From 6d4d1e394e5b0116de360cabd70c747f6b5507fc Mon Sep 17 00:00:00 2001 From: Li Jie Date: Sat, 22 Aug 2026 05:52:38 +0800 Subject: [PATCH] fix: render platforms without paired baselines --- dist/index.js | 2 +- publish/dist/index.js | 2 +- src/artifact.js | 14 ++++++++----- src/report.js | 9 +++++++- test/artifact.test.js | 43 +++++++++++++++++++++++++++++++++++++-- test/store-report.test.js | 40 ++++++++++++++++++++++++++++++++++++ 6 files changed, 100 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index ab44b2c..26805e3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -(()=>{var e={2047:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);const{URL:r}=B(3136);const{benchmarkKey:i}=B(8817);const{loadSnapshot:a}=B(1283);const{assert:o,compareText:l,hasControl:c,median:C,safePart:u,walkFiles:f,writeJSON:h}=B(8793);const p=1;function validLabel(e,t,B=160){o(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e&&!c(e),`${t} must be a trimmed string of 1..${B} bytes`)}function validURL(e,t){let B;try{B=new r(e)}catch{throw new Error(`invalid ${t} ${JSON.stringify(e)}`)}o(B.protocol==="https:"&&B.hostname&&!B.username&&!B.password&&!/[<>\r\n]/u.test(e),`invalid ${t} ${JSON.stringify(e)}`)}function validUnit(e){return typeof e==="string"&&Buffer.byteLength(e)>=1&&Buffer.byteLength(e)<=64&&!c(e)&&!/[\s`|<>]/u.test(e)}function validBenchmarkName(e){return typeof e==="string"&&e.startsWith("Benchmark")&&e.length>"Benchmark".length&&Buffer.byteLength(e)<=300&&!c(e)&&!/[\s`|<>]/u.test(e)}function validateMeasurements(e,t){o(t&&typeof t==="object"&&!Array.isArray(t)&&Object.keys(t).length>=1&&Object.keys(t).length<=32,`benchmark ${JSON.stringify(e)} has an invalid measurement count`);for(const[B,s]of Object.entries(t)){o(validUnit(B),`benchmark ${JSON.stringify(e)} has invalid unit ${JSON.stringify(B)}`);o(typeof s==="number"&&Number.isFinite(s)&&s>=0,`benchmark ${JSON.stringify(e)} unit ${JSON.stringify(B)} has invalid value`)}}function validateResult(e,t,B={}){const s=B.trustedLayout??true;const n=s?t.maxBenchmarks:5e3;o(e?.schemaVersion===p,`unsupported result schema ${e?.schemaVersion}`);o(e.suiteId===t.id,`suite id ${JSON.stringify(e.suiteId)} does not match config ${JSON.stringify(t.id)}`);o(u(e.shardId),`invalid shard id ${JSON.stringify(e.shardId)}`);o(e.samplePairing===undefined||e.samplePairing==="index",`invalid sample pairing ${JSON.stringify(e.samplePairing)}`);o(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(e.source?.repository),`invalid source repository ${JSON.stringify(e.source?.repository)}`);o(/^[0-9a-f]{40}$/u.test(e.source.sha),`invalid source SHA ${JSON.stringify(e.source.sha)}`);validURL(e.source.url,"source URL");if(e.source.runUrl)validURL(e.source.runUrl,"run URL");o(typeof e.source.timestamp==="string"&&!Number.isNaN(Date.parse(e.source.timestamp)),"source timestamp is invalid");o(u(e.platform?.id),`invalid platform id ${JSON.stringify(e.platform?.id)}`);validLabel(e.platform.label,"platform label");o(Array.isArray(e.benchmarks)&&e.benchmarks.length>=1&&e.benchmarks.length<=n,`benchmark count is outside 1..${n}`);o(Object.keys(e.units??{}).length<=64,"unit metadata count exceeds 64");for(const[t,B]of Object.entries(e.units??{})){o(validUnit(t),`invalid metadata unit ${JSON.stringify(t)}`);o(B.better===undefined||B.better==="higher"||B.better==="lower",`unit ${t} has invalid better value`);o(B.assume===undefined||B.assume==="nothing"||B.assume==="exact",`unit ${t} has invalid assume value`)}const r=new Set;for(const B of e.benchmarks){o(validBenchmarkName(B.name),`invalid benchmark name ${JSON.stringify(B.name)}`);o(!B.package||/^[A-Za-z0-9._~+/-]+$/u.test(B.package),`benchmark ${B.name} has invalid package ${JSON.stringify(B.package)}`);const e=i(B);o(!r.has(e),`duplicate benchmark ${JSON.stringify(e)}`);r.add(e);if(s){o(t.includeBenchmark(B.name,e),`benchmark ${JSON.stringify(e)} is excluded by trusted config`);const s=t.layoutFor(B.name,e);o(B.group===s.group&&B.chart===s.chart,`benchmark ${JSON.stringify(e)} layout does not match trusted config`)}else{o(B.group==="other"||u(B.group)&&B.group===B.group.toLowerCase(),`benchmark ${JSON.stringify(e)} has invalid stored group`);o(B.chart===`group:${B.group}`||B.chart===`benchmark:${e}`,`benchmark ${JSON.stringify(e)} has invalid stored chart`)}o(Array.isArray(B.samples)&&B.samples.length>=1&&B.samples.length<=100,`benchmark ${JSON.stringify(e)} sample count is outside 1..100`);const n=new Map;for(const t of B.samples){o(Number.isSafeInteger(t.iterations)&&t.iterations>0,`benchmark ${JSON.stringify(e)} has invalid iterations`);validateMeasurements(e,t.measurements);for(const[e,B]of Object.entries(t.measurements)){if(!n.has(e))n.set(e,[]);n.get(e).push(B)}}validateMeasurements(e,B.measurements);o(n.size===Object.keys(B.measurements).length,`benchmark ${JSON.stringify(e)} sample and summary units do not match`);for(const[t,s]of Object.entries(B.measurements)){o(n.has(t)&&s===C(n.get(t)),`benchmark ${JSON.stringify(e)} unit ${JSON.stringify(t)} summary is not the sample median`)}}return e}function validateSamplePairing(e,t){if(e.samplePairing===undefined&&t?.samplePairing===undefined){return}o(e.samplePairing==="index"&&t?.samplePairing==="index","index sample pairing requires a paired baseline");const B=new Map(t.benchmarks.map(e=>[i(e),e]));o(e.benchmarks.length===t.benchmarks.length,"index-paired result and baseline benchmark counts differ");for(const t of e.benchmarks){const e=i(t);const s=B.get(e);o(s,`index-paired baseline is missing benchmark ${JSON.stringify(e)}`);o(t.samples.length===s.samples.length,`index-paired benchmark ${JSON.stringify(e)} sample counts differ`);for(let B=0;B{const t=JSON.parse(s.readFileSync(e,"utf8"));try{validateResult(t,B);const r=n.join(n.dirname(e),"baseline.json");if(s.existsSync(r)){const e=validateResult(JSON.parse(s.readFileSync(r,"utf8")),B);o(e.shardId===t.shardId,`baseline shard ${JSON.stringify(e.shardId)} does not match result shard ${JSON.stringify(t.shardId)}`);o(JSON.stringify(e.platform)===JSON.stringify(t.platform),`baseline platform does not match result platform ${JSON.stringify(t.platform.id)}`);validateSamplePairing(t,e);l.push(e)}return t}catch(t){throw new Error(`${e}: ${t.message}`,{cause:t})}});o(l.length===0||l.length===c.length,"same-runner baseline must be present for every result artifact");return{config:B,results:mergeShards(c),baselines:l.length===0?[]:mergeShards(l)}}function mergeMetadata(e,t,B){for(const[s,n]of Object.entries(t??{})){if(e[s]){o(JSON.stringify(e[s])===JSON.stringify(n),`platform ${B} has conflicting metadata for ${s}`)}else{e[s]=n}}}function mergeShards(e){o(e.length>=1&&e.length<=256,"shard count is outside 1..256");const t=e[0];const B=`${t.source.repository}@${t.source.sha}`;const s=new Set;const n=new Map;for(const t of e){o(`${t.source.repository}@${t.source.sha}`===B,`shard ${t.shardId} source does not match ${B}`);const e=`${t.platform.id}/${t.shardId}`;o(!s.has(e),`duplicate shard ${JSON.stringify(e)}`);s.add(e);let r=n.get(t.platform.id);if(!r){r={...t,shardId:"merged",units:{},benchmarks:[]};n.set(t.platform.id,r)}else{o(JSON.stringify(r.platform)===JSON.stringify(t.platform),`platform ${t.platform.id} metadata differs between shards`);o(r.samplePairing===t.samplePairing,`platform ${t.platform.id} sample pairing differs between shards`)}mergeMetadata(r.units,t.units,t.platform.id);const a=new Set(r.benchmarks.map(i));for(const e of t.benchmarks){const B=i(e);o(!a.has(B),`platform ${t.platform.id} repeats benchmark ${JSON.stringify(B)} across shards`);a.add(B);r.benchmarks.push(e)}if(Date.parse(t.source.timestamp)>Date.parse(r.source.timestamp)){r.source=t.source}}return[...n.values()].map(e=>({...e,benchmarks:e.benchmarks.toSorted((e,t)=>l(i(e),i(t)))})).sort((e,t)=>l(e.platform.id,t.platform.id))}e.exports={loadArtifacts:loadArtifacts,mergeShards:mergeShards,schemaVersion:p,validateResult:validateResult,writeArtifact:writeArtifact}},6247:(e,t,B)=>{"use strict";const s=B(3024);const n=B(8161);const r=B(6760);const{parseArgs:i}=B(7975);const{loadArtifacts:a,validateResult:o,writeArtifact:l,schemaVersion:c}=B(2047);const{loadConfig:C}=B(1283);const{parseGoBenchmark:u}=B(8817);const{writeReport:f}=B(8959);const{entryFromResults:h,update:p}=B(7864);const{assert:g,safePart:m,writeOutputs:d}=B(8793);function options(e,t){const B=i({args:e,options:Object.fromEntries(Object.keys(t).map(e=>[e,{type:"string"}])),strict:true});return B.values}function required(e,t,B){for(const s of t){g(e[s],`${B} requires --${s}`)}}function goOS(){return{win32:"windows"}[process.platform]??process.platform}function goArch(){return{x64:"amd64",ia32:"386"}[process.arch]??process.arch}function displayOS(e){return{darwin:"macOS",linux:"Linux",windows:"Windows"}[e]??e}function githubEvent(){const e=process.env.GITHUB_EVENT_PATH;if(!e)return{};try{return JSON.parse(s.readFileSync(e,"utf8"))}catch(t){throw new Error(`read GitHub event ${e}: ${t.message}`,{cause:t})}}function sourceDefaults(){const e=githubEvent();const t=e.pull_request?.head;return{repository:t?.repo?.full_name||process.env.GITHUB_REPOSITORY||"",sha:t?.sha||process.env.GITHUB_SHA||"",ref:t?.ref||process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME||process.env.GITHUB_REF||""}}function baselineSourceDefaults(){const e=githubEvent().pull_request?.base;return{repository:e?.repo?.full_name||"",sha:e?.sha||"",ref:e?.ref||""}}function serverURL(){return(process.env.GITHUB_SERVER_URL||"https://github.com").replace(/\/+$/u,"")}function defaultSourceURL(e,t){return`${serverURL()}/${e}/commit/${t}`}function defaultRunURL(){return process.env.GITHUB_RUN_ID&&process.env.GITHUB_REPOSITORY?`${serverURL()}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`:""}function defaultTemporaryDirectory(e){const t=process.env.RUNNER_TEMP||n.tmpdir();s.mkdirSync(t,{recursive:true});return s.mkdtempSync(r.join(t,e))}function runRecord(e,t={}){const B=options(e,{config:true,input:true,"baseline-input":true,"baseline-repository":true,"baseline-sha":true,"baseline-ref":true,"sample-pairing":true,"output-dir":true,"platform-id":true,"platform-label":true,"shard-id":true,os:true,arch:true,runner:true,repository:true,sha:true,ref:true,"source-url":true,"run-url":true,timestamp:true,"github-output":true});required(B,["config","input"],"record");const n=C(B.config);const r=u(s.readFileSync(B.input,"utf8"),n);const i=B.os||r.fileConfig.goos||goOS();const a=B.arch||r.fileConfig.goarch||goArch();const o=B["platform-id"]||`${i}-${a}`;const f=B["shard-id"]||process.env.GITHUB_JOB||"default";g(m(o),`invalid platform id ${JSON.stringify(o)}`);g(m(f),`invalid shard id ${JSON.stringify(f)}`);const h=sourceDefaults();const p=B.repository||h.repository;const D=B.sha||h.sha;const E=B["source-url"]||defaultSourceURL(p,D);const y=B["run-url"]||defaultRunURL();const b=B.timestamp||(new Date).toISOString();const O={id:o,label:B["platform-label"]||`${displayOS(i)} / ${a}`,os:i,arch:a,...B.runner?{runner:B.runner}:{}};const w={schemaVersion:c,suiteId:n.id,shardId:f,...B["sample-pairing"]?{samplePairing:B["sample-pairing"]}:{},source:{repository:p,sha:D,...B.ref||h.ref?{ref:B.ref||h.ref}:{},url:E,...y?{runUrl:y}:{},timestamp:b},platform:O,units:r.units,benchmarks:r.benchmarks};let S=null;if(B["baseline-input"]){const e=baselineSourceDefaults();const t=B["baseline-repository"]||e.repository;const r=B["baseline-sha"]||e.sha;const i=B["baseline-ref"]||e.ref;g(t&&r,"baseline repository and SHA are required with --baseline-input");const a=u(s.readFileSync(B["baseline-input"],"utf8"),n);S={schemaVersion:c,suiteId:n.id,shardId:f,...B["sample-pairing"]?{samplePairing:B["sample-pairing"]}:{},source:{repository:t,sha:r,...i?{ref:i}:{},url:defaultSourceURL(t,r),...y?{runUrl:y}:{},timestamp:b},platform:O,units:a.units,benchmarks:a.benchmarks}}const N=B["output-dir"]||defaultTemporaryDirectory(`go-benchmark-${n.id}-${o}-${f}-`);l(N,n,w,S);const F=`go-benchmark-${n.id}-${o}-${f}`;const A={"artifact-name":F,"artifact-path":N,"platform-id":o,"shard-id":f,"suite-id":n.id};d(t.githubOutput??B["github-output"]??process.env.GITHUB_OUTPUT,A);console.log(`Recorded ${r.benchmarks.length} benchmarks for ${o}/${f} in ${N}`);return{outputDirectory:N,outputs:A}}function series(e,t=""){return{kind:e[`${t}series-kind`],id:e[`${t}series-id`],label:e[`${t}series-label`]}}function bindSource(e,t,B){const s=B["expected-source-repository"];const n=B["expected-source-sha"];g(Boolean(s)===Boolean(n),"expected source repository and SHA must be provided together");for(const r of e){if(s){g(r.source.repository===s,`artifact source repository ${JSON.stringify(r.source.repository)} does not match ${JSON.stringify(s)}`);g(r.source.sha===n,`artifact source SHA ${JSON.stringify(r.source.sha)} does not match ${JSON.stringify(n)}`)}r.source={...r.source,...B["source-ref"]?{ref:B["source-ref"]}:{},...B["source-url"]?{url:B["source-url"]}:{},...B["source-run-url"]?{runUrl:B["source-run-url"]}:{},...B["source-timestamp"]?{timestamp:B["source-timestamp"]}:{}};o(r,t)}}function bindBaselineSource(e,t,B){if(e.length===0)return;const s=B["expected-baseline-repository"];const n=B["expected-baseline-sha"];g(s,"expected baseline repository is required with a paired baseline");for(const r of e){g(r.source.repository===s,`artifact baseline repository ${JSON.stringify(r.source.repository)} does not match ${JSON.stringify(s)}`);if(n){g(r.source.sha===n,`artifact baseline SHA ${JSON.stringify(r.source.sha)} does not match ${JSON.stringify(n)}`)}const e=n||r.source.sha;r.source={...r.source,repository:s,sha:e,...B["baseline-source-ref"]?{ref:B["baseline-source-ref"]}:{},url:defaultSourceURL(s,e),...B["source-run-url"]?{runUrl:B["source-run-url"]}:{},...B["source-timestamp"]?{timestamp:B["source-timestamp"]}:{}};o(r,t)}}function bindConfig(e,t){if(!t)return;const B=C(t);g(JSON.stringify(e.config.toJSON())===JSON.stringify(B.toJSON()),"artifact configuration does not match the trusted configuration");for(const t of e.results)o(t,B);for(const t of e.baselines)o(t,B);e.config=B}function runRender(e,t={}){const B=options(e,{artifacts:true,"data-dir":true,"trusted-config":true,"series-kind":true,"series-id":true,"series-label":true,"additional-series-kind":true,"additional-series-id":true,"additional-series-label":true,"site-base-url":true,"expected-source-repository":true,"expected-source-sha":true,"expected-baseline-repository":true,"expected-baseline-sha":true,"baseline-source-ref":true,"source-ref":true,"source-url":true,"source-run-url":true,"source-timestamp":true,comment:true,"github-output":true});required(B,["artifacts","data-dir","series-kind","series-id","series-label"],"render");const s=a(B.artifacts);bindConfig(s,B["trusted-config"]);bindSource(s.results,s.config,B);bindBaselineSource(s.baselines,s.config,B);const n=series(B);const i=s.baselines.length===0?null:h(s.baselines,s.config);const o=p(B["data-dir"],s.config,n,s.results,{comparison:n.kind==="pull"?i:null});const l=[B["additional-series-kind"],B["additional-series-id"],B["additional-series-label"]];if(l.some(Boolean)){g(l.every(Boolean),"additional series kind, id, and label must be provided together");p(B["data-dir"],s.config,series(B,"additional-"),s.results,{comparison:i})}const c=B.comment||r.join(B["data-dir"],".go-benchmark-comment.md");const C=B["site-base-url"]?`${B["site-base-url"].replace(/\/+$/u,"")}/${s.config.sitePath.replace(/^\/+|\/+$/gu,"")}/?series=${encodeURIComponent(`${n.kind}/${n.id}`)}`:"";f(c,C,s.config,o.entry,i||o.main,{sameRunner:Boolean(i)});const u={"comment-path":c,marker:`\x3c!-- go-benchmark:${s.config.id} --\x3e`,"site-path":o.sitePath,"site-url":C,"suite-id":s.config.id};d(t.githubOutput??B["github-output"]??process.env.GITHUB_OUTPUT,u);console.log(`Updated ${n.kind} series ${n.id} with ${s.results.length} platforms`);return{outputs:u}}e.exports={runRecord:runRecord,runRender:runRender}},4408:(e,t,B)=>{"use strict";const{benchmarkKey:s}=B(8817);const{median:n}=B(8793);function benchmarkIndex(e){return new Map((e?.benchmarks??[]).map(e=>[s(e),e]))}function isIndexPaired(e,t,B){return B&&e?.samplePairing==="index"&&t?.samplePairing==="index"}function sampleValues(e,t){return e.samples.flatMap(e=>Object.hasOwn(e.measurements,t)?[e.measurements[t]]:[])}function metricComparison(e,t,B,s){const r=e?.measurements?.[B];const i=t?.measurements?.[B];const a={baseline:i,...r!==undefined&&i!==undefined?{difference:r-i}:{}};if(!s||!e||!t){return a}const o=sampleValues(e,B);const l=sampleValues(t,B);if(o.length===0||o.length!==l.length){return a}const c=[];const C=[];let u=true;for(let e=0;e{"use strict";const s=B(6760);const n=B(8815);const{RE2JS:r}=B(6472);const{assert:i,hasControl:a,safePart:o}=B(8793);const{parseViews:l,serializeViews:c}=B(7675);const C=B(3024);function stringList(e,t){if(e===undefined||e===null||e==="")return[];if(typeof e==="string")return[e];i(Array.isArray(e)&&e.every(e=>typeof e==="string"),`${t} must be a string or string list`);return e}function label(e,t,B=120){i(typeof e==="string",`${t} must be a string`);i(e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e,`${t} must be a trimmed string of 1..${B} bytes`);i(!a(e),`${t} contains a control character`);return e}function title(e){return e.split(/[-_.]/u).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join(" ")}function compilePatterns(e,t){return e.map(e=>{try{return r.compile(e)}catch(B){throw new Error(`${t} pattern ${JSON.stringify(e)}: ${B.message}`,{cause:B})}})}function matches(e,t,B){const s=t.replace(/^Benchmark/u,"");const n=B.replace("::Benchmark","::");return e.some(e=>[t,s,B,n].some(t=>e.matcher(t).find()))}class Config{constructor(e,t="configuration"){i(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);this.version=e.version??1;i(this.version===1,`unsupported version ${this.version}`);this.id=e.id;i(typeof this.id==="string"&&/^[a-z0-9][a-z0-9._-]*$/.test(this.id),"invalid id");this.title=label(e.title??`${this.id} benchmarks`,"title");this.sitePath=s.posix.normalize(e["site-path"]??`go-benchmarks/${this.id}`);i(this.sitePath!=="."&&!this.sitePath.startsWith("../")&&!s.posix.isAbsolute(this.sitePath),`site-path ${JSON.stringify(this.sitePath)} must stay within the data branch`);this.include=stringList(e.include,"include");if(this.include.length===0)this.include=["^Benchmark"];this.exclude=stringList(e.exclude,"exclude");this.maxBenchmarks=e["max-benchmarks"]??500;i(Number.isInteger(this.maxBenchmarks)&&this.maxBenchmarks>=1&&this.maxBenchmarks<=5e3,"max-benchmarks must be between 1 and 5000");this.groups={};this.compiledGroups={};const B=e.groups??{};i(B&&typeof B==="object"&&!Array.isArray(B),"groups must be a mapping");for(const[e,t]of Object.entries(B)){i(o(e)&&e===e.toLowerCase(),`invalid group id ${JSON.stringify(e)}`);const B=typeof t==="string"||Array.isArray(t)?{match:t}:{...t};i(B&&typeof B==="object",`group ${e} must be a pattern or mapping`);const s=stringList(B.match,`group ${e} match`);i(s.length!==0,`group ${e} has no match pattern`);const n=B.chart??"combined";i(n==="combined"||n==="single",`group ${e} chart must be combined or single`);this.groups[e]={title:label(B.title??title(e),`group ${e} title`),match:s,chart:n};this.compiledGroups[e]=compilePatterns(s,`group ${e}`)}this.views=l(e.views);this.compiledInclude=compilePatterns(this.include,"include");this.compiledExclude=compilePatterns(this.exclude,"exclude")}includeBenchmark(e,t){return matches(this.compiledInclude,e,t)&&!matches(this.compiledExclude,e,t)}layoutFor(e,t){const B=Object.keys(this.groups).filter(B=>matches(this.compiledGroups[B],e,t)).sort();i(B.length<=1,`benchmark ${JSON.stringify(t)} matches multiple groups: ${B.join(", ")}`);if(B.length===0)return{group:"other",chart:`benchmark:${t}`};const s=B[0];return{group:s,chart:this.groups[s].chart==="single"?`benchmark:${t}`:`group:${s}`}}toJSON(){return{version:this.version,id:this.id,title:this.title,sitePath:this.sitePath,include:this.include,exclude:this.exclude,maxBenchmarks:this.maxBenchmarks,groups:this.groups,views:c(this.views)}}}function loadConfig(e){let t;try{t=n.parse(C.readFileSync(e,"utf8"),{uniqueKeys:true})}catch(t){throw new Error(`parse ${e}: ${t.message}`,{cause:t})}return new Config(t,e)}function loadSnapshot(e){const t=JSON.parse(C.readFileSync(e,"utf8"));const B={...t,"site-path":t.sitePath,"max-benchmarks":t.maxBenchmarks};return new Config(B,e)}e.exports={Config:Config,loadConfig:loadConfig,loadSnapshot:loadSnapshot}},8817:(e,t,B)=>{"use strict";const{assert:s,compareText:n,median:r}=B(8793);const i=new Map([["ns/op","lower"],["sec/op","lower"],["MB/s","higher"],["B/s","higher"],["B/op","lower"],["allocs/op","lower"]]);function parseNumber(e,t){const B=Number(e);s(Number.isFinite(B)&&B>=0,`${t} has invalid value ${JSON.stringify(e)}`);return B}function parseIterations(e,t){s(/^[0-9]+$/u.test(e),`benchmark ${JSON.stringify(t)} has invalid iteration count ${JSON.stringify(e)}`);const B=Number(e);s(Number.isSafeInteger(B)&&B>0,`benchmark ${JSON.stringify(t)} has invalid iteration count ${JSON.stringify(e)}`);return B}function parseUnitLine(e,t,B){s(e.length>=2,`line ${B}: missing unit`);const n=e[1];for(const r of e.slice(2)){const e=r.indexOf("=");s(e>0,`line ${B}: expected key=value`);const i=r.slice(0,e);const a=r.slice(e+1);s(i==="better"||i==="assume",`line ${B}: unsupported unit metadata ${i}`);if(i==="better")s(a==="higher"||a==="lower",`line ${B}: invalid better value ${a}`);if(i==="assume")s(a==="nothing"||a==="exact",`line ${B}: invalid assume value ${a}`);const o=t[n]??{};s(o[i]===undefined||o[i]===a,`line ${B}: conflicting ${i} metadata for ${n}`);o[i]=a;t[n]=o}}function parseBenchmarkLine(e,t,B,n,r){s(e.length>=4&&(e.length-2)%2===0,`line ${r}: malformed benchmark result`);const i=e[0].replace(/-[0-9]+$/u,"");const a=t?`${t}::${i}`:i;if(!B.includeBenchmark(i,a))return;const o=parseIterations(e[1],a);const l={};for(let t=2;tn(e,t)).map(([e,t])=>[e,r(t)]));return e}function parseGoBenchmark(e,t){const B=new Map;const r={};const a={};let o="";for(const[s,n]of e.split(/\r?\n/u).entries()){const e=s+1;const i=n.trim();if(!i)continue;const l=i.split(/\s+/u);if(l[0]==="Unit"){parseUnitLine(l,r,e);continue}if(l[0].startsWith("Benchmark")){parseBenchmarkLine(l,o,t,B,e);continue}const c=/^([a-z][a-z0-9_-]*):\s*(.*)$/u.exec(i);if(c){const[,e,t]=c;a[e]=t;if(e==="pkg")o=t}}s(B.size!==0,"no included Go benchmarks found");s(B.size<=t.maxBenchmarks,`benchmark count exceeds max-benchmarks ${t.maxBenchmarks}`);const l=[...B.values()].map(summarize).sort((e,t)=>n(benchmarkKey(e),benchmarkKey(t)));for(const e of l){for(const t of Object.keys(e.measurements)){if(!r[t]&&i.has(t))r[t]={better:i.get(t)}}}return{benchmarks:l,units:r,fileConfig:a}}function benchmarkKey(e){return e.package?`${e.package}::${e.name}`:e.name}e.exports={benchmarkKey:benchmarkKey,parseGoBenchmark:parseGoBenchmark}},4217:e=>{"use strict";function markdown(e){return String(e).replace(/[\\*_[\]#`]/gu,"\\$&")}function tableCell(e){return markdown(e).replaceAll("|","\\|").replaceAll("\n"," ")}function formatNumber(e){if(Number.isInteger(e)&&e<1e12)return String(e);return e.toFixed(3)}function formatPreciseNumber(e){if(e===0||Number.isInteger(e))return String(e);const t=Math.abs(e);if(t<1e-7){const[t,B]=e.toExponential(3).split("e");return`${t.replace(/\.?0+$/u,"")}e${B}`}const B=t>=999.95?0:t>=99.995?1:t>=9.9995?2:t>=.99995?3:t>=.099995?4:t>=.0099995?5:t>=99995e-8?6:7;return e.toFixed(B).replace(/0+$/u,"").replace(/\.$/u,"")}function formatSigned(e,t){const B=Object.is(e,-0)?0:e;const s=B>0?"+":B<0?"-":"";return`${s}${t(Math.abs(B))}`}function formatDelta(e,t){const B=e.toFixed(1);const s=e!==0&&Number(B)===0?formatPreciseNumber(e):B;const n=`${e>=0?"+":""}${s}%`;if(e===0||t!=="lower"&&t!=="higher")return n;const r=t==="lower"&&e<0||t==="higher"&&e>0;return`${n} (${r?"better":"worse"})`}function delta(e,t,B){if(t===undefined)return"new";if(t===0)return e===0?"0.0%":"from 0";return formatDelta((e/t-1)*100,B)}e.exports={delta:delta,formatDelta:formatDelta,formatNumber:formatNumber,formatPreciseNumber:formatPreciseNumber,formatSigned:formatSigned,markdown:markdown,tableCell:tableCell}},4683:(e,t,B)=>{"use strict";const s=B(6760);const{runRecord:n}=B(6247);function workspacePath(e){return s.isAbsolute(e)?e:s.join(process.env.GITHUB_WORKSPACE||process.cwd(),e)}function input(e){const t=`BENCHMARK_${e.replaceAll("-","_").toUpperCase()}`;return process.env[t]??""}function add(e,t,B){if(B)e.push(`--${t}`,B)}function run(){const e=["--config",workspacePath(input("config")),"--input",workspacePath(input("benchmark-file"))];if(input("baseline-benchmark-file")){add(e,"baseline-input",workspacePath(input("baseline-benchmark-file")))}add(e,"baseline-repository",input("baseline-repository"));add(e,"baseline-sha",input("baseline-sha"));add(e,"baseline-ref",input("baseline-ref"));add(e,"sample-pairing",input("sample-pairing"));add(e,"platform-id",input("platform-id"));add(e,"platform-label",input("platform-label"));add(e,"shard-id",input("shard-id"));return n(e)}e.exports={run:run,workspacePath:workspacePath}},8959:(e,t,B)=>{"use strict";const s=B(3024);const{benchmarkKey:n}=B(8817);const{benchmarkIndex:r,isIndexPaired:i,metricComparison:a}=B(4408);const{delta:o,formatDelta:l,formatNumber:c,formatPreciseNumber:C,formatSigned:u,markdown:f,tableCell:h}=B(4217);const{compareText:p}=B(8793);const{renderViews:g}=B(6919);function groupTitle(e,t){if(t==="other")return"Other";return e.groups[t]?.title??t}function writeReport(e,t,m,d,D,E={}){const y=d.source;const b=E.sameRunner??false;const O=b?"vs base":"vs main";const w=[`\x3c!-- go-benchmark:${m.id} --\x3e`,`## ${f(m.title)}`,"",`[\`${y.sha.slice(0,12)}\`](<${y.url}>)`+(y.runUrl?` | [workflow run](<${y.runUrl}>)`:"")+(t?` | [long-term charts](<${t}>)`:""),""];if(Object.keys(m.views).length>0){w.push(...g(m,d,D,O,b))}else{for(const e of Object.keys(d.platforms).sort(p)){const t=d.platforms[e];const B=D?.platforms?.[e];const s=r(B);const g=i(t,B,b);w.push(`### ${f(t.platform.label)}`,"",`| Group | Benchmark | Metric | Current | ${O} |`,"|---|---|---|---:|---:|");for(const e of t.benchmarks){for(const B of Object.keys(e.measurements).sort(p)){const r=n(e);const i=a(e,s.get(r),B,g);const f=i.change===undefined?o(e.measurements[B],i.baseline,t.units?.[B]?.better):l(i.change,t.units?.[B]?.better);const p=i.difference===undefined?f:`${u(i.difference,e=>`${C(e)} ${B}`)} / ${f}`;w.push(`| ${h(groupTitle(m,e.group))} | \`${r}\` | \`${B}\` | ${c(e.measurements[B])} | ${p} |`)}}w.push("")}}let S;if(D&&b){const e=Object.entries(d.platforms).some(([e,t])=>i(t,D.platforms?.[e],b));S=`_Compared with [\`${D.source.sha.slice(0,12)}\`](<${D.source.url}>) measured in the same runner job${e?"; index-paired signed differences and percentage changes are pairwise medians":""}._`}else if(D){S="_Compared only with the latest matching platform in the main series._"}else{S="_No main baseline exists yet; all metrics are marked `new`._"}w.push(S,"");if(Buffer.byteLength(w.join("\n"))>65e3){throw new Error("benchmark report exceeds the GitHub comment size limit")}s.mkdirSync(B(6760).dirname(e),{recursive:true});s.writeFileSync(e,w.join("\n"))}e.exports={delta:o,writeReport:writeReport}},7864:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);const{validateResult:r}=B(2047);const{loadSnapshot:i}=B(1283);const{benchmarkKey:a}=B(8817);const{assert:o,compareText:l,hasControl:c,readJSONIfExists:C,safePart:u,walkFiles:f,writeJSON:h}=B(8793);const p=1;const g=500;const m=["app.js","index.html","styles.css"];function validateLabel(e,t){o(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=160&&e.trim()===e&&!c(e),`${t} must be a trimmed string of 1..160 bytes`)}function validateSeries(e){o(e?.kind==="main"||e?.kind==="branch"||e?.kind==="pull",`unsupported series kind ${JSON.stringify(e?.kind)}`);o(u(e.id),`invalid series id ${JSON.stringify(e.id)}`);validateLabel(e.label,"series label")}function normalizeStoredResult(e,t){if(!e.shardId)e.shardId="merged";for(const t of e.benchmarks??[]){if(!t.chart){t.chart=t.group==="other"?`benchmark:${a(t)}`:`group:${t.group}`}}return r(e,t,{trustedLayout:false})}function validateEntry(e,t){o(e?.source&&e.platforms&&typeof e.platforms==="object","history entry is invalid");for(const[B,s]of Object.entries(e.platforms)){o(s?.platform?.id===B,`history platform key ${JSON.stringify(B)} does not match its result`);normalizeStoredResult(s,t);o(s.source.repository===e.source.repository&&s.source.sha===e.source.sha,`history platform ${B} source does not match its entry`)}return e}function validateHistory(e,t,B){o(e.schemaVersion===p,`unsupported history schema ${e.schemaVersion}`);o(e.suiteId===t.id&&e.kind===B.kind&&e.id===B.id,`history identity does not match ${t.id}/${B.kind}/${B.id}`);o(Array.isArray(e.entries)&&e.entries.length<=g,"history entries are invalid");for(const B of e.entries){validateEntry(B,t)}e.label=B.label}function emptyHistory(e,t){return{schemaVersion:p,suiteId:e.id,kind:t.kind,id:t.id,label:t.label,entries:[]}}function mergeHistories(e,t,B,s=false){const n=e.map(e=>C(e,null)).filter(Boolean);if(n.length===0)return s?null:emptyHistory(t,B);const r=emptyHistory(t,B);for(const e of n){validateHistory(e,t,B);for(const t of e.entries){const e=r.entries.findIndex(e=>sameSource(e,t));if(e===-1){r.entries.push(t)}else if(compareEntries(r.entries[e],t)<=0){r.entries[e]=t}}}r.entries.sort(compareEntries);if(r.entries.length>g){r.entries.splice(0,r.entries.length-g)}return r}function entryFromResults(e,t){o(e.length!==0,"cannot update history without results");const B=e[0].source;const s={};for(const n of e){r(n,t);o(n.source.repository===B.repository&&n.source.sha===B.sha,`platform ${n.platform.id} does not match source ${B.repository}@${B.sha}`);o(!Object.hasOwn(s,n.platform.id),`duplicate platform ${JSON.stringify(n.platform.id)}`);s[n.platform.id]=n}return{source:B,platforms:s}}function compareEntries(e,t){const B=Date.parse(e.source.timestamp)-Date.parse(t.source.timestamp);return B||l(e.source.sha,t.source.sha)}function compareSeries(e,t){const B={main:0,branch:1,pull:2};return B[e.kind]-B[t.kind]||l(e.label,t.label)||l(e.id,t.id)}function sameSource(e,t){return e.source.repository===t.source.repository&&e.source.sha===t.source.sha}function commitRelative(e){o(/^[0-9a-f]{40}$/u.test(e.source.sha),`invalid source SHA ${JSON.stringify(e.source.sha)}`);return n.posix.join("commits",`${e.source.sha}.json`)}function writeCommit(e,t,B,s=null){validateEntry(B,t);if(s)validateEntry(s,t);const r=commitRelative(B);const i=n.join(e,...r.split("/"));const a=C(i,null);let l=B;if(a){o(a.schemaVersion===p&&a.suiteId===t.id,`commit snapshot identity does not match ${t.id}`);validateEntry(a,t);o(a.source.sha===B.source.sha,`commit snapshot source does not match ${B.source.sha}`);if(compareEntries(a,B)>0)l=a;if(a.comparison){validateEntry(a.comparison,t);s??=a.comparison}}h(i,{schemaVersion:p,suiteId:t.id,source:l.source,platforms:l.platforms,...s?{comparison:s}:{}});return r}function latestMatchingPlatforms(e,t){if(!e?.entries?.length)return null;const B={};let s;for(let n=e.entries.length-1;n>=0&&Object.keys(B).lengths.existsSync(n.join(e,"index.html")));o(B,"bundled web assets are missing");for(const e of m){const r=n.join(B,e);const i=n.join(t,e);s.mkdirSync(n.dirname(i),{recursive:true});s.copyFileSync(r,i)}s.writeFileSync(n.join(e,".nojekyll"),"")}function migrateLegacyData(e,t){const B=n.posix.normalize(t);o(B!=="."&&!B.startsWith("../")&&!n.posix.isAbsolute(B),`site path ${JSON.stringify(t)} must stay within the data branch`);const r=n.join(e,...B.split("/"));const a=n.join(r,"series");const l=f(a,"history.json");const c=n.join(r,"series.json");const u=C(c,{schemaVersion:p,series:[]});o(u.schemaVersion===p&&Array.isArray(u.series),"unsupported or invalid series index");const g=new Set;for(const e of l){const t=n.dirname(e);const a=i(n.join(t,"config.json"));o(a.sitePath===B,`series config site path ${JSON.stringify(a.sitePath)} does not match ${JSON.stringify(B)}`);const l=C(e,null);const c={kind:l?.kind,id:l?.id,label:l?.label};validateSeries(c);validateHistory(l,a,c);const f=n.join(t,"summary.json");const p=s.existsSync(f);const m=mergeHistories([f,e],a,c);for(const e of m.entries){g.add(commitRelative(e));writeCommit(r,a,e)}if(c.kind==="pull"&&m.entries.length>0){const e=m.entries[m.entries.length-1];if(p){const t=C(f,null);validateHistory(t,a,c);const B=t.entries[t.entries.length-1];if(!B||compareEntries(B,e)<0){m.entries=[e]}else{m.entries=t.entries}}else{m.entries=[e]}}h(f,m);const d=m.entries[m.entries.length-1];let D=u.series.find(e=>e.kind===c.kind&&e.id===c.id);if(!D&&d){D={kind:c.kind,id:c.id,label:c.label,configPath:n.posix.join("series",c.kind,c.id,"config.json"),updatedAt:d.source.timestamp};u.series.push(D)}if(d){D.path=n.posix.join("series",c.kind,c.id,"summary.json");D.configPath=n.posix.join("series",c.kind,c.id,"config.json");D.commitPath=commitRelative(d);D.sha=d.source.sha;D.sourceUrl=d.source.url}}u.series.sort(compareSeries);h(c,u);writeWeb(e,r);return{commits:g.size,series:l.length,siteRoot:r}}function update(e,t,B,s,r={}){validateSeries(B);const i=entryFromResults(s,t);const a=n.posix.join("series",B.kind,B.id,"summary.json");const l=n.posix.join("series",B.kind,B.id,"history.json");const c=n.posix.join("series",B.kind,B.id,"config.json");const u=n.join(e,...t.sitePath.split("/"));const f=n.join(u,...a.split("/"));const m=n.join(u,...l.split("/"));const d=n.join(u,...c.split("/"));const D=mergeHistories([f,m],t,B);const E=r.comparison??null;if(E)validateEntry(E,t);if(B.kind==="pull"){for(const e of D.entries)writeCommit(u,t,e);D.entries=E&&!sameSource(E,i)?[E,i]:[i]}else{const e=D.entries.findIndex(e=>sameSource(e,i));if(e===-1)D.entries.push(i);else D.entries[e]=i;D.entries.sort(compareEntries);if(D.entries.length>g){D.entries.splice(0,D.entries.length-g)}}if(B.kind==="pull"){writeCommit(u,t,i,E)}else{for(const e of D.entries){writeCommit(u,t,e,sameSource(e,i)?E:null)}}const y=commitRelative(i);h(f,D);h(m,D);h(d,t.toJSON());const b=n.join(u,"series.json");const O=C(b,{schemaVersion:p,series:[]});o(O.schemaVersion===p&&Array.isArray(O.series),"unsupported or invalid series index");const w={kind:B.kind,id:B.id,label:B.label,path:a,configPath:c,commitPath:y,sha:i.source.sha,sourceUrl:i.source.url,updatedAt:(new Date).toISOString()};const S=O.series.findIndex(e=>e.kind===w.kind&&e.id===w.id);if(S===-1)O.series.push(w);else O.series[S]=w;O.series.sort(compareSeries);h(b,O);writeWeb(e,u);const N=n.join(u,"series","main","main","summary.json");const F=n.join(u,"series","main","main","history.json");const A=mergeHistories([N,F],t,{kind:"main",id:"main",label:"Main"},true);if(A){validateHistory(A,t,{kind:"main",id:"main",label:A.label||"Main"})}return{entry:i,main:latestMatchingPlatforms(A,i.platforms),commitPath:n.join(u,...y.split("/")),historyPath:f,summaryPath:f,sitePath:u}}e.exports={entryFromResults:entryFromResults,latestMatchingPlatforms:latestMatchingPlatforms,migrateLegacyData:migrateLegacyData,update:update}},8793:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);function assert(e,t){if(!e)throw new Error(t)}function readJSON(e){try{return JSON.parse(s.readFileSync(e,"utf8"))}catch(t){throw new Error(`read ${e}: ${t.message}`,{cause:t})}}function readJSONIfExists(e,t){if(!s.existsSync(e))return t;return readJSON(e)}function writeJSON(e,t){s.mkdirSync(n.dirname(e),{recursive:true});s.writeFileSync(e,`${JSON.stringify(t,null,2)}\n`)}function walkFiles(e,t){const B=[];if(!s.existsSync(e))return B;const r=[e];while(r.length!==0){const e=r.pop();for(const i of s.readdirSync(e,{withFileTypes:true})){const s=n.join(e,i.name);if(i.isSymbolicLink()){throw new Error(`artifact contains symlink ${s}`)}if(i.isDirectory())r.push(s);else if(i.isFile()&&i.name===t)B.push(s)}}return B.sort()}function median(e){assert(e.length!==0,"cannot calculate an empty median");const t=e.toSorted((e,t)=>e-t);const B=Math.floor(t.length/2);return t.length%2===0?(t[B-1]+t[B])/2:t[B]}function safePart(e){return/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)}function hasControl(e){return[...e].some(e=>{const t=e.codePointAt(0);return t<=31||t===127})}function compareText(e,t){return et?1:0}function writeOutputs(e,t){if(!e)return;let B="";for(const[e,s]of Object.entries(t).sort()){assert(!/[\r\n]/.test(e+s),`GitHub output ${e} contains a newline`);B+=`${e}=${s}\n`}s.appendFileSync(e,B)}e.exports={assert:assert,compareText:compareText,hasControl:hasControl,median:median,readJSON:readJSON,readJSONIfExists:readJSONIfExists,safePart:safePart,walkFiles:walkFiles,writeJSON:writeJSON,writeOutputs:writeOutputs}},7675:(e,t,B)=>{"use strict";const{RE2JS:s}=B(6472);const{assert:n,hasControl:r,safePart:i}=B(8793);const a=new Set(["platform","package","group","benchmark","metric"]);const o=new Set(["auto","number","bytes","duration-ns","duration-us","duration-ms","duration-s"]);function keys(e,t,B){for(const s of Object.keys(e)){n(t.has(s),`${B} has unsupported field ${s}`)}}function text(e,t,B=120){n(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e&&!r(e),`${t} must be a trimmed string of 1..${B} bytes`);return e}function stringList(e,t){if(e===undefined||e===null||e==="")return[];const B=typeof e==="string"?[e]:e;n(Array.isArray(B)&&B.every(e=>typeof e==="string"),`${t} must be a string or string list`);return B}function patterns(e,t){return stringList(e,t).map(e=>{try{return{source:e,compiled:s.compile(e)}}catch(B){throw new Error(`${t} pattern ${JSON.stringify(e)}: ${B.message}`,{cause:B})}})}function dimensionList(e,t,B){const s=e===undefined?t:stringList(e,B);n(s.length>0,`${B} must not be empty`);const r=new Set;for(const e of s){n(a.has(e),`${B} has unsupported dimension ${e}`);n(!r.has(e),`${B} repeats dimension ${e}`);r.add(e)}return s}function parseDimensionOptions(e,t){n(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);const B={};for(const[s,r]of Object.entries(e)){n(a.has(s),`${t} has unknown ${s}`);const e=typeof r==="string"?{title:r}:r;n(e&&typeof e==="object"&&!Array.isArray(e),`${t}.${s} must be a title or mapping`);keys(e,new Set(["title","trim-prefix"]),`${t}.${s}`);B[s]={...e.title===undefined?{}:{title:text(e.title,`${t}.${s}.title`)},...e["trim-prefix"]===undefined?{}:{trimPrefix:text(e["trim-prefix"],`${t}.${s}.trim-prefix`,300)}}}return B}function parseMetrics(e,t){n(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);const B={};for(const[s,r]of Object.entries(e)){const e=typeof r==="string"?{title:r}:r;n(s.length>0&&Buffer.byteLength(s)<=64,`${t} has invalid metric ${JSON.stringify(s)}`);n(e&&typeof e==="object"&&!Array.isArray(e),`${t}.${s} must be a title or mapping`);keys(e,new Set(["title","format"]),`${t}.${s}`);const i=e.format??"auto";n(o.has(i),`${t}.${s}.format has unsupported value ${i}`);B[s]={title:text(e.title??s,`${t}.${s}.title`),format:i}}return B}function serializeDimensionOptions(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t.title===undefined?{}:{title:t.title},...t.trimPrefix===undefined?{}:{"trim-prefix":t.trimPrefix}}]))}class View{constructor(e,t){n(i(e)&&e===e.toLowerCase(),`invalid view id ${JSON.stringify(e)}`);n(t&&typeof t==="object"&&!Array.isArray(t),`view ${e} must be a mapping`);keys(t,new Set(["title","select","table"]),`view ${e}`);this.id=e;this.title=text(t.title??e,`view ${e} title`);const B=t.select??{};n(B&&typeof B==="object"&&!Array.isArray(B),`view ${e} select must be a mapping`);keys(B,new Set(["platforms","packages","groups","benchmarks","metrics"]),`view ${e} select`);this.select={};this.compiledSelect={};for(const t of["platforms","packages","groups","benchmarks","metrics"]){const s=patterns(B[t],`view ${e} select.${t}`);this.select[t]=s.map(e=>e.source);this.compiledSelect[t]=s.map(e=>e.compiled)}const s=t.table??{};n(s&&typeof s==="object"&&!Array.isArray(s),`view ${e} table must be a mapping`);keys(s,new Set(["rows","columns","split-by","collapsed","missing","empty","max-rows","dimensions","metrics"]),`view ${e} table`);this.rows=dimensionList(s.rows,["platform","benchmark"],`view ${e} table.rows`);this.columns=dimensionList(s.columns,["metric"],`view ${e} table.columns`);this.splitBy=s["split-by"]===undefined?[]:dimensionList(s["split-by"],[],`view ${e} table.split-by`);const r=new Set;for(const t of[...this.rows,...this.columns,...this.splitBy]){n(!r.has(t),`view ${e} uses dimension ${t} more than once`);r.add(t)}this.collapsed=s.collapsed??false;n(typeof this.collapsed==="boolean",`view ${e} table.collapsed must be boolean`);this.missing=s.missing??"blank";n(this.missing==="blank"||this.missing==="error",`view ${e} table.missing must be blank or error`);this.empty=s.empty??"hide";n(this.empty==="hide"||this.empty==="error",`view ${e} table.empty must be hide or error`);this.maxRows=s["max-rows"]??200;n(Number.isInteger(this.maxRows)&&this.maxRows>=1&&this.maxRows<=1e3,`view ${e} table.max-rows must be between 1 and 1000`);this.dimensionOptions=parseDimensionOptions(s.dimensions??{},`view ${e} table.dimensions`);this.metrics=parseMetrics(s.metrics??{},`view ${e} table.metrics`)}matches(e){const t={platforms:[e.dimensions.platform.key,e.dimensions.platform.label],packages:[e.dimensions.package.key],groups:[e.dimensions.group.key,e.dimensions.group.label],benchmarks:[e.dimensions.benchmark.key,e.dimensions.benchmark.label,e.dimensions.benchmark.label.replace(/^Benchmark/u,"")],metrics:[e.dimensions.metric.key]};return Object.entries(this.compiledSelect).every(([e,B])=>B.length===0||B.some(B=>t[e].some(e=>B.matcher(e).find())))}toJSON(){return{title:this.title,select:Object.fromEntries(Object.entries(this.select).filter(([,e])=>e.length>0)),table:{rows:this.rows,columns:this.columns,...this.splitBy.length>0?{"split-by":this.splitBy}:{},collapsed:this.collapsed,missing:this.missing,empty:this.empty,"max-rows":this.maxRows,...Object.keys(this.dimensionOptions).length>0?{dimensions:serializeDimensionOptions(this.dimensionOptions)}:{},...Object.keys(this.metrics).length>0?{metrics:this.metrics}:{}}}}}function parseViews(e){if(e===undefined||e===null)return{};n(e&&typeof e==="object"&&!Array.isArray(e),"views must be a mapping");return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,new View(e,t)]))}function serializeViews(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.toJSON()]))}e.exports={parseViews:parseViews,serializeViews:serializeViews}},6919:(e,t,B)=>{"use strict";const{benchmarkKey:s}=B(8817);const{benchmarkIndex:n,isIndexPaired:r,metricComparison:i}=B(4408);const{delta:a,formatDelta:o,formatNumber:l,formatPreciseNumber:c,formatSigned:C,markdown:u,tableCell:f}=B(4217);const{assert:h,compareText:p}=B(8793);const g={platform:"Platform",package:"Package",group:"Group",benchmark:"Benchmark",metric:"Metric"};function groupTitle(e,t){if(t==="other")return"Other";return e.groups[t]?.title??t}function observations(e,t,B,a){const o=[];for(const l of Object.keys(t.platforms).sort(p)){const c=t.platforms[l];const C=B?.platforms?.[l];const u=n(C);const f=r(c,C,a);for(const t of c.benchmarks){const B=s(t);for(const s of Object.keys(t.measurements).sort(p)){const n=i(t,u.get(B),s,f);o.push({dimensions:{platform:{key:l,label:c.platform.label},package:{key:t.package??"",label:t.package||"(root)"},group:{key:t.group,label:groupTitle(e,t.group)},benchmark:{key:B,label:t.name},metric:{key:s,label:s}},value:t.measurements[s],...n,better:c.units?.[s]?.better})}}}return o}function tuple(e,t){return t.map(t=>e.dimensions[t])}function tupleKey(e){return JSON.stringify(e.map(e=>e.key))}function trim(e,t){return t&&e.startsWith(t)?e.slice(t.length):e}function tupleLabels(e,t,B){return e.map((e,s)=>{const n=t[s];if(n==="metric"){return B.metrics[e.key]?.title??e.label}return trim(e.label,B.dimensionOptions[n]?.trimPrefix)})}function dimensionTitle(e,t){return e.dimensionOptions[t]?.title??g[t]}function formatDuration(e,t,B=l){const s=e*{ns:1,us:1e3,ms:1e6,s:1e9}[t];if(s>=1e9)return`${B(s/1e9)} s`;if(s>=1e6)return`${B(s/1e6)} ms`;if(s>=1e3)return`${B(s/1e3)} us`;return`${B(s)} ns`}function formatValue(e,t,B,s=l){const n=B.metrics[t]?.format??"auto";if(n==="number")return s(e);if(n==="bytes")return`${s(e)} B`;if(n.startsWith("duration-")){return formatDuration(e,n.slice("duration-".length),s)}return`${s(e)} ${t}`}function metricRank(e,t){const B=Object.keys(e.metrics).indexOf(t.key);return B===-1?Number.MAX_SAFE_INTEGER:B}function compareTuple(e,t,B,s){for(let n=0;ncompareTuple(e,s,t,B))}function splitTitle(e,t){return e.map((e,B)=>`${dimensionTitle(t,t.splitBy[B])}: ${tupleLabels([e],[t.splitBy[B]],t)[0]}`).join(" / ")}function renderTable(e,t,B){const s=uniqueTuples(e,t.rows,t);const n=uniqueTuples(e,t.columns,t);h(s.length<=t.maxRows,`view ${t.id} has ${s.length} rows, exceeding max-rows ${t.maxRows}`);const r=new Map;for(const B of e){const e=tupleKey(tuple(B,t.rows));const s=tupleKey(tuple(B,t.columns));const n=`${e}\n${s}`;h(!r.has(n),`view ${t.id} has duplicate cell ${n}`);r.set(n,B)}const i=t.rows.map(e=>dimensionTitle(t,e));for(const e of n){const s=tupleLabels(e,t.columns,t);i.push(s.join(" / "),B)}const l=[`| ${i.map(f).join(" | ")} |`,`|${t.rows.map(()=>"---").join("|")}|${n.map(()=>"---:|---:").join("|")}|`];for(const e of s){const B=tupleLabels(e,t.rows,t).map(f);for(const s of n){const n=`${tupleKey(e)}\n${tupleKey(s)}`;const i=r.get(n);if(!i){h(t.missing==="blank",`view ${t.id} is missing cell ${n}`);B.push("-","-");continue}const l=i.change===undefined?a(i.value,i.baseline,i.better):o(i.change,i.better);const u=i.difference===undefined?l:`${C(i.difference,e=>formatValue(e,i.dimensions.metric.key,t,c))} / ${l}`;B.push(formatValue(i.value,i.dimensions.metric.key,t),u)}l.push(`| ${B.map(f).join(" | ")} |`)}return l}function renderView(e,t,B){const s=t.filter(t=>e.matches(t));if(s.length===0){h(e.empty==="hide",`view ${e.id} has no matching results`);return[]}const n=e.splitBy.length===0?[[]]:uniqueTuples(s,e.splitBy,e);const r=[];for(const t of n){const n=e.splitBy.length===0?s:s.filter(B=>tupleKey(tuple(B,e.splitBy))===tupleKey(t));if(t.length>0)r.push(`#### ${u(splitTitle(t,e))}`,"");r.push(...renderTable(n,e,B),"")}if(!e.collapsed){return[`### ${u(e.title)}`,"",...r]}return["
",`${u(e.title)}`,"",...r,"
",""]}function renderViews(e,t,B,s="vs main",n=false){const r=observations(e,t,B,n);return Object.values(e.views).flatMap(e=>renderView(e,r,s))}e.exports={renderViews:renderViews}},181:e=>{"use strict";e.exports=require("buffer")},3024:e=>{"use strict";e.exports=require("node:fs")},8161:e=>{"use strict";e.exports=require("node:os")},6760:e=>{"use strict";e.exports=require("node:path")},3136:e=>{"use strict";e.exports=require("node:url")},7975:e=>{"use strict";e.exports=require("node:util")},932:e=>{"use strict";e.exports=require("process")},7349:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(4454);var i=B(2223);var a=B(7103);var o=B(334);var l=B(3142);function resolveCollection(e,t,B,s,n,r){const i=B.type==="block-map"?a.resolveBlockMap(e,t,B,s,r):B.type==="block-seq"?o.resolveBlockSeq(e,t,B,s,r):l.resolveFlowCollection(e,t,B,s,r);const c=i.constructor;if(n==="!"||n===c.tagName){i.tag=c.tagName;return i}if(n)i.tag=n;return i}function composeCollection(e,t,B,a,o){const l=a.tag;const c=!l?null:t.directives.tagName(l.source,e=>o(l,"TAG_RESOLVE_FAILED",e));if(B.type==="block-seq"){const{anchor:e,newlineAfterProp:t}=a;const B=e&&l?e.offset>l.offset?e:l:e??l;if(B&&(!t||t.offsete.tag===c&&e.collection===C);if(!u){const s=t.schema.knownTags[c];if(s?.collection===C){t.schema.tags.push(Object.assign({},s,{default:false}));u=s}else{if(s){o(l,"BAD_COLLECTION_TYPE",`${s.tag} used for ${C} collection, but expects ${s.collection??"scalar"}`,true)}else{o(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,true)}return resolveCollection(e,t,B,o,c)}}const f=resolveCollection(e,t,B,o,c,u);const h=u.resolve?.(f,e=>o(l,"TAG_RESOLVE_FAILED",e),t.options)??f;const p=s.isNode(h)?h:new n.Scalar(h);p.range=f.range;p.tag=c;if(u?.format)p.format=u.format;return p}t.composeCollection=composeCollection},3683:(e,t,B)=>{"use strict";var s=B(3021);var n=B(5937);var r=B(7788);var i=B(4631);function composeDoc(e,t,{offset:B,start:a,value:o,end:l},c){const C=Object.assign({_directives:t},e);const u=new s.Document(undefined,C);const f={atKey:false,atRoot:true,directives:u.directives,options:u.options,schema:u.schema};const h=i.resolveProps(a,{indicator:"doc-start",next:o??l?.[0],offset:B,onError:c,parentIndent:0,startOnNewline:true});if(h.found){u.directives.docStart=true;if(o&&(o.type==="block-map"||o.type==="block-seq")&&!h.hasNewline)c(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}u.contents=o?n.composeNode(f,o,h,c):n.composeEmptyNode(f,h.end,a,null,h,c);const p=u.contents.range[2];const g=r.resolveEnd(l,p,false,c);if(g.comment)u.comment=g.comment;u.range=[B,p,g.offset];return u}t.composeDoc=composeDoc},5937:(e,t,B)=>{"use strict";var s=B(4065);var n=B(1127);var r=B(7349);var i=B(5413);var a=B(7788);var o=B(2599);const l={composeNode:composeNode,composeEmptyNode:composeEmptyNode};function composeNode(e,t,B,s){const a=e.atKey;const{spaceBefore:o,comment:c,anchor:C,tag:u}=B;let f;let h=true;switch(t.type){case"alias":f=composeAlias(e,t,s);if(C||u)s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=i.composeScalar(e,t,u,s);if(C)f.anchor=C.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{f=r.composeCollection(l,e,t,B,s);if(C)f.anchor=C.source.substring(1)}catch(e){const B=e instanceof Error?e.message:String(e);s(t,"RESOURCE_EXHAUSTION",B)}break;default:{const e=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",e);h=false}}f??(f=composeEmptyNode(e,t.offset,undefined,null,B,s));if(C&&f.anchor==="")s(C,"BAD_ALIAS","Anchor cannot be an empty string");if(a&&e.options.stringKeys&&(!n.isScalar(f)||typeof f.value!=="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")){const e="With stringKeys, all keys must be strings";s(u??t,"NON_STRING_KEY",e)}if(o)f.spaceBefore=true;if(c){if(t.type==="scalar"&&t.source==="")f.comment=c;else f.commentBefore=c}if(e.options.keepSourceTokens&&h)f.srcToken=t;return f}function composeEmptyNode(e,t,B,s,{spaceBefore:n,comment:r,anchor:a,tag:l,end:c},C){const u={type:"scalar",offset:o.emptyScalarPosition(t,B,s),indent:-1,source:""};const f=i.composeScalar(e,u,l,C);if(a){f.anchor=a.source.substring(1);if(f.anchor==="")C(a,"BAD_ALIAS","Anchor cannot be an empty string")}if(n)f.spaceBefore=true;if(r){f.comment=r;f.range[2]=c}return f}function composeAlias({options:e},{offset:t,source:B,end:n},r){const i=new s.Alias(B.substring(1));if(i.source==="")r(t,"BAD_ALIAS","Alias cannot be an empty string");if(i.source.endsWith(":"))r(t+B.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);const o=t+B.length;const l=a.resolveEnd(n,o,e.strict,r);i.range=[t,o,l.offset];if(l.comment)i.comment=l.comment;return i}t.composeEmptyNode=composeEmptyNode;t.composeNode=composeNode},5413:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(8913);var i=B(6842);function composeScalar(e,t,B,a){const{value:o,type:l,comment:c,range:C}=t.type==="block-scalar"?r.resolveBlockScalar(e,t,a):i.resolveFlowScalar(t,e.options.strict,a);const u=B?e.directives.tagName(B.source,e=>a(B,"TAG_RESOLVE_FAILED",e)):null;let f;if(e.options.stringKeys&&e.atKey){f=e.schema[s.SCALAR]}else if(u)f=findScalarTagByName(e.schema,o,u,B,a);else if(t.type==="scalar")f=findScalarTagByTest(e,o,t,a);else f=e.schema[s.SCALAR];let h;try{const r=f.resolve(o,e=>a(B??t,"TAG_RESOLVE_FAILED",e),e.options);h=s.isScalar(r)?r:new n.Scalar(r)}catch(e){const s=e instanceof Error?e.message:String(e);a(B??t,"TAG_RESOLVE_FAILED",s);h=new n.Scalar(o)}h.range=C;h.source=o;if(l)h.type=l;if(u)h.tag=u;if(f.format)h.format=f.format;if(c)h.comment=c;return h}function findScalarTagByName(e,t,B,n,r){if(B==="!")return e[s.SCALAR];const i=[];for(const t of e.tags){if(!t.collection&&t.tag===B){if(t.default&&t.test)i.push(t);else return t}}for(const e of i)if(e.test?.test(t))return e;const a=e.knownTags[B];if(a&&!a.collection){e.tags.push(Object.assign({},a,{default:false,test:undefined}));return a}r(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${B}`,B!=="tag:yaml.org,2002:str");return e[s.SCALAR]}function findScalarTagByTest({atKey:e,directives:t,schema:B},n,r,i){const a=B.tags.find(t=>(t.default===true||e&&t.default==="key")&&t.test?.test(n))||B[s.SCALAR];if(B.compat){const e=B.compat.find(e=>e.default&&e.test?.test(n))??B[s.SCALAR];if(a.tag!==e.tag){const B=t.tagString(a.tag);const s=t.tagString(e.tag);const n=`Value may be parsed as either ${B} or ${s}`;i(r,"TAG_RESOLVE_FAILED",n,true)}}return a}t.composeScalar=composeScalar},9984:(e,t,B)=>{"use strict";var s=B(932);var n=B(1342);var r=B(3021);var i=B(1464);var a=B(1127);var o=B(3683);var l=B(7788);function getErrorPos(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:B}=e;return[t,t+(typeof B==="string"?B.length:1)]}function parsePrelude(e){let t="";let B=false;let s=false;for(let n=0;n{const n=getErrorPos(e);if(s)this.warnings.push(new i.YAMLWarning(n,t,B));else this.errors.push(new i.YAMLParseError(n,t,B))};this.directives=new n.Directives({version:e.version||"1.2"});this.options=e}decorate(e,t){const{comment:B,afterEmptyLine:s}=parsePrelude(this.prelude);if(B){const n=e.contents;if(t){e.comment=e.comment?`${e.comment}\n${B}`:B}else if(s||e.directives.docStart||!n){e.commentBefore=B}else if(a.isCollection(n)&&!n.flow&&n.items.length>0){let e=n.items[0];if(a.isPair(e))e=e.key;const t=e.commentBefore;e.commentBefore=t?`${B}\n${t}`:B}else{const e=n.commentBefore;n.commentBefore=e?`${B}\n${e}`:B}}if(t){for(let t=0;t{const n=getErrorPos(e);n[0]+=t;this.onError(n,"BAD_DIRECTIVE",B,s)});this.prelude.push(e.source);this.atDirectives=true;break;case"document":{const t=o.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");this.decorate(t,false);if(this.doc)yield this.doc;this.doc=t;this.atDirectives=false;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message;const B=new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(B);else this.doc.errors.push(B);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=true;const t=l.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);this.decorate(this.doc,true);if(t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=false,t=-1){if(this.doc){this.decorate(this.doc,true);yield this.doc;this.doc=null}else if(e){const e=Object.assign({_directives:this.directives},this.options);const B=new r.Document(undefined,e);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");B.range=[0,t,t];this.decorate(B,false);yield B}}}t.Composer=Composer},7103:(e,t,B)=>{"use strict";var s=B(7165);var n=B(4454);var r=B(4631);var i=B(9499);var a=B(4051);var o=B(1187);const l="All mapping items must start at the same column";function resolveBlockMap({composeNode:e,composeEmptyNode:t},B,c,C,u){const f=u?.nodeClass??n.YAMLMap;const h=new f(B.schema);if(B.atRoot)B.atRoot=false;let p=c.offset;let g=null;for(const n of c.items){const{start:u,key:f,sep:m,value:d}=n;const D=r.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:p,onError:C,parentIndent:c.indent,startOnNewline:true});const E=!D.found;if(E){if(f){if(f.type==="block-seq")C(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==c.indent)C(p,"BAD_INDENT",l)}if(!D.anchor&&!D.tag&&!m){g=D.end;if(D.comment){if(h.comment)h.comment+="\n"+D.comment;else h.comment=D.comment}continue}if(D.newlineAfterProp||i.containsNewline(f)){C(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}}else if(D.found?.indent!==c.indent){C(p,"BAD_INDENT",l)}B.atKey=true;const y=D.end;const b=f?e(B,f,D,C):t(B,y,u,null,D,C);if(B.schema.compat)a.flowIndentCheck(c.indent,f,C);B.atKey=false;if(o.mapIncludes(B,h.items,b))C(y,"DUPLICATE_KEY","Map keys must be unique");const O=r.resolveProps(m??[],{indicator:"map-value-ind",next:d,offset:b.range[2],onError:C,parentIndent:c.indent,startOnNewline:!f||f.type==="block-scalar"});p=O.end;if(O.found){if(E){if(d?.type==="block-map"&&!O.hasNewline)C(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(B.options.strict&&D.start{"use strict";var s=B(3301);function resolveBlockScalar(e,t,B){const n=t.offset;const r=parseBlockScalarHeader(t,e.options.strict,B);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};const i=r.mode===">"?s.Scalar.BLOCK_FOLDED:s.Scalar.BLOCK_LITERAL;const a=t.source?splitLines(t.source):[];let o=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(t===""||t==="\r")o=e;else break}if(o===0){const e=r.chomp==="+"&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let B=n+r.length;if(t.source)B+=t.source.length;return{value:e,type:i,comment:r.comment,range:[n,B,B]}}let l=t.indent+r.indent;let c=t.offset+r.length;let C=0;for(let t=0;tl)l=s.length}else{if(s.length=o;--e){if(a[e][0].length>l)o=e+1}let u="";let f="";let h=false;for(let e=0;el||n[0]==="\t"){if(f===" ")f="\n";else if(!h&&f==="\n")f="\n\n";u+=f+t.slice(l)+n;f="\n";h=true}else if(n===""){if(f==="\n")u+="\n";else f="\n"}else{u+=f+n;f=" ";h=false}}switch(r.chomp){case"-":break;case"+":for(let e=o;e{"use strict";var s=B(2223);var n=B(4631);var r=B(4051);function resolveBlockSeq({composeNode:e,composeEmptyNode:t},B,i,a,o){const l=o?.nodeClass??s.YAMLSeq;const c=new l(B.schema);if(B.atRoot)B.atRoot=false;if(B.atKey)B.atKey=false;let C=i.offset;let u=null;for(const{start:s,value:o}of i.items){const l=n.resolveProps(s,{indicator:"seq-item-ind",next:o,offset:C,onError:a,parentIndent:i.indent,startOnNewline:true});if(!l.found){if(l.anchor||l.tag||o){if(o?.type==="block-seq")a(l.end,"BAD_INDENT","All sequence items must start at the same column");else a(C,"MISSING_CHAR","Sequence item without - indicator")}else{u=l.end;if(l.comment)c.comment=l.comment;continue}}const f=o?e(B,o,l,a):t(B,l.end,s,null,l,a);if(B.schema.compat)r.flowIndentCheck(i.indent,o,a);C=f.range[2];c.items.push(f)}c.range=[i.offset,C,u??C];return c}t.resolveBlockSeq=resolveBlockSeq},7788:(e,t)=>{"use strict";function resolveEnd(e,t,B,s){let n="";if(e){let r=false;let i="";for(const a of e){const{source:e,type:o}=a;switch(o){case"space":r=true;break;case"comment":{if(B&&!r)s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";if(!n)n=t;else n+=i+t;i="";break}case"newline":if(n)i+=e;r=true;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${o} at node end`)}t+=e.length}}return{comment:n,offset:t}}t.resolveEnd=resolveEnd},3142:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(4454);var i=B(2223);var a=B(7788);var o=B(4631);var l=B(9499);var c=B(1187);const C="Block collections are not allowed within flow collections";const isBlock=e=>e&&(e.type==="block-map"||e.type==="block-seq");function resolveFlowCollection({composeNode:e,composeEmptyNode:t},B,u,f,h){const p=u.start.source==="{";const g=p?"flow map":"flow sequence";const m=h?.nodeClass??(p?r.YAMLMap:i.YAMLSeq);const d=new m(B.schema);d.flow=true;const D=B.atRoot;if(D)B.atRoot=false;if(B.atKey)B.atKey=false;let E=u.offset+u.start.source.length;for(let i=0;i0){const e=a.resolveEnd(O,w,B.options.strict,f);if(e.comment){if(d.comment)d.comment+="\n"+e.comment;else d.comment=e.comment}d.range=[u.offset,w,e.offset]}else{d.range=[u.offset,w,w]}return d}t.resolveFlowCollection=resolveFlowCollection},6842:(e,t,B)=>{"use strict";var s=B(3301);var n=B(7788);function resolveFlowScalar(e,t,B){const{offset:r,type:i,source:a,end:o}=e;let l;let c;const _onError=(e,t,s)=>B(r+e,t,s);switch(i){case"scalar":l=s.Scalar.PLAIN;c=plainValue(a,_onError);break;case"single-quoted-scalar":l=s.Scalar.QUOTE_SINGLE;c=singleQuotedValue(a,_onError);break;case"double-quoted-scalar":l=s.Scalar.QUOTE_DOUBLE;c=doubleQuotedValue(a,_onError);break;default:B(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`);return{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const C=r+a.length;const u=n.resolveEnd(o,C,t,B);return{value:c,type:l,comment:u.comment,range:[r,C,u.offset]}}function plainValue(e,t){let B="";switch(e[0]){case"\t":B="a tab character";break;case",":B="flow indicator character ,";break;case"%":B="directive indicator character %";break;case"|":case">":{B=`block scalar indicator ${e[0]}`;break}case"@":case"`":{B=`reserved character ${e[0]}`;break}}if(B)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${B}`);return foldLines(e)}function singleQuotedValue(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return foldLines(e.slice(1,-1)).replace(/''/g,"'")}function foldLines(e){let t,B;try{t=new RegExp("(.*?)(?t?e.slice(t,s+1):n}else{B+=n}}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return B}function foldNewline(e,t){let B="";let s=e[t+1];while(s===" "||s==="\t"||s==="\n"||s==="\r"){if(s==="\r"&&e[t+2]!=="\n")break;if(s==="\n")B+="\n";t+=1;s=e[t+1]}if(!B)B=" ";return{fold:B,offset:t}}const r={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function parseCharCode(e,t,B,s){const n=e.substr(t,B);const r=n.length===B&&/^[0-9a-fA-F]+$/.test(n);const i=r?parseInt(n,16):NaN;try{return String.fromCodePoint(i)}catch{const n=e.substr(t-2,B+2);s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${n}`);return n}}t.resolveFlowScalar=resolveFlowScalar},4631:(e,t)=>{"use strict";function resolveProps(e,{flow:t,indicator:B,next:s,offset:n,onError:r,parentIndent:i,startOnNewline:a}){let o=false;let l=a;let c=a;let C="";let u="";let f=false;let h=false;let p=null;let g=null;let m=null;let d=null;let D=null;let E=null;let y=null;for(const n of e){if(h){if(n.type!=="space"&&n.type!=="newline"&&n.type!=="comma")r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");h=false}if(p){if(l&&n.type!=="comment"&&n.type!=="newline"){r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation")}p=null}switch(n.type){case"space":if(!t&&(B!=="doc-start"||s?.type!=="flow-collection")&&n.source.includes("\t")){p=n}c=true;break;case"comment":{if(!c)r(n,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=n.source.substring(1)||" ";if(!C)C=e;else C+=u+e;u="";l=false;break}case"newline":if(l){if(C)C+=n.source;else if(!E||B!=="seq-item-ind")o=true}else u+=n.source;l=true;f=true;if(g||m)d=n;c=true;break;case"anchor":if(g)r(n,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(n.source.endsWith(":"))r(n.offset+n.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true);g=n;y??(y=n.offset);l=false;c=false;h=true;break;case"tag":{if(m)r(n,"MULTIPLE_TAGS","A node can have at most one tag");m=n;y??(y=n.offset);l=false;c=false;h=true;break}case B:if(g||m)r(n,"BAD_PROP_ORDER",`Anchors and tags must be after the ${n.source} indicator`);if(E)r(n,"UNEXPECTED_TOKEN",`Unexpected ${n.source} in ${t??"collection"}`);E=n;l=B==="seq-item-ind"||B==="explicit-key-ind";c=false;break;case"comma":if(t){if(D)r(n,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);D=n;l=false;c=false;break}default:r(n,"UNEXPECTED_TOKEN",`Unexpected ${n.type} token`);l=false;c=false}}const b=e[e.length-1];const O=b?b.offset+b.source.length:n;if(h&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")){r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space")}if(p&&(l&&p.indent<=i||s?.type==="block-map"||s?.type==="block-seq"))r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:E,spaceBefore:o,comment:C,hasNewline:f,anchor:g,tag:m,newlineAfterProp:d,end:O,start:y??O}}t.resolveProps=resolveProps},9499:(e,t)=>{"use strict";function containsNewline(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return true;if(e.end)for(const t of e.end)if(t.type==="newline")return true;return false;case"flow-collection":for(const t of e.items){for(const e of t.start)if(e.type==="newline")return true;if(t.sep)for(const e of t.sep)if(e.type==="newline")return true;if(containsNewline(t.key)||containsNewline(t.value))return true}return false;default:return true}}t.containsNewline=containsNewline},2599:(e,t)=>{"use strict";function emptyScalarPosition(e,t,B){if(t){B??(B=t.length);for(let s=B-1;s>=0;--s){let B=t[s];switch(B.type){case"space":case"comment":case"newline":e-=B.source.length;continue}B=t[++s];while(B?.type==="space"){e+=B.source.length;B=t[++s]}break}}return e}t.emptyScalarPosition=emptyScalarPosition},4051:(e,t,B)=>{"use strict";var s=B(9499);function flowIndentCheck(e,t,B){if(t?.type==="flow-collection"){const n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&s.containsNewline(t)){const e="Flow end indicator should be more indented than parent";B(n,"BAD_INDENT",e,true)}}}t.flowIndentCheck=flowIndentCheck},1187:(e,t,B)=>{"use strict";var s=B(1127);function mapIncludes(e,t,B){const{uniqueKeys:n}=e.options;if(n===false)return false;const r=typeof n==="function"?n:(e,t)=>e===t||s.isScalar(e)&&s.isScalar(t)&&e.value===t.value;return t.some(e=>r(e.key,B))}t.mapIncludes=mapIncludes},3021:(e,t,B)=>{"use strict";var s=B(4065);var n=B(101);var r=B(1127);var i=B(7165);var a=B(4043);var o=B(5840);var l=B(6829);var c=B(1596);var C=B(3661);var u=B(2404);var f=B(1342);class Document{constructor(e,t,B){this.commentBefore=null;this.comment=null;this.errors=[];this.warnings=[];Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let s=null;if(typeof t==="function"||Array.isArray(t)){s=t}else if(B===undefined&&t){B=t;t=undefined}const n=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},B);this.options=n;let{version:i}=n;if(B?._directives){this.directives=B._directives.atDocument();if(this.directives.yaml.explicit)i=this.directives.yaml.version}else this.directives=new f.Directives({version:i});this.setSchema(i,B);this.contents=e===undefined?null:this.createNode(e,s,B)}clone(){const e=Object.create(Document.prototype,{[r.NODE_TYPE]:{value:r.DOC}});e.commentBefore=this.commentBefore;e.comment=this.comment;e.errors=this.errors.slice();e.warnings=this.warnings.slice();e.options=Object.assign({},this.options);if(this.directives)e.directives=this.directives.clone();e.schema=this.schema.clone();e.contents=r.isNode(this.contents)?this.contents.clone(e.schema):this.contents;if(this.range)e.range=this.range.slice();return e}add(e){if(assertCollection(this.contents))this.contents.add(e)}addIn(e,t){if(assertCollection(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const B=c.anchorNames(this);e.anchor=!t||B.has(t)?c.findNewAnchor(t||"a",B):t}return new s.Alias(e.anchor)}createNode(e,t,B){let s=undefined;if(typeof t==="function"){e=t.call({"":e},"",e);s=t}else if(Array.isArray(t)){const keyToStr=e=>typeof e==="number"||e instanceof String||e instanceof Number;const e=t.filter(keyToStr).map(String);if(e.length>0)t=t.concat(e);s=t}else if(B===undefined&&t){B=t;t=undefined}const{aliasDuplicateObjects:n,anchorPrefix:i,flow:a,keepUndefined:o,onTagObj:l,tag:C}=B??{};const{onAnchor:f,setAnchors:h,sourceObjects:p}=c.createNodeAnchors(this,i||"a");const g={aliasDuplicateObjects:n??true,keepUndefined:o??false,onAnchor:f,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:p};const m=u.createNode(e,C,g);if(a&&r.isCollection(m))m.flow=true;h();return m}createPair(e,t,B={}){const s=this.createNode(e,null,B);const n=this.createNode(t,null,B);return new i.Pair(s,n)}delete(e){return assertCollection(this.contents)?this.contents.delete(e):false}deleteIn(e){if(n.isEmptyPath(e)){if(this.contents==null)return false;this.contents=null;return true}return assertCollection(this.contents)?this.contents.deleteIn(e):false}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):undefined}getIn(e,t){if(n.isEmptyPath(e))return!t&&r.isScalar(this.contents)?this.contents.value:this.contents;return r.isCollection(this.contents)?this.contents.getIn(e,t):undefined}has(e){return r.isCollection(this.contents)?this.contents.has(e):false}hasIn(e){if(n.isEmptyPath(e))return this.contents!==undefined;return r.isCollection(this.contents)?this.contents.hasIn(e):false}set(e,t){if(this.contents==null){this.contents=n.collectionFromPath(this.schema,[e],t)}else if(assertCollection(this.contents)){this.contents.set(e,t)}}setIn(e,t){if(n.isEmptyPath(e)){this.contents=t}else if(this.contents==null){this.contents=n.collectionFromPath(this.schema,Array.from(e),t)}else if(assertCollection(this.contents)){this.contents.setIn(e,t)}}setSchema(e,t={}){if(typeof e==="number")e=String(e);let B;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new f.Directives({version:"1.1"});B={resolveKnownTags:false,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new f.Directives({version:e});B={resolveKnownTags:true,schema:"core"};break;case null:if(this.directives)delete this.directives;B=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(B)this.schema=new o.Schema(Object.assign(B,t));else throw new Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:B,maxAliasCount:s,onAnchor:n,reviver:r}={}){const i={anchors:new Map,doc:this,keep:!e,mapAsMap:B===true,mapKeyWarned:false,maxAliasCount:typeof s==="number"?s:100};const o=a.toJS(this.contents,t??"",i);if(typeof n==="function")for(const{count:e,res:t}of i.anchors.values())n(t,e);return typeof r==="function"?C.applyReviver(r,{"":o},"",o):o}toJSON(e,t){return this.toJS({json:true,jsonArg:e,mapAsMap:false,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return l.stringifyDocument(this,e)}}function assertCollection(e){if(r.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}t.Document=Document},1596:(e,t,B)=>{"use strict";var s=B(1127);var n=B(204);function anchorIsValid(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);const B=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(B)}return true}function anchorNames(e){const t=new Set;n.visit(e,{Value(e,B){if(B.anchor)t.add(B.anchor)}});return t}function findNewAnchor(e,t){for(let B=1;true;++B){const s=`${e}${B}`;if(!t.has(s))return s}}function createNodeAnchors(e,t){const B=[];const n=new Map;let r=null;return{onAnchor:s=>{B.push(s);r??(r=anchorNames(e));const n=findNewAnchor(t,r);r.add(n);return n},setAnchors:()=>{for(const e of B){const t=n.get(e);if(typeof t==="object"&&t.anchor&&(s.isScalar(t.node)||s.isCollection(t.node))){t.node.anchor=t.anchor}else{const t=new Error("Failed to resolve repeated object (this should not happen)");t.source=e;throw t}}},sourceObjects:n}}t.anchorIsValid=anchorIsValid;t.anchorNames=anchorNames;t.createNodeAnchors=createNodeAnchors;t.findNewAnchor=findNewAnchor},3661:(e,t)=>{"use strict";function applyReviver(e,t,B,s){if(s&&typeof s==="object"){if(Array.isArray(s)){for(let t=0,B=s.length;t{"use strict";var s=B(4065);var n=B(1127);var r=B(3301);const i="tag:yaml.org,2002:";function findTagObject(e,t,B){if(t){const e=B.filter(e=>e.tag===t);const s=e.find(e=>!e.format)??e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return B.find(t=>t.identify?.(e)&&!t.format)}function createNode(e,t,B){if(n.isDocument(e))e=e.contents;if(n.isNode(e))return e;if(n.isPair(e)){const t=B.schema[n.MAP].createNode?.(B.schema,null,B);t.items.push(e);return t}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!=="undefined"&&e instanceof BigInt){e=e.valueOf()}const{aliasDuplicateObjects:a,onAnchor:o,onTagObj:l,schema:c,sourceObjects:C}=B;let u=undefined;if(a&&e&&typeof e==="object"){u=C.get(e);if(u){u.anchor??(u.anchor=o(e));return new s.Alias(u.anchor)}else{u={anchor:null,node:null};C.set(e,u)}}if(t?.startsWith("!!"))t=i+t.slice(2);let f=findTagObject(e,t,c.tags);if(!f){if(e&&typeof e.toJSON==="function"){e=e.toJSON()}if(!e||typeof e!=="object"){const t=new r.Scalar(e);if(u)u.node=t;return t}f=e instanceof Map?c[n.MAP]:Symbol.iterator in Object(e)?c[n.SEQ]:c[n.MAP]}if(l){l(f);delete B.onTagObj}const h=f?.createNode?f.createNode(B.schema,e,B):typeof f?.nodeClass?.from==="function"?f.nodeClass.from(B.schema,e,B):new r.Scalar(e);if(t)h.tag=t;else if(!f.default)h.tag=f.tag;if(u)u.node=h;return h}t.createNode=createNode},1342:(e,t,B)=>{"use strict";var s=B(1127);var n=B(204);const r={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};const escapeTagName=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);class Directives{constructor(e,t){this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},Directives.defaultYaml,e);this.tags=Object.assign({},Directives.defaultTags,t)}clone(){const e=new Directives(this.yaml,this.tags);e.docStart=this.docStart;return e}atDocument(){const e=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},Directives.defaultTags);break}return e}add(e,t){if(this.atNextDocument){this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},Directives.defaultTags);this.atNextDocument=false}const B=e.trim().split(/[ \t]+/);const s=B.shift();switch(s){case"%TAG":{if(B.length!==2){t(0,"%TAG directive should contain exactly two parts");if(B.length<2)return false}const[e,s]=B;this.tags[e]=s;return true}case"%YAML":{this.yaml.explicit=true;if(B.length!==1){t(0,"%YAML directive should contain exactly one part");return false}const[e]=B;if(e==="1.1"||e==="1.2"){this.yaml.version=e;return true}else{const B=/^\d+\.\d+$/.test(e);t(6,`Unsupported YAML version ${e}`,B);return false}}default:t(0,`Unknown directive ${s}`,true);return false}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!"){t(`Not a valid tag: ${e}`);return null}if(e[1]==="<"){const B=e.slice(2,-1);if(B==="!"||B==="!!"){t(`Verbatim tags aren't resolved, so ${e} is invalid.`);return null}if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return B}const[,B,s]=e.match(/^(.*!)([^!]*)$/s);if(!s)t(`The ${e} tag has no suffix`);const n=this.tags[B];if(n){try{return n+decodeURIComponent(s)}catch(e){t(String(e));return null}}if(B==="!")return e;t(`Could not resolve tag: ${e}`);return null}tagString(e){for(const[t,B]of Object.entries(this.tags)){if(e.startsWith(B))return t+escapeTagName(e.substring(B.length))}return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[];const B=Object.entries(this.tags);let r;if(e&&B.length>0&&s.isNode(e.contents)){const t={};n.visit(e.contents,(e,B)=>{if(s.isNode(B)&&B.tag)t[B.tag]=true});r=Object.keys(t)}else r=[];for(const[s,n]of B){if(s==="!!"&&n==="tag:yaml.org,2002:")continue;if(!e||r.some(e=>e.startsWith(n)))t.push(`%TAG ${s} ${n}`)}return t.join("\n")}}Directives.defaultYaml={explicit:false,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"};t.Directives=Directives},1464:(e,t)=>{"use strict";class YAMLError extends Error{constructor(e,t,B,s){super();this.name=e;this.code=B;this.message=s;this.pos=t}}class YAMLParseError extends YAMLError{constructor(e,t,B){super("YAMLParseError",e,t,B)}}class YAMLWarning extends YAMLError{constructor(e,t,B){super("YAMLWarning",e,t,B)}}const prettifyError=(e,t)=>B=>{if(B.pos[0]===-1)return;B.linePos=B.pos.map(e=>t.linePos(e));const{line:s,col:n}=B.linePos[0];B.message+=` at line ${s}, column ${n}`;let r=n-1;let i=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&i.length>80){const e=Math.min(r-39,i.length-79);i="…"+i.substring(e);r-=e-1}if(i.length>80)i=i.substring(0,79)+"…";if(s>1&&/^ *$/.test(i.substring(0,r))){let B=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);if(B.length>80)B=B.substring(0,79)+"…\n";i=B+i}if(/[^ ]/.test(i)){let e=1;const t=B.linePos[1];if(t?.line===s&&t.col>n){e=Math.max(1,Math.min(t.col-n,80-r))}const a=" ".repeat(r)+"^".repeat(e);B.message+=`:\n\n${i}\n${a}\n`}};t.YAMLError=YAMLError;t.YAMLParseError=YAMLParseError;t.YAMLWarning=YAMLWarning;t.prettifyError=prettifyError},8815:(e,t,B)=>{"use strict";var s=B(9984);var n=B(3021);var r=B(5840);var i=B(1464);var a=B(4065);var o=B(1127);var l=B(7165);var c=B(3301);var C=B(4454);var u=B(2223);var f=B(3461);var h=B(361);var p=B(6628);var g=B(3456);var m=B(4047);var d=B(204);t.Composer=s.Composer;t.Document=n.Document;t.Schema=r.Schema;t.YAMLError=i.YAMLError;t.YAMLParseError=i.YAMLParseError;t.YAMLWarning=i.YAMLWarning;t.Alias=a.Alias;t.isAlias=o.isAlias;t.isCollection=o.isCollection;t.isDocument=o.isDocument;t.isMap=o.isMap;t.isNode=o.isNode;t.isPair=o.isPair;t.isScalar=o.isScalar;t.isSeq=o.isSeq;t.Pair=l.Pair;t.Scalar=c.Scalar;t.YAMLMap=C.YAMLMap;t.YAMLSeq=u.YAMLSeq;t.CST=f;t.Lexer=h.Lexer;t.LineCounter=p.LineCounter;t.Parser=g.Parser;t.parse=m.parse;t.parseAllDocuments=m.parseAllDocuments;t.parseDocument=m.parseDocument;t.stringify=m.stringify;t.visit=d.visit;t.visitAsync=d.visitAsync},7249:(e,t,B)=>{"use strict";var s=B(932);function debug(e,...t){if(e==="debug")console.log(...t)}function warn(e,t){if(e==="debug"||e==="warn"){if(typeof s.emitWarning==="function")s.emitWarning(t);else console.warn(t)}}t.debug=debug;t.warn=warn},4065:(e,t,B)=>{"use strict";var s=B(1596);var n=B(204);var r=B(1127);var i=B(6673);var a=B(4043);class Alias extends i.NodeBase{constructor(e){super(r.ALIAS);this.source=e;Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let B;if(t?.aliasResolveCache){B=t.aliasResolveCache}else{B=[];n.visit(e,{Node:(e,t)=>{if(r.isAlias(t)||r.hasAnchor(t))B.push(t)}});if(t)t.aliasResolveCache=B}let s=undefined;for(const e of B){if(e===this)break;if(e.anchor===this.source)s=e}return s}toJSON(e,t){if(!t)return{source:this.source};const{anchors:B,doc:s,maxAliasCount:n}=t;const r=this.resolve(s,t);if(!r){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let i=B.get(r);if(!i){a.toJS(r,null,t);i=B.get(r)}if(i?.res===undefined){const e="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(e)}if(n>=0){i.count+=1;if(i.aliasCount===0)i.aliasCount=getAliasCount(s,r,B);if(i.count*i.aliasCount>n){const e="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(e)}}return i.res}toString(e,t,B){const n=`*${this.source}`;if(e){s.anchorIsValid(this.source);if(e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${n} `}return n}}function getAliasCount(e,t,B){if(r.isAlias(t)){const s=t.resolve(e);const n=B&&s&&B.get(s);return n?n.count*n.aliasCount:0}else if(r.isCollection(t)){let s=0;for(const n of t.items){const t=getAliasCount(e,n,B);if(t>s)s=t}return s}else if(r.isPair(t)){const s=getAliasCount(e,t.key,B);const n=getAliasCount(e,t.value,B);return Math.max(s,n)}return 1}t.Alias=Alias},101:(e,t,B)=>{"use strict";var s=B(2404);var n=B(1127);var r=B(6673);function collectionFromPath(e,t,B){let n=B;for(let e=t.length-1;e>=0;--e){const B=t[e];if(typeof B==="number"&&Number.isInteger(B)&&B>=0){const e=[];e[B]=n;n=e}else{n=new Map([[B,n]])}}return s.createNode(n,undefined,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const isEmptyPath=e=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class Collection extends r.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:true,enumerable:false,writable:true})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t);if(this.range)t.range=this.range.slice();return t}addIn(e,t){if(isEmptyPath(e))this.add(t);else{const[B,...s]=e;const r=this.get(B,true);if(n.isCollection(r))r.addIn(s,t);else if(r===undefined&&this.schema)this.set(B,collectionFromPath(this.schema,s,t));else throw new Error(`Expected YAML collection at ${B}. Remaining path: ${s}`)}}deleteIn(e){const[t,...B]=e;if(B.length===0)return this.delete(t);const s=this.get(t,true);if(n.isCollection(s))return s.deleteIn(B);else throw new Error(`Expected YAML collection at ${t}. Remaining path: ${B}`)}getIn(e,t){const[B,...s]=e;const r=this.get(B,true);if(s.length===0)return!t&&n.isScalar(r)?r.value:r;else return n.isCollection(r)?r.getIn(s,t):undefined}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return false;const B=t.value;return B==null||e&&n.isScalar(B)&&B.value==null&&!B.commentBefore&&!B.comment&&!B.tag})}hasIn(e){const[t,...B]=e;if(B.length===0)return this.has(t);const s=this.get(t,true);return n.isCollection(s)?s.hasIn(B):false}setIn(e,t){const[B,...s]=e;if(s.length===0){this.set(B,t)}else{const e=this.get(B,true);if(n.isCollection(e))e.setIn(s,t);else if(e===undefined&&this.schema)this.set(B,collectionFromPath(this.schema,s,t));else throw new Error(`Expected YAML collection at ${B}. Remaining path: ${s}`)}}}t.Collection=Collection;t.collectionFromPath=collectionFromPath;t.isEmptyPath=isEmptyPath},6673:(e,t,B)=>{"use strict";var s=B(3661);var n=B(1127);var r=B(4043);class NodeBase{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:B,onAnchor:i,reviver:a}={}){if(!n.isDocument(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:true,mapAsMap:t===true,mapKeyWarned:false,maxAliasCount:typeof B==="number"?B:100};const l=r.toJS(this,"",o);if(typeof i==="function")for(const{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==="function"?s.applyReviver(a,{"":l},"",l):l}}t.NodeBase=NodeBase},7165:(e,t,B)=>{"use strict";var s=B(2404);var n=B(9748);var r=B(7104);var i=B(1127);function createPair(e,t,B){const n=s.createNode(e,undefined,B);const r=s.createNode(t,undefined,B);return new Pair(n,r)}class Pair{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR});this.key=e;this.value=t}clone(e){let{key:t,value:B}=this;if(i.isNode(t))t=t.clone(e);if(i.isNode(B))B=B.clone(e);return new Pair(t,B)}toJSON(e,t){const B=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,B,this)}toString(e,t,B){return e?.doc?n.stringifyPair(this,e,t,B):JSON.stringify(this)}}t.Pair=Pair;t.createPair=createPair},3301:(e,t,B)=>{"use strict";var s=B(1127);var n=B(6673);var r=B(4043);const isScalarValue=e=>!e||typeof e!=="function"&&typeof e!=="object";class Scalar extends n.NodeBase{constructor(e){super(s.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}}Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE";t.Scalar=Scalar;t.isScalarValue=isScalarValue},4454:(e,t,B)=>{"use strict";var s=B(1212);var n=B(7104);var r=B(101);var i=B(1127);var a=B(7165);var o=B(3301);function findPair(e,t){const B=i.isScalar(t)?t.value:t;for(const s of e){if(i.isPair(s)){if(s.key===t||s.key===B)return s;if(i.isScalar(s.key)&&s.key.value===B)return s}}return undefined}class YAMLMap extends r.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(i.MAP,e);this.items=[]}static from(e,t,B){const{keepUndefined:s,replacer:n}=B;const r=new this(e);const add=(e,i)=>{if(typeof n==="function")i=n.call(t,e,i);else if(Array.isArray(n)&&!n.includes(e))return;if(i!==undefined||s)r.items.push(a.createPair(e,i,B))};if(t instanceof Map){for(const[e,B]of t)add(e,B)}else if(t&&typeof t==="object"){for(const e of Object.keys(t))add(e,t[e])}if(typeof e.sortMapEntries==="function"){r.items.sort(e.sortMapEntries)}return r}add(e,t){let B;if(i.isPair(e))B=e;else if(!e||typeof e!=="object"||!("key"in e)){B=new a.Pair(e,e?.value)}else B=new a.Pair(e.key,e.value);const s=findPair(this.items,B.key);const n=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${B.key} already set`);if(i.isScalar(s.value)&&o.isScalarValue(B.value))s.value.value=B.value;else s.value=B.value}else if(n){const e=this.items.findIndex(e=>n(B,e)<0);if(e===-1)this.items.push(B);else this.items.splice(e,0,B)}else{this.items.push(B)}}delete(e){const t=findPair(this.items,e);if(!t)return false;const B=this.items.splice(this.items.indexOf(t),1);return B.length>0}get(e,t){const B=findPair(this.items,e);const s=B?.value;return(!t&&i.isScalar(s)?s.value:s)??undefined}has(e){return!!findPair(this.items,e)}set(e,t){this.add(new a.Pair(e,t),true)}toJSON(e,t,B){const s=B?new B:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(s);for(const e of this.items)n.addPairToJSMap(t,s,e);return s}toString(e,t,B){if(!e)return JSON.stringify(this);for(const e of this.items){if(!i.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`)}if(!e.allNullValues&&this.hasAllNullValues(false))e=Object.assign({},e,{allNullValues:true});return s.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:B,onComment:t})}}t.YAMLMap=YAMLMap;t.findPair=findPair},2223:(e,t,B)=>{"use strict";var s=B(2404);var n=B(1212);var r=B(101);var i=B(1127);var a=B(3301);var o=B(4043);class YAMLSeq extends r.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(i.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){const t=asItemIndex(e);if(typeof t!=="number")return false;const B=this.items.splice(t,1);return B.length>0}get(e,t){const B=asItemIndex(e);if(typeof B!=="number")return undefined;const s=this.items[B];return!t&&i.isScalar(s)?s.value:s}has(e){const t=asItemIndex(e);return typeof t==="number"&&t=0?t:null}t.YAMLSeq=YAMLSeq},7104:(e,t,B)=>{"use strict";var s=B(7249);var n=B(452);var r=B(2148);var i=B(1127);var a=B(4043);function addPairToJSMap(e,t,{key:B,value:s}){if(i.isNode(B)&&B.addToJSMap)B.addToJSMap(e,t,s);else if(n.isMergeKey(e,B))n.addMergeToJSMap(e,t,s);else{const n=a.toJS(B,"",e);if(t instanceof Map){t.set(n,a.toJS(s,n,e))}else if(t instanceof Set){t.add(n)}else{const r=stringifyKey(B,n,e);const i=a.toJS(s,r,e);if(r in t)Object.defineProperty(t,r,{value:i,writable:true,enumerable:true,configurable:true});else t[r]=i}}return t}function stringifyKey(e,t,B){if(t===null)return"";if(typeof t!=="object")return String(t);if(i.isNode(e)&&B?.doc){const t=r.createStringifyContext(B.doc,{});t.anchors=new Set;for(const e of B.anchors.keys())t.anchors.add(e.anchor);t.inFlow=true;t.inStringifyKey=true;const n=e.toString(t);if(!B.mapKeyWarned){let e=JSON.stringify(n);if(e.length>40)e=e.substring(0,36)+'..."';s.warn(B.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`);B.mapKeyWarned=true}return n}return JSON.stringify(t)}t.addPairToJSMap=addPairToJSMap},1127:(e,t)=>{"use strict";const B=Symbol.for("yaml.alias");const s=Symbol.for("yaml.document");const n=Symbol.for("yaml.map");const r=Symbol.for("yaml.pair");const i=Symbol.for("yaml.scalar");const a=Symbol.for("yaml.seq");const o=Symbol.for("yaml.node.type");const isAlias=e=>!!e&&typeof e==="object"&&e[o]===B;const isDocument=e=>!!e&&typeof e==="object"&&e[o]===s;const isMap=e=>!!e&&typeof e==="object"&&e[o]===n;const isPair=e=>!!e&&typeof e==="object"&&e[o]===r;const isScalar=e=>!!e&&typeof e==="object"&&e[o]===i;const isSeq=e=>!!e&&typeof e==="object"&&e[o]===a;function isCollection(e){if(e&&typeof e==="object")switch(e[o]){case n:case a:return true}return false}function isNode(e){if(e&&typeof e==="object")switch(e[o]){case B:case n:case i:case a:return true}return false}const hasAnchor=e=>(isScalar(e)||isCollection(e))&&!!e.anchor;t.ALIAS=B;t.DOC=s;t.MAP=n;t.NODE_TYPE=o;t.PAIR=r;t.SCALAR=i;t.SEQ=a;t.hasAnchor=hasAnchor;t.isAlias=isAlias;t.isCollection=isCollection;t.isDocument=isDocument;t.isMap=isMap;t.isNode=isNode;t.isPair=isPair;t.isScalar=isScalar;t.isSeq=isSeq},4043:(e,t,B)=>{"use strict";var s=B(1127);function toJS(e,t,B){if(Array.isArray(e))return e.map((e,t)=>toJS(e,String(t),B));if(e&&typeof e.toJSON==="function"){if(!B||!s.hasAnchor(e))return e.toJSON(t,B);const n={aliasCount:0,count:1,res:undefined};B.anchors.set(e,n);B.onCreate=e=>{n.res=e;delete B.onCreate};const r=e.toJSON(t,B);if(B.onCreate)B.onCreate(r);return r}if(typeof e==="bigint"&&!B?.keep)return Number(e);return e}t.toJS=toJS},110:(e,t,B)=>{"use strict";var s=B(8913);var n=B(6842);var r=B(1464);var i=B(3069);function resolveAsScalar(e,t=true,B){if(e){const _onError=(e,t,s)=>{const n=typeof e==="number"?e:Array.isArray(e)?e[0]:e.offset;if(B)B(n,t,s);else throw new r.YAMLParseError([n,n+1],t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return n.resolveFlowScalar(e,t,_onError);case"block-scalar":return s.resolveBlockScalar({options:{strict:t}},e,_onError)}}return null}function createScalarToken(e,t){const{implicitKey:B=false,indent:s,inFlow:n=false,offset:r=-1,type:a="PLAIN"}=t;const o=i.stringifyString({type:a,value:e},{implicitKey:B,indent:s>0?" ".repeat(s):"",inFlow:n,options:{blockQuote:true,lineWidth:-1}});const l=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(o[0]){case"|":case">":{const e=o.indexOf("\n");const t=o.substring(0,e);const B=o.substring(e+1)+"\n";const n=[{type:"block-scalar-header",offset:r,indent:s,source:t}];if(!addEndtoBlockProps(n,l))n.push({type:"newline",offset:-1,indent:s,source:"\n"});return{type:"block-scalar",offset:r,indent:s,props:n,source:B}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:o,end:l};default:return{type:"scalar",offset:r,indent:s,source:o,end:l}}}function setScalarValue(e,t,B={}){let{afterKey:s=false,implicitKey:n=false,inFlow:r=false,type:a}=B;let o="indent"in e?e.indent:null;if(s&&typeof o==="number")o+=2;if(!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=t.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}const l=i.stringifyString({type:a,value:t},{implicitKey:n||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:r,options:{blockQuote:true,lineWidth:-1}});switch(l[0]){case"|":case">":setBlockScalarValue(e,l);break;case'"':setFlowScalarValue(e,l,"double-quoted-scalar");break;case"'":setFlowScalarValue(e,l,"single-quoted-scalar");break;default:setFlowScalarValue(e,l,"scalar")}}function setBlockScalarValue(e,t){const B=t.indexOf("\n");const s=t.substring(0,B);const n=t.substring(B+1)+"\n";if(e.type==="block-scalar"){const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");t.source=s;e.source=n}else{const{offset:t}=e;const B="indent"in e?e.indent:-1;const r=[{type:"block-scalar-header",offset:t,indent:B,source:s}];if(!addEndtoBlockProps(r,"end"in e?e.end:undefined))r.push({type:"newline",offset:-1,indent:B,source:"\n"});for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:"block-scalar",indent:B,props:r,source:n})}}function addEndtoBlockProps(e,t){if(t)for(const B of t)switch(B.type){case"space":case"comment":e.push(B);break;case"newline":e.push(B);return true}return false}function setFlowScalarValue(e,t,B){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=B;e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let n=t.length;if(e.props[0].type==="block-scalar-header")n-=e.props[0].source.length;for(const e of s)e.offset+=n;delete e.props;Object.assign(e,{type:B,source:t,end:s});break}case"block-map":case"block-seq":{const s=e.offset+t.length;const n={type:"newline",offset:s,indent:e.indent,source:"\n"};delete e.items;Object.assign(e,{type:B,source:t,end:[n]});break}default:{const s="indent"in e?e.indent:-1;const n="end"in e&&Array.isArray(e.end)?e.end.filter(e=>e.type==="space"||e.type==="comment"||e.type==="newline"):[];for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:B,indent:s,source:t,end:n})}}}t.createScalarToken=createScalarToken;t.resolveAsScalar=resolveAsScalar;t.setScalarValue=setScalarValue},1733:(e,t)=>{"use strict";const stringify=e=>"type"in e?stringifyToken(e):stringifyItem(e);function stringifyToken(e){switch(e.type){case"block-scalar":{let t="";for(const B of e.props)t+=stringifyToken(B);return t+e.source}case"block-map":case"block-seq":{let t="";for(const B of e.items)t+=stringifyItem(B);return t}case"flow-collection":{let t=e.start.source;for(const B of e.items)t+=stringifyItem(B);for(const B of e.end)t+=B.source;return t}case"document":{let t=stringifyItem(e);if(e.end)for(const B of e.end)t+=B.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const B of e.end)t+=B.source;return t}}}function stringifyItem({start:e,key:t,sep:B,value:s}){let n="";for(const t of e)n+=t.source;if(t)n+=stringifyToken(t);if(B)for(const e of B)n+=e.source;if(s)n+=stringifyToken(s);return n}t.stringify=stringify},7715:(e,t)=>{"use strict";const B=Symbol("break visit");const s=Symbol("skip children");const n=Symbol("remove item");function visit(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};_visit(Object.freeze([]),e,t)}visit.BREAK=B;visit.SKIP=s;visit.REMOVE=n;visit.itemAtPath=(e,t)=>{let B=e;for(const[e,s]of t){const t=B?.[e];if(t&&"items"in t){B=t.items[s]}else return undefined}return B};visit.parentCollection=(e,t)=>{const B=visit.itemAtPath(e,t.slice(0,-1));const s=t[t.length-1][0];const n=B?.[s];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function _visit(e,t,s){let r=s(t,e);if(typeof r==="symbol")return r;for(const i of["key","value"]){const a=t[i];if(a&&"items"in a){for(let t=0;t{"use strict";var s=B(110);var n=B(1733);var r=B(7715);const i="\ufeff";const a="";const o="";const l="";const isCollection=e=>!!e&&"items"in e;const isScalar=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function prettyToken(e){switch(e){case i:return"";case a:return"";case o:return"";case l:return"";default:return JSON.stringify(e)}}function tokenType(e){switch(e){case i:return"byte-order-mark";case a:return"doc-mode";case o:return"flow-error-end";case l:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}t.createScalarToken=s.createScalarToken;t.resolveAsScalar=s.resolveAsScalar;t.setScalarValue=s.setScalarValue;t.stringify=n.stringify;t.visit=r.visit;t.BOM=i;t.DOCUMENT=a;t.FLOW_END=o;t.SCALAR=l;t.isCollection=isCollection;t.isScalar=isScalar;t.prettyToken=prettyToken;t.tokenType=tokenType},361:(e,t,B)=>{"use strict";var s=B(3461);function isEmpty(e){switch(e){case undefined:case" ":case"\n":case"\r":case"\t":return true;default:return false}}const n=new Set("0123456789ABCDEFabcdef");const r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");const i=new Set(",[]{}");const a=new Set(" ,[]{}\n\r\t");const isNotAnchorChar=e=>!e||a.has(e);class Lexer{constructor(){this.atEnd=false;this.blockScalarIndent=-1;this.blockScalarKeep=false;this.buffer="";this.flowKey=false;this.flowLevel=0;this.indentNext=0;this.indentValue=0;this.lineEndPos=null;this.next=null;this.pos=0}*lex(e,t=false){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e;this.lineEndPos=null}this.atEnd=!t;let B=this.next??"stream";while(B&&(t||this.hasChars(1)))B=yield*this.parseNext(B)}atLineEnd(){let e=this.pos;let t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t==="\n")return true;if(t==="\r")return this.buffer[e+1]==="\n";return false}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let B=0;while(t===" ")t=this.buffer[++B+e];if(t==="\r"){const t=this.buffer[B+e+1];if(t==="\n"||!t&&!this.atEnd)return e+B+1}return t==="\n"||B>=this.indentNext||!t&&!this.atEnd?e+B:-1}if(t==="-"||t==="."){const t=this.buffer.substr(e,3);if((t==="---"||t==="...")&&isEmpty(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&ethis.indentValue&&!isEmpty(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&isEmpty(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));this.indentNext=this.indentValue+1;this.indentValue+=e;return"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(true);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case undefined:yield*this.pushNewline();return yield*this.parseLineStart();case"{":case"[":yield*this.pushCount(1);this.flowKey=false;this.flowLevel=1;return"flow";case"}":case"]":yield*this.pushCount(1);return"doc";case"*":yield*this.pushUntil(isNotAnchorChar);return"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":t+=(yield*this.parseBlockScalarHeader());t+=(yield*this.pushSpaces(true));yield*this.pushCount(e.length-t);yield*this.pushNewline();return yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t;let B=-1;do{e=yield*this.pushNewline();if(e>0){t=yield*this.pushSpaces(false);this.indentValue=B=t}else{t=0}t+=(yield*this.pushSpaces(true))}while(e+t>0);const n=this.getLine();if(n===null)return this.setNext("flow");if(B!==-1&&B"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(e=>isEmpty(e)||e==="#")}*parseBlockScalar(){let e=this.pos-1;let t=0;let B;e:for(let s=this.pos;B=this.buffer[s];++s){switch(B){case" ":t+=1;break;case"\n":e=s;t=0;break;case"\r":{const e=this.buffer[s+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if(e==="\n")break}default:break e}}if(!B&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else{this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext)}do{const t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf("\n",t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;B=this.buffer[n];while(B===" ")B=this.buffer[++n];if(B==="\t"){while(B==="\t"||B===" "||B==="\r"||B==="\n")B=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep){do{let B=e-1;let s=this.buffer[B];if(s==="\r")s=this.buffer[--B];const n=B;while(s===" ")s=this.buffer[--B];if(s==="\n"&&B>=this.pos&&B+1+t>n)e=B;else break}while(true)}yield s.SCALAR;yield*this.pushToIndex(e+1,true);return yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1;let B=this.pos-1;let n;while(n=this.buffer[++B]){if(n===":"){const s=this.buffer[B+1];if(isEmpty(s)||e&&i.has(s))break;t=B}else if(isEmpty(n)){let s=this.buffer[B+1];if(n==="\r"){if(s==="\n"){B+=1;n="\n";s=this.buffer[B+1]}else t=B}if(s==="#"||e&&i.has(s))break;if(n==="\n"){const e=this.continueScalar(B+1);if(e===-1)break;B=Math.max(B,e-2)}}else{if(e&&i.has(n))break;t=B}}if(!n&&!this.atEnd)return this.setNext("plain-scalar");yield s.SCALAR;yield*this.pushToIndex(t+1,true);return e?"flow":"doc"}*pushCount(e){if(e>0){yield this.buffer.substr(this.pos,e);this.pos+=e;return e}return 0}*pushToIndex(e,t){const B=this.buffer.slice(this.pos,e);if(B){yield B;this.pos+=B.length;return B.length}else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(true){switch(this.charAt(0)){case"!":e+=(yield*this.pushTag());e+=(yield*this.pushSpaces(true));continue e;case"&":e+=(yield*this.pushUntil(isNotAnchorChar));e+=(yield*this.pushSpaces(true));continue e;case"-":case"?":case":":{const t=this.flowLevel>0;const B=this.charAt(1);if(isEmpty(B)||t&&i.has(B)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=false;e+=(yield*this.pushCount(1));e+=(yield*this.pushSpaces(true));continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2;let t=this.buffer[e];while(!isEmpty(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,false)}else{let e=this.pos+1;let t=this.buffer[e];while(t){if(r.has(t))t=this.buffer[++e];else if(t==="%"&&n.has(this.buffer[e+1])&&n.has(this.buffer[e+2])){t=this.buffer[e+=3]}else break}return yield*this.pushToIndex(e,false)}}*pushNewline(){const e=this.buffer[this.pos];if(e==="\n")return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)==="\n")return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1;let B;do{B=this.buffer[++t]}while(B===" "||e&&B==="\t");const s=t-this.pos;if(s>0){yield this.buffer.substr(this.pos,s);this.pos=t}return s}*pushUntil(e){let t=this.pos;let B=this.buffer[t];while(!e(B))B=this.buffer[++t];return yield*this.pushToIndex(t,false)}}t.Lexer=Lexer},6628:(e,t)=>{"use strict";class LineCounter{constructor(){this.lineStarts=[];this.addNewLine=e=>this.lineStarts.push(e);this.linePos=e=>{let t=0;let B=this.lineStarts.length;while(t>1;if(this.lineStarts[s]{"use strict";var s=B(932);var n=B(3461);var r=B(361);function includesToken(e,t){for(let B=0;B=0){switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}}while(e[++t]?.type==="space"){}return e.splice(t,e.length)}function arrayPushArray(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let B=0;B0)yield*this.pop()}get sourceToken(){const e={type:this.type,offset:this.offset,indent:this.indent,source:this.source};return e}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t){const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}else if(this.stack.length===0){yield t}else{const e=this.peek(1);if(t.type==="block-scalar"){t.indent="indent"in e?e.indent:0}else if(t.type==="flow-collection"&&e.type==="document"){t.indent=0}if(t.type==="flow-collection")fixFlowSeqItems(t);switch(e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const B=e.items[e.items.length-1];if(B.value){e.items.push({start:[],key:t,sep:[]});this.onKeyLine=true;return}else if(B.sep){B.value=t}else{Object.assign(B,{key:t,sep:[]});this.onKeyLine=!B.explicitKey;return}break}case"block-seq":{const B=e.items[e.items.length-1];if(B.value)e.items.push({start:[],value:t});else B.value=t;break}case"flow-collection":{const B=e.items[e.items.length-1];if(!B||B.value)e.items.push({start:[],key:t,sep:[]});else if(B.sep)B.value=t;else Object.assign(B,{key:t,sep:[]});return}default:yield*this.pop();yield*this.pop(t)}if((e.type==="document"||e.type==="block-map"||e.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const B=t.items[t.items.length-1];if(B&&!B.sep&&!B.value&&B.start.length>0&&findNonEmptyIndex(B.start)===-1&&(t.indent===0||B.start.every(e=>e.type!=="comment"||e.indent=e.indent){const B=!this.onKeyLine&&this.indent===e.indent;const s=B&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let n=[];if(s&&t.sep&&!t.value){const B=[];for(let s=0;se.indent)B.length=0;break;default:B.length=0}}if(B.length>=2)n=t.sep.splice(B[1])}switch(this.type){case"anchor":case"tag":if(s||t.value){n.push(this.sourceToken);e.items.push({start:n});this.onKeyLine=true}else if(t.sep){t.sep.push(this.sourceToken)}else{t.start.push(this.sourceToken)}return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey){t.start.push(this.sourceToken);t.explicitKey=true}else if(s||t.value){n.push(this.sourceToken);e.items.push({start:n,explicitKey:true})}else{this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]})}this.onKeyLine=true;return;case"map-value-ind":if(t.explicitKey){if(!t.sep){if(includesToken(t.start,"newline")){Object.assign(t,{key:null,sep:[this.sourceToken]})}else{const e=getFirstKeyStartProps(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value){e.items.push({start:[],key:null,sep:[this.sourceToken]})}else if(includesToken(t.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]})}else if(isFlowToken(t.key)&&!includesToken(t.sep,"newline")){const e=getFirstKeyStartProps(t.start);const B=t.key;const s=t.sep;s.push(this.sourceToken);delete t.key;delete t.sep;this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:B,sep:s}]})}else if(n.length>0){t.sep=t.sep.concat(n,this.sourceToken)}else{t.sep.push(this.sourceToken)}}else{if(!t.sep){Object.assign(t,{key:null,sep:[this.sourceToken]})}else if(t.value||s){e.items.push({start:n,key:null,sep:[this.sourceToken]})}else if(includesToken(t.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]})}else{t.sep.push(this.sourceToken)}}this.onKeyLine=true;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const B=this.flowScalar(this.type);if(s||t.value){e.items.push({start:n,key:B,sep:[]});this.onKeyLine=true}else if(t.sep){this.stack.push(B)}else{Object.assign(t,{key:B,sep:[]});this.onKeyLine=true}return}default:{const s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!includesToken(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(B){e.items.push({start:n})}this.stack.push(s);return}}}}yield*this.pop();yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const B="end"in t.value?t.value.end:undefined;const s=Array.isArray(B)?B[B.length-1]:undefined;if(s?.type==="comment")B?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const B=e.items[e.items.length-2];const s=B?.value?.end;if(Array.isArray(s)){arrayPushArray(s,t.start);s.push(this.sourceToken);e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||includesToken(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop();yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let e;do{yield*this.pop();e=this.peek(1)}while(e?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const B=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:B,sep:[]});else if(t.sep)this.stack.push(B);else Object.assign(t,{key:B,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const B=this.startBlockValue(e);if(B)this.stack.push(B);else{yield*this.pop();yield*this.step()}}else{const t=this.peek(2);if(t.type==="block-map"&&(this.type==="map-value-ind"&&t.indent===e.indent||this.type==="newline"&&!t.items[t.items.length-1].sep)){yield*this.pop();yield*this.step()}else if(this.type==="map-value-ind"&&t.type!=="flow-collection"){const B=getPrevProps(t);const s=getFirstKeyStartProps(B);fixFlowSeqItems(e);const n=e.end.splice(1,e.end.length);n.push(this.sourceToken);const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=true;this.stack[this.stack.length-1]=r}else{yield*this.lineEnd(e)}}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;while(e!==0){this.onNewLine(this.offset+e);e=this.source.indexOf("\n",e)+1}}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=true;const t=getPrevProps(e);const B=getFirstKeyStartProps(t);B.push(this.sourceToken);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:B,explicitKey:true}]}}case"map-value-ind":{this.onKeyLine=true;const t=getPrevProps(e);const B=getFirstKeyStartProps(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:B,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return false;if(this.indent<=t)return false;return e.every(e=>e.type==="newline"||e.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop();yield*this.step();break;case"newline":this.onKeyLine=false;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}t.Parser=Parser},4047:(e,t,B)=>{"use strict";var s=B(9984);var n=B(3021);var r=B(1464);var i=B(7249);var a=B(1127);var o=B(6628);var l=B(3456);function parseOptions(e){const t=e.prettyErrors!==false;const B=e.lineCounter||t&&new o.LineCounter||null;return{lineCounter:B,prettyErrors:t}}function parseAllDocuments(e,t={}){const{lineCounter:B,prettyErrors:n}=parseOptions(t);const i=new l.Parser(B?.addNewLine);const a=new s.Composer(t);const o=Array.from(a.compose(i.parse(e)));if(n&&B)for(const t of o){t.errors.forEach(r.prettifyError(e,B));t.warnings.forEach(r.prettifyError(e,B))}if(o.length>0)return o;return Object.assign([],{empty:true},a.streamInfo())}function parseDocument(e,t={}){const{lineCounter:B,prettyErrors:n}=parseOptions(t);const i=new l.Parser(B?.addNewLine);const a=new s.Composer(t);let o=null;for(const t of a.compose(i.parse(e),true,e.length)){if(!o)o=t;else if(o.options.logLevel!=="silent"){o.errors.push(new r.YAMLParseError(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}if(n&&B){o.errors.forEach(r.prettifyError(e,B));o.warnings.forEach(r.prettifyError(e,B))}return o}function parse(e,t,B){let s=undefined;if(typeof t==="function"){s=t}else if(B===undefined&&t&&typeof t==="object"){B=t}const n=parseDocument(e,B);if(!n)return null;n.warnings.forEach(e=>i.warn(n.options.logLevel,e));if(n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];else n.errors=[]}return n.toJS(Object.assign({reviver:s},B))}function stringify(e,t,B){let s=null;if(typeof t==="function"||Array.isArray(t)){s=t}else if(B===undefined&&t){B=t}if(typeof B==="string")B=B.length;if(typeof B==="number"){const e=Math.round(B);B=e<1?undefined:e>8?{indent:8}:{indent:e}}if(e===undefined){const{keepUndefined:e}=B??t??{};if(!e)return undefined}if(a.isDocument(e)&&!s)return e.toString(B);return new n.Document(e,s,B).toString(B)}t.parse=parse;t.parseAllDocuments=parseAllDocuments;t.parseDocument=parseDocument;t.stringify=stringify},5840:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7451);var r=B(1706);var i=B(6464);var a=B(18);const sortMapEntriesByKey=(e,t)=>e.keyt.key?1:0;class Schema{constructor({compat:e,customTags:t,merge:B,resolveKnownTags:o,schema:l,sortMapEntries:c,toStringDefaults:C}){this.compat=Array.isArray(e)?a.getTags(e,"compat"):e?a.getTags(null,e):null;this.name=typeof l==="string"&&l||"core";this.knownTags=o?a.coreKnownTags:{};this.tags=a.getTags(t,this.name,B);this.toStringOptions=C??null;Object.defineProperty(this,s.MAP,{value:n.map});Object.defineProperty(this,s.SCALAR,{value:i.string});Object.defineProperty(this,s.SEQ,{value:r.seq});this.sortMapEntries=typeof c==="function"?c:c===true?sortMapEntriesByKey:null}clone(){const e=Object.create(Schema.prototype,Object.getOwnPropertyDescriptors(this));e.tags=this.tags.slice();return e}}t.Schema=Schema},7451:(e,t,B)=>{"use strict";var s=B(1127);var n=B(4454);const r={collection:"map",default:true,nodeClass:n.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!s.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,B)=>n.YAMLMap.from(e,t,B)};t.map=r},3632:(e,t,B)=>{"use strict";var s=B(3301);const n={identify:e=>e==null,createNode:()=>new s.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new s.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&n.test.test(e)?e:t.options.nullStr};t.nullTag=n},1706:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2223);const r={collection:"seq",default:true,nodeClass:n.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!s.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,B)=>n.YAMLSeq.from(e,t,B)};t.seq=r},6464:(e,t,B)=>{"use strict";var s=B(3069);const n={identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,B,n){t=Object.assign({actualString:true},t);return s.stringifyString(e,t,B,n)}};t.string=n},3959:(e,t,B)=>{"use strict";var s=B(3301);const n={identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new s.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},B){if(e&&n.test.test(e)){const B=e[0]==="t"||e[0]==="T";if(t===B)return e}return t?B.options.trueStr:B.options.falseStr}};t.boolTag=n},8405:(e,t,B)=>{"use strict";var s=B(3301);var n=B(8689);const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber};const i={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}};const a={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new s.Scalar(parseFloat(e));const B=e.indexOf(".");if(B!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-B-1;return t},stringify:n.stringifyNumber};t.float=a;t.floatExp=i;t.floatNaN=r},9874:(e,t,B)=>{"use strict";var s=B(8689);const intIdentify=e=>typeof e==="bigint"||Number.isInteger(e);const intResolve=(e,t,B,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),B);function intStringify(e,t,B){const{value:n}=e;if(intIdentify(n)&&n>=0)return B+n.toString(t);return s.stringifyNumber(e)}const n={identify:e=>intIdentify(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,B)=>intResolve(e,2,8,B),stringify:e=>intStringify(e,8,"0o")};const r={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,B)=>intResolve(e,0,10,B),stringify:s.stringifyNumber};const i={identify:e=>intIdentify(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,B)=>intResolve(e,2,16,B),stringify:e=>intStringify(e,16,"0x")};t.int=r;t.intHex=i;t.intOct=n},896:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(3959);var o=B(8405);var l=B(9874);const c=[s.map,r.seq,i.string,n.nullTag,a.boolTag,l.intOct,l.int,l.intHex,o.floatNaN,o.floatExp,o.float];t.schema=c},3559:(e,t,B)=>{"use strict";var s=B(3301);var n=B(7451);var r=B(1706);function intIdentify(e){return typeof e==="bigint"||Number.isInteger(e)}const stringifyJSON=({value:e})=>JSON.stringify(e);const i=[{identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:stringifyJSON},{identify:e=>e==null,createNode:()=>new s.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:stringifyJSON},{identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:stringifyJSON},{identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:B})=>B?BigInt(e):parseInt(e,10),stringify:({value:e})=>intIdentify(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:stringifyJSON}];const a={default:true,tag:"",test:/^/,resolve(e,t){t(`Unresolved plain scalar ${JSON.stringify(e)}`);return e}};const o=[n.map,r.seq].concat(i,a);t.schema=o},18:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(3959);var o=B(8405);var l=B(9874);var c=B(896);var C=B(3559);var u=B(6083);var f=B(452);var h=B(303);var p=B(8385);var g=B(5913);var m=B(1528);var d=B(6752);const D=new Map([["core",c.schema],["failsafe",[s.map,r.seq,i.string]],["json",C.schema],["yaml11",g.schema],["yaml-1.1",g.schema]]);const E={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:d.floatTime,int:l.int,intHex:l.intHex,intOct:l.intOct,intTime:d.intTime,map:s.map,merge:f.merge,null:n.nullTag,omap:h.omap,pairs:p.pairs,seq:r.seq,set:m.set,timestamp:d.timestamp};const y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":f.merge,"tag:yaml.org,2002:omap":h.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":m.set,"tag:yaml.org,2002:timestamp":d.timestamp};function getTags(e,t,B){const s=D.get(t);if(s&&!e){return B&&!s.includes(f.merge)?s.concat(f.merge):s.slice()}let n=s;if(!n){if(Array.isArray(e))n=[];else{const e=Array.from(D.keys()).filter(e=>e!=="yaml11").map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e)){for(const t of e)n=n.concat(t)}else if(typeof e==="function"){n=e(n.slice())}if(B)n=n.concat(f.merge);return n.reduce((e,t)=>{const B=typeof t==="string"?E[t]:t;if(!B){const e=JSON.stringify(t);const B=Object.keys(E).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${B}`)}if(!e.includes(B))e.push(B);return e},[])}t.coreKnownTags=y;t.getTags=getTags},6083:(e,t,B)=>{"use strict";var s=B(181);var n=B(3301);var r=B(3069);const i={identify:e=>e instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof s.Buffer==="function"){return s.Buffer.from(e,"base64")}else if(typeof atob==="function"){const t=atob(e.replace(/[\n\r]/g,""));const B=new Uint8Array(t.length);for(let e=0;e{"use strict";var s=B(3301);function boolStringify({value:e,source:t},B){const s=e?n:r;if(t&&s.test.test(t))return t;return e?B.options.trueStr:B.options.falseStr}const n={identify:e=>e===true,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new s.Scalar(true),stringify:boolStringify};const r={identify:e=>e===false,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new s.Scalar(false),stringify:boolStringify};t.falseTag=r;t.trueTag=n},5782:(e,t,B)=>{"use strict";var s=B(3301);var n=B(8689);const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber};const i={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}};const a={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new s.Scalar(parseFloat(e.replace(/_/g,"")));const B=e.indexOf(".");if(B!==-1){const s=e.substring(B+1).replace(/_/g,"");if(s[s.length-1]==="0")t.minFractionDigits=s.length}return t},stringify:n.stringifyNumber};t.float=a;t.floatExp=i;t.floatNaN=r},873:(e,t,B)=>{"use strict";var s=B(8689);const intIdentify=e=>typeof e==="bigint"||Number.isInteger(e);function intResolve(e,t,B,{intAsBigInt:s}){const n=e[0];if(n==="-"||n==="+")t+=1;e=e.substring(t).replace(/_/g,"");if(s){switch(B){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const t=BigInt(e);return n==="-"?BigInt(-1)*t:t}const r=parseInt(e,B);return n==="-"?-1*r:r}function intStringify(e,t,B){const{value:n}=e;if(intIdentify(n)){const e=n.toString(t);return n<0?"-"+B+e.substr(1):B+e}return s.stringifyNumber(e)}const n={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,B)=>intResolve(e,2,2,B),stringify:e=>intStringify(e,2,"0b")};const r={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,B)=>intResolve(e,1,8,B),stringify:e=>intStringify(e,8,"0")};const i={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,B)=>intResolve(e,0,10,B),stringify:s.stringifyNumber};const a={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,B)=>intResolve(e,2,16,B),stringify:e=>intStringify(e,16,"0x")};t.int=i;t.intBin=n;t.intHex=a;t.intOct=r},452:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);const r="<<";const i={identify:e=>e===r||typeof e==="symbol"&&e.description===r,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(r)),{addToJSMap:addMergeToJSMap}),stringify:()=>r};const isMergeKey=(e,t)=>(i.identify(t)||s.isScalar(t)&&(!t.type||t.type===n.Scalar.PLAIN)&&i.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===i.tag&&e.default);function addMergeToJSMap(e,t,B){const n=resolveAliasValue(e,B);if(s.isSeq(n))for(const B of n.items)mergeValue(e,t,B);else if(Array.isArray(n))for(const B of n)mergeValue(e,t,B);else mergeValue(e,t,n)}function mergeValue(e,t,B){const n=resolveAliasValue(e,B);if(!s.isMap(n))throw new Error("Merge sources must be maps or map aliases");const r=n.toJSON(null,e,Map);for(const[e,B]of r){if(t instanceof Map){if(!t.has(e))t.set(e,B)}else if(t instanceof Set){t.add(e)}else if(!Object.prototype.hasOwnProperty.call(t,e)){Object.defineProperty(t,e,{value:B,writable:true,enumerable:true,configurable:true})}}return t}function resolveAliasValue(e,t){return e&&s.isAlias(t)?t.resolve(e.doc,e):t}t.addMergeToJSMap=addMergeToJSMap;t.isMergeKey=isMergeKey;t.merge=i},303:(e,t,B)=>{"use strict";var s=B(1127);var n=B(4043);var r=B(4454);var i=B(2223);var a=B(8385);class YAMLOMap extends i.YAMLSeq{constructor(){super();this.add=r.YAMLMap.prototype.add.bind(this);this.delete=r.YAMLMap.prototype.delete.bind(this);this.get=r.YAMLMap.prototype.get.bind(this);this.has=r.YAMLMap.prototype.has.bind(this);this.set=r.YAMLMap.prototype.set.bind(this);this.tag=YAMLOMap.tag}toJSON(e,t){if(!t)return super.toJSON(e);const B=new Map;if(t?.onCreate)t.onCreate(B);for(const e of this.items){let r,i;if(s.isPair(e)){r=n.toJS(e.key,"",t);i=n.toJS(e.value,r,t)}else{r=n.toJS(e,"",t)}if(B.has(r))throw new Error("Ordered maps must not include duplicate keys");B.set(r,i)}return B}static from(e,t,B){const s=a.createPairs(e,t,B);const n=new this;n.items=s.items;return n}}YAMLOMap.tag="tag:yaml.org,2002:omap";const o={collection:"seq",identify:e=>e instanceof Map,nodeClass:YAMLOMap,default:false,tag:"tag:yaml.org,2002:omap",resolve(e,t){const B=a.resolvePairs(e,t);const n=[];for(const{key:e}of B.items){if(s.isScalar(e)){if(n.includes(e.value)){t(`Ordered maps must not include duplicate keys: ${e.value}`)}else{n.push(e.value)}}}return Object.assign(new YAMLOMap,B)},createNode:(e,t,B)=>YAMLOMap.from(e,t,B)};t.YAMLOMap=YAMLOMap;t.omap=o},8385:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(3301);var i=B(2223);function resolvePairs(e,t){if(s.isSeq(e)){for(let B=0;B1)t("Each pair must have its own sequence indicator");const e=i.items[0]||new n.Pair(new r.Scalar(null));if(i.commentBefore)e.key.commentBefore=e.key.commentBefore?`${i.commentBefore}\n${e.key.commentBefore}`:i.commentBefore;if(i.comment){const t=e.value??e.key;t.comment=t.comment?`${i.comment}\n${t.comment}`:i.comment}i=e}e.items[B]=s.isPair(i)?i:new n.Pair(i)}}else t("Expected a sequence for this tag");return e}function createPairs(e,t,B){const{replacer:s}=B;const r=new i.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){if(typeof s==="function")e=s.call(t,String(a++),e);let i,o;if(Array.isArray(e)){if(e.length===2){i=e[0];o=e[1]}else throw new TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){const t=Object.keys(e);if(t.length===1){i=t[0];o=e[i]}else{throw new TypeError(`Expected tuple with one key, not ${t.length} keys`)}}else{i=e}r.items.push(n.createPair(i,o,B))}return r}const a={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:resolvePairs,createNode:createPairs};t.createPairs=createPairs;t.pairs=a;t.resolvePairs=resolvePairs},5913:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(6083);var o=B(8398);var l=B(5782);var c=B(873);var C=B(452);var u=B(303);var f=B(8385);var h=B(1528);var p=B(6752);const g=[s.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,l.floatNaN,l.floatExp,l.float,a.binary,C.merge,u.omap,f.pairs,h.set,p.intTime,p.floatTime,p.timestamp];t.schema=g},1528:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(4454);class YAMLSet extends r.YAMLMap{constructor(e){super(e);this.tag=YAMLSet.tag}add(e){let t;if(s.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new n.Pair(e.key,null);else t=new n.Pair(e,null);const B=r.findPair(this.items,t.key);if(!B)this.items.push(t)}get(e,t){const B=r.findPair(this.items,e);return!t&&s.isPair(B)?s.isScalar(B.key)?B.key.value:B.key:B}set(e,t){if(typeof t!=="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const B=r.findPair(this.items,e);if(B&&!t){this.items.splice(this.items.indexOf(B),1)}else if(!B&&t){this.items.push(new n.Pair(e))}}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,B){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(true))return super.toString(Object.assign({},e,{allNullValues:true}),t,B);else throw new Error("Set items must all have null values")}static from(e,t,B){const{replacer:s}=B;const r=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t){if(typeof s==="function")e=s.call(t,e,e);r.items.push(n.createPair(e,null,B))}return r}}YAMLSet.tag="tag:yaml.org,2002:set";const i={collection:"map",identify:e=>e instanceof Set,nodeClass:YAMLSet,default:false,tag:"tag:yaml.org,2002:set",createNode:(e,t,B)=>YAMLSet.from(e,t,B),resolve(e,t){if(s.isMap(e)){if(e.hasAllNullValues(true))return Object.assign(new YAMLSet,e);else t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};t.YAMLSet=YAMLSet;t.set=i},6752:(e,t,B)=>{"use strict";var s=B(8689);function parseSexagesimal(e,t){const B=e[0];const s=B==="-"||B==="+"?e.substring(1):e;const num=e=>t?BigInt(e):Number(e);const n=s.replace(/_/g,"").split(":").reduce((e,t)=>e*num(60)+num(t),num(0));return B==="-"?num(-1)*n:n}function stringifySexagesimal(e){let{value:t}=e;let num=e=>e;if(typeof t==="bigint")num=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return s.stringifyNumber(e);let B="";if(t<0){B="-";t*=num(-1)}const n=num(60);const r=[t%n];if(t<60){r.unshift(0)}else{t=(t-r[0])/n;r.unshift(t%n);if(t>=60){t=(t-r[0])/n;r.unshift(t)}}return B+r.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const n={identify:e=>typeof e==="bigint"||Number.isInteger(e),default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:B})=>parseSexagesimal(e,B),stringify:stringifySexagesimal};const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>parseSexagesimal(e,false),stringify:stringifySexagesimal};const i={identify:e=>e instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})"+"(?:"+"(?:t|T|[ \\t]+)"+"([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)"+"(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?"+")?$"),resolve(e){const t=e.match(i.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,B,s,n,r,a,o]=t.map(Number);const l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(B,s-1,n,r||0,a||0,o||0,l);const C=t[8];if(C&&C!=="Z"){let e=parseSexagesimal(C,false);if(Math.abs(e)<30)e*=60;c-=6e4*e}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};t.floatTime=r;t.intTime=n;t.timestamp=i},4475:(e,t)=>{"use strict";const B="flow";const s="block";const n="quoted";function foldFlowLines(e,t,B="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return e;if(ii-Math.max(2,a))C.push(0);else f=i-r}let h=undefined;let p=undefined;let g=false;let m=-1;let d=-1;let D=-1;if(B===s){m=consumeMoreIndentedLines(e,m,t.length);if(m!==-1)f=m+c}for(let r;r=e[m+=1];){if(B===n&&r==="\\"){d=m;switch(e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}D=m}if(r==="\n"){if(B===s)m=consumeMoreIndentedLines(e,m,t.length);f=m+t.length+c;h=undefined}else{if(r===" "&&p&&p!==" "&&p!=="\n"&&p!=="\t"){const t=e[m+1];if(t&&t!==" "&&t!=="\n"&&t!=="\t")h=m}if(m>=f){if(h){C.push(h);f=h+c;h=undefined}else if(B===n){while(p===" "||p==="\t"){p=r;r=e[m+=1];g=true}const t=m>D+1?m-2:d-1;if(u[t])return e;C.push(t);u[t]=true;f=t+c;h=undefined}else{g=true}}}p=r}if(g&&l)l();if(C.length===0)return e;if(o)o();let E=e.slice(0,C[0]);for(let s=0;s{"use strict";var s=B(1596);var n=B(1127);var r=B(9799);var i=B(3069);function createStringifyContext(e,t){const B=Object.assign({blockQuote:true,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trailingComma:false,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let s;switch(B.collectionStyle){case"block":s=false;break;case"flow":s=true;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:B.flowCollectionPadding?" ":"",indent:"",indentStep:typeof B.indent==="number"?" ".repeat(B.indent):" ",inFlow:s,options:B}}function getTagObject(e,t){if(t.tag){const B=e.filter(e=>e.tag===t.tag);if(B.length>0)return B.find(e=>e.format===t.format)??B[0]}let B=undefined;let s;if(n.isScalar(t)){s=t.value;let n=e.filter(e=>e.identify?.(s));if(n.length>1){const e=n.filter(e=>e.test);if(e.length>0)n=e}B=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else{s=t;B=e.find(e=>e.nodeClass&&s instanceof e.nodeClass)}if(!B){const e=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${e} value`)}return B}function stringifyProps(e,t,{anchors:B,doc:r}){if(!r.directives)return"";const i=[];const a=(n.isScalar(e)||n.isCollection(e))&&e.anchor;if(a&&s.anchorIsValid(a)){B.add(a);i.push(`&${a}`)}const o=e.tag??(t.default?null:t.tag);if(o)i.push(r.directives.tagString(o));return i.join(" ")}function stringify(e,t,B,s){if(n.isPair(e))return e.toString(t,B,s);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e)){throw new TypeError(`Cannot stringify circular structure without alias nodes`)}else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let r=undefined;const a=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>r=e});r??(r=getTagObject(t.doc.schema.tags,a));const o=stringifyProps(a,r,t);if(o.length>0)t.indentAtStart=(t.indentAtStart??0)+o.length+1;const l=typeof r.stringify==="function"?r.stringify(a,t,B,s):n.isScalar(a)?i.stringifyString(a,t,B,s):a.toString(t,B,s);if(!o)return l;return n.isScalar(a)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}\n${t.indent}${l}`}t.createStringifyContext=createStringifyContext;t.stringify=stringify},1212:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2148);var r=B(9799);function stringifyCollection(e,t,B){const s=t.inFlow??e.flow;const n=s?stringifyFlowCollection:stringifyBlockCollection;return n(e,t,B)}function stringifyBlockCollection({comment:e,items:t},B,{blockItemPrefix:i,flowChars:a,itemIndent:o,onChompKeep:l,onComment:c}){const{indent:C,options:{commentString:u}}=B;const f=Object.assign({},B,{indent:o,type:null});let h=false;const p=[];for(let e=0;el=null,()=>h=true);if(l)c+=r.lineComment(c,o,u(l));if(h&&l)h=false;p.push(i+c)}let g;if(p.length===0){g=a.start+a.end}else{g=p[0];for(let e=1;eo=null);u||(u=h.length>f||l.includes("\n"));if(B0){u||(u=h.reduce((e,t)=>e+t.length+2,2)+(l.length+2)>t.options.lineWidth)}if(u){l+=","}}if(o)l+=r.lineComment(l,i,c(o));h.push(l);f=h.length}const{start:p,end:g}=B;if(h.length===0){return p+g}else{if(!u){const e=h.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(u){let e=p;for(const t of h)e+=t?`\n${o}${a}${t}`:"\n";return`${e}\n${a}${g}`}else{return`${p}${l}${h.join(" ")}${l}${g}`}}}function addCommentBefore({indent:e,options:{commentString:t}},B,s,n){if(s&&n)s=s.replace(/^\n+/,"");if(s){const n=r.indentComment(t(s),e);B.push(n.trimStart())}}t.stringifyCollection=stringifyCollection},9799:(e,t)=>{"use strict";const stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function indentComment(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}const lineComment=(e,t,B)=>e.endsWith("\n")?indentComment(B,t):B.includes("\n")?"\n"+indentComment(B,t):(e.endsWith(" ")?"":" ")+B;t.indentComment=indentComment;t.lineComment=lineComment;t.stringifyComment=stringifyComment},6829:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2148);var r=B(9799);function stringifyDocument(e,t){const B=[];let i=t.directives===true;if(t.directives!==false&&e.directives){const t=e.directives.toString(e);if(t){B.push(t);i=true}else if(e.directives.docStart)i=true}if(i)B.push("---");const a=n.createStringifyContext(e,t);const{commentString:o}=a.options;if(e.commentBefore){if(B.length!==1)B.unshift("");const t=o(e.commentBefore);B.unshift(r.indentComment(t,""))}let l=false;let c=null;if(e.contents){if(s.isNode(e.contents)){if(e.contents.spaceBefore&&i)B.push("");if(e.contents.commentBefore){const t=o(e.contents.commentBefore);B.push(r.indentComment(t,""))}a.forceBlockIndent=!!e.comment;c=e.contents.comment}const t=c?undefined:()=>l=true;let C=n.stringify(e.contents,a,()=>c=null,t);if(c)C+=r.lineComment(C,"",o(c));if((C[0]==="|"||C[0]===">")&&B[B.length-1]==="---"){B[B.length-1]=`--- ${C}`}else B.push(C)}else{B.push(n.stringify(e.contents,a))}if(e.directives?.docEnd){if(e.comment){const t=o(e.comment);if(t.includes("\n")){B.push("...");B.push(r.indentComment(t,""))}else{B.push(`... ${t}`)}}else{B.push("...")}}else{let t=e.comment;if(t&&l)t=t.replace(/^\n+/,"");if(t){if((!l||c)&&B[B.length-1]!=="")B.push("");B.push(r.indentComment(o(t),""))}}return B.join("\n")+"\n"}t.stringifyDocument=stringifyDocument},8689:(e,t)=>{"use strict";function stringifyNumber({format:e,minFractionDigits:t,tag:B,value:s}){if(typeof s==="bigint")return String(s);const n=typeof s==="number"?s:Number(s);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!B||B==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let e=r.indexOf(".");if(e<0){e=r.length;r+="."}let B=t-(r.length-e-1);while(B-- >0)r+="0"}return r}t.stringifyNumber=stringifyNumber},9748:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(2148);var i=B(9799);function stringifyPair({key:e,value:t},B,a,o){const{allNullValues:l,doc:c,indent:C,indentStep:u,options:{commentString:f,indentSeq:h,simpleKeys:p}}=B;let g=s.isNode(e)&&e.comment||null;if(p){if(g){throw new Error("With simple keys, key nodes cannot have comments")}if(s.isCollection(e)||!s.isNode(e)&&typeof e==="object"){const e="With simple keys, collection cannot be used as a key value";throw new Error(e)}}let m=!p&&(!e||g&&t==null&&!B.inFlow||s.isCollection(e)||(s.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==="object"));B=Object.assign({},B,{allNullValues:false,implicitKey:!m&&(p||!l),indent:C+u});let d=false;let D=false;let E=r.stringify(e,B,()=>d=true,()=>D=true);if(!m&&!B.inFlow&&E.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=true}if(B.inFlow){if(l||t==null){if(d&&a)a();return E===""?"?":m?`? ${E}`:E}}else if(l&&!p||t==null&&m){E=`? ${E}`;if(g&&!d){E+=i.lineComment(E,B.indent,f(g))}else if(D&&o)o();return E}if(d)g=null;if(m){if(g)E+=i.lineComment(E,B.indent,f(g));E=`? ${E}\n${C}:`}else{E=`${E}:`;if(g)E+=i.lineComment(E,B.indent,f(g))}let y,b,O;if(s.isNode(t)){y=!!t.spaceBefore;b=t.commentBefore;O=t.comment}else{y=false;b=null;O=null;if(t&&typeof t==="object")t=c.createNode(t)}B.implicitKey=false;if(!m&&!g&&s.isScalar(t))B.indentAtStart=E.length+1;D=false;if(!h&&u.length>=2&&!B.inFlow&&!m&&s.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor){B.indent=B.indent.substring(2)}let w=false;const S=r.stringify(t,B,()=>w=true,()=>D=true);let N=" ";if(g||y||b){N=y?"\n":"";if(b){const e=f(b);N+=`\n${i.indentComment(e,B.indent)}`}if(S===""&&!B.inFlow){if(N==="\n"&&O)N="\n\n"}else{N+=`\n${B.indent}`}}else if(!m&&s.isCollection(t)){const e=S[0];const s=S.indexOf("\n");const n=s!==-1;const r=B.inFlow??t.flow??t.items.length===0;if(n||!r){let t=false;if(n&&(e==="&"||e==="!")){let B=S.indexOf(" ");if(e==="&"&&B!==-1&&B{"use strict";var s=B(3301);var n=B(4475);const getFoldOptions=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});const containsDocumentMarker=e=>/^(%|---|\.\.\.)/m.test(e);function lineLengthOverLimit(e,t,B){if(!t||t<0)return false;const s=t-B;const n=e.length;if(n<=s)return false;for(let t=0,B=0;ts)return true;B=t+1;if(n-B<=s)return false}}return true}function doubleQuotedString(e,t){const B=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return B;const{implicitKey:s}=t;const r=t.options.doubleQuotedMinMultiLineLength;const i=t.indent||(containsDocumentMarker(e)?" ":"");let a="";let o=0;for(let e=0,t=B[e];t;t=B[++e]){if(t===" "&&B[e+1]==="\\"&&B[e+2]==="n"){a+=B.slice(o,e)+"\\ ";e+=1;o=e;t="\\"}if(t==="\\")switch(B[e+1]){case"u":{a+=B.slice(o,e);const t=B.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:if(t.substr(0,2)==="00")a+="\\x"+t.substr(2);else a+=B.substr(e,6)}e+=5;o=e+1}break;case"n":if(s||B[e+2]==='"'||B.length\n";let h;let p;for(p=B.length;p>0;--p){const e=B[p-1];if(e!=="\n"&&e!=="\t"&&e!==" ")break}let g=B.substring(p);const m=g.indexOf("\n");if(m===-1){h="-"}else if(B===g||m!==g.length-1){h="+";if(o)o()}else{h=""}if(g){B=B.slice(0,-g.length);if(g[g.length-1]==="\n")g=g.slice(0,-1);g=g.replace(r,`$&${u}`)}let d=false;let D;let E=-1;for(D=0;D{r=true}}const o=n.foldFlowLines(`${y}${e}${g}`,u,n.FOLD_BLOCK,a);if(!r)return`>${O}\n${u}${o}`}B=B.replace(/\n+/g,`$&${u}`);return`|${O}\n${u}${y}${B}${g}`}function plainString(e,t,B,r){const{type:i,value:a}=e;const{actualString:o,implicitKey:l,indent:c,indentStep:C,inFlow:u}=t;if(l&&a.includes("\n")||u&&/[[\]{},]/.test(a)){return quotedString(a,t)}if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)){return l||u||!a.includes("\n")?quotedString(a,t):blockString(e,t,B,r)}if(!l&&!u&&i!==s.Scalar.PLAIN&&a.includes("\n")){return blockString(e,t,B,r)}if(containsDocumentMarker(a)){if(c===""){t.forceBlockIndent=true;return blockString(e,t,B,r)}else if(l&&c===C){return quotedString(a,t)}}const f=a.replace(/\n+/g,`$&\n${c}`);if(o){const test=e=>e.default&&e.tag!=="tag:yaml.org,2002:str"&&e.test?.test(f);const{compat:e,tags:B}=t.doc.schema;if(B.some(test)||e?.some(test))return quotedString(a,t)}return l?f:n.foldFlowLines(f,c,n.FOLD_FLOW,getFoldOptions(t,false))}function stringifyString(e,t,B,n){const{implicitKey:r,inFlow:i}=t;const a=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;if(o!==s.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value))o=s.Scalar.QUOTE_DOUBLE}const _stringify=e=>{switch(e){case s.Scalar.BLOCK_FOLDED:case s.Scalar.BLOCK_LITERAL:return r||i?quotedString(a.value,t):blockString(a,t,B,n);case s.Scalar.QUOTE_DOUBLE:return doubleQuotedString(a.value,t);case s.Scalar.QUOTE_SINGLE:return singleQuotedString(a.value,t);case s.Scalar.PLAIN:return plainString(a,t,B,n);default:return null}};let l=_stringify(o);if(l===null){const{defaultKeyType:e,defaultStringType:B}=t.options;const s=r&&e||B;l=_stringify(s);if(l===null)throw new Error(`Unsupported default string type ${s}`)}return l}t.stringifyString=stringifyString},204:(e,t,B)=>{"use strict";var s=B(1127);const n=Symbol("break visit");const r=Symbol("skip children");const i=Symbol("remove node");function visit(e,t){const B=initVisitor(t);if(s.isDocument(e)){const t=visit_(null,e.contents,B,Object.freeze([e]));if(t===i)e.contents=null}else visit_(null,e,B,Object.freeze([]))}visit.BREAK=n;visit.SKIP=r;visit.REMOVE=i;function visit_(e,t,B,r){const a=callVisitor(e,t,B,r);if(s.isNode(a)||s.isPair(a)){replaceNode(e,r,a);return visit_(e,a,B,r)}if(typeof a!=="symbol"){if(s.isCollection(t)){r=Object.freeze(r.concat(t));for(let e=0;e{ +(()=>{var e={2047:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);const{URL:r}=B(3136);const{benchmarkKey:i}=B(8817);const{loadSnapshot:a}=B(1283);const{assert:o,compareText:l,hasControl:c,median:C,safePart:u,walkFiles:f,writeJSON:h}=B(8793);const p=1;function validLabel(e,t,B=160){o(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e&&!c(e),`${t} must be a trimmed string of 1..${B} bytes`)}function validURL(e,t){let B;try{B=new r(e)}catch{throw new Error(`invalid ${t} ${JSON.stringify(e)}`)}o(B.protocol==="https:"&&B.hostname&&!B.username&&!B.password&&!/[<>\r\n]/u.test(e),`invalid ${t} ${JSON.stringify(e)}`)}function validUnit(e){return typeof e==="string"&&Buffer.byteLength(e)>=1&&Buffer.byteLength(e)<=64&&!c(e)&&!/[\s`|<>]/u.test(e)}function validBenchmarkName(e){return typeof e==="string"&&e.startsWith("Benchmark")&&e.length>"Benchmark".length&&Buffer.byteLength(e)<=300&&!c(e)&&!/[\s`|<>]/u.test(e)}function validateMeasurements(e,t){o(t&&typeof t==="object"&&!Array.isArray(t)&&Object.keys(t).length>=1&&Object.keys(t).length<=32,`benchmark ${JSON.stringify(e)} has an invalid measurement count`);for(const[B,s]of Object.entries(t)){o(validUnit(B),`benchmark ${JSON.stringify(e)} has invalid unit ${JSON.stringify(B)}`);o(typeof s==="number"&&Number.isFinite(s)&&s>=0,`benchmark ${JSON.stringify(e)} unit ${JSON.stringify(B)} has invalid value`)}}function validateResult(e,t,B={}){const s=B.trustedLayout??true;const n=s?t.maxBenchmarks:5e3;o(e?.schemaVersion===p,`unsupported result schema ${e?.schemaVersion}`);o(e.suiteId===t.id,`suite id ${JSON.stringify(e.suiteId)} does not match config ${JSON.stringify(t.id)}`);o(u(e.shardId),`invalid shard id ${JSON.stringify(e.shardId)}`);o(e.samplePairing===undefined||e.samplePairing==="index",`invalid sample pairing ${JSON.stringify(e.samplePairing)}`);o(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(e.source?.repository),`invalid source repository ${JSON.stringify(e.source?.repository)}`);o(/^[0-9a-f]{40}$/u.test(e.source.sha),`invalid source SHA ${JSON.stringify(e.source.sha)}`);validURL(e.source.url,"source URL");if(e.source.runUrl)validURL(e.source.runUrl,"run URL");o(typeof e.source.timestamp==="string"&&!Number.isNaN(Date.parse(e.source.timestamp)),"source timestamp is invalid");o(u(e.platform?.id),`invalid platform id ${JSON.stringify(e.platform?.id)}`);validLabel(e.platform.label,"platform label");o(Array.isArray(e.benchmarks)&&e.benchmarks.length>=1&&e.benchmarks.length<=n,`benchmark count is outside 1..${n}`);o(Object.keys(e.units??{}).length<=64,"unit metadata count exceeds 64");for(const[t,B]of Object.entries(e.units??{})){o(validUnit(t),`invalid metadata unit ${JSON.stringify(t)}`);o(B.better===undefined||B.better==="higher"||B.better==="lower",`unit ${t} has invalid better value`);o(B.assume===undefined||B.assume==="nothing"||B.assume==="exact",`unit ${t} has invalid assume value`)}const r=new Set;for(const B of e.benchmarks){o(validBenchmarkName(B.name),`invalid benchmark name ${JSON.stringify(B.name)}`);o(!B.package||/^[A-Za-z0-9._~+/-]+$/u.test(B.package),`benchmark ${B.name} has invalid package ${JSON.stringify(B.package)}`);const e=i(B);o(!r.has(e),`duplicate benchmark ${JSON.stringify(e)}`);r.add(e);if(s){o(t.includeBenchmark(B.name,e),`benchmark ${JSON.stringify(e)} is excluded by trusted config`);const s=t.layoutFor(B.name,e);o(B.group===s.group&&B.chart===s.chart,`benchmark ${JSON.stringify(e)} layout does not match trusted config`)}else{o(B.group==="other"||u(B.group)&&B.group===B.group.toLowerCase(),`benchmark ${JSON.stringify(e)} has invalid stored group`);o(B.chart===`group:${B.group}`||B.chart===`benchmark:${e}`,`benchmark ${JSON.stringify(e)} has invalid stored chart`)}o(Array.isArray(B.samples)&&B.samples.length>=1&&B.samples.length<=100,`benchmark ${JSON.stringify(e)} sample count is outside 1..100`);const n=new Map;for(const t of B.samples){o(Number.isSafeInteger(t.iterations)&&t.iterations>0,`benchmark ${JSON.stringify(e)} has invalid iterations`);validateMeasurements(e,t.measurements);for(const[e,B]of Object.entries(t.measurements)){if(!n.has(e))n.set(e,[]);n.get(e).push(B)}}validateMeasurements(e,B.measurements);o(n.size===Object.keys(B.measurements).length,`benchmark ${JSON.stringify(e)} sample and summary units do not match`);for(const[t,s]of Object.entries(B.measurements)){o(n.has(t)&&s===C(n.get(t)),`benchmark ${JSON.stringify(e)} unit ${JSON.stringify(t)} summary is not the sample median`)}}return e}function validateSamplePairing(e,t){if(e.samplePairing===undefined&&t?.samplePairing===undefined){return}o(e.samplePairing==="index"&&t?.samplePairing==="index","index sample pairing requires a paired baseline");const B=new Map(t.benchmarks.map(e=>[i(e),e]));o(e.benchmarks.length===t.benchmarks.length,"index-paired result and baseline benchmark counts differ");for(const t of e.benchmarks){const e=i(t);const s=B.get(e);o(s,`index-paired baseline is missing benchmark ${JSON.stringify(e)}`);o(t.samples.length===s.samples.length,`index-paired benchmark ${JSON.stringify(e)} sample counts differ`);for(let B=0;B{const t=JSON.parse(s.readFileSync(e,"utf8"));try{validateResult(t,B);const r=n.join(n.dirname(e),"baseline.json");const i=s.existsSync(r);const a=c.get(t.platform.id);o(a===undefined||a===i,`same-runner baseline must be present for every shard of platform ${JSON.stringify(t.platform.id)}`);c.set(t.platform.id,i);if(i){const e=validateResult(JSON.parse(s.readFileSync(r,"utf8")),B);o(e.shardId===t.shardId,`baseline shard ${JSON.stringify(e.shardId)} does not match result shard ${JSON.stringify(t.shardId)}`);o(JSON.stringify(e.platform)===JSON.stringify(t.platform),`baseline platform does not match result platform ${JSON.stringify(t.platform.id)}`);validateSamplePairing(t,e);l.push(e)}return t}catch(t){throw new Error(`${e}: ${t.message}`,{cause:t})}});return{config:B,results:mergeShards(C),baselines:l.length===0?[]:mergeShards(l)}}function mergeMetadata(e,t,B){for(const[s,n]of Object.entries(t??{})){if(e[s]){o(JSON.stringify(e[s])===JSON.stringify(n),`platform ${B} has conflicting metadata for ${s}`)}else{e[s]=n}}}function mergeShards(e){o(e.length>=1&&e.length<=256,"shard count is outside 1..256");const t=e[0];const B=`${t.source.repository}@${t.source.sha}`;const s=new Set;const n=new Map;for(const t of e){o(`${t.source.repository}@${t.source.sha}`===B,`shard ${t.shardId} source does not match ${B}`);const e=`${t.platform.id}/${t.shardId}`;o(!s.has(e),`duplicate shard ${JSON.stringify(e)}`);s.add(e);let r=n.get(t.platform.id);if(!r){r={...t,shardId:"merged",units:{},benchmarks:[]};n.set(t.platform.id,r)}else{o(JSON.stringify(r.platform)===JSON.stringify(t.platform),`platform ${t.platform.id} metadata differs between shards`);o(r.samplePairing===t.samplePairing,`platform ${t.platform.id} sample pairing differs between shards`)}mergeMetadata(r.units,t.units,t.platform.id);const a=new Set(r.benchmarks.map(i));for(const e of t.benchmarks){const B=i(e);o(!a.has(B),`platform ${t.platform.id} repeats benchmark ${JSON.stringify(B)} across shards`);a.add(B);r.benchmarks.push(e)}if(Date.parse(t.source.timestamp)>Date.parse(r.source.timestamp)){r.source=t.source}}return[...n.values()].map(e=>({...e,benchmarks:e.benchmarks.toSorted((e,t)=>l(i(e),i(t)))})).sort((e,t)=>l(e.platform.id,t.platform.id))}e.exports={loadArtifacts:loadArtifacts,mergeShards:mergeShards,schemaVersion:p,validateResult:validateResult,writeArtifact:writeArtifact}},6247:(e,t,B)=>{"use strict";const s=B(3024);const n=B(8161);const r=B(6760);const{parseArgs:i}=B(7975);const{loadArtifacts:a,validateResult:o,writeArtifact:l,schemaVersion:c}=B(2047);const{loadConfig:C}=B(1283);const{parseGoBenchmark:u}=B(8817);const{writeReport:f}=B(8959);const{entryFromResults:h,update:p}=B(7864);const{assert:g,safePart:m,writeOutputs:d}=B(8793);function options(e,t){const B=i({args:e,options:Object.fromEntries(Object.keys(t).map(e=>[e,{type:"string"}])),strict:true});return B.values}function required(e,t,B){for(const s of t){g(e[s],`${B} requires --${s}`)}}function goOS(){return{win32:"windows"}[process.platform]??process.platform}function goArch(){return{x64:"amd64",ia32:"386"}[process.arch]??process.arch}function displayOS(e){return{darwin:"macOS",linux:"Linux",windows:"Windows"}[e]??e}function githubEvent(){const e=process.env.GITHUB_EVENT_PATH;if(!e)return{};try{return JSON.parse(s.readFileSync(e,"utf8"))}catch(t){throw new Error(`read GitHub event ${e}: ${t.message}`,{cause:t})}}function sourceDefaults(){const e=githubEvent();const t=e.pull_request?.head;return{repository:t?.repo?.full_name||process.env.GITHUB_REPOSITORY||"",sha:t?.sha||process.env.GITHUB_SHA||"",ref:t?.ref||process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME||process.env.GITHUB_REF||""}}function baselineSourceDefaults(){const e=githubEvent().pull_request?.base;return{repository:e?.repo?.full_name||"",sha:e?.sha||"",ref:e?.ref||""}}function serverURL(){return(process.env.GITHUB_SERVER_URL||"https://github.com").replace(/\/+$/u,"")}function defaultSourceURL(e,t){return`${serverURL()}/${e}/commit/${t}`}function defaultRunURL(){return process.env.GITHUB_RUN_ID&&process.env.GITHUB_REPOSITORY?`${serverURL()}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`:""}function defaultTemporaryDirectory(e){const t=process.env.RUNNER_TEMP||n.tmpdir();s.mkdirSync(t,{recursive:true});return s.mkdtempSync(r.join(t,e))}function runRecord(e,t={}){const B=options(e,{config:true,input:true,"baseline-input":true,"baseline-repository":true,"baseline-sha":true,"baseline-ref":true,"sample-pairing":true,"output-dir":true,"platform-id":true,"platform-label":true,"shard-id":true,os:true,arch:true,runner:true,repository:true,sha:true,ref:true,"source-url":true,"run-url":true,timestamp:true,"github-output":true});required(B,["config","input"],"record");const n=C(B.config);const r=u(s.readFileSync(B.input,"utf8"),n);const i=B.os||r.fileConfig.goos||goOS();const a=B.arch||r.fileConfig.goarch||goArch();const o=B["platform-id"]||`${i}-${a}`;const f=B["shard-id"]||process.env.GITHUB_JOB||"default";g(m(o),`invalid platform id ${JSON.stringify(o)}`);g(m(f),`invalid shard id ${JSON.stringify(f)}`);const h=sourceDefaults();const p=B.repository||h.repository;const D=B.sha||h.sha;const E=B["source-url"]||defaultSourceURL(p,D);const y=B["run-url"]||defaultRunURL();const b=B.timestamp||(new Date).toISOString();const O={id:o,label:B["platform-label"]||`${displayOS(i)} / ${a}`,os:i,arch:a,...B.runner?{runner:B.runner}:{}};const w={schemaVersion:c,suiteId:n.id,shardId:f,...B["sample-pairing"]?{samplePairing:B["sample-pairing"]}:{},source:{repository:p,sha:D,...B.ref||h.ref?{ref:B.ref||h.ref}:{},url:E,...y?{runUrl:y}:{},timestamp:b},platform:O,units:r.units,benchmarks:r.benchmarks};let S=null;if(B["baseline-input"]){const e=baselineSourceDefaults();const t=B["baseline-repository"]||e.repository;const r=B["baseline-sha"]||e.sha;const i=B["baseline-ref"]||e.ref;g(t&&r,"baseline repository and SHA are required with --baseline-input");const a=u(s.readFileSync(B["baseline-input"],"utf8"),n);S={schemaVersion:c,suiteId:n.id,shardId:f,...B["sample-pairing"]?{samplePairing:B["sample-pairing"]}:{},source:{repository:t,sha:r,...i?{ref:i}:{},url:defaultSourceURL(t,r),...y?{runUrl:y}:{},timestamp:b},platform:O,units:a.units,benchmarks:a.benchmarks}}const N=B["output-dir"]||defaultTemporaryDirectory(`go-benchmark-${n.id}-${o}-${f}-`);l(N,n,w,S);const F=`go-benchmark-${n.id}-${o}-${f}`;const A={"artifact-name":F,"artifact-path":N,"platform-id":o,"shard-id":f,"suite-id":n.id};d(t.githubOutput??B["github-output"]??process.env.GITHUB_OUTPUT,A);console.log(`Recorded ${r.benchmarks.length} benchmarks for ${o}/${f} in ${N}`);return{outputDirectory:N,outputs:A}}function series(e,t=""){return{kind:e[`${t}series-kind`],id:e[`${t}series-id`],label:e[`${t}series-label`]}}function bindSource(e,t,B){const s=B["expected-source-repository"];const n=B["expected-source-sha"];g(Boolean(s)===Boolean(n),"expected source repository and SHA must be provided together");for(const r of e){if(s){g(r.source.repository===s,`artifact source repository ${JSON.stringify(r.source.repository)} does not match ${JSON.stringify(s)}`);g(r.source.sha===n,`artifact source SHA ${JSON.stringify(r.source.sha)} does not match ${JSON.stringify(n)}`)}r.source={...r.source,...B["source-ref"]?{ref:B["source-ref"]}:{},...B["source-url"]?{url:B["source-url"]}:{},...B["source-run-url"]?{runUrl:B["source-run-url"]}:{},...B["source-timestamp"]?{timestamp:B["source-timestamp"]}:{}};o(r,t)}}function bindBaselineSource(e,t,B){if(e.length===0)return;const s=B["expected-baseline-repository"];const n=B["expected-baseline-sha"];g(s,"expected baseline repository is required with a paired baseline");for(const r of e){g(r.source.repository===s,`artifact baseline repository ${JSON.stringify(r.source.repository)} does not match ${JSON.stringify(s)}`);if(n){g(r.source.sha===n,`artifact baseline SHA ${JSON.stringify(r.source.sha)} does not match ${JSON.stringify(n)}`)}const e=n||r.source.sha;r.source={...r.source,repository:s,sha:e,...B["baseline-source-ref"]?{ref:B["baseline-source-ref"]}:{},url:defaultSourceURL(s,e),...B["source-run-url"]?{runUrl:B["source-run-url"]}:{},...B["source-timestamp"]?{timestamp:B["source-timestamp"]}:{}};o(r,t)}}function bindConfig(e,t){if(!t)return;const B=C(t);g(JSON.stringify(e.config.toJSON())===JSON.stringify(B.toJSON()),"artifact configuration does not match the trusted configuration");for(const t of e.results)o(t,B);for(const t of e.baselines)o(t,B);e.config=B}function runRender(e,t={}){const B=options(e,{artifacts:true,"data-dir":true,"trusted-config":true,"series-kind":true,"series-id":true,"series-label":true,"additional-series-kind":true,"additional-series-id":true,"additional-series-label":true,"site-base-url":true,"expected-source-repository":true,"expected-source-sha":true,"expected-baseline-repository":true,"expected-baseline-sha":true,"baseline-source-ref":true,"source-ref":true,"source-url":true,"source-run-url":true,"source-timestamp":true,comment:true,"github-output":true});required(B,["artifacts","data-dir","series-kind","series-id","series-label"],"render");const s=a(B.artifacts);bindConfig(s,B["trusted-config"]);bindSource(s.results,s.config,B);bindBaselineSource(s.baselines,s.config,B);const n=series(B);const i=s.baselines.length===0?null:h(s.baselines,s.config);const o=p(B["data-dir"],s.config,n,s.results,{comparison:n.kind==="pull"?i:null});const l=[B["additional-series-kind"],B["additional-series-id"],B["additional-series-label"]];if(l.some(Boolean)){g(l.every(Boolean),"additional series kind, id, and label must be provided together");p(B["data-dir"],s.config,series(B,"additional-"),s.results,{comparison:i})}const c=B.comment||r.join(B["data-dir"],".go-benchmark-comment.md");const C=B["site-base-url"]?`${B["site-base-url"].replace(/\/+$/u,"")}/${s.config.sitePath.replace(/^\/+|\/+$/gu,"")}/?series=${encodeURIComponent(`${n.kind}/${n.id}`)}`:"";f(c,C,s.config,o.entry,i||o.main,{sameRunner:Boolean(i)});const u={"comment-path":c,marker:`\x3c!-- go-benchmark:${s.config.id} --\x3e`,"site-path":o.sitePath,"site-url":C,"suite-id":s.config.id};d(t.githubOutput??B["github-output"]??process.env.GITHUB_OUTPUT,u);console.log(`Updated ${n.kind} series ${n.id} with ${s.results.length} platforms`);return{outputs:u}}e.exports={runRecord:runRecord,runRender:runRender}},4408:(e,t,B)=>{"use strict";const{benchmarkKey:s}=B(8817);const{median:n}=B(8793);function benchmarkIndex(e){return new Map((e?.benchmarks??[]).map(e=>[s(e),e]))}function isIndexPaired(e,t,B){return B&&e?.samplePairing==="index"&&t?.samplePairing==="index"}function sampleValues(e,t){return e.samples.flatMap(e=>Object.hasOwn(e.measurements,t)?[e.measurements[t]]:[])}function metricComparison(e,t,B,s){const r=e?.measurements?.[B];const i=t?.measurements?.[B];const a={baseline:i,...r!==undefined&&i!==undefined?{difference:r-i}:{}};if(!s||!e||!t){return a}const o=sampleValues(e,B);const l=sampleValues(t,B);if(o.length===0||o.length!==l.length){return a}const c=[];const C=[];let u=true;for(let e=0;e{"use strict";const s=B(6760);const n=B(8815);const{RE2JS:r}=B(6472);const{assert:i,hasControl:a,safePart:o}=B(8793);const{parseViews:l,serializeViews:c}=B(7675);const C=B(3024);function stringList(e,t){if(e===undefined||e===null||e==="")return[];if(typeof e==="string")return[e];i(Array.isArray(e)&&e.every(e=>typeof e==="string"),`${t} must be a string or string list`);return e}function label(e,t,B=120){i(typeof e==="string",`${t} must be a string`);i(e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e,`${t} must be a trimmed string of 1..${B} bytes`);i(!a(e),`${t} contains a control character`);return e}function title(e){return e.split(/[-_.]/u).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join(" ")}function compilePatterns(e,t){return e.map(e=>{try{return r.compile(e)}catch(B){throw new Error(`${t} pattern ${JSON.stringify(e)}: ${B.message}`,{cause:B})}})}function matches(e,t,B){const s=t.replace(/^Benchmark/u,"");const n=B.replace("::Benchmark","::");return e.some(e=>[t,s,B,n].some(t=>e.matcher(t).find()))}class Config{constructor(e,t="configuration"){i(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);this.version=e.version??1;i(this.version===1,`unsupported version ${this.version}`);this.id=e.id;i(typeof this.id==="string"&&/^[a-z0-9][a-z0-9._-]*$/.test(this.id),"invalid id");this.title=label(e.title??`${this.id} benchmarks`,"title");this.sitePath=s.posix.normalize(e["site-path"]??`go-benchmarks/${this.id}`);i(this.sitePath!=="."&&!this.sitePath.startsWith("../")&&!s.posix.isAbsolute(this.sitePath),`site-path ${JSON.stringify(this.sitePath)} must stay within the data branch`);this.include=stringList(e.include,"include");if(this.include.length===0)this.include=["^Benchmark"];this.exclude=stringList(e.exclude,"exclude");this.maxBenchmarks=e["max-benchmarks"]??500;i(Number.isInteger(this.maxBenchmarks)&&this.maxBenchmarks>=1&&this.maxBenchmarks<=5e3,"max-benchmarks must be between 1 and 5000");this.groups={};this.compiledGroups={};const B=e.groups??{};i(B&&typeof B==="object"&&!Array.isArray(B),"groups must be a mapping");for(const[e,t]of Object.entries(B)){i(o(e)&&e===e.toLowerCase(),`invalid group id ${JSON.stringify(e)}`);const B=typeof t==="string"||Array.isArray(t)?{match:t}:{...t};i(B&&typeof B==="object",`group ${e} must be a pattern or mapping`);const s=stringList(B.match,`group ${e} match`);i(s.length!==0,`group ${e} has no match pattern`);const n=B.chart??"combined";i(n==="combined"||n==="single",`group ${e} chart must be combined or single`);this.groups[e]={title:label(B.title??title(e),`group ${e} title`),match:s,chart:n};this.compiledGroups[e]=compilePatterns(s,`group ${e}`)}this.views=l(e.views);this.compiledInclude=compilePatterns(this.include,"include");this.compiledExclude=compilePatterns(this.exclude,"exclude")}includeBenchmark(e,t){return matches(this.compiledInclude,e,t)&&!matches(this.compiledExclude,e,t)}layoutFor(e,t){const B=Object.keys(this.groups).filter(B=>matches(this.compiledGroups[B],e,t)).sort();i(B.length<=1,`benchmark ${JSON.stringify(t)} matches multiple groups: ${B.join(", ")}`);if(B.length===0)return{group:"other",chart:`benchmark:${t}`};const s=B[0];return{group:s,chart:this.groups[s].chart==="single"?`benchmark:${t}`:`group:${s}`}}toJSON(){return{version:this.version,id:this.id,title:this.title,sitePath:this.sitePath,include:this.include,exclude:this.exclude,maxBenchmarks:this.maxBenchmarks,groups:this.groups,views:c(this.views)}}}function loadConfig(e){let t;try{t=n.parse(C.readFileSync(e,"utf8"),{uniqueKeys:true})}catch(t){throw new Error(`parse ${e}: ${t.message}`,{cause:t})}return new Config(t,e)}function loadSnapshot(e){const t=JSON.parse(C.readFileSync(e,"utf8"));const B={...t,"site-path":t.sitePath,"max-benchmarks":t.maxBenchmarks};return new Config(B,e)}e.exports={Config:Config,loadConfig:loadConfig,loadSnapshot:loadSnapshot}},8817:(e,t,B)=>{"use strict";const{assert:s,compareText:n,median:r}=B(8793);const i=new Map([["ns/op","lower"],["sec/op","lower"],["MB/s","higher"],["B/s","higher"],["B/op","lower"],["allocs/op","lower"]]);function parseNumber(e,t){const B=Number(e);s(Number.isFinite(B)&&B>=0,`${t} has invalid value ${JSON.stringify(e)}`);return B}function parseIterations(e,t){s(/^[0-9]+$/u.test(e),`benchmark ${JSON.stringify(t)} has invalid iteration count ${JSON.stringify(e)}`);const B=Number(e);s(Number.isSafeInteger(B)&&B>0,`benchmark ${JSON.stringify(t)} has invalid iteration count ${JSON.stringify(e)}`);return B}function parseUnitLine(e,t,B){s(e.length>=2,`line ${B}: missing unit`);const n=e[1];for(const r of e.slice(2)){const e=r.indexOf("=");s(e>0,`line ${B}: expected key=value`);const i=r.slice(0,e);const a=r.slice(e+1);s(i==="better"||i==="assume",`line ${B}: unsupported unit metadata ${i}`);if(i==="better")s(a==="higher"||a==="lower",`line ${B}: invalid better value ${a}`);if(i==="assume")s(a==="nothing"||a==="exact",`line ${B}: invalid assume value ${a}`);const o=t[n]??{};s(o[i]===undefined||o[i]===a,`line ${B}: conflicting ${i} metadata for ${n}`);o[i]=a;t[n]=o}}function parseBenchmarkLine(e,t,B,n,r){s(e.length>=4&&(e.length-2)%2===0,`line ${r}: malformed benchmark result`);const i=e[0].replace(/-[0-9]+$/u,"");const a=t?`${t}::${i}`:i;if(!B.includeBenchmark(i,a))return;const o=parseIterations(e[1],a);const l={};for(let t=2;tn(e,t)).map(([e,t])=>[e,r(t)]));return e}function parseGoBenchmark(e,t){const B=new Map;const r={};const a={};let o="";for(const[s,n]of e.split(/\r?\n/u).entries()){const e=s+1;const i=n.trim();if(!i)continue;const l=i.split(/\s+/u);if(l[0]==="Unit"){parseUnitLine(l,r,e);continue}if(l[0].startsWith("Benchmark")){parseBenchmarkLine(l,o,t,B,e);continue}const c=/^([a-z][a-z0-9_-]*):\s*(.*)$/u.exec(i);if(c){const[,e,t]=c;a[e]=t;if(e==="pkg")o=t}}s(B.size!==0,"no included Go benchmarks found");s(B.size<=t.maxBenchmarks,`benchmark count exceeds max-benchmarks ${t.maxBenchmarks}`);const l=[...B.values()].map(summarize).sort((e,t)=>n(benchmarkKey(e),benchmarkKey(t)));for(const e of l){for(const t of Object.keys(e.measurements)){if(!r[t]&&i.has(t))r[t]={better:i.get(t)}}}return{benchmarks:l,units:r,fileConfig:a}}function benchmarkKey(e){return e.package?`${e.package}::${e.name}`:e.name}e.exports={benchmarkKey:benchmarkKey,parseGoBenchmark:parseGoBenchmark}},4217:e=>{"use strict";function markdown(e){return String(e).replace(/[\\*_[\]#`]/gu,"\\$&")}function tableCell(e){return markdown(e).replaceAll("|","\\|").replaceAll("\n"," ")}function formatNumber(e){if(Number.isInteger(e)&&e<1e12)return String(e);return e.toFixed(3)}function formatPreciseNumber(e){if(e===0||Number.isInteger(e))return String(e);const t=Math.abs(e);if(t<1e-7){const[t,B]=e.toExponential(3).split("e");return`${t.replace(/\.?0+$/u,"")}e${B}`}const B=t>=999.95?0:t>=99.995?1:t>=9.9995?2:t>=.99995?3:t>=.099995?4:t>=.0099995?5:t>=99995e-8?6:7;return e.toFixed(B).replace(/0+$/u,"").replace(/\.$/u,"")}function formatSigned(e,t){const B=Object.is(e,-0)?0:e;const s=B>0?"+":B<0?"-":"";return`${s}${t(Math.abs(B))}`}function formatDelta(e,t){const B=e.toFixed(1);const s=e!==0&&Number(B)===0?formatPreciseNumber(e):B;const n=`${e>=0?"+":""}${s}%`;if(e===0||t!=="lower"&&t!=="higher")return n;const r=t==="lower"&&e<0||t==="higher"&&e>0;return`${n} (${r?"better":"worse"})`}function delta(e,t,B){if(t===undefined)return"new";if(t===0)return e===0?"0.0%":"from 0";return formatDelta((e/t-1)*100,B)}e.exports={delta:delta,formatDelta:formatDelta,formatNumber:formatNumber,formatPreciseNumber:formatPreciseNumber,formatSigned:formatSigned,markdown:markdown,tableCell:tableCell}},4683:(e,t,B)=>{"use strict";const s=B(6760);const{runRecord:n}=B(6247);function workspacePath(e){return s.isAbsolute(e)?e:s.join(process.env.GITHUB_WORKSPACE||process.cwd(),e)}function input(e){const t=`BENCHMARK_${e.replaceAll("-","_").toUpperCase()}`;return process.env[t]??""}function add(e,t,B){if(B)e.push(`--${t}`,B)}function run(){const e=["--config",workspacePath(input("config")),"--input",workspacePath(input("benchmark-file"))];if(input("baseline-benchmark-file")){add(e,"baseline-input",workspacePath(input("baseline-benchmark-file")))}add(e,"baseline-repository",input("baseline-repository"));add(e,"baseline-sha",input("baseline-sha"));add(e,"baseline-ref",input("baseline-ref"));add(e,"sample-pairing",input("sample-pairing"));add(e,"platform-id",input("platform-id"));add(e,"platform-label",input("platform-label"));add(e,"shard-id",input("shard-id"));return n(e)}e.exports={run:run,workspacePath:workspacePath}},8959:(e,t,B)=>{"use strict";const s=B(3024);const{benchmarkKey:n}=B(8817);const{benchmarkIndex:r,isIndexPaired:i,metricComparison:a}=B(4408);const{delta:o,formatDelta:l,formatNumber:c,formatPreciseNumber:C,formatSigned:u,markdown:f,tableCell:h}=B(4217);const{compareText:p}=B(8793);const{renderViews:g}=B(6919);function groupTitle(e,t){if(t==="other")return"Other";return e.groups[t]?.title??t}function writeReport(e,t,m,d,D,E={}){const y=d.source;const b=E.sameRunner??false;const O=b?"vs base":"vs main";const w=[`\x3c!-- go-benchmark:${m.id} --\x3e`,`## ${f(m.title)}`,"",`[\`${y.sha.slice(0,12)}\`](<${y.url}>)`+(y.runUrl?` | [workflow run](<${y.runUrl}>)`:"")+(t?` | [long-term charts](<${t}>)`:""),""];if(Object.keys(m.views).length>0){w.push(...g(m,d,D,O,b))}else{for(const e of Object.keys(d.platforms).sort(p)){const t=d.platforms[e];const B=D?.platforms?.[e];const s=r(B);const g=i(t,B,b);w.push(`### ${f(t.platform.label)}`,"",`| Group | Benchmark | Metric | Current | ${O} |`,"|---|---|---|---:|---:|");for(const e of t.benchmarks){for(const B of Object.keys(e.measurements).sort(p)){const r=n(e);const i=a(e,s.get(r),B,g);const f=i.change===undefined?o(e.measurements[B],i.baseline,t.units?.[B]?.better):l(i.change,t.units?.[B]?.better);const p=i.difference===undefined?f:`${u(i.difference,e=>`${C(e)} ${B}`)} / ${f}`;w.push(`| ${h(groupTitle(m,e.group))} | \`${r}\` | \`${B}\` | ${c(e.measurements[B])} | ${p} |`)}}w.push("")}}let S;if(D&&b){const e=Object.entries(d.platforms).some(([e,t])=>i(t,D.platforms?.[e],b));const t=Object.keys(d.platforms).some(e=>!D.platforms?.[e]);S=`_Compared with [\`${D.source.sha.slice(0,12)}\`](<${D.source.url}>) measured in the same runner job${e?"; index-paired signed differences and percentage changes are pairwise medians":""}.${t?" Platforms without a paired baseline are marked `new`.":""}_`}else if(D){S="_Compared only with the latest matching platform in the main series._"}else{S="_No main baseline exists yet; all metrics are marked `new`._"}w.push(S,"");if(Buffer.byteLength(w.join("\n"))>65e3){throw new Error("benchmark report exceeds the GitHub comment size limit")}s.mkdirSync(B(6760).dirname(e),{recursive:true});s.writeFileSync(e,w.join("\n"))}e.exports={delta:o,writeReport:writeReport}},7864:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);const{validateResult:r}=B(2047);const{loadSnapshot:i}=B(1283);const{benchmarkKey:a}=B(8817);const{assert:o,compareText:l,hasControl:c,readJSONIfExists:C,safePart:u,walkFiles:f,writeJSON:h}=B(8793);const p=1;const g=500;const m=["app.js","index.html","styles.css"];function validateLabel(e,t){o(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=160&&e.trim()===e&&!c(e),`${t} must be a trimmed string of 1..160 bytes`)}function validateSeries(e){o(e?.kind==="main"||e?.kind==="branch"||e?.kind==="pull",`unsupported series kind ${JSON.stringify(e?.kind)}`);o(u(e.id),`invalid series id ${JSON.stringify(e.id)}`);validateLabel(e.label,"series label")}function normalizeStoredResult(e,t){if(!e.shardId)e.shardId="merged";for(const t of e.benchmarks??[]){if(!t.chart){t.chart=t.group==="other"?`benchmark:${a(t)}`:`group:${t.group}`}}return r(e,t,{trustedLayout:false})}function validateEntry(e,t){o(e?.source&&e.platforms&&typeof e.platforms==="object","history entry is invalid");for(const[B,s]of Object.entries(e.platforms)){o(s?.platform?.id===B,`history platform key ${JSON.stringify(B)} does not match its result`);normalizeStoredResult(s,t);o(s.source.repository===e.source.repository&&s.source.sha===e.source.sha,`history platform ${B} source does not match its entry`)}return e}function validateHistory(e,t,B){o(e.schemaVersion===p,`unsupported history schema ${e.schemaVersion}`);o(e.suiteId===t.id&&e.kind===B.kind&&e.id===B.id,`history identity does not match ${t.id}/${B.kind}/${B.id}`);o(Array.isArray(e.entries)&&e.entries.length<=g,"history entries are invalid");for(const B of e.entries){validateEntry(B,t)}e.label=B.label}function emptyHistory(e,t){return{schemaVersion:p,suiteId:e.id,kind:t.kind,id:t.id,label:t.label,entries:[]}}function mergeHistories(e,t,B,s=false){const n=e.map(e=>C(e,null)).filter(Boolean);if(n.length===0)return s?null:emptyHistory(t,B);const r=emptyHistory(t,B);for(const e of n){validateHistory(e,t,B);for(const t of e.entries){const e=r.entries.findIndex(e=>sameSource(e,t));if(e===-1){r.entries.push(t)}else if(compareEntries(r.entries[e],t)<=0){r.entries[e]=t}}}r.entries.sort(compareEntries);if(r.entries.length>g){r.entries.splice(0,r.entries.length-g)}return r}function entryFromResults(e,t){o(e.length!==0,"cannot update history without results");const B=e[0].source;const s={};for(const n of e){r(n,t);o(n.source.repository===B.repository&&n.source.sha===B.sha,`platform ${n.platform.id} does not match source ${B.repository}@${B.sha}`);o(!Object.hasOwn(s,n.platform.id),`duplicate platform ${JSON.stringify(n.platform.id)}`);s[n.platform.id]=n}return{source:B,platforms:s}}function compareEntries(e,t){const B=Date.parse(e.source.timestamp)-Date.parse(t.source.timestamp);return B||l(e.source.sha,t.source.sha)}function compareSeries(e,t){const B={main:0,branch:1,pull:2};return B[e.kind]-B[t.kind]||l(e.label,t.label)||l(e.id,t.id)}function sameSource(e,t){return e.source.repository===t.source.repository&&e.source.sha===t.source.sha}function commitRelative(e){o(/^[0-9a-f]{40}$/u.test(e.source.sha),`invalid source SHA ${JSON.stringify(e.source.sha)}`);return n.posix.join("commits",`${e.source.sha}.json`)}function writeCommit(e,t,B,s=null){validateEntry(B,t);if(s)validateEntry(s,t);const r=commitRelative(B);const i=n.join(e,...r.split("/"));const a=C(i,null);let l=B;if(a){o(a.schemaVersion===p&&a.suiteId===t.id,`commit snapshot identity does not match ${t.id}`);validateEntry(a,t);o(a.source.sha===B.source.sha,`commit snapshot source does not match ${B.source.sha}`);if(compareEntries(a,B)>0)l=a;if(a.comparison){validateEntry(a.comparison,t);s??=a.comparison}}h(i,{schemaVersion:p,suiteId:t.id,source:l.source,platforms:l.platforms,...s?{comparison:s}:{}});return r}function latestMatchingPlatforms(e,t){if(!e?.entries?.length)return null;const B={};let s;for(let n=e.entries.length-1;n>=0&&Object.keys(B).lengths.existsSync(n.join(e,"index.html")));o(B,"bundled web assets are missing");for(const e of m){const r=n.join(B,e);const i=n.join(t,e);s.mkdirSync(n.dirname(i),{recursive:true});s.copyFileSync(r,i)}s.writeFileSync(n.join(e,".nojekyll"),"")}function migrateLegacyData(e,t){const B=n.posix.normalize(t);o(B!=="."&&!B.startsWith("../")&&!n.posix.isAbsolute(B),`site path ${JSON.stringify(t)} must stay within the data branch`);const r=n.join(e,...B.split("/"));const a=n.join(r,"series");const l=f(a,"history.json");const c=n.join(r,"series.json");const u=C(c,{schemaVersion:p,series:[]});o(u.schemaVersion===p&&Array.isArray(u.series),"unsupported or invalid series index");const g=new Set;for(const e of l){const t=n.dirname(e);const a=i(n.join(t,"config.json"));o(a.sitePath===B,`series config site path ${JSON.stringify(a.sitePath)} does not match ${JSON.stringify(B)}`);const l=C(e,null);const c={kind:l?.kind,id:l?.id,label:l?.label};validateSeries(c);validateHistory(l,a,c);const f=n.join(t,"summary.json");const p=s.existsSync(f);const m=mergeHistories([f,e],a,c);for(const e of m.entries){g.add(commitRelative(e));writeCommit(r,a,e)}if(c.kind==="pull"&&m.entries.length>0){const e=m.entries[m.entries.length-1];if(p){const t=C(f,null);validateHistory(t,a,c);const B=t.entries[t.entries.length-1];if(!B||compareEntries(B,e)<0){m.entries=[e]}else{m.entries=t.entries}}else{m.entries=[e]}}h(f,m);const d=m.entries[m.entries.length-1];let D=u.series.find(e=>e.kind===c.kind&&e.id===c.id);if(!D&&d){D={kind:c.kind,id:c.id,label:c.label,configPath:n.posix.join("series",c.kind,c.id,"config.json"),updatedAt:d.source.timestamp};u.series.push(D)}if(d){D.path=n.posix.join("series",c.kind,c.id,"summary.json");D.configPath=n.posix.join("series",c.kind,c.id,"config.json");D.commitPath=commitRelative(d);D.sha=d.source.sha;D.sourceUrl=d.source.url}}u.series.sort(compareSeries);h(c,u);writeWeb(e,r);return{commits:g.size,series:l.length,siteRoot:r}}function update(e,t,B,s,r={}){validateSeries(B);const i=entryFromResults(s,t);const a=n.posix.join("series",B.kind,B.id,"summary.json");const l=n.posix.join("series",B.kind,B.id,"history.json");const c=n.posix.join("series",B.kind,B.id,"config.json");const u=n.join(e,...t.sitePath.split("/"));const f=n.join(u,...a.split("/"));const m=n.join(u,...l.split("/"));const d=n.join(u,...c.split("/"));const D=mergeHistories([f,m],t,B);const E=r.comparison??null;if(E)validateEntry(E,t);if(B.kind==="pull"){for(const e of D.entries)writeCommit(u,t,e);D.entries=E&&!sameSource(E,i)?[E,i]:[i]}else{const e=D.entries.findIndex(e=>sameSource(e,i));if(e===-1)D.entries.push(i);else D.entries[e]=i;D.entries.sort(compareEntries);if(D.entries.length>g){D.entries.splice(0,D.entries.length-g)}}if(B.kind==="pull"){writeCommit(u,t,i,E)}else{for(const e of D.entries){writeCommit(u,t,e,sameSource(e,i)?E:null)}}const y=commitRelative(i);h(f,D);h(m,D);h(d,t.toJSON());const b=n.join(u,"series.json");const O=C(b,{schemaVersion:p,series:[]});o(O.schemaVersion===p&&Array.isArray(O.series),"unsupported or invalid series index");const w={kind:B.kind,id:B.id,label:B.label,path:a,configPath:c,commitPath:y,sha:i.source.sha,sourceUrl:i.source.url,updatedAt:(new Date).toISOString()};const S=O.series.findIndex(e=>e.kind===w.kind&&e.id===w.id);if(S===-1)O.series.push(w);else O.series[S]=w;O.series.sort(compareSeries);h(b,O);writeWeb(e,u);const N=n.join(u,"series","main","main","summary.json");const F=n.join(u,"series","main","main","history.json");const A=mergeHistories([N,F],t,{kind:"main",id:"main",label:"Main"},true);if(A){validateHistory(A,t,{kind:"main",id:"main",label:A.label||"Main"})}return{entry:i,main:latestMatchingPlatforms(A,i.platforms),commitPath:n.join(u,...y.split("/")),historyPath:f,summaryPath:f,sitePath:u}}e.exports={entryFromResults:entryFromResults,latestMatchingPlatforms:latestMatchingPlatforms,migrateLegacyData:migrateLegacyData,update:update}},8793:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);function assert(e,t){if(!e)throw new Error(t)}function readJSON(e){try{return JSON.parse(s.readFileSync(e,"utf8"))}catch(t){throw new Error(`read ${e}: ${t.message}`,{cause:t})}}function readJSONIfExists(e,t){if(!s.existsSync(e))return t;return readJSON(e)}function writeJSON(e,t){s.mkdirSync(n.dirname(e),{recursive:true});s.writeFileSync(e,`${JSON.stringify(t,null,2)}\n`)}function walkFiles(e,t){const B=[];if(!s.existsSync(e))return B;const r=[e];while(r.length!==0){const e=r.pop();for(const i of s.readdirSync(e,{withFileTypes:true})){const s=n.join(e,i.name);if(i.isSymbolicLink()){throw new Error(`artifact contains symlink ${s}`)}if(i.isDirectory())r.push(s);else if(i.isFile()&&i.name===t)B.push(s)}}return B.sort()}function median(e){assert(e.length!==0,"cannot calculate an empty median");const t=e.toSorted((e,t)=>e-t);const B=Math.floor(t.length/2);return t.length%2===0?(t[B-1]+t[B])/2:t[B]}function safePart(e){return/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)}function hasControl(e){return[...e].some(e=>{const t=e.codePointAt(0);return t<=31||t===127})}function compareText(e,t){return et?1:0}function writeOutputs(e,t){if(!e)return;let B="";for(const[e,s]of Object.entries(t).sort()){assert(!/[\r\n]/.test(e+s),`GitHub output ${e} contains a newline`);B+=`${e}=${s}\n`}s.appendFileSync(e,B)}e.exports={assert:assert,compareText:compareText,hasControl:hasControl,median:median,readJSON:readJSON,readJSONIfExists:readJSONIfExists,safePart:safePart,walkFiles:walkFiles,writeJSON:writeJSON,writeOutputs:writeOutputs}},7675:(e,t,B)=>{"use strict";const{RE2JS:s}=B(6472);const{assert:n,hasControl:r,safePart:i}=B(8793);const a=new Set(["platform","package","group","benchmark","metric"]);const o=new Set(["auto","number","bytes","duration-ns","duration-us","duration-ms","duration-s"]);function keys(e,t,B){for(const s of Object.keys(e)){n(t.has(s),`${B} has unsupported field ${s}`)}}function text(e,t,B=120){n(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e&&!r(e),`${t} must be a trimmed string of 1..${B} bytes`);return e}function stringList(e,t){if(e===undefined||e===null||e==="")return[];const B=typeof e==="string"?[e]:e;n(Array.isArray(B)&&B.every(e=>typeof e==="string"),`${t} must be a string or string list`);return B}function patterns(e,t){return stringList(e,t).map(e=>{try{return{source:e,compiled:s.compile(e)}}catch(B){throw new Error(`${t} pattern ${JSON.stringify(e)}: ${B.message}`,{cause:B})}})}function dimensionList(e,t,B){const s=e===undefined?t:stringList(e,B);n(s.length>0,`${B} must not be empty`);const r=new Set;for(const e of s){n(a.has(e),`${B} has unsupported dimension ${e}`);n(!r.has(e),`${B} repeats dimension ${e}`);r.add(e)}return s}function parseDimensionOptions(e,t){n(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);const B={};for(const[s,r]of Object.entries(e)){n(a.has(s),`${t} has unknown ${s}`);const e=typeof r==="string"?{title:r}:r;n(e&&typeof e==="object"&&!Array.isArray(e),`${t}.${s} must be a title or mapping`);keys(e,new Set(["title","trim-prefix"]),`${t}.${s}`);B[s]={...e.title===undefined?{}:{title:text(e.title,`${t}.${s}.title`)},...e["trim-prefix"]===undefined?{}:{trimPrefix:text(e["trim-prefix"],`${t}.${s}.trim-prefix`,300)}}}return B}function parseMetrics(e,t){n(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);const B={};for(const[s,r]of Object.entries(e)){const e=typeof r==="string"?{title:r}:r;n(s.length>0&&Buffer.byteLength(s)<=64,`${t} has invalid metric ${JSON.stringify(s)}`);n(e&&typeof e==="object"&&!Array.isArray(e),`${t}.${s} must be a title or mapping`);keys(e,new Set(["title","format"]),`${t}.${s}`);const i=e.format??"auto";n(o.has(i),`${t}.${s}.format has unsupported value ${i}`);B[s]={title:text(e.title??s,`${t}.${s}.title`),format:i}}return B}function serializeDimensionOptions(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t.title===undefined?{}:{title:t.title},...t.trimPrefix===undefined?{}:{"trim-prefix":t.trimPrefix}}]))}class View{constructor(e,t){n(i(e)&&e===e.toLowerCase(),`invalid view id ${JSON.stringify(e)}`);n(t&&typeof t==="object"&&!Array.isArray(t),`view ${e} must be a mapping`);keys(t,new Set(["title","select","table"]),`view ${e}`);this.id=e;this.title=text(t.title??e,`view ${e} title`);const B=t.select??{};n(B&&typeof B==="object"&&!Array.isArray(B),`view ${e} select must be a mapping`);keys(B,new Set(["platforms","packages","groups","benchmarks","metrics"]),`view ${e} select`);this.select={};this.compiledSelect={};for(const t of["platforms","packages","groups","benchmarks","metrics"]){const s=patterns(B[t],`view ${e} select.${t}`);this.select[t]=s.map(e=>e.source);this.compiledSelect[t]=s.map(e=>e.compiled)}const s=t.table??{};n(s&&typeof s==="object"&&!Array.isArray(s),`view ${e} table must be a mapping`);keys(s,new Set(["rows","columns","split-by","collapsed","missing","empty","max-rows","dimensions","metrics"]),`view ${e} table`);this.rows=dimensionList(s.rows,["platform","benchmark"],`view ${e} table.rows`);this.columns=dimensionList(s.columns,["metric"],`view ${e} table.columns`);this.splitBy=s["split-by"]===undefined?[]:dimensionList(s["split-by"],[],`view ${e} table.split-by`);const r=new Set;for(const t of[...this.rows,...this.columns,...this.splitBy]){n(!r.has(t),`view ${e} uses dimension ${t} more than once`);r.add(t)}this.collapsed=s.collapsed??false;n(typeof this.collapsed==="boolean",`view ${e} table.collapsed must be boolean`);this.missing=s.missing??"blank";n(this.missing==="blank"||this.missing==="error",`view ${e} table.missing must be blank or error`);this.empty=s.empty??"hide";n(this.empty==="hide"||this.empty==="error",`view ${e} table.empty must be hide or error`);this.maxRows=s["max-rows"]??200;n(Number.isInteger(this.maxRows)&&this.maxRows>=1&&this.maxRows<=1e3,`view ${e} table.max-rows must be between 1 and 1000`);this.dimensionOptions=parseDimensionOptions(s.dimensions??{},`view ${e} table.dimensions`);this.metrics=parseMetrics(s.metrics??{},`view ${e} table.metrics`)}matches(e){const t={platforms:[e.dimensions.platform.key,e.dimensions.platform.label],packages:[e.dimensions.package.key],groups:[e.dimensions.group.key,e.dimensions.group.label],benchmarks:[e.dimensions.benchmark.key,e.dimensions.benchmark.label,e.dimensions.benchmark.label.replace(/^Benchmark/u,"")],metrics:[e.dimensions.metric.key]};return Object.entries(this.compiledSelect).every(([e,B])=>B.length===0||B.some(B=>t[e].some(e=>B.matcher(e).find())))}toJSON(){return{title:this.title,select:Object.fromEntries(Object.entries(this.select).filter(([,e])=>e.length>0)),table:{rows:this.rows,columns:this.columns,...this.splitBy.length>0?{"split-by":this.splitBy}:{},collapsed:this.collapsed,missing:this.missing,empty:this.empty,"max-rows":this.maxRows,...Object.keys(this.dimensionOptions).length>0?{dimensions:serializeDimensionOptions(this.dimensionOptions)}:{},...Object.keys(this.metrics).length>0?{metrics:this.metrics}:{}}}}}function parseViews(e){if(e===undefined||e===null)return{};n(e&&typeof e==="object"&&!Array.isArray(e),"views must be a mapping");return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,new View(e,t)]))}function serializeViews(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.toJSON()]))}e.exports={parseViews:parseViews,serializeViews:serializeViews}},6919:(e,t,B)=>{"use strict";const{benchmarkKey:s}=B(8817);const{benchmarkIndex:n,isIndexPaired:r,metricComparison:i}=B(4408);const{delta:a,formatDelta:o,formatNumber:l,formatPreciseNumber:c,formatSigned:C,markdown:u,tableCell:f}=B(4217);const{assert:h,compareText:p}=B(8793);const g={platform:"Platform",package:"Package",group:"Group",benchmark:"Benchmark",metric:"Metric"};function groupTitle(e,t){if(t==="other")return"Other";return e.groups[t]?.title??t}function observations(e,t,B,a){const o=[];for(const l of Object.keys(t.platforms).sort(p)){const c=t.platforms[l];const C=B?.platforms?.[l];const u=n(C);const f=r(c,C,a);for(const t of c.benchmarks){const B=s(t);for(const s of Object.keys(t.measurements).sort(p)){const n=i(t,u.get(B),s,f);o.push({dimensions:{platform:{key:l,label:c.platform.label},package:{key:t.package??"",label:t.package||"(root)"},group:{key:t.group,label:groupTitle(e,t.group)},benchmark:{key:B,label:t.name},metric:{key:s,label:s}},value:t.measurements[s],...n,better:c.units?.[s]?.better})}}}return o}function tuple(e,t){return t.map(t=>e.dimensions[t])}function tupleKey(e){return JSON.stringify(e.map(e=>e.key))}function trim(e,t){return t&&e.startsWith(t)?e.slice(t.length):e}function tupleLabels(e,t,B){return e.map((e,s)=>{const n=t[s];if(n==="metric"){return B.metrics[e.key]?.title??e.label}return trim(e.label,B.dimensionOptions[n]?.trimPrefix)})}function dimensionTitle(e,t){return e.dimensionOptions[t]?.title??g[t]}function formatDuration(e,t,B=l){const s=e*{ns:1,us:1e3,ms:1e6,s:1e9}[t];if(s>=1e9)return`${B(s/1e9)} s`;if(s>=1e6)return`${B(s/1e6)} ms`;if(s>=1e3)return`${B(s/1e3)} us`;return`${B(s)} ns`}function formatValue(e,t,B,s=l){const n=B.metrics[t]?.format??"auto";if(n==="number")return s(e);if(n==="bytes")return`${s(e)} B`;if(n.startsWith("duration-")){return formatDuration(e,n.slice("duration-".length),s)}return`${s(e)} ${t}`}function metricRank(e,t){const B=Object.keys(e.metrics).indexOf(t.key);return B===-1?Number.MAX_SAFE_INTEGER:B}function compareTuple(e,t,B,s){for(let n=0;ncompareTuple(e,s,t,B))}function splitTitle(e,t){return e.map((e,B)=>`${dimensionTitle(t,t.splitBy[B])}: ${tupleLabels([e],[t.splitBy[B]],t)[0]}`).join(" / ")}function renderTable(e,t,B){const s=uniqueTuples(e,t.rows,t);const n=uniqueTuples(e,t.columns,t);h(s.length<=t.maxRows,`view ${t.id} has ${s.length} rows, exceeding max-rows ${t.maxRows}`);const r=new Map;for(const B of e){const e=tupleKey(tuple(B,t.rows));const s=tupleKey(tuple(B,t.columns));const n=`${e}\n${s}`;h(!r.has(n),`view ${t.id} has duplicate cell ${n}`);r.set(n,B)}const i=t.rows.map(e=>dimensionTitle(t,e));for(const e of n){const s=tupleLabels(e,t.columns,t);i.push(s.join(" / "),B)}const l=[`| ${i.map(f).join(" | ")} |`,`|${t.rows.map(()=>"---").join("|")}|${n.map(()=>"---:|---:").join("|")}|`];for(const e of s){const B=tupleLabels(e,t.rows,t).map(f);for(const s of n){const n=`${tupleKey(e)}\n${tupleKey(s)}`;const i=r.get(n);if(!i){h(t.missing==="blank",`view ${t.id} is missing cell ${n}`);B.push("-","-");continue}const l=i.change===undefined?a(i.value,i.baseline,i.better):o(i.change,i.better);const u=i.difference===undefined?l:`${C(i.difference,e=>formatValue(e,i.dimensions.metric.key,t,c))} / ${l}`;B.push(formatValue(i.value,i.dimensions.metric.key,t),u)}l.push(`| ${B.map(f).join(" | ")} |`)}return l}function renderView(e,t,B){const s=t.filter(t=>e.matches(t));if(s.length===0){h(e.empty==="hide",`view ${e.id} has no matching results`);return[]}const n=e.splitBy.length===0?[[]]:uniqueTuples(s,e.splitBy,e);const r=[];for(const t of n){const n=e.splitBy.length===0?s:s.filter(B=>tupleKey(tuple(B,e.splitBy))===tupleKey(t));if(t.length>0)r.push(`#### ${u(splitTitle(t,e))}`,"");r.push(...renderTable(n,e,B),"")}if(!e.collapsed){return[`### ${u(e.title)}`,"",...r]}return["
",`${u(e.title)}`,"",...r,"
",""]}function renderViews(e,t,B,s="vs main",n=false){const r=observations(e,t,B,n);return Object.values(e.views).flatMap(e=>renderView(e,r,s))}e.exports={renderViews:renderViews}},181:e=>{"use strict";e.exports=require("buffer")},3024:e=>{"use strict";e.exports=require("node:fs")},8161:e=>{"use strict";e.exports=require("node:os")},6760:e=>{"use strict";e.exports=require("node:path")},3136:e=>{"use strict";e.exports=require("node:url")},7975:e=>{"use strict";e.exports=require("node:util")},932:e=>{"use strict";e.exports=require("process")},7349:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(4454);var i=B(2223);var a=B(7103);var o=B(334);var l=B(3142);function resolveCollection(e,t,B,s,n,r){const i=B.type==="block-map"?a.resolveBlockMap(e,t,B,s,r):B.type==="block-seq"?o.resolveBlockSeq(e,t,B,s,r):l.resolveFlowCollection(e,t,B,s,r);const c=i.constructor;if(n==="!"||n===c.tagName){i.tag=c.tagName;return i}if(n)i.tag=n;return i}function composeCollection(e,t,B,a,o){const l=a.tag;const c=!l?null:t.directives.tagName(l.source,e=>o(l,"TAG_RESOLVE_FAILED",e));if(B.type==="block-seq"){const{anchor:e,newlineAfterProp:t}=a;const B=e&&l?e.offset>l.offset?e:l:e??l;if(B&&(!t||t.offsete.tag===c&&e.collection===C);if(!u){const s=t.schema.knownTags[c];if(s?.collection===C){t.schema.tags.push(Object.assign({},s,{default:false}));u=s}else{if(s){o(l,"BAD_COLLECTION_TYPE",`${s.tag} used for ${C} collection, but expects ${s.collection??"scalar"}`,true)}else{o(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,true)}return resolveCollection(e,t,B,o,c)}}const f=resolveCollection(e,t,B,o,c,u);const h=u.resolve?.(f,e=>o(l,"TAG_RESOLVE_FAILED",e),t.options)??f;const p=s.isNode(h)?h:new n.Scalar(h);p.range=f.range;p.tag=c;if(u?.format)p.format=u.format;return p}t.composeCollection=composeCollection},3683:(e,t,B)=>{"use strict";var s=B(3021);var n=B(5937);var r=B(7788);var i=B(4631);function composeDoc(e,t,{offset:B,start:a,value:o,end:l},c){const C=Object.assign({_directives:t},e);const u=new s.Document(undefined,C);const f={atKey:false,atRoot:true,directives:u.directives,options:u.options,schema:u.schema};const h=i.resolveProps(a,{indicator:"doc-start",next:o??l?.[0],offset:B,onError:c,parentIndent:0,startOnNewline:true});if(h.found){u.directives.docStart=true;if(o&&(o.type==="block-map"||o.type==="block-seq")&&!h.hasNewline)c(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}u.contents=o?n.composeNode(f,o,h,c):n.composeEmptyNode(f,h.end,a,null,h,c);const p=u.contents.range[2];const g=r.resolveEnd(l,p,false,c);if(g.comment)u.comment=g.comment;u.range=[B,p,g.offset];return u}t.composeDoc=composeDoc},5937:(e,t,B)=>{"use strict";var s=B(4065);var n=B(1127);var r=B(7349);var i=B(5413);var a=B(7788);var o=B(2599);const l={composeNode:composeNode,composeEmptyNode:composeEmptyNode};function composeNode(e,t,B,s){const a=e.atKey;const{spaceBefore:o,comment:c,anchor:C,tag:u}=B;let f;let h=true;switch(t.type){case"alias":f=composeAlias(e,t,s);if(C||u)s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=i.composeScalar(e,t,u,s);if(C)f.anchor=C.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{f=r.composeCollection(l,e,t,B,s);if(C)f.anchor=C.source.substring(1)}catch(e){const B=e instanceof Error?e.message:String(e);s(t,"RESOURCE_EXHAUSTION",B)}break;default:{const e=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",e);h=false}}f??(f=composeEmptyNode(e,t.offset,undefined,null,B,s));if(C&&f.anchor==="")s(C,"BAD_ALIAS","Anchor cannot be an empty string");if(a&&e.options.stringKeys&&(!n.isScalar(f)||typeof f.value!=="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")){const e="With stringKeys, all keys must be strings";s(u??t,"NON_STRING_KEY",e)}if(o)f.spaceBefore=true;if(c){if(t.type==="scalar"&&t.source==="")f.comment=c;else f.commentBefore=c}if(e.options.keepSourceTokens&&h)f.srcToken=t;return f}function composeEmptyNode(e,t,B,s,{spaceBefore:n,comment:r,anchor:a,tag:l,end:c},C){const u={type:"scalar",offset:o.emptyScalarPosition(t,B,s),indent:-1,source:""};const f=i.composeScalar(e,u,l,C);if(a){f.anchor=a.source.substring(1);if(f.anchor==="")C(a,"BAD_ALIAS","Anchor cannot be an empty string")}if(n)f.spaceBefore=true;if(r){f.comment=r;f.range[2]=c}return f}function composeAlias({options:e},{offset:t,source:B,end:n},r){const i=new s.Alias(B.substring(1));if(i.source==="")r(t,"BAD_ALIAS","Alias cannot be an empty string");if(i.source.endsWith(":"))r(t+B.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);const o=t+B.length;const l=a.resolveEnd(n,o,e.strict,r);i.range=[t,o,l.offset];if(l.comment)i.comment=l.comment;return i}t.composeEmptyNode=composeEmptyNode;t.composeNode=composeNode},5413:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(8913);var i=B(6842);function composeScalar(e,t,B,a){const{value:o,type:l,comment:c,range:C}=t.type==="block-scalar"?r.resolveBlockScalar(e,t,a):i.resolveFlowScalar(t,e.options.strict,a);const u=B?e.directives.tagName(B.source,e=>a(B,"TAG_RESOLVE_FAILED",e)):null;let f;if(e.options.stringKeys&&e.atKey){f=e.schema[s.SCALAR]}else if(u)f=findScalarTagByName(e.schema,o,u,B,a);else if(t.type==="scalar")f=findScalarTagByTest(e,o,t,a);else f=e.schema[s.SCALAR];let h;try{const r=f.resolve(o,e=>a(B??t,"TAG_RESOLVE_FAILED",e),e.options);h=s.isScalar(r)?r:new n.Scalar(r)}catch(e){const s=e instanceof Error?e.message:String(e);a(B??t,"TAG_RESOLVE_FAILED",s);h=new n.Scalar(o)}h.range=C;h.source=o;if(l)h.type=l;if(u)h.tag=u;if(f.format)h.format=f.format;if(c)h.comment=c;return h}function findScalarTagByName(e,t,B,n,r){if(B==="!")return e[s.SCALAR];const i=[];for(const t of e.tags){if(!t.collection&&t.tag===B){if(t.default&&t.test)i.push(t);else return t}}for(const e of i)if(e.test?.test(t))return e;const a=e.knownTags[B];if(a&&!a.collection){e.tags.push(Object.assign({},a,{default:false,test:undefined}));return a}r(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${B}`,B!=="tag:yaml.org,2002:str");return e[s.SCALAR]}function findScalarTagByTest({atKey:e,directives:t,schema:B},n,r,i){const a=B.tags.find(t=>(t.default===true||e&&t.default==="key")&&t.test?.test(n))||B[s.SCALAR];if(B.compat){const e=B.compat.find(e=>e.default&&e.test?.test(n))??B[s.SCALAR];if(a.tag!==e.tag){const B=t.tagString(a.tag);const s=t.tagString(e.tag);const n=`Value may be parsed as either ${B} or ${s}`;i(r,"TAG_RESOLVE_FAILED",n,true)}}return a}t.composeScalar=composeScalar},9984:(e,t,B)=>{"use strict";var s=B(932);var n=B(1342);var r=B(3021);var i=B(1464);var a=B(1127);var o=B(3683);var l=B(7788);function getErrorPos(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:B}=e;return[t,t+(typeof B==="string"?B.length:1)]}function parsePrelude(e){let t="";let B=false;let s=false;for(let n=0;n{const n=getErrorPos(e);if(s)this.warnings.push(new i.YAMLWarning(n,t,B));else this.errors.push(new i.YAMLParseError(n,t,B))};this.directives=new n.Directives({version:e.version||"1.2"});this.options=e}decorate(e,t){const{comment:B,afterEmptyLine:s}=parsePrelude(this.prelude);if(B){const n=e.contents;if(t){e.comment=e.comment?`${e.comment}\n${B}`:B}else if(s||e.directives.docStart||!n){e.commentBefore=B}else if(a.isCollection(n)&&!n.flow&&n.items.length>0){let e=n.items[0];if(a.isPair(e))e=e.key;const t=e.commentBefore;e.commentBefore=t?`${B}\n${t}`:B}else{const e=n.commentBefore;n.commentBefore=e?`${B}\n${e}`:B}}if(t){for(let t=0;t{const n=getErrorPos(e);n[0]+=t;this.onError(n,"BAD_DIRECTIVE",B,s)});this.prelude.push(e.source);this.atDirectives=true;break;case"document":{const t=o.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");this.decorate(t,false);if(this.doc)yield this.doc;this.doc=t;this.atDirectives=false;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message;const B=new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(B);else this.doc.errors.push(B);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=true;const t=l.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);this.decorate(this.doc,true);if(t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=false,t=-1){if(this.doc){this.decorate(this.doc,true);yield this.doc;this.doc=null}else if(e){const e=Object.assign({_directives:this.directives},this.options);const B=new r.Document(undefined,e);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");B.range=[0,t,t];this.decorate(B,false);yield B}}}t.Composer=Composer},7103:(e,t,B)=>{"use strict";var s=B(7165);var n=B(4454);var r=B(4631);var i=B(9499);var a=B(4051);var o=B(1187);const l="All mapping items must start at the same column";function resolveBlockMap({composeNode:e,composeEmptyNode:t},B,c,C,u){const f=u?.nodeClass??n.YAMLMap;const h=new f(B.schema);if(B.atRoot)B.atRoot=false;let p=c.offset;let g=null;for(const n of c.items){const{start:u,key:f,sep:m,value:d}=n;const D=r.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:p,onError:C,parentIndent:c.indent,startOnNewline:true});const E=!D.found;if(E){if(f){if(f.type==="block-seq")C(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==c.indent)C(p,"BAD_INDENT",l)}if(!D.anchor&&!D.tag&&!m){g=D.end;if(D.comment){if(h.comment)h.comment+="\n"+D.comment;else h.comment=D.comment}continue}if(D.newlineAfterProp||i.containsNewline(f)){C(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}}else if(D.found?.indent!==c.indent){C(p,"BAD_INDENT",l)}B.atKey=true;const y=D.end;const b=f?e(B,f,D,C):t(B,y,u,null,D,C);if(B.schema.compat)a.flowIndentCheck(c.indent,f,C);B.atKey=false;if(o.mapIncludes(B,h.items,b))C(y,"DUPLICATE_KEY","Map keys must be unique");const O=r.resolveProps(m??[],{indicator:"map-value-ind",next:d,offset:b.range[2],onError:C,parentIndent:c.indent,startOnNewline:!f||f.type==="block-scalar"});p=O.end;if(O.found){if(E){if(d?.type==="block-map"&&!O.hasNewline)C(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(B.options.strict&&D.start{"use strict";var s=B(3301);function resolveBlockScalar(e,t,B){const n=t.offset;const r=parseBlockScalarHeader(t,e.options.strict,B);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};const i=r.mode===">"?s.Scalar.BLOCK_FOLDED:s.Scalar.BLOCK_LITERAL;const a=t.source?splitLines(t.source):[];let o=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(t===""||t==="\r")o=e;else break}if(o===0){const e=r.chomp==="+"&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let B=n+r.length;if(t.source)B+=t.source.length;return{value:e,type:i,comment:r.comment,range:[n,B,B]}}let l=t.indent+r.indent;let c=t.offset+r.length;let C=0;for(let t=0;tl)l=s.length}else{if(s.length=o;--e){if(a[e][0].length>l)o=e+1}let u="";let f="";let h=false;for(let e=0;el||n[0]==="\t"){if(f===" ")f="\n";else if(!h&&f==="\n")f="\n\n";u+=f+t.slice(l)+n;f="\n";h=true}else if(n===""){if(f==="\n")u+="\n";else f="\n"}else{u+=f+n;f=" ";h=false}}switch(r.chomp){case"-":break;case"+":for(let e=o;e{"use strict";var s=B(2223);var n=B(4631);var r=B(4051);function resolveBlockSeq({composeNode:e,composeEmptyNode:t},B,i,a,o){const l=o?.nodeClass??s.YAMLSeq;const c=new l(B.schema);if(B.atRoot)B.atRoot=false;if(B.atKey)B.atKey=false;let C=i.offset;let u=null;for(const{start:s,value:o}of i.items){const l=n.resolveProps(s,{indicator:"seq-item-ind",next:o,offset:C,onError:a,parentIndent:i.indent,startOnNewline:true});if(!l.found){if(l.anchor||l.tag||o){if(o?.type==="block-seq")a(l.end,"BAD_INDENT","All sequence items must start at the same column");else a(C,"MISSING_CHAR","Sequence item without - indicator")}else{u=l.end;if(l.comment)c.comment=l.comment;continue}}const f=o?e(B,o,l,a):t(B,l.end,s,null,l,a);if(B.schema.compat)r.flowIndentCheck(i.indent,o,a);C=f.range[2];c.items.push(f)}c.range=[i.offset,C,u??C];return c}t.resolveBlockSeq=resolveBlockSeq},7788:(e,t)=>{"use strict";function resolveEnd(e,t,B,s){let n="";if(e){let r=false;let i="";for(const a of e){const{source:e,type:o}=a;switch(o){case"space":r=true;break;case"comment":{if(B&&!r)s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";if(!n)n=t;else n+=i+t;i="";break}case"newline":if(n)i+=e;r=true;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${o} at node end`)}t+=e.length}}return{comment:n,offset:t}}t.resolveEnd=resolveEnd},3142:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(4454);var i=B(2223);var a=B(7788);var o=B(4631);var l=B(9499);var c=B(1187);const C="Block collections are not allowed within flow collections";const isBlock=e=>e&&(e.type==="block-map"||e.type==="block-seq");function resolveFlowCollection({composeNode:e,composeEmptyNode:t},B,u,f,h){const p=u.start.source==="{";const g=p?"flow map":"flow sequence";const m=h?.nodeClass??(p?r.YAMLMap:i.YAMLSeq);const d=new m(B.schema);d.flow=true;const D=B.atRoot;if(D)B.atRoot=false;if(B.atKey)B.atKey=false;let E=u.offset+u.start.source.length;for(let i=0;i0){const e=a.resolveEnd(O,w,B.options.strict,f);if(e.comment){if(d.comment)d.comment+="\n"+e.comment;else d.comment=e.comment}d.range=[u.offset,w,e.offset]}else{d.range=[u.offset,w,w]}return d}t.resolveFlowCollection=resolveFlowCollection},6842:(e,t,B)=>{"use strict";var s=B(3301);var n=B(7788);function resolveFlowScalar(e,t,B){const{offset:r,type:i,source:a,end:o}=e;let l;let c;const _onError=(e,t,s)=>B(r+e,t,s);switch(i){case"scalar":l=s.Scalar.PLAIN;c=plainValue(a,_onError);break;case"single-quoted-scalar":l=s.Scalar.QUOTE_SINGLE;c=singleQuotedValue(a,_onError);break;case"double-quoted-scalar":l=s.Scalar.QUOTE_DOUBLE;c=doubleQuotedValue(a,_onError);break;default:B(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`);return{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const C=r+a.length;const u=n.resolveEnd(o,C,t,B);return{value:c,type:l,comment:u.comment,range:[r,C,u.offset]}}function plainValue(e,t){let B="";switch(e[0]){case"\t":B="a tab character";break;case",":B="flow indicator character ,";break;case"%":B="directive indicator character %";break;case"|":case">":{B=`block scalar indicator ${e[0]}`;break}case"@":case"`":{B=`reserved character ${e[0]}`;break}}if(B)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${B}`);return foldLines(e)}function singleQuotedValue(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return foldLines(e.slice(1,-1)).replace(/''/g,"'")}function foldLines(e){let t,B;try{t=new RegExp("(.*?)(?t?e.slice(t,s+1):n}else{B+=n}}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return B}function foldNewline(e,t){let B="";let s=e[t+1];while(s===" "||s==="\t"||s==="\n"||s==="\r"){if(s==="\r"&&e[t+2]!=="\n")break;if(s==="\n")B+="\n";t+=1;s=e[t+1]}if(!B)B=" ";return{fold:B,offset:t}}const r={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function parseCharCode(e,t,B,s){const n=e.substr(t,B);const r=n.length===B&&/^[0-9a-fA-F]+$/.test(n);const i=r?parseInt(n,16):NaN;try{return String.fromCodePoint(i)}catch{const n=e.substr(t-2,B+2);s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${n}`);return n}}t.resolveFlowScalar=resolveFlowScalar},4631:(e,t)=>{"use strict";function resolveProps(e,{flow:t,indicator:B,next:s,offset:n,onError:r,parentIndent:i,startOnNewline:a}){let o=false;let l=a;let c=a;let C="";let u="";let f=false;let h=false;let p=null;let g=null;let m=null;let d=null;let D=null;let E=null;let y=null;for(const n of e){if(h){if(n.type!=="space"&&n.type!=="newline"&&n.type!=="comma")r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");h=false}if(p){if(l&&n.type!=="comment"&&n.type!=="newline"){r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation")}p=null}switch(n.type){case"space":if(!t&&(B!=="doc-start"||s?.type!=="flow-collection")&&n.source.includes("\t")){p=n}c=true;break;case"comment":{if(!c)r(n,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=n.source.substring(1)||" ";if(!C)C=e;else C+=u+e;u="";l=false;break}case"newline":if(l){if(C)C+=n.source;else if(!E||B!=="seq-item-ind")o=true}else u+=n.source;l=true;f=true;if(g||m)d=n;c=true;break;case"anchor":if(g)r(n,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(n.source.endsWith(":"))r(n.offset+n.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true);g=n;y??(y=n.offset);l=false;c=false;h=true;break;case"tag":{if(m)r(n,"MULTIPLE_TAGS","A node can have at most one tag");m=n;y??(y=n.offset);l=false;c=false;h=true;break}case B:if(g||m)r(n,"BAD_PROP_ORDER",`Anchors and tags must be after the ${n.source} indicator`);if(E)r(n,"UNEXPECTED_TOKEN",`Unexpected ${n.source} in ${t??"collection"}`);E=n;l=B==="seq-item-ind"||B==="explicit-key-ind";c=false;break;case"comma":if(t){if(D)r(n,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);D=n;l=false;c=false;break}default:r(n,"UNEXPECTED_TOKEN",`Unexpected ${n.type} token`);l=false;c=false}}const b=e[e.length-1];const O=b?b.offset+b.source.length:n;if(h&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")){r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space")}if(p&&(l&&p.indent<=i||s?.type==="block-map"||s?.type==="block-seq"))r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:E,spaceBefore:o,comment:C,hasNewline:f,anchor:g,tag:m,newlineAfterProp:d,end:O,start:y??O}}t.resolveProps=resolveProps},9499:(e,t)=>{"use strict";function containsNewline(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return true;if(e.end)for(const t of e.end)if(t.type==="newline")return true;return false;case"flow-collection":for(const t of e.items){for(const e of t.start)if(e.type==="newline")return true;if(t.sep)for(const e of t.sep)if(e.type==="newline")return true;if(containsNewline(t.key)||containsNewline(t.value))return true}return false;default:return true}}t.containsNewline=containsNewline},2599:(e,t)=>{"use strict";function emptyScalarPosition(e,t,B){if(t){B??(B=t.length);for(let s=B-1;s>=0;--s){let B=t[s];switch(B.type){case"space":case"comment":case"newline":e-=B.source.length;continue}B=t[++s];while(B?.type==="space"){e+=B.source.length;B=t[++s]}break}}return e}t.emptyScalarPosition=emptyScalarPosition},4051:(e,t,B)=>{"use strict";var s=B(9499);function flowIndentCheck(e,t,B){if(t?.type==="flow-collection"){const n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&s.containsNewline(t)){const e="Flow end indicator should be more indented than parent";B(n,"BAD_INDENT",e,true)}}}t.flowIndentCheck=flowIndentCheck},1187:(e,t,B)=>{"use strict";var s=B(1127);function mapIncludes(e,t,B){const{uniqueKeys:n}=e.options;if(n===false)return false;const r=typeof n==="function"?n:(e,t)=>e===t||s.isScalar(e)&&s.isScalar(t)&&e.value===t.value;return t.some(e=>r(e.key,B))}t.mapIncludes=mapIncludes},3021:(e,t,B)=>{"use strict";var s=B(4065);var n=B(101);var r=B(1127);var i=B(7165);var a=B(4043);var o=B(5840);var l=B(6829);var c=B(1596);var C=B(3661);var u=B(2404);var f=B(1342);class Document{constructor(e,t,B){this.commentBefore=null;this.comment=null;this.errors=[];this.warnings=[];Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let s=null;if(typeof t==="function"||Array.isArray(t)){s=t}else if(B===undefined&&t){B=t;t=undefined}const n=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},B);this.options=n;let{version:i}=n;if(B?._directives){this.directives=B._directives.atDocument();if(this.directives.yaml.explicit)i=this.directives.yaml.version}else this.directives=new f.Directives({version:i});this.setSchema(i,B);this.contents=e===undefined?null:this.createNode(e,s,B)}clone(){const e=Object.create(Document.prototype,{[r.NODE_TYPE]:{value:r.DOC}});e.commentBefore=this.commentBefore;e.comment=this.comment;e.errors=this.errors.slice();e.warnings=this.warnings.slice();e.options=Object.assign({},this.options);if(this.directives)e.directives=this.directives.clone();e.schema=this.schema.clone();e.contents=r.isNode(this.contents)?this.contents.clone(e.schema):this.contents;if(this.range)e.range=this.range.slice();return e}add(e){if(assertCollection(this.contents))this.contents.add(e)}addIn(e,t){if(assertCollection(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const B=c.anchorNames(this);e.anchor=!t||B.has(t)?c.findNewAnchor(t||"a",B):t}return new s.Alias(e.anchor)}createNode(e,t,B){let s=undefined;if(typeof t==="function"){e=t.call({"":e},"",e);s=t}else if(Array.isArray(t)){const keyToStr=e=>typeof e==="number"||e instanceof String||e instanceof Number;const e=t.filter(keyToStr).map(String);if(e.length>0)t=t.concat(e);s=t}else if(B===undefined&&t){B=t;t=undefined}const{aliasDuplicateObjects:n,anchorPrefix:i,flow:a,keepUndefined:o,onTagObj:l,tag:C}=B??{};const{onAnchor:f,setAnchors:h,sourceObjects:p}=c.createNodeAnchors(this,i||"a");const g={aliasDuplicateObjects:n??true,keepUndefined:o??false,onAnchor:f,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:p};const m=u.createNode(e,C,g);if(a&&r.isCollection(m))m.flow=true;h();return m}createPair(e,t,B={}){const s=this.createNode(e,null,B);const n=this.createNode(t,null,B);return new i.Pair(s,n)}delete(e){return assertCollection(this.contents)?this.contents.delete(e):false}deleteIn(e){if(n.isEmptyPath(e)){if(this.contents==null)return false;this.contents=null;return true}return assertCollection(this.contents)?this.contents.deleteIn(e):false}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):undefined}getIn(e,t){if(n.isEmptyPath(e))return!t&&r.isScalar(this.contents)?this.contents.value:this.contents;return r.isCollection(this.contents)?this.contents.getIn(e,t):undefined}has(e){return r.isCollection(this.contents)?this.contents.has(e):false}hasIn(e){if(n.isEmptyPath(e))return this.contents!==undefined;return r.isCollection(this.contents)?this.contents.hasIn(e):false}set(e,t){if(this.contents==null){this.contents=n.collectionFromPath(this.schema,[e],t)}else if(assertCollection(this.contents)){this.contents.set(e,t)}}setIn(e,t){if(n.isEmptyPath(e)){this.contents=t}else if(this.contents==null){this.contents=n.collectionFromPath(this.schema,Array.from(e),t)}else if(assertCollection(this.contents)){this.contents.setIn(e,t)}}setSchema(e,t={}){if(typeof e==="number")e=String(e);let B;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new f.Directives({version:"1.1"});B={resolveKnownTags:false,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new f.Directives({version:e});B={resolveKnownTags:true,schema:"core"};break;case null:if(this.directives)delete this.directives;B=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(B)this.schema=new o.Schema(Object.assign(B,t));else throw new Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:B,maxAliasCount:s,onAnchor:n,reviver:r}={}){const i={anchors:new Map,doc:this,keep:!e,mapAsMap:B===true,mapKeyWarned:false,maxAliasCount:typeof s==="number"?s:100};const o=a.toJS(this.contents,t??"",i);if(typeof n==="function")for(const{count:e,res:t}of i.anchors.values())n(t,e);return typeof r==="function"?C.applyReviver(r,{"":o},"",o):o}toJSON(e,t){return this.toJS({json:true,jsonArg:e,mapAsMap:false,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return l.stringifyDocument(this,e)}}function assertCollection(e){if(r.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}t.Document=Document},1596:(e,t,B)=>{"use strict";var s=B(1127);var n=B(204);function anchorIsValid(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);const B=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(B)}return true}function anchorNames(e){const t=new Set;n.visit(e,{Value(e,B){if(B.anchor)t.add(B.anchor)}});return t}function findNewAnchor(e,t){for(let B=1;true;++B){const s=`${e}${B}`;if(!t.has(s))return s}}function createNodeAnchors(e,t){const B=[];const n=new Map;let r=null;return{onAnchor:s=>{B.push(s);r??(r=anchorNames(e));const n=findNewAnchor(t,r);r.add(n);return n},setAnchors:()=>{for(const e of B){const t=n.get(e);if(typeof t==="object"&&t.anchor&&(s.isScalar(t.node)||s.isCollection(t.node))){t.node.anchor=t.anchor}else{const t=new Error("Failed to resolve repeated object (this should not happen)");t.source=e;throw t}}},sourceObjects:n}}t.anchorIsValid=anchorIsValid;t.anchorNames=anchorNames;t.createNodeAnchors=createNodeAnchors;t.findNewAnchor=findNewAnchor},3661:(e,t)=>{"use strict";function applyReviver(e,t,B,s){if(s&&typeof s==="object"){if(Array.isArray(s)){for(let t=0,B=s.length;t{"use strict";var s=B(4065);var n=B(1127);var r=B(3301);const i="tag:yaml.org,2002:";function findTagObject(e,t,B){if(t){const e=B.filter(e=>e.tag===t);const s=e.find(e=>!e.format)??e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return B.find(t=>t.identify?.(e)&&!t.format)}function createNode(e,t,B){if(n.isDocument(e))e=e.contents;if(n.isNode(e))return e;if(n.isPair(e)){const t=B.schema[n.MAP].createNode?.(B.schema,null,B);t.items.push(e);return t}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!=="undefined"&&e instanceof BigInt){e=e.valueOf()}const{aliasDuplicateObjects:a,onAnchor:o,onTagObj:l,schema:c,sourceObjects:C}=B;let u=undefined;if(a&&e&&typeof e==="object"){u=C.get(e);if(u){u.anchor??(u.anchor=o(e));return new s.Alias(u.anchor)}else{u={anchor:null,node:null};C.set(e,u)}}if(t?.startsWith("!!"))t=i+t.slice(2);let f=findTagObject(e,t,c.tags);if(!f){if(e&&typeof e.toJSON==="function"){e=e.toJSON()}if(!e||typeof e!=="object"){const t=new r.Scalar(e);if(u)u.node=t;return t}f=e instanceof Map?c[n.MAP]:Symbol.iterator in Object(e)?c[n.SEQ]:c[n.MAP]}if(l){l(f);delete B.onTagObj}const h=f?.createNode?f.createNode(B.schema,e,B):typeof f?.nodeClass?.from==="function"?f.nodeClass.from(B.schema,e,B):new r.Scalar(e);if(t)h.tag=t;else if(!f.default)h.tag=f.tag;if(u)u.node=h;return h}t.createNode=createNode},1342:(e,t,B)=>{"use strict";var s=B(1127);var n=B(204);const r={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};const escapeTagName=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);class Directives{constructor(e,t){this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},Directives.defaultYaml,e);this.tags=Object.assign({},Directives.defaultTags,t)}clone(){const e=new Directives(this.yaml,this.tags);e.docStart=this.docStart;return e}atDocument(){const e=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},Directives.defaultTags);break}return e}add(e,t){if(this.atNextDocument){this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},Directives.defaultTags);this.atNextDocument=false}const B=e.trim().split(/[ \t]+/);const s=B.shift();switch(s){case"%TAG":{if(B.length!==2){t(0,"%TAG directive should contain exactly two parts");if(B.length<2)return false}const[e,s]=B;this.tags[e]=s;return true}case"%YAML":{this.yaml.explicit=true;if(B.length!==1){t(0,"%YAML directive should contain exactly one part");return false}const[e]=B;if(e==="1.1"||e==="1.2"){this.yaml.version=e;return true}else{const B=/^\d+\.\d+$/.test(e);t(6,`Unsupported YAML version ${e}`,B);return false}}default:t(0,`Unknown directive ${s}`,true);return false}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!"){t(`Not a valid tag: ${e}`);return null}if(e[1]==="<"){const B=e.slice(2,-1);if(B==="!"||B==="!!"){t(`Verbatim tags aren't resolved, so ${e} is invalid.`);return null}if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return B}const[,B,s]=e.match(/^(.*!)([^!]*)$/s);if(!s)t(`The ${e} tag has no suffix`);const n=this.tags[B];if(n){try{return n+decodeURIComponent(s)}catch(e){t(String(e));return null}}if(B==="!")return e;t(`Could not resolve tag: ${e}`);return null}tagString(e){for(const[t,B]of Object.entries(this.tags)){if(e.startsWith(B))return t+escapeTagName(e.substring(B.length))}return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[];const B=Object.entries(this.tags);let r;if(e&&B.length>0&&s.isNode(e.contents)){const t={};n.visit(e.contents,(e,B)=>{if(s.isNode(B)&&B.tag)t[B.tag]=true});r=Object.keys(t)}else r=[];for(const[s,n]of B){if(s==="!!"&&n==="tag:yaml.org,2002:")continue;if(!e||r.some(e=>e.startsWith(n)))t.push(`%TAG ${s} ${n}`)}return t.join("\n")}}Directives.defaultYaml={explicit:false,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"};t.Directives=Directives},1464:(e,t)=>{"use strict";class YAMLError extends Error{constructor(e,t,B,s){super();this.name=e;this.code=B;this.message=s;this.pos=t}}class YAMLParseError extends YAMLError{constructor(e,t,B){super("YAMLParseError",e,t,B)}}class YAMLWarning extends YAMLError{constructor(e,t,B){super("YAMLWarning",e,t,B)}}const prettifyError=(e,t)=>B=>{if(B.pos[0]===-1)return;B.linePos=B.pos.map(e=>t.linePos(e));const{line:s,col:n}=B.linePos[0];B.message+=` at line ${s}, column ${n}`;let r=n-1;let i=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&i.length>80){const e=Math.min(r-39,i.length-79);i="…"+i.substring(e);r-=e-1}if(i.length>80)i=i.substring(0,79)+"…";if(s>1&&/^ *$/.test(i.substring(0,r))){let B=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);if(B.length>80)B=B.substring(0,79)+"…\n";i=B+i}if(/[^ ]/.test(i)){let e=1;const t=B.linePos[1];if(t?.line===s&&t.col>n){e=Math.max(1,Math.min(t.col-n,80-r))}const a=" ".repeat(r)+"^".repeat(e);B.message+=`:\n\n${i}\n${a}\n`}};t.YAMLError=YAMLError;t.YAMLParseError=YAMLParseError;t.YAMLWarning=YAMLWarning;t.prettifyError=prettifyError},8815:(e,t,B)=>{"use strict";var s=B(9984);var n=B(3021);var r=B(5840);var i=B(1464);var a=B(4065);var o=B(1127);var l=B(7165);var c=B(3301);var C=B(4454);var u=B(2223);var f=B(3461);var h=B(361);var p=B(6628);var g=B(3456);var m=B(4047);var d=B(204);t.Composer=s.Composer;t.Document=n.Document;t.Schema=r.Schema;t.YAMLError=i.YAMLError;t.YAMLParseError=i.YAMLParseError;t.YAMLWarning=i.YAMLWarning;t.Alias=a.Alias;t.isAlias=o.isAlias;t.isCollection=o.isCollection;t.isDocument=o.isDocument;t.isMap=o.isMap;t.isNode=o.isNode;t.isPair=o.isPair;t.isScalar=o.isScalar;t.isSeq=o.isSeq;t.Pair=l.Pair;t.Scalar=c.Scalar;t.YAMLMap=C.YAMLMap;t.YAMLSeq=u.YAMLSeq;t.CST=f;t.Lexer=h.Lexer;t.LineCounter=p.LineCounter;t.Parser=g.Parser;t.parse=m.parse;t.parseAllDocuments=m.parseAllDocuments;t.parseDocument=m.parseDocument;t.stringify=m.stringify;t.visit=d.visit;t.visitAsync=d.visitAsync},7249:(e,t,B)=>{"use strict";var s=B(932);function debug(e,...t){if(e==="debug")console.log(...t)}function warn(e,t){if(e==="debug"||e==="warn"){if(typeof s.emitWarning==="function")s.emitWarning(t);else console.warn(t)}}t.debug=debug;t.warn=warn},4065:(e,t,B)=>{"use strict";var s=B(1596);var n=B(204);var r=B(1127);var i=B(6673);var a=B(4043);class Alias extends i.NodeBase{constructor(e){super(r.ALIAS);this.source=e;Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let B;if(t?.aliasResolveCache){B=t.aliasResolveCache}else{B=[];n.visit(e,{Node:(e,t)=>{if(r.isAlias(t)||r.hasAnchor(t))B.push(t)}});if(t)t.aliasResolveCache=B}let s=undefined;for(const e of B){if(e===this)break;if(e.anchor===this.source)s=e}return s}toJSON(e,t){if(!t)return{source:this.source};const{anchors:B,doc:s,maxAliasCount:n}=t;const r=this.resolve(s,t);if(!r){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let i=B.get(r);if(!i){a.toJS(r,null,t);i=B.get(r)}if(i?.res===undefined){const e="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(e)}if(n>=0){i.count+=1;if(i.aliasCount===0)i.aliasCount=getAliasCount(s,r,B);if(i.count*i.aliasCount>n){const e="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(e)}}return i.res}toString(e,t,B){const n=`*${this.source}`;if(e){s.anchorIsValid(this.source);if(e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${n} `}return n}}function getAliasCount(e,t,B){if(r.isAlias(t)){const s=t.resolve(e);const n=B&&s&&B.get(s);return n?n.count*n.aliasCount:0}else if(r.isCollection(t)){let s=0;for(const n of t.items){const t=getAliasCount(e,n,B);if(t>s)s=t}return s}else if(r.isPair(t)){const s=getAliasCount(e,t.key,B);const n=getAliasCount(e,t.value,B);return Math.max(s,n)}return 1}t.Alias=Alias},101:(e,t,B)=>{"use strict";var s=B(2404);var n=B(1127);var r=B(6673);function collectionFromPath(e,t,B){let n=B;for(let e=t.length-1;e>=0;--e){const B=t[e];if(typeof B==="number"&&Number.isInteger(B)&&B>=0){const e=[];e[B]=n;n=e}else{n=new Map([[B,n]])}}return s.createNode(n,undefined,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const isEmptyPath=e=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class Collection extends r.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:true,enumerable:false,writable:true})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t);if(this.range)t.range=this.range.slice();return t}addIn(e,t){if(isEmptyPath(e))this.add(t);else{const[B,...s]=e;const r=this.get(B,true);if(n.isCollection(r))r.addIn(s,t);else if(r===undefined&&this.schema)this.set(B,collectionFromPath(this.schema,s,t));else throw new Error(`Expected YAML collection at ${B}. Remaining path: ${s}`)}}deleteIn(e){const[t,...B]=e;if(B.length===0)return this.delete(t);const s=this.get(t,true);if(n.isCollection(s))return s.deleteIn(B);else throw new Error(`Expected YAML collection at ${t}. Remaining path: ${B}`)}getIn(e,t){const[B,...s]=e;const r=this.get(B,true);if(s.length===0)return!t&&n.isScalar(r)?r.value:r;else return n.isCollection(r)?r.getIn(s,t):undefined}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return false;const B=t.value;return B==null||e&&n.isScalar(B)&&B.value==null&&!B.commentBefore&&!B.comment&&!B.tag})}hasIn(e){const[t,...B]=e;if(B.length===0)return this.has(t);const s=this.get(t,true);return n.isCollection(s)?s.hasIn(B):false}setIn(e,t){const[B,...s]=e;if(s.length===0){this.set(B,t)}else{const e=this.get(B,true);if(n.isCollection(e))e.setIn(s,t);else if(e===undefined&&this.schema)this.set(B,collectionFromPath(this.schema,s,t));else throw new Error(`Expected YAML collection at ${B}. Remaining path: ${s}`)}}}t.Collection=Collection;t.collectionFromPath=collectionFromPath;t.isEmptyPath=isEmptyPath},6673:(e,t,B)=>{"use strict";var s=B(3661);var n=B(1127);var r=B(4043);class NodeBase{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:B,onAnchor:i,reviver:a}={}){if(!n.isDocument(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:true,mapAsMap:t===true,mapKeyWarned:false,maxAliasCount:typeof B==="number"?B:100};const l=r.toJS(this,"",o);if(typeof i==="function")for(const{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==="function"?s.applyReviver(a,{"":l},"",l):l}}t.NodeBase=NodeBase},7165:(e,t,B)=>{"use strict";var s=B(2404);var n=B(9748);var r=B(7104);var i=B(1127);function createPair(e,t,B){const n=s.createNode(e,undefined,B);const r=s.createNode(t,undefined,B);return new Pair(n,r)}class Pair{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR});this.key=e;this.value=t}clone(e){let{key:t,value:B}=this;if(i.isNode(t))t=t.clone(e);if(i.isNode(B))B=B.clone(e);return new Pair(t,B)}toJSON(e,t){const B=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,B,this)}toString(e,t,B){return e?.doc?n.stringifyPair(this,e,t,B):JSON.stringify(this)}}t.Pair=Pair;t.createPair=createPair},3301:(e,t,B)=>{"use strict";var s=B(1127);var n=B(6673);var r=B(4043);const isScalarValue=e=>!e||typeof e!=="function"&&typeof e!=="object";class Scalar extends n.NodeBase{constructor(e){super(s.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}}Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE";t.Scalar=Scalar;t.isScalarValue=isScalarValue},4454:(e,t,B)=>{"use strict";var s=B(1212);var n=B(7104);var r=B(101);var i=B(1127);var a=B(7165);var o=B(3301);function findPair(e,t){const B=i.isScalar(t)?t.value:t;for(const s of e){if(i.isPair(s)){if(s.key===t||s.key===B)return s;if(i.isScalar(s.key)&&s.key.value===B)return s}}return undefined}class YAMLMap extends r.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(i.MAP,e);this.items=[]}static from(e,t,B){const{keepUndefined:s,replacer:n}=B;const r=new this(e);const add=(e,i)=>{if(typeof n==="function")i=n.call(t,e,i);else if(Array.isArray(n)&&!n.includes(e))return;if(i!==undefined||s)r.items.push(a.createPair(e,i,B))};if(t instanceof Map){for(const[e,B]of t)add(e,B)}else if(t&&typeof t==="object"){for(const e of Object.keys(t))add(e,t[e])}if(typeof e.sortMapEntries==="function"){r.items.sort(e.sortMapEntries)}return r}add(e,t){let B;if(i.isPair(e))B=e;else if(!e||typeof e!=="object"||!("key"in e)){B=new a.Pair(e,e?.value)}else B=new a.Pair(e.key,e.value);const s=findPair(this.items,B.key);const n=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${B.key} already set`);if(i.isScalar(s.value)&&o.isScalarValue(B.value))s.value.value=B.value;else s.value=B.value}else if(n){const e=this.items.findIndex(e=>n(B,e)<0);if(e===-1)this.items.push(B);else this.items.splice(e,0,B)}else{this.items.push(B)}}delete(e){const t=findPair(this.items,e);if(!t)return false;const B=this.items.splice(this.items.indexOf(t),1);return B.length>0}get(e,t){const B=findPair(this.items,e);const s=B?.value;return(!t&&i.isScalar(s)?s.value:s)??undefined}has(e){return!!findPair(this.items,e)}set(e,t){this.add(new a.Pair(e,t),true)}toJSON(e,t,B){const s=B?new B:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(s);for(const e of this.items)n.addPairToJSMap(t,s,e);return s}toString(e,t,B){if(!e)return JSON.stringify(this);for(const e of this.items){if(!i.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`)}if(!e.allNullValues&&this.hasAllNullValues(false))e=Object.assign({},e,{allNullValues:true});return s.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:B,onComment:t})}}t.YAMLMap=YAMLMap;t.findPair=findPair},2223:(e,t,B)=>{"use strict";var s=B(2404);var n=B(1212);var r=B(101);var i=B(1127);var a=B(3301);var o=B(4043);class YAMLSeq extends r.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(i.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){const t=asItemIndex(e);if(typeof t!=="number")return false;const B=this.items.splice(t,1);return B.length>0}get(e,t){const B=asItemIndex(e);if(typeof B!=="number")return undefined;const s=this.items[B];return!t&&i.isScalar(s)?s.value:s}has(e){const t=asItemIndex(e);return typeof t==="number"&&t=0?t:null}t.YAMLSeq=YAMLSeq},7104:(e,t,B)=>{"use strict";var s=B(7249);var n=B(452);var r=B(2148);var i=B(1127);var a=B(4043);function addPairToJSMap(e,t,{key:B,value:s}){if(i.isNode(B)&&B.addToJSMap)B.addToJSMap(e,t,s);else if(n.isMergeKey(e,B))n.addMergeToJSMap(e,t,s);else{const n=a.toJS(B,"",e);if(t instanceof Map){t.set(n,a.toJS(s,n,e))}else if(t instanceof Set){t.add(n)}else{const r=stringifyKey(B,n,e);const i=a.toJS(s,r,e);if(r in t)Object.defineProperty(t,r,{value:i,writable:true,enumerable:true,configurable:true});else t[r]=i}}return t}function stringifyKey(e,t,B){if(t===null)return"";if(typeof t!=="object")return String(t);if(i.isNode(e)&&B?.doc){const t=r.createStringifyContext(B.doc,{});t.anchors=new Set;for(const e of B.anchors.keys())t.anchors.add(e.anchor);t.inFlow=true;t.inStringifyKey=true;const n=e.toString(t);if(!B.mapKeyWarned){let e=JSON.stringify(n);if(e.length>40)e=e.substring(0,36)+'..."';s.warn(B.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`);B.mapKeyWarned=true}return n}return JSON.stringify(t)}t.addPairToJSMap=addPairToJSMap},1127:(e,t)=>{"use strict";const B=Symbol.for("yaml.alias");const s=Symbol.for("yaml.document");const n=Symbol.for("yaml.map");const r=Symbol.for("yaml.pair");const i=Symbol.for("yaml.scalar");const a=Symbol.for("yaml.seq");const o=Symbol.for("yaml.node.type");const isAlias=e=>!!e&&typeof e==="object"&&e[o]===B;const isDocument=e=>!!e&&typeof e==="object"&&e[o]===s;const isMap=e=>!!e&&typeof e==="object"&&e[o]===n;const isPair=e=>!!e&&typeof e==="object"&&e[o]===r;const isScalar=e=>!!e&&typeof e==="object"&&e[o]===i;const isSeq=e=>!!e&&typeof e==="object"&&e[o]===a;function isCollection(e){if(e&&typeof e==="object")switch(e[o]){case n:case a:return true}return false}function isNode(e){if(e&&typeof e==="object")switch(e[o]){case B:case n:case i:case a:return true}return false}const hasAnchor=e=>(isScalar(e)||isCollection(e))&&!!e.anchor;t.ALIAS=B;t.DOC=s;t.MAP=n;t.NODE_TYPE=o;t.PAIR=r;t.SCALAR=i;t.SEQ=a;t.hasAnchor=hasAnchor;t.isAlias=isAlias;t.isCollection=isCollection;t.isDocument=isDocument;t.isMap=isMap;t.isNode=isNode;t.isPair=isPair;t.isScalar=isScalar;t.isSeq=isSeq},4043:(e,t,B)=>{"use strict";var s=B(1127);function toJS(e,t,B){if(Array.isArray(e))return e.map((e,t)=>toJS(e,String(t),B));if(e&&typeof e.toJSON==="function"){if(!B||!s.hasAnchor(e))return e.toJSON(t,B);const n={aliasCount:0,count:1,res:undefined};B.anchors.set(e,n);B.onCreate=e=>{n.res=e;delete B.onCreate};const r=e.toJSON(t,B);if(B.onCreate)B.onCreate(r);return r}if(typeof e==="bigint"&&!B?.keep)return Number(e);return e}t.toJS=toJS},110:(e,t,B)=>{"use strict";var s=B(8913);var n=B(6842);var r=B(1464);var i=B(3069);function resolveAsScalar(e,t=true,B){if(e){const _onError=(e,t,s)=>{const n=typeof e==="number"?e:Array.isArray(e)?e[0]:e.offset;if(B)B(n,t,s);else throw new r.YAMLParseError([n,n+1],t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return n.resolveFlowScalar(e,t,_onError);case"block-scalar":return s.resolveBlockScalar({options:{strict:t}},e,_onError)}}return null}function createScalarToken(e,t){const{implicitKey:B=false,indent:s,inFlow:n=false,offset:r=-1,type:a="PLAIN"}=t;const o=i.stringifyString({type:a,value:e},{implicitKey:B,indent:s>0?" ".repeat(s):"",inFlow:n,options:{blockQuote:true,lineWidth:-1}});const l=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(o[0]){case"|":case">":{const e=o.indexOf("\n");const t=o.substring(0,e);const B=o.substring(e+1)+"\n";const n=[{type:"block-scalar-header",offset:r,indent:s,source:t}];if(!addEndtoBlockProps(n,l))n.push({type:"newline",offset:-1,indent:s,source:"\n"});return{type:"block-scalar",offset:r,indent:s,props:n,source:B}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:o,end:l};default:return{type:"scalar",offset:r,indent:s,source:o,end:l}}}function setScalarValue(e,t,B={}){let{afterKey:s=false,implicitKey:n=false,inFlow:r=false,type:a}=B;let o="indent"in e?e.indent:null;if(s&&typeof o==="number")o+=2;if(!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=t.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}const l=i.stringifyString({type:a,value:t},{implicitKey:n||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:r,options:{blockQuote:true,lineWidth:-1}});switch(l[0]){case"|":case">":setBlockScalarValue(e,l);break;case'"':setFlowScalarValue(e,l,"double-quoted-scalar");break;case"'":setFlowScalarValue(e,l,"single-quoted-scalar");break;default:setFlowScalarValue(e,l,"scalar")}}function setBlockScalarValue(e,t){const B=t.indexOf("\n");const s=t.substring(0,B);const n=t.substring(B+1)+"\n";if(e.type==="block-scalar"){const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");t.source=s;e.source=n}else{const{offset:t}=e;const B="indent"in e?e.indent:-1;const r=[{type:"block-scalar-header",offset:t,indent:B,source:s}];if(!addEndtoBlockProps(r,"end"in e?e.end:undefined))r.push({type:"newline",offset:-1,indent:B,source:"\n"});for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:"block-scalar",indent:B,props:r,source:n})}}function addEndtoBlockProps(e,t){if(t)for(const B of t)switch(B.type){case"space":case"comment":e.push(B);break;case"newline":e.push(B);return true}return false}function setFlowScalarValue(e,t,B){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=B;e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let n=t.length;if(e.props[0].type==="block-scalar-header")n-=e.props[0].source.length;for(const e of s)e.offset+=n;delete e.props;Object.assign(e,{type:B,source:t,end:s});break}case"block-map":case"block-seq":{const s=e.offset+t.length;const n={type:"newline",offset:s,indent:e.indent,source:"\n"};delete e.items;Object.assign(e,{type:B,source:t,end:[n]});break}default:{const s="indent"in e?e.indent:-1;const n="end"in e&&Array.isArray(e.end)?e.end.filter(e=>e.type==="space"||e.type==="comment"||e.type==="newline"):[];for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:B,indent:s,source:t,end:n})}}}t.createScalarToken=createScalarToken;t.resolveAsScalar=resolveAsScalar;t.setScalarValue=setScalarValue},1733:(e,t)=>{"use strict";const stringify=e=>"type"in e?stringifyToken(e):stringifyItem(e);function stringifyToken(e){switch(e.type){case"block-scalar":{let t="";for(const B of e.props)t+=stringifyToken(B);return t+e.source}case"block-map":case"block-seq":{let t="";for(const B of e.items)t+=stringifyItem(B);return t}case"flow-collection":{let t=e.start.source;for(const B of e.items)t+=stringifyItem(B);for(const B of e.end)t+=B.source;return t}case"document":{let t=stringifyItem(e);if(e.end)for(const B of e.end)t+=B.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const B of e.end)t+=B.source;return t}}}function stringifyItem({start:e,key:t,sep:B,value:s}){let n="";for(const t of e)n+=t.source;if(t)n+=stringifyToken(t);if(B)for(const e of B)n+=e.source;if(s)n+=stringifyToken(s);return n}t.stringify=stringify},7715:(e,t)=>{"use strict";const B=Symbol("break visit");const s=Symbol("skip children");const n=Symbol("remove item");function visit(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};_visit(Object.freeze([]),e,t)}visit.BREAK=B;visit.SKIP=s;visit.REMOVE=n;visit.itemAtPath=(e,t)=>{let B=e;for(const[e,s]of t){const t=B?.[e];if(t&&"items"in t){B=t.items[s]}else return undefined}return B};visit.parentCollection=(e,t)=>{const B=visit.itemAtPath(e,t.slice(0,-1));const s=t[t.length-1][0];const n=B?.[s];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function _visit(e,t,s){let r=s(t,e);if(typeof r==="symbol")return r;for(const i of["key","value"]){const a=t[i];if(a&&"items"in a){for(let t=0;t{"use strict";var s=B(110);var n=B(1733);var r=B(7715);const i="\ufeff";const a="";const o="";const l="";const isCollection=e=>!!e&&"items"in e;const isScalar=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function prettyToken(e){switch(e){case i:return"";case a:return"";case o:return"";case l:return"";default:return JSON.stringify(e)}}function tokenType(e){switch(e){case i:return"byte-order-mark";case a:return"doc-mode";case o:return"flow-error-end";case l:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}t.createScalarToken=s.createScalarToken;t.resolveAsScalar=s.resolveAsScalar;t.setScalarValue=s.setScalarValue;t.stringify=n.stringify;t.visit=r.visit;t.BOM=i;t.DOCUMENT=a;t.FLOW_END=o;t.SCALAR=l;t.isCollection=isCollection;t.isScalar=isScalar;t.prettyToken=prettyToken;t.tokenType=tokenType},361:(e,t,B)=>{"use strict";var s=B(3461);function isEmpty(e){switch(e){case undefined:case" ":case"\n":case"\r":case"\t":return true;default:return false}}const n=new Set("0123456789ABCDEFabcdef");const r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");const i=new Set(",[]{}");const a=new Set(" ,[]{}\n\r\t");const isNotAnchorChar=e=>!e||a.has(e);class Lexer{constructor(){this.atEnd=false;this.blockScalarIndent=-1;this.blockScalarKeep=false;this.buffer="";this.flowKey=false;this.flowLevel=0;this.indentNext=0;this.indentValue=0;this.lineEndPos=null;this.next=null;this.pos=0}*lex(e,t=false){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e;this.lineEndPos=null}this.atEnd=!t;let B=this.next??"stream";while(B&&(t||this.hasChars(1)))B=yield*this.parseNext(B)}atLineEnd(){let e=this.pos;let t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t==="\n")return true;if(t==="\r")return this.buffer[e+1]==="\n";return false}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let B=0;while(t===" ")t=this.buffer[++B+e];if(t==="\r"){const t=this.buffer[B+e+1];if(t==="\n"||!t&&!this.atEnd)return e+B+1}return t==="\n"||B>=this.indentNext||!t&&!this.atEnd?e+B:-1}if(t==="-"||t==="."){const t=this.buffer.substr(e,3);if((t==="---"||t==="...")&&isEmpty(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&ethis.indentValue&&!isEmpty(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&isEmpty(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));this.indentNext=this.indentValue+1;this.indentValue+=e;return"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(true);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case undefined:yield*this.pushNewline();return yield*this.parseLineStart();case"{":case"[":yield*this.pushCount(1);this.flowKey=false;this.flowLevel=1;return"flow";case"}":case"]":yield*this.pushCount(1);return"doc";case"*":yield*this.pushUntil(isNotAnchorChar);return"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":t+=(yield*this.parseBlockScalarHeader());t+=(yield*this.pushSpaces(true));yield*this.pushCount(e.length-t);yield*this.pushNewline();return yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t;let B=-1;do{e=yield*this.pushNewline();if(e>0){t=yield*this.pushSpaces(false);this.indentValue=B=t}else{t=0}t+=(yield*this.pushSpaces(true))}while(e+t>0);const n=this.getLine();if(n===null)return this.setNext("flow");if(B!==-1&&B"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(e=>isEmpty(e)||e==="#")}*parseBlockScalar(){let e=this.pos-1;let t=0;let B;e:for(let s=this.pos;B=this.buffer[s];++s){switch(B){case" ":t+=1;break;case"\n":e=s;t=0;break;case"\r":{const e=this.buffer[s+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if(e==="\n")break}default:break e}}if(!B&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else{this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext)}do{const t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf("\n",t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;B=this.buffer[n];while(B===" ")B=this.buffer[++n];if(B==="\t"){while(B==="\t"||B===" "||B==="\r"||B==="\n")B=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep){do{let B=e-1;let s=this.buffer[B];if(s==="\r")s=this.buffer[--B];const n=B;while(s===" ")s=this.buffer[--B];if(s==="\n"&&B>=this.pos&&B+1+t>n)e=B;else break}while(true)}yield s.SCALAR;yield*this.pushToIndex(e+1,true);return yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1;let B=this.pos-1;let n;while(n=this.buffer[++B]){if(n===":"){const s=this.buffer[B+1];if(isEmpty(s)||e&&i.has(s))break;t=B}else if(isEmpty(n)){let s=this.buffer[B+1];if(n==="\r"){if(s==="\n"){B+=1;n="\n";s=this.buffer[B+1]}else t=B}if(s==="#"||e&&i.has(s))break;if(n==="\n"){const e=this.continueScalar(B+1);if(e===-1)break;B=Math.max(B,e-2)}}else{if(e&&i.has(n))break;t=B}}if(!n&&!this.atEnd)return this.setNext("plain-scalar");yield s.SCALAR;yield*this.pushToIndex(t+1,true);return e?"flow":"doc"}*pushCount(e){if(e>0){yield this.buffer.substr(this.pos,e);this.pos+=e;return e}return 0}*pushToIndex(e,t){const B=this.buffer.slice(this.pos,e);if(B){yield B;this.pos+=B.length;return B.length}else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(true){switch(this.charAt(0)){case"!":e+=(yield*this.pushTag());e+=(yield*this.pushSpaces(true));continue e;case"&":e+=(yield*this.pushUntil(isNotAnchorChar));e+=(yield*this.pushSpaces(true));continue e;case"-":case"?":case":":{const t=this.flowLevel>0;const B=this.charAt(1);if(isEmpty(B)||t&&i.has(B)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=false;e+=(yield*this.pushCount(1));e+=(yield*this.pushSpaces(true));continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2;let t=this.buffer[e];while(!isEmpty(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,false)}else{let e=this.pos+1;let t=this.buffer[e];while(t){if(r.has(t))t=this.buffer[++e];else if(t==="%"&&n.has(this.buffer[e+1])&&n.has(this.buffer[e+2])){t=this.buffer[e+=3]}else break}return yield*this.pushToIndex(e,false)}}*pushNewline(){const e=this.buffer[this.pos];if(e==="\n")return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)==="\n")return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1;let B;do{B=this.buffer[++t]}while(B===" "||e&&B==="\t");const s=t-this.pos;if(s>0){yield this.buffer.substr(this.pos,s);this.pos=t}return s}*pushUntil(e){let t=this.pos;let B=this.buffer[t];while(!e(B))B=this.buffer[++t];return yield*this.pushToIndex(t,false)}}t.Lexer=Lexer},6628:(e,t)=>{"use strict";class LineCounter{constructor(){this.lineStarts=[];this.addNewLine=e=>this.lineStarts.push(e);this.linePos=e=>{let t=0;let B=this.lineStarts.length;while(t>1;if(this.lineStarts[s]{"use strict";var s=B(932);var n=B(3461);var r=B(361);function includesToken(e,t){for(let B=0;B=0){switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}}while(e[++t]?.type==="space"){}return e.splice(t,e.length)}function arrayPushArray(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let B=0;B0)yield*this.pop()}get sourceToken(){const e={type:this.type,offset:this.offset,indent:this.indent,source:this.source};return e}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t){const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}else if(this.stack.length===0){yield t}else{const e=this.peek(1);if(t.type==="block-scalar"){t.indent="indent"in e?e.indent:0}else if(t.type==="flow-collection"&&e.type==="document"){t.indent=0}if(t.type==="flow-collection")fixFlowSeqItems(t);switch(e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const B=e.items[e.items.length-1];if(B.value){e.items.push({start:[],key:t,sep:[]});this.onKeyLine=true;return}else if(B.sep){B.value=t}else{Object.assign(B,{key:t,sep:[]});this.onKeyLine=!B.explicitKey;return}break}case"block-seq":{const B=e.items[e.items.length-1];if(B.value)e.items.push({start:[],value:t});else B.value=t;break}case"flow-collection":{const B=e.items[e.items.length-1];if(!B||B.value)e.items.push({start:[],key:t,sep:[]});else if(B.sep)B.value=t;else Object.assign(B,{key:t,sep:[]});return}default:yield*this.pop();yield*this.pop(t)}if((e.type==="document"||e.type==="block-map"||e.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const B=t.items[t.items.length-1];if(B&&!B.sep&&!B.value&&B.start.length>0&&findNonEmptyIndex(B.start)===-1&&(t.indent===0||B.start.every(e=>e.type!=="comment"||e.indent=e.indent){const B=!this.onKeyLine&&this.indent===e.indent;const s=B&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let n=[];if(s&&t.sep&&!t.value){const B=[];for(let s=0;se.indent)B.length=0;break;default:B.length=0}}if(B.length>=2)n=t.sep.splice(B[1])}switch(this.type){case"anchor":case"tag":if(s||t.value){n.push(this.sourceToken);e.items.push({start:n});this.onKeyLine=true}else if(t.sep){t.sep.push(this.sourceToken)}else{t.start.push(this.sourceToken)}return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey){t.start.push(this.sourceToken);t.explicitKey=true}else if(s||t.value){n.push(this.sourceToken);e.items.push({start:n,explicitKey:true})}else{this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]})}this.onKeyLine=true;return;case"map-value-ind":if(t.explicitKey){if(!t.sep){if(includesToken(t.start,"newline")){Object.assign(t,{key:null,sep:[this.sourceToken]})}else{const e=getFirstKeyStartProps(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value){e.items.push({start:[],key:null,sep:[this.sourceToken]})}else if(includesToken(t.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]})}else if(isFlowToken(t.key)&&!includesToken(t.sep,"newline")){const e=getFirstKeyStartProps(t.start);const B=t.key;const s=t.sep;s.push(this.sourceToken);delete t.key;delete t.sep;this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:B,sep:s}]})}else if(n.length>0){t.sep=t.sep.concat(n,this.sourceToken)}else{t.sep.push(this.sourceToken)}}else{if(!t.sep){Object.assign(t,{key:null,sep:[this.sourceToken]})}else if(t.value||s){e.items.push({start:n,key:null,sep:[this.sourceToken]})}else if(includesToken(t.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]})}else{t.sep.push(this.sourceToken)}}this.onKeyLine=true;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const B=this.flowScalar(this.type);if(s||t.value){e.items.push({start:n,key:B,sep:[]});this.onKeyLine=true}else if(t.sep){this.stack.push(B)}else{Object.assign(t,{key:B,sep:[]});this.onKeyLine=true}return}default:{const s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!includesToken(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(B){e.items.push({start:n})}this.stack.push(s);return}}}}yield*this.pop();yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const B="end"in t.value?t.value.end:undefined;const s=Array.isArray(B)?B[B.length-1]:undefined;if(s?.type==="comment")B?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const B=e.items[e.items.length-2];const s=B?.value?.end;if(Array.isArray(s)){arrayPushArray(s,t.start);s.push(this.sourceToken);e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||includesToken(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop();yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let e;do{yield*this.pop();e=this.peek(1)}while(e?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const B=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:B,sep:[]});else if(t.sep)this.stack.push(B);else Object.assign(t,{key:B,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const B=this.startBlockValue(e);if(B)this.stack.push(B);else{yield*this.pop();yield*this.step()}}else{const t=this.peek(2);if(t.type==="block-map"&&(this.type==="map-value-ind"&&t.indent===e.indent||this.type==="newline"&&!t.items[t.items.length-1].sep)){yield*this.pop();yield*this.step()}else if(this.type==="map-value-ind"&&t.type!=="flow-collection"){const B=getPrevProps(t);const s=getFirstKeyStartProps(B);fixFlowSeqItems(e);const n=e.end.splice(1,e.end.length);n.push(this.sourceToken);const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=true;this.stack[this.stack.length-1]=r}else{yield*this.lineEnd(e)}}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;while(e!==0){this.onNewLine(this.offset+e);e=this.source.indexOf("\n",e)+1}}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=true;const t=getPrevProps(e);const B=getFirstKeyStartProps(t);B.push(this.sourceToken);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:B,explicitKey:true}]}}case"map-value-ind":{this.onKeyLine=true;const t=getPrevProps(e);const B=getFirstKeyStartProps(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:B,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return false;if(this.indent<=t)return false;return e.every(e=>e.type==="newline"||e.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop();yield*this.step();break;case"newline":this.onKeyLine=false;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}t.Parser=Parser},4047:(e,t,B)=>{"use strict";var s=B(9984);var n=B(3021);var r=B(1464);var i=B(7249);var a=B(1127);var o=B(6628);var l=B(3456);function parseOptions(e){const t=e.prettyErrors!==false;const B=e.lineCounter||t&&new o.LineCounter||null;return{lineCounter:B,prettyErrors:t}}function parseAllDocuments(e,t={}){const{lineCounter:B,prettyErrors:n}=parseOptions(t);const i=new l.Parser(B?.addNewLine);const a=new s.Composer(t);const o=Array.from(a.compose(i.parse(e)));if(n&&B)for(const t of o){t.errors.forEach(r.prettifyError(e,B));t.warnings.forEach(r.prettifyError(e,B))}if(o.length>0)return o;return Object.assign([],{empty:true},a.streamInfo())}function parseDocument(e,t={}){const{lineCounter:B,prettyErrors:n}=parseOptions(t);const i=new l.Parser(B?.addNewLine);const a=new s.Composer(t);let o=null;for(const t of a.compose(i.parse(e),true,e.length)){if(!o)o=t;else if(o.options.logLevel!=="silent"){o.errors.push(new r.YAMLParseError(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}if(n&&B){o.errors.forEach(r.prettifyError(e,B));o.warnings.forEach(r.prettifyError(e,B))}return o}function parse(e,t,B){let s=undefined;if(typeof t==="function"){s=t}else if(B===undefined&&t&&typeof t==="object"){B=t}const n=parseDocument(e,B);if(!n)return null;n.warnings.forEach(e=>i.warn(n.options.logLevel,e));if(n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];else n.errors=[]}return n.toJS(Object.assign({reviver:s},B))}function stringify(e,t,B){let s=null;if(typeof t==="function"||Array.isArray(t)){s=t}else if(B===undefined&&t){B=t}if(typeof B==="string")B=B.length;if(typeof B==="number"){const e=Math.round(B);B=e<1?undefined:e>8?{indent:8}:{indent:e}}if(e===undefined){const{keepUndefined:e}=B??t??{};if(!e)return undefined}if(a.isDocument(e)&&!s)return e.toString(B);return new n.Document(e,s,B).toString(B)}t.parse=parse;t.parseAllDocuments=parseAllDocuments;t.parseDocument=parseDocument;t.stringify=stringify},5840:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7451);var r=B(1706);var i=B(6464);var a=B(18);const sortMapEntriesByKey=(e,t)=>e.keyt.key?1:0;class Schema{constructor({compat:e,customTags:t,merge:B,resolveKnownTags:o,schema:l,sortMapEntries:c,toStringDefaults:C}){this.compat=Array.isArray(e)?a.getTags(e,"compat"):e?a.getTags(null,e):null;this.name=typeof l==="string"&&l||"core";this.knownTags=o?a.coreKnownTags:{};this.tags=a.getTags(t,this.name,B);this.toStringOptions=C??null;Object.defineProperty(this,s.MAP,{value:n.map});Object.defineProperty(this,s.SCALAR,{value:i.string});Object.defineProperty(this,s.SEQ,{value:r.seq});this.sortMapEntries=typeof c==="function"?c:c===true?sortMapEntriesByKey:null}clone(){const e=Object.create(Schema.prototype,Object.getOwnPropertyDescriptors(this));e.tags=this.tags.slice();return e}}t.Schema=Schema},7451:(e,t,B)=>{"use strict";var s=B(1127);var n=B(4454);const r={collection:"map",default:true,nodeClass:n.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!s.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,B)=>n.YAMLMap.from(e,t,B)};t.map=r},3632:(e,t,B)=>{"use strict";var s=B(3301);const n={identify:e=>e==null,createNode:()=>new s.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new s.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&n.test.test(e)?e:t.options.nullStr};t.nullTag=n},1706:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2223);const r={collection:"seq",default:true,nodeClass:n.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!s.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,B)=>n.YAMLSeq.from(e,t,B)};t.seq=r},6464:(e,t,B)=>{"use strict";var s=B(3069);const n={identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,B,n){t=Object.assign({actualString:true},t);return s.stringifyString(e,t,B,n)}};t.string=n},3959:(e,t,B)=>{"use strict";var s=B(3301);const n={identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new s.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},B){if(e&&n.test.test(e)){const B=e[0]==="t"||e[0]==="T";if(t===B)return e}return t?B.options.trueStr:B.options.falseStr}};t.boolTag=n},8405:(e,t,B)=>{"use strict";var s=B(3301);var n=B(8689);const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber};const i={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}};const a={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new s.Scalar(parseFloat(e));const B=e.indexOf(".");if(B!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-B-1;return t},stringify:n.stringifyNumber};t.float=a;t.floatExp=i;t.floatNaN=r},9874:(e,t,B)=>{"use strict";var s=B(8689);const intIdentify=e=>typeof e==="bigint"||Number.isInteger(e);const intResolve=(e,t,B,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),B);function intStringify(e,t,B){const{value:n}=e;if(intIdentify(n)&&n>=0)return B+n.toString(t);return s.stringifyNumber(e)}const n={identify:e=>intIdentify(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,B)=>intResolve(e,2,8,B),stringify:e=>intStringify(e,8,"0o")};const r={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,B)=>intResolve(e,0,10,B),stringify:s.stringifyNumber};const i={identify:e=>intIdentify(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,B)=>intResolve(e,2,16,B),stringify:e=>intStringify(e,16,"0x")};t.int=r;t.intHex=i;t.intOct=n},896:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(3959);var o=B(8405);var l=B(9874);const c=[s.map,r.seq,i.string,n.nullTag,a.boolTag,l.intOct,l.int,l.intHex,o.floatNaN,o.floatExp,o.float];t.schema=c},3559:(e,t,B)=>{"use strict";var s=B(3301);var n=B(7451);var r=B(1706);function intIdentify(e){return typeof e==="bigint"||Number.isInteger(e)}const stringifyJSON=({value:e})=>JSON.stringify(e);const i=[{identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:stringifyJSON},{identify:e=>e==null,createNode:()=>new s.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:stringifyJSON},{identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:stringifyJSON},{identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:B})=>B?BigInt(e):parseInt(e,10),stringify:({value:e})=>intIdentify(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:stringifyJSON}];const a={default:true,tag:"",test:/^/,resolve(e,t){t(`Unresolved plain scalar ${JSON.stringify(e)}`);return e}};const o=[n.map,r.seq].concat(i,a);t.schema=o},18:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(3959);var o=B(8405);var l=B(9874);var c=B(896);var C=B(3559);var u=B(6083);var f=B(452);var h=B(303);var p=B(8385);var g=B(5913);var m=B(1528);var d=B(6752);const D=new Map([["core",c.schema],["failsafe",[s.map,r.seq,i.string]],["json",C.schema],["yaml11",g.schema],["yaml-1.1",g.schema]]);const E={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:d.floatTime,int:l.int,intHex:l.intHex,intOct:l.intOct,intTime:d.intTime,map:s.map,merge:f.merge,null:n.nullTag,omap:h.omap,pairs:p.pairs,seq:r.seq,set:m.set,timestamp:d.timestamp};const y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":f.merge,"tag:yaml.org,2002:omap":h.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":m.set,"tag:yaml.org,2002:timestamp":d.timestamp};function getTags(e,t,B){const s=D.get(t);if(s&&!e){return B&&!s.includes(f.merge)?s.concat(f.merge):s.slice()}let n=s;if(!n){if(Array.isArray(e))n=[];else{const e=Array.from(D.keys()).filter(e=>e!=="yaml11").map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e)){for(const t of e)n=n.concat(t)}else if(typeof e==="function"){n=e(n.slice())}if(B)n=n.concat(f.merge);return n.reduce((e,t)=>{const B=typeof t==="string"?E[t]:t;if(!B){const e=JSON.stringify(t);const B=Object.keys(E).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${B}`)}if(!e.includes(B))e.push(B);return e},[])}t.coreKnownTags=y;t.getTags=getTags},6083:(e,t,B)=>{"use strict";var s=B(181);var n=B(3301);var r=B(3069);const i={identify:e=>e instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof s.Buffer==="function"){return s.Buffer.from(e,"base64")}else if(typeof atob==="function"){const t=atob(e.replace(/[\n\r]/g,""));const B=new Uint8Array(t.length);for(let e=0;e{"use strict";var s=B(3301);function boolStringify({value:e,source:t},B){const s=e?n:r;if(t&&s.test.test(t))return t;return e?B.options.trueStr:B.options.falseStr}const n={identify:e=>e===true,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new s.Scalar(true),stringify:boolStringify};const r={identify:e=>e===false,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new s.Scalar(false),stringify:boolStringify};t.falseTag=r;t.trueTag=n},5782:(e,t,B)=>{"use strict";var s=B(3301);var n=B(8689);const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber};const i={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}};const a={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new s.Scalar(parseFloat(e.replace(/_/g,"")));const B=e.indexOf(".");if(B!==-1){const s=e.substring(B+1).replace(/_/g,"");if(s[s.length-1]==="0")t.minFractionDigits=s.length}return t},stringify:n.stringifyNumber};t.float=a;t.floatExp=i;t.floatNaN=r},873:(e,t,B)=>{"use strict";var s=B(8689);const intIdentify=e=>typeof e==="bigint"||Number.isInteger(e);function intResolve(e,t,B,{intAsBigInt:s}){const n=e[0];if(n==="-"||n==="+")t+=1;e=e.substring(t).replace(/_/g,"");if(s){switch(B){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const t=BigInt(e);return n==="-"?BigInt(-1)*t:t}const r=parseInt(e,B);return n==="-"?-1*r:r}function intStringify(e,t,B){const{value:n}=e;if(intIdentify(n)){const e=n.toString(t);return n<0?"-"+B+e.substr(1):B+e}return s.stringifyNumber(e)}const n={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,B)=>intResolve(e,2,2,B),stringify:e=>intStringify(e,2,"0b")};const r={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,B)=>intResolve(e,1,8,B),stringify:e=>intStringify(e,8,"0")};const i={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,B)=>intResolve(e,0,10,B),stringify:s.stringifyNumber};const a={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,B)=>intResolve(e,2,16,B),stringify:e=>intStringify(e,16,"0x")};t.int=i;t.intBin=n;t.intHex=a;t.intOct=r},452:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);const r="<<";const i={identify:e=>e===r||typeof e==="symbol"&&e.description===r,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(r)),{addToJSMap:addMergeToJSMap}),stringify:()=>r};const isMergeKey=(e,t)=>(i.identify(t)||s.isScalar(t)&&(!t.type||t.type===n.Scalar.PLAIN)&&i.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===i.tag&&e.default);function addMergeToJSMap(e,t,B){const n=resolveAliasValue(e,B);if(s.isSeq(n))for(const B of n.items)mergeValue(e,t,B);else if(Array.isArray(n))for(const B of n)mergeValue(e,t,B);else mergeValue(e,t,n)}function mergeValue(e,t,B){const n=resolveAliasValue(e,B);if(!s.isMap(n))throw new Error("Merge sources must be maps or map aliases");const r=n.toJSON(null,e,Map);for(const[e,B]of r){if(t instanceof Map){if(!t.has(e))t.set(e,B)}else if(t instanceof Set){t.add(e)}else if(!Object.prototype.hasOwnProperty.call(t,e)){Object.defineProperty(t,e,{value:B,writable:true,enumerable:true,configurable:true})}}return t}function resolveAliasValue(e,t){return e&&s.isAlias(t)?t.resolve(e.doc,e):t}t.addMergeToJSMap=addMergeToJSMap;t.isMergeKey=isMergeKey;t.merge=i},303:(e,t,B)=>{"use strict";var s=B(1127);var n=B(4043);var r=B(4454);var i=B(2223);var a=B(8385);class YAMLOMap extends i.YAMLSeq{constructor(){super();this.add=r.YAMLMap.prototype.add.bind(this);this.delete=r.YAMLMap.prototype.delete.bind(this);this.get=r.YAMLMap.prototype.get.bind(this);this.has=r.YAMLMap.prototype.has.bind(this);this.set=r.YAMLMap.prototype.set.bind(this);this.tag=YAMLOMap.tag}toJSON(e,t){if(!t)return super.toJSON(e);const B=new Map;if(t?.onCreate)t.onCreate(B);for(const e of this.items){let r,i;if(s.isPair(e)){r=n.toJS(e.key,"",t);i=n.toJS(e.value,r,t)}else{r=n.toJS(e,"",t)}if(B.has(r))throw new Error("Ordered maps must not include duplicate keys");B.set(r,i)}return B}static from(e,t,B){const s=a.createPairs(e,t,B);const n=new this;n.items=s.items;return n}}YAMLOMap.tag="tag:yaml.org,2002:omap";const o={collection:"seq",identify:e=>e instanceof Map,nodeClass:YAMLOMap,default:false,tag:"tag:yaml.org,2002:omap",resolve(e,t){const B=a.resolvePairs(e,t);const n=[];for(const{key:e}of B.items){if(s.isScalar(e)){if(n.includes(e.value)){t(`Ordered maps must not include duplicate keys: ${e.value}`)}else{n.push(e.value)}}}return Object.assign(new YAMLOMap,B)},createNode:(e,t,B)=>YAMLOMap.from(e,t,B)};t.YAMLOMap=YAMLOMap;t.omap=o},8385:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(3301);var i=B(2223);function resolvePairs(e,t){if(s.isSeq(e)){for(let B=0;B1)t("Each pair must have its own sequence indicator");const e=i.items[0]||new n.Pair(new r.Scalar(null));if(i.commentBefore)e.key.commentBefore=e.key.commentBefore?`${i.commentBefore}\n${e.key.commentBefore}`:i.commentBefore;if(i.comment){const t=e.value??e.key;t.comment=t.comment?`${i.comment}\n${t.comment}`:i.comment}i=e}e.items[B]=s.isPair(i)?i:new n.Pair(i)}}else t("Expected a sequence for this tag");return e}function createPairs(e,t,B){const{replacer:s}=B;const r=new i.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){if(typeof s==="function")e=s.call(t,String(a++),e);let i,o;if(Array.isArray(e)){if(e.length===2){i=e[0];o=e[1]}else throw new TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){const t=Object.keys(e);if(t.length===1){i=t[0];o=e[i]}else{throw new TypeError(`Expected tuple with one key, not ${t.length} keys`)}}else{i=e}r.items.push(n.createPair(i,o,B))}return r}const a={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:resolvePairs,createNode:createPairs};t.createPairs=createPairs;t.pairs=a;t.resolvePairs=resolvePairs},5913:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(6083);var o=B(8398);var l=B(5782);var c=B(873);var C=B(452);var u=B(303);var f=B(8385);var h=B(1528);var p=B(6752);const g=[s.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,l.floatNaN,l.floatExp,l.float,a.binary,C.merge,u.omap,f.pairs,h.set,p.intTime,p.floatTime,p.timestamp];t.schema=g},1528:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(4454);class YAMLSet extends r.YAMLMap{constructor(e){super(e);this.tag=YAMLSet.tag}add(e){let t;if(s.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new n.Pair(e.key,null);else t=new n.Pair(e,null);const B=r.findPair(this.items,t.key);if(!B)this.items.push(t)}get(e,t){const B=r.findPair(this.items,e);return!t&&s.isPair(B)?s.isScalar(B.key)?B.key.value:B.key:B}set(e,t){if(typeof t!=="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const B=r.findPair(this.items,e);if(B&&!t){this.items.splice(this.items.indexOf(B),1)}else if(!B&&t){this.items.push(new n.Pair(e))}}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,B){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(true))return super.toString(Object.assign({},e,{allNullValues:true}),t,B);else throw new Error("Set items must all have null values")}static from(e,t,B){const{replacer:s}=B;const r=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t){if(typeof s==="function")e=s.call(t,e,e);r.items.push(n.createPair(e,null,B))}return r}}YAMLSet.tag="tag:yaml.org,2002:set";const i={collection:"map",identify:e=>e instanceof Set,nodeClass:YAMLSet,default:false,tag:"tag:yaml.org,2002:set",createNode:(e,t,B)=>YAMLSet.from(e,t,B),resolve(e,t){if(s.isMap(e)){if(e.hasAllNullValues(true))return Object.assign(new YAMLSet,e);else t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};t.YAMLSet=YAMLSet;t.set=i},6752:(e,t,B)=>{"use strict";var s=B(8689);function parseSexagesimal(e,t){const B=e[0];const s=B==="-"||B==="+"?e.substring(1):e;const num=e=>t?BigInt(e):Number(e);const n=s.replace(/_/g,"").split(":").reduce((e,t)=>e*num(60)+num(t),num(0));return B==="-"?num(-1)*n:n}function stringifySexagesimal(e){let{value:t}=e;let num=e=>e;if(typeof t==="bigint")num=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return s.stringifyNumber(e);let B="";if(t<0){B="-";t*=num(-1)}const n=num(60);const r=[t%n];if(t<60){r.unshift(0)}else{t=(t-r[0])/n;r.unshift(t%n);if(t>=60){t=(t-r[0])/n;r.unshift(t)}}return B+r.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const n={identify:e=>typeof e==="bigint"||Number.isInteger(e),default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:B})=>parseSexagesimal(e,B),stringify:stringifySexagesimal};const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>parseSexagesimal(e,false),stringify:stringifySexagesimal};const i={identify:e=>e instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})"+"(?:"+"(?:t|T|[ \\t]+)"+"([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)"+"(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?"+")?$"),resolve(e){const t=e.match(i.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,B,s,n,r,a,o]=t.map(Number);const l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(B,s-1,n,r||0,a||0,o||0,l);const C=t[8];if(C&&C!=="Z"){let e=parseSexagesimal(C,false);if(Math.abs(e)<30)e*=60;c-=6e4*e}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};t.floatTime=r;t.intTime=n;t.timestamp=i},4475:(e,t)=>{"use strict";const B="flow";const s="block";const n="quoted";function foldFlowLines(e,t,B="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return e;if(ii-Math.max(2,a))C.push(0);else f=i-r}let h=undefined;let p=undefined;let g=false;let m=-1;let d=-1;let D=-1;if(B===s){m=consumeMoreIndentedLines(e,m,t.length);if(m!==-1)f=m+c}for(let r;r=e[m+=1];){if(B===n&&r==="\\"){d=m;switch(e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}D=m}if(r==="\n"){if(B===s)m=consumeMoreIndentedLines(e,m,t.length);f=m+t.length+c;h=undefined}else{if(r===" "&&p&&p!==" "&&p!=="\n"&&p!=="\t"){const t=e[m+1];if(t&&t!==" "&&t!=="\n"&&t!=="\t")h=m}if(m>=f){if(h){C.push(h);f=h+c;h=undefined}else if(B===n){while(p===" "||p==="\t"){p=r;r=e[m+=1];g=true}const t=m>D+1?m-2:d-1;if(u[t])return e;C.push(t);u[t]=true;f=t+c;h=undefined}else{g=true}}}p=r}if(g&&l)l();if(C.length===0)return e;if(o)o();let E=e.slice(0,C[0]);for(let s=0;s{"use strict";var s=B(1596);var n=B(1127);var r=B(9799);var i=B(3069);function createStringifyContext(e,t){const B=Object.assign({blockQuote:true,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trailingComma:false,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let s;switch(B.collectionStyle){case"block":s=false;break;case"flow":s=true;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:B.flowCollectionPadding?" ":"",indent:"",indentStep:typeof B.indent==="number"?" ".repeat(B.indent):" ",inFlow:s,options:B}}function getTagObject(e,t){if(t.tag){const B=e.filter(e=>e.tag===t.tag);if(B.length>0)return B.find(e=>e.format===t.format)??B[0]}let B=undefined;let s;if(n.isScalar(t)){s=t.value;let n=e.filter(e=>e.identify?.(s));if(n.length>1){const e=n.filter(e=>e.test);if(e.length>0)n=e}B=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else{s=t;B=e.find(e=>e.nodeClass&&s instanceof e.nodeClass)}if(!B){const e=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${e} value`)}return B}function stringifyProps(e,t,{anchors:B,doc:r}){if(!r.directives)return"";const i=[];const a=(n.isScalar(e)||n.isCollection(e))&&e.anchor;if(a&&s.anchorIsValid(a)){B.add(a);i.push(`&${a}`)}const o=e.tag??(t.default?null:t.tag);if(o)i.push(r.directives.tagString(o));return i.join(" ")}function stringify(e,t,B,s){if(n.isPair(e))return e.toString(t,B,s);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e)){throw new TypeError(`Cannot stringify circular structure without alias nodes`)}else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let r=undefined;const a=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>r=e});r??(r=getTagObject(t.doc.schema.tags,a));const o=stringifyProps(a,r,t);if(o.length>0)t.indentAtStart=(t.indentAtStart??0)+o.length+1;const l=typeof r.stringify==="function"?r.stringify(a,t,B,s):n.isScalar(a)?i.stringifyString(a,t,B,s):a.toString(t,B,s);if(!o)return l;return n.isScalar(a)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}\n${t.indent}${l}`}t.createStringifyContext=createStringifyContext;t.stringify=stringify},1212:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2148);var r=B(9799);function stringifyCollection(e,t,B){const s=t.inFlow??e.flow;const n=s?stringifyFlowCollection:stringifyBlockCollection;return n(e,t,B)}function stringifyBlockCollection({comment:e,items:t},B,{blockItemPrefix:i,flowChars:a,itemIndent:o,onChompKeep:l,onComment:c}){const{indent:C,options:{commentString:u}}=B;const f=Object.assign({},B,{indent:o,type:null});let h=false;const p=[];for(let e=0;el=null,()=>h=true);if(l)c+=r.lineComment(c,o,u(l));if(h&&l)h=false;p.push(i+c)}let g;if(p.length===0){g=a.start+a.end}else{g=p[0];for(let e=1;eo=null);u||(u=h.length>f||l.includes("\n"));if(B0){u||(u=h.reduce((e,t)=>e+t.length+2,2)+(l.length+2)>t.options.lineWidth)}if(u){l+=","}}if(o)l+=r.lineComment(l,i,c(o));h.push(l);f=h.length}const{start:p,end:g}=B;if(h.length===0){return p+g}else{if(!u){const e=h.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(u){let e=p;for(const t of h)e+=t?`\n${o}${a}${t}`:"\n";return`${e}\n${a}${g}`}else{return`${p}${l}${h.join(" ")}${l}${g}`}}}function addCommentBefore({indent:e,options:{commentString:t}},B,s,n){if(s&&n)s=s.replace(/^\n+/,"");if(s){const n=r.indentComment(t(s),e);B.push(n.trimStart())}}t.stringifyCollection=stringifyCollection},9799:(e,t)=>{"use strict";const stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function indentComment(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}const lineComment=(e,t,B)=>e.endsWith("\n")?indentComment(B,t):B.includes("\n")?"\n"+indentComment(B,t):(e.endsWith(" ")?"":" ")+B;t.indentComment=indentComment;t.lineComment=lineComment;t.stringifyComment=stringifyComment},6829:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2148);var r=B(9799);function stringifyDocument(e,t){const B=[];let i=t.directives===true;if(t.directives!==false&&e.directives){const t=e.directives.toString(e);if(t){B.push(t);i=true}else if(e.directives.docStart)i=true}if(i)B.push("---");const a=n.createStringifyContext(e,t);const{commentString:o}=a.options;if(e.commentBefore){if(B.length!==1)B.unshift("");const t=o(e.commentBefore);B.unshift(r.indentComment(t,""))}let l=false;let c=null;if(e.contents){if(s.isNode(e.contents)){if(e.contents.spaceBefore&&i)B.push("");if(e.contents.commentBefore){const t=o(e.contents.commentBefore);B.push(r.indentComment(t,""))}a.forceBlockIndent=!!e.comment;c=e.contents.comment}const t=c?undefined:()=>l=true;let C=n.stringify(e.contents,a,()=>c=null,t);if(c)C+=r.lineComment(C,"",o(c));if((C[0]==="|"||C[0]===">")&&B[B.length-1]==="---"){B[B.length-1]=`--- ${C}`}else B.push(C)}else{B.push(n.stringify(e.contents,a))}if(e.directives?.docEnd){if(e.comment){const t=o(e.comment);if(t.includes("\n")){B.push("...");B.push(r.indentComment(t,""))}else{B.push(`... ${t}`)}}else{B.push("...")}}else{let t=e.comment;if(t&&l)t=t.replace(/^\n+/,"");if(t){if((!l||c)&&B[B.length-1]!=="")B.push("");B.push(r.indentComment(o(t),""))}}return B.join("\n")+"\n"}t.stringifyDocument=stringifyDocument},8689:(e,t)=>{"use strict";function stringifyNumber({format:e,minFractionDigits:t,tag:B,value:s}){if(typeof s==="bigint")return String(s);const n=typeof s==="number"?s:Number(s);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!B||B==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let e=r.indexOf(".");if(e<0){e=r.length;r+="."}let B=t-(r.length-e-1);while(B-- >0)r+="0"}return r}t.stringifyNumber=stringifyNumber},9748:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(2148);var i=B(9799);function stringifyPair({key:e,value:t},B,a,o){const{allNullValues:l,doc:c,indent:C,indentStep:u,options:{commentString:f,indentSeq:h,simpleKeys:p}}=B;let g=s.isNode(e)&&e.comment||null;if(p){if(g){throw new Error("With simple keys, key nodes cannot have comments")}if(s.isCollection(e)||!s.isNode(e)&&typeof e==="object"){const e="With simple keys, collection cannot be used as a key value";throw new Error(e)}}let m=!p&&(!e||g&&t==null&&!B.inFlow||s.isCollection(e)||(s.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==="object"));B=Object.assign({},B,{allNullValues:false,implicitKey:!m&&(p||!l),indent:C+u});let d=false;let D=false;let E=r.stringify(e,B,()=>d=true,()=>D=true);if(!m&&!B.inFlow&&E.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=true}if(B.inFlow){if(l||t==null){if(d&&a)a();return E===""?"?":m?`? ${E}`:E}}else if(l&&!p||t==null&&m){E=`? ${E}`;if(g&&!d){E+=i.lineComment(E,B.indent,f(g))}else if(D&&o)o();return E}if(d)g=null;if(m){if(g)E+=i.lineComment(E,B.indent,f(g));E=`? ${E}\n${C}:`}else{E=`${E}:`;if(g)E+=i.lineComment(E,B.indent,f(g))}let y,b,O;if(s.isNode(t)){y=!!t.spaceBefore;b=t.commentBefore;O=t.comment}else{y=false;b=null;O=null;if(t&&typeof t==="object")t=c.createNode(t)}B.implicitKey=false;if(!m&&!g&&s.isScalar(t))B.indentAtStart=E.length+1;D=false;if(!h&&u.length>=2&&!B.inFlow&&!m&&s.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor){B.indent=B.indent.substring(2)}let w=false;const S=r.stringify(t,B,()=>w=true,()=>D=true);let N=" ";if(g||y||b){N=y?"\n":"";if(b){const e=f(b);N+=`\n${i.indentComment(e,B.indent)}`}if(S===""&&!B.inFlow){if(N==="\n"&&O)N="\n\n"}else{N+=`\n${B.indent}`}}else if(!m&&s.isCollection(t)){const e=S[0];const s=S.indexOf("\n");const n=s!==-1;const r=B.inFlow??t.flow??t.items.length===0;if(n||!r){let t=false;if(n&&(e==="&"||e==="!")){let B=S.indexOf(" ");if(e==="&"&&B!==-1&&B{"use strict";var s=B(3301);var n=B(4475);const getFoldOptions=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});const containsDocumentMarker=e=>/^(%|---|\.\.\.)/m.test(e);function lineLengthOverLimit(e,t,B){if(!t||t<0)return false;const s=t-B;const n=e.length;if(n<=s)return false;for(let t=0,B=0;ts)return true;B=t+1;if(n-B<=s)return false}}return true}function doubleQuotedString(e,t){const B=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return B;const{implicitKey:s}=t;const r=t.options.doubleQuotedMinMultiLineLength;const i=t.indent||(containsDocumentMarker(e)?" ":"");let a="";let o=0;for(let e=0,t=B[e];t;t=B[++e]){if(t===" "&&B[e+1]==="\\"&&B[e+2]==="n"){a+=B.slice(o,e)+"\\ ";e+=1;o=e;t="\\"}if(t==="\\")switch(B[e+1]){case"u":{a+=B.slice(o,e);const t=B.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:if(t.substr(0,2)==="00")a+="\\x"+t.substr(2);else a+=B.substr(e,6)}e+=5;o=e+1}break;case"n":if(s||B[e+2]==='"'||B.length\n";let h;let p;for(p=B.length;p>0;--p){const e=B[p-1];if(e!=="\n"&&e!=="\t"&&e!==" ")break}let g=B.substring(p);const m=g.indexOf("\n");if(m===-1){h="-"}else if(B===g||m!==g.length-1){h="+";if(o)o()}else{h=""}if(g){B=B.slice(0,-g.length);if(g[g.length-1]==="\n")g=g.slice(0,-1);g=g.replace(r,`$&${u}`)}let d=false;let D;let E=-1;for(D=0;D{r=true}}const o=n.foldFlowLines(`${y}${e}${g}`,u,n.FOLD_BLOCK,a);if(!r)return`>${O}\n${u}${o}`}B=B.replace(/\n+/g,`$&${u}`);return`|${O}\n${u}${y}${B}${g}`}function plainString(e,t,B,r){const{type:i,value:a}=e;const{actualString:o,implicitKey:l,indent:c,indentStep:C,inFlow:u}=t;if(l&&a.includes("\n")||u&&/[[\]{},]/.test(a)){return quotedString(a,t)}if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)){return l||u||!a.includes("\n")?quotedString(a,t):blockString(e,t,B,r)}if(!l&&!u&&i!==s.Scalar.PLAIN&&a.includes("\n")){return blockString(e,t,B,r)}if(containsDocumentMarker(a)){if(c===""){t.forceBlockIndent=true;return blockString(e,t,B,r)}else if(l&&c===C){return quotedString(a,t)}}const f=a.replace(/\n+/g,`$&\n${c}`);if(o){const test=e=>e.default&&e.tag!=="tag:yaml.org,2002:str"&&e.test?.test(f);const{compat:e,tags:B}=t.doc.schema;if(B.some(test)||e?.some(test))return quotedString(a,t)}return l?f:n.foldFlowLines(f,c,n.FOLD_FLOW,getFoldOptions(t,false))}function stringifyString(e,t,B,n){const{implicitKey:r,inFlow:i}=t;const a=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;if(o!==s.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value))o=s.Scalar.QUOTE_DOUBLE}const _stringify=e=>{switch(e){case s.Scalar.BLOCK_FOLDED:case s.Scalar.BLOCK_LITERAL:return r||i?quotedString(a.value,t):blockString(a,t,B,n);case s.Scalar.QUOTE_DOUBLE:return doubleQuotedString(a.value,t);case s.Scalar.QUOTE_SINGLE:return singleQuotedString(a.value,t);case s.Scalar.PLAIN:return plainString(a,t,B,n);default:return null}};let l=_stringify(o);if(l===null){const{defaultKeyType:e,defaultStringType:B}=t.options;const s=r&&e||B;l=_stringify(s);if(l===null)throw new Error(`Unsupported default string type ${s}`)}return l}t.stringifyString=stringifyString},204:(e,t,B)=>{"use strict";var s=B(1127);const n=Symbol("break visit");const r=Symbol("skip children");const i=Symbol("remove node");function visit(e,t){const B=initVisitor(t);if(s.isDocument(e)){const t=visit_(null,e.contents,B,Object.freeze([e]));if(t===i)e.contents=null}else visit_(null,e,B,Object.freeze([]))}visit.BREAK=n;visit.SKIP=r;visit.REMOVE=i;function visit_(e,t,B,r){const a=callVisitor(e,t,B,r);if(s.isNode(a)||s.isPair(a)){replaceNode(e,r,a);return visit_(e,a,B,r)}if(typeof a!=="symbol"){if(s.isCollection(t)){r=Object.freeze(r.concat(t));for(let e=0;e{ /*! * re2js * RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching diff --git a/publish/dist/index.js b/publish/dist/index.js index fbca268..c238308 100644 --- a/publish/dist/index.js +++ b/publish/dist/index.js @@ -1,4 +1,4 @@ -(()=>{var e={2047:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);const{URL:r}=B(3136);const{benchmarkKey:i}=B(8817);const{loadSnapshot:a}=B(1283);const{assert:o,compareText:l,hasControl:c,median:C,safePart:u,walkFiles:f,writeJSON:h}=B(8793);const p=1;function validLabel(e,t,B=160){o(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e&&!c(e),`${t} must be a trimmed string of 1..${B} bytes`)}function validURL(e,t){let B;try{B=new r(e)}catch{throw new Error(`invalid ${t} ${JSON.stringify(e)}`)}o(B.protocol==="https:"&&B.hostname&&!B.username&&!B.password&&!/[<>\r\n]/u.test(e),`invalid ${t} ${JSON.stringify(e)}`)}function validUnit(e){return typeof e==="string"&&Buffer.byteLength(e)>=1&&Buffer.byteLength(e)<=64&&!c(e)&&!/[\s`|<>]/u.test(e)}function validBenchmarkName(e){return typeof e==="string"&&e.startsWith("Benchmark")&&e.length>"Benchmark".length&&Buffer.byteLength(e)<=300&&!c(e)&&!/[\s`|<>]/u.test(e)}function validateMeasurements(e,t){o(t&&typeof t==="object"&&!Array.isArray(t)&&Object.keys(t).length>=1&&Object.keys(t).length<=32,`benchmark ${JSON.stringify(e)} has an invalid measurement count`);for(const[B,s]of Object.entries(t)){o(validUnit(B),`benchmark ${JSON.stringify(e)} has invalid unit ${JSON.stringify(B)}`);o(typeof s==="number"&&Number.isFinite(s)&&s>=0,`benchmark ${JSON.stringify(e)} unit ${JSON.stringify(B)} has invalid value`)}}function validateResult(e,t,B={}){const s=B.trustedLayout??true;const n=s?t.maxBenchmarks:5e3;o(e?.schemaVersion===p,`unsupported result schema ${e?.schemaVersion}`);o(e.suiteId===t.id,`suite id ${JSON.stringify(e.suiteId)} does not match config ${JSON.stringify(t.id)}`);o(u(e.shardId),`invalid shard id ${JSON.stringify(e.shardId)}`);o(e.samplePairing===undefined||e.samplePairing==="index",`invalid sample pairing ${JSON.stringify(e.samplePairing)}`);o(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(e.source?.repository),`invalid source repository ${JSON.stringify(e.source?.repository)}`);o(/^[0-9a-f]{40}$/u.test(e.source.sha),`invalid source SHA ${JSON.stringify(e.source.sha)}`);validURL(e.source.url,"source URL");if(e.source.runUrl)validURL(e.source.runUrl,"run URL");o(typeof e.source.timestamp==="string"&&!Number.isNaN(Date.parse(e.source.timestamp)),"source timestamp is invalid");o(u(e.platform?.id),`invalid platform id ${JSON.stringify(e.platform?.id)}`);validLabel(e.platform.label,"platform label");o(Array.isArray(e.benchmarks)&&e.benchmarks.length>=1&&e.benchmarks.length<=n,`benchmark count is outside 1..${n}`);o(Object.keys(e.units??{}).length<=64,"unit metadata count exceeds 64");for(const[t,B]of Object.entries(e.units??{})){o(validUnit(t),`invalid metadata unit ${JSON.stringify(t)}`);o(B.better===undefined||B.better==="higher"||B.better==="lower",`unit ${t} has invalid better value`);o(B.assume===undefined||B.assume==="nothing"||B.assume==="exact",`unit ${t} has invalid assume value`)}const r=new Set;for(const B of e.benchmarks){o(validBenchmarkName(B.name),`invalid benchmark name ${JSON.stringify(B.name)}`);o(!B.package||/^[A-Za-z0-9._~+/-]+$/u.test(B.package),`benchmark ${B.name} has invalid package ${JSON.stringify(B.package)}`);const e=i(B);o(!r.has(e),`duplicate benchmark ${JSON.stringify(e)}`);r.add(e);if(s){o(t.includeBenchmark(B.name,e),`benchmark ${JSON.stringify(e)} is excluded by trusted config`);const s=t.layoutFor(B.name,e);o(B.group===s.group&&B.chart===s.chart,`benchmark ${JSON.stringify(e)} layout does not match trusted config`)}else{o(B.group==="other"||u(B.group)&&B.group===B.group.toLowerCase(),`benchmark ${JSON.stringify(e)} has invalid stored group`);o(B.chart===`group:${B.group}`||B.chart===`benchmark:${e}`,`benchmark ${JSON.stringify(e)} has invalid stored chart`)}o(Array.isArray(B.samples)&&B.samples.length>=1&&B.samples.length<=100,`benchmark ${JSON.stringify(e)} sample count is outside 1..100`);const n=new Map;for(const t of B.samples){o(Number.isSafeInteger(t.iterations)&&t.iterations>0,`benchmark ${JSON.stringify(e)} has invalid iterations`);validateMeasurements(e,t.measurements);for(const[e,B]of Object.entries(t.measurements)){if(!n.has(e))n.set(e,[]);n.get(e).push(B)}}validateMeasurements(e,B.measurements);o(n.size===Object.keys(B.measurements).length,`benchmark ${JSON.stringify(e)} sample and summary units do not match`);for(const[t,s]of Object.entries(B.measurements)){o(n.has(t)&&s===C(n.get(t)),`benchmark ${JSON.stringify(e)} unit ${JSON.stringify(t)} summary is not the sample median`)}}return e}function validateSamplePairing(e,t){if(e.samplePairing===undefined&&t?.samplePairing===undefined){return}o(e.samplePairing==="index"&&t?.samplePairing==="index","index sample pairing requires a paired baseline");const B=new Map(t.benchmarks.map(e=>[i(e),e]));o(e.benchmarks.length===t.benchmarks.length,"index-paired result and baseline benchmark counts differ");for(const t of e.benchmarks){const e=i(t);const s=B.get(e);o(s,`index-paired baseline is missing benchmark ${JSON.stringify(e)}`);o(t.samples.length===s.samples.length,`index-paired benchmark ${JSON.stringify(e)} sample counts differ`);for(let B=0;B{const t=JSON.parse(s.readFileSync(e,"utf8"));try{validateResult(t,B);const r=n.join(n.dirname(e),"baseline.json");if(s.existsSync(r)){const e=validateResult(JSON.parse(s.readFileSync(r,"utf8")),B);o(e.shardId===t.shardId,`baseline shard ${JSON.stringify(e.shardId)} does not match result shard ${JSON.stringify(t.shardId)}`);o(JSON.stringify(e.platform)===JSON.stringify(t.platform),`baseline platform does not match result platform ${JSON.stringify(t.platform.id)}`);validateSamplePairing(t,e);l.push(e)}return t}catch(t){throw new Error(`${e}: ${t.message}`,{cause:t})}});o(l.length===0||l.length===c.length,"same-runner baseline must be present for every result artifact");return{config:B,results:mergeShards(c),baselines:l.length===0?[]:mergeShards(l)}}function mergeMetadata(e,t,B){for(const[s,n]of Object.entries(t??{})){if(e[s]){o(JSON.stringify(e[s])===JSON.stringify(n),`platform ${B} has conflicting metadata for ${s}`)}else{e[s]=n}}}function mergeShards(e){o(e.length>=1&&e.length<=256,"shard count is outside 1..256");const t=e[0];const B=`${t.source.repository}@${t.source.sha}`;const s=new Set;const n=new Map;for(const t of e){o(`${t.source.repository}@${t.source.sha}`===B,`shard ${t.shardId} source does not match ${B}`);const e=`${t.platform.id}/${t.shardId}`;o(!s.has(e),`duplicate shard ${JSON.stringify(e)}`);s.add(e);let r=n.get(t.platform.id);if(!r){r={...t,shardId:"merged",units:{},benchmarks:[]};n.set(t.platform.id,r)}else{o(JSON.stringify(r.platform)===JSON.stringify(t.platform),`platform ${t.platform.id} metadata differs between shards`);o(r.samplePairing===t.samplePairing,`platform ${t.platform.id} sample pairing differs between shards`)}mergeMetadata(r.units,t.units,t.platform.id);const a=new Set(r.benchmarks.map(i));for(const e of t.benchmarks){const B=i(e);o(!a.has(B),`platform ${t.platform.id} repeats benchmark ${JSON.stringify(B)} across shards`);a.add(B);r.benchmarks.push(e)}if(Date.parse(t.source.timestamp)>Date.parse(r.source.timestamp)){r.source=t.source}}return[...n.values()].map(e=>({...e,benchmarks:e.benchmarks.toSorted((e,t)=>l(i(e),i(t)))})).sort((e,t)=>l(e.platform.id,t.platform.id))}e.exports={loadArtifacts:loadArtifacts,mergeShards:mergeShards,schemaVersion:p,validateResult:validateResult,writeArtifact:writeArtifact}},6247:(e,t,B)=>{"use strict";const s=B(3024);const n=B(8161);const r=B(6760);const{parseArgs:i}=B(7975);const{loadArtifacts:a,validateResult:o,writeArtifact:l,schemaVersion:c}=B(2047);const{loadConfig:C}=B(1283);const{parseGoBenchmark:u}=B(8817);const{writeReport:f}=B(8959);const{entryFromResults:h,update:p}=B(7864);const{assert:g,safePart:m,writeOutputs:d}=B(8793);function options(e,t){const B=i({args:e,options:Object.fromEntries(Object.keys(t).map(e=>[e,{type:"string"}])),strict:true});return B.values}function required(e,t,B){for(const s of t){g(e[s],`${B} requires --${s}`)}}function goOS(){return{win32:"windows"}[process.platform]??process.platform}function goArch(){return{x64:"amd64",ia32:"386"}[process.arch]??process.arch}function displayOS(e){return{darwin:"macOS",linux:"Linux",windows:"Windows"}[e]??e}function githubEvent(){const e=process.env.GITHUB_EVENT_PATH;if(!e)return{};try{return JSON.parse(s.readFileSync(e,"utf8"))}catch(t){throw new Error(`read GitHub event ${e}: ${t.message}`,{cause:t})}}function sourceDefaults(){const e=githubEvent();const t=e.pull_request?.head;return{repository:t?.repo?.full_name||process.env.GITHUB_REPOSITORY||"",sha:t?.sha||process.env.GITHUB_SHA||"",ref:t?.ref||process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME||process.env.GITHUB_REF||""}}function baselineSourceDefaults(){const e=githubEvent().pull_request?.base;return{repository:e?.repo?.full_name||"",sha:e?.sha||"",ref:e?.ref||""}}function serverURL(){return(process.env.GITHUB_SERVER_URL||"https://github.com").replace(/\/+$/u,"")}function defaultSourceURL(e,t){return`${serverURL()}/${e}/commit/${t}`}function defaultRunURL(){return process.env.GITHUB_RUN_ID&&process.env.GITHUB_REPOSITORY?`${serverURL()}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`:""}function defaultTemporaryDirectory(e){const t=process.env.RUNNER_TEMP||n.tmpdir();s.mkdirSync(t,{recursive:true});return s.mkdtempSync(r.join(t,e))}function runRecord(e,t={}){const B=options(e,{config:true,input:true,"baseline-input":true,"baseline-repository":true,"baseline-sha":true,"baseline-ref":true,"sample-pairing":true,"output-dir":true,"platform-id":true,"platform-label":true,"shard-id":true,os:true,arch:true,runner:true,repository:true,sha:true,ref:true,"source-url":true,"run-url":true,timestamp:true,"github-output":true});required(B,["config","input"],"record");const n=C(B.config);const r=u(s.readFileSync(B.input,"utf8"),n);const i=B.os||r.fileConfig.goos||goOS();const a=B.arch||r.fileConfig.goarch||goArch();const o=B["platform-id"]||`${i}-${a}`;const f=B["shard-id"]||process.env.GITHUB_JOB||"default";g(m(o),`invalid platform id ${JSON.stringify(o)}`);g(m(f),`invalid shard id ${JSON.stringify(f)}`);const h=sourceDefaults();const p=B.repository||h.repository;const D=B.sha||h.sha;const E=B["source-url"]||defaultSourceURL(p,D);const y=B["run-url"]||defaultRunURL();const b=B.timestamp||(new Date).toISOString();const O={id:o,label:B["platform-label"]||`${displayOS(i)} / ${a}`,os:i,arch:a,...B.runner?{runner:B.runner}:{}};const w={schemaVersion:c,suiteId:n.id,shardId:f,...B["sample-pairing"]?{samplePairing:B["sample-pairing"]}:{},source:{repository:p,sha:D,...B.ref||h.ref?{ref:B.ref||h.ref}:{},url:E,...y?{runUrl:y}:{},timestamp:b},platform:O,units:r.units,benchmarks:r.benchmarks};let S=null;if(B["baseline-input"]){const e=baselineSourceDefaults();const t=B["baseline-repository"]||e.repository;const r=B["baseline-sha"]||e.sha;const i=B["baseline-ref"]||e.ref;g(t&&r,"baseline repository and SHA are required with --baseline-input");const a=u(s.readFileSync(B["baseline-input"],"utf8"),n);S={schemaVersion:c,suiteId:n.id,shardId:f,...B["sample-pairing"]?{samplePairing:B["sample-pairing"]}:{},source:{repository:t,sha:r,...i?{ref:i}:{},url:defaultSourceURL(t,r),...y?{runUrl:y}:{},timestamp:b},platform:O,units:a.units,benchmarks:a.benchmarks}}const N=B["output-dir"]||defaultTemporaryDirectory(`go-benchmark-${n.id}-${o}-${f}-`);l(N,n,w,S);const F=`go-benchmark-${n.id}-${o}-${f}`;const A={"artifact-name":F,"artifact-path":N,"platform-id":o,"shard-id":f,"suite-id":n.id};d(t.githubOutput??B["github-output"]??process.env.GITHUB_OUTPUT,A);console.log(`Recorded ${r.benchmarks.length} benchmarks for ${o}/${f} in ${N}`);return{outputDirectory:N,outputs:A}}function series(e,t=""){return{kind:e[`${t}series-kind`],id:e[`${t}series-id`],label:e[`${t}series-label`]}}function bindSource(e,t,B){const s=B["expected-source-repository"];const n=B["expected-source-sha"];g(Boolean(s)===Boolean(n),"expected source repository and SHA must be provided together");for(const r of e){if(s){g(r.source.repository===s,`artifact source repository ${JSON.stringify(r.source.repository)} does not match ${JSON.stringify(s)}`);g(r.source.sha===n,`artifact source SHA ${JSON.stringify(r.source.sha)} does not match ${JSON.stringify(n)}`)}r.source={...r.source,...B["source-ref"]?{ref:B["source-ref"]}:{},...B["source-url"]?{url:B["source-url"]}:{},...B["source-run-url"]?{runUrl:B["source-run-url"]}:{},...B["source-timestamp"]?{timestamp:B["source-timestamp"]}:{}};o(r,t)}}function bindBaselineSource(e,t,B){if(e.length===0)return;const s=B["expected-baseline-repository"];const n=B["expected-baseline-sha"];g(s,"expected baseline repository is required with a paired baseline");for(const r of e){g(r.source.repository===s,`artifact baseline repository ${JSON.stringify(r.source.repository)} does not match ${JSON.stringify(s)}`);if(n){g(r.source.sha===n,`artifact baseline SHA ${JSON.stringify(r.source.sha)} does not match ${JSON.stringify(n)}`)}const e=n||r.source.sha;r.source={...r.source,repository:s,sha:e,...B["baseline-source-ref"]?{ref:B["baseline-source-ref"]}:{},url:defaultSourceURL(s,e),...B["source-run-url"]?{runUrl:B["source-run-url"]}:{},...B["source-timestamp"]?{timestamp:B["source-timestamp"]}:{}};o(r,t)}}function bindConfig(e,t){if(!t)return;const B=C(t);g(JSON.stringify(e.config.toJSON())===JSON.stringify(B.toJSON()),"artifact configuration does not match the trusted configuration");for(const t of e.results)o(t,B);for(const t of e.baselines)o(t,B);e.config=B}function runRender(e,t={}){const B=options(e,{artifacts:true,"data-dir":true,"trusted-config":true,"series-kind":true,"series-id":true,"series-label":true,"additional-series-kind":true,"additional-series-id":true,"additional-series-label":true,"site-base-url":true,"expected-source-repository":true,"expected-source-sha":true,"expected-baseline-repository":true,"expected-baseline-sha":true,"baseline-source-ref":true,"source-ref":true,"source-url":true,"source-run-url":true,"source-timestamp":true,comment:true,"github-output":true});required(B,["artifacts","data-dir","series-kind","series-id","series-label"],"render");const s=a(B.artifacts);bindConfig(s,B["trusted-config"]);bindSource(s.results,s.config,B);bindBaselineSource(s.baselines,s.config,B);const n=series(B);const i=s.baselines.length===0?null:h(s.baselines,s.config);const o=p(B["data-dir"],s.config,n,s.results,{comparison:n.kind==="pull"?i:null});const l=[B["additional-series-kind"],B["additional-series-id"],B["additional-series-label"]];if(l.some(Boolean)){g(l.every(Boolean),"additional series kind, id, and label must be provided together");p(B["data-dir"],s.config,series(B,"additional-"),s.results,{comparison:i})}const c=B.comment||r.join(B["data-dir"],".go-benchmark-comment.md");const C=B["site-base-url"]?`${B["site-base-url"].replace(/\/+$/u,"")}/${s.config.sitePath.replace(/^\/+|\/+$/gu,"")}/?series=${encodeURIComponent(`${n.kind}/${n.id}`)}`:"";f(c,C,s.config,o.entry,i||o.main,{sameRunner:Boolean(i)});const u={"comment-path":c,marker:`\x3c!-- go-benchmark:${s.config.id} --\x3e`,"site-path":o.sitePath,"site-url":C,"suite-id":s.config.id};d(t.githubOutput??B["github-output"]??process.env.GITHUB_OUTPUT,u);console.log(`Updated ${n.kind} series ${n.id} with ${s.results.length} platforms`);return{outputs:u}}e.exports={runRecord:runRecord,runRender:runRender}},4408:(e,t,B)=>{"use strict";const{benchmarkKey:s}=B(8817);const{median:n}=B(8793);function benchmarkIndex(e){return new Map((e?.benchmarks??[]).map(e=>[s(e),e]))}function isIndexPaired(e,t,B){return B&&e?.samplePairing==="index"&&t?.samplePairing==="index"}function sampleValues(e,t){return e.samples.flatMap(e=>Object.hasOwn(e.measurements,t)?[e.measurements[t]]:[])}function metricComparison(e,t,B,s){const r=e?.measurements?.[B];const i=t?.measurements?.[B];const a={baseline:i,...r!==undefined&&i!==undefined?{difference:r-i}:{}};if(!s||!e||!t){return a}const o=sampleValues(e,B);const l=sampleValues(t,B);if(o.length===0||o.length!==l.length){return a}const c=[];const C=[];let u=true;for(let e=0;e{"use strict";const s=B(6760);const n=B(8815);const{RE2JS:r}=B(6472);const{assert:i,hasControl:a,safePart:o}=B(8793);const{parseViews:l,serializeViews:c}=B(7675);const C=B(3024);function stringList(e,t){if(e===undefined||e===null||e==="")return[];if(typeof e==="string")return[e];i(Array.isArray(e)&&e.every(e=>typeof e==="string"),`${t} must be a string or string list`);return e}function label(e,t,B=120){i(typeof e==="string",`${t} must be a string`);i(e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e,`${t} must be a trimmed string of 1..${B} bytes`);i(!a(e),`${t} contains a control character`);return e}function title(e){return e.split(/[-_.]/u).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join(" ")}function compilePatterns(e,t){return e.map(e=>{try{return r.compile(e)}catch(B){throw new Error(`${t} pattern ${JSON.stringify(e)}: ${B.message}`,{cause:B})}})}function matches(e,t,B){const s=t.replace(/^Benchmark/u,"");const n=B.replace("::Benchmark","::");return e.some(e=>[t,s,B,n].some(t=>e.matcher(t).find()))}class Config{constructor(e,t="configuration"){i(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);this.version=e.version??1;i(this.version===1,`unsupported version ${this.version}`);this.id=e.id;i(typeof this.id==="string"&&/^[a-z0-9][a-z0-9._-]*$/.test(this.id),"invalid id");this.title=label(e.title??`${this.id} benchmarks`,"title");this.sitePath=s.posix.normalize(e["site-path"]??`go-benchmarks/${this.id}`);i(this.sitePath!=="."&&!this.sitePath.startsWith("../")&&!s.posix.isAbsolute(this.sitePath),`site-path ${JSON.stringify(this.sitePath)} must stay within the data branch`);this.include=stringList(e.include,"include");if(this.include.length===0)this.include=["^Benchmark"];this.exclude=stringList(e.exclude,"exclude");this.maxBenchmarks=e["max-benchmarks"]??500;i(Number.isInteger(this.maxBenchmarks)&&this.maxBenchmarks>=1&&this.maxBenchmarks<=5e3,"max-benchmarks must be between 1 and 5000");this.groups={};this.compiledGroups={};const B=e.groups??{};i(B&&typeof B==="object"&&!Array.isArray(B),"groups must be a mapping");for(const[e,t]of Object.entries(B)){i(o(e)&&e===e.toLowerCase(),`invalid group id ${JSON.stringify(e)}`);const B=typeof t==="string"||Array.isArray(t)?{match:t}:{...t};i(B&&typeof B==="object",`group ${e} must be a pattern or mapping`);const s=stringList(B.match,`group ${e} match`);i(s.length!==0,`group ${e} has no match pattern`);const n=B.chart??"combined";i(n==="combined"||n==="single",`group ${e} chart must be combined or single`);this.groups[e]={title:label(B.title??title(e),`group ${e} title`),match:s,chart:n};this.compiledGroups[e]=compilePatterns(s,`group ${e}`)}this.views=l(e.views);this.compiledInclude=compilePatterns(this.include,"include");this.compiledExclude=compilePatterns(this.exclude,"exclude")}includeBenchmark(e,t){return matches(this.compiledInclude,e,t)&&!matches(this.compiledExclude,e,t)}layoutFor(e,t){const B=Object.keys(this.groups).filter(B=>matches(this.compiledGroups[B],e,t)).sort();i(B.length<=1,`benchmark ${JSON.stringify(t)} matches multiple groups: ${B.join(", ")}`);if(B.length===0)return{group:"other",chart:`benchmark:${t}`};const s=B[0];return{group:s,chart:this.groups[s].chart==="single"?`benchmark:${t}`:`group:${s}`}}toJSON(){return{version:this.version,id:this.id,title:this.title,sitePath:this.sitePath,include:this.include,exclude:this.exclude,maxBenchmarks:this.maxBenchmarks,groups:this.groups,views:c(this.views)}}}function loadConfig(e){let t;try{t=n.parse(C.readFileSync(e,"utf8"),{uniqueKeys:true})}catch(t){throw new Error(`parse ${e}: ${t.message}`,{cause:t})}return new Config(t,e)}function loadSnapshot(e){const t=JSON.parse(C.readFileSync(e,"utf8"));const B={...t,"site-path":t.sitePath,"max-benchmarks":t.maxBenchmarks};return new Config(B,e)}e.exports={Config:Config,loadConfig:loadConfig,loadSnapshot:loadSnapshot}},8817:(e,t,B)=>{"use strict";const{assert:s,compareText:n,median:r}=B(8793);const i=new Map([["ns/op","lower"],["sec/op","lower"],["MB/s","higher"],["B/s","higher"],["B/op","lower"],["allocs/op","lower"]]);function parseNumber(e,t){const B=Number(e);s(Number.isFinite(B)&&B>=0,`${t} has invalid value ${JSON.stringify(e)}`);return B}function parseIterations(e,t){s(/^[0-9]+$/u.test(e),`benchmark ${JSON.stringify(t)} has invalid iteration count ${JSON.stringify(e)}`);const B=Number(e);s(Number.isSafeInteger(B)&&B>0,`benchmark ${JSON.stringify(t)} has invalid iteration count ${JSON.stringify(e)}`);return B}function parseUnitLine(e,t,B){s(e.length>=2,`line ${B}: missing unit`);const n=e[1];for(const r of e.slice(2)){const e=r.indexOf("=");s(e>0,`line ${B}: expected key=value`);const i=r.slice(0,e);const a=r.slice(e+1);s(i==="better"||i==="assume",`line ${B}: unsupported unit metadata ${i}`);if(i==="better")s(a==="higher"||a==="lower",`line ${B}: invalid better value ${a}`);if(i==="assume")s(a==="nothing"||a==="exact",`line ${B}: invalid assume value ${a}`);const o=t[n]??{};s(o[i]===undefined||o[i]===a,`line ${B}: conflicting ${i} metadata for ${n}`);o[i]=a;t[n]=o}}function parseBenchmarkLine(e,t,B,n,r){s(e.length>=4&&(e.length-2)%2===0,`line ${r}: malformed benchmark result`);const i=e[0].replace(/-[0-9]+$/u,"");const a=t?`${t}::${i}`:i;if(!B.includeBenchmark(i,a))return;const o=parseIterations(e[1],a);const l={};for(let t=2;tn(e,t)).map(([e,t])=>[e,r(t)]));return e}function parseGoBenchmark(e,t){const B=new Map;const r={};const a={};let o="";for(const[s,n]of e.split(/\r?\n/u).entries()){const e=s+1;const i=n.trim();if(!i)continue;const l=i.split(/\s+/u);if(l[0]==="Unit"){parseUnitLine(l,r,e);continue}if(l[0].startsWith("Benchmark")){parseBenchmarkLine(l,o,t,B,e);continue}const c=/^([a-z][a-z0-9_-]*):\s*(.*)$/u.exec(i);if(c){const[,e,t]=c;a[e]=t;if(e==="pkg")o=t}}s(B.size!==0,"no included Go benchmarks found");s(B.size<=t.maxBenchmarks,`benchmark count exceeds max-benchmarks ${t.maxBenchmarks}`);const l=[...B.values()].map(summarize).sort((e,t)=>n(benchmarkKey(e),benchmarkKey(t)));for(const e of l){for(const t of Object.keys(e.measurements)){if(!r[t]&&i.has(t))r[t]={better:i.get(t)}}}return{benchmarks:l,units:r,fileConfig:a}}function benchmarkKey(e){return e.package?`${e.package}::${e.name}`:e.name}e.exports={benchmarkKey:benchmarkKey,parseGoBenchmark:parseGoBenchmark}},4217:e=>{"use strict";function markdown(e){return String(e).replace(/[\\*_[\]#`]/gu,"\\$&")}function tableCell(e){return markdown(e).replaceAll("|","\\|").replaceAll("\n"," ")}function formatNumber(e){if(Number.isInteger(e)&&e<1e12)return String(e);return e.toFixed(3)}function formatPreciseNumber(e){if(e===0||Number.isInteger(e))return String(e);const t=Math.abs(e);if(t<1e-7){const[t,B]=e.toExponential(3).split("e");return`${t.replace(/\.?0+$/u,"")}e${B}`}const B=t>=999.95?0:t>=99.995?1:t>=9.9995?2:t>=.99995?3:t>=.099995?4:t>=.0099995?5:t>=99995e-8?6:7;return e.toFixed(B).replace(/0+$/u,"").replace(/\.$/u,"")}function formatSigned(e,t){const B=Object.is(e,-0)?0:e;const s=B>0?"+":B<0?"-":"";return`${s}${t(Math.abs(B))}`}function formatDelta(e,t){const B=e.toFixed(1);const s=e!==0&&Number(B)===0?formatPreciseNumber(e):B;const n=`${e>=0?"+":""}${s}%`;if(e===0||t!=="lower"&&t!=="higher")return n;const r=t==="lower"&&e<0||t==="higher"&&e>0;return`${n} (${r?"better":"worse"})`}function delta(e,t,B){if(t===undefined)return"new";if(t===0)return e===0?"0.0%":"from 0";return formatDelta((e/t-1)*100,B)}e.exports={delta:delta,formatDelta:formatDelta,formatNumber:formatNumber,formatPreciseNumber:formatPreciseNumber,formatSigned:formatSigned,markdown:markdown,tableCell:tableCell}},2080:(e,t,B)=>{"use strict";const s=B(6760);const{runRender:n}=B(6247);function workspacePath(e){return s.isAbsolute(e)?e:s.join(process.env.GITHUB_WORKSPACE||process.cwd(),e)}function input(e){const t=`BENCHMARK_${e.replaceAll("-","_").toUpperCase()}`;return process.env[t]??""}function add(e,t,B){if(B)e.push(`--${t}`,B)}function run(){const e=["--artifacts",workspacePath(input("artifacts")),"--data-dir",workspacePath(input("data-directory")),"--series-kind",input("series-kind"),"--series-id",input("series-id"),"--series-label",input("series-label"),"--comment",workspacePath(input("comment-path"))];if(input("trusted-config")){add(e,"trusted-config",workspacePath(input("trusted-config")))}add(e,"additional-series-kind",input("additional-series-kind"));add(e,"additional-series-id",input("additional-series-id"));add(e,"additional-series-label",input("additional-series-label"));add(e,"site-base-url",input("site-base-url"));add(e,"expected-source-repository",input("expected-source-repository"));add(e,"expected-source-sha",input("expected-source-sha"));add(e,"expected-baseline-repository",input("expected-baseline-repository"));add(e,"expected-baseline-sha",input("expected-baseline-sha"));add(e,"baseline-source-ref",input("baseline-source-ref"));add(e,"source-ref",input("source-ref"));add(e,"source-url",input("source-url"));add(e,"source-run-url",input("source-run-url"));add(e,"source-timestamp",input("source-timestamp"));return n(e)}e.exports={run:run}},8959:(e,t,B)=>{"use strict";const s=B(3024);const{benchmarkKey:n}=B(8817);const{benchmarkIndex:r,isIndexPaired:i,metricComparison:a}=B(4408);const{delta:o,formatDelta:l,formatNumber:c,formatPreciseNumber:C,formatSigned:u,markdown:f,tableCell:h}=B(4217);const{compareText:p}=B(8793);const{renderViews:g}=B(6919);function groupTitle(e,t){if(t==="other")return"Other";return e.groups[t]?.title??t}function writeReport(e,t,m,d,D,E={}){const y=d.source;const b=E.sameRunner??false;const O=b?"vs base":"vs main";const w=[`\x3c!-- go-benchmark:${m.id} --\x3e`,`## ${f(m.title)}`,"",`[\`${y.sha.slice(0,12)}\`](<${y.url}>)`+(y.runUrl?` | [workflow run](<${y.runUrl}>)`:"")+(t?` | [long-term charts](<${t}>)`:""),""];if(Object.keys(m.views).length>0){w.push(...g(m,d,D,O,b))}else{for(const e of Object.keys(d.platforms).sort(p)){const t=d.platforms[e];const B=D?.platforms?.[e];const s=r(B);const g=i(t,B,b);w.push(`### ${f(t.platform.label)}`,"",`| Group | Benchmark | Metric | Current | ${O} |`,"|---|---|---|---:|---:|");for(const e of t.benchmarks){for(const B of Object.keys(e.measurements).sort(p)){const r=n(e);const i=a(e,s.get(r),B,g);const f=i.change===undefined?o(e.measurements[B],i.baseline,t.units?.[B]?.better):l(i.change,t.units?.[B]?.better);const p=i.difference===undefined?f:`${u(i.difference,e=>`${C(e)} ${B}`)} / ${f}`;w.push(`| ${h(groupTitle(m,e.group))} | \`${r}\` | \`${B}\` | ${c(e.measurements[B])} | ${p} |`)}}w.push("")}}let S;if(D&&b){const e=Object.entries(d.platforms).some(([e,t])=>i(t,D.platforms?.[e],b));S=`_Compared with [\`${D.source.sha.slice(0,12)}\`](<${D.source.url}>) measured in the same runner job${e?"; index-paired signed differences and percentage changes are pairwise medians":""}._`}else if(D){S="_Compared only with the latest matching platform in the main series._"}else{S="_No main baseline exists yet; all metrics are marked `new`._"}w.push(S,"");if(Buffer.byteLength(w.join("\n"))>65e3){throw new Error("benchmark report exceeds the GitHub comment size limit")}s.mkdirSync(B(6760).dirname(e),{recursive:true});s.writeFileSync(e,w.join("\n"))}e.exports={delta:o,writeReport:writeReport}},7864:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);const{validateResult:r}=B(2047);const{loadSnapshot:i}=B(1283);const{benchmarkKey:a}=B(8817);const{assert:o,compareText:l,hasControl:c,readJSONIfExists:C,safePart:u,walkFiles:f,writeJSON:h}=B(8793);const p=1;const g=500;const m=["app.js","index.html","styles.css"];function validateLabel(e,t){o(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=160&&e.trim()===e&&!c(e),`${t} must be a trimmed string of 1..160 bytes`)}function validateSeries(e){o(e?.kind==="main"||e?.kind==="branch"||e?.kind==="pull",`unsupported series kind ${JSON.stringify(e?.kind)}`);o(u(e.id),`invalid series id ${JSON.stringify(e.id)}`);validateLabel(e.label,"series label")}function normalizeStoredResult(e,t){if(!e.shardId)e.shardId="merged";for(const t of e.benchmarks??[]){if(!t.chart){t.chart=t.group==="other"?`benchmark:${a(t)}`:`group:${t.group}`}}return r(e,t,{trustedLayout:false})}function validateEntry(e,t){o(e?.source&&e.platforms&&typeof e.platforms==="object","history entry is invalid");for(const[B,s]of Object.entries(e.platforms)){o(s?.platform?.id===B,`history platform key ${JSON.stringify(B)} does not match its result`);normalizeStoredResult(s,t);o(s.source.repository===e.source.repository&&s.source.sha===e.source.sha,`history platform ${B} source does not match its entry`)}return e}function validateHistory(e,t,B){o(e.schemaVersion===p,`unsupported history schema ${e.schemaVersion}`);o(e.suiteId===t.id&&e.kind===B.kind&&e.id===B.id,`history identity does not match ${t.id}/${B.kind}/${B.id}`);o(Array.isArray(e.entries)&&e.entries.length<=g,"history entries are invalid");for(const B of e.entries){validateEntry(B,t)}e.label=B.label}function emptyHistory(e,t){return{schemaVersion:p,suiteId:e.id,kind:t.kind,id:t.id,label:t.label,entries:[]}}function mergeHistories(e,t,B,s=false){const n=e.map(e=>C(e,null)).filter(Boolean);if(n.length===0)return s?null:emptyHistory(t,B);const r=emptyHistory(t,B);for(const e of n){validateHistory(e,t,B);for(const t of e.entries){const e=r.entries.findIndex(e=>sameSource(e,t));if(e===-1){r.entries.push(t)}else if(compareEntries(r.entries[e],t)<=0){r.entries[e]=t}}}r.entries.sort(compareEntries);if(r.entries.length>g){r.entries.splice(0,r.entries.length-g)}return r}function entryFromResults(e,t){o(e.length!==0,"cannot update history without results");const B=e[0].source;const s={};for(const n of e){r(n,t);o(n.source.repository===B.repository&&n.source.sha===B.sha,`platform ${n.platform.id} does not match source ${B.repository}@${B.sha}`);o(!Object.hasOwn(s,n.platform.id),`duplicate platform ${JSON.stringify(n.platform.id)}`);s[n.platform.id]=n}return{source:B,platforms:s}}function compareEntries(e,t){const B=Date.parse(e.source.timestamp)-Date.parse(t.source.timestamp);return B||l(e.source.sha,t.source.sha)}function compareSeries(e,t){const B={main:0,branch:1,pull:2};return B[e.kind]-B[t.kind]||l(e.label,t.label)||l(e.id,t.id)}function sameSource(e,t){return e.source.repository===t.source.repository&&e.source.sha===t.source.sha}function commitRelative(e){o(/^[0-9a-f]{40}$/u.test(e.source.sha),`invalid source SHA ${JSON.stringify(e.source.sha)}`);return n.posix.join("commits",`${e.source.sha}.json`)}function writeCommit(e,t,B,s=null){validateEntry(B,t);if(s)validateEntry(s,t);const r=commitRelative(B);const i=n.join(e,...r.split("/"));const a=C(i,null);let l=B;if(a){o(a.schemaVersion===p&&a.suiteId===t.id,`commit snapshot identity does not match ${t.id}`);validateEntry(a,t);o(a.source.sha===B.source.sha,`commit snapshot source does not match ${B.source.sha}`);if(compareEntries(a,B)>0)l=a;if(a.comparison){validateEntry(a.comparison,t);s??=a.comparison}}h(i,{schemaVersion:p,suiteId:t.id,source:l.source,platforms:l.platforms,...s?{comparison:s}:{}});return r}function latestMatchingPlatforms(e,t){if(!e?.entries?.length)return null;const B={};let s;for(let n=e.entries.length-1;n>=0&&Object.keys(B).lengths.existsSync(n.join(e,"index.html")));o(B,"bundled web assets are missing");for(const e of m){const r=n.join(B,e);const i=n.join(t,e);s.mkdirSync(n.dirname(i),{recursive:true});s.copyFileSync(r,i)}s.writeFileSync(n.join(e,".nojekyll"),"")}function migrateLegacyData(e,t){const B=n.posix.normalize(t);o(B!=="."&&!B.startsWith("../")&&!n.posix.isAbsolute(B),`site path ${JSON.stringify(t)} must stay within the data branch`);const r=n.join(e,...B.split("/"));const a=n.join(r,"series");const l=f(a,"history.json");const c=n.join(r,"series.json");const u=C(c,{schemaVersion:p,series:[]});o(u.schemaVersion===p&&Array.isArray(u.series),"unsupported or invalid series index");const g=new Set;for(const e of l){const t=n.dirname(e);const a=i(n.join(t,"config.json"));o(a.sitePath===B,`series config site path ${JSON.stringify(a.sitePath)} does not match ${JSON.stringify(B)}`);const l=C(e,null);const c={kind:l?.kind,id:l?.id,label:l?.label};validateSeries(c);validateHistory(l,a,c);const f=n.join(t,"summary.json");const p=s.existsSync(f);const m=mergeHistories([f,e],a,c);for(const e of m.entries){g.add(commitRelative(e));writeCommit(r,a,e)}if(c.kind==="pull"&&m.entries.length>0){const e=m.entries[m.entries.length-1];if(p){const t=C(f,null);validateHistory(t,a,c);const B=t.entries[t.entries.length-1];if(!B||compareEntries(B,e)<0){m.entries=[e]}else{m.entries=t.entries}}else{m.entries=[e]}}h(f,m);const d=m.entries[m.entries.length-1];let D=u.series.find(e=>e.kind===c.kind&&e.id===c.id);if(!D&&d){D={kind:c.kind,id:c.id,label:c.label,configPath:n.posix.join("series",c.kind,c.id,"config.json"),updatedAt:d.source.timestamp};u.series.push(D)}if(d){D.path=n.posix.join("series",c.kind,c.id,"summary.json");D.configPath=n.posix.join("series",c.kind,c.id,"config.json");D.commitPath=commitRelative(d);D.sha=d.source.sha;D.sourceUrl=d.source.url}}u.series.sort(compareSeries);h(c,u);writeWeb(e,r);return{commits:g.size,series:l.length,siteRoot:r}}function update(e,t,B,s,r={}){validateSeries(B);const i=entryFromResults(s,t);const a=n.posix.join("series",B.kind,B.id,"summary.json");const l=n.posix.join("series",B.kind,B.id,"history.json");const c=n.posix.join("series",B.kind,B.id,"config.json");const u=n.join(e,...t.sitePath.split("/"));const f=n.join(u,...a.split("/"));const m=n.join(u,...l.split("/"));const d=n.join(u,...c.split("/"));const D=mergeHistories([f,m],t,B);const E=r.comparison??null;if(E)validateEntry(E,t);if(B.kind==="pull"){for(const e of D.entries)writeCommit(u,t,e);D.entries=E&&!sameSource(E,i)?[E,i]:[i]}else{const e=D.entries.findIndex(e=>sameSource(e,i));if(e===-1)D.entries.push(i);else D.entries[e]=i;D.entries.sort(compareEntries);if(D.entries.length>g){D.entries.splice(0,D.entries.length-g)}}if(B.kind==="pull"){writeCommit(u,t,i,E)}else{for(const e of D.entries){writeCommit(u,t,e,sameSource(e,i)?E:null)}}const y=commitRelative(i);h(f,D);h(m,D);h(d,t.toJSON());const b=n.join(u,"series.json");const O=C(b,{schemaVersion:p,series:[]});o(O.schemaVersion===p&&Array.isArray(O.series),"unsupported or invalid series index");const w={kind:B.kind,id:B.id,label:B.label,path:a,configPath:c,commitPath:y,sha:i.source.sha,sourceUrl:i.source.url,updatedAt:(new Date).toISOString()};const S=O.series.findIndex(e=>e.kind===w.kind&&e.id===w.id);if(S===-1)O.series.push(w);else O.series[S]=w;O.series.sort(compareSeries);h(b,O);writeWeb(e,u);const N=n.join(u,"series","main","main","summary.json");const F=n.join(u,"series","main","main","history.json");const A=mergeHistories([N,F],t,{kind:"main",id:"main",label:"Main"},true);if(A){validateHistory(A,t,{kind:"main",id:"main",label:A.label||"Main"})}return{entry:i,main:latestMatchingPlatforms(A,i.platforms),commitPath:n.join(u,...y.split("/")),historyPath:f,summaryPath:f,sitePath:u}}e.exports={entryFromResults:entryFromResults,latestMatchingPlatforms:latestMatchingPlatforms,migrateLegacyData:migrateLegacyData,update:update}},8793:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);function assert(e,t){if(!e)throw new Error(t)}function readJSON(e){try{return JSON.parse(s.readFileSync(e,"utf8"))}catch(t){throw new Error(`read ${e}: ${t.message}`,{cause:t})}}function readJSONIfExists(e,t){if(!s.existsSync(e))return t;return readJSON(e)}function writeJSON(e,t){s.mkdirSync(n.dirname(e),{recursive:true});s.writeFileSync(e,`${JSON.stringify(t,null,2)}\n`)}function walkFiles(e,t){const B=[];if(!s.existsSync(e))return B;const r=[e];while(r.length!==0){const e=r.pop();for(const i of s.readdirSync(e,{withFileTypes:true})){const s=n.join(e,i.name);if(i.isSymbolicLink()){throw new Error(`artifact contains symlink ${s}`)}if(i.isDirectory())r.push(s);else if(i.isFile()&&i.name===t)B.push(s)}}return B.sort()}function median(e){assert(e.length!==0,"cannot calculate an empty median");const t=e.toSorted((e,t)=>e-t);const B=Math.floor(t.length/2);return t.length%2===0?(t[B-1]+t[B])/2:t[B]}function safePart(e){return/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)}function hasControl(e){return[...e].some(e=>{const t=e.codePointAt(0);return t<=31||t===127})}function compareText(e,t){return et?1:0}function writeOutputs(e,t){if(!e)return;let B="";for(const[e,s]of Object.entries(t).sort()){assert(!/[\r\n]/.test(e+s),`GitHub output ${e} contains a newline`);B+=`${e}=${s}\n`}s.appendFileSync(e,B)}e.exports={assert:assert,compareText:compareText,hasControl:hasControl,median:median,readJSON:readJSON,readJSONIfExists:readJSONIfExists,safePart:safePart,walkFiles:walkFiles,writeJSON:writeJSON,writeOutputs:writeOutputs}},7675:(e,t,B)=>{"use strict";const{RE2JS:s}=B(6472);const{assert:n,hasControl:r,safePart:i}=B(8793);const a=new Set(["platform","package","group","benchmark","metric"]);const o=new Set(["auto","number","bytes","duration-ns","duration-us","duration-ms","duration-s"]);function keys(e,t,B){for(const s of Object.keys(e)){n(t.has(s),`${B} has unsupported field ${s}`)}}function text(e,t,B=120){n(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e&&!r(e),`${t} must be a trimmed string of 1..${B} bytes`);return e}function stringList(e,t){if(e===undefined||e===null||e==="")return[];const B=typeof e==="string"?[e]:e;n(Array.isArray(B)&&B.every(e=>typeof e==="string"),`${t} must be a string or string list`);return B}function patterns(e,t){return stringList(e,t).map(e=>{try{return{source:e,compiled:s.compile(e)}}catch(B){throw new Error(`${t} pattern ${JSON.stringify(e)}: ${B.message}`,{cause:B})}})}function dimensionList(e,t,B){const s=e===undefined?t:stringList(e,B);n(s.length>0,`${B} must not be empty`);const r=new Set;for(const e of s){n(a.has(e),`${B} has unsupported dimension ${e}`);n(!r.has(e),`${B} repeats dimension ${e}`);r.add(e)}return s}function parseDimensionOptions(e,t){n(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);const B={};for(const[s,r]of Object.entries(e)){n(a.has(s),`${t} has unknown ${s}`);const e=typeof r==="string"?{title:r}:r;n(e&&typeof e==="object"&&!Array.isArray(e),`${t}.${s} must be a title or mapping`);keys(e,new Set(["title","trim-prefix"]),`${t}.${s}`);B[s]={...e.title===undefined?{}:{title:text(e.title,`${t}.${s}.title`)},...e["trim-prefix"]===undefined?{}:{trimPrefix:text(e["trim-prefix"],`${t}.${s}.trim-prefix`,300)}}}return B}function parseMetrics(e,t){n(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);const B={};for(const[s,r]of Object.entries(e)){const e=typeof r==="string"?{title:r}:r;n(s.length>0&&Buffer.byteLength(s)<=64,`${t} has invalid metric ${JSON.stringify(s)}`);n(e&&typeof e==="object"&&!Array.isArray(e),`${t}.${s} must be a title or mapping`);keys(e,new Set(["title","format"]),`${t}.${s}`);const i=e.format??"auto";n(o.has(i),`${t}.${s}.format has unsupported value ${i}`);B[s]={title:text(e.title??s,`${t}.${s}.title`),format:i}}return B}function serializeDimensionOptions(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t.title===undefined?{}:{title:t.title},...t.trimPrefix===undefined?{}:{"trim-prefix":t.trimPrefix}}]))}class View{constructor(e,t){n(i(e)&&e===e.toLowerCase(),`invalid view id ${JSON.stringify(e)}`);n(t&&typeof t==="object"&&!Array.isArray(t),`view ${e} must be a mapping`);keys(t,new Set(["title","select","table"]),`view ${e}`);this.id=e;this.title=text(t.title??e,`view ${e} title`);const B=t.select??{};n(B&&typeof B==="object"&&!Array.isArray(B),`view ${e} select must be a mapping`);keys(B,new Set(["platforms","packages","groups","benchmarks","metrics"]),`view ${e} select`);this.select={};this.compiledSelect={};for(const t of["platforms","packages","groups","benchmarks","metrics"]){const s=patterns(B[t],`view ${e} select.${t}`);this.select[t]=s.map(e=>e.source);this.compiledSelect[t]=s.map(e=>e.compiled)}const s=t.table??{};n(s&&typeof s==="object"&&!Array.isArray(s),`view ${e} table must be a mapping`);keys(s,new Set(["rows","columns","split-by","collapsed","missing","empty","max-rows","dimensions","metrics"]),`view ${e} table`);this.rows=dimensionList(s.rows,["platform","benchmark"],`view ${e} table.rows`);this.columns=dimensionList(s.columns,["metric"],`view ${e} table.columns`);this.splitBy=s["split-by"]===undefined?[]:dimensionList(s["split-by"],[],`view ${e} table.split-by`);const r=new Set;for(const t of[...this.rows,...this.columns,...this.splitBy]){n(!r.has(t),`view ${e} uses dimension ${t} more than once`);r.add(t)}this.collapsed=s.collapsed??false;n(typeof this.collapsed==="boolean",`view ${e} table.collapsed must be boolean`);this.missing=s.missing??"blank";n(this.missing==="blank"||this.missing==="error",`view ${e} table.missing must be blank or error`);this.empty=s.empty??"hide";n(this.empty==="hide"||this.empty==="error",`view ${e} table.empty must be hide or error`);this.maxRows=s["max-rows"]??200;n(Number.isInteger(this.maxRows)&&this.maxRows>=1&&this.maxRows<=1e3,`view ${e} table.max-rows must be between 1 and 1000`);this.dimensionOptions=parseDimensionOptions(s.dimensions??{},`view ${e} table.dimensions`);this.metrics=parseMetrics(s.metrics??{},`view ${e} table.metrics`)}matches(e){const t={platforms:[e.dimensions.platform.key,e.dimensions.platform.label],packages:[e.dimensions.package.key],groups:[e.dimensions.group.key,e.dimensions.group.label],benchmarks:[e.dimensions.benchmark.key,e.dimensions.benchmark.label,e.dimensions.benchmark.label.replace(/^Benchmark/u,"")],metrics:[e.dimensions.metric.key]};return Object.entries(this.compiledSelect).every(([e,B])=>B.length===0||B.some(B=>t[e].some(e=>B.matcher(e).find())))}toJSON(){return{title:this.title,select:Object.fromEntries(Object.entries(this.select).filter(([,e])=>e.length>0)),table:{rows:this.rows,columns:this.columns,...this.splitBy.length>0?{"split-by":this.splitBy}:{},collapsed:this.collapsed,missing:this.missing,empty:this.empty,"max-rows":this.maxRows,...Object.keys(this.dimensionOptions).length>0?{dimensions:serializeDimensionOptions(this.dimensionOptions)}:{},...Object.keys(this.metrics).length>0?{metrics:this.metrics}:{}}}}}function parseViews(e){if(e===undefined||e===null)return{};n(e&&typeof e==="object"&&!Array.isArray(e),"views must be a mapping");return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,new View(e,t)]))}function serializeViews(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.toJSON()]))}e.exports={parseViews:parseViews,serializeViews:serializeViews}},6919:(e,t,B)=>{"use strict";const{benchmarkKey:s}=B(8817);const{benchmarkIndex:n,isIndexPaired:r,metricComparison:i}=B(4408);const{delta:a,formatDelta:o,formatNumber:l,formatPreciseNumber:c,formatSigned:C,markdown:u,tableCell:f}=B(4217);const{assert:h,compareText:p}=B(8793);const g={platform:"Platform",package:"Package",group:"Group",benchmark:"Benchmark",metric:"Metric"};function groupTitle(e,t){if(t==="other")return"Other";return e.groups[t]?.title??t}function observations(e,t,B,a){const o=[];for(const l of Object.keys(t.platforms).sort(p)){const c=t.platforms[l];const C=B?.platforms?.[l];const u=n(C);const f=r(c,C,a);for(const t of c.benchmarks){const B=s(t);for(const s of Object.keys(t.measurements).sort(p)){const n=i(t,u.get(B),s,f);o.push({dimensions:{platform:{key:l,label:c.platform.label},package:{key:t.package??"",label:t.package||"(root)"},group:{key:t.group,label:groupTitle(e,t.group)},benchmark:{key:B,label:t.name},metric:{key:s,label:s}},value:t.measurements[s],...n,better:c.units?.[s]?.better})}}}return o}function tuple(e,t){return t.map(t=>e.dimensions[t])}function tupleKey(e){return JSON.stringify(e.map(e=>e.key))}function trim(e,t){return t&&e.startsWith(t)?e.slice(t.length):e}function tupleLabels(e,t,B){return e.map((e,s)=>{const n=t[s];if(n==="metric"){return B.metrics[e.key]?.title??e.label}return trim(e.label,B.dimensionOptions[n]?.trimPrefix)})}function dimensionTitle(e,t){return e.dimensionOptions[t]?.title??g[t]}function formatDuration(e,t,B=l){const s=e*{ns:1,us:1e3,ms:1e6,s:1e9}[t];if(s>=1e9)return`${B(s/1e9)} s`;if(s>=1e6)return`${B(s/1e6)} ms`;if(s>=1e3)return`${B(s/1e3)} us`;return`${B(s)} ns`}function formatValue(e,t,B,s=l){const n=B.metrics[t]?.format??"auto";if(n==="number")return s(e);if(n==="bytes")return`${s(e)} B`;if(n.startsWith("duration-")){return formatDuration(e,n.slice("duration-".length),s)}return`${s(e)} ${t}`}function metricRank(e,t){const B=Object.keys(e.metrics).indexOf(t.key);return B===-1?Number.MAX_SAFE_INTEGER:B}function compareTuple(e,t,B,s){for(let n=0;ncompareTuple(e,s,t,B))}function splitTitle(e,t){return e.map((e,B)=>`${dimensionTitle(t,t.splitBy[B])}: ${tupleLabels([e],[t.splitBy[B]],t)[0]}`).join(" / ")}function renderTable(e,t,B){const s=uniqueTuples(e,t.rows,t);const n=uniqueTuples(e,t.columns,t);h(s.length<=t.maxRows,`view ${t.id} has ${s.length} rows, exceeding max-rows ${t.maxRows}`);const r=new Map;for(const B of e){const e=tupleKey(tuple(B,t.rows));const s=tupleKey(tuple(B,t.columns));const n=`${e}\n${s}`;h(!r.has(n),`view ${t.id} has duplicate cell ${n}`);r.set(n,B)}const i=t.rows.map(e=>dimensionTitle(t,e));for(const e of n){const s=tupleLabels(e,t.columns,t);i.push(s.join(" / "),B)}const l=[`| ${i.map(f).join(" | ")} |`,`|${t.rows.map(()=>"---").join("|")}|${n.map(()=>"---:|---:").join("|")}|`];for(const e of s){const B=tupleLabels(e,t.rows,t).map(f);for(const s of n){const n=`${tupleKey(e)}\n${tupleKey(s)}`;const i=r.get(n);if(!i){h(t.missing==="blank",`view ${t.id} is missing cell ${n}`);B.push("-","-");continue}const l=i.change===undefined?a(i.value,i.baseline,i.better):o(i.change,i.better);const u=i.difference===undefined?l:`${C(i.difference,e=>formatValue(e,i.dimensions.metric.key,t,c))} / ${l}`;B.push(formatValue(i.value,i.dimensions.metric.key,t),u)}l.push(`| ${B.map(f).join(" | ")} |`)}return l}function renderView(e,t,B){const s=t.filter(t=>e.matches(t));if(s.length===0){h(e.empty==="hide",`view ${e.id} has no matching results`);return[]}const n=e.splitBy.length===0?[[]]:uniqueTuples(s,e.splitBy,e);const r=[];for(const t of n){const n=e.splitBy.length===0?s:s.filter(B=>tupleKey(tuple(B,e.splitBy))===tupleKey(t));if(t.length>0)r.push(`#### ${u(splitTitle(t,e))}`,"");r.push(...renderTable(n,e,B),"")}if(!e.collapsed){return[`### ${u(e.title)}`,"",...r]}return["
",`${u(e.title)}`,"",...r,"
",""]}function renderViews(e,t,B,s="vs main",n=false){const r=observations(e,t,B,n);return Object.values(e.views).flatMap(e=>renderView(e,r,s))}e.exports={renderViews:renderViews}},181:e=>{"use strict";e.exports=require("buffer")},3024:e=>{"use strict";e.exports=require("node:fs")},8161:e=>{"use strict";e.exports=require("node:os")},6760:e=>{"use strict";e.exports=require("node:path")},3136:e=>{"use strict";e.exports=require("node:url")},7975:e=>{"use strict";e.exports=require("node:util")},932:e=>{"use strict";e.exports=require("process")},7349:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(4454);var i=B(2223);var a=B(7103);var o=B(334);var l=B(3142);function resolveCollection(e,t,B,s,n,r){const i=B.type==="block-map"?a.resolveBlockMap(e,t,B,s,r):B.type==="block-seq"?o.resolveBlockSeq(e,t,B,s,r):l.resolveFlowCollection(e,t,B,s,r);const c=i.constructor;if(n==="!"||n===c.tagName){i.tag=c.tagName;return i}if(n)i.tag=n;return i}function composeCollection(e,t,B,a,o){const l=a.tag;const c=!l?null:t.directives.tagName(l.source,e=>o(l,"TAG_RESOLVE_FAILED",e));if(B.type==="block-seq"){const{anchor:e,newlineAfterProp:t}=a;const B=e&&l?e.offset>l.offset?e:l:e??l;if(B&&(!t||t.offsete.tag===c&&e.collection===C);if(!u){const s=t.schema.knownTags[c];if(s?.collection===C){t.schema.tags.push(Object.assign({},s,{default:false}));u=s}else{if(s){o(l,"BAD_COLLECTION_TYPE",`${s.tag} used for ${C} collection, but expects ${s.collection??"scalar"}`,true)}else{o(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,true)}return resolveCollection(e,t,B,o,c)}}const f=resolveCollection(e,t,B,o,c,u);const h=u.resolve?.(f,e=>o(l,"TAG_RESOLVE_FAILED",e),t.options)??f;const p=s.isNode(h)?h:new n.Scalar(h);p.range=f.range;p.tag=c;if(u?.format)p.format=u.format;return p}t.composeCollection=composeCollection},3683:(e,t,B)=>{"use strict";var s=B(3021);var n=B(5937);var r=B(7788);var i=B(4631);function composeDoc(e,t,{offset:B,start:a,value:o,end:l},c){const C=Object.assign({_directives:t},e);const u=new s.Document(undefined,C);const f={atKey:false,atRoot:true,directives:u.directives,options:u.options,schema:u.schema};const h=i.resolveProps(a,{indicator:"doc-start",next:o??l?.[0],offset:B,onError:c,parentIndent:0,startOnNewline:true});if(h.found){u.directives.docStart=true;if(o&&(o.type==="block-map"||o.type==="block-seq")&&!h.hasNewline)c(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}u.contents=o?n.composeNode(f,o,h,c):n.composeEmptyNode(f,h.end,a,null,h,c);const p=u.contents.range[2];const g=r.resolveEnd(l,p,false,c);if(g.comment)u.comment=g.comment;u.range=[B,p,g.offset];return u}t.composeDoc=composeDoc},5937:(e,t,B)=>{"use strict";var s=B(4065);var n=B(1127);var r=B(7349);var i=B(5413);var a=B(7788);var o=B(2599);const l={composeNode:composeNode,composeEmptyNode:composeEmptyNode};function composeNode(e,t,B,s){const a=e.atKey;const{spaceBefore:o,comment:c,anchor:C,tag:u}=B;let f;let h=true;switch(t.type){case"alias":f=composeAlias(e,t,s);if(C||u)s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=i.composeScalar(e,t,u,s);if(C)f.anchor=C.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{f=r.composeCollection(l,e,t,B,s);if(C)f.anchor=C.source.substring(1)}catch(e){const B=e instanceof Error?e.message:String(e);s(t,"RESOURCE_EXHAUSTION",B)}break;default:{const e=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",e);h=false}}f??(f=composeEmptyNode(e,t.offset,undefined,null,B,s));if(C&&f.anchor==="")s(C,"BAD_ALIAS","Anchor cannot be an empty string");if(a&&e.options.stringKeys&&(!n.isScalar(f)||typeof f.value!=="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")){const e="With stringKeys, all keys must be strings";s(u??t,"NON_STRING_KEY",e)}if(o)f.spaceBefore=true;if(c){if(t.type==="scalar"&&t.source==="")f.comment=c;else f.commentBefore=c}if(e.options.keepSourceTokens&&h)f.srcToken=t;return f}function composeEmptyNode(e,t,B,s,{spaceBefore:n,comment:r,anchor:a,tag:l,end:c},C){const u={type:"scalar",offset:o.emptyScalarPosition(t,B,s),indent:-1,source:""};const f=i.composeScalar(e,u,l,C);if(a){f.anchor=a.source.substring(1);if(f.anchor==="")C(a,"BAD_ALIAS","Anchor cannot be an empty string")}if(n)f.spaceBefore=true;if(r){f.comment=r;f.range[2]=c}return f}function composeAlias({options:e},{offset:t,source:B,end:n},r){const i=new s.Alias(B.substring(1));if(i.source==="")r(t,"BAD_ALIAS","Alias cannot be an empty string");if(i.source.endsWith(":"))r(t+B.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);const o=t+B.length;const l=a.resolveEnd(n,o,e.strict,r);i.range=[t,o,l.offset];if(l.comment)i.comment=l.comment;return i}t.composeEmptyNode=composeEmptyNode;t.composeNode=composeNode},5413:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(8913);var i=B(6842);function composeScalar(e,t,B,a){const{value:o,type:l,comment:c,range:C}=t.type==="block-scalar"?r.resolveBlockScalar(e,t,a):i.resolveFlowScalar(t,e.options.strict,a);const u=B?e.directives.tagName(B.source,e=>a(B,"TAG_RESOLVE_FAILED",e)):null;let f;if(e.options.stringKeys&&e.atKey){f=e.schema[s.SCALAR]}else if(u)f=findScalarTagByName(e.schema,o,u,B,a);else if(t.type==="scalar")f=findScalarTagByTest(e,o,t,a);else f=e.schema[s.SCALAR];let h;try{const r=f.resolve(o,e=>a(B??t,"TAG_RESOLVE_FAILED",e),e.options);h=s.isScalar(r)?r:new n.Scalar(r)}catch(e){const s=e instanceof Error?e.message:String(e);a(B??t,"TAG_RESOLVE_FAILED",s);h=new n.Scalar(o)}h.range=C;h.source=o;if(l)h.type=l;if(u)h.tag=u;if(f.format)h.format=f.format;if(c)h.comment=c;return h}function findScalarTagByName(e,t,B,n,r){if(B==="!")return e[s.SCALAR];const i=[];for(const t of e.tags){if(!t.collection&&t.tag===B){if(t.default&&t.test)i.push(t);else return t}}for(const e of i)if(e.test?.test(t))return e;const a=e.knownTags[B];if(a&&!a.collection){e.tags.push(Object.assign({},a,{default:false,test:undefined}));return a}r(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${B}`,B!=="tag:yaml.org,2002:str");return e[s.SCALAR]}function findScalarTagByTest({atKey:e,directives:t,schema:B},n,r,i){const a=B.tags.find(t=>(t.default===true||e&&t.default==="key")&&t.test?.test(n))||B[s.SCALAR];if(B.compat){const e=B.compat.find(e=>e.default&&e.test?.test(n))??B[s.SCALAR];if(a.tag!==e.tag){const B=t.tagString(a.tag);const s=t.tagString(e.tag);const n=`Value may be parsed as either ${B} or ${s}`;i(r,"TAG_RESOLVE_FAILED",n,true)}}return a}t.composeScalar=composeScalar},9984:(e,t,B)=>{"use strict";var s=B(932);var n=B(1342);var r=B(3021);var i=B(1464);var a=B(1127);var o=B(3683);var l=B(7788);function getErrorPos(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:B}=e;return[t,t+(typeof B==="string"?B.length:1)]}function parsePrelude(e){let t="";let B=false;let s=false;for(let n=0;n{const n=getErrorPos(e);if(s)this.warnings.push(new i.YAMLWarning(n,t,B));else this.errors.push(new i.YAMLParseError(n,t,B))};this.directives=new n.Directives({version:e.version||"1.2"});this.options=e}decorate(e,t){const{comment:B,afterEmptyLine:s}=parsePrelude(this.prelude);if(B){const n=e.contents;if(t){e.comment=e.comment?`${e.comment}\n${B}`:B}else if(s||e.directives.docStart||!n){e.commentBefore=B}else if(a.isCollection(n)&&!n.flow&&n.items.length>0){let e=n.items[0];if(a.isPair(e))e=e.key;const t=e.commentBefore;e.commentBefore=t?`${B}\n${t}`:B}else{const e=n.commentBefore;n.commentBefore=e?`${B}\n${e}`:B}}if(t){for(let t=0;t{const n=getErrorPos(e);n[0]+=t;this.onError(n,"BAD_DIRECTIVE",B,s)});this.prelude.push(e.source);this.atDirectives=true;break;case"document":{const t=o.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");this.decorate(t,false);if(this.doc)yield this.doc;this.doc=t;this.atDirectives=false;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message;const B=new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(B);else this.doc.errors.push(B);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=true;const t=l.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);this.decorate(this.doc,true);if(t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=false,t=-1){if(this.doc){this.decorate(this.doc,true);yield this.doc;this.doc=null}else if(e){const e=Object.assign({_directives:this.directives},this.options);const B=new r.Document(undefined,e);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");B.range=[0,t,t];this.decorate(B,false);yield B}}}t.Composer=Composer},7103:(e,t,B)=>{"use strict";var s=B(7165);var n=B(4454);var r=B(4631);var i=B(9499);var a=B(4051);var o=B(1187);const l="All mapping items must start at the same column";function resolveBlockMap({composeNode:e,composeEmptyNode:t},B,c,C,u){const f=u?.nodeClass??n.YAMLMap;const h=new f(B.schema);if(B.atRoot)B.atRoot=false;let p=c.offset;let g=null;for(const n of c.items){const{start:u,key:f,sep:m,value:d}=n;const D=r.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:p,onError:C,parentIndent:c.indent,startOnNewline:true});const E=!D.found;if(E){if(f){if(f.type==="block-seq")C(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==c.indent)C(p,"BAD_INDENT",l)}if(!D.anchor&&!D.tag&&!m){g=D.end;if(D.comment){if(h.comment)h.comment+="\n"+D.comment;else h.comment=D.comment}continue}if(D.newlineAfterProp||i.containsNewline(f)){C(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}}else if(D.found?.indent!==c.indent){C(p,"BAD_INDENT",l)}B.atKey=true;const y=D.end;const b=f?e(B,f,D,C):t(B,y,u,null,D,C);if(B.schema.compat)a.flowIndentCheck(c.indent,f,C);B.atKey=false;if(o.mapIncludes(B,h.items,b))C(y,"DUPLICATE_KEY","Map keys must be unique");const O=r.resolveProps(m??[],{indicator:"map-value-ind",next:d,offset:b.range[2],onError:C,parentIndent:c.indent,startOnNewline:!f||f.type==="block-scalar"});p=O.end;if(O.found){if(E){if(d?.type==="block-map"&&!O.hasNewline)C(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(B.options.strict&&D.start{"use strict";var s=B(3301);function resolveBlockScalar(e,t,B){const n=t.offset;const r=parseBlockScalarHeader(t,e.options.strict,B);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};const i=r.mode===">"?s.Scalar.BLOCK_FOLDED:s.Scalar.BLOCK_LITERAL;const a=t.source?splitLines(t.source):[];let o=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(t===""||t==="\r")o=e;else break}if(o===0){const e=r.chomp==="+"&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let B=n+r.length;if(t.source)B+=t.source.length;return{value:e,type:i,comment:r.comment,range:[n,B,B]}}let l=t.indent+r.indent;let c=t.offset+r.length;let C=0;for(let t=0;tl)l=s.length}else{if(s.length=o;--e){if(a[e][0].length>l)o=e+1}let u="";let f="";let h=false;for(let e=0;el||n[0]==="\t"){if(f===" ")f="\n";else if(!h&&f==="\n")f="\n\n";u+=f+t.slice(l)+n;f="\n";h=true}else if(n===""){if(f==="\n")u+="\n";else f="\n"}else{u+=f+n;f=" ";h=false}}switch(r.chomp){case"-":break;case"+":for(let e=o;e{"use strict";var s=B(2223);var n=B(4631);var r=B(4051);function resolveBlockSeq({composeNode:e,composeEmptyNode:t},B,i,a,o){const l=o?.nodeClass??s.YAMLSeq;const c=new l(B.schema);if(B.atRoot)B.atRoot=false;if(B.atKey)B.atKey=false;let C=i.offset;let u=null;for(const{start:s,value:o}of i.items){const l=n.resolveProps(s,{indicator:"seq-item-ind",next:o,offset:C,onError:a,parentIndent:i.indent,startOnNewline:true});if(!l.found){if(l.anchor||l.tag||o){if(o?.type==="block-seq")a(l.end,"BAD_INDENT","All sequence items must start at the same column");else a(C,"MISSING_CHAR","Sequence item without - indicator")}else{u=l.end;if(l.comment)c.comment=l.comment;continue}}const f=o?e(B,o,l,a):t(B,l.end,s,null,l,a);if(B.schema.compat)r.flowIndentCheck(i.indent,o,a);C=f.range[2];c.items.push(f)}c.range=[i.offset,C,u??C];return c}t.resolveBlockSeq=resolveBlockSeq},7788:(e,t)=>{"use strict";function resolveEnd(e,t,B,s){let n="";if(e){let r=false;let i="";for(const a of e){const{source:e,type:o}=a;switch(o){case"space":r=true;break;case"comment":{if(B&&!r)s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";if(!n)n=t;else n+=i+t;i="";break}case"newline":if(n)i+=e;r=true;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${o} at node end`)}t+=e.length}}return{comment:n,offset:t}}t.resolveEnd=resolveEnd},3142:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(4454);var i=B(2223);var a=B(7788);var o=B(4631);var l=B(9499);var c=B(1187);const C="Block collections are not allowed within flow collections";const isBlock=e=>e&&(e.type==="block-map"||e.type==="block-seq");function resolveFlowCollection({composeNode:e,composeEmptyNode:t},B,u,f,h){const p=u.start.source==="{";const g=p?"flow map":"flow sequence";const m=h?.nodeClass??(p?r.YAMLMap:i.YAMLSeq);const d=new m(B.schema);d.flow=true;const D=B.atRoot;if(D)B.atRoot=false;if(B.atKey)B.atKey=false;let E=u.offset+u.start.source.length;for(let i=0;i0){const e=a.resolveEnd(O,w,B.options.strict,f);if(e.comment){if(d.comment)d.comment+="\n"+e.comment;else d.comment=e.comment}d.range=[u.offset,w,e.offset]}else{d.range=[u.offset,w,w]}return d}t.resolveFlowCollection=resolveFlowCollection},6842:(e,t,B)=>{"use strict";var s=B(3301);var n=B(7788);function resolveFlowScalar(e,t,B){const{offset:r,type:i,source:a,end:o}=e;let l;let c;const _onError=(e,t,s)=>B(r+e,t,s);switch(i){case"scalar":l=s.Scalar.PLAIN;c=plainValue(a,_onError);break;case"single-quoted-scalar":l=s.Scalar.QUOTE_SINGLE;c=singleQuotedValue(a,_onError);break;case"double-quoted-scalar":l=s.Scalar.QUOTE_DOUBLE;c=doubleQuotedValue(a,_onError);break;default:B(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`);return{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const C=r+a.length;const u=n.resolveEnd(o,C,t,B);return{value:c,type:l,comment:u.comment,range:[r,C,u.offset]}}function plainValue(e,t){let B="";switch(e[0]){case"\t":B="a tab character";break;case",":B="flow indicator character ,";break;case"%":B="directive indicator character %";break;case"|":case">":{B=`block scalar indicator ${e[0]}`;break}case"@":case"`":{B=`reserved character ${e[0]}`;break}}if(B)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${B}`);return foldLines(e)}function singleQuotedValue(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return foldLines(e.slice(1,-1)).replace(/''/g,"'")}function foldLines(e){let t,B;try{t=new RegExp("(.*?)(?t?e.slice(t,s+1):n}else{B+=n}}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return B}function foldNewline(e,t){let B="";let s=e[t+1];while(s===" "||s==="\t"||s==="\n"||s==="\r"){if(s==="\r"&&e[t+2]!=="\n")break;if(s==="\n")B+="\n";t+=1;s=e[t+1]}if(!B)B=" ";return{fold:B,offset:t}}const r={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function parseCharCode(e,t,B,s){const n=e.substr(t,B);const r=n.length===B&&/^[0-9a-fA-F]+$/.test(n);const i=r?parseInt(n,16):NaN;try{return String.fromCodePoint(i)}catch{const n=e.substr(t-2,B+2);s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${n}`);return n}}t.resolveFlowScalar=resolveFlowScalar},4631:(e,t)=>{"use strict";function resolveProps(e,{flow:t,indicator:B,next:s,offset:n,onError:r,parentIndent:i,startOnNewline:a}){let o=false;let l=a;let c=a;let C="";let u="";let f=false;let h=false;let p=null;let g=null;let m=null;let d=null;let D=null;let E=null;let y=null;for(const n of e){if(h){if(n.type!=="space"&&n.type!=="newline"&&n.type!=="comma")r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");h=false}if(p){if(l&&n.type!=="comment"&&n.type!=="newline"){r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation")}p=null}switch(n.type){case"space":if(!t&&(B!=="doc-start"||s?.type!=="flow-collection")&&n.source.includes("\t")){p=n}c=true;break;case"comment":{if(!c)r(n,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=n.source.substring(1)||" ";if(!C)C=e;else C+=u+e;u="";l=false;break}case"newline":if(l){if(C)C+=n.source;else if(!E||B!=="seq-item-ind")o=true}else u+=n.source;l=true;f=true;if(g||m)d=n;c=true;break;case"anchor":if(g)r(n,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(n.source.endsWith(":"))r(n.offset+n.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true);g=n;y??(y=n.offset);l=false;c=false;h=true;break;case"tag":{if(m)r(n,"MULTIPLE_TAGS","A node can have at most one tag");m=n;y??(y=n.offset);l=false;c=false;h=true;break}case B:if(g||m)r(n,"BAD_PROP_ORDER",`Anchors and tags must be after the ${n.source} indicator`);if(E)r(n,"UNEXPECTED_TOKEN",`Unexpected ${n.source} in ${t??"collection"}`);E=n;l=B==="seq-item-ind"||B==="explicit-key-ind";c=false;break;case"comma":if(t){if(D)r(n,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);D=n;l=false;c=false;break}default:r(n,"UNEXPECTED_TOKEN",`Unexpected ${n.type} token`);l=false;c=false}}const b=e[e.length-1];const O=b?b.offset+b.source.length:n;if(h&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")){r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space")}if(p&&(l&&p.indent<=i||s?.type==="block-map"||s?.type==="block-seq"))r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:E,spaceBefore:o,comment:C,hasNewline:f,anchor:g,tag:m,newlineAfterProp:d,end:O,start:y??O}}t.resolveProps=resolveProps},9499:(e,t)=>{"use strict";function containsNewline(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return true;if(e.end)for(const t of e.end)if(t.type==="newline")return true;return false;case"flow-collection":for(const t of e.items){for(const e of t.start)if(e.type==="newline")return true;if(t.sep)for(const e of t.sep)if(e.type==="newline")return true;if(containsNewline(t.key)||containsNewline(t.value))return true}return false;default:return true}}t.containsNewline=containsNewline},2599:(e,t)=>{"use strict";function emptyScalarPosition(e,t,B){if(t){B??(B=t.length);for(let s=B-1;s>=0;--s){let B=t[s];switch(B.type){case"space":case"comment":case"newline":e-=B.source.length;continue}B=t[++s];while(B?.type==="space"){e+=B.source.length;B=t[++s]}break}}return e}t.emptyScalarPosition=emptyScalarPosition},4051:(e,t,B)=>{"use strict";var s=B(9499);function flowIndentCheck(e,t,B){if(t?.type==="flow-collection"){const n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&s.containsNewline(t)){const e="Flow end indicator should be more indented than parent";B(n,"BAD_INDENT",e,true)}}}t.flowIndentCheck=flowIndentCheck},1187:(e,t,B)=>{"use strict";var s=B(1127);function mapIncludes(e,t,B){const{uniqueKeys:n}=e.options;if(n===false)return false;const r=typeof n==="function"?n:(e,t)=>e===t||s.isScalar(e)&&s.isScalar(t)&&e.value===t.value;return t.some(e=>r(e.key,B))}t.mapIncludes=mapIncludes},3021:(e,t,B)=>{"use strict";var s=B(4065);var n=B(101);var r=B(1127);var i=B(7165);var a=B(4043);var o=B(5840);var l=B(6829);var c=B(1596);var C=B(3661);var u=B(2404);var f=B(1342);class Document{constructor(e,t,B){this.commentBefore=null;this.comment=null;this.errors=[];this.warnings=[];Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let s=null;if(typeof t==="function"||Array.isArray(t)){s=t}else if(B===undefined&&t){B=t;t=undefined}const n=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},B);this.options=n;let{version:i}=n;if(B?._directives){this.directives=B._directives.atDocument();if(this.directives.yaml.explicit)i=this.directives.yaml.version}else this.directives=new f.Directives({version:i});this.setSchema(i,B);this.contents=e===undefined?null:this.createNode(e,s,B)}clone(){const e=Object.create(Document.prototype,{[r.NODE_TYPE]:{value:r.DOC}});e.commentBefore=this.commentBefore;e.comment=this.comment;e.errors=this.errors.slice();e.warnings=this.warnings.slice();e.options=Object.assign({},this.options);if(this.directives)e.directives=this.directives.clone();e.schema=this.schema.clone();e.contents=r.isNode(this.contents)?this.contents.clone(e.schema):this.contents;if(this.range)e.range=this.range.slice();return e}add(e){if(assertCollection(this.contents))this.contents.add(e)}addIn(e,t){if(assertCollection(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const B=c.anchorNames(this);e.anchor=!t||B.has(t)?c.findNewAnchor(t||"a",B):t}return new s.Alias(e.anchor)}createNode(e,t,B){let s=undefined;if(typeof t==="function"){e=t.call({"":e},"",e);s=t}else if(Array.isArray(t)){const keyToStr=e=>typeof e==="number"||e instanceof String||e instanceof Number;const e=t.filter(keyToStr).map(String);if(e.length>0)t=t.concat(e);s=t}else if(B===undefined&&t){B=t;t=undefined}const{aliasDuplicateObjects:n,anchorPrefix:i,flow:a,keepUndefined:o,onTagObj:l,tag:C}=B??{};const{onAnchor:f,setAnchors:h,sourceObjects:p}=c.createNodeAnchors(this,i||"a");const g={aliasDuplicateObjects:n??true,keepUndefined:o??false,onAnchor:f,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:p};const m=u.createNode(e,C,g);if(a&&r.isCollection(m))m.flow=true;h();return m}createPair(e,t,B={}){const s=this.createNode(e,null,B);const n=this.createNode(t,null,B);return new i.Pair(s,n)}delete(e){return assertCollection(this.contents)?this.contents.delete(e):false}deleteIn(e){if(n.isEmptyPath(e)){if(this.contents==null)return false;this.contents=null;return true}return assertCollection(this.contents)?this.contents.deleteIn(e):false}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):undefined}getIn(e,t){if(n.isEmptyPath(e))return!t&&r.isScalar(this.contents)?this.contents.value:this.contents;return r.isCollection(this.contents)?this.contents.getIn(e,t):undefined}has(e){return r.isCollection(this.contents)?this.contents.has(e):false}hasIn(e){if(n.isEmptyPath(e))return this.contents!==undefined;return r.isCollection(this.contents)?this.contents.hasIn(e):false}set(e,t){if(this.contents==null){this.contents=n.collectionFromPath(this.schema,[e],t)}else if(assertCollection(this.contents)){this.contents.set(e,t)}}setIn(e,t){if(n.isEmptyPath(e)){this.contents=t}else if(this.contents==null){this.contents=n.collectionFromPath(this.schema,Array.from(e),t)}else if(assertCollection(this.contents)){this.contents.setIn(e,t)}}setSchema(e,t={}){if(typeof e==="number")e=String(e);let B;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new f.Directives({version:"1.1"});B={resolveKnownTags:false,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new f.Directives({version:e});B={resolveKnownTags:true,schema:"core"};break;case null:if(this.directives)delete this.directives;B=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(B)this.schema=new o.Schema(Object.assign(B,t));else throw new Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:B,maxAliasCount:s,onAnchor:n,reviver:r}={}){const i={anchors:new Map,doc:this,keep:!e,mapAsMap:B===true,mapKeyWarned:false,maxAliasCount:typeof s==="number"?s:100};const o=a.toJS(this.contents,t??"",i);if(typeof n==="function")for(const{count:e,res:t}of i.anchors.values())n(t,e);return typeof r==="function"?C.applyReviver(r,{"":o},"",o):o}toJSON(e,t){return this.toJS({json:true,jsonArg:e,mapAsMap:false,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return l.stringifyDocument(this,e)}}function assertCollection(e){if(r.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}t.Document=Document},1596:(e,t,B)=>{"use strict";var s=B(1127);var n=B(204);function anchorIsValid(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);const B=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(B)}return true}function anchorNames(e){const t=new Set;n.visit(e,{Value(e,B){if(B.anchor)t.add(B.anchor)}});return t}function findNewAnchor(e,t){for(let B=1;true;++B){const s=`${e}${B}`;if(!t.has(s))return s}}function createNodeAnchors(e,t){const B=[];const n=new Map;let r=null;return{onAnchor:s=>{B.push(s);r??(r=anchorNames(e));const n=findNewAnchor(t,r);r.add(n);return n},setAnchors:()=>{for(const e of B){const t=n.get(e);if(typeof t==="object"&&t.anchor&&(s.isScalar(t.node)||s.isCollection(t.node))){t.node.anchor=t.anchor}else{const t=new Error("Failed to resolve repeated object (this should not happen)");t.source=e;throw t}}},sourceObjects:n}}t.anchorIsValid=anchorIsValid;t.anchorNames=anchorNames;t.createNodeAnchors=createNodeAnchors;t.findNewAnchor=findNewAnchor},3661:(e,t)=>{"use strict";function applyReviver(e,t,B,s){if(s&&typeof s==="object"){if(Array.isArray(s)){for(let t=0,B=s.length;t{"use strict";var s=B(4065);var n=B(1127);var r=B(3301);const i="tag:yaml.org,2002:";function findTagObject(e,t,B){if(t){const e=B.filter(e=>e.tag===t);const s=e.find(e=>!e.format)??e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return B.find(t=>t.identify?.(e)&&!t.format)}function createNode(e,t,B){if(n.isDocument(e))e=e.contents;if(n.isNode(e))return e;if(n.isPair(e)){const t=B.schema[n.MAP].createNode?.(B.schema,null,B);t.items.push(e);return t}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!=="undefined"&&e instanceof BigInt){e=e.valueOf()}const{aliasDuplicateObjects:a,onAnchor:o,onTagObj:l,schema:c,sourceObjects:C}=B;let u=undefined;if(a&&e&&typeof e==="object"){u=C.get(e);if(u){u.anchor??(u.anchor=o(e));return new s.Alias(u.anchor)}else{u={anchor:null,node:null};C.set(e,u)}}if(t?.startsWith("!!"))t=i+t.slice(2);let f=findTagObject(e,t,c.tags);if(!f){if(e&&typeof e.toJSON==="function"){e=e.toJSON()}if(!e||typeof e!=="object"){const t=new r.Scalar(e);if(u)u.node=t;return t}f=e instanceof Map?c[n.MAP]:Symbol.iterator in Object(e)?c[n.SEQ]:c[n.MAP]}if(l){l(f);delete B.onTagObj}const h=f?.createNode?f.createNode(B.schema,e,B):typeof f?.nodeClass?.from==="function"?f.nodeClass.from(B.schema,e,B):new r.Scalar(e);if(t)h.tag=t;else if(!f.default)h.tag=f.tag;if(u)u.node=h;return h}t.createNode=createNode},1342:(e,t,B)=>{"use strict";var s=B(1127);var n=B(204);const r={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};const escapeTagName=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);class Directives{constructor(e,t){this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},Directives.defaultYaml,e);this.tags=Object.assign({},Directives.defaultTags,t)}clone(){const e=new Directives(this.yaml,this.tags);e.docStart=this.docStart;return e}atDocument(){const e=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},Directives.defaultTags);break}return e}add(e,t){if(this.atNextDocument){this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},Directives.defaultTags);this.atNextDocument=false}const B=e.trim().split(/[ \t]+/);const s=B.shift();switch(s){case"%TAG":{if(B.length!==2){t(0,"%TAG directive should contain exactly two parts");if(B.length<2)return false}const[e,s]=B;this.tags[e]=s;return true}case"%YAML":{this.yaml.explicit=true;if(B.length!==1){t(0,"%YAML directive should contain exactly one part");return false}const[e]=B;if(e==="1.1"||e==="1.2"){this.yaml.version=e;return true}else{const B=/^\d+\.\d+$/.test(e);t(6,`Unsupported YAML version ${e}`,B);return false}}default:t(0,`Unknown directive ${s}`,true);return false}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!"){t(`Not a valid tag: ${e}`);return null}if(e[1]==="<"){const B=e.slice(2,-1);if(B==="!"||B==="!!"){t(`Verbatim tags aren't resolved, so ${e} is invalid.`);return null}if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return B}const[,B,s]=e.match(/^(.*!)([^!]*)$/s);if(!s)t(`The ${e} tag has no suffix`);const n=this.tags[B];if(n){try{return n+decodeURIComponent(s)}catch(e){t(String(e));return null}}if(B==="!")return e;t(`Could not resolve tag: ${e}`);return null}tagString(e){for(const[t,B]of Object.entries(this.tags)){if(e.startsWith(B))return t+escapeTagName(e.substring(B.length))}return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[];const B=Object.entries(this.tags);let r;if(e&&B.length>0&&s.isNode(e.contents)){const t={};n.visit(e.contents,(e,B)=>{if(s.isNode(B)&&B.tag)t[B.tag]=true});r=Object.keys(t)}else r=[];for(const[s,n]of B){if(s==="!!"&&n==="tag:yaml.org,2002:")continue;if(!e||r.some(e=>e.startsWith(n)))t.push(`%TAG ${s} ${n}`)}return t.join("\n")}}Directives.defaultYaml={explicit:false,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"};t.Directives=Directives},1464:(e,t)=>{"use strict";class YAMLError extends Error{constructor(e,t,B,s){super();this.name=e;this.code=B;this.message=s;this.pos=t}}class YAMLParseError extends YAMLError{constructor(e,t,B){super("YAMLParseError",e,t,B)}}class YAMLWarning extends YAMLError{constructor(e,t,B){super("YAMLWarning",e,t,B)}}const prettifyError=(e,t)=>B=>{if(B.pos[0]===-1)return;B.linePos=B.pos.map(e=>t.linePos(e));const{line:s,col:n}=B.linePos[0];B.message+=` at line ${s}, column ${n}`;let r=n-1;let i=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&i.length>80){const e=Math.min(r-39,i.length-79);i="…"+i.substring(e);r-=e-1}if(i.length>80)i=i.substring(0,79)+"…";if(s>1&&/^ *$/.test(i.substring(0,r))){let B=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);if(B.length>80)B=B.substring(0,79)+"…\n";i=B+i}if(/[^ ]/.test(i)){let e=1;const t=B.linePos[1];if(t?.line===s&&t.col>n){e=Math.max(1,Math.min(t.col-n,80-r))}const a=" ".repeat(r)+"^".repeat(e);B.message+=`:\n\n${i}\n${a}\n`}};t.YAMLError=YAMLError;t.YAMLParseError=YAMLParseError;t.YAMLWarning=YAMLWarning;t.prettifyError=prettifyError},8815:(e,t,B)=>{"use strict";var s=B(9984);var n=B(3021);var r=B(5840);var i=B(1464);var a=B(4065);var o=B(1127);var l=B(7165);var c=B(3301);var C=B(4454);var u=B(2223);var f=B(3461);var h=B(361);var p=B(6628);var g=B(3456);var m=B(4047);var d=B(204);t.Composer=s.Composer;t.Document=n.Document;t.Schema=r.Schema;t.YAMLError=i.YAMLError;t.YAMLParseError=i.YAMLParseError;t.YAMLWarning=i.YAMLWarning;t.Alias=a.Alias;t.isAlias=o.isAlias;t.isCollection=o.isCollection;t.isDocument=o.isDocument;t.isMap=o.isMap;t.isNode=o.isNode;t.isPair=o.isPair;t.isScalar=o.isScalar;t.isSeq=o.isSeq;t.Pair=l.Pair;t.Scalar=c.Scalar;t.YAMLMap=C.YAMLMap;t.YAMLSeq=u.YAMLSeq;t.CST=f;t.Lexer=h.Lexer;t.LineCounter=p.LineCounter;t.Parser=g.Parser;t.parse=m.parse;t.parseAllDocuments=m.parseAllDocuments;t.parseDocument=m.parseDocument;t.stringify=m.stringify;t.visit=d.visit;t.visitAsync=d.visitAsync},7249:(e,t,B)=>{"use strict";var s=B(932);function debug(e,...t){if(e==="debug")console.log(...t)}function warn(e,t){if(e==="debug"||e==="warn"){if(typeof s.emitWarning==="function")s.emitWarning(t);else console.warn(t)}}t.debug=debug;t.warn=warn},4065:(e,t,B)=>{"use strict";var s=B(1596);var n=B(204);var r=B(1127);var i=B(6673);var a=B(4043);class Alias extends i.NodeBase{constructor(e){super(r.ALIAS);this.source=e;Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let B;if(t?.aliasResolveCache){B=t.aliasResolveCache}else{B=[];n.visit(e,{Node:(e,t)=>{if(r.isAlias(t)||r.hasAnchor(t))B.push(t)}});if(t)t.aliasResolveCache=B}let s=undefined;for(const e of B){if(e===this)break;if(e.anchor===this.source)s=e}return s}toJSON(e,t){if(!t)return{source:this.source};const{anchors:B,doc:s,maxAliasCount:n}=t;const r=this.resolve(s,t);if(!r){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let i=B.get(r);if(!i){a.toJS(r,null,t);i=B.get(r)}if(i?.res===undefined){const e="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(e)}if(n>=0){i.count+=1;if(i.aliasCount===0)i.aliasCount=getAliasCount(s,r,B);if(i.count*i.aliasCount>n){const e="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(e)}}return i.res}toString(e,t,B){const n=`*${this.source}`;if(e){s.anchorIsValid(this.source);if(e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${n} `}return n}}function getAliasCount(e,t,B){if(r.isAlias(t)){const s=t.resolve(e);const n=B&&s&&B.get(s);return n?n.count*n.aliasCount:0}else if(r.isCollection(t)){let s=0;for(const n of t.items){const t=getAliasCount(e,n,B);if(t>s)s=t}return s}else if(r.isPair(t)){const s=getAliasCount(e,t.key,B);const n=getAliasCount(e,t.value,B);return Math.max(s,n)}return 1}t.Alias=Alias},101:(e,t,B)=>{"use strict";var s=B(2404);var n=B(1127);var r=B(6673);function collectionFromPath(e,t,B){let n=B;for(let e=t.length-1;e>=0;--e){const B=t[e];if(typeof B==="number"&&Number.isInteger(B)&&B>=0){const e=[];e[B]=n;n=e}else{n=new Map([[B,n]])}}return s.createNode(n,undefined,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const isEmptyPath=e=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class Collection extends r.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:true,enumerable:false,writable:true})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t);if(this.range)t.range=this.range.slice();return t}addIn(e,t){if(isEmptyPath(e))this.add(t);else{const[B,...s]=e;const r=this.get(B,true);if(n.isCollection(r))r.addIn(s,t);else if(r===undefined&&this.schema)this.set(B,collectionFromPath(this.schema,s,t));else throw new Error(`Expected YAML collection at ${B}. Remaining path: ${s}`)}}deleteIn(e){const[t,...B]=e;if(B.length===0)return this.delete(t);const s=this.get(t,true);if(n.isCollection(s))return s.deleteIn(B);else throw new Error(`Expected YAML collection at ${t}. Remaining path: ${B}`)}getIn(e,t){const[B,...s]=e;const r=this.get(B,true);if(s.length===0)return!t&&n.isScalar(r)?r.value:r;else return n.isCollection(r)?r.getIn(s,t):undefined}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return false;const B=t.value;return B==null||e&&n.isScalar(B)&&B.value==null&&!B.commentBefore&&!B.comment&&!B.tag})}hasIn(e){const[t,...B]=e;if(B.length===0)return this.has(t);const s=this.get(t,true);return n.isCollection(s)?s.hasIn(B):false}setIn(e,t){const[B,...s]=e;if(s.length===0){this.set(B,t)}else{const e=this.get(B,true);if(n.isCollection(e))e.setIn(s,t);else if(e===undefined&&this.schema)this.set(B,collectionFromPath(this.schema,s,t));else throw new Error(`Expected YAML collection at ${B}. Remaining path: ${s}`)}}}t.Collection=Collection;t.collectionFromPath=collectionFromPath;t.isEmptyPath=isEmptyPath},6673:(e,t,B)=>{"use strict";var s=B(3661);var n=B(1127);var r=B(4043);class NodeBase{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:B,onAnchor:i,reviver:a}={}){if(!n.isDocument(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:true,mapAsMap:t===true,mapKeyWarned:false,maxAliasCount:typeof B==="number"?B:100};const l=r.toJS(this,"",o);if(typeof i==="function")for(const{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==="function"?s.applyReviver(a,{"":l},"",l):l}}t.NodeBase=NodeBase},7165:(e,t,B)=>{"use strict";var s=B(2404);var n=B(9748);var r=B(7104);var i=B(1127);function createPair(e,t,B){const n=s.createNode(e,undefined,B);const r=s.createNode(t,undefined,B);return new Pair(n,r)}class Pair{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR});this.key=e;this.value=t}clone(e){let{key:t,value:B}=this;if(i.isNode(t))t=t.clone(e);if(i.isNode(B))B=B.clone(e);return new Pair(t,B)}toJSON(e,t){const B=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,B,this)}toString(e,t,B){return e?.doc?n.stringifyPair(this,e,t,B):JSON.stringify(this)}}t.Pair=Pair;t.createPair=createPair},3301:(e,t,B)=>{"use strict";var s=B(1127);var n=B(6673);var r=B(4043);const isScalarValue=e=>!e||typeof e!=="function"&&typeof e!=="object";class Scalar extends n.NodeBase{constructor(e){super(s.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}}Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE";t.Scalar=Scalar;t.isScalarValue=isScalarValue},4454:(e,t,B)=>{"use strict";var s=B(1212);var n=B(7104);var r=B(101);var i=B(1127);var a=B(7165);var o=B(3301);function findPair(e,t){const B=i.isScalar(t)?t.value:t;for(const s of e){if(i.isPair(s)){if(s.key===t||s.key===B)return s;if(i.isScalar(s.key)&&s.key.value===B)return s}}return undefined}class YAMLMap extends r.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(i.MAP,e);this.items=[]}static from(e,t,B){const{keepUndefined:s,replacer:n}=B;const r=new this(e);const add=(e,i)=>{if(typeof n==="function")i=n.call(t,e,i);else if(Array.isArray(n)&&!n.includes(e))return;if(i!==undefined||s)r.items.push(a.createPair(e,i,B))};if(t instanceof Map){for(const[e,B]of t)add(e,B)}else if(t&&typeof t==="object"){for(const e of Object.keys(t))add(e,t[e])}if(typeof e.sortMapEntries==="function"){r.items.sort(e.sortMapEntries)}return r}add(e,t){let B;if(i.isPair(e))B=e;else if(!e||typeof e!=="object"||!("key"in e)){B=new a.Pair(e,e?.value)}else B=new a.Pair(e.key,e.value);const s=findPair(this.items,B.key);const n=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${B.key} already set`);if(i.isScalar(s.value)&&o.isScalarValue(B.value))s.value.value=B.value;else s.value=B.value}else if(n){const e=this.items.findIndex(e=>n(B,e)<0);if(e===-1)this.items.push(B);else this.items.splice(e,0,B)}else{this.items.push(B)}}delete(e){const t=findPair(this.items,e);if(!t)return false;const B=this.items.splice(this.items.indexOf(t),1);return B.length>0}get(e,t){const B=findPair(this.items,e);const s=B?.value;return(!t&&i.isScalar(s)?s.value:s)??undefined}has(e){return!!findPair(this.items,e)}set(e,t){this.add(new a.Pair(e,t),true)}toJSON(e,t,B){const s=B?new B:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(s);for(const e of this.items)n.addPairToJSMap(t,s,e);return s}toString(e,t,B){if(!e)return JSON.stringify(this);for(const e of this.items){if(!i.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`)}if(!e.allNullValues&&this.hasAllNullValues(false))e=Object.assign({},e,{allNullValues:true});return s.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:B,onComment:t})}}t.YAMLMap=YAMLMap;t.findPair=findPair},2223:(e,t,B)=>{"use strict";var s=B(2404);var n=B(1212);var r=B(101);var i=B(1127);var a=B(3301);var o=B(4043);class YAMLSeq extends r.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(i.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){const t=asItemIndex(e);if(typeof t!=="number")return false;const B=this.items.splice(t,1);return B.length>0}get(e,t){const B=asItemIndex(e);if(typeof B!=="number")return undefined;const s=this.items[B];return!t&&i.isScalar(s)?s.value:s}has(e){const t=asItemIndex(e);return typeof t==="number"&&t=0?t:null}t.YAMLSeq=YAMLSeq},7104:(e,t,B)=>{"use strict";var s=B(7249);var n=B(452);var r=B(2148);var i=B(1127);var a=B(4043);function addPairToJSMap(e,t,{key:B,value:s}){if(i.isNode(B)&&B.addToJSMap)B.addToJSMap(e,t,s);else if(n.isMergeKey(e,B))n.addMergeToJSMap(e,t,s);else{const n=a.toJS(B,"",e);if(t instanceof Map){t.set(n,a.toJS(s,n,e))}else if(t instanceof Set){t.add(n)}else{const r=stringifyKey(B,n,e);const i=a.toJS(s,r,e);if(r in t)Object.defineProperty(t,r,{value:i,writable:true,enumerable:true,configurable:true});else t[r]=i}}return t}function stringifyKey(e,t,B){if(t===null)return"";if(typeof t!=="object")return String(t);if(i.isNode(e)&&B?.doc){const t=r.createStringifyContext(B.doc,{});t.anchors=new Set;for(const e of B.anchors.keys())t.anchors.add(e.anchor);t.inFlow=true;t.inStringifyKey=true;const n=e.toString(t);if(!B.mapKeyWarned){let e=JSON.stringify(n);if(e.length>40)e=e.substring(0,36)+'..."';s.warn(B.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`);B.mapKeyWarned=true}return n}return JSON.stringify(t)}t.addPairToJSMap=addPairToJSMap},1127:(e,t)=>{"use strict";const B=Symbol.for("yaml.alias");const s=Symbol.for("yaml.document");const n=Symbol.for("yaml.map");const r=Symbol.for("yaml.pair");const i=Symbol.for("yaml.scalar");const a=Symbol.for("yaml.seq");const o=Symbol.for("yaml.node.type");const isAlias=e=>!!e&&typeof e==="object"&&e[o]===B;const isDocument=e=>!!e&&typeof e==="object"&&e[o]===s;const isMap=e=>!!e&&typeof e==="object"&&e[o]===n;const isPair=e=>!!e&&typeof e==="object"&&e[o]===r;const isScalar=e=>!!e&&typeof e==="object"&&e[o]===i;const isSeq=e=>!!e&&typeof e==="object"&&e[o]===a;function isCollection(e){if(e&&typeof e==="object")switch(e[o]){case n:case a:return true}return false}function isNode(e){if(e&&typeof e==="object")switch(e[o]){case B:case n:case i:case a:return true}return false}const hasAnchor=e=>(isScalar(e)||isCollection(e))&&!!e.anchor;t.ALIAS=B;t.DOC=s;t.MAP=n;t.NODE_TYPE=o;t.PAIR=r;t.SCALAR=i;t.SEQ=a;t.hasAnchor=hasAnchor;t.isAlias=isAlias;t.isCollection=isCollection;t.isDocument=isDocument;t.isMap=isMap;t.isNode=isNode;t.isPair=isPair;t.isScalar=isScalar;t.isSeq=isSeq},4043:(e,t,B)=>{"use strict";var s=B(1127);function toJS(e,t,B){if(Array.isArray(e))return e.map((e,t)=>toJS(e,String(t),B));if(e&&typeof e.toJSON==="function"){if(!B||!s.hasAnchor(e))return e.toJSON(t,B);const n={aliasCount:0,count:1,res:undefined};B.anchors.set(e,n);B.onCreate=e=>{n.res=e;delete B.onCreate};const r=e.toJSON(t,B);if(B.onCreate)B.onCreate(r);return r}if(typeof e==="bigint"&&!B?.keep)return Number(e);return e}t.toJS=toJS},110:(e,t,B)=>{"use strict";var s=B(8913);var n=B(6842);var r=B(1464);var i=B(3069);function resolveAsScalar(e,t=true,B){if(e){const _onError=(e,t,s)=>{const n=typeof e==="number"?e:Array.isArray(e)?e[0]:e.offset;if(B)B(n,t,s);else throw new r.YAMLParseError([n,n+1],t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return n.resolveFlowScalar(e,t,_onError);case"block-scalar":return s.resolveBlockScalar({options:{strict:t}},e,_onError)}}return null}function createScalarToken(e,t){const{implicitKey:B=false,indent:s,inFlow:n=false,offset:r=-1,type:a="PLAIN"}=t;const o=i.stringifyString({type:a,value:e},{implicitKey:B,indent:s>0?" ".repeat(s):"",inFlow:n,options:{blockQuote:true,lineWidth:-1}});const l=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(o[0]){case"|":case">":{const e=o.indexOf("\n");const t=o.substring(0,e);const B=o.substring(e+1)+"\n";const n=[{type:"block-scalar-header",offset:r,indent:s,source:t}];if(!addEndtoBlockProps(n,l))n.push({type:"newline",offset:-1,indent:s,source:"\n"});return{type:"block-scalar",offset:r,indent:s,props:n,source:B}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:o,end:l};default:return{type:"scalar",offset:r,indent:s,source:o,end:l}}}function setScalarValue(e,t,B={}){let{afterKey:s=false,implicitKey:n=false,inFlow:r=false,type:a}=B;let o="indent"in e?e.indent:null;if(s&&typeof o==="number")o+=2;if(!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=t.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}const l=i.stringifyString({type:a,value:t},{implicitKey:n||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:r,options:{blockQuote:true,lineWidth:-1}});switch(l[0]){case"|":case">":setBlockScalarValue(e,l);break;case'"':setFlowScalarValue(e,l,"double-quoted-scalar");break;case"'":setFlowScalarValue(e,l,"single-quoted-scalar");break;default:setFlowScalarValue(e,l,"scalar")}}function setBlockScalarValue(e,t){const B=t.indexOf("\n");const s=t.substring(0,B);const n=t.substring(B+1)+"\n";if(e.type==="block-scalar"){const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");t.source=s;e.source=n}else{const{offset:t}=e;const B="indent"in e?e.indent:-1;const r=[{type:"block-scalar-header",offset:t,indent:B,source:s}];if(!addEndtoBlockProps(r,"end"in e?e.end:undefined))r.push({type:"newline",offset:-1,indent:B,source:"\n"});for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:"block-scalar",indent:B,props:r,source:n})}}function addEndtoBlockProps(e,t){if(t)for(const B of t)switch(B.type){case"space":case"comment":e.push(B);break;case"newline":e.push(B);return true}return false}function setFlowScalarValue(e,t,B){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=B;e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let n=t.length;if(e.props[0].type==="block-scalar-header")n-=e.props[0].source.length;for(const e of s)e.offset+=n;delete e.props;Object.assign(e,{type:B,source:t,end:s});break}case"block-map":case"block-seq":{const s=e.offset+t.length;const n={type:"newline",offset:s,indent:e.indent,source:"\n"};delete e.items;Object.assign(e,{type:B,source:t,end:[n]});break}default:{const s="indent"in e?e.indent:-1;const n="end"in e&&Array.isArray(e.end)?e.end.filter(e=>e.type==="space"||e.type==="comment"||e.type==="newline"):[];for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:B,indent:s,source:t,end:n})}}}t.createScalarToken=createScalarToken;t.resolveAsScalar=resolveAsScalar;t.setScalarValue=setScalarValue},1733:(e,t)=>{"use strict";const stringify=e=>"type"in e?stringifyToken(e):stringifyItem(e);function stringifyToken(e){switch(e.type){case"block-scalar":{let t="";for(const B of e.props)t+=stringifyToken(B);return t+e.source}case"block-map":case"block-seq":{let t="";for(const B of e.items)t+=stringifyItem(B);return t}case"flow-collection":{let t=e.start.source;for(const B of e.items)t+=stringifyItem(B);for(const B of e.end)t+=B.source;return t}case"document":{let t=stringifyItem(e);if(e.end)for(const B of e.end)t+=B.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const B of e.end)t+=B.source;return t}}}function stringifyItem({start:e,key:t,sep:B,value:s}){let n="";for(const t of e)n+=t.source;if(t)n+=stringifyToken(t);if(B)for(const e of B)n+=e.source;if(s)n+=stringifyToken(s);return n}t.stringify=stringify},7715:(e,t)=>{"use strict";const B=Symbol("break visit");const s=Symbol("skip children");const n=Symbol("remove item");function visit(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};_visit(Object.freeze([]),e,t)}visit.BREAK=B;visit.SKIP=s;visit.REMOVE=n;visit.itemAtPath=(e,t)=>{let B=e;for(const[e,s]of t){const t=B?.[e];if(t&&"items"in t){B=t.items[s]}else return undefined}return B};visit.parentCollection=(e,t)=>{const B=visit.itemAtPath(e,t.slice(0,-1));const s=t[t.length-1][0];const n=B?.[s];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function _visit(e,t,s){let r=s(t,e);if(typeof r==="symbol")return r;for(const i of["key","value"]){const a=t[i];if(a&&"items"in a){for(let t=0;t{"use strict";var s=B(110);var n=B(1733);var r=B(7715);const i="\ufeff";const a="";const o="";const l="";const isCollection=e=>!!e&&"items"in e;const isScalar=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function prettyToken(e){switch(e){case i:return"";case a:return"";case o:return"";case l:return"";default:return JSON.stringify(e)}}function tokenType(e){switch(e){case i:return"byte-order-mark";case a:return"doc-mode";case o:return"flow-error-end";case l:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}t.createScalarToken=s.createScalarToken;t.resolveAsScalar=s.resolveAsScalar;t.setScalarValue=s.setScalarValue;t.stringify=n.stringify;t.visit=r.visit;t.BOM=i;t.DOCUMENT=a;t.FLOW_END=o;t.SCALAR=l;t.isCollection=isCollection;t.isScalar=isScalar;t.prettyToken=prettyToken;t.tokenType=tokenType},361:(e,t,B)=>{"use strict";var s=B(3461);function isEmpty(e){switch(e){case undefined:case" ":case"\n":case"\r":case"\t":return true;default:return false}}const n=new Set("0123456789ABCDEFabcdef");const r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");const i=new Set(",[]{}");const a=new Set(" ,[]{}\n\r\t");const isNotAnchorChar=e=>!e||a.has(e);class Lexer{constructor(){this.atEnd=false;this.blockScalarIndent=-1;this.blockScalarKeep=false;this.buffer="";this.flowKey=false;this.flowLevel=0;this.indentNext=0;this.indentValue=0;this.lineEndPos=null;this.next=null;this.pos=0}*lex(e,t=false){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e;this.lineEndPos=null}this.atEnd=!t;let B=this.next??"stream";while(B&&(t||this.hasChars(1)))B=yield*this.parseNext(B)}atLineEnd(){let e=this.pos;let t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t==="\n")return true;if(t==="\r")return this.buffer[e+1]==="\n";return false}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let B=0;while(t===" ")t=this.buffer[++B+e];if(t==="\r"){const t=this.buffer[B+e+1];if(t==="\n"||!t&&!this.atEnd)return e+B+1}return t==="\n"||B>=this.indentNext||!t&&!this.atEnd?e+B:-1}if(t==="-"||t==="."){const t=this.buffer.substr(e,3);if((t==="---"||t==="...")&&isEmpty(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&ethis.indentValue&&!isEmpty(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&isEmpty(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));this.indentNext=this.indentValue+1;this.indentValue+=e;return"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(true);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case undefined:yield*this.pushNewline();return yield*this.parseLineStart();case"{":case"[":yield*this.pushCount(1);this.flowKey=false;this.flowLevel=1;return"flow";case"}":case"]":yield*this.pushCount(1);return"doc";case"*":yield*this.pushUntil(isNotAnchorChar);return"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":t+=(yield*this.parseBlockScalarHeader());t+=(yield*this.pushSpaces(true));yield*this.pushCount(e.length-t);yield*this.pushNewline();return yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t;let B=-1;do{e=yield*this.pushNewline();if(e>0){t=yield*this.pushSpaces(false);this.indentValue=B=t}else{t=0}t+=(yield*this.pushSpaces(true))}while(e+t>0);const n=this.getLine();if(n===null)return this.setNext("flow");if(B!==-1&&B"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(e=>isEmpty(e)||e==="#")}*parseBlockScalar(){let e=this.pos-1;let t=0;let B;e:for(let s=this.pos;B=this.buffer[s];++s){switch(B){case" ":t+=1;break;case"\n":e=s;t=0;break;case"\r":{const e=this.buffer[s+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if(e==="\n")break}default:break e}}if(!B&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else{this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext)}do{const t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf("\n",t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;B=this.buffer[n];while(B===" ")B=this.buffer[++n];if(B==="\t"){while(B==="\t"||B===" "||B==="\r"||B==="\n")B=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep){do{let B=e-1;let s=this.buffer[B];if(s==="\r")s=this.buffer[--B];const n=B;while(s===" ")s=this.buffer[--B];if(s==="\n"&&B>=this.pos&&B+1+t>n)e=B;else break}while(true)}yield s.SCALAR;yield*this.pushToIndex(e+1,true);return yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1;let B=this.pos-1;let n;while(n=this.buffer[++B]){if(n===":"){const s=this.buffer[B+1];if(isEmpty(s)||e&&i.has(s))break;t=B}else if(isEmpty(n)){let s=this.buffer[B+1];if(n==="\r"){if(s==="\n"){B+=1;n="\n";s=this.buffer[B+1]}else t=B}if(s==="#"||e&&i.has(s))break;if(n==="\n"){const e=this.continueScalar(B+1);if(e===-1)break;B=Math.max(B,e-2)}}else{if(e&&i.has(n))break;t=B}}if(!n&&!this.atEnd)return this.setNext("plain-scalar");yield s.SCALAR;yield*this.pushToIndex(t+1,true);return e?"flow":"doc"}*pushCount(e){if(e>0){yield this.buffer.substr(this.pos,e);this.pos+=e;return e}return 0}*pushToIndex(e,t){const B=this.buffer.slice(this.pos,e);if(B){yield B;this.pos+=B.length;return B.length}else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(true){switch(this.charAt(0)){case"!":e+=(yield*this.pushTag());e+=(yield*this.pushSpaces(true));continue e;case"&":e+=(yield*this.pushUntil(isNotAnchorChar));e+=(yield*this.pushSpaces(true));continue e;case"-":case"?":case":":{const t=this.flowLevel>0;const B=this.charAt(1);if(isEmpty(B)||t&&i.has(B)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=false;e+=(yield*this.pushCount(1));e+=(yield*this.pushSpaces(true));continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2;let t=this.buffer[e];while(!isEmpty(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,false)}else{let e=this.pos+1;let t=this.buffer[e];while(t){if(r.has(t))t=this.buffer[++e];else if(t==="%"&&n.has(this.buffer[e+1])&&n.has(this.buffer[e+2])){t=this.buffer[e+=3]}else break}return yield*this.pushToIndex(e,false)}}*pushNewline(){const e=this.buffer[this.pos];if(e==="\n")return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)==="\n")return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1;let B;do{B=this.buffer[++t]}while(B===" "||e&&B==="\t");const s=t-this.pos;if(s>0){yield this.buffer.substr(this.pos,s);this.pos=t}return s}*pushUntil(e){let t=this.pos;let B=this.buffer[t];while(!e(B))B=this.buffer[++t];return yield*this.pushToIndex(t,false)}}t.Lexer=Lexer},6628:(e,t)=>{"use strict";class LineCounter{constructor(){this.lineStarts=[];this.addNewLine=e=>this.lineStarts.push(e);this.linePos=e=>{let t=0;let B=this.lineStarts.length;while(t>1;if(this.lineStarts[s]{"use strict";var s=B(932);var n=B(3461);var r=B(361);function includesToken(e,t){for(let B=0;B=0){switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}}while(e[++t]?.type==="space"){}return e.splice(t,e.length)}function arrayPushArray(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let B=0;B0)yield*this.pop()}get sourceToken(){const e={type:this.type,offset:this.offset,indent:this.indent,source:this.source};return e}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t){const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}else if(this.stack.length===0){yield t}else{const e=this.peek(1);if(t.type==="block-scalar"){t.indent="indent"in e?e.indent:0}else if(t.type==="flow-collection"&&e.type==="document"){t.indent=0}if(t.type==="flow-collection")fixFlowSeqItems(t);switch(e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const B=e.items[e.items.length-1];if(B.value){e.items.push({start:[],key:t,sep:[]});this.onKeyLine=true;return}else if(B.sep){B.value=t}else{Object.assign(B,{key:t,sep:[]});this.onKeyLine=!B.explicitKey;return}break}case"block-seq":{const B=e.items[e.items.length-1];if(B.value)e.items.push({start:[],value:t});else B.value=t;break}case"flow-collection":{const B=e.items[e.items.length-1];if(!B||B.value)e.items.push({start:[],key:t,sep:[]});else if(B.sep)B.value=t;else Object.assign(B,{key:t,sep:[]});return}default:yield*this.pop();yield*this.pop(t)}if((e.type==="document"||e.type==="block-map"||e.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const B=t.items[t.items.length-1];if(B&&!B.sep&&!B.value&&B.start.length>0&&findNonEmptyIndex(B.start)===-1&&(t.indent===0||B.start.every(e=>e.type!=="comment"||e.indent=e.indent){const B=!this.onKeyLine&&this.indent===e.indent;const s=B&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let n=[];if(s&&t.sep&&!t.value){const B=[];for(let s=0;se.indent)B.length=0;break;default:B.length=0}}if(B.length>=2)n=t.sep.splice(B[1])}switch(this.type){case"anchor":case"tag":if(s||t.value){n.push(this.sourceToken);e.items.push({start:n});this.onKeyLine=true}else if(t.sep){t.sep.push(this.sourceToken)}else{t.start.push(this.sourceToken)}return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey){t.start.push(this.sourceToken);t.explicitKey=true}else if(s||t.value){n.push(this.sourceToken);e.items.push({start:n,explicitKey:true})}else{this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]})}this.onKeyLine=true;return;case"map-value-ind":if(t.explicitKey){if(!t.sep){if(includesToken(t.start,"newline")){Object.assign(t,{key:null,sep:[this.sourceToken]})}else{const e=getFirstKeyStartProps(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value){e.items.push({start:[],key:null,sep:[this.sourceToken]})}else if(includesToken(t.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]})}else if(isFlowToken(t.key)&&!includesToken(t.sep,"newline")){const e=getFirstKeyStartProps(t.start);const B=t.key;const s=t.sep;s.push(this.sourceToken);delete t.key;delete t.sep;this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:B,sep:s}]})}else if(n.length>0){t.sep=t.sep.concat(n,this.sourceToken)}else{t.sep.push(this.sourceToken)}}else{if(!t.sep){Object.assign(t,{key:null,sep:[this.sourceToken]})}else if(t.value||s){e.items.push({start:n,key:null,sep:[this.sourceToken]})}else if(includesToken(t.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]})}else{t.sep.push(this.sourceToken)}}this.onKeyLine=true;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const B=this.flowScalar(this.type);if(s||t.value){e.items.push({start:n,key:B,sep:[]});this.onKeyLine=true}else if(t.sep){this.stack.push(B)}else{Object.assign(t,{key:B,sep:[]});this.onKeyLine=true}return}default:{const s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!includesToken(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(B){e.items.push({start:n})}this.stack.push(s);return}}}}yield*this.pop();yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const B="end"in t.value?t.value.end:undefined;const s=Array.isArray(B)?B[B.length-1]:undefined;if(s?.type==="comment")B?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const B=e.items[e.items.length-2];const s=B?.value?.end;if(Array.isArray(s)){arrayPushArray(s,t.start);s.push(this.sourceToken);e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||includesToken(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop();yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let e;do{yield*this.pop();e=this.peek(1)}while(e?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const B=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:B,sep:[]});else if(t.sep)this.stack.push(B);else Object.assign(t,{key:B,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const B=this.startBlockValue(e);if(B)this.stack.push(B);else{yield*this.pop();yield*this.step()}}else{const t=this.peek(2);if(t.type==="block-map"&&(this.type==="map-value-ind"&&t.indent===e.indent||this.type==="newline"&&!t.items[t.items.length-1].sep)){yield*this.pop();yield*this.step()}else if(this.type==="map-value-ind"&&t.type!=="flow-collection"){const B=getPrevProps(t);const s=getFirstKeyStartProps(B);fixFlowSeqItems(e);const n=e.end.splice(1,e.end.length);n.push(this.sourceToken);const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=true;this.stack[this.stack.length-1]=r}else{yield*this.lineEnd(e)}}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;while(e!==0){this.onNewLine(this.offset+e);e=this.source.indexOf("\n",e)+1}}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=true;const t=getPrevProps(e);const B=getFirstKeyStartProps(t);B.push(this.sourceToken);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:B,explicitKey:true}]}}case"map-value-ind":{this.onKeyLine=true;const t=getPrevProps(e);const B=getFirstKeyStartProps(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:B,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return false;if(this.indent<=t)return false;return e.every(e=>e.type==="newline"||e.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop();yield*this.step();break;case"newline":this.onKeyLine=false;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}t.Parser=Parser},4047:(e,t,B)=>{"use strict";var s=B(9984);var n=B(3021);var r=B(1464);var i=B(7249);var a=B(1127);var o=B(6628);var l=B(3456);function parseOptions(e){const t=e.prettyErrors!==false;const B=e.lineCounter||t&&new o.LineCounter||null;return{lineCounter:B,prettyErrors:t}}function parseAllDocuments(e,t={}){const{lineCounter:B,prettyErrors:n}=parseOptions(t);const i=new l.Parser(B?.addNewLine);const a=new s.Composer(t);const o=Array.from(a.compose(i.parse(e)));if(n&&B)for(const t of o){t.errors.forEach(r.prettifyError(e,B));t.warnings.forEach(r.prettifyError(e,B))}if(o.length>0)return o;return Object.assign([],{empty:true},a.streamInfo())}function parseDocument(e,t={}){const{lineCounter:B,prettyErrors:n}=parseOptions(t);const i=new l.Parser(B?.addNewLine);const a=new s.Composer(t);let o=null;for(const t of a.compose(i.parse(e),true,e.length)){if(!o)o=t;else if(o.options.logLevel!=="silent"){o.errors.push(new r.YAMLParseError(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}if(n&&B){o.errors.forEach(r.prettifyError(e,B));o.warnings.forEach(r.prettifyError(e,B))}return o}function parse(e,t,B){let s=undefined;if(typeof t==="function"){s=t}else if(B===undefined&&t&&typeof t==="object"){B=t}const n=parseDocument(e,B);if(!n)return null;n.warnings.forEach(e=>i.warn(n.options.logLevel,e));if(n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];else n.errors=[]}return n.toJS(Object.assign({reviver:s},B))}function stringify(e,t,B){let s=null;if(typeof t==="function"||Array.isArray(t)){s=t}else if(B===undefined&&t){B=t}if(typeof B==="string")B=B.length;if(typeof B==="number"){const e=Math.round(B);B=e<1?undefined:e>8?{indent:8}:{indent:e}}if(e===undefined){const{keepUndefined:e}=B??t??{};if(!e)return undefined}if(a.isDocument(e)&&!s)return e.toString(B);return new n.Document(e,s,B).toString(B)}t.parse=parse;t.parseAllDocuments=parseAllDocuments;t.parseDocument=parseDocument;t.stringify=stringify},5840:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7451);var r=B(1706);var i=B(6464);var a=B(18);const sortMapEntriesByKey=(e,t)=>e.keyt.key?1:0;class Schema{constructor({compat:e,customTags:t,merge:B,resolveKnownTags:o,schema:l,sortMapEntries:c,toStringDefaults:C}){this.compat=Array.isArray(e)?a.getTags(e,"compat"):e?a.getTags(null,e):null;this.name=typeof l==="string"&&l||"core";this.knownTags=o?a.coreKnownTags:{};this.tags=a.getTags(t,this.name,B);this.toStringOptions=C??null;Object.defineProperty(this,s.MAP,{value:n.map});Object.defineProperty(this,s.SCALAR,{value:i.string});Object.defineProperty(this,s.SEQ,{value:r.seq});this.sortMapEntries=typeof c==="function"?c:c===true?sortMapEntriesByKey:null}clone(){const e=Object.create(Schema.prototype,Object.getOwnPropertyDescriptors(this));e.tags=this.tags.slice();return e}}t.Schema=Schema},7451:(e,t,B)=>{"use strict";var s=B(1127);var n=B(4454);const r={collection:"map",default:true,nodeClass:n.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!s.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,B)=>n.YAMLMap.from(e,t,B)};t.map=r},3632:(e,t,B)=>{"use strict";var s=B(3301);const n={identify:e=>e==null,createNode:()=>new s.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new s.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&n.test.test(e)?e:t.options.nullStr};t.nullTag=n},1706:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2223);const r={collection:"seq",default:true,nodeClass:n.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!s.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,B)=>n.YAMLSeq.from(e,t,B)};t.seq=r},6464:(e,t,B)=>{"use strict";var s=B(3069);const n={identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,B,n){t=Object.assign({actualString:true},t);return s.stringifyString(e,t,B,n)}};t.string=n},3959:(e,t,B)=>{"use strict";var s=B(3301);const n={identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new s.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},B){if(e&&n.test.test(e)){const B=e[0]==="t"||e[0]==="T";if(t===B)return e}return t?B.options.trueStr:B.options.falseStr}};t.boolTag=n},8405:(e,t,B)=>{"use strict";var s=B(3301);var n=B(8689);const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber};const i={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}};const a={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new s.Scalar(parseFloat(e));const B=e.indexOf(".");if(B!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-B-1;return t},stringify:n.stringifyNumber};t.float=a;t.floatExp=i;t.floatNaN=r},9874:(e,t,B)=>{"use strict";var s=B(8689);const intIdentify=e=>typeof e==="bigint"||Number.isInteger(e);const intResolve=(e,t,B,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),B);function intStringify(e,t,B){const{value:n}=e;if(intIdentify(n)&&n>=0)return B+n.toString(t);return s.stringifyNumber(e)}const n={identify:e=>intIdentify(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,B)=>intResolve(e,2,8,B),stringify:e=>intStringify(e,8,"0o")};const r={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,B)=>intResolve(e,0,10,B),stringify:s.stringifyNumber};const i={identify:e=>intIdentify(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,B)=>intResolve(e,2,16,B),stringify:e=>intStringify(e,16,"0x")};t.int=r;t.intHex=i;t.intOct=n},896:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(3959);var o=B(8405);var l=B(9874);const c=[s.map,r.seq,i.string,n.nullTag,a.boolTag,l.intOct,l.int,l.intHex,o.floatNaN,o.floatExp,o.float];t.schema=c},3559:(e,t,B)=>{"use strict";var s=B(3301);var n=B(7451);var r=B(1706);function intIdentify(e){return typeof e==="bigint"||Number.isInteger(e)}const stringifyJSON=({value:e})=>JSON.stringify(e);const i=[{identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:stringifyJSON},{identify:e=>e==null,createNode:()=>new s.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:stringifyJSON},{identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:stringifyJSON},{identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:B})=>B?BigInt(e):parseInt(e,10),stringify:({value:e})=>intIdentify(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:stringifyJSON}];const a={default:true,tag:"",test:/^/,resolve(e,t){t(`Unresolved plain scalar ${JSON.stringify(e)}`);return e}};const o=[n.map,r.seq].concat(i,a);t.schema=o},18:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(3959);var o=B(8405);var l=B(9874);var c=B(896);var C=B(3559);var u=B(6083);var f=B(452);var h=B(303);var p=B(8385);var g=B(5913);var m=B(1528);var d=B(6752);const D=new Map([["core",c.schema],["failsafe",[s.map,r.seq,i.string]],["json",C.schema],["yaml11",g.schema],["yaml-1.1",g.schema]]);const E={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:d.floatTime,int:l.int,intHex:l.intHex,intOct:l.intOct,intTime:d.intTime,map:s.map,merge:f.merge,null:n.nullTag,omap:h.omap,pairs:p.pairs,seq:r.seq,set:m.set,timestamp:d.timestamp};const y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":f.merge,"tag:yaml.org,2002:omap":h.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":m.set,"tag:yaml.org,2002:timestamp":d.timestamp};function getTags(e,t,B){const s=D.get(t);if(s&&!e){return B&&!s.includes(f.merge)?s.concat(f.merge):s.slice()}let n=s;if(!n){if(Array.isArray(e))n=[];else{const e=Array.from(D.keys()).filter(e=>e!=="yaml11").map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e)){for(const t of e)n=n.concat(t)}else if(typeof e==="function"){n=e(n.slice())}if(B)n=n.concat(f.merge);return n.reduce((e,t)=>{const B=typeof t==="string"?E[t]:t;if(!B){const e=JSON.stringify(t);const B=Object.keys(E).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${B}`)}if(!e.includes(B))e.push(B);return e},[])}t.coreKnownTags=y;t.getTags=getTags},6083:(e,t,B)=>{"use strict";var s=B(181);var n=B(3301);var r=B(3069);const i={identify:e=>e instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof s.Buffer==="function"){return s.Buffer.from(e,"base64")}else if(typeof atob==="function"){const t=atob(e.replace(/[\n\r]/g,""));const B=new Uint8Array(t.length);for(let e=0;e{"use strict";var s=B(3301);function boolStringify({value:e,source:t},B){const s=e?n:r;if(t&&s.test.test(t))return t;return e?B.options.trueStr:B.options.falseStr}const n={identify:e=>e===true,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new s.Scalar(true),stringify:boolStringify};const r={identify:e=>e===false,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new s.Scalar(false),stringify:boolStringify};t.falseTag=r;t.trueTag=n},5782:(e,t,B)=>{"use strict";var s=B(3301);var n=B(8689);const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber};const i={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}};const a={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new s.Scalar(parseFloat(e.replace(/_/g,"")));const B=e.indexOf(".");if(B!==-1){const s=e.substring(B+1).replace(/_/g,"");if(s[s.length-1]==="0")t.minFractionDigits=s.length}return t},stringify:n.stringifyNumber};t.float=a;t.floatExp=i;t.floatNaN=r},873:(e,t,B)=>{"use strict";var s=B(8689);const intIdentify=e=>typeof e==="bigint"||Number.isInteger(e);function intResolve(e,t,B,{intAsBigInt:s}){const n=e[0];if(n==="-"||n==="+")t+=1;e=e.substring(t).replace(/_/g,"");if(s){switch(B){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const t=BigInt(e);return n==="-"?BigInt(-1)*t:t}const r=parseInt(e,B);return n==="-"?-1*r:r}function intStringify(e,t,B){const{value:n}=e;if(intIdentify(n)){const e=n.toString(t);return n<0?"-"+B+e.substr(1):B+e}return s.stringifyNumber(e)}const n={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,B)=>intResolve(e,2,2,B),stringify:e=>intStringify(e,2,"0b")};const r={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,B)=>intResolve(e,1,8,B),stringify:e=>intStringify(e,8,"0")};const i={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,B)=>intResolve(e,0,10,B),stringify:s.stringifyNumber};const a={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,B)=>intResolve(e,2,16,B),stringify:e=>intStringify(e,16,"0x")};t.int=i;t.intBin=n;t.intHex=a;t.intOct=r},452:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);const r="<<";const i={identify:e=>e===r||typeof e==="symbol"&&e.description===r,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(r)),{addToJSMap:addMergeToJSMap}),stringify:()=>r};const isMergeKey=(e,t)=>(i.identify(t)||s.isScalar(t)&&(!t.type||t.type===n.Scalar.PLAIN)&&i.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===i.tag&&e.default);function addMergeToJSMap(e,t,B){const n=resolveAliasValue(e,B);if(s.isSeq(n))for(const B of n.items)mergeValue(e,t,B);else if(Array.isArray(n))for(const B of n)mergeValue(e,t,B);else mergeValue(e,t,n)}function mergeValue(e,t,B){const n=resolveAliasValue(e,B);if(!s.isMap(n))throw new Error("Merge sources must be maps or map aliases");const r=n.toJSON(null,e,Map);for(const[e,B]of r){if(t instanceof Map){if(!t.has(e))t.set(e,B)}else if(t instanceof Set){t.add(e)}else if(!Object.prototype.hasOwnProperty.call(t,e)){Object.defineProperty(t,e,{value:B,writable:true,enumerable:true,configurable:true})}}return t}function resolveAliasValue(e,t){return e&&s.isAlias(t)?t.resolve(e.doc,e):t}t.addMergeToJSMap=addMergeToJSMap;t.isMergeKey=isMergeKey;t.merge=i},303:(e,t,B)=>{"use strict";var s=B(1127);var n=B(4043);var r=B(4454);var i=B(2223);var a=B(8385);class YAMLOMap extends i.YAMLSeq{constructor(){super();this.add=r.YAMLMap.prototype.add.bind(this);this.delete=r.YAMLMap.prototype.delete.bind(this);this.get=r.YAMLMap.prototype.get.bind(this);this.has=r.YAMLMap.prototype.has.bind(this);this.set=r.YAMLMap.prototype.set.bind(this);this.tag=YAMLOMap.tag}toJSON(e,t){if(!t)return super.toJSON(e);const B=new Map;if(t?.onCreate)t.onCreate(B);for(const e of this.items){let r,i;if(s.isPair(e)){r=n.toJS(e.key,"",t);i=n.toJS(e.value,r,t)}else{r=n.toJS(e,"",t)}if(B.has(r))throw new Error("Ordered maps must not include duplicate keys");B.set(r,i)}return B}static from(e,t,B){const s=a.createPairs(e,t,B);const n=new this;n.items=s.items;return n}}YAMLOMap.tag="tag:yaml.org,2002:omap";const o={collection:"seq",identify:e=>e instanceof Map,nodeClass:YAMLOMap,default:false,tag:"tag:yaml.org,2002:omap",resolve(e,t){const B=a.resolvePairs(e,t);const n=[];for(const{key:e}of B.items){if(s.isScalar(e)){if(n.includes(e.value)){t(`Ordered maps must not include duplicate keys: ${e.value}`)}else{n.push(e.value)}}}return Object.assign(new YAMLOMap,B)},createNode:(e,t,B)=>YAMLOMap.from(e,t,B)};t.YAMLOMap=YAMLOMap;t.omap=o},8385:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(3301);var i=B(2223);function resolvePairs(e,t){if(s.isSeq(e)){for(let B=0;B1)t("Each pair must have its own sequence indicator");const e=i.items[0]||new n.Pair(new r.Scalar(null));if(i.commentBefore)e.key.commentBefore=e.key.commentBefore?`${i.commentBefore}\n${e.key.commentBefore}`:i.commentBefore;if(i.comment){const t=e.value??e.key;t.comment=t.comment?`${i.comment}\n${t.comment}`:i.comment}i=e}e.items[B]=s.isPair(i)?i:new n.Pair(i)}}else t("Expected a sequence for this tag");return e}function createPairs(e,t,B){const{replacer:s}=B;const r=new i.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){if(typeof s==="function")e=s.call(t,String(a++),e);let i,o;if(Array.isArray(e)){if(e.length===2){i=e[0];o=e[1]}else throw new TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){const t=Object.keys(e);if(t.length===1){i=t[0];o=e[i]}else{throw new TypeError(`Expected tuple with one key, not ${t.length} keys`)}}else{i=e}r.items.push(n.createPair(i,o,B))}return r}const a={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:resolvePairs,createNode:createPairs};t.createPairs=createPairs;t.pairs=a;t.resolvePairs=resolvePairs},5913:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(6083);var o=B(8398);var l=B(5782);var c=B(873);var C=B(452);var u=B(303);var f=B(8385);var h=B(1528);var p=B(6752);const g=[s.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,l.floatNaN,l.floatExp,l.float,a.binary,C.merge,u.omap,f.pairs,h.set,p.intTime,p.floatTime,p.timestamp];t.schema=g},1528:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(4454);class YAMLSet extends r.YAMLMap{constructor(e){super(e);this.tag=YAMLSet.tag}add(e){let t;if(s.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new n.Pair(e.key,null);else t=new n.Pair(e,null);const B=r.findPair(this.items,t.key);if(!B)this.items.push(t)}get(e,t){const B=r.findPair(this.items,e);return!t&&s.isPair(B)?s.isScalar(B.key)?B.key.value:B.key:B}set(e,t){if(typeof t!=="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const B=r.findPair(this.items,e);if(B&&!t){this.items.splice(this.items.indexOf(B),1)}else if(!B&&t){this.items.push(new n.Pair(e))}}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,B){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(true))return super.toString(Object.assign({},e,{allNullValues:true}),t,B);else throw new Error("Set items must all have null values")}static from(e,t,B){const{replacer:s}=B;const r=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t){if(typeof s==="function")e=s.call(t,e,e);r.items.push(n.createPair(e,null,B))}return r}}YAMLSet.tag="tag:yaml.org,2002:set";const i={collection:"map",identify:e=>e instanceof Set,nodeClass:YAMLSet,default:false,tag:"tag:yaml.org,2002:set",createNode:(e,t,B)=>YAMLSet.from(e,t,B),resolve(e,t){if(s.isMap(e)){if(e.hasAllNullValues(true))return Object.assign(new YAMLSet,e);else t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};t.YAMLSet=YAMLSet;t.set=i},6752:(e,t,B)=>{"use strict";var s=B(8689);function parseSexagesimal(e,t){const B=e[0];const s=B==="-"||B==="+"?e.substring(1):e;const num=e=>t?BigInt(e):Number(e);const n=s.replace(/_/g,"").split(":").reduce((e,t)=>e*num(60)+num(t),num(0));return B==="-"?num(-1)*n:n}function stringifySexagesimal(e){let{value:t}=e;let num=e=>e;if(typeof t==="bigint")num=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return s.stringifyNumber(e);let B="";if(t<0){B="-";t*=num(-1)}const n=num(60);const r=[t%n];if(t<60){r.unshift(0)}else{t=(t-r[0])/n;r.unshift(t%n);if(t>=60){t=(t-r[0])/n;r.unshift(t)}}return B+r.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const n={identify:e=>typeof e==="bigint"||Number.isInteger(e),default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:B})=>parseSexagesimal(e,B),stringify:stringifySexagesimal};const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>parseSexagesimal(e,false),stringify:stringifySexagesimal};const i={identify:e=>e instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})"+"(?:"+"(?:t|T|[ \\t]+)"+"([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)"+"(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?"+")?$"),resolve(e){const t=e.match(i.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,B,s,n,r,a,o]=t.map(Number);const l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(B,s-1,n,r||0,a||0,o||0,l);const C=t[8];if(C&&C!=="Z"){let e=parseSexagesimal(C,false);if(Math.abs(e)<30)e*=60;c-=6e4*e}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};t.floatTime=r;t.intTime=n;t.timestamp=i},4475:(e,t)=>{"use strict";const B="flow";const s="block";const n="quoted";function foldFlowLines(e,t,B="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return e;if(ii-Math.max(2,a))C.push(0);else f=i-r}let h=undefined;let p=undefined;let g=false;let m=-1;let d=-1;let D=-1;if(B===s){m=consumeMoreIndentedLines(e,m,t.length);if(m!==-1)f=m+c}for(let r;r=e[m+=1];){if(B===n&&r==="\\"){d=m;switch(e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}D=m}if(r==="\n"){if(B===s)m=consumeMoreIndentedLines(e,m,t.length);f=m+t.length+c;h=undefined}else{if(r===" "&&p&&p!==" "&&p!=="\n"&&p!=="\t"){const t=e[m+1];if(t&&t!==" "&&t!=="\n"&&t!=="\t")h=m}if(m>=f){if(h){C.push(h);f=h+c;h=undefined}else if(B===n){while(p===" "||p==="\t"){p=r;r=e[m+=1];g=true}const t=m>D+1?m-2:d-1;if(u[t])return e;C.push(t);u[t]=true;f=t+c;h=undefined}else{g=true}}}p=r}if(g&&l)l();if(C.length===0)return e;if(o)o();let E=e.slice(0,C[0]);for(let s=0;s{"use strict";var s=B(1596);var n=B(1127);var r=B(9799);var i=B(3069);function createStringifyContext(e,t){const B=Object.assign({blockQuote:true,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trailingComma:false,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let s;switch(B.collectionStyle){case"block":s=false;break;case"flow":s=true;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:B.flowCollectionPadding?" ":"",indent:"",indentStep:typeof B.indent==="number"?" ".repeat(B.indent):" ",inFlow:s,options:B}}function getTagObject(e,t){if(t.tag){const B=e.filter(e=>e.tag===t.tag);if(B.length>0)return B.find(e=>e.format===t.format)??B[0]}let B=undefined;let s;if(n.isScalar(t)){s=t.value;let n=e.filter(e=>e.identify?.(s));if(n.length>1){const e=n.filter(e=>e.test);if(e.length>0)n=e}B=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else{s=t;B=e.find(e=>e.nodeClass&&s instanceof e.nodeClass)}if(!B){const e=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${e} value`)}return B}function stringifyProps(e,t,{anchors:B,doc:r}){if(!r.directives)return"";const i=[];const a=(n.isScalar(e)||n.isCollection(e))&&e.anchor;if(a&&s.anchorIsValid(a)){B.add(a);i.push(`&${a}`)}const o=e.tag??(t.default?null:t.tag);if(o)i.push(r.directives.tagString(o));return i.join(" ")}function stringify(e,t,B,s){if(n.isPair(e))return e.toString(t,B,s);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e)){throw new TypeError(`Cannot stringify circular structure without alias nodes`)}else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let r=undefined;const a=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>r=e});r??(r=getTagObject(t.doc.schema.tags,a));const o=stringifyProps(a,r,t);if(o.length>0)t.indentAtStart=(t.indentAtStart??0)+o.length+1;const l=typeof r.stringify==="function"?r.stringify(a,t,B,s):n.isScalar(a)?i.stringifyString(a,t,B,s):a.toString(t,B,s);if(!o)return l;return n.isScalar(a)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}\n${t.indent}${l}`}t.createStringifyContext=createStringifyContext;t.stringify=stringify},1212:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2148);var r=B(9799);function stringifyCollection(e,t,B){const s=t.inFlow??e.flow;const n=s?stringifyFlowCollection:stringifyBlockCollection;return n(e,t,B)}function stringifyBlockCollection({comment:e,items:t},B,{blockItemPrefix:i,flowChars:a,itemIndent:o,onChompKeep:l,onComment:c}){const{indent:C,options:{commentString:u}}=B;const f=Object.assign({},B,{indent:o,type:null});let h=false;const p=[];for(let e=0;el=null,()=>h=true);if(l)c+=r.lineComment(c,o,u(l));if(h&&l)h=false;p.push(i+c)}let g;if(p.length===0){g=a.start+a.end}else{g=p[0];for(let e=1;eo=null);u||(u=h.length>f||l.includes("\n"));if(B0){u||(u=h.reduce((e,t)=>e+t.length+2,2)+(l.length+2)>t.options.lineWidth)}if(u){l+=","}}if(o)l+=r.lineComment(l,i,c(o));h.push(l);f=h.length}const{start:p,end:g}=B;if(h.length===0){return p+g}else{if(!u){const e=h.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(u){let e=p;for(const t of h)e+=t?`\n${o}${a}${t}`:"\n";return`${e}\n${a}${g}`}else{return`${p}${l}${h.join(" ")}${l}${g}`}}}function addCommentBefore({indent:e,options:{commentString:t}},B,s,n){if(s&&n)s=s.replace(/^\n+/,"");if(s){const n=r.indentComment(t(s),e);B.push(n.trimStart())}}t.stringifyCollection=stringifyCollection},9799:(e,t)=>{"use strict";const stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function indentComment(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}const lineComment=(e,t,B)=>e.endsWith("\n")?indentComment(B,t):B.includes("\n")?"\n"+indentComment(B,t):(e.endsWith(" ")?"":" ")+B;t.indentComment=indentComment;t.lineComment=lineComment;t.stringifyComment=stringifyComment},6829:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2148);var r=B(9799);function stringifyDocument(e,t){const B=[];let i=t.directives===true;if(t.directives!==false&&e.directives){const t=e.directives.toString(e);if(t){B.push(t);i=true}else if(e.directives.docStart)i=true}if(i)B.push("---");const a=n.createStringifyContext(e,t);const{commentString:o}=a.options;if(e.commentBefore){if(B.length!==1)B.unshift("");const t=o(e.commentBefore);B.unshift(r.indentComment(t,""))}let l=false;let c=null;if(e.contents){if(s.isNode(e.contents)){if(e.contents.spaceBefore&&i)B.push("");if(e.contents.commentBefore){const t=o(e.contents.commentBefore);B.push(r.indentComment(t,""))}a.forceBlockIndent=!!e.comment;c=e.contents.comment}const t=c?undefined:()=>l=true;let C=n.stringify(e.contents,a,()=>c=null,t);if(c)C+=r.lineComment(C,"",o(c));if((C[0]==="|"||C[0]===">")&&B[B.length-1]==="---"){B[B.length-1]=`--- ${C}`}else B.push(C)}else{B.push(n.stringify(e.contents,a))}if(e.directives?.docEnd){if(e.comment){const t=o(e.comment);if(t.includes("\n")){B.push("...");B.push(r.indentComment(t,""))}else{B.push(`... ${t}`)}}else{B.push("...")}}else{let t=e.comment;if(t&&l)t=t.replace(/^\n+/,"");if(t){if((!l||c)&&B[B.length-1]!=="")B.push("");B.push(r.indentComment(o(t),""))}}return B.join("\n")+"\n"}t.stringifyDocument=stringifyDocument},8689:(e,t)=>{"use strict";function stringifyNumber({format:e,minFractionDigits:t,tag:B,value:s}){if(typeof s==="bigint")return String(s);const n=typeof s==="number"?s:Number(s);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!B||B==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let e=r.indexOf(".");if(e<0){e=r.length;r+="."}let B=t-(r.length-e-1);while(B-- >0)r+="0"}return r}t.stringifyNumber=stringifyNumber},9748:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(2148);var i=B(9799);function stringifyPair({key:e,value:t},B,a,o){const{allNullValues:l,doc:c,indent:C,indentStep:u,options:{commentString:f,indentSeq:h,simpleKeys:p}}=B;let g=s.isNode(e)&&e.comment||null;if(p){if(g){throw new Error("With simple keys, key nodes cannot have comments")}if(s.isCollection(e)||!s.isNode(e)&&typeof e==="object"){const e="With simple keys, collection cannot be used as a key value";throw new Error(e)}}let m=!p&&(!e||g&&t==null&&!B.inFlow||s.isCollection(e)||(s.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==="object"));B=Object.assign({},B,{allNullValues:false,implicitKey:!m&&(p||!l),indent:C+u});let d=false;let D=false;let E=r.stringify(e,B,()=>d=true,()=>D=true);if(!m&&!B.inFlow&&E.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=true}if(B.inFlow){if(l||t==null){if(d&&a)a();return E===""?"?":m?`? ${E}`:E}}else if(l&&!p||t==null&&m){E=`? ${E}`;if(g&&!d){E+=i.lineComment(E,B.indent,f(g))}else if(D&&o)o();return E}if(d)g=null;if(m){if(g)E+=i.lineComment(E,B.indent,f(g));E=`? ${E}\n${C}:`}else{E=`${E}:`;if(g)E+=i.lineComment(E,B.indent,f(g))}let y,b,O;if(s.isNode(t)){y=!!t.spaceBefore;b=t.commentBefore;O=t.comment}else{y=false;b=null;O=null;if(t&&typeof t==="object")t=c.createNode(t)}B.implicitKey=false;if(!m&&!g&&s.isScalar(t))B.indentAtStart=E.length+1;D=false;if(!h&&u.length>=2&&!B.inFlow&&!m&&s.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor){B.indent=B.indent.substring(2)}let w=false;const S=r.stringify(t,B,()=>w=true,()=>D=true);let N=" ";if(g||y||b){N=y?"\n":"";if(b){const e=f(b);N+=`\n${i.indentComment(e,B.indent)}`}if(S===""&&!B.inFlow){if(N==="\n"&&O)N="\n\n"}else{N+=`\n${B.indent}`}}else if(!m&&s.isCollection(t)){const e=S[0];const s=S.indexOf("\n");const n=s!==-1;const r=B.inFlow??t.flow??t.items.length===0;if(n||!r){let t=false;if(n&&(e==="&"||e==="!")){let B=S.indexOf(" ");if(e==="&"&&B!==-1&&B{"use strict";var s=B(3301);var n=B(4475);const getFoldOptions=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});const containsDocumentMarker=e=>/^(%|---|\.\.\.)/m.test(e);function lineLengthOverLimit(e,t,B){if(!t||t<0)return false;const s=t-B;const n=e.length;if(n<=s)return false;for(let t=0,B=0;ts)return true;B=t+1;if(n-B<=s)return false}}return true}function doubleQuotedString(e,t){const B=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return B;const{implicitKey:s}=t;const r=t.options.doubleQuotedMinMultiLineLength;const i=t.indent||(containsDocumentMarker(e)?" ":"");let a="";let o=0;for(let e=0,t=B[e];t;t=B[++e]){if(t===" "&&B[e+1]==="\\"&&B[e+2]==="n"){a+=B.slice(o,e)+"\\ ";e+=1;o=e;t="\\"}if(t==="\\")switch(B[e+1]){case"u":{a+=B.slice(o,e);const t=B.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:if(t.substr(0,2)==="00")a+="\\x"+t.substr(2);else a+=B.substr(e,6)}e+=5;o=e+1}break;case"n":if(s||B[e+2]==='"'||B.length\n";let h;let p;for(p=B.length;p>0;--p){const e=B[p-1];if(e!=="\n"&&e!=="\t"&&e!==" ")break}let g=B.substring(p);const m=g.indexOf("\n");if(m===-1){h="-"}else if(B===g||m!==g.length-1){h="+";if(o)o()}else{h=""}if(g){B=B.slice(0,-g.length);if(g[g.length-1]==="\n")g=g.slice(0,-1);g=g.replace(r,`$&${u}`)}let d=false;let D;let E=-1;for(D=0;D{r=true}}const o=n.foldFlowLines(`${y}${e}${g}`,u,n.FOLD_BLOCK,a);if(!r)return`>${O}\n${u}${o}`}B=B.replace(/\n+/g,`$&${u}`);return`|${O}\n${u}${y}${B}${g}`}function plainString(e,t,B,r){const{type:i,value:a}=e;const{actualString:o,implicitKey:l,indent:c,indentStep:C,inFlow:u}=t;if(l&&a.includes("\n")||u&&/[[\]{},]/.test(a)){return quotedString(a,t)}if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)){return l||u||!a.includes("\n")?quotedString(a,t):blockString(e,t,B,r)}if(!l&&!u&&i!==s.Scalar.PLAIN&&a.includes("\n")){return blockString(e,t,B,r)}if(containsDocumentMarker(a)){if(c===""){t.forceBlockIndent=true;return blockString(e,t,B,r)}else if(l&&c===C){return quotedString(a,t)}}const f=a.replace(/\n+/g,`$&\n${c}`);if(o){const test=e=>e.default&&e.tag!=="tag:yaml.org,2002:str"&&e.test?.test(f);const{compat:e,tags:B}=t.doc.schema;if(B.some(test)||e?.some(test))return quotedString(a,t)}return l?f:n.foldFlowLines(f,c,n.FOLD_FLOW,getFoldOptions(t,false))}function stringifyString(e,t,B,n){const{implicitKey:r,inFlow:i}=t;const a=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;if(o!==s.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value))o=s.Scalar.QUOTE_DOUBLE}const _stringify=e=>{switch(e){case s.Scalar.BLOCK_FOLDED:case s.Scalar.BLOCK_LITERAL:return r||i?quotedString(a.value,t):blockString(a,t,B,n);case s.Scalar.QUOTE_DOUBLE:return doubleQuotedString(a.value,t);case s.Scalar.QUOTE_SINGLE:return singleQuotedString(a.value,t);case s.Scalar.PLAIN:return plainString(a,t,B,n);default:return null}};let l=_stringify(o);if(l===null){const{defaultKeyType:e,defaultStringType:B}=t.options;const s=r&&e||B;l=_stringify(s);if(l===null)throw new Error(`Unsupported default string type ${s}`)}return l}t.stringifyString=stringifyString},204:(e,t,B)=>{"use strict";var s=B(1127);const n=Symbol("break visit");const r=Symbol("skip children");const i=Symbol("remove node");function visit(e,t){const B=initVisitor(t);if(s.isDocument(e)){const t=visit_(null,e.contents,B,Object.freeze([e]));if(t===i)e.contents=null}else visit_(null,e,B,Object.freeze([]))}visit.BREAK=n;visit.SKIP=r;visit.REMOVE=i;function visit_(e,t,B,r){const a=callVisitor(e,t,B,r);if(s.isNode(a)||s.isPair(a)){replaceNode(e,r,a);return visit_(e,a,B,r)}if(typeof a!=="symbol"){if(s.isCollection(t)){r=Object.freeze(r.concat(t));for(let e=0;e{ +(()=>{var e={2047:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);const{URL:r}=B(3136);const{benchmarkKey:i}=B(8817);const{loadSnapshot:a}=B(1283);const{assert:o,compareText:l,hasControl:c,median:C,safePart:u,walkFiles:f,writeJSON:h}=B(8793);const p=1;function validLabel(e,t,B=160){o(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e&&!c(e),`${t} must be a trimmed string of 1..${B} bytes`)}function validURL(e,t){let B;try{B=new r(e)}catch{throw new Error(`invalid ${t} ${JSON.stringify(e)}`)}o(B.protocol==="https:"&&B.hostname&&!B.username&&!B.password&&!/[<>\r\n]/u.test(e),`invalid ${t} ${JSON.stringify(e)}`)}function validUnit(e){return typeof e==="string"&&Buffer.byteLength(e)>=1&&Buffer.byteLength(e)<=64&&!c(e)&&!/[\s`|<>]/u.test(e)}function validBenchmarkName(e){return typeof e==="string"&&e.startsWith("Benchmark")&&e.length>"Benchmark".length&&Buffer.byteLength(e)<=300&&!c(e)&&!/[\s`|<>]/u.test(e)}function validateMeasurements(e,t){o(t&&typeof t==="object"&&!Array.isArray(t)&&Object.keys(t).length>=1&&Object.keys(t).length<=32,`benchmark ${JSON.stringify(e)} has an invalid measurement count`);for(const[B,s]of Object.entries(t)){o(validUnit(B),`benchmark ${JSON.stringify(e)} has invalid unit ${JSON.stringify(B)}`);o(typeof s==="number"&&Number.isFinite(s)&&s>=0,`benchmark ${JSON.stringify(e)} unit ${JSON.stringify(B)} has invalid value`)}}function validateResult(e,t,B={}){const s=B.trustedLayout??true;const n=s?t.maxBenchmarks:5e3;o(e?.schemaVersion===p,`unsupported result schema ${e?.schemaVersion}`);o(e.suiteId===t.id,`suite id ${JSON.stringify(e.suiteId)} does not match config ${JSON.stringify(t.id)}`);o(u(e.shardId),`invalid shard id ${JSON.stringify(e.shardId)}`);o(e.samplePairing===undefined||e.samplePairing==="index",`invalid sample pairing ${JSON.stringify(e.samplePairing)}`);o(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(e.source?.repository),`invalid source repository ${JSON.stringify(e.source?.repository)}`);o(/^[0-9a-f]{40}$/u.test(e.source.sha),`invalid source SHA ${JSON.stringify(e.source.sha)}`);validURL(e.source.url,"source URL");if(e.source.runUrl)validURL(e.source.runUrl,"run URL");o(typeof e.source.timestamp==="string"&&!Number.isNaN(Date.parse(e.source.timestamp)),"source timestamp is invalid");o(u(e.platform?.id),`invalid platform id ${JSON.stringify(e.platform?.id)}`);validLabel(e.platform.label,"platform label");o(Array.isArray(e.benchmarks)&&e.benchmarks.length>=1&&e.benchmarks.length<=n,`benchmark count is outside 1..${n}`);o(Object.keys(e.units??{}).length<=64,"unit metadata count exceeds 64");for(const[t,B]of Object.entries(e.units??{})){o(validUnit(t),`invalid metadata unit ${JSON.stringify(t)}`);o(B.better===undefined||B.better==="higher"||B.better==="lower",`unit ${t} has invalid better value`);o(B.assume===undefined||B.assume==="nothing"||B.assume==="exact",`unit ${t} has invalid assume value`)}const r=new Set;for(const B of e.benchmarks){o(validBenchmarkName(B.name),`invalid benchmark name ${JSON.stringify(B.name)}`);o(!B.package||/^[A-Za-z0-9._~+/-]+$/u.test(B.package),`benchmark ${B.name} has invalid package ${JSON.stringify(B.package)}`);const e=i(B);o(!r.has(e),`duplicate benchmark ${JSON.stringify(e)}`);r.add(e);if(s){o(t.includeBenchmark(B.name,e),`benchmark ${JSON.stringify(e)} is excluded by trusted config`);const s=t.layoutFor(B.name,e);o(B.group===s.group&&B.chart===s.chart,`benchmark ${JSON.stringify(e)} layout does not match trusted config`)}else{o(B.group==="other"||u(B.group)&&B.group===B.group.toLowerCase(),`benchmark ${JSON.stringify(e)} has invalid stored group`);o(B.chart===`group:${B.group}`||B.chart===`benchmark:${e}`,`benchmark ${JSON.stringify(e)} has invalid stored chart`)}o(Array.isArray(B.samples)&&B.samples.length>=1&&B.samples.length<=100,`benchmark ${JSON.stringify(e)} sample count is outside 1..100`);const n=new Map;for(const t of B.samples){o(Number.isSafeInteger(t.iterations)&&t.iterations>0,`benchmark ${JSON.stringify(e)} has invalid iterations`);validateMeasurements(e,t.measurements);for(const[e,B]of Object.entries(t.measurements)){if(!n.has(e))n.set(e,[]);n.get(e).push(B)}}validateMeasurements(e,B.measurements);o(n.size===Object.keys(B.measurements).length,`benchmark ${JSON.stringify(e)} sample and summary units do not match`);for(const[t,s]of Object.entries(B.measurements)){o(n.has(t)&&s===C(n.get(t)),`benchmark ${JSON.stringify(e)} unit ${JSON.stringify(t)} summary is not the sample median`)}}return e}function validateSamplePairing(e,t){if(e.samplePairing===undefined&&t?.samplePairing===undefined){return}o(e.samplePairing==="index"&&t?.samplePairing==="index","index sample pairing requires a paired baseline");const B=new Map(t.benchmarks.map(e=>[i(e),e]));o(e.benchmarks.length===t.benchmarks.length,"index-paired result and baseline benchmark counts differ");for(const t of e.benchmarks){const e=i(t);const s=B.get(e);o(s,`index-paired baseline is missing benchmark ${JSON.stringify(e)}`);o(t.samples.length===s.samples.length,`index-paired benchmark ${JSON.stringify(e)} sample counts differ`);for(let B=0;B{const t=JSON.parse(s.readFileSync(e,"utf8"));try{validateResult(t,B);const r=n.join(n.dirname(e),"baseline.json");const i=s.existsSync(r);const a=c.get(t.platform.id);o(a===undefined||a===i,`same-runner baseline must be present for every shard of platform ${JSON.stringify(t.platform.id)}`);c.set(t.platform.id,i);if(i){const e=validateResult(JSON.parse(s.readFileSync(r,"utf8")),B);o(e.shardId===t.shardId,`baseline shard ${JSON.stringify(e.shardId)} does not match result shard ${JSON.stringify(t.shardId)}`);o(JSON.stringify(e.platform)===JSON.stringify(t.platform),`baseline platform does not match result platform ${JSON.stringify(t.platform.id)}`);validateSamplePairing(t,e);l.push(e)}return t}catch(t){throw new Error(`${e}: ${t.message}`,{cause:t})}});return{config:B,results:mergeShards(C),baselines:l.length===0?[]:mergeShards(l)}}function mergeMetadata(e,t,B){for(const[s,n]of Object.entries(t??{})){if(e[s]){o(JSON.stringify(e[s])===JSON.stringify(n),`platform ${B} has conflicting metadata for ${s}`)}else{e[s]=n}}}function mergeShards(e){o(e.length>=1&&e.length<=256,"shard count is outside 1..256");const t=e[0];const B=`${t.source.repository}@${t.source.sha}`;const s=new Set;const n=new Map;for(const t of e){o(`${t.source.repository}@${t.source.sha}`===B,`shard ${t.shardId} source does not match ${B}`);const e=`${t.platform.id}/${t.shardId}`;o(!s.has(e),`duplicate shard ${JSON.stringify(e)}`);s.add(e);let r=n.get(t.platform.id);if(!r){r={...t,shardId:"merged",units:{},benchmarks:[]};n.set(t.platform.id,r)}else{o(JSON.stringify(r.platform)===JSON.stringify(t.platform),`platform ${t.platform.id} metadata differs between shards`);o(r.samplePairing===t.samplePairing,`platform ${t.platform.id} sample pairing differs between shards`)}mergeMetadata(r.units,t.units,t.platform.id);const a=new Set(r.benchmarks.map(i));for(const e of t.benchmarks){const B=i(e);o(!a.has(B),`platform ${t.platform.id} repeats benchmark ${JSON.stringify(B)} across shards`);a.add(B);r.benchmarks.push(e)}if(Date.parse(t.source.timestamp)>Date.parse(r.source.timestamp)){r.source=t.source}}return[...n.values()].map(e=>({...e,benchmarks:e.benchmarks.toSorted((e,t)=>l(i(e),i(t)))})).sort((e,t)=>l(e.platform.id,t.platform.id))}e.exports={loadArtifacts:loadArtifacts,mergeShards:mergeShards,schemaVersion:p,validateResult:validateResult,writeArtifact:writeArtifact}},6247:(e,t,B)=>{"use strict";const s=B(3024);const n=B(8161);const r=B(6760);const{parseArgs:i}=B(7975);const{loadArtifacts:a,validateResult:o,writeArtifact:l,schemaVersion:c}=B(2047);const{loadConfig:C}=B(1283);const{parseGoBenchmark:u}=B(8817);const{writeReport:f}=B(8959);const{entryFromResults:h,update:p}=B(7864);const{assert:g,safePart:m,writeOutputs:d}=B(8793);function options(e,t){const B=i({args:e,options:Object.fromEntries(Object.keys(t).map(e=>[e,{type:"string"}])),strict:true});return B.values}function required(e,t,B){for(const s of t){g(e[s],`${B} requires --${s}`)}}function goOS(){return{win32:"windows"}[process.platform]??process.platform}function goArch(){return{x64:"amd64",ia32:"386"}[process.arch]??process.arch}function displayOS(e){return{darwin:"macOS",linux:"Linux",windows:"Windows"}[e]??e}function githubEvent(){const e=process.env.GITHUB_EVENT_PATH;if(!e)return{};try{return JSON.parse(s.readFileSync(e,"utf8"))}catch(t){throw new Error(`read GitHub event ${e}: ${t.message}`,{cause:t})}}function sourceDefaults(){const e=githubEvent();const t=e.pull_request?.head;return{repository:t?.repo?.full_name||process.env.GITHUB_REPOSITORY||"",sha:t?.sha||process.env.GITHUB_SHA||"",ref:t?.ref||process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME||process.env.GITHUB_REF||""}}function baselineSourceDefaults(){const e=githubEvent().pull_request?.base;return{repository:e?.repo?.full_name||"",sha:e?.sha||"",ref:e?.ref||""}}function serverURL(){return(process.env.GITHUB_SERVER_URL||"https://github.com").replace(/\/+$/u,"")}function defaultSourceURL(e,t){return`${serverURL()}/${e}/commit/${t}`}function defaultRunURL(){return process.env.GITHUB_RUN_ID&&process.env.GITHUB_REPOSITORY?`${serverURL()}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`:""}function defaultTemporaryDirectory(e){const t=process.env.RUNNER_TEMP||n.tmpdir();s.mkdirSync(t,{recursive:true});return s.mkdtempSync(r.join(t,e))}function runRecord(e,t={}){const B=options(e,{config:true,input:true,"baseline-input":true,"baseline-repository":true,"baseline-sha":true,"baseline-ref":true,"sample-pairing":true,"output-dir":true,"platform-id":true,"platform-label":true,"shard-id":true,os:true,arch:true,runner:true,repository:true,sha:true,ref:true,"source-url":true,"run-url":true,timestamp:true,"github-output":true});required(B,["config","input"],"record");const n=C(B.config);const r=u(s.readFileSync(B.input,"utf8"),n);const i=B.os||r.fileConfig.goos||goOS();const a=B.arch||r.fileConfig.goarch||goArch();const o=B["platform-id"]||`${i}-${a}`;const f=B["shard-id"]||process.env.GITHUB_JOB||"default";g(m(o),`invalid platform id ${JSON.stringify(o)}`);g(m(f),`invalid shard id ${JSON.stringify(f)}`);const h=sourceDefaults();const p=B.repository||h.repository;const D=B.sha||h.sha;const E=B["source-url"]||defaultSourceURL(p,D);const y=B["run-url"]||defaultRunURL();const b=B.timestamp||(new Date).toISOString();const O={id:o,label:B["platform-label"]||`${displayOS(i)} / ${a}`,os:i,arch:a,...B.runner?{runner:B.runner}:{}};const w={schemaVersion:c,suiteId:n.id,shardId:f,...B["sample-pairing"]?{samplePairing:B["sample-pairing"]}:{},source:{repository:p,sha:D,...B.ref||h.ref?{ref:B.ref||h.ref}:{},url:E,...y?{runUrl:y}:{},timestamp:b},platform:O,units:r.units,benchmarks:r.benchmarks};let S=null;if(B["baseline-input"]){const e=baselineSourceDefaults();const t=B["baseline-repository"]||e.repository;const r=B["baseline-sha"]||e.sha;const i=B["baseline-ref"]||e.ref;g(t&&r,"baseline repository and SHA are required with --baseline-input");const a=u(s.readFileSync(B["baseline-input"],"utf8"),n);S={schemaVersion:c,suiteId:n.id,shardId:f,...B["sample-pairing"]?{samplePairing:B["sample-pairing"]}:{},source:{repository:t,sha:r,...i?{ref:i}:{},url:defaultSourceURL(t,r),...y?{runUrl:y}:{},timestamp:b},platform:O,units:a.units,benchmarks:a.benchmarks}}const N=B["output-dir"]||defaultTemporaryDirectory(`go-benchmark-${n.id}-${o}-${f}-`);l(N,n,w,S);const F=`go-benchmark-${n.id}-${o}-${f}`;const A={"artifact-name":F,"artifact-path":N,"platform-id":o,"shard-id":f,"suite-id":n.id};d(t.githubOutput??B["github-output"]??process.env.GITHUB_OUTPUT,A);console.log(`Recorded ${r.benchmarks.length} benchmarks for ${o}/${f} in ${N}`);return{outputDirectory:N,outputs:A}}function series(e,t=""){return{kind:e[`${t}series-kind`],id:e[`${t}series-id`],label:e[`${t}series-label`]}}function bindSource(e,t,B){const s=B["expected-source-repository"];const n=B["expected-source-sha"];g(Boolean(s)===Boolean(n),"expected source repository and SHA must be provided together");for(const r of e){if(s){g(r.source.repository===s,`artifact source repository ${JSON.stringify(r.source.repository)} does not match ${JSON.stringify(s)}`);g(r.source.sha===n,`artifact source SHA ${JSON.stringify(r.source.sha)} does not match ${JSON.stringify(n)}`)}r.source={...r.source,...B["source-ref"]?{ref:B["source-ref"]}:{},...B["source-url"]?{url:B["source-url"]}:{},...B["source-run-url"]?{runUrl:B["source-run-url"]}:{},...B["source-timestamp"]?{timestamp:B["source-timestamp"]}:{}};o(r,t)}}function bindBaselineSource(e,t,B){if(e.length===0)return;const s=B["expected-baseline-repository"];const n=B["expected-baseline-sha"];g(s,"expected baseline repository is required with a paired baseline");for(const r of e){g(r.source.repository===s,`artifact baseline repository ${JSON.stringify(r.source.repository)} does not match ${JSON.stringify(s)}`);if(n){g(r.source.sha===n,`artifact baseline SHA ${JSON.stringify(r.source.sha)} does not match ${JSON.stringify(n)}`)}const e=n||r.source.sha;r.source={...r.source,repository:s,sha:e,...B["baseline-source-ref"]?{ref:B["baseline-source-ref"]}:{},url:defaultSourceURL(s,e),...B["source-run-url"]?{runUrl:B["source-run-url"]}:{},...B["source-timestamp"]?{timestamp:B["source-timestamp"]}:{}};o(r,t)}}function bindConfig(e,t){if(!t)return;const B=C(t);g(JSON.stringify(e.config.toJSON())===JSON.stringify(B.toJSON()),"artifact configuration does not match the trusted configuration");for(const t of e.results)o(t,B);for(const t of e.baselines)o(t,B);e.config=B}function runRender(e,t={}){const B=options(e,{artifacts:true,"data-dir":true,"trusted-config":true,"series-kind":true,"series-id":true,"series-label":true,"additional-series-kind":true,"additional-series-id":true,"additional-series-label":true,"site-base-url":true,"expected-source-repository":true,"expected-source-sha":true,"expected-baseline-repository":true,"expected-baseline-sha":true,"baseline-source-ref":true,"source-ref":true,"source-url":true,"source-run-url":true,"source-timestamp":true,comment:true,"github-output":true});required(B,["artifacts","data-dir","series-kind","series-id","series-label"],"render");const s=a(B.artifacts);bindConfig(s,B["trusted-config"]);bindSource(s.results,s.config,B);bindBaselineSource(s.baselines,s.config,B);const n=series(B);const i=s.baselines.length===0?null:h(s.baselines,s.config);const o=p(B["data-dir"],s.config,n,s.results,{comparison:n.kind==="pull"?i:null});const l=[B["additional-series-kind"],B["additional-series-id"],B["additional-series-label"]];if(l.some(Boolean)){g(l.every(Boolean),"additional series kind, id, and label must be provided together");p(B["data-dir"],s.config,series(B,"additional-"),s.results,{comparison:i})}const c=B.comment||r.join(B["data-dir"],".go-benchmark-comment.md");const C=B["site-base-url"]?`${B["site-base-url"].replace(/\/+$/u,"")}/${s.config.sitePath.replace(/^\/+|\/+$/gu,"")}/?series=${encodeURIComponent(`${n.kind}/${n.id}`)}`:"";f(c,C,s.config,o.entry,i||o.main,{sameRunner:Boolean(i)});const u={"comment-path":c,marker:`\x3c!-- go-benchmark:${s.config.id} --\x3e`,"site-path":o.sitePath,"site-url":C,"suite-id":s.config.id};d(t.githubOutput??B["github-output"]??process.env.GITHUB_OUTPUT,u);console.log(`Updated ${n.kind} series ${n.id} with ${s.results.length} platforms`);return{outputs:u}}e.exports={runRecord:runRecord,runRender:runRender}},4408:(e,t,B)=>{"use strict";const{benchmarkKey:s}=B(8817);const{median:n}=B(8793);function benchmarkIndex(e){return new Map((e?.benchmarks??[]).map(e=>[s(e),e]))}function isIndexPaired(e,t,B){return B&&e?.samplePairing==="index"&&t?.samplePairing==="index"}function sampleValues(e,t){return e.samples.flatMap(e=>Object.hasOwn(e.measurements,t)?[e.measurements[t]]:[])}function metricComparison(e,t,B,s){const r=e?.measurements?.[B];const i=t?.measurements?.[B];const a={baseline:i,...r!==undefined&&i!==undefined?{difference:r-i}:{}};if(!s||!e||!t){return a}const o=sampleValues(e,B);const l=sampleValues(t,B);if(o.length===0||o.length!==l.length){return a}const c=[];const C=[];let u=true;for(let e=0;e{"use strict";const s=B(6760);const n=B(8815);const{RE2JS:r}=B(6472);const{assert:i,hasControl:a,safePart:o}=B(8793);const{parseViews:l,serializeViews:c}=B(7675);const C=B(3024);function stringList(e,t){if(e===undefined||e===null||e==="")return[];if(typeof e==="string")return[e];i(Array.isArray(e)&&e.every(e=>typeof e==="string"),`${t} must be a string or string list`);return e}function label(e,t,B=120){i(typeof e==="string",`${t} must be a string`);i(e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e,`${t} must be a trimmed string of 1..${B} bytes`);i(!a(e),`${t} contains a control character`);return e}function title(e){return e.split(/[-_.]/u).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join(" ")}function compilePatterns(e,t){return e.map(e=>{try{return r.compile(e)}catch(B){throw new Error(`${t} pattern ${JSON.stringify(e)}: ${B.message}`,{cause:B})}})}function matches(e,t,B){const s=t.replace(/^Benchmark/u,"");const n=B.replace("::Benchmark","::");return e.some(e=>[t,s,B,n].some(t=>e.matcher(t).find()))}class Config{constructor(e,t="configuration"){i(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);this.version=e.version??1;i(this.version===1,`unsupported version ${this.version}`);this.id=e.id;i(typeof this.id==="string"&&/^[a-z0-9][a-z0-9._-]*$/.test(this.id),"invalid id");this.title=label(e.title??`${this.id} benchmarks`,"title");this.sitePath=s.posix.normalize(e["site-path"]??`go-benchmarks/${this.id}`);i(this.sitePath!=="."&&!this.sitePath.startsWith("../")&&!s.posix.isAbsolute(this.sitePath),`site-path ${JSON.stringify(this.sitePath)} must stay within the data branch`);this.include=stringList(e.include,"include");if(this.include.length===0)this.include=["^Benchmark"];this.exclude=stringList(e.exclude,"exclude");this.maxBenchmarks=e["max-benchmarks"]??500;i(Number.isInteger(this.maxBenchmarks)&&this.maxBenchmarks>=1&&this.maxBenchmarks<=5e3,"max-benchmarks must be between 1 and 5000");this.groups={};this.compiledGroups={};const B=e.groups??{};i(B&&typeof B==="object"&&!Array.isArray(B),"groups must be a mapping");for(const[e,t]of Object.entries(B)){i(o(e)&&e===e.toLowerCase(),`invalid group id ${JSON.stringify(e)}`);const B=typeof t==="string"||Array.isArray(t)?{match:t}:{...t};i(B&&typeof B==="object",`group ${e} must be a pattern or mapping`);const s=stringList(B.match,`group ${e} match`);i(s.length!==0,`group ${e} has no match pattern`);const n=B.chart??"combined";i(n==="combined"||n==="single",`group ${e} chart must be combined or single`);this.groups[e]={title:label(B.title??title(e),`group ${e} title`),match:s,chart:n};this.compiledGroups[e]=compilePatterns(s,`group ${e}`)}this.views=l(e.views);this.compiledInclude=compilePatterns(this.include,"include");this.compiledExclude=compilePatterns(this.exclude,"exclude")}includeBenchmark(e,t){return matches(this.compiledInclude,e,t)&&!matches(this.compiledExclude,e,t)}layoutFor(e,t){const B=Object.keys(this.groups).filter(B=>matches(this.compiledGroups[B],e,t)).sort();i(B.length<=1,`benchmark ${JSON.stringify(t)} matches multiple groups: ${B.join(", ")}`);if(B.length===0)return{group:"other",chart:`benchmark:${t}`};const s=B[0];return{group:s,chart:this.groups[s].chart==="single"?`benchmark:${t}`:`group:${s}`}}toJSON(){return{version:this.version,id:this.id,title:this.title,sitePath:this.sitePath,include:this.include,exclude:this.exclude,maxBenchmarks:this.maxBenchmarks,groups:this.groups,views:c(this.views)}}}function loadConfig(e){let t;try{t=n.parse(C.readFileSync(e,"utf8"),{uniqueKeys:true})}catch(t){throw new Error(`parse ${e}: ${t.message}`,{cause:t})}return new Config(t,e)}function loadSnapshot(e){const t=JSON.parse(C.readFileSync(e,"utf8"));const B={...t,"site-path":t.sitePath,"max-benchmarks":t.maxBenchmarks};return new Config(B,e)}e.exports={Config:Config,loadConfig:loadConfig,loadSnapshot:loadSnapshot}},8817:(e,t,B)=>{"use strict";const{assert:s,compareText:n,median:r}=B(8793);const i=new Map([["ns/op","lower"],["sec/op","lower"],["MB/s","higher"],["B/s","higher"],["B/op","lower"],["allocs/op","lower"]]);function parseNumber(e,t){const B=Number(e);s(Number.isFinite(B)&&B>=0,`${t} has invalid value ${JSON.stringify(e)}`);return B}function parseIterations(e,t){s(/^[0-9]+$/u.test(e),`benchmark ${JSON.stringify(t)} has invalid iteration count ${JSON.stringify(e)}`);const B=Number(e);s(Number.isSafeInteger(B)&&B>0,`benchmark ${JSON.stringify(t)} has invalid iteration count ${JSON.stringify(e)}`);return B}function parseUnitLine(e,t,B){s(e.length>=2,`line ${B}: missing unit`);const n=e[1];for(const r of e.slice(2)){const e=r.indexOf("=");s(e>0,`line ${B}: expected key=value`);const i=r.slice(0,e);const a=r.slice(e+1);s(i==="better"||i==="assume",`line ${B}: unsupported unit metadata ${i}`);if(i==="better")s(a==="higher"||a==="lower",`line ${B}: invalid better value ${a}`);if(i==="assume")s(a==="nothing"||a==="exact",`line ${B}: invalid assume value ${a}`);const o=t[n]??{};s(o[i]===undefined||o[i]===a,`line ${B}: conflicting ${i} metadata for ${n}`);o[i]=a;t[n]=o}}function parseBenchmarkLine(e,t,B,n,r){s(e.length>=4&&(e.length-2)%2===0,`line ${r}: malformed benchmark result`);const i=e[0].replace(/-[0-9]+$/u,"");const a=t?`${t}::${i}`:i;if(!B.includeBenchmark(i,a))return;const o=parseIterations(e[1],a);const l={};for(let t=2;tn(e,t)).map(([e,t])=>[e,r(t)]));return e}function parseGoBenchmark(e,t){const B=new Map;const r={};const a={};let o="";for(const[s,n]of e.split(/\r?\n/u).entries()){const e=s+1;const i=n.trim();if(!i)continue;const l=i.split(/\s+/u);if(l[0]==="Unit"){parseUnitLine(l,r,e);continue}if(l[0].startsWith("Benchmark")){parseBenchmarkLine(l,o,t,B,e);continue}const c=/^([a-z][a-z0-9_-]*):\s*(.*)$/u.exec(i);if(c){const[,e,t]=c;a[e]=t;if(e==="pkg")o=t}}s(B.size!==0,"no included Go benchmarks found");s(B.size<=t.maxBenchmarks,`benchmark count exceeds max-benchmarks ${t.maxBenchmarks}`);const l=[...B.values()].map(summarize).sort((e,t)=>n(benchmarkKey(e),benchmarkKey(t)));for(const e of l){for(const t of Object.keys(e.measurements)){if(!r[t]&&i.has(t))r[t]={better:i.get(t)}}}return{benchmarks:l,units:r,fileConfig:a}}function benchmarkKey(e){return e.package?`${e.package}::${e.name}`:e.name}e.exports={benchmarkKey:benchmarkKey,parseGoBenchmark:parseGoBenchmark}},4217:e=>{"use strict";function markdown(e){return String(e).replace(/[\\*_[\]#`]/gu,"\\$&")}function tableCell(e){return markdown(e).replaceAll("|","\\|").replaceAll("\n"," ")}function formatNumber(e){if(Number.isInteger(e)&&e<1e12)return String(e);return e.toFixed(3)}function formatPreciseNumber(e){if(e===0||Number.isInteger(e))return String(e);const t=Math.abs(e);if(t<1e-7){const[t,B]=e.toExponential(3).split("e");return`${t.replace(/\.?0+$/u,"")}e${B}`}const B=t>=999.95?0:t>=99.995?1:t>=9.9995?2:t>=.99995?3:t>=.099995?4:t>=.0099995?5:t>=99995e-8?6:7;return e.toFixed(B).replace(/0+$/u,"").replace(/\.$/u,"")}function formatSigned(e,t){const B=Object.is(e,-0)?0:e;const s=B>0?"+":B<0?"-":"";return`${s}${t(Math.abs(B))}`}function formatDelta(e,t){const B=e.toFixed(1);const s=e!==0&&Number(B)===0?formatPreciseNumber(e):B;const n=`${e>=0?"+":""}${s}%`;if(e===0||t!=="lower"&&t!=="higher")return n;const r=t==="lower"&&e<0||t==="higher"&&e>0;return`${n} (${r?"better":"worse"})`}function delta(e,t,B){if(t===undefined)return"new";if(t===0)return e===0?"0.0%":"from 0";return formatDelta((e/t-1)*100,B)}e.exports={delta:delta,formatDelta:formatDelta,formatNumber:formatNumber,formatPreciseNumber:formatPreciseNumber,formatSigned:formatSigned,markdown:markdown,tableCell:tableCell}},2080:(e,t,B)=>{"use strict";const s=B(6760);const{runRender:n}=B(6247);function workspacePath(e){return s.isAbsolute(e)?e:s.join(process.env.GITHUB_WORKSPACE||process.cwd(),e)}function input(e){const t=`BENCHMARK_${e.replaceAll("-","_").toUpperCase()}`;return process.env[t]??""}function add(e,t,B){if(B)e.push(`--${t}`,B)}function run(){const e=["--artifacts",workspacePath(input("artifacts")),"--data-dir",workspacePath(input("data-directory")),"--series-kind",input("series-kind"),"--series-id",input("series-id"),"--series-label",input("series-label"),"--comment",workspacePath(input("comment-path"))];if(input("trusted-config")){add(e,"trusted-config",workspacePath(input("trusted-config")))}add(e,"additional-series-kind",input("additional-series-kind"));add(e,"additional-series-id",input("additional-series-id"));add(e,"additional-series-label",input("additional-series-label"));add(e,"site-base-url",input("site-base-url"));add(e,"expected-source-repository",input("expected-source-repository"));add(e,"expected-source-sha",input("expected-source-sha"));add(e,"expected-baseline-repository",input("expected-baseline-repository"));add(e,"expected-baseline-sha",input("expected-baseline-sha"));add(e,"baseline-source-ref",input("baseline-source-ref"));add(e,"source-ref",input("source-ref"));add(e,"source-url",input("source-url"));add(e,"source-run-url",input("source-run-url"));add(e,"source-timestamp",input("source-timestamp"));return n(e)}e.exports={run:run}},8959:(e,t,B)=>{"use strict";const s=B(3024);const{benchmarkKey:n}=B(8817);const{benchmarkIndex:r,isIndexPaired:i,metricComparison:a}=B(4408);const{delta:o,formatDelta:l,formatNumber:c,formatPreciseNumber:C,formatSigned:u,markdown:f,tableCell:h}=B(4217);const{compareText:p}=B(8793);const{renderViews:g}=B(6919);function groupTitle(e,t){if(t==="other")return"Other";return e.groups[t]?.title??t}function writeReport(e,t,m,d,D,E={}){const y=d.source;const b=E.sameRunner??false;const O=b?"vs base":"vs main";const w=[`\x3c!-- go-benchmark:${m.id} --\x3e`,`## ${f(m.title)}`,"",`[\`${y.sha.slice(0,12)}\`](<${y.url}>)`+(y.runUrl?` | [workflow run](<${y.runUrl}>)`:"")+(t?` | [long-term charts](<${t}>)`:""),""];if(Object.keys(m.views).length>0){w.push(...g(m,d,D,O,b))}else{for(const e of Object.keys(d.platforms).sort(p)){const t=d.platforms[e];const B=D?.platforms?.[e];const s=r(B);const g=i(t,B,b);w.push(`### ${f(t.platform.label)}`,"",`| Group | Benchmark | Metric | Current | ${O} |`,"|---|---|---|---:|---:|");for(const e of t.benchmarks){for(const B of Object.keys(e.measurements).sort(p)){const r=n(e);const i=a(e,s.get(r),B,g);const f=i.change===undefined?o(e.measurements[B],i.baseline,t.units?.[B]?.better):l(i.change,t.units?.[B]?.better);const p=i.difference===undefined?f:`${u(i.difference,e=>`${C(e)} ${B}`)} / ${f}`;w.push(`| ${h(groupTitle(m,e.group))} | \`${r}\` | \`${B}\` | ${c(e.measurements[B])} | ${p} |`)}}w.push("")}}let S;if(D&&b){const e=Object.entries(d.platforms).some(([e,t])=>i(t,D.platforms?.[e],b));const t=Object.keys(d.platforms).some(e=>!D.platforms?.[e]);S=`_Compared with [\`${D.source.sha.slice(0,12)}\`](<${D.source.url}>) measured in the same runner job${e?"; index-paired signed differences and percentage changes are pairwise medians":""}.${t?" Platforms without a paired baseline are marked `new`.":""}_`}else if(D){S="_Compared only with the latest matching platform in the main series._"}else{S="_No main baseline exists yet; all metrics are marked `new`._"}w.push(S,"");if(Buffer.byteLength(w.join("\n"))>65e3){throw new Error("benchmark report exceeds the GitHub comment size limit")}s.mkdirSync(B(6760).dirname(e),{recursive:true});s.writeFileSync(e,w.join("\n"))}e.exports={delta:o,writeReport:writeReport}},7864:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);const{validateResult:r}=B(2047);const{loadSnapshot:i}=B(1283);const{benchmarkKey:a}=B(8817);const{assert:o,compareText:l,hasControl:c,readJSONIfExists:C,safePart:u,walkFiles:f,writeJSON:h}=B(8793);const p=1;const g=500;const m=["app.js","index.html","styles.css"];function validateLabel(e,t){o(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=160&&e.trim()===e&&!c(e),`${t} must be a trimmed string of 1..160 bytes`)}function validateSeries(e){o(e?.kind==="main"||e?.kind==="branch"||e?.kind==="pull",`unsupported series kind ${JSON.stringify(e?.kind)}`);o(u(e.id),`invalid series id ${JSON.stringify(e.id)}`);validateLabel(e.label,"series label")}function normalizeStoredResult(e,t){if(!e.shardId)e.shardId="merged";for(const t of e.benchmarks??[]){if(!t.chart){t.chart=t.group==="other"?`benchmark:${a(t)}`:`group:${t.group}`}}return r(e,t,{trustedLayout:false})}function validateEntry(e,t){o(e?.source&&e.platforms&&typeof e.platforms==="object","history entry is invalid");for(const[B,s]of Object.entries(e.platforms)){o(s?.platform?.id===B,`history platform key ${JSON.stringify(B)} does not match its result`);normalizeStoredResult(s,t);o(s.source.repository===e.source.repository&&s.source.sha===e.source.sha,`history platform ${B} source does not match its entry`)}return e}function validateHistory(e,t,B){o(e.schemaVersion===p,`unsupported history schema ${e.schemaVersion}`);o(e.suiteId===t.id&&e.kind===B.kind&&e.id===B.id,`history identity does not match ${t.id}/${B.kind}/${B.id}`);o(Array.isArray(e.entries)&&e.entries.length<=g,"history entries are invalid");for(const B of e.entries){validateEntry(B,t)}e.label=B.label}function emptyHistory(e,t){return{schemaVersion:p,suiteId:e.id,kind:t.kind,id:t.id,label:t.label,entries:[]}}function mergeHistories(e,t,B,s=false){const n=e.map(e=>C(e,null)).filter(Boolean);if(n.length===0)return s?null:emptyHistory(t,B);const r=emptyHistory(t,B);for(const e of n){validateHistory(e,t,B);for(const t of e.entries){const e=r.entries.findIndex(e=>sameSource(e,t));if(e===-1){r.entries.push(t)}else if(compareEntries(r.entries[e],t)<=0){r.entries[e]=t}}}r.entries.sort(compareEntries);if(r.entries.length>g){r.entries.splice(0,r.entries.length-g)}return r}function entryFromResults(e,t){o(e.length!==0,"cannot update history without results");const B=e[0].source;const s={};for(const n of e){r(n,t);o(n.source.repository===B.repository&&n.source.sha===B.sha,`platform ${n.platform.id} does not match source ${B.repository}@${B.sha}`);o(!Object.hasOwn(s,n.platform.id),`duplicate platform ${JSON.stringify(n.platform.id)}`);s[n.platform.id]=n}return{source:B,platforms:s}}function compareEntries(e,t){const B=Date.parse(e.source.timestamp)-Date.parse(t.source.timestamp);return B||l(e.source.sha,t.source.sha)}function compareSeries(e,t){const B={main:0,branch:1,pull:2};return B[e.kind]-B[t.kind]||l(e.label,t.label)||l(e.id,t.id)}function sameSource(e,t){return e.source.repository===t.source.repository&&e.source.sha===t.source.sha}function commitRelative(e){o(/^[0-9a-f]{40}$/u.test(e.source.sha),`invalid source SHA ${JSON.stringify(e.source.sha)}`);return n.posix.join("commits",`${e.source.sha}.json`)}function writeCommit(e,t,B,s=null){validateEntry(B,t);if(s)validateEntry(s,t);const r=commitRelative(B);const i=n.join(e,...r.split("/"));const a=C(i,null);let l=B;if(a){o(a.schemaVersion===p&&a.suiteId===t.id,`commit snapshot identity does not match ${t.id}`);validateEntry(a,t);o(a.source.sha===B.source.sha,`commit snapshot source does not match ${B.source.sha}`);if(compareEntries(a,B)>0)l=a;if(a.comparison){validateEntry(a.comparison,t);s??=a.comparison}}h(i,{schemaVersion:p,suiteId:t.id,source:l.source,platforms:l.platforms,...s?{comparison:s}:{}});return r}function latestMatchingPlatforms(e,t){if(!e?.entries?.length)return null;const B={};let s;for(let n=e.entries.length-1;n>=0&&Object.keys(B).lengths.existsSync(n.join(e,"index.html")));o(B,"bundled web assets are missing");for(const e of m){const r=n.join(B,e);const i=n.join(t,e);s.mkdirSync(n.dirname(i),{recursive:true});s.copyFileSync(r,i)}s.writeFileSync(n.join(e,".nojekyll"),"")}function migrateLegacyData(e,t){const B=n.posix.normalize(t);o(B!=="."&&!B.startsWith("../")&&!n.posix.isAbsolute(B),`site path ${JSON.stringify(t)} must stay within the data branch`);const r=n.join(e,...B.split("/"));const a=n.join(r,"series");const l=f(a,"history.json");const c=n.join(r,"series.json");const u=C(c,{schemaVersion:p,series:[]});o(u.schemaVersion===p&&Array.isArray(u.series),"unsupported or invalid series index");const g=new Set;for(const e of l){const t=n.dirname(e);const a=i(n.join(t,"config.json"));o(a.sitePath===B,`series config site path ${JSON.stringify(a.sitePath)} does not match ${JSON.stringify(B)}`);const l=C(e,null);const c={kind:l?.kind,id:l?.id,label:l?.label};validateSeries(c);validateHistory(l,a,c);const f=n.join(t,"summary.json");const p=s.existsSync(f);const m=mergeHistories([f,e],a,c);for(const e of m.entries){g.add(commitRelative(e));writeCommit(r,a,e)}if(c.kind==="pull"&&m.entries.length>0){const e=m.entries[m.entries.length-1];if(p){const t=C(f,null);validateHistory(t,a,c);const B=t.entries[t.entries.length-1];if(!B||compareEntries(B,e)<0){m.entries=[e]}else{m.entries=t.entries}}else{m.entries=[e]}}h(f,m);const d=m.entries[m.entries.length-1];let D=u.series.find(e=>e.kind===c.kind&&e.id===c.id);if(!D&&d){D={kind:c.kind,id:c.id,label:c.label,configPath:n.posix.join("series",c.kind,c.id,"config.json"),updatedAt:d.source.timestamp};u.series.push(D)}if(d){D.path=n.posix.join("series",c.kind,c.id,"summary.json");D.configPath=n.posix.join("series",c.kind,c.id,"config.json");D.commitPath=commitRelative(d);D.sha=d.source.sha;D.sourceUrl=d.source.url}}u.series.sort(compareSeries);h(c,u);writeWeb(e,r);return{commits:g.size,series:l.length,siteRoot:r}}function update(e,t,B,s,r={}){validateSeries(B);const i=entryFromResults(s,t);const a=n.posix.join("series",B.kind,B.id,"summary.json");const l=n.posix.join("series",B.kind,B.id,"history.json");const c=n.posix.join("series",B.kind,B.id,"config.json");const u=n.join(e,...t.sitePath.split("/"));const f=n.join(u,...a.split("/"));const m=n.join(u,...l.split("/"));const d=n.join(u,...c.split("/"));const D=mergeHistories([f,m],t,B);const E=r.comparison??null;if(E)validateEntry(E,t);if(B.kind==="pull"){for(const e of D.entries)writeCommit(u,t,e);D.entries=E&&!sameSource(E,i)?[E,i]:[i]}else{const e=D.entries.findIndex(e=>sameSource(e,i));if(e===-1)D.entries.push(i);else D.entries[e]=i;D.entries.sort(compareEntries);if(D.entries.length>g){D.entries.splice(0,D.entries.length-g)}}if(B.kind==="pull"){writeCommit(u,t,i,E)}else{for(const e of D.entries){writeCommit(u,t,e,sameSource(e,i)?E:null)}}const y=commitRelative(i);h(f,D);h(m,D);h(d,t.toJSON());const b=n.join(u,"series.json");const O=C(b,{schemaVersion:p,series:[]});o(O.schemaVersion===p&&Array.isArray(O.series),"unsupported or invalid series index");const w={kind:B.kind,id:B.id,label:B.label,path:a,configPath:c,commitPath:y,sha:i.source.sha,sourceUrl:i.source.url,updatedAt:(new Date).toISOString()};const S=O.series.findIndex(e=>e.kind===w.kind&&e.id===w.id);if(S===-1)O.series.push(w);else O.series[S]=w;O.series.sort(compareSeries);h(b,O);writeWeb(e,u);const N=n.join(u,"series","main","main","summary.json");const F=n.join(u,"series","main","main","history.json");const A=mergeHistories([N,F],t,{kind:"main",id:"main",label:"Main"},true);if(A){validateHistory(A,t,{kind:"main",id:"main",label:A.label||"Main"})}return{entry:i,main:latestMatchingPlatforms(A,i.platforms),commitPath:n.join(u,...y.split("/")),historyPath:f,summaryPath:f,sitePath:u}}e.exports={entryFromResults:entryFromResults,latestMatchingPlatforms:latestMatchingPlatforms,migrateLegacyData:migrateLegacyData,update:update}},8793:(e,t,B)=>{"use strict";const s=B(3024);const n=B(6760);function assert(e,t){if(!e)throw new Error(t)}function readJSON(e){try{return JSON.parse(s.readFileSync(e,"utf8"))}catch(t){throw new Error(`read ${e}: ${t.message}`,{cause:t})}}function readJSONIfExists(e,t){if(!s.existsSync(e))return t;return readJSON(e)}function writeJSON(e,t){s.mkdirSync(n.dirname(e),{recursive:true});s.writeFileSync(e,`${JSON.stringify(t,null,2)}\n`)}function walkFiles(e,t){const B=[];if(!s.existsSync(e))return B;const r=[e];while(r.length!==0){const e=r.pop();for(const i of s.readdirSync(e,{withFileTypes:true})){const s=n.join(e,i.name);if(i.isSymbolicLink()){throw new Error(`artifact contains symlink ${s}`)}if(i.isDirectory())r.push(s);else if(i.isFile()&&i.name===t)B.push(s)}}return B.sort()}function median(e){assert(e.length!==0,"cannot calculate an empty median");const t=e.toSorted((e,t)=>e-t);const B=Math.floor(t.length/2);return t.length%2===0?(t[B-1]+t[B])/2:t[B]}function safePart(e){return/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)}function hasControl(e){return[...e].some(e=>{const t=e.codePointAt(0);return t<=31||t===127})}function compareText(e,t){return et?1:0}function writeOutputs(e,t){if(!e)return;let B="";for(const[e,s]of Object.entries(t).sort()){assert(!/[\r\n]/.test(e+s),`GitHub output ${e} contains a newline`);B+=`${e}=${s}\n`}s.appendFileSync(e,B)}e.exports={assert:assert,compareText:compareText,hasControl:hasControl,median:median,readJSON:readJSON,readJSONIfExists:readJSONIfExists,safePart:safePart,walkFiles:walkFiles,writeJSON:writeJSON,writeOutputs:writeOutputs}},7675:(e,t,B)=>{"use strict";const{RE2JS:s}=B(6472);const{assert:n,hasControl:r,safePart:i}=B(8793);const a=new Set(["platform","package","group","benchmark","metric"]);const o=new Set(["auto","number","bytes","duration-ns","duration-us","duration-ms","duration-s"]);function keys(e,t,B){for(const s of Object.keys(e)){n(t.has(s),`${B} has unsupported field ${s}`)}}function text(e,t,B=120){n(typeof e==="string"&&e.length>0&&Buffer.byteLength(e)<=B&&e.trim()===e&&!r(e),`${t} must be a trimmed string of 1..${B} bytes`);return e}function stringList(e,t){if(e===undefined||e===null||e==="")return[];const B=typeof e==="string"?[e]:e;n(Array.isArray(B)&&B.every(e=>typeof e==="string"),`${t} must be a string or string list`);return B}function patterns(e,t){return stringList(e,t).map(e=>{try{return{source:e,compiled:s.compile(e)}}catch(B){throw new Error(`${t} pattern ${JSON.stringify(e)}: ${B.message}`,{cause:B})}})}function dimensionList(e,t,B){const s=e===undefined?t:stringList(e,B);n(s.length>0,`${B} must not be empty`);const r=new Set;for(const e of s){n(a.has(e),`${B} has unsupported dimension ${e}`);n(!r.has(e),`${B} repeats dimension ${e}`);r.add(e)}return s}function parseDimensionOptions(e,t){n(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);const B={};for(const[s,r]of Object.entries(e)){n(a.has(s),`${t} has unknown ${s}`);const e=typeof r==="string"?{title:r}:r;n(e&&typeof e==="object"&&!Array.isArray(e),`${t}.${s} must be a title or mapping`);keys(e,new Set(["title","trim-prefix"]),`${t}.${s}`);B[s]={...e.title===undefined?{}:{title:text(e.title,`${t}.${s}.title`)},...e["trim-prefix"]===undefined?{}:{trimPrefix:text(e["trim-prefix"],`${t}.${s}.trim-prefix`,300)}}}return B}function parseMetrics(e,t){n(e&&typeof e==="object"&&!Array.isArray(e),`${t} must be a mapping`);const B={};for(const[s,r]of Object.entries(e)){const e=typeof r==="string"?{title:r}:r;n(s.length>0&&Buffer.byteLength(s)<=64,`${t} has invalid metric ${JSON.stringify(s)}`);n(e&&typeof e==="object"&&!Array.isArray(e),`${t}.${s} must be a title or mapping`);keys(e,new Set(["title","format"]),`${t}.${s}`);const i=e.format??"auto";n(o.has(i),`${t}.${s}.format has unsupported value ${i}`);B[s]={title:text(e.title??s,`${t}.${s}.title`),format:i}}return B}function serializeDimensionOptions(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t.title===undefined?{}:{title:t.title},...t.trimPrefix===undefined?{}:{"trim-prefix":t.trimPrefix}}]))}class View{constructor(e,t){n(i(e)&&e===e.toLowerCase(),`invalid view id ${JSON.stringify(e)}`);n(t&&typeof t==="object"&&!Array.isArray(t),`view ${e} must be a mapping`);keys(t,new Set(["title","select","table"]),`view ${e}`);this.id=e;this.title=text(t.title??e,`view ${e} title`);const B=t.select??{};n(B&&typeof B==="object"&&!Array.isArray(B),`view ${e} select must be a mapping`);keys(B,new Set(["platforms","packages","groups","benchmarks","metrics"]),`view ${e} select`);this.select={};this.compiledSelect={};for(const t of["platforms","packages","groups","benchmarks","metrics"]){const s=patterns(B[t],`view ${e} select.${t}`);this.select[t]=s.map(e=>e.source);this.compiledSelect[t]=s.map(e=>e.compiled)}const s=t.table??{};n(s&&typeof s==="object"&&!Array.isArray(s),`view ${e} table must be a mapping`);keys(s,new Set(["rows","columns","split-by","collapsed","missing","empty","max-rows","dimensions","metrics"]),`view ${e} table`);this.rows=dimensionList(s.rows,["platform","benchmark"],`view ${e} table.rows`);this.columns=dimensionList(s.columns,["metric"],`view ${e} table.columns`);this.splitBy=s["split-by"]===undefined?[]:dimensionList(s["split-by"],[],`view ${e} table.split-by`);const r=new Set;for(const t of[...this.rows,...this.columns,...this.splitBy]){n(!r.has(t),`view ${e} uses dimension ${t} more than once`);r.add(t)}this.collapsed=s.collapsed??false;n(typeof this.collapsed==="boolean",`view ${e} table.collapsed must be boolean`);this.missing=s.missing??"blank";n(this.missing==="blank"||this.missing==="error",`view ${e} table.missing must be blank or error`);this.empty=s.empty??"hide";n(this.empty==="hide"||this.empty==="error",`view ${e} table.empty must be hide or error`);this.maxRows=s["max-rows"]??200;n(Number.isInteger(this.maxRows)&&this.maxRows>=1&&this.maxRows<=1e3,`view ${e} table.max-rows must be between 1 and 1000`);this.dimensionOptions=parseDimensionOptions(s.dimensions??{},`view ${e} table.dimensions`);this.metrics=parseMetrics(s.metrics??{},`view ${e} table.metrics`)}matches(e){const t={platforms:[e.dimensions.platform.key,e.dimensions.platform.label],packages:[e.dimensions.package.key],groups:[e.dimensions.group.key,e.dimensions.group.label],benchmarks:[e.dimensions.benchmark.key,e.dimensions.benchmark.label,e.dimensions.benchmark.label.replace(/^Benchmark/u,"")],metrics:[e.dimensions.metric.key]};return Object.entries(this.compiledSelect).every(([e,B])=>B.length===0||B.some(B=>t[e].some(e=>B.matcher(e).find())))}toJSON(){return{title:this.title,select:Object.fromEntries(Object.entries(this.select).filter(([,e])=>e.length>0)),table:{rows:this.rows,columns:this.columns,...this.splitBy.length>0?{"split-by":this.splitBy}:{},collapsed:this.collapsed,missing:this.missing,empty:this.empty,"max-rows":this.maxRows,...Object.keys(this.dimensionOptions).length>0?{dimensions:serializeDimensionOptions(this.dimensionOptions)}:{},...Object.keys(this.metrics).length>0?{metrics:this.metrics}:{}}}}}function parseViews(e){if(e===undefined||e===null)return{};n(e&&typeof e==="object"&&!Array.isArray(e),"views must be a mapping");return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,new View(e,t)]))}function serializeViews(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.toJSON()]))}e.exports={parseViews:parseViews,serializeViews:serializeViews}},6919:(e,t,B)=>{"use strict";const{benchmarkKey:s}=B(8817);const{benchmarkIndex:n,isIndexPaired:r,metricComparison:i}=B(4408);const{delta:a,formatDelta:o,formatNumber:l,formatPreciseNumber:c,formatSigned:C,markdown:u,tableCell:f}=B(4217);const{assert:h,compareText:p}=B(8793);const g={platform:"Platform",package:"Package",group:"Group",benchmark:"Benchmark",metric:"Metric"};function groupTitle(e,t){if(t==="other")return"Other";return e.groups[t]?.title??t}function observations(e,t,B,a){const o=[];for(const l of Object.keys(t.platforms).sort(p)){const c=t.platforms[l];const C=B?.platforms?.[l];const u=n(C);const f=r(c,C,a);for(const t of c.benchmarks){const B=s(t);for(const s of Object.keys(t.measurements).sort(p)){const n=i(t,u.get(B),s,f);o.push({dimensions:{platform:{key:l,label:c.platform.label},package:{key:t.package??"",label:t.package||"(root)"},group:{key:t.group,label:groupTitle(e,t.group)},benchmark:{key:B,label:t.name},metric:{key:s,label:s}},value:t.measurements[s],...n,better:c.units?.[s]?.better})}}}return o}function tuple(e,t){return t.map(t=>e.dimensions[t])}function tupleKey(e){return JSON.stringify(e.map(e=>e.key))}function trim(e,t){return t&&e.startsWith(t)?e.slice(t.length):e}function tupleLabels(e,t,B){return e.map((e,s)=>{const n=t[s];if(n==="metric"){return B.metrics[e.key]?.title??e.label}return trim(e.label,B.dimensionOptions[n]?.trimPrefix)})}function dimensionTitle(e,t){return e.dimensionOptions[t]?.title??g[t]}function formatDuration(e,t,B=l){const s=e*{ns:1,us:1e3,ms:1e6,s:1e9}[t];if(s>=1e9)return`${B(s/1e9)} s`;if(s>=1e6)return`${B(s/1e6)} ms`;if(s>=1e3)return`${B(s/1e3)} us`;return`${B(s)} ns`}function formatValue(e,t,B,s=l){const n=B.metrics[t]?.format??"auto";if(n==="number")return s(e);if(n==="bytes")return`${s(e)} B`;if(n.startsWith("duration-")){return formatDuration(e,n.slice("duration-".length),s)}return`${s(e)} ${t}`}function metricRank(e,t){const B=Object.keys(e.metrics).indexOf(t.key);return B===-1?Number.MAX_SAFE_INTEGER:B}function compareTuple(e,t,B,s){for(let n=0;ncompareTuple(e,s,t,B))}function splitTitle(e,t){return e.map((e,B)=>`${dimensionTitle(t,t.splitBy[B])}: ${tupleLabels([e],[t.splitBy[B]],t)[0]}`).join(" / ")}function renderTable(e,t,B){const s=uniqueTuples(e,t.rows,t);const n=uniqueTuples(e,t.columns,t);h(s.length<=t.maxRows,`view ${t.id} has ${s.length} rows, exceeding max-rows ${t.maxRows}`);const r=new Map;for(const B of e){const e=tupleKey(tuple(B,t.rows));const s=tupleKey(tuple(B,t.columns));const n=`${e}\n${s}`;h(!r.has(n),`view ${t.id} has duplicate cell ${n}`);r.set(n,B)}const i=t.rows.map(e=>dimensionTitle(t,e));for(const e of n){const s=tupleLabels(e,t.columns,t);i.push(s.join(" / "),B)}const l=[`| ${i.map(f).join(" | ")} |`,`|${t.rows.map(()=>"---").join("|")}|${n.map(()=>"---:|---:").join("|")}|`];for(const e of s){const B=tupleLabels(e,t.rows,t).map(f);for(const s of n){const n=`${tupleKey(e)}\n${tupleKey(s)}`;const i=r.get(n);if(!i){h(t.missing==="blank",`view ${t.id} is missing cell ${n}`);B.push("-","-");continue}const l=i.change===undefined?a(i.value,i.baseline,i.better):o(i.change,i.better);const u=i.difference===undefined?l:`${C(i.difference,e=>formatValue(e,i.dimensions.metric.key,t,c))} / ${l}`;B.push(formatValue(i.value,i.dimensions.metric.key,t),u)}l.push(`| ${B.map(f).join(" | ")} |`)}return l}function renderView(e,t,B){const s=t.filter(t=>e.matches(t));if(s.length===0){h(e.empty==="hide",`view ${e.id} has no matching results`);return[]}const n=e.splitBy.length===0?[[]]:uniqueTuples(s,e.splitBy,e);const r=[];for(const t of n){const n=e.splitBy.length===0?s:s.filter(B=>tupleKey(tuple(B,e.splitBy))===tupleKey(t));if(t.length>0)r.push(`#### ${u(splitTitle(t,e))}`,"");r.push(...renderTable(n,e,B),"")}if(!e.collapsed){return[`### ${u(e.title)}`,"",...r]}return["
",`${u(e.title)}`,"",...r,"
",""]}function renderViews(e,t,B,s="vs main",n=false){const r=observations(e,t,B,n);return Object.values(e.views).flatMap(e=>renderView(e,r,s))}e.exports={renderViews:renderViews}},181:e=>{"use strict";e.exports=require("buffer")},3024:e=>{"use strict";e.exports=require("node:fs")},8161:e=>{"use strict";e.exports=require("node:os")},6760:e=>{"use strict";e.exports=require("node:path")},3136:e=>{"use strict";e.exports=require("node:url")},7975:e=>{"use strict";e.exports=require("node:util")},932:e=>{"use strict";e.exports=require("process")},7349:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(4454);var i=B(2223);var a=B(7103);var o=B(334);var l=B(3142);function resolveCollection(e,t,B,s,n,r){const i=B.type==="block-map"?a.resolveBlockMap(e,t,B,s,r):B.type==="block-seq"?o.resolveBlockSeq(e,t,B,s,r):l.resolveFlowCollection(e,t,B,s,r);const c=i.constructor;if(n==="!"||n===c.tagName){i.tag=c.tagName;return i}if(n)i.tag=n;return i}function composeCollection(e,t,B,a,o){const l=a.tag;const c=!l?null:t.directives.tagName(l.source,e=>o(l,"TAG_RESOLVE_FAILED",e));if(B.type==="block-seq"){const{anchor:e,newlineAfterProp:t}=a;const B=e&&l?e.offset>l.offset?e:l:e??l;if(B&&(!t||t.offsete.tag===c&&e.collection===C);if(!u){const s=t.schema.knownTags[c];if(s?.collection===C){t.schema.tags.push(Object.assign({},s,{default:false}));u=s}else{if(s){o(l,"BAD_COLLECTION_TYPE",`${s.tag} used for ${C} collection, but expects ${s.collection??"scalar"}`,true)}else{o(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,true)}return resolveCollection(e,t,B,o,c)}}const f=resolveCollection(e,t,B,o,c,u);const h=u.resolve?.(f,e=>o(l,"TAG_RESOLVE_FAILED",e),t.options)??f;const p=s.isNode(h)?h:new n.Scalar(h);p.range=f.range;p.tag=c;if(u?.format)p.format=u.format;return p}t.composeCollection=composeCollection},3683:(e,t,B)=>{"use strict";var s=B(3021);var n=B(5937);var r=B(7788);var i=B(4631);function composeDoc(e,t,{offset:B,start:a,value:o,end:l},c){const C=Object.assign({_directives:t},e);const u=new s.Document(undefined,C);const f={atKey:false,atRoot:true,directives:u.directives,options:u.options,schema:u.schema};const h=i.resolveProps(a,{indicator:"doc-start",next:o??l?.[0],offset:B,onError:c,parentIndent:0,startOnNewline:true});if(h.found){u.directives.docStart=true;if(o&&(o.type==="block-map"||o.type==="block-seq")&&!h.hasNewline)c(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}u.contents=o?n.composeNode(f,o,h,c):n.composeEmptyNode(f,h.end,a,null,h,c);const p=u.contents.range[2];const g=r.resolveEnd(l,p,false,c);if(g.comment)u.comment=g.comment;u.range=[B,p,g.offset];return u}t.composeDoc=composeDoc},5937:(e,t,B)=>{"use strict";var s=B(4065);var n=B(1127);var r=B(7349);var i=B(5413);var a=B(7788);var o=B(2599);const l={composeNode:composeNode,composeEmptyNode:composeEmptyNode};function composeNode(e,t,B,s){const a=e.atKey;const{spaceBefore:o,comment:c,anchor:C,tag:u}=B;let f;let h=true;switch(t.type){case"alias":f=composeAlias(e,t,s);if(C||u)s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=i.composeScalar(e,t,u,s);if(C)f.anchor=C.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{f=r.composeCollection(l,e,t,B,s);if(C)f.anchor=C.source.substring(1)}catch(e){const B=e instanceof Error?e.message:String(e);s(t,"RESOURCE_EXHAUSTION",B)}break;default:{const e=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",e);h=false}}f??(f=composeEmptyNode(e,t.offset,undefined,null,B,s));if(C&&f.anchor==="")s(C,"BAD_ALIAS","Anchor cannot be an empty string");if(a&&e.options.stringKeys&&(!n.isScalar(f)||typeof f.value!=="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")){const e="With stringKeys, all keys must be strings";s(u??t,"NON_STRING_KEY",e)}if(o)f.spaceBefore=true;if(c){if(t.type==="scalar"&&t.source==="")f.comment=c;else f.commentBefore=c}if(e.options.keepSourceTokens&&h)f.srcToken=t;return f}function composeEmptyNode(e,t,B,s,{spaceBefore:n,comment:r,anchor:a,tag:l,end:c},C){const u={type:"scalar",offset:o.emptyScalarPosition(t,B,s),indent:-1,source:""};const f=i.composeScalar(e,u,l,C);if(a){f.anchor=a.source.substring(1);if(f.anchor==="")C(a,"BAD_ALIAS","Anchor cannot be an empty string")}if(n)f.spaceBefore=true;if(r){f.comment=r;f.range[2]=c}return f}function composeAlias({options:e},{offset:t,source:B,end:n},r){const i=new s.Alias(B.substring(1));if(i.source==="")r(t,"BAD_ALIAS","Alias cannot be an empty string");if(i.source.endsWith(":"))r(t+B.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);const o=t+B.length;const l=a.resolveEnd(n,o,e.strict,r);i.range=[t,o,l.offset];if(l.comment)i.comment=l.comment;return i}t.composeEmptyNode=composeEmptyNode;t.composeNode=composeNode},5413:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(8913);var i=B(6842);function composeScalar(e,t,B,a){const{value:o,type:l,comment:c,range:C}=t.type==="block-scalar"?r.resolveBlockScalar(e,t,a):i.resolveFlowScalar(t,e.options.strict,a);const u=B?e.directives.tagName(B.source,e=>a(B,"TAG_RESOLVE_FAILED",e)):null;let f;if(e.options.stringKeys&&e.atKey){f=e.schema[s.SCALAR]}else if(u)f=findScalarTagByName(e.schema,o,u,B,a);else if(t.type==="scalar")f=findScalarTagByTest(e,o,t,a);else f=e.schema[s.SCALAR];let h;try{const r=f.resolve(o,e=>a(B??t,"TAG_RESOLVE_FAILED",e),e.options);h=s.isScalar(r)?r:new n.Scalar(r)}catch(e){const s=e instanceof Error?e.message:String(e);a(B??t,"TAG_RESOLVE_FAILED",s);h=new n.Scalar(o)}h.range=C;h.source=o;if(l)h.type=l;if(u)h.tag=u;if(f.format)h.format=f.format;if(c)h.comment=c;return h}function findScalarTagByName(e,t,B,n,r){if(B==="!")return e[s.SCALAR];const i=[];for(const t of e.tags){if(!t.collection&&t.tag===B){if(t.default&&t.test)i.push(t);else return t}}for(const e of i)if(e.test?.test(t))return e;const a=e.knownTags[B];if(a&&!a.collection){e.tags.push(Object.assign({},a,{default:false,test:undefined}));return a}r(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${B}`,B!=="tag:yaml.org,2002:str");return e[s.SCALAR]}function findScalarTagByTest({atKey:e,directives:t,schema:B},n,r,i){const a=B.tags.find(t=>(t.default===true||e&&t.default==="key")&&t.test?.test(n))||B[s.SCALAR];if(B.compat){const e=B.compat.find(e=>e.default&&e.test?.test(n))??B[s.SCALAR];if(a.tag!==e.tag){const B=t.tagString(a.tag);const s=t.tagString(e.tag);const n=`Value may be parsed as either ${B} or ${s}`;i(r,"TAG_RESOLVE_FAILED",n,true)}}return a}t.composeScalar=composeScalar},9984:(e,t,B)=>{"use strict";var s=B(932);var n=B(1342);var r=B(3021);var i=B(1464);var a=B(1127);var o=B(3683);var l=B(7788);function getErrorPos(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:B}=e;return[t,t+(typeof B==="string"?B.length:1)]}function parsePrelude(e){let t="";let B=false;let s=false;for(let n=0;n{const n=getErrorPos(e);if(s)this.warnings.push(new i.YAMLWarning(n,t,B));else this.errors.push(new i.YAMLParseError(n,t,B))};this.directives=new n.Directives({version:e.version||"1.2"});this.options=e}decorate(e,t){const{comment:B,afterEmptyLine:s}=parsePrelude(this.prelude);if(B){const n=e.contents;if(t){e.comment=e.comment?`${e.comment}\n${B}`:B}else if(s||e.directives.docStart||!n){e.commentBefore=B}else if(a.isCollection(n)&&!n.flow&&n.items.length>0){let e=n.items[0];if(a.isPair(e))e=e.key;const t=e.commentBefore;e.commentBefore=t?`${B}\n${t}`:B}else{const e=n.commentBefore;n.commentBefore=e?`${B}\n${e}`:B}}if(t){for(let t=0;t{const n=getErrorPos(e);n[0]+=t;this.onError(n,"BAD_DIRECTIVE",B,s)});this.prelude.push(e.source);this.atDirectives=true;break;case"document":{const t=o.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");this.decorate(t,false);if(this.doc)yield this.doc;this.doc=t;this.atDirectives=false;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message;const B=new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(B);else this.doc.errors.push(B);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=true;const t=l.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);this.decorate(this.doc,true);if(t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=false,t=-1){if(this.doc){this.decorate(this.doc,true);yield this.doc;this.doc=null}else if(e){const e=Object.assign({_directives:this.directives},this.options);const B=new r.Document(undefined,e);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");B.range=[0,t,t];this.decorate(B,false);yield B}}}t.Composer=Composer},7103:(e,t,B)=>{"use strict";var s=B(7165);var n=B(4454);var r=B(4631);var i=B(9499);var a=B(4051);var o=B(1187);const l="All mapping items must start at the same column";function resolveBlockMap({composeNode:e,composeEmptyNode:t},B,c,C,u){const f=u?.nodeClass??n.YAMLMap;const h=new f(B.schema);if(B.atRoot)B.atRoot=false;let p=c.offset;let g=null;for(const n of c.items){const{start:u,key:f,sep:m,value:d}=n;const D=r.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:p,onError:C,parentIndent:c.indent,startOnNewline:true});const E=!D.found;if(E){if(f){if(f.type==="block-seq")C(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==c.indent)C(p,"BAD_INDENT",l)}if(!D.anchor&&!D.tag&&!m){g=D.end;if(D.comment){if(h.comment)h.comment+="\n"+D.comment;else h.comment=D.comment}continue}if(D.newlineAfterProp||i.containsNewline(f)){C(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}}else if(D.found?.indent!==c.indent){C(p,"BAD_INDENT",l)}B.atKey=true;const y=D.end;const b=f?e(B,f,D,C):t(B,y,u,null,D,C);if(B.schema.compat)a.flowIndentCheck(c.indent,f,C);B.atKey=false;if(o.mapIncludes(B,h.items,b))C(y,"DUPLICATE_KEY","Map keys must be unique");const O=r.resolveProps(m??[],{indicator:"map-value-ind",next:d,offset:b.range[2],onError:C,parentIndent:c.indent,startOnNewline:!f||f.type==="block-scalar"});p=O.end;if(O.found){if(E){if(d?.type==="block-map"&&!O.hasNewline)C(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(B.options.strict&&D.start{"use strict";var s=B(3301);function resolveBlockScalar(e,t,B){const n=t.offset;const r=parseBlockScalarHeader(t,e.options.strict,B);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};const i=r.mode===">"?s.Scalar.BLOCK_FOLDED:s.Scalar.BLOCK_LITERAL;const a=t.source?splitLines(t.source):[];let o=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(t===""||t==="\r")o=e;else break}if(o===0){const e=r.chomp==="+"&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let B=n+r.length;if(t.source)B+=t.source.length;return{value:e,type:i,comment:r.comment,range:[n,B,B]}}let l=t.indent+r.indent;let c=t.offset+r.length;let C=0;for(let t=0;tl)l=s.length}else{if(s.length=o;--e){if(a[e][0].length>l)o=e+1}let u="";let f="";let h=false;for(let e=0;el||n[0]==="\t"){if(f===" ")f="\n";else if(!h&&f==="\n")f="\n\n";u+=f+t.slice(l)+n;f="\n";h=true}else if(n===""){if(f==="\n")u+="\n";else f="\n"}else{u+=f+n;f=" ";h=false}}switch(r.chomp){case"-":break;case"+":for(let e=o;e{"use strict";var s=B(2223);var n=B(4631);var r=B(4051);function resolveBlockSeq({composeNode:e,composeEmptyNode:t},B,i,a,o){const l=o?.nodeClass??s.YAMLSeq;const c=new l(B.schema);if(B.atRoot)B.atRoot=false;if(B.atKey)B.atKey=false;let C=i.offset;let u=null;for(const{start:s,value:o}of i.items){const l=n.resolveProps(s,{indicator:"seq-item-ind",next:o,offset:C,onError:a,parentIndent:i.indent,startOnNewline:true});if(!l.found){if(l.anchor||l.tag||o){if(o?.type==="block-seq")a(l.end,"BAD_INDENT","All sequence items must start at the same column");else a(C,"MISSING_CHAR","Sequence item without - indicator")}else{u=l.end;if(l.comment)c.comment=l.comment;continue}}const f=o?e(B,o,l,a):t(B,l.end,s,null,l,a);if(B.schema.compat)r.flowIndentCheck(i.indent,o,a);C=f.range[2];c.items.push(f)}c.range=[i.offset,C,u??C];return c}t.resolveBlockSeq=resolveBlockSeq},7788:(e,t)=>{"use strict";function resolveEnd(e,t,B,s){let n="";if(e){let r=false;let i="";for(const a of e){const{source:e,type:o}=a;switch(o){case"space":r=true;break;case"comment":{if(B&&!r)s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";if(!n)n=t;else n+=i+t;i="";break}case"newline":if(n)i+=e;r=true;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${o} at node end`)}t+=e.length}}return{comment:n,offset:t}}t.resolveEnd=resolveEnd},3142:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(4454);var i=B(2223);var a=B(7788);var o=B(4631);var l=B(9499);var c=B(1187);const C="Block collections are not allowed within flow collections";const isBlock=e=>e&&(e.type==="block-map"||e.type==="block-seq");function resolveFlowCollection({composeNode:e,composeEmptyNode:t},B,u,f,h){const p=u.start.source==="{";const g=p?"flow map":"flow sequence";const m=h?.nodeClass??(p?r.YAMLMap:i.YAMLSeq);const d=new m(B.schema);d.flow=true;const D=B.atRoot;if(D)B.atRoot=false;if(B.atKey)B.atKey=false;let E=u.offset+u.start.source.length;for(let i=0;i0){const e=a.resolveEnd(O,w,B.options.strict,f);if(e.comment){if(d.comment)d.comment+="\n"+e.comment;else d.comment=e.comment}d.range=[u.offset,w,e.offset]}else{d.range=[u.offset,w,w]}return d}t.resolveFlowCollection=resolveFlowCollection},6842:(e,t,B)=>{"use strict";var s=B(3301);var n=B(7788);function resolveFlowScalar(e,t,B){const{offset:r,type:i,source:a,end:o}=e;let l;let c;const _onError=(e,t,s)=>B(r+e,t,s);switch(i){case"scalar":l=s.Scalar.PLAIN;c=plainValue(a,_onError);break;case"single-quoted-scalar":l=s.Scalar.QUOTE_SINGLE;c=singleQuotedValue(a,_onError);break;case"double-quoted-scalar":l=s.Scalar.QUOTE_DOUBLE;c=doubleQuotedValue(a,_onError);break;default:B(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`);return{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const C=r+a.length;const u=n.resolveEnd(o,C,t,B);return{value:c,type:l,comment:u.comment,range:[r,C,u.offset]}}function plainValue(e,t){let B="";switch(e[0]){case"\t":B="a tab character";break;case",":B="flow indicator character ,";break;case"%":B="directive indicator character %";break;case"|":case">":{B=`block scalar indicator ${e[0]}`;break}case"@":case"`":{B=`reserved character ${e[0]}`;break}}if(B)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${B}`);return foldLines(e)}function singleQuotedValue(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return foldLines(e.slice(1,-1)).replace(/''/g,"'")}function foldLines(e){let t,B;try{t=new RegExp("(.*?)(?t?e.slice(t,s+1):n}else{B+=n}}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return B}function foldNewline(e,t){let B="";let s=e[t+1];while(s===" "||s==="\t"||s==="\n"||s==="\r"){if(s==="\r"&&e[t+2]!=="\n")break;if(s==="\n")B+="\n";t+=1;s=e[t+1]}if(!B)B=" ";return{fold:B,offset:t}}const r={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function parseCharCode(e,t,B,s){const n=e.substr(t,B);const r=n.length===B&&/^[0-9a-fA-F]+$/.test(n);const i=r?parseInt(n,16):NaN;try{return String.fromCodePoint(i)}catch{const n=e.substr(t-2,B+2);s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${n}`);return n}}t.resolveFlowScalar=resolveFlowScalar},4631:(e,t)=>{"use strict";function resolveProps(e,{flow:t,indicator:B,next:s,offset:n,onError:r,parentIndent:i,startOnNewline:a}){let o=false;let l=a;let c=a;let C="";let u="";let f=false;let h=false;let p=null;let g=null;let m=null;let d=null;let D=null;let E=null;let y=null;for(const n of e){if(h){if(n.type!=="space"&&n.type!=="newline"&&n.type!=="comma")r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");h=false}if(p){if(l&&n.type!=="comment"&&n.type!=="newline"){r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation")}p=null}switch(n.type){case"space":if(!t&&(B!=="doc-start"||s?.type!=="flow-collection")&&n.source.includes("\t")){p=n}c=true;break;case"comment":{if(!c)r(n,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=n.source.substring(1)||" ";if(!C)C=e;else C+=u+e;u="";l=false;break}case"newline":if(l){if(C)C+=n.source;else if(!E||B!=="seq-item-ind")o=true}else u+=n.source;l=true;f=true;if(g||m)d=n;c=true;break;case"anchor":if(g)r(n,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(n.source.endsWith(":"))r(n.offset+n.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true);g=n;y??(y=n.offset);l=false;c=false;h=true;break;case"tag":{if(m)r(n,"MULTIPLE_TAGS","A node can have at most one tag");m=n;y??(y=n.offset);l=false;c=false;h=true;break}case B:if(g||m)r(n,"BAD_PROP_ORDER",`Anchors and tags must be after the ${n.source} indicator`);if(E)r(n,"UNEXPECTED_TOKEN",`Unexpected ${n.source} in ${t??"collection"}`);E=n;l=B==="seq-item-ind"||B==="explicit-key-ind";c=false;break;case"comma":if(t){if(D)r(n,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);D=n;l=false;c=false;break}default:r(n,"UNEXPECTED_TOKEN",`Unexpected ${n.type} token`);l=false;c=false}}const b=e[e.length-1];const O=b?b.offset+b.source.length:n;if(h&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")){r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space")}if(p&&(l&&p.indent<=i||s?.type==="block-map"||s?.type==="block-seq"))r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:E,spaceBefore:o,comment:C,hasNewline:f,anchor:g,tag:m,newlineAfterProp:d,end:O,start:y??O}}t.resolveProps=resolveProps},9499:(e,t)=>{"use strict";function containsNewline(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return true;if(e.end)for(const t of e.end)if(t.type==="newline")return true;return false;case"flow-collection":for(const t of e.items){for(const e of t.start)if(e.type==="newline")return true;if(t.sep)for(const e of t.sep)if(e.type==="newline")return true;if(containsNewline(t.key)||containsNewline(t.value))return true}return false;default:return true}}t.containsNewline=containsNewline},2599:(e,t)=>{"use strict";function emptyScalarPosition(e,t,B){if(t){B??(B=t.length);for(let s=B-1;s>=0;--s){let B=t[s];switch(B.type){case"space":case"comment":case"newline":e-=B.source.length;continue}B=t[++s];while(B?.type==="space"){e+=B.source.length;B=t[++s]}break}}return e}t.emptyScalarPosition=emptyScalarPosition},4051:(e,t,B)=>{"use strict";var s=B(9499);function flowIndentCheck(e,t,B){if(t?.type==="flow-collection"){const n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&s.containsNewline(t)){const e="Flow end indicator should be more indented than parent";B(n,"BAD_INDENT",e,true)}}}t.flowIndentCheck=flowIndentCheck},1187:(e,t,B)=>{"use strict";var s=B(1127);function mapIncludes(e,t,B){const{uniqueKeys:n}=e.options;if(n===false)return false;const r=typeof n==="function"?n:(e,t)=>e===t||s.isScalar(e)&&s.isScalar(t)&&e.value===t.value;return t.some(e=>r(e.key,B))}t.mapIncludes=mapIncludes},3021:(e,t,B)=>{"use strict";var s=B(4065);var n=B(101);var r=B(1127);var i=B(7165);var a=B(4043);var o=B(5840);var l=B(6829);var c=B(1596);var C=B(3661);var u=B(2404);var f=B(1342);class Document{constructor(e,t,B){this.commentBefore=null;this.comment=null;this.errors=[];this.warnings=[];Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let s=null;if(typeof t==="function"||Array.isArray(t)){s=t}else if(B===undefined&&t){B=t;t=undefined}const n=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},B);this.options=n;let{version:i}=n;if(B?._directives){this.directives=B._directives.atDocument();if(this.directives.yaml.explicit)i=this.directives.yaml.version}else this.directives=new f.Directives({version:i});this.setSchema(i,B);this.contents=e===undefined?null:this.createNode(e,s,B)}clone(){const e=Object.create(Document.prototype,{[r.NODE_TYPE]:{value:r.DOC}});e.commentBefore=this.commentBefore;e.comment=this.comment;e.errors=this.errors.slice();e.warnings=this.warnings.slice();e.options=Object.assign({},this.options);if(this.directives)e.directives=this.directives.clone();e.schema=this.schema.clone();e.contents=r.isNode(this.contents)?this.contents.clone(e.schema):this.contents;if(this.range)e.range=this.range.slice();return e}add(e){if(assertCollection(this.contents))this.contents.add(e)}addIn(e,t){if(assertCollection(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const B=c.anchorNames(this);e.anchor=!t||B.has(t)?c.findNewAnchor(t||"a",B):t}return new s.Alias(e.anchor)}createNode(e,t,B){let s=undefined;if(typeof t==="function"){e=t.call({"":e},"",e);s=t}else if(Array.isArray(t)){const keyToStr=e=>typeof e==="number"||e instanceof String||e instanceof Number;const e=t.filter(keyToStr).map(String);if(e.length>0)t=t.concat(e);s=t}else if(B===undefined&&t){B=t;t=undefined}const{aliasDuplicateObjects:n,anchorPrefix:i,flow:a,keepUndefined:o,onTagObj:l,tag:C}=B??{};const{onAnchor:f,setAnchors:h,sourceObjects:p}=c.createNodeAnchors(this,i||"a");const g={aliasDuplicateObjects:n??true,keepUndefined:o??false,onAnchor:f,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:p};const m=u.createNode(e,C,g);if(a&&r.isCollection(m))m.flow=true;h();return m}createPair(e,t,B={}){const s=this.createNode(e,null,B);const n=this.createNode(t,null,B);return new i.Pair(s,n)}delete(e){return assertCollection(this.contents)?this.contents.delete(e):false}deleteIn(e){if(n.isEmptyPath(e)){if(this.contents==null)return false;this.contents=null;return true}return assertCollection(this.contents)?this.contents.deleteIn(e):false}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):undefined}getIn(e,t){if(n.isEmptyPath(e))return!t&&r.isScalar(this.contents)?this.contents.value:this.contents;return r.isCollection(this.contents)?this.contents.getIn(e,t):undefined}has(e){return r.isCollection(this.contents)?this.contents.has(e):false}hasIn(e){if(n.isEmptyPath(e))return this.contents!==undefined;return r.isCollection(this.contents)?this.contents.hasIn(e):false}set(e,t){if(this.contents==null){this.contents=n.collectionFromPath(this.schema,[e],t)}else if(assertCollection(this.contents)){this.contents.set(e,t)}}setIn(e,t){if(n.isEmptyPath(e)){this.contents=t}else if(this.contents==null){this.contents=n.collectionFromPath(this.schema,Array.from(e),t)}else if(assertCollection(this.contents)){this.contents.setIn(e,t)}}setSchema(e,t={}){if(typeof e==="number")e=String(e);let B;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new f.Directives({version:"1.1"});B={resolveKnownTags:false,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new f.Directives({version:e});B={resolveKnownTags:true,schema:"core"};break;case null:if(this.directives)delete this.directives;B=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(B)this.schema=new o.Schema(Object.assign(B,t));else throw new Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:B,maxAliasCount:s,onAnchor:n,reviver:r}={}){const i={anchors:new Map,doc:this,keep:!e,mapAsMap:B===true,mapKeyWarned:false,maxAliasCount:typeof s==="number"?s:100};const o=a.toJS(this.contents,t??"",i);if(typeof n==="function")for(const{count:e,res:t}of i.anchors.values())n(t,e);return typeof r==="function"?C.applyReviver(r,{"":o},"",o):o}toJSON(e,t){return this.toJS({json:true,jsonArg:e,mapAsMap:false,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return l.stringifyDocument(this,e)}}function assertCollection(e){if(r.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}t.Document=Document},1596:(e,t,B)=>{"use strict";var s=B(1127);var n=B(204);function anchorIsValid(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);const B=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(B)}return true}function anchorNames(e){const t=new Set;n.visit(e,{Value(e,B){if(B.anchor)t.add(B.anchor)}});return t}function findNewAnchor(e,t){for(let B=1;true;++B){const s=`${e}${B}`;if(!t.has(s))return s}}function createNodeAnchors(e,t){const B=[];const n=new Map;let r=null;return{onAnchor:s=>{B.push(s);r??(r=anchorNames(e));const n=findNewAnchor(t,r);r.add(n);return n},setAnchors:()=>{for(const e of B){const t=n.get(e);if(typeof t==="object"&&t.anchor&&(s.isScalar(t.node)||s.isCollection(t.node))){t.node.anchor=t.anchor}else{const t=new Error("Failed to resolve repeated object (this should not happen)");t.source=e;throw t}}},sourceObjects:n}}t.anchorIsValid=anchorIsValid;t.anchorNames=anchorNames;t.createNodeAnchors=createNodeAnchors;t.findNewAnchor=findNewAnchor},3661:(e,t)=>{"use strict";function applyReviver(e,t,B,s){if(s&&typeof s==="object"){if(Array.isArray(s)){for(let t=0,B=s.length;t{"use strict";var s=B(4065);var n=B(1127);var r=B(3301);const i="tag:yaml.org,2002:";function findTagObject(e,t,B){if(t){const e=B.filter(e=>e.tag===t);const s=e.find(e=>!e.format)??e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return B.find(t=>t.identify?.(e)&&!t.format)}function createNode(e,t,B){if(n.isDocument(e))e=e.contents;if(n.isNode(e))return e;if(n.isPair(e)){const t=B.schema[n.MAP].createNode?.(B.schema,null,B);t.items.push(e);return t}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!=="undefined"&&e instanceof BigInt){e=e.valueOf()}const{aliasDuplicateObjects:a,onAnchor:o,onTagObj:l,schema:c,sourceObjects:C}=B;let u=undefined;if(a&&e&&typeof e==="object"){u=C.get(e);if(u){u.anchor??(u.anchor=o(e));return new s.Alias(u.anchor)}else{u={anchor:null,node:null};C.set(e,u)}}if(t?.startsWith("!!"))t=i+t.slice(2);let f=findTagObject(e,t,c.tags);if(!f){if(e&&typeof e.toJSON==="function"){e=e.toJSON()}if(!e||typeof e!=="object"){const t=new r.Scalar(e);if(u)u.node=t;return t}f=e instanceof Map?c[n.MAP]:Symbol.iterator in Object(e)?c[n.SEQ]:c[n.MAP]}if(l){l(f);delete B.onTagObj}const h=f?.createNode?f.createNode(B.schema,e,B):typeof f?.nodeClass?.from==="function"?f.nodeClass.from(B.schema,e,B):new r.Scalar(e);if(t)h.tag=t;else if(!f.default)h.tag=f.tag;if(u)u.node=h;return h}t.createNode=createNode},1342:(e,t,B)=>{"use strict";var s=B(1127);var n=B(204);const r={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};const escapeTagName=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);class Directives{constructor(e,t){this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},Directives.defaultYaml,e);this.tags=Object.assign({},Directives.defaultTags,t)}clone(){const e=new Directives(this.yaml,this.tags);e.docStart=this.docStart;return e}atDocument(){const e=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},Directives.defaultTags);break}return e}add(e,t){if(this.atNextDocument){this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},Directives.defaultTags);this.atNextDocument=false}const B=e.trim().split(/[ \t]+/);const s=B.shift();switch(s){case"%TAG":{if(B.length!==2){t(0,"%TAG directive should contain exactly two parts");if(B.length<2)return false}const[e,s]=B;this.tags[e]=s;return true}case"%YAML":{this.yaml.explicit=true;if(B.length!==1){t(0,"%YAML directive should contain exactly one part");return false}const[e]=B;if(e==="1.1"||e==="1.2"){this.yaml.version=e;return true}else{const B=/^\d+\.\d+$/.test(e);t(6,`Unsupported YAML version ${e}`,B);return false}}default:t(0,`Unknown directive ${s}`,true);return false}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!"){t(`Not a valid tag: ${e}`);return null}if(e[1]==="<"){const B=e.slice(2,-1);if(B==="!"||B==="!!"){t(`Verbatim tags aren't resolved, so ${e} is invalid.`);return null}if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return B}const[,B,s]=e.match(/^(.*!)([^!]*)$/s);if(!s)t(`The ${e} tag has no suffix`);const n=this.tags[B];if(n){try{return n+decodeURIComponent(s)}catch(e){t(String(e));return null}}if(B==="!")return e;t(`Could not resolve tag: ${e}`);return null}tagString(e){for(const[t,B]of Object.entries(this.tags)){if(e.startsWith(B))return t+escapeTagName(e.substring(B.length))}return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[];const B=Object.entries(this.tags);let r;if(e&&B.length>0&&s.isNode(e.contents)){const t={};n.visit(e.contents,(e,B)=>{if(s.isNode(B)&&B.tag)t[B.tag]=true});r=Object.keys(t)}else r=[];for(const[s,n]of B){if(s==="!!"&&n==="tag:yaml.org,2002:")continue;if(!e||r.some(e=>e.startsWith(n)))t.push(`%TAG ${s} ${n}`)}return t.join("\n")}}Directives.defaultYaml={explicit:false,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"};t.Directives=Directives},1464:(e,t)=>{"use strict";class YAMLError extends Error{constructor(e,t,B,s){super();this.name=e;this.code=B;this.message=s;this.pos=t}}class YAMLParseError extends YAMLError{constructor(e,t,B){super("YAMLParseError",e,t,B)}}class YAMLWarning extends YAMLError{constructor(e,t,B){super("YAMLWarning",e,t,B)}}const prettifyError=(e,t)=>B=>{if(B.pos[0]===-1)return;B.linePos=B.pos.map(e=>t.linePos(e));const{line:s,col:n}=B.linePos[0];B.message+=` at line ${s}, column ${n}`;let r=n-1;let i=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&i.length>80){const e=Math.min(r-39,i.length-79);i="…"+i.substring(e);r-=e-1}if(i.length>80)i=i.substring(0,79)+"…";if(s>1&&/^ *$/.test(i.substring(0,r))){let B=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);if(B.length>80)B=B.substring(0,79)+"…\n";i=B+i}if(/[^ ]/.test(i)){let e=1;const t=B.linePos[1];if(t?.line===s&&t.col>n){e=Math.max(1,Math.min(t.col-n,80-r))}const a=" ".repeat(r)+"^".repeat(e);B.message+=`:\n\n${i}\n${a}\n`}};t.YAMLError=YAMLError;t.YAMLParseError=YAMLParseError;t.YAMLWarning=YAMLWarning;t.prettifyError=prettifyError},8815:(e,t,B)=>{"use strict";var s=B(9984);var n=B(3021);var r=B(5840);var i=B(1464);var a=B(4065);var o=B(1127);var l=B(7165);var c=B(3301);var C=B(4454);var u=B(2223);var f=B(3461);var h=B(361);var p=B(6628);var g=B(3456);var m=B(4047);var d=B(204);t.Composer=s.Composer;t.Document=n.Document;t.Schema=r.Schema;t.YAMLError=i.YAMLError;t.YAMLParseError=i.YAMLParseError;t.YAMLWarning=i.YAMLWarning;t.Alias=a.Alias;t.isAlias=o.isAlias;t.isCollection=o.isCollection;t.isDocument=o.isDocument;t.isMap=o.isMap;t.isNode=o.isNode;t.isPair=o.isPair;t.isScalar=o.isScalar;t.isSeq=o.isSeq;t.Pair=l.Pair;t.Scalar=c.Scalar;t.YAMLMap=C.YAMLMap;t.YAMLSeq=u.YAMLSeq;t.CST=f;t.Lexer=h.Lexer;t.LineCounter=p.LineCounter;t.Parser=g.Parser;t.parse=m.parse;t.parseAllDocuments=m.parseAllDocuments;t.parseDocument=m.parseDocument;t.stringify=m.stringify;t.visit=d.visit;t.visitAsync=d.visitAsync},7249:(e,t,B)=>{"use strict";var s=B(932);function debug(e,...t){if(e==="debug")console.log(...t)}function warn(e,t){if(e==="debug"||e==="warn"){if(typeof s.emitWarning==="function")s.emitWarning(t);else console.warn(t)}}t.debug=debug;t.warn=warn},4065:(e,t,B)=>{"use strict";var s=B(1596);var n=B(204);var r=B(1127);var i=B(6673);var a=B(4043);class Alias extends i.NodeBase{constructor(e){super(r.ALIAS);this.source=e;Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let B;if(t?.aliasResolveCache){B=t.aliasResolveCache}else{B=[];n.visit(e,{Node:(e,t)=>{if(r.isAlias(t)||r.hasAnchor(t))B.push(t)}});if(t)t.aliasResolveCache=B}let s=undefined;for(const e of B){if(e===this)break;if(e.anchor===this.source)s=e}return s}toJSON(e,t){if(!t)return{source:this.source};const{anchors:B,doc:s,maxAliasCount:n}=t;const r=this.resolve(s,t);if(!r){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let i=B.get(r);if(!i){a.toJS(r,null,t);i=B.get(r)}if(i?.res===undefined){const e="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(e)}if(n>=0){i.count+=1;if(i.aliasCount===0)i.aliasCount=getAliasCount(s,r,B);if(i.count*i.aliasCount>n){const e="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(e)}}return i.res}toString(e,t,B){const n=`*${this.source}`;if(e){s.anchorIsValid(this.source);if(e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${n} `}return n}}function getAliasCount(e,t,B){if(r.isAlias(t)){const s=t.resolve(e);const n=B&&s&&B.get(s);return n?n.count*n.aliasCount:0}else if(r.isCollection(t)){let s=0;for(const n of t.items){const t=getAliasCount(e,n,B);if(t>s)s=t}return s}else if(r.isPair(t)){const s=getAliasCount(e,t.key,B);const n=getAliasCount(e,t.value,B);return Math.max(s,n)}return 1}t.Alias=Alias},101:(e,t,B)=>{"use strict";var s=B(2404);var n=B(1127);var r=B(6673);function collectionFromPath(e,t,B){let n=B;for(let e=t.length-1;e>=0;--e){const B=t[e];if(typeof B==="number"&&Number.isInteger(B)&&B>=0){const e=[];e[B]=n;n=e}else{n=new Map([[B,n]])}}return s.createNode(n,undefined,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const isEmptyPath=e=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class Collection extends r.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:true,enumerable:false,writable:true})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t);if(this.range)t.range=this.range.slice();return t}addIn(e,t){if(isEmptyPath(e))this.add(t);else{const[B,...s]=e;const r=this.get(B,true);if(n.isCollection(r))r.addIn(s,t);else if(r===undefined&&this.schema)this.set(B,collectionFromPath(this.schema,s,t));else throw new Error(`Expected YAML collection at ${B}. Remaining path: ${s}`)}}deleteIn(e){const[t,...B]=e;if(B.length===0)return this.delete(t);const s=this.get(t,true);if(n.isCollection(s))return s.deleteIn(B);else throw new Error(`Expected YAML collection at ${t}. Remaining path: ${B}`)}getIn(e,t){const[B,...s]=e;const r=this.get(B,true);if(s.length===0)return!t&&n.isScalar(r)?r.value:r;else return n.isCollection(r)?r.getIn(s,t):undefined}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return false;const B=t.value;return B==null||e&&n.isScalar(B)&&B.value==null&&!B.commentBefore&&!B.comment&&!B.tag})}hasIn(e){const[t,...B]=e;if(B.length===0)return this.has(t);const s=this.get(t,true);return n.isCollection(s)?s.hasIn(B):false}setIn(e,t){const[B,...s]=e;if(s.length===0){this.set(B,t)}else{const e=this.get(B,true);if(n.isCollection(e))e.setIn(s,t);else if(e===undefined&&this.schema)this.set(B,collectionFromPath(this.schema,s,t));else throw new Error(`Expected YAML collection at ${B}. Remaining path: ${s}`)}}}t.Collection=Collection;t.collectionFromPath=collectionFromPath;t.isEmptyPath=isEmptyPath},6673:(e,t,B)=>{"use strict";var s=B(3661);var n=B(1127);var r=B(4043);class NodeBase{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:B,onAnchor:i,reviver:a}={}){if(!n.isDocument(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:true,mapAsMap:t===true,mapKeyWarned:false,maxAliasCount:typeof B==="number"?B:100};const l=r.toJS(this,"",o);if(typeof i==="function")for(const{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==="function"?s.applyReviver(a,{"":l},"",l):l}}t.NodeBase=NodeBase},7165:(e,t,B)=>{"use strict";var s=B(2404);var n=B(9748);var r=B(7104);var i=B(1127);function createPair(e,t,B){const n=s.createNode(e,undefined,B);const r=s.createNode(t,undefined,B);return new Pair(n,r)}class Pair{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR});this.key=e;this.value=t}clone(e){let{key:t,value:B}=this;if(i.isNode(t))t=t.clone(e);if(i.isNode(B))B=B.clone(e);return new Pair(t,B)}toJSON(e,t){const B=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,B,this)}toString(e,t,B){return e?.doc?n.stringifyPair(this,e,t,B):JSON.stringify(this)}}t.Pair=Pair;t.createPair=createPair},3301:(e,t,B)=>{"use strict";var s=B(1127);var n=B(6673);var r=B(4043);const isScalarValue=e=>!e||typeof e!=="function"&&typeof e!=="object";class Scalar extends n.NodeBase{constructor(e){super(s.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}}Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE";t.Scalar=Scalar;t.isScalarValue=isScalarValue},4454:(e,t,B)=>{"use strict";var s=B(1212);var n=B(7104);var r=B(101);var i=B(1127);var a=B(7165);var o=B(3301);function findPair(e,t){const B=i.isScalar(t)?t.value:t;for(const s of e){if(i.isPair(s)){if(s.key===t||s.key===B)return s;if(i.isScalar(s.key)&&s.key.value===B)return s}}return undefined}class YAMLMap extends r.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(i.MAP,e);this.items=[]}static from(e,t,B){const{keepUndefined:s,replacer:n}=B;const r=new this(e);const add=(e,i)=>{if(typeof n==="function")i=n.call(t,e,i);else if(Array.isArray(n)&&!n.includes(e))return;if(i!==undefined||s)r.items.push(a.createPair(e,i,B))};if(t instanceof Map){for(const[e,B]of t)add(e,B)}else if(t&&typeof t==="object"){for(const e of Object.keys(t))add(e,t[e])}if(typeof e.sortMapEntries==="function"){r.items.sort(e.sortMapEntries)}return r}add(e,t){let B;if(i.isPair(e))B=e;else if(!e||typeof e!=="object"||!("key"in e)){B=new a.Pair(e,e?.value)}else B=new a.Pair(e.key,e.value);const s=findPair(this.items,B.key);const n=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${B.key} already set`);if(i.isScalar(s.value)&&o.isScalarValue(B.value))s.value.value=B.value;else s.value=B.value}else if(n){const e=this.items.findIndex(e=>n(B,e)<0);if(e===-1)this.items.push(B);else this.items.splice(e,0,B)}else{this.items.push(B)}}delete(e){const t=findPair(this.items,e);if(!t)return false;const B=this.items.splice(this.items.indexOf(t),1);return B.length>0}get(e,t){const B=findPair(this.items,e);const s=B?.value;return(!t&&i.isScalar(s)?s.value:s)??undefined}has(e){return!!findPair(this.items,e)}set(e,t){this.add(new a.Pair(e,t),true)}toJSON(e,t,B){const s=B?new B:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(s);for(const e of this.items)n.addPairToJSMap(t,s,e);return s}toString(e,t,B){if(!e)return JSON.stringify(this);for(const e of this.items){if(!i.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`)}if(!e.allNullValues&&this.hasAllNullValues(false))e=Object.assign({},e,{allNullValues:true});return s.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:B,onComment:t})}}t.YAMLMap=YAMLMap;t.findPair=findPair},2223:(e,t,B)=>{"use strict";var s=B(2404);var n=B(1212);var r=B(101);var i=B(1127);var a=B(3301);var o=B(4043);class YAMLSeq extends r.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(i.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){const t=asItemIndex(e);if(typeof t!=="number")return false;const B=this.items.splice(t,1);return B.length>0}get(e,t){const B=asItemIndex(e);if(typeof B!=="number")return undefined;const s=this.items[B];return!t&&i.isScalar(s)?s.value:s}has(e){const t=asItemIndex(e);return typeof t==="number"&&t=0?t:null}t.YAMLSeq=YAMLSeq},7104:(e,t,B)=>{"use strict";var s=B(7249);var n=B(452);var r=B(2148);var i=B(1127);var a=B(4043);function addPairToJSMap(e,t,{key:B,value:s}){if(i.isNode(B)&&B.addToJSMap)B.addToJSMap(e,t,s);else if(n.isMergeKey(e,B))n.addMergeToJSMap(e,t,s);else{const n=a.toJS(B,"",e);if(t instanceof Map){t.set(n,a.toJS(s,n,e))}else if(t instanceof Set){t.add(n)}else{const r=stringifyKey(B,n,e);const i=a.toJS(s,r,e);if(r in t)Object.defineProperty(t,r,{value:i,writable:true,enumerable:true,configurable:true});else t[r]=i}}return t}function stringifyKey(e,t,B){if(t===null)return"";if(typeof t!=="object")return String(t);if(i.isNode(e)&&B?.doc){const t=r.createStringifyContext(B.doc,{});t.anchors=new Set;for(const e of B.anchors.keys())t.anchors.add(e.anchor);t.inFlow=true;t.inStringifyKey=true;const n=e.toString(t);if(!B.mapKeyWarned){let e=JSON.stringify(n);if(e.length>40)e=e.substring(0,36)+'..."';s.warn(B.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`);B.mapKeyWarned=true}return n}return JSON.stringify(t)}t.addPairToJSMap=addPairToJSMap},1127:(e,t)=>{"use strict";const B=Symbol.for("yaml.alias");const s=Symbol.for("yaml.document");const n=Symbol.for("yaml.map");const r=Symbol.for("yaml.pair");const i=Symbol.for("yaml.scalar");const a=Symbol.for("yaml.seq");const o=Symbol.for("yaml.node.type");const isAlias=e=>!!e&&typeof e==="object"&&e[o]===B;const isDocument=e=>!!e&&typeof e==="object"&&e[o]===s;const isMap=e=>!!e&&typeof e==="object"&&e[o]===n;const isPair=e=>!!e&&typeof e==="object"&&e[o]===r;const isScalar=e=>!!e&&typeof e==="object"&&e[o]===i;const isSeq=e=>!!e&&typeof e==="object"&&e[o]===a;function isCollection(e){if(e&&typeof e==="object")switch(e[o]){case n:case a:return true}return false}function isNode(e){if(e&&typeof e==="object")switch(e[o]){case B:case n:case i:case a:return true}return false}const hasAnchor=e=>(isScalar(e)||isCollection(e))&&!!e.anchor;t.ALIAS=B;t.DOC=s;t.MAP=n;t.NODE_TYPE=o;t.PAIR=r;t.SCALAR=i;t.SEQ=a;t.hasAnchor=hasAnchor;t.isAlias=isAlias;t.isCollection=isCollection;t.isDocument=isDocument;t.isMap=isMap;t.isNode=isNode;t.isPair=isPair;t.isScalar=isScalar;t.isSeq=isSeq},4043:(e,t,B)=>{"use strict";var s=B(1127);function toJS(e,t,B){if(Array.isArray(e))return e.map((e,t)=>toJS(e,String(t),B));if(e&&typeof e.toJSON==="function"){if(!B||!s.hasAnchor(e))return e.toJSON(t,B);const n={aliasCount:0,count:1,res:undefined};B.anchors.set(e,n);B.onCreate=e=>{n.res=e;delete B.onCreate};const r=e.toJSON(t,B);if(B.onCreate)B.onCreate(r);return r}if(typeof e==="bigint"&&!B?.keep)return Number(e);return e}t.toJS=toJS},110:(e,t,B)=>{"use strict";var s=B(8913);var n=B(6842);var r=B(1464);var i=B(3069);function resolveAsScalar(e,t=true,B){if(e){const _onError=(e,t,s)=>{const n=typeof e==="number"?e:Array.isArray(e)?e[0]:e.offset;if(B)B(n,t,s);else throw new r.YAMLParseError([n,n+1],t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return n.resolveFlowScalar(e,t,_onError);case"block-scalar":return s.resolveBlockScalar({options:{strict:t}},e,_onError)}}return null}function createScalarToken(e,t){const{implicitKey:B=false,indent:s,inFlow:n=false,offset:r=-1,type:a="PLAIN"}=t;const o=i.stringifyString({type:a,value:e},{implicitKey:B,indent:s>0?" ".repeat(s):"",inFlow:n,options:{blockQuote:true,lineWidth:-1}});const l=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(o[0]){case"|":case">":{const e=o.indexOf("\n");const t=o.substring(0,e);const B=o.substring(e+1)+"\n";const n=[{type:"block-scalar-header",offset:r,indent:s,source:t}];if(!addEndtoBlockProps(n,l))n.push({type:"newline",offset:-1,indent:s,source:"\n"});return{type:"block-scalar",offset:r,indent:s,props:n,source:B}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:o,end:l};default:return{type:"scalar",offset:r,indent:s,source:o,end:l}}}function setScalarValue(e,t,B={}){let{afterKey:s=false,implicitKey:n=false,inFlow:r=false,type:a}=B;let o="indent"in e?e.indent:null;if(s&&typeof o==="number")o+=2;if(!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=t.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}const l=i.stringifyString({type:a,value:t},{implicitKey:n||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:r,options:{blockQuote:true,lineWidth:-1}});switch(l[0]){case"|":case">":setBlockScalarValue(e,l);break;case'"':setFlowScalarValue(e,l,"double-quoted-scalar");break;case"'":setFlowScalarValue(e,l,"single-quoted-scalar");break;default:setFlowScalarValue(e,l,"scalar")}}function setBlockScalarValue(e,t){const B=t.indexOf("\n");const s=t.substring(0,B);const n=t.substring(B+1)+"\n";if(e.type==="block-scalar"){const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");t.source=s;e.source=n}else{const{offset:t}=e;const B="indent"in e?e.indent:-1;const r=[{type:"block-scalar-header",offset:t,indent:B,source:s}];if(!addEndtoBlockProps(r,"end"in e?e.end:undefined))r.push({type:"newline",offset:-1,indent:B,source:"\n"});for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:"block-scalar",indent:B,props:r,source:n})}}function addEndtoBlockProps(e,t){if(t)for(const B of t)switch(B.type){case"space":case"comment":e.push(B);break;case"newline":e.push(B);return true}return false}function setFlowScalarValue(e,t,B){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=B;e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let n=t.length;if(e.props[0].type==="block-scalar-header")n-=e.props[0].source.length;for(const e of s)e.offset+=n;delete e.props;Object.assign(e,{type:B,source:t,end:s});break}case"block-map":case"block-seq":{const s=e.offset+t.length;const n={type:"newline",offset:s,indent:e.indent,source:"\n"};delete e.items;Object.assign(e,{type:B,source:t,end:[n]});break}default:{const s="indent"in e?e.indent:-1;const n="end"in e&&Array.isArray(e.end)?e.end.filter(e=>e.type==="space"||e.type==="comment"||e.type==="newline"):[];for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:B,indent:s,source:t,end:n})}}}t.createScalarToken=createScalarToken;t.resolveAsScalar=resolveAsScalar;t.setScalarValue=setScalarValue},1733:(e,t)=>{"use strict";const stringify=e=>"type"in e?stringifyToken(e):stringifyItem(e);function stringifyToken(e){switch(e.type){case"block-scalar":{let t="";for(const B of e.props)t+=stringifyToken(B);return t+e.source}case"block-map":case"block-seq":{let t="";for(const B of e.items)t+=stringifyItem(B);return t}case"flow-collection":{let t=e.start.source;for(const B of e.items)t+=stringifyItem(B);for(const B of e.end)t+=B.source;return t}case"document":{let t=stringifyItem(e);if(e.end)for(const B of e.end)t+=B.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const B of e.end)t+=B.source;return t}}}function stringifyItem({start:e,key:t,sep:B,value:s}){let n="";for(const t of e)n+=t.source;if(t)n+=stringifyToken(t);if(B)for(const e of B)n+=e.source;if(s)n+=stringifyToken(s);return n}t.stringify=stringify},7715:(e,t)=>{"use strict";const B=Symbol("break visit");const s=Symbol("skip children");const n=Symbol("remove item");function visit(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};_visit(Object.freeze([]),e,t)}visit.BREAK=B;visit.SKIP=s;visit.REMOVE=n;visit.itemAtPath=(e,t)=>{let B=e;for(const[e,s]of t){const t=B?.[e];if(t&&"items"in t){B=t.items[s]}else return undefined}return B};visit.parentCollection=(e,t)=>{const B=visit.itemAtPath(e,t.slice(0,-1));const s=t[t.length-1][0];const n=B?.[s];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function _visit(e,t,s){let r=s(t,e);if(typeof r==="symbol")return r;for(const i of["key","value"]){const a=t[i];if(a&&"items"in a){for(let t=0;t{"use strict";var s=B(110);var n=B(1733);var r=B(7715);const i="\ufeff";const a="";const o="";const l="";const isCollection=e=>!!e&&"items"in e;const isScalar=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function prettyToken(e){switch(e){case i:return"";case a:return"";case o:return"";case l:return"";default:return JSON.stringify(e)}}function tokenType(e){switch(e){case i:return"byte-order-mark";case a:return"doc-mode";case o:return"flow-error-end";case l:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}t.createScalarToken=s.createScalarToken;t.resolveAsScalar=s.resolveAsScalar;t.setScalarValue=s.setScalarValue;t.stringify=n.stringify;t.visit=r.visit;t.BOM=i;t.DOCUMENT=a;t.FLOW_END=o;t.SCALAR=l;t.isCollection=isCollection;t.isScalar=isScalar;t.prettyToken=prettyToken;t.tokenType=tokenType},361:(e,t,B)=>{"use strict";var s=B(3461);function isEmpty(e){switch(e){case undefined:case" ":case"\n":case"\r":case"\t":return true;default:return false}}const n=new Set("0123456789ABCDEFabcdef");const r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");const i=new Set(",[]{}");const a=new Set(" ,[]{}\n\r\t");const isNotAnchorChar=e=>!e||a.has(e);class Lexer{constructor(){this.atEnd=false;this.blockScalarIndent=-1;this.blockScalarKeep=false;this.buffer="";this.flowKey=false;this.flowLevel=0;this.indentNext=0;this.indentValue=0;this.lineEndPos=null;this.next=null;this.pos=0}*lex(e,t=false){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e;this.lineEndPos=null}this.atEnd=!t;let B=this.next??"stream";while(B&&(t||this.hasChars(1)))B=yield*this.parseNext(B)}atLineEnd(){let e=this.pos;let t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t==="\n")return true;if(t==="\r")return this.buffer[e+1]==="\n";return false}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let B=0;while(t===" ")t=this.buffer[++B+e];if(t==="\r"){const t=this.buffer[B+e+1];if(t==="\n"||!t&&!this.atEnd)return e+B+1}return t==="\n"||B>=this.indentNext||!t&&!this.atEnd?e+B:-1}if(t==="-"||t==="."){const t=this.buffer.substr(e,3);if((t==="---"||t==="...")&&isEmpty(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&ethis.indentValue&&!isEmpty(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&isEmpty(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));this.indentNext=this.indentValue+1;this.indentValue+=e;return"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(true);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case undefined:yield*this.pushNewline();return yield*this.parseLineStart();case"{":case"[":yield*this.pushCount(1);this.flowKey=false;this.flowLevel=1;return"flow";case"}":case"]":yield*this.pushCount(1);return"doc";case"*":yield*this.pushUntil(isNotAnchorChar);return"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":t+=(yield*this.parseBlockScalarHeader());t+=(yield*this.pushSpaces(true));yield*this.pushCount(e.length-t);yield*this.pushNewline();return yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t;let B=-1;do{e=yield*this.pushNewline();if(e>0){t=yield*this.pushSpaces(false);this.indentValue=B=t}else{t=0}t+=(yield*this.pushSpaces(true))}while(e+t>0);const n=this.getLine();if(n===null)return this.setNext("flow");if(B!==-1&&B"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(e=>isEmpty(e)||e==="#")}*parseBlockScalar(){let e=this.pos-1;let t=0;let B;e:for(let s=this.pos;B=this.buffer[s];++s){switch(B){case" ":t+=1;break;case"\n":e=s;t=0;break;case"\r":{const e=this.buffer[s+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if(e==="\n")break}default:break e}}if(!B&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else{this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext)}do{const t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf("\n",t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;B=this.buffer[n];while(B===" ")B=this.buffer[++n];if(B==="\t"){while(B==="\t"||B===" "||B==="\r"||B==="\n")B=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep){do{let B=e-1;let s=this.buffer[B];if(s==="\r")s=this.buffer[--B];const n=B;while(s===" ")s=this.buffer[--B];if(s==="\n"&&B>=this.pos&&B+1+t>n)e=B;else break}while(true)}yield s.SCALAR;yield*this.pushToIndex(e+1,true);return yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1;let B=this.pos-1;let n;while(n=this.buffer[++B]){if(n===":"){const s=this.buffer[B+1];if(isEmpty(s)||e&&i.has(s))break;t=B}else if(isEmpty(n)){let s=this.buffer[B+1];if(n==="\r"){if(s==="\n"){B+=1;n="\n";s=this.buffer[B+1]}else t=B}if(s==="#"||e&&i.has(s))break;if(n==="\n"){const e=this.continueScalar(B+1);if(e===-1)break;B=Math.max(B,e-2)}}else{if(e&&i.has(n))break;t=B}}if(!n&&!this.atEnd)return this.setNext("plain-scalar");yield s.SCALAR;yield*this.pushToIndex(t+1,true);return e?"flow":"doc"}*pushCount(e){if(e>0){yield this.buffer.substr(this.pos,e);this.pos+=e;return e}return 0}*pushToIndex(e,t){const B=this.buffer.slice(this.pos,e);if(B){yield B;this.pos+=B.length;return B.length}else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(true){switch(this.charAt(0)){case"!":e+=(yield*this.pushTag());e+=(yield*this.pushSpaces(true));continue e;case"&":e+=(yield*this.pushUntil(isNotAnchorChar));e+=(yield*this.pushSpaces(true));continue e;case"-":case"?":case":":{const t=this.flowLevel>0;const B=this.charAt(1);if(isEmpty(B)||t&&i.has(B)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=false;e+=(yield*this.pushCount(1));e+=(yield*this.pushSpaces(true));continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2;let t=this.buffer[e];while(!isEmpty(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,false)}else{let e=this.pos+1;let t=this.buffer[e];while(t){if(r.has(t))t=this.buffer[++e];else if(t==="%"&&n.has(this.buffer[e+1])&&n.has(this.buffer[e+2])){t=this.buffer[e+=3]}else break}return yield*this.pushToIndex(e,false)}}*pushNewline(){const e=this.buffer[this.pos];if(e==="\n")return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)==="\n")return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1;let B;do{B=this.buffer[++t]}while(B===" "||e&&B==="\t");const s=t-this.pos;if(s>0){yield this.buffer.substr(this.pos,s);this.pos=t}return s}*pushUntil(e){let t=this.pos;let B=this.buffer[t];while(!e(B))B=this.buffer[++t];return yield*this.pushToIndex(t,false)}}t.Lexer=Lexer},6628:(e,t)=>{"use strict";class LineCounter{constructor(){this.lineStarts=[];this.addNewLine=e=>this.lineStarts.push(e);this.linePos=e=>{let t=0;let B=this.lineStarts.length;while(t>1;if(this.lineStarts[s]{"use strict";var s=B(932);var n=B(3461);var r=B(361);function includesToken(e,t){for(let B=0;B=0){switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}}while(e[++t]?.type==="space"){}return e.splice(t,e.length)}function arrayPushArray(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let B=0;B0)yield*this.pop()}get sourceToken(){const e={type:this.type,offset:this.offset,indent:this.indent,source:this.source};return e}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t){const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}else if(this.stack.length===0){yield t}else{const e=this.peek(1);if(t.type==="block-scalar"){t.indent="indent"in e?e.indent:0}else if(t.type==="flow-collection"&&e.type==="document"){t.indent=0}if(t.type==="flow-collection")fixFlowSeqItems(t);switch(e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const B=e.items[e.items.length-1];if(B.value){e.items.push({start:[],key:t,sep:[]});this.onKeyLine=true;return}else if(B.sep){B.value=t}else{Object.assign(B,{key:t,sep:[]});this.onKeyLine=!B.explicitKey;return}break}case"block-seq":{const B=e.items[e.items.length-1];if(B.value)e.items.push({start:[],value:t});else B.value=t;break}case"flow-collection":{const B=e.items[e.items.length-1];if(!B||B.value)e.items.push({start:[],key:t,sep:[]});else if(B.sep)B.value=t;else Object.assign(B,{key:t,sep:[]});return}default:yield*this.pop();yield*this.pop(t)}if((e.type==="document"||e.type==="block-map"||e.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const B=t.items[t.items.length-1];if(B&&!B.sep&&!B.value&&B.start.length>0&&findNonEmptyIndex(B.start)===-1&&(t.indent===0||B.start.every(e=>e.type!=="comment"||e.indent=e.indent){const B=!this.onKeyLine&&this.indent===e.indent;const s=B&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let n=[];if(s&&t.sep&&!t.value){const B=[];for(let s=0;se.indent)B.length=0;break;default:B.length=0}}if(B.length>=2)n=t.sep.splice(B[1])}switch(this.type){case"anchor":case"tag":if(s||t.value){n.push(this.sourceToken);e.items.push({start:n});this.onKeyLine=true}else if(t.sep){t.sep.push(this.sourceToken)}else{t.start.push(this.sourceToken)}return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey){t.start.push(this.sourceToken);t.explicitKey=true}else if(s||t.value){n.push(this.sourceToken);e.items.push({start:n,explicitKey:true})}else{this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]})}this.onKeyLine=true;return;case"map-value-ind":if(t.explicitKey){if(!t.sep){if(includesToken(t.start,"newline")){Object.assign(t,{key:null,sep:[this.sourceToken]})}else{const e=getFirstKeyStartProps(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value){e.items.push({start:[],key:null,sep:[this.sourceToken]})}else if(includesToken(t.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]})}else if(isFlowToken(t.key)&&!includesToken(t.sep,"newline")){const e=getFirstKeyStartProps(t.start);const B=t.key;const s=t.sep;s.push(this.sourceToken);delete t.key;delete t.sep;this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:B,sep:s}]})}else if(n.length>0){t.sep=t.sep.concat(n,this.sourceToken)}else{t.sep.push(this.sourceToken)}}else{if(!t.sep){Object.assign(t,{key:null,sep:[this.sourceToken]})}else if(t.value||s){e.items.push({start:n,key:null,sep:[this.sourceToken]})}else if(includesToken(t.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]})}else{t.sep.push(this.sourceToken)}}this.onKeyLine=true;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const B=this.flowScalar(this.type);if(s||t.value){e.items.push({start:n,key:B,sep:[]});this.onKeyLine=true}else if(t.sep){this.stack.push(B)}else{Object.assign(t,{key:B,sep:[]});this.onKeyLine=true}return}default:{const s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!includesToken(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(B){e.items.push({start:n})}this.stack.push(s);return}}}}yield*this.pop();yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const B="end"in t.value?t.value.end:undefined;const s=Array.isArray(B)?B[B.length-1]:undefined;if(s?.type==="comment")B?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const B=e.items[e.items.length-2];const s=B?.value?.end;if(Array.isArray(s)){arrayPushArray(s,t.start);s.push(this.sourceToken);e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||includesToken(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop();yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let e;do{yield*this.pop();e=this.peek(1)}while(e?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const B=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:B,sep:[]});else if(t.sep)this.stack.push(B);else Object.assign(t,{key:B,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const B=this.startBlockValue(e);if(B)this.stack.push(B);else{yield*this.pop();yield*this.step()}}else{const t=this.peek(2);if(t.type==="block-map"&&(this.type==="map-value-ind"&&t.indent===e.indent||this.type==="newline"&&!t.items[t.items.length-1].sep)){yield*this.pop();yield*this.step()}else if(this.type==="map-value-ind"&&t.type!=="flow-collection"){const B=getPrevProps(t);const s=getFirstKeyStartProps(B);fixFlowSeqItems(e);const n=e.end.splice(1,e.end.length);n.push(this.sourceToken);const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=true;this.stack[this.stack.length-1]=r}else{yield*this.lineEnd(e)}}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;while(e!==0){this.onNewLine(this.offset+e);e=this.source.indexOf("\n",e)+1}}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=true;const t=getPrevProps(e);const B=getFirstKeyStartProps(t);B.push(this.sourceToken);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:B,explicitKey:true}]}}case"map-value-ind":{this.onKeyLine=true;const t=getPrevProps(e);const B=getFirstKeyStartProps(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:B,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return false;if(this.indent<=t)return false;return e.every(e=>e.type==="newline"||e.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop();yield*this.step();break;case"newline":this.onKeyLine=false;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}t.Parser=Parser},4047:(e,t,B)=>{"use strict";var s=B(9984);var n=B(3021);var r=B(1464);var i=B(7249);var a=B(1127);var o=B(6628);var l=B(3456);function parseOptions(e){const t=e.prettyErrors!==false;const B=e.lineCounter||t&&new o.LineCounter||null;return{lineCounter:B,prettyErrors:t}}function parseAllDocuments(e,t={}){const{lineCounter:B,prettyErrors:n}=parseOptions(t);const i=new l.Parser(B?.addNewLine);const a=new s.Composer(t);const o=Array.from(a.compose(i.parse(e)));if(n&&B)for(const t of o){t.errors.forEach(r.prettifyError(e,B));t.warnings.forEach(r.prettifyError(e,B))}if(o.length>0)return o;return Object.assign([],{empty:true},a.streamInfo())}function parseDocument(e,t={}){const{lineCounter:B,prettyErrors:n}=parseOptions(t);const i=new l.Parser(B?.addNewLine);const a=new s.Composer(t);let o=null;for(const t of a.compose(i.parse(e),true,e.length)){if(!o)o=t;else if(o.options.logLevel!=="silent"){o.errors.push(new r.YAMLParseError(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}if(n&&B){o.errors.forEach(r.prettifyError(e,B));o.warnings.forEach(r.prettifyError(e,B))}return o}function parse(e,t,B){let s=undefined;if(typeof t==="function"){s=t}else if(B===undefined&&t&&typeof t==="object"){B=t}const n=parseDocument(e,B);if(!n)return null;n.warnings.forEach(e=>i.warn(n.options.logLevel,e));if(n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];else n.errors=[]}return n.toJS(Object.assign({reviver:s},B))}function stringify(e,t,B){let s=null;if(typeof t==="function"||Array.isArray(t)){s=t}else if(B===undefined&&t){B=t}if(typeof B==="string")B=B.length;if(typeof B==="number"){const e=Math.round(B);B=e<1?undefined:e>8?{indent:8}:{indent:e}}if(e===undefined){const{keepUndefined:e}=B??t??{};if(!e)return undefined}if(a.isDocument(e)&&!s)return e.toString(B);return new n.Document(e,s,B).toString(B)}t.parse=parse;t.parseAllDocuments=parseAllDocuments;t.parseDocument=parseDocument;t.stringify=stringify},5840:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7451);var r=B(1706);var i=B(6464);var a=B(18);const sortMapEntriesByKey=(e,t)=>e.keyt.key?1:0;class Schema{constructor({compat:e,customTags:t,merge:B,resolveKnownTags:o,schema:l,sortMapEntries:c,toStringDefaults:C}){this.compat=Array.isArray(e)?a.getTags(e,"compat"):e?a.getTags(null,e):null;this.name=typeof l==="string"&&l||"core";this.knownTags=o?a.coreKnownTags:{};this.tags=a.getTags(t,this.name,B);this.toStringOptions=C??null;Object.defineProperty(this,s.MAP,{value:n.map});Object.defineProperty(this,s.SCALAR,{value:i.string});Object.defineProperty(this,s.SEQ,{value:r.seq});this.sortMapEntries=typeof c==="function"?c:c===true?sortMapEntriesByKey:null}clone(){const e=Object.create(Schema.prototype,Object.getOwnPropertyDescriptors(this));e.tags=this.tags.slice();return e}}t.Schema=Schema},7451:(e,t,B)=>{"use strict";var s=B(1127);var n=B(4454);const r={collection:"map",default:true,nodeClass:n.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!s.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,B)=>n.YAMLMap.from(e,t,B)};t.map=r},3632:(e,t,B)=>{"use strict";var s=B(3301);const n={identify:e=>e==null,createNode:()=>new s.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new s.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&n.test.test(e)?e:t.options.nullStr};t.nullTag=n},1706:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2223);const r={collection:"seq",default:true,nodeClass:n.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!s.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,B)=>n.YAMLSeq.from(e,t,B)};t.seq=r},6464:(e,t,B)=>{"use strict";var s=B(3069);const n={identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,B,n){t=Object.assign({actualString:true},t);return s.stringifyString(e,t,B,n)}};t.string=n},3959:(e,t,B)=>{"use strict";var s=B(3301);const n={identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new s.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},B){if(e&&n.test.test(e)){const B=e[0]==="t"||e[0]==="T";if(t===B)return e}return t?B.options.trueStr:B.options.falseStr}};t.boolTag=n},8405:(e,t,B)=>{"use strict";var s=B(3301);var n=B(8689);const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber};const i={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}};const a={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new s.Scalar(parseFloat(e));const B=e.indexOf(".");if(B!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-B-1;return t},stringify:n.stringifyNumber};t.float=a;t.floatExp=i;t.floatNaN=r},9874:(e,t,B)=>{"use strict";var s=B(8689);const intIdentify=e=>typeof e==="bigint"||Number.isInteger(e);const intResolve=(e,t,B,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),B);function intStringify(e,t,B){const{value:n}=e;if(intIdentify(n)&&n>=0)return B+n.toString(t);return s.stringifyNumber(e)}const n={identify:e=>intIdentify(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,B)=>intResolve(e,2,8,B),stringify:e=>intStringify(e,8,"0o")};const r={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,B)=>intResolve(e,0,10,B),stringify:s.stringifyNumber};const i={identify:e=>intIdentify(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,B)=>intResolve(e,2,16,B),stringify:e=>intStringify(e,16,"0x")};t.int=r;t.intHex=i;t.intOct=n},896:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(3959);var o=B(8405);var l=B(9874);const c=[s.map,r.seq,i.string,n.nullTag,a.boolTag,l.intOct,l.int,l.intHex,o.floatNaN,o.floatExp,o.float];t.schema=c},3559:(e,t,B)=>{"use strict";var s=B(3301);var n=B(7451);var r=B(1706);function intIdentify(e){return typeof e==="bigint"||Number.isInteger(e)}const stringifyJSON=({value:e})=>JSON.stringify(e);const i=[{identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:stringifyJSON},{identify:e=>e==null,createNode:()=>new s.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:stringifyJSON},{identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:stringifyJSON},{identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:B})=>B?BigInt(e):parseInt(e,10),stringify:({value:e})=>intIdentify(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:stringifyJSON}];const a={default:true,tag:"",test:/^/,resolve(e,t){t(`Unresolved plain scalar ${JSON.stringify(e)}`);return e}};const o=[n.map,r.seq].concat(i,a);t.schema=o},18:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(3959);var o=B(8405);var l=B(9874);var c=B(896);var C=B(3559);var u=B(6083);var f=B(452);var h=B(303);var p=B(8385);var g=B(5913);var m=B(1528);var d=B(6752);const D=new Map([["core",c.schema],["failsafe",[s.map,r.seq,i.string]],["json",C.schema],["yaml11",g.schema],["yaml-1.1",g.schema]]);const E={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:d.floatTime,int:l.int,intHex:l.intHex,intOct:l.intOct,intTime:d.intTime,map:s.map,merge:f.merge,null:n.nullTag,omap:h.omap,pairs:p.pairs,seq:r.seq,set:m.set,timestamp:d.timestamp};const y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":f.merge,"tag:yaml.org,2002:omap":h.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":m.set,"tag:yaml.org,2002:timestamp":d.timestamp};function getTags(e,t,B){const s=D.get(t);if(s&&!e){return B&&!s.includes(f.merge)?s.concat(f.merge):s.slice()}let n=s;if(!n){if(Array.isArray(e))n=[];else{const e=Array.from(D.keys()).filter(e=>e!=="yaml11").map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e)){for(const t of e)n=n.concat(t)}else if(typeof e==="function"){n=e(n.slice())}if(B)n=n.concat(f.merge);return n.reduce((e,t)=>{const B=typeof t==="string"?E[t]:t;if(!B){const e=JSON.stringify(t);const B=Object.keys(E).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${B}`)}if(!e.includes(B))e.push(B);return e},[])}t.coreKnownTags=y;t.getTags=getTags},6083:(e,t,B)=>{"use strict";var s=B(181);var n=B(3301);var r=B(3069);const i={identify:e=>e instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof s.Buffer==="function"){return s.Buffer.from(e,"base64")}else if(typeof atob==="function"){const t=atob(e.replace(/[\n\r]/g,""));const B=new Uint8Array(t.length);for(let e=0;e{"use strict";var s=B(3301);function boolStringify({value:e,source:t},B){const s=e?n:r;if(t&&s.test.test(t))return t;return e?B.options.trueStr:B.options.falseStr}const n={identify:e=>e===true,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new s.Scalar(true),stringify:boolStringify};const r={identify:e=>e===false,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new s.Scalar(false),stringify:boolStringify};t.falseTag=r;t.trueTag=n},5782:(e,t,B)=>{"use strict";var s=B(3301);var n=B(8689);const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber};const i={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}};const a={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new s.Scalar(parseFloat(e.replace(/_/g,"")));const B=e.indexOf(".");if(B!==-1){const s=e.substring(B+1).replace(/_/g,"");if(s[s.length-1]==="0")t.minFractionDigits=s.length}return t},stringify:n.stringifyNumber};t.float=a;t.floatExp=i;t.floatNaN=r},873:(e,t,B)=>{"use strict";var s=B(8689);const intIdentify=e=>typeof e==="bigint"||Number.isInteger(e);function intResolve(e,t,B,{intAsBigInt:s}){const n=e[0];if(n==="-"||n==="+")t+=1;e=e.substring(t).replace(/_/g,"");if(s){switch(B){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const t=BigInt(e);return n==="-"?BigInt(-1)*t:t}const r=parseInt(e,B);return n==="-"?-1*r:r}function intStringify(e,t,B){const{value:n}=e;if(intIdentify(n)){const e=n.toString(t);return n<0?"-"+B+e.substr(1):B+e}return s.stringifyNumber(e)}const n={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,B)=>intResolve(e,2,2,B),stringify:e=>intStringify(e,2,"0b")};const r={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,B)=>intResolve(e,1,8,B),stringify:e=>intStringify(e,8,"0")};const i={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,B)=>intResolve(e,0,10,B),stringify:s.stringifyNumber};const a={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,B)=>intResolve(e,2,16,B),stringify:e=>intStringify(e,16,"0x")};t.int=i;t.intBin=n;t.intHex=a;t.intOct=r},452:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);const r="<<";const i={identify:e=>e===r||typeof e==="symbol"&&e.description===r,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(r)),{addToJSMap:addMergeToJSMap}),stringify:()=>r};const isMergeKey=(e,t)=>(i.identify(t)||s.isScalar(t)&&(!t.type||t.type===n.Scalar.PLAIN)&&i.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===i.tag&&e.default);function addMergeToJSMap(e,t,B){const n=resolveAliasValue(e,B);if(s.isSeq(n))for(const B of n.items)mergeValue(e,t,B);else if(Array.isArray(n))for(const B of n)mergeValue(e,t,B);else mergeValue(e,t,n)}function mergeValue(e,t,B){const n=resolveAliasValue(e,B);if(!s.isMap(n))throw new Error("Merge sources must be maps or map aliases");const r=n.toJSON(null,e,Map);for(const[e,B]of r){if(t instanceof Map){if(!t.has(e))t.set(e,B)}else if(t instanceof Set){t.add(e)}else if(!Object.prototype.hasOwnProperty.call(t,e)){Object.defineProperty(t,e,{value:B,writable:true,enumerable:true,configurable:true})}}return t}function resolveAliasValue(e,t){return e&&s.isAlias(t)?t.resolve(e.doc,e):t}t.addMergeToJSMap=addMergeToJSMap;t.isMergeKey=isMergeKey;t.merge=i},303:(e,t,B)=>{"use strict";var s=B(1127);var n=B(4043);var r=B(4454);var i=B(2223);var a=B(8385);class YAMLOMap extends i.YAMLSeq{constructor(){super();this.add=r.YAMLMap.prototype.add.bind(this);this.delete=r.YAMLMap.prototype.delete.bind(this);this.get=r.YAMLMap.prototype.get.bind(this);this.has=r.YAMLMap.prototype.has.bind(this);this.set=r.YAMLMap.prototype.set.bind(this);this.tag=YAMLOMap.tag}toJSON(e,t){if(!t)return super.toJSON(e);const B=new Map;if(t?.onCreate)t.onCreate(B);for(const e of this.items){let r,i;if(s.isPair(e)){r=n.toJS(e.key,"",t);i=n.toJS(e.value,r,t)}else{r=n.toJS(e,"",t)}if(B.has(r))throw new Error("Ordered maps must not include duplicate keys");B.set(r,i)}return B}static from(e,t,B){const s=a.createPairs(e,t,B);const n=new this;n.items=s.items;return n}}YAMLOMap.tag="tag:yaml.org,2002:omap";const o={collection:"seq",identify:e=>e instanceof Map,nodeClass:YAMLOMap,default:false,tag:"tag:yaml.org,2002:omap",resolve(e,t){const B=a.resolvePairs(e,t);const n=[];for(const{key:e}of B.items){if(s.isScalar(e)){if(n.includes(e.value)){t(`Ordered maps must not include duplicate keys: ${e.value}`)}else{n.push(e.value)}}}return Object.assign(new YAMLOMap,B)},createNode:(e,t,B)=>YAMLOMap.from(e,t,B)};t.YAMLOMap=YAMLOMap;t.omap=o},8385:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(3301);var i=B(2223);function resolvePairs(e,t){if(s.isSeq(e)){for(let B=0;B1)t("Each pair must have its own sequence indicator");const e=i.items[0]||new n.Pair(new r.Scalar(null));if(i.commentBefore)e.key.commentBefore=e.key.commentBefore?`${i.commentBefore}\n${e.key.commentBefore}`:i.commentBefore;if(i.comment){const t=e.value??e.key;t.comment=t.comment?`${i.comment}\n${t.comment}`:i.comment}i=e}e.items[B]=s.isPair(i)?i:new n.Pair(i)}}else t("Expected a sequence for this tag");return e}function createPairs(e,t,B){const{replacer:s}=B;const r=new i.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){if(typeof s==="function")e=s.call(t,String(a++),e);let i,o;if(Array.isArray(e)){if(e.length===2){i=e[0];o=e[1]}else throw new TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){const t=Object.keys(e);if(t.length===1){i=t[0];o=e[i]}else{throw new TypeError(`Expected tuple with one key, not ${t.length} keys`)}}else{i=e}r.items.push(n.createPair(i,o,B))}return r}const a={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:resolvePairs,createNode:createPairs};t.createPairs=createPairs;t.pairs=a;t.resolvePairs=resolvePairs},5913:(e,t,B)=>{"use strict";var s=B(7451);var n=B(3632);var r=B(1706);var i=B(6464);var a=B(6083);var o=B(8398);var l=B(5782);var c=B(873);var C=B(452);var u=B(303);var f=B(8385);var h=B(1528);var p=B(6752);const g=[s.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,l.floatNaN,l.floatExp,l.float,a.binary,C.merge,u.omap,f.pairs,h.set,p.intTime,p.floatTime,p.timestamp];t.schema=g},1528:(e,t,B)=>{"use strict";var s=B(1127);var n=B(7165);var r=B(4454);class YAMLSet extends r.YAMLMap{constructor(e){super(e);this.tag=YAMLSet.tag}add(e){let t;if(s.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new n.Pair(e.key,null);else t=new n.Pair(e,null);const B=r.findPair(this.items,t.key);if(!B)this.items.push(t)}get(e,t){const B=r.findPair(this.items,e);return!t&&s.isPair(B)?s.isScalar(B.key)?B.key.value:B.key:B}set(e,t){if(typeof t!=="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const B=r.findPair(this.items,e);if(B&&!t){this.items.splice(this.items.indexOf(B),1)}else if(!B&&t){this.items.push(new n.Pair(e))}}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,B){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(true))return super.toString(Object.assign({},e,{allNullValues:true}),t,B);else throw new Error("Set items must all have null values")}static from(e,t,B){const{replacer:s}=B;const r=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t){if(typeof s==="function")e=s.call(t,e,e);r.items.push(n.createPair(e,null,B))}return r}}YAMLSet.tag="tag:yaml.org,2002:set";const i={collection:"map",identify:e=>e instanceof Set,nodeClass:YAMLSet,default:false,tag:"tag:yaml.org,2002:set",createNode:(e,t,B)=>YAMLSet.from(e,t,B),resolve(e,t){if(s.isMap(e)){if(e.hasAllNullValues(true))return Object.assign(new YAMLSet,e);else t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};t.YAMLSet=YAMLSet;t.set=i},6752:(e,t,B)=>{"use strict";var s=B(8689);function parseSexagesimal(e,t){const B=e[0];const s=B==="-"||B==="+"?e.substring(1):e;const num=e=>t?BigInt(e):Number(e);const n=s.replace(/_/g,"").split(":").reduce((e,t)=>e*num(60)+num(t),num(0));return B==="-"?num(-1)*n:n}function stringifySexagesimal(e){let{value:t}=e;let num=e=>e;if(typeof t==="bigint")num=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return s.stringifyNumber(e);let B="";if(t<0){B="-";t*=num(-1)}const n=num(60);const r=[t%n];if(t<60){r.unshift(0)}else{t=(t-r[0])/n;r.unshift(t%n);if(t>=60){t=(t-r[0])/n;r.unshift(t)}}return B+r.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const n={identify:e=>typeof e==="bigint"||Number.isInteger(e),default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:B})=>parseSexagesimal(e,B),stringify:stringifySexagesimal};const r={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>parseSexagesimal(e,false),stringify:stringifySexagesimal};const i={identify:e=>e instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})"+"(?:"+"(?:t|T|[ \\t]+)"+"([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)"+"(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?"+")?$"),resolve(e){const t=e.match(i.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,B,s,n,r,a,o]=t.map(Number);const l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(B,s-1,n,r||0,a||0,o||0,l);const C=t[8];if(C&&C!=="Z"){let e=parseSexagesimal(C,false);if(Math.abs(e)<30)e*=60;c-=6e4*e}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};t.floatTime=r;t.intTime=n;t.timestamp=i},4475:(e,t)=>{"use strict";const B="flow";const s="block";const n="quoted";function foldFlowLines(e,t,B="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return e;if(ii-Math.max(2,a))C.push(0);else f=i-r}let h=undefined;let p=undefined;let g=false;let m=-1;let d=-1;let D=-1;if(B===s){m=consumeMoreIndentedLines(e,m,t.length);if(m!==-1)f=m+c}for(let r;r=e[m+=1];){if(B===n&&r==="\\"){d=m;switch(e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}D=m}if(r==="\n"){if(B===s)m=consumeMoreIndentedLines(e,m,t.length);f=m+t.length+c;h=undefined}else{if(r===" "&&p&&p!==" "&&p!=="\n"&&p!=="\t"){const t=e[m+1];if(t&&t!==" "&&t!=="\n"&&t!=="\t")h=m}if(m>=f){if(h){C.push(h);f=h+c;h=undefined}else if(B===n){while(p===" "||p==="\t"){p=r;r=e[m+=1];g=true}const t=m>D+1?m-2:d-1;if(u[t])return e;C.push(t);u[t]=true;f=t+c;h=undefined}else{g=true}}}p=r}if(g&&l)l();if(C.length===0)return e;if(o)o();let E=e.slice(0,C[0]);for(let s=0;s{"use strict";var s=B(1596);var n=B(1127);var r=B(9799);var i=B(3069);function createStringifyContext(e,t){const B=Object.assign({blockQuote:true,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trailingComma:false,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let s;switch(B.collectionStyle){case"block":s=false;break;case"flow":s=true;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:B.flowCollectionPadding?" ":"",indent:"",indentStep:typeof B.indent==="number"?" ".repeat(B.indent):" ",inFlow:s,options:B}}function getTagObject(e,t){if(t.tag){const B=e.filter(e=>e.tag===t.tag);if(B.length>0)return B.find(e=>e.format===t.format)??B[0]}let B=undefined;let s;if(n.isScalar(t)){s=t.value;let n=e.filter(e=>e.identify?.(s));if(n.length>1){const e=n.filter(e=>e.test);if(e.length>0)n=e}B=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else{s=t;B=e.find(e=>e.nodeClass&&s instanceof e.nodeClass)}if(!B){const e=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${e} value`)}return B}function stringifyProps(e,t,{anchors:B,doc:r}){if(!r.directives)return"";const i=[];const a=(n.isScalar(e)||n.isCollection(e))&&e.anchor;if(a&&s.anchorIsValid(a)){B.add(a);i.push(`&${a}`)}const o=e.tag??(t.default?null:t.tag);if(o)i.push(r.directives.tagString(o));return i.join(" ")}function stringify(e,t,B,s){if(n.isPair(e))return e.toString(t,B,s);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e)){throw new TypeError(`Cannot stringify circular structure without alias nodes`)}else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let r=undefined;const a=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>r=e});r??(r=getTagObject(t.doc.schema.tags,a));const o=stringifyProps(a,r,t);if(o.length>0)t.indentAtStart=(t.indentAtStart??0)+o.length+1;const l=typeof r.stringify==="function"?r.stringify(a,t,B,s):n.isScalar(a)?i.stringifyString(a,t,B,s):a.toString(t,B,s);if(!o)return l;return n.isScalar(a)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}\n${t.indent}${l}`}t.createStringifyContext=createStringifyContext;t.stringify=stringify},1212:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2148);var r=B(9799);function stringifyCollection(e,t,B){const s=t.inFlow??e.flow;const n=s?stringifyFlowCollection:stringifyBlockCollection;return n(e,t,B)}function stringifyBlockCollection({comment:e,items:t},B,{blockItemPrefix:i,flowChars:a,itemIndent:o,onChompKeep:l,onComment:c}){const{indent:C,options:{commentString:u}}=B;const f=Object.assign({},B,{indent:o,type:null});let h=false;const p=[];for(let e=0;el=null,()=>h=true);if(l)c+=r.lineComment(c,o,u(l));if(h&&l)h=false;p.push(i+c)}let g;if(p.length===0){g=a.start+a.end}else{g=p[0];for(let e=1;eo=null);u||(u=h.length>f||l.includes("\n"));if(B0){u||(u=h.reduce((e,t)=>e+t.length+2,2)+(l.length+2)>t.options.lineWidth)}if(u){l+=","}}if(o)l+=r.lineComment(l,i,c(o));h.push(l);f=h.length}const{start:p,end:g}=B;if(h.length===0){return p+g}else{if(!u){const e=h.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(u){let e=p;for(const t of h)e+=t?`\n${o}${a}${t}`:"\n";return`${e}\n${a}${g}`}else{return`${p}${l}${h.join(" ")}${l}${g}`}}}function addCommentBefore({indent:e,options:{commentString:t}},B,s,n){if(s&&n)s=s.replace(/^\n+/,"");if(s){const n=r.indentComment(t(s),e);B.push(n.trimStart())}}t.stringifyCollection=stringifyCollection},9799:(e,t)=>{"use strict";const stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function indentComment(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}const lineComment=(e,t,B)=>e.endsWith("\n")?indentComment(B,t):B.includes("\n")?"\n"+indentComment(B,t):(e.endsWith(" ")?"":" ")+B;t.indentComment=indentComment;t.lineComment=lineComment;t.stringifyComment=stringifyComment},6829:(e,t,B)=>{"use strict";var s=B(1127);var n=B(2148);var r=B(9799);function stringifyDocument(e,t){const B=[];let i=t.directives===true;if(t.directives!==false&&e.directives){const t=e.directives.toString(e);if(t){B.push(t);i=true}else if(e.directives.docStart)i=true}if(i)B.push("---");const a=n.createStringifyContext(e,t);const{commentString:o}=a.options;if(e.commentBefore){if(B.length!==1)B.unshift("");const t=o(e.commentBefore);B.unshift(r.indentComment(t,""))}let l=false;let c=null;if(e.contents){if(s.isNode(e.contents)){if(e.contents.spaceBefore&&i)B.push("");if(e.contents.commentBefore){const t=o(e.contents.commentBefore);B.push(r.indentComment(t,""))}a.forceBlockIndent=!!e.comment;c=e.contents.comment}const t=c?undefined:()=>l=true;let C=n.stringify(e.contents,a,()=>c=null,t);if(c)C+=r.lineComment(C,"",o(c));if((C[0]==="|"||C[0]===">")&&B[B.length-1]==="---"){B[B.length-1]=`--- ${C}`}else B.push(C)}else{B.push(n.stringify(e.contents,a))}if(e.directives?.docEnd){if(e.comment){const t=o(e.comment);if(t.includes("\n")){B.push("...");B.push(r.indentComment(t,""))}else{B.push(`... ${t}`)}}else{B.push("...")}}else{let t=e.comment;if(t&&l)t=t.replace(/^\n+/,"");if(t){if((!l||c)&&B[B.length-1]!=="")B.push("");B.push(r.indentComment(o(t),""))}}return B.join("\n")+"\n"}t.stringifyDocument=stringifyDocument},8689:(e,t)=>{"use strict";function stringifyNumber({format:e,minFractionDigits:t,tag:B,value:s}){if(typeof s==="bigint")return String(s);const n=typeof s==="number"?s:Number(s);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!B||B==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let e=r.indexOf(".");if(e<0){e=r.length;r+="."}let B=t-(r.length-e-1);while(B-- >0)r+="0"}return r}t.stringifyNumber=stringifyNumber},9748:(e,t,B)=>{"use strict";var s=B(1127);var n=B(3301);var r=B(2148);var i=B(9799);function stringifyPair({key:e,value:t},B,a,o){const{allNullValues:l,doc:c,indent:C,indentStep:u,options:{commentString:f,indentSeq:h,simpleKeys:p}}=B;let g=s.isNode(e)&&e.comment||null;if(p){if(g){throw new Error("With simple keys, key nodes cannot have comments")}if(s.isCollection(e)||!s.isNode(e)&&typeof e==="object"){const e="With simple keys, collection cannot be used as a key value";throw new Error(e)}}let m=!p&&(!e||g&&t==null&&!B.inFlow||s.isCollection(e)||(s.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==="object"));B=Object.assign({},B,{allNullValues:false,implicitKey:!m&&(p||!l),indent:C+u});let d=false;let D=false;let E=r.stringify(e,B,()=>d=true,()=>D=true);if(!m&&!B.inFlow&&E.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=true}if(B.inFlow){if(l||t==null){if(d&&a)a();return E===""?"?":m?`? ${E}`:E}}else if(l&&!p||t==null&&m){E=`? ${E}`;if(g&&!d){E+=i.lineComment(E,B.indent,f(g))}else if(D&&o)o();return E}if(d)g=null;if(m){if(g)E+=i.lineComment(E,B.indent,f(g));E=`? ${E}\n${C}:`}else{E=`${E}:`;if(g)E+=i.lineComment(E,B.indent,f(g))}let y,b,O;if(s.isNode(t)){y=!!t.spaceBefore;b=t.commentBefore;O=t.comment}else{y=false;b=null;O=null;if(t&&typeof t==="object")t=c.createNode(t)}B.implicitKey=false;if(!m&&!g&&s.isScalar(t))B.indentAtStart=E.length+1;D=false;if(!h&&u.length>=2&&!B.inFlow&&!m&&s.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor){B.indent=B.indent.substring(2)}let w=false;const S=r.stringify(t,B,()=>w=true,()=>D=true);let N=" ";if(g||y||b){N=y?"\n":"";if(b){const e=f(b);N+=`\n${i.indentComment(e,B.indent)}`}if(S===""&&!B.inFlow){if(N==="\n"&&O)N="\n\n"}else{N+=`\n${B.indent}`}}else if(!m&&s.isCollection(t)){const e=S[0];const s=S.indexOf("\n");const n=s!==-1;const r=B.inFlow??t.flow??t.items.length===0;if(n||!r){let t=false;if(n&&(e==="&"||e==="!")){let B=S.indexOf(" ");if(e==="&"&&B!==-1&&B{"use strict";var s=B(3301);var n=B(4475);const getFoldOptions=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});const containsDocumentMarker=e=>/^(%|---|\.\.\.)/m.test(e);function lineLengthOverLimit(e,t,B){if(!t||t<0)return false;const s=t-B;const n=e.length;if(n<=s)return false;for(let t=0,B=0;ts)return true;B=t+1;if(n-B<=s)return false}}return true}function doubleQuotedString(e,t){const B=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return B;const{implicitKey:s}=t;const r=t.options.doubleQuotedMinMultiLineLength;const i=t.indent||(containsDocumentMarker(e)?" ":"");let a="";let o=0;for(let e=0,t=B[e];t;t=B[++e]){if(t===" "&&B[e+1]==="\\"&&B[e+2]==="n"){a+=B.slice(o,e)+"\\ ";e+=1;o=e;t="\\"}if(t==="\\")switch(B[e+1]){case"u":{a+=B.slice(o,e);const t=B.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:if(t.substr(0,2)==="00")a+="\\x"+t.substr(2);else a+=B.substr(e,6)}e+=5;o=e+1}break;case"n":if(s||B[e+2]==='"'||B.length\n";let h;let p;for(p=B.length;p>0;--p){const e=B[p-1];if(e!=="\n"&&e!=="\t"&&e!==" ")break}let g=B.substring(p);const m=g.indexOf("\n");if(m===-1){h="-"}else if(B===g||m!==g.length-1){h="+";if(o)o()}else{h=""}if(g){B=B.slice(0,-g.length);if(g[g.length-1]==="\n")g=g.slice(0,-1);g=g.replace(r,`$&${u}`)}let d=false;let D;let E=-1;for(D=0;D{r=true}}const o=n.foldFlowLines(`${y}${e}${g}`,u,n.FOLD_BLOCK,a);if(!r)return`>${O}\n${u}${o}`}B=B.replace(/\n+/g,`$&${u}`);return`|${O}\n${u}${y}${B}${g}`}function plainString(e,t,B,r){const{type:i,value:a}=e;const{actualString:o,implicitKey:l,indent:c,indentStep:C,inFlow:u}=t;if(l&&a.includes("\n")||u&&/[[\]{},]/.test(a)){return quotedString(a,t)}if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)){return l||u||!a.includes("\n")?quotedString(a,t):blockString(e,t,B,r)}if(!l&&!u&&i!==s.Scalar.PLAIN&&a.includes("\n")){return blockString(e,t,B,r)}if(containsDocumentMarker(a)){if(c===""){t.forceBlockIndent=true;return blockString(e,t,B,r)}else if(l&&c===C){return quotedString(a,t)}}const f=a.replace(/\n+/g,`$&\n${c}`);if(o){const test=e=>e.default&&e.tag!=="tag:yaml.org,2002:str"&&e.test?.test(f);const{compat:e,tags:B}=t.doc.schema;if(B.some(test)||e?.some(test))return quotedString(a,t)}return l?f:n.foldFlowLines(f,c,n.FOLD_FLOW,getFoldOptions(t,false))}function stringifyString(e,t,B,n){const{implicitKey:r,inFlow:i}=t;const a=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;if(o!==s.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value))o=s.Scalar.QUOTE_DOUBLE}const _stringify=e=>{switch(e){case s.Scalar.BLOCK_FOLDED:case s.Scalar.BLOCK_LITERAL:return r||i?quotedString(a.value,t):blockString(a,t,B,n);case s.Scalar.QUOTE_DOUBLE:return doubleQuotedString(a.value,t);case s.Scalar.QUOTE_SINGLE:return singleQuotedString(a.value,t);case s.Scalar.PLAIN:return plainString(a,t,B,n);default:return null}};let l=_stringify(o);if(l===null){const{defaultKeyType:e,defaultStringType:B}=t.options;const s=r&&e||B;l=_stringify(s);if(l===null)throw new Error(`Unsupported default string type ${s}`)}return l}t.stringifyString=stringifyString},204:(e,t,B)=>{"use strict";var s=B(1127);const n=Symbol("break visit");const r=Symbol("skip children");const i=Symbol("remove node");function visit(e,t){const B=initVisitor(t);if(s.isDocument(e)){const t=visit_(null,e.contents,B,Object.freeze([e]));if(t===i)e.contents=null}else visit_(null,e,B,Object.freeze([]))}visit.BREAK=n;visit.SKIP=r;visit.REMOVE=i;function visit_(e,t,B,r){const a=callVisitor(e,t,B,r);if(s.isNode(a)||s.isPair(a)){replaceNode(e,r,a);return visit_(e,a,B,r)}if(typeof a!=="symbol"){if(s.isCollection(t)){r=Object.freeze(r.concat(t));for(let e=0;e{ /*! * re2js * RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching diff --git a/src/artifact.js b/src/artifact.js index 2266ca7..d6b2273 100644 --- a/src/artifact.js +++ b/src/artifact.js @@ -308,12 +308,20 @@ function loadArtifacts(root) { `no result.json artifacts found under ${root}`, ); const baselines = []; + const platformHasBaseline = new Map(); const results = resultPaths.map((filename) => { const result = JSON.parse(fs.readFileSync(filename, "utf8")); try { validateResult(result, config); const baselinePath = path.join(path.dirname(filename), "baseline.json"); - if (fs.existsSync(baselinePath)) { + const hasBaseline = fs.existsSync(baselinePath); + const previous = platformHasBaseline.get(result.platform.id); + assert( + previous === undefined || previous === hasBaseline, + `same-runner baseline must be present for every shard of platform ${JSON.stringify(result.platform.id)}`, + ); + platformHasBaseline.set(result.platform.id, hasBaseline); + if (hasBaseline) { const baseline = validateResult( JSON.parse(fs.readFileSync(baselinePath, "utf8")), config, @@ -334,10 +342,6 @@ function loadArtifacts(root) { throw new Error(`${filename}: ${error.message}`, { cause: error }); } }); - assert( - baselines.length === 0 || baselines.length === results.length, - "same-runner baseline must be present for every result artifact", - ); return { config, results: mergeShards(results), diff --git a/src/report.js b/src/report.js index 5bf9014..8a0ff9d 100644 --- a/src/report.js +++ b/src/report.js @@ -100,11 +100,18 @@ function writeReport( ([platformId, result]) => isIndexPaired(result, baseline.platforms?.[platformId], sameRunner), ); + const missingPlatform = Object.keys(current.platforms).some( + (platformId) => !baseline.platforms?.[platformId], + ); comparisonNote = `_Compared with [\`${baseline.source.sha.slice(0, 12)}\`](<${baseline.source.url}>) measured in the same runner job${ paired ? "; index-paired signed differences and percentage changes are pairwise medians" : "" - }._`; + }.${ + missingPlatform + ? " Platforms without a paired baseline are marked `new`." + : "" + }_`; } else if (baseline) { comparisonNote = "_Compared only with the latest matching platform in the main series._"; diff --git a/test/artifact.test.js b/test/artifact.test.js index 0a2313a..535ee68 100644 --- a/test/artifact.test.js +++ b/test/artifact.test.js @@ -95,7 +95,7 @@ test("validates, writes, loads, and merges distinct shards", () => { ); }); -test("requires a same-runner baseline for every artifact", () => { +test("requires a same-runner baseline for every shard of a platform", () => { const config = new Config({ id: "artifact", groups: { core: "^Core" } }); const root = fs.mkdtempSync(path.join(os.tmpdir(), "benchmark-paired-")); writeArtifact( @@ -111,7 +111,46 @@ test("requires a same-runner baseline for every artifact", () => { ); assert.throws( () => loadArtifacts(root), - /baseline must be present for every result artifact/u, + /baseline must be present for every shard of platform "linux-amd64"/u, + ); +}); + +test("allows a platform without a same-runner baseline", () => { + const config = new Config({ id: "artifact", groups: { core: "^Core" } }); + const root = fs.mkdtempSync(path.join(os.tmpdir(), "benchmark-partial-")); + writeArtifact( + path.join(root, "linux"), + config, + result("linux", ["BenchmarkCoreLinux"]), + result("linux", ["BenchmarkCoreLinux"], { + source: { + ...result("linux", []).source, + sha: baselineSHA, + url: `https://github.com/owner/project/commit/${baselineSHA}`, + }, + }), + ); + writeArtifact( + path.join(root, "windows"), + config, + result("windows", ["BenchmarkCoreWindows"], { + platform: { + id: "windows-amd64", + label: "Windows / amd64", + os: "windows", + arch: "amd64", + }, + }), + ); + + const loaded = loadArtifacts(root); + assert.deepEqual( + loaded.results.map((item) => item.platform.id), + ["linux-amd64", "windows-amd64"], + ); + assert.deepEqual( + loaded.baselines.map((item) => item.platform.id), + ["linux-amd64"], ); }); diff --git a/test/store-report.test.js b/test/store-report.test.js index a8162bb..0db291e 100644 --- a/test/store-report.test.js +++ b/test/store-report.test.js @@ -277,6 +277,46 @@ test("marks values new when no main platform baseline exists", () => { assert.match(fs.readFileSync(comment, "utf8"), /\| new \|/u); }); +test("reports a platform without a paired baseline as new", () => { + const config = new Config({ + id: "history", + groups: { core: "^Core" }, + }); + const root = fs.mkdtempSync(path.join(os.tmpdir(), "benchmark-partial-")); + const baseSHA = "3434343434343434343434343434343434343434"; + const headSHA = "3535353535353535353535353535353535353535"; + const linux = result(headSHA, 8); + const windows = result(headSHA, 12); + windows.platform = { + id: "windows-amd64", + label: "Windows / amd64", + os: "windows", + arch: "amd64", + }; + const baseline = result(baseSHA, 10); + const comment = path.join(root, "comment.md"); + + writeReport( + comment, + "", + config, + { + source: linux.source, + platforms: { "linux-amd64": linux, "windows-amd64": windows }, + }, + { + source: baseline.source, + platforms: { "linux-amd64": baseline }, + }, + { sameRunner: true }, + ); + + const body = fs.readFileSync(comment, "utf8"); + assert.match(body, /### Linux \/ amd64[\s\S]*-20\.0% \(better\)/u); + assert.match(body, /### Windows \/ amd64[\s\S]*\| new \|/u); + assert.match(body, /Platforms without a paired baseline are marked `new`/u); +}); + test("keeps valid history when grouping and chart configuration evolves", () => { const root = fs.mkdtempSync(path.join(os.tmpdir(), "benchmark-config-")); const firstConfig = new Config({