buildkeel 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/THIRD-PARTY-NOTICES +3 -3
  2. package/antigravity/THIRD-PARTY-NOTICES +3 -3
  3. package/antigravity/agents/bk-break-it-flash.md +25 -0
  4. package/antigravity/agents/bk-break-it.md +25 -0
  5. package/antigravity/agents/bk-designer-flash.md +20 -0
  6. package/antigravity/agents/bk-designer.md +20 -0
  7. package/antigravity/agents/bk-edge-cases-flash.md +31 -0
  8. package/antigravity/agents/bk-edge-cases.md +31 -0
  9. package/antigravity/agents/bk-final-quality-reviewer-flash.md +47 -0
  10. package/antigravity/agents/bk-final-quality-reviewer.md +47 -0
  11. package/antigravity/agents/bk-final-spec-reviewer-flash.md +37 -0
  12. package/antigravity/agents/bk-final-spec-reviewer.md +37 -0
  13. package/antigravity/agents/bk-implementer-flash.md +32 -0
  14. package/antigravity/agents/bk-implementer.md +32 -0
  15. package/antigravity/agents/bk-note-checker-flash.md +19 -0
  16. package/antigravity/agents/bk-note-checker.md +19 -0
  17. package/antigravity/agents/bk-quality-reviewer-flash.md +47 -0
  18. package/antigravity/agents/bk-quality-reviewer.md +47 -0
  19. package/antigravity/agents/bk-readiness-reader-flash.md +28 -0
  20. package/antigravity/agents/bk-readiness-reader.md +28 -0
  21. package/antigravity/agents/bk-spec-reviewer-flash.md +37 -0
  22. package/antigravity/agents/bk-spec-reviewer.md +37 -0
  23. package/antigravity/bin/bk-launch.cmd +6 -11
  24. package/antigravity/bin/bk-start.cjs +4 -1
  25. package/antigravity/dist/hooks/main.js +121 -118
  26. package/antigravity/dist/server/main.js +622 -394
  27. package/antigravity/package.json +1 -1
  28. package/antigravity/plugin.json +1 -1
  29. package/antigravity/practices/P-01.md +7 -0
  30. package/antigravity/practices/P-02.md +7 -0
  31. package/antigravity/practices/P-03.md +7 -0
  32. package/antigravity/practices/P-04.md +7 -0
  33. package/antigravity/practices/P-05.md +7 -0
  34. package/antigravity/practices/P-06.md +7 -0
  35. package/antigravity/practices/P-07.md +7 -0
  36. package/antigravity/practices/P-08.md +7 -0
  37. package/antigravity/practices/P-09.md +7 -0
  38. package/antigravity/practices/P-10.md +7 -0
  39. package/antigravity/practices/P-11.md +7 -0
  40. package/antigravity/practices/P-12.md +7 -0
  41. package/antigravity/practices/P-13.md +7 -0
  42. package/antigravity/practices/P-14.md +7 -0
  43. package/antigravity/practices/P-15.md +7 -0
  44. package/antigravity/rules/buildkeel.md +7 -7
  45. package/antigravity/skills/bk-approve/SKILL.md +5 -3
  46. package/antigravity/skills/bk-build/SKILL.md +138 -24
  47. package/antigravity/skills/bk-capture/SKILL.md +77 -25
  48. package/antigravity/skills/bk-done/SKILL.md +56 -13
  49. package/antigravity/skills/bk-impact/SKILL.md +6 -4
  50. package/antigravity/skills/bk-init/SKILL.md +66 -21
  51. package/antigravity/skills/bk-migrate/SKILL.md +31 -2
  52. package/antigravity/skills/bk-new/SKILL.md +32 -16
  53. package/antigravity/skills/bk-onboard/SKILL.md +26 -13
  54. package/antigravity/skills/bk-pause/SKILL.md +56 -0
  55. package/antigravity/skills/bk-resume/SKILL.md +35 -0
  56. package/antigravity/skills/bk-review/SKILL.md +56 -0
  57. package/antigravity/skills/bk-settings/SKILL.md +18 -0
  58. package/antigravity/skills/bk-stats/SKILL.md +3 -1
  59. package/antigravity/templates/adr.md +31 -0
  60. package/antigravity/templates/{bug.md → defect.md} +5 -3
  61. package/antigravity/templates/design.md +2 -1
  62. package/antigravity/templates/spec-driven/proposal.md +2 -1
  63. package/antigravity/templates/spec-driven/tasks.md +13 -5
  64. package/antigravity/templates/task.md +23 -2
  65. package/antigravity/templates/thread.md +41 -0
  66. package/cli.mjs +85 -85
  67. package/package.json +1 -1
@@ -1,158 +1,161 @@
1
1
  import { createRequire as __bkCreateRequire } from 'node:module'; const require = __bkCreateRequire(import.meta.url);
