@mcp-com-ai/hapi 1.1.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/bin.js +121 -113
- package/dist/core/document-source.d.ts +4 -0
- package/dist/core/index.js +64 -64
- package/dist/core/plugin-loader.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +122 -114
- package/dist/skills/hapi-federated-apis/SKILL.md +452 -0
- package/dist/skills/hapi-federated-apis/scripts/audit-planning-facts.ts +127 -0
- package/dist/skills/hapi-intent-based-apis/SKILL.md +199 -0
- package/dist/skills/hapi-intent-based-apis/references/examples.md +135 -0
- package/dist/skills/hapi-intent-based-apis/references/extension-rules.md +90 -0
- package/dist/skills/hapi-intent-based-apis/references/runtime-behavior.md +52 -0
- package/dist/skills/hapi-intent-based-apis/scripts/check-intent-metadata.ts +163 -0
- package/dist/workspace-plugins.d.ts +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)}}M.defaultYaml={explicit:!1,version:"1.2"};M.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
2
|
+
var b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ue=import.meta.require;var A=b(function(vo){var Kt=Symbol.for("yaml.alias"),On=Symbol.for("yaml.document"),We=Symbol.for("yaml.map"),Pn=Symbol.for("yaml.pair"),Ft=Symbol.for("yaml.scalar"),ze=Symbol.for("yaml.seq"),j=Symbol.for("yaml.node.type"),ho=(e)=>!!e&&typeof e==="object"&&e[j]===Kt,mo=(e)=>!!e&&typeof e==="object"&&e[j]===On,go=(e)=>!!e&&typeof e==="object"&&e[j]===We,yo=(e)=>!!e&&typeof e==="object"&&e[j]===Pn,Ln=(e)=>!!e&&typeof e==="object"&&e[j]===Ft,bo=(e)=>!!e&&typeof e==="object"&&e[j]===ze;function En(e){if(e&&typeof e==="object")switch(e[j]){case We:case ze:return!0}return!1}function wo(e){if(e&&typeof e==="object")switch(e[j]){case Kt:case We:case Ft:case ze:return!0}return!1}var So=(e)=>(Ln(e)||En(e))&&!!e.anchor;vo.ALIAS=Kt;vo.DOC=On;vo.MAP=We;vo.NODE_TYPE=j;vo.PAIR=Pn;vo.SCALAR=Ft;vo.SEQ=ze;vo.hasAnchor=So;vo.isAlias=ho;vo.isCollection=En;vo.isDocument=mo;vo.isMap=go;vo.isNode=wo;vo.isPair=yo;vo.isScalar=Ln;vo.isSeq=bo});var Se=b(function(Ro){var q=A(),T=Symbol("break visit"),qn=Symbol("skip children"),R=Symbol("remove node");function Ge(e,t){let s=In(t);if(q.isDocument(e)){if(ae(null,e.contents,s,Object.freeze([e]))===R)e.contents=null}else ae(null,e,s,Object.freeze([]))}Ge.BREAK=T;Ge.SKIP=qn;Ge.REMOVE=R;function ae(e,t,s,n){let i=$n(e,t,s,n);if(q.isNode(i)||q.isPair(i))return Tn(e,n,i),ae(e,i,s,n);if(typeof i!=="symbol"){if(q.isCollection(t)){n=Object.freeze(n.concat(t));for(let r=0;r<t.items.length;++r){let o=ae(r,t.items[r],s,n);if(typeof o==="number")r=o-1;else if(o===T)return T;else if(o===R)t.items.splice(r,1),r-=1}}else if(q.isPair(t)){n=Object.freeze(n.concat(t));let r=ae("key",t.key,s,n);if(r===T)return T;else if(r===R)t.key=null;let o=ae("value",t.value,s,n);if(o===T)return T;else if(o===R)t.value=null}}return i}async function Qe(e,t){let s=In(t);if(q.isDocument(e)){if(await le(null,e.contents,s,Object.freeze([e]))===R)e.contents=null}else await le(null,e,s,Object.freeze([]))}Qe.BREAK=T;Qe.SKIP=qn;Qe.REMOVE=R;async function le(e,t,s,n){let i=await $n(e,t,s,n);if(q.isNode(i)||q.isPair(i))return Tn(e,n,i),le(e,i,s,n);if(typeof i!=="symbol"){if(q.isCollection(t)){n=Object.freeze(n.concat(t));for(let r=0;r<t.items.length;++r){let o=await le(r,t.items[r],s,n);if(typeof o==="number")r=o-1;else if(o===T)return T;else if(o===R)t.items.splice(r,1),r-=1}}else if(q.isPair(t)){n=Object.freeze(n.concat(t));let r=await le("key",t.key,s,n);if(r===T)return T;else if(r===R)t.key=null;let o=await le("value",t.value,s,n);if(o===T)return T;else if(o===R)t.value=null}}return i}function In(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function $n(e,t,s,n){if(typeof s==="function")return s(e,t,n);if(q.isMap(t))return s.Map?.(e,t,n);if(q.isSeq(t))return s.Seq?.(e,t,n);if(q.isPair(t))return s.Pair?.(e,t,n);if(q.isScalar(t))return s.Scalar?.(e,t,n);if(q.isAlias(t))return s.Alias?.(e,t,n);return}function Tn(e,t,s){let n=t[t.length-1];if(q.isCollection(n))n.items[e]=s;else if(q.isPair(n))if(e==="key")n.key=s;else n.value=s;else if(q.isDocument(n))n.contents=s;else{let i=q.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Ro.visit=Ge;Ro.visitAsync=Qe});var Ut=b(function(Yo){var Mn=A(),Ko=Se(),Fo={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Uo=(e)=>e.replace(/[!,[\]{}]/g,(t)=>Fo[t]);class M{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},M.defaultYaml,e),this.tags=Object.assign({},M.defaultTags,t)}clone(){let e=new M(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new M(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:M.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},M.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:M.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},M.defaultTags),this.atNextDocument=!1;let s=e.trim().split(/[ \t]+/),n=s.shift();switch(n){case"%TAG":{if(s.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),s.length<2)return!1}let[i,r]=s;return this.tags[i]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let r=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,r),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let r=e.slice(2,-1);if(r==="!"||r==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return r}let[,s,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(n)}catch(r){return t(String(r)),null}if(s==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+Uo(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),n;if(e&&s.length>0&&Mn.isNode(e.contents)){let i={};Ko.visit(e.contents,(r,o)=>{if(Mn.isNode(o)&&o.tag)i[o.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,r]of s){if(i==="!!"&&r==="tag:yaml.org,2002:")continue;if(!e||n.some((o)=>o.startsWith(r)))t.push(`%TAG ${i} ${r}`)}return t.join(`
|
|
3
|
+
`)}}M.defaultYaml={explicit:!1,version:"1.2"};M.defaultTags={"!!":"tag:yaml.org,2002:"};Yo.Directives=M});var Xe=b(function(zo){var xn=A(),Ho=Se();function Jo(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(s)}return!0}function _n(e){let t=new Set;return Ho.visit(e,{Value(s,n){if(n.anchor)t.add(n.anchor)}}),t}function Dn(e,t){for(let s=1;;++s){let n=`${e}${s}`;if(!t.has(n))return n}}function Wo(e,t){let s=[],n=new Map,i=null;return{onAnchor:(r)=>{s.push(r),i??(i=_n(e));let o=Dn(t,i);return i.add(o),o},setAnchors:()=>{for(let r of s){let o=n.get(r);if(typeof o==="object"&&o.anchor&&(xn.isScalar(o.node)||xn.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}zo.anchorIsValid=Jo;zo.anchorNames=_n;zo.createNodeAnchors=Wo;zo.findNewAnchor=Dn});var Yt=b(function(ea){function ve(e,t,s,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=ve(e,n,String(i),o);if(a===void 0)delete n[i];else if(a!==o)n[i]=a}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=ve(e,n,i,r);if(o===void 0)n.delete(i);else if(o!==r)n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=ve(e,n,i,i);if(r===void 0)n.delete(i);else if(r!==i)n.delete(i),n.add(r)}else for(let[i,r]of Object.entries(n)){let o=ve(e,n,i,r);if(o===void 0)delete n[i];else if(o!==r)n[i]=o}return e.call(t,s,n)}ea.applyReviver=ve});var U=b(function(na){var sa=A();function Rn(e,t,s){if(Array.isArray(e))return e.map((n,i)=>Rn(n,String(i),s));if(e&&typeof e.toJSON==="function"){if(!s||!sa.hasAnchor(e))return e.toJSON(t,s);let n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=(r)=>{n.res=r,delete s.onCreate};let i=e.toJSON(t,s);if(s.onCreate)s.onCreate(i);return i}if(typeof e==="bigint"&&!s?.keep)return Number(e);return e}na.toJS=Rn});var Ze=b(function(aa){var ra=Yt(),Bn=A(),oa=U();class jn{constructor(e){Object.defineProperty(this,Bn.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:n,reviver:i}={}){if(!Bn.isDocument(e))throw TypeError("A document argument is required");let r={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s==="number"?s:100},o=oa.toJS(this,"",r);if(typeof n==="function")for(let{count:a,res:l}of r.anchors.values())n(l,a);return typeof i==="function"?ra.applyReviver(i,{"":o},"",o):o}}aa.NodeBase=jn});var ke=b(function(da){var ca=Xe(),ua=Se(),ce=A(),fa=Ze(),pa=U();class Kn extends fa.NodeBase{constructor(e){super(ce.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let s;if(t?.aliasResolveCache)s=t.aliasResolveCache;else if(s=[],ua.visit(e,{Node:(i,r)=>{if(ce.isAlias(r)||ce.hasAnchor(r))s.push(r)}}),t)t.aliasResolveCache=s;let n=void 0;for(let i of s){if(i===this)break;if(i.anchor===this.source)n=i}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:s,doc:n,maxAliasCount:i}=t,r=this.resolve(n,t);if(!r){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(a)}let o=s.get(r);if(!o)pa.toJS(r,null,t),o=s.get(r);if(o?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0){if(o.count+=1,o.aliasCount===0)o.aliasCount=et(n,r,s);if(o.count*o.aliasCount>i)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return o.res}toString(e,t,s){let n=`*${this.source}`;if(e){if(ca.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(i)}if(e.implicitKey)return`${n} `}return n}}function et(e,t,s){if(ce.isAlias(t)){let n=t.resolve(e),i=s&&n&&s.get(n);return i?i.count*i.aliasCount:0}else if(ce.isCollection(t)){let n=0;for(let i of t.items){let r=et(e,i,s);if(r>n)n=r}return n}else if(ce.isPair(t)){let n=et(e,t.key,s),i=et(e,t.value,s);return Math.max(n,i)}return 1}da.Alias=Kn});var P=b(function(wa){var ma=A(),ga=Ze(),ya=U(),ba=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class X extends ga.NodeBase{constructor(e){super(ma.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:ya.toJS(this.value,e,t)}toString(){return String(this.value)}}X.BLOCK_FOLDED="BLOCK_FOLDED";X.BLOCK_LITERAL="BLOCK_LITERAL";X.PLAIN="PLAIN";X.QUOTE_DOUBLE="QUOTE_DOUBLE";X.QUOTE_SINGLE="QUOTE_SINGLE";wa.Scalar=X;wa.isScalarValue=ba});var Ce=b(function(Oa){var ka=ke(),Z=A(),Fn=P(),Ca="tag:yaml.org,2002:";function Na(e,t,s){if(t){let n=s.filter((r)=>r.tag===t),i=n.find((r)=>!r.format)??n[0];if(!i)throw Error(`Tag ${t} not found`);return i}return s.find((n)=>n.identify?.(e)&&!n.format)}function Aa(e,t,s){if(Z.isDocument(e))e=e.contents;if(Z.isNode(e))return e;if(Z.isPair(e)){let u=s.schema[Z.MAP].createNode?.(s.schema,null,s);return u.items.push(e),u}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=s,l=void 0;if(n&&e&&typeof e==="object")if(l=a.get(e),l)return l.anchor??(l.anchor=i(e)),new ka.Alias(l.anchor);else l={anchor:null,node:null},a.set(e,l);if(t?.startsWith("!!"))t=Ca+t.slice(2);let c=Na(e,t,o.tags);if(!c){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let u=new Fn.Scalar(e);if(l)l.node=u;return u}c=e instanceof Map?o[Z.MAP]:(Symbol.iterator in Object(e))?o[Z.SEQ]:o[Z.MAP]}if(r)r(c),delete s.onTagObj;let f=c?.createNode?c.createNode(s.schema,e,s):typeof c?.nodeClass?.from==="function"?c.nodeClass.from(s.schema,e,s):new Fn.Scalar(e);if(t)f.tag=t;else if(!c.default)f.tag=c.tag;if(l)l.node=f;return f}Oa.createNode=Aa});var tt=b(function(qa){var La=Ce(),B=A(),Ea=Ze();function Vt(e,t,s){let n=s;for(let i=t.length-1;i>=0;--i){let r=t[i];if(typeof r==="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return La.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Un=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class Yn extends Ea.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;if(t.items=t.items.map((s)=>B.isNode(s)||B.isPair(s)?s.clone(e):s),this.range)t.range=this.range.slice();return t}addIn(e,t){if(Un(e))this.add(t);else{let[s,...n]=e,i=this.get(s,!0);if(B.isCollection(i))i.addIn(n,t);else if(i===void 0&&this.schema)this.set(s,Vt(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}deleteIn(e){let[t,...s]=e;if(s.length===0)return this.delete(t);let n=this.get(t,!0);if(B.isCollection(n))return n.deleteIn(s);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...n]=e,i=this.get(s,!0);if(n.length===0)return!t&&B.isScalar(i)?i.value:i;else return B.isCollection(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!B.isPair(t))return!1;let s=t.value;return s==null||e&&B.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(s.length===0)return this.has(t);let n=this.get(t,!0);return B.isCollection(n)?n.hasIn(s):!1}setIn(e,t){let[s,...n]=e;if(n.length===0)this.set(s,t);else{let i=this.get(s,!0);if(B.isCollection(i))i.setIn(n,t);else if(i===void 0&&this.schema)this.set(s,Vt(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}}qa.Collection=Yn;qa.collectionFromPath=Vt;qa.isEmptyPath=Un});var Ne=b(function(_a){var Ma=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ht(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var xa=(e,t,s)=>e.endsWith(`
|
|
4
4
|
`)?Ht(s,t):s.includes(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+Ht(s,t):(e.endsWith(" ")?"":" ")+s;
|
|
7
|
-
`){if(s==="block")
|
|
8
|
-
`&&m!=="\t"){let k=e[
|
|
9
|
-
`&&k!=="\t")
|
|
10
|
-
${t}${e.slice(0,C)}`;else{if(s==="quoted"&&
|
|
11
|
-
${t}${e.slice(k+1,C)}`}}return
|
|
12
|
-
`);n=t,i=t+1,r=e[i]}return n}
|
|
13
|
-
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Ae(e,t){let s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(it(e)?" ":""),o="",a=0;for(let l=0,c=s[l];c;c=s[++l]){if(c===" "&&s[l+1]==="\\"&&s[l+2]==="n")o+=s.slice(a,l)+"\\ ",l+=1,a=l,c="\\";if(c==="\\")switch(s[l+1]){case"u":{o+=s.slice(a,l);let
|
|
6
|
+
`+Ht(s,t):(e.endsWith(" ")?"":" ")+s;_a.indentComment=Ht;_a.lineComment=xa;_a.stringifyComment=Ma});var Hn=b(function(Ka){function ja(e,t,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;if(i<r)r=0;let l=Math.max(1+r,1+i-t.length);if(e.length<=l)return e;let c=[],f={},u=i-t.length;if(typeof n==="number")if(n>i-Math.max(2,r))c.push(0);else u=i-n;let p=void 0,m=void 0,y=!1,d=-1,h=-1,g=-1;if(s==="block"){if(d=Vn(e,d,t.length),d!==-1)u=d+l}for(let v;v=e[d+=1];){if(s==="quoted"&&v==="\\"){switch(h=d,e[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}g=d}if(v===`
|
|
7
|
+
`){if(s==="block")d=Vn(e,d,t.length);u=d+t.length+l,p=void 0}else{if(v===" "&&m&&m!==" "&&m!==`
|
|
8
|
+
`&&m!=="\t"){let k=e[d+1];if(k&&k!==" "&&k!==`
|
|
9
|
+
`&&k!=="\t")p=d}if(d>=u)if(p)c.push(p),u=p+l,p=void 0;else if(s==="quoted"){while(m===" "||m==="\t")m=v,v=e[d+=1],y=!0;let k=d>g+1?d-2:h-1;if(f[k])return e;c.push(k),f[k]=!0,u=k+l,p=void 0}else y=!0}m=v}if(y&&a)a();if(c.length===0)return e;if(o)o();let w=e.slice(0,c[0]);for(let v=0;v<c.length;++v){let k=c[v],C=c[v+1]||e.length;if(k===0)w=`
|
|
10
|
+
${t}${e.slice(0,C)}`;else{if(s==="quoted"&&f[k])w+=`${e[k]}\\`;w+=`
|
|
11
|
+
${t}${e.slice(k+1,C)}`}}return w}function Vn(e,t,s){let n=t,i=t+1,r=e[i];while(r===" "||r==="\t")if(t<i+s)r=e[++t];else{do r=e[++t];while(r&&r!==`
|
|
12
|
+
`);n=t,i=t+1,r=e[i]}return n}Ka.FOLD_BLOCK="block";Ka.FOLD_FLOW="flow";Ka.FOLD_QUOTED="quoted";Ka.foldFlowLines=ja});var Oe=b(function(za){var _=P(),Y=Hn(),nt=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),it=(e)=>/^(%|---|\.\.\.)/m.test(e);function Ha(e,t,s){if(!t||t<0)return!1;let n=t-s,i=e.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(e[r]===`
|
|
13
|
+
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Ae(e,t){let s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(it(e)?" ":""),o="",a=0;for(let l=0,c=s[l];c;c=s[++l]){if(c===" "&&s[l+1]==="\\"&&s[l+2]==="n")o+=s.slice(a,l)+"\\ ",l+=1,a=l,c="\\";if(c==="\\")switch(s[l+1]){case"u":{o+=s.slice(a,l);let f=s.substr(l+2,4);switch(f){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:if(f.substr(0,2)==="00")o+="\\x"+f.substr(2);else o+=s.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||s[l+2]==='"'||s.length<i)l+=1;else{o+=s.slice(a,l)+`
|
|
14
14
|
|
|
15
15
|
`;while(s[l+2]==="\\"&&s[l+3]==="n"&&s[l+4]!=='"')o+=`
|
|
16
16
|
`,l+=2;if(o+=r,s[l+2]===" ")o+="\\";l+=1,a=l+1}break;default:l+=1}}return o=a?o+s.slice(a):s,n?o:Y.foldFlowLines(o,r,Y.FOLD_QUOTED,nt(t,!1))}function Jt(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
17
17
|
`)||/[ \t]\n|\n[ \t]/.test(e))return Ae(e,t);let s=t.indent||(it(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
-
${s}`)+"'";return t.implicitKey?n:Y.foldFlowLines(n,s,Y.FOLD_FLOW,nt(t,!1))}function ue(e,t){let{singleQuote:s}=t.options,n;if(s===!1)n=Ae;else{let i=e.includes('"'),r=e.includes("'");if(i&&!r)n=Jt;else if(r&&!i)n=Ae;else n=s?Jt:Ae}return n(e,t)}var
|
|
18
|
+
${s}`)+"'";return t.implicitKey?n:Y.foldFlowLines(n,s,Y.FOLD_FLOW,nt(t,!1))}function ue(e,t){let{singleQuote:s}=t.options,n;if(s===!1)n=Ae;else{let i=e.includes('"'),r=e.includes("'");if(i&&!r)n=Jt;else if(r&&!i)n=Ae;else n=s?Jt:Ae}return n(e,t)}var Wt;try{Wt=new RegExp(`(^|(?<!
|
|
19
19
|
))
|
|
20
20
|
+(?!
|
|
21
|
-
|$)`,"g")}catch{
|
|
21
|
+
|$)`,"g")}catch{Wt=/\n+(?!\n|$)/g}function st({comment:e,type:t,value:s},n,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(s))return ue(s,n);let c=n.indent||(n.forceBlockIndent||it(s)?" ":""),f=o==="literal"?!0:o==="folded"||t===_.Scalar.BLOCK_FOLDED?!1:t===_.Scalar.BLOCK_LITERAL?!0:!Ha(s,l,c.length);if(!s)return f?`|
|
|
22
22
|
`:`>
|
|
23
|
-
`;let u,
|
|
24
|
-
`&&C!=="\t"&&C!==" ")break}let m=s.substring(
|
|
25
|
-
`);if(
|
|
26
|
-
`)m=m.slice(0,-1);m=m.replace(
|
|
27
|
-
`)
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),N=!1,O=nt(n,!0);if(o!=="folded"&&t!==_.Scalar.BLOCK_FOLDED)O.onOverflow=()=>{N=!0};let
|
|
29
|
-
${c}${
|
|
30
|
-
${c}${
|
|
31
|
-
`)||
|
|
32
|
-
`)?ue(r,t):st(e,t,s,n);if(!a&&!
|
|
23
|
+
`;let u,p;for(p=s.length;p>0;--p){let C=s[p-1];if(C!==`
|
|
24
|
+
`&&C!=="\t"&&C!==" ")break}let m=s.substring(p),y=m.indexOf(`
|
|
25
|
+
`);if(y===-1)u="-";else if(s===m||y!==m.length-1){if(u="+",r)r()}else u="";if(m){if(s=s.slice(0,-m.length),m[m.length-1]===`
|
|
26
|
+
`)m=m.slice(0,-1);m=m.replace(Wt,`$&${c}`)}let d=!1,h,g=-1;for(h=0;h<s.length;++h){let C=s[h];if(C===" ")d=!0;else if(C===`
|
|
27
|
+
`)g=h;else break}let w=s.substring(0,g<h?g+1:h);if(w)s=s.substring(w.length),w=w.replace(/\n+/g,`$&${c}`);let k=(d?c?"2":"1":"")+u;if(e){if(k+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!f){let C=s.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),N=!1,O=nt(n,!0);if(o!=="folded"&&t!==_.Scalar.BLOCK_FOLDED)O.onOverflow=()=>{N=!0};let S=Y.foldFlowLines(`${w}${C}${m}`,c,Y.FOLD_BLOCK,O);if(!N)return`>${k}
|
|
29
|
+
${c}${S}`}return s=s.replace(/\n+/g,`$&${c}`),`|${k}
|
|
30
|
+
${c}${w}${s}${m}`}function Ja(e,t,s,n){let{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:f}=t;if(a&&r.includes(`
|
|
31
|
+
`)||f&&/[[\]{},]/.test(r))return ue(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||f||!r.includes(`
|
|
32
|
+
`)?ue(r,t):st(e,t,s,n);if(!a&&!f&&i!==_.Scalar.PLAIN&&r.includes(`
|
|
33
33
|
`))return st(e,t,s,n);if(it(r)){if(l==="")return t.forceBlockIndent=!0,st(e,t,s,n);else if(a&&l===c)return ue(r,t)}let u=r.replace(/\n+/g,`$&
|
|
34
|
-
${l}`);if(o){let
|
|
35
|
-
${t.indent}${a}`}
|
|
36
|
-
${a}:`}else if(h=`${h}:`,
|
|
37
|
-
`:"",
|
|
38
|
-
${
|
|
34
|
+
${l}`);if(o){let p=(d)=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:m,tags:y}=t.doc.schema;if(y.some(p)||m?.some(p))return ue(r,t)}return a?u:Y.foldFlowLines(u,l,Y.FOLD_FLOW,nt(t,!1))}function Wa(e,t,s,n){let{implicitKey:i,inFlow:r}=t,o=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==_.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value))a=_.Scalar.QUOTE_DOUBLE}let l=(f)=>{switch(f){case _.Scalar.BLOCK_FOLDED:case _.Scalar.BLOCK_LITERAL:return i||r?ue(o.value,t):st(o,t,s,n);case _.Scalar.QUOTE_DOUBLE:return Ae(o.value,t);case _.Scalar.QUOTE_SINGLE:return Jt(o.value,t);case _.Scalar.PLAIN:return Ja(o,t,s,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:f,defaultStringType:u}=t.options,p=i&&f||u;if(c=l(p),c===null)throw Error(`Unsupported default string type ${p}`)}return c}za.stringifyString=Wa});var Pe=b(function(il){var Qa=Xe(),V=A(),Xa=Ne(),Za=Oe();function el(e,t){let s=Object.assign({blockQuote:!0,commentString:Xa.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),n;switch(s.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent==="number"?" ".repeat(s.indent):" ",inFlow:n,options:s}}function tl(e,t){if(t.tag){let i=e.filter((r)=>r.tag===t.tag);if(i.length>0)return i.find((r)=>r.format===t.format)??i[0]}let s=void 0,n;if(V.isScalar(t)){n=t.value;let i=e.filter((r)=>r.identify?.(n));if(i.length>1){let r=i.filter((o)=>o.test);if(r.length>0)i=r}s=i.find((r)=>r.format===t.format)??i.find((r)=>!r.format)}else n=t,s=e.find((i)=>i.nodeClass&&n instanceof i.nodeClass);if(!s){let i=n?.constructor?.name??(n===null?"null":typeof n);throw Error(`Tag not resolved for ${i} value`)}return s}function sl(e,t,{anchors:s,doc:n}){if(!n.directives)return"";let i=[],r=(V.isScalar(e)||V.isCollection(e))&&e.anchor;if(r&&Qa.anchorIsValid(r))s.add(r),i.push(`&${r}`);let o=e.tag??(t.default?null:t.tag);if(o)i.push(n.directives.tagString(o));return i.join(" ")}function nl(e,t,s,n){if(V.isPair(e))return e.toString(t,s,n);if(V.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw 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 i=void 0,r=V.isNode(e)?e:t.doc.createNode(e,{onTagObj:(l)=>i=l});i??(i=tl(t.doc.schema.tags,r));let o=sl(r,i,t);if(o.length>0)t.indentAtStart=(t.indentAtStart??0)+o.length+1;let a=typeof i.stringify==="function"?i.stringify(r,t,s,n):V.isScalar(r)?Za.stringifyString(r,t,s,n):r.toString(t,s,n);if(!o)return a;return V.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
+
${t.indent}${a}`}il.createStringifyContext=el;il.stringify=nl});var zn=b(function(ll){var K=A(),Jn=P(),Wn=Pe(),Le=Ne();function al({key:e,value:t},s,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:f,simpleKeys:u}}=s,p=K.isNode(e)&&e.comment||null;if(u){if(p)throw Error("With simple keys, key nodes cannot have comments");if(K.isCollection(e)||!K.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let m=!u&&(!e||p&&t==null&&!s.inFlow||K.isCollection(e)||(K.isScalar(e)?e.type===Jn.Scalar.BLOCK_FOLDED||e.type===Jn.Scalar.BLOCK_LITERAL:typeof e==="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!m&&(u||!r),indent:a+l});let y=!1,d=!1,h=Wn.stringify(e,s,()=>y=!0,()=>d=!0);if(!m&&!s.inFlow&&h.length>1024){if(u)throw Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(s.inFlow){if(r||t==null){if(y&&n)n();return h===""?"?":m?`? ${h}`:h}}else if(r&&!u||t==null&&m){if(h=`? ${h}`,p&&!y)h+=Le.lineComment(h,s.indent,c(p));else if(d&&i)i();return h}if(y)p=null;if(m){if(p)h+=Le.lineComment(h,s.indent,c(p));h=`? ${h}
|
|
36
|
+
${a}:`}else if(h=`${h}:`,p)h+=Le.lineComment(h,s.indent,c(p));let g,w,v;if(K.isNode(t))g=!!t.spaceBefore,w=t.commentBefore,v=t.comment;else if(g=!1,w=null,v=null,t&&typeof t==="object")t=o.createNode(t);if(s.implicitKey=!1,!m&&!p&&K.isScalar(t))s.indentAtStart=h.length+1;if(d=!1,!f&&l.length>=2&&!s.inFlow&&!m&&K.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)s.indent=s.indent.substring(2);let k=!1,C=Wn.stringify(t,s,()=>k=!0,()=>d=!0),N=" ";if(p||g||w){if(N=g?`
|
|
37
|
+
`:"",w){let O=c(w);N+=`
|
|
38
|
+
${Le.indentComment(O,s.indent)}`}if(C===""&&!s.inFlow){if(N===`
|
|
39
39
|
`&&v)N=`
|
|
40
40
|
|
|
41
41
|
`}else N+=`
|
|
42
|
-
${s.indent}`}else if(!m&&K.isCollection(t)){let O=C[0],
|
|
43
|
-
`),
|
|
42
|
+
${s.indent}`}else if(!m&&K.isCollection(t)){let O=C[0],S=C.indexOf(`
|
|
43
|
+
`),L=S!==-1,F=s.inFlow??t.flow??t.items.length===0;if(L||!F){let oe=!1;if(L&&(O==="&"||O==="!")){let E=C.indexOf(" ");if(O==="&"&&E!==-1&&E<S&&C[E+1]==="!")E=C.indexOf(" ",E+1);if(E===-1||S<E)oe=!0}if(!oe)N=`
|
|
44
44
|
${s.indent}`}}else if(C===""||C[0]===`
|
|
45
|
-
`)N="";if(h+=N+C,s.inFlow){if(k&&n)n()}else if(v&&!k)h+=
|
|
46
|
-
${l}${
|
|
45
|
+
`)N="";if(h+=N+C,s.inFlow){if(k&&n)n()}else if(v&&!k)h+=Le.lineComment(h,s.indent,c(v));else if(d&&i)i();return h}ll.stringifyPair=al});var zt=b(function(pl){var Gn=Ue("process");function ul(e,...t){if(e==="debug")console.log(...t)}function fl(e,t){if(e==="debug"||e==="warn")if(typeof Gn.emitWarning==="function")Gn.emitWarning(t);else console.warn(t)}pl.debug=ul;pl.warn=fl});var lt=b(function(gl){var at=A(),Qn=P(),rt="<<",ot={identify:(e)=>e===rt||typeof e==="symbol"&&e.description===rt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Qn.Scalar(Symbol(rt)),{addToJSMap:Xn}),stringify:()=>rt},ml=(e,t)=>(ot.identify(t)||at.isScalar(t)&&(!t.type||t.type===Qn.Scalar.PLAIN)&&ot.identify(t.value))&&e?.doc.schema.tags.some((s)=>s.tag===ot.tag&&s.default);function Xn(e,t,s){let n=Zn(e,s);if(at.isSeq(n))for(let i of n.items)Gt(e,t,i);else if(Array.isArray(n))for(let i of n)Gt(e,t,i);else Gt(e,t,n)}function Gt(e,t,s){let n=Zn(e,s);if(!at.isMap(n))throw Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,e,Map);for(let[r,o]of i)if(t instanceof Map){if(!t.has(r))t.set(r,o)}else if(t instanceof Set)t.add(r);else if(!Object.prototype.hasOwnProperty.call(t,r))Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Zn(e,t){return e&&at.isAlias(t)?t.resolve(e.doc,e):t}gl.addMergeToJSMap=Xn;gl.isMergeKey=ml;gl.merge=ot});var Xt=b(function(Nl){var Sl=zt(),ei=lt(),vl=Pe(),ti=A(),Qt=U();function kl(e,t,{key:s,value:n}){if(ti.isNode(s)&&s.addToJSMap)s.addToJSMap(e,t,n);else if(ei.isMergeKey(e,s))ei.addMergeToJSMap(e,t,n);else{let i=Qt.toJS(s,"",e);if(t instanceof Map)t.set(i,Qt.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let r=Cl(s,i,e),o=Qt.toJS(n,r,e);if(r in t)Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});else t[r]=o}}return t}function Cl(e,t,s){if(t===null)return"";if(typeof t!=="object")return String(t);if(ti.isNode(e)&&s?.doc){let n=vl.createStringifyContext(s.doc,{});n.anchors=new Set;for(let r of s.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!s.mapKeyWarned){let r=JSON.stringify(i);if(r.length>40)r=r.substring(0,36)+'..."';Sl.warn(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return i}return JSON.stringify(t)}Nl.addPairToJSMap=kl});var H=b(function(El){var si=Ce(),Ol=zn(),Pl=Xt(),ct=A();function Ll(e,t,s){let n=si.createNode(e,void 0,s),i=si.createNode(t,void 0,s);return new ut(n,i)}class ut{constructor(e,t=null){Object.defineProperty(this,ct.NODE_TYPE,{value:ct.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;if(ct.isNode(t))t=t.clone(e);if(ct.isNode(s))s=s.clone(e);return new ut(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return Pl.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?Ol.stringifyPair(this,e,t,s):JSON.stringify(this)}}El.Pair=ut;El.createPair=Ll});var Zt=b(function(xl){var ee=A(),ni=Pe(),ft=Ne();function $l(e,t,s){return(t.inFlow??e.flow?Ml:Tl)(e,t,s)}function Tl({comment:e,items:t},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=s,f=Object.assign({},s,{indent:r,type:null}),u=!1,p=[];for(let y=0;y<t.length;++y){let d=t[y],h=null;if(ee.isNode(d)){if(!u&&d.spaceBefore)p.push("");if(pt(s,p,d.commentBefore,u),d.comment)h=d.comment}else if(ee.isPair(d)){let w=ee.isNode(d.key)?d.key:null;if(w){if(!u&&w.spaceBefore)p.push("");pt(s,p,w.commentBefore,u)}}u=!1;let g=ni.stringify(d,f,()=>h=null,()=>u=!0);if(h)g+=ft.lineComment(g,r,c(h));if(u&&h)u=!1;p.push(n+g)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let y=1;y<p.length;++y){let d=p[y];m+=d?`
|
|
46
|
+
${l}${d}`:`
|
|
47
47
|
`}}if(e){if(m+=`
|
|
48
|
-
`+ft.indentComment(c(e),l),a)a()}else if(u&&o)o();return m}function
|
|
49
|
-
`)),
|
|
50
|
-
${r}${i}${
|
|
51
|
-
`;return`${
|
|
52
|
-
${i}${m}`}else return`${
|
|
53
|
-
`:" ")}return
|
|
48
|
+
`+ft.indentComment(c(e),l),a)a()}else if(u&&o)o();return m}function Ml({items:e},t,{flowChars:s,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;n+=r;let l=Object.assign({},t,{indent:n,inFlow:!0,type:null}),c=!1,f=0,u=[];for(let y=0;y<e.length;++y){let d=e[y],h=null;if(ee.isNode(d)){if(d.spaceBefore)u.push("");if(pt(t,u,d.commentBefore,!1),d.comment)h=d.comment}else if(ee.isPair(d)){let w=ee.isNode(d.key)?d.key:null;if(w){if(w.spaceBefore)u.push("");if(pt(t,u,w.commentBefore,!1),w.comment)c=!0}let v=ee.isNode(d.value)?d.value:null;if(v){if(v.comment)h=v.comment;if(v.commentBefore)c=!0}else if(d.value==null&&w?.comment)h=w.comment}if(h)c=!0;let g=ni.stringify(d,l,()=>h=null);if(c||(c=u.length>f||g.includes(`
|
|
49
|
+
`)),y<e.length-1)g+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)c||(c=u.reduce((w,v)=>w+v.length+2,2)+(g.length+2)>t.options.lineWidth);if(c)g+=","}if(h)g+=ft.lineComment(g,n,a(h));u.push(g),f=u.length}let{start:p,end:m}=s;if(u.length===0)return p+m;else{if(!c){let y=u.reduce((d,h)=>d+h.length+2,2);c=t.options.lineWidth>0&&y>t.options.lineWidth}if(c){let y=p;for(let d of u)y+=d?`
|
|
50
|
+
${r}${i}${d}`:`
|
|
51
|
+
`;return`${y}
|
|
52
|
+
${i}${m}`}else return`${p}${o}${u.join(" ")}${o}${m}`}}function pt({indent:e,options:{commentString:t}},s,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let r=ft.indentComment(t(n),e);s.push(r.trimStart())}}xl.stringifyCollection=$l});var W=b(function(Kl){var Dl=Zt(),Rl=Xt(),Bl=tt(),J=A(),dt=H(),jl=P();function Ee(e,t){let s=J.isScalar(t)?t.value:t;for(let n of e)if(J.isPair(n)){if(n.key===t||n.key===s)return n;if(J.isScalar(n.key)&&n.key.value===s)return n}return}class ii extends Bl.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(J.MAP,e);this.items=[]}static from(e,t,s){let{keepUndefined:n,replacer:i}=s,r=new this(e),o=(a,l)=>{if(typeof i==="function")l=i.call(t,a,l);else if(Array.isArray(i)&&!i.includes(a))return;if(l!==void 0||n)r.items.push(dt.createPair(a,l,s))};if(t instanceof Map)for(let[a,l]of t)o(a,l);else if(t&&typeof t==="object")for(let a of Object.keys(t))o(a,t[a]);if(typeof e.sortMapEntries==="function")r.items.sort(e.sortMapEntries);return r}add(e,t){let s;if(J.isPair(e))s=e;else if(!e||typeof e!=="object"||!("key"in e))s=new dt.Pair(e,e?.value);else s=new dt.Pair(e.key,e.value);let n=Ee(this.items,s.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${s.key} already set`);if(J.isScalar(n.value)&&jl.isScalarValue(s.value))n.value.value=s.value;else n.value=s.value}else if(i){let r=this.items.findIndex((o)=>i(s,o)<0);if(r===-1)this.items.push(s);else this.items.splice(r,0,s)}else this.items.push(s)}delete(e){let t=Ee(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=Ee(this.items,e)?.value;return(!t&&J.isScalar(n)?n.value:n)??void 0}has(e){return!!Ee(this.items,e)}set(e,t){this.add(new dt.Pair(e,t),!0)}toJSON(e,t,s){let n=s?new s:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(n);for(let i of this.items)Rl.addPairToJSMap(t,n,i);return n}toString(e,t,s){if(!e)return JSON.stringify(this);for(let n of this.items)if(!J.isPair(n))throw Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return Dl.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}Kl.YAMLMap=ii;Kl.findPair=Ee});var fe=b(function(Hl){var Yl=A(),ri=W(),Vl={collection:"map",default:!0,nodeClass:ri.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!Yl.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,s)=>ri.YAMLMap.from(e,t,s)};Hl.map=Vl});var z=b(function(Zl){var Wl=Ce(),zl=Zt(),Gl=tt(),mt=A(),Ql=P(),Xl=U();class oi extends Gl.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(mt.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=ht(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let s=ht(e);if(typeof s!=="number")return;let n=this.items[s];return!t&&mt.isScalar(n)?n.value:n}has(e){let t=ht(e);return typeof t==="number"&&t<this.items.length}set(e,t){let s=ht(e);if(typeof s!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[s];if(mt.isScalar(n)&&Ql.isScalarValue(t))n.value=t;else this.items[s]=t}toJSON(e,t){let s=[];if(t?.onCreate)t.onCreate(s);let n=0;for(let i of this.items)s.push(Xl.toJS(i,String(n++),t));return s}toString(e,t,s){if(!e)return JSON.stringify(this);return zl.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t})}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let r=0;for(let o of t){if(typeof n==="function"){let a=t instanceof Set?o:String(r++);o=n.call(t,a,o)}i.items.push(Wl.createNode(o,void 0,s))}}return i}}function ht(e){let t=mt.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}Zl.YAMLSeq=oi});var pe=b(function(nc){var tc=A(),ai=z(),sc={collection:"seq",default:!0,nodeClass:ai.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!tc.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,s)=>ai.YAMLSeq.from(e,t,s)};nc.seq=sc});var qe=b(function(ac){var rc=Oe(),oc={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,s,n){return t=Object.assign({actualString:!0},t),rc.stringifyString(e,t,s,n)}};ac.string=oc});var gt=b(function(cc){var li=P(),ci={identify:(e)=>e==null,createNode:()=>new li.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new li.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&ci.test.test(e)?e:t.options.nullStr};cc.nullTag=ci});var es=b(function(pc){var fc=P(),ui={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new fc.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&ui.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?s.options.trueStr:s.options.falseStr}};pc.boolTag=ui});var de=b(function(mc){function hc({format:e,minFractionDigits:t,tag:s,value:n}){if(typeof n==="bigint")return String(n);let i=typeof n==="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");if(o<0)o=r.length,r+=".";let a=t-(r.length-o-1);while(a-- >0)r+="0"}return r}mc.stringifyNumber=hc});var ss=b(function(vc){var yc=P(),ts=de(),bc={identify:(e)=>typeof e==="number",default:!0,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:ts.stringifyNumber},wc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():ts.stringifyNumber(e)}},Sc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new yc.Scalar(parseFloat(e)),s=e.indexOf(".");if(s!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-s-1;return t},stringify:ts.stringifyNumber};vc.float=Sc;vc.floatExp=wc;vc.floatNaN=bc});var is=b(function(Lc){var fi=de(),yt=(e)=>typeof e==="bigint"||Number.isInteger(e),ns=(e,t,s,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),s);function pi(e,t,s){let{value:n}=e;if(yt(n)&&n>=0)return s+n.toString(t);return fi.stringifyNumber(e)}var Ac={identify:(e)=>yt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>ns(e,2,8,s),stringify:(e)=>pi(e,8,"0o")},Oc={identify:yt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>ns(e,0,10,s),stringify:fi.stringifyNumber},Pc={identify:(e)=>yt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>ns(e,2,16,s),stringify:(e)=>pi(e,16,"0x")};Lc.int=Oc;Lc.intHex=Pc;Lc.intOct=Ac});var di=b(function(Rc){var $c=fe(),Tc=gt(),Mc=pe(),xc=qe(),_c=es(),rs=ss(),os=is(),Dc=[$c.map,Mc.seq,xc.string,Tc.nullTag,_c.boolTag,os.intOct,os.int,os.intHex,rs.floatNaN,rs.floatExp,rs.float];Rc.schema=Dc});var mi=b(function(Hc){var jc=P(),Kc=fe(),Fc=pe();function hi(e){return typeof e==="bigint"||Number.isInteger(e)}var bt=({value:e})=>JSON.stringify(e),Uc=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:bt},{identify:(e)=>e==null,createNode:()=>new jc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:bt},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:bt},{identify:hi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>hi(e)?e.toString():JSON.stringify(e)},{identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(e)=>parseFloat(e),stringify:bt}],Yc={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Vc=[Kc.map,Fc.seq].concat(Uc,Yc);Hc.schema=Vc});var ls=b(function(Gc){var Ie=Ue("buffer"),as=P(),Wc=Oe(),zc={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Ie.Buffer==="function")return Ie.Buffer.from(e,"base64");else if(typeof atob==="function"){let s=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(s.length);for(let i=0;i<s.length;++i)n[i]=s.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},n,i,r){if(!s)return"";let o=s,a;if(typeof Ie.Buffer==="function")a=o instanceof Ie.Buffer?o.toString("base64"):Ie.Buffer.from(o.buffer).toString("base64");else if(typeof btoa==="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=as.Scalar.BLOCK_LITERAL),t!==as.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),f=Array(c);for(let u=0,p=0;u<c;++u,p+=l)f[u]=a.substr(p,l);a=f.join(t===as.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return Wc.stringifyString({comment:e,type:t,value:a},n,i,r)}};Gc.binary=zc});var St=b(function(tu){var wt=A(),cs=H(),Xc=P(),Zc=z();function gi(e,t){if(wt.isSeq(e))for(let s=0;s<e.items.length;++s){let n=e.items[s];if(wt.isPair(n))continue;else if(wt.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let i=n.items[0]||new cs.Pair(new Xc.Scalar(null));if(n.commentBefore)i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
54
54
|
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
55
|
-
${r.comment}`:n.comment}n=i}e.items[s]=wt.isPair(n)?n:new cs.Pair(n)}else t("Expected a sequence for this tag");return e}function gi(e,t,s){let{replacer:n}=s,i=new Xc.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,String(r++),o);let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(cs.createPair(a,l,s))}return i}var Zc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:mi,createNode:gi};eu.createPairs=gi;eu.pairs=Zc;eu.resolvePairs=mi});var fs=y(function(ou){var yi=A(),us=U(),Te=z(),iu=W(),bi=St();class te extends iu.YAMLSeq{constructor(){super();this.add=Te.YAMLMap.prototype.add.bind(this),this.delete=Te.YAMLMap.prototype.delete.bind(this),this.get=Te.YAMLMap.prototype.get.bind(this),this.has=Te.YAMLMap.prototype.has.bind(this),this.set=Te.YAMLMap.prototype.set.bind(this),this.tag=te.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;if(t?.onCreate)t.onCreate(s);for(let n of this.items){let i,r;if(yi.isPair(n))i=us.toJS(n.key,"",t),r=us.toJS(n.value,i,t);else i=us.toJS(n,"",t);if(s.has(i))throw Error("Ordered maps must not include duplicate keys");s.set(i,r)}return s}static from(e,t,s){let n=bi.createPairs(e,t,s),i=new this;return i.items=n.items,i}}te.tag="tag:yaml.org,2002:omap";var ru={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=bi.resolvePairs(e,t),n=[];for(let{key:i}of s.items)if(yi.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new te,s)},createNode:(e,t,s)=>te.from(e,t,s)};ou.YAMLOMap=te;ou.omap=ru});var Ci=y(function(cu){var wi=L();function Si({value:e,source:t},s){if(t&&(e?vi:ki).test.test(t))return t;return e?s.options.trueStr:s.options.falseStr}var vi={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new wi.Scalar(!0),stringify:Si},ki={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new wi.Scalar(!1),stringify:Si};cu.falseTag=ki;cu.trueTag=vi});var Ni=y(function(gu){var du=L(),ds=pe(),pu={identify:(e)=>typeof e==="number",default:!0,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:ds.stringifyNumber},hu={identify:(e)=>typeof e==="number",default:!0,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){let t=Number(e.value);return isFinite(t)?t.toExponential():ds.stringifyNumber(e)}},mu={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new du.Scalar(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){let n=e.substring(s+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:ds.stringifyNumber};gu.float=mu;gu.floatExp=hu;gu.floatNaN=pu});var Oi=y(function(Nu){var Ai=pe(),$e=(e)=>typeof e==="bigint"||Number.isInteger(e);function vt(e,t,s,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return i==="-"?BigInt(-1)*o:o}let r=parseInt(e,s);return i==="-"?-1*r:r}function ps(e,t,s){let{value:n}=e;if($e(n)){let i=n.toString(t);return n<0?"-"+s+i.substr(1):s+i}return Ai.stringifyNumber(e)}var Su={identify:$e,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>vt(e,2,2,s),stringify:(e)=>ps(e,2,"0b")},vu={identify:$e,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>vt(e,1,8,s),stringify:(e)=>ps(e,8,"0")},ku={identify:$e,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>vt(e,0,10,s),stringify:Ai.stringifyNumber},Cu={identify:$e,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>vt(e,2,16,s),stringify:(e)=>ps(e,16,"0x")};Nu.int=ku;Nu.intBin=Su;Nu.intHex=Cu;Nu.intOct=vu});var hs=y(function(qu){var Nt=A(),kt=H(),Ct=z();class se extends Ct.YAMLMap{constructor(e){super(e);this.tag=se.tag}add(e){let t;if(Nt.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new kt.Pair(e.key,null);else t=new kt.Pair(e,null);if(!Ct.findPair(this.items,t.key))this.items.push(t)}get(e,t){let s=Ct.findPair(this.items,e);return!t&&Nt.isPair(s)?Nt.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=Ct.findPair(this.items,e);if(s&&!t)this.items.splice(this.items.indexOf(s),1);else if(!s&&t)this.items.push(new kt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);else throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let r of t){if(typeof n==="function")r=n.call(t,r,r);i.items.push(kt.createPair(r,null,s))}return i}}se.tag="tag:yaml.org,2002:set";var Eu={collection:"map",identify:(e)=>e instanceof Set,nodeClass:se,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>se.from(e,t,s),resolve(e,t){if(Nt.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new se,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};qu.YAMLSet=se;qu.set=Eu});var gs=y(function(_u){var $u=pe();function ms(e,t){let s=e[0],n=s==="-"||s==="+"?e.substring(1):e,i=(o)=>t?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function Li(e){let{value:t}=e,s=(o)=>o;if(typeof t==="bigint")s=(o)=>BigInt(o);else if(isNaN(t)||!isFinite(t))return $u.stringifyNumber(e);let n="";if(t<0)n="-",t*=s(-1);let i=s(60),r=[t%i];if(t<60)r.unshift(0);else if(t=(t-r[0])/i,r.unshift(t%i),t>=60)t=(t-r[0])/i,r.unshift(t);return n+r.map((o)=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Mu={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:s})=>ms(e,s),stringify:Li},xu={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>ms(e,!1),stringify:Li},Pi={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(Pi.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(s,n-1,i,r||0,o||0,a||0,l),d=t[8];if(d&&d!=="Z"){let u=ms(d,!1);if(Math.abs(u)<30)u*=60;c-=60000*u}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};_u.floatTime=xu;_u.intTime=Mu;_u.timestamp=Pi});var qi=y(function(Gu){var ju=fe(),Ku=gt(),Fu=de(),Uu=qe(),Yu=ls(),Ei=Ci(),ys=Ni(),At=Oi(),Vu=lt(),Hu=fs(),Ju=St(),zu=hs(),bs=gs(),Wu=[ju.map,Fu.seq,Uu.string,Ku.nullTag,Ei.trueTag,Ei.falseTag,At.intBin,At.intOct,At.int,At.intHex,ys.floatNaN,ys.floatExp,ys.float,Yu.binary,Vu.merge,Hu.omap,Ju.pairs,zu.set,bs.intTime,bs.floatTime,bs.timestamp];Gu.schema=Wu});var ji=y(function(of){var Mi=fe(),Xu=gt(),xi=de(),Zu=qe(),ef=es(),ws=ss(),Ss=is(),tf=di(),sf=hi(),_i=ls(),Me=lt(),Di=fs(),Ri=St(),Ii=qi(),Bi=hs(),Ot=gs(),Ti=new Map([["core",tf.schema],["failsafe",[Mi.map,xi.seq,Zu.string]],["json",sf.schema],["yaml11",Ii.schema],["yaml-1.1",Ii.schema]]),$i={binary:_i.binary,bool:ef.boolTag,float:ws.float,floatExp:ws.floatExp,floatNaN:ws.floatNaN,floatTime:Ot.floatTime,int:Ss.int,intHex:Ss.intHex,intOct:Ss.intOct,intTime:Ot.intTime,map:Mi.map,merge:Me.merge,null:Xu.nullTag,omap:Di.omap,pairs:Ri.pairs,seq:xi.seq,set:Bi.set,timestamp:Ot.timestamp},nf={"tag:yaml.org,2002:binary":_i.binary,"tag:yaml.org,2002:merge":Me.merge,"tag:yaml.org,2002:omap":Di.omap,"tag:yaml.org,2002:pairs":Ri.pairs,"tag:yaml.org,2002:set":Bi.set,"tag:yaml.org,2002:timestamp":Ot.timestamp};function rf(e,t,s){let n=Ti.get(t);if(n&&!e)return s&&!n.includes(Me.merge)?n.concat(Me.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let r=Array.from(Ti.keys()).filter((o)=>o!=="yaml11").map((o)=>JSON.stringify(o)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(let r of e)i=i.concat(r);else if(typeof e==="function")i=e(i.slice());if(s)i=i.concat(Me.merge);return i.reduce((r,o)=>{let a=typeof o==="string"?$i[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys($i).map((d)=>JSON.stringify(d)).join(", ");throw Error(`Unknown custom tag ${l}; use one of ${c}`)}if(!r.includes(a))r.push(a);return r},[])}of.coreKnownTags=nf;of.getTags=rf});var Cs=y(function(pf){var vs=A(),cf=fe(),uf=de(),ff=qe(),Lt=ji(),df=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class ks{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:i,sortMapEntries:r,toStringDefaults:o}){this.compat=Array.isArray(e)?Lt.getTags(e,"compat"):e?Lt.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?Lt.coreKnownTags:{},this.tags=Lt.getTags(t,this.name,s),this.toStringOptions=o??null,Object.defineProperty(this,vs.MAP,{value:cf.map}),Object.defineProperty(this,vs.SCALAR,{value:ff.string}),Object.defineProperty(this,vs.SEQ,{value:uf.seq}),this.sortMapEntries=typeof r==="function"?r:r===!0?df:null}clone(){let e=Object.create(ks.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}pf.Schema=ks});var Ki=y(function(yf){var mf=A(),Ns=Le(),xe=Ne();function gf(e,t){let s=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);if(l)s.push(l),n=!0;else if(e.directives.docStart)n=!0}if(n)s.push("---");let i=Ns.createStringifyContext(e,t),{commentString:r}=i.options;if(e.commentBefore){if(s.length!==1)s.unshift("");let l=r(e.commentBefore);s.unshift(xe.indentComment(l,""))}let o=!1,a=null;if(e.contents){if(mf.isNode(e.contents)){if(e.contents.spaceBefore&&n)s.push("");if(e.contents.commentBefore){let d=r(e.contents.commentBefore);s.push(xe.indentComment(d,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>o=!0,c=Ns.stringify(e.contents,i,()=>a=null,l);if(a)c+=xe.lineComment(c,"",r(a));if((c[0]==="|"||c[0]===">")&&s[s.length-1]==="---")s[s.length-1]=`--- ${c}`;else s.push(c)}else s.push(Ns.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let l=r(e.comment);if(l.includes(`
|
|
55
|
+
${r.comment}`:n.comment}n=i}e.items[s]=wt.isPair(n)?n:new cs.Pair(n)}else t("Expected a sequence for this tag");return e}function yi(e,t,s){let{replacer:n}=s,i=new Zc.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,String(r++),o);let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(cs.createPair(a,l,s))}return i}var eu={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:gi,createNode:yi};tu.createPairs=yi;tu.pairs=eu;tu.resolvePairs=gi});var fs=b(function(au){var bi=A(),us=U(),$e=W(),ru=z(),wi=St();class te extends ru.YAMLSeq{constructor(){super();this.add=$e.YAMLMap.prototype.add.bind(this),this.delete=$e.YAMLMap.prototype.delete.bind(this),this.get=$e.YAMLMap.prototype.get.bind(this),this.has=$e.YAMLMap.prototype.has.bind(this),this.set=$e.YAMLMap.prototype.set.bind(this),this.tag=te.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;if(t?.onCreate)t.onCreate(s);for(let n of this.items){let i,r;if(bi.isPair(n))i=us.toJS(n.key,"",t),r=us.toJS(n.value,i,t);else i=us.toJS(n,"",t);if(s.has(i))throw Error("Ordered maps must not include duplicate keys");s.set(i,r)}return s}static from(e,t,s){let n=wi.createPairs(e,t,s),i=new this;return i.items=n.items,i}}te.tag="tag:yaml.org,2002:omap";var ou={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=wi.resolvePairs(e,t),n=[];for(let{key:i}of s.items)if(bi.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new te,s)},createNode:(e,t,s)=>te.from(e,t,s)};au.YAMLOMap=te;au.omap=ou});var Ni=b(function(uu){var Si=P();function vi({value:e,source:t},s){if(t&&(e?ki:Ci).test.test(t))return t;return e?s.options.trueStr:s.options.falseStr}var ki={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Si.Scalar(!0),stringify:vi},Ci={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Si.Scalar(!1),stringify:vi};uu.falseTag=Ci;uu.trueTag=ki});var Ai=b(function(yu){var du=P(),ps=de(),hu={identify:(e)=>typeof e==="number",default:!0,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:ps.stringifyNumber},mu={identify:(e)=>typeof e==="number",default:!0,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){let t=Number(e.value);return isFinite(t)?t.toExponential():ps.stringifyNumber(e)}},gu={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new du.Scalar(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){let n=e.substring(s+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:ps.stringifyNumber};yu.float=gu;yu.floatExp=mu;yu.floatNaN=hu});var Pi=b(function(Au){var Oi=de(),Te=(e)=>typeof e==="bigint"||Number.isInteger(e);function vt(e,t,s,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return i==="-"?BigInt(-1)*o:o}let r=parseInt(e,s);return i==="-"?-1*r:r}function ds(e,t,s){let{value:n}=e;if(Te(n)){let i=n.toString(t);return n<0?"-"+s+i.substr(1):s+i}return Oi.stringifyNumber(e)}var vu={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>vt(e,2,2,s),stringify:(e)=>ds(e,2,"0b")},ku={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>vt(e,1,8,s),stringify:(e)=>ds(e,8,"0")},Cu={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>vt(e,0,10,s),stringify:Oi.stringifyNumber},Nu={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>vt(e,2,16,s),stringify:(e)=>ds(e,16,"0x")};Au.int=Cu;Au.intBin=vu;Au.intHex=Nu;Au.intOct=ku});var hs=b(function(Iu){var Nt=A(),kt=H(),Ct=W();class se extends Ct.YAMLMap{constructor(e){super(e);this.tag=se.tag}add(e){let t;if(Nt.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new kt.Pair(e.key,null);else t=new kt.Pair(e,null);if(!Ct.findPair(this.items,t.key))this.items.push(t)}get(e,t){let s=Ct.findPair(this.items,e);return!t&&Nt.isPair(s)?Nt.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=Ct.findPair(this.items,e);if(s&&!t)this.items.splice(this.items.indexOf(s),1);else if(!s&&t)this.items.push(new kt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);else throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let r of t){if(typeof n==="function")r=n.call(t,r,r);i.items.push(kt.createPair(r,null,s))}return i}}se.tag="tag:yaml.org,2002:set";var qu={collection:"map",identify:(e)=>e instanceof Set,nodeClass:se,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>se.from(e,t,s),resolve(e,t){if(Nt.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new se,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};Iu.YAMLSet=se;Iu.set=qu});var gs=b(function(Du){var Mu=de();function ms(e,t){let s=e[0],n=s==="-"||s==="+"?e.substring(1):e,i=(o)=>t?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function Li(e){let{value:t}=e,s=(o)=>o;if(typeof t==="bigint")s=(o)=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Mu.stringifyNumber(e);let n="";if(t<0)n="-",t*=s(-1);let i=s(60),r=[t%i];if(t<60)r.unshift(0);else if(t=(t-r[0])/i,r.unshift(t%i),t>=60)t=(t-r[0])/i,r.unshift(t);return n+r.map((o)=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var xu={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:s})=>ms(e,s),stringify:Li},_u={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>ms(e,!1),stringify:Li},Ei={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(Ei.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(s,n-1,i,r||0,o||0,a||0,l),f=t[8];if(f&&f!=="Z"){let u=ms(f,!1);if(Math.abs(u)<30)u*=60;c-=60000*u}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Du.floatTime=_u;Du.intTime=xu;Du.timestamp=Ei});var Ii=b(function(Qu){var Ku=fe(),Fu=gt(),Uu=pe(),Yu=qe(),Vu=ls(),qi=Ni(),ys=Ai(),At=Pi(),Hu=lt(),Ju=fs(),Wu=St(),zu=hs(),bs=gs(),Gu=[Ku.map,Uu.seq,Yu.string,Fu.nullTag,qi.trueTag,qi.falseTag,At.intBin,At.intOct,At.int,At.intHex,ys.floatNaN,ys.floatExp,ys.float,Vu.binary,Hu.merge,Ju.omap,Wu.pairs,zu.set,bs.intTime,bs.floatTime,bs.timestamp];Qu.schema=Gu});var Ki=b(function(af){var xi=fe(),Zu=gt(),_i=pe(),ef=qe(),tf=es(),ws=ss(),Ss=is(),sf=di(),nf=mi(),Di=ls(),Me=lt(),Ri=fs(),Bi=St(),$i=Ii(),ji=hs(),Ot=gs(),Ti=new Map([["core",sf.schema],["failsafe",[xi.map,_i.seq,ef.string]],["json",nf.schema],["yaml11",$i.schema],["yaml-1.1",$i.schema]]),Mi={binary:Di.binary,bool:tf.boolTag,float:ws.float,floatExp:ws.floatExp,floatNaN:ws.floatNaN,floatTime:Ot.floatTime,int:Ss.int,intHex:Ss.intHex,intOct:Ss.intOct,intTime:Ot.intTime,map:xi.map,merge:Me.merge,null:Zu.nullTag,omap:Ri.omap,pairs:Bi.pairs,seq:_i.seq,set:ji.set,timestamp:Ot.timestamp},rf={"tag:yaml.org,2002:binary":Di.binary,"tag:yaml.org,2002:merge":Me.merge,"tag:yaml.org,2002:omap":Ri.omap,"tag:yaml.org,2002:pairs":Bi.pairs,"tag:yaml.org,2002:set":ji.set,"tag:yaml.org,2002:timestamp":Ot.timestamp};function of(e,t,s){let n=Ti.get(t);if(n&&!e)return s&&!n.includes(Me.merge)?n.concat(Me.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let r=Array.from(Ti.keys()).filter((o)=>o!=="yaml11").map((o)=>JSON.stringify(o)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(let r of e)i=i.concat(r);else if(typeof e==="function")i=e(i.slice());if(s)i=i.concat(Me.merge);return i.reduce((r,o)=>{let a=typeof o==="string"?Mi[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Mi).map((f)=>JSON.stringify(f)).join(", ");throw Error(`Unknown custom tag ${l}; use one of ${c}`)}if(!r.includes(a))r.push(a);return r},[])}af.coreKnownTags=rf;af.getTags=of});var Cs=b(function(hf){var vs=A(),uf=fe(),ff=pe(),pf=qe(),Pt=Ki(),df=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class ks{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:i,sortMapEntries:r,toStringDefaults:o}){this.compat=Array.isArray(e)?Pt.getTags(e,"compat"):e?Pt.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?Pt.coreKnownTags:{},this.tags=Pt.getTags(t,this.name,s),this.toStringOptions=o??null,Object.defineProperty(this,vs.MAP,{value:uf.map}),Object.defineProperty(this,vs.SCALAR,{value:pf.string}),Object.defineProperty(this,vs.SEQ,{value:ff.seq}),this.sortMapEntries=typeof r==="function"?r:r===!0?df:null}clone(){let e=Object.create(ks.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}hf.Schema=ks});var Fi=b(function(bf){var gf=A(),Ns=Pe(),xe=Ne();function yf(e,t){let s=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);if(l)s.push(l),n=!0;else if(e.directives.docStart)n=!0}if(n)s.push("---");let i=Ns.createStringifyContext(e,t),{commentString:r}=i.options;if(e.commentBefore){if(s.length!==1)s.unshift("");let l=r(e.commentBefore);s.unshift(xe.indentComment(l,""))}let o=!1,a=null;if(e.contents){if(gf.isNode(e.contents)){if(e.contents.spaceBefore&&n)s.push("");if(e.contents.commentBefore){let f=r(e.contents.commentBefore);s.push(xe.indentComment(f,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>o=!0,c=Ns.stringify(e.contents,i,()=>a=null,l);if(a)c+=xe.lineComment(c,"",r(a));if((c[0]==="|"||c[0]===">")&&s[s.length-1]==="---")s[s.length-1]=`--- ${c}`;else s.push(c)}else s.push(Ns.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let l=r(e.comment);if(l.includes(`
|
|
56
56
|
`))s.push("..."),s.push(xe.indentComment(l,""));else s.push(`... ${l}`)}else s.push("...");else{let l=e.comment;if(l&&o)l=l.replace(/^\n+/,"");if(l){if((!o||a)&&s[s.length-1]!=="")s.push("");s.push(xe.indentComment(r(l),""))}}return s.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}
|
|
58
|
+
`}bf.stringifyDocument=yf});var _e=b(function(Pf){var Sf=ke(),he=tt(),x=A(),vf=H(),kf=U(),Cf=Cs(),Nf=Fi(),As=Xe(),Af=Yt(),Of=Ce(),Os=Ut();class Ps{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,x.NODE_TYPE,{value:x.DOC});let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(s===void 0&&t)s=t,t=void 0;let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:r}=i;if(s?._directives){if(this.directives=s._directives.atDocument(),this.directives.yaml.explicit)r=this.directives.yaml.version}else this.directives=new Os.Directives({version:r});this.setSchema(r,s),this.contents=e===void 0?null:this.createNode(e,n,s)}clone(){let e=Object.create(Ps.prototype,{[x.NODE_TYPE]:{value:x.DOC}});if(e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives)e.directives=this.directives.clone();if(e.schema=this.schema.clone(),e.contents=x.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(me(this.contents))this.contents.add(e)}addIn(e,t){if(me(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=As.anchorNames(this);e.anchor=!t||s.has(t)?As.findNewAnchor(t||"a",s):t}return new Sf.Alias(e.anchor)}createNode(e,t,s){let n=void 0;if(typeof t==="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let d=(g)=>typeof g==="number"||g instanceof String||g instanceof Number,h=t.filter(d).map(String);if(h.length>0)t=t.concat(h);n=t}else if(s===void 0&&t)s=t,t=void 0;let{aliasDuplicateObjects:i,anchorPrefix:r,flow:o,keepUndefined:a,onTagObj:l,tag:c}=s??{},{onAnchor:f,setAnchors:u,sourceObjects:p}=As.createNodeAnchors(this,r||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:p},y=Of.createNode(e,c,m);if(o&&x.isCollection(y))y.flow=!0;return u(),y}createPair(e,t,s={}){let n=this.createNode(e,null,s),i=this.createNode(t,null,s);return new vf.Pair(n,i)}delete(e){return me(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(he.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return me(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return x.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(he.isEmptyPath(e))return!t&&x.isScalar(this.contents)?this.contents.value:this.contents;return x.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return x.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(he.isEmptyPath(e))return this.contents!==void 0;return x.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=he.collectionFromPath(this.schema,[e],t);else if(me(this.contents))this.contents.set(e,t)}setIn(e,t){if(he.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=he.collectionFromPath(this.schema,Array.from(e),t);else if(me(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let s;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Os.Directives({version:"1.1"});s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new Os.Directives({version:e});s={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;s=null;break;default:{let n=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Cf.Schema(Object.assign(s,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n==="number"?n:100},a=kf.toJS(this.contents,t??"",o);if(typeof i==="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r==="function"?Af.applyReviver(r,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Nf.stringifyDocument(this,e)}}function me(e){if(x.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}Pf.Document=Ps});var De=b(function(qf){class Lt extends Error{constructor(e,t,s,n){super();this.name=e,this.code=s,this.message=n,this.pos=t}}class Ui extends Lt{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class Yi extends Lt{constructor(e,t,s){super("YAMLWarning",e,t,s)}}var Ef=(e,t)=>(s)=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map((a)=>t.linePos(a));let{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80)o=o.substring(0,79)+"\u2026";if(n>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);if(a.length>80)a=a.substring(0,79)+`\u2026
|
|
59
59
|
`;o=a+o}if(/[^ ]/.test(o)){let a=1,l=s.linePos[1];if(l?.line===n&&l.col>i)a=Math.max(1,Math.min(l.col-i,80-r));let c=" ".repeat(r)+"^".repeat(a);s.message+=`:
|
|
60
60
|
|
|
61
61
|
${o}
|
|
62
62
|
${c}
|
|
63
|
-
`}};
|
|
64
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let s of t.start)if(s.type==="newline")return!0;if(t.sep){for(let s of t.sep)if(s.type==="newline")return!0}if(
|
|
65
|
-
`+
|
|
66
|
-
`+v.comment;else
|
|
67
|
-
`+N.comment;else c.comment=N.comment;u=N.end;continue}if(!o&&s.options.strict&&
|
|
68
|
-
`+O;else
|
|
69
|
-
`+
|
|
70
|
-
`+h.comment;else c.comment=h.comment;c.range=[n.offset,
|
|
71
|
-
`.repeat(Math.max(1,o.length-1)):"",h=n+i.length;if(t.source)h+=t.source.length;return{value:
|
|
72
|
-
`;for(let
|
|
73
|
-
`;else if(h.length>l||
|
|
74
|
-
`;else if(!m&&
|
|
75
|
-
`)
|
|
63
|
+
`}};qf.YAMLError=Lt;qf.YAMLParseError=Ui;qf.YAMLWarning=Yi;qf.prettifyError=Ef});var Re=b(function(_f){function xf(e,{flow:t,indicator:s,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,f=a,u="",p="",m=!1,y=!1,d=null,h=null,g=null,w=null,v=null,k=null,C=null;for(let S of e){if(y){if(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma")r(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");y=!1}if(d){if(c&&S.type!=="comment"&&S.type!=="newline")r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation");d=null}switch(S.type){case"space":if(!t&&(s!=="doc-start"||n?.type!=="flow-collection")&&S.source.includes("\t"))d=S;f=!0;break;case"comment":{if(!f)r(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=S.source.substring(1)||" ";if(!u)u=L;else u+=p+L;p="",c=!1;break}case"newline":if(c){if(u)u+=S.source;else if(!k||s!=="seq-item-ind")l=!0}else p+=S.source;if(c=!0,m=!0,h||g)w=S;f=!0;break;case"anchor":if(h)r(S,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(S.source.endsWith(":"))r(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);h=S,C??(C=S.offset),c=!1,f=!1,y=!0;break;case"tag":{if(g)r(S,"MULTIPLE_TAGS","A node can have at most one tag");g=S,C??(C=S.offset),c=!1,f=!1,y=!0;break}case s:if(h||g)r(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`);if(k)r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t??"collection"}`);k=S,c=s==="seq-item-ind"||s==="explicit-key-ind",f=!1;break;case"comma":if(t){if(v)r(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);v=S,c=!1,f=!1;break}default:r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),c=!1,f=!1}}let N=e[e.length-1],O=N?N.offset+N.source.length:i;if(y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!==""))r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(d&&(c&&d.indent<=o||n?.type==="block-map"||n?.type==="block-seq"))r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:v,found:k,spaceBefore:l,comment:u,hasNewline:m,anchor:h,tag:g,newlineAfterProp:w,end:O,start:C??O}}_f.resolveProps=xf});var Et=b(function(Rf){function Ls(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
64
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let s of t.start)if(s.type==="newline")return!0;if(t.sep){for(let s of t.sep)if(s.type==="newline")return!0}if(Ls(t.key)||Ls(t.value))return!0}return!1;default:return!0}}Rf.containsNewline=Ls});var Es=b(function(Ff){var jf=Et();function Kf(e,t,s){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&jf.containsNewline(t))s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ff.flowIndentCheck=Kf});var qs=b(function(Vf){var Vi=A();function Yf(e,t,s){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n==="function"?n:(r,o)=>r===o||Vi.isScalar(r)&&Vi.isScalar(o)&&r.value===o.value;return t.some((r)=>i(r.key,s))}Vf.mapIncludes=Yf});var Gi=b(function(Qf){var Hi=H(),Jf=W(),Ji=Re(),Wf=Et(),Wi=Es(),zf=qs(),zi="All mapping items must start at the same column";function Gf({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??Jf.YAMLMap)(s.schema);if(s.atRoot)s.atRoot=!1;let l=n.offset,c=null;for(let f of n.items){let{start:u,key:p,sep:m,value:y}=f,d=Ji.resolveProps(u,{indicator:"explicit-key-ind",next:p??m?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),h=!d.found;if(h){if(p){if(p.type==="block-seq")i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in p&&p.indent!==n.indent)i(l,"BAD_INDENT",zi)}if(!d.anchor&&!d.tag&&!m){if(c=d.end,d.comment)if(a.comment)a.comment+=`
|
|
65
|
+
`+d.comment;else a.comment=d.comment;continue}if(d.newlineAfterProp||Wf.containsNewline(p))i(p??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(d.found?.indent!==n.indent)i(l,"BAD_INDENT",zi);s.atKey=!0;let g=d.end,w=p?e(s,p,d,i):t(s,g,u,null,d,i);if(s.schema.compat)Wi.flowIndentCheck(n.indent,p,i);if(s.atKey=!1,zf.mapIncludes(s,a.items,w))i(g,"DUPLICATE_KEY","Map keys must be unique");let v=Ji.resolveProps(m??[],{indicator:"map-value-ind",next:y,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=v.end,v.found){if(h){if(y?.type==="block-map"&&!v.hasNewline)i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(s.options.strict&&d.start<v.found.offset-1024)i(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let k=y?e(s,y,v,i):t(s,l,m,null,v,i);if(s.schema.compat)Wi.flowIndentCheck(n.indent,y,i);l=k.range[2];let C=new Hi.Pair(w,k);if(s.options.keepSourceTokens)C.srcToken=f;a.items.push(C)}else{if(h)i(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(v.comment)if(w.comment)w.comment+=`
|
|
66
|
+
`+v.comment;else w.comment=v.comment;let k=new Hi.Pair(w);if(s.options.keepSourceTokens)k.srcToken=f;a.items.push(k)}}if(c&&c<l)i(c,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,l,c??l],a}Qf.resolveBlockMap=Gf});var Qi=b(function(np){var Zf=z(),ep=Re(),tp=Es();function sp({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??Zf.YAMLSeq)(s.schema);if(s.atRoot)s.atRoot=!1;if(s.atKey)s.atKey=!1;let l=n.offset,c=null;for(let{start:f,value:u}of n.items){let p=ep.resolveProps(f,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||u)if(u?.type==="block-seq")i(p.end,"BAD_INDENT","All sequence items must start at the same column");else i(l,"MISSING_CHAR","Sequence item without - indicator");else{if(c=p.end,p.comment)a.comment=p.comment;continue}let m=u?e(s,u,p,i):t(s,p.end,f,null,p,i);if(s.schema.compat)tp.flowIndentCheck(n.indent,u,i);l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}np.resolveBlockSeq=sp});var ge=b(function(op){function rp(e,t,s,n){let i="";if(e){let r=!1,o="";for(let a of e){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{if(s&&!r)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=l.substring(1)||" ";if(!i)i=f;else i+=o+f;o="";break}case"newline":if(i)o+=l;r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:i,offset:t}}op.resolveEnd=rp});var er=b(function(mp){var lp=A(),cp=H(),Xi=W(),up=z(),fp=ge(),Zi=Re(),pp=Et(),dp=qs(),Is="Block collections are not allowed within flow collections",$s=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function hp({composeNode:e,composeEmptyNode:t},s,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=new(r?.nodeClass??(o?Xi.YAMLMap:up.YAMLSeq))(s.schema);c.flow=!0;let f=s.atRoot;if(f)s.atRoot=!1;if(s.atKey)s.atKey=!1;let u=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let g=n.items[h],{start:w,key:v,sep:k,value:C}=g,N=Zi.resolveProps(w,{flow:a,indicator:"explicit-key-ind",next:v??k?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!k&&!C){if(h===0&&N.comma)i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(h<n.items.length-1)i(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(N.comment)if(c.comment)c.comment+=`
|
|
67
|
+
`+N.comment;else c.comment=N.comment;u=N.end;continue}if(!o&&s.options.strict&&pp.containsNewline(v))i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0){if(N.comma)i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!N.comma)i(N.start,"MISSING_CHAR",`Missing , between ${a} items`);if(N.comment){let O="";e:for(let S of w)switch(S.type){case"comma":case"space":break;case"comment":O=S.source.substring(1);break e;default:break e}if(O){let S=c.items[c.items.length-1];if(lp.isPair(S))S=S.value??S.key;if(S.comment)S.comment+=`
|
|
68
|
+
`+O;else S.comment=O;N.comment=N.comment.substring(O.length+1)}}}if(!o&&!k&&!N.found){let O=C?e(s,C,N,i):t(s,N.end,k,null,N,i);if(c.items.push(O),u=O.range[2],$s(C))i(O.range,"BLOCK_IN_FLOW",Is)}else{s.atKey=!0;let O=N.end,S=v?e(s,v,N,i):t(s,O,w,null,N,i);if($s(v))i(S.range,"BLOCK_IN_FLOW",Is);s.atKey=!1;let L=Zi.resolveProps(k??[],{flow:a,indicator:"map-value-ind",next:C,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(L.found){if(!o&&!N.found&&s.options.strict){if(k)for(let E of k){if(E===L.found)break;if(E.type==="newline"){i(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(N.start<L.found.offset-1024)i(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(C)if("source"in C&&C.source?.[0]===":")i(C,"MISSING_CHAR",`Missing space after : in ${a}`);else i(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let F=C?e(s,C,L,i):L.found?t(s,L.end,k,null,L,i):null;if(F){if($s(C))i(F.range,"BLOCK_IN_FLOW",Is)}else if(L.comment)if(S.comment)S.comment+=`
|
|
69
|
+
`+L.comment;else S.comment=L.comment;let oe=new cp.Pair(S,F);if(s.options.keepSourceTokens)oe.srcToken=g;if(o){let E=c;if(dp.mapIncludes(s,E.items,S))i(O,"DUPLICATE_KEY","Map keys must be unique");E.items.push(oe)}else{let E=new Xi.YAMLMap(s.schema);E.flow=!0,E.items.push(oe);let en=(F??S).range;E.range=[S.range[0],en[1],en[2]],c.items.push(E)}u=F?F.range[2]:L.end}}let p=o?"}":"]",[m,...y]=n.end,d=u;if(m?.source===p)d=m.offset+m.source.length;else{let h=a[0].toUpperCase()+a.substring(1),g=f?`${h} must end with a ${p}`:`${h} in block collection must be sufficiently indented and end with a ${p}`;if(i(u,f?"MISSING_CHAR":"BAD_INDENT",g),m&&m.source.length!==1)y.unshift(m)}if(y.length>0){let h=fp.resolveEnd(y,d,s.options.strict,i);if(h.comment)if(c.comment)c.comment+=`
|
|
70
|
+
`+h.comment;else c.comment=h.comment;c.range=[n.offset,d,h.offset]}else c.range=[n.offset,d,d];return c}mp.resolveFlowCollection=hp});var tr=b(function(Ap){var yp=A(),bp=P(),wp=W(),Sp=z(),vp=Gi(),kp=Qi(),Cp=er();function Ts(e,t,s,n,i,r){let o=s.type==="block-map"?vp.resolveBlockMap(e,t,s,n,r):s.type==="block-seq"?kp.resolveBlockSeq(e,t,s,n,r):Cp.resolveFlowCollection(e,t,s,n,r),a=o.constructor;if(i==="!"||i===a.tagName)return o.tag=a.tagName,o;if(i)o.tag=i;return o}function Np(e,t,s,n,i){let r=n.tag,o=!r?null:t.directives.tagName(r.source,(p)=>i(r,"TAG_RESOLVE_FAILED",p));if(s.type==="block-seq"){let{anchor:p,newlineAfterProp:m}=n,y=p&&r?p.offset>r.offset?p:r:p??r;if(y&&(!m||m.offset<y.offset))i(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===wp.YAMLMap.tagName&&a==="map"||o===Sp.YAMLSeq.tagName&&a==="seq")return Ts(e,t,s,i,o);let l=t.schema.tags.find((p)=>p.tag===o&&p.collection===a);if(!l){let p=t.schema.knownTags[o];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else{if(p)i(r,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0);else i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0);return Ts(e,t,s,i,o)}}let c=Ts(e,t,s,i,o,l),f=l.resolve?.(c,(p)=>i(r,"TAG_RESOLVE_FAILED",p),t.options)??c,u=yp.isNode(f)?f:new bp.Scalar(f);if(u.range=c.range,u.tag=o,l?.format)u.format=l.format;return u}Ap.composeCollection=Np});var xs=b(function(qp){var Ms=P();function Pp(e,t,s){let n=t.offset,i=Lp(t,e.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?Ms.Scalar.BLOCK_FOLDED:Ms.Scalar.BLOCK_LITERAL,o=t.source?Ep(t.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let h=o[d][1];if(h===""||h==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&o.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,o.length-1)):"",h=n+i.length;if(t.source)h+=t.source.length;return{value:d,type:r,comment:i.comment,range:[n,h,h]}}let l=t.indent+i.indent,c=t.offset+i.length,f=0;for(let d=0;d<a;++d){let[h,g]=o[d];if(g===""||g==="\r"){if(i.indent===0&&h.length>l)l=h.length}else{if(h.length<l)s(c+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)l=h.length;if(f=d,l===0&&!e.atRoot)s(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=h.length+g.length+1}for(let d=o.length-1;d>=a;--d)if(o[d][0].length>l)a=d+1;let u="",p="",m=!1;for(let d=0;d<f;++d)u+=o[d][0].slice(l)+`
|
|
72
|
+
`;for(let d=f;d<a;++d){let[h,g]=o[d];c+=h.length+g.length+1;let w=g[g.length-1]==="\r";if(w)g=g.slice(0,-1);if(g&&h.length<l){let k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;s(c-g.length-(w?2:1),"BAD_INDENT",k),h=""}if(r===Ms.Scalar.BLOCK_LITERAL)u+=p+h.slice(l)+g,p=`
|
|
73
|
+
`;else if(h.length>l||g[0]==="\t"){if(p===" ")p=`
|
|
74
|
+
`;else if(!m&&p===`
|
|
75
|
+
`)p=`
|
|
76
76
|
|
|
77
|
-
`;u+=
|
|
78
|
-
`,m=!0}else if(
|
|
77
|
+
`;u+=p+h.slice(l)+g,p=`
|
|
78
|
+
`,m=!0}else if(g==="")if(p===`
|
|
79
79
|
`)u+=`
|
|
80
|
-
`;else
|
|
81
|
-
`;else u+=
|
|
82
|
-
`+o[
|
|
80
|
+
`;else p=`
|
|
81
|
+
`;else u+=p+g,p=" ",m=!1}switch(i.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)u+=`
|
|
82
|
+
`+o[d][0].slice(l);if(u[u.length-1]!==`
|
|
83
83
|
`)u+=`
|
|
84
84
|
`;break;default:u+=`
|
|
85
|
-
`}let
|
|
85
|
+
`}let y=n+i.length+t.source.length;return{value:u,type:r,comment:i.comment,range:[n,y,y]}}function Lp({offset:e,props:t},s,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],r=i[0],o=0,a="",l=-1;for(let p=1;p<i.length;++p){let m=i[p];if(!a&&(m==="-"||m==="+"))a=m;else{let y=Number(m);if(!o&&y)o=y;else if(l===-1)l=e+p}}if(l!==-1)n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,f="",u=i.length;for(let p=1;p<t.length;++p){let m=t[p];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":if(s&&!c)n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");u+=m.source.length,f=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);let d=m.source;if(d&&typeof d==="string")u+=d.length}}}return{mode:r,indent:o,chomp:a,comment:f,length:u}}function Ep(e){let t=e.split(/\n( *)/),s=t[0],n=s.match(/^( *)/),r=[n?.[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}qp.resolveBlockScalar=Pp});var Ds=b(function(jp){var _s=P(),$p=ge();function Tp(e,t,s){let{offset:n,type:i,source:r,end:o}=e,a,l,c=(p,m,y)=>s(n+p,m,y);switch(i){case"scalar":a=_s.Scalar.PLAIN,l=Mp(r,c);break;case"single-quoted-scalar":a=_s.Scalar.QUOTE_SINGLE,l=xp(r,c);break;case"double-quoted-scalar":a=_s.Scalar.QUOTE_DOUBLE,l=_p(r,c);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let f=n+r.length,u=$p.resolveEnd(o,f,t,s);return{value:l,type:a,comment:u.comment,range:[n,f,u.offset]}}function Mp(e,t){let s="";switch(e[0]){case"\t":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}if(s)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`);return sr(e)}function xp(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return sr(e.slice(1,-1)).replace(/''/g,"'")}function sr(e){let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
86
|
`,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
87
|
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let i=n[1],r=" ",o=t.lastIndex;s.lastIndex=o;while(n=s.exec(e)){if(n[1]==="")if(r===`
|
|
88
88
|
`)i+=r;else r=`
|
|
89
|
-
`;else i+=r+n[1],r=" ";o=s.lastIndex}let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(e),i+r+(n?.[1]??"")}function
|
|
89
|
+
`;else i+=r+n[1],r=" ";o=s.lastIndex}let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(e),i+r+(n?.[1]??"")}function _p(e,t){let s="";for(let n=1;n<e.length-1;++n){let i=e[n];if(i==="\r"&&e[n+1]===`
|
|
90
90
|
`)continue;if(i===`
|
|
91
|
-
`){let{fold:r,offset:o}=
|
|
91
|
+
`){let{fold:r,offset:o}=Dp(e,n);s+=r,n=o}else if(i==="\\"){let r=e[++n],o=Rp[r];if(o)s+=o;else if(r===`
|
|
92
92
|
`){r=e[n+1];while(r===" "||r==="\t")r=e[++n+1]}else if(r==="\r"&&e[n+1]===`
|
|
93
|
-
`){r=e[++n+1];while(r===" "||r==="\t")r=e[++n+1]}else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;s+=
|
|
93
|
+
`){r=e[++n+1];while(r===" "||r==="\t")r=e[++n+1]}else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;s+=Bp(e,n+1,a,t),n+=a}else{let a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),s+=a}}else if(i===" "||i==="\t"){let r=n,o=e[n+1];while(o===" "||o==="\t")o=e[++n+1];if(o!==`
|
|
94
94
|
`&&!(o==="\r"&&e[n+2]===`
|
|
95
|
-
`))s+=n>r?e.slice(r,n+1):i}else s+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return s}function
|
|
95
|
+
`))s+=n>r?e.slice(r,n+1):i}else s+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return s}function Dp(e,t){let s="",n=e[t+1];while(n===" "||n==="\t"||n===`
|
|
96
96
|
`||n==="\r"){if(n==="\r"&&e[t+2]!==`
|
|
97
97
|
`)break;if(n===`
|
|
98
98
|
`)s+=`
|
|
99
|
-
`;t+=1,n=e[t+1]}if(!s)s=" ";return{fold:s,offset:t}}var
|
|
100
|
-
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
99
|
+
`;t+=1,n=e[t+1]}if(!s)s=" ";return{fold:s,offset:t}}var Rp={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Bp(e,t,s,n){let i=e.substr(t,s),o=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=e.substr(t-2,s+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}jp.resolveFlowScalar=Tp});var ir=b(function(Jp){var ne=A(),nr=P(),Fp=xs(),Up=Ds();function Yp(e,t,s,n){let{value:i,type:r,comment:o,range:a}=t.type==="block-scalar"?Fp.resolveBlockScalar(e,t,n):Up.resolveFlowScalar(t,e.options.strict,n),l=s?e.directives.tagName(s.source,(u)=>n(s,"TAG_RESOLVE_FAILED",u)):null,c;if(e.options.stringKeys&&e.atKey)c=e.schema[ne.SCALAR];else if(l)c=Vp(e.schema,i,l,s,n);else if(t.type==="scalar")c=Hp(e,i,t,n);else c=e.schema[ne.SCALAR];let f;try{let u=c.resolve(i,(p)=>n(s??t,"TAG_RESOLVE_FAILED",p),e.options);f=ne.isScalar(u)?u:new nr.Scalar(u)}catch(u){let p=u instanceof Error?u.message:String(u);n(s??t,"TAG_RESOLVE_FAILED",p),f=new nr.Scalar(i)}if(f.range=a,f.source=i,r)f.type=r;if(l)f.tag=l;if(c.format)f.format=c.format;if(o)f.comment=o;return f}function Vp(e,t,s,n,i){if(s==="!")return e[ne.SCALAR];let r=[];for(let a of e.tags)if(!a.collection&&a.tag===s)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(t))return a;let o=e.knownTags[s];if(o&&!o.collection)return e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o;return i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[ne.SCALAR]}function Hp({atKey:e,directives:t,schema:s},n,i,r){let o=s.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||s[ne.SCALAR];if(s.compat){let a=s.compat.find((l)=>l.default&&l.test?.test(n))??s[ne.SCALAR];if(o.tag!==a.tag){let l=t.tagString(o.tag),c=t.tagString(a.tag),f=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",f,!0)}}return o}Jp.composeScalar=Yp});var rr=b(function(Gp){function zp(e,t,s){if(t){s??(s=t.length);for(let n=s-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++n];while(i?.type==="space")e+=i.source.length,i=t[++n];break}}return e}Gp.emptyScalarPosition=zp});var lr=b(function(rd){var Xp=ke(),Zp=A(),ed=tr(),or=ir(),td=ge(),sd=rr(),nd={composeNode:ar,composeEmptyNode:Rs};function ar(e,t,s,n){let i=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=s,c,f=!0;switch(t.type){case"alias":if(c=id(e,t,n),a||l)n(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":if(c=or.composeScalar(e,t,l,n),a)c.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(c=ed.composeCollection(nd,e,t,s,n),a)c.anchor=a.source.substring(1)}catch(u){let p=u instanceof Error?u.message:String(u);n(t,"RESOURCE_EXHAUSTION",p)}break;default:{let u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",u),f=!1}}if(c??(c=Rs(e,t.offset,void 0,null,s,n)),a&&c.anchor==="")n(a,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&e.options.stringKeys&&(!Zp.isScalar(c)||typeof c.value!=="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str"))n(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(r)c.spaceBefore=!0;if(o)if(t.type==="scalar"&&t.source==="")c.comment=o;else c.commentBefore=o;if(e.options.keepSourceTokens&&f)c.srcToken=t;return c}function Rs(e,t,s,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let f={type:"scalar",offset:sd.emptyScalarPosition(t,s,n),indent:-1,source:""},u=or.composeScalar(e,f,a,c);if(o){if(u.anchor=o.source.substring(1),u.anchor==="")c(o,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)u.spaceBefore=!0;if(r)u.comment=r,u.range[2]=l;return u}function id({options:e},{offset:t,source:s,end:n},i){let r=new Xp.Alias(s.substring(1));if(r.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(r.source.endsWith(":"))i(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+s.length,a=td.resolveEnd(n,o,e.strict,i);if(r.range=[t,o,a.offset],a.comment)r.comment=a.comment;return r}rd.composeEmptyNode=Rs;rd.composeNode=ar});var ur=b(function(pd){var ld=_e(),cr=lr(),cd=ge(),ud=Re();function fd(e,t,{offset:s,start:n,value:i,end:r},o){let a=Object.assign({_directives:t},e),l=new ld.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},f=ud.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});if(f.found){if(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!f.hasNewline)o(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}l.contents=i?cr.composeNode(c,i,f,o):cr.composeEmptyNode(c,f.end,n,null,f,o);let u=l.contents.range[2],p=cd.resolveEnd(r,u,!1,o);if(p.comment)l.comment=p.comment;return l.range=[s,u,p.offset],l}pd.composeDoc=fd});var Bs=b(function(wd){var hd=Ue("process"),md=Ut(),gd=_e(),Be=De(),fr=A(),yd=ur(),bd=ge();function je(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:s}=e;return[t,t+(typeof s==="string"?s.length:1)]}function pr(e){let t="",s=!1,n=!1;for(let i=0;i<e.length;++i){let r=e[i];switch(r[0]){case"#":t+=(t===""?"":n?`
|
|
101
101
|
|
|
102
102
|
`:`
|
|
103
|
-
`)+(r.substring(1)||" "),s=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;s=!1;break;default:if(!s)n=!0;s=!1}}return{comment:t,afterEmptyLine:n}}class dr{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,n,i)=>{let r=je(t);if(i)this.warnings.push(new Be.YAMLWarning(r,s,n));else this.errors.push(new Be.YAMLParseError(r,s,n))},this.directives=new
|
|
104
|
-
${s}`:s;else if(n||e.directives.docStart||!i)e.commentBefore=s;else if(
|
|
103
|
+
`)+(r.substring(1)||" "),s=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;s=!1;break;default:if(!s)n=!0;s=!1}}return{comment:t,afterEmptyLine:n}}class dr{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,n,i)=>{let r=je(t);if(i)this.warnings.push(new Be.YAMLWarning(r,s,n));else this.errors.push(new Be.YAMLParseError(r,s,n))},this.directives=new md.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:n}=pr(this.prelude);if(s){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
104
|
+
${s}`:s;else if(n||e.directives.docStart||!i)e.commentBefore=s;else if(fr.isCollection(i)&&!i.flow&&i.items.length>0){let r=i.items[0];if(fr.isPair(r))r=r.key;let o=r.commentBefore;r.commentBefore=o?`${s}
|
|
105
105
|
${o}`:s}else{let r=i.commentBefore;i.commentBefore=r?`${s}
|
|
106
|
-
${r}`:s}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
107
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Be.YAMLParseError(je(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),n=new
|
|
106
|
+
${r}`:s}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:pr(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let n of e)yield*this.next(n);yield*this.end(t,s)}*next(e){if(hd.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,s,n)=>{let i=je(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=yd.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");if(this.decorate(t,!1),this.doc)yield this.doc;this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new Be.YAMLParseError(je(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(s);else this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){this.errors.push(new Be.YAMLParseError(je(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=bd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
|
|
107
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Be.YAMLParseError(je(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),n=new gd.Document(void 0,s);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");n.range=[0,t,t],this.decorate(n,!1),yield n}}}wd.Composer=dr});var gr=b(function(Ld){var vd=xs(),kd=Ds(),Cd=De(),hr=Oe();function Nd(e,t=!0,s){if(e){let n=(i,r,o)=>{let a=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(s)s(a,r,o);else throw new Cd.YAMLParseError([a,a+1],r,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return kd.resolveFlowScalar(e,t,n);case"block-scalar":return vd.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function Ad(e,t){let{implicitKey:s=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=hr.stringifyString({type:o,value:e},{implicitKey:s,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
108
108
|
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
109
|
-
`),
|
|
110
|
-
`,
|
|
111
|
-
`});return{type:"block-scalar",offset:r,indent:n,props:
|
|
109
|
+
`),f=a.substring(0,c),u=a.substring(c+1)+`
|
|
110
|
+
`,p=[{type:"block-scalar-header",offset:r,indent:n,source:f}];if(!mr(p,l))p.push({type:"newline",offset:-1,indent:n,source:`
|
|
111
|
+
`});return{type:"block-scalar",offset:r,indent:n,props:p,source:u}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function Od(e,t,s={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=s,a="indent"in e?e.indent:null;if(n&&typeof a==="number")a+=2;if(!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=e.props[0];if(c.type!=="block-scalar-header")throw Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=hr.stringifyString({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Pd(e,l);break;case'"':js(e,l,"double-quoted-scalar");break;case"'":js(e,l,"single-quoted-scalar");break;default:js(e,l,"scalar")}}function Pd(e,t){let s=t.indexOf(`
|
|
112
112
|
`),n=t.substring(0,s),i=t.substring(s+1)+`
|
|
113
|
-
`;if(e.type==="block-scalar"){let r=e.props[0];if(r.type!=="block-scalar-header")throw Error("Invalid block scalar header");r.source=n,e.source=i}else{let{offset:r}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];if(!
|
|
114
|
-
`});for(let l of Object.keys(e))if(l!=="type"&&l!=="offset")delete e[l];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function
|
|
115
|
-
`};delete e.items,Object.assign(e,{type:s,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((r)=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(e))if(r!=="type"&&r!=="offset")delete e[r];Object.assign(e,{type:s,indent:n,source:t,end:i})}}}
|
|
113
|
+
`;if(e.type==="block-scalar"){let r=e.props[0];if(r.type!=="block-scalar-header")throw Error("Invalid block scalar header");r.source=n,e.source=i}else{let{offset:r}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];if(!mr(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:o,source:`
|
|
114
|
+
`});for(let l of Object.keys(e))if(l!=="type"&&l!=="offset")delete e[l];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function mr(e,t){if(t)for(let s of t)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function js(e,t,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),i=t.length;if(e.props[0].type==="block-scalar-header")i-=e.props[0].source.length;for(let r of n)r.offset+=i;delete e.props,Object.assign(e,{type:s,source:t,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
115
|
+
`};delete e.items,Object.assign(e,{type:s,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((r)=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(e))if(r!=="type"&&r!=="offset")delete e[r];Object.assign(e,{type:s,indent:n,source:t,end:i})}}}Ld.createScalarToken=Ad;Ld.resolveAsScalar=Nd;Ld.setScalarValue=Od});var yr=b(function(Td){var $d=(e)=>("type"in e)?It(e):qt(e);function It(e){switch(e.type){case"block-scalar":{let t="";for(let s of e.props)t+=It(s);return t+e.source}case"block-map":case"block-seq":{let t="";for(let s of e.items)t+=qt(s);return t}case"flow-collection":{let t=e.start.source;for(let s of e.items)t+=qt(s);for(let s of e.end)t+=s.source;return t}case"document":{let t=qt(e);if(e.end)for(let s of e.end)t+=s.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let s of e.end)t+=s.source;return t}}}function qt({start:e,key:t,sep:s,value:n}){let i="";for(let r of e)i+=r.source;if(t)i+=It(t);if(s)for(let r of s)i+=r.source;if(n)i+=It(n);return i}Td.stringify=$d});var Sr=b(function(_d){var Ks=Symbol("break visit"),xd=Symbol("skip children"),br=Symbol("remove item");function ie(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};wr(Object.freeze([]),e,t)}ie.BREAK=Ks;ie.SKIP=xd;ie.REMOVE=br;ie.itemAtPath=(e,t)=>{let s=e;for(let[n,i]of t){let r=s?.[n];if(r&&"items"in r)s=r.items[i];else return}return s};ie.parentCollection=(e,t)=>{let s=ie.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=s?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};function wr(e,t,s){let n=s(t,e);if(typeof n==="symbol")return n;for(let i of["key","value"]){let r=t[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=wr(Object.freeze(e.concat([[i,o]])),r.items[o],s);if(typeof a==="number")o=a-1;else if(a===Ks)return Ks;else if(a===br)r.items.splice(o,1),o-=1}if(typeof n==="function"&&i==="key")n=n(t,e)}}return typeof n==="function"?n(t,e):n}_d.visit=ie});var $t=b(function(Yd){var Fs=gr(),Rd=yr(),Bd=Sr(),Us="\uFEFF",Ys="\x02",Vs="\x18",Hs="\x1F",jd=(e)=>!!e&&("items"in e),Kd=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Fd(e){switch(e){case Us:return"<BOM>";case Ys:return"<DOC>";case Vs:return"<FLOW_END>";case Hs:return"<SCALAR>";default:return JSON.stringify(e)}}function Ud(e){switch(e){case Us:return"byte-order-mark";case Ys:return"doc-mode";case Vs:return"flow-error-end";case Hs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
116
|
`:case`\r
|
|
117
|
-
`: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}
|
|
118
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
119
|
-
\r `),Js=(e)=>!e||
|
|
117
|
+
`: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}Yd.createScalarToken=Fs.createScalarToken;Yd.resolveAsScalar=Fs.resolveAsScalar;Yd.setScalarValue=Fs.setScalarValue;Yd.stringify=Rd.stringify;Yd.visit=Bd.visit;Yd.BOM=Us;Yd.DOCUMENT=Ys;Yd.FLOW_END=Vs;Yd.SCALAR=Hs;Yd.isCollection=jd;Yd.isScalar=Kd;Yd.prettyToken=Fd;Yd.tokenType=Ud});var Ws=b(function(oh){var Ke=$t();function D(e){switch(e){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case"\t":return!0;default:return!1}}var vr=new Set("0123456789ABCDEFabcdef"),ih=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Tt=new Set(",[]{}"),rh=new Set(` ,[]{}
|
|
119
|
+
\r `),Js=(e)=>!e||rh.has(e);class kr{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){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 s=this.next??"stream";while(s&&(t||this.hasChars(1)))s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
|
|
120
120
|
`)return!0;if(t==="\r")return this.buffer[e+1]===`
|
|
121
121
|
`;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;while(t===" ")t=this.buffer[++s+e];if(t==="\r"){let n=this.buffer[s+e+1];if(n===`
|
|
122
122
|
`||!n&&!this.atEnd)return e+s+1}return t===`
|
|
@@ -128,21 +128,21 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
128
128
|
`)break}default:break e}if(!s&&!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{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
129
129
|
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;s=this.buffer[n];while(s===" ")s=this.buffer[++n];if(s==="\t"){while(s==="\t"||s===" "||s==="\r"||s===`
|
|
130
130
|
`)s=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,r=this.buffer[i];if(r==="\r")r=this.buffer[--i];let o=i;while(r===" ")r=this.buffer[--i];if(r===`
|
|
131
|
-
`&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield Ke.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,n;while(n=this.buffer[++s])if(n===":"){let i=this.buffer[s+1];if(D(i)||e
|
|
131
|
+
`&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield Ke.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,n;while(n=this.buffer[++s])if(n===":"){let i=this.buffer[s+1];if(D(i)||e&&Tt.has(i))break;t=s}else if(D(n)){let i=this.buffer[s+1];if(n==="\r")if(i===`
|
|
132
132
|
`)s+=1,n=`
|
|
133
|
-
`,i=this.buffer[s+1];else t=s;if(i==="#"||e
|
|
134
|
-
`){let r=this.continueScalar(s+1);if(r===-1)break;s=Math.max(s,r-2)}}else{if(e
|
|
133
|
+
`,i=this.buffer[s+1];else t=s;if(i==="#"||e&&Tt.has(i))break;if(n===`
|
|
134
|
+
`){let r=this.continueScalar(s+1);if(r===-1)break;s=Math.max(s,r-2)}}else{if(e&&Tt.has(n))break;t=s}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield Ke.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc"}*pushCount(e){if(e>0)return yield this.buffer.substr(this.pos,e),this.pos+=e,e;return 0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);if(s)return yield s,this.pos+=s.length,s.length;else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(!0){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Js),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(D(s)||t&&Tt.has(s)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];while(!D(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];while(t)if(ih.has(t))t=this.buffer[++e];else if(t==="%"&&vr.has(this.buffer[e+1])&&vr.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];if(e===`
|
|
135
135
|
`)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
|
|
136
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,s=this.buffer[t];while(!e(s))s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}
|
|
136
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,s=this.buffer[t];while(!e(s))s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}oh.Lexer=kr});var zs=b(function(lh){class Cr{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,s=this.lineStarts.length;while(t<s){let i=t+s>>1;if(this.lineStarts[i]<e)t=i+1;else s=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}lh.LineCounter=Cr});var Gs=b(function(ph){var uh=Ue("process"),Nr=$t(),fh=Ws();function G(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Ar(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Pr(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Mt(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function ye(e){if(e.length===0)return[];let t=e.length;e:while(--t>=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 xt(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let s=0;s<t.length;++s)e.push(t[s])}function Or(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!G(t.start,"explicit-key-ind")&&!G(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,Pr(t.value))if(t.value.end)xt(t.value.end,t.sep);else t.value.end=t.sep;else xt(t.start,t.sep);delete t.sep}}}class Lr{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new fh.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let s of this.lexer.lex(e,t))yield*this.next(s);if(!t)yield*this.end()}*next(e){if(this.source=e,uh.env.LOG_TOKENS)console.log("|",Nr.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Nr.tokenType(e);if(!t){let s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}else if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+e.length);break;case"space":if(this.atNewLine&&e[0]===" ")this.indent+=e.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=e.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let 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){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let s=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in s?s.indent:0;else if(t.type==="flow-collection"&&s.type==="document")t.indent=0;if(t.type==="flow-collection")Or(t);switch(s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{let n=s.items[s.items.length-1];if(n.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=s.items[s.items.length-1];if(n.value)s.items.push({start:[],value:t});else n.value=t;break}case"flow-collection":{let n=s.items[s.items.length-1];if(!n||n.value)s.items.push({start:[],key:t,sep:[]});else if(n.sep)n.value=t;else Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];if(n&&!n.sep&&!n.value&&n.start.length>0&&Ar(n.start)===-1&&(t.indent===0||n.start.every((i)=>i.type!=="comment"||i.indent<t.indent))){if(s.type==="document")s.end=n.start;else s.items.push({start:n.start});t.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")e.start.push(this.sourceToken);this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{if(Ar(e.start)!==-1)yield*this.pop(),yield*this.step();else e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);if(t)this.stack.push(t);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Mt(this.peek(2)),s=ye(t),n;if(e.end)n=e.end,n.push(this.sourceToken),delete e.end;else n=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
137
137
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){xt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(n&&t.sep&&!t.value){let r=[];for(let o=0;o<t.sep.length;++o){let a=t.sep[o];switch(a.type){case"newline":r.push(o);break;case"space":break;case"comment":if(a.indent>e.indent)r.length=0;break;default:r.length=0}}if(r.length>=2)i=t.sep.splice(r[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0;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=!0;else if(n||t.value)i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(G(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let r=ye(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(G(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(
|
|
138
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){xt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(n&&t.sep&&!t.value){let r=[];for(let o=0;o<t.sep.length;++o){let a=t.sep[o];switch(a.type){case"newline":r.push(o);break;case"space":break;case"comment":if(a.indent>e.indent)r.length=0;break;default:r.length=0}}if(r.length>=2)i=t.sep.splice(r[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0;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=!0;else if(n||t.value)i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(G(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let r=ye(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(G(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Pr(t.key)&&!G(t.sep,"newline")){let r=ye(t.start),{key:o,sep:a}=t;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:o,sep:a}]})}else if(i.length>0)t.sep=t.sep.concat(i,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||n)e.items.push({start:i,key:null,sep:[this.sourceToken]});else if(G(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=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);if(n||t.value)e.items.push({start:i,key:r,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(r);else Object.assign(t,{key:r,sep:[]}),this.onKeyLine=!0;return}default:{let r=this.startBlockValue(e);if(r){if(r.type==="block-seq"){if(!t.explicitKey&&t.sep&&!G(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(s)e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.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)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){xt(n,t.start),n.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||G(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.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":{let n=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:n,sep:[]});else if(t.sep)this.stack.push(n);else Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);if(s)this.stack.push(s);else yield*this.pop(),yield*this.step()}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let n=Mt(s),i=ye(n);Or(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
139
139
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
140
|
-
`,t)+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=!0;let t=Mt(e),s=ye(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Mt(e),s=ye(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((s)=>s.type==="newline"||s.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=!1;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()}}}
|
|
141
|
-
`)}}async function un(e,t,s){if(await Bun.spawn([e,...t],{cwd:s,stdout:"inherit",stderr:"inherit",env:{...process.env,BUN_BE_BUN:"1"}}).exited)throw Error(`Plugin package operation failed: ${t.join(" ")}`)}async function
|
|
142
|
-
`)}async function sn(e){let t=JSON.parse(await Ve(e,"utf8"));return Object.keys(t.dependencies??{}).filter(be)}function
|
|
143
|
-
`),0}let[n,...i]=t;if(!n)return 0;if(n==="--help"||n==="-h"){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}if(n==="--version"||n==="-v"){let o=e.get("version");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}let r=e.get(n);if(!r)return
|
|
144
|
-
`),Bt(t,n,i.slice(0,-1)),1}if(!t.run)return Bt(t,n,i.slice(0,-1)),0;if(t.name==="serve"&&i.length>1){let
|
|
145
|
-
`);try{let
|
|
140
|
+
`,t)+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=!0;let t=Mt(e),s=ye(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Mt(e),s=ye(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((s)=>s.type==="newline"||s.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=!1;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()}}}ph.Parser=Lr});var Tr=b(function(vh){var Er=Bs(),hh=_e(),Fe=De(),mh=zt(),gh=A(),yh=zs(),qr=Gs();function Ir(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new yh.LineCounter||null,prettyErrors:t}}function bh(e,t={}){let{lineCounter:s,prettyErrors:n}=Ir(t),i=new qr.Parser(s?.addNewLine),r=new Er.Composer(t),o=Array.from(r.compose(i.parse(e)));if(n&&s)for(let a of o)a.errors.forEach(Fe.prettifyError(e,s)),a.warnings.forEach(Fe.prettifyError(e,s));if(o.length>0)return o;return Object.assign([],{empty:!0},r.streamInfo())}function $r(e,t={}){let{lineCounter:s,prettyErrors:n}=Ir(t),i=new qr.Parser(s?.addNewLine),r=new Er.Composer(t),o=null;for(let a of r.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Fe.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&s)o.errors.forEach(Fe.prettifyError(e,s)),o.warnings.forEach(Fe.prettifyError(e,s));return o}function wh(e,t,s){let n=void 0;if(typeof t==="function")n=t;else if(s===void 0&&t&&typeof t==="object")s=t;let i=$r(e,s);if(!i)return null;if(i.warnings.forEach((r)=>mh.warn(i.options.logLevel,r)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},s))}function Sh(e,t,s){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(s===void 0&&t)s=t;if(typeof s==="string")s=s.length;if(typeof s==="number"){let i=Math.round(s);s=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=s??t??{};if(!i)return}if(gh.isDocument(e)&&!n)return e.toString(s);return new hh.Document(e,n,s).toString(s)}vh.parse=wh;vh.parseAllDocuments=bh;vh.parseDocument=$r;vh.stringify=Sh});import{satisfiesVersionRange as qm}from"@mcp-com-ai/plugin-sdk";import{hapiHome as Im,loadGlobalConfig as $m,parseWorkspaceBootstrap as Tm,resolveHapiWorkspace as Mm,runtimeConsole as xm}from"@mcp-com-ai/shared-utils";function tn(e,t,s={}){let n=s.warn??(()=>{}),i=new Map,r=(o,a,l,c)=>{for(let f of[o.name,...o.aliases??[]]){if(i.has(f)){let u=i.get(f);n(`Command '${f}' already provided by ${u.source==="core"?"core":u.pluginName}; ignoring declaration from ${l??"core"}`);continue}i.set(f,{...o,source:a,pluginName:l,packageName:c})}};for(let o of e)r(o,"core");for(let{plugin:o,packageName:a}of t)for(let l of o.commands)r(l,"plugin",o.name,a);return i}function Dm(e){let t=new Set;for(let[s,n]of e.entries())if(s===n.name)t.add(n);return Array.from(t).filter((s)=>!s.hidden).sort((s,n)=>s.name.localeCompare(n.name))}import{HAPI_CLI_API_VERSION as fn,satisfiesVersionRange as Zr}from"@mcp-com-ai/plugin-sdk";import{mkdir as Ur,realpath as Rt,readFile as Ve,stat as Yr,writeFile as rn}from"fs/promises";import I from"path";import{pathToFileURL as Vr}from"url";import{hasFileSystemAccess as on,resolveHapiPaths as Hr}from"@mcp-com-ai/shared-utils";function we(){let e=I.join(Hr().home,"plugins");return{root:e,nodeModules:I.join(e,"node_modules"),manifest:I.join(e,"package.json")}}function be(e){return/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/i.test(e)}async function an(e,t=we()){if(!on||!be(e))return;let s=I.join(t.nodeModules,...e.split("/"));try{let n=await Rt(s),i=await Rt(t.nodeModules);if(!nn(n,i))return;let r=JSON.parse(await Ve(I.join(n,"package.json"),"utf8"));if(r.name!==e)return;let o=Qr(r);if(!o||!Xr(o))return;let a=I.resolve(n,o),l=await Rt(a);if(!nn(l,n))return;return Vr(l).href}catch{return}}async function ln(e,t={}){if(!on)throw Error("Managed plugins are not available without filesystem access.");let s=t.store??we(),n=await zr(e),i=await Wr(e);if(i.length===0&&n.size===0)throw Error("Provide at least one plugin package, tarball, or release directory.");await Ur(s.root,{recursive:!0}),await Jr(s);let r=await sn(s.manifest),o=t.execute??un;if(n.size>0)await Gr(s.manifest,n),await o(process.execPath,["install","--production"],s.root);if(i.length>0)await o(process.execPath,["add","--production",...i],s.root);return{packageNames:(await sn(s.manifest)).filter((l)=>!r.includes(l)),store:s}}async function cn(e,t={}){if(!be(e))throw Error(`Invalid plugin package name: ${e}`);let s=t.store??we();await(t.execute??un)(process.execPath,["remove",e],s.root)}async function Jr(e){try{await Ve(e.manifest,"utf8")}catch{await rn(e.manifest,JSON.stringify({name:"hapi-managed-plugins",private:!0,type:"module"},null,2)+`
|
|
141
|
+
`)}}async function un(e,t,s){if(await Bun.spawn([e,...t],{cwd:s,stdout:"inherit",stderr:"inherit",env:{...process.env,BUN_BE_BUN:"1"}}).exited)throw Error(`Plugin package operation failed: ${t.join(" ")}`)}async function Wr(e){let t=[];for(let s of e){let n=I.resolve(s);try{if(!(await Yr(n)).isDirectory()){t.push(s);continue}let r=I.join(n,"manifest.json");if(await Bun.file(r).exists())continue;else t.push(n)}catch(i){if(i instanceof Error&&i.message.includes("Release manifest"))throw i;t.push(s)}}return t}async function zr(e){let t=new Map,s=new Set;for(let r of e){let o=I.resolve(r),a=I.join(o,"manifest.json");if(!await Bun.file(a).exists())continue;let l=await Bun.file(a).json();for(let c of l.packages??[]){if(!c.name||!c.file||!be(c.name))continue;t.set(c.name,{file:I.join(o,c.file),internalDependencies:c.internalDependencies??{}})}for(let c of l.managedPlugins??[])if(be(c))s.add(c);if(s.size===0)throw Error(`Release manifest does not declare managed plugins: ${o}`)}let n=new Map,i=[...s];while(i.length>0){let r=i.pop();if(!r||n.has(r))continue;let o=t.get(r);if(!o)throw Error(`Release manifest is missing required package ${r}.`);n.set(r,`file:${o.file}`),i.push(...Object.keys(o.internalDependencies))}return n}async function Gr(e,t){let s=JSON.parse(await Ve(e,"utf8")),n=Object.fromEntries(t);await rn(e,`${JSON.stringify({...s,dependencies:{...s.dependencies??{},...n},overrides:{...s.overrides??{},...n}},null,2)}
|
|
142
|
+
`)}async function sn(e){let t=JSON.parse(await Ve(e,"utf8"));return Object.keys(t.dependencies??{}).filter(be)}function Qr(e){let t=e.exports&&typeof e.exports==="object"&&!Array.isArray(e.exports)?e.exports["."]??e.exports:e.exports;return Ye(t)??e.module??e.main}function Ye(e){if(typeof e==="string")return e;if(!e||typeof e!=="object"||Array.isArray(e))return;let t=e;return Ye(t.bun)??Ye(t.import)??Ye(t.default)}function Xr(e){return/\.(?:c?m?js)$/i.test(e)&&!/(?:^|\/)src(?:\/|$)/.test(e)}function nn(e,t){let s=I.relative(t,e);return s===""||!s.startsWith(`..${I.sep}`)&&s!==".."&&!I.isAbsolute(s)}var eo=["@mcp-com-ai/plugin-openapi","@mcp-com-ai/plugin-arazzo","@mcp-com-ai/plugin-cloudflare","@mcp-com-ai/plugin-capability-graph","@mcp-com-ai/enterprise-plugin-auth","@mcp-com-ai/enterprise-plugin-licensing","@mcp-com-ai/enterprise-plugin-a2a","@mcp-com-ai/plugin-otel"];async function dn(e={}){let t=e.warn??(()=>{}),s=new Set(e.blocklist??[]),n=[],i=new Set,r=[];for(let o of e.bundledPlugins??[])r.push({packageName:o.name,source:"bundled",plugin:o});for(let o of e.workspacePackages??[])r.push({packageName:o,source:"workspace"});for(let o of eo)r.push({packageName:o,source:"installed"});for(let o of e.configuredPackages??[])r.push({packageName:o,source:"installed"});for(let o of e.workspaceRequirements??[])r.push({packageName:o,source:"installed"});for(let{packageName:o,source:a,plugin:l}of r){if(i.has(o))continue;if(i.add(o),s.has(o))continue;let c=!1;try{let f=a,u;if(!l)try{u=await import(o)}catch(y){if(!pn(y))throw y;let d=await(e.resolveManagedEntrypoint??an)(o);if(!d)throw y;c=!0,u=await import(d),f="managed"}let p=l??(u?.plugin??u?.default);if(!p){t(`Plugin '${o}' loaded but did not export a plugin definition`);continue}if(p.compatibility?.cliApiVersion!==fn){t(`Plugin '${o}' declares cliApiVersion=${p.compatibility?.cliApiVersion}; CLI expects ${fn}. Skipping.`);continue}let m=p.compatibility.core;if(m&&!Zr(m.version,m.range)){t(`Plugin '${o}' resolved core ${m.version}, which does not satisfy its declared range ${m.range}. Skipping.`);continue}n.push({plugin:p,packageName:o,source:f})}catch(f){let u=f instanceof Error?f.message:String(f);if(c||!pn(f))t(`Plugin '${o}' failed to load: ${u}`)}}return n}function pn(e){if(!e||typeof e!=="object")return!1;let t=e.code;if(t==="ERR_MODULE_NOT_FOUND"||t==="MODULE_NOT_FOUND")return!0;let s=e.message??"";return/Cannot find (module|package)/i.test(s)}import{parseArgs as to,renderCommandHelp as Bt}from"@mcp-com-ai/plugin-sdk";var He=[{command:"graph",packageName:"@mcp-com-ai/plugin-capability-graph",description:"Compile, inspect, search, and evaluate OpenAPI capability graphs.",installHint:"bun add -g @mcp-com-ai/plugin-capability-graph"},{command:"cloudflare",packageName:"@mcp-com-ai/plugin-cloudflare",description:"Deploy HAPI MCP servers to Cloudflare Workers (deploy, login, status).",installHint:"bun add -g @mcp-com-ai/plugin-cloudflare"},{command:"openapi",packageName:"@mcp-com-ai/plugin-openapi",description:"OpenAPI-driven tooling (init, lint, list, serve).",installHint:"bun add -g @mcp-com-ai/plugin-openapi",documentRootField:"openapi"},{command:"arazzo",packageName:"@mcp-com-ai/plugin-arazzo",description:"Arazzo workflow validation, serving, and execution.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"workflows",packageName:"@mcp-com-ai/plugin-arazzo",description:"Alias for the Arazzo workflow command group.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"auth",packageName:"@mcp-com-ai/enterprise-plugin-auth",description:"OAuth/Security handler configuration for `hapi serve` (enterprise tier).",installHint:"Contact La Rebelion Labs for enterprise access."},{command:"otel",packageName:"@mcp-com-ai/plugin-otel",description:"OpenTelemetry / PostHog telemetry collection for HAPI commands.",installHint:"bun add -g @mcp-com-ai/plugin-otel"},{command:"license",packageName:"@mcp-com-ai/enterprise-plugin-licensing",description:"Enterprise licensing (activation, status, import). Part of the enterprise tier.",installHint:"Contact La Rebelion Labs for enterprise access, then run `hapi plugins install <private-release-or-package>`."}];function hn(e){return He.find((t)=>t.command===e)}function mn(e){return He.find((t)=>t.documentRootField===e)}var so=new Set(["--help","-h","help"]);async function yn(e,t,s){if(t.length===0){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}return s.stdout.write(`Usage: hapi <command> [subcommand] [options]
|
|
143
|
+
`),0}let[n,...i]=t;if(!n)return 0;if(n==="--help"||n==="-h"){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}if(n==="--version"||n==="-v"){let o=e.get("version");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}let r=e.get(n);if(!r)return no(n,s);return jt(e,r,i,s,[r.name])}async function jt(e,t,s,n,i){if(s.length>0&&so.has(s[0]))return Bt(t,n,i.slice(0,-1)),0;let r=s[0];if(t.subcommands&&t.subcommands.length>0&&r&&!r.startsWith("-")){let c=t.subcommands.find((f)=>f.name===r||f.aliases?.includes(r));if(c)return jt(e,c,s.slice(1),n,[...i,c.name]);if(!t.run)return n.stderr.write(`Unknown subcommand: ${i.join(" ")} ${r}
|
|
144
|
+
`),Bt(t,n,i.slice(0,-1)),1}if(!t.run)return Bt(t,n,i.slice(0,-1)),0;if(t.name==="serve"&&i.length>1){let c=e.get("serve");if(c?.source==="core")return jt(e,c,s,n,[c.name])}let o=n.workspace,a=o?.profileSettings?.spec&&i[0]==="graph"&&!gn(s,"specs")&&!s.some((c)=>!c.startsWith("-"))?[String(o.profileSettings.spec),...s]:s,l=to(a,t.options??[]);if(t.name==="serve"&&o?.profileSettings){let c=o.profileSettings,f={specs:c.spec,mcp:c.mcp,"capability-graph":c.capabilityGraph,"capability-planning":c.capabilityPlanning,"capability-classifier":c.capabilityClassifier,"runtime-authority":c.runtimeAuthority};for(let[u,p]of Object.entries(f))if(p!==void 0&&!gn(s,u))l.options[u]=p}if(l.unknownOptions?.length)n.stderr.write(`\u26A0\uFE0F Unrecognized option(s): ${l.unknownOptions.map((c)=>`--${c}`).join(", ")} \u2014 not applied. Check for a typo (see --help for valid options).
|
|
145
|
+
`);try{let c=await t.run(l,n);return typeof c==="number"?c:Number(process.exitCode??0)}catch(c){let{printCliError:f}=await import("@mcp-com-ai/shared-utils");return f(`\u274C ${i.join(" ")} failed`,c),1}}function gn(e,t){let s=t.replace(/-([a-z])/g,(n,i)=>i.toUpperCase());return e.some((n)=>n===`--${t}`||n===`--no-${t}`||n.startsWith(`--${t}=`)||n===`--${s}`||n.startsWith(`--${s}=`))}function no(e,t){let s=hn(e);if(s)return t.stderr.write(`
|
|
146
146
|
Command "${e}" is provided by ${s.packageName}, which is not installed.
|
|
147
147
|
`),t.stderr.write(`
|
|
148
148
|
${s.description}
|
|
@@ -152,7 +152,7 @@ Command "${e}" is provided by ${s.packageName}, which is not installed.
|
|
|
152
152
|
|
|
153
153
|
`),127;return t.stderr.write(`Unknown command: ${e}
|
|
154
154
|
`),t.stderr.write(`Run "hapi help" to see available commands.
|
|
155
|
-
`),127}function
|
|
155
|
+
`),127}function bn(e){return{name:"help",description:"Show the top-level CLI help",aliases:["--help","-h"],async run(t,s){let n=e(),i=new Map;for(let[l,c]of n.entries())if(l===c.name)i.set(l,c);let r=(l)=>s.stdout.write(l);r(`
|
|
156
156
|
`),r(`HAPI \u2014 turn your APIs into MCP tools.
|
|
157
157
|
`),r(`
|
|
158
158
|
Usage:
|
|
@@ -175,18 +175,18 @@ Examples:
|
|
|
175
175
|
`),r(`Is the HAPI CLI helpful?
|
|
176
176
|
Don't forget to star the project on GitHub: https://github.com/mcp-com-ai/hapimcp
|
|
177
177
|
|
|
178
|
-
`),0}}}import{HAPI_CLI_API_VERSION as
|
|
179
|
-
`),t.stdout.write(`plugin-contract v${
|
|
180
|
-
`),0)};import{hasFileSystemAccess as
|
|
178
|
+
`),0}}}import{HAPI_CLI_API_VERSION as ro}from"@mcp-com-ai/plugin-sdk";var wn="1.3.1";var Je=wn;var Sn={name:"version",aliases:["--version","-v"],description:"Show the installed CLI version",run:async(e,t)=>(t.stdout.write(`hapi ${Je}
|
|
179
|
+
`),t.stdout.write(`plugin-contract v${ro}
|
|
180
|
+
`),0)};import{hasFileSystemAccess as oo,loadGlobalConfig as vn,saveGlobalConfig as kn}from"@mcp-com-ai/shared-utils";function Cn(e){return{name:"plugins",description:"List loaded plugins and discover installable ones",subcommands:[{name:"list",description:"List the plugins currently loaded by the CLI",async run(t,s){let n=e();if(n.length===0)return s.stdout.write("No plugins loaded. Run `hapi plugins available` to see what you can install.\n"),0;s.stdout.write(`
|
|
181
181
|
Loaded plugins:
|
|
182
182
|
`);for(let i of n){let r=i.plugin.displayName??i.plugin.name;if(s.stdout.write(` ${r.padEnd(36)} ${i.plugin.version.padEnd(10)} [${i.source}]
|
|
183
183
|
`),i.plugin.description)s.stdout.write(` ${i.plugin.description}
|
|
184
184
|
`)}return s.stdout.write(`
|
|
185
|
-
`),0}},{name:"install",description:"Install trusted plugin packages into the HAPI-managed extension store",arguments:[{name:"package",description:"Package specifier, .tgz file, or release directory",required:!0,variadic:!0}],async run(t,s){if(!
|
|
186
|
-
`),1;let n=await ln(t.positionals),i=n.packageNames.filter(
|
|
185
|
+
`),0}},{name:"install",description:"Install trusted plugin packages into the HAPI-managed extension store",arguments:[{name:"package",description:"Package specifier, .tgz file, or release directory",required:!0,variadic:!0}],async run(t,s){if(!oo)return s.stderr.write(`Managed plugin installation is unavailable in this runtime.
|
|
186
|
+
`),1;let n=await ln(t.positionals),i=n.packageNames.filter(ao);if(i.length>0){let r=await vn({force:!0});await kn({...r,plugins:[...new Set([...r.plugins??[],...i])]})}if(s.stdout.write(`Installed ${n.packageNames.length} package(s) in ${n.store.root}.
|
|
187
187
|
`),i.length>0)s.stdout.write(`Enabled plugins: ${i.join(", ")}
|
|
188
188
|
`);return 0}},{name:"remove",aliases:["uninstall"],description:"Remove a plugin package from the HAPI-managed extension store",arguments:[{name:"package",description:"Installed plugin package name",required:!0}],async run(t,s){let n=t.positionals[0];if(!n)return s.stderr.write(`Usage: hapi plugins remove <package-name>
|
|
189
|
-
`),1;await cn(n);let i=await
|
|
189
|
+
`),1;await cn(n);let i=await vn({force:!0});return await kn({...i,plugins:(i.plugins??[]).filter((r)=>r!==n)}),s.stdout.write(`Removed ${n} from the managed plugin store.
|
|
190
190
|
`),0}},{name:"store",description:"Show the HAPI-managed extension store location",async run(t,s){let n=we();return s.stdout.write(`Managed plugin store: ${n.root}
|
|
191
191
|
`),s.stdout.write(`Packages: ${n.nodeModules}
|
|
192
192
|
`),0}},{name:"available",description:"Show first-party plugins the CLI knows about",async run(t,s){let n=new Set(e().map((i)=>i.packageName));s.stdout.write(`
|
|
@@ -196,36 +196,44 @@ First-party HAPI plugins:
|
|
|
196
196
|
`),s.stdout.write(` ${i.description}
|
|
197
197
|
`),i.installHint&&!n.has(i.packageName))s.stdout.write(` Install: ${i.installHint}
|
|
198
198
|
`)}return s.stdout.write(`
|
|
199
|
-
`),0}}]}}function
|
|
199
|
+
`),0}}]}}function ao(e){return e.includes("plugin-")&&!e.endsWith("/plugin-sdk")}import{HAPI_CLI_API_VERSION as lo,satisfiesVersionRange as co}from"@mcp-com-ai/plugin-sdk";import{getHapiPaths as uo,hasFileSystemAccess as Nn,isBunRuntime as fo,isCloudflareRuntime as po}from"@mcp-com-ai/shared-utils";function An(e){return{name:"doctor",description:"Check the local HAPI environment for common configuration issues",async run(t,s){let n=(c)=>s.stdout.write(c),i=(c)=>s.stderr.write(c),r=0;n(`
|
|
200
200
|
HAPI doctor
|
|
201
201
|
`),n(`===========
|
|
202
202
|
|
|
203
203
|
`),n(`CLI version: ${Je}
|
|
204
|
-
`),n(`Plugin contract: v${
|
|
205
|
-
`),n(`Runtime: ${
|
|
206
|
-
`),n(`File-system access: ${
|
|
207
|
-
`);let o=
|
|
204
|
+
`),n(`Plugin contract: v${lo}
|
|
205
|
+
`),n(`Runtime: ${fo?"bun":po?"cloudflare-workers":"node/other"}
|
|
206
|
+
`),n(`File-system access: ${Nn?"yes":"no"}
|
|
207
|
+
`);let o=uo();n(`
|
|
208
208
|
HAPI_HOME: ${o.home}
|
|
209
209
|
`),n(` specs: ${o.specs}
|
|
210
210
|
`),n(` config: ${o.config}
|
|
211
211
|
`),n(` logs: ${o.logs}
|
|
212
212
|
`),n(` certs: ${o.certs}
|
|
213
213
|
`),n(` plugins: ${o.plugins}
|
|
214
|
-
`)
|
|
215
|
-
|
|
216
|
-
`)
|
|
217
|
-
|
|
218
|
-
`);for(let
|
|
219
|
-
`);let c
|
|
220
|
-
`)
|
|
214
|
+
`);let a=s.workspace;if(a){n(`
|
|
215
|
+
Workspace: ${a.root}
|
|
216
|
+
`),n(` descriptor: ${a.descriptor}
|
|
217
|
+
`),n(` profile: ${a.profile??"(none)"}
|
|
218
|
+
`);for(let[c,f]of Object.entries(a.paths))n(` ${c}:`.padEnd(24)+`${f}
|
|
219
|
+
`);for(let c of[...a.plugins.required,...a.plugins.optional])n(` plugin: ${c.name} ${c.version}
|
|
220
|
+
`)}if(Nn){let c=await import("fs/promises");for(let[f,u]of Object.entries({home:o.home,config:o.config,specs:o.specs,plugins:o.plugins}))try{if(!(await c.stat(u)).isDirectory())i(` \u2717 ${f} exists but is not a directory: ${u}
|
|
221
|
+
`),r++}catch{n(` \u2022 ${f} missing (will be created on first use): ${u}
|
|
222
|
+
`)}}let l=e();n(`
|
|
223
|
+
Loaded plugins: ${l.length}
|
|
224
|
+
`);for(let c of l){n(` \u2713 ${c.plugin.name}@${c.plugin.version} [${c.source}]
|
|
225
|
+
`);let f=c.plugin.compatibility.core;if(f){let u=co(f.version,f.range);if(n(` core: ${f.version} ${u?"satisfies":"does not satisfy"} ${f.range}
|
|
226
|
+
`),!u)r++}}if(l.length===0)n(` \u2022 no plugins loaded
|
|
221
227
|
`);return n(`
|
|
222
|
-
`),r===0?0:1}}}import{existsSync as
|
|
223
|
-
`),1;let r=n??i??t.positionals[0]??"",o=await xr(r,{cwd:s.cwd,hapiHome:s.hapiHome});if(!o){let
|
|
224
|
-
`),1;return
|
|
225
|
-
`),1;if(l.length===0){let
|
|
228
|
+
`),r===0?0:1}}}import{existsSync as um}from"fs";import{posix as fm,win32 as pm}from"path";import{fileURLToPath as dm,pathToFileURL as hm}from"url";var Oh=Bs(),Ph=_e(),Lh=Cs(),Qs=De(),Eh=ke(),Q=A(),qh=H(),Ih=P(),$h=W(),Th=z(),Ey=$t(),Mh=Ws(),xh=zs(),_h=Gs(),_t=Tr(),Mr=Se();var Dh=Oh.Composer,Rh=Ph.Document,Bh=Lh.Schema,{YAMLError:jh,YAMLParseError:Kh,YAMLWarning:Fh}=Qs,Uh=Eh.Alias,{isAlias:Yh,isCollection:Vh,isDocument:Hh,isMap:Jh,isNode:Wh,isPair:zh,isScalar:Gh,isSeq:Qh}=Q,Xh=qh.Pair,Zh=Ih.Scalar,em=$h.YAMLMap,tm=Th.YAMLSeq;var sm=Mh.Lexer,nm=xh.LineCounter,im=_h.Parser,{parse:Xs,parseAllDocuments:rm,parseDocument:om,stringify:am}=_t,{visit:lm,visitAsync:cm}=Mr;import{DEFAULT_DOCUMENT_SOURCE_POLICY as Dt,assertRemoteDocumentUrl as mm,redactDocumentUrl as gm}from"@mcp-com-ai/plugin-sdk";async function xr(e,t){let s=e.trim();if(!s)return;Br(s);let n=vm(s);if(n?.protocol==="http:"||n?.protocol==="https:")return wm(s,n,t);if(n&&n.protocol!=="file:"&&n.protocol!=="path:")throw Error(`Unsupported document source scheme: ${n.protocol}`);let i=n?.protocol==="file:"?Cm(n):ym(n?.protocol==="path:"?km(n):s,t);if(!i)return;return bm(s,i,t.maxBytes??Dt.maxBytes)}function ym(e,t){return Am(e,t.cwd,t.hapiHome,um)}async function bm(e,t,s){let n=Bun.file(t);if(n.size>s)throw Error(`Document source exceeds ${s} bytes: ${t}`);let i=await n.text();Dr(i,s,t);let r=Nm(t);return Rr({identifier:e,canonicalUri:r,baseUri:new URL(".",r).href,raw:i,document:_r(i,t),remote:!1})}async function wm(e,t,s){let n=s.fetchImpl??fetch,i=s.maxBytes??Dt.maxBytes,r=new AbortController,o=setTimeout(()=>r.abort(),s.timeoutMs??Dt.timeoutMs),a=t;try{for(let l=0;l<=Dt.maxRedirects;l++){mm(a);let c=await n(a,{redirect:"manual",signal:r.signal});if(Sm(c.status)){let p=c.headers.get("location");if(!p)throw Error(`Redirect from ${re(a)} has no Location header`);a=new URL(p,a);continue}if(!c.ok)throw Error(`Unable to load ${re(a)}: HTTP ${c.status}`);let f=Number(c.headers.get("content-length"));if(Number.isFinite(f)&&f>i)throw Error(`Document source exceeds ${i} bytes: ${re(a)}`);let u=await c.text();return Dr(u,i,re(a)),Rr({identifier:e,canonicalUri:a.href,baseUri:new URL(".",a).href,raw:u,document:_r(u,re(a)),remote:!0})}throw Error(`Too many redirects while loading ${re(t)}`)}catch(l){if(r.signal.aborted)throw Error(`Timed out loading ${re(a)}`);throw l}finally{clearTimeout(o)}}function _r(e,t){try{let s=Xs(e);if(!s||typeof s!=="object"||Array.isArray(s))throw Error("document root must be an object");return s}catch(s){throw Error(`Unable to parse ${t}: ${s instanceof Error?s.message:String(s)}`)}}function Dr(e,t,s){if(new TextEncoder().encode(e).byteLength>t)throw Error(`Document source exceeds ${t} bytes: ${s}`)}function Rr(e){return Object.freeze(e)}function Sm(e){return[301,302,303,307,308].includes(e)}function vm(e){if(Zs(e))return;try{return new URL(e)}catch{return}}function km(e){let t=decodeURIComponent(e.pathname);if(/^\/[A-Za-z]:\//.test(t))return t.slice(1).replaceAll("/","\\");if(/^[A-Za-z]$/.test(e.hostname))return`${e.hostname.toUpperCase()}:${t}`.replaceAll("/","\\");if(e.hostname)return`\\\\${e.hostname}${t.replaceAll("/","\\")}`;return t}function Cm(e){return dm(e,{windows:Pm(e)})}function Nm(e){return hm(e,{windows:Zs(e)}).href}function Am(e,t,s,n){Br(e);let i=Om(e,t,s),r=i.resolve(t,e);if(n(r))return r;let o=i.resolve(s,"specs");for(let a of["",".json",".yaml",".yml"]){let l=i.resolve(o,`${e}${a}`);if(n(l))return l}return}function Om(...e){return e.some((t)=>Zs(t))?pm:fm}function Zs(e){return/^[A-Za-z]:[\\/]/.test(e)||/^\\\\/.test(e)}function Pm(e){return e.hostname.length>0||/^\/[A-Za-z]:\//.test(e.pathname)}function Br(e){if(/^[A-Za-z]:[^\\/]/.test(e))throw Error(`Windows drive-relative document sources are ambiguous: ${e}. Use an absolute drive path or a path relative to the current directory.`)}function re(e){return gm(e)}function Kr(e){let t=()=>e().flatMap((s)=>s.plugin.serveProviders??[]);return{name:"serve",description:"Serve an OpenAPI or Arazzo document with the matching installed plugin",arguments:[{name:"source",description:"Project name, local JSON/YAML file, or remote document URL",required:!1}],get options(){return Em(t())},get longHelp(){return t().find((s)=>s.longHelp)?.longHelp},async run(s,n){return Lm(t(),s,n)}}}async function Lm(e,t,s){let n=typeof t.options.specs==="string"?t.options.specs:void 0,i=typeof t.options.openapi==="string"?t.options.openapi:void 0;if(n&&i)return s.stderr.write(`Use either --specs or --openapi, not both.
|
|
229
|
+
`),1;let r=n??i??t.positionals[0]??"",o=await xr(r,{cwd:s.cwd,hapiHome:s.hapiHome});if(!o){let f=e.filter((u)=>u.legacyFallback);if(f.length!==1)return s.stderr.write(`Unable to resolve document source: ${r||"(missing)"}
|
|
230
|
+
`),1;return jr(await f[0].serve({source:o,invocation:t},s))}let a=o.document,l=e.filter((f)=>typeof a[f.rootField]==="string");if(l.length>1)return s.stderr.write(`Ambiguous document ${o.identifier}: multiple root fields matched (${l.map((f)=>f.rootField).join(", ")})
|
|
231
|
+
`),1;if(l.length===0){let f=Object.keys(a).map((u)=>mn(u)).find(Boolean);if(f)return s.stderr.write(`Document type requires ${f.packageName}, which is not installed.
|
|
226
232
|
`),s.stderr.write(`Install it with:
|
|
227
|
-
${
|
|
233
|
+
${f.installHint??`bun add -g ${f.packageName}`}
|
|
228
234
|
`),127;return s.stderr.write(`Unknown document type: expected one root version field such as "openapi" or "arazzo".
|
|
229
235
|
`),1}let c=l[0];if(i&&c.kind!=="openapi")return s.stderr.write(`Expected an OpenAPI document from --openapi, received ${c.kind}.
|
|
230
|
-
`),1;return
|
|
231
|
-
`)}
|
|
236
|
+
`),1;return jr(await c.serve({source:o,invocation:t},s))}function Em(e){let t=new Map;for(let s of e)for(let n of s.options??[]){let i=t.get(n.name);if(i&&(i.type!==n.type||i.alias!==n.alias))throw Error(`Incompatible --${n.name} declarations from serve providers`);if(!i)t.set(n.name,n)}return[...t.values()]}function jr(e){return typeof e==="number"?e:Number(process.exitCode??0)}function Fr(e){return[bn(e.getRegistry),Sn,Kr(e.getLoaded),Cn(e.getLoaded),An(e.getLoaded)]}async function Xy(e){let t=e.stdout??process.stdout,s=e.stderr??process.stderr,n=e.stdin??process.stdin,i=e.env??process.env,r=e.cwd??process.cwd(),o=e.silent??!1,a,l;try{a=Tm(e.argv,i),l=await Mm(a.selector,a.profile,r)}catch(g){return s.write(`\u274C ${g instanceof Error?g.message:String(g)}
|
|
237
|
+
`),1}let c=(g)=>{if(!o)s.write(`warn: ${g}
|
|
238
|
+
`)},f=await $m().catch(()=>({plugins:void 0,pluginsDisabled:void 0})),u=await dn({bundledPlugins:e.bundledPlugins,workspacePackages:e.workspacePackages,configuredPackages:Array.isArray(f.plugins)?f.plugins:void 0,workspaceRequirements:[...l?.plugins.required.map((g)=>g.name)??[],...l?.plugins.optional.map((g)=>g.name)??[]],blocklist:[...Array.isArray(f.pluginsDisabled)?f.pluginsDisabled:[],...e.pluginsDisabled??[]],warn:c});if(l){let g=[...l.plugins.required];if(l.profileSettings?.capabilityClassifier==="typesafe"){let v=l.plugins.optional.find((k)=>k.name==="@mcp-com-ai/enterprise-plugin-capability-classifier");g.push(v??{name:"@mcp-com-ai/enterprise-plugin-capability-classifier",version:"(declare a compatible version in plugins.optional)"})}let w=g.find((v)=>{let k=u.find((C)=>C.packageName===v.name);return!k||!qm(k.plugin.version,v.version)});if(w)return s.write(`\u274C Workspace ${l.descriptor} profile ${l.profile??"(default)"} requires ${w.name} ${w.version}, but a compatible global managed plugin is not available. Install it with: hapi plugins install <release-or-package>
|
|
239
|
+
`),1}let p=new Map,d=Fr({getRegistry:()=>p,getLoaded:()=>u});p=tn(d,u,{warn:c});let h={cwd:r,env:i,stdout:t,stderr:s,stdin:n,rawArgv:a.argv,hapiHome:Im,workspace:l,services:new Map};for(let{plugin:g}of u)if(typeof g.onLoad==="function")try{await g.onLoad(h)}catch(w){c(`Plugin '${g.name}' onLoad failed: ${w instanceof Error?w.message:String(w)}`)}try{return await yn(p,a.argv,h)}catch(g){return xm.error(g),1}}export{tn as buildCommandRegistry,dn as loadInstalledPlugins,Xy as runCli,yn as runCommand};
|