UNPKG

setup-cpp

Version:

Install all the tools required for building and testing C++/C projects.

18 lines 56.2 kB
import*as path from"path";import path__default,{join}from"path";import{fileURLToPath}from"url";import{r as requireSemver,c as commonjsGlobal,a as coreExports,e as execExports,t as toolCacheExports,H as HttpClient,i as info,b as ciInfo,p as pathExists,w as warning}from"../setup-cpp.mjs";import require$$0$2 from"fs";import require$$0$1 from"stream";import*as require$$0 from"os";import"process";import"https";import"crypto";import"http";import"net";import"tls";import"events";import"util";import"string_decoder";import"child_process";import"assert";import"timers";import"node:buffer";import"node:path";import"node:child_process";import"node:process";import"node:url";import"node:os";import"node:fs";import"buffer";import"node:util";import"fs/promises";import"constants";import"console";var semverExports=requireSemver(),toml={},parse={exports:{}},tomlParser={exports:{}},parser,hasRequiredParser;function requireParser(){if(hasRequiredParser)return parser;hasRequiredParser=1;const e=1114112;class r extends Error{constructor(i,l,a){super("[ParserError] "+i,l,a),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,r)}}class o{constructor(i){this.parser=i,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}}class t{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new o(this.parseStart)}parse(i){if(i.length===0||i.length==null)return;this._buf=String(i),this.ii=-1,this.char=-1;let l;for(;l===!1||this.nextChar();)l=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=e;let i;do i=this.state.parser,this.runOne();while(this.state.parser!==i);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(i){if(typeof i!="function")throw new r("Tried to set state to non-existent state: "+JSON.stringify(i));this.state.parser=i}goto(i){return this.next(i),this.runOne()}call(i,l){l&&this.next(l),this.stack.push(this.state),this.state=new o(i)}callNow(i,l){return this.call(i,l),this.runOne()}return(i){if(this.stack.length===0)throw this.error(new r("Stack underflow"));i===void 0&&(i=this.state.buf),this.state=this.stack.pop(),this.state.returned=i}returnNow(i){return this.return(i),this.runOne()}consume(){if(this.char===e)throw this.error(new r("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(i){return i.line=this.line,i.col=this.col,i.pos=this.pos,i}parseStart(){throw new r("Must declare a parseStart method")}}return t.END=e,t.Error=r,parser=t,parser}var createDatetime,hasRequiredCreateDatetime;function requireCreateDatetime(){return hasRequiredCreateDatetime||(hasRequiredCreateDatetime=1,createDatetime=e=>{const r=new Date(e);if(isNaN(r))throw new TypeError("Invalid Datetime");return r}),createDatetime}var formatNum,hasRequiredFormatNum;function requireFormatNum(){return hasRequiredFormatNum||(hasRequiredFormatNum=1,formatNum=(e,r)=>{for(r=String(r);r.length<e;)r="0"+r;return r}),formatNum}var createDatetimeFloat,hasRequiredCreateDatetimeFloat;function requireCreateDatetimeFloat(){if(hasRequiredCreateDatetimeFloat)return createDatetimeFloat;hasRequiredCreateDatetimeFloat=1;const e=requireFormatNum();class r extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){const t=`${this.getUTCFullYear()}-${e(2,this.getUTCMonth()+1)}-${e(2,this.getUTCDate())}`,n=`${e(2,this.getUTCHours())}:${e(2,this.getUTCMinutes())}:${e(2,this.getUTCSeconds())}.${e(3,this.getUTCMilliseconds())}`;return`${t}T${n}`}}return createDatetimeFloat=o=>{const t=new r(o);if(isNaN(t))throw new TypeError("Invalid Datetime");return t},createDatetimeFloat}var createDate,hasRequiredCreateDate;function requireCreateDate(){if(hasRequiredCreateDate)return createDate;hasRequiredCreateDate=1;const e=requireFormatNum(),r=commonjsGlobal.Date;class o extends r{constructor(n){super(n),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${e(2,this.getUTCMonth()+1)}-${e(2,this.getUTCDate())}`}}return createDate=t=>{const n=new o(t);if(isNaN(n))throw new TypeError("Invalid Datetime");return n},createDate}var createTime,hasRequiredCreateTime;function requireCreateTime(){if(hasRequiredCreateTime)return createTime;hasRequiredCreateTime=1;const e=requireFormatNum();class r extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${e(2,this.getUTCHours())}:${e(2,this.getUTCMinutes())}:${e(2,this.getUTCSeconds())}.${e(3,this.getUTCMilliseconds())}`}}return createTime=o=>{const t=new r(o);if(isNaN(t))throw new TypeError("Invalid Datetime");return t},createTime}var hasRequiredTomlParser;function requireTomlParser(){if(hasRequiredTomlParser)return tomlParser.exports;hasRequiredTomlParser=1,tomlParser.exports=makeParserClass(requireParser()),tomlParser.exports.makeParserClass=makeParserClass;class TomlError extends Error{constructor(r){super(r),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,TomlError),this.fromTOML=!0,this.wrapped=null}}TomlError.wrap=e=>{const r=new TomlError(e.message);return r.code=e.code,r.wrapped=e,r},tomlParser.exports.TomlError=TomlError;const createDateTime=requireCreateDatetime(),createDateTimeFloat=requireCreateDatetimeFloat(),createDate=requireCreateDate(),createTime=requireCreateTime(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:` `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}const _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,r){return hasOwnProperty.call(e,r)?!0:(r==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}const INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}const TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}const _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}const LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}let _custom;try{const utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}const _inspect=_custom||"inspect";class BoxedBigInt{constructor(r){try{this.value=commonjsGlobal.BigInt.asIntN(64,r)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}}const INTEGER=Symbol("integer");function Integer(e){let r=Number(e);return Object.is(r,-0)&&(r=0),commonjsGlobal.BigInt&&!Number.isSafeInteger(r)?new BoxedBigInt(e):Object.defineProperties(new Number(r),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}const FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){const r=typeof e;if(r==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return r}function makeParserClass(e){class r extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(t){let n=this.ctx,i=t.key.pop();for(let l of t.key){if(hasKey(n,l)&&!isTable(n[l]))throw this.error(new TomlError("Can't redefine existing key"));n=n[l]=n[l]||Table()}if(hasKey(n,i))throw this.error(new TomlError("Can't redefine existing key"));return n[_declared]=!0,isInteger(t.value)||isFloat(t.value)?n[i]=t.value.valueOf():n[i]=t.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(t){return this.state.resultTable?this.state.resultTable.push(t):this.state.resultTable=[t],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(t){return this.returnNow({key:this.state.resultTable,value:t})}parseComment(){do{if(this.char===e.END||this.char===CTRL_J)return this.return();if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("comments")}while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(t){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,t)&&(!isTable(this.ctx[t])||this.ctx[t][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[t]=this.ctx[t]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,t))this.ctx=this.ctx[t]=Table();else if(isTable(this.ctx[t]))this.ctx=this.ctx[t];else if(isList(this.ctx[t]))this.ctx=this.ctx[t][this.ctx[t].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(t){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,t)||(this.ctx[t]=List()),isInlineList(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[t])){const n=Table();this.ctx[t].push(n),this.ctx=n}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,t))this.ctx=this.ctx[t]=Table();else{if(isInlineList(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[t]))this.ctx=this.ctx[t][this.ctx[t].length-1];else if(isTable(this.ctx[t]))this.ctx=this.ctx[t];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(t){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(t){return this.returnNow(t)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd3):(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd3(){return this.char===CHAR_APOS?(this.state.buf+="'",this.next(this.parseLiteralMultiEnd4)):this.returnNow()}parseLiteralMultiEnd4(){return this.char===CHAR_APOS?(this.state.buf+="'",this.return()):this.returnNow()}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}recordEscapeReplacement(t){return this.state.buf+=t,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}errorControlCharIn(t){let n="\\u00";return this.char<16&&(n+="0"),n+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${t}, use ${n} instead`))}recordMultiEscapeReplacement(t){return this.state.buf+=t,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd3):(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEnd3(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.next(this.parseMultiEnd4)):this.returnNow()}parseMultiEnd4(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.return()):this.returnNow()}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(t){try{const n=parseInt(t,16);if(n>=SURROGATE_FIRST&&n<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(n))}catch(n){throw this.error(TomlError.wrap(n))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(t){return this.state.resultArr||(this.state.resultArr=InlineList(tomlType(t))),isFloat(t)||isInteger(t)?this.state.resultArr.push(t.valueOf()):this.state.resultArr.push(t),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(t){let n=this.state.resultTable,i=t.key.pop();for(let l of t.key){if(hasKey(n,l)&&(!isTable(n[l])||n[l][_declared]))throw this.error(new TomlError("Can't redefine existing key"));n=n[l]=n[l]||Table()}if(hasKey(n,i))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(t.value)||isFloat(t.value)?n[i]=t.value.valueOf():n[i]=t.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTablePostComma);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTablePostComma(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)throw this.error(new TomlError("Empty elements in inline tables are not permitted"));if(this.char===CHAR_RCUB)throw this.error(new TomlError("Trailing commas in inline tables are not permitted"));return this.goto(this.parseInlineTable)}}return r}return tomlParser.exports}var parsePrettyError,hasRequiredParsePrettyError;function requireParsePrettyError(){if(hasRequiredParsePrettyError)return parsePrettyError;hasRequiredParsePrettyError=1,parsePrettyError=e;function e(r,o){if(r.pos==null||r.line==null)return r;let t=r.message;if(t+=` at row ${r.line+1}, col ${r.col+1}, pos ${r.pos}: `,o&&o.split){const n=o.split(/\n/),i=String(Math.min(n.length,r.line+3)).length;let l=" ";for(;l.length<i;)l+=" ";for(let a=Math.max(0,r.line-1);a<Math.min(n.length,r.line+2);++a){let c=String(a+1);if(c.length<i&&(c=" "+c),r.line===a){t+=c+"> "+n[a]+` `,t+=l+" ";for(let p=0;p<r.col;++p)t+=" ";t+=`^ `}else t+=c+": "+n[a]+` `}}return r.message=t+` `,r}return parsePrettyError}var parseString_1,hasRequiredParseString;function requireParseString(){if(hasRequiredParseString)return parseString_1;hasRequiredParseString=1,parseString_1=o;const e=requireTomlParser(),r=requireParsePrettyError();function o(t){commonjsGlobal.Buffer&&commonjsGlobal.Buffer.isBuffer(t)&&(t=t.toString("utf8"));const n=new e;try{return n.parse(t),n.finish()}catch(i){throw r(i,t)}}return parseString_1}var parseAsync_1,hasRequiredParseAsync;function requireParseAsync(){if(hasRequiredParseAsync)return parseAsync_1;hasRequiredParseAsync=1,parseAsync_1=o;const e=requireTomlParser(),r=requireParsePrettyError();function o(t,n){n||(n={});const i=0,l=n.blocksize||40960,a=new e;return new Promise((p,d)=>{setImmediate(c,i,l,p,d)});function c(p,d,f,y){if(p>=t.length)try{return f(a.finish())}catch(m){return y(r(m,t))}try{a.parse(t.slice(p,p+d)),setImmediate(c,p+d,d,f,y)}catch(m){y(r(m,t))}}}return parseAsync_1}var parseStream_1,hasRequiredParseStream;function requireParseStream(){if(hasRequiredParseStream)return parseStream_1;hasRequiredParseStream=1,parseStream_1=o;const e=require$$0$1,r=requireTomlParser();function o(i){return i?t(i):n()}function t(i){const l=new r;return i.setEncoding("utf8"),new Promise((a,c)=>{let p,d=!1,f=!1;function y(){if(d=!0,!p)try{a(l.finish())}catch(R){c(R)}}function m(R){f=!0,c(R)}i.once("end",y),i.once("error",m),_();function _(){p=!0;let R;for(;(R=i.read())!==null;)try{l.parse(R)}catch(E){return m(E)}if(p=!1,d)return y();f||i.once("readable",_)}})}function n(){const i=new r;return new e.Transform({objectMode:!0,transform(l,a,c){try{i.parse(l.toString(a))}catch(p){this.emit("error",p)}c()},flush(l){try{this.push(i.finish())}catch(a){this.emit("error",a)}l()}})}return parseStream_1}var hasRequiredParse;function requireParse(){return hasRequiredParse||(hasRequiredParse=1,parse.exports=requireParseString(),parse.exports.async=requireParseAsync(),parse.exports.stream=requireParseStream(),parse.exports.prettyError=requireParsePrettyError()),parse.exports}var stringify={exports:{}},hasRequiredStringify;function requireStringify(){if(hasRequiredStringify)return stringify.exports;hasRequiredStringify=1,stringify.exports=e,stringify.exports.value=R;function e(s){if(s===null)throw r("null");if(s===void 0)throw r("undefined");if(typeof s!="object")throw r(typeof s);if(typeof s.toJSON=="function"&&(s=s.toJSON()),s==null)return null;const h=a(s);if(h!=="table")throw r(h);return i("","",s)}function r(s){return new Error("Can only stringify objects, not "+s)}function o(s){return Object.keys(s).filter(h=>l(s[h]))}function t(s){return Object.keys(s).filter(h=>!l(s[h]))}function n(s){let h=Array.isArray(s)?[]:Object.prototype.hasOwnProperty.call(s,"__proto__")?{["__proto__"]:void 0}:{};for(let u of Object.keys(s))s[u]&&typeof s[u].toJSON=="function"&&!("toISOString"in s[u])?h[u]=s[u].toJSON():h[u]=s[u];return h}function i(s,h,u){u=n(u);let x,C;x=o(u),C=t(u);const T=[],g=h||"";x.forEach(A=>{var P=a(u[A]);P!=="undefined"&&P!=="null"&&T.push(g+c(A)+" = "+_(u[A],!0))}),T.length>0&&T.push("");const w=s&&x.length>0?h+" ":"";return C.forEach(A=>{T.push(O(s,w,A,u[A]))}),T.join(` `)}function l(s){switch(a(s)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return s.length===0||a(s[0])!=="table";case"table":return Object.keys(s).length===0;default:return!1}}function a(s){return s===void 0?"undefined":s===null?"null":typeof s=="bigint"||Number.isInteger(s)&&!Object.is(s,-0)?"integer":typeof s=="number"?"float":typeof s=="boolean"?"boolean":typeof s=="string"?"string":"toISOString"in s?isNaN(s)?"undefined":"datetime":Array.isArray(s)?"array":"table"}function c(s){const h=String(s);return/^[-A-Za-z0-9_]+$/.test(h)?h:p(h)}function p(s){return'"'+y(s).replace(/"/g,'\\"')+'"'}function d(s){return"'"+s+"'"}function f(s,h){for(;h.length<s;)h="0"+h;return h}function y(s){return s.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/([\u0000-\u001f\u007f])/,h=>"\\u"+f(4,h.codePointAt(0).toString(16)))}function m(s){let h=s.split(/\n/).map(u=>y(u).replace(/"(?="")/g,'\\"')).join(` `);return h.slice(-1)==='"'&&(h+=`\\ `),`""" `+h+'"""'}function _(s,h){let u=a(s);return u==="string"&&(h&&/\n/.test(s)?u="string-multiline":!/[\b\t\n\f\r']/.test(s)&&/"/.test(s)&&(u="string-literal")),R(s,u)}function R(s,h){switch(h||(h=a(s)),h){case"string-multiline":return m(s);case"string":return p(s);case"string-literal":return d(s);case"integer":return E(s);case"float":return S(s);case"boolean":return N(s);case"datetime":return I(s);case"array":return H(s.filter(u=>a(u)!=="null"&&a(u)!=="undefined"&&a(u)!=="nan"));case"table":return b(s);default:throw r(h)}}function E(s){return String(s).replace(/\B(?=(\d{3})+(?!\d))/g,"_")}function S(s){if(s===1/0)return"inf";if(s===-1/0)return"-inf";if(Object.is(s,NaN))return"nan";if(Object.is(s,-0))return"-0.0";const[h,u]=String(s).split(".");return E(h)+"."+u}function N(s){return String(s)}function I(s){return s.toISOString()}function H(s){s=n(s);let h="[";const u=s.map(x=>R(x));return u.join(", ").length>60||/\n/.test(u)?h+=` `+u.join(`, `)+` `:h+=" "+u.join(", ")+(u.length>0?" ":""),h+"]"}function b(s){s=n(s);const h=[];return Object.keys(s).forEach(u=>{h.push(c(u)+" = "+_(s[u],!1))}),"{ "+h.join(", ")+(h.length>0?" ":"")+"}"}function O(s,h,u,x){const C=a(x);if(C==="array")return L(s,h,u,x);if(C==="table")return D(s,h,u,x);throw r(C)}function L(s,h,u,x){x=n(x);const C=a(x[0]);if(C!=="table")throw r(C);const T=s+c(u);let g="";return x.forEach(w=>{g.length>0&&(g+=` `),g+=h+"[["+T+`]] `,g+=i(T+".",h,w)}),g}function D(s,h,u,x){const C=s+c(u);let T="";return o(x).length>0&&(T+=h+"["+C+`] `),T+i(C+".",h,x)}return stringify.exports}var hasRequiredToml;function requireToml(){return hasRequiredToml||(hasRequiredToml=1,toml.parse=requireParse(),toml.stringify=requireStringify()),toml}requireToml();const IS_WINDOWS=process.platform==="win32",IS_LINUX=process.platform==="linux",IS_MAC=process.platform==="darwin",WINDOWS_ARCHS=["x86","x64"],WINDOWS_PLATFORMS=["win32","win64"],PYPY_VERSION_FILE="PYPY_VERSION";function createSymlinkInFolder(e,r,o,t=!1){const n=path.join(e,r),i=path.join(e,o);require$$0$2.existsSync(i)||(require$$0$2.symlinkSync(n,i),!IS_WINDOWS&&t&&require$$0$2.chmodSync(i,"755"))}function validateVersion(e){return isNightlyKeyword(e)||!!semverExports.validRange(e)}function isNightlyKeyword(e){return e==="nightly"}function getPyPyVersionFromPath(e){return path.basename(path.dirname(e))}function readExactPyPyVersionFile(e){let r="";const o=path.join(e,PYPY_VERSION_FILE);return require$$0$2.existsSync(o)&&(r=require$$0$2.readFileSync(o).toString().trim()),r}function writeExactPyPyVersionFile(e,r){const o=path.join(e,PYPY_VERSION_FILE);require$$0$2.writeFileSync(o,r)}function validatePythonVersionFormatForPyPy(e){return/^\d+\.\d+$/.test(e)}async function getWindowsInfo(){const{stdout:e}=await execExports.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',void 0,{silent:!0});return{osName:"Windows",osVersion:e.trim().split(" ")[3]}}async function getMacOSInfo(){const{stdout:e}=await execExports.getExecOutput("sw_vers",["-productVersion"],{silent:!0});return{osName:"macOS",osVersion:e.trim()}}async function getLinuxInfo(){const{stdout:e}=await execExports.getExecOutput("lsb_release",["-i","-r","-s"],{silent:!0}),[r,o]=e.trim().split(` `);return coreExports.debug(`OS Name: ${r}, Version: ${o}`),{osName:r,osVersion:o}}async function getOSInfo(){let e;try{IS_WINDOWS?e=await getWindowsInfo():IS_LINUX?e=await getLinuxInfo():IS_MAC&&(e=await getMacOSInfo())}catch(r){const o=r;coreExports.debug(o.message)}finally{return e}}function getBinaryDirectory(e){return IS_WINDOWS?e:path.join(e,"bin")}function getDownloadFileName(e){const r=process.env.RUNNER_TEMP||".";return IS_WINDOWS?path.join(r,path.basename(e)):void 0}async function installPyPy(e,r,o,t,n){let i;if(n=n??await getAvailablePyPyVersions(),!n||n.length===0)throw new Error("No release was found in PyPy version.json");let l=findRelease(n,r,e,o,!1);if(!l||!l.foundAsset)throw new Error(`PyPy version ${r} (${e}) with arch ${o} not found`);const{foundAsset:a,resolvedPythonVersion:c,resolvedPyPyVersion:p}=l,d=`${a.download_url}`;coreExports.info(`Downloading PyPy from "${d}" ...`);try{const f=getDownloadFileName(d),y=await toolCacheExports.downloadTool(d,f);coreExports.info("Extracting downloaded archive..."),IS_WINDOWS?i=await toolCacheExports.extractZip(y):i=await toolCacheExports.extractTar(y,void 0,"x");const m=require$$0$2.readdirSync(i)[0],_=path.join(i,m);let R=_;isNightlyKeyword(p)||(R=await toolCacheExports.cacheDir(_,"PyPy",c,o)),writeExactPyPyVersionFile(R,p);const E=getBinaryDirectory(R);return await createPyPySymlink(E,c),await installPip(E),{installDir:R,resolvedPythonVersion:c,resolvedPyPyVersion:p}}catch(f){throw f instanceof Error&&(f instanceof toolCacheExports.HTTPError&&(f.httpStatusCode===403||f.httpStatusCode===429)?coreExports.info(`Received HTTP status code ${f.httpStatusCode}. This usually indicates the rate limit has been exceeded`):coreExports.info(f.message),f.stack!==void 0&&coreExports.debug(f.stack)),f}}async function getAvailablePyPyVersions(){const e="https://downloads.python.org/pypy/versions.json",o=await new HttpClient("tool-cache").getJson(e);if(!o.result)throw new Error(`Unable to retrieve the list of available PyPy versions from '${e}'`);return o.result}async function createPyPySymlink(e,r){const o=semverExports.coerce(r),t=semverExports.major(o),n=semverExports.minor(o),i=t===2?"":"3",l=`${t}.${n}`,a=IS_WINDOWS?".exe":"";coreExports.info("Creating symlinks..."),createSymlinkInFolder(e,`pypy${i}${a}`,`python${t}${a}`,!0),createSymlinkInFolder(e,`pypy${i}${a}`,`python${a}`,!0),createSymlinkInFolder(e,`pypy${i}${a}`,`pypy${l}${a}`,!0)}async function installPip(e){coreExports.info("Installing and updating pip");const r=path.join(e,"python");await execExports.exec(`${r} -m ensurepip`),await execExports.exec(`${e}/python -m pip install --ignore-installed pip`)}function findRelease(e,r,o,t,n){const i={includePrerelease:n},l=e.filter(d=>{const f=semverExports.satisfies(semverExports.coerce(d.python_version),r),m=isNightlyKeyword(o)&&isNightlyKeyword(d.pypy_version)||semverExports.satisfies(pypyVersionToSemantic(d.pypy_version),o,i),_=d.files&&(IS_WINDOWS?isArchPresentForWindows(d,t):isArchPresentForMacOrLinux(d,t,process.platform));return f&&m&&_});if(l.length===0)return null;const c=l.sort((d,f)=>semverExports.compare(semverExports.coerce(pypyVersionToSemantic(f.pypy_version)),semverExports.coerce(pypyVersionToSemantic(d.pypy_version)))||semverExports.compare(semverExports.coerce(f.python_version),semverExports.coerce(d.python_version)))[0];return{foundAsset:IS_WINDOWS?findAssetForWindows(c,t):findAssetForMacOrLinux(c,t,process.platform),resolvedPythonVersion:c.python_version,resolvedPyPyVersion:c.pypy_version.trim()}}function pypyVersionToSemantic(e){const r=/(\d+\.\d+\.\d+)((?:a|b|rc))(\d*)/g;return e.replace(r,"$1-$2.$3")}function isArchPresentForWindows(e,r){return r=replaceX32toX86(r),e.files.some(o=>WINDOWS_PLATFORMS.includes(o.platform)&&o.arch===r)}function isArchPresentForMacOrLinux(e,r,o){return e.files.some(t=>t.arch===r&&t.platform===o)}function findAssetForWindows(e,r){return r=replaceX32toX86(r),e.files.find(o=>WINDOWS_PLATFORMS.includes(o.platform)&&o.arch===r)}function findAssetForMacOrLinux(e,r,o){return e.files.find(t=>t.arch===r&&t.platform===o)}function replaceX32toX86(e){return e==="x32"&&(e="x86"),e}async function findPyPyVersion(e,r,o,t,n){let i="",l="",a,c;const p=parsePyPyVersion(e);({installDir:a,resolvedPythonVersion:l,resolvedPyPyVersion:i}=findPyPyToolCache(p.pythonVersion,p.pypyVersion,r)),a||({installDir:a,resolvedPythonVersion:l,resolvedPyPyVersion:i}=await installPyPy(p.pypyVersion,p.pythonVersion,r,n,c));const d=IS_WINDOWS?"Scripts":"bin",f=path.join(a,d),y=IS_WINDOWS?".exe":"",m=path.join(IS_WINDOWS?a:f,`python${y}`),_=getBinaryDirectory(a);return coreExports.exportVariable("pythonLocation",a),coreExports.exportVariable("Python_ROOT_DIR",a),coreExports.exportVariable("Python2_ROOT_DIR",a),coreExports.exportVariable("Python3_ROOT_DIR",a),coreExports.exportVariable("PKG_CONFIG_PATH",_+"/lib/pkgconfig"),coreExports.addPath(_),coreExports.addPath(f),coreExports.setOutput("python-version","pypy"+i),coreExports.setOutput("python-path",m),{resolvedPyPyVersion:i,resolvedPythonVersion:l}}function findPyPyToolCache(e,r,o){let t="",n="",i=IS_WINDOWS?findPyPyInstallDirForWindows(e):toolCacheExports.find("PyPy",e,o);return i&&(n=getPyPyVersionFromPath(i),t=readExactPyPyVersionFile(i),semverExports.satisfies(t,r)||(i=null,t="",n="")),i||coreExports.info(`PyPy version ${e} (${r}) was not found in the local cache`),{installDir:i,resolvedPythonVersion:n,resolvedPyPyVersion:t}}function parsePyPyVersion(e){const r=e.split("-").filter(n=>!!n);if(/^(pypy)(.+)/.test(r[0])){const n=r[0].replace("pypy","");r.splice(0,1,"pypy",n)}if(r.length<2||r[0]!="pypy")throw new Error("Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy<python-version>' or 'pypy-<python-version>'. See README for examples and documentation.");const o=r[1];let t;if(r.length>2?t=pypyVersionToSemantic(r[2]):t="x",!validateVersion(o)||!validateVersion(t))throw new Error("Invalid 'version' property for PyPy. B