2
- var Ia=Object.create;var Xn=Object.defineProperty;var $a=Object.getOwnPropertyDescriptor;var _a=Object.getOwnPropertyNames;var Pa=Object.getPrototypeOf,Da=Object.prototype.hasOwnProperty;var Ze=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var g=(s,e)=>()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var Ma=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _a(e))!Da.call(s,i)&&i!==t&&Xn(s,i,{get:()=>e[i],enumerable:!(n=$a(e,i))||n.enumerable});return s};var Zn=(s,e,t)=>(t=s!=null?Ia(Pa(s)):{},Ma(e||!s||!s.__esModule?Xn(t,"default",{value:s,enumerable:!0}):t,s));var O=g(_=>{"use strict";var os=Symbol.for("yaml.alias"),pi=Symbol.for("yaml.document"),tt=Symbol.for("yaml.map"),mi=Symbol.for("yaml.pair"),as=Symbol.for("yaml.scalar"),st=Symbol.for("yaml.seq"),H=Symbol.for("yaml.node.type"),Za=s=>!!s&&typeof s=="object"&&s[H]===os,el=s=>!!s&&typeof s=="object"&&s[H]===pi,tl=s=>!!s&&typeof s=="object"&&s[H]===tt,sl=s=>!!s&&typeof s=="object"&&s[H]===mi,gi=s=>!!s&&typeof s=="object"&&s[H]===as,nl=s=>!!s&&typeof s=="object"&&s[H]===st;function yi(s){if(s&&typeof s=="object")switch(s[H]){case tt:case st:return!0}return!1}function il(s){if(s&&typeof s=="object")switch(s[H]){case os:case tt:case as:case st:return!0}return!1}var rl=s=>(gi(s)||yi(s))&&!!s.anchor;_.ALIAS=os;_.DOC=pi;_.MAP=tt;_.NODE_TYPE=H;_.PAIR=mi;_.SCALAR=as;_.SEQ=st;_.hasAnchor=rl;_.isAlias=Za;_.isCollection=yi;_.isDocument=el;_.isMap=tl;_.isNode=il;_.isPair=sl;_.isScalar=gi;_.isSeq=nl});var ve=g(ls=>{"use strict";var $=O(),D=Symbol("break visit"),bi=Symbol("skip children"),j=Symbol("remove node");function nt(s,e){let t=wi(e);$.isDocument(s)?fe(null,s.contents,t,Object.freeze([s]))===j&&(s.contents=null):fe(null,s,t,Object.freeze([]))}nt.BREAK=D;nt.SKIP=bi;nt.REMOVE=j;function fe(s,e,t,n){let i=Si(s,e,t,n);if($.isNode(i)||$.isPair(i))return ki(s,n,i),fe(s,i,t,n);if(typeof i!="symbol"){if($.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=fe(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===j&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){n=Object.freeze(n.concat(e));let r=fe("key",e.key,t,n);if(r===D)return D;r===j&&(e.key=null);let o=fe("value",e.value,t,n);if(o===D)return D;o===j&&(e.value=null)}}return i}async function it(s,e){let t=wi(e);$.isDocument(s)?await de(null,s.contents,t,Object.freeze([s]))===j&&(s.contents=null):await de(null,s,t,Object.freeze([]))}it.BREAK=D;it.SKIP=bi;it.REMOVE=j;async function de(s,e,t,n){let i=await Si(s,e,t,n);if($.isNode(i)||$.isPair(i))return ki(s,n,i),de(s,i,t,n);if(typeof i!="symbol"){if($.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await de(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===j&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){n=Object.freeze(n.concat(e));let r=await de("key",e.key,t,n);if(r===D)return D;r===j&&(e.key=null);let o=await de("value",e.value,t,n);if(o===D)return D;o===j&&(e.value=null)}}return i}function wi(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Si(s,e,t,n){if(typeof t=="function")return t(s,e,n);if($.isMap(e))return t.Map?.(s,e,n);if($.isSeq(e))return t.Seq?.(s,e,n);if($.isPair(e))return t.Pair?.(s,e,n);if($.isScalar(e))return t.Scalar?.(s,e,n);if($.isAlias(e))return t.Alias?.(s,e,n)}function ki(s,e,t){let n=e[e.length-1];if($.isCollection(n))n.items[s]=t;else if($.isPair(n))s==="key"?n.key=t:n.value=t;else if($.isDocument(n))n.contents=t;else{let i=$.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}ls.visit=nt;ls.visitAsync=it});var cs=g(Ni=>{"use strict";var vi=O(),ol=ve(),al={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ll=s=>s.replace(/[!,[\]{}]/g,e=>al[e]),Ne=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ll(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&vi.isNode(e.contents)){let r={};ol.visit(e.contents,(o,a)=>{vi.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
3
- `)}};Ne.defaultYaml={explicit:!1,version:"1.2"};Ne.defaultTags={"!!":"tag:yaml.org,2002:"};Ni.Directives=Ne});var rt=g(Ae=>{"use strict";var Ai=O(),cl=ve();function ul(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Oi(s){let e=new Set;return cl.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Ei(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function fl(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Oi(s));let o=Ei(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(Ai.isScalar(o.node)||Ai.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}Ae.anchorIsValid=ul;Ae.anchorNames=Oi;Ae.createNodeAnchors=fl;Ae.findNewAnchor=Ei});var us=g(Ci=>{"use strict";function Oe(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=Oe(s,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=Oe(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=Oe(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=Oe(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}Ci.applyReviver=Oe});var J=g(qi=>{"use strict";var dl=O();function Ti(s,e,t){if(Array.isArray(s))return s.map((n,i)=>Ti(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!dl.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}qi.toJS=Ti});var ot=g(Ii=>{"use strict";var hl=us(),Li=O(),pl=J(),fs=class{constructor(e){Object.defineProperty(this,Li.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!Li.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=pl.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?hl.applyReviver(r,{"":a},"",a):a}};Ii.NodeBase=fs});var Ee=g($i=>{"use strict";var ml=rt(),gl=ve(),he=O(),yl=ot(),bl=J(),ds=class extends yl.NodeBase{constructor(e){super(he.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],gl.visit(e,{Node:(r,o)=>{(he.isAlias(o)||he.hasAnchor(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}if(i&&t){let{anchors:r,doc:o,maxAliasCount:a}=t,l=r.get(i);if(l||(bl.toJS(i,null,t),l=r.get(i)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=at(o,i,r)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return i}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(n).res}toString(e,t,n){let i=`*${this.source}`;if(e){if(ml.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function at(s,e,t){if(he.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(he.isCollection(e)){let n=0;for(let i of e.items){let r=at(s,i,t);r>n&&(n=r)}return n}else if(he.isPair(e)){let n=at(s,e.key,t),i=at(s,e.value,t);return Math.max(n,i)}return 1}$i.Alias=ds});var q=g(hs=>{"use strict";var wl=O(),Sl=ot(),kl=J(),vl=s=>!s||typeof s!="function"&&typeof s!="object",V=class extends Sl.NodeBase{constructor(e){super(wl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:kl.toJS(this.value,e,t)}toString(){return String(this.value)}};V.BLOCK_FOLDED="BLOCK_FOLDED";V.BLOCK_LITERAL="BLOCK_LITERAL";V.PLAIN="PLAIN";V.QUOTE_DOUBLE="QUOTE_DOUBLE";V.QUOTE_SINGLE="QUOTE_SINGLE";hs.Scalar=V;hs.isScalarValue=vl});var Ce=g(Pi=>{"use strict";var Nl=Ee(),se=O(),_i=q(),Al="tag:yaml.org,2002:";function Ol(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function El(s,e,t){if(se.isDocument(s)&&(s=s.contents),se.isNode(s))return s;if(se.isPair(s)){let u=t.schema[se.MAP].createNode?.(t.schema,null,t);return u.items.push(s),u}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor??(l.anchor=i(s)),new Nl.Alias(l.anchor);l={anchor:null,node:null},a.set(s,l)}e?.startsWith("!!")&&(e=Al+e.slice(2));let c=Ol(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let u=new _i.Scalar(s);return l&&(l.node=u),u}c=s instanceof Map?o[se.MAP]:Symbol.iterator in Object(s)?o[se.SEQ]:o[se.MAP]}r&&(r(c),delete t.onTagObj);let h=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new _i.Scalar(s);return e?h.tag=e:c.default||(h.tag=c.tag),l&&(l.node=h),h}Pi.createNode=El});var ct=g(lt=>{"use strict";var Cl=Ce(),F=O(),Tl=ot();function ps(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Cl.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Di=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,ms=class extends Tl.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>F.isNode(n)||F.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Di(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(F.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,ps(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(F.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&F.isScalar(r)?r.value:r:F.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!F.isPair(t))return!1;let n=t.value;return n==null||e&&F.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return F.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(F.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,ps(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};lt.Collection=ms;lt.collectionFromPath=ps;lt.isEmptyPath=Di});var Te=g(ut=>{"use strict";var ql=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function gs(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var Ll=(s,e,t)=>s.endsWith(`
4
- `)?gs(t,e):t.includes(`
2
+ var Ua=Object.create;var ci=Object.defineProperty;var Ya=Object.getOwnPropertyDescriptor;var Ja=Object.getOwnPropertyNames;var Va=Object.getPrototypeOf,Wa=Object.prototype.hasOwnProperty;var nt=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var y=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var Ga=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ja(e))!Wa.call(n,i)&&i!==t&&ci(n,i,{get:()=>e[i],enumerable:!(s=Ya(e,i))||s.enumerable});return n};var dn=(n,e,t)=>(t=n!=null?Ua(Va(n)):{},Ga(e||!n||!n.__esModule?ci(t,"default",{value:n,enumerable:!0}):t,n));var C=y(P=>{"use strict";var bn=Symbol.for("yaml.alias"),Ti=Symbol.for("yaml.document"),at=Symbol.for("yaml.map"),Li=Symbol.for("yaml.pair"),kn=Symbol.for("yaml.scalar"),lt=Symbol.for("yaml.seq"),H=Symbol.for("yaml.node.type"),ql=n=>!!n&&typeof n=="object"&&n[H]===bn,Il=n=>!!n&&typeof n=="object"&&n[H]===Ti,$l=n=>!!n&&typeof n=="object"&&n[H]===at,_l=n=>!!n&&typeof n=="object"&&n[H]===Li,qi=n=>!!n&&typeof n=="object"&&n[H]===kn,Pl=n=>!!n&&typeof n=="object"&&n[H]===lt;function Ii(n){if(n&&typeof n=="object")switch(n[H]){case at:case lt:return!0}return!1}function xl(n){if(n&&typeof n=="object")switch(n[H]){case bn:case at:case kn:case lt:return!0}return!1}var Dl=n=>(qi(n)||Ii(n))&&!!n.anchor;P.ALIAS=bn;P.DOC=Ti;P.MAP=at;P.NODE_TYPE=H;P.PAIR=Li;P.SCALAR=kn;P.SEQ=lt;P.hasAnchor=Dl;P.isAlias=ql;P.isCollection=Ii;P.isDocument=Il;P.isMap=$l;P.isNode=xl;P.isPair=_l;P.isScalar=qi;P.isSeq=Pl});var Ce=y(Sn=>{"use strict";var $=C(),D=Symbol("break visit"),$i=Symbol("skip children"),j=Symbol("remove node");function ct(n,e){let t=_i(e);$.isDocument(n)?he(null,n.contents,t,Object.freeze([n]))===j&&(n.contents=null):he(null,n,t,Object.freeze([]))}ct.BREAK=D;ct.SKIP=$i;ct.REMOVE=j;function he(n,e,t,s){let i=Pi(n,e,t,s);if($.isNode(i)||$.isPair(i))return xi(n,s,i),he(n,i,t,s);if(typeof i!="symbol"){if($.isCollection(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=he(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===j&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){s=Object.freeze(s.concat(e));let r=he("key",e.key,t,s);if(r===D)return D;r===j&&(e.key=null);let o=he("value",e.value,t,s);if(o===D)return D;o===j&&(e.value=null)}}return i}async function ut(n,e){let t=_i(e);$.isDocument(n)?await pe(null,n.contents,t,Object.freeze([n]))===j&&(n.contents=null):await pe(null,n,t,Object.freeze([]))}ut.BREAK=D;ut.SKIP=$i;ut.REMOVE=j;async function pe(n,e,t,s){let i=await Pi(n,e,t,s);if($.isNode(i)||$.isPair(i))return xi(n,s,i),pe(n,i,t,s);if(typeof i!="symbol"){if($.isCollection(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=await pe(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===j&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){s=Object.freeze(s.concat(e));let r=await pe("key",e.key,t,s);if(r===D)return D;r===j&&(e.key=null);let o=await pe("value",e.value,t,s);if(o===D)return D;o===j&&(e.value=null)}}return i}function _i(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function Pi(n,e,t,s){if(typeof t=="function")return t(n,e,s);if($.isMap(e))return t.Map?.(n,e,s);if($.isSeq(e))return t.Seq?.(n,e,s);if($.isPair(e))return t.Pair?.(n,e,s);if($.isScalar(e))return t.Scalar?.(n,e,s);if($.isAlias(e))return t.Alias?.(n,e,s)}function xi(n,e,t){let s=e[e.length-1];if($.isCollection(s))s.items[n]=t;else if($.isPair(s))n==="key"?s.key=t:s.value=t;else if($.isDocument(s))s.contents=t;else{let i=$.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Sn.visit=ct;Sn.visitAsync=ut});var vn=y(Mi=>{"use strict";var Di=C(),Ml=Ce(),Bl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Rl=n=>n.replace(/[!,[\]{}]/g,e=>Bl[e]),Oe=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+Rl(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),i;if(e&&s.length>0&&Di.isNode(e.contents)){let r={};Ml.visit(e.contents,(o,a)=>{Di.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
3
+ `)}};Oe.defaultYaml={explicit:!1,version:"1.2"};Oe.defaultTags={"!!":"tag:yaml.org,2002:"};Mi.Directives=Oe});var ft=y(Ee=>{"use strict";var Bi=C(),Kl=Ce();function jl(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Ri(n){let e=new Set;return Kl.visit(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function Ki(n,e){for(let t=1;;++t){let s=`${n}${t}`;if(!e.has(s))return s}}function Fl(n,e){let t=[],s=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Ri(n));let o=Ki(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=s.get(r);if(typeof o=="object"&&o.anchor&&(Bi.isScalar(o.node)||Bi.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}Ee.anchorIsValid=jl;Ee.anchorNames=Ri;Ee.createNodeAnchors=Fl;Ee.findNewAnchor=Ki});var An=y(ji=>{"use strict";function Te(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){let o=s[i],a=Te(n,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(let i of Array.from(s.keys())){let r=s.get(i),o=Te(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(let i of Array.from(s)){let r=Te(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(let[i,r]of Object.entries(s)){let o=Te(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}ji.applyReviver=Te});var J=y(Hi=>{"use strict";var Hl=C();function Fi(n,e,t){if(Array.isArray(n))return n.map((s,i)=>Fi(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!Hl.hasAnchor(n))return n.toJSON(e,t);let s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};let i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}Hi.toJS=Fi});var dt=y(Yi=>{"use strict";var Ul=An(),Ui=C(),Yl=J(),Nn=class{constructor(e){Object.defineProperty(this,Ui.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!Ui.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Yl.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?Ul.applyReviver(r,{"":a},"",a):a}};Yi.NodeBase=Nn});var Le=y(Ji=>{"use strict";var Jl=ft(),Vl=Ce(),me=C(),Wl=dt(),Gl=J(),Cn=class extends Wl.NodeBase{constructor(e){super(me.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],Vl.visit(e,{Node:(r,o)=>{(me.isAlias(o)||me.hasAnchor(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let i;for(let r of s){if(r===this)break;r.anchor===this.source&&(i=r)}if(i&&t){let{anchors:r,doc:o,maxAliasCount:a}=t,l=r.get(i);if(l||(Gl.toJS(i,null,t),l=r.get(i)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=ht(o,i,r)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return i}toJSON(e,t){if(!t)return{source:this.source};let s=this.resolve(t.doc,t);if(!s){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(s).res}toString(e,t,s){let i=`*${this.source}`;if(e){if(Jl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function ht(n,e,t){if(me.isAlias(e)){let s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(me.isCollection(e)){let s=0;for(let i of e.items){let r=ht(n,i,t);r>s&&(s=r)}return s}else if(me.isPair(e)){let s=ht(n,e.key,t),i=ht(n,e.value,t);return Math.max(s,i)}return 1}Ji.Alias=Cn});var L=y(On=>{"use strict";var Ql=C(),zl=dt(),Xl=J(),Zl=n=>!n||typeof n!="function"&&typeof n!="object",V=class extends zl.NodeBase{constructor(e){super(Ql.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:Xl.toJS(this.value,e,t)}toString(){return String(this.value)}};V.BLOCK_FOLDED="BLOCK_FOLDED";V.BLOCK_LITERAL="BLOCK_LITERAL";V.PLAIN="PLAIN";V.QUOTE_DOUBLE="QUOTE_DOUBLE";V.QUOTE_SINGLE="QUOTE_SINGLE";On.Scalar=V;On.isScalarValue=Zl});var qe=y(Wi=>{"use strict";var ec=Le(),se=C(),Vi=L(),tc="tag:yaml.org,2002:";function nc(n,e,t){if(e){let s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}function sc(n,e,t){if(se.isDocument(n)&&(n=n.contents),se.isNode(n))return n;if(se.isPair(n)){let u=t.schema[se.MAP].createNode?.(t.schema,null,t);return u.items.push(n),u}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(s&&n&&typeof n=="object"){if(l=a.get(n),l)return l.anchor??(l.anchor=i(n)),new ec.Alias(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=tc+e.slice(2));let c=nc(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let u=new Vi.Scalar(n);return l&&(l.node=u),u}c=n instanceof Map?o[se.MAP]:Symbol.iterator in Object(n)?o[se.SEQ]:o[se.MAP]}r&&(r(c),delete t.onTagObj);let h=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new Vi.Scalar(n);return e?h.tag=e:c.default||(h.tag=c.tag),l&&(l.node=h),h}Wi.createNode=sc});var mt=y(pt=>{"use strict";var ic=qe(),F=C(),rc=dt();function En(n,e,t){let s=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return ic.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var Gi=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,Tn=class extends rc.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>F.isNode(s)||F.isPair(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Gi(e))this.add(t);else{let[s,...i]=e,r=this.get(s,!0);if(F.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,En(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){let[t,...s]=e;if(s.length===0)return this.delete(t);let i=this.get(t,!0);if(F.isCollection(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&F.isScalar(r)?r.value:r:F.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!F.isPair(t))return!1;let s=t.value;return s==null||e&&F.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(s.length===0)return this.has(t);let i=this.get(t,!0);return F.isCollection(i)?i.hasIn(s):!1}setIn(e,t){let[s,...i]=e;if(i.length===0)this.set(s,t);else{let r=this.get(s,!0);if(F.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,En(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};pt.Collection=Tn;pt.collectionFromPath=En;pt.isEmptyPath=Gi});var Ie=y(gt=>{"use strict";var oc=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function Ln(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var ac=(n,e,t)=>n.endsWith(`
4
+ `)?Ln(t,e):t.includes(`
5
5
  `)?`
6
- `+gs(t,e):(s.endsWith(" ")?"":" ")+t;ut.indentComment=gs;ut.lineComment=Ll;ut.stringifyComment=ql});var Bi=g(qe=>{"use strict";var Il="flow",ys="block",ft="quoted";function $l(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;let c=[],h={},u=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):u=i-n);let f,p,y=!1,d=-1,m=-1,w=-1;t===ys&&(d=Mi(s,d,e.length),d!==-1&&(u=d+l));for(let k;k=s[d+=1];){if(t===ft&&k==="\\"){switch(m=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}w=d}if(k===`
7
- `)t===ys&&(d=Mi(s,d,e.length)),u=d+e.length+l,f=void 0;else{if(k===" "&&p&&p!==" "&&p!==`
8
- `&&p!==" "){let v=s[d+1];v&&v!==" "&&v!==`
9
- `&&v!==" "&&(f=d)}if(d>=u)if(f)c.push(f),u=f+l,f=void 0;else if(t===ft){for(;p===" "||p===" ";)p=k,k=s[d+=1],y=!0;let v=d>w+1?d-2:m-1;if(h[v])return s;c.push(v),h[v]=!0,u=v+l,f=void 0}else y=!0}p=k}if(y&&a&&a(),c.length===0)return s;o&&o();let S=s.slice(0,c[0]);for(let k=0;k<c.length;++k){let v=c[k],N=c[k+1]||s.length;v===0?S=`
10
- ${e}${s.slice(0,N)}`:(t===ft&&h[v]&&(S+=`${s[v]}\\`),S+=`
11
- ${e}${s.slice(v+1,N)}`)}return S}function Mi(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
12
- `);n=e,i=e+1,r=s[i]}return n}qe.FOLD_BLOCK=ys;qe.FOLD_FLOW=Il;qe.FOLD_QUOTED=ft;qe.foldFlowLines=$l});var Ie=g(xi=>{"use strict";var x=q(),W=Bi(),ht=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),pt=s=>/^(%|---|\.\.\.)/m.test(s);function _l(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
13
- `){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Le(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(pt(s)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let h=t.substr(l+2,4);switch(h){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
6
+ `+Ln(t,e):(n.endsWith(" ")?"":" ")+t;gt.indentComment=Ln;gt.lineComment=ac;gt.stringifyComment=oc});var zi=y($e=>{"use strict";var lc="flow",qn="block",yt="quoted";function cc(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return n;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(n.length<=l)return n;let c=[],h={},u=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):u=i-s);let f,p,g=!1,d=-1,m=-1,b=-1;t===qn&&(d=Qi(n,d,e.length),d!==-1&&(u=d+l));for(let S;S=n[d+=1];){if(t===yt&&S==="\\"){switch(m=d,n[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}b=d}if(S===`
7
+ `)t===qn&&(d=Qi(n,d,e.length)),u=d+e.length+l,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==`
8
+ `&&p!==" "){let v=n[d+1];v&&v!==" "&&v!==`
9
+ `&&v!==" "&&(f=d)}if(d>=u)if(f)c.push(f),u=f+l,f=void 0;else if(t===yt){for(;p===" "||p===" ";)p=S,S=n[d+=1],g=!0;let v=d>b+1?d-2:m-1;if(h[v])return n;c.push(v),h[v]=!0,u=v+l,f=void 0}else g=!0}p=S}if(g&&a&&a(),c.length===0)return n;o&&o();let k=n.slice(0,c[0]);for(let S=0;S<c.length;++S){let v=c[S],A=c[S+1]||n.length;v===0?k=`
10
+ ${e}${n.slice(0,A)}`:(t===yt&&h[v]&&(k+=`${n[v]}\\`),k+=`
11
+ ${e}${n.slice(v+1,A)}`)}return k}function Qi(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
12
+ `);s=e,i=e+1,r=n[i]}return s}$e.FOLD_BLOCK=qn;$e.FOLD_FLOW=lc;$e.FOLD_QUOTED=yt;$e.foldFlowLines=cc});var Pe=y(Xi=>{"use strict";var R=L(),W=zi(),bt=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),kt=n=>/^(%|---|\.\.\.)/m.test(n);function uc(n,e,t){if(!e||e<0)return!1;let s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
13
+ `){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function _e(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(kt(n)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let h=t.substr(l+2,4);switch(h){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
14
14
 
15
15
  `;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
16
- `,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:W.foldFlowLines(o,r,W.FOLD_QUOTED,ht(e,!1))}function bs(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
17
- `)||/[ \t]\n|\n[ \t]/.test(s))return Le(s,e);let t=e.indent||(pt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
18
- ${t}`)+"'";return e.implicitKey?n:W.foldFlowLines(n,t,W.FOLD_FLOW,ht(e,!1))}function pe(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Le;else{let i=s.includes('"'),r=s.includes("'");i&&!r?n=bs:r&&!i?n=Le:n=t?bs:Le}return n(s,e)}var ws;try{ws=new RegExp(`(^|(?<!
16
+ `,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,s?o:W.foldFlowLines(o,r,W.FOLD_QUOTED,bt(e,!1))}function In(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
17
+ `)||/[ \t]\n|\n[ \t]/.test(n))return _e(n,e);let t=e.indent||(kt(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
18
+ ${t}`)+"'";return e.implicitKey?s:W.foldFlowLines(s,t,W.FOLD_FLOW,bt(e,!1))}function ge(n,e){let{singleQuote:t}=e.options,s;if(t===!1)s=_e;else{let i=n.includes('"'),r=n.includes("'");i&&!r?s=In:r&&!i?s=_e:s=t?In:_e}return s(n,e)}var $n;try{$n=new RegExp(`(^|(?<!
19
19
  ))
20
20
  +(?!
21
- |$)`,"g")}catch{ws=/\n+(?!\n|$)/g}function dt({comment:s,type:e,value:t},n,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t))return pe(t,n);let c=n.indent||(n.forceBlockIndent||pt(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===x.Scalar.BLOCK_FOLDED?!1:e===x.Scalar.BLOCK_LITERAL?!0:!_l(t,l,c.length);if(!t)return h?`|
21
+ |$)`,"g")}catch{$n=/\n+(?!\n|$)/g}function wt({comment:n,type:e,value:t},s,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(t))return ge(t,s);let c=s.indent||(s.forceBlockIndent||kt(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===R.Scalar.BLOCK_FOLDED?!1:e===R.Scalar.BLOCK_LITERAL?!0:!uc(t,l,c.length);if(!t)return h?`|
22
22
  `:`>
23
- `;let u,f;for(f=t.length;f>0;--f){let N=t[f-1];if(N!==`
24
- `&&N!==" "&&N!==" ")break}let p=t.substring(f),y=p.indexOf(`
25
- `);y===-1?u="-":t===p||y!==p.length-1?(u="+",r&&r()):u="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
26
- `&&(p=p.slice(0,-1)),p=p.replace(ws,`$&${c}`));let d=!1,m,w=-1;for(m=0;m<t.length;++m){let N=t[m];if(N===" ")d=!0;else if(N===`
27
- `)w=m;else break}let S=t.substring(0,w<m?w+1:m);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let v=(d?c?"2":"1":"")+u;if(s&&(v+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!h){let N=t.replace(/\n+/g,`
28
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,C=ht(n,!0);o!=="folded"&&e!==x.Scalar.BLOCK_FOLDED&&(C.onOverflow=()=>{A=!0});let b=W.foldFlowLines(`${S}${N}${p}`,c,W.FOLD_BLOCK,C);if(!A)return`>${v}
29
- ${c}${b}`}return t=t.replace(/\n+/g,`$&${c}`),`|${v}
30
- ${c}${S}${t}${p}`}function Pl(s,e,t,n){let{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:h}=e;if(a&&r.includes(`
31
- `)||h&&/[[\]{},]/.test(r))return pe(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||h||!r.includes(`
32
- `)?pe(r,e):dt(s,e,t,n);if(!a&&!h&&i!==x.Scalar.PLAIN&&r.includes(`
33
- `))return dt(s,e,t,n);if(pt(r)){if(l==="")return e.forceBlockIndent=!0,dt(s,e,t,n);if(a&&l===c)return pe(r,e)}let u=r.replace(/\n+/g,`$&
34
- ${l}`);if(o){let f=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:p,tags:y}=e.doc.schema;if(y.some(f)||p?.some(f))return pe(r,e)}return a?u:W.foldFlowLines(u,l,W.FOLD_FLOW,ht(e,!1))}function Dl(s,e,t,n){let{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==x.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=x.Scalar.QUOTE_DOUBLE);let l=h=>{switch(h){case x.Scalar.BLOCK_FOLDED:case x.Scalar.BLOCK_LITERAL:return i||r?pe(o.value,e):dt(o,e,t,n);case x.Scalar.QUOTE_DOUBLE:return Le(o.value,e);case x.Scalar.QUOTE_SINGLE:return bs(o.value,e);case x.Scalar.PLAIN:return Pl(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:h,defaultStringType:u}=e.options,f=i&&h||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}xi.stringifyString=Dl});var $e=g(Ss=>{"use strict";var Ml=rt(),G=O(),Bl=Te(),xl=Ie();function Kl(s,e){let t=Object.assign({blockQuote:!0,commentString:Bl.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},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Rl(s,e){if(e.tag){let i=s.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(G.isScalar(e)){n=e.value;let i=s.filter(r=>r.identify?.(n));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,t=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}function jl(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(G.isScalar(s)||G.isCollection(s))&&s.anchor;r&&Ml.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=s.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function Fl(s,e,t,n){if(G.isPair(s))return s.toString(e,t,n);if(G.isAlias(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=G.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>i=l});i??(i=Rl(e.doc.schema.tags,r));let o=jl(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,n):G.isScalar(r)?xl.stringifyString(r,e,t,n):r.toString(e,t,n);return o?G.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
35
- ${e.indent}${a}`:a}Ss.createStringifyContext=Kl;Ss.stringify=Fl});var Fi=g(ji=>{"use strict";var U=O(),Ki=q(),Ri=$e(),_e=Te();function Hl({key:s,value:e},t,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:h,simpleKeys:u}}=t,f=U.isNode(s)&&s.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(U.isCollection(s)||!U.isNode(s)&&typeof s=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let p=!u&&(!s||f&&e==null&&!t.inFlow||U.isCollection(s)||(U.isScalar(s)?s.type===Ki.Scalar.BLOCK_FOLDED||s.type===Ki.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(u||!r),indent:a+l});let y=!1,d=!1,m=Ri.stringify(s,t,()=>y=!0,()=>d=!0);if(!p&&!t.inFlow&&m.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(r||e==null)return y&&n&&n(),m===""?"?":p?`? ${m}`:m}else if(r&&!u||e==null&&p)return m=`? ${m}`,f&&!y?m+=_e.lineComment(m,t.indent,c(f)):d&&i&&i(),m;y&&(f=null),p?(f&&(m+=_e.lineComment(m,t.indent,c(f))),m=`? ${m}
36
- ${a}:`):(m=`${m}:`,f&&(m+=_e.lineComment(m,t.indent,c(f))));let w,S,k;U.isNode(e)?(w=!!e.spaceBefore,S=e.commentBefore,k=e.comment):(w=!1,S=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!f&&U.isScalar(e)&&(t.indentAtStart=m.length+1),d=!1,!h&&l.length>=2&&!t.inFlow&&!p&&U.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let v=!1,N=Ri.stringify(e,t,()=>v=!0,()=>d=!0),A=" ";if(f||w||S){if(A=w?`
37
- `:"",S){let C=c(S);A+=`
38
- ${_e.indentComment(C,t.indent)}`}N===""&&!t.inFlow?A===`
39
- `&&k&&(A=`
23
+ `;let u,f;for(f=t.length;f>0;--f){let A=t[f-1];if(A!==`
24
+ `&&A!==" "&&A!==" ")break}let p=t.substring(f),g=p.indexOf(`
25
+ `);g===-1?u="-":t===p||g!==p.length-1?(u="+",r&&r()):u="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
26
+ `&&(p=p.slice(0,-1)),p=p.replace($n,`$&${c}`));let d=!1,m,b=-1;for(m=0;m<t.length;++m){let A=t[m];if(A===" ")d=!0;else if(A===`
27
+ `)b=m;else break}let k=t.substring(0,b<m?b+1:m);k&&(t=t.substring(k.length),k=k.replace(/\n+/g,`$&${c}`));let v=(d?c?"2":"1":"")+u;if(n&&(v+=" "+a(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!h){let A=t.replace(/\n+/g,`
28
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),N=!1,E=bt(s,!0);o!=="folded"&&e!==R.Scalar.BLOCK_FOLDED&&(E.onOverflow=()=>{N=!0});let w=W.foldFlowLines(`${k}${A}${p}`,c,W.FOLD_BLOCK,E);if(!N)return`>${v}
29
+ ${c}${w}`}return t=t.replace(/\n+/g,`$&${c}`),`|${v}
30
+ ${c}${k}${t}${p}`}function fc(n,e,t,s){let{type:i,value:r}=n,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:h}=e;if(a&&r.includes(`
31
+ `)||h&&/[[\]{},]/.test(r))return ge(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||h||!r.includes(`
32
+ `)?ge(r,e):wt(n,e,t,s);if(!a&&!h&&i!==R.Scalar.PLAIN&&r.includes(`
33
+ `))return wt(n,e,t,s);if(kt(r)){if(l==="")return e.forceBlockIndent=!0,wt(n,e,t,s);if(a&&l===c)return ge(r,e)}let u=r.replace(/\n+/g,`$&
34
+ ${l}`);if(o){let f=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:p,tags:g}=e.doc.schema;if(g.some(f)||p?.some(f))return ge(r,e)}return a?u:W.foldFlowLines(u,l,W.FOLD_FLOW,bt(e,!1))}function dc(n,e,t,s){let{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==R.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=R.Scalar.QUOTE_DOUBLE);let l=h=>{switch(h){case R.Scalar.BLOCK_FOLDED:case R.Scalar.BLOCK_LITERAL:return i||r?ge(o.value,e):wt(o,e,t,s);case R.Scalar.QUOTE_DOUBLE:return _e(o.value,e);case R.Scalar.QUOTE_SINGLE:return In(o.value,e);case R.Scalar.PLAIN:return fc(o,e,t,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:h,defaultStringType:u}=e.options,f=i&&h||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}Xi.stringifyString=dc});var xe=y(_n=>{"use strict";var hc=ft(),G=C(),pc=Ie(),mc=Pe();function gc(n,e){let t=Object.assign({blockQuote:!0,commentString:pc.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},n.schema.toStringOptions,e),s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function yc(n,e){if(e.tag){let i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(G.isScalar(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){let i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}function wc(n,e,{anchors:t,doc:s}){if(!s.directives)return"";let i=[],r=(G.isScalar(n)||G.isCollection(n))&&n.anchor;r&&hc.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function bc(n,e,t,s){if(G.isPair(n))return n.toString(e,t,s);if(G.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i,r=G.isNode(n)?n:e.doc.createNode(n,{onTagObj:l=>i=l});i??(i=yc(e.doc.schema.tags,r));let o=wc(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,s):G.isScalar(r)?mc.stringifyString(r,e,t,s):r.toString(e,t,s);return o?G.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
35
+ ${e.indent}${a}`:a}_n.createStringifyContext=gc;_n.stringify=bc});var nr=y(tr=>{"use strict";var U=C(),Zi=L(),er=xe(),De=Ie();function kc({key:n,value:e},t,s,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:h,simpleKeys:u}}=t,f=U.isNode(n)&&n.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(U.isCollection(n)||!U.isNode(n)&&typeof n=="object"){let E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let p=!u&&(!n||f&&e==null&&!t.inFlow||U.isCollection(n)||(U.isScalar(n)?n.type===Zi.Scalar.BLOCK_FOLDED||n.type===Zi.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(u||!r),indent:a+l});let g=!1,d=!1,m=er.stringify(n,t,()=>g=!0,()=>d=!0);if(!p&&!t.inFlow&&m.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(r||e==null)return g&&s&&s(),m===""?"?":p?`? ${m}`:m}else if(r&&!u||e==null&&p)return m=`? ${m}`,f&&!g?m+=De.lineComment(m,t.indent,c(f)):d&&i&&i(),m;g&&(f=null),p?(f&&(m+=De.lineComment(m,t.indent,c(f))),m=`? ${m}
36
+ ${a}:`):(m=`${m}:`,f&&(m+=De.lineComment(m,t.indent,c(f))));let b,k,S;U.isNode(e)?(b=!!e.spaceBefore,k=e.commentBefore,S=e.comment):(b=!1,k=null,S=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!f&&U.isScalar(e)&&(t.indentAtStart=m.length+1),d=!1,!h&&l.length>=2&&!t.inFlow&&!p&&U.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let v=!1,A=er.stringify(e,t,()=>v=!0,()=>d=!0),N=" ";if(f||b||k){if(N=b?`
37
+ `:"",k){let E=c(k);N+=`
38
+ ${De.indentComment(E,t.indent)}`}A===""&&!t.inFlow?N===`
39
+ `&&S&&(N=`
40
40
 
41
- `):A+=`
42
- ${t.indent}`}else if(!p&&U.isCollection(e)){let C=N[0],b=N.indexOf(`
43
- `),L=b!==-1,Y=t.inFlow??e.flow??e.items.length===0;if(L||!Y){let ue=!1;if(L&&(C==="&"||C==="!")){let I=N.indexOf(" ");C==="&"&&I!==-1&&I<b&&N[I+1]==="!"&&(I=N.indexOf(" ",I+1)),(I===-1||b<I)&&(ue=!0)}ue||(A=`
44
- ${t.indent}`)}}else(N===""||N[0]===`
45
- `)&&(A="");return m+=A+N,t.inFlow?v&&n&&n():k&&!v?m+=_e.lineComment(m,t.indent,c(k)):d&&i&&i(),m}ji.stringifyPair=Hl});var vs=g(ks=>{"use strict";var Hi=Ze("process");function Ul(s,...e){s==="debug"&&console.log(...e)}function Yl(s,e){(s==="debug"||s==="warn")&&(typeof Hi.emitWarning=="function"?Hi.emitWarning(e):console.warn(e))}ks.debug=Ul;ks.warn=Yl});var wt=g(bt=>{"use strict";var yt=O(),Ui=q(),mt="<<",gt={identify:s=>s===mt||typeof s=="symbol"&&s.description===mt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ui.Scalar(Symbol(mt)),{addToJSMap:Yi}),stringify:()=>mt},Jl=(s,e)=>(gt.identify(e)||yt.isScalar(e)&&(!e.type||e.type===Ui.Scalar.PLAIN)&&gt.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===gt.tag&&t.default);function Yi(s,e,t){let n=Ji(s,t);if(yt.isSeq(n))for(let i of n.items)Ns(s,e,i);else if(Array.isArray(n))for(let i of n)Ns(s,e,i);else Ns(s,e,n)}function Ns(s,e,t){let n=Ji(s,t);if(!yt.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Ji(s,e){return s&&yt.isAlias(e)?e.resolve(s.doc,s):e}bt.addMergeToJSMap=Yi;bt.isMergeKey=Jl;bt.merge=gt});var Os=g(Gi=>{"use strict";var Vl=vs(),Vi=wt(),Wl=$e(),Wi=O(),As=J();function Gl(s,e,{key:t,value:n}){if(Wi.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(Vi.isMergeKey(s,t))Vi.addMergeToJSMap(s,e,n);else{let i=As.toJS(t,"",s);if(e instanceof Map)e.set(i,As.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=Ql(t,i,s),o=As.toJS(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Ql(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Wi.isNode(s)&&t?.doc){let n=Wl.createStringifyContext(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Vl.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}Gi.addPairToJSMap=Gl});var Q=g(Es=>{"use strict";var Qi=Ce(),zl=Fi(),Xl=Os(),St=O();function Zl(s,e,t){let n=Qi.createNode(s,void 0,t),i=Qi.createNode(e,void 0,t);return new kt(n,i)}var kt=class s{constructor(e,t=null){Object.defineProperty(this,St.NODE_TYPE,{value:St.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return St.isNode(t)&&(t=t.clone(e)),St.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return Xl.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?zl.stringifyPair(this,e,t,n):JSON.stringify(this)}};Es.Pair=kt;Es.createPair=Zl});var Cs=g(Xi=>{"use strict";var ne=O(),zi=$e(),vt=Te();function ec(s,e,t){return(e.inFlow??s.flow?sc:tc)(s,e,t)}function tc({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,h=Object.assign({},t,{indent:r,type:null}),u=!1,f=[];for(let y=0;y<e.length;++y){let d=e[y],m=null;if(ne.isNode(d))!u&&d.spaceBefore&&f.push(""),Nt(t,f,d.commentBefore,u),d.comment&&(m=d.comment);else if(ne.isPair(d)){let S=ne.isNode(d.key)?d.key:null;S&&(!u&&S.spaceBefore&&f.push(""),Nt(t,f,S.commentBefore,u))}u=!1;let w=zi.stringify(d,h,()=>m=null,()=>u=!0);m&&(w+=vt.lineComment(w,r,c(m))),u&&m&&(u=!1),f.push(n+w)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let y=1;y<f.length;++y){let d=f[y];p+=d?`
41
+ `):N+=`
42
+ ${t.indent}`}else if(!p&&U.isCollection(e)){let E=A[0],w=A.indexOf(`
43
+ `),q=w!==-1,Y=t.inFlow??e.flow??e.items.length===0;if(q||!Y){let ue=!1;if(q&&(E==="&"||E==="!")){let I=A.indexOf(" ");E==="&"&&I!==-1&&I<w&&A[I+1]==="!"&&(I=A.indexOf(" ",I+1)),(I===-1||w<I)&&(ue=!0)}ue||(N=`
44
+ ${t.indent}`)}}else(A===""||A[0]===`
45
+ `)&&(N="");return m+=N+A,t.inFlow?v&&s&&s():S&&!v?m+=De.lineComment(m,t.indent,c(S)):d&&i&&i(),m}tr.stringifyPair=kc});var xn=y(Pn=>{"use strict";var sr=nt("process");function Sc(n,...e){n==="debug"&&console.log(...e)}function vc(n,e){(n==="debug"||n==="warn")&&(typeof sr.emitWarning=="function"?sr.emitWarning(e):console.warn(e))}Pn.debug=Sc;Pn.warn=vc});var Ct=y(Nt=>{"use strict";var At=C(),ir=L(),St="<<",vt={identify:n=>n===St||typeof n=="symbol"&&n.description===St,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ir.Scalar(Symbol(St)),{addToJSMap:rr}),stringify:()=>St},Ac=(n,e)=>(vt.identify(e)||At.isScalar(e)&&(!e.type||e.type===ir.Scalar.PLAIN)&&vt.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===vt.tag&&t.default);function rr(n,e,t){let s=or(n,t);if(At.isSeq(s))for(let i of s.items)Dn(n,e,i);else if(Array.isArray(s))for(let i of s)Dn(n,e,i);else Dn(n,e,s)}function Dn(n,e,t){let s=or(n,t);if(!At.isMap(s))throw new Error("Merge sources must be maps or map aliases");let i=s.toJSON(null,n,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function or(n,e){return n&&At.isAlias(e)?e.resolve(n.doc,n):e}Nt.addMergeToJSMap=rr;Nt.isMergeKey=Ac;Nt.merge=vt});var Bn=y(cr=>{"use strict";var Nc=xn(),ar=Ct(),Cc=xe(),lr=C(),Mn=J();function Oc(n,e,{key:t,value:s}){if(lr.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(ar.isMergeKey(n,t))ar.addMergeToJSMap(n,e,s);else{let i=Mn.toJS(t,"",n);if(e instanceof Map)e.set(i,Mn.toJS(s,i,n));else if(e instanceof Set)e.add(i);else{let r=Ec(t,i,n),o=Mn.toJS(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Ec(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(lr.isNode(n)&&t?.doc){let s=Cc.createStringifyContext(t.doc,{});s.anchors=new Set;for(let r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;let i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Nc.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}cr.addPairToJSMap=Oc});var Q=y(Rn=>{"use strict";var ur=qe(),Tc=nr(),Lc=Bn(),Ot=C();function qc(n,e,t){let s=ur.createNode(n,void 0,t),i=ur.createNode(e,void 0,t);return new Et(s,i)}var Et=class n{constructor(e,t=null){Object.defineProperty(this,Ot.NODE_TYPE,{value:Ot.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return Ot.isNode(t)&&(t=t.clone(e)),Ot.isNode(s)&&(s=s.clone(e)),new n(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return Lc.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?Tc.stringifyPair(this,e,t,s):JSON.stringify(this)}};Rn.Pair=Et;Rn.createPair=qc});var Kn=y(dr=>{"use strict";var ie=C(),fr=xe(),Tt=Ie();function Ic(n,e,t){return(e.inFlow??n.flow?_c:$c)(n,e,t)}function $c({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,h=Object.assign({},t,{indent:r,type:null}),u=!1,f=[];for(let g=0;g<e.length;++g){let d=e[g],m=null;if(ie.isNode(d))!u&&d.spaceBefore&&f.push(""),Lt(t,f,d.commentBefore,u),d.comment&&(m=d.comment);else if(ie.isPair(d)){let k=ie.isNode(d.key)?d.key:null;k&&(!u&&k.spaceBefore&&f.push(""),Lt(t,f,k.commentBefore,u))}u=!1;let b=fr.stringify(d,h,()=>m=null,()=>u=!0);m&&(b+=Tt.lineComment(b,r,c(m))),u&&m&&(u=!1),f.push(s+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let g=1;g<f.length;++g){let d=f[g];p+=d?`
46
46
  ${l}${d}`:`
47
- `}}return s?(p+=`
48
- `+vt.indentComment(c(s),l),a&&a()):u&&o&&o(),p}function sc({items:s},e,{flowChars:t,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;let l=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,h=0,u=[];for(let y=0;y<s.length;++y){let d=s[y],m=null;if(ne.isNode(d))d.spaceBefore&&u.push(""),Nt(e,u,d.commentBefore,!1),d.comment&&(m=d.comment);else if(ne.isPair(d)){let S=ne.isNode(d.key)?d.key:null;S&&(S.spaceBefore&&u.push(""),Nt(e,u,S.commentBefore,!1),S.comment&&(c=!0));let k=ne.isNode(d.value)?d.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(c=!0)):d.value==null&&S?.comment&&(m=S.comment)}m&&(c=!0);let w=zi.stringify(d,l,()=>m=null);c||(c=u.length>h||w.includes(`
49
- `)),y<s.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=u.reduce((S,k)=>S+k.length+2,2)+(w.length+2)>e.options.lineWidth)),c&&(w+=",")),m&&(w+=vt.lineComment(w,n,a(m))),u.push(w),h=u.length}let{start:f,end:p}=t;if(u.length===0)return f+p;if(!c){let y=u.reduce((d,m)=>d+m.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=f;for(let d of u)y+=d?`
47
+ `}}return n?(p+=`
48
+ `+Tt.indentComment(c(n),l),a&&a()):u&&o&&o(),p}function _c({items:n},e,{flowChars:t,itemIndent:s}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;s+=r;let l=Object.assign({},e,{indent:s,inFlow:!0,type:null}),c=!1,h=0,u=[];for(let g=0;g<n.length;++g){let d=n[g],m=null;if(ie.isNode(d))d.spaceBefore&&u.push(""),Lt(e,u,d.commentBefore,!1),d.comment&&(m=d.comment);else if(ie.isPair(d)){let k=ie.isNode(d.key)?d.key:null;k&&(k.spaceBefore&&u.push(""),Lt(e,u,k.commentBefore,!1),k.comment&&(c=!0));let S=ie.isNode(d.value)?d.value:null;S?(S.comment&&(m=S.comment),S.commentBefore&&(c=!0)):d.value==null&&k?.comment&&(m=k.comment)}m&&(c=!0);let b=fr.stringify(d,l,()=>m=null);c||(c=u.length>h||b.includes(`
49
+ `)),g<n.length-1?b+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=u.reduce((k,S)=>k+S.length+2,2)+(b.length+2)>e.options.lineWidth)),c&&(b+=",")),m&&(b+=Tt.lineComment(b,s,a(m))),u.push(b),h=u.length}let{start:f,end:p}=t;if(u.length===0)return f+p;if(!c){let g=u.reduce((d,m)=>d+m.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=f;for(let d of u)g+=d?`
50
50
  ${r}${i}${d}`:`
51
- `;return`${y}
52
- ${i}${p}`}else return`${f}${o}${u.join(" ")}${o}${p}`}function Nt({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=vt.indentComment(e(n),s);t.push(r.trimStart())}}Xi.stringifyCollection=ec});var X=g(qs=>{"use strict";var nc=Cs(),ic=Os(),rc=ct(),z=O(),At=Q(),oc=q();function Pe(s,e){let t=z.isScalar(e)?e.value:e;for(let n of s)if(z.isPair(n)&&(n.key===e||n.key===t||z.isScalar(n.key)&&n.key.value===t))return n}var Ts=class extends rc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(z.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(At.createPair(l,c,n))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;z.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new At.Pair(e,e?.value):n=new At.Pair(e.key,e.value);let i=Pe(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);z.isScalar(i.value)&&oc.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let o=this.items.findIndex(a=>r(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Pe(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Pe(this.items,e)?.value;return(!t&&z.isScalar(i)?i.value:i)??void 0}has(e){return!!Pe(this.items,e)}set(e,t){this.add(new At.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)ic.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!z.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),nc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};qs.YAMLMap=Ts;qs.findPair=Pe});var me=g(er=>{"use strict";var ac=O(),Zi=X(),lc={collection:"map",default:!0,nodeClass:Zi.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return ac.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>Zi.YAMLMap.from(s,e,t)};er.map=lc});var Z=g(tr=>{"use strict";var cc=Ce(),uc=Cs(),fc=ct(),Et=O(),dc=q(),hc=J(),Ls=class extends fc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Et.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Ot(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Ot(e);if(typeof n!="number")return;let i=this.items[n];return!t&&Et.isScalar(i)?i.value:i}has(e){let t=Ot(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Ot(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Et.isScalar(i)&&dc.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let i=0;for(let r of this.items)n.push(hc.toJS(r,String(i++),t));return n}toString(e,t,n){return e?uc.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(cc.createNode(a,void 0,n))}}return r}};function Ot(s){let e=Et.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}tr.YAMLSeq=Ls});var ge=g(nr=>{"use strict";var pc=O(),sr=Z(),mc={collection:"seq",default:!0,nodeClass:sr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return pc.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>sr.YAMLSeq.from(s,e,t)};nr.seq=mc});var De=g(ir=>{"use strict";var gc=Ie(),yc={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),gc.stringifyString(s,e,t,n)}};ir.string=yc});var Ct=g(ar=>{"use strict";var rr=q(),or={identify:s=>s==null,createNode:()=>new rr.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new rr.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&or.test.test(s)?s:e.options.nullStr};ar.nullTag=or});var Is=g(cr=>{"use strict";var bc=q(),lr={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new bc.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&lr.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};cr.boolTag=lr});var ye=g(ur=>{"use strict";function wc({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}ur.stringifyNumber=wc});var _s=g(Tt=>{"use strict";var Sc=q(),$s=ye(),kc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$s.stringifyNumber},vc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():$s.stringifyNumber(s)}},Nc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new Sc.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:$s.stringifyNumber};Tt.float=Nc;Tt.floatExp=vc;Tt.floatNaN=kc});var Ds=g(Lt=>{"use strict";var fr=ye(),qt=s=>typeof s=="bigint"||Number.isInteger(s),Ps=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function dr(s,e,t){let{value:n}=s;return qt(n)&&n>=0?t+n.toString(e):fr.stringifyNumber(s)}var Ac={identify:s=>qt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Ps(s,2,8,t),stringify:s=>dr(s,8,"0o")},Oc={identify:qt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Ps(s,0,10,t),stringify:fr.stringifyNumber},Ec={identify:s=>qt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Ps(s,2,16,t),stringify:s=>dr(s,16,"0x")};Lt.int=Oc;Lt.intHex=Ec;Lt.intOct=Ac});var pr=g(hr=>{"use strict";var Cc=me(),Tc=Ct(),qc=ge(),Lc=De(),Ic=Is(),Ms=_s(),Bs=Ds(),$c=[Cc.map,qc.seq,Lc.string,Tc.nullTag,Ic.boolTag,Bs.intOct,Bs.int,Bs.intHex,Ms.floatNaN,Ms.floatExp,Ms.float];hr.schema=$c});var yr=g(gr=>{"use strict";var _c=q(),Pc=me(),Dc=ge();function mr(s){return typeof s=="bigint"||Number.isInteger(s)}var It=({value:s})=>JSON.stringify(s),Mc=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:It},{identify:s=>s==null,createNode:()=>new _c.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:It},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:It},{identify:mr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>mr(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:It}],Bc={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},xc=[Pc.map,Dc.seq].concat(Mc,Bc);gr.schema=xc});var Ks=g(br=>{"use strict";var Me=Ze("buffer"),xs=q(),Kc=Ie(),Rc={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Me.Buffer=="function")return Me.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){if(!t)return"";let o=t,a;if(typeof Me.Buffer=="function")a=o instanceof Me.Buffer?o.toString("base64"):Me.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=xs.Scalar.BLOCK_LITERAL),e!==xs.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),h=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)h[u]=a.substr(f,l);a=h.join(e===xs.Scalar.BLOCK_LITERAL?`
53
- `:" ")}return Kc.stringifyString({comment:s,type:e,value:a},n,i,r)}};br.binary=Rc});var Pt=g(_t=>{"use strict";var $t=O(),Rs=Q(),jc=q(),Fc=Z();function wr(s,e){if($t.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!$t.isPair(n)){if($t.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Rs.Pair(new jc.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
54
- ${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
55
- ${r.comment}`:n.comment}n=i}s.items[t]=$t.isPair(n)?n:new Rs.Pair(n)}}else e("Expected a sequence for this tag");return s}function Sr(s,e,t){let{replacer:n}=t,i=new Fc.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Rs.createPair(a,l,t))}return i}var Hc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:wr,createNode:Sr};_t.createPairs=Sr;_t.pairs=Hc;_t.resolvePairs=wr});var Hs=g(Fs=>{"use strict";var kr=O(),js=J(),Be=X(),Uc=Z(),vr=Pt(),ie=class s extends Uc.YAMLSeq{constructor(){super(),this.add=Be.YAMLMap.prototype.add.bind(this),this.delete=Be.YAMLMap.prototype.delete.bind(this),this.get=Be.YAMLMap.prototype.get.bind(this),this.has=Be.YAMLMap.prototype.has.bind(this),this.set=Be.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(kr.isPair(i)?(r=js.toJS(i.key,"",t),o=js.toJS(i.value,r,t)):r=js.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){let i=vr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ie.tag="tag:yaml.org,2002:omap";var Yc={collection:"seq",identify:s=>s instanceof Map,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=vr.resolvePairs(s,e),n=[];for(let{key:i}of t.items)kr.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ie,t)},createNode:(s,e,t)=>ie.from(s,e,t)};Fs.YAMLOMap=ie;Fs.omap=Yc});var Cr=g(Us=>{"use strict";var Nr=q();function Ar({value:s,source:e},t){return e&&(s?Or:Er).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var Or={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Nr.Scalar(!0),stringify:Ar},Er={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Nr.Scalar(!1),stringify:Ar};Us.falseTag=Er;Us.trueTag=Or});var Tr=g(Dt=>{"use strict";var Jc=q(),Ys=ye(),Vc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ys.stringifyNumber},Wc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Ys.stringifyNumber(s)}},Gc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new Jc.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Ys.stringifyNumber};Dt.float=Gc;Dt.floatExp=Wc;Dt.floatNaN=Vc});var Lr=g(Ke=>{"use strict";var qr=ye(),xe=s=>typeof s=="bigint"||Number.isInteger(s);function Mt(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}function Js(s,e,t){let{value:n}=s;if(xe(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return qr.stringifyNumber(s)}var Qc={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Mt(s,2,2,t),stringify:s=>Js(s,2,"0b")},zc={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Mt(s,1,8,t),stringify:s=>Js(s,8,"0")},Xc={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Mt(s,0,10,t),stringify:qr.stringifyNumber},Zc={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Mt(s,2,16,t),stringify:s=>Js(s,16,"0x")};Ke.int=Xc;Ke.intBin=Qc;Ke.intHex=Zc;Ke.intOct=zc});var Ws=g(Vs=>{"use strict";var Kt=O(),Bt=Q(),xt=X(),re=class s extends xt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Kt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Bt.Pair(e.key,null):t=new Bt.Pair(e,null),xt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=xt.findPair(this.items,e);return!t&&Kt.isPair(n)?Kt.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=xt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Bt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Bt.createPair(o,null,n));return r}};re.tag="tag:yaml.org,2002:set";var eu={collection:"map",identify:s=>s instanceof Set,nodeClass:re,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>re.from(s,e,t),resolve(s,e){if(Kt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new re,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};Vs.YAMLSet=re;Vs.set=eu});var Qs=g(Rt=>{"use strict";var tu=ye();function Gs(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function Ir(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return tu.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var su={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>Gs(s,t),stringify:Ir},nu={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>Gs(s,!1),stringify:Ir},$r={identify:s=>s 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(s){let e=s.match($r.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l),h=e[8];if(h&&h!=="Z"){let u=Gs(h,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Rt.floatTime=nu;Rt.intTime=su;Rt.timestamp=$r});var Dr=g(Pr=>{"use strict";var iu=me(),ru=Ct(),ou=ge(),au=De(),lu=Ks(),_r=Cr(),zs=Tr(),jt=Lr(),cu=wt(),uu=Hs(),fu=Pt(),du=Ws(),Xs=Qs(),hu=[iu.map,ou.seq,au.string,ru.nullTag,_r.trueTag,_r.falseTag,jt.intBin,jt.intOct,jt.int,jt.intHex,zs.floatNaN,zs.floatExp,zs.float,lu.binary,cu.merge,uu.omap,fu.pairs,du.set,Xs.intTime,Xs.floatTime,Xs.timestamp];Pr.schema=hu});var Yr=g(tn=>{"use strict";var Kr=me(),pu=Ct(),Rr=ge(),mu=De(),gu=Is(),Zs=_s(),en=Ds(),yu=pr(),bu=yr(),jr=Ks(),Re=wt(),Fr=Hs(),Hr=Pt(),Mr=Dr(),Ur=Ws(),Ft=Qs(),Br=new Map([["core",yu.schema],["failsafe",[Kr.map,Rr.seq,mu.string]],["json",bu.schema],["yaml11",Mr.schema],["yaml-1.1",Mr.schema]]),xr={binary:jr.binary,bool:gu.boolTag,float:Zs.float,floatExp:Zs.floatExp,floatNaN:Zs.floatNaN,floatTime:Ft.floatTime,int:en.int,intHex:en.intHex,intOct:en.intOct,intTime:Ft.intTime,map:Kr.map,merge:Re.merge,null:pu.nullTag,omap:Fr.omap,pairs:Hr.pairs,seq:Rr.seq,set:Ur.set,timestamp:Ft.timestamp},wu={"tag:yaml.org,2002:binary":jr.binary,"tag:yaml.org,2002:merge":Re.merge,"tag:yaml.org,2002:omap":Fr.omap,"tag:yaml.org,2002:pairs":Hr.pairs,"tag:yaml.org,2002:set":Ur.set,"tag:yaml.org,2002:timestamp":Ft.timestamp};function Su(s,e,t){let n=Br.get(e);if(n&&!s)return t&&!n.includes(Re.merge)?n.concat(Re.merge):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(Br.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(let r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Re.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?xr[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(xr).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}tn.coreKnownTags=wu;tn.getTags=Su});var rn=g(Jr=>{"use strict";var sn=O(),ku=me(),vu=ge(),Nu=De(),Ht=Yr(),Au=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,nn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ht.getTags(e,"compat"):e?Ht.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Ht.coreKnownTags:{},this.tags=Ht.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,sn.MAP,{value:ku.map}),Object.defineProperty(this,sn.SCALAR,{value:Nu.string}),Object.defineProperty(this,sn.SEQ,{value:vu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Au:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Jr.Schema=nn});var Wr=g(Vr=>{"use strict";var Ou=O(),on=$e(),je=Te();function Eu(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=on.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift(je.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(Ou.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let h=r(s.contents.commentBefore);t.push(je.indentComment(h,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=on.stringify(s.contents,i,()=>a=null,l);a&&(c+=je.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(on.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
56
- `)?(t.push("..."),t.push(je.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(je.indentComment(r(l),"")))}return t.join(`
51
+ `;return`${g}
52
+ ${i}${p}`}else return`${f}${o}${u.join(" ")}${o}${p}`}function Lt({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let r=Tt.indentComment(e(s),n);t.push(r.trimStart())}}dr.stringifyCollection=Ic});var X=y(Fn=>{"use strict";var Pc=Kn(),xc=Bn(),Dc=mt(),z=C(),qt=Q(),Mc=L();function Me(n,e){let t=z.isScalar(e)?e.value:e;for(let s of n)if(z.isPair(s)&&(s.key===e||s.key===t||z.isScalar(s.key)&&s.key.value===t))return s}var jn=class extends Dc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(z.MAP,e),this.items=[]}static from(e,t,s){let{keepUndefined:i,replacer:r}=s,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(qt.createPair(l,c,s))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;z.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new qt.Pair(e,e?.value):s=new qt.Pair(e.key,e.value);let i=Me(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);z.isScalar(i.value)&&Mc.isScalarValue(s.value)?i.value.value=s.value:i.value=s.value}else if(r){let o=this.items.findIndex(a=>r(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let t=Me(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Me(this.items,e)?.value;return(!t&&z.isScalar(i)?i.value:i)??void 0}has(e){return!!Me(this.items,e)}set(e,t){this.add(new qt.Pair(e,t),!0)}toJSON(e,t,s){let i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)xc.addPairToJSMap(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(let i of this.items)if(!z.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Pc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}};Fn.YAMLMap=jn;Fn.findPair=Me});var ye=y(pr=>{"use strict";var Bc=C(),hr=X(),Rc={collection:"map",default:!0,nodeClass:hr.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return Bc.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>hr.YAMLMap.from(n,e,t)};pr.map=Rc});var Z=y(mr=>{"use strict";var Kc=qe(),jc=Kn(),Fc=mt(),$t=C(),Hc=L(),Uc=J(),Hn=class extends Fc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super($t.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=It(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let s=It(e);if(typeof s!="number")return;let i=this.items[s];return!t&&$t.isScalar(i)?i.value:i}has(e){let t=It(e);return typeof t=="number"&&t<this.items.length}set(e,t){let s=It(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[s];$t.isScalar(i)&&Hc.isScalarValue(t)?i.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let i=0;for(let r of this.items)s.push(Uc.toJS(r,String(i++),t));return s}toString(e,t,s){return e?jc.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(Kc.createNode(a,void 0,s))}}return r}};function It(n){let e=$t.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}mr.YAMLSeq=Hn});var we=y(yr=>{"use strict";var Yc=C(),gr=Z(),Jc={collection:"seq",default:!0,nodeClass:gr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return Yc.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>gr.YAMLSeq.from(n,e,t)};yr.seq=Jc});var Be=y(wr=>{"use strict";var Vc=Pe(),Wc={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),Vc.stringifyString(n,e,t,s)}};wr.string=Wc});var _t=y(Sr=>{"use strict";var br=L(),kr={identify:n=>n==null,createNode:()=>new br.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new br.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&kr.test.test(n)?n:e.options.nullStr};Sr.nullTag=kr});var Un=y(Ar=>{"use strict";var Gc=L(),vr={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new Gc.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&vr.test.test(n)){let s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};Ar.boolTag=vr});var be=y(Nr=>{"use strict";function Qc({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);let i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}Nr.stringifyNumber=Qc});var Jn=y(Pt=>{"use strict";var zc=L(),Yn=be(),Xc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yn.stringifyNumber},Zc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Yn.stringifyNumber(n)}},eu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new zc.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Yn.stringifyNumber};Pt.float=eu;Pt.floatExp=Zc;Pt.floatNaN=Xc});var Wn=y(Dt=>{"use strict";var Cr=be(),xt=n=>typeof n=="bigint"||Number.isInteger(n),Vn=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function Or(n,e,t){let{value:s}=n;return xt(s)&&s>=0?t+s.toString(e):Cr.stringifyNumber(n)}var tu={identify:n=>xt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Vn(n,2,8,t),stringify:n=>Or(n,8,"0o")},nu={identify:xt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Vn(n,0,10,t),stringify:Cr.stringifyNumber},su={identify:n=>xt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Vn(n,2,16,t),stringify:n=>Or(n,16,"0x")};Dt.int=nu;Dt.intHex=su;Dt.intOct=tu});var Tr=y(Er=>{"use strict";var iu=ye(),ru=_t(),ou=we(),au=Be(),lu=Un(),Gn=Jn(),Qn=Wn(),cu=[iu.map,ou.seq,au.string,ru.nullTag,lu.boolTag,Qn.intOct,Qn.int,Qn.intHex,Gn.floatNaN,Gn.floatExp,Gn.float];Er.schema=cu});var Ir=y(qr=>{"use strict";var uu=L(),fu=ye(),du=we();function Lr(n){return typeof n=="bigint"||Number.isInteger(n)}var Mt=({value:n})=>JSON.stringify(n),hu=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Mt},{identify:n=>n==null,createNode:()=>new uu.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Mt},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Mt},{identify:Lr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Lr(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Mt}],pu={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},mu=[fu.map,du.seq].concat(hu,pu);qr.schema=mu});var Xn=y($r=>{"use strict";var Re=nt("buffer"),zn=L(),gu=Pe(),yu={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Re.Buffer=="function")return Re.Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";let o=t,a;if(typeof Re.Buffer=="function")a=o instanceof Re.Buffer?o.toString("base64"):Re.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=zn.Scalar.BLOCK_LITERAL),e!==zn.Scalar.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),h=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)h[u]=a.substr(f,l);a=h.join(e===zn.Scalar.BLOCK_LITERAL?`
53
+ `:" ")}return gu.stringifyString({comment:n,type:e,value:a},s,i,r)}};$r.binary=yu});var Kt=y(Rt=>{"use strict";var Bt=C(),Zn=Q(),wu=L(),bu=Z();function _r(n,e){if(Bt.isSeq(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!Bt.isPair(s)){if(Bt.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let i=s.items[0]||new Zn.Pair(new wu.Scalar(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
54
+ ${i.key.commentBefore}`:s.commentBefore),s.comment){let r=i.value??i.key;r.comment=r.comment?`${s.comment}
55
+ ${r.comment}`:s.comment}s=i}n.items[t]=Bt.isPair(s)?s:new Zn.Pair(s)}}else e("Expected a sequence for this tag");return n}function Pr(n,e,t){let{replacer:s}=t,i=new bu.YAMLSeq(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Zn.createPair(a,l,t))}return i}var ku={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:_r,createNode:Pr};Rt.createPairs=Pr;Rt.pairs=ku;Rt.resolvePairs=_r});var ns=y(ts=>{"use strict";var xr=C(),es=J(),Ke=X(),Su=Z(),Dr=Kt(),re=class n extends Su.YAMLSeq{constructor(){super(),this.add=Ke.YAMLMap.prototype.add.bind(this),this.delete=Ke.YAMLMap.prototype.delete.bind(this),this.get=Ke.YAMLMap.prototype.get.bind(this),this.has=Ke.YAMLMap.prototype.has.bind(this),this.set=Ke.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;t?.onCreate&&t.onCreate(s);for(let i of this.items){let r,o;if(xr.isPair(i)?(r=es.toJS(i.key,"",t),o=es.toJS(i.value,r,t)):r=es.toJS(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){let i=Dr.createPairs(e,t,s),r=new this;return r.items=i.items,r}};re.tag="tag:yaml.org,2002:omap";var vu={collection:"seq",identify:n=>n instanceof Map,nodeClass:re,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=Dr.resolvePairs(n,e),s=[];for(let{key:i}of t.items)xr.isScalar(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new re,t)},createNode:(n,e,t)=>re.from(n,e,t)};ts.YAMLOMap=re;ts.omap=vu});var jr=y(ss=>{"use strict";var Mr=L();function Br({value:n,source:e},t){return e&&(n?Rr:Kr).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var Rr={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Mr.Scalar(!0),stringify:Br},Kr={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Mr.Scalar(!1),stringify:Br};ss.falseTag=Kr;ss.trueTag=Rr});var Fr=y(jt=>{"use strict";var Au=L(),is=be(),Nu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:is.stringifyNumber},Cu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():is.stringifyNumber(n)}},Ou={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new Au.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:is.stringifyNumber};jt.float=Ou;jt.floatExp=Cu;jt.floatNaN=Nu});var Ur=y(Fe=>{"use strict";var Hr=be(),je=n=>typeof n=="bigint"||Number.isInteger(n);function Ft(n,e,t,{intAsBigInt:s}){let i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return i==="-"?BigInt(-1)*o:o}let r=parseInt(n,t);return i==="-"?-1*r:r}function rs(n,e,t){let{value:s}=n;if(je(s)){let i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return Hr.stringifyNumber(n)}var Eu={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Ft(n,2,2,t),stringify:n=>rs(n,2,"0b")},Tu={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Ft(n,1,8,t),stringify:n=>rs(n,8,"0")},Lu={identify:je,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Ft(n,0,10,t),stringify:Hr.stringifyNumber},qu={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Ft(n,2,16,t),stringify:n=>rs(n,16,"0x")};Fe.int=Lu;Fe.intBin=Eu;Fe.intHex=qu;Fe.intOct=Tu});var as=y(os=>{"use strict";var Yt=C(),Ht=Q(),Ut=X(),oe=class n extends Ut.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;Yt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Ht.Pair(e.key,null):t=new Ht.Pair(e,null),Ut.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let s=Ut.findPair(this.items,e);return!t&&Yt.isPair(s)?Yt.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=Ut.findPair(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new Ht.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Ht.createPair(o,null,s));return r}};oe.tag="tag:yaml.org,2002:set";var Iu={collection:"map",identify:n=>n instanceof Set,nodeClass:oe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>oe.from(n,e,t),resolve(n,e){if(Yt.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new oe,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};os.YAMLSet=oe;os.set=Iu});var cs=y(Jt=>{"use strict";var $u=be();function ls(n,e){let t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function Yr(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return $u.stringifyNumber(n);let s="";e<0&&(s="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var _u={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>ls(n,t),stringify:Yr},Pu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>ls(n,!1),stringify:Yr},Jr={identify:n=>n 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(n){let e=n.match(Jr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,s,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,s-1,i,r||0,o||0,a||0,l),h=e[8];if(h&&h!=="Z"){let u=ls(h,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Jt.floatTime=Pu;Jt.intTime=_u;Jt.timestamp=Jr});var Gr=y(Wr=>{"use strict";var xu=ye(),Du=_t(),Mu=we(),Bu=Be(),Ru=Xn(),Vr=jr(),us=Fr(),Vt=Ur(),Ku=Ct(),ju=ns(),Fu=Kt(),Hu=as(),fs=cs(),Uu=[xu.map,Mu.seq,Bu.string,Du.nullTag,Vr.trueTag,Vr.falseTag,Vt.intBin,Vt.intOct,Vt.int,Vt.intHex,us.floatNaN,us.floatExp,us.float,Ru.binary,Ku.merge,ju.omap,Fu.pairs,Hu.set,fs.intTime,fs.floatTime,fs.timestamp];Wr.schema=Uu});var ro=y(ps=>{"use strict";var Zr=ye(),Yu=_t(),eo=we(),Ju=Be(),Vu=Un(),ds=Jn(),hs=Wn(),Wu=Tr(),Gu=Ir(),to=Xn(),He=Ct(),no=ns(),so=Kt(),Qr=Gr(),io=as(),Wt=cs(),zr=new Map([["core",Wu.schema],["failsafe",[Zr.map,eo.seq,Ju.string]],["json",Gu.schema],["yaml11",Qr.schema],["yaml-1.1",Qr.schema]]),Xr={binary:to.binary,bool:Vu.boolTag,float:ds.float,floatExp:ds.floatExp,floatNaN:ds.floatNaN,floatTime:Wt.floatTime,int:hs.int,intHex:hs.intHex,intOct:hs.intOct,intTime:Wt.intTime,map:Zr.map,merge:He.merge,null:Yu.nullTag,omap:no.omap,pairs:so.pairs,seq:eo.seq,set:io.set,timestamp:Wt.timestamp},Qu={"tag:yaml.org,2002:binary":to.binary,"tag:yaml.org,2002:merge":He.merge,"tag:yaml.org,2002:omap":no.omap,"tag:yaml.org,2002:pairs":so.pairs,"tag:yaml.org,2002:set":io.set,"tag:yaml.org,2002:timestamp":Wt.timestamp};function zu(n,e,t){let s=zr.get(e);if(s&&!n)return t&&!s.includes(He.merge)?s.concat(He.merge):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{let r=Array.from(zr.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(let r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(He.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Xr[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Xr).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}ps.coreKnownTags=Qu;ps.getTags=zu});var ys=y(oo=>{"use strict";var ms=C(),Xu=ye(),Zu=we(),ef=Be(),Gt=ro(),tf=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,gs=class n{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Gt.getTags(e,"compat"):e?Gt.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Gt.coreKnownTags:{},this.tags=Gt.getTags(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,ms.MAP,{value:Xu.map}),Object.defineProperty(this,ms.SCALAR,{value:ef.string}),Object.defineProperty(this,ms.SEQ,{value:Zu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?tf:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};oo.Schema=gs});var lo=y(ao=>{"use strict";var nf=C(),ws=xe(),Ue=Ie();function sf(n,e){let t=[],s=e.directives===!0;if(e.directives!==!1&&n.directives){let l=n.directives.toString(n);l?(t.push(l),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");let i=ws.createStringifyContext(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");let l=r(n.commentBefore);t.unshift(Ue.indentComment(l,""))}let o=!1,a=null;if(n.contents){if(nf.isNode(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){let h=r(n.contents.commentBefore);t.push(Ue.indentComment(h,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}let l=a?void 0:()=>o=!0,c=ws.stringify(n.contents,i,()=>a=null,l);a&&(c+=Ue.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(ws.stringify(n.contents,i));if(n.directives?.docEnd)if(n.comment){let l=r(n.comment);l.includes(`
56
+ `)?(t.push("..."),t.push(Ue.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Ue.indentComment(r(l),"")))}return t.join(`
57
57
  `)+`
58
- `}Vr.stringifyDocument=Eu});var Fe=g(Gr=>{"use strict";var Cu=Ee(),be=ct(),B=O(),Tu=Q(),qu=J(),Lu=rn(),Iu=Wr(),an=rt(),$u=us(),_u=Ce(),ln=cs(),cn=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,B.NODE_TYPE,{value:B.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ln.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[B.NODE_TYPE]:{value:B.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=B.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){we(this.contents)&&this.contents.add(e)}addIn(e,t){we(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=an.anchorNames(this);e.anchor=!t||n.has(t)?an.findNewAnchor(t||"a",n):t}return new Cu.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let m=S=>typeof S=="number"||S instanceof String||S instanceof Number,w=t.filter(m).map(String);w.length>0&&(t=t.concat(w)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:h}=n??{},{onAnchor:u,setAnchors:f,sourceObjects:p}=an.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},d=_u.createNode(e,h,y);return a&&B.isCollection(d)&&(d.flow=!0),f(),d}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new Tu.Pair(i,r)}delete(e){return we(this.contents)?this.contents.delete(e):!1}deleteIn(e){return be.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):we(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return B.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return be.isEmptyPath(e)?!t&&B.isScalar(this.contents)?this.contents.value:this.contents:B.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return B.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return be.isEmptyPath(e)?this.contents!==void 0:B.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=be.collectionFromPath(this.schema,[e],t):we(this.contents)&&this.contents.set(e,t)}setIn(e,t){be.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=be.collectionFromPath(this.schema,Array.from(e),t):we(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ln.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ln.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Lu.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=qu.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:h}of a.anchors.values())r(h,c);return typeof o=="function"?$u.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Iu.stringifyDocument(this,e)}};function we(s){if(B.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}Gr.Document=cn});var Ye=g(Ue=>{"use strict";var He=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},un=class extends He{constructor(e,t,n){super("YAMLParseError",e,t,n)}},fn=class extends He{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Pu=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
59
- `),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
58
+ `}ao.stringifyDocument=sf});var Ye=y(co=>{"use strict";var rf=Le(),ke=mt(),B=C(),of=Q(),af=J(),lf=ys(),cf=lo(),bs=ft(),uf=An(),ff=qe(),ks=vn(),Ss=class n{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,B.NODE_TYPE,{value:B.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ks.Directives({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){let e=Object.create(n.prototype,{[B.NODE_TYPE]:{value:B.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=B.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Se(this.contents)&&this.contents.add(e)}addIn(e,t){Se(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=bs.anchorNames(this);e.anchor=!t||s.has(t)?bs.findNewAnchor(t||"a",s):t}return new rf.Alias(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let m=k=>typeof k=="number"||k instanceof String||k instanceof Number,b=t.filter(m).map(String);b.length>0&&(t=t.concat(b)),i=t}else s===void 0&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:h}=s??{},{onAnchor:u,setAnchors:f,sourceObjects:p}=bs.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},d=ff.createNode(e,h,g);return a&&B.isCollection(d)&&(d.flow=!0),f(),d}createPair(e,t,s={}){let i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new of.Pair(i,r)}delete(e){return Se(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ke.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Se(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return B.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ke.isEmptyPath(e)?!t&&B.isScalar(this.contents)?this.contents.value:this.contents:B.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return B.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return ke.isEmptyPath(e)?this.contents!==void 0:B.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ke.collectionFromPath(this.schema,[e],t):Se(this.contents)&&this.contents.set(e,t)}setIn(e,t){ke.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=ke.collectionFromPath(this.schema,Array.from(e),t):Se(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ks.Directives({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ks.Directives({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new lf.Schema(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=af.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:h}of a.anchors.values())r(h,c);return typeof o=="function"?uf.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return cf.stringifyDocument(this,e)}};function Se(n){if(B.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}co.Document=Ss});var We=y(Ve=>{"use strict";var Je=class extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}},vs=class extends Je{constructor(e,t,s){super("YAMLParseError",e,t,s)}},As=class extends Je{constructor(e,t,s){super("YAMLWarning",e,t,s)}},df=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(o.substring(0,r))){let a=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
59
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===s&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
60
60
 
61
61
  ${o}
62
62
  ${c}
63
- `}};Ue.YAMLError=He;Ue.YAMLParseError=un;Ue.YAMLWarning=fn;Ue.prettifyError=Pu});var Je=g(Qr=>{"use strict";function Du(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,h=a,u="",f="",p=!1,y=!1,d=null,m=null,w=null,S=null,k=null,v=null,N=null;for(let b of s)switch(y&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(c&&b.type!=="comment"&&b.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),b.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(d=b),h=!0;break;case"comment":{h||r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=b.source.substring(1)||" ";u?u+=f+L:u=L,f="",c=!1;break}case"newline":c?u?u+=b.source:(!v||t!=="seq-item-ind")&&(l=!0):f+=b.source,c=!0,p=!0,(m||w)&&(S=b),h=!0;break;case"anchor":m&&r(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&r(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=b,N??(N=b.offset),c=!1,h=!1,y=!0;break;case"tag":{w&&r(b,"MULTIPLE_TAGS","A node can have at most one tag"),w=b,N??(N=b.offset),c=!1,h=!1,y=!0;break}case t:(m||w)&&r(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),v&&r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),v=b,c=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){k&&r(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,c=!1,h=!1;break}default:r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,h=!1}let A=s[s.length-1],C=A?A.offset+A.source.length:i;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:v,spaceBefore:l,comment:u,hasNewline:p,anchor:m,tag:w,newlineAfterProp:S,end:C,start:N??C}}Qr.resolveProps=Du});var Ut=g(zr=>{"use strict";function dn(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
64
- `))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(dn(e.key)||dn(e.value))return!0}return!1;default:return!0}}zr.containsNewline=dn});var hn=g(Xr=>{"use strict";var Mu=Ut();function Bu(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Mu.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Xr.flowIndentCheck=Bu});var pn=g(eo=>{"use strict";var Zr=O();function xu(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||Zr.isScalar(r)&&Zr.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}eo.mapIncludes=xu});var oo=g(ro=>{"use strict";var to=Q(),Ku=X(),so=Je(),Ru=Ut(),no=hn(),ju=pn(),io="All mapping items must start at the same column";function Fu({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Ku.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let h of n.items){let{start:u,key:f,sep:p,value:y}=h,d=so.resolveProps(u,{indicator:"explicit-key-ind",next:f??p?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),m=!d.found;if(m){if(f&&(f.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(l,"BAD_INDENT",io)),!d.anchor&&!d.tag&&!p){c=d.end,d.comment&&(a.comment?a.comment+=`
65
- `+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||Ru.containsNewline(f))&&i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&i(l,"BAD_INDENT",io);t.atKey=!0;let w=d.end,S=f?s(t,f,d,i):e(t,w,u,null,d,i);t.schema.compat&&no.flowIndentCheck(n.indent,f,i),t.atKey=!1,ju.mapIncludes(t,a.items,S)&&i(w,"DUPLICATE_KEY","Map keys must be unique");let k=so.resolveProps(p??[],{indicator:"map-value-ind",next:y,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=k.end,k.found){m&&(y?.type==="block-map"&&!k.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<k.found.offset-1024&&i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let v=y?s(t,y,k,i):e(t,l,p,null,k,i);t.schema.compat&&no.flowIndentCheck(n.indent,y,i),l=v.range[2];let N=new to.Pair(S,v);t.options.keepSourceTokens&&(N.srcToken=h),a.items.push(N)}else{m&&i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(S.comment?S.comment+=`
66
- `+k.comment:S.comment=k.comment);let v=new to.Pair(S);t.options.keepSourceTokens&&(v.srcToken=h),a.items.push(v)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}ro.resolveBlockMap=Fu});var lo=g(ao=>{"use strict";var Hu=Z(),Uu=Je(),Yu=hn();function Ju({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Hu.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:h,value:u}of n.items){let f=Uu.resolveProps(h,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let p=u?s(t,u,f,i):e(t,f.end,h,null,f,i);t.schema.compat&&Yu.flowIndentCheck(n.indent,u,i),l=p.range[2],a.items.push(p)}return a.range=[n.offset,l,c??l],a}ao.resolveBlockSeq=Ju});var Se=g(co=>{"use strict";function Vu(s,e,t,n){let i="";if(s){let r=!1,o="";for(let a of s){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let h=l.substring(1)||" ";i?i+=o+h:i=h,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}co.resolveEnd=Vu});var po=g(ho=>{"use strict";var Wu=O(),Gu=Q(),uo=X(),Qu=Z(),zu=Se(),fo=Je(),Xu=Ut(),Zu=pn(),mn="Block collections are not allowed within flow collections",gn=s=>s&&(s.type==="block-map"||s.type==="block-seq");function ef({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?uo.YAMLMap:Qu.YAMLSeq),c=new l(t.schema);c.flow=!0;let h=t.atRoot;h&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=n.offset+n.start.source.length;for(let m=0;m<n.items.length;++m){let w=n.items[m],{start:S,key:k,sep:v,value:N}=w,A=fo.resolveProps(S,{flow:a,indicator:"explicit-key-ind",next:k??v?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!v&&!N){m===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<n.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
67
- `+A.comment:c.comment=A.comment),u=A.end;continue}!o&&t.options.strict&&Xu.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let C="";e:for(let b of S)switch(b.type){case"comma":case"space":break;case"comment":C=b.source.substring(1);break e;default:break e}if(C){let b=c.items[c.items.length-1];Wu.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
68
- `+C:b.comment=C,A.comment=A.comment.substring(C.length+1)}}if(!o&&!v&&!A.found){let C=N?s(t,N,A,i):e(t,A.end,v,null,A,i);c.items.push(C),u=C.range[2],gn(N)&&i(C.range,"BLOCK_IN_FLOW",mn)}else{t.atKey=!0;let C=A.end,b=k?s(t,k,A,i):e(t,C,S,null,A,i);gn(k)&&i(b.range,"BLOCK_IN_FLOW",mn),t.atKey=!1;let L=fo.resolveProps(v??[],{flow:a,indicator:"map-value-ind",next:N,offset:b.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(L.found){if(!o&&!A.found&&t.options.strict){if(v)for(let I of v){if(I===L.found)break;if(I.type==="newline"){i(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<L.found.offset-1024&&i(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else N&&("source"in N&&N.source?.[0]===":"?i(N,"MISSING_CHAR",`Missing space after : in ${a}`):i(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Y=N?s(t,N,L,i):L.found?e(t,L.end,v,null,L,i):null;Y?gn(N)&&i(Y.range,"BLOCK_IN_FLOW",mn):L.comment&&(b.comment?b.comment+=`
69
- `+L.comment:b.comment=L.comment);let ue=new Gu.Pair(b,Y);if(t.options.keepSourceTokens&&(ue.srcToken=w),o){let I=c;Zu.mapIncludes(t,I.items,b)&&i(C,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(ue)}else{let I=new uo.YAMLMap(t.schema);I.flow=!0,I.items.push(ue);let zn=(Y??b).range;I.range=[b.range[0],zn[1],zn[2]],c.items.push(I)}u=Y?Y.range[2]:L.end}}let f=o?"}":"]",[p,...y]=n.end,d=u;if(p?.source===f)d=p.offset+p.source.length;else{let m=a[0].toUpperCase()+a.substring(1),w=h?`${m} must end with a ${f}`:`${m} in block collection must be sufficiently indented and end with a ${f}`;i(u,h?"MISSING_CHAR":"BAD_INDENT",w),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let m=zu.resolveEnd(y,d,t.options.strict,i);m.comment&&(c.comment?c.comment+=`
70
- `+m.comment:c.comment=m.comment),c.range=[n.offset,d,m.offset]}else c.range=[n.offset,d,d];return c}ho.resolveFlowCollection=ef});var go=g(mo=>{"use strict";var tf=O(),sf=q(),nf=X(),rf=Z(),of=oo(),af=lo(),lf=po();function yn(s,e,t,n,i,r){let o=t.type==="block-map"?of.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?af.resolveBlockSeq(s,e,t,n,r):lf.resolveFlowCollection(s,e,t,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function cf(s,e,t,n,i){let r=n.tag,o=r?e.directives.tagName(r.source,f=>i(r,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,y=f&&r?f.offset>r.offset?f:r:f??r;y&&(!p||p.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===nf.YAMLMap.tagName&&a==="map"||o===rf.YAMLSeq.tagName&&a==="seq")return yn(s,e,t,i,o);let l=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!l){let f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?i(r,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),yn(s,e,t,i,o)}let c=yn(s,e,t,i,o,l),h=l.resolve?.(c,f=>i(r,"TAG_RESOLVE_FAILED",f),e.options)??c,u=tf.isNode(h)?h:new sf.Scalar(h);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}mo.composeCollection=cf});var wn=g(yo=>{"use strict";var bn=q();function uf(s,e,t){let n=e.offset,i=ff(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?bn.Scalar.BLOCK_FOLDED:bn.Scalar.BLOCK_LITERAL,o=e.source?df(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let m=o[d][1];if(m===""||m==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&o.length>0?`
71
- `.repeat(Math.max(1,o.length-1)):"",m=n+i.length;return e.source&&(m+=e.source.length),{value:d,type:r,comment:i.comment,range:[n,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,h=0;for(let d=0;d<a;++d){let[m,w]=o[d];if(w===""||w==="\r")i.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&t(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=m.length),h=d,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+w.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>l&&(a=d+1);let u="",f="",p=!1;for(let d=0;d<h;++d)u+=o[d][0].slice(l)+`
72
- `;for(let d=h;d<a;++d){let[m,w]=o[d];c+=m.length+w.length+1;let S=w[w.length-1]==="\r";if(S&&(w=w.slice(0,-1)),w&&m.length<l){let v=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-w.length-(S?2:1),"BAD_INDENT",v),m=""}r===bn.Scalar.BLOCK_LITERAL?(u+=f+m.slice(l)+w,f=`
73
- `):m.length>l||w[0]===" "?(f===" "?f=`
63
+ `}};Ve.YAMLError=Je;Ve.YAMLParseError=vs;Ve.YAMLWarning=As;Ve.prettifyError=df});var Ge=y(uo=>{"use strict";function hf(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,h=a,u="",f="",p=!1,g=!1,d=null,m=null,b=null,k=null,S=null,v=null,A=null;for(let w of n)switch(g&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&r(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),d&&(c&&w.type!=="comment"&&w.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),w.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&w.source.includes(" ")&&(d=w),h=!0;break;case"comment":{h||r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=w.source.substring(1)||" ";u?u+=f+q:u=q,f="",c=!1;break}case"newline":c?u?u+=w.source:(!v||t!=="seq-item-ind")&&(l=!0):f+=w.source,c=!0,p=!0,(m||b)&&(k=w),h=!0;break;case"anchor":m&&r(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&r(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=w,A??(A=w.offset),c=!1,h=!1,g=!0;break;case"tag":{b&&r(w,"MULTIPLE_TAGS","A node can have at most one tag"),b=w,A??(A=w.offset),c=!1,h=!1,g=!0;break}case t:(m||b)&&r(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),v&&r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),v=w,c=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){S&&r(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=w,c=!1,h=!1;break}default:r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),c=!1,h=!1}let N=n[n.length-1],E=N?N.offset+N.source.length:i;return g&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:v,spaceBefore:l,comment:u,hasNewline:p,anchor:m,tag:b,newlineAfterProp:k,end:E,start:A??E}}uo.resolveProps=hf});var Qt=y(fo=>{"use strict";function Ns(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
64
+ `))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Ns(e.key)||Ns(e.value))return!0}return!1;default:return!0}}fo.containsNewline=Ns});var Cs=y(ho=>{"use strict";var pf=Qt();function mf(n,e,t){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&pf.containsNewline(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ho.flowIndentCheck=mf});var Os=y(mo=>{"use strict";var po=C();function gf(n,e,t){let{uniqueKeys:s}=n.options;if(s===!1)return!1;let i=typeof s=="function"?s:(r,o)=>r===o||po.isScalar(r)&&po.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}mo.mapIncludes=gf});var So=y(ko=>{"use strict";var go=Q(),yf=X(),yo=Ge(),wf=Qt(),wo=Cs(),bf=Os(),bo="All mapping items must start at the same column";function kf({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??yf.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=s.offset,c=null;for(let h of s.items){let{start:u,key:f,sep:p,value:g}=h,d=yo.resolveProps(u,{indicator:"explicit-key-ind",next:f??p?.[0],offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0}),m=!d.found;if(m){if(f&&(f.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==s.indent&&i(l,"BAD_INDENT",bo)),!d.anchor&&!d.tag&&!p){c=d.end,d.comment&&(a.comment?a.comment+=`
65
+ `+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||wf.containsNewline(f))&&i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==s.indent&&i(l,"BAD_INDENT",bo);t.atKey=!0;let b=d.end,k=f?n(t,f,d,i):e(t,b,u,null,d,i);t.schema.compat&&wo.flowIndentCheck(s.indent,f,i),t.atKey=!1,bf.mapIncludes(t,a.items,k)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let S=yo.resolveProps(p??[],{indicator:"map-value-ind",next:g,offset:k.range[2],onError:i,parentIndent:s.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=S.end,S.found){m&&(g?.type==="block-map"&&!S.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<S.found.offset-1024&&i(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let v=g?n(t,g,S,i):e(t,l,p,null,S,i);t.schema.compat&&wo.flowIndentCheck(s.indent,g,i),l=v.range[2];let A=new go.Pair(k,v);t.options.keepSourceTokens&&(A.srcToken=h),a.items.push(A)}else{m&&i(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(k.comment?k.comment+=`
66
+ `+S.comment:k.comment=S.comment);let v=new go.Pair(k);t.options.keepSourceTokens&&(v.srcToken=h),a.items.push(v)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}ko.resolveBlockMap=kf});var Ao=y(vo=>{"use strict";var Sf=Z(),vf=Ge(),Af=Cs();function Nf({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??Sf.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=s.offset,c=null;for(let{start:h,value:u}of s.items){let f=vf.resolveProps(h,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let p=u?n(t,u,f,i):e(t,f.end,h,null,f,i);t.schema.compat&&Af.flowIndentCheck(s.indent,u,i),l=p.range[2],a.items.push(p)}return a.range=[s.offset,l,c??l],a}vo.resolveBlockSeq=Nf});var ve=y(No=>{"use strict";function Cf(n,e,t,s){let i="";if(n){let r=!1,o="";for(let a of n){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let h=l.substring(1)||" ";i?i+=o+h:i=h,o="";break}case"newline":i&&(o+=l),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}No.resolveEnd=Cf});var To=y(Eo=>{"use strict";var Of=C(),Ef=Q(),Co=X(),Tf=Z(),Lf=ve(),Oo=Ge(),qf=Qt(),If=Os(),Es="Block collections are not allowed within flow collections",Ts=n=>n&&(n.type==="block-map"||n.type==="block-seq");function $f({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?Co.YAMLMap:Tf.YAMLSeq),c=new l(t.schema);c.flow=!0;let h=t.atRoot;h&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=s.offset+s.start.source.length;for(let m=0;m<s.items.length;++m){let b=s.items[m],{start:k,key:S,sep:v,value:A}=b,N=Oo.resolveProps(k,{flow:a,indicator:"explicit-key-ind",next:S??v?.[0],offset:u,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!v&&!A){m===0&&N.comma?i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<s.items.length-1&&i(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(c.comment?c.comment+=`
67
+ `+N.comment:c.comment=N.comment),u=N.end;continue}!o&&t.options.strict&&qf.containsNewline(S)&&i(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)N.comma&&i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||i(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let E="";e:for(let w of k)switch(w.type){case"comma":case"space":break;case"comment":E=w.source.substring(1);break e;default:break e}if(E){let w=c.items[c.items.length-1];Of.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
68
+ `+E:w.comment=E,N.comment=N.comment.substring(E.length+1)}}if(!o&&!v&&!N.found){let E=A?n(t,A,N,i):e(t,N.end,v,null,N,i);c.items.push(E),u=E.range[2],Ts(A)&&i(E.range,"BLOCK_IN_FLOW",Es)}else{t.atKey=!0;let E=N.end,w=S?n(t,S,N,i):e(t,E,k,null,N,i);Ts(S)&&i(w.range,"BLOCK_IN_FLOW",Es),t.atKey=!1;let q=Oo.resolveProps(v??[],{flow:a,indicator:"map-value-ind",next:A,offset:w.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(q.found){if(!o&&!N.found&&t.options.strict){if(v)for(let I of v){if(I===q.found)break;if(I.type==="newline"){i(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<q.found.offset-1024&&i(q.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source?.[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${a}`):i(q.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Y=A?n(t,A,q,i):q.found?e(t,q.end,v,null,q,i):null;Y?Ts(A)&&i(Y.range,"BLOCK_IN_FLOW",Es):q.comment&&(w.comment?w.comment+=`
69
+ `+q.comment:w.comment=q.comment);let ue=new Ef.Pair(w,Y);if(t.options.keepSourceTokens&&(ue.srcToken=b),o){let I=c;If.mapIncludes(t,I.items,w)&&i(E,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(ue)}else{let I=new Co.YAMLMap(t.schema);I.flow=!0,I.items.push(ue);let li=(Y??w).range;I.range=[w.range[0],li[1],li[2]],c.items.push(I)}u=Y?Y.range[2]:q.end}}let f=o?"}":"]",[p,...g]=s.end,d=u;if(p?.source===f)d=p.offset+p.source.length;else{let m=a[0].toUpperCase()+a.substring(1),b=h?`${m} must end with a ${f}`:`${m} in block collection must be sufficiently indented and end with a ${f}`;i(u,h?"MISSING_CHAR":"BAD_INDENT",b),p&&p.source.length!==1&&g.unshift(p)}if(g.length>0){let m=Lf.resolveEnd(g,d,t.options.strict,i);m.comment&&(c.comment?c.comment+=`
70
+ `+m.comment:c.comment=m.comment),c.range=[s.offset,d,m.offset]}else c.range=[s.offset,d,d];return c}Eo.resolveFlowCollection=$f});var qo=y(Lo=>{"use strict";var _f=C(),Pf=L(),xf=X(),Df=Z(),Mf=So(),Bf=Ao(),Rf=To();function Ls(n,e,t,s,i,r){let o=t.type==="block-map"?Mf.resolveBlockMap(n,e,t,s,r):t.type==="block-seq"?Bf.resolveBlockSeq(n,e,t,s,r):Rf.resolveFlowCollection(n,e,t,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Kf(n,e,t,s,i){let r=s.tag,o=r?e.directives.tagName(r.source,f=>i(r,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=s,g=f&&r?f.offset>r.offset?f:r:f??r;g&&(!p||p.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===xf.YAMLMap.tagName&&a==="map"||o===Df.YAMLSeq.tagName&&a==="seq")return Ls(n,e,t,i,o);let l=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!l){let f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?i(r,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ls(n,e,t,i,o)}let c=Ls(n,e,t,i,o,l),h=l.resolve?.(c,f=>i(r,"TAG_RESOLVE_FAILED",f),e.options)??c,u=_f.isNode(h)?h:new Pf.Scalar(h);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}Lo.composeCollection=Kf});var Is=y(Io=>{"use strict";var qs=L();function jf(n,e,t){let s=e.offset,i=Ff(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};let r=i.mode===">"?qs.Scalar.BLOCK_FOLDED:qs.Scalar.BLOCK_LITERAL,o=e.source?Hf(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let m=o[d][1];if(m===""||m==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&o.length>0?`
71
+ `.repeat(Math.max(1,o.length-1)):"",m=s+i.length;return e.source&&(m+=e.source.length),{value:d,type:r,comment:i.comment,range:[s,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,h=0;for(let d=0;d<a;++d){let[m,b]=o[d];if(b===""||b==="\r")i.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&t(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=m.length),h=d,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+b.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>l&&(a=d+1);let u="",f="",p=!1;for(let d=0;d<h;++d)u+=o[d][0].slice(l)+`
72
+ `;for(let d=h;d<a;++d){let[m,b]=o[d];c+=m.length+b.length+1;let k=b[b.length-1]==="\r";if(k&&(b=b.slice(0,-1)),b&&m.length<l){let v=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(k?2:1),"BAD_INDENT",v),m=""}r===qs.Scalar.BLOCK_LITERAL?(u+=f+m.slice(l)+b,f=`
73
+ `):m.length>l||b[0]===" "?(f===" "?f=`
74
74
  `:!p&&f===`
75
75
  `&&(f=`
76
76
 
77
- `),u+=f+m.slice(l)+w,f=`
78
- `,p=!0):w===""?f===`
77
+ `),u+=f+m.slice(l)+b,f=`
78
+ `,p=!0):b===""?f===`
79
79
  `?u+=`
80
80
  `:f=`
81
- `:(u+=f+w,f=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)u+=`
81
+ `:(u+=f+b,f=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)u+=`
82
82
  `+o[d][0].slice(l);u[u.length-1]!==`
83
83
  `&&(u+=`
84
84
  `);break;default:u+=`
85
- `}let y=n+i.length+e.source.length;return{value:u,type:r,comment:i.comment,range:[n,y,y]}}function ff({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",l=-1;for(let f=1;f<i.length;++f){let p=i[f];if(!a&&(p==="-"||p==="+"))a=p;else{let y=Number(p);!o&&y?o=y:l===-1&&(l=s+f)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,h="",u=i.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":c=!0;case"newline":u+=p.source.length;break;case"comment":t&&!c&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=p.source.length,h=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),u+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",y);let d=p.source;d&&typeof d=="string"&&(u+=d.length)}}}return{mode:r,indent:o,chomp:a,comment:h,length:u}}function df(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}yo.resolveBlockScalar=uf});var kn=g(wo=>{"use strict";var Sn=q(),hf=Se();function pf(s,e,t){let{offset:n,type:i,source:r,end:o}=s,a,l,c=(f,p,y)=>t(n+f,p,y);switch(i){case"scalar":a=Sn.Scalar.PLAIN,l=mf(r,c);break;case"single-quoted-scalar":a=Sn.Scalar.QUOTE_SINGLE,l=gf(r,c);break;case"double-quoted-scalar":a=Sn.Scalar.QUOTE_DOUBLE,l=yf(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let h=n+r.length,u=hf.resolveEnd(o,h,e,t);return{value:l,type:a,comment:u.comment,range:[n,h,u.offset]}}function mf(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),bo(s)}function gf(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),bo(s.slice(1,-1)).replace(/''/g,"'")}function bo(s){let e=/(.*?)\r?\n/sy,t=e.exec(s);if(!t)return s;let n,i;try{n=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=t[1].replace(n,""),o=" ",a=e.lastIndex;for(;t=e.exec(s);){let c=t[1].replace(i,"");c===""?o===`
85
+ `}let g=s+i.length+e.source.length;return{value:u,type:r,comment:i.comment,range:[s,g,g]}}function Ff({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",l=-1;for(let f=1;f<i.length;++f){let p=i[f];if(!a&&(p==="-"||p==="+"))a=p;else{let g=Number(p);!o&&g?o=g:l===-1&&(l=n+f)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,h="",u=i.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":c=!0;case"newline":u+=p.source.length;break;case"comment":t&&!c&&s(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=p.source.length,h=p.source.substring(1);break;case"error":s(p,"UNEXPECTED_TOKEN",p.message),u+=p.source.length;break;default:{let g=`Unexpected token in block scalar header: ${p.type}`;s(p,"UNEXPECTED_TOKEN",g);let d=p.source;d&&typeof d=="string"&&(u+=d.length)}}}return{mode:r,indent:o,chomp:a,comment:h,length:u}}function Hf(n){let e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}Io.resolveBlockScalar=jf});var _s=y(_o=>{"use strict";var $s=L(),Uf=ve();function Yf(n,e,t){let{offset:s,type:i,source:r,end:o}=n,a,l,c=(f,p,g)=>t(s+f,p,g);switch(i){case"scalar":a=$s.Scalar.PLAIN,l=Jf(r,c);break;case"single-quoted-scalar":a=$s.Scalar.QUOTE_SINGLE,l=Vf(r,c);break;case"double-quoted-scalar":a=$s.Scalar.QUOTE_DOUBLE,l=Wf(r,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}let h=s+r.length,u=Uf.resolveEnd(o,h,e,t);return{value:l,type:a,comment:u.comment,range:[s,h,u.offset]}}function Jf(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),$o(n)}function Vf(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),$o(n.slice(1,-1)).replace(/''/g,"'")}function $o(n){let e=/(.*?)\r?\n/sy,t=e.exec(n);if(!t)return n;let s,i;try{s=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{s=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=t[1].replace(s,""),o=" ",a=e.lastIndex;for(;t=e.exec(n);){let c=t[1].replace(i,"");c===""?o===`
86
86
  `?r+=o:o=`
87
- `:(r+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,t=l.exec(s),r+o+(t?.[1]??"")}function yf(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
87
+ `:(r+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,t=l.exec(n),r+o+(t?.[1]??"")}function Wf(n,e){let t="";for(let s=1;s<n.length-1;++s){let i=n[s];if(!(i==="\r"&&n[s+1]===`
88
88
  `))if(i===`
89
- `){let{fold:r,offset:o}=bf(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n],o=wf[r];if(o)t+=o;else if(r===`
90
- `)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
91
- `)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;t+=Sf(s,n+1,a,e),n+=a}else{let a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let r=n,o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
92
- `&&!(o==="\r"&&s[n+2]===`
93
- `)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function bf(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
94
- `||n==="\r")&&!(n==="\r"&&s[e+2]!==`
95
- `);)n===`
89
+ `){let{fold:r,offset:o}=Gf(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s],o=Qf[r];if(o)t+=o;else if(r===`
90
+ `)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
91
+ `)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;t+=zf(n,s+1,a,e),s+=a}else{let a=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let r=s,o=n[s+1];for(;o===" "||o===" ";)o=n[++s+1];o!==`
92
+ `&&!(o==="\r"&&n[s+2]===`
93
+ `)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function Gf(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
94
+ `||s==="\r")&&!(s==="\r"&&n[e+2]!==`
95
+ `);)s===`
96
96
  `&&(t+=`
97
- `),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var wf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
98
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Sf(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}wo.resolveFlowScalar=pf});var vo=g(ko=>{"use strict";var oe=O(),So=q(),kf=wn(),vf=kn();function Nf(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?kf.resolveBlockScalar(s,e,n):vf.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,u=>n(t,"TAG_RESOLVE_FAILED",u)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[oe.SCALAR]:l?c=Af(s.schema,i,l,t,n):e.type==="scalar"?c=Of(s,i,e,n):c=s.schema[oe.SCALAR];let h;try{let u=c.resolve(i,f=>n(t??e,"TAG_RESOLVE_FAILED",f),s.options);h=oe.isScalar(u)?u:new So.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);n(t??e,"TAG_RESOLVE_FAILED",f),h=new So.Scalar(i)}return h.range=a,h.source=i,r&&(h.type=r),l&&(h.tag=l),c.format&&(h.format=c.format),o&&(h.comment=o),h}function Af(s,e,t,n,i){if(t==="!")return s[oe.SCALAR];let r=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[oe.SCALAR])}function Of({atKey:s,directives:e,schema:t},n,i,r){let o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[oe.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[oe.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),h=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",h,!0)}}return o}ko.composeScalar=Nf});var Ao=g(No=>{"use strict";function Ef(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}No.emptyScalarPosition=Ef});var Co=g(Nn=>{"use strict";var Cf=Ee(),Tf=O(),qf=go(),Oo=vo(),Lf=Se(),If=Ao(),$f={composeNode:Eo,composeEmptyNode:vn};function Eo(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,h=!0;switch(e.type){case"alias":c=_f(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Oo.composeScalar(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=qf.composeCollection($f,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",u),h=!1}}return c??(c=vn(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!Tf.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&h&&(c.srcToken=e),c}function vn(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let h={type:"scalar",offset:If.emptyScalarPosition(e,t,n),indent:-1,source:""},u=Oo.composeScalar(s,h,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function _f({options:s},{offset:e,source:t,end:n},i){let r=new Cf.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Lf.resolveEnd(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Nn.composeEmptyNode=vn;Nn.composeNode=Eo});var Lo=g(qo=>{"use strict";var Pf=Fe(),To=Co(),Df=Se(),Mf=Je();function Bf(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({_directives:e},s),l=new Pf.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},h=Mf.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?To.composeNode(c,i,h,o):To.composeEmptyNode(c,h.end,n,null,h,o);let u=l.contents.range[2],f=Df.resolveEnd(r,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[t,u,f.offset],l}qo.composeDoc=Bf});var On=g(_o=>{"use strict";var xf=Ze("process"),Kf=cs(),Rf=Fe(),Ve=Ye(),Io=O(),jf=Lo(),Ff=Se();function We(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function $o(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){let r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
97
+ `),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}var Qf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
98
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function zf(n,e,t,s){let i=n.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}_o.resolveFlowScalar=Yf});var Do=y(xo=>{"use strict";var ae=C(),Po=L(),Xf=Is(),Zf=_s();function ed(n,e,t,s){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?Xf.resolveBlockScalar(n,e,s):Zf.resolveFlowScalar(e,n.options.strict,s),l=t?n.directives.tagName(t.source,u=>s(t,"TAG_RESOLVE_FAILED",u)):null,c;n.options.stringKeys&&n.atKey?c=n.schema[ae.SCALAR]:l?c=td(n.schema,i,l,t,s):e.type==="scalar"?c=nd(n,i,e,s):c=n.schema[ae.SCALAR];let h;try{let u=c.resolve(i,f=>s(t??e,"TAG_RESOLVE_FAILED",f),n.options);h=ae.isScalar(u)?u:new Po.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);s(t??e,"TAG_RESOLVE_FAILED",f),h=new Po.Scalar(i)}return h.range=a,h.source=i,r&&(h.type=r),l&&(h.tag=l),c.format&&(h.format=c.format),o&&(h.comment=o),h}function td(n,e,t,s,i){if(t==="!")return n[ae.SCALAR];let r=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[ae.SCALAR])}function nd({atKey:n,directives:e,schema:t},s,i,r){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(s))||t[ae.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(s))??t[ae.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),h=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",h,!0)}}return o}xo.composeScalar=ed});var Bo=y(Mo=>{"use strict";function sd(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}Mo.emptyScalarPosition=sd});var jo=y(xs=>{"use strict";var id=Le(),rd=C(),od=qo(),Ro=Do(),ad=ve(),ld=Bo(),cd={composeNode:Ko,composeEmptyNode:Ps};function Ko(n,e,t,s){let i=n.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,h=!0;switch(e.type){case"alias":c=ud(n,e,s),(a||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Ro.composeScalar(n,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=od.composeCollection(cd,n,e,t,s),a&&(c.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);s(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",u),h=!1}}return c??(c=Ps(n,e.offset,void 0,null,t,s)),a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!rd.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&h&&(c.srcToken=e),c}function Ps(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let h={type:"scalar",offset:ld.emptyScalarPosition(e,t,s),indent:-1,source:""},u=Ro.composeScalar(n,h,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function ud({options:n},{offset:e,source:t,end:s},i){let r=new id.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=ad.resolveEnd(s,o,n.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}xs.composeEmptyNode=Ps;xs.composeNode=Ko});var Uo=y(Ho=>{"use strict";var fd=Ye(),Fo=jo(),dd=ve(),hd=Ge();function pd(n,e,{offset:t,start:s,value:i,end:r},o){let a=Object.assign({_directives:e},n),l=new fd.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},h=hd.resolveProps(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Fo.composeNode(c,i,h,o):Fo.composeEmptyNode(c,h.end,s,null,h,o);let u=l.contents.range[2],f=dd.resolveEnd(r,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[t,u,f.offset],l}Ho.composeDoc=pd});var Ms=y(Vo=>{"use strict";var md=nt("process"),gd=vn(),yd=Ye(),Qe=We(),Yo=C(),wd=Uo(),bd=ve();function ze(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Jo(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){let r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
99
99
 
100
100
  `:`
101
- `)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var An=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let o=We(t);r?this.warnings.push(new Ve.YAMLWarning(o,n,i)):this.errors.push(new Ve.YAMLParseError(o,n,i))},this.directives=new Kf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=$o(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
102
- ${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(Io.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Io.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
103
- ${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}
104
- ${o}`:n}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:$o(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(xf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=We(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=jf.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ve.YAMLParseError(We(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ve.YAMLParseError(We(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Ff.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
105
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ve.YAMLParseError(We(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Rf.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};_o.Composer=An});var Mo=g(Yt=>{"use strict";var Hf=wn(),Uf=kn(),Yf=Ye(),Po=Ie();function Jf(s,e=!0,t){if(s){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new Yf.YAMLParseError([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Uf.resolveFlowScalar(s,e,n);case"block-scalar":return Hf.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function Vf(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Po.stringifyString({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
101
+ `)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}var Ds=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{let o=ze(t);r?this.warnings.push(new Qe.YAMLWarning(o,s,i)):this.errors.push(new Qe.YAMLParseError(o,s,i))},this.directives=new gd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:i}=Jo(this.prelude);if(s){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
102
+ ${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(Yo.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Yo.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${s}
103
+ ${a}`:s}else{let o=r.commentBefore;r.commentBefore=o?`${s}
104
+ ${o}`:s}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Jo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(md.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{let r=ze(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=wd.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new Qe.YAMLParseError(ze(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){let s="Unexpected doc-end without preceding document";this.errors.push(new Qe.YAMLParseError(ze(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let t=bd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
105
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Qe.YAMLParseError(ze(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),i=new yd.Document(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};Vo.Composer=Ds});var Qo=y(zt=>{"use strict";var kd=Is(),Sd=_s(),vd=We(),Wo=Pe();function Ad(n,e=!0,t){if(n){let s=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new vd.YAMLParseError([a,a+1],r,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Sd.resolveFlowScalar(n,e,s);case"block-scalar":return kd.resolveBlockScalar({options:{strict:e}},n,s)}}return null}function Nd(n,e){let{implicitKey:t=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Wo.stringifyString({type:o,value:n},{implicitKey:t,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:s,source:`
106
106
  `}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
107
107
  `),h=a.substring(0,c),u=a.substring(c+1)+`
108
- `,f=[{type:"block-scalar-header",offset:r,indent:n,source:h}];return Do(f,l)||f.push({type:"newline",offset:-1,indent:n,source:`
109
- `}),{type:"block-scalar",offset:r,indent:n,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function Wf(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=Po.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Gf(s,l);break;case'"':En(s,l,"double-quoted-scalar");break;case"'":En(s,l,"single-quoted-scalar");break;default:En(s,l,"scalar")}}function Gf(s,e){let t=e.indexOf(`
110
- `),n=e.substring(0,t),i=e.substring(t+1)+`
111
- `;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];Do(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
112
- `});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:i})}}function Do(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function En(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
113
- `};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}Yt.createScalarToken=Vf;Yt.resolveAsScalar=Jf;Yt.setScalarValue=Wf});var xo=g(Bo=>{"use strict";var Qf=s=>"type"in s?Vt(s):Jt(s);function Vt(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=Vt(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=Jt(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=Jt(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=Jt(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function Jt({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=Vt(e)),t)for(let r of t)i+=r.source;return n&&(i+=Vt(n)),i}Bo.stringify=Qf});var Fo=g(jo=>{"use strict";var Cn=Symbol("break visit"),zf=Symbol("skip children"),Ko=Symbol("remove item");function ae(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Ro(Object.freeze([]),s,e)}ae.BREAK=Cn;ae.SKIP=zf;ae.REMOVE=Ko;ae.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t?.[n];if(r&&"items"in r)t=r.items[i];else return}return t};ae.parentCollection=(s,e)=>{let t=ae.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Ro(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=Ro(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Cn)return Cn;a===Ko&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}jo.visit=ae});var Wt=g(M=>{"use strict";var Tn=Mo(),Xf=xo(),Zf=Fo(),qn="\uFEFF",Ln="",In="",$n="",ed=s=>!!s&&"items"in s,td=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function sd(s){switch(s){case qn:return"<BOM>";case Ln:return"<DOC>";case In:return"<FLOW_END>";case $n:return"<SCALAR>";default:return JSON.stringify(s)}}function nd(s){switch(s){case qn:return"byte-order-mark";case Ln:return"doc-mode";case In:return"flow-error-end";case $n:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
108
+ `,f=[{type:"block-scalar-header",offset:r,indent:s,source:h}];return Go(f,l)||f.push({type:"newline",offset:-1,indent:s,source:`
109
+ `}),{type:"block-scalar",offset:r,indent:s,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:l};default:return{type:"scalar",offset:r,indent:s,source:a,end:l}}}function Cd(n,e,t={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in n?n.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=n.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=Wo.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Od(n,l);break;case'"':Bs(n,l,"double-quoted-scalar");break;case"'":Bs(n,l,"single-quoted-scalar");break;default:Bs(n,l,"scalar")}}function Od(n,e){let t=e.indexOf(`
110
+ `),s=e.substring(0,t),i=e.substring(t+1)+`
111
+ `;if(n.type==="block-scalar"){let r=n.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=s,n.source=i}else{let{offset:r}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:s}];Go(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
112
+ `});for(let l of Object.keys(n))l!=="type"&&l!=="offset"&&delete n[l];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:i})}}function Go(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function Bs(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let s=n.props.slice(1),i=e.length;n.props[0].type==="block-scalar-header"&&(i-=n.props[0].source.length);for(let r of s)r.offset+=i;delete n.props,Object.assign(n,{type:t,source:e,end:s});break}case"block-map":case"block-seq":{let i={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
113
+ `};delete n.items,Object.assign(n,{type:t,source:e,end:[i]});break}default:{let s="indent"in n?n.indent:-1,i="end"in n&&Array.isArray(n.end)?n.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(n))r!=="type"&&r!=="offset"&&delete n[r];Object.assign(n,{type:t,indent:s,source:e,end:i})}}}zt.createScalarToken=Nd;zt.resolveAsScalar=Ad;zt.setScalarValue=Cd});var Xo=y(zo=>{"use strict";var Ed=n=>"type"in n?Zt(n):Xt(n);function Zt(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=Zt(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=Xt(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=Xt(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=Xt(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function Xt({start:n,key:e,sep:t,value:s}){let i="";for(let r of n)i+=r.source;if(e&&(i+=Zt(e)),t)for(let r of t)i+=r.source;return s&&(i+=Zt(s)),i}zo.stringify=Ed});var na=y(ta=>{"use strict";var Rs=Symbol("break visit"),Td=Symbol("skip children"),Zo=Symbol("remove item");function le(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),ea(Object.freeze([]),n,e)}le.BREAK=Rs;le.SKIP=Td;le.REMOVE=Zo;le.itemAtPath=(n,e)=>{let t=n;for(let[s,i]of e){let r=t?.[s];if(r&&"items"in r)t=r.items[i];else return}return t};le.parentCollection=(n,e)=>{let t=le.itemAtPath(n,e.slice(0,-1)),s=e[e.length-1][0],i=t?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function ea(n,e,t){let s=t(e,n);if(typeof s=="symbol")return s;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=ea(Object.freeze(n.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Rs)return Rs;a===Zo&&(r.items.splice(o,1),o-=1)}}typeof s=="function"&&i==="key"&&(s=s(e,n))}}return typeof s=="function"?s(e,n):s}ta.visit=le});var en=y(M=>{"use strict";var Ks=Qo(),Ld=Xo(),qd=na(),js="\uFEFF",Fs="",Hs="",Us="",Id=n=>!!n&&"items"in n,$d=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function _d(n){switch(n){case js:return"<BOM>";case Fs:return"<DOC>";case Hs:return"<FLOW_END>";case Us:return"<SCALAR>";default:return JSON.stringify(n)}}function Pd(n){switch(n){case js:return"byte-order-mark";case Fs:return"doc-mode";case Hs:return"flow-error-end";case Us:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
114
114
  `:case`\r
115
- `: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(s[0]){case" ":case" ":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}M.createScalarToken=Tn.createScalarToken;M.resolveAsScalar=Tn.resolveAsScalar;M.setScalarValue=Tn.setScalarValue;M.stringify=Xf.stringify;M.visit=Zf.visit;M.BOM=qn;M.DOCUMENT=Ln;M.FLOW_END=In;M.SCALAR=$n;M.isCollection=ed;M.isScalar=td;M.prettyToken=sd;M.tokenType=nd});var Dn=g(Uo=>{"use strict";var Ge=Wt();function K(s){switch(s){case void 0:case" ":case`
116
- `:case"\r":case" ":return!0;default:return!1}}var Ho=new Set("0123456789ABCDEFabcdef"),id=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Gt=new Set(",[]{}"),rd=new Set(` ,[]{}
117
- \r `),_n=s=>!s||rd.has(s),Pn=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
115
+ `: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(n[0]){case" ":case" ":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}M.createScalarToken=Ks.createScalarToken;M.resolveAsScalar=Ks.resolveAsScalar;M.setScalarValue=Ks.setScalarValue;M.stringify=Ld.stringify;M.visit=qd.visit;M.BOM=js;M.DOCUMENT=Fs;M.FLOW_END=Hs;M.SCALAR=Us;M.isCollection=Id;M.isScalar=$d;M.prettyToken=_d;M.tokenType=Pd});var Vs=y(ia=>{"use strict";var Xe=en();function K(n){switch(n){case void 0:case" ":case`
116
+ `:case"\r":case" ":return!0;default:return!1}}var sa=new Set("0123456789ABCDEFabcdef"),xd=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),tn=new Set(",[]{}"),Dd=new Set(` ,[]{}
117
+ \r `),Ys=n=>!n||Dd.has(n),Js=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
118
118
  `?!0:t==="\r"?this.buffer[e+1]===`
119
- `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===`
120
- `||!i&&!this.atEnd)return e+n+1}return t===`
121
- `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&K(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
122
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){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 e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Ge.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Ge.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&K(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!K(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&K(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case 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(_n),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&K(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Ge.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"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(_n),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||K(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),i=n.indexOf(`
123
- `,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
124
- `,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>K(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
119
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){let i=this.buffer[s+e+1];if(i===`
120
+ `||!i&&!this.atEnd)return e+s+1}return t===`
121
+ `||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&K(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
122
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){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 e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Xe.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){let r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Xe.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&K(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!K(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&K(t)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case 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(Ys),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&K(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Xe.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"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(Ys),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||K(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let s=this.buffer.substring(0,t),i=s.indexOf(`
123
+ `,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
124
+ `,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>K(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
125
125
  `:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
126
- `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
127
- `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
128
- `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
129
- `&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield Ge.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(K(r)||e&&Gt.has(r))break;t=n}else if(K(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
130
- `?(n+=1,i=`
131
- `,r=this.buffer[n+1]):t=n),r==="#"||e&&Gt.has(r))break;if(i===`
132
- `){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&Gt.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ge.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(_n),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(K(n)||t&&Gt.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!K(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(id.has(t))t=this.buffer[++e];else if(t==="%"&&Ho.has(this.buffer[e+1])&&Ho.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
126
+ `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
127
+ `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
128
+ `;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
129
+ `&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield Xe.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){let r=this.buffer[s+1];if(K(r)||e&&tn.has(r))break;t=s}else if(K(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
130
+ `?(s+=1,i=`
131
+ `,r=this.buffer[s+1]):t=s),r==="#"||e&&tn.has(r))break;if(i===`
132
+ `){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&tn.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Xe.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Ys),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(K(s)||t&&tn.has(s)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!K(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(xd.has(t))t=this.buffer[++e];else if(t==="%"&&sa.has(this.buffer[e+1])&&sa.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
133
133
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
134
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};Uo.Lexer=Pn});var Bn=g(Yo=>{"use strict";var Mn=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};Yo.LineCounter=Mn});var Kn=g(Qo=>{"use strict";var od=Ze("process"),Jo=Wt(),ad=Dn();function ee(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function Vo(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Go(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Qt(s){switch(s.type){case"document":return s.start;case"block-map":{let e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function ke(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function zt(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let t=0;t<e.length;++t)s.push(e[t])}function Wo(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!ee(e.start,"explicit-key-ind")&&!ee(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Go(e.value)?e.value.end?zt(e.value.end,e.sep):e.value.end=e.sep:zt(e.start,e.sep),delete e.sep)}var xn=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new ad.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,od.env.LOG_TOKENS&&console.log("|",Jo.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Jo.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Wo(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Vo(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Vo(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Qt(this.peek(2)),n=ke(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
134
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};ia.Lexer=Js});var Gs=y(ra=>{"use strict";var Ws=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){let r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};ra.LineCounter=Ws});var zs=y(ua=>{"use strict";var Md=nt("process"),oa=en(),Bd=Vs();function ee(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function aa(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function ca(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function nn(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Ae(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function sn(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}function la(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!ee(e.start,"explicit-key-ind")&&!ee(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ca(e.value)?e.value.end?sn(e.value.end,e.sep):e.value.end=e.sep:sn(e.start,e.sep),delete e.sep)}var Qs=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Bd.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,Md.env.LOG_TOKENS&&console.log("|",oa.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=oa.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&la(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{let i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&aa(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{aa(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=nn(this.peek(2)),s=Ae(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
135
135
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
136
- `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){zt(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ee(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Go(t.key)&&!ee(t.sep,"newline")){let o=ke(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ee(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=ke(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ee(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ee(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){zt(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ee(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Qt(n),r=ke(i);Wo(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
136
+ `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){sn(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ee(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(ca(t.key)&&!ee(t.sep,"newline")){let o=Ae(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ee(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Ae(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ee(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ee(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){sn(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ee(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let i=nn(s),r=Ae(i);la(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
137
137
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
138
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Qt(e),n=ke(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Qt(e),n=ke(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Qo.Parser=xn});var ta=g(ze=>{"use strict";var zo=On(),ld=Fe(),Qe=Ye(),cd=vs(),ud=O(),fd=Bn(),Xo=Kn();function Zo(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new fd.LineCounter||null,prettyErrors:e}}function dd(s,e={}){let{lineCounter:t,prettyErrors:n}=Zo(e),i=new Xo.Parser(t?.addNewLine),r=new zo.Composer(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(Qe.prettifyError(s,t)),a.warnings.forEach(Qe.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ea(s,e={}){let{lineCounter:t,prettyErrors:n}=Zo(e),i=new Xo.Parser(t?.addNewLine),r=new zo.Composer(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Qe.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Qe.prettifyError(s,t)),o.warnings.forEach(Qe.prettifyError(s,t))),o}function hd(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=ea(s,t);if(!i)return null;if(i.warnings.forEach(r=>cd.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function pd(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return ud.isDocument(s)&&!n?s.toString(t):new ld.Document(s,n,t).toString(t)}ze.parse=hd;ze.parseAllDocuments=dd;ze.parseDocument=ea;ze.stringify=pd});var jn=g(E=>{"use strict";var md=On(),gd=Fe(),yd=rn(),Rn=Ye(),bd=Ee(),te=O(),wd=Q(),Sd=q(),kd=X(),vd=Z(),Nd=Wt(),Ad=Dn(),Od=Bn(),Ed=Kn(),Xt=ta(),sa=ve();E.Composer=md.Composer;E.Document=gd.Document;E.Schema=yd.Schema;E.YAMLError=Rn.YAMLError;E.YAMLParseError=Rn.YAMLParseError;E.YAMLWarning=Rn.YAMLWarning;E.Alias=bd.Alias;E.isAlias=te.isAlias;E.isCollection=te.isCollection;E.isDocument=te.isDocument;E.isMap=te.isMap;E.isNode=te.isNode;E.isPair=te.isPair;E.isScalar=te.isScalar;E.isSeq=te.isSeq;E.Pair=wd.Pair;E.Scalar=Sd.Scalar;E.YAMLMap=kd.YAMLMap;E.YAMLSeq=vd.YAMLSeq;E.CST=Nd;E.Lexer=Ad.Lexer;E.LineCounter=Od.LineCounter;E.Parser=Ed.Parser;E.parse=Xt.parse;E.parseAllDocuments=Xt.parseAllDocuments;E.parseDocument=Xt.parseDocument;E.stringify=Xt.stringify;E.visit=sa.visit;E.visitAsync=sa.visitAsync});import{appendFileSync as dh,readFileSync as hh}from"node:fs";var Ba=["claude-code","antigravity"],ei=s=>Ba.includes(s);function R(s,e){return s==="antigravity"?`/bk-${e}`:`/bk:${e}`}function ti(s,e){return s.replace(/\{\{bk:([a-z][a-z-]*)\}\}/g,(t,n)=>R(e,n))}import{isAbsolute as ns,relative as ja,resolve as ii}from"node:path";import{existsSync as si}from"node:fs";import{dirname as xa,join as ni,resolve as Ka}from"node:path";var Ra=".buildkeel.yaml";function et(s){let e=Ka(s);for(;;){if(si(ni(e,Ra)))return e;if(si(ni(e,".git")))return null;let t=xa(e);if(t===e)return null;e=t}}var oi=["write_to_file","replace_file_content","multi_replace_file_content"],Nh=oi.join("|");var Fa={decision:"allow"},ri={decision:"ask"},is=(s,e)=>{let t=ja(s,e);return t===""||!t.startsWith("..")&&!ns(t)};function ss(s,e){let t=(s.workspacePaths??[]).filter(i=>typeof i=="string"&&i!==""),n=e?[...t.filter(i=>is(i,e)),...t.filter(i=>!is(i,e))]:t;return n.find(i=>et(i)!==null)??n[0]??process.cwd()}var ai={parse(s,e){let t=s??{};switch(e[0]){case"PreInvocation":return t.conversationId?{kind:"prompt",cwd:ss(t),conversation:t.conversationId,newMessage:t.invocationNum===0,transcript:t.transcriptPath??null}:{kind:"ignored"};case"PreToolUse":case"PostToolUse":{let n=t.toolCall?.name??"",i=t.toolCall?.args?.TargetFile,r=oi.includes(n)&&typeof i=="string"&&i!==""?i:null;if(e[0]==="PostToolUse"){if(!r||t.error)return{kind:"ignored"};let l=ss(t,ns(r)?r:void 0);return{kind:"after-edit",cwd:l,tool:n,files:[ii(l,r)],...t.conversationId?{deferTo:t.conversationId}:{}}}let o=ss(t,r&&ns(r)?r:void 0),a=[...t.workspacePaths??[],...t.artifactDirectoryPath?[t.artifactDirectoryPath]:[]].filter(l=>typeof l=="string"&&l!=="");return{kind:"before-edit",cwd:o,tool:n,files:r?[ii(o,r)]:[],folders:a}}default:return{kind:"ignored"}}},render(s,e){if(e.kind==="prompt"){let t=s.context?{injectSteps:[{ephemeralMessage:s.context}]}:{};return{stdout:JSON.stringify(t),exitCode:0}}if(e.kind==="before-edit"){let t=e.files.length>0&&e.files.every(i=>(e.folders??[]).some(r=>is(r,i))),n=s.block?{decision:"deny",reason:s.block}:t?Fa:ri;return{stdout:JSON.stringify(n),exitCode:0}}return{stdout:"{}",exitCode:0}},failed:s=>({stdout:JSON.stringify(s[0]==="PreToolUse"?ri:{}),exitCode:0})};var li={Edit:"file_path",Write:"file_path",MultiEdit:"file_path",NotebookEdit:"notebook_path"},Oh=Object.keys(li).join("|"),Ha=["Bash","PowerShell"],Ua={startup:"startup",resume:"resume",clear:"clear",compact:"compact",fork:"resume"},ci={parse(s){let e=s??{},t=e.cwd??process.cwd();switch(e.hook_event_name){case"SessionStart":{let n=Ua[e.source??"startup"]??"startup";return{kind:"session-start",cwd:t,reason:n}}case"PreToolUse":case"PostToolUse":{let n=e.tool_name??"";if(e.hook_event_name==="PreToolUse"&&Ha.includes(n)){let o=e.tool_input?.command;return typeof o=="string"?{kind:"before-shell",cwd:t,tool:n,command:o}:{kind:"ignored"}}let i=li[n],r=i?e.tool_input?.[i]:void 0;return typeof r!="string"?{kind:"ignored"}:{kind:e.hook_event_name==="PreToolUse"?"before-edit":"after-edit",cwd:t,tool:n,files:[r]}}default:return{kind:"ignored"}}},render(s,e){if(e.kind==="session-start")return{stdout:s.context??"",exitCode:0};if(e.kind==="before-shell"&&s.context)return{stdout:JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:s.context}}),exitCode:0};if(e.kind==="before-edit"&&(s.block||s.context)){let t={hookSpecificOutput:{hookEventName:"PreToolUse",...s.block?{permissionDecision:"deny",permissionDecisionReason:s.block}:{},...s.context?{additionalContext:s.context}:{}}};return{stdout:JSON.stringify(t),exitCode:0}}return e.kind==="after-edit"&&s.context?{stdout:JSON.stringify({hookSpecificOutput:{hookEventName:"PostToolUse",additionalContext:s.context}}),exitCode:0}:{stdout:"",exitCode:0}},failed:()=>({stdout:"",exitCode:1})};import{existsSync as Th,readFileSync as Ya,writeFileSync as qh}from"node:fs";import{join as rs}from"node:path";var P=".buildkeel",Ja="hook-cache.json",Va="context.md",ui=s=>rs(s,P,Va),Wa="context-short.md",fi=s=>rs(s,P,Wa);function Ga(s){return rs(s,P,Ja)}function di(s){try{let e=JSON.parse(Ya(Ga(s),"utf8"));return e?.version===1?e:null}catch{return null}}var Ih=`${P}/`;import{appendFileSync as Id,closeSync as $d,fstatSync as _d,mkdirSync as la,openSync as Pd,readFileSync as ca,readSync as Dd,renameSync as ua,rmSync as Md,statSync as Bd,writeFileSync as xd}from"node:fs";import{homedir as Kd}from"node:os";import{join as ts}from"node:path";import{randomBytes as Qa}from"node:crypto";import{dirname as za,join as Xa}from"node:path";var hi=s=>Xa(za(s),`.${Qa(6).toString("hex")}.bk-tmp`);import{readFileSync as Td}from"node:fs";var Fn=Zn(jn(),1);var Cd=Zn(jn(),1);var Hn={type:"test-plan",dir:"test-plan",file:"plan.md",idSuffix:"-TP"},Un={type:"design",dir:"design",file:"design.md",idSuffix:"-DD"},om=[{type:Hn.type,dir:Hn.dir,file:Hn.file,suffix:"TP"},{type:Un.type,dir:Un.dir,file:Un.file,suffix:"DD"}];function na(s){return/^([A-Z][A-Z0-9]*-[A-Za-z0-9]+)(?:-|$)/.exec(s)?.[1]??null}var Zt=(s,e)=>e?`${s} "${e}"`:s;function Yn(s,e){let t=[{key:"setup",text:`BuildKeel is set up in this repository. Until the user runs a BuildKeel command, or you are about to change a file, converse as you would without it, and leave BuildKeel's artifacts, IDs and commands out of it. Be a thinking partner: check facts in the code and docs before asking; for a design choice, lay out the options, trade-offs, risks and pitfalls, then ask one question in prose and say why it matters. Recommend only when the evidence supports it, and say what it rests on; never assume the user's intent, priorities or constraints, and ask when only they know. When you look something up, say what you found and give the sources. Keep what was decided apart from what is still open. Take the space the reasoning needs; do not cut it short or push toward a conclusion or a plan. Use your question tool only for a closed choice between comparable options, and let several answers be picked when more than one can apply. Until the user signals the discussion has reached a point, end your replies without mentioning BuildKeel, the spec tree or its artifacts, and without offering to draft, record, plan or build anything; settling the last open question is not that signal, so wait for the user to say it. When they signal it, such as with "sounds good" or "I think that's it", ask once, in prose, whether there is more to explore or they are ready to capture it with ${R(e,"capture")}; if they keep talking or say no, do not offer again until something new is settled. Never start it yourself.`,fingerprint:""}];if(s.activeUnit){let n=s.activeBranch?` on branch ${s.activeBranch}`:"";t.push({key:"unit",text:`Active unit: ${Zt(s.activeUnit,s.activeTitle)}${n}.`,fingerprint:`${s.activeUnit}${n}`})}else s.untrackedSince?t.push({key:"unit",text:`No active unit in this working tree: the user chose to work without one here since ${s.untrackedSince}, so changes made now belong to no unit. Starting a unit with ${R(e,"build")} <ID> ends this.`,fingerprint:`untracked:${s.untrackedSince}`}):t.push({key:"unit",text:"No unit is active in this working tree.",fingerprint:""});if(t.push({key:"rules",text:"Read and change the spec tree only through the BuildKeel tools, never by editing its files.",fingerprint:""}),t.push({key:"review",text:"Before you save anything to the spec tree, show what changes, in full, in your reply, and ask in plain text. Agreement saves it; anything else is feedback: discuss it, then list each point with how it was addressed, show the final version, and save only once the user agrees. When work would change a document the user agreed, say which, what and why, and take it through the same review. Never add, change or remove a requirement, criterion, scenario or task on your own initiative."+(s.mode==="spec-driven"?" Report each tick in a line; do not ask about ticks. Tick with save_draft tick, change one requirement with save_draft requirement, and read one file of a change with query file, rather than resending or rereading whole files.":""),fingerprint:s.mode==="spec-driven"?"spec-driven":""}),s.mode==="spec-driven")t.push({key:"stages",text:"This spec tree is Spec-driven: its capability specs say how the system behaves now, and each change says how it will change; nothing in it is approved. Before discussing how the system behaves, look up the capability specs with the BuildKeel query tool. Each BuildKeel command follows its part for a Spec-driven tree.",fingerprint:"spec-driven"},{key:"consistency",text:"When you edit one file of an open change (its proposal, a spec change, its design or its tasks), check the others against the edit, in any direction, and name the follow-on edits in the same reply; then take each through the review, one edit at a time, with what changes and why. Never edit code as part of this.",fingerprint:"spec-driven"},{key:"build",text:`While a change is open, commit each task's work as it is done, adding "BuildKeel-Task: <number>" to a commit that does exactly that one task, and tick each task once its verification passes. Name a change with its title, never by its ID alone, such as CH-001 "Download historical market data". When the user asks in words to build a change's tasks, suggest ${R(e,"build")} once; if they say to go ahead without it, build the tasks anyway by the same rules, and if they say not now, build nothing. A specific edit they ask for needs no suggestion. While building, stop and ask when a test fails and you cannot fix it, or a requirement is unclear. Before adding a requirement to a change with more than half its tasks ticked, ask once whether it belongs in that change or a new one, and draft nothing until they answer.`,fingerprint:`spec-driven|${e}`},{key:"tests",text:"Put the ID of the scenario a test checks in square brackets in the test's name, one ID per bracket.",fingerprint:"spec-driven"}),s.guide==="on"&&t.push({key:"guide",text:"This person chose to be guided through their first change: at each step of it, from drafting to finishing, add one or two plain lines on what just happened and what comes next, as BuildKeel's tool results say. If they ask you to stop explaining, turn it off with the BuildKeel manage tool (action guide, guide off).",fingerprint:"on"});else if(s.stages){let n=(s.stageExamples??[]).map(r=>`\`${r}\``),i=n.length>1?`${n.slice(0,-1).join(", ")} or ${n.at(-1)}`:n[0]??"";t.push({key:"stages",text:`This spec tree's stages, as the team names them: ${s.stages}. Use these names with the user, in each command's help, questions and output; BuildKeel's tools accept them as types, and the usual names too.`+(i?` Examples of what to draft, in the team's words: ${i}; use these in place of a command's usual examples.`:""),fingerprint:`${s.stages}|${n.join(",")}`})}return t}var qd=8e3;function ra(s,e){try{return ti(Td(s,"utf8").trimEnd(),e)}catch{return null}}function Ld(s,e,t){return e.activeUnit?ra(ui(s),t):null}function es(s,e,t,n){let i=ia(Ld(s,e,t),e,t,n);if(i.length<=qd||!e.activeUnit)return i;let r=ra(fi(s),t);return r?ia(r,e,t,n):i}function ia(s,e,t,n){let i=["BuildKeel:"];for(let r of Yn(e,t)){let o=r.key==="unit"&&e.activeUnit?s?n?" Its context is loaded again below.":" Its context follows.":" BuildKeel has no context for it; call the BuildKeel get_context tool to see why.":"";i.push(`- ${r.text}${o}`)}return s&&i.push("",s),i.join(`
139
- `)}var oa=({event:s,codeRoot:e,cache:t,host:n})=>s.kind!=="session-start"?null:{context:es(e,t,n,s.reason==="compact")};var fa=(s,e,t)=>ts(s,P,"conversations",`${e.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,100)}.${t}`),Rd=(s,e)=>fa(s,e,"json"),da=(s,e)=>fa(s,e,"notices");function ha(s,e,t){let n=da(s,e);la(ts(n,".."),{recursive:!0}),Id(n,`${JSON.stringify(t)}
140
- `)}function jd(s,e){let t=da(s,e),n=hi(t),i;try{ua(t,n),i=ca(n,"utf8")}catch{return[]}finally{Md(n,{force:!0})}return i.split(`
141
- `).filter(Boolean).flatMap(r=>{try{return[String(JSON.parse(r))]}catch{return[]}})}function Fd(s){try{let e=JSON.parse(ca(s,"utf8"));return e.version===1?e:null}catch{return null}}function aa(s,e){la(ts(s,".."),{recursive:!0});let t=`${s}.${process.pid}.tmp`;xd(t,`${JSON.stringify(e,null,2)}
142
- `),ua(t,s)}var pa=s=>s==="~"||s.startsWith("~/")?ts(Kd(),s.slice(1)):s;function Hd(s,e){let t;try{t=Pd(pa(s),"r")}catch{return{ok:!1,offset:e,checkpoint:null}}try{let n=_d(t).size,i=n<e?0:e,r=Buffer.alloc(n-i),o=r.length>0?Dd(t,r,0,r.length,i):0,a=r.subarray(0,o).lastIndexOf(10);if(a<0)return{ok:!0,offset:i,checkpoint:null};let l=!0,c=null;for(let h of r.subarray(0,a).toString("utf8").split(`
143
- `))if(h.trim())try{let u=JSON.parse(h);typeof u.step_index!="number"||typeof u.type!="string"?l=!1:u.type==="CHECKPOINT"&&(c=Math.max(c??-1,u.step_index))}catch{l=!1}return{ok:l,offset:i+a+1,checkpoint:c}}catch{return{ok:!1,offset:e,checkpoint:null}}finally{$d(t)}}function Ud(s){if(!s)return 0;try{return Bd(pa(s)).size}catch{return 0}}var ma=s=>{if(s.event.kind!=="prompt")return null;let e=jd(s.codeRoot,s.event.conversation),n=[Yd(s)?.context,...e].filter(Boolean).join(`
138
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=nn(e),s=Ae(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=nn(e),s=Ae(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};ua.Parser=Qs});var ma=y(et=>{"use strict";var fa=Ms(),Rd=Ye(),Ze=We(),Kd=xn(),jd=C(),Fd=Gs(),da=zs();function ha(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Fd.LineCounter||null,prettyErrors:e}}function Hd(n,e={}){let{lineCounter:t,prettyErrors:s}=ha(e),i=new da.Parser(t?.addNewLine),r=new fa.Composer(e),o=Array.from(r.compose(i.parse(n)));if(s&&t)for(let a of o)a.errors.forEach(Ze.prettifyError(n,t)),a.warnings.forEach(Ze.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function pa(n,e={}){let{lineCounter:t,prettyErrors:s}=ha(e),i=new da.Parser(t?.addNewLine),r=new fa.Composer(e),o=null;for(let a of r.compose(i.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ze.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(Ze.prettifyError(n,t)),o.warnings.forEach(Ze.prettifyError(n,t))),o}function Ud(n,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=pa(n,t);if(!i)return null;if(i.warnings.forEach(r=>Kd.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},t))}function Yd(n,e,t){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(n===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return jd.isDocument(n)&&!s?n.toString(t):new Rd.Document(n,s,t).toString(t)}et.parse=Ud;et.parseAllDocuments=Hd;et.parseDocument=pa;et.stringify=Yd});var on=y(O=>{"use strict";var Jd=Ms(),Vd=Ye(),Wd=ys(),Xs=We(),Gd=Le(),te=C(),Qd=Q(),zd=L(),Xd=X(),Zd=Z(),eh=en(),th=Vs(),nh=Gs(),sh=zs(),rn=ma(),ga=Ce();O.Composer=Jd.Composer;O.Document=Vd.Document;O.Schema=Wd.Schema;O.YAMLError=Xs.YAMLError;O.YAMLParseError=Xs.YAMLParseError;O.YAMLWarning=Xs.YAMLWarning;O.Alias=Gd.Alias;O.isAlias=te.isAlias;O.isCollection=te.isCollection;O.isDocument=te.isDocument;O.isMap=te.isMap;O.isNode=te.isNode;O.isPair=te.isPair;O.isScalar=te.isScalar;O.isSeq=te.isSeq;O.Pair=Qd.Pair;O.Scalar=zd.Scalar;O.YAMLMap=Xd.YAMLMap;O.YAMLSeq=Zd.YAMLSeq;O.CST=eh;O.Lexer=th.Lexer;O.LineCounter=nh.LineCounter;O.Parser=sh.Parser;O.parse=rn.parse;O.parseAllDocuments=rn.parseAllDocuments;O.parseDocument=rn.parseDocument;O.stringify=rn.stringify;O.visit=ga.visit;O.visitAsync=ga.visitAsync});import{appendFileSync as tp,readFileSync as np}from"node:fs";var Qa=["claude-code","antigravity"],ui=n=>Qa.includes(n);function x(n,e){return n==="antigravity"?`/bk-${e}`:`/bk:${e}`}var za=n=>n==="antigravity"?"the agent":"Claude";function fi(n,e){let t=za(e);return n.replace(/\{\{bk:([a-z][a-z-]*)\}\}/g,(s,i)=>x(e,i)).replaceAll("{{agent}}",t).replaceAll("{{Agent}}",t.charAt(0).toUpperCase()+t.slice(1))}import{isAbsolute as hn,relative as tl,resolve as pi}from"node:path";import{existsSync as di}from"node:fs";import{dirname as Xa,join as hi,resolve as Za}from"node:path";var el=".buildkeel.yaml";function Ne(n){let e=Za(n);for(;;){if(di(hi(e,el)))return e;if(di(hi(e,".git")))return null;let t=Xa(e);if(t===e)return null;e=t}}var mn=["write_to_file","replace_file_content","multi_replace_file_content","edit_file","write_file"],nl=["TargetFile","Path"],gi=["run_command"],dp=mn.join("|"),hp=[...mn,...gi].join("|"),sl=n=>{for(let e of nl){let t=n?.[e];if(typeof t=="string"&&t!=="")return t}return null};var il={decision:"allow"},mi={decision:"ask"},pn=(n,e)=>{let t=tl(n,e);return t===""||!t.startsWith("..")&&!hn(t)};function st(n,e){let t=(n.workspacePaths??[]).filter(i=>typeof i=="string"&&i!==""),s=e?[...t.filter(i=>pn(i,e)),...t.filter(i=>!pn(i,e))]:t;return s.find(i=>Ne(i)!==null)??s[0]??process.cwd()}var yi={parse(n,e){let t=n??{};switch(e[0]){case"PreInvocation":return t.conversationId?{kind:"prompt",cwd:st(t),conversation:t.conversationId,newMessage:t.invocationNum===0,transcript:t.transcriptPath??null}:{kind:"ignored"};case"PreToolUse":case"PostToolUse":{let s=t.toolCall?.name??"",i=mn.includes(s)?sl(t.toolCall?.args):null;if(e[0]==="PostToolUse"&&gi.includes(s)){let a=t.toolCall?.args?.CommandLine;return typeof a!="string"||t.error?{kind:"ignored"}:{kind:"after-shell",cwd:st(t),tool:s,command:a,...t.conversationId?{deferTo:t.conversationId}:{}}}if(e[0]==="PostToolUse"){if(!i||t.error)return{kind:"ignored"};let a=st(t,hn(i)?i:void 0);return{kind:"after-edit",cwd:a,tool:s,files:[pi(a,i)],...t.conversationId?{deferTo:t.conversationId}:{}}}let r=st(t,i&&hn(i)?i:void 0),o=[...t.workspacePaths??[],...t.artifactDirectoryPath?[t.artifactDirectoryPath]:[]].filter(a=>typeof a=="string"&&a!=="");return{kind:"before-edit",cwd:r,tool:s,files:i?[pi(r,i)]:[],folders:o}}default:return{kind:"ignored"}}},render(n,e){if(e.kind==="prompt"){let t=n.context?{injectSteps:[{ephemeralMessage:n.context}]}:{};return{stdout:JSON.stringify(t),exitCode:0}}if(e.kind==="before-edit"){let t=e.files.length>0&&e.files.every(i=>(e.folders??[]).some(r=>pn(r,i))),s=n.block?{decision:"deny",reason:n.block}:t?il:mi;return{stdout:JSON.stringify(s),exitCode:0}}return{stdout:"{}",exitCode:0}},failed:n=>({stdout:JSON.stringify(n[0]==="PreToolUse"?mi:{}),exitCode:0})};var wi={Edit:"file_path",Write:"file_path",MultiEdit:"file_path",NotebookEdit:"notebook_path"},mp=Object.keys(wi).join("|"),rl=["Bash","PowerShell"],ol={startup:"startup",resume:"resume",clear:"clear",compact:"compact",fork:"resume"},bi={parse(n){let e=n??{},t=e.cwd??process.cwd();switch(e.hook_event_name){case"SessionStart":{let s=ol[e.source??"startup"]??"startup",i=e.session_id?{conversation:e.session_id,transcript:e.transcript_path??null}:{};return{kind:"session-start",cwd:t,reason:s,...i}}case"PreToolUse":case"PostToolUse":{let s=e.tool_name??"";if(e.hook_event_name==="PreToolUse"&&rl.includes(s)){let o=e.tool_input?.command;return typeof o=="string"?{kind:"before-shell",cwd:t,tool:s,command:o}:{kind:"ignored"}}let i=wi[s],r=i?e.tool_input?.[i]:void 0;return typeof r!="string"?{kind:"ignored"}:{kind:e.hook_event_name==="PreToolUse"?"before-edit":"after-edit",cwd:t,tool:s,files:[r]}}default:return{kind:"ignored"}}},render(n,e){if(e.kind==="session-start")return{stdout:n.context??"",exitCode:0};if(e.kind==="before-shell"&&n.context)return{stdout:JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:n.context}}),exitCode:0};if(e.kind==="before-edit"&&(n.block||n.context)){let t={hookSpecificOutput:{hookEventName:"PreToolUse",...n.block?{permissionDecision:"deny",permissionDecisionReason:n.block}:{},...n.context?{additionalContext:n.context}:{}}};return{stdout:JSON.stringify(t),exitCode:0}}return e.kind==="after-edit"&&n.context?{stdout:JSON.stringify({hookSpecificOutput:{hookEventName:"PostToolUse",additionalContext:n.context}}),exitCode:0}:{stdout:"",exitCode:0}},failed:()=>({stdout:"",exitCode:1})};import{existsSync as wp,readFileSync as al,writeFileSync as bp}from"node:fs";import{join as gn}from"node:path";var _=".buildkeel",ki="break-",ll="hook-cache.json",cl="context.md",Si=n=>gn(n,_,cl),ul="context-short.md",vi=n=>gn(n,_,ul);function fl(n){return gn(n,_,ll)}function Ai(n){try{let e=JSON.parse(al(fl(n),"utf8"));return e?.version===1?e:null}catch{return null}}var Sp=`${_}/`;import{appendFileSync as mh,closeSync as gh,fstatSync as yh,mkdirSync as wh,openSync as bh,readFileSync as kh,readSync as Sh,renameSync as vh,rmSync as Ah,statSync as Nh}from"node:fs";import{join as Ch}from"node:path";import{closeSync as dl,existsSync as hl,fstatSync as pl,mkdirSync as ml,openSync as gl,readdirSync as yl,readFileSync as wl,readSync as bl,renameSync as kl,writeFileSync as Sl}from"node:fs";import{homedir as vl}from"node:os";import{join as fe}from"node:path";var Al="conversations",Nl=(n,e)=>`${n.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,100)}.${e}`,Ni=n=>fe(n,_,Al),it=(n,e,t)=>fe(Ni(n),Nl(e,t));function de(n){try{let e=JSON.parse(wl(n,"utf8"));return e.version===1?e:null}catch{return null}}function rt(n,e){ml(fe(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;Sl(t,`${JSON.stringify(e,null,2)}
139
+ `),kl(t,n)}function Ci(n,e,t,s=new Date,i){let r=it(n,e,"json"),o=de(r)??{version:1,startedAt:s.toISOString()},a={...o,conversation:e,...t?{transcriptPath:t}:{},lastSeen:s.toISOString(),...i!==void 0?{activeUnit:i}:{}};JSON.stringify(a)!==JSON.stringify(o)&&rt(r,a)}function yn(n){let e=Ni(n);return hl(e)?yl(e).filter(t=>t.endsWith(".json")).flatMap(t=>{let s=de(fe(e,t));return s?[{...s,file:fe(e,t)}]:[]}).sort((t,s)=>(s.lastSeen??s.startedAt).localeCompare(t.lastSeen??t.startedAt)):[]}var ot=n=>n==="~"||n.startsWith("~/")?fe(vl(),n.slice(1)):n;function Cl(n){let e;try{e=gl(ot(n),"r")}catch{return[]}try{let t=Buffer.alloc(pl(e).size),s=t.length>0?bl(e,t,0,t.length,0):0;return t.subarray(0,s).toString("utf8").split(`
140
+ `).filter(i=>i.trim())}catch{return[]}finally{dl(e)}}function Ol(n){let e=[];for(let t of n){let s;try{s=JSON.parse(t)}catch{continue}if(s.type==="USER_INPUT"&&typeof s.content=="string"){let a=/<USER_REQUEST>([\s\S]*?)<\/USER_REQUEST>/.exec(s.content)?.[1]??s.content;e.push({text:a.trim(),...typeof s.created_at=="string"?{at:s.created_at}:{}});continue}if(s.type!=="user"||s.isMeta===!0)continue;let i=s.message,r=typeof s.timestamp=="string"?{at:s.timestamp}:{};if(typeof i?.content=="string"){e.push({text:i.content,...r});continue}if(!Array.isArray(i?.content))continue;let o=[];for(let a of i.content)if(a.type==="text"&&typeof a.text=="string")o.push(a.text);else if(a.type==="tool_result"){let l=typeof a.content=="string"?a.content:Array.isArray(a.content)?a.content.map(c=>typeof c.text=="string"?c.text:"").join(`
141
+ `):"";/^User has answered your questions?/.test(l)&&o.push(l)}o.length>0&&e.push({text:o.join(`
142
+ `),...r})}return e}function Oi(n){let e=de(n);e&&rt(n,{...e,recoveryOffered:!0})}function wn(n,e){let t=Ol(Cl(n));return e?t.filter(s=>s.at===void 0||s.at>e):t}import{randomBytes as El}from"node:crypto";import{dirname as Tl,join as Ll}from"node:path";var Ei=n=>Ll(Tl(n),`.${El(6).toString("hex")}.bk-tmp`);import{readFileSync as fh}from"node:fs";var Zs=dn(on(),1);var rh=dn(on(),1);var ei={type:"test-plan",dir:"test-plan",file:"plan.md",idSuffix:"-TP"},ti={type:"design",dir:"design",file:"design.md",idSuffix:"-DD"},ig=[{type:ei.type,dir:ei.dir,file:ei.file,suffix:"TP"},{type:ti.type,dir:ti.dir,file:ti.file,suffix:"DD"}];var ih={notes:"notes",pauses:"pauses",runs:"runs",reviews:"reviews",answers:"answers",switches:"switches",handoffs:"handoffs",asBuilt:"as-built"},rg=["versions","approvals","completions","repins",...Object.values(ih)];function ya(n){return/^([A-Z][A-Z0-9]*-[A-Za-z0-9]+)(?:-|$)/.exec(n)?.[1]??null}var an=(n,e)=>e?`${n} "${e}"`:n;var oh=3;function ln(n,e,t,s){if(e.activeUnit||e.threads==="off")return null;let i=yn(n).find(a=>a.conversation!==s&&a.transcriptPath);if(!i?.transcriptPath||i.recoveryOffered||i.activeUnit)return null;let r=wn(i.transcriptPath,i.savedAt);return r.length<oh?null:(Oi(i.file),`The previous conversation in this repository on this machine (started ${(i.startedAt??"").slice(0,10)}, ${r.length} messages from the user) ended with no unit, and was not paused or captured. Offer once, in one line, to recover it as a thread with ${x(t,"pause")}, built from its whole transcript at ${i.transcriptPath}, which stays on this machine. If the user declines or says nothing of it, do not offer again.`)}function cn(n,e,t,s,i){if(e.activeUnit||!i)return null;let r=yn(n).find(o=>o.conversation===s);return wn(i,r?.savedAt).length===0?null:`This conversation was compacted, and the exploration in it is not saved. If the user pauses with ${x(t,"pause")}, build the thread from the whole transcript at ${i}, not from the summary.`}var wa=dn(on(),1);import{readFileSync as ah,statSync as lh}from"node:fs";import{join as ch}from"node:path";var uh="buildkeel.yaml";function un(n){let e=ch(n.specRoot,uh),t;try{if(lh(e).mtimeMs<=Date.parse(n.updatedAt))return n;t=ah(e,"utf8")}catch{return n}let s;try{s=(0,wa.parse)(t)}catch{return n}let i=(a,l)=>{let c=s?.process,h=c&&typeof c=="object"?c[a]:void 0;return h&&typeof h=="object"?h[l]:void 0},r=a=>a!==!1&&a!=="off",o=i("continuity","threads");return{...n,threads:o===!1?"off":o==="off"||o==="auto"?o:"ask",exploring:r(i("planning","exploring")),spikes:r(i("planning","spikes"))}}function ni(n,e){let t=n.exploring!==!1,s=[{key:"setup",text:"BuildKeel is set up in this repository. Until the user runs a BuildKeel command, or you are about to change a file, converse as you would without it, and leave BuildKeel's artifacts, IDs and commands out of it. "+(t?"Be a thinking partner: check facts in the code and docs before asking; for an idea or a design choice, play back your understanding, lay out two or three options with their trade-offs, risks and pitfalls, then ask one question in prose and say why it matters. ":"Check facts in the code and docs before asking. ")+"Recommend only when the evidence supports it, and say what it rests on; never assume the user's intent, priorities or constraints, and ask when only they know. When you look something up, say what you found and give the sources. "+(t?"Keep what was decided apart from what is still open, and the user's own words apart from your proposals. ":"")+`Take the space the reasoning needs; do not cut it short or push toward a conclusion or a plan. Use your question tool only for a closed choice between comparable options, and let several answers be picked when more than one can apply. Until the user signals the discussion has reached a point, end your replies without mentioning BuildKeel, the spec tree or its artifacts, and without offering to draft, record, plan or build anything; settling the last open question is not that signal, so wait for the user to say it. When they signal it, such as with "sounds good" or "I think that's it", ask once, in prose, whether there is more to explore or they are ready to capture it with ${x(e,"capture")}; if they keep talking or say no, do not offer again until something new is settled. Never start it yourself. When the user says words such as "let's stop here" or "I'm switching machines", pause as ${x(e,"pause")} does.`,fingerprint:t?"":"no-exploring"}];if(n.activeUnit){let i=n.activeBranch?` on branch ${n.activeBranch}`:"";s.push({key:"unit",text:`Active unit: ${an(n.activeUnit,n.activeTitle)}${i}.`,fingerprint:`${n.activeUnit}${i}`})}else n.spike?s.push({key:"unit",text:`No active unit in this working tree: the spike "${n.spike.name}" is under way on ${n.spike.branch} since ${n.spike.since}, untracked, throwaway work whose commits carry no unit line. End it with the BuildKeel manage tool (action spike, end true) to offer its findings as working notes.`,fingerprint:`spike:${n.spike.branch}`}):n.untrackedSince?s.push({key:"unit",text:`No active unit in this working tree: the user chose to work without one here since ${n.untrackedSince}, so changes made now belong to no unit. Starting a unit with ${x(e,"build")} <ID> ends this.`,fingerprint:`untracked:${n.untrackedSince}`}):s.push({key:"unit",text:"No unit is active in this working tree.",fingerprint:""});if(n.paused&&n.paused.length>0){let i=(n.pausedCount??n.paused.length)-n.paused.length,r=n.paused.map(o=>`${o.id}${o.title?` "${o.title}"`:""} (paused by ${o.by} on ${o.at.slice(0,10)}${o.next?`; next: ${o.next}`:""})`);s.push({key:"paused",text:`Paused work in this spec tree: ${r.join("; ")}${i>0?`; and ${i} more`:""}. Offer it once, in one line, when the user's first message does not take the conversation elsewhere: ${x(e,"resume")} with its ID resumes it. Do not offer it again in this conversation.`,fingerprint:n.paused.map(o=>`${o.id}@${o.at}`).join(",")})}if(n.freshness?.status==="behind"&&s.push({key:"behind",text:"The spec tree was behind its remote at the last fetch, so work paused on another machine may not be here yet. Only when the user turns to work (resuming, building, or asking what is paused), offer once, in one line, to pull it first; do not raise it otherwise.",fingerprint:"behind"}),s.push(dh(n)),s.push({key:"knowledge",text:'When the user states a rule for how the team designs, tests or reviews code, such as "from now on we always...", it is a team practice: offer it in full, saved with save_draft type practice once the user agrees, never in your own memory. When a decision is hard to reverse, surprising without its context, and chosen over a real alternative, offer an ADR for it in one line; draft it with save_draft type adr only if the user agrees.'+(n.spikes===!1?"":` When the user asks for a spike, throwaway work to find something out, such as "let's spike the SMS provider", start it with manage action spike and a short name before writing any file, even a scratch one, and end it with manage action spike and end: true when they say so.`),fingerprint:n.spikes===!1?"no-spikes":""}),s.push({key:"rules",text:"Read and change the spec tree only through the BuildKeel tools, never by editing its files.",fingerprint:""}),s.push({key:"review",text:"Before you save anything to the spec tree, show what changes, in full, in your reply, and ask in plain text. Agreement saves it; anything else is feedback: discuss it, then list each point with how it was addressed, show the final version, and save only once the user agrees. When work would change a document the user agreed, say which, what and why, and take it through the same review. Never add, change or remove a requirement, criterion, scenario or task on your own initiative. Check a reported problem against the spec and its code first: propose, as your reading, a defect, a change in behavior, a gap or code no spec covers; record nothing until the user confirms. If agreed behavior looks wrong while building, stop and ask, naming the requirement, criterion or scenario and why; never build something else or edit the spec without the answer. Kept, build it as agreed; changed, update the spec first, then the code."+(n.mode==="spec-driven"?" Report each tick in a line; do not ask about ticks. Tick with save_draft tick, change one requirement with save_draft requirement, and read one file of a change with query file, rather than resending or rereading whole files.":""),fingerprint:n.mode==="spec-driven"?"spec-driven":""}),n.mode==="spec-driven")s.push({key:"stages",text:"This spec tree is Spec-driven: its capability specs say how the system behaves now, and each change says how it will change; nothing in it is approved. Before discussing how the system behaves, look up the capability specs with the BuildKeel query tool. Each BuildKeel command follows its part for a Spec-driven tree.",fingerprint:"spec-driven"},{key:"consistency",text:"When you edit one file of an open change (its proposal, a spec change, its design or its tasks), check the others against the edit, in any direction, and name the follow-on edits in the same reply; then take each through the review, one edit at a time, with what changes and why. Never edit code as part of this.",fingerprint:"spec-driven"},{key:"build",text:`While a change is open, commit each task's work as it is done, adding "BuildKeel-Task: <number>" to a commit that does exactly that one task, and tick each task once its verification passes. Name a change with its title, never by its ID alone, such as CH-001 "Download historical market data". When the user asks in words to build a change's tasks, suggest ${x(e,"build")} once; if they say to go ahead without it, build the tasks anyway by the same rules, and if they say not now, build nothing. A specific edit they ask for needs no suggestion. While building, stop and ask when a test fails and you cannot fix it, or a requirement is unclear. Before adding a requirement to a change with more than half its tasks ticked, ask once whether it belongs in that change or a new one, and draft nothing until they answer.`,fingerprint:`spec-driven|${e}`},{key:"tests",text:"Put the ID of the scenario a test checks in square brackets in the test's name, one ID per bracket.",fingerprint:"spec-driven"}),n.guide==="on"&&s.push({key:"guide",text:"This person chose to be guided through their first change: at each step of it, from drafting to finishing, add one or two plain lines on what just happened and what comes next, as BuildKeel's tool results say. If they ask you to stop explaining, turn it off with the BuildKeel manage tool (action guide, guide off).",fingerprint:"on"});else if(n.stages){let i=(n.stageExamples??[]).map(o=>`\`${o}\``),r=i.length>1?`${i.slice(0,-1).join(", ")} or ${i.at(-1)}`:i[0]??"";s.push({key:"stages",text:`This spec tree's stages, as the team names them: ${n.stages}. Use these names with the user, in each command's help, questions and output; BuildKeel's tools accept them as types, and the usual names too.`+(r?` Examples of what to draft, in the team's words: ${r}; use these in place of a command's usual examples.`:""),fingerprint:`${n.stages}|${i.join(",")}`})}return s}var ba=25;function dh(n){let e=n.glossary??[],t=e.slice(0,ba).map(r=>`${r.term} (${r.definition}${r.avoid.length>0?`; not: ${r.avoid.join(", ")}`:""})`),s=e.slice(ba).map(r=>r.term);return{key:"terms",text:"Hold to precise words: when the user uses a term against the glossary, or against how the code uses it, say so and ask which meaning is meant, before anything else; when a term is vague or means two things, propose one precise term for each, with a concrete example at the boundary if it helps; once a term is settled, offer its glossary entry in full, saved with save_draft type glossary only once the user agrees."+(e.length>0?` The team's glossary: ${t.join("; ")}${s.length>0?`; and ${s.join(", ")} (query view glossary)`:""}.`:""),fingerprint:e.map(r=>`${r.term}:${r.definition}:${r.avoid.join(",")}`).join("|")}}var hh=8e3;function Sa(n,e){try{return fi(fh(n,"utf8").trimEnd(),e)}catch{return null}}function ph(n,e,t){return e.activeUnit?Sa(Si(n),t):null}function fn(n,e,t,s,i=[]){let r=ka(ph(n,e,t),e,t,s,i);if(r.length<=hh||!e.activeUnit)return r;let o=Sa(vi(n),t);return o?ka(o,e,t,s,i):r}function ka(n,e,t,s,i){let r=["BuildKeel:"];for(let o of ni(e,t)){let a=o.key==="unit"&&e.activeUnit?n?s?" Its context is loaded again below.":" Its context follows.":" BuildKeel has no context for it; call the BuildKeel get_context tool to see why.":"";r.push(`- ${o.text}${a}`)}return r.push(...i.map(o=>`- ${o}`)),n&&r.push("",n),r.join(`
143
+ `)}var va=({event:n,codeRoot:e,cache:t,host:s})=>{if(n.kind!=="session-start")return null;let i=un(t),r=n.reason==="compact"?[cn(e,i,s,n.conversation,n.transcript)]:n.reason==="resume"?[]:[ln(e,i,s,n.conversation)];return{context:fn(e,i,s,n.reason==="compact",r.filter(o=>o!==null))}};var Oh=(n,e)=>it(n,e,"json"),Na=(n,e)=>it(n,e,"notices");function Ca(n,e,t){let s=Na(n,e);wh(Ch(s,".."),{recursive:!0}),mh(s,`${JSON.stringify(t)}
144
+ `)}function Eh(n,e){let t=Na(n,e),s=Ei(t),i;try{vh(t,s),i=kh(s,"utf8")}catch{return[]}finally{Ah(s,{force:!0})}return i.split(`
145
+ `).filter(Boolean).flatMap(r=>{try{return[String(JSON.parse(r))]}catch{return[]}})}var Th=n=>{let e=de(n);return e?.reported&&e.transcript?e:null},Aa=rt;function Lh(n,e){let t;try{t=bh(ot(n),"r")}catch{return{ok:!1,offset:e,checkpoint:null}}try{let s=yh(t).size,i=s<e?0:e,r=Buffer.alloc(s-i),o=r.length>0?Sh(t,r,0,r.length,i):0,a=r.subarray(0,o).lastIndexOf(10);if(a<0)return{ok:!0,offset:i,checkpoint:null};let l=!0,c=null;for(let h of r.subarray(0,a).toString("utf8").split(`
146
+ `))if(h.trim())try{let u=JSON.parse(h);typeof u.step_index!="number"||typeof u.type!="string"?l=!1:u.type==="CHECKPOINT"&&(c=Math.max(c??-1,u.step_index))}catch{l=!1}return{ok:l,offset:i+a+1,checkpoint:c}}catch{return{ok:!1,offset:e,checkpoint:null}}finally{gh(t)}}function qh(n){if(!n)return 0;try{return Nh(ot(n)).size}catch{return 0}}var Oa=n=>{if(n.event.kind!=="prompt")return null;let e=Eh(n.codeRoot,n.event.conversation),s=[Ih(n)?.context,...e].filter(Boolean).join(`
144
147
 
145
- `);return n?{context:n}:null},Yd=({event:s,codeRoot:e,cache:t,host:n})=>{if(s.kind!=="prompt")return null;let i=Rd(e,s.conversation),r=Yn(t,n),o=Object.fromEntries(r.map(f=>[f.key,f.fingerprint])),a=Fd(i);if(!a)return aa(i,{version:1,startedAt:new Date().toISOString(),reported:o,transcript:{offset:Ud(s.transcript),checkpoint:null}}),{context:es(e,t,n,!1)};let l=s.transcript?Hd(s.transcript,a.transcript.offset):{ok:!1,offset:a.transcript.offset,checkpoint:null},c=l.checkpoint!==null&&(a.transcript.checkpoint===null||l.checkpoint>a.transcript.checkpoint),h={...a,transcript:{offset:l.offset,checkpoint:c?l.checkpoint:a.transcript.checkpoint}},u=null;if(c)u=es(e,t,n,!0),h.reported=o;else if(s.newMessage){let f=r.filter(p=>a.reported[p.key]!==p.fingerprint).map(p=>`- ${p.text}`);if(!l.ok&&t.activeUnit){let p=`- Active unit: ${t.activeUnit}. If its requirements and test cases are no longer in view, call the BuildKeel get_context tool.`,y=f.findIndex(d=>d.startsWith("- Active unit:"));y>=0?f[y]=`${f[y]} If its requirements and test cases are no longer in view, call the BuildKeel get_context tool.`:f.unshift(p)}f.length>0&&(u=["BuildKeel:",...f].join(`
146
- `)),h.reported=o}return JSON.stringify(h)!==JSON.stringify(a)&&aa(i,h),u?{context:u}:null};import{appendFileSync as th,mkdirSync as sh}from"node:fs";import{dirname as nh,join as ih,resolve as rh}from"node:path";import{existsSync as Jd,realpathSync as ga}from"node:fs";import{basename as va,dirname as ya,isAbsolute as Vd,join as Wd,relative as Na,resolve as Gd,sep as Qd}from"node:path";var Jn={versions:"the frozen copy",approvals:"an approval record",completions:"a completion record",repins:"a re-pin decision record"},zd={"test-plan":"TP",design:"DD"},Xd=process.platform==="win32",T=s=>Xd?s.toLowerCase():s;function le(s,e){let t=ba(s,e);if(t!==null)return t;try{let n=e;for(;!Jd(n)&&ya(n)!==n;)n=ya(n);let i=Wd(ga(n),Na(n,e));return ba(ga(s),i)}catch{return null}}var ce=(s,e)=>le(s,e);function ba(s,e){let t=Na(s,e);return t===""||t.startsWith("..")||Vd(t)?null:t.split(Qd).join("/")}var wa="Make the change you want through a new change, drafted with the BuildKeel save_draft tool (type change): finishing it writes the next versions.",Zd="It is kept, read-only, as the history of how the system came to be before this spec tree moved to Full SDLC. Change behavior through the team's stages, as a new version of the artifact it became.";function Sa(s,e){if(s.conversion!=="finished")return eh(s,e);if(T(e)===T("onboarding/conversion.yaml"))return`BuildKeel: ${e} records how this spec tree moved to Full SDLC, and where each scenario went. It was finished when the tree switched, and is never edited.`;let[t]=e.split("/").map(T);return t!==T("capabilities")&&t!==T("changes")?null:`BuildKeel: ${e} is part of the capability specs and changes this spec tree had before it moved to Full SDLC. ${Zd}`}function eh(s,e){let t=e.split("/"),[n,,i]=t.map(T);if(n===T("capabilities")&&t.length>=3){let a=/^v(0|[1-9][0-9]*)\.(md|yaml)$/.exec(va(e)),l=a?`${t[1]} v${a[1]}`:t[1]??"",c=a?.[2]==="yaml"?`the record of ${l}`:a?`${l}, a capability spec version`:`part of capability ${l}`;return`BuildKeel: ${e} is ${c}, written when a change was archived. Capability specs are never edited directly. ${wa}`}if(n!==T("changes")||t.length<3)return null;let r=na((t[1]??"").toUpperCase()),o=r??t[1]??"";return t.length===3&&i===T("discarded.yaml")?`BuildKeel: ${e} is the discard record of ${o}. BuildKeel writes it once when a change is discarded, and it is never edited.`:t.length===3&&i===T("archive.yaml")?`BuildKeel: ${e} is the archive record of ${o}, written once when it was archived. It is never edited.`:t.length===4&&i!==void 0&&Object.hasOwn(Jn,i)?`BuildKeel: ${e} is ${Jn[i]} of ${o}. BuildKeel writes these records once and they are never edited, by hand or by the agent.`:r&&(s.archivedChanges??[]).some(a=>T(a)===T(r))?`BuildKeel: ${e} belongs to ${o}, which is archived: its files are its record and are never edited. ${wa}`:null}function Xe(s,e){let t=ce(s.specRoot,e);return t===null?null:/^bugs\/[^/]+\/closed\.yaml$/.test(T(t))?`BuildKeel: ${t} is the closing record of ${t.split("/")[1]}. BuildKeel writes it once when the bug is closed, and it is never edited. A defect that returns is a new bug.`:s.mode==="spec-driven"?Sa(s,t)??(s.conversion?ka(s,t):null):(s.conversion==="finished"?Sa(s,t):null)??ka(s,t)}function ka(s,e){let t=e.split("/"),n=s.documents??zd,i=t.length>=4&&t[2]!==void 0&&Object.hasOwn(n,t[2])?n[t[2]]:void 0,r=i!==void 0,o=t[r?3:2],a=`${t[1]??""}${r?`-${i}`:""}`,l=r?5:4;if(o&&t.length===l&&s.lockedDirs.map(T).includes(T(o))){if(T(o)==="versions"){let u=/^v(0|[1-9][0-9]*)\.md$/.exec(va(e))?.[1],f=u?`${a} v${u}`:a;return`BuildKeel: ${e} is the frozen copy of ${f}, which is approved and cannot be changed. To change ${a}, call the BuildKeel save_draft tool with id ${a} and the whole changed file: that opens the next version as a draft, and the approved version stays in force until the new one is approved.`}let h=Jn[o.toLowerCase()]??"a record";return`BuildKeel: ${e} is ${h} of ${a}. BuildKeel writes these records once and they are never edited, by hand or by the agent.`+(T(o)==="approvals"?" To approve a new version, use the BuildKeel approve tool.":"")}if((s.lockedSources??[]).find(h=>T(e).startsWith(`${T(h)}/`))){let h=`${t[1]??""}${r?`-${i}`:""}`;return`BuildKeel: ${e} is a source kept with ${h} v0, frozen when version 0 was approved: sources stay exactly as they were read. To change what ${h} says, call the BuildKeel save_draft tool with id ${h} and the whole changed file: that opens its next version as a draft.`}return s.lockedFiles.some(h=>T(h)===T(e))?`BuildKeel: ${e} is the working file of ${a}, which is approved and has no new version open, so it is not edited directly. To change ${a}, call the BuildKeel save_draft tool with id ${a} and the whole changed file: that opens the next version as a draft, and the approved version stays in force until the new one is approved.`:null}var Aa=({event:s,cache:e})=>{if(s.kind!=="before-edit"&&s.kind!=="after-edit")return null;let t=e.lockMode??"block";if(!(t==="block"?s.kind==="before-edit":t==="warn"&&s.kind==="after-edit"))return null;let i=s.files.map(r=>Xe(e,Gd(s.cwd,r))).filter(r=>r!==null);return i.length===0?null:s.kind==="before-edit"?{block:[...new Set(i)].join(`
148
+ `);return s?{context:s}:null},Ih=({event:n,codeRoot:e,cache:t,host:s})=>{if(n.kind!=="prompt")return null;let i=un(t),r=Oh(e,n.conversation),o=ni(i,s),a=Object.fromEntries(o.map(p=>[p.key,p.fingerprint])),l=Th(r);if(!l){let p=new Date().toISOString(),g=de(r),d={...g,version:1,startedAt:g?.startedAt??p,conversation:n.conversation,...n.transcript?{transcriptPath:n.transcript}:{},lastSeen:p,activeUnit:i.activeUnit,reported:a,transcript:{offset:qh(n.transcript),checkpoint:null}};Aa(r,d);let m=ln(e,i,s,n.conversation);return{context:fn(e,i,s,!1,m?[m]:[])}}let c=n.transcript?Lh(n.transcript,l.transcript.offset):{ok:!1,offset:l.transcript.offset,checkpoint:null},h=c.checkpoint!==null&&(l.transcript.checkpoint===null||c.checkpoint>l.transcript.checkpoint),u={...l,conversation:n.conversation,...n.transcript?{transcriptPath:n.transcript}:{},...n.newMessage?{lastSeen:new Date().toISOString(),activeUnit:i.activeUnit}:{},transcript:{offset:c.offset,checkpoint:h?c.checkpoint:l.transcript.checkpoint}},f=null;if(h){let p=cn(e,i,s,n.conversation,n.transcript);f=fn(e,i,s,!0,p?[p]:[]),u.reported=a}else if(n.newMessage){let p=o.filter(g=>g.key!=="behind"&&l.reported[g.key]!==g.fingerprint).map(g=>`- ${g.text}`);if(!c.ok&&i.activeUnit){let g=`- Active unit: ${i.activeUnit}. If its requirements and test cases are no longer in view, call the BuildKeel get_context tool.`,d=p.findIndex(m=>m.startsWith("- Active unit:"));d>=0?p[d]=`${p[d]} If its requirements and test cases are no longer in view, call the BuildKeel get_context tool.`:p.unshift(g)}p.length>0&&(f=["BuildKeel:",...p].join(`
149
+ `)),u.reported=a}return JSON.stringify(u)!==JSON.stringify(l)&&Aa(r,u),f?{context:f}:null},Ea=({event:n,codeRoot:e,cache:t})=>{if(n.kind!=="session-start"||!n.conversation)return null;try{Ci(e,n.conversation,n.transcript??null,new Date,t.activeUnit)}catch{}return null};import{appendFileSync as Fh,mkdirSync as Hh}from"node:fs";import{dirname as Uh,join as Yh,resolve as Jh}from"node:path";import{existsSync as $h,realpathSync as Ta}from"node:fs";import{basename as xa,dirname as La,isAbsolute as _h,join as Ph,relative as Da,resolve as qa,sep as xh}from"node:path";var si={versions:"the frozen copy",approvals:"an approval record",completions:"a completion record",repins:"a re-pin decision record",notes:"a record of working notes",pauses:"a pause record",runs:"a test-run summary",reviews:"a record of review findings",answers:"the answer to a review finding"},Dh={glossary:"a version of a glossary entry",practices:"a version of a practice",adrs:"an architecture decision record",threads:"a record of a thread","code-notes":"a version of a note on the code",patterns:"a record of a declined pattern"},Mh={"test-plan":"TP",design:"DD"},Bh=()=>process.platform==="win32"||process.platform==="darwin",T=n=>Bh()?n.toLowerCase():n;function ne(n,e){let t=Ia(n,e);if(t!==null)return t;try{let s=e;for(;!$h(s)&&La(s)!==s;)s=La(s);let i=Ph(Ta(s),Da(s,e));return Ia(Ta(n),i)}catch{return null}}var ce=(n,e)=>ne(n,e);function Ia(n,e){let t=Da(n,e);return t===""||t.startsWith("..")||_h(t)?null:t.split(xh).join("/")}var $a="Make the change you want through a new change, drafted with the BuildKeel save_draft tool (type change): finishing it writes the next versions.",Rh="It is kept, read-only, as the history of how the system came to be before this spec tree moved to Full SDLC. Change behavior through the team's stages, as a new version of the artifact it became.";function _a(n,e){if(n.conversion!=="finished")return Kh(n,e);if(T(e)===T("onboarding/conversion.yaml"))return`BuildKeel: ${e} records how this spec tree moved to Full SDLC, and where each scenario went. It was finished when the tree switched, and is never edited.`;let[t]=e.split("/").map(T);return t!==T("capabilities")&&t!==T("changes")?null:`BuildKeel: ${e} is part of the capability specs and changes this spec tree had before it moved to Full SDLC. ${Rh}`}function Kh(n,e){let t=e.split("/"),[s,,i]=t.map(T);if(s===T("capabilities")&&t.length>=3){let a=/^v(0|[1-9][0-9]*)\.(md|yaml)$/.exec(xa(e)),l=a?`${t[1]} v${a[1]}`:t[1]??"",c=a?.[2]==="yaml"?`the record of ${l}`:a?`${l}, a capability spec version`:`part of capability ${l}`;return`BuildKeel: ${e} is ${c}, written when a change was archived. Capability specs are never edited directly. ${$a}`}if(s!==T("changes")||t.length<3)return null;let r=ya((t[1]??"").toUpperCase()),o=r??t[1]??"";return t.length===3&&i===T("discarded.yaml")?`BuildKeel: ${e} is the discard record of ${o}. BuildKeel writes it once when a change is discarded, and it is never edited.`:t.length===3&&i===T("archive.yaml")?`BuildKeel: ${e} is the archive record of ${o}, written once when it was archived. It is never edited.`:t.length===4&&i!==void 0&&Object.hasOwn(si,i)?`BuildKeel: ${e} is ${si[i]} of ${o}. BuildKeel writes these records once and they are never edited, by hand or by the agent.`:r&&(n.archivedChanges??[]).some(a=>T(a)===T(r))?`BuildKeel: ${e} belongs to ${o}, which is archived: its files are its record and are never edited. ${$a}`:null}function tt(n,e){let t=ce(n.specRoot,e);if(t===null)return null;if(/^defects\/[^/]+\/closed\.yaml$/.test(T(t)))return`BuildKeel: ${t} is the closing record of ${t.split("/")[1]}. BuildKeel writes it once when the defect is closed, and it is never edited. A defect that returns is a new defect.`;let s=Dh[T(t.split("/")[0]??"")];return s&&t.includes("/")?`BuildKeel: ${t} is ${s}. BuildKeel writes these records through its tools, a new file for each change, and they are never edited, by hand or by the agent: save the change with the BuildKeel save_draft tool.`:n.mode==="spec-driven"?_a(n,t)??(n.conversion?Pa(n,t):null):(n.conversion==="finished"?_a(n,t):null)??Pa(n,t)}function Pa(n,e){let t=e.split("/"),s=n.documents??Mh,i=t.length>=4&&t[2]!==void 0&&Object.hasOwn(s,t[2])?s[t[2]]:void 0,r=i!==void 0,o=t[r?3:2],a=`${t[1]??""}${r?`-${i}`:""}`,l=r?5:4;if(o&&t.length===l&&n.lockedDirs.map(T).includes(T(o))){if(T(o)==="versions"){let u=/^v(0|[1-9][0-9]*)\.md$/.exec(xa(e))?.[1],f=u?`${a} v${u}`:a;return`BuildKeel: ${e} is the frozen copy of ${f}, which is approved and cannot be changed. To change ${a}, call the BuildKeel save_draft tool with id ${a} and the whole changed file: that opens the next version as a draft, and the approved version stays in force until the new one is approved.`}let h=si[o.toLowerCase()]??"a record";return`BuildKeel: ${e} is ${h} of ${a}. BuildKeel writes these records once and they are never edited, by hand or by the agent.`+(T(o)==="approvals"?" To approve a new version, use the BuildKeel approve tool.":"")}if((n.lockedSources??[]).find(h=>T(e).startsWith(`${T(h)}/`))){let h=`${t[1]??""}${r?`-${i}`:""}`;return`BuildKeel: ${e} is a source kept with ${h} v0, frozen when version 0 was approved: sources stay exactly as they were read. To change what ${h} says, call the BuildKeel save_draft tool with id ${h} and the whole changed file: that opens its next version as a draft.`}return n.lockedFiles.some(h=>T(h)===T(e))?`BuildKeel: ${e} is the working file of ${a}, which is approved and has no new version open, so it is not edited directly. To change ${a}, call the BuildKeel save_draft tool with id ${a} and the whole changed file: that opens the next version as a draft, and the approved version stays in force until the new one is approved.`:null}function jh(n,e,t){let s=ne(e,t);return s===null?null:(n.copy??[]).some(r=>r.endsWith("/")?T(s).startsWith(T(r)):T(s)===T(r))?`BuildKeel: ${s} is the read-only copy of the spec tree's glossary, practices or ADRs, which BuildKeel writes. Change the glossary, a practice or an ADR through BuildKeel (save_draft with type glossary, practice or adr), and the copy is written again.`:null}var Ma=({event:n,cache:e,codeRoot:t})=>{if(n.kind!=="before-edit"&&n.kind!=="after-edit")return null;let s=e.lockMode??"block";if(!(s==="block"?n.kind==="before-edit":s==="warn"&&n.kind==="after-edit"))return null;let r=n.files.map(o=>tt(e,qa(n.cwd,o))??jh(e,t,qa(n.cwd,o))).filter(o=>o!==null);return r.length===0?null:n.kind==="before-edit"?{block:[...new Set(r)].join(`
147
150
 
148
- `)}:{context:i.map(r=>`BuildKeel: this tree's lock gate is set to warn, so the edit went ahead. ${r.replace(/^BuildKeel: /,"")} Validation and the status overview report the change. Tell the user, and undo it unless they asked for it.`).join(`
151
+ `)}:{context:r.map(o=>`BuildKeel: this tree's lock gate is set to warn, so the edit went ahead. ${o.replace(/^BuildKeel: /,"")} Validation and the status overview report the change. Tell the user, and undo it unless they asked for it.`).join(`
149
152
 
150
- `)}};var Vn=(s,e)=>ih(s,P,"journal",`${e}.jsonl`),Oa=({event:s,codeRoot:e,cache:t})=>{if(s.kind!=="after-edit"||!t.activeUnit)return null;let n=new Date().toISOString(),i=[];for(let o of s.files){let a=rh(s.cwd,o);if(Xe(t,a)||ce(t.specRoot,a)!==null)continue;let l=le(e,a);if(l===null||l===P||l.startsWith(`${P}/`))continue;let c={at:n,tool:s.tool,file:l};i.push(JSON.stringify(c))}if(i.length===0)return null;let r=Vn(e,t.activeUnit);return sh(nh(r),{recursive:!0}),th(r,`${i.join(`
153
+ `)}};var ii=(n,e)=>Yh(n,_,"journal",`${e}.jsonl`),Ba=({event:n,codeRoot:e,cache:t})=>{if(n.kind!=="after-edit"||!t.activeUnit)return null;let s=new Date().toISOString(),i=[];for(let o of n.files){let a=Jh(n.cwd,o);if(tt(t,a)||ce(t.specRoot,a)!==null)continue;let l=ne(e,a);if(l===null||l===_||l.startsWith(`${_}/`))continue;let c={at:s,tool:n.tool,file:l};i.push(JSON.stringify(c))}if(i.length===0)return null;let r=ii(e,t.activeUnit);return Hh(Uh(r),{recursive:!0}),Fh(r,`${i.join(`
151
154
  `)}
152
- `),null};var oh=/\bgit(?:\s+-{1,2}[^\s;&|]+(?:\s+(?!push\b)[^\s;&|-][^\s;&|]*)?)*\s+push\b|\bgh\s+pr\s+(?:create|merge)\b/,ah=s=>oh.test(s),Ea=({event:s,cache:e,host:t})=>s.kind!=="before-shell"||!e.activeUnit||!ah(s.command)?null:{context:`BuildKeel: ${Zt(e.activeUnit,e.activeTitle)} is not finished: tell the user to run ${R(t,"done")} before merging. The command goes ahead.`};import{resolve as lh}from"node:path";var Ca=({event:s,codeRoot:e,cache:t,host:n})=>{if(s.kind!=="before-edit"||t.activeUnit||t.untrackedSince)return null;let i=s.files.flatMap(r=>{let o=lh(s.cwd,r);if(ce(t.specRoot,o)!==null)return[];let a=le(e,o);return a===null||a===P||a.startsWith(`${P}/`)?[]:[a]});return i.length===0?null:{block:`BuildKeel: there is no active unit in this working tree, so a change to ${i.join(", ")} would belong to no unit of work. Before changing it, ask the user how to go on, recommending the choice that fits: capture what you discussed, which the user starts by running ${R(n,"capture")} (you cannot start it), turning it into the artifacts the team's process needs, to approve and then build; start the unit it belongs to with ${R(n,"build")} <ID>; record it as an ad-hoc unit, with a short title you propose (create it with the BuildKeel save_draft tool, type adhoc, then start it with start_work); or go ahead without a unit, which only the user can choose (then call the BuildKeel manage tool with action untracked). Make the change once one of these is done.`}};import{readFileSync as ch}from"node:fs";import{resolve as uh}from"node:path";function Wn(s,e){return e.some(t=>t.endsWith("/")?s.startsWith(t):s===t||s.startsWith(`${t}/`))}function Gn(s){let e=s.split("/"),t=e.at(-1)??"";return e.slice(0,-1).some(n=>["test","tests","__tests__","spec"].includes(n))||/[._-](test|spec)\.[^.]+$/.test(t)||/^test_.*\.py$/.test(t)}var Qn=8;function fh(s,e){try{let t=ch(Vn(s,e),"utf8").split(`
153
- `).filter(Boolean);return new Set(t.map(n=>JSON.parse(n).file))}catch{return new Set}}var Ta=({event:s,codeRoot:e,cache:t})=>{if(s.kind!=="after-edit"||!t.activeUnit||t.scope.length===0)return null;let n=fh(e,t.activeUnit),i=[];for(let a of s.files){let l=uh(s.cwd,a);if(Xe(t,l)||ce(t.specRoot,l)!==null)continue;let c=le(e,l);c===null||c===P||c.startsWith(`${P}/`)||!Wn(c,t.scope)&&!Gn(c)&&!n.has(c)&&!i.includes(c)&&i.push(c)}if(i.length===0)return null;let r=t.activeUnit,o=t.scope.slice(0,Qn).join(", ")+(t.scope.length>Qn?`, and ${t.scope.length-Qn} more`:"");return{context:`BuildKeel: ${i.join(", ")} ${i.length===1?"is":"are"} outside the areas ${r} relates to so far (${o}): its scope and its story's, and what its own work and the other work on its story changed. If the change belongs to ${r}, carry on and tell the user it widens what ${r} touches. If it belongs to other work, stop and ask the user which unit it belongs to.`}};function qa(s,e,t="claude-code"){if(s.kind==="ignored")return{};let n=et(s.cwd);if(!n)return{};let i=di(n);if(!i)return{};let r=e.map(l=>l({event:s,codeRoot:n,cache:i,host:t})).filter(l=>l!==null),o=r.find(l=>l.block)?.block,a=r.map(l=>l.context).filter(Boolean).join(`
155
+ `),null};var Vh=/\bgit(?:\s+-{1,2}[^\s;&|]+(?:\s+(?!push\b)[^\s;&|-][^\s;&|]*)?)*\s+push\b|\bgh\s+pr\s+(?:create|merge)\b/,Wh=n=>Vh.test(n),Ra=({event:n,cache:e,host:t})=>{if(n.kind!=="before-shell"&&n.kind!=="after-shell"||!e.activeUnit||!Wh(n.command))return null;let s=n.kind==="after-shell"?` The command \`${n.command}\` has run.`:" The command goes ahead.";return{context:`BuildKeel: ${an(e.activeUnit,e.activeTitle)} is not finished: tell the user to run ${x(t,"done")} before merging.${s}`}};import{resolve as Gh}from"node:path";var Ka=({event:n,codeRoot:e,cache:t,host:s})=>{if(n.kind!=="before-edit"||t.activeUnit||t.untrackedSince||Qh(e))return null;let i=n.files.flatMap(r=>{let o=Gh(n.cwd,r);if(ce(t.specRoot,o)!==null)return[];let a=ne(e,o);return a===null||a===_||a.startsWith(`${_}/`)?[]:[a]});return i.length===0||t.merging&&i.every(r=>t.merging?.files.includes(r))?null:{block:`BuildKeel: there is no active unit in this working tree, so a change to ${i.join(", ")} would belong to no unit of work. Before changing it, ask the user how to go on, recommending the choice that fits: capture what you discussed, which the user starts by running ${x(s,"capture")} (you cannot start it), turning it into ${t.mode==="spec-driven"?"a change to build":"the artifacts the team's process needs, to approve and then build"}; start the unit it belongs to with ${x(s,"build")} <ID>; record it as an ad-hoc unit, with a short title you propose (create it with the BuildKeel save_draft tool, type adhoc, then start it with start_work); or go ahead without a unit, which only the user can choose (then call the BuildKeel manage tool with action untracked). Make the change once one of these is done.`}},Qh=n=>{let e=n.replaceAll("\\","/").replace(/\/$/,"").split("/");return e.at(-3)===_&&e.at(-2)==="worktrees"&&(e.at(-1)??"").startsWith(ki)};import{readFileSync as zh}from"node:fs";import{resolve as Xh}from"node:path";function ri(n,e){return e.some(t=>t.endsWith("/")?n.startsWith(t):n===t||n.startsWith(`${t}/`))}function oi(n){let e=n.split("/"),t=e.at(-1)??"";return e.slice(0,-1).some(s=>["test","tests","__tests__","spec"].includes(s))||/[._-](test|spec)\.[^.]+$/.test(t)||/^test_.*\.py$/.test(t)}var ai=8;function Zh(n,e){try{let t=zh(ii(n,e),"utf8").split(`
156
+ `).filter(Boolean);return new Set(t.map(s=>JSON.parse(s).file))}catch{return new Set}}var ja=({event:n,codeRoot:e,cache:t})=>{if(n.kind!=="after-edit"||!t.activeUnit||t.scope.length===0)return null;let s=Zh(e,t.activeUnit),i=[];for(let a of n.files){let l=Xh(n.cwd,a);if(tt(t,l)||ce(t.specRoot,l)!==null)continue;let c=ne(e,l);c===null||c===_||c.startsWith(`${_}/`)||!ri(c,t.scope)&&!oi(c)&&!s.has(c)&&!i.includes(c)&&i.push(c)}if(i.length===0)return null;let r=t.activeUnit,o=t.scope.slice(0,ai).join(", ")+(t.scope.length>ai?`, and ${t.scope.length-ai} more`:"");return{context:`BuildKeel: ${i.join(", ")} ${i.length===1?"is":"are"} outside the areas ${r} relates to so far (${o}): its scope and its story's, and what its own work and the other work on its story changed. If the change belongs to ${r}, carry on and tell the user it widens what ${r} touches. If it belongs to other work, stop and ask the user which unit it belongs to.`}};function Fa(n,e,t="claude-code"){if(n.kind==="ignored")return{};let s=ep(n)??Ne(n.cwd);if(!s)return{};let i=Ai(s);if(!i)return{};let r=e.map(l=>l({event:n,codeRoot:s,cache:i,host:t})).filter(l=>l!==null),o=r.find(l=>l.block)?.block,a=r.map(l=>l.context).filter(Boolean).join(`
154
157
 
155
- `);return a&&s.kind==="after-edit"&&s.deferTo?(ha(n,s.deferTo,a),o?{block:o}:{}):{...o?{block:o}:{},...a?{context:a}:{}}}var La=[Aa,Ca,Ta,Oa,oa,ma,Ea];var ph={"claude-code":ci,antigravity:ai};function mh(s){let e=s.indexOf("--host"),t=e>=0?s[e+1]:void 0,n=t&&ei(t)?ph[t]:void 0;if(!n)return process.stderr.write(`BuildKeel hook: unsupported host "${t??""}".
156
- `),1;let i=s.filter((r,o)=>o!==e&&o!==e+1);try{let r=hh(0,"utf8");process.env.BUILDKEEL_HOOK_LOG&&dh(process.env.BUILDKEEL_HOOK_LOG,`${JSON.stringify({host:t,args:i,input:r.trim()?JSON.parse(r):null})}
157
- `);let o=n.parse(r.trim()?JSON.parse(r):{},i),a=qa(o,La,t),{stdout:l,exitCode:c}=n.render(a,o);return l&&process.stdout.write(l),c}catch(r){process.stderr.write(`BuildKeel hook failed: ${r instanceof Error?r.message:String(r)}
158
- `);let{stdout:o,exitCode:a}=n.failed(i);return o&&process.stdout.write(o),a}}process.exitCode=mh(process.argv.slice(2));
158
+ `);return a&&(n.kind==="after-edit"||n.kind==="after-shell")&&n.deferTo?(Ca(s,n.deferTo,a),o?{block:o}:{}):{...o?{block:o}:{},...a?{context:a}:{}}}function ep(n){if(n.kind!=="before-edit"&&n.kind!=="after-edit")return null;let e=n.files[0],t=e?/^(.*[\\/]\.buildkeel[\\/]worktrees[\\/][^\\/]+)[\\/]/.exec(e)?.[1]:void 0;return t?Ne(t):null}var Ha=[Ma,Ka,ja,Ba,Ea,va,Oa,Ra];var sp={"claude-code":bi,antigravity:yi};function ip(n){let e=n.indexOf("--host"),t=e>=0?n[e+1]:void 0,s=t&&ui(t)?sp[t]:void 0;if(!s)return process.stderr.write(`BuildKeel hook: unsupported host "${t??""}".
159
+ `),1;let i=n.filter((r,o)=>o!==e&&o!==e+1);try{let r=np(0,"utf8");process.env.BUILDKEEL_HOOK_LOG&&tp(process.env.BUILDKEEL_HOOK_LOG,`${JSON.stringify({host:t,args:i,input:r.trim()?JSON.parse(r):null})}
160
+ `);let o=s.parse(r.trim()?JSON.parse(r):{},i),a=Fa(o,Ha,t),{stdout:l,exitCode:c}=s.render(a,o);return l&&process.stdout.write(l),c}catch(r){process.stderr.write(`BuildKeel hook failed: ${r instanceof Error?r.message:String(r)}
161
+ `);let{stdout:o,exitCode:a}=s.failed(i);return o&&process.stdout.write(o),a}}process.exitCode=ip(process.argv.slice(2));