@mcp-com-ai/hapi 1.0.1-beta.260912

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
package/dist/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
package/dist/bin.js ADDED
@@ -0,0 +1,221 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ var T=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var X0=import.meta.require;var M=T((a2)=>{var g$=Symbol.for("yaml.alias"),L1=Symbol.for("yaml.document"),p0=Symbol.for("yaml.map"),Z1=Symbol.for("yaml.pair"),u$=Symbol.for("yaml.scalar"),d0=Symbol.for("yaml.seq"),k=Symbol.for("yaml.node.type"),k2=($)=>!!$&&typeof $==="object"&&$[k]===g$,x2=($)=>!!$&&typeof $==="object"&&$[k]===L1,v2=($)=>!!$&&typeof $==="object"&&$[k]===p0,m2=($)=>!!$&&typeof $==="object"&&$[k]===Z1,R1=($)=>!!$&&typeof $==="object"&&$[k]===u$,p2=($)=>!!$&&typeof $==="object"&&$[k]===d0;function G1($){if($&&typeof $==="object")switch($[k]){case p0:case d0:return!0}return!1}function d2($){if($&&typeof $==="object")switch($[k]){case g$:case p0:case u$:case d0:return!0}return!1}var l2=($)=>(R1($)||G1($))&&!!$.anchor;a2.ALIAS=g$;a2.DOC=L1;a2.MAP=p0;a2.NODE_TYPE=k;a2.PAIR=Z1;a2.SCALAR=u$;a2.SEQ=d0;a2.hasAnchor=l2;a2.isAlias=k2;a2.isCollection=G1;a2.isDocument=x2;a2.isMap=v2;a2.isNode=d2;a2.isPair=m2;a2.isScalar=R1;a2.isSeq=p2});var P0=T((RH)=>{var C=M(),j=Symbol("break visit"),J1=Symbol("skip children"),y=Symbol("remove node");function l0($,q){let U=I1(q);if(C.isDocument($)){if(L0(null,$.contents,U,Object.freeze([$]))===y)$.contents=null}else L0(null,$,U,Object.freeze([]))}l0.BREAK=j;l0.SKIP=J1;l0.REMOVE=y;function L0($,q,U,H){let z=Q1($,q,U,H);if(C.isNode(z)||C.isPair(z))return B1($,H,z),L0($,z,U,H);if(typeof z!=="symbol"){if(C.isCollection(q)){H=Object.freeze(H.concat(q));for(let X=0;X<q.items.length;++X){let L=L0(X,q.items[X],U,H);if(typeof L==="number")X=L-1;else if(L===j)return j;else if(L===y)q.items.splice(X,1),X-=1}}else if(C.isPair(q)){H=Object.freeze(H.concat(q));let X=L0("key",q.key,U,H);if(X===j)return j;else if(X===y)q.key=null;let L=L0("value",q.value,U,H);if(L===j)return j;else if(L===y)q.value=null}}return z}async function a0($,q){let U=I1(q);if(C.isDocument($)){if(await Z0(null,$.contents,U,Object.freeze([$]))===y)$.contents=null}else await Z0(null,$,U,Object.freeze([]))}a0.BREAK=j;a0.SKIP=J1;a0.REMOVE=y;async function Z0($,q,U,H){let z=await Q1($,q,U,H);if(C.isNode(z)||C.isPair(z))return B1($,H,z),Z0($,z,U,H);if(typeof z!=="symbol"){if(C.isCollection(q)){H=Object.freeze(H.concat(q));for(let X=0;X<q.items.length;++X){let L=await Z0(X,q.items[X],U,H);if(typeof L==="number")X=L-1;else if(L===j)return j;else if(L===y)q.items.splice(X,1),X-=1}}else if(C.isPair(q)){H=Object.freeze(H.concat(q));let X=await Z0("key",q.key,U,H);if(X===j)return j;else if(X===y)q.key=null;let L=await Z0("value",q.value,U,H);if(L===j)return j;else if(L===y)q.value=null}}return z}function I1($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function Q1($,q,U,H){if(typeof U==="function")return U($,q,H);if(C.isMap(q))return U.Map?.($,q,H);if(C.isSeq(q))return U.Seq?.($,q,H);if(C.isPair(q))return U.Pair?.($,q,H);if(C.isScalar(q))return U.Scalar?.($,q,H);if(C.isAlias(q))return U.Alias?.($,q,H);return}function B1($,q,U){let H=q[q.length-1];if(C.isCollection(H))H.items[$]=U;else if(C.isPair(H))if($==="key")H.key=U;else H.value=U;else if(C.isDocument(H))H.contents=U;else{let z=C.isAlias(H)?"alias":"scalar";throw Error(`Cannot replace node with ${z} parent`)}}RH.visit=l0;RH.visitAsync=a0});var y$=T((DH)=>{var D1=M(),IH=P0(),QH={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},BH=($)=>$.replace(/[!,[\]{}]/g,(q)=>QH[q]);class f{constructor($,q){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},f.defaultYaml,$),this.tags=Object.assign({},f.defaultTags,q)}clone(){let $=new f(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new f(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:f.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},f.defaultTags);break}return $}add($,q){if(this.atNextDocument)this.yaml={explicit:f.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},f.defaultTags),this.atNextDocument=!1;let U=$.trim().split(/[ \t]+/),H=U.shift();switch(H){case"%TAG":{if(U.length!==2){if(q(0,"%TAG directive should contain exactly two parts"),U.length<2)return!1}let[z,X]=U;return this.tags[z]=X,!0}case"%YAML":{if(this.yaml.explicit=!0,U.length!==1)return q(0,"%YAML directive should contain exactly one part"),!1;let[z]=U;if(z==="1.1"||z==="1.2")return this.yaml.version=z,!0;else{let X=/^\d+\.\d+$/.test(z);return q(6,`Unsupported YAML version ${z}`,X),!1}}default:return q(0,`Unknown directive ${H}`,!0),!1}}tagName($,q){if($==="!")return"!";if($[0]!=="!")return q(`Not a valid tag: ${$}`),null;if($[1]==="<"){let X=$.slice(2,-1);if(X==="!"||X==="!!")return q(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")q("Verbatim tags must end with a >");return X}let[,U,H]=$.match(/^(.*!)([^!]*)$/s);if(!H)q(`The ${$} tag has no suffix`);let z=this.tags[U];if(z)try{return z+decodeURIComponent(H)}catch(X){return q(String(X)),null}if(U==="!")return $;return q(`Could not resolve tag: ${$}`),null}tagString($){for(let[q,U]of Object.entries(this.tags))if($.startsWith(U))return q+BH($.substring(U.length));return $[0]==="!"?$:`!<${$}>`}toString($){let q=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],U=Object.entries(this.tags),H;if($&&U.length>0&&D1.isNode($.contents)){let z={};IH.visit($.contents,(X,L)=>{if(D1.isNode(L)&&L.tag)z[L.tag]=!0}),H=Object.keys(z)}else H=[];for(let[z,X]of U){if(z==="!!"&&X==="tag:yaml.org,2002:")continue;if(!$||H.some((L)=>L.startsWith(X)))q.push(`%TAG ${z} ${X}`)}return q.join(`
4
+ `)}}f.defaultYaml={explicit:!1,version:"1.2"};f.defaultTags={"!!":"tag:yaml.org,2002:"};DH.Directives=f});var s0=T((wH)=>{var O1=M(),TH=P0();function PH($){if(/[\x00-\x19\s,[\]{}]/.test($)){let U=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(U)}return!0}function T1($){let q=new Set;return TH.visit($,{Value(U,H){if(H.anchor)q.add(H.anchor)}}),q}function P1($,q){for(let U=1;;++U){let H=`${$}${U}`;if(!q.has(H))return H}}function YH($,q){let U=[],H=new Map,z=null;return{onAnchor:(X)=>{U.push(X),z??(z=T1($));let L=P1(q,z);return z.add(L),L},setAnchors:()=>{for(let X of U){let L=H.get(X);if(typeof L==="object"&&L.anchor&&(O1.isScalar(L.node)||O1.isCollection(L.node)))L.node.anchor=L.anchor;else{let Z=Error("Failed to resolve repeated object (this should not happen)");throw Z.source=X,Z}}},sourceObjects:H}}wH.anchorIsValid=PH;wH.anchorNames=T1;wH.createNodeAnchors=YH;wH.findNewAnchor=P1});var h$=T((AH)=>{function Y0($,q,U,H){if(H&&typeof H==="object")if(Array.isArray(H))for(let z=0,X=H.length;z<X;++z){let L=H[z],Z=Y0($,H,String(z),L);if(Z===void 0)delete H[z];else if(Z!==L)H[z]=Z}else if(H instanceof Map)for(let z of Array.from(H.keys())){let X=H.get(z),L=Y0($,H,z,X);if(L===void 0)H.delete(z);else if(L!==X)H.set(z,L)}else if(H instanceof Set)for(let z of Array.from(H)){let X=Y0($,H,z,z);if(X===void 0)H.delete(z);else if(X!==z)H.delete(z),H.add(X)}else for(let[z,X]of Object.entries(H)){let L=Y0($,H,z,X);if(L===void 0)delete H[z];else if(L!==X)H[z]=L}return $.call(q,U,H)}AH.applyReviver=Y0});var m=T((bH)=>{var KH=M();function Y1($,q,U){if(Array.isArray($))return $.map((H,z)=>Y1(H,String(z),U));if($&&typeof $.toJSON==="function"){if(!U||!KH.hasAnchor($))return $.toJSON(q,U);let H={aliasCount:0,count:1,res:void 0};U.anchors.set($,H),U.onCreate=(X)=>{H.res=X,delete U.onCreate};let z=$.toJSON(q,U);if(U.onCreate)U.onCreate(z);return z}if(typeof $==="bigint"&&!U?.keep)return Number($);return $}bH.toJS=Y1});var i0=T((jH)=>{var SH=h$(),w1=M(),CH=m();class _1{constructor($){Object.defineProperty(this,w1.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:q,maxAliasCount:U,onAnchor:H,reviver:z}={}){if(!w1.isDocument($))throw TypeError("A document argument is required");let X={anchors:new Map,doc:$,keep:!0,mapAsMap:q===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},L=CH.toJS(this,"",X);if(typeof H==="function")for(let{count:Z,res:R}of X.anchors.values())H(R,Z);return typeof z==="function"?SH.applyReviver(z,{"":L},"",L):L}}jH.NodeBase=_1});var w0=T((hH)=>{var EH=s0(),gH=P0(),R0=M(),uH=i0(),yH=m();class V1 extends uH.NodeBase{constructor($){super(R0.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,q){if(q?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let U;if(q?.aliasResolveCache)U=q.aliasResolveCache;else if(U=[],gH.visit($,{Node:(z,X)=>{if(R0.isAlias(X)||R0.hasAnchor(X))U.push(X)}}),q)q.aliasResolveCache=U;let H=void 0;for(let z of U){if(z===this)break;if(z.anchor===this.source)H=z}return H}toJSON($,q){if(!q)return{source:this.source};let{anchors:U,doc:H,maxAliasCount:z}=q,X=this.resolve(H,q);if(!X){let Z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Z)}let L=U.get(X);if(!L)yH.toJS(X,null,q),L=U.get(X);if(L?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(z>=0){if(L.count+=1,L.aliasCount===0)L.aliasCount=c0(H,X,U);if(L.count*L.aliasCount>z)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return L.res}toString($,q,U){let H=`*${this.source}`;if($){if(EH.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(z)}if($.implicitKey)return`${H} `}return H}}function c0($,q,U){if(R0.isAlias(q)){let H=q.resolve($),z=U&&H&&U.get(H);return z?z.count*z.aliasCount:0}else if(R0.isCollection(q)){let H=0;for(let z of q.items){let X=c0($,z,U);if(X>H)H=X}return H}else if(R0.isPair(q)){let H=c0($,q.key,U),z=c0($,q.value,U);return Math.max(H,z)}return 1}hH.Alias=V1});var b=T((dH)=>{var xH=M(),vH=i0(),mH=m(),pH=($)=>!$||typeof $!=="function"&&typeof $!=="object";class n extends vH.NodeBase{constructor($){super(xH.SCALAR);this.value=$}toJSON($,q){return q?.keep?this.value:mH.toJS(this.value,$,q)}toString(){return String(this.value)}}n.BLOCK_FOLDED="BLOCK_FOLDED";n.BLOCK_LITERAL="BLOCK_LITERAL";n.PLAIN="PLAIN";n.QUOTE_DOUBLE="QUOTE_DOUBLE";n.QUOTE_SINGLE="QUOTE_SINGLE";dH.Scalar=n;dH.isScalarValue=pH});var _0=T((nH)=>{var sH=w0(),o=M(),W1=b(),iH="tag:yaml.org,2002:";function cH($,q,U){if(q){let H=U.filter((X)=>X.tag===q),z=H.find((X)=>!X.format)??H[0];if(!z)throw Error(`Tag ${q} not found`);return z}return U.find((H)=>H.identify?.($)&&!H.format)}function rH($,q,U){if(o.isDocument($))$=$.contents;if(o.isNode($))return $;if(o.isPair($)){let J=U.schema[o.MAP].createNode?.(U.schema,null,U);return J.items.push($),J}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:H,onAnchor:z,onTagObj:X,schema:L,sourceObjects:Z}=U,R=void 0;if(H&&$&&typeof $==="object")if(R=Z.get($),R)return R.anchor??(R.anchor=z($)),new sH.Alias(R.anchor);else R={anchor:null,node:null},Z.set($,R);if(q?.startsWith("!!"))q=iH+q.slice(2);let G=cH($,q,L.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let J=new W1.Scalar($);if(R)R.node=J;return J}G=$ instanceof Map?L[o.MAP]:(Symbol.iterator in Object($))?L[o.SEQ]:L[o.MAP]}if(X)X(G),delete U.onTagObj;let I=G?.createNode?G.createNode(U.schema,$,U):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(U.schema,$,U):new W1.Scalar($);if(q)I.tag=q;else if(!G.default)I.tag=G.tag;if(R)R.node=I;return I}nH.createNode=rH});var r0=T(($9)=>{var tH=_0(),h=M(),eH=i0();function k$($,q,U){let H=U;for(let z=q.length-1;z>=0;--z){let X=q[z];if(typeof X==="number"&&Number.isInteger(X)&&X>=0){let L=[];L[X]=H,H=L}else H=new Map([[X,H]])}return tH.createNode(H,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var F1=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class A1 extends eH.NodeBase{constructor($,q){super($);Object.defineProperty(this,"schema",{value:q,configurable:!0,enumerable:!1,writable:!0})}clone($){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)q.schema=$;if(q.items=q.items.map((U)=>h.isNode(U)||h.isPair(U)?U.clone($):U),this.range)q.range=this.range.slice();return q}addIn($,q){if(F1($))this.add(q);else{let[U,...H]=$,z=this.get(U,!0);if(h.isCollection(z))z.addIn(H,q);else if(z===void 0&&this.schema)this.set(U,k$(this.schema,H,q));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}}deleteIn($){let[q,...U]=$;if(U.length===0)return this.delete(q);let H=this.get(q,!0);if(h.isCollection(H))return H.deleteIn(U);else throw Error(`Expected YAML collection at ${q}. Remaining path: ${U}`)}getIn($,q){let[U,...H]=$,z=this.get(U,!0);if(H.length===0)return!q&&h.isScalar(z)?z.value:z;else return h.isCollection(z)?z.getIn(H,q):void 0}hasAllNullValues($){return this.items.every((q)=>{if(!h.isPair(q))return!1;let U=q.value;return U==null||$&&h.isScalar(U)&&U.value==null&&!U.commentBefore&&!U.comment&&!U.tag})}hasIn($){let[q,...U]=$;if(U.length===0)return this.has(q);let H=this.get(q,!0);return h.isCollection(H)?H.hasIn(U):!1}setIn($,q){let[U,...H]=$;if(H.length===0)this.set(U,q);else{let z=this.get(U,!0);if(h.isCollection(z))z.setIn(H,q);else if(z===void 0&&this.schema)this.set(U,k$(this.schema,H,q));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}}}$9.Collection=A1;$9.collectionFromPath=k$;$9.isEmptyPath=F1});var V0=T((L9)=>{var z9=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function x$($,q){if(/^\n+$/.test($))return $.substring(1);return q?$.replace(/^(?! *$)/gm,q):$}var X9=($,q,U)=>$.endsWith(`
5
+ `)?x$(U,q):U.includes(`
6
+ `)?`
7
+ `+x$(U,q):($.endsWith(" ")?"":" ")+U;L9.indentComment=x$;L9.lineComment=X9;L9.stringifyComment=z9});var K1=T((I9)=>{function J9($,q,U="flow",{indentAtStart:H,lineWidth:z=80,minContentWidth:X=20,onFold:L,onOverflow:Z}={}){if(!z||z<0)return $;if(z<X)X=0;let R=Math.max(1+X,1+z-q.length);if($.length<=R)return $;let G=[],I={},J=z-q.length;if(typeof H==="number")if(H>z-Math.max(2,X))G.push(0);else J=z-H;let Q=void 0,O=void 0,P=!1,B=-1,D=-1,w=-1;if(U==="block"){if(B=M1($,B,q.length),B!==-1)J=B+R}for(let V;V=$[B+=1];){if(U==="quoted"&&V==="\\"){switch(D=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}w=B}if(V===`
8
+ `){if(U==="block")B=M1($,B,q.length);J=B+q.length+R,Q=void 0}else{if(V===" "&&O&&O!==" "&&O!==`
9
+ `&&O!=="\t"){let W=$[B+1];if(W&&W!==" "&&W!==`
10
+ `&&W!=="\t")Q=B}if(B>=J)if(Q)G.push(Q),J=Q+R,Q=void 0;else if(U==="quoted"){while(O===" "||O==="\t")O=V,V=$[B+=1],P=!0;let W=B>w+1?B-2:D-1;if(I[W])return $;G.push(W),I[W]=!0,J=W+R,Q=void 0}else P=!0}O=V}if(P&&Z)Z();if(G.length===0)return $;if(L)L();let _=$.slice(0,G[0]);for(let V=0;V<G.length;++V){let W=G[V],F=G[V+1]||$.length;if(W===0)_=`
11
+ ${q}${$.slice(0,F)}`;else{if(U==="quoted"&&I[W])_+=`${$[W]}\\`;_+=`
12
+ ${q}${$.slice(W+1,F)}`}}return _}function M1($,q,U){let H=q,z=q+1,X=$[z];while(X===" "||X==="\t")if(q<z+U)X=$[++q];else{do X=$[++q];while(X&&X!==`
13
+ `);H=q,z=q+1,X=$[z]}return H}I9.FOLD_BLOCK="block";I9.FOLD_FLOW="flow";I9.FOLD_QUOTED="quoted";I9.foldFlowLines=J9});var F0=T((w9)=>{var g=b(),p=K1(),o0=($,q)=>({indentAtStart:q?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),t0=($)=>/^(%|---|\.\.\.)/m.test($);function T9($,q,U){if(!q||q<0)return!1;let H=q-U,z=$.length;if(z<=H)return!1;for(let X=0,L=0;X<z;++X)if($[X]===`
14
+ `){if(X-L>H)return!0;if(L=X+1,z-L<=H)return!1}return!0}function W0($,q){let U=JSON.stringify($);if(q.options.doubleQuotedAsJSON)return U;let{implicitKey:H}=q,z=q.options.doubleQuotedMinMultiLineLength,X=q.indent||(t0($)?" ":""),L="",Z=0;for(let R=0,G=U[R];G;G=U[++R]){if(G===" "&&U[R+1]==="\\"&&U[R+2]==="n")L+=U.slice(Z,R)+"\\ ",R+=1,Z=R,G="\\";if(G==="\\")switch(U[R+1]){case"u":{L+=U.slice(Z,R);let I=U.substr(R+2,4);switch(I){case"0000":L+="\\0";break;case"0007":L+="\\a";break;case"000b":L+="\\v";break;case"001b":L+="\\e";break;case"0085":L+="\\N";break;case"00a0":L+="\\_";break;case"2028":L+="\\L";break;case"2029":L+="\\P";break;default:if(I.substr(0,2)==="00")L+="\\x"+I.substr(2);else L+=U.substr(R,6)}R+=5,Z=R+1}break;case"n":if(H||U[R+2]==='"'||U.length<z)R+=1;else{L+=U.slice(Z,R)+`
15
+
16
+ `;while(U[R+2]==="\\"&&U[R+3]==="n"&&U[R+4]!=='"')L+=`
17
+ `,R+=2;if(L+=X,U[R+2]===" ")L+="\\";R+=1,Z=R+1}break;default:R+=1}}return L=Z?L+U.slice(Z):U,H?L:p.foldFlowLines(L,X,p.FOLD_QUOTED,o0(q,!1))}function v$($,q){if(q.options.singleQuote===!1||q.implicitKey&&$.includes(`
18
+ `)||/[ \t]\n|\n[ \t]/.test($))return W0($,q);let U=q.indent||(t0($)?" ":""),H="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
19
+ ${U}`)+"'";return q.implicitKey?H:p.foldFlowLines(H,U,p.FOLD_FLOW,o0(q,!1))}function G0($,q){let{singleQuote:U}=q.options,H;if(U===!1)H=W0;else{let z=$.includes('"'),X=$.includes("'");if(z&&!X)H=v$;else if(X&&!z)H=W0;else H=U?v$:W0}return H($,q)}var m$;try{m$=new RegExp(`(^|(?<!
20
+ ))
21
+ +(?!
22
+ |$)`,"g")}catch{m$=/\n+(?!\n|$)/g}function n0({comment:$,type:q,value:U},H,z,X){let{blockQuote:L,commentString:Z,lineWidth:R}=H.options;if(!L||/\n[\t ]+$/.test(U))return G0(U,H);let G=H.indent||(H.forceBlockIndent||t0(U)?" ":""),I=L==="literal"?!0:L==="folded"||q===g.Scalar.BLOCK_FOLDED?!1:q===g.Scalar.BLOCK_LITERAL?!0:!T9(U,R,G.length);if(!U)return I?`|
23
+ `:`>
24
+ `;let J,Q;for(Q=U.length;Q>0;--Q){let F=U[Q-1];if(F!==`
25
+ `&&F!=="\t"&&F!==" ")break}let O=U.substring(Q),P=O.indexOf(`
26
+ `);if(P===-1)J="-";else if(U===O||P!==O.length-1){if(J="+",X)X()}else J="";if(O){if(U=U.slice(0,-O.length),O[O.length-1]===`
27
+ `)O=O.slice(0,-1);O=O.replace(m$,`$&${G}`)}let B=!1,D,w=-1;for(D=0;D<U.length;++D){let F=U[D];if(F===" ")B=!0;else if(F===`
28
+ `)w=D;else break}let _=U.substring(0,w<D?w+1:D);if(_)U=U.substring(_.length),_=_.replace(/\n+/g,`$&${G}`);let W=(B?G?"2":"1":"")+J;if($){if(W+=" "+Z($.replace(/ ?[\r\n]+/g," ")),z)z()}if(!I){let F=U.replace(/\n+/g,`
29
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),A=!1,K=o0(H,!0);if(L!=="folded"&&q!==g.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{A=!0};let Y=p.foldFlowLines(`${_}${F}${O}`,G,p.FOLD_BLOCK,K);if(!A)return`>${W}
30
+ ${G}${Y}`}return U=U.replace(/\n+/g,`$&${G}`),`|${W}
31
+ ${G}${_}${U}${O}`}function P9($,q,U,H){let{type:z,value:X}=$,{actualString:L,implicitKey:Z,indent:R,indentStep:G,inFlow:I}=q;if(Z&&X.includes(`
32
+ `)||I&&/[[\]{},]/.test(X))return G0(X,q);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(X))return Z||I||!X.includes(`
33
+ `)?G0(X,q):n0($,q,U,H);if(!Z&&!I&&z!==g.Scalar.PLAIN&&X.includes(`
34
+ `))return n0($,q,U,H);if(t0(X)){if(R==="")return q.forceBlockIndent=!0,n0($,q,U,H);else if(Z&&R===G)return G0(X,q)}let J=X.replace(/\n+/g,`$&
35
+ ${R}`);if(L){let Q=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(J),{compat:O,tags:P}=q.doc.schema;if(P.some(Q)||O?.some(Q))return G0(X,q)}return Z?J:p.foldFlowLines(J,R,p.FOLD_FLOW,o0(q,!1))}function Y9($,q,U,H){let{implicitKey:z,inFlow:X}=q,L=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:Z}=$;if(Z!==g.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(L.value))Z=g.Scalar.QUOTE_DOUBLE}let R=(I)=>{switch(I){case g.Scalar.BLOCK_FOLDED:case g.Scalar.BLOCK_LITERAL:return z||X?G0(L.value,q):n0(L,q,U,H);case g.Scalar.QUOTE_DOUBLE:return W0(L.value,q);case g.Scalar.QUOTE_SINGLE:return v$(L.value,q);case g.Scalar.PLAIN:return P9(L,q,U,H);default:return null}},G=R(Z);if(G===null){let{defaultKeyType:I,defaultStringType:J}=q.options,Q=z&&I||J;if(G=R(Q),G===null)throw Error(`Unsupported default string type ${Q}`)}return G}w9.stringifyString=Y9});var A0=T((N9)=>{var V9=s0(),d=M(),W9=V0(),F9=F0();function A9($,q){let U=Object.assign({blockQuote:!0,commentString:W9.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},$.schema.toStringOptions,q),H;switch(U.collectionStyle){case"block":H=!1;break;case"flow":H=!0;break;default:H=null}return{anchors:new Set,doc:$,flowCollectionPadding:U.flowCollectionPadding?" ":"",indent:"",indentStep:typeof U.indent==="number"?" ".repeat(U.indent):" ",inFlow:H,options:U}}function M9($,q){if(q.tag){let z=$.filter((X)=>X.tag===q.tag);if(z.length>0)return z.find((X)=>X.format===q.format)??z[0]}let U=void 0,H;if(d.isScalar(q)){H=q.value;let z=$.filter((X)=>X.identify?.(H));if(z.length>1){let X=z.filter((L)=>L.test);if(X.length>0)z=X}U=z.find((X)=>X.format===q.format)??z.find((X)=>!X.format)}else H=q,U=$.find((z)=>z.nodeClass&&H instanceof z.nodeClass);if(!U){let z=H?.constructor?.name??(H===null?"null":typeof H);throw Error(`Tag not resolved for ${z} value`)}return U}function K9($,q,{anchors:U,doc:H}){if(!H.directives)return"";let z=[],X=(d.isScalar($)||d.isCollection($))&&$.anchor;if(X&&V9.anchorIsValid(X))U.add(X),z.push(`&${X}`);let L=$.tag??(q.default?null:q.tag);if(L)z.push(H.directives.tagString(L));return z.join(" ")}function b9($,q,U,H){if(d.isPair($))return $.toString(q,U,H);if(d.isAlias($)){if(q.doc.directives)return $.toString(q);if(q.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(q.resolvedAliases)q.resolvedAliases.add($);else q.resolvedAliases=new Set([$]);$=$.resolve(q.doc)}}let z=void 0,X=d.isNode($)?$:q.doc.createNode($,{onTagObj:(R)=>z=R});z??(z=M9(q.doc.schema.tags,X));let L=K9(X,z,q);if(L.length>0)q.indentAtStart=(q.indentAtStart??0)+L.length+1;let Z=typeof z.stringify==="function"?z.stringify(X,q,U,H):d.isScalar(X)?F9.stringifyString(X,q,U,H):X.toString(q,U,H);if(!L)return Z;return d.isScalar(X)||Z[0]==="{"||Z[0]==="["?`${L} ${Z}`:`${L}
36
+ ${q.indent}${Z}`}N9.createStringifyContext=A9;N9.stringify=b9});var S1=T((f9)=>{var x=M(),b1=b(),N1=A0(),M0=V0();function j9({key:$,value:q},U,H,z){let{allNullValues:X,doc:L,indent:Z,indentStep:R,options:{commentString:G,indentSeq:I,simpleKeys:J}}=U,Q=x.isNode($)&&$.comment||null;if(J){if(Q)throw Error("With simple keys, key nodes cannot have comments");if(x.isCollection($)||!x.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let O=!J&&(!$||Q&&q==null&&!U.inFlow||x.isCollection($)||(x.isScalar($)?$.type===b1.Scalar.BLOCK_FOLDED||$.type===b1.Scalar.BLOCK_LITERAL:typeof $==="object"));U=Object.assign({},U,{allNullValues:!1,implicitKey:!O&&(J||!X),indent:Z+R});let P=!1,B=!1,D=N1.stringify($,U,()=>P=!0,()=>B=!0);if(!O&&!U.inFlow&&D.length>1024){if(J)throw Error("With simple keys, single line scalar must not span more than 1024 characters");O=!0}if(U.inFlow){if(X||q==null){if(P&&H)H();return D===""?"?":O?`? ${D}`:D}}else if(X&&!J||q==null&&O){if(D=`? ${D}`,Q&&!P)D+=M0.lineComment(D,U.indent,G(Q));else if(B&&z)z();return D}if(P)Q=null;if(O){if(Q)D+=M0.lineComment(D,U.indent,G(Q));D=`? ${D}
37
+ ${Z}:`}else if(D=`${D}:`,Q)D+=M0.lineComment(D,U.indent,G(Q));let w,_,V;if(x.isNode(q))w=!!q.spaceBefore,_=q.commentBefore,V=q.comment;else if(w=!1,_=null,V=null,q&&typeof q==="object")q=L.createNode(q);if(U.implicitKey=!1,!O&&!Q&&x.isScalar(q))U.indentAtStart=D.length+1;if(B=!1,!I&&R.length>=2&&!U.inFlow&&!O&&x.isSeq(q)&&!q.flow&&!q.tag&&!q.anchor)U.indent=U.indent.substring(2);let W=!1,F=N1.stringify(q,U,()=>W=!0,()=>B=!0),A=" ";if(Q||w||_){if(A=w?`
38
+ `:"",_){let K=G(_);A+=`
39
+ ${M0.indentComment(K,U.indent)}`}if(F===""&&!U.inFlow){if(A===`
40
+ `&&V)A=`
41
+
42
+ `}else A+=`
43
+ ${U.indent}`}else if(!O&&x.isCollection(q)){let K=F[0],Y=F.indexOf(`
44
+ `),N=Y!==-1,v=U.inFlow??q.flow??q.items.length===0;if(N||!v){let z0=!1;if(N&&(K==="&"||K==="!")){let S=F.indexOf(" ");if(K==="&"&&S!==-1&&S<Y&&F[S+1]==="!")S=F.indexOf(" ",S+1);if(S===-1||Y<S)z0=!0}if(!z0)A=`
45
+ ${U.indent}`}}else if(F===""||F[0]===`
46
+ `)A="";if(D+=A+F,U.inFlow){if(W&&H)H()}else if(V&&!W)D+=M0.lineComment(D,U.indent,G(V));else if(B&&z)z();return D}f9.stringifyPair=j9});var p$=T((y9)=>{var C1=X0("process");function g9($,...q){if($==="debug")console.log(...q)}function u9($,q){if($==="debug"||$==="warn")if(typeof C1.emitWarning==="function")C1.emitWarning(q);else console.warn(q)}y9.debug=g9;y9.warn=u9});var U$=T((v9)=>{var q$=M(),j1=b(),e0="<<",$$={identify:($)=>$===e0||typeof $==="symbol"&&$.description===e0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new j1.Scalar(Symbol(e0)),{addToJSMap:f1}),stringify:()=>e0},x9=($,q)=>($$.identify(q)||q$.isScalar(q)&&(!q.type||q.type===j1.Scalar.PLAIN)&&$$.identify(q.value))&&$?.doc.schema.tags.some((U)=>U.tag===$$.tag&&U.default);function f1($,q,U){let H=E1($,U);if(q$.isSeq(H))for(let z of H.items)d$($,q,z);else if(Array.isArray(H))for(let z of H)d$($,q,z);else d$($,q,H)}function d$($,q,U){let H=E1($,U);if(!q$.isMap(H))throw Error("Merge sources must be maps or map aliases");let z=H.toJSON(null,$,Map);for(let[X,L]of z)if(q instanceof Map){if(!q.has(X))q.set(X,L)}else if(q instanceof Set)q.add(X);else if(!Object.prototype.hasOwnProperty.call(q,X))Object.defineProperty(q,X,{value:L,writable:!0,enumerable:!0,configurable:!0});return q}function E1($,q){return $&&q$.isAlias(q)?q.resolve($.doc,$):q}v9.addMergeToJSMap=f1;v9.isMergeKey=x9;v9.merge=$$});var a$=T((c9)=>{var l9=p$(),g1=U$(),a9=A0(),u1=M(),l$=m();function s9($,q,{key:U,value:H}){if(u1.isNode(U)&&U.addToJSMap)U.addToJSMap($,q,H);else if(g1.isMergeKey($,U))g1.addMergeToJSMap($,q,H);else{let z=l$.toJS(U,"",$);if(q instanceof Map)q.set(z,l$.toJS(H,z,$));else if(q instanceof Set)q.add(z);else{let X=i9(U,z,$),L=l$.toJS(H,X,$);if(X in q)Object.defineProperty(q,X,{value:L,writable:!0,enumerable:!0,configurable:!0});else q[X]=L}}return q}function i9($,q,U){if(q===null)return"";if(typeof q!=="object")return String(q);if(u1.isNode($)&&U?.doc){let H=a9.createStringifyContext(U.doc,{});H.anchors=new Set;for(let X of U.anchors.keys())H.anchors.add(X.anchor);H.inFlow=!0,H.inStringifyKey=!0;let z=$.toString(H);if(!U.mapKeyWarned){let X=JSON.stringify(z);if(X.length>40)X=X.substring(0,36)+'..."';l9.warn(U.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${X}. Set mapAsMap: true to use object keys.`),U.mapKeyWarned=!0}return z}return JSON.stringify(q)}c9.addPairToJSMap=s9});var l=T((e9)=>{var y1=_0(),n9=S1(),o9=a$(),H$=M();function t9($,q,U){let H=y1.createNode($,void 0,U),z=y1.createNode(q,void 0,U);return new z$(H,z)}class z${constructor($,q=null){Object.defineProperty(this,H$.NODE_TYPE,{value:H$.PAIR}),this.key=$,this.value=q}clone($){let{key:q,value:U}=this;if(H$.isNode(q))q=q.clone($);if(H$.isNode(U))U=U.clone($);return new z$(q,U)}toJSON($,q){let U=q?.mapAsMap?new Map:{};return o9.addPairToJSMap(q,U,this)}toString($,q,U){return $?.doc?n9.stringifyPair(this,$,q,U):JSON.stringify(this)}}e9.Pair=z$;e9.createPair=t9});var s$=T((Xz)=>{var t=M(),h1=A0(),X$=V0();function Uz($,q,U){return(q.inFlow??$.flow?zz:Hz)($,q,U)}function Hz({comment:$,items:q},U,{blockItemPrefix:H,flowChars:z,itemIndent:X,onChompKeep:L,onComment:Z}){let{indent:R,options:{commentString:G}}=U,I=Object.assign({},U,{indent:X,type:null}),J=!1,Q=[];for(let P=0;P<q.length;++P){let B=q[P],D=null;if(t.isNode(B)){if(!J&&B.spaceBefore)Q.push("");if(L$(U,Q,B.commentBefore,J),B.comment)D=B.comment}else if(t.isPair(B)){let _=t.isNode(B.key)?B.key:null;if(_){if(!J&&_.spaceBefore)Q.push("");L$(U,Q,_.commentBefore,J)}}J=!1;let w=h1.stringify(B,I,()=>D=null,()=>J=!0);if(D)w+=X$.lineComment(w,X,G(D));if(J&&D)J=!1;Q.push(H+w)}let O;if(Q.length===0)O=z.start+z.end;else{O=Q[0];for(let P=1;P<Q.length;++P){let B=Q[P];O+=B?`
47
+ ${R}${B}`:`
48
+ `}}if($){if(O+=`
49
+ `+X$.indentComment(G($),R),Z)Z()}else if(J&&L)L();return O}function zz({items:$},q,{flowChars:U,itemIndent:H}){let{indent:z,indentStep:X,flowCollectionPadding:L,options:{commentString:Z}}=q;H+=X;let R=Object.assign({},q,{indent:H,inFlow:!0,type:null}),G=!1,I=0,J=[];for(let P=0;P<$.length;++P){let B=$[P],D=null;if(t.isNode(B)){if(B.spaceBefore)J.push("");if(L$(q,J,B.commentBefore,!1),B.comment)D=B.comment}else if(t.isPair(B)){let _=t.isNode(B.key)?B.key:null;if(_){if(_.spaceBefore)J.push("");if(L$(q,J,_.commentBefore,!1),_.comment)G=!0}let V=t.isNode(B.value)?B.value:null;if(V){if(V.comment)D=V.comment;if(V.commentBefore)G=!0}else if(B.value==null&&_?.comment)D=_.comment}if(D)G=!0;let w=h1.stringify(B,R,()=>D=null);if(G||(G=J.length>I||w.includes(`
50
+ `)),P<$.length-1)w+=",";else if(q.options.trailingComma){if(q.options.lineWidth>0)G||(G=J.reduce((_,V)=>_+V.length+2,2)+(w.length+2)>q.options.lineWidth);if(G)w+=","}if(D)w+=X$.lineComment(w,H,Z(D));J.push(w),I=J.length}let{start:Q,end:O}=U;if(J.length===0)return Q+O;else{if(!G){let P=J.reduce((B,D)=>B+D.length+2,2);G=q.options.lineWidth>0&&P>q.options.lineWidth}if(G){let P=Q;for(let B of J)P+=B?`
51
+ ${X}${z}${B}`:`
52
+ `;return`${P}
53
+ ${z}${O}`}else return`${Q}${L}${J.join(" ")}${L}${O}`}}function L$({indent:$,options:{commentString:q}},U,H,z){if(H&&z)H=H.replace(/^\n+/,"");if(H){let X=X$.indentComment(q(H),$);U.push(X.trimStart())}}Xz.stringifyCollection=Uz});var s=T((Iz)=>{var Zz=s$(),Rz=a$(),Gz=r0(),a=M(),Z$=l(),Jz=b();function K0($,q){let U=a.isScalar(q)?q.value:q;for(let H of $)if(a.isPair(H)){if(H.key===q||H.key===U)return H;if(a.isScalar(H.key)&&H.key.value===U)return H}return}class k1 extends Gz.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(a.MAP,$);this.items=[]}static from($,q,U){let{keepUndefined:H,replacer:z}=U,X=new this($),L=(Z,R)=>{if(typeof z==="function")R=z.call(q,Z,R);else if(Array.isArray(z)&&!z.includes(Z))return;if(R!==void 0||H)X.items.push(Z$.createPair(Z,R,U))};if(q instanceof Map)for(let[Z,R]of q)L(Z,R);else if(q&&typeof q==="object")for(let Z of Object.keys(q))L(Z,q[Z]);if(typeof $.sortMapEntries==="function")X.items.sort($.sortMapEntries);return X}add($,q){let U;if(a.isPair($))U=$;else if(!$||typeof $!=="object"||!("key"in $))U=new Z$.Pair($,$?.value);else U=new Z$.Pair($.key,$.value);let H=K0(this.items,U.key),z=this.schema?.sortMapEntries;if(H){if(!q)throw Error(`Key ${U.key} already set`);if(a.isScalar(H.value)&&Jz.isScalarValue(U.value))H.value.value=U.value;else H.value=U.value}else if(z){let X=this.items.findIndex((L)=>z(U,L)<0);if(X===-1)this.items.push(U);else this.items.splice(X,0,U)}else this.items.push(U)}delete($){let q=K0(this.items,$);if(!q)return!1;return this.items.splice(this.items.indexOf(q),1).length>0}get($,q){let H=K0(this.items,$)?.value;return(!q&&a.isScalar(H)?H.value:H)??void 0}has($){return!!K0(this.items,$)}set($,q){this.add(new Z$.Pair($,q),!0)}toJSON($,q,U){let H=U?new U:q?.mapAsMap?new Map:{};if(q?.onCreate)q.onCreate(H);for(let z of this.items)Rz.addPairToJSMap(q,H,z);return H}toString($,q,U){if(!$)return JSON.stringify(this);for(let H of this.items)if(!a.isPair(H))throw Error(`Map items must all be pairs; found ${JSON.stringify(H)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return Zz.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:U,onComment:q})}}Iz.YAMLMap=k1;Iz.findPair=K0});var J0=T((Tz)=>{var Dz=M(),x1=s(),Oz={collection:"map",default:!0,nodeClass:x1.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,q){if(!Dz.isMap($))q("Expected a mapping for this tag");return $},createNode:($,q,U)=>x1.YAMLMap.from($,q,U)};Tz.map=Oz});var i=T((Fz)=>{var Yz=_0(),wz=s$(),_z=r0(),G$=M(),Vz=b(),Wz=m();class v1 extends _z.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(G$.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let q=R$($);if(typeof q!=="number")return!1;return this.items.splice(q,1).length>0}get($,q){let U=R$($);if(typeof U!=="number")return;let H=this.items[U];return!q&&G$.isScalar(H)?H.value:H}has($){let q=R$($);return typeof q==="number"&&q<this.items.length}set($,q){let U=R$($);if(typeof U!=="number")throw Error(`Expected a valid index, not ${$}.`);let H=this.items[U];if(G$.isScalar(H)&&Vz.isScalarValue(q))H.value=q;else this.items[U]=q}toJSON($,q){let U=[];if(q?.onCreate)q.onCreate(U);let H=0;for(let z of this.items)U.push(Wz.toJS(z,String(H++),q));return U}toString($,q,U){if(!$)return JSON.stringify(this);return wz.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:U,onComment:q})}static from($,q,U){let{replacer:H}=U,z=new this($);if(q&&Symbol.iterator in Object(q)){let X=0;for(let L of q){if(typeof H==="function"){let Z=q instanceof Set?L:String(X++);L=H.call(q,Z,L)}z.items.push(Yz.createNode(L,void 0,U))}}return z}}function R$($){let q=G$.isScalar($)?$.value:$;if(q&&typeof q==="string")q=Number(q);return typeof q==="number"&&Number.isInteger(q)&&q>=0?q:null}Fz.YAMLSeq=v1});var I0=T((bz)=>{var Mz=M(),m1=i(),Kz={collection:"seq",default:!0,nodeClass:m1.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,q){if(!Mz.isSeq($))q("Expected a sequence for this tag");return $},createNode:($,q,U)=>m1.YAMLSeq.from($,q,U)};bz.seq=Kz});var b0=T((jz)=>{var Sz=F0(),Cz={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,q,U,H){return q=Object.assign({actualString:!0},q),Sz.stringifyString($,q,U,H)}};jz.string=Cz});var J$=T((Ez)=>{var p1=b(),d1={identify:($)=>$==null,createNode:()=>new p1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new p1.Scalar(null),stringify:({source:$},q)=>typeof $==="string"&&d1.test.test($)?$:q.options.nullStr};Ez.nullTag=d1});var i$=T((yz)=>{var uz=b(),l1={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new uz.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:q},U){if($&&l1.test.test($)){let H=$[0]==="t"||$[0]==="T";if(q===H)return $}return q?U.options.trueStr:U.options.falseStr}};yz.boolTag=l1});var Q0=T((xz)=>{function kz({format:$,minFractionDigits:q,tag:U,value:H}){if(typeof H==="bigint")return String(H);let z=typeof H==="number"?H:Number(H);if(!isFinite(z))return isNaN(z)?".nan":z<0?"-.inf":".inf";let X=Object.is(H,-0)?"-0":JSON.stringify(H);if(!$&&q&&(!U||U==="tag:yaml.org,2002:float")&&/^-?\d/.test(X)&&!X.includes("e")){let L=X.indexOf(".");if(L<0)L=X.length,X+=".";let Z=q-(X.length-L-1);while(Z-- >0)X+="0"}return X}xz.stringifyNumber=kz});var r$=T((az)=>{var mz=b(),c$=Q0(),pz={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:c$.stringifyNumber},dz={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let q=Number($.value);return isFinite(q)?q.toExponential():c$.stringifyNumber($)}},lz={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let q=new mz.Scalar(parseFloat($)),U=$.indexOf(".");if(U!==-1&&$[$.length-1]==="0")q.minFractionDigits=$.length-U-1;return q},stringify:c$.stringifyNumber};az.float=lz;az.floatExp=dz;az.floatNaN=pz});var o$=T((tz)=>{var a1=Q0(),I$=($)=>typeof $==="bigint"||Number.isInteger($),n$=($,q,U,{intAsBigInt:H})=>H?BigInt($):parseInt($.substring(q),U);function s1($,q,U){let{value:H}=$;if(I$(H)&&H>=0)return U+H.toString(q);return a1.stringifyNumber($)}var rz={identify:($)=>I$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,q,U)=>n$($,2,8,U),stringify:($)=>s1($,8,"0o")},nz={identify:I$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,q,U)=>n$($,0,10,U),stringify:a1.stringifyNumber},oz={identify:($)=>I$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,q,U)=>n$($,2,16,U),stringify:($)=>s1($,16,"0x")};tz.int=nz;tz.intHex=oz;tz.intOct=rz});var i1=T((R6)=>{var U6=J0(),H6=J$(),z6=I0(),X6=b0(),L6=i$(),t$=r$(),e$=o$(),Z6=[U6.map,z6.seq,X6.string,H6.nullTag,L6.boolTag,e$.intOct,e$.int,e$.intHex,t$.floatNaN,t$.floatExp,t$.float];R6.schema=Z6});var r1=T((T6)=>{var J6=b(),I6=J0(),Q6=I0();function c1($){return typeof $==="bigint"||Number.isInteger($)}var Q$=({value:$})=>JSON.stringify($),B6=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:Q$},{identify:($)=>$==null,createNode:()=>new J6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Q$},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:Q$},{identify:c1,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,q,{intAsBigInt:U})=>U?BigInt($):parseInt($,10),stringify:({value:$})=>c1($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:Q$}],D6={default:!0,tag:"",test:/^/,resolve($,q){return q(`Unresolved plain scalar ${JSON.stringify($)}`),$}},O6=[I6.map,Q6.seq].concat(B6,D6);T6.schema=O6});var qq=T((_6)=>{var N0=X0("buffer"),$q=b(),Y6=F0(),w6={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,q){if(typeof N0.Buffer==="function")return N0.Buffer.from($,"base64");else if(typeof atob==="function"){let U=atob($.replace(/[\n\r]/g,"")),H=new Uint8Array(U.length);for(let z=0;z<U.length;++z)H[z]=U.charCodeAt(z);return H}else return q("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:q,value:U},H,z,X){if(!U)return"";let L=U,Z;if(typeof N0.Buffer==="function")Z=L instanceof N0.Buffer?L.toString("base64"):N0.Buffer.from(L.buffer).toString("base64");else if(typeof btoa==="function"){let R="";for(let G=0;G<L.length;++G)R+=String.fromCharCode(L[G]);Z=btoa(R)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(q??(q=$q.Scalar.BLOCK_LITERAL),q!==$q.Scalar.QUOTE_DOUBLE){let R=Math.max(H.options.lineWidth-H.indent.length,H.options.minContentWidth),G=Math.ceil(Z.length/R),I=Array(G);for(let J=0,Q=0;J<G;++J,Q+=R)I[J]=Z.substr(Q,R);Z=I.join(q===$q.Scalar.BLOCK_LITERAL?`
54
+ `:" ")}return Y6.stringifyString({comment:$,type:q,value:Z},H,z,X)}};_6.binary=w6});var D$=T((M6)=>{var B$=M(),Uq=l(),W6=b(),F6=i();function n1($,q){if(B$.isSeq($))for(let U=0;U<$.items.length;++U){let H=$.items[U];if(B$.isPair(H))continue;else if(B$.isMap(H)){if(H.items.length>1)q("Each pair must have its own sequence indicator");let z=H.items[0]||new Uq.Pair(new W6.Scalar(null));if(H.commentBefore)z.key.commentBefore=z.key.commentBefore?`${H.commentBefore}
55
+ ${z.key.commentBefore}`:H.commentBefore;if(H.comment){let X=z.value??z.key;X.comment=X.comment?`${H.comment}
56
+ ${X.comment}`:H.comment}H=z}$.items[U]=B$.isPair(H)?H:new Uq.Pair(H)}else q("Expected a sequence for this tag");return $}function o1($,q,U){let{replacer:H}=U,z=new F6.YAMLSeq($);z.tag="tag:yaml.org,2002:pairs";let X=0;if(q&&Symbol.iterator in Object(q))for(let L of q){if(typeof H==="function")L=H.call(q,String(X++),L);let Z,R;if(Array.isArray(L))if(L.length===2)Z=L[0],R=L[1];else throw TypeError(`Expected [key, value] tuple: ${L}`);else if(L&&L instanceof Object){let G=Object.keys(L);if(G.length===1)Z=G[0],R=L[Z];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else Z=L;z.items.push(Uq.createPair(Z,R,U))}return z}var A6={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:n1,createNode:o1};M6.createPairs=o1;M6.pairs=A6;M6.resolvePairs=n1});var zq=T((j6)=>{var t1=M(),Hq=m(),S0=s(),S6=i(),e1=D$();class e extends S6.YAMLSeq{constructor(){super();this.add=S0.YAMLMap.prototype.add.bind(this),this.delete=S0.YAMLMap.prototype.delete.bind(this),this.get=S0.YAMLMap.prototype.get.bind(this),this.has=S0.YAMLMap.prototype.has.bind(this),this.set=S0.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON($,q){if(!q)return super.toJSON($);let U=new Map;if(q?.onCreate)q.onCreate(U);for(let H of this.items){let z,X;if(t1.isPair(H))z=Hq.toJS(H.key,"",q),X=Hq.toJS(H.value,z,q);else z=Hq.toJS(H,"",q);if(U.has(z))throw Error("Ordered maps must not include duplicate keys");U.set(z,X)}return U}static from($,q,U){let H=e1.createPairs($,q,U),z=new this;return z.items=H.items,z}}e.tag="tag:yaml.org,2002:omap";var C6={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:e,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,q){let U=e1.resolvePairs($,q),H=[];for(let{key:z}of U.items)if(t1.isScalar(z))if(H.includes(z.value))q(`Ordered maps must not include duplicate keys: ${z.value}`);else H.push(z.value);return Object.assign(new e,U)},createNode:($,q,U)=>e.from($,q,U)};j6.YAMLOMap=e;j6.omap=C6});var zU=T((g6)=>{var $U=b();function qU({value:$,source:q},U){if(q&&($?UU:HU).test.test(q))return q;return $?U.options.trueStr:U.options.falseStr}var UU={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $U.Scalar(!0),stringify:qU},HU={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $U.Scalar(!1),stringify:qU};g6.falseTag=HU;g6.trueTag=UU});var XU=T((m6)=>{var h6=b(),Xq=Q0(),k6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Xq.stringifyNumber},x6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let q=Number($.value);return isFinite(q)?q.toExponential():Xq.stringifyNumber($)}},v6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let q=new h6.Scalar(parseFloat($.replace(/_/g,""))),U=$.indexOf(".");if(U!==-1){let H=$.substring(U+1).replace(/_/g,"");if(H[H.length-1]==="0")q.minFractionDigits=H.length}return q},stringify:Xq.stringifyNumber};m6.float=v6;m6.floatExp=x6;m6.floatNaN=k6});var ZU=T((r6)=>{var LU=Q0(),C0=($)=>typeof $==="bigint"||Number.isInteger($);function O$($,q,U,{intAsBigInt:H}){let z=$[0];if(z==="-"||z==="+")q+=1;if($=$.substring(q).replace(/_/g,""),H){switch(U){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let L=BigInt($);return z==="-"?BigInt(-1)*L:L}let X=parseInt($,U);return z==="-"?-1*X:X}function Lq($,q,U){let{value:H}=$;if(C0(H)){let z=H.toString(q);return H<0?"-"+U+z.substr(1):U+z}return LU.stringifyNumber($)}var a6={identify:C0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,q,U)=>O$($,2,2,U),stringify:($)=>Lq($,2,"0b")},s6={identify:C0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,q,U)=>O$($,1,8,U),stringify:($)=>Lq($,8,"0")},i6={identify:C0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,q,U)=>O$($,0,10,U),stringify:LU.stringifyNumber},c6={identify:C0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,q,U)=>O$($,2,16,U),stringify:($)=>Lq($,16,"0x")};r6.int=i6;r6.intBin=a6;r6.intHex=c6;r6.intOct=s6});var Zq=T((q4)=>{var Y$=M(),T$=l(),P$=s();class $0 extends P$.YAMLMap{constructor($){super($);this.tag=$0.tag}add($){let q;if(Y$.isPair($))q=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)q=new T$.Pair($.key,null);else q=new T$.Pair($,null);if(!P$.findPair(this.items,q.key))this.items.push(q)}get($,q){let U=P$.findPair(this.items,$);return!q&&Y$.isPair(U)?Y$.isScalar(U.key)?U.key.value:U.key:U}set($,q){if(typeof q!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof q}`);let U=P$.findPair(this.items,$);if(U&&!q)this.items.splice(this.items.indexOf(U),1);else if(!U&&q)this.items.push(new T$.Pair($))}toJSON($,q){return super.toJSON($,q,Set)}toString($,q,U){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),q,U);else throw Error("Set items must all have null values")}static from($,q,U){let{replacer:H}=U,z=new this($);if(q&&Symbol.iterator in Object(q))for(let X of q){if(typeof H==="function")X=H.call(q,X,X);z.items.push(T$.createPair(X,null,U))}return z}}$0.tag="tag:yaml.org,2002:set";var $4={collection:"map",identify:($)=>$ instanceof Set,nodeClass:$0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,q,U)=>$0.from($,q,U),resolve($,q){if(Y$.isMap($))if($.hasAllNullValues(!0))return Object.assign(new $0,$);else q("Set items must all have null values");else q("Expected a mapping for this tag");return $}};q4.YAMLSet=$0;q4.set=$4});var Gq=T((Z4)=>{var z4=Q0();function Rq($,q){let U=$[0],H=U==="-"||U==="+"?$.substring(1):$,z=(L)=>q?BigInt(L):Number(L),X=H.replace(/_/g,"").split(":").reduce((L,Z)=>L*z(60)+z(Z),z(0));return U==="-"?z(-1)*X:X}function RU($){let{value:q}=$,U=(L)=>L;if(typeof q==="bigint")U=(L)=>BigInt(L);else if(isNaN(q)||!isFinite(q))return z4.stringifyNumber($);let H="";if(q<0)H="-",q*=U(-1);let z=U(60),X=[q%z];if(q<60)X.unshift(0);else if(q=(q-X[0])/z,X.unshift(q%z),q>=60)q=(q-X[0])/z,X.unshift(q);return H+X.map((L)=>String(L).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var X4={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,q,{intAsBigInt:U})=>Rq($,U),stringify:RU},L4={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>Rq($,!1),stringify:RU},GU={identify:($)=>$ 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($){let q=$.match(GU.test);if(!q)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,U,H,z,X,L,Z]=q.map(Number),R=q[7]?Number((q[7]+"00").substr(1,3)):0,G=Date.UTC(U,H-1,z,X||0,L||0,Z||0,R),I=q[8];if(I&&I!=="Z"){let J=Rq(I,!1);if(Math.abs(J)<30)J*=60;G-=60000*J}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Z4.floatTime=L4;Z4.intTime=X4;Z4.timestamp=GU});var IU=T((V4)=>{var I4=J0(),Q4=J$(),B4=I0(),D4=b0(),O4=qq(),JU=zU(),Jq=XU(),w$=ZU(),T4=U$(),P4=zq(),Y4=D$(),w4=Zq(),Iq=Gq(),_4=[I4.map,B4.seq,D4.string,Q4.nullTag,JU.trueTag,JU.falseTag,w$.intBin,w$.intOct,w$.int,w$.intHex,Jq.floatNaN,Jq.floatExp,Jq.float,O4.binary,T4.merge,P4.omap,Y4.pairs,w4.set,Iq.intTime,Iq.floatTime,Iq.timestamp];V4.schema=_4});var VU=T((C4)=>{var OU=J0(),F4=J$(),TU=I0(),A4=b0(),M4=i$(),Qq=r$(),Bq=o$(),K4=i1(),b4=r1(),PU=qq(),j0=U$(),YU=zq(),wU=D$(),QU=IU(),_U=Zq(),_$=Gq(),BU=new Map([["core",K4.schema],["failsafe",[OU.map,TU.seq,A4.string]],["json",b4.schema],["yaml11",QU.schema],["yaml-1.1",QU.schema]]),DU={binary:PU.binary,bool:M4.boolTag,float:Qq.float,floatExp:Qq.floatExp,floatNaN:Qq.floatNaN,floatTime:_$.floatTime,int:Bq.int,intHex:Bq.intHex,intOct:Bq.intOct,intTime:_$.intTime,map:OU.map,merge:j0.merge,null:F4.nullTag,omap:YU.omap,pairs:wU.pairs,seq:TU.seq,set:_U.set,timestamp:_$.timestamp},N4={"tag:yaml.org,2002:binary":PU.binary,"tag:yaml.org,2002:merge":j0.merge,"tag:yaml.org,2002:omap":YU.omap,"tag:yaml.org,2002:pairs":wU.pairs,"tag:yaml.org,2002:set":_U.set,"tag:yaml.org,2002:timestamp":_$.timestamp};function S4($,q,U){let H=BU.get(q);if(H&&!$)return U&&!H.includes(j0.merge)?H.concat(j0.merge):H.slice();let z=H;if(!z)if(Array.isArray($))z=[];else{let X=Array.from(BU.keys()).filter((L)=>L!=="yaml11").map((L)=>JSON.stringify(L)).join(", ");throw Error(`Unknown schema "${q}"; use one of ${X} or define customTags array`)}if(Array.isArray($))for(let X of $)z=z.concat(X);else if(typeof $==="function")z=$(z.slice());if(U)z=z.concat(j0.merge);return z.reduce((X,L)=>{let Z=typeof L==="string"?DU[L]:L;if(!Z){let R=JSON.stringify(L),G=Object.keys(DU).map((I)=>JSON.stringify(I)).join(", ");throw Error(`Unknown custom tag ${R}; use one of ${G}`)}if(!X.includes(Z))X.push(Z);return X},[])}C4.coreKnownTags=N4;C4.getTags=S4});var Tq=T((h4)=>{var Dq=M(),E4=J0(),g4=I0(),u4=b0(),V$=VU(),y4=($,q)=>$.key<q.key?-1:$.key>q.key?1:0;class Oq{constructor({compat:$,customTags:q,merge:U,resolveKnownTags:H,schema:z,sortMapEntries:X,toStringDefaults:L}){this.compat=Array.isArray($)?V$.getTags($,"compat"):$?V$.getTags(null,$):null,this.name=typeof z==="string"&&z||"core",this.knownTags=H?V$.coreKnownTags:{},this.tags=V$.getTags(q,this.name,U),this.toStringOptions=L??null,Object.defineProperty(this,Dq.MAP,{value:E4.map}),Object.defineProperty(this,Dq.SCALAR,{value:u4.string}),Object.defineProperty(this,Dq.SEQ,{value:g4.seq}),this.sortMapEntries=typeof X==="function"?X:X===!0?y4:null}clone(){let $=Object.create(Oq.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}h4.Schema=Oq});var WU=T((m4)=>{var x4=M(),Pq=A0(),f0=V0();function v4($,q){let U=[],H=q.directives===!0;if(q.directives!==!1&&$.directives){let R=$.directives.toString($);if(R)U.push(R),H=!0;else if($.directives.docStart)H=!0}if(H)U.push("---");let z=Pq.createStringifyContext($,q),{commentString:X}=z.options;if($.commentBefore){if(U.length!==1)U.unshift("");let R=X($.commentBefore);U.unshift(f0.indentComment(R,""))}let L=!1,Z=null;if($.contents){if(x4.isNode($.contents)){if($.contents.spaceBefore&&H)U.push("");if($.contents.commentBefore){let I=X($.contents.commentBefore);U.push(f0.indentComment(I,""))}z.forceBlockIndent=!!$.comment,Z=$.contents.comment}let R=Z?void 0:()=>L=!0,G=Pq.stringify($.contents,z,()=>Z=null,R);if(Z)G+=f0.lineComment(G,"",X(Z));if((G[0]==="|"||G[0]===">")&&U[U.length-1]==="---")U[U.length-1]=`--- ${G}`;else U.push(G)}else U.push(Pq.stringify($.contents,z));if($.directives?.docEnd)if($.comment){let R=X($.comment);if(R.includes(`
57
+ `))U.push("..."),U.push(f0.indentComment(R,""));else U.push(`... ${R}`)}else U.push("...");else{let R=$.comment;if(R&&L)R=R.replace(/^\n+/,"");if(R){if((!L||Z)&&U[U.length-1]!=="")U.push("");U.push(f0.indentComment(X(R),""))}}return U.join(`
58
+ `)+`
59
+ `}m4.stringifyDocument=v4});var E0=T((n4)=>{var d4=w0(),B0=r0(),E=M(),l4=l(),a4=m(),s4=Tq(),i4=WU(),Yq=s0(),c4=h$(),r4=_0(),wq=y$();class _q{constructor($,q,U){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,E.NODE_TYPE,{value:E.DOC});let H=null;if(typeof q==="function"||Array.isArray(q))H=q;else if(U===void 0&&q)U=q,q=void 0;let z=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},U);this.options=z;let{version:X}=z;if(U?._directives){if(this.directives=U._directives.atDocument(),this.directives.yaml.explicit)X=this.directives.yaml.version}else this.directives=new wq.Directives({version:X});this.setSchema(X,U),this.contents=$===void 0?null:this.createNode($,H,U)}clone(){let $=Object.create(_q.prototype,{[E.NODE_TYPE]:{value:E.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=E.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(D0(this.contents))this.contents.add($)}addIn($,q){if(D0(this.contents))this.contents.addIn($,q)}createAlias($,q){if(!$.anchor){let U=Yq.anchorNames(this);$.anchor=!q||U.has(q)?Yq.findNewAnchor(q||"a",U):q}return new d4.Alias($.anchor)}createNode($,q,U){let H=void 0;if(typeof q==="function")$=q.call({"":$},"",$),H=q;else if(Array.isArray(q)){let B=(w)=>typeof w==="number"||w instanceof String||w instanceof Number,D=q.filter(B).map(String);if(D.length>0)q=q.concat(D);H=q}else if(U===void 0&&q)U=q,q=void 0;let{aliasDuplicateObjects:z,anchorPrefix:X,flow:L,keepUndefined:Z,onTagObj:R,tag:G}=U??{},{onAnchor:I,setAnchors:J,sourceObjects:Q}=Yq.createNodeAnchors(this,X||"a"),O={aliasDuplicateObjects:z??!0,keepUndefined:Z??!1,onAnchor:I,onTagObj:R,replacer:H,schema:this.schema,sourceObjects:Q},P=r4.createNode($,G,O);if(L&&E.isCollection(P))P.flow=!0;return J(),P}createPair($,q,U={}){let H=this.createNode($,null,U),z=this.createNode(q,null,U);return new l4.Pair(H,z)}delete($){return D0(this.contents)?this.contents.delete($):!1}deleteIn($){if(B0.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return D0(this.contents)?this.contents.deleteIn($):!1}get($,q){return E.isCollection(this.contents)?this.contents.get($,q):void 0}getIn($,q){if(B0.isEmptyPath($))return!q&&E.isScalar(this.contents)?this.contents.value:this.contents;return E.isCollection(this.contents)?this.contents.getIn($,q):void 0}has($){return E.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(B0.isEmptyPath($))return this.contents!==void 0;return E.isCollection(this.contents)?this.contents.hasIn($):!1}set($,q){if(this.contents==null)this.contents=B0.collectionFromPath(this.schema,[$],q);else if(D0(this.contents))this.contents.set($,q)}setIn($,q){if(B0.isEmptyPath($))this.contents=q;else if(this.contents==null)this.contents=B0.collectionFromPath(this.schema,Array.from($),q);else if(D0(this.contents))this.contents.setIn($,q)}setSchema($,q={}){if(typeof $==="number")$=String($);let U;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new wq.Directives({version:"1.1"});U={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new wq.Directives({version:$});U={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;U=null;break;default:{let H=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${H}`)}}if(q.schema instanceof Object)this.schema=q.schema;else if(U)this.schema=new s4.Schema(Object.assign(U,q));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:q,mapAsMap:U,maxAliasCount:H,onAnchor:z,reviver:X}={}){let L={anchors:new Map,doc:this,keep:!$,mapAsMap:U===!0,mapKeyWarned:!1,maxAliasCount:typeof H==="number"?H:100},Z=a4.toJS(this.contents,q??"",L);if(typeof z==="function")for(let{count:R,res:G}of L.anchors.values())z(G,R);return typeof X==="function"?c4.applyReviver(X,{"":Z},"",Z):Z}toJSON($,q){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:q})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let q=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${q}`)}return i4.stringifyDocument(this,$)}}function D0($){if(E.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}n4.Document=_q});var g0=T((e4)=>{class W$ extends Error{constructor($,q,U,H){super();this.name=$,this.code=U,this.message=H,this.pos=q}}class FU extends W${constructor($,q,U){super("YAMLParseError",$,q,U)}}class AU extends W${constructor($,q,U){super("YAMLWarning",$,q,U)}}var t4=($,q)=>(U)=>{if(U.pos[0]===-1)return;U.linePos=U.pos.map((Z)=>q.linePos(Z));let{line:H,col:z}=U.linePos[0];U.message+=` at line ${H}, column ${z}`;let X=z-1,L=$.substring(q.lineStarts[H-1],q.lineStarts[H]).replace(/[\n\r]+$/,"");if(X>=60&&L.length>80){let Z=Math.min(X-39,L.length-79);L="\u2026"+L.substring(Z),X-=Z-1}if(L.length>80)L=L.substring(0,79)+"\u2026";if(H>1&&/^ *$/.test(L.substring(0,X))){let Z=$.substring(q.lineStarts[H-2],q.lineStarts[H-1]);if(Z.length>80)Z=Z.substring(0,79)+`\u2026
60
+ `;L=Z+L}if(/[^ ]/.test(L)){let Z=1,R=U.linePos[1];if(R?.line===H&&R.col>z)Z=Math.max(1,Math.min(R.col-z,80-X));let G=" ".repeat(X)+"^".repeat(Z);U.message+=`:
61
+
62
+ ${L}
63
+ ${G}
64
+ `}};e4.YAMLError=W$;e4.YAMLParseError=FU;e4.YAMLWarning=AU;e4.prettifyError=t4});var u0=T((X3)=>{function z3($,{flow:q,indicator:U,next:H,offset:z,onError:X,parentIndent:L,startOnNewline:Z}){let R=!1,G=Z,I=Z,J="",Q="",O=!1,P=!1,B=null,D=null,w=null,_=null,V=null,W=null,F=null;for(let Y of $){if(P){if(Y.type!=="space"&&Y.type!=="newline"&&Y.type!=="comma")X(Y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");P=!1}if(B){if(G&&Y.type!=="comment"&&Y.type!=="newline")X(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(Y.type){case"space":if(!q&&(U!=="doc-start"||H?.type!=="flow-collection")&&Y.source.includes("\t"))B=Y;I=!0;break;case"comment":{if(!I)X(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=Y.source.substring(1)||" ";if(!J)J=N;else J+=Q+N;Q="",G=!1;break}case"newline":if(G){if(J)J+=Y.source;else if(!W||U!=="seq-item-ind")R=!0}else Q+=Y.source;if(G=!0,O=!0,D||w)_=Y;I=!0;break;case"anchor":if(D)X(Y,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(Y.source.endsWith(":"))X(Y.offset+Y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=Y,F??(F=Y.offset),G=!1,I=!1,P=!0;break;case"tag":{if(w)X(Y,"MULTIPLE_TAGS","A node can have at most one tag");w=Y,F??(F=Y.offset),G=!1,I=!1,P=!0;break}case U:if(D||w)X(Y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${Y.source} indicator`);if(W)X(Y,"UNEXPECTED_TOKEN",`Unexpected ${Y.source} in ${q??"collection"}`);W=Y,G=U==="seq-item-ind"||U==="explicit-key-ind",I=!1;break;case"comma":if(q){if(V)X(Y,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);V=Y,G=!1,I=!1;break}default:X(Y,"UNEXPECTED_TOKEN",`Unexpected ${Y.type} token`),G=!1,I=!1}}let A=$[$.length-1],K=A?A.offset+A.source.length:z;if(P&&H&&H.type!=="space"&&H.type!=="newline"&&H.type!=="comma"&&(H.type!=="scalar"||H.source!==""))X(H.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(G&&B.indent<=L||H?.type==="block-map"||H?.type==="block-seq"))X(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:V,found:W,spaceBefore:R,comment:J,hasNewline:O,anchor:D,tag:w,newlineAfterProp:_,end:K,start:F??K}}X3.resolveProps=z3});var F$=T((Z3)=>{function Vq($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
65
+ `))return!0;if($.end){for(let q of $.end)if(q.type==="newline")return!0}return!1;case"flow-collection":for(let q of $.items){for(let U of q.start)if(U.type==="newline")return!0;if(q.sep){for(let U of q.sep)if(U.type==="newline")return!0}if(Vq(q.key)||Vq(q.value))return!0}return!1;default:return!0}}Z3.containsNewline=Vq});var Wq=T((I3)=>{var G3=F$();function J3($,q,U){if(q?.type==="flow-collection"){let H=q.end[0];if(H.indent===$&&(H.source==="]"||H.source==="}")&&G3.containsNewline(q))U(H,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}I3.flowIndentCheck=J3});var Fq=T((D3)=>{var MU=M();function B3($,q,U){let{uniqueKeys:H}=$.options;if(H===!1)return!1;let z=typeof H==="function"?H:(X,L)=>X===L||MU.isScalar(X)&&MU.isScalar(L)&&X.value===L.value;return q.some((X)=>z(X.key,U))}D3.mapIncludes=B3});var CU=T((_3)=>{var KU=l(),T3=s(),bU=u0(),P3=F$(),NU=Wq(),Y3=Fq(),SU="All mapping items must start at the same column";function w3({composeNode:$,composeEmptyNode:q},U,H,z,X){let Z=new(X?.nodeClass??T3.YAMLMap)(U.schema);if(U.atRoot)U.atRoot=!1;let R=H.offset,G=null;for(let I of H.items){let{start:J,key:Q,sep:O,value:P}=I,B=bU.resolveProps(J,{indicator:"explicit-key-ind",next:Q??O?.[0],offset:R,onError:z,parentIndent:H.indent,startOnNewline:!0}),D=!B.found;if(D){if(Q){if(Q.type==="block-seq")z(R,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in Q&&Q.indent!==H.indent)z(R,"BAD_INDENT",SU)}if(!B.anchor&&!B.tag&&!O){if(G=B.end,B.comment)if(Z.comment)Z.comment+=`
66
+ `+B.comment;else Z.comment=B.comment;continue}if(B.newlineAfterProp||P3.containsNewline(Q))z(Q??J[J.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==H.indent)z(R,"BAD_INDENT",SU);U.atKey=!0;let w=B.end,_=Q?$(U,Q,B,z):q(U,w,J,null,B,z);if(U.schema.compat)NU.flowIndentCheck(H.indent,Q,z);if(U.atKey=!1,Y3.mapIncludes(U,Z.items,_))z(w,"DUPLICATE_KEY","Map keys must be unique");let V=bU.resolveProps(O??[],{indicator:"map-value-ind",next:P,offset:_.range[2],onError:z,parentIndent:H.indent,startOnNewline:!Q||Q.type==="block-scalar"});if(R=V.end,V.found){if(D){if(P?.type==="block-map"&&!V.hasNewline)z(R,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(U.options.strict&&B.start<V.found.offset-1024)z(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let W=P?$(U,P,V,z):q(U,R,O,null,V,z);if(U.schema.compat)NU.flowIndentCheck(H.indent,P,z);R=W.range[2];let F=new KU.Pair(_,W);if(U.options.keepSourceTokens)F.srcToken=I;Z.items.push(F)}else{if(D)z(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(V.comment)if(_.comment)_.comment+=`
67
+ `+V.comment;else _.comment=V.comment;let W=new KU.Pair(_);if(U.options.keepSourceTokens)W.srcToken=I;Z.items.push(W)}}if(G&&G<R)z(G,"IMPOSSIBLE","Map comment with trailing content");return Z.range=[H.offset,R,G??R],Z}_3.resolveBlockMap=w3});var jU=T((K3)=>{var W3=i(),F3=u0(),A3=Wq();function M3({composeNode:$,composeEmptyNode:q},U,H,z,X){let Z=new(X?.nodeClass??W3.YAMLSeq)(U.schema);if(U.atRoot)U.atRoot=!1;if(U.atKey)U.atKey=!1;let R=H.offset,G=null;for(let{start:I,value:J}of H.items){let Q=F3.resolveProps(I,{indicator:"seq-item-ind",next:J,offset:R,onError:z,parentIndent:H.indent,startOnNewline:!0});if(!Q.found)if(Q.anchor||Q.tag||J)if(J?.type==="block-seq")z(Q.end,"BAD_INDENT","All sequence items must start at the same column");else z(R,"MISSING_CHAR","Sequence item without - indicator");else{if(G=Q.end,Q.comment)Z.comment=Q.comment;continue}let O=J?$(U,J,Q,z):q(U,Q.end,I,null,Q,z);if(U.schema.compat)A3.flowIndentCheck(H.indent,J,z);R=O.range[2],Z.items.push(O)}return Z.range=[H.offset,R,G??R],Z}K3.resolveBlockSeq=M3});var O0=T((S3)=>{function N3($,q,U,H){let z="";if($){let X=!1,L="";for(let Z of $){let{source:R,type:G}=Z;switch(G){case"space":X=!0;break;case"comment":{if(U&&!X)H(Z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let I=R.substring(1)||" ";if(!z)z=I;else z+=L+I;L="";break}case"newline":if(z)L+=R;X=!0;break;default:H(Z,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}q+=R.length}}return{comment:z,offset:q}}S3.resolveEnd=N3});var gU=T((k3)=>{var j3=M(),f3=l(),fU=s(),E3=i(),g3=O0(),EU=u0(),u3=F$(),y3=Fq(),Aq="Block collections are not allowed within flow collections",Mq=($)=>$&&($.type==="block-map"||$.type==="block-seq");function h3({composeNode:$,composeEmptyNode:q},U,H,z,X){let L=H.start.source==="{",Z=L?"flow map":"flow sequence",G=new(X?.nodeClass??(L?fU.YAMLMap:E3.YAMLSeq))(U.schema);G.flow=!0;let I=U.atRoot;if(I)U.atRoot=!1;if(U.atKey)U.atKey=!1;let J=H.offset+H.start.source.length;for(let D=0;D<H.items.length;++D){let w=H.items[D],{start:_,key:V,sep:W,value:F}=w,A=EU.resolveProps(_,{flow:Z,indicator:"explicit-key-ind",next:V??W?.[0],offset:J,onError:z,parentIndent:H.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!W&&!F){if(D===0&&A.comma)z(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);else if(D<H.items.length-1)z(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Z}`);if(A.comment)if(G.comment)G.comment+=`
68
+ `+A.comment;else G.comment=A.comment;J=A.end;continue}if(!L&&U.options.strict&&u3.containsNewline(V))z(V,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(A.comma)z(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`)}else{if(!A.comma)z(A.start,"MISSING_CHAR",`Missing , between ${Z} items`);if(A.comment){let K="";$:for(let Y of _)switch(Y.type){case"comma":case"space":break;case"comment":K=Y.source.substring(1);break $;default:break $}if(K){let Y=G.items[G.items.length-1];if(j3.isPair(Y))Y=Y.value??Y.key;if(Y.comment)Y.comment+=`
69
+ `+K;else Y.comment=K;A.comment=A.comment.substring(K.length+1)}}}if(!L&&!W&&!A.found){let K=F?$(U,F,A,z):q(U,A.end,W,null,A,z);if(G.items.push(K),J=K.range[2],Mq(F))z(K.range,"BLOCK_IN_FLOW",Aq)}else{U.atKey=!0;let K=A.end,Y=V?$(U,V,A,z):q(U,K,_,null,A,z);if(Mq(V))z(Y.range,"BLOCK_IN_FLOW",Aq);U.atKey=!1;let N=EU.resolveProps(W??[],{flow:Z,indicator:"map-value-ind",next:F,offset:Y.range[2],onError:z,parentIndent:H.indent,startOnNewline:!1});if(N.found){if(!L&&!A.found&&U.options.strict){if(W)for(let S of W){if(S===N.found)break;if(S.type==="newline"){z(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<N.found.offset-1024)z(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(F)if("source"in F&&F.source?.[0]===":")z(F,"MISSING_CHAR",`Missing space after : in ${Z}`);else z(N.start,"MISSING_CHAR",`Missing , or : between ${Z} items`);let v=F?$(U,F,N,z):N.found?q(U,N.end,W,null,N,z):null;if(v){if(Mq(F))z(v.range,"BLOCK_IN_FLOW",Aq)}else if(N.comment)if(Y.comment)Y.comment+=`
70
+ `+N.comment;else Y.comment=N.comment;let z0=new f3.Pair(Y,v);if(U.options.keepSourceTokens)z0.srcToken=w;if(L){let S=G;if(y3.mapIncludes(U,S.items,Y))z(K,"DUPLICATE_KEY","Map keys must be unique");S.items.push(z0)}else{let S=new fU.YAMLMap(U.schema);S.flow=!0,S.items.push(z0);let iq=(v??Y).range;S.range=[Y.range[0],iq[1],iq[2]],G.items.push(S)}J=v?v.range[2]:N.end}}let Q=L?"}":"]",[O,...P]=H.end,B=J;if(O?.source===Q)B=O.offset+O.source.length;else{let D=Z[0].toUpperCase()+Z.substring(1),w=I?`${D} must end with a ${Q}`:`${D} in block collection must be sufficiently indented and end with a ${Q}`;if(z(J,I?"MISSING_CHAR":"BAD_INDENT",w),O&&O.source.length!==1)P.unshift(O)}if(P.length>0){let D=g3.resolveEnd(P,B,U.options.strict,z);if(D.comment)if(G.comment)G.comment+=`
71
+ `+D.comment;else G.comment=D.comment;G.range=[H.offset,B,D.offset]}else G.range=[H.offset,B,B];return G}k3.resolveFlowCollection=h3});var uU=T((c3)=>{var v3=M(),m3=b(),p3=s(),d3=i(),l3=CU(),a3=jU(),s3=gU();function Kq($,q,U,H,z,X){let L=U.type==="block-map"?l3.resolveBlockMap($,q,U,H,X):U.type==="block-seq"?a3.resolveBlockSeq($,q,U,H,X):s3.resolveFlowCollection($,q,U,H,X),Z=L.constructor;if(z==="!"||z===Z.tagName)return L.tag=Z.tagName,L;if(z)L.tag=z;return L}function i3($,q,U,H,z){let X=H.tag,L=!X?null:q.directives.tagName(X.source,(Q)=>z(X,"TAG_RESOLVE_FAILED",Q));if(U.type==="block-seq"){let{anchor:Q,newlineAfterProp:O}=H,P=Q&&X?Q.offset>X.offset?Q:X:Q??X;if(P&&(!O||O.offset<P.offset))z(P,"MISSING_CHAR","Missing newline after block sequence props")}let Z=U.type==="block-map"?"map":U.type==="block-seq"?"seq":U.start.source==="{"?"map":"seq";if(!X||!L||L==="!"||L===p3.YAMLMap.tagName&&Z==="map"||L===d3.YAMLSeq.tagName&&Z==="seq")return Kq($,q,U,z,L);let R=q.schema.tags.find((Q)=>Q.tag===L&&Q.collection===Z);if(!R){let Q=q.schema.knownTags[L];if(Q?.collection===Z)q.schema.tags.push(Object.assign({},Q,{default:!1})),R=Q;else{if(Q)z(X,"BAD_COLLECTION_TYPE",`${Q.tag} used for ${Z} collection, but expects ${Q.collection??"scalar"}`,!0);else z(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${L}`,!0);return Kq($,q,U,z,L)}}let G=Kq($,q,U,z,L,R),I=R.resolve?.(G,(Q)=>z(X,"TAG_RESOLVE_FAILED",Q),q.options)??G,J=v3.isNode(I)?I:new m3.Scalar(I);if(J.range=G.range,J.tag=L,R?.format)J.format=R.format;return J}c3.composeCollection=i3});var Nq=T((e3)=>{var bq=b();function n3($,q,U){let H=q.offset,z=o3(q,$.options.strict,U);if(!z)return{value:"",type:null,comment:"",range:[H,H,H]};let X=z.mode===">"?bq.Scalar.BLOCK_FOLDED:bq.Scalar.BLOCK_LITERAL,L=q.source?t3(q.source):[],Z=L.length;for(let B=L.length-1;B>=0;--B){let D=L[B][1];if(D===""||D==="\r")Z=B;else break}if(Z===0){let B=z.chomp==="+"&&L.length>0?`
72
+ `.repeat(Math.max(1,L.length-1)):"",D=H+z.length;if(q.source)D+=q.source.length;return{value:B,type:X,comment:z.comment,range:[H,D,D]}}let R=q.indent+z.indent,G=q.offset+z.length,I=0;for(let B=0;B<Z;++B){let[D,w]=L[B];if(w===""||w==="\r"){if(z.indent===0&&D.length>R)R=D.length}else{if(D.length<R)U(G+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(z.indent===0)R=D.length;if(I=B,R===0&&!$.atRoot)U(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=D.length+w.length+1}for(let B=L.length-1;B>=Z;--B)if(L[B][0].length>R)Z=B+1;let J="",Q="",O=!1;for(let B=0;B<I;++B)J+=L[B][0].slice(R)+`
73
+ `;for(let B=I;B<Z;++B){let[D,w]=L[B];G+=D.length+w.length+1;let _=w[w.length-1]==="\r";if(_)w=w.slice(0,-1);if(w&&D.length<R){let W=`Block scalar lines must not be less indented than their ${z.indent?"explicit indentation indicator":"first line"}`;U(G-w.length-(_?2:1),"BAD_INDENT",W),D=""}if(X===bq.Scalar.BLOCK_LITERAL)J+=Q+D.slice(R)+w,Q=`
74
+ `;else if(D.length>R||w[0]==="\t"){if(Q===" ")Q=`
75
+ `;else if(!O&&Q===`
76
+ `)Q=`
77
+
78
+ `;J+=Q+D.slice(R)+w,Q=`
79
+ `,O=!0}else if(w==="")if(Q===`
80
+ `)J+=`
81
+ `;else Q=`
82
+ `;else J+=Q+w,Q=" ",O=!1}switch(z.chomp){case"-":break;case"+":for(let B=Z;B<L.length;++B)J+=`
83
+ `+L[B][0].slice(R);if(J[J.length-1]!==`
84
+ `)J+=`
85
+ `;break;default:J+=`
86
+ `}let P=H+z.length+q.source.length;return{value:J,type:X,comment:z.comment,range:[H,P,P]}}function o3({offset:$,props:q},U,H){if(q[0].type!=="block-scalar-header")return H(q[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:z}=q[0],X=z[0],L=0,Z="",R=-1;for(let Q=1;Q<z.length;++Q){let O=z[Q];if(!Z&&(O==="-"||O==="+"))Z=O;else{let P=Number(O);if(!L&&P)L=P;else if(R===-1)R=$+Q}}if(R!==-1)H(R,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${z}`);let G=!1,I="",J=z.length;for(let Q=1;Q<q.length;++Q){let O=q[Q];switch(O.type){case"space":G=!0;case"newline":J+=O.source.length;break;case"comment":if(U&&!G)H(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");J+=O.source.length,I=O.source.substring(1);break;case"error":H(O,"UNEXPECTED_TOKEN",O.message),J+=O.source.length;break;default:{let P=`Unexpected token in block scalar header: ${O.type}`;H(O,"UNEXPECTED_TOKEN",P);let B=O.source;if(B&&typeof B==="string")J+=B.length}}}return{mode:X,indent:L,chomp:Z,comment:I,length:J}}function t3($){let q=$.split(/\n( *)/),U=q[0],H=U.match(/^( *)/),X=[H?.[1]?[H[1],U.slice(H[1].length)]:["",U]];for(let L=1;L<q.length;L+=2)X.push([q[L],q[L+1]]);return X}e3.resolveBlockScalar=n3});var Cq=T((G8)=>{var Sq=b(),q8=O0();function U8($,q,U){let{offset:H,type:z,source:X,end:L}=$,Z,R,G=(Q,O,P)=>U(H+Q,O,P);switch(z){case"scalar":Z=Sq.Scalar.PLAIN,R=H8(X,G);break;case"single-quoted-scalar":Z=Sq.Scalar.QUOTE_SINGLE,R=z8(X,G);break;case"double-quoted-scalar":Z=Sq.Scalar.QUOTE_DOUBLE,R=X8(X,G);break;default:return U($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${z}`),{value:"",type:null,comment:"",range:[H,H+X.length,H+X.length]}}let I=H+X.length,J=q8.resolveEnd(L,I,q,U);return{value:R,type:Z,comment:J.comment,range:[H,I,J.offset]}}function H8($,q){let U="";switch($[0]){case"\t":U="a tab character";break;case",":U="flow indicator character ,";break;case"%":U="directive indicator character %";break;case"|":case">":{U=`block scalar indicator ${$[0]}`;break}case"@":case"`":{U=`reserved character ${$[0]}`;break}}if(U)q(0,"BAD_SCALAR_START",`Plain value cannot start with ${U}`);return yU($)}function z8($,q){if($[$.length-1]!=="'"||$.length===1)q($.length,"MISSING_CHAR","Missing closing 'quote");return yU($.slice(1,-1)).replace(/''/g,"'")}function yU($){let q,U;try{q=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `,"sy"),U=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
88
+ `,"sy")}catch{q=/(.*?)[ \t]*\r?\n/sy,U=/[ \t]*(.*?)[ \t]*\r?\n/sy}let H=q.exec($);if(!H)return $;let z=H[1],X=" ",L=q.lastIndex;U.lastIndex=L;while(H=U.exec($)){if(H[1]==="")if(X===`
89
+ `)z+=X;else X=`
90
+ `;else z+=X+H[1],X=" ";L=U.lastIndex}let Z=/[ \t]*(.*)/sy;return Z.lastIndex=L,H=Z.exec($),z+X+(H?.[1]??"")}function X8($,q){let U="";for(let H=1;H<$.length-1;++H){let z=$[H];if(z==="\r"&&$[H+1]===`
91
+ `)continue;if(z===`
92
+ `){let{fold:X,offset:L}=L8($,H);U+=X,H=L}else if(z==="\\"){let X=$[++H],L=Z8[X];if(L)U+=L;else if(X===`
93
+ `){X=$[H+1];while(X===" "||X==="\t")X=$[++H+1]}else if(X==="\r"&&$[H+1]===`
94
+ `){X=$[++H+1];while(X===" "||X==="\t")X=$[++H+1]}else if(X==="x"||X==="u"||X==="U"){let Z=X==="x"?2:X==="u"?4:8;U+=R8($,H+1,Z,q),H+=Z}else{let Z=$.substr(H-1,2);q(H-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Z}`),U+=Z}}else if(z===" "||z==="\t"){let X=H,L=$[H+1];while(L===" "||L==="\t")L=$[++H+1];if(L!==`
95
+ `&&!(L==="\r"&&$[H+2]===`
96
+ `))U+=H>X?$.slice(X,H+1):z}else U+=z}if($[$.length-1]!=='"'||$.length===1)q($.length,"MISSING_CHAR",'Missing closing "quote');return U}function L8($,q){let U="",H=$[q+1];while(H===" "||H==="\t"||H===`
97
+ `||H==="\r"){if(H==="\r"&&$[q+2]!==`
98
+ `)break;if(H===`
99
+ `)U+=`
100
+ `;q+=1,H=$[q+1]}if(!U)U=" ";return{fold:U,offset:q}}var Z8={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
101
+ `,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function R8($,q,U,H){let z=$.substr(q,U),L=z.length===U&&/^[0-9a-fA-F]+$/.test(z)?parseInt(z,16):NaN;try{return String.fromCodePoint(L)}catch{let Z=$.substr(q-2,U+2);return H(q-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Z}`),Z}}G8.resolveFlowScalar=U8});var kU=T((T8)=>{var q0=M(),hU=b(),I8=Nq(),Q8=Cq();function B8($,q,U,H){let{value:z,type:X,comment:L,range:Z}=q.type==="block-scalar"?I8.resolveBlockScalar($,q,H):Q8.resolveFlowScalar(q,$.options.strict,H),R=U?$.directives.tagName(U.source,(J)=>H(U,"TAG_RESOLVE_FAILED",J)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[q0.SCALAR];else if(R)G=D8($.schema,z,R,U,H);else if(q.type==="scalar")G=O8($,z,q,H);else G=$.schema[q0.SCALAR];let I;try{let J=G.resolve(z,(Q)=>H(U??q,"TAG_RESOLVE_FAILED",Q),$.options);I=q0.isScalar(J)?J:new hU.Scalar(J)}catch(J){let Q=J instanceof Error?J.message:String(J);H(U??q,"TAG_RESOLVE_FAILED",Q),I=new hU.Scalar(z)}if(I.range=Z,I.source=z,X)I.type=X;if(R)I.tag=R;if(G.format)I.format=G.format;if(L)I.comment=L;return I}function D8($,q,U,H,z){if(U==="!")return $[q0.SCALAR];let X=[];for(let Z of $.tags)if(!Z.collection&&Z.tag===U)if(Z.default&&Z.test)X.push(Z);else return Z;for(let Z of X)if(Z.test?.test(q))return Z;let L=$.knownTags[U];if(L&&!L.collection)return $.tags.push(Object.assign({},L,{default:!1,test:void 0})),L;return z(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,U!=="tag:yaml.org,2002:str"),$[q0.SCALAR]}function O8({atKey:$,directives:q,schema:U},H,z,X){let L=U.tags.find((Z)=>(Z.default===!0||$&&Z.default==="key")&&Z.test?.test(H))||U[q0.SCALAR];if(U.compat){let Z=U.compat.find((R)=>R.default&&R.test?.test(H))??U[q0.SCALAR];if(L.tag!==Z.tag){let R=q.tagString(L.tag),G=q.tagString(Z.tag),I=`Value may be parsed as either ${R} or ${G}`;X(z,"TAG_RESOLVE_FAILED",I,!0)}}return L}T8.composeScalar=B8});var xU=T((w8)=>{function Y8($,q,U){if(q){U??(U=q.length);for(let H=U-1;H>=0;--H){let z=q[H];switch(z.type){case"space":case"comment":case"newline":$-=z.source.length;continue}z=q[++H];while(z?.type==="space")$+=z.source.length,z=q[++H];break}}return $}w8.emptyScalarPosition=Y8});var pU=T((N8)=>{var V8=w0(),W8=M(),F8=uU(),vU=kU(),A8=O0(),M8=xU(),K8={composeNode:mU,composeEmptyNode:jq};function mU($,q,U,H){let z=$.atKey,{spaceBefore:X,comment:L,anchor:Z,tag:R}=U,G,I=!0;switch(q.type){case"alias":if(G=b8($,q,H),Z||R)H(q,"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(G=vU.composeScalar($,q,R,H),Z)G.anchor=Z.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(G=F8.composeCollection(K8,$,q,U,H),Z)G.anchor=Z.source.substring(1)}catch(J){let Q=J instanceof Error?J.message:String(J);H(q,"RESOURCE_EXHAUSTION",Q)}break;default:{let J=q.type==="error"?q.message:`Unsupported token (type: ${q.type})`;H(q,"UNEXPECTED_TOKEN",J),I=!1}}if(G??(G=jq($,q.offset,void 0,null,U,H)),Z&&G.anchor==="")H(Z,"BAD_ALIAS","Anchor cannot be an empty string");if(z&&$.options.stringKeys&&(!W8.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))H(R??q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(X)G.spaceBefore=!0;if(L)if(q.type==="scalar"&&q.source==="")G.comment=L;else G.commentBefore=L;if($.options.keepSourceTokens&&I)G.srcToken=q;return G}function jq($,q,U,H,{spaceBefore:z,comment:X,anchor:L,tag:Z,end:R},G){let I={type:"scalar",offset:M8.emptyScalarPosition(q,U,H),indent:-1,source:""},J=vU.composeScalar($,I,Z,G);if(L){if(J.anchor=L.source.substring(1),J.anchor==="")G(L,"BAD_ALIAS","Anchor cannot be an empty string")}if(z)J.spaceBefore=!0;if(X)J.comment=X,J.range[2]=R;return J}function b8({options:$},{offset:q,source:U,end:H},z){let X=new V8.Alias(U.substring(1));if(X.source==="")z(q,"BAD_ALIAS","Alias cannot be an empty string");if(X.source.endsWith(":"))z(q+U.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let L=q+U.length,Z=A8.resolveEnd(H,L,$.strict,z);if(X.range=[q,L,Z.offset],Z.comment)X.comment=Z.comment;return X}N8.composeEmptyNode=jq;N8.composeNode=mU});var lU=T((u8)=>{var j8=E0(),dU=pU(),f8=O0(),E8=u0();function g8($,q,{offset:U,start:H,value:z,end:X},L){let Z=Object.assign({_directives:q},$),R=new j8.Document(void 0,Z),G={atKey:!1,atRoot:!0,directives:R.directives,options:R.options,schema:R.schema},I=E8.resolveProps(H,{indicator:"doc-start",next:z??X?.[0],offset:U,onError:L,parentIndent:0,startOnNewline:!0});if(I.found){if(R.directives.docStart=!0,z&&(z.type==="block-map"||z.type==="block-seq")&&!I.hasNewline)L(I.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}R.contents=z?dU.composeNode(G,z,I,L):dU.composeEmptyNode(G,I.end,H,null,I,L);let J=R.contents.range[2],Q=f8.resolveEnd(X,J,!1,L);if(Q.comment)R.comment=Q.comment;return R.range=[U,J,Q.offset],R}u8.composeDoc=g8});var fq=T((p8)=>{var h8=X0("process"),k8=y$(),x8=E0(),y0=g0(),aU=M(),v8=lU(),m8=O0();function h0($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:q,source:U}=$;return[q,q+(typeof U==="string"?U.length:1)]}function sU($){let q="",U=!1,H=!1;for(let z=0;z<$.length;++z){let X=$[z];switch(X[0]){case"#":q+=(q===""?"":H?`
102
+
103
+ `:`
104
+ `)+(X.substring(1)||" "),U=!0,H=!1;break;case"%":if($[z+1]?.[0]!=="#")z+=1;U=!1;break;default:if(!U)H=!0;U=!1}}return{comment:q,afterEmptyLine:H}}class iU{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(q,U,H,z)=>{let X=h0(q);if(z)this.warnings.push(new y0.YAMLWarning(X,U,H));else this.errors.push(new y0.YAMLParseError(X,U,H))},this.directives=new k8.Directives({version:$.version||"1.2"}),this.options=$}decorate($,q){let{comment:U,afterEmptyLine:H}=sU(this.prelude);if(U){let z=$.contents;if(q)$.comment=$.comment?`${$.comment}
105
+ ${U}`:U;else if(H||$.directives.docStart||!z)$.commentBefore=U;else if(aU.isCollection(z)&&!z.flow&&z.items.length>0){let X=z.items[0];if(aU.isPair(X))X=X.key;let L=X.commentBefore;X.commentBefore=L?`${U}
106
+ ${L}`:U}else{let X=z.commentBefore;z.commentBefore=X?`${U}
107
+ ${X}`:U}}if(q){for(let z=0;z<this.errors.length;++z)$.errors.push(this.errors[z]);for(let z=0;z<this.warnings.length;++z)$.warnings.push(this.warnings[z])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:sU(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,q=!1,U=-1){for(let H of $)yield*this.next(H);yield*this.end(q,U)}*next($){if(h8.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(q,U,H)=>{let z=h0($);z[0]+=q,this.onError(z,"BAD_DIRECTIVE",U,H)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let q=v8.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!q.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(q,!1),this.doc)yield this.doc;this.doc=q,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let q=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,U=new y0.YAMLParseError(h0($),"UNEXPECTED_TOKEN",q);if(this.atDirectives||!this.doc)this.errors.push(U);else this.doc.errors.push(U);break}case"doc-end":{if(!this.doc){this.errors.push(new y0.YAMLParseError(h0($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let q=m8.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),q.comment){let U=this.doc.comment;this.doc.comment=U?`${U}
108
+ ${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.push(new y0.YAMLParseError(h0($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,q=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let U=Object.assign({_directives:this.directives},this.options),H=new x8.Document(void 0,U);if(this.atDirectives)this.onError(q,"MISSING_CHAR","Missing directives-end indicator line");H.range=[0,q,q],this.decorate(H,!1),yield H}}}p8.Composer=iU});var nU=T((o8)=>{var l8=Nq(),a8=Cq(),s8=g0(),cU=F0();function i8($,q=!0,U){if($){let H=(z,X,L)=>{let Z=typeof z==="number"?z:Array.isArray(z)?z[0]:z.offset;if(U)U(Z,X,L);else throw new s8.YAMLParseError([Z,Z+1],X,L)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return a8.resolveFlowScalar($,q,H);case"block-scalar":return l8.resolveBlockScalar({options:{strict:q}},$,H)}}return null}function c8($,q){let{implicitKey:U=!1,indent:H,inFlow:z=!1,offset:X=-1,type:L="PLAIN"}=q,Z=cU.stringifyString({type:L,value:$},{implicitKey:U,indent:H>0?" ".repeat(H):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}}),R=q.end??[{type:"newline",offset:-1,indent:H,source:`
109
+ `}];switch(Z[0]){case"|":case">":{let G=Z.indexOf(`
110
+ `),I=Z.substring(0,G),J=Z.substring(G+1)+`
111
+ `,Q=[{type:"block-scalar-header",offset:X,indent:H,source:I}];if(!rU(Q,R))Q.push({type:"newline",offset:-1,indent:H,source:`
112
+ `});return{type:"block-scalar",offset:X,indent:H,props:Q,source:J}}case'"':return{type:"double-quoted-scalar",offset:X,indent:H,source:Z,end:R};case"'":return{type:"single-quoted-scalar",offset:X,indent:H,source:Z,end:R};default:return{type:"scalar",offset:X,indent:H,source:Z,end:R}}}function r8($,q,U={}){let{afterKey:H=!1,implicitKey:z=!1,inFlow:X=!1,type:L}=U,Z="indent"in $?$.indent:null;if(H&&typeof Z==="number")Z+=2;if(!L)switch($.type){case"single-quoted-scalar":L="QUOTE_SINGLE";break;case"double-quoted-scalar":L="QUOTE_DOUBLE";break;case"block-scalar":{let G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");L=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:L="PLAIN"}let R=cU.stringifyString({type:L,value:q},{implicitKey:z||Z===null,indent:Z!==null&&Z>0?" ".repeat(Z):"",inFlow:X,options:{blockQuote:!0,lineWidth:-1}});switch(R[0]){case"|":case">":n8($,R);break;case'"':Eq($,R,"double-quoted-scalar");break;case"'":Eq($,R,"single-quoted-scalar");break;default:Eq($,R,"scalar")}}function n8($,q){let U=q.indexOf(`
113
+ `),H=q.substring(0,U),z=q.substring(U+1)+`
114
+ `;if($.type==="block-scalar"){let X=$.props[0];if(X.type!=="block-scalar-header")throw Error("Invalid block scalar header");X.source=H,$.source=z}else{let{offset:X}=$,L="indent"in $?$.indent:-1,Z=[{type:"block-scalar-header",offset:X,indent:L,source:H}];if(!rU(Z,"end"in $?$.end:void 0))Z.push({type:"newline",offset:-1,indent:L,source:`
115
+ `});for(let R of Object.keys($))if(R!=="type"&&R!=="offset")delete $[R];Object.assign($,{type:"block-scalar",indent:L,props:Z,source:z})}}function rU($,q){if(q)for(let U of q)switch(U.type){case"space":case"comment":$.push(U);break;case"newline":return $.push(U),!0}return!1}function Eq($,q,U){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=U,$.source=q;break;case"block-scalar":{let H=$.props.slice(1),z=q.length;if($.props[0].type==="block-scalar-header")z-=$.props[0].source.length;for(let X of H)X.offset+=z;delete $.props,Object.assign($,{type:U,source:q,end:H});break}case"block-map":case"block-seq":{let z={type:"newline",offset:$.offset+q.length,indent:$.indent,source:`
116
+ `};delete $.items,Object.assign($,{type:U,source:q,end:[z]});break}default:{let H="indent"in $?$.indent:-1,z="end"in $&&Array.isArray($.end)?$.end.filter((X)=>X.type==="space"||X.type==="comment"||X.type==="newline"):[];for(let X of Object.keys($))if(X!=="type"&&X!=="offset")delete $[X];Object.assign($,{type:U,indent:H,source:q,end:z})}}}o8.createScalarToken=c8;o8.resolveAsScalar=i8;o8.setScalarValue=r8});var oU=T((UX)=>{var qX=($)=>("type"in $)?M$($):A$($);function M$($){switch($.type){case"block-scalar":{let q="";for(let U of $.props)q+=M$(U);return q+$.source}case"block-map":case"block-seq":{let q="";for(let U of $.items)q+=A$(U);return q}case"flow-collection":{let q=$.start.source;for(let U of $.items)q+=A$(U);for(let U of $.end)q+=U.source;return q}case"document":{let q=A$($);if($.end)for(let U of $.end)q+=U.source;return q}default:{let q=$.source;if("end"in $&&$.end)for(let U of $.end)q+=U.source;return q}}}function A$({start:$,key:q,sep:U,value:H}){let z="";for(let X of $)z+=X.source;if(q)z+=M$(q);if(U)for(let X of U)z+=X.source;if(H)z+=M$(H);return z}UX.stringify=qX});var $2=T((XX)=>{var gq=Symbol("break visit"),zX=Symbol("skip children"),tU=Symbol("remove item");function U0($,q){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};eU(Object.freeze([]),$,q)}U0.BREAK=gq;U0.SKIP=zX;U0.REMOVE=tU;U0.itemAtPath=($,q)=>{let U=$;for(let[H,z]of q){let X=U?.[H];if(X&&"items"in X)U=X.items[z];else return}return U};U0.parentCollection=($,q)=>{let U=U0.itemAtPath($,q.slice(0,-1)),H=q[q.length-1][0],z=U?.[H];if(z&&"items"in z)return z;throw Error("Parent collection not found")};function eU($,q,U){let H=U(q,$);if(typeof H==="symbol")return H;for(let z of["key","value"]){let X=q[z];if(X&&"items"in X){for(let L=0;L<X.items.length;++L){let Z=eU(Object.freeze($.concat([[z,L]])),X.items[L],U);if(typeof Z==="number")L=Z-1;else if(Z===gq)return gq;else if(Z===tU)X.items.splice(L,1),L-=1}if(typeof H==="function"&&z==="key")H=H(q,$)}}return typeof H==="function"?H(q,$):H}XX.visit=U0});var K$=T((BX)=>{var uq=nU(),ZX=oU(),RX=$2(),yq="\uFEFF",hq="\x02",kq="\x18",xq="\x1F",GX=($)=>!!$&&("items"in $),JX=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function IX($){switch($){case yq:return"<BOM>";case hq:return"<DOC>";case kq:return"<FLOW_END>";case xq:return"<SCALAR>";default:return JSON.stringify($)}}function QX($){switch($){case yq:return"byte-order-mark";case hq:return"doc-mode";case kq:return"flow-error-end";case xq:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
117
+ `:case`\r
118
+ `: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($[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}BX.createScalarToken=uq.createScalarToken;BX.resolveAsScalar=uq.resolveAsScalar;BX.setScalarValue=uq.setScalarValue;BX.stringify=ZX.stringify;BX.visit=RX.visit;BX.BOM=yq;BX.DOCUMENT=hq;BX.FLOW_END=kq;BX.SCALAR=xq;BX.isCollection=GX;BX.isScalar=JX;BX.prettyToken=IX;BX.tokenType=QX});var mq=T((SX)=>{var k0=K$();function u($){switch($){case void 0:case" ":case`
119
+ `:case"\r":case"\t":return!0;default:return!1}}var q2=new Set("0123456789ABCDEFabcdef"),bX=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),b$=new Set(",[]{}"),NX=new Set(` ,[]{}
120
+ \r `),vq=($)=>!$||NX.has($);class U2{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($,q=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!q;let U=this.next??"stream";while(U&&(q||this.hasChars(1)))U=yield*this.parseNext(U)}atLineEnd(){let $=this.pos,q=this.buffer[$];while(q===" "||q==="\t")q=this.buffer[++$];if(!q||q==="#"||q===`
121
+ `)return!0;if(q==="\r")return this.buffer[$+1]===`
122
+ `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let q=this.buffer[$];if(this.indentNext>0){let U=0;while(q===" ")q=this.buffer[++U+$];if(q==="\r"){let H=this.buffer[U+$+1];if(H===`
123
+ `||!H&&!this.atEnd)return $+U+1}return q===`
124
+ `||U>=this.indentNext||!q&&!this.atEnd?$+U:-1}if(q==="-"||q==="."){let U=this.buffer.substr($,3);if((U==="---"||U==="...")&&u(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
125
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===k0.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let q=$.length,U=$.indexOf("#");while(U!==-1){let z=$[U-1];if(z===" "||z==="\t"){q=U-1;break}else U=$.indexOf("#",U+1)}while(!0){let z=$[q-1];if(z===" "||z==="\t")q-=1;else break}let H=(yield*this.pushCount(q))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-H),this.pushNewline(),"stream"}if(this.atLineEnd()){let q=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-q),yield*this.pushNewline(),"stream"}return yield k0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let q=this.peek(3);if((q==="---"||q==="...")&&u(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,q==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!u(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,q]=this.peek(2);if(!q&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&u(q)){let U=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=U,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let q=yield*this.pushIndicators();switch($[q]){case"#":yield*this.pushCount($.length-q);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(vq),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return q+=yield*this.parseBlockScalarHeader(),q+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-q),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,q,U=-1;do{if($=yield*this.pushNewline(),$>0)q=yield*this.pushSpaces(!1),this.indentValue=U=q;else q=0;q+=yield*this.pushSpaces(!0)}while($+q>0);let H=this.getLine();if(H===null)return this.setNext("flow");if(U!==-1&&U<this.indentNext&&H[0]!=="#"||U===0&&(H.startsWith("---")||H.startsWith("..."))&&u(H[3])){if(!(U===this.indentNext-1&&this.flowLevel===1&&(H[0]==="]"||H[0]==="}")))return this.flowLevel=0,yield k0.FLOW_END,yield*this.parseLineStart()}let z=0;while(H[z]===",")z+=yield*this.pushCount(1),z+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(z+=yield*this.pushIndicators(),H[z]){case void 0:return"flow";case"#":return yield*this.pushCount(H.length-z),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(vq),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let X=this.charAt(1);if(this.flowKey||u(X)||X===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),q=this.buffer.indexOf($,this.pos+1);if($==="'")while(q!==-1&&this.buffer[q+1]==="'")q=this.buffer.indexOf("'",q+2);else while(q!==-1){let z=0;while(this.buffer[q-1-z]==="\\")z+=1;if(z%2===0)break;q=this.buffer.indexOf('"',q+1)}let U=this.buffer.substring(0,q),H=U.indexOf(`
126
+ `,this.pos);if(H!==-1){while(H!==-1){let z=this.continueScalar(H+1);if(z===-1)break;H=U.indexOf(`
127
+ `,z)}if(H!==-1)q=H-(U[H-1]==="\r"?2:1)}if(q===-1){if(!this.atEnd)return this.setNext("quoted-scalar");q=this.buffer.length}return yield*this.pushToIndex(q+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let q=this.buffer[++$];if(q==="+")this.blockScalarKeep=!0;else if(q>"0"&&q<="9")this.blockScalarIndent=Number(q)-1;else if(q!=="-")break}return yield*this.pushUntil((q)=>u(q)||q==="#")}*parseBlockScalar(){let $=this.pos-1,q=0,U;$:for(let z=this.pos;U=this.buffer[z];++z)switch(U){case" ":q+=1;break;case`
128
+ `:$=z,q=0;break;case"\r":{let X=this.buffer[z+1];if(!X&&!this.atEnd)return this.setNext("block-scalar");if(X===`
129
+ `)break}default:break $}if(!U&&!this.atEnd)return this.setNext("block-scalar");if(q>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=q;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let z=this.continueScalar($+1);if(z===-1)break;$=this.buffer.indexOf(`
130
+ `,z)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let H=$+1;U=this.buffer[H];while(U===" ")U=this.buffer[++H];if(U==="\t"){while(U==="\t"||U===" "||U==="\r"||U===`
131
+ `)U=this.buffer[++H];$=H-1}else if(!this.blockScalarKeep)do{let z=$-1,X=this.buffer[z];if(X==="\r")X=this.buffer[--z];let L=z;while(X===" ")X=this.buffer[--z];if(X===`
132
+ `&&z>=this.pos&&z+1+q>L)$=z;else break}while(!0);return yield k0.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,q=this.pos-1,U=this.pos-1,H;while(H=this.buffer[++U])if(H===":"){let z=this.buffer[U+1];if(u(z)||$&&b$.has(z))break;q=U}else if(u(H)){let z=this.buffer[U+1];if(H==="\r")if(z===`
133
+ `)U+=1,H=`
134
+ `,z=this.buffer[U+1];else q=U;if(z==="#"||$&&b$.has(z))break;if(H===`
135
+ `){let X=this.continueScalar(U+1);if(X===-1)break;U=Math.max(U,X-2)}}else{if($&&b$.has(H))break;q=U}if(!H&&!this.atEnd)return this.setNext("plain-scalar");return yield k0.SCALAR,yield*this.pushToIndex(q+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,q){let U=this.buffer.slice(this.pos,$);if(U)return yield U,this.pos+=U.length,U.length;else if(q)yield"";return 0}*pushIndicators(){let $=0;$:while(!0){switch(this.charAt(0)){case"!":$+=yield*this.pushTag(),$+=yield*this.pushSpaces(!0);continue $;case"&":$+=yield*this.pushUntil(vq),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let q=this.flowLevel>0,U=this.charAt(1);if(u(U)||q&&b$.has(U)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0);continue $}}}break $}return $}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,q=this.buffer[$];while(!u(q)&&q!==">")q=this.buffer[++$];return yield*this.pushToIndex(q===">"?$+1:$,!1)}else{let $=this.pos+1,q=this.buffer[$];while(q)if(bX.has(q))q=this.buffer[++$];else if(q==="%"&&q2.has(this.buffer[$+1])&&q2.has(this.buffer[$+2]))q=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
136
+ `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
137
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let q=this.pos-1,U;do U=this.buffer[++q];while(U===" "||$&&U==="\t");let H=q-this.pos;if(H>0)yield this.buffer.substr(this.pos,H),this.pos=q;return H}*pushUntil($){let q=this.pos,U=this.buffer[q];while(!$(U))U=this.buffer[++q];return yield*this.pushToIndex(q,!1)}}SX.Lexer=U2});var pq=T((jX)=>{class H2{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let q=0,U=this.lineStarts.length;while(q<U){let z=q+U>>1;if(this.lineStarts[z]<$)q=z+1;else U=z}if(this.lineStarts[q]===$)return{line:q+1,col:1};if(q===0)return{line:0,col:$};let H=this.lineStarts[q-1];return{line:q,col:$-H+1}}}}jX.LineCounter=H2});var dq=T((uX)=>{var EX=X0("process"),z2=K$(),gX=mq();function c($,q){for(let U=0;U<$.length;++U)if($[U].type===q)return!0;return!1}function X2($){for(let q=0;q<$.length;++q)switch($[q].type){case"space":case"comment":case"newline":break;default:return q}return-1}function Z2($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function N$($){switch($.type){case"document":return $.start;case"block-map":{let q=$.items[$.items.length-1];return q.sep??q.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function T0($){if($.length===0)return[];let q=$.length;$:while(--q>=0)switch($[q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++q]?.type==="space");return $.splice(q,$.length)}function S$($,q){if(q.length<1e5)Array.prototype.push.apply($,q);else for(let U=0;U<q.length;++U)$.push(q[U])}function L2($){if($.start.type==="flow-seq-start"){for(let q of $.items)if(q.sep&&!q.value&&!c(q.start,"explicit-key-ind")&&!c(q.sep,"map-value-ind")){if(q.key)q.value=q.key;if(delete q.key,Z2(q.value))if(q.value.end)S$(q.value.end,q.sep);else q.value.end=q.sep;else S$(q.start,q.sep);delete q.sep}}}class R2{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new gX.Lexer,this.onNewLine=$}*parse($,q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let U of this.lexer.lex($,q))yield*this.next(U);if(!q)yield*this.end()}*next($){if(this.source=$,EX.env.LOG_TOKENS)console.log("|",z2.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let q=z2.tokenType($);if(!q){let U=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:U,source:$}),this.offset+=$.length}else if(q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=q,yield*this.step(),q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.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 $=this.peek(1);if(this.type==="doc-end"&&$?.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(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let q=$??this.stack.pop();if(!q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield q;else{let U=this.peek(1);if(q.type==="block-scalar")q.indent="indent"in U?U.indent:0;else if(q.type==="flow-collection"&&U.type==="document")q.indent=0;if(q.type==="flow-collection")L2(q);switch(U.type){case"document":U.value=q;break;case"block-scalar":U.props.push(q);break;case"block-map":{let H=U.items[U.items.length-1];if(H.value){U.items.push({start:[],key:q,sep:[]}),this.onKeyLine=!0;return}else if(H.sep)H.value=q;else{Object.assign(H,{key:q,sep:[]}),this.onKeyLine=!H.explicitKey;return}break}case"block-seq":{let H=U.items[U.items.length-1];if(H.value)U.items.push({start:[],value:q});else H.value=q;break}case"flow-collection":{let H=U.items[U.items.length-1];if(!H||H.value)U.items.push({start:[],key:q,sep:[]});else if(H.sep)H.value=q;else Object.assign(H,{key:q,sep:[]});return}default:yield*this.pop(),yield*this.pop(q)}if((U.type==="document"||U.type==="block-map"||U.type==="block-seq")&&(q.type==="block-map"||q.type==="block-seq")){let H=q.items[q.items.length-1];if(H&&!H.sep&&!H.value&&H.start.length>0&&X2(H.start)===-1&&(q.indent===0||H.start.every((z)=>z.type!=="comment"||z.indent<q.indent))){if(U.type==="document")U.end=H.start;else U.items.push({start:H.start});q.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 $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(X2($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let q=this.startBlockValue($);if(q)this.stack.push(q);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let q=N$(this.peek(2)),U=T0(q),H;if($.end)H=$.end,H.push(this.sourceToken),delete $.end;else H=[this.sourceToken];let z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:U,key:$,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let q=this.source.indexOf(`
138
+ `)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
139
+ `,q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let q=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,q.value){let U="end"in q.value?q.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)$.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else{if(this.atIndentedComment(q.start,$.indent)){let H=$.items[$.items.length-2]?.value?.end;if(Array.isArray(H)){S$(H,q.start),H.push(this.sourceToken),$.items.pop();return}}q.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let U=!this.onKeyLine&&this.indent===$.indent,H=U&&(q.sep||q.explicitKey)&&this.type!=="seq-item-ind",z=[];if(H&&q.sep&&!q.value){let X=[];for(let L=0;L<q.sep.length;++L){let Z=q.sep[L];switch(Z.type){case"newline":X.push(L);break;case"space":break;case"comment":if(Z.indent>$.indent)X.length=0;break;default:X.length=0}}if(X.length>=2)z=q.sep.splice(X[1])}switch(this.type){case"anchor":case"tag":if(H||q.value)z.push(this.sourceToken),$.items.push({start:z}),this.onKeyLine=!0;else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!q.sep&&!q.explicitKey)q.start.push(this.sourceToken),q.explicitKey=!0;else if(H||q.value)z.push(this.sourceToken),$.items.push({start:z,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(q.explicitKey)if(!q.sep)if(c(q.start,"newline"))Object.assign(q,{key:null,sep:[this.sourceToken]});else{let X=T0(q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]})}else if(q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(c(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]});else if(Z2(q.key)&&!c(q.sep,"newline")){let X=T0(q.start),L=q.key,Z=q.sep;Z.push(this.sourceToken),delete q.key,delete q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:L,sep:Z}]})}else if(z.length>0)q.sep=q.sep.concat(z,this.sourceToken);else q.sep.push(this.sourceToken);else if(!q.sep)Object.assign(q,{key:null,sep:[this.sourceToken]});else if(q.value||H)$.items.push({start:z,key:null,sep:[this.sourceToken]});else if(c(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(H||q.value)$.items.push({start:z,key:X,sep:[]}),this.onKeyLine=!0;else if(q.sep)this.stack.push(X);else Object.assign(q,{key:X,sep:[]}),this.onKeyLine=!0;return}default:{let X=this.startBlockValue($);if(X){if(X.type==="block-seq"){if(!q.explicitKey&&q.sep&&!c(q.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(U)$.items.push({start:z});this.stack.push(X);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let q=$.items[$.items.length-1];switch(this.type){case"newline":if(q.value){let U="end"in q.value?q.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(q.start,$.indent)){let H=$.items[$.items.length-2]?.value?.end;if(Array.isArray(H)){S$(H,q.start),H.push(this.sourceToken),$.items.pop();return}}q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(q.value||this.indent<=$.indent)break;q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(q.value||c(q.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return}if(this.indent>$.indent){let U=this.startBlockValue($);if(U){this.stack.push(U);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let q=$.items[$.items.length-1];if(this.type==="flow-error-end"){let U;do yield*this.pop(),U=this.peek(1);while(U?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!q||q.sep)$.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return;case"map-value-ind":if(!q||q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else Object.assign(q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!q||q.value)$.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(!q||q.value)$.items.push({start:[],key:H,sep:[]});else if(q.sep)this.stack.push(H);else Object.assign(q,{key:H,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let U=this.startBlockValue($);if(U)this.stack.push(U);else yield*this.pop(),yield*this.step()}else{let U=this.peek(2);if(U.type==="block-map"&&(this.type==="map-value-ind"&&U.indent===$.indent||this.type==="newline"&&!U.items[U.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&U.type!=="flow-collection"){let H=N$(U),z=T0(H);L2($);let X=$.end.splice(1,$.end.length);X.push(this.sourceToken);let L={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:z,key:$,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=L}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let q=this.source.indexOf(`
140
+ `)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
141
+ `,q)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){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 q=N$($),U=T0(q);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let q=N$($),U=T0(q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,q){if(this.type!=="comment")return!1;if(this.indent<=q)return!1;return $.every((U)=>U.type==="newline"||U.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){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($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}uX.Parser=R2});var B2=T((lX)=>{var G2=fq(),hX=E0(),x0=g0(),kX=p$(),xX=M(),vX=pq(),J2=dq();function I2($){let q=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||q&&new vX.LineCounter||null,prettyErrors:q}}function mX($,q={}){let{lineCounter:U,prettyErrors:H}=I2(q),z=new J2.Parser(U?.addNewLine),X=new G2.Composer(q),L=Array.from(X.compose(z.parse($)));if(H&&U)for(let Z of L)Z.errors.forEach(x0.prettifyError($,U)),Z.warnings.forEach(x0.prettifyError($,U));if(L.length>0)return L;return Object.assign([],{empty:!0},X.streamInfo())}function Q2($,q={}){let{lineCounter:U,prettyErrors:H}=I2(q),z=new J2.Parser(U?.addNewLine),X=new G2.Composer(q),L=null;for(let Z of X.compose(z.parse($),!0,$.length))if(!L)L=Z;else if(L.options.logLevel!=="silent"){L.errors.push(new x0.YAMLParseError(Z.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(H&&U)L.errors.forEach(x0.prettifyError($,U)),L.warnings.forEach(x0.prettifyError($,U));return L}function pX($,q,U){let H=void 0;if(typeof q==="function")H=q;else if(U===void 0&&q&&typeof q==="object")U=q;let z=Q2($,U);if(!z)return null;if(z.warnings.forEach((X)=>kX.warn(z.options.logLevel,X)),z.errors.length>0)if(z.options.logLevel!=="silent")throw z.errors[0];else z.errors=[];return z.toJS(Object.assign({reviver:H},U))}function dX($,q,U){let H=null;if(typeof q==="function"||Array.isArray(q))H=q;else if(U===void 0&&q)U=q;if(typeof U==="string")U=U.length;if(typeof U==="number"){let z=Math.round(U);U=z<1?void 0:z>8?{indent:8}:{indent:z}}if($===void 0){let{keepUndefined:z}=U??q??{};if(!z)return}if(xX.isDocument($)&&!H)return $.toString(U);return new hX.Document($,H,U).toString(U)}lX.parse=pX;lX.parseAllDocuments=mX;lX.parseDocument=Q2;lX.stringify=dX});import{hapiHome as l5,loadGlobalConfig as a5,runtimeConsole as s5}from"@mcp-com-ai/shared-utils";function cq($,q,U={}){let H=U.warn??(()=>{}),z=new Map,X=(L,Z,R,G)=>{for(let I of[L.name,...L.aliases??[]]){if(z.has(I)){let J=z.get(I);H(`Command '${I}' already provided by ${J.source==="core"?"core":J.pluginName}; ignoring declaration from ${R??"core"}`);continue}z.set(I,{...L,source:Z,pluginName:R,packageName:G})}};for(let L of $)X(L,"core");for(let{plugin:L,packageName:Z}of q)for(let R of L.commands)X(R,"plugin",L.name,Z);return z}function n5($){let q=new Set;for(let[U,H]of $.entries())if(U===H.name)q.add(H);return Array.from(q).filter((U)=>!U.hidden).sort((U,H)=>U.name.localeCompare(H.name))}import{HAPI_CLI_API_VERSION as rq,satisfiesVersionRange as M2}from"@mcp-com-ai/plugin-sdk";var K2=["@mcp-com-ai/plugin-openapi","@mcp-com-ai/plugin-arazzo","@mcp-com-ai/plugin-cloudflare","@mcp-com-ai/enterprise-plugin-auth","@mcp-com-ai/plugin-otel"];async function nq($={}){let q=$.warn??(()=>{}),U=new Set($.blocklist??[]),H=[],z=new Set,X=[];for(let L of $.bundledPlugins??[])X.push({packageName:L.name,source:"bundled",plugin:L});for(let L of $.workspacePackages??[])X.push({packageName:L,source:"workspace"});for(let L of K2)X.push({packageName:L,source:"installed"});for(let L of $.configuredPackages??[])X.push({packageName:L,source:"installed"});for(let{packageName:L,source:Z,plugin:R}of X){if(z.has(L))continue;if(z.add(L),U.has(L))continue;try{let G=R?void 0:await import(L),I=R??(G?.plugin??G?.default);if(!I){q(`Plugin '${L}' loaded but did not export a plugin definition`);continue}if(I.compatibility?.cliApiVersion!==rq){q(`Plugin '${L}' declares cliApiVersion=${I.compatibility?.cliApiVersion}; CLI expects ${rq}. Skipping.`);continue}let J=I.compatibility.core;if(J&&!M2(J.version,J.range)){q(`Plugin '${L}' resolved core ${J.version}, which does not satisfy its declared range ${J.range}. Skipping.`);continue}H.push({plugin:I,packageName:L,source:Z})}catch(G){let I=G instanceof Error?G.message:String(G);if(!b2(G))q(`Plugin '${L}' failed to load: ${I}`)}}return H}function b2($){if(!$||typeof $!=="object")return!1;let q=$.code;if(q==="ERR_MODULE_NOT_FOUND"||q==="MODULE_NOT_FOUND")return!0;let U=$.message??"";return/Cannot find (module|package)/i.test(U)}import{parseArgs as N2,renderCommandHelp as f$}from"@mcp-com-ai/plugin-sdk";var v0=[{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."}];function oq($){return v0.find((q)=>q.command===$)}function tq($){return v0.find((q)=>q.documentRootField===$)}var S2=new Set(["--help","-h","help"]);async function eq($,q,U){if(q.length===0){let L=$.get("help");if(L?.run){let Z=await L.run({positionals:[],options:{},rest:[]},U);return typeof Z==="number"?Z:0}return U.stdout.write(`Usage: hapi <command> [subcommand] [options]
142
+ `),0}let[H,...z]=q;if(!H)return 0;if(H==="--help"||H==="-h"){let L=$.get("help");if(L?.run){let Z=await L.run({positionals:[],options:{},rest:[]},U);return typeof Z==="number"?Z:0}}if(H==="--version"||H==="-v"){let L=$.get("version");if(L?.run){let Z=await L.run({positionals:[],options:{},rest:[]},U);return typeof Z==="number"?Z:0}}let X=$.get(H);if(!X)return C2(H,U);return E$($,X,z,U,[X.name])}async function E$($,q,U,H,z){if(U.length>0&&S2.has(U[0]))return f$(q,H,z.slice(0,-1)),0;let X=U[0];if(q.subcommands&&q.subcommands.length>0&&X&&!X.startsWith("-")){let Z=q.subcommands.find((R)=>R.name===X||R.aliases?.includes(X));if(Z)return E$($,Z,U.slice(1),H,[...z,Z.name]);if(!q.run)return H.stderr.write(`Unknown subcommand: ${z.join(" ")} ${X}
143
+ `),f$(q,H,z.slice(0,-1)),1}if(!q.run)return f$(q,H,z.slice(0,-1)),0;if(q.name==="serve"&&z.length>1){let Z=$.get("serve");if(Z?.source==="core")return E$($,Z,U,H,[Z.name])}let L=N2(U,q.options??[]);try{let Z=await q.run(L,H);return typeof Z==="number"?Z:Number(process.exitCode??0)}catch(Z){let{printCliError:R}=await import("@mcp-com-ai/shared-utils");return R(`\u274C ${z.join(" ")} failed`,Z),1}}function C2($,q){let U=oq($);if(U)return q.stderr.write(`
144
+ Command "${$}" is provided by ${U.packageName}, which is not installed.
145
+ `),q.stderr.write(`
146
+ ${U.description}
147
+
148
+ `),q.stderr.write(`Install it with:
149
+ ${U.installHint??`bun add -g ${U.packageName}`}
150
+
151
+ `),127;return q.stderr.write(`Unknown command: ${$}
152
+ `),q.stderr.write(`Run "hapi help" to see available commands.
153
+ `),127}function $1($){return{name:"help",description:"Show the top-level CLI help",aliases:["--help","-h"],async run(q,U){let H=$(),z=new Map;for(let[R,G]of H.entries())if(R===G.name)z.set(R,G);let X=(R)=>U.stdout.write(R);X(`
154
+ `),X(`HAPI \u2014 turn your APIs into MCP tools.
155
+ `),X(`
156
+ Usage:
157
+ hapi <command> [subcommand] [options]
158
+
159
+ `),X(`Core commands:
160
+ `);let L=[],Z=[];for(let R of z.values()){if(R.hidden)continue;if(R.source==="core")L.push(R);else Z.push(R)}L.sort((R,G)=>R.name.localeCompare(G.name)),Z.sort((R,G)=>R.name.localeCompare(G.name));for(let R of L)X(` ${R.name.padEnd(14)} ${R.description}
161
+ `);if(Z.length>0){X(`
162
+ Plugin commands:
163
+ `);for(let R of Z){let G=R.pluginName?` (${R.pluginName})`:"";X(` ${R.name.padEnd(14)} ${R.description}${G}
164
+ `)}}return X(`
165
+ Examples:
166
+ `),X(` hapi version
167
+ `),X(` hapi plugins list
168
+ `),X(` hapi openapi init petstore
169
+ `),X(` hapi cloudflare deploy --openapi https://.../openapi.json
170
+
171
+ `),X(`Documentation: https://docs.mcp.com.ai
172
+
173
+ `),X(`Is the HAPI CLI helpful?
174
+ Don't forget to star the project on GitHub: https://github.com/mcp-com-ai/hapimcp
175
+
176
+ `),0}}}import{HAPI_CLI_API_VERSION as f2}from"@mcp-com-ai/plugin-sdk";var q1="1.0.1-beta.260912";var m0=q1;var U1={name:"version",aliases:["--version","-v"],description:"Show the installed CLI version",run:async($,q)=>{return q.stdout.write(`hapi ${m0}
177
+ `),q.stdout.write(`plugin-contract v${f2}
178
+ `),0}};function H1($){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(q,U){let H=$();if(H.length===0)return U.stdout.write("No plugins loaded. Run `hapi plugins available` to see what you can install.\n"),0;U.stdout.write(`
179
+ Loaded plugins:
180
+ `);for(let z of H){let X=z.plugin.displayName??z.plugin.name;if(U.stdout.write(` ${X.padEnd(36)} ${z.plugin.version.padEnd(10)} [${z.source}]
181
+ `),z.plugin.description)U.stdout.write(` ${z.plugin.description}
182
+ `)}return U.stdout.write(`
183
+ `),0}},{name:"available",description:"Show first-party plugins the CLI knows about",async run(q,U){let H=new Set($().map((z)=>z.packageName));U.stdout.write(`
184
+ First-party HAPI plugins:
185
+
186
+ `);for(let z of v0){let X=H.has(z.packageName)?"installed":"not installed";if(U.stdout.write(` ${z.command.padEnd(12)} ${z.packageName.padEnd(40)} [${X}]
187
+ `),U.stdout.write(` ${z.description}
188
+ `),z.installHint&&!H.has(z.packageName))U.stdout.write(` Install: ${z.installHint}
189
+ `)}return U.stdout.write(`
190
+ `),0}}]}}import{HAPI_CLI_API_VERSION as E2,satisfiesVersionRange as g2}from"@mcp-com-ai/plugin-sdk";import{getHapiPaths as u2,hasFileSystemAccess as z1,isBunRuntime as y2,isCloudflareRuntime as h2}from"@mcp-com-ai/shared-utils";function X1($){return{name:"doctor",description:"Check the local HAPI environment for common configuration issues",async run(q,U){let H=(R)=>U.stdout.write(R),z=(R)=>U.stderr.write(R),X=0;H(`
191
+ HAPI doctor
192
+ `),H(`===========
193
+
194
+ `),H(`CLI version: ${m0}
195
+ `),H(`Plugin contract: v${E2}
196
+ `),H(`Runtime: ${y2?"bun":h2?"cloudflare-workers":"node/other"}
197
+ `),H(`File-system access: ${z1?"yes":"no"}
198
+ `);let L=u2();if(H(`
199
+ HAPI_HOME: ${L.home}
200
+ `),H(` specs: ${L.specs}
201
+ `),H(` config: ${L.config}
202
+ `),H(` logs: ${L.logs}
203
+ `),H(` certs: ${L.certs}
204
+ `),z1){let R=await import("fs/promises");for(let[G,I]of Object.entries({home:L.home,config:L.config,specs:L.specs}))try{if(!(await R.stat(I)).isDirectory())z(` \u2717 ${G} exists but is not a directory: ${I}
205
+ `),X++}catch{H(` \u2022 ${G} missing (will be created on first use): ${I}
206
+ `)}}let Z=$();H(`
207
+ Loaded plugins: ${Z.length}
208
+ `);for(let R of Z){H(` \u2713 ${R.plugin.name}@${R.plugin.version} [${R.source}]
209
+ `);let G=R.plugin.compatibility.core;if(G){let I=g2(G.version,G.range);if(H(` core: ${G.version} ${I?"satisfies":"does not satisfy"} ${G.range}
210
+ `),!I)X++}}if(Z.length===0)H(` \u2022 no plugins loaded
211
+ `);return H(`
212
+ `),X===0?0:1}}}import{existsSync as O2}from"fs";import{resolve as sq}from"path";import{pathToFileURL as E5}from"url";var rX=fq(),nX=E0(),oX=Tq(),lq=g0(),tX=w0(),r=M(),eX=l(),$5=b(),q5=s(),U5=i(),gZ=K$(),H5=mq(),z5=pq(),X5=dq(),C$=B2(),D2=P0();var L5=rX.Composer,Z5=nX.Document,R5=oX.Schema,G5=lq.YAMLError,J5=lq.YAMLParseError,I5=lq.YAMLWarning,Q5=tX.Alias,B5=r.isAlias,D5=r.isCollection,O5=r.isDocument,T5=r.isMap,P5=r.isNode,Y5=r.isPair,w5=r.isScalar,_5=r.isSeq,V5=eX.Pair,W5=$5.Scalar,F5=q5.YAMLMap,A5=U5.YAMLSeq;var M5=H5.Lexer,K5=z5.LineCounter,b5=X5.Parser,aq=C$.parse,N5=C$.parseAllDocuments,S5=C$.parseDocument,C5=C$.stringify,j5=D2.visit,f5=D2.visitAsync;import{DEFAULT_DOCUMENT_SOURCE_POLICY as j$,assertRemoteDocumentUrl as g5,redactDocumentUrl as u5}from"@mcp-com-ai/plugin-sdk";async function T2($,q){let U=$.trim();if(!U)return;let H=v5(U);if(H?.protocol==="http:"||H?.protocol==="https:")return k5(U,H,q);if(H&&H.protocol!=="file:"&&H.protocol!=="path:")throw Error(`Unsupported document source scheme: ${H.protocol}`);let z=H?.protocol==="file:"?Bun.fileURLToPath(H):y5(H?.protocol==="path:"?m5(H):U,q);if(!z)return;return h5(U,z,q.maxBytes??j$.maxBytes)}function y5($,q){let U=sq(q.cwd,$);if(O2(U))return U;let H=sq(q.hapiHome,"specs");for(let z of["",".json",".yaml",".yml"]){let X=sq(H,`${$}${z}`);if(O2(X))return X}return}async function h5($,q,U){let H=Bun.file(q);if(H.size>U)throw Error(`Document source exceeds ${U} bytes: ${q}`);let z=await H.text();Y2(z,U,q);let X=E5(q).href;return w2({identifier:$,canonicalUri:X,baseUri:new URL(".",X).href,raw:z,document:P2(z,q),remote:!1})}async function k5($,q,U){let H=U.fetchImpl??fetch,z=U.maxBytes??j$.maxBytes,X=new AbortController,L=setTimeout(()=>X.abort(),U.timeoutMs??j$.timeoutMs),Z=q;try{for(let R=0;R<=j$.maxRedirects;R++){g5(Z);let G=await H(Z,{redirect:"manual",signal:X.signal});if(x5(G.status)){let Q=G.headers.get("location");if(!Q)throw Error(`Redirect from ${H0(Z)} has no Location header`);Z=new URL(Q,Z);continue}if(!G.ok)throw Error(`Unable to load ${H0(Z)}: HTTP ${G.status}`);let I=Number(G.headers.get("content-length"));if(Number.isFinite(I)&&I>z)throw Error(`Document source exceeds ${z} bytes: ${H0(Z)}`);let J=await G.text();return Y2(J,z,H0(Z)),w2({identifier:$,canonicalUri:Z.href,baseUri:new URL(".",Z).href,raw:J,document:P2(J,H0(Z)),remote:!0})}throw Error(`Too many redirects while loading ${H0(q)}`)}catch(R){if(X.signal.aborted)throw Error(`Timed out loading ${H0(Z)}`);throw R}finally{clearTimeout(L)}}function P2($,q){try{let U=aq($);if(!U||typeof U!=="object"||Array.isArray(U))throw Error("document root must be an object");return U}catch(U){throw Error(`Unable to parse ${q}: ${U instanceof Error?U.message:String(U)}`)}}function Y2($,q,U){if(new TextEncoder().encode($).byteLength>q)throw Error(`Document source exceeds ${q} bytes: ${U}`)}function w2($){return Object.freeze($)}function x5($){return[301,302,303,307,308].includes($)}function v5($){try{return new URL($)}catch{return}}function m5($){let q=decodeURIComponent($.pathname);return $.hostname?`${$.hostname}${q}`:q}function H0($){return u5($)}function V2($){let q=()=>$().flatMap((U)=>U.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 d5(q())},async run(U,H){return p5(q(),U,H)}}}async function p5($,q,U){let H=typeof q.options.specs==="string"?q.options.specs:void 0,z=typeof q.options.openapi==="string"?q.options.openapi:void 0;if(H&&z)return U.stderr.write(`Use either --specs or --openapi, not both.
213
+ `),1;let X=H??z??q.positionals[0]??"",L=await T2(X,{cwd:U.cwd,hapiHome:U.hapiHome});if(!L){let I=$.filter((J)=>J.legacyFallback);if(I.length!==1)return U.stderr.write(`Unable to resolve document source: ${X||"(missing)"}
214
+ `),1;return _2(await I[0].serve({source:L,invocation:q},U))}let Z=L.document,R=$.filter((I)=>typeof Z[I.rootField]==="string");if(R.length>1)return U.stderr.write(`Ambiguous document ${L.identifier}: multiple root fields matched (${R.map((I)=>I.rootField).join(", ")})
215
+ `),1;if(R.length===0){let I=Object.keys(Z).map((J)=>tq(J)).find(Boolean);if(I)return U.stderr.write(`Document type requires ${I.packageName}, which is not installed.
216
+ `),U.stderr.write(`Install it with:
217
+ ${I.installHint??`bun add -g ${I.packageName}`}
218
+ `),127;return U.stderr.write(`Unknown document type: expected one root version field such as "openapi" or "arazzo".
219
+ `),1}let G=R[0];if(z&&G.kind!=="openapi")return U.stderr.write(`Expected an OpenAPI document from --openapi, received ${G.kind}.
220
+ `),1;return _2(await G.serve({source:L,invocation:q},U))}function d5($){let q=new Map;for(let U of $)for(let H of U.options??[]){let z=q.get(H.name);if(z&&(z.type!==H.type||z.alias!==H.alias))throw Error(`Incompatible --${H.name} declarations from serve providers`);if(!z)q.set(H.name,H)}return[...q.values()]}function _2($){return typeof $==="number"?$:Number(process.exitCode??0)}function W2($){return[$1($.getRegistry),U1,V2($.getLoaded),H1($.getLoaded),X1($.getLoaded)]}async function F2($){let q=$.stdout??process.stdout,U=$.stderr??process.stderr,H=$.stdin??process.stdin,z=$.env??process.env,X=$.cwd??process.cwd(),L=$.silent??!1,Z=(B)=>{if(!L)U.write(`warn: ${B}
221
+ `)},R=await a5().catch(()=>({plugins:void 0,pluginsDisabled:void 0})),G=await nq({bundledPlugins:$.bundledPlugins,workspacePackages:$.workspacePackages,configuredPackages:Array.isArray(R.plugins)?R.plugins:void 0,blocklist:Array.isArray(R.pluginsDisabled)?R.pluginsDisabled:void 0,warn:Z}),I=new Map,O=W2({getRegistry:()=>I,getLoaded:()=>G});I=cq(O,G,{warn:Z});let P={cwd:X,env:z,stdout:q,stderr:U,stdin:H,rawArgv:$.argv,hapiHome:l5,services:new Map};for(let{plugin:B}of G)if(typeof B.onLoad==="function")try{await B.onLoad(P)}catch(D){Z(`Plugin '${B.name}' onLoad failed: ${D instanceof Error?D.message:String(D)}`)}try{return await eq(I,$.argv,P)}catch(B){return s5.error(B),1}}var A2=["@mcp-com-ai/plugin-openapi","@mcp-com-ai/plugin-arazzo","@mcp-com-ai/plugin-cloudflare","@mcp-com-ai/plugin-otel"];import{printCliError as i5}from"@mcp-com-ai/shared-utils";async function c5(){let $=process.argv.slice(2),q=await F2({argv:$,workspacePackages:A2});process.exit(q)}c5().catch(($)=>{i5("HAPI could not complete the command",$),process.exit(1)});
@@ -0,0 +1,3 @@
1
+ import type { CliCommand } from "@mcp-com-ai/plugin-sdk";
2
+ import type { LoadedPlugin } from "../core/types";
3
+ export declare function createDoctorCommand(getLoaded: () => readonly LoadedPlugin[]): CliCommand;
@@ -0,0 +1,3 @@
1
+ import type { CliCommand } from '@mcp-com-ai/plugin-sdk';
2
+ import type { RegisteredCommand } from '../core/types';
3
+ export declare function createHelpCommand(getRegistry: () => Map<string, RegisteredCommand>): CliCommand;
@@ -0,0 +1,7 @@
1
+ import type { CliCommand } from '@mcp-com-ai/plugin-sdk';
2
+ import type { LoadedPlugin, RegisteredCommand } from '../core/types';
3
+ export interface BuildBuiltinsOptions {
4
+ getRegistry: () => Map<string, RegisteredCommand>;
5
+ getLoaded: () => readonly LoadedPlugin[];
6
+ }
7
+ export declare function buildBuiltins(options: BuildBuiltinsOptions): CliCommand[];
@@ -0,0 +1,3 @@
1
+ import type { CliCommand } from '@mcp-com-ai/plugin-sdk';
2
+ import type { LoadedPlugin } from '../core/types';
3
+ export declare function createPluginsCommand(getLoaded: () => readonly LoadedPlugin[]): CliCommand;
@@ -0,0 +1,4 @@
1
+ import type { CliCommand, CliContext, CliInvocation, ServeProvider } from "@mcp-com-ai/plugin-sdk";
2
+ import type { LoadedPlugin } from "../core/types";
3
+ export declare function createServeCommand(getLoaded: () => readonly LoadedPlugin[]): CliCommand;
4
+ export declare function dispatchServe(providers: readonly ServeProvider[], invocation: CliInvocation, context: CliContext): Promise<number>;
@@ -0,0 +1,2 @@
1
+ import type { CliCommand } from '@mcp-com-ai/plugin-sdk';
2
+ export declare const versionCommand: CliCommand;
@@ -0,0 +1,20 @@
1
+ import type { CliCommand } from '@mcp-com-ai/plugin-sdk';
2
+ import type { LoadedPlugin, RegisteredCommand } from './types';
3
+ /**
4
+ * Merges built-in and plugin-provided commands into a single registry.
5
+ *
6
+ * Conflict policy: built-ins win over plugins; earlier plugins win over
7
+ * later ones. The CLI logs a warning when a plugin tries to claim a name
8
+ * that's already taken — it does not crash. (Enterprise users
9
+ * occasionally extend commands with internal overlays; silent override
10
+ * is a debugging nightmare, silent refusal is surprising.)
11
+ */
12
+ export interface BuildRegistryOptions {
13
+ warn?: (msg: string) => void;
14
+ }
15
+ export declare function buildCommandRegistry(builtins: readonly CliCommand[], plugins: readonly LoadedPlugin[], options?: BuildRegistryOptions): Map<string, RegisteredCommand>;
16
+ /**
17
+ * Produce a sorted, dedupe list of registered commands for `hapi help`
18
+ * output. Aliases are hidden from the list to avoid noise.
19
+ */
20
+ export declare function listCommands(registry: Map<string, RegisteredCommand>): RegisteredCommand[];
@@ -0,0 +1,10 @@
1
+ import { type DocumentSourceEnvelope } from "@mcp-com-ai/plugin-sdk";
2
+ export interface ResolveDocumentSourceOptions {
3
+ cwd: string;
4
+ hapiHome: string;
5
+ fetchImpl?: typeof fetch;
6
+ maxBytes?: number;
7
+ timeoutMs?: number;
8
+ }
9
+ export declare function resolveDocumentSource(identifier: string, options: ResolveDocumentSourceOptions): Promise<DocumentSourceEnvelope | undefined>;
10
+ export declare function redactUrl(value: URL | string): string;
@@ -0,0 +1,6 @@
1
+ export * from './types';
2
+ export * from './document-source';
3
+ export * from './command-registry';
4
+ export * from './plugin-loader';
5
+ export * from './run-command';
6
+ export * from './known-plugins';