house-lights 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,155 +1,155 @@
1
1
  // GENERATED by tools/assets.mjs (way engine v0.259.0). Do not edit.
2
2
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
3
- var gl=Object.create;var Ur=Object.defineProperty;var yl=Object.getOwnPropertyDescriptor;var bl=Object.getOwnPropertyNames;var wl=Object.getPrototypeOf,kl=Object.prototype.hasOwnProperty;var xt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Sl=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of bl(e))!kl.call(t,r)&&r!==n&&Ur(t,r,{get:()=>e[r],enumerable:!(s=yl(e,r))||s.enumerable});return t};var Wn=(t,e,n)=>(n=t!=null?gl(wl(t)):{},Sl(e||!t||!t.__esModule?Ur(n,"default",{value:t,enumerable:!0}):n,t));var M=O(U=>{"use strict";var Xn=Symbol.for("yaml.alias"),Jr=Symbol.for("yaml.document"),Mt=Symbol.for("yaml.map"),Wr=Symbol.for("yaml.pair"),Hn=Symbol.for("yaml.scalar"),It=Symbol.for("yaml.seq"),le=Symbol.for("yaml.node.type"),El=t=>!!t&&typeof t=="object"&&t[le]===Xn,Cl=t=>!!t&&typeof t=="object"&&t[le]===Jr,ql=t=>!!t&&typeof t=="object"&&t[le]===Mt,Tl=t=>!!t&&typeof t=="object"&&t[le]===Wr,Gr=t=>!!t&&typeof t=="object"&&t[le]===Hn,Pl=t=>!!t&&typeof t=="object"&&t[le]===It;function Xr(t){if(t&&typeof t=="object")switch(t[le]){case Mt:case It:return!0}return!1}function Ll(t){if(t&&typeof t=="object")switch(t[le]){case Xn:case Mt:case Hn:case It:return!0}return!1}var xl=t=>(Gr(t)||Xr(t))&&!!t.anchor;U.ALIAS=Xn;U.DOC=Jr;U.MAP=Mt;U.NODE_TYPE=le;U.PAIR=Wr;U.SCALAR=Hn;U.SEQ=It;U.hasAnchor=xl;U.isAlias=El;U.isCollection=Xr;U.isDocument=Cl;U.isMap=ql;U.isNode=Ll;U.isPair=Tl;U.isScalar=Gr;U.isSeq=Pl});var Ye=O(Qn=>{"use strict";var K=M(),X=Symbol("break visit"),Hr=Symbol("skip children"),ie=Symbol("remove node");function Dt(t,e){let n=Qr(e);K.isDocument(t)?qe(null,t.contents,n,Object.freeze([t]))===ie&&(t.contents=null):qe(null,t,n,Object.freeze([]))}Dt.BREAK=X;Dt.SKIP=Hr;Dt.REMOVE=ie;function qe(t,e,n,s){let r=Zr(t,e,n,s);if(K.isNode(r)||K.isPair(r))return ei(t,s,r),qe(t,r,n,s);if(typeof r!="symbol"){if(K.isCollection(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=qe(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===X)return X;o===ie&&(e.items.splice(i,1),i-=1)}}}else if(K.isPair(e)){s=Object.freeze(s.concat(e));let i=qe("key",e.key,n,s);if(i===X)return X;i===ie&&(e.key=null);let o=qe("value",e.value,n,s);if(o===X)return X;o===ie&&(e.value=null)}}return r}async function Rt(t,e){let n=Qr(e);K.isDocument(t)?await Te(null,t.contents,n,Object.freeze([t]))===ie&&(t.contents=null):await Te(null,t,n,Object.freeze([]))}Rt.BREAK=X;Rt.SKIP=Hr;Rt.REMOVE=ie;async function Te(t,e,n,s){let r=await Zr(t,e,n,s);if(K.isNode(r)||K.isPair(r))return ei(t,s,r),Te(t,r,n,s);if(typeof r!="symbol"){if(K.isCollection(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=await Te(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===X)return X;o===ie&&(e.items.splice(i,1),i-=1)}}}else if(K.isPair(e)){s=Object.freeze(s.concat(e));let i=await Te("key",e.key,n,s);if(i===X)return X;i===ie&&(e.key=null);let o=await Te("value",e.value,n,s);if(o===X)return X;o===ie&&(e.value=null)}}return r}function Qr(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Zr(t,e,n,s){if(typeof n=="function")return n(t,e,s);if(K.isMap(e))return n.Map?.(t,e,s);if(K.isSeq(e))return n.Seq?.(t,e,s);if(K.isPair(e))return n.Pair?.(t,e,s);if(K.isScalar(e))return n.Scalar?.(t,e,s);if(K.isAlias(e))return n.Alias?.(t,e,s)}function ei(t,e,n){let s=e[e.length-1];if(K.isCollection(s))s.items[t]=n;else if(K.isPair(s))t==="key"?s.key=n:s.value=n;else if(K.isDocument(s))s.contents=n;else{let r=K.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}Qn.visit=Dt;Qn.visitAsync=Rt});var Zn=O(ni=>{"use strict";var ti=M(),Ml=Ye(),Il={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Dl=t=>t.replace(/[!,[\]{}]/g,e=>Il[e]),ze=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[i,o]=s;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+Dl(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),r;if(e&&s.length>0&&ti.isNode(e.contents)){let i={};Ml.visit(e.contents,(o,a)=>{ti.isNode(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,o]of s)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
4
- `)}};ze.defaultYaml={explicit:!1,version:"1.2"};ze.defaultTags={"!!":"tag:yaml.org,2002:"};ni.Directives=ze});var _t=O(Ve=>{"use strict";var si=M(),Rl=Ye();function _l(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function ri(t){let e=new Set;return Rl.visit(t,{Value(n,s){s.anchor&&e.add(s.anchor)}}),e}function ii(t,e){for(let n=1;;++n){let s=`${t}${n}`;if(!e.has(s))return s}}function Fl(t,e){let n=[],s=new Map,r=null;return{onAnchor:i=>{n.push(i),r??(r=ri(t));let o=ii(e,r);return r.add(o),o},setAnchors:()=>{for(let i of n){let o=s.get(i);if(typeof o=="object"&&o.anchor&&(si.isScalar(o.node)||si.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=i,a}}},sourceObjects:s}}Ve.anchorIsValid=_l;Ve.anchorNames=ri;Ve.createNodeAnchors=Fl;Ve.findNewAnchor=ii});var es=O(oi=>{"use strict";function Je(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){let o=s[r],a=Je(t,s,String(r),o);a===void 0?delete s[r]:a!==o&&(s[r]=a)}else if(s instanceof Map)for(let r of Array.from(s.keys())){let i=s.get(r),o=Je(t,s,r,i);o===void 0?s.delete(r):o!==i&&s.set(r,o)}else if(s instanceof Set)for(let r of Array.from(s)){let i=Je(t,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(let[r,i]of Object.entries(s)){let o=Je(t,s,r,i);o===void 0?delete s[r]:o!==i&&(s[r]=o)}return t.call(e,n,s)}oi.applyReviver=Je});var fe=O(li=>{"use strict";var jl=M();function ai(t,e,n){if(Array.isArray(t))return t.map((s,r)=>ai(s,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!jl.hasAnchor(t))return t.toJSON(e,n);let s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=i=>{s.res=i,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}li.toJS=ai});var Ft=O(fi=>{"use strict";var Bl=es(),ci=M(),Kl=fe(),ts=class{constructor(e){Object.defineProperty(this,ci.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:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!ci.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Kl.toJS(this,"",o);if(typeof r=="function")for(let{count:l,res:c}of o.anchors.values())r(c,l);return typeof i=="function"?Bl.applyReviver(i,{"":a},"",a):a}};fi.NodeBase=ts});var We=O(ui=>{"use strict";var Ul=_t(),Yl=Ye(),Pe=M(),zl=Ft(),Vl=fe(),ns=class extends zl.NodeBase{constructor(e){super(Pe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],Yl.visit(e,{Node:(i,o)=>{(Pe.isAlias(o)||Pe.hasAnchor(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(let i of s){if(i===this)break;i.anchor===this.source&&(r=i)}if(r&&n){let{anchors:i,doc:o,maxAliasCount:a}=n,l=i.get(r);if(l||(Vl.toJS(r,null,n),l=i.get(r)),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=jt(o,r,i)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return r}toJSON(e,n){if(!n)return{source:this.source};let s=this.resolve(n.doc,n);if(!s){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return n.anchors.get(s).res}toString(e,n,s){let r=`*${this.source}`;if(e){if(Ul.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function jt(t,e,n){if(Pe.isAlias(e)){let s=e.resolve(t),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(Pe.isCollection(e)){let s=0;for(let r of e.items){let i=jt(t,r,n);i>s&&(s=i)}return s}else if(Pe.isPair(e)){let s=jt(t,e.key,n),r=jt(t,e.value,n);return Math.max(s,r)}return 1}ui.Alias=ns});var j=O(ss=>{"use strict";var Jl=M(),Wl=Ft(),Gl=fe(),Xl=t=>!t||typeof t!="function"&&typeof t!="object",ue=class extends Wl.NodeBase{constructor(e){super(Jl.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:Gl.toJS(this.value,e,n)}toString(){return String(this.value)}};ue.BLOCK_FOLDED="BLOCK_FOLDED";ue.BLOCK_LITERAL="BLOCK_LITERAL";ue.PLAIN="PLAIN";ue.QUOTE_DOUBLE="QUOTE_DOUBLE";ue.QUOTE_SINGLE="QUOTE_SINGLE";ss.Scalar=ue;ss.isScalarValue=Xl});var Ge=O(pi=>{"use strict";var Hl=We(),Se=M(),di=j(),Ql="tag:yaml.org,2002:";function Zl(t,e,n){if(e){let s=n.filter(i=>i.tag===e),r=s.find(i=>!i.format)??s[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(s=>s.identify?.(t)&&!s.format)}function ec(t,e,n){if(Se.isDocument(t)&&(t=t.contents),Se.isNode(t))return t;if(Se.isPair(t)){let u=n.schema[Se.MAP].createNode?.(n.schema,null,n);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=n,l;if(s&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=r(t)),new Hl.Alias(l.anchor);l={anchor:null,node:null},a.set(t,l)}e?.startsWith("!!")&&(e=Ql+e.slice(2));let c=Zl(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new di.Scalar(t);return l&&(l.node=u),u}c=t instanceof Map?o[Se.MAP]:Symbol.iterator in Object(t)?o[Se.SEQ]:o[Se.MAP]}i&&(i(c),delete n.onTagObj);let p=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new di.Scalar(t);return e?p.tag=e:c.default||(p.tag=c.tag),l&&(l.node=p),p}pi.createNode=ec});var Kt=O(Bt=>{"use strict";var tc=Ge(),oe=M(),nc=Ft();function rs(t,e,n){let s=n;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=s,s=o}else s=new Map([[i,s]])}return tc.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var hi=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,is=class extends nc.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>oe.isNode(s)||oe.isPair(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(hi(e))this.add(n);else{let[s,...r]=e,i=this.get(s,!0);if(oe.isCollection(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,rs(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){let[n,...s]=e;if(s.length===0)return this.delete(n);let r=this.get(n,!0);if(oe.isCollection(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){let[s,...r]=e,i=this.get(s,!0);return r.length===0?!n&&oe.isScalar(i)?i.value:i:oe.isCollection(i)?i.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!oe.isPair(n))return!1;let s=n.value;return s==null||e&&oe.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[n,...s]=e;if(s.length===0)return this.has(n);let r=this.get(n,!0);return oe.isCollection(r)?r.hasIn(s):!1}setIn(e,n){let[s,...r]=e;if(r.length===0)this.set(s,n);else{let i=this.get(s,!0);if(oe.isCollection(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,rs(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}};Bt.Collection=is;Bt.collectionFromPath=rs;Bt.isEmptyPath=hi});var Xe=O(Ut=>{"use strict";var sc=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function os(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var rc=(t,e,n)=>t.endsWith(`
5
- `)?os(n,e):n.includes(`
3
+ var wl=Object.create;var Yr=Object.defineProperty;var kl=Object.getOwnPropertyDescriptor;var Sl=Object.getOwnPropertyNames;var vl=Object.getPrototypeOf,$l=Object.prototype.hasOwnProperty;var Dt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Al=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Sl(e))!$l.call(t,r)&&r!==n&&Yr(t,r,{get:()=>e[r],enumerable:!(s=kl(e,r))||s.enumerable});return t};var Xn=(t,e,n)=>(n=t!=null?wl(vl(t)):{},Al(e||!t||!t.__esModule?Yr(n,"default",{value:t,enumerable:!0}):n,t));var M=N(U=>{"use strict";var Qn=Symbol.for("yaml.alias"),Jr=Symbol.for("yaml.document"),Rt=Symbol.for("yaml.map"),Gr=Symbol.for("yaml.pair"),Zn=Symbol.for("yaml.scalar"),_t=Symbol.for("yaml.seq"),le=Symbol.for("yaml.node.type"),Tl=t=>!!t&&typeof t=="object"&&t[le]===Qn,Pl=t=>!!t&&typeof t=="object"&&t[le]===Jr,Ll=t=>!!t&&typeof t=="object"&&t[le]===Rt,xl=t=>!!t&&typeof t=="object"&&t[le]===Gr,Xr=t=>!!t&&typeof t=="object"&&t[le]===Zn,Ml=t=>!!t&&typeof t=="object"&&t[le]===_t;function Hr(t){if(t&&typeof t=="object")switch(t[le]){case Rt:case _t:return!0}return!1}function Il(t){if(t&&typeof t=="object")switch(t[le]){case Qn:case Rt:case Zn:case _t:return!0}return!1}var Dl=t=>(Xr(t)||Hr(t))&&!!t.anchor;U.ALIAS=Qn;U.DOC=Jr;U.MAP=Rt;U.NODE_TYPE=le;U.PAIR=Gr;U.SCALAR=Zn;U.SEQ=_t;U.hasAnchor=Dl;U.isAlias=Tl;U.isCollection=Hr;U.isDocument=Pl;U.isMap=Ll;U.isNode=Il;U.isPair=xl;U.isScalar=Xr;U.isSeq=Ml});var Ye=N(es=>{"use strict";var K=M(),X=Symbol("break visit"),Qr=Symbol("skip children"),ie=Symbol("remove node");function Ft(t,e){let n=Zr(e);K.isDocument(t)?qe(null,t.contents,n,Object.freeze([t]))===ie&&(t.contents=null):qe(null,t,n,Object.freeze([]))}Ft.BREAK=X;Ft.SKIP=Qr;Ft.REMOVE=ie;function qe(t,e,n,s){let r=ei(t,e,n,s);if(K.isNode(r)||K.isPair(r))return ti(t,s,r),qe(t,r,n,s);if(typeof r!="symbol"){if(K.isCollection(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=qe(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===X)return X;o===ie&&(e.items.splice(i,1),i-=1)}}}else if(K.isPair(e)){s=Object.freeze(s.concat(e));let i=qe("key",e.key,n,s);if(i===X)return X;i===ie&&(e.key=null);let o=qe("value",e.value,n,s);if(o===X)return X;o===ie&&(e.value=null)}}return r}async function jt(t,e){let n=Zr(e);K.isDocument(t)?await Te(null,t.contents,n,Object.freeze([t]))===ie&&(t.contents=null):await Te(null,t,n,Object.freeze([]))}jt.BREAK=X;jt.SKIP=Qr;jt.REMOVE=ie;async function Te(t,e,n,s){let r=await ei(t,e,n,s);if(K.isNode(r)||K.isPair(r))return ti(t,s,r),Te(t,r,n,s);if(typeof r!="symbol"){if(K.isCollection(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=await Te(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===X)return X;o===ie&&(e.items.splice(i,1),i-=1)}}}else if(K.isPair(e)){s=Object.freeze(s.concat(e));let i=await Te("key",e.key,n,s);if(i===X)return X;i===ie&&(e.key=null);let o=await Te("value",e.value,n,s);if(o===X)return X;o===ie&&(e.value=null)}}return r}function Zr(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function ei(t,e,n,s){if(typeof n=="function")return n(t,e,s);if(K.isMap(e))return n.Map?.(t,e,s);if(K.isSeq(e))return n.Seq?.(t,e,s);if(K.isPair(e))return n.Pair?.(t,e,s);if(K.isScalar(e))return n.Scalar?.(t,e,s);if(K.isAlias(e))return n.Alias?.(t,e,s)}function ti(t,e,n){let s=e[e.length-1];if(K.isCollection(s))s.items[t]=n;else if(K.isPair(s))t==="key"?s.key=n:s.value=n;else if(K.isDocument(s))s.contents=n;else{let r=K.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}es.visit=Ft;es.visitAsync=jt});var ts=N(si=>{"use strict";var ni=M(),Rl=Ye(),_l={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Fl=t=>t.replace(/[!,[\]{}]/g,e=>_l[e]),ze=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[i,o]=s;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+Fl(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),r;if(e&&s.length>0&&ni.isNode(e.contents)){let i={};Rl.visit(e.contents,(o,a)=>{ni.isNode(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,o]of s)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
4
+ `)}};ze.defaultYaml={explicit:!1,version:"1.2"};ze.defaultTags={"!!":"tag:yaml.org,2002:"};si.Directives=ze});var Bt=N(Ve=>{"use strict";var ri=M(),jl=Ye();function Bl(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function ii(t){let e=new Set;return jl.visit(t,{Value(n,s){s.anchor&&e.add(s.anchor)}}),e}function oi(t,e){for(let n=1;;++n){let s=`${t}${n}`;if(!e.has(s))return s}}function Kl(t,e){let n=[],s=new Map,r=null;return{onAnchor:i=>{n.push(i),r??(r=ii(t));let o=oi(e,r);return r.add(o),o},setAnchors:()=>{for(let i of n){let o=s.get(i);if(typeof o=="object"&&o.anchor&&(ri.isScalar(o.node)||ri.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=i,a}}},sourceObjects:s}}Ve.anchorIsValid=Bl;Ve.anchorNames=ii;Ve.createNodeAnchors=Kl;Ve.findNewAnchor=oi});var ns=N(ai=>{"use strict";function We(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){let o=s[r],a=We(t,s,String(r),o);a===void 0?delete s[r]:a!==o&&(s[r]=a)}else if(s instanceof Map)for(let r of Array.from(s.keys())){let i=s.get(r),o=We(t,s,r,i);o===void 0?s.delete(r):o!==i&&s.set(r,o)}else if(s instanceof Set)for(let r of Array.from(s)){let i=We(t,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(let[r,i]of Object.entries(s)){let o=We(t,s,r,i);o===void 0?delete s[r]:o!==i&&(s[r]=o)}return t.call(e,n,s)}ai.applyReviver=We});var fe=N(ci=>{"use strict";var Ul=M();function li(t,e,n){if(Array.isArray(t))return t.map((s,r)=>li(s,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!Ul.hasAnchor(t))return t.toJSON(e,n);let s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=i=>{s.res=i,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}ci.toJS=li});var Kt=N(ui=>{"use strict";var Yl=ns(),fi=M(),zl=fe(),ss=class{constructor(e){Object.defineProperty(this,fi.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:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!fi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=zl.toJS(this,"",o);if(typeof r=="function")for(let{count:l,res:c}of o.anchors.values())r(c,l);return typeof i=="function"?Yl.applyReviver(i,{"":a},"",a):a}};ui.NodeBase=ss});var Je=N(di=>{"use strict";var Vl=Bt(),Wl=Ye(),Pe=M(),Jl=Kt(),Gl=fe(),rs=class extends Jl.NodeBase{constructor(e){super(Pe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],Wl.visit(e,{Node:(i,o)=>{(Pe.isAlias(o)||Pe.hasAnchor(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(let i of s){if(i===this)break;i.anchor===this.source&&(r=i)}if(r&&n){let{anchors:i,doc:o,maxAliasCount:a}=n,l=i.get(r);if(l||(Gl.toJS(r,null,n),l=i.get(r)),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=Ut(o,r,i)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return r}toJSON(e,n){if(!n)return{source:this.source};let s=this.resolve(n.doc,n);if(!s){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return n.anchors.get(s).res}toString(e,n,s){let r=`*${this.source}`;if(e){if(Vl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function Ut(t,e,n){if(Pe.isAlias(e)){let s=e.resolve(t),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(Pe.isCollection(e)){let s=0;for(let r of e.items){let i=Ut(t,r,n);i>s&&(s=i)}return s}else if(Pe.isPair(e)){let s=Ut(t,e.key,n),r=Ut(t,e.value,n);return Math.max(s,r)}return 1}di.Alias=rs});var j=N(is=>{"use strict";var Xl=M(),Hl=Kt(),Ql=fe(),Zl=t=>!t||typeof t!="function"&&typeof t!="object",ue=class extends Hl.NodeBase{constructor(e){super(Xl.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:Ql.toJS(this.value,e,n)}toString(){return String(this.value)}};ue.BLOCK_FOLDED="BLOCK_FOLDED";ue.BLOCK_LITERAL="BLOCK_LITERAL";ue.PLAIN="PLAIN";ue.QUOTE_DOUBLE="QUOTE_DOUBLE";ue.QUOTE_SINGLE="QUOTE_SINGLE";is.Scalar=ue;is.isScalarValue=Zl});var Ge=N(hi=>{"use strict";var ec=Je(),Se=M(),pi=j(),tc="tag:yaml.org,2002:";function nc(t,e,n){if(e){let s=n.filter(i=>i.tag===e),r=s.find(i=>!i.format)??s[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(s=>s.identify?.(t)&&!s.format)}function sc(t,e,n){if(Se.isDocument(t)&&(t=t.contents),Se.isNode(t))return t;if(Se.isPair(t)){let f=n.schema[Se.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=n,l;if(s&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=r(t)),new ec.Alias(l.anchor);l={anchor:null,node:null},a.set(t,l)}e?.startsWith("!!")&&(e=tc+e.slice(2));let c=nc(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new pi.Scalar(t);return l&&(l.node=f),f}c=t instanceof Map?o[Se.MAP]:Symbol.iterator in Object(t)?o[Se.SEQ]:o[Se.MAP]}i&&(i(c),delete n.onTagObj);let d=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new pi.Scalar(t);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}hi.createNode=sc});var zt=N(Yt=>{"use strict";var rc=Ge(),oe=M(),ic=Kt();function os(t,e,n){let s=n;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=s,s=o}else s=new Map([[i,s]])}return rc.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var mi=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,as=class extends ic.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>oe.isNode(s)||oe.isPair(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(mi(e))this.add(n);else{let[s,...r]=e,i=this.get(s,!0);if(oe.isCollection(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,os(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){let[n,...s]=e;if(s.length===0)return this.delete(n);let r=this.get(n,!0);if(oe.isCollection(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){let[s,...r]=e,i=this.get(s,!0);return r.length===0?!n&&oe.isScalar(i)?i.value:i:oe.isCollection(i)?i.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!oe.isPair(n))return!1;let s=n.value;return s==null||e&&oe.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[n,...s]=e;if(s.length===0)return this.has(n);let r=this.get(n,!0);return oe.isCollection(r)?r.hasIn(s):!1}setIn(e,n){let[s,...r]=e;if(r.length===0)this.set(s,n);else{let i=this.get(s,!0);if(oe.isCollection(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,os(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}};Yt.Collection=as;Yt.collectionFromPath=os;Yt.isEmptyPath=mi});var Xe=N(Vt=>{"use strict";var oc=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ls(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var ac=(t,e,n)=>t.endsWith(`
5
+ `)?ls(n,e):n.includes(`
6
6
  `)?`
7
- `+os(n,e):(t.endsWith(" ")?"":" ")+n;Ut.indentComment=os;Ut.lineComment=rc;Ut.stringifyComment=sc});var gi=O(He=>{"use strict";var ic="flow",as="block",Yt="quoted";function oc(t,e,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return t;r<i&&(i=0);let l=Math.max(1+i,1+r-e.length);if(t.length<=l)return t;let c=[],p={},u=r-e.length;typeof s=="number"&&(s>r-Math.max(2,i)?c.push(0):u=r-s);let f,m,d=!1,h=-1,g=-1,k=-1;n===as&&(h=mi(t,h,e.length),h!==-1&&(u=h+l));for(let E;E=t[h+=1];){if(n===Yt&&E==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}k=h}if(E===`
8
- `)n===as&&(h=mi(t,h,e.length)),u=h+e.length+l,f=void 0;else{if(E===" "&&m&&m!==" "&&m!==`
9
- `&&m!==" "){let y=t[h+1];y&&y!==" "&&y!==`
10
- `&&y!==" "&&(f=h)}if(h>=u)if(f)c.push(f),u=f+l,f=void 0;else if(n===Yt){for(;m===" "||m===" ";)m=E,E=t[h+=1],d=!0;let y=h>k+1?h-2:g-1;if(p[y])return t;c.push(y),p[y]=!0,u=y+l,f=void 0}else d=!0}m=E}if(d&&a&&a(),c.length===0)return t;o&&o();let $=t.slice(0,c[0]);for(let E=0;E<c.length;++E){let y=c[E],S=c[E+1]||t.length;y===0?$=`
11
- ${e}${t.slice(0,S)}`:(n===Yt&&p[y]&&($+=`${t[y]}\\`),$+=`
12
- ${e}${t.slice(y+1,S)}`)}return $}function mi(t,e,n){let s=e,r=e+1,i=t[r];for(;i===" "||i===" ";)if(e<r+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
13
- `);s=e,r=e+1,i=t[r]}return s}He.FOLD_BLOCK=as;He.FOLD_FLOW=ic;He.FOLD_QUOTED=Yt;He.foldFlowLines=oc});var Ze=O(yi=>{"use strict";var ne=j(),de=gi(),Vt=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Jt=t=>/^(%|---|\.\.\.)/m.test(t);function ac(t,e,n){if(!e||e<0)return!1;let s=e-n,r=t.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if(t[i]===`
14
- `){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}function Qe(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:s}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Jt(t)?" ":""),o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);let p=n.substr(l+2,4);switch(p){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:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<r)l+=1;else{for(o+=n.slice(a,l)+`
7
+ `+ls(n,e):(t.endsWith(" ")?"":" ")+n;Vt.indentComment=ls;Vt.lineComment=ac;Vt.stringifyComment=oc});var yi=N(He=>{"use strict";var lc="flow",cs="block",Wt="quoted";function cc(t,e,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return t;r<i&&(i=0);let l=Math.max(1+i,1+r-e.length);if(t.length<=l)return t;let c=[],d={},f=r-e.length;typeof s=="number"&&(s>r-Math.max(2,i)?c.push(0):f=r-s);let u,h,k=!1,m=-1,y=-1,p=-1;n===cs&&(m=gi(t,m,e.length),m!==-1&&(f=m+l));for(let A;A=t[m+=1];){if(n===Wt&&A==="\\"){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}p=m}if(A===`
8
+ `)n===cs&&(m=gi(t,m,e.length)),f=m+e.length+l,u=void 0;else{if(A===" "&&h&&h!==" "&&h!==`
9
+ `&&h!==" "){let g=t[m+1];g&&g!==" "&&g!==`
10
+ `&&g!==" "&&(u=m)}if(m>=f)if(u)c.push(u),f=u+l,u=void 0;else if(n===Wt){for(;h===" "||h===" ";)h=A,A=t[m+=1],k=!0;let g=m>p+1?m-2:y-1;if(d[g])return t;c.push(g),d[g]=!0,f=g+l,u=void 0}else k=!0}h=A}if(k&&a&&a(),c.length===0)return t;o&&o();let S=t.slice(0,c[0]);for(let A=0;A<c.length;++A){let g=c[A],v=c[A+1]||t.length;g===0?S=`
11
+ ${e}${t.slice(0,v)}`:(n===Wt&&d[g]&&(S+=`${t[g]}\\`),S+=`
12
+ ${e}${t.slice(g+1,v)}`)}return S}function gi(t,e,n){let s=e,r=e+1,i=t[r];for(;i===" "||i===" ";)if(e<r+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
13
+ `);s=e,r=e+1,i=t[r]}return s}He.FOLD_BLOCK=cs;He.FOLD_FLOW=lc;He.FOLD_QUOTED=Wt;He.foldFlowLines=cc});var Ze=N(bi=>{"use strict";var ne=j(),de=yi(),Gt=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Xt=t=>/^(%|---|\.\.\.)/m.test(t);function fc(t,e,n){if(!e||e<0)return!1;let s=e-n,r=t.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if(t[i]===`
14
+ `){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}function Qe(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:s}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Xt(t)?" ":""),o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);let d=n.substr(l+2,4);switch(d){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:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<r)l+=1;else{for(o+=n.slice(a,l)+`
15
15
 
16
16
  `;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
17
- `,l+=2;o+=i,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,s?o:de.foldFlowLines(o,i,de.FOLD_QUOTED,Vt(e,!1))}function ls(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
18
- `)||/[ \t]\n|\n[ \t]/.test(t))return Qe(t,e);let n=e.indent||(Jt(t)?" ":""),s="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
19
- ${n}`)+"'";return e.implicitKey?s:de.foldFlowLines(s,n,de.FOLD_FLOW,Vt(e,!1))}function Le(t,e){let{singleQuote:n}=e.options,s;if(n===!1)s=Qe;else{let r=t.includes('"'),i=t.includes("'");r&&!i?s=ls:i&&!r?s=Qe:s=n?ls:Qe}return s(t,e)}var cs;try{cs=new RegExp(`(^|(?<!
17
+ `,l+=2;o+=i,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,s?o:de.foldFlowLines(o,i,de.FOLD_QUOTED,Gt(e,!1))}function fs(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
18
+ `)||/[ \t]\n|\n[ \t]/.test(t))return Qe(t,e);let n=e.indent||(Xt(t)?" ":""),s="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
19
+ ${n}`)+"'";return e.implicitKey?s:de.foldFlowLines(s,n,de.FOLD_FLOW,Gt(e,!1))}function Le(t,e){let{singleQuote:n}=e.options,s;if(n===!1)s=Qe;else{let r=t.includes('"'),i=t.includes("'");r&&!i?s=fs:i&&!r?s=Qe:s=n?fs:Qe}return s(t,e)}var us;try{us=new RegExp(`(^|(?<!
20
20
  ))
21
21
  +(?!
22
- |$)`,"g")}catch{cs=/\n+(?!\n|$)/g}function zt({comment:t,type:e,value:n},s,r,i){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n))return Le(n,s);let c=s.indent||(s.forceBlockIndent||Jt(n)?" ":""),p=o==="literal"?!0:o==="folded"||e===ne.Scalar.BLOCK_FOLDED?!1:e===ne.Scalar.BLOCK_LITERAL?!0:!ac(n,l,c.length);if(!n)return p?`|
22
+ |$)`,"g")}catch{us=/\n+(?!\n|$)/g}function Jt({comment:t,type:e,value:n},s,r,i){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n))return Le(n,s);let c=s.indent||(s.forceBlockIndent||Xt(n)?" ":""),d=o==="literal"?!0:o==="folded"||e===ne.Scalar.BLOCK_FOLDED?!1:e===ne.Scalar.BLOCK_LITERAL?!0:!fc(n,l,c.length);if(!n)return d?`|
23
23
  `:`>
24
- `;let u,f;for(f=n.length;f>0;--f){let S=n[f-1];if(S!==`
25
- `&&S!==" "&&S!==" ")break}let m=n.substring(f),d=m.indexOf(`
26
- `);d===-1?u="-":n===m||d!==m.length-1?(u="+",i&&i()):u="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
27
- `&&(m=m.slice(0,-1)),m=m.replace(cs,`$&${c}`));let h=!1,g,k=-1;for(g=0;g<n.length;++g){let S=n[g];if(S===" ")h=!0;else if(S===`
28
- `)k=g;else break}let $=n.substring(0,k<g?k+1:g);$&&(n=n.substring($.length),$=$.replace(/\n+/g,`$&${c}`));let y=(h?c?"2":"1":"")+u;if(t&&(y+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){let S=n.replace(/\n+/g,`
29
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,T=Vt(s,!0);o!=="folded"&&e!==ne.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{A=!0});let N=de.foldFlowLines(`${$}${S}${m}`,c,de.FOLD_BLOCK,T);if(!A)return`>${y}
30
- ${c}${N}`}return n=n.replace(/\n+/g,`$&${c}`),`|${y}
31
- ${c}${$}${n}${m}`}function lc(t,e,n,s){let{type:r,value:i}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:p}=e;if(a&&i.includes(`
32
- `)||p&&/[[\]{},]/.test(i))return Le(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||p||!i.includes(`
33
- `)?Le(i,e):zt(t,e,n,s);if(!a&&!p&&r!==ne.Scalar.PLAIN&&i.includes(`
34
- `))return zt(t,e,n,s);if(Jt(i)){if(l==="")return e.forceBlockIndent=!0,zt(t,e,n,s);if(a&&l===c)return Le(i,e)}let u=i.replace(/\n+/g,`$&
35
- ${l}`);if(o){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:d}=e.doc.schema;if(d.some(f)||m?.some(f))return Le(i,e)}return a?u:de.foldFlowLines(u,l,de.FOLD_FLOW,Vt(e,!1))}function cc(t,e,n,s){let{implicitKey:r,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==ne.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ne.Scalar.QUOTE_DOUBLE);let l=p=>{switch(p){case ne.Scalar.BLOCK_FOLDED:case ne.Scalar.BLOCK_LITERAL:return r||i?Le(o.value,e):zt(o,e,n,s);case ne.Scalar.QUOTE_DOUBLE:return Qe(o.value,e);case ne.Scalar.QUOTE_SINGLE:return ls(o.value,e);case ne.Scalar.PLAIN:return lc(o,e,n,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:p,defaultStringType:u}=e.options,f=r&&p||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}yi.stringifyString=cc});var et=O(fs=>{"use strict";var fc=_t(),pe=M(),uc=Xe(),dc=Ze();function pc(t,e){let n=Object.assign({blockQuote:!0,commentString:uc.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},t.schema.toStringOptions,e),s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function hc(t,e){if(e.tag){let r=t.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let n,s;if(pe.isScalar(e)){s=e.value;let r=t.filter(i=>i.identify?.(s));if(r.length>1){let i=r.filter(o=>o.test);i.length>0&&(r=i)}n=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else s=e,n=t.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){let r=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function mc(t,e,{anchors:n,doc:s}){if(!s.directives)return"";let r=[],i=(pe.isScalar(t)||pe.isCollection(t))&&t.anchor;i&&fc.anchorIsValid(i)&&(n.add(i),r.push(`&${i}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function gc(t,e,n,s){if(pe.isPair(t))return t.toString(e,n,s);if(pe.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,i=pe.isNode(t)?t:e.doc.createNode(t,{onTagObj:l=>r=l});r??(r=hc(e.doc.schema.tags,i));let o=mc(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(i,e,n,s):pe.isScalar(i)?dc.stringifyString(i,e,n,s):i.toString(e,n,s);return o?pe.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
36
- ${e.indent}${a}`:a}fs.createStringifyContext=pc;fs.stringify=gc});var Si=O(ki=>{"use strict";var ce=M(),bi=j(),wi=et(),tt=Xe();function yc({key:t,value:e},n,s,r){let{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:p,simpleKeys:u}}=n,f=ce.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(ce.isCollection(t)||!ce.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!u&&(!t||f&&e==null&&!n.inFlow||ce.isCollection(t)||(ce.isScalar(t)?t.type===bi.Scalar.BLOCK_FOLDED||t.type===bi.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(u||!i),indent:a+l});let d=!1,h=!1,g=wi.stringify(t,n,()=>d=!0,()=>h=!0);if(!m&&!n.inFlow&&g.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(i||e==null)return d&&s&&s(),g===""?"?":m?`? ${g}`:g}else if(i&&!u||e==null&&m)return g=`? ${g}`,f&&!d?g+=tt.lineComment(g,n.indent,c(f)):h&&r&&r(),g;d&&(f=null),m?(f&&(g+=tt.lineComment(g,n.indent,c(f))),g=`? ${g}
37
- ${a}:`):(g=`${g}:`,f&&(g+=tt.lineComment(g,n.indent,c(f))));let k,$,E;ce.isNode(e)?(k=!!e.spaceBefore,$=e.commentBefore,E=e.comment):(k=!1,$=null,E=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!m&&!f&&ce.isScalar(e)&&(n.indentAtStart=g.length+1),h=!1,!p&&l.length>=2&&!n.inFlow&&!m&&ce.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let y=!1,S=wi.stringify(e,n,()=>y=!0,()=>h=!0),A=" ";if(f||k||$){if(A=k?`
38
- `:"",$){let T=c($);A+=`
39
- ${tt.indentComment(T,n.indent)}`}S===""&&!n.inFlow?A===`
40
- `&&E&&(A=`
24
+ `;let f,u;for(u=n.length;u>0;--u){let v=n[u-1];if(v!==`
25
+ `&&v!==" "&&v!==" ")break}let h=n.substring(u),k=h.indexOf(`
26
+ `);k===-1?f="-":n===h||k!==h.length-1?(f="+",i&&i()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
27
+ `&&(h=h.slice(0,-1)),h=h.replace(us,`$&${c}`));let m=!1,y,p=-1;for(y=0;y<n.length;++y){let v=n[y];if(v===" ")m=!0;else if(v===`
28
+ `)p=y;else break}let S=n.substring(0,p<y?p+1:y);S&&(n=n.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let g=(m?c?"2":"1":"")+f;if(t&&(g+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!d){let v=n.replace(/\n+/g,`
29
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),O=!1,T=Gt(s,!0);o!=="folded"&&e!==ne.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{O=!0});let E=de.foldFlowLines(`${S}${v}${h}`,c,de.FOLD_BLOCK,T);if(!O)return`>${g}
30
+ ${c}${E}`}return n=n.replace(/\n+/g,`$&${c}`),`|${g}
31
+ ${c}${S}${n}${h}`}function uc(t,e,n,s){let{type:r,value:i}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=e;if(a&&i.includes(`
32
+ `)||d&&/[[\]{},]/.test(i))return Le(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||d||!i.includes(`
33
+ `)?Le(i,e):Jt(t,e,n,s);if(!a&&!d&&r!==ne.Scalar.PLAIN&&i.includes(`
34
+ `))return Jt(t,e,n,s);if(Xt(i)){if(l==="")return e.forceBlockIndent=!0,Jt(t,e,n,s);if(a&&l===c)return Le(i,e)}let f=i.replace(/\n+/g,`$&
35
+ ${l}`);if(o){let u=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:h,tags:k}=e.doc.schema;if(k.some(u)||h?.some(u))return Le(i,e)}return a?f:de.foldFlowLines(f,l,de.FOLD_FLOW,Gt(e,!1))}function dc(t,e,n,s){let{implicitKey:r,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==ne.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ne.Scalar.QUOTE_DOUBLE);let l=d=>{switch(d){case ne.Scalar.BLOCK_FOLDED:case ne.Scalar.BLOCK_LITERAL:return r||i?Le(o.value,e):Jt(o,e,n,s);case ne.Scalar.QUOTE_DOUBLE:return Qe(o.value,e);case ne.Scalar.QUOTE_SINGLE:return fs(o.value,e);case ne.Scalar.PLAIN:return uc(o,e,n,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:d,defaultStringType:f}=e.options,u=r&&d||f;if(c=l(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}bi.stringifyString=dc});var et=N(ds=>{"use strict";var pc=Bt(),pe=M(),hc=Xe(),mc=Ze();function gc(t,e){let n=Object.assign({blockQuote:!0,commentString:hc.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},t.schema.toStringOptions,e),s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function yc(t,e){if(e.tag){let r=t.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let n,s;if(pe.isScalar(e)){s=e.value;let r=t.filter(i=>i.identify?.(s));if(r.length>1){let i=r.filter(o=>o.test);i.length>0&&(r=i)}n=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else s=e,n=t.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){let r=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function bc(t,e,{anchors:n,doc:s}){if(!s.directives)return"";let r=[],i=(pe.isScalar(t)||pe.isCollection(t))&&t.anchor;i&&pc.anchorIsValid(i)&&(n.add(i),r.push(`&${i}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function wc(t,e,n,s){if(pe.isPair(t))return t.toString(e,n,s);if(pe.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,i=pe.isNode(t)?t:e.doc.createNode(t,{onTagObj:l=>r=l});r??(r=yc(e.doc.schema.tags,i));let o=bc(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(i,e,n,s):pe.isScalar(i)?mc.stringifyString(i,e,n,s):i.toString(e,n,s);return o?pe.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
36
+ ${e.indent}${a}`:a}ds.createStringifyContext=gc;ds.stringify=wc});var vi=N(Si=>{"use strict";var ce=M(),wi=j(),ki=et(),tt=Xe();function kc({key:t,value:e},n,s,r){let{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:f}}=n,u=ce.isNode(t)&&t.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(ce.isCollection(t)||!ce.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let h=!f&&(!t||u&&e==null&&!n.inFlow||ce.isCollection(t)||(ce.isScalar(t)?t.type===wi.Scalar.BLOCK_FOLDED||t.type===wi.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!i),indent:a+l});let k=!1,m=!1,y=ki.stringify(t,n,()=>k=!0,()=>m=!0);if(!h&&!n.inFlow&&y.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(i||e==null)return k&&s&&s(),y===""?"?":h?`? ${y}`:y}else if(i&&!f||e==null&&h)return y=`? ${y}`,u&&!k?y+=tt.lineComment(y,n.indent,c(u)):m&&r&&r(),y;k&&(u=null),h?(u&&(y+=tt.lineComment(y,n.indent,c(u))),y=`? ${y}
37
+ ${a}:`):(y=`${y}:`,u&&(y+=tt.lineComment(y,n.indent,c(u))));let p,S,A;ce.isNode(e)?(p=!!e.spaceBefore,S=e.commentBefore,A=e.comment):(p=!1,S=null,A=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!u&&ce.isScalar(e)&&(n.indentAtStart=y.length+1),m=!1,!d&&l.length>=2&&!n.inFlow&&!h&&ce.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let g=!1,v=ki.stringify(e,n,()=>g=!0,()=>m=!0),O=" ";if(u||p||S){if(O=p?`
38
+ `:"",S){let T=c(S);O+=`
39
+ ${tt.indentComment(T,n.indent)}`}v===""&&!n.inFlow?O===`
40
+ `&&A&&(O=`
41
41
 
42
- `):A+=`
43
- ${n.indent}`}else if(!m&&ce.isCollection(e)){let T=S[0],N=S.indexOf(`
44
- `),w=N!==-1,L=n.inFlow??e.flow??e.items.length===0;if(w||!L){let v=!1;if(w&&(T==="&"||T==="!")){let q=S.indexOf(" ");T==="&"&&q!==-1&&q<N&&S[q+1]==="!"&&(q=S.indexOf(" ",q+1)),(q===-1||N<q)&&(v=!0)}v||(A=`
45
- ${n.indent}`)}}else(S===""||S[0]===`
46
- `)&&(A="");return g+=A+S,n.inFlow?y&&s&&s():E&&!y?g+=tt.lineComment(g,n.indent,c(E)):h&&r&&r(),g}ki.stringifyPair=yc});var ds=O(us=>{"use strict";var vi=xt("process");function bc(t,...e){t==="debug"&&console.log(...e)}function wc(t,e){(t==="debug"||t==="warn")&&(typeof vi.emitWarning=="function"?vi.emitWarning(e):console.warn(e))}us.debug=bc;us.warn=wc});var Qt=O(Ht=>{"use strict";var Xt=M(),$i=j(),Wt="<<",Gt={identify:t=>t===Wt||typeof t=="symbol"&&t.description===Wt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new $i.Scalar(Symbol(Wt)),{addToJSMap:Ai}),stringify:()=>Wt},kc=(t,e)=>(Gt.identify(e)||Xt.isScalar(e)&&(!e.type||e.type===$i.Scalar.PLAIN)&&Gt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Gt.tag&&n.default);function Ai(t,e,n){let s=Oi(t,n);if(Xt.isSeq(s))for(let r of s.items)ps(t,e,r);else if(Array.isArray(s))for(let r of s)ps(t,e,r);else ps(t,e,s)}function ps(t,e,n){let s=Oi(t,n);if(!Xt.isMap(s))throw new Error("Merge sources must be maps or map aliases");let r=s.toJSON(null,t,Map);for(let[i,o]of r)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Oi(t,e){return t&&Xt.isAlias(e)?e.resolve(t.doc,t):e}Ht.addMergeToJSMap=Ai;Ht.isMergeKey=kc;Ht.merge=Gt});var ms=O(Ci=>{"use strict";var Sc=ds(),Ni=Qt(),vc=et(),Ei=M(),hs=fe();function $c(t,e,{key:n,value:s}){if(Ei.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,s);else if(Ni.isMergeKey(t,n))Ni.addMergeToJSMap(t,e,s);else{let r=hs.toJS(n,"",t);if(e instanceof Map)e.set(r,hs.toJS(s,r,t));else if(e instanceof Set)e.add(r);else{let i=Ac(n,r,t),o=hs.toJS(s,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Ac(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Ei.isNode(t)&&n?.doc){let s=vc.createStringifyContext(n.doc,{});s.anchors=new Set;for(let i of n.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;let r=t.toString(s);if(!n.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Sc.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}Ci.addPairToJSMap=$c});var he=O(gs=>{"use strict";var qi=Ge(),Oc=Si(),Nc=ms(),Zt=M();function Ec(t,e,n){let s=qi.createNode(t,void 0,n),r=qi.createNode(e,void 0,n);return new en(s,r)}var en=class t{constructor(e,n=null){Object.defineProperty(this,Zt.NODE_TYPE,{value:Zt.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:s}=this;return Zt.isNode(n)&&(n=n.clone(e)),Zt.isNode(s)&&(s=s.clone(e)),new t(n,s)}toJSON(e,n){let s=n?.mapAsMap?new Map:{};return Nc.addPairToJSMap(n,s,this)}toString(e,n,s){return e?.doc?Oc.stringifyPair(this,e,n,s):JSON.stringify(this)}};gs.Pair=en;gs.createPair=Ec});var ys=O(Pi=>{"use strict";var ve=M(),Ti=et(),tn=Xe();function Cc(t,e,n){return(e.inFlow??t.flow?Tc:qc)(t,e,n)}function qc({comment:t,items:e},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=n,p=Object.assign({},n,{indent:i,type:null}),u=!1,f=[];for(let d=0;d<e.length;++d){let h=e[d],g=null;if(ve.isNode(h))!u&&h.spaceBefore&&f.push(""),nn(n,f,h.commentBefore,u),h.comment&&(g=h.comment);else if(ve.isPair(h)){let $=ve.isNode(h.key)?h.key:null;$&&(!u&&$.spaceBefore&&f.push(""),nn(n,f,$.commentBefore,u))}u=!1;let k=Ti.stringify(h,p,()=>g=null,()=>u=!0);g&&(k+=tn.lineComment(k,i,c(g))),u&&g&&(u=!1),f.push(s+k)}let m;if(f.length===0)m=r.start+r.end;else{m=f[0];for(let d=1;d<f.length;++d){let h=f[d];m+=h?`
47
- ${l}${h}`:`
48
- `}}return t?(m+=`
49
- `+tn.indentComment(c(t),l),a&&a()):u&&o&&o(),m}function Tc({items:t},e,{flowChars:n,itemIndent:s}){let{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;s+=i;let l=Object.assign({},e,{indent:s,inFlow:!0,type:null}),c=!1,p=0,u=[];for(let d=0;d<t.length;++d){let h=t[d],g=null;if(ve.isNode(h))h.spaceBefore&&u.push(""),nn(e,u,h.commentBefore,!1),h.comment&&(g=h.comment);else if(ve.isPair(h)){let $=ve.isNode(h.key)?h.key:null;$&&($.spaceBefore&&u.push(""),nn(e,u,$.commentBefore,!1),$.comment&&(c=!0));let E=ve.isNode(h.value)?h.value:null;E?(E.comment&&(g=E.comment),E.commentBefore&&(c=!0)):h.value==null&&$?.comment&&(g=$.comment)}g&&(c=!0);let k=Ti.stringify(h,l,()=>g=null);c||(c=u.length>p||k.includes(`
50
- `)),d<t.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=u.reduce(($,E)=>$+E.length+2,2)+(k.length+2)>e.options.lineWidth)),c&&(k+=",")),g&&(k+=tn.lineComment(k,s,a(g))),u.push(k),p=u.length}let{start:f,end:m}=n;if(u.length===0)return f+m;if(!c){let d=u.reduce((h,g)=>h+g.length+2,2);c=e.options.lineWidth>0&&d>e.options.lineWidth}if(c){let d=f;for(let h of u)d+=h?`
51
- ${i}${r}${h}`:`
52
- `;return`${d}
53
- ${r}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function nn({indent:t,options:{commentString:e}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){let i=tn.indentComment(e(s),t);n.push(i.trimStart())}}Pi.stringifyCollection=Cc});var ge=O(ws=>{"use strict";var Pc=ys(),Lc=ms(),xc=Kt(),me=M(),sn=he(),Mc=j();function nt(t,e){let n=me.isScalar(e)?e.value:e;for(let s of t)if(me.isPair(s)&&(s.key===e||s.key===n||me.isScalar(s.key)&&s.key.value===n))return s}var bs=class extends xc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(me.MAP,e),this.items=[]}static from(e,n,s){let{keepUndefined:r,replacer:i}=s,o=new this(e),a=(l,c)=>{if(typeof i=="function")c=i.call(n,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||r)&&o.items.push(sn.createPair(l,c,s))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let s;me.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new sn.Pair(e,e?.value):s=new sn.Pair(e.key,e.value);let r=nt(this.items,s.key),i=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);me.isScalar(r.value)&&Mc.isScalarValue(s.value)?r.value.value=s.value:r.value=s.value}else if(i){let o=this.items.findIndex(a=>i(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let n=nt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=nt(this.items,e)?.value;return(!n&&me.isScalar(r)?r.value:r)??void 0}has(e){return!!nt(this.items,e)}set(e,n){this.add(new sn.Pair(e,n),!0)}toJSON(e,n,s){let r=s?new s:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let i of this.items)Lc.addPairToJSMap(n,r,i);return r}toString(e,n,s){if(!e)return JSON.stringify(this);for(let r of this.items)if(!me.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} 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:n})}};ws.YAMLMap=bs;ws.findPair=nt});var xe=O(xi=>{"use strict";var Ic=M(),Li=ge(),Dc={collection:"map",default:!0,nodeClass:Li.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Ic.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Li.YAMLMap.from(t,e,n)};xi.map=Dc});var ye=O(Mi=>{"use strict";var Rc=Ge(),_c=ys(),Fc=Kt(),on=M(),jc=j(),Bc=fe(),ks=class extends Fc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(on.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=rn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let s=rn(e);if(typeof s!="number")return;let r=this.items[s];return!n&&on.isScalar(r)?r.value:r}has(e){let n=rn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let s=rn(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[s];on.isScalar(r)&&jc.isScalarValue(n)?r.value=n:this.items[s]=n}toJSON(e,n){let s=[];n?.onCreate&&n.onCreate(s);let r=0;for(let i of this.items)s.push(Bc.toJS(i,String(r++),n));return s}toString(e,n,s){return e?_c.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof r=="function"){let l=n instanceof Set?a:String(o++);a=r.call(n,l,a)}i.items.push(Rc.createNode(a,void 0,s))}}return i}};function rn(t){let e=on.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Mi.YAMLSeq=ks});var Me=O(Di=>{"use strict";var Kc=M(),Ii=ye(),Uc={collection:"seq",default:!0,nodeClass:Ii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Kc.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Ii.YAMLSeq.from(t,e,n)};Di.seq=Uc});var st=O(Ri=>{"use strict";var Yc=Ze(),zc={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,s){return e=Object.assign({actualString:!0},e),Yc.stringifyString(t,e,n,s)}};Ri.string=zc});var an=O(ji=>{"use strict";var _i=j(),Fi={identify:t=>t==null,createNode:()=>new _i.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _i.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Fi.test.test(t)?t:e.options.nullStr};ji.nullTag=Fi});var Ss=O(Ki=>{"use strict";var Vc=j(),Bi={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Vc.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Bi.test.test(t)){let s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?n.options.trueStr:n.options.falseStr}};Ki.boolTag=Bi});var Ie=O(Ui=>{"use strict";function Jc({format:t,minFractionDigits:e,tag:n,value:s}){if(typeof s=="bigint")return String(s);let r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(s,-0)?"-0":JSON.stringify(s);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}Ui.stringifyNumber=Jc});var $s=O(ln=>{"use strict";var Wc=j(),vs=Ie(),Gc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:vs.stringifyNumber},Xc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():vs.stringifyNumber(t)}},Hc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Wc.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:vs.stringifyNumber};ln.float=Hc;ln.floatExp=Xc;ln.floatNaN=Gc});var Os=O(fn=>{"use strict";var Yi=Ie(),cn=t=>typeof t=="bigint"||Number.isInteger(t),As=(t,e,n,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),n);function zi(t,e,n){let{value:s}=t;return cn(s)&&s>=0?n+s.toString(e):Yi.stringifyNumber(t)}var Qc={identify:t=>cn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>As(t,2,8,n),stringify:t=>zi(t,8,"0o")},Zc={identify:cn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>As(t,0,10,n),stringify:Yi.stringifyNumber},ef={identify:t=>cn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>As(t,2,16,n),stringify:t=>zi(t,16,"0x")};fn.int=Zc;fn.intHex=ef;fn.intOct=Qc});var Ji=O(Vi=>{"use strict";var tf=xe(),nf=an(),sf=Me(),rf=st(),of=Ss(),Ns=$s(),Es=Os(),af=[tf.map,sf.seq,rf.string,nf.nullTag,of.boolTag,Es.intOct,Es.int,Es.intHex,Ns.floatNaN,Ns.floatExp,Ns.float];Vi.schema=af});var Xi=O(Gi=>{"use strict";var lf=j(),cf=xe(),ff=Me();function Wi(t){return typeof t=="bigint"||Number.isInteger(t)}var un=({value:t})=>JSON.stringify(t),uf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:un},{identify:t=>t==null,createNode:()=>new lf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:un},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:un},{identify:Wi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Wi(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:un}],df={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},pf=[cf.map,ff.seq].concat(uf,df);Gi.schema=pf});var qs=O(Hi=>{"use strict";var rt=xt("buffer"),Cs=j(),hf=Ze(),mf={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof rt.Buffer=="function")return rt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},s,r,i){if(!n)return"";let o=n,a;if(typeof rt.Buffer=="function")a=o instanceof rt.Buffer?o.toString("base64"):rt.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=Cs.Scalar.BLOCK_LITERAL),e!==Cs.Scalar.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),p=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)p[u]=a.substr(f,l);a=p.join(e===Cs.Scalar.BLOCK_LITERAL?`
54
- `:" ")}return hf.stringifyString({comment:t,type:e,value:a},s,r,i)}};Hi.binary=mf});var hn=O(pn=>{"use strict";var dn=M(),Ts=he(),gf=j(),yf=ye();function Qi(t,e){if(dn.isSeq(t))for(let n=0;n<t.items.length;++n){let s=t.items[n];if(!dn.isPair(s)){if(dn.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let r=s.items[0]||new Ts.Pair(new gf.Scalar(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
42
+ `):O+=`
43
+ ${n.indent}`}else if(!h&&ce.isCollection(e)){let T=v[0],E=v.indexOf(`
44
+ `),b=E!==-1,L=n.inFlow??e.flow??e.items.length===0;if(b||!L){let $=!1;if(b&&(T==="&"||T==="!")){let q=v.indexOf(" ");T==="&"&&q!==-1&&q<E&&v[q+1]==="!"&&(q=v.indexOf(" ",q+1)),(q===-1||E<q)&&($=!0)}$||(O=`
45
+ ${n.indent}`)}}else(v===""||v[0]===`
46
+ `)&&(O="");return y+=O+v,n.inFlow?g&&s&&s():A&&!g?y+=tt.lineComment(y,n.indent,c(A)):m&&r&&r(),y}Si.stringifyPair=kc});var hs=N(ps=>{"use strict";var $i=Dt("process");function Sc(t,...e){t==="debug"&&console.log(...e)}function vc(t,e){(t==="debug"||t==="warn")&&(typeof $i.emitWarning=="function"?$i.emitWarning(e):console.warn(e))}ps.debug=Sc;ps.warn=vc});var tn=N(en=>{"use strict";var Zt=M(),Ai=j(),Ht="<<",Qt={identify:t=>t===Ht||typeof t=="symbol"&&t.description===Ht,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ai.Scalar(Symbol(Ht)),{addToJSMap:Oi}),stringify:()=>Ht},$c=(t,e)=>(Qt.identify(e)||Zt.isScalar(e)&&(!e.type||e.type===Ai.Scalar.PLAIN)&&Qt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Qt.tag&&n.default);function Oi(t,e,n){let s=Ni(t,n);if(Zt.isSeq(s))for(let r of s.items)ms(t,e,r);else if(Array.isArray(s))for(let r of s)ms(t,e,r);else ms(t,e,s)}function ms(t,e,n){let s=Ni(t,n);if(!Zt.isMap(s))throw new Error("Merge sources must be maps or map aliases");let r=s.toJSON(null,t,Map);for(let[i,o]of r)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Ni(t,e){return t&&Zt.isAlias(e)?e.resolve(t.doc,t):e}en.addMergeToJSMap=Oi;en.isMergeKey=$c;en.merge=Qt});var ys=N(qi=>{"use strict";var Ac=hs(),Ei=tn(),Oc=et(),Ci=M(),gs=fe();function Nc(t,e,{key:n,value:s}){if(Ci.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,s);else if(Ei.isMergeKey(t,n))Ei.addMergeToJSMap(t,e,s);else{let r=gs.toJS(n,"",t);if(e instanceof Map)e.set(r,gs.toJS(s,r,t));else if(e instanceof Set)e.add(r);else{let i=Ec(n,r,t),o=gs.toJS(s,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Ec(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Ci.isNode(t)&&n?.doc){let s=Oc.createStringifyContext(n.doc,{});s.anchors=new Set;for(let i of n.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;let r=t.toString(s);if(!n.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Ac.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}qi.addPairToJSMap=Nc});var he=N(bs=>{"use strict";var Ti=Ge(),Cc=vi(),qc=ys(),nn=M();function Tc(t,e,n){let s=Ti.createNode(t,void 0,n),r=Ti.createNode(e,void 0,n);return new sn(s,r)}var sn=class t{constructor(e,n=null){Object.defineProperty(this,nn.NODE_TYPE,{value:nn.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:s}=this;return nn.isNode(n)&&(n=n.clone(e)),nn.isNode(s)&&(s=s.clone(e)),new t(n,s)}toJSON(e,n){let s=n?.mapAsMap?new Map:{};return qc.addPairToJSMap(n,s,this)}toString(e,n,s){return e?.doc?Cc.stringifyPair(this,e,n,s):JSON.stringify(this)}};bs.Pair=sn;bs.createPair=Tc});var ws=N(Li=>{"use strict";var ve=M(),Pi=et(),rn=Xe();function Pc(t,e,n){return(e.inFlow??t.flow?xc:Lc)(t,e,n)}function Lc({comment:t,items:e},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:i,type:null}),f=!1,u=[];for(let k=0;k<e.length;++k){let m=e[k],y=null;if(ve.isNode(m))!f&&m.spaceBefore&&u.push(""),on(n,u,m.commentBefore,f),m.comment&&(y=m.comment);else if(ve.isPair(m)){let S=ve.isNode(m.key)?m.key:null;S&&(!f&&S.spaceBefore&&u.push(""),on(n,u,S.commentBefore,f))}f=!1;let p=Pi.stringify(m,d,()=>y=null,()=>f=!0);y&&(p+=rn.lineComment(p,i,c(y))),f&&y&&(f=!1),u.push(s+p)}let h;if(u.length===0)h=r.start+r.end;else{h=u[0];for(let k=1;k<u.length;++k){let m=u[k];h+=m?`
47
+ ${l}${m}`:`
48
+ `}}return t?(h+=`
49
+ `+rn.indentComment(c(t),l),a&&a()):f&&o&&o(),h}function xc({items:t},e,{flowChars:n,itemIndent:s}){let{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;s+=i;let l=Object.assign({},e,{indent:s,inFlow:!0,type:null}),c=!1,d=0,f=[];for(let k=0;k<t.length;++k){let m=t[k],y=null;if(ve.isNode(m))m.spaceBefore&&f.push(""),on(e,f,m.commentBefore,!1),m.comment&&(y=m.comment);else if(ve.isPair(m)){let S=ve.isNode(m.key)?m.key:null;S&&(S.spaceBefore&&f.push(""),on(e,f,S.commentBefore,!1),S.comment&&(c=!0));let A=ve.isNode(m.value)?m.value:null;A?(A.comment&&(y=A.comment),A.commentBefore&&(c=!0)):m.value==null&&S?.comment&&(y=S.comment)}y&&(c=!0);let p=Pi.stringify(m,l,()=>y=null);c||(c=f.length>d||p.includes(`
50
+ `)),k<t.length-1?p+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((S,A)=>S+A.length+2,2)+(p.length+2)>e.options.lineWidth)),c&&(p+=",")),y&&(p+=rn.lineComment(p,s,a(y))),f.push(p),d=f.length}let{start:u,end:h}=n;if(f.length===0)return u+h;if(!c){let k=f.reduce((m,y)=>m+y.length+2,2);c=e.options.lineWidth>0&&k>e.options.lineWidth}if(c){let k=u;for(let m of f)k+=m?`
51
+ ${i}${r}${m}`:`
52
+ `;return`${k}
53
+ ${r}${h}`}else return`${u}${o}${f.join(" ")}${o}${h}`}function on({indent:t,options:{commentString:e}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){let i=rn.indentComment(e(s),t);n.push(i.trimStart())}}Li.stringifyCollection=Pc});var ge=N(Ss=>{"use strict";var Mc=ws(),Ic=ys(),Dc=zt(),me=M(),an=he(),Rc=j();function nt(t,e){let n=me.isScalar(e)?e.value:e;for(let s of t)if(me.isPair(s)&&(s.key===e||s.key===n||me.isScalar(s.key)&&s.key.value===n))return s}var ks=class extends Dc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(me.MAP,e),this.items=[]}static from(e,n,s){let{keepUndefined:r,replacer:i}=s,o=new this(e),a=(l,c)=>{if(typeof i=="function")c=i.call(n,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||r)&&o.items.push(an.createPair(l,c,s))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let s;me.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new an.Pair(e,e?.value):s=new an.Pair(e.key,e.value);let r=nt(this.items,s.key),i=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);me.isScalar(r.value)&&Rc.isScalarValue(s.value)?r.value.value=s.value:r.value=s.value}else if(i){let o=this.items.findIndex(a=>i(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let n=nt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=nt(this.items,e)?.value;return(!n&&me.isScalar(r)?r.value:r)??void 0}has(e){return!!nt(this.items,e)}set(e,n){this.add(new an.Pair(e,n),!0)}toJSON(e,n,s){let r=s?new s:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let i of this.items)Ic.addPairToJSMap(n,r,i);return r}toString(e,n,s){if(!e)return JSON.stringify(this);for(let r of this.items)if(!me.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Mc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:n})}};Ss.YAMLMap=ks;Ss.findPair=nt});var xe=N(Mi=>{"use strict";var _c=M(),xi=ge(),Fc={collection:"map",default:!0,nodeClass:xi.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return _c.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>xi.YAMLMap.from(t,e,n)};Mi.map=Fc});var ye=N(Ii=>{"use strict";var jc=Ge(),Bc=ws(),Kc=zt(),cn=M(),Uc=j(),Yc=fe(),vs=class extends Kc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(cn.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=ln(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let s=ln(e);if(typeof s!="number")return;let r=this.items[s];return!n&&cn.isScalar(r)?r.value:r}has(e){let n=ln(e);return typeof n=="number"&&n<this.items.length}set(e,n){let s=ln(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[s];cn.isScalar(r)&&Uc.isScalarValue(n)?r.value=n:this.items[s]=n}toJSON(e,n){let s=[];n?.onCreate&&n.onCreate(s);let r=0;for(let i of this.items)s.push(Yc.toJS(i,String(r++),n));return s}toString(e,n,s){return e?Bc.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof r=="function"){let l=n instanceof Set?a:String(o++);a=r.call(n,l,a)}i.items.push(jc.createNode(a,void 0,s))}}return i}};function ln(t){let e=cn.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Ii.YAMLSeq=vs});var Me=N(Ri=>{"use strict";var zc=M(),Di=ye(),Vc={collection:"seq",default:!0,nodeClass:Di.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return zc.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Di.YAMLSeq.from(t,e,n)};Ri.seq=Vc});var st=N(_i=>{"use strict";var Wc=Ze(),Jc={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,s){return e=Object.assign({actualString:!0},e),Wc.stringifyString(t,e,n,s)}};_i.string=Jc});var fn=N(Bi=>{"use strict";var Fi=j(),ji={identify:t=>t==null,createNode:()=>new Fi.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Fi.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&ji.test.test(t)?t:e.options.nullStr};Bi.nullTag=ji});var $s=N(Ui=>{"use strict";var Gc=j(),Ki={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Gc.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Ki.test.test(t)){let s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?n.options.trueStr:n.options.falseStr}};Ui.boolTag=Ki});var Ie=N(Yi=>{"use strict";function Xc({format:t,minFractionDigits:e,tag:n,value:s}){if(typeof s=="bigint")return String(s);let r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(s,-0)?"-0":JSON.stringify(s);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}Yi.stringifyNumber=Xc});var Os=N(un=>{"use strict";var Hc=j(),As=Ie(),Qc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:As.stringifyNumber},Zc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():As.stringifyNumber(t)}},ef={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Hc.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:As.stringifyNumber};un.float=ef;un.floatExp=Zc;un.floatNaN=Qc});var Es=N(pn=>{"use strict";var zi=Ie(),dn=t=>typeof t=="bigint"||Number.isInteger(t),Ns=(t,e,n,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),n);function Vi(t,e,n){let{value:s}=t;return dn(s)&&s>=0?n+s.toString(e):zi.stringifyNumber(t)}var tf={identify:t=>dn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Ns(t,2,8,n),stringify:t=>Vi(t,8,"0o")},nf={identify:dn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Ns(t,0,10,n),stringify:zi.stringifyNumber},sf={identify:t=>dn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Ns(t,2,16,n),stringify:t=>Vi(t,16,"0x")};pn.int=nf;pn.intHex=sf;pn.intOct=tf});var Ji=N(Wi=>{"use strict";var rf=xe(),of=fn(),af=Me(),lf=st(),cf=$s(),Cs=Os(),qs=Es(),ff=[rf.map,af.seq,lf.string,of.nullTag,cf.boolTag,qs.intOct,qs.int,qs.intHex,Cs.floatNaN,Cs.floatExp,Cs.float];Wi.schema=ff});var Hi=N(Xi=>{"use strict";var uf=j(),df=xe(),pf=Me();function Gi(t){return typeof t=="bigint"||Number.isInteger(t)}var hn=({value:t})=>JSON.stringify(t),hf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:hn},{identify:t=>t==null,createNode:()=>new uf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:hn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:hn},{identify:Gi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Gi(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:hn}],mf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},gf=[df.map,pf.seq].concat(hf,mf);Xi.schema=gf});var Ps=N(Qi=>{"use strict";var rt=Dt("buffer"),Ts=j(),yf=Ze(),bf={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof rt.Buffer=="function")return rt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},s,r,i){if(!n)return"";let o=n,a;if(typeof rt.Buffer=="function")a=o instanceof rt.Buffer?o.toString("base64"):rt.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=Ts.Scalar.BLOCK_LITERAL),e!==Ts.Scalar.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let f=0,u=0;f<c;++f,u+=l)d[f]=a.substr(u,l);a=d.join(e===Ts.Scalar.BLOCK_LITERAL?`
54
+ `:" ")}return yf.stringifyString({comment:t,type:e,value:a},s,r,i)}};Qi.binary=bf});var yn=N(gn=>{"use strict";var mn=M(),Ls=he(),wf=j(),kf=ye();function Zi(t,e){if(mn.isSeq(t))for(let n=0;n<t.items.length;++n){let s=t.items[n];if(!mn.isPair(s)){if(mn.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let r=s.items[0]||new Ls.Pair(new wf.Scalar(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
55
55
  ${r.key.commentBefore}`:s.commentBefore),s.comment){let i=r.value??r.key;i.comment=i.comment?`${s.comment}
56
- ${i.comment}`:s.comment}s=r}t.items[n]=dn.isPair(s)?s:new Ts.Pair(s)}}else e("Expected a sequence for this tag");return t}function Zi(t,e,n){let{replacer:s}=n,r=new yf.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(i++),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;r.items.push(Ts.createPair(a,l,n))}return r}var bf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Qi,createNode:Zi};pn.createPairs=Zi;pn.pairs=bf;pn.resolvePairs=Qi});var xs=O(Ls=>{"use strict";var eo=M(),Ps=fe(),it=ge(),wf=ye(),to=hn(),$e=class t extends wf.YAMLSeq{constructor(){super(),this.add=it.YAMLMap.prototype.add.bind(this),this.delete=it.YAMLMap.prototype.delete.bind(this),this.get=it.YAMLMap.prototype.get.bind(this),this.has=it.YAMLMap.prototype.has.bind(this),this.set=it.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let s=new Map;n?.onCreate&&n.onCreate(s);for(let r of this.items){let i,o;if(eo.isPair(r)?(i=Ps.toJS(r.key,"",n),o=Ps.toJS(r.value,i,n)):i=Ps.toJS(r,"",n),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(e,n,s){let r=to.createPairs(e,n,s),i=new this;return i.items=r.items,i}};$e.tag="tag:yaml.org,2002:omap";var kf={collection:"seq",identify:t=>t instanceof Map,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=to.resolvePairs(t,e),s=[];for(let{key:r}of n.items)eo.isScalar(r)&&(s.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new $e,n)},createNode:(t,e,n)=>$e.from(t,e,n)};Ls.YAMLOMap=$e;Ls.omap=kf});var oo=O(Ms=>{"use strict";var no=j();function so({value:t,source:e},n){return e&&(t?ro:io).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var ro={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new no.Scalar(!0),stringify:so},io={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new no.Scalar(!1),stringify:so};Ms.falseTag=io;Ms.trueTag=ro});var ao=O(mn=>{"use strict";var Sf=j(),Is=Ie(),vf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Is.stringifyNumber},$f={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Is.stringifyNumber(t)}},Af={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Sf.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let s=t.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Is.stringifyNumber};mn.float=Af;mn.floatExp=$f;mn.floatNaN=vf});var co=O(at=>{"use strict";var lo=Ie(),ot=t=>typeof t=="bigint"||Number.isInteger(t);function gn(t,e,n,{intAsBigInt:s}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return r==="-"?-1*i:i}function Ds(t,e,n){let{value:s}=t;if(ot(s)){let r=s.toString(e);return s<0?"-"+n+r.substr(1):n+r}return lo.stringifyNumber(t)}var Of={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>gn(t,2,2,n),stringify:t=>Ds(t,2,"0b")},Nf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>gn(t,1,8,n),stringify:t=>Ds(t,8,"0")},Ef={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>gn(t,0,10,n),stringify:lo.stringifyNumber},Cf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>gn(t,2,16,n),stringify:t=>Ds(t,16,"0x")};at.int=Ef;at.intBin=Of;at.intHex=Cf;at.intOct=Nf});var _s=O(Rs=>{"use strict";var wn=M(),yn=he(),bn=ge(),Ae=class t extends bn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;wn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new yn.Pair(e.key,null):n=new yn.Pair(e,null),bn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let s=bn.findPair(this.items,e);return!n&&wn.isPair(s)?wn.isScalar(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let s=bn.findPair(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new yn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),i.items.push(yn.createPair(o,null,s));return i}};Ae.tag="tag:yaml.org,2002:set";var qf={collection:"map",identify:t=>t instanceof Set,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ae.from(t,e,n),resolve(t,e){if(wn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ae,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Rs.YAMLSet=Ae;Rs.set=qf});var js=O(kn=>{"use strict";var Tf=Ie();function Fs(t,e){let n=t[0],s=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),i=s.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*i:i}function fo(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Tf.stringifyNumber(t);let s="";e<0&&(s="-",e*=n(-1));let r=n(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),s+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Pf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Fs(t,n),stringify:fo},Lf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Fs(t,!1),stringify:fo},uo={identify:t=>t 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(t){let e=t.match(uo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,s,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,s-1,r,i||0,o||0,a||0,l),p=e[8];if(p&&p!=="Z"){let u=Fs(p,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};kn.floatTime=Lf;kn.intTime=Pf;kn.timestamp=uo});var mo=O(ho=>{"use strict";var xf=xe(),Mf=an(),If=Me(),Df=st(),Rf=qs(),po=oo(),Bs=ao(),Sn=co(),_f=Qt(),Ff=xs(),jf=hn(),Bf=_s(),Ks=js(),Kf=[xf.map,If.seq,Df.string,Mf.nullTag,po.trueTag,po.falseTag,Sn.intBin,Sn.intOct,Sn.int,Sn.intHex,Bs.floatNaN,Bs.floatExp,Bs.float,Rf.binary,_f.merge,Ff.omap,jf.pairs,Bf.set,Ks.intTime,Ks.floatTime,Ks.timestamp];ho.schema=Kf});var Oo=O(zs=>{"use strict";var wo=xe(),Uf=an(),ko=Me(),Yf=st(),zf=Ss(),Us=$s(),Ys=Os(),Vf=Ji(),Jf=Xi(),So=qs(),lt=Qt(),vo=xs(),$o=hn(),go=mo(),Ao=_s(),vn=js(),yo=new Map([["core",Vf.schema],["failsafe",[wo.map,ko.seq,Yf.string]],["json",Jf.schema],["yaml11",go.schema],["yaml-1.1",go.schema]]),bo={binary:So.binary,bool:zf.boolTag,float:Us.float,floatExp:Us.floatExp,floatNaN:Us.floatNaN,floatTime:vn.floatTime,int:Ys.int,intHex:Ys.intHex,intOct:Ys.intOct,intTime:vn.intTime,map:wo.map,merge:lt.merge,null:Uf.nullTag,omap:vo.omap,pairs:$o.pairs,seq:ko.seq,set:Ao.set,timestamp:vn.timestamp},Wf={"tag:yaml.org,2002:binary":So.binary,"tag:yaml.org,2002:merge":lt.merge,"tag:yaml.org,2002:omap":vo.omap,"tag:yaml.org,2002:pairs":$o.pairs,"tag:yaml.org,2002:set":Ao.set,"tag:yaml.org,2002:timestamp":vn.timestamp};function Gf(t,e,n){let s=yo.get(e);if(s&&!t)return n&&!s.includes(lt.merge)?s.concat(lt.merge):s.slice();let r=s;if(!r)if(Array.isArray(t))r=[];else{let i=Array.from(yo.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)r=r.concat(i);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(lt.merge)),r.reduce((i,o)=>{let a=typeof o=="string"?bo[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(bo).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}zs.coreKnownTags=Wf;zs.getTags=Gf});var Ws=O(No=>{"use strict";var Vs=M(),Xf=xe(),Hf=Me(),Qf=st(),$n=Oo(),Zf=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Js=class t{constructor({compat:e,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?$n.getTags(e,"compat"):e?$n.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?$n.coreKnownTags:{},this.tags=$n.getTags(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Vs.MAP,{value:Xf.map}),Object.defineProperty(this,Vs.SCALAR,{value:Qf.string}),Object.defineProperty(this,Vs.SEQ,{value:Hf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Zf:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};No.Schema=Js});var Co=O(Eo=>{"use strict";var eu=M(),Gs=et(),ct=Xe();function tu(t,e){let n=[],s=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),s=!0):t.directives.docStart&&(s=!0)}s&&n.push("---");let r=Gs.createStringifyContext(t,e),{commentString:i}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=i(t.commentBefore);n.unshift(ct.indentComment(l,""))}let o=!1,a=null;if(t.contents){if(eu.isNode(t.contents)){if(t.contents.spaceBefore&&s&&n.push(""),t.contents.commentBefore){let p=i(t.contents.commentBefore);n.push(ct.indentComment(p,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>o=!0,c=Gs.stringify(t.contents,r,()=>a=null,l);a&&(c+=ct.lineComment(c,"",i(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Gs.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let l=i(t.comment);l.includes(`
56
+ ${i.comment}`:s.comment}s=r}t.items[n]=mn.isPair(s)?s:new Ls.Pair(s)}}else e("Expected a sequence for this tag");return t}function eo(t,e,n){let{replacer:s}=n,r=new kf.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(i++),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;r.items.push(Ls.createPair(a,l,n))}return r}var Sf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Zi,createNode:eo};gn.createPairs=eo;gn.pairs=Sf;gn.resolvePairs=Zi});var Is=N(Ms=>{"use strict";var to=M(),xs=fe(),it=ge(),vf=ye(),no=yn(),$e=class t extends vf.YAMLSeq{constructor(){super(),this.add=it.YAMLMap.prototype.add.bind(this),this.delete=it.YAMLMap.prototype.delete.bind(this),this.get=it.YAMLMap.prototype.get.bind(this),this.has=it.YAMLMap.prototype.has.bind(this),this.set=it.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let s=new Map;n?.onCreate&&n.onCreate(s);for(let r of this.items){let i,o;if(to.isPair(r)?(i=xs.toJS(r.key,"",n),o=xs.toJS(r.value,i,n)):i=xs.toJS(r,"",n),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(e,n,s){let r=no.createPairs(e,n,s),i=new this;return i.items=r.items,i}};$e.tag="tag:yaml.org,2002:omap";var $f={collection:"seq",identify:t=>t instanceof Map,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=no.resolvePairs(t,e),s=[];for(let{key:r}of n.items)to.isScalar(r)&&(s.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new $e,n)},createNode:(t,e,n)=>$e.from(t,e,n)};Ms.YAMLOMap=$e;Ms.omap=$f});var ao=N(Ds=>{"use strict";var so=j();function ro({value:t,source:e},n){return e&&(t?io:oo).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var io={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new so.Scalar(!0),stringify:ro},oo={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new so.Scalar(!1),stringify:ro};Ds.falseTag=oo;Ds.trueTag=io});var lo=N(bn=>{"use strict";var Af=j(),Rs=Ie(),Of={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Rs.stringifyNumber},Nf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Rs.stringifyNumber(t)}},Ef={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Af.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let s=t.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Rs.stringifyNumber};bn.float=Ef;bn.floatExp=Nf;bn.floatNaN=Of});var fo=N(at=>{"use strict";var co=Ie(),ot=t=>typeof t=="bigint"||Number.isInteger(t);function wn(t,e,n,{intAsBigInt:s}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return r==="-"?-1*i:i}function _s(t,e,n){let{value:s}=t;if(ot(s)){let r=s.toString(e);return s<0?"-"+n+r.substr(1):n+r}return co.stringifyNumber(t)}var Cf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>wn(t,2,2,n),stringify:t=>_s(t,2,"0b")},qf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>wn(t,1,8,n),stringify:t=>_s(t,8,"0")},Tf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>wn(t,0,10,n),stringify:co.stringifyNumber},Pf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>wn(t,2,16,n),stringify:t=>_s(t,16,"0x")};at.int=Tf;at.intBin=Cf;at.intHex=Pf;at.intOct=qf});var js=N(Fs=>{"use strict";var vn=M(),kn=he(),Sn=ge(),Ae=class t extends Sn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;vn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new kn.Pair(e.key,null):n=new kn.Pair(e,null),Sn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let s=Sn.findPair(this.items,e);return!n&&vn.isPair(s)?vn.isScalar(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let s=Sn.findPair(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new kn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),i.items.push(kn.createPair(o,null,s));return i}};Ae.tag="tag:yaml.org,2002:set";var Lf={collection:"map",identify:t=>t instanceof Set,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ae.from(t,e,n),resolve(t,e){if(vn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ae,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Fs.YAMLSet=Ae;Fs.set=Lf});var Ks=N($n=>{"use strict";var xf=Ie();function Bs(t,e){let n=t[0],s=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),i=s.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*i:i}function uo(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return xf.stringifyNumber(t);let s="";e<0&&(s="-",e*=n(-1));let r=n(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),s+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Mf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Bs(t,n),stringify:uo},If={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Bs(t,!1),stringify:uo},po={identify:t=>t 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(t){let e=t.match(po.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,s,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,s-1,r,i||0,o||0,a||0,l),d=e[8];if(d&&d!=="Z"){let f=Bs(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$n.floatTime=If;$n.intTime=Mf;$n.timestamp=po});var go=N(mo=>{"use strict";var Df=xe(),Rf=fn(),_f=Me(),Ff=st(),jf=Ps(),ho=ao(),Us=lo(),An=fo(),Bf=tn(),Kf=Is(),Uf=yn(),Yf=js(),Ys=Ks(),zf=[Df.map,_f.seq,Ff.string,Rf.nullTag,ho.trueTag,ho.falseTag,An.intBin,An.intOct,An.int,An.intHex,Us.floatNaN,Us.floatExp,Us.float,jf.binary,Bf.merge,Kf.omap,Uf.pairs,Yf.set,Ys.intTime,Ys.floatTime,Ys.timestamp];mo.schema=zf});var No=N(Ws=>{"use strict";var ko=xe(),Vf=fn(),So=Me(),Wf=st(),Jf=$s(),zs=Os(),Vs=Es(),Gf=Ji(),Xf=Hi(),vo=Ps(),lt=tn(),$o=Is(),Ao=yn(),yo=go(),Oo=js(),On=Ks(),bo=new Map([["core",Gf.schema],["failsafe",[ko.map,So.seq,Wf.string]],["json",Xf.schema],["yaml11",yo.schema],["yaml-1.1",yo.schema]]),wo={binary:vo.binary,bool:Jf.boolTag,float:zs.float,floatExp:zs.floatExp,floatNaN:zs.floatNaN,floatTime:On.floatTime,int:Vs.int,intHex:Vs.intHex,intOct:Vs.intOct,intTime:On.intTime,map:ko.map,merge:lt.merge,null:Vf.nullTag,omap:$o.omap,pairs:Ao.pairs,seq:So.seq,set:Oo.set,timestamp:On.timestamp},Hf={"tag:yaml.org,2002:binary":vo.binary,"tag:yaml.org,2002:merge":lt.merge,"tag:yaml.org,2002:omap":$o.omap,"tag:yaml.org,2002:pairs":Ao.pairs,"tag:yaml.org,2002:set":Oo.set,"tag:yaml.org,2002:timestamp":On.timestamp};function Qf(t,e,n){let s=bo.get(e);if(s&&!t)return n&&!s.includes(lt.merge)?s.concat(lt.merge):s.slice();let r=s;if(!r)if(Array.isArray(t))r=[];else{let i=Array.from(bo.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)r=r.concat(i);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(lt.merge)),r.reduce((i,o)=>{let a=typeof o=="string"?wo[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(wo).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}Ws.coreKnownTags=Hf;Ws.getTags=Qf});var Xs=N(Eo=>{"use strict";var Js=M(),Zf=xe(),eu=Me(),tu=st(),Nn=No(),nu=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Gs=class t{constructor({compat:e,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Nn.getTags(e,"compat"):e?Nn.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?Nn.coreKnownTags:{},this.tags=Nn.getTags(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Js.MAP,{value:Zf.map}),Object.defineProperty(this,Js.SCALAR,{value:tu.string}),Object.defineProperty(this,Js.SEQ,{value:eu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?nu:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Eo.Schema=Gs});var qo=N(Co=>{"use strict";var su=M(),Hs=et(),ct=Xe();function ru(t,e){let n=[],s=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),s=!0):t.directives.docStart&&(s=!0)}s&&n.push("---");let r=Hs.createStringifyContext(t,e),{commentString:i}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=i(t.commentBefore);n.unshift(ct.indentComment(l,""))}let o=!1,a=null;if(t.contents){if(su.isNode(t.contents)){if(t.contents.spaceBefore&&s&&n.push(""),t.contents.commentBefore){let d=i(t.contents.commentBefore);n.push(ct.indentComment(d,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>o=!0,c=Hs.stringify(t.contents,r,()=>a=null,l);a&&(c+=ct.lineComment(c,"",i(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Hs.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let l=i(t.comment);l.includes(`
57
57
  `)?(n.push("..."),n.push(ct.indentComment(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=t.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(ct.indentComment(i(l),"")))}return n.join(`
58
58
  `)+`
59
- `}Eo.stringifyDocument=tu});var ft=O(qo=>{"use strict";var nu=We(),De=Kt(),Z=M(),su=he(),ru=fe(),iu=Ws(),ou=Co(),Xs=_t(),au=es(),lu=Ge(),Hs=Zn(),Qs=class t{constructor(e,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Z.NODE_TYPE,{value:Z.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:o}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Hs.Directives({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,r,s)}clone(){let e=Object.create(t.prototype,{[Z.NODE_TYPE]:{value:Z.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=Z.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Re(this.contents)&&this.contents.add(e)}addIn(e,n){Re(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let s=Xs.anchorNames(this);e.anchor=!n||s.has(n)?Xs.findNewAnchor(n||"a",s):n}return new nu.Alias(e.anchor)}createNode(e,n,s){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let g=$=>typeof $=="number"||$ instanceof String||$ instanceof Number,k=n.filter(g).map(String);k.length>0&&(n=n.concat(k)),r=n}else s===void 0&&n&&(s=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:p}=s??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=Xs.createNodeAnchors(this,o||"a"),d={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:m},h=lu.createNode(e,p,d);return a&&Z.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,n,s={}){let r=this.createNode(e,null,s),i=this.createNode(n,null,s);return new su.Pair(r,i)}delete(e){return Re(this.contents)?this.contents.delete(e):!1}deleteIn(e){return De.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Re(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Z.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return De.isEmptyPath(e)?!n&&Z.isScalar(this.contents)?this.contents.value:this.contents:Z.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Z.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return De.isEmptyPath(e)?this.contents!==void 0:Z.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=De.collectionFromPath(this.schema,[e],n):Re(this.contents)&&this.contents.set(e,n)}setIn(e,n){De.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=De.collectionFromPath(this.schema,Array.from(e),n):Re(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Hs.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 Hs.Directives({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new iu.Schema(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=ru.toJS(this.contents,n??"",a);if(typeof i=="function")for(let{count:c,res:p}of a.anchors.values())i(p,c);return typeof o=="function"?au.applyReviver(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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 n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return ou.stringifyDocument(this,e)}};function Re(t){if(Z.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}qo.Document=Qs});var pt=O(dt=>{"use strict";var ut=class extends Error{constructor(e,n,s,r){super(),this.name=e,this.code=s,this.message=r,this.pos=n}},Zs=class extends ut{constructor(e,n,s){super("YAMLParseError",e,n,s)}},er=class extends ut{constructor(e,n,s){super("YAMLWarning",e,n,s)}},cu=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,o=t.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
59
+ `}Co.stringifyDocument=ru});var ft=N(To=>{"use strict";var iu=Je(),De=zt(),ee=M(),ou=he(),au=fe(),lu=Xs(),cu=qo(),Qs=Bt(),fu=ns(),uu=Ge(),Zs=ts(),er=class t{constructor(e,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ee.NODE_TYPE,{value:ee.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:o}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Zs.Directives({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,r,s)}clone(){let e=Object.create(t.prototype,{[ee.NODE_TYPE]:{value:ee.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=ee.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Re(this.contents)&&this.contents.add(e)}addIn(e,n){Re(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let s=Qs.anchorNames(this);e.anchor=!n||s.has(n)?Qs.findNewAnchor(n||"a",s):n}return new iu.Alias(e.anchor)}createNode(e,n,s){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let y=S=>typeof S=="number"||S instanceof String||S instanceof Number,p=n.filter(y).map(String);p.length>0&&(n=n.concat(p)),r=n}else s===void 0&&n&&(s=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=s??{},{onAnchor:f,setAnchors:u,sourceObjects:h}=Qs.createNodeAnchors(this,o||"a"),k={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:h},m=uu.createNode(e,d,k);return a&&ee.isCollection(m)&&(m.flow=!0),u(),m}createPair(e,n,s={}){let r=this.createNode(e,null,s),i=this.createNode(n,null,s);return new ou.Pair(r,i)}delete(e){return Re(this.contents)?this.contents.delete(e):!1}deleteIn(e){return De.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Re(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return ee.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return De.isEmptyPath(e)?!n&&ee.isScalar(this.contents)?this.contents.value:this.contents:ee.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return ee.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return De.isEmptyPath(e)?this.contents!==void 0:ee.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=De.collectionFromPath(this.schema,[e],n):Re(this.contents)&&this.contents.set(e,n)}setIn(e,n){De.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=De.collectionFromPath(this.schema,Array.from(e),n):Re(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Zs.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 Zs.Directives({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new lu.Schema(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=au.toJS(this.contents,n??"",a);if(typeof i=="function")for(let{count:c,res:d}of a.anchors.values())i(d,c);return typeof o=="function"?fu.applyReviver(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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 n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return cu.stringifyDocument(this,e)}};function Re(t){if(ee.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}To.Document=er});var pt=N(dt=>{"use strict";var ut=class extends Error{constructor(e,n,s,r){super(),this.name=e,this.code=s,this.message=r,this.pos=n}},tr=class extends ut{constructor(e,n,s){super("YAMLParseError",e,n,s)}},nr=class extends ut{constructor(e,n,s){super("YAMLWarning",e,n,s)}},du=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,o=t.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
60
60
  `),o=a+o}if(/[^ ]/.test(o)){let a=1,l=n.linePos[1];l?.line===s&&l.col>r&&(a=Math.max(1,Math.min(l.col-r,80-i)));let c=" ".repeat(i)+"^".repeat(a);n.message+=`:
61
61
 
62
62
  ${o}
63
63
  ${c}
64
- `}};dt.YAMLError=ut;dt.YAMLParseError=Zs;dt.YAMLWarning=er;dt.prettifyError=cu});var ht=O(To=>{"use strict";function fu(t,{flow:e,indicator:n,next:s,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,p=a,u="",f="",m=!1,d=!1,h=null,g=null,k=null,$=null,E=null,y=null,S=null;for(let N of t)switch(d&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&i(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),h&&(c&&N.type!=="comment"&&N.type!=="newline"&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),N.type){case"space":!e&&(n!=="doc-start"||s?.type!=="flow-collection")&&N.source.includes(" ")&&(h=N),p=!0;break;case"comment":{p||i(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let w=N.source.substring(1)||" ";u?u+=f+w:u=w,f="",c=!1;break}case"newline":c?u?u+=N.source:(!y||n!=="seq-item-ind")&&(l=!0):f+=N.source,c=!0,m=!0,(g||k)&&($=N),p=!0;break;case"anchor":g&&i(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&i(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=N,S??(S=N.offset),c=!1,p=!1,d=!0;break;case"tag":{k&&i(N,"MULTIPLE_TAGS","A node can have at most one tag"),k=N,S??(S=N.offset),c=!1,p=!1,d=!0;break}case n:(g||k)&&i(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),y&&i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${e??"collection"}`),y=N,c=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(e){E&&i(N,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),E=N,c=!1,p=!1;break}default:i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),c=!1,p=!1}let A=t[t.length-1],T=A?A.offset+A.source.length:r;return d&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:y,spaceBefore:l,comment:u,hasNewline:m,anchor:g,tag:k,newlineAfterProp:$,end:T,start:S??T}}To.resolveProps=fu});var An=O(Po=>{"use strict";function tr(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
65
- `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(tr(e.key)||tr(e.value))return!0}return!1;default:return!0}}Po.containsNewline=tr});var nr=O(Lo=>{"use strict";var uu=An();function du(t,e,n){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&uu.containsNewline(e)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Lo.flowIndentCheck=du});var sr=O(Mo=>{"use strict";var xo=M();function pu(t,e,n){let{uniqueKeys:s}=t.options;if(s===!1)return!1;let r=typeof s=="function"?s:(i,o)=>i===o||xo.isScalar(i)&&xo.isScalar(o)&&i.value===o.value;return e.some(i=>r(i.key,n))}Mo.mapIncludes=pu});var jo=O(Fo=>{"use strict";var Io=he(),hu=ge(),Do=ht(),mu=An(),Ro=nr(),gu=sr(),_o="All mapping items must start at the same column";function yu({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=i?.nodeClass??hu.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,c=null;for(let p of s.items){let{start:u,key:f,sep:m,value:d}=p,h=Do.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==s.indent&&r(l,"BAD_INDENT",_o)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(a.comment?a.comment+=`
66
- `+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||mu.containsNewline(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&r(l,"BAD_INDENT",_o);n.atKey=!0;let k=h.end,$=f?t(n,f,h,r):e(n,k,u,null,h,r);n.schema.compat&&Ro.flowIndentCheck(s.indent,f,r),n.atKey=!1,gu.mapIncludes(n,a.items,$)&&r(k,"DUPLICATE_KEY","Map keys must be unique");let E=Do.resolveProps(m??[],{indicator:"map-value-ind",next:d,offset:$.range[2],onError:r,parentIndent:s.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=E.end,E.found){g&&(d?.type==="block-map"&&!E.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&h.start<E.found.offset-1024&&r($.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let y=d?t(n,d,E,r):e(n,l,m,null,E,r);n.schema.compat&&Ro.flowIndentCheck(s.indent,d,r),l=y.range[2];let S=new Io.Pair($,y);n.options.keepSourceTokens&&(S.srcToken=p),a.items.push(S)}else{g&&r($.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&($.comment?$.comment+=`
67
- `+E.comment:$.comment=E.comment);let y=new Io.Pair($);n.options.keepSourceTokens&&(y.srcToken=p),a.items.push(y)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}Fo.resolveBlockMap=yu});var Ko=O(Bo=>{"use strict";var bu=ye(),wu=ht(),ku=nr();function Su({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=i?.nodeClass??bu.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=s.offset,c=null;for(let{start:p,value:u}of s.items){let f=wu.resolveProps(p,{indicator:"seq-item-ind",next:u,offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let m=u?t(n,u,f,r):e(n,f.end,p,null,f,r);n.schema.compat&&ku.flowIndentCheck(s.indent,u,r),l=m.range[2],a.items.push(m)}return a.range=[s.offset,l,c??l],a}Bo.resolveBlockSeq=Su});var _e=O(Uo=>{"use strict";function vu(t,e,n,s){let r="";if(t){let i=!1,o="";for(let a of t){let{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=l.substring(1)||" ";r?r+=o+p:r=p,o="";break}case"newline":r&&(o+=l),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:r,offset:e}}Uo.resolveEnd=vu});var Jo=O(Vo=>{"use strict";var $u=M(),Au=he(),Yo=ge(),Ou=ye(),Nu=_e(),zo=ht(),Eu=An(),Cu=sr(),rr="Block collections are not allowed within flow collections",ir=t=>t&&(t.type==="block-map"||t.type==="block-seq");function qu({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=i?.nodeClass??(o?Yo.YAMLMap:Ou.YAMLSeq),c=new l(n.schema);c.flow=!0;let p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){let k=s.items[g],{start:$,key:E,sep:y,value:S}=k,A=zo.resolveProps($,{flow:a,indicator:"explicit-key-ind",next:E??y?.[0],offset:u,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!y&&!S){g===0&&A.comma?r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<s.items.length-1&&r(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
68
- `+A.comment:c.comment=A.comment),u=A.end;continue}!o&&n.options.strict&&Eu.containsNewline(E)&&r(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)A.comma&&r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||r(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let T="";e:for(let N of $)switch(N.type){case"comma":case"space":break;case"comment":T=N.source.substring(1);break e;default:break e}if(T){let N=c.items[c.items.length-1];$u.isPair(N)&&(N=N.value??N.key),N.comment?N.comment+=`
69
- `+T:N.comment=T,A.comment=A.comment.substring(T.length+1)}}if(!o&&!y&&!A.found){let T=S?t(n,S,A,r):e(n,A.end,y,null,A,r);c.items.push(T),u=T.range[2],ir(S)&&r(T.range,"BLOCK_IN_FLOW",rr)}else{n.atKey=!0;let T=A.end,N=E?t(n,E,A,r):e(n,T,$,null,A,r);ir(E)&&r(N.range,"BLOCK_IN_FLOW",rr),n.atKey=!1;let w=zo.resolveProps(y??[],{flow:a,indicator:"map-value-ind",next:S,offset:N.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(w.found){if(!o&&!A.found&&n.options.strict){if(y)for(let q of y){if(q===w.found)break;if(q.type==="newline"){r(q,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<w.found.offset-1024&&r(w.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source?.[0]===":"?r(S,"MISSING_CHAR",`Missing space after : in ${a}`):r(w.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let L=S?t(n,S,w,r):w.found?e(n,w.end,y,null,w,r):null;L?ir(S)&&r(L.range,"BLOCK_IN_FLOW",rr):w.comment&&(N.comment?N.comment+=`
70
- `+w.comment:N.comment=w.comment);let v=new Au.Pair(N,L);if(n.options.keepSourceTokens&&(v.srcToken=k),o){let q=c;Cu.mapIncludes(n,q.items,N)&&r(T,"DUPLICATE_KEY","Map keys must be unique"),q.items.push(v)}else{let q=new Yo.YAMLMap(n.schema);q.flow=!0,q.items.push(v);let D=(L??N).range;q.range=[N.range[0],D[1],D[2]],c.items.push(q)}u=L?L.range[2]:w.end}}let f=o?"}":"]",[m,...d]=s.end,h=u;if(m?.source===f)h=m.offset+m.source.length;else{let g=a[0].toUpperCase()+a.substring(1),k=p?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;r(u,p?"MISSING_CHAR":"BAD_INDENT",k),m&&m.source.length!==1&&d.unshift(m)}if(d.length>0){let g=Nu.resolveEnd(d,h,n.options.strict,r);g.comment&&(c.comment?c.comment+=`
71
- `+g.comment:c.comment=g.comment),c.range=[s.offset,h,g.offset]}else c.range=[s.offset,h,h];return c}Vo.resolveFlowCollection=qu});var Go=O(Wo=>{"use strict";var Tu=M(),Pu=j(),Lu=ge(),xu=ye(),Mu=jo(),Iu=Ko(),Du=Jo();function or(t,e,n,s,r,i){let o=n.type==="block-map"?Mu.resolveBlockMap(t,e,n,s,i):n.type==="block-seq"?Iu.resolveBlockSeq(t,e,n,s,i):Du.resolveFlowCollection(t,e,n,s,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function Ru(t,e,n,s,r){let i=s.tag,o=i?e.directives.tagName(i.source,f=>r(i,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=s,d=f&&i?f.offset>i.offset?f:i:f??i;d&&(!m||m.offset<d.offset)&&r(d,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Lu.YAMLMap.tagName&&a==="map"||o===xu.YAMLSeq.tagName&&a==="seq")return or(t,e,n,r,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?r(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),or(t,e,n,r,o)}let c=or(t,e,n,r,o,l),p=l.resolve?.(c,f=>r(i,"TAG_RESOLVE_FAILED",f),e.options)??c,u=Tu.isNode(p)?p:new Pu.Scalar(p);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}Wo.composeCollection=Ru});var lr=O(Xo=>{"use strict";var ar=j();function _u(t,e,n){let s=e.offset,r=Fu(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};let i=r.mode===">"?ar.Scalar.BLOCK_FOLDED:ar.Scalar.BLOCK_LITERAL,o=e.source?ju(e.source):[],a=o.length;for(let h=o.length-1;h>=0;--h){let g=o[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=r.chomp==="+"&&o.length>0?`
72
- `.repeat(Math.max(1,o.length-1)):"",g=s+r.length;return e.source&&(g+=e.source.length),{value:h,type:i,comment:r.comment,range:[s,g,g]}}let l=e.indent+r.indent,c=e.offset+r.length,p=0;for(let h=0;h<a;++h){let[g,k]=o[h];if(k===""||k==="\r")r.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&n(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=g.length),p=h,l===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+k.length+1}for(let h=o.length-1;h>=a;--h)o[h][0].length>l&&(a=h+1);let u="",f="",m=!1;for(let h=0;h<p;++h)u+=o[h][0].slice(l)+`
73
- `;for(let h=p;h<a;++h){let[g,k]=o[h];c+=g.length+k.length+1;let $=k[k.length-1]==="\r";if($&&(k=k.slice(0,-1)),k&&g.length<l){let y=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-k.length-($?2:1),"BAD_INDENT",y),g=""}i===ar.Scalar.BLOCK_LITERAL?(u+=f+g.slice(l)+k,f=`
74
- `):g.length>l||k[0]===" "?(f===" "?f=`
75
- `:!m&&f===`
76
- `&&(f=`
64
+ `}};dt.YAMLError=ut;dt.YAMLParseError=tr;dt.YAMLWarning=nr;dt.prettifyError=du});var ht=N(Po=>{"use strict";function pu(t,{flow:e,indicator:n,next:s,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,f="",u="",h=!1,k=!1,m=null,y=null,p=null,S=null,A=null,g=null,v=null;for(let E of t)switch(k&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&i(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k=!1),m&&(c&&E.type!=="comment"&&E.type!=="newline"&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),E.type){case"space":!e&&(n!=="doc-start"||s?.type!=="flow-collection")&&E.source.includes(" ")&&(m=E),d=!0;break;case"comment":{d||i(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let b=E.source.substring(1)||" ";f?f+=u+b:f=b,u="",c=!1;break}case"newline":c?f?f+=E.source:(!g||n!=="seq-item-ind")&&(l=!0):u+=E.source,c=!0,h=!0,(y||p)&&(S=E),d=!0;break;case"anchor":y&&i(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&i(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=E,v??(v=E.offset),c=!1,d=!1,k=!0;break;case"tag":{p&&i(E,"MULTIPLE_TAGS","A node can have at most one tag"),p=E,v??(v=E.offset),c=!1,d=!1,k=!0;break}case n:(y||p)&&i(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),g&&i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${e??"collection"}`),g=E,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){A&&i(E,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),A=E,c=!1,d=!1;break}default:i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),c=!1,d=!1}let O=t[t.length-1],T=O?O.offset+O.source.length:r;return k&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:A,found:g,spaceBefore:l,comment:f,hasNewline:h,anchor:y,tag:p,newlineAfterProp:S,end:T,start:v??T}}Po.resolveProps=pu});var En=N(Lo=>{"use strict";function sr(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
65
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(sr(e.key)||sr(e.value))return!0}return!1;default:return!0}}Lo.containsNewline=sr});var rr=N(xo=>{"use strict";var hu=En();function mu(t,e,n){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&hu.containsNewline(e)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}xo.flowIndentCheck=mu});var ir=N(Io=>{"use strict";var Mo=M();function gu(t,e,n){let{uniqueKeys:s}=t.options;if(s===!1)return!1;let r=typeof s=="function"?s:(i,o)=>i===o||Mo.isScalar(i)&&Mo.isScalar(o)&&i.value===o.value;return e.some(i=>r(i.key,n))}Io.mapIncludes=gu});var Bo=N(jo=>{"use strict";var Do=he(),yu=ge(),Ro=ht(),bu=En(),_o=rr(),wu=ir(),Fo="All mapping items must start at the same column";function ku({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=i?.nodeClass??yu.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,c=null;for(let d of s.items){let{start:f,key:u,sep:h,value:k}=d,m=Ro.resolveProps(f,{indicator:"explicit-key-ind",next:u??h?.[0],offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0}),y=!m.found;if(y){if(u&&(u.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==s.indent&&r(l,"BAD_INDENT",Fo)),!m.anchor&&!m.tag&&!h){c=m.end,m.comment&&(a.comment?a.comment+=`
66
+ `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||bu.containsNewline(u))&&r(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==s.indent&&r(l,"BAD_INDENT",Fo);n.atKey=!0;let p=m.end,S=u?t(n,u,m,r):e(n,p,f,null,m,r);n.schema.compat&&_o.flowIndentCheck(s.indent,u,r),n.atKey=!1,wu.mapIncludes(n,a.items,S)&&r(p,"DUPLICATE_KEY","Map keys must be unique");let A=Ro.resolveProps(h??[],{indicator:"map-value-ind",next:k,offset:S.range[2],onError:r,parentIndent:s.indent,startOnNewline:!u||u.type==="block-scalar"});if(l=A.end,A.found){y&&(k?.type==="block-map"&&!A.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<A.found.offset-1024&&r(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let g=k?t(n,k,A,r):e(n,l,h,null,A,r);n.schema.compat&&_o.flowIndentCheck(s.indent,k,r),l=g.range[2];let v=new Do.Pair(S,g);n.options.keepSourceTokens&&(v.srcToken=d),a.items.push(v)}else{y&&r(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(S.comment?S.comment+=`
67
+ `+A.comment:S.comment=A.comment);let g=new Do.Pair(S);n.options.keepSourceTokens&&(g.srcToken=d),a.items.push(g)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}jo.resolveBlockMap=ku});var Uo=N(Ko=>{"use strict";var Su=ye(),vu=ht(),$u=rr();function Au({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=i?.nodeClass??Su.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=s.offset,c=null;for(let{start:d,value:f}of s.items){let u=vu.resolveProps(d,{indicator:"seq-item-ind",next:f,offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?r(u.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(a.comment=u.comment);continue}let h=f?t(n,f,u,r):e(n,u.end,d,null,u,r);n.schema.compat&&$u.flowIndentCheck(s.indent,f,r),l=h.range[2],a.items.push(h)}return a.range=[s.offset,l,c??l],a}Ko.resolveBlockSeq=Au});var _e=N(Yo=>{"use strict";function Ou(t,e,n,s){let r="";if(t){let i=!1,o="";for(let a of t){let{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";r?r+=o+d:r=d,o="";break}case"newline":r&&(o+=l),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:r,offset:e}}Yo.resolveEnd=Ou});var Jo=N(Wo=>{"use strict";var Nu=M(),Eu=he(),zo=ge(),Cu=ye(),qu=_e(),Vo=ht(),Tu=En(),Pu=ir(),or="Block collections are not allowed within flow collections",ar=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Lu({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=i?.nodeClass??(o?zo.YAMLMap:Cu.YAMLSeq),c=new l(n.schema);c.flow=!0;let d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=s.offset+s.start.source.length;for(let y=0;y<s.items.length;++y){let p=s.items[y],{start:S,key:A,sep:g,value:v}=p,O=Vo.resolveProps(S,{flow:a,indicator:"explicit-key-ind",next:A??g?.[0],offset:f,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!g&&!v){y===0&&O.comma?r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<s.items.length-1&&r(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),O.comment&&(c.comment?c.comment+=`
68
+ `+O.comment:c.comment=O.comment),f=O.end;continue}!o&&n.options.strict&&Tu.containsNewline(A)&&r(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0)O.comma&&r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(O.comma||r(O.start,"MISSING_CHAR",`Missing , between ${a} items`),O.comment){let T="";e:for(let E of S)switch(E.type){case"comma":case"space":break;case"comment":T=E.source.substring(1);break e;default:break e}if(T){let E=c.items[c.items.length-1];Nu.isPair(E)&&(E=E.value??E.key),E.comment?E.comment+=`
69
+ `+T:E.comment=T,O.comment=O.comment.substring(T.length+1)}}if(!o&&!g&&!O.found){let T=v?t(n,v,O,r):e(n,O.end,g,null,O,r);c.items.push(T),f=T.range[2],ar(v)&&r(T.range,"BLOCK_IN_FLOW",or)}else{n.atKey=!0;let T=O.end,E=A?t(n,A,O,r):e(n,T,S,null,O,r);ar(A)&&r(E.range,"BLOCK_IN_FLOW",or),n.atKey=!1;let b=Vo.resolveProps(g??[],{flow:a,indicator:"map-value-ind",next:v,offset:E.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(b.found){if(!o&&!O.found&&n.options.strict){if(g)for(let q of g){if(q===b.found)break;if(q.type==="newline"){r(q,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<b.found.offset-1024&&r(b.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else v&&("source"in v&&v.source?.[0]===":"?r(v,"MISSING_CHAR",`Missing space after : in ${a}`):r(b.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let L=v?t(n,v,b,r):b.found?e(n,b.end,g,null,b,r):null;L?ar(v)&&r(L.range,"BLOCK_IN_FLOW",or):b.comment&&(E.comment?E.comment+=`
70
+ `+b.comment:E.comment=b.comment);let $=new Eu.Pair(E,L);if(n.options.keepSourceTokens&&($.srcToken=p),o){let q=c;Pu.mapIncludes(n,q.items,E)&&r(T,"DUPLICATE_KEY","Map keys must be unique"),q.items.push($)}else{let q=new zo.YAMLMap(n.schema);q.flow=!0,q.items.push($);let D=(L??E).range;q.range=[E.range[0],D[1],D[2]],c.items.push(q)}f=L?L.range[2]:b.end}}let u=o?"}":"]",[h,...k]=s.end,m=f;if(h?.source===u)m=h.offset+h.source.length;else{let y=a[0].toUpperCase()+a.substring(1),p=d?`${y} must end with a ${u}`:`${y} in block collection must be sufficiently indented and end with a ${u}`;r(f,d?"MISSING_CHAR":"BAD_INDENT",p),h&&h.source.length!==1&&k.unshift(h)}if(k.length>0){let y=qu.resolveEnd(k,m,n.options.strict,r);y.comment&&(c.comment?c.comment+=`
71
+ `+y.comment:c.comment=y.comment),c.range=[s.offset,m,y.offset]}else c.range=[s.offset,m,m];return c}Wo.resolveFlowCollection=Lu});var Xo=N(Go=>{"use strict";var xu=M(),Mu=j(),Iu=ge(),Du=ye(),Ru=Bo(),_u=Uo(),Fu=Jo();function lr(t,e,n,s,r,i){let o=n.type==="block-map"?Ru.resolveBlockMap(t,e,n,s,i):n.type==="block-seq"?_u.resolveBlockSeq(t,e,n,s,i):Fu.resolveFlowCollection(t,e,n,s,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function ju(t,e,n,s,r){let i=s.tag,o=i?e.directives.tagName(i.source,u=>r(i,"TAG_RESOLVE_FAILED",u)):null;if(n.type==="block-seq"){let{anchor:u,newlineAfterProp:h}=s,k=u&&i?u.offset>i.offset?u:i:u??i;k&&(!h||h.offset<k.offset)&&r(k,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Iu.YAMLMap.tagName&&a==="map"||o===Du.YAMLSeq.tagName&&a==="seq")return lr(t,e,n,r,o);let l=e.schema.tags.find(u=>u.tag===o&&u.collection===a);if(!l){let u=e.schema.knownTags[o];if(u?.collection===a)e.schema.tags.push(Object.assign({},u,{default:!1})),l=u;else return u?r(i,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),lr(t,e,n,r,o)}let c=lr(t,e,n,r,o,l),d=l.resolve?.(c,u=>r(i,"TAG_RESOLVE_FAILED",u),e.options)??c,f=xu.isNode(d)?d:new Mu.Scalar(d);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}Go.composeCollection=ju});var fr=N(Ho=>{"use strict";var cr=j();function Bu(t,e,n){let s=e.offset,r=Ku(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};let i=r.mode===">"?cr.Scalar.BLOCK_FOLDED:cr.Scalar.BLOCK_LITERAL,o=e.source?Uu(e.source):[],a=o.length;for(let m=o.length-1;m>=0;--m){let y=o[m][1];if(y===""||y==="\r")a=m;else break}if(a===0){let m=r.chomp==="+"&&o.length>0?`
72
+ `.repeat(Math.max(1,o.length-1)):"",y=s+r.length;return e.source&&(y+=e.source.length),{value:m,type:i,comment:r.comment,range:[s,y,y]}}let l=e.indent+r.indent,c=e.offset+r.length,d=0;for(let m=0;m<a;++m){let[y,p]=o[m];if(p===""||p==="\r")r.indent===0&&y.length>l&&(l=y.length);else{y.length<l&&n(c+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=y.length),d=m,l===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=y.length+p.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>l&&(a=m+1);let f="",u="",h=!1;for(let m=0;m<d;++m)f+=o[m][0].slice(l)+`
73
+ `;for(let m=d;m<a;++m){let[y,p]=o[m];c+=y.length+p.length+1;let S=p[p.length-1]==="\r";if(S&&(p=p.slice(0,-1)),p&&y.length<l){let g=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-p.length-(S?2:1),"BAD_INDENT",g),y=""}i===cr.Scalar.BLOCK_LITERAL?(f+=u+y.slice(l)+p,u=`
74
+ `):y.length>l||p[0]===" "?(u===" "?u=`
75
+ `:!h&&u===`
76
+ `&&(u=`
77
77
 
78
- `),u+=f+g.slice(l)+k,f=`
79
- `,m=!0):k===""?f===`
80
- `?u+=`
81
- `:f=`
82
- `:(u+=f+k,f=" ",m=!1)}switch(r.chomp){case"-":break;case"+":for(let h=a;h<o.length;++h)u+=`
83
- `+o[h][0].slice(l);u[u.length-1]!==`
84
- `&&(u+=`
85
- `);break;default:u+=`
86
- `}let d=s+r.length+e.source.length;return{value:u,type:i,comment:r.comment,range:[s,d,d]}}function Fu({offset:t,props:e},n,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],i=r[0],o=0,a="",l=-1;for(let f=1;f<r.length;++f){let m=r[f];if(!a&&(m==="-"||m==="+"))a=m;else{let d=Number(m);!o&&d?o=d:l===-1&&(l=t+f)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,p="",u=r.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":n&&!c&&s(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,p=m.source.substring(1);break;case"error":s(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let d=`Unexpected token in block scalar header: ${m.type}`;s(m,"UNEXPECTED_TOKEN",d);let h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:i,indent:o,chomp:a,comment:p,length:u}}function ju(t){let e=t.split(/\n( *)/),n=e[0],s=n.match(/^( *)/),i=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}Xo.resolveBlockScalar=_u});var fr=O(Qo=>{"use strict";var cr=j(),Bu=_e();function Ku(t,e,n){let{offset:s,type:r,source:i,end:o}=t,a,l,c=(f,m,d)=>n(s+f,m,d);switch(r){case"scalar":a=cr.Scalar.PLAIN,l=Uu(i,c);break;case"single-quoted-scalar":a=cr.Scalar.QUOTE_SINGLE,l=Yu(i,c);break;case"double-quoted-scalar":a=cr.Scalar.QUOTE_DOUBLE,l=zu(i,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}let p=s+i.length,u=Bu.resolveEnd(o,p,e,n);return{value:l,type:a,comment:u.comment,range:[s,p,u.offset]}}function Uu(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Ho(t)}function Yu(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ho(t.slice(1,-1)).replace(/''/g,"'")}function Ho(t){let e=/(.*?)\r?\n/sy,n=e.exec(t);if(!n)return t;let s,r;try{s=new RegExp("(?<![ ])[ ]+$"),r=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{s=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let i=n[1].replace(s,""),o=" ",a=e.lastIndex;for(;n=e.exec(t);){let c=n[1].replace(r,"");c===""?o===`
78
+ `),f+=u+y.slice(l)+p,u=`
79
+ `,h=!0):p===""?u===`
80
+ `?f+=`
81
+ `:u=`
82
+ `:(f+=u+p,u=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let m=a;m<o.length;++m)f+=`
83
+ `+o[m][0].slice(l);f[f.length-1]!==`
84
+ `&&(f+=`
85
+ `);break;default:f+=`
86
+ `}let k=s+r.length+e.source.length;return{value:f,type:i,comment:r.comment,range:[s,k,k]}}function Ku({offset:t,props:e},n,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],i=r[0],o=0,a="",l=-1;for(let u=1;u<r.length;++u){let h=r[u];if(!a&&(h==="-"||h==="+"))a=h;else{let k=Number(h);!o&&k?o=k:l===-1&&(l=t+u)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,d="",f=r.length;for(let u=1;u<e.length;++u){let h=e[u];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":n&&!c&&s(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,d=h.source.substring(1);break;case"error":s(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let k=`Unexpected token in block scalar header: ${h.type}`;s(h,"UNEXPECTED_TOKEN",k);let m=h.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:i,indent:o,chomp:a,comment:d,length:f}}function Uu(t){let e=t.split(/\n( *)/),n=e[0],s=n.match(/^( *)/),i=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}Ho.resolveBlockScalar=Bu});var dr=N(Zo=>{"use strict";var ur=j(),Yu=_e();function zu(t,e,n){let{offset:s,type:r,source:i,end:o}=t,a,l,c=(u,h,k)=>n(s+u,h,k);switch(r){case"scalar":a=ur.Scalar.PLAIN,l=Vu(i,c);break;case"single-quoted-scalar":a=ur.Scalar.QUOTE_SINGLE,l=Wu(i,c);break;case"double-quoted-scalar":a=ur.Scalar.QUOTE_DOUBLE,l=Ju(i,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}let d=s+i.length,f=Yu.resolveEnd(o,d,e,n);return{value:l,type:a,comment:f.comment,range:[s,d,f.offset]}}function Vu(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Qo(t)}function Wu(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Qo(t.slice(1,-1)).replace(/''/g,"'")}function Qo(t){let e=/(.*?)\r?\n/sy,n=e.exec(t);if(!n)return t;let s,r;try{s=new RegExp("(?<![ ])[ ]+$"),r=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{s=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let i=n[1].replace(s,""),o=" ",a=e.lastIndex;for(;n=e.exec(t);){let c=n[1].replace(r,"");c===""?o===`
87
87
  `?i+=o:o=`
88
- `:(i+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(t),i+o+(n?.[1]??"")}function zu(t,e){let n="";for(let s=1;s<t.length-1;++s){let r=t[s];if(!(r==="\r"&&t[s+1]===`
88
+ `:(i+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(t),i+o+(n?.[1]??"")}function Ju(t,e){let n="";for(let s=1;s<t.length-1;++s){let r=t[s];if(!(r==="\r"&&t[s+1]===`
89
89
  `))if(r===`
90
- `){let{fold:i,offset:o}=Vu(t,s);n+=i,s=o}else if(r==="\\"){let i=t[++s],o=Ju[i];if(o)n+=o;else if(i===`
90
+ `){let{fold:i,offset:o}=Gu(t,s);n+=i,s=o}else if(r==="\\"){let i=t[++s],o=Xu[i];if(o)n+=o;else if(i===`
91
91
  `)for(i=t[s+1];i===" "||i===" ";)i=t[++s+1];else if(i==="\r"&&t[s+1]===`
92
- `)for(i=t[++s+1];i===" "||i===" ";)i=t[++s+1];else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;n+=Wu(t,s+1,a,e),s+=a}else{let a=t.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let i=s,o=t[s+1];for(;o===" "||o===" ";)o=t[++s+1];o!==`
92
+ `)for(i=t[++s+1];i===" "||i===" ";)i=t[++s+1];else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;n+=Hu(t,s+1,a,e),s+=a}else{let a=t.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let i=s,o=t[s+1];for(;o===" "||o===" ";)o=t[++s+1];o!==`
93
93
  `&&!(o==="\r"&&t[s+2]===`
94
- `)&&(n+=s>i?t.slice(i,s+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Vu(t,e){let n="",s=t[e+1];for(;(s===" "||s===" "||s===`
94
+ `)&&(n+=s>i?t.slice(i,s+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Gu(t,e){let n="",s=t[e+1];for(;(s===" "||s===" "||s===`
95
95
  `||s==="\r")&&!(s==="\r"&&t[e+2]!==`
96
96
  `);)s===`
97
97
  `&&(n+=`
98
- `),e+=1,s=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Ju={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Wu(t,e,n,s){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Qo.resolveFlowScalar=Ku});var ta=O(ea=>{"use strict";var Oe=M(),Zo=j(),Gu=lr(),Xu=fr();function Hu(t,e,n,s){let{value:r,type:i,comment:o,range:a}=e.type==="block-scalar"?Gu.resolveBlockScalar(t,e,s):Xu.resolveFlowScalar(e,t.options.strict,s),l=n?t.directives.tagName(n.source,u=>s(n,"TAG_RESOLVE_FAILED",u)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[Oe.SCALAR]:l?c=Qu(t.schema,r,l,n,s):e.type==="scalar"?c=Zu(t,r,e,s):c=t.schema[Oe.SCALAR];let p;try{let u=c.resolve(r,f=>s(n??e,"TAG_RESOLVE_FAILED",f),t.options);p=Oe.isScalar(u)?u:new Zo.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);s(n??e,"TAG_RESOLVE_FAILED",f),p=new Zo.Scalar(r)}return p.range=a,p.source=r,i&&(p.type=i),l&&(p.tag=l),c.format&&(p.format=c.format),o&&(p.comment=o),p}function Qu(t,e,n,s,r){if(n==="!")return t[Oe.SCALAR];let i=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Oe.SCALAR])}function Zu({atKey:t,directives:e,schema:n},s,r,i){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(s))||n[Oe.SCALAR];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(s))??n[Oe.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return o}ea.composeScalar=Hu});var sa=O(na=>{"use strict";function ed(t,e,n){if(e){n??(n=e.length);for(let s=n-1;s>=0;--s){let r=e[s];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++s];r?.type==="space";)t+=r.source.length,r=e[++s];break}}return t}na.emptyScalarPosition=ed});var oa=O(dr=>{"use strict";var td=We(),nd=M(),sd=Go(),ra=ta(),rd=_e(),id=sa(),od={composeNode:ia,composeEmptyNode:ur};function ia(t,e,n,s){let r=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=n,c,p=!0;switch(e.type){case"alias":c=ad(t,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=ra.composeScalar(t,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=sd.composeCollection(od,t,e,n,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),p=!1}}return c??(c=ur(t,e.offset,void 0,null,n,s)),a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!nd.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"),i&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&p&&(c.srcToken=e),c}function ur(t,e,n,s,{spaceBefore:r,comment:i,anchor:o,tag:a,end:l},c){let p={type:"scalar",offset:id.emptyScalarPosition(e,n,s),indent:-1,source:""},u=ra.composeScalar(t,p,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),i&&(u.comment=i,u.range[2]=l),u}function ad({options:t},{offset:e,source:n,end:s},r){let i=new td.Alias(n.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=rd.resolveEnd(s,o,t.strict,r);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}dr.composeEmptyNode=ur;dr.composeNode=ia});var ca=O(la=>{"use strict";var ld=ft(),aa=oa(),cd=_e(),fd=ht();function ud(t,e,{offset:n,start:s,value:r,end:i},o){let a=Object.assign({_directives:e},t),l=new ld.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=fd.resolveProps(s,{indicator:"doc-start",next:r??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?aa.composeNode(c,r,p,o):aa.composeEmptyNode(c,p.end,s,null,p,o);let u=l.contents.range[2],f=cd.resolveEnd(i,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[n,u,f.offset],l}la.composeDoc=ud});var hr=O(da=>{"use strict";var dd=xt("process"),pd=Zn(),hd=ft(),mt=pt(),fa=M(),md=ca(),gd=_e();function gt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function ua(t){let e="",n=!1,s=!1;for(let r=0;r<t.length;++r){let i=t[r];switch(i[0]){case"#":e+=(e===""?"":s?`
98
+ `),e+=1,s=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Xu={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Hu(t,e,n,s){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Zo.resolveFlowScalar=zu});var na=N(ta=>{"use strict";var Oe=M(),ea=j(),Qu=fr(),Zu=dr();function ed(t,e,n,s){let{value:r,type:i,comment:o,range:a}=e.type==="block-scalar"?Qu.resolveBlockScalar(t,e,s):Zu.resolveFlowScalar(e,t.options.strict,s),l=n?t.directives.tagName(n.source,f=>s(n,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[Oe.SCALAR]:l?c=td(t.schema,r,l,n,s):e.type==="scalar"?c=nd(t,r,e,s):c=t.schema[Oe.SCALAR];let d;try{let f=c.resolve(r,u=>s(n??e,"TAG_RESOLVE_FAILED",u),t.options);d=Oe.isScalar(f)?f:new ea.Scalar(f)}catch(f){let u=f instanceof Error?f.message:String(f);s(n??e,"TAG_RESOLVE_FAILED",u),d=new ea.Scalar(r)}return d.range=a,d.source=r,i&&(d.type=i),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function td(t,e,n,s,r){if(n==="!")return t[Oe.SCALAR];let i=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Oe.SCALAR])}function nd({atKey:t,directives:e,schema:n},s,r,i){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(s))||n[Oe.SCALAR];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(s))??n[Oe.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;i(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}ta.composeScalar=ed});var ra=N(sa=>{"use strict";function sd(t,e,n){if(e){n??(n=e.length);for(let s=n-1;s>=0;--s){let r=e[s];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++s];r?.type==="space";)t+=r.source.length,r=e[++s];break}}return t}sa.emptyScalarPosition=sd});var aa=N(hr=>{"use strict";var rd=Je(),id=M(),od=Xo(),ia=na(),ad=_e(),ld=ra(),cd={composeNode:oa,composeEmptyNode:pr};function oa(t,e,n,s){let r=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=n,c,d=!0;switch(e.type){case"alias":c=fd(t,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=ia.composeScalar(t,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,t,e,n,s),a&&(c.anchor=a.source.substring(1))}catch(f){let u=f instanceof Error?f.message:String(f);s(e,"RESOURCE_EXHAUSTION",u)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),d=!1}}return c??(c=pr(t,e.offset,void 0,null,n,s)),a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!id.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"),i&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&d&&(c.srcToken=e),c}function pr(t,e,n,s,{spaceBefore:r,comment:i,anchor:o,tag:a,end:l},c){let d={type:"scalar",offset:ld.emptyScalarPosition(e,n,s),indent:-1,source:""},f=ia.composeScalar(t,d,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function fd({options:t},{offset:e,source:n,end:s},r){let i=new rd.Alias(n.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=ad.resolveEnd(s,o,t.strict,r);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}hr.composeEmptyNode=pr;hr.composeNode=oa});var fa=N(ca=>{"use strict";var ud=ft(),la=aa(),dd=_e(),pd=ht();function hd(t,e,{offset:n,start:s,value:r,end:i},o){let a=Object.assign({_directives:e},t),l=new ud.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=pd.resolveProps(s,{indicator:"doc-start",next:r??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?la.composeNode(c,r,d,o):la.composeEmptyNode(c,d.end,s,null,d,o);let f=l.contents.range[2],u=dd.resolveEnd(i,f,!1,o);return u.comment&&(l.comment=u.comment),l.range=[n,f,u.offset],l}ca.composeDoc=hd});var gr=N(pa=>{"use strict";var md=Dt("process"),gd=ts(),yd=ft(),mt=pt(),ua=M(),bd=fa(),wd=_e();function gt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function da(t){let e="",n=!1,s=!1;for(let r=0;r<t.length;++r){let i=t[r];switch(i[0]){case"#":e+=(e===""?"":s?`
100
100
 
101
101
  `:`
102
- `)+(i.substring(1)||" "),n=!0,s=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:e,afterEmptyLine:s}}var pr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,i)=>{let o=gt(n);i?this.warnings.push(new mt.YAMLWarning(o,s,r)):this.errors.push(new mt.YAMLParseError(o,s,r))},this.directives=new pd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:s,afterEmptyLine:r}=ua(this.prelude);if(s){let i=e.contents;if(n)e.comment=e.comment?`${e.comment}
103
- ${s}`:s;else if(r||e.directives.docStart||!i)e.commentBefore=s;else if(fa.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];fa.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${s}
102
+ `)+(i.substring(1)||" "),n=!0,s=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:e,afterEmptyLine:s}}var mr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,i)=>{let o=gt(n);i?this.warnings.push(new mt.YAMLWarning(o,s,r)):this.errors.push(new mt.YAMLParseError(o,s,r))},this.directives=new gd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:s,afterEmptyLine:r}=da(this.prelude);if(s){let i=e.contents;if(n)e.comment=e.comment?`${e.comment}
103
+ ${s}`:s;else if(r||e.directives.docStart||!i)e.commentBefore=s;else if(ua.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];ua.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${s}
104
104
  ${a}`:s}else{let o=i.commentBefore;i.commentBefore=o?`${s}
105
- ${o}`:s}}if(n){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:ua(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,s=-1){for(let r of e)yield*this.next(r);yield*this.end(n,s)}*next(e){switch(dd.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,s,r)=>{let i=gt(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=md.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",n);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 mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let n=gd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
106
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-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),r=new hd.Document(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};da.Composer=pr});var ma=O(On=>{"use strict";var yd=lr(),bd=fr(),wd=pt(),pa=Ze();function kd(t,e=!0,n){if(t){let s=(r,i,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,i,o);else throw new wd.YAMLParseError([a,a+1],i,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return bd.resolveFlowScalar(t,e,s);case"block-scalar":return yd.resolveBlockScalar({options:{strict:e}},t,s)}}return null}function Sd(t,e){let{implicitKey:n=!1,indent:s,inFlow:r=!1,offset:i=-1,type:o="PLAIN"}=e,a=pa.stringifyString({type:o,value:t},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:s,source:`
105
+ ${o}`:s}}if(n){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:da(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,s=-1){for(let r of e)yield*this.next(r);yield*this.end(n,s)}*next(e){switch(md.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,s,r)=>{let i=gt(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=bd.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",n);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 mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let n=wd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
106
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-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),r=new yd.Document(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};pa.Composer=mr});var ga=N(Cn=>{"use strict";var kd=fr(),Sd=dr(),vd=pt(),ha=Ze();function $d(t,e=!0,n){if(t){let s=(r,i,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,i,o);else throw new vd.YAMLParseError([a,a+1],i,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Sd.resolveFlowScalar(t,e,s);case"block-scalar":return kd.resolveBlockScalar({options:{strict:e}},t,s)}}return null}function Ad(t,e){let{implicitKey:n=!1,indent:s,inFlow:r=!1,offset:i=-1,type:o="PLAIN"}=e,a=ha.stringifyString({type:o,value:t},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:s,source:`
107
107
  `}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
108
- `),p=a.substring(0,c),u=a.substring(c+1)+`
109
- `,f=[{type:"block-scalar-header",offset:i,indent:s,source:p}];return ha(f,l)||f.push({type:"newline",offset:-1,indent:s,source:`
110
- `}),{type:"block-scalar",offset:i,indent:s,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:i,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:s,source:a,end:l};default:return{type:"scalar",offset:i,indent:s,source:a,end:l}}}function vd(t,e,n={}){let{afterKey:s=!1,implicitKey:r=!1,inFlow:i=!1,type:o}=n,a="indent"in t?t.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.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=pa.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":$d(t,l);break;case'"':mr(t,l,"double-quoted-scalar");break;case"'":mr(t,l,"single-quoted-scalar");break;default:mr(t,l,"scalar")}}function $d(t,e){let n=e.indexOf(`
108
+ `),d=a.substring(0,c),f=a.substring(c+1)+`
109
+ `,u=[{type:"block-scalar-header",offset:i,indent:s,source:d}];return ma(u,l)||u.push({type:"newline",offset:-1,indent:s,source:`
110
+ `}),{type:"block-scalar",offset:i,indent:s,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:s,source:a,end:l};default:return{type:"scalar",offset:i,indent:s,source:a,end:l}}}function Od(t,e,n={}){let{afterKey:s=!1,implicitKey:r=!1,inFlow:i=!1,type:o}=n,a="indent"in t?t.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.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=ha.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Nd(t,l);break;case'"':yr(t,l,"double-quoted-scalar");break;case"'":yr(t,l,"single-quoted-scalar");break;default:yr(t,l,"scalar")}}function Nd(t,e){let n=e.indexOf(`
111
111
  `),s=e.substring(0,n),r=e.substring(n+1)+`
112
- `;if(t.type==="block-scalar"){let i=t.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=s,t.source=r}else{let{offset:i}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:s}];ha(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
113
- `});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:r})}}function ha(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function mr(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let s=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let i of s)i.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:s});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
114
- `};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let s="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(t))i!=="type"&&i!=="offset"&&delete t[i];Object.assign(t,{type:n,indent:s,source:e,end:r})}}}On.createScalarToken=Sd;On.resolveAsScalar=kd;On.setScalarValue=vd});var ya=O(ga=>{"use strict";var Ad=t=>"type"in t?En(t):Nn(t);function En(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=En(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=Nn(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=Nn(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=Nn(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function Nn({start:t,key:e,sep:n,value:s}){let r="";for(let i of t)r+=i.source;if(e&&(r+=En(e)),n)for(let i of n)r+=i.source;return s&&(r+=En(s)),r}ga.stringify=Ad});var Sa=O(ka=>{"use strict";var gr=Symbol("break visit"),Od=Symbol("skip children"),ba=Symbol("remove item");function Ne(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),wa(Object.freeze([]),t,e)}Ne.BREAK=gr;Ne.SKIP=Od;Ne.REMOVE=ba;Ne.itemAtPath=(t,e)=>{let n=t;for(let[s,r]of e){let i=n?.[s];if(i&&"items"in i)n=i.items[r];else return}return n};Ne.parentCollection=(t,e)=>{let n=Ne.itemAtPath(t,e.slice(0,-1)),s=e[e.length-1][0],r=n?.[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function wa(t,e,n){let s=n(e,t);if(typeof s=="symbol")return s;for(let r of["key","value"]){let i=e[r];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=wa(Object.freeze(t.concat([[r,o]])),i.items[o],n);if(typeof a=="number")o=a-1;else{if(a===gr)return gr;a===ba&&(i.items.splice(o,1),o-=1)}}typeof s=="function"&&r==="key"&&(s=s(e,t))}}return typeof s=="function"?s(e,t):s}ka.visit=Ne});var Cn=O(H=>{"use strict";var yr=ma(),Nd=ya(),Ed=Sa(),br="\uFEFF",wr="",kr="",Sr="",Cd=t=>!!t&&"items"in t,qd=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Td(t){switch(t){case br:return"<BOM>";case wr:return"<DOC>";case kr:return"<FLOW_END>";case Sr:return"<SCALAR>";default:return JSON.stringify(t)}}function Pd(t){switch(t){case br:return"byte-order-mark";case wr:return"doc-mode";case kr:return"flow-error-end";case Sr:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
112
+ `;if(t.type==="block-scalar"){let i=t.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=s,t.source=r}else{let{offset:i}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:s}];ma(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
113
+ `});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:r})}}function ma(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function yr(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let s=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let i of s)i.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:s});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
114
+ `};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let s="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(t))i!=="type"&&i!=="offset"&&delete t[i];Object.assign(t,{type:n,indent:s,source:e,end:r})}}}Cn.createScalarToken=Ad;Cn.resolveAsScalar=$d;Cn.setScalarValue=Od});var ba=N(ya=>{"use strict";var Ed=t=>"type"in t?Tn(t):qn(t);function Tn(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=Tn(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=qn(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=qn(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=qn(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function qn({start:t,key:e,sep:n,value:s}){let r="";for(let i of t)r+=i.source;if(e&&(r+=Tn(e)),n)for(let i of n)r+=i.source;return s&&(r+=Tn(s)),r}ya.stringify=Ed});var va=N(Sa=>{"use strict";var br=Symbol("break visit"),Cd=Symbol("skip children"),wa=Symbol("remove item");function Ne(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),ka(Object.freeze([]),t,e)}Ne.BREAK=br;Ne.SKIP=Cd;Ne.REMOVE=wa;Ne.itemAtPath=(t,e)=>{let n=t;for(let[s,r]of e){let i=n?.[s];if(i&&"items"in i)n=i.items[r];else return}return n};Ne.parentCollection=(t,e)=>{let n=Ne.itemAtPath(t,e.slice(0,-1)),s=e[e.length-1][0],r=n?.[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function ka(t,e,n){let s=n(e,t);if(typeof s=="symbol")return s;for(let r of["key","value"]){let i=e[r];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=ka(Object.freeze(t.concat([[r,o]])),i.items[o],n);if(typeof a=="number")o=a-1;else{if(a===br)return br;a===wa&&(i.items.splice(o,1),o-=1)}}typeof s=="function"&&r==="key"&&(s=s(e,t))}}return typeof s=="function"?s(e,t):s}Sa.visit=Ne});var Pn=N(H=>{"use strict";var wr=ga(),qd=ba(),Td=va(),kr="\uFEFF",Sr="",vr="",$r="",Pd=t=>!!t&&"items"in t,Ld=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function xd(t){switch(t){case kr:return"<BOM>";case Sr:return"<DOC>";case vr:return"<FLOW_END>";case $r:return"<SCALAR>";default:return JSON.stringify(t)}}function Md(t){switch(t){case kr:return"byte-order-mark";case Sr:return"doc-mode";case vr:return"flow-error-end";case $r:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
115
  `:case`\r
116
- `: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(t[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}H.createScalarToken=yr.createScalarToken;H.resolveAsScalar=yr.resolveAsScalar;H.setScalarValue=yr.setScalarValue;H.stringify=Nd.stringify;H.visit=Ed.visit;H.BOM=br;H.DOCUMENT=wr;H.FLOW_END=kr;H.SCALAR=Sr;H.isCollection=Cd;H.isScalar=qd;H.prettyToken=Td;H.tokenType=Pd});var Ar=O($a=>{"use strict";var yt=Cn();function se(t){switch(t){case void 0:case" ":case`
117
- `:case"\r":case" ":return!0;default:return!1}}var va=new Set("0123456789ABCDEFabcdef"),Ld=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qn=new Set(",[]{}"),xd=new Set(` ,[]{}
118
- \r `),vr=t=>!t||xd.has(t),$r=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,n=!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=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
116
+ `: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(t[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}H.createScalarToken=wr.createScalarToken;H.resolveAsScalar=wr.resolveAsScalar;H.setScalarValue=wr.setScalarValue;H.stringify=qd.stringify;H.visit=Td.visit;H.BOM=kr;H.DOCUMENT=Sr;H.FLOW_END=vr;H.SCALAR=$r;H.isCollection=Pd;H.isScalar=Ld;H.prettyToken=xd;H.tokenType=Md});var Nr=N(Aa=>{"use strict";var yt=Pn();function se(t){switch(t){case void 0:case" ":case`
117
+ `:case"\r":case" ":return!0;default:return!1}}var $a=new Set("0123456789ABCDEFabcdef"),Id=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ln=new Set(",[]{}"),Dd=new Set(` ,[]{}
118
+ \r `),Ar=t=>!t||Dd.has(t),Or=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,n=!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=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
119
119
  `?!0:n==="\r"?this.buffer[e+1]===`
120
120
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+e];if(n==="\r"){let r=this.buffer[s+e+1];if(r===`
121
121
  `||!r&&!this.atEnd)return e+s+1}return n===`
122
122
  `||s>=this.indentNext||!n&&!this.atEnd?e+s:-1}if(n==="-"||n==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&se(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(`
123
- `,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]===yt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,s=e.indexOf("#");for(;s!==-1;){let i=e[s-1];if(i===" "||i===" "){n=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let i=e[n-1];if(i===" "||i===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield yt.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 n=this.peek(3);if((n==="---"||n==="...")&&se(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!se(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&se(n)){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 n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(vr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,s=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&se(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield yt.FLOW_END,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"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(vr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||se(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),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}let s=this.buffer.substring(0,n),r=s.indexOf(`
123
+ `,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]===yt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,s=e.indexOf("#");for(;s!==-1;){let i=e[s-1];if(i===" "||i===" "){n=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let i=e[n-1];if(i===" "||i===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield yt.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 n=this.peek(3);if((n==="---"||n==="...")&&se(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!se(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&se(n)){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 n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(Ar),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,s=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&se(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield yt.FLOW_END,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"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(Ar),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||se(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),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}let s=this.buffer.substring(0,n),r=s.indexOf(`
124
124
  `,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
125
125
  `,i)}r!==-1&&(n=r-(s[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>se(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":n+=1;break;case`
126
126
  `:e=i,n=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
127
127
  `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
128
128
  `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
129
129
  `;)s=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
130
- `&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield yt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){let i=this.buffer[s+1];if(se(i)||e&&qn.has(i))break;n=s}else if(se(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
130
+ `&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield yt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){let i=this.buffer[s+1];if(se(i)||e&&Ln.has(i))break;n=s}else if(se(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
131
131
  `?(s+=1,r=`
132
- `,i=this.buffer[s+1]):n=s),i==="#"||e&&qn.has(i))break;if(r===`
133
- `){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&qn.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield yt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(n&&(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(vr),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,s=this.charAt(1);if(se(s)||n&&qn.has(s)){n?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,n=this.buffer[e];for(;!se(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Ld.has(n))n=this.buffer[++e];else if(n==="%"&&va.has(this.buffer[e+1])&&va.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
132
+ `,i=this.buffer[s+1]):n=s),i==="#"||e&&Ln.has(i))break;if(r===`
133
+ `){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Ln.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield yt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(n&&(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(Ar),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,s=this.charAt(1);if(se(s)||n&&Ln.has(s)){n?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,n=this.buffer[e];for(;!se(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Id.has(n))n=this.buffer[++e];else if(n==="%"&&$a.has(this.buffer[e+1])&&$a.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
134
134
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
135
- `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||e&&s===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,s=this.buffer[n];for(;!e(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};$a.Lexer=$r});var Nr=O(Aa=>{"use strict";var Or=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,s=this.lineStarts.length;for(;n<s;){let i=n+s>>1;this.lineStarts[i]<e?n=i+1:s=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};Aa.LineCounter=Or});var Cr=O(qa=>{"use strict";var Md=xt("process"),Oa=Cn(),Id=Ar();function be(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Na(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Ca(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Tn(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Fe(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Pn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function Ea(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!be(e.start,"explicit-key-ind")&&!be(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Ca(e.value)?e.value.end?Pn(e.value.end,e.sep):e.value.end=e.sep:Pn(e.start,e.sep),delete e.sep)}var Er=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 Id.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(e,n))yield*this.next(s);n||(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 n=Oa.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){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 n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ea(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{let r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Na(r.start)===-1&&(n.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.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":{Na(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 n=this.startBlockValue(e);n?this.stack.push(n):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 n=Tn(this.peek(2)),s=Fe(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
135
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||e&&s===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,s=this.buffer[n];for(;!e(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Aa.Lexer=Or});var Cr=N(Oa=>{"use strict";var Er=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,s=this.lineStarts.length;for(;n<s;){let i=n+s>>1;this.lineStarts[i]<e?n=i+1:s=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};Oa.LineCounter=Er});var Tr=N(Ta=>{"use strict";var Rd=Dt("process"),Na=Pn(),_d=Nr();function be(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Ea(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function qa(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function xn(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Fe(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Mn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function Ca(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!be(e.start,"explicit-key-ind")&&!be(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,qa(e.value)?e.value.end?Mn(e.value.end,e.sep):e.value.end=e.sep:Mn(e.start,e.sep),delete e.sep)}var qr=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 _d.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(e,n))yield*this.next(s);n||(yield*this.end())}*next(e){if(this.source=e,Rd.env.LOG_TOKENS&&console.log("|",Na.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Na.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){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 n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ca(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{let r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Ea(r.start)===-1&&(n.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.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":{Ea(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 n=this.startBlockValue(e);n?this.stack.push(n):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 n=xn(this.peek(2)),s=Fe(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
136
136
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
137
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let s="end"in n.value?n.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 n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Pn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,r=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let l=n.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&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(i.push(this.sourceToken),e.items.push({start:i,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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(be(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Ca(n.key)&&!be(n.sep,"newline")){let o=Fe(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(be(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Fe(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):be(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{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);r||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!be(n.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:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let s="end"in n.value?n.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 n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Pn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||be(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.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 n=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":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,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 r=Tn(s),i=Fe(r);Ea(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:i,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 n=this.source.indexOf(`
137
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let s="end"in n.value?n.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 n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Mn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,r=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let l=n.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&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(i.push(this.sourceToken),e.items.push({start:i,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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(be(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(qa(n.key)&&!be(n.sep,"newline")){let o=Fe(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(be(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Fe(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):be(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{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);r||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!be(n.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:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let s="end"in n.value?n.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 n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Mn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||be(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.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 n=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":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,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 r=xn(s),i=Fe(r);Ca(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:i,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 n=this.source.indexOf(`
138
138
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
139
- `,n)+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 n=Tn(e),s=Fe(n);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 n=Tn(e),s=Fe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!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;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};qa.Parser=Er});var Ma=O(wt=>{"use strict";var Ta=hr(),Dd=ft(),bt=pt(),Rd=ds(),_d=M(),Fd=Nr(),Pa=Cr();function La(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Fd.LineCounter||null,prettyErrors:e}}function jd(t,e={}){let{lineCounter:n,prettyErrors:s}=La(e),r=new Pa.Parser(n?.addNewLine),i=new Ta.Composer(e),o=Array.from(i.compose(r.parse(t)));if(s&&n)for(let a of o)a.errors.forEach(bt.prettifyError(t,n)),a.warnings.forEach(bt.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function xa(t,e={}){let{lineCounter:n,prettyErrors:s}=La(e),r=new Pa.Parser(n?.addNewLine),i=new Ta.Composer(e),o=null;for(let a of i.compose(r.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new bt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(bt.prettifyError(t,n)),o.warnings.forEach(bt.prettifyError(t,n))),o}function Bd(t,e,n){let s;typeof e=="function"?s=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=xa(t,n);if(!r)return null;if(r.warnings.forEach(i=>Rd.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function Kd(t,e,n){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return _d.isDocument(t)&&!s?t.toString(n):new Dd.Document(t,s,n).toString(n)}wt.parse=Bd;wt.parseAllDocuments=jd;wt.parseDocument=xa;wt.stringify=Kd});var xn=O(I=>{"use strict";var Ud=hr(),Yd=ft(),zd=Ws(),qr=pt(),Vd=We(),we=M(),Jd=he(),Wd=j(),Gd=ge(),Xd=ye(),Hd=Cn(),Qd=Ar(),Zd=Nr(),ep=Cr(),Ln=Ma(),Ia=Ye();I.Composer=Ud.Composer;I.Document=Yd.Document;I.Schema=zd.Schema;I.YAMLError=qr.YAMLError;I.YAMLParseError=qr.YAMLParseError;I.YAMLWarning=qr.YAMLWarning;I.Alias=Vd.Alias;I.isAlias=we.isAlias;I.isCollection=we.isCollection;I.isDocument=we.isDocument;I.isMap=we.isMap;I.isNode=we.isNode;I.isPair=we.isPair;I.isScalar=we.isScalar;I.isSeq=we.isSeq;I.Pair=Jd.Pair;I.Scalar=Wd.Scalar;I.YAMLMap=Gd.YAMLMap;I.YAMLSeq=Xd.YAMLSeq;I.CST=Hd;I.Lexer=Qd.Lexer;I.LineCounter=Zd.LineCounter;I.Parser=ep.Parser;I.parse=Ln.parse;I.parseAllDocuments=Ln.parseAllDocuments;I.parseDocument=Ln.parseDocument;I.stringify=Ln.stringify;I.visit=Ia.visit;I.visitAsync=Ia.visitAsync});import{readdirSync as vl,readFileSync as $l}from"node:fs";import{basename as Al,join as Gn}from"node:path";var Ol=/^agent\.mcs\.ya?ml$/,Nl=/\.ya?ml$/,Yr=t=>vl(t,{withFileTypes:!0}).filter(e=>!e.name.startsWith(".")&&e.name!=="node_modules");function zr(t,e=""){return Yr(t).flatMap(n=>{let s=e?`${e}/${n.name}`:n.name;return n.isDirectory()?zr(Gn(t,n.name),s):n.isFile()?[{path:s,text:Nl.test(n.name)?$l(Gn(t,n.name),"utf8"):""}]:[]})}function Vr(t){let e=Yr(t);return e.some(n=>n.isFile()&&Ol.test(n.name))?[{id:Al(t),dir:t,files:zr(t)}]:e.filter(n=>n.isDirectory()).flatMap(n=>Vr(Gn(t,n.name)))}var re=Wn(xn()),Y=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,_=t=>typeof t=="string"&&t.trim()?t:void 0,Tr=t=>Array.isArray(t)?t:[];function tp(t){if(!t.trim())return"empty";let e=new re.LineCounter,n=(0,re.parseDocument)(t,{lineCounter:e,uniqueKeys:!1});if(n.errors.length)return"yaml";let s=new WeakMap,r=o=>{if((0,re.isMap)(o)){let a={};o.range&&s.set(a,o.range[0]);for(let l of o.items)a[String((0,re.isScalar)(l.key)?l.key.value:l.key)]=r(l.value);return a}return(0,re.isSeq)(o)?o.items.map(r):(0,re.isScalar)(o)?o.value:o},i=r(n.contents);return i==null?"empty":{data:i,lineOf:o=>o&&typeof o=="object"&&s.has(o)?e.linePos(s.get(o)).line:void 0}}function*St(t){if(Array.isArray(t))for(let n of t)yield*St(n);let e=Y(t);if(e){typeof e.kind=="string"&&(yield e);for(let n of Object.values(e))yield*St(n)}}var kt=t=>t.split(".")[1]??t,Pr=(t,e)=>t.slice(t.lastIndexOf(e)+(t.includes(e)?e.length:0)),np=new Set(["LogCustomTelemetryEvent","CSATQuestion","SearchAndSummarizeContent","SearchKnowledgeSources"]);function sp(t,e,n){let s={id:t,facts:{},children:[],unknown:[]},r=[];for(let i of[...e].sort((o,a)=>o.path.localeCompare(a.path))){if(!/\.ya?ml$/.test(i.path)){s.unknown.push({file:i.path,why:"file"});continue}let o=tp(i.text);if(o==="yaml"||o==="empty"){s.unknown.push({file:i.path,why:o});continue}let a=Y(o.data),l=/^agents\/([^/]+)\//.exec(i.path)?.[1],c=s.facts;if(l){let d=s.children.find(h=>h.name===l);d||s.children.push(d={name:l,facts:{}}),c=d.facts}let p=(d,h,g=c)=>(g[d]??=[]).push({file:i.path,line:o.lineOf(h??a)});if(l&&p(`child:${l}`,a,s.facts),!l&&/^settings\.mcs\.ya?ml$/.test(i.path)&&a){s.schemaName=_(a.schemaName)??s.schemaName,s.displayName=_(a.displayName)??s.displayName,_(a.authenticationMode)&&p(`auth:${a.authenticationMode}`);let d=Y(a.configuration),h=Y(d?.settings)?.GenerativeActionsEnabled;typeof h=="boolean"&&p(`setting:generative=${h?"on":"off"}`,d),d?.isAgentConnectable===!0&&p("setting:connectable",d);continue}let u=n?[...St(a)].map(d=>d.kind).find(d=>!n.has(d)):void 0;if(u&&s.unknown.push({file:i.path,why:"kind",kind:u}),typeof a?.kind!="string"){u||s.unknown.push({file:i.path,why:"kind"});continue}let f=i.text,m=(d,h)=>{_(d)&&(p("instructions:present",h),/\b(Today|Now)\(\)/.test(d)&&p("ms:date-context",h))};switch(a.kind){case"GptComponentMetadata":{s.displayName??=_(a.displayName),m(a.instructions,a);let d=Y(Y(a.aISettings)?.model);_(d?.modelNameHint)&&p(`model:${d.modelNameHint}`,d);break}case"AgentDialog":{let d=Y(a.beginDialog);_(d?.kind)&&p(`trigger:${d.kind}`,d),m(Y(a.settings)?.instructions,a.settings);break}case"AdaptiveDialog":{let d=Y(a.beginDialog),h=_(d?.kind);h&&p(`trigger:${h}`,d),_(a.modelDescription)&&p("topics:with-model-description");let g=Tr(a.inputs).some(k=>Y(k)?.kind==="AutomaticTaskInput"&&Y(k)?.shouldPromptUser===!1);h==="OnRecognizedIntent"&&g&&p("ms:orchestrator-variables",d),h==="OnError"&&f.includes("System.Error.SubCode")&&p("ms:rai-error-handling",d),h==="OnKnowledgeRequested"&&[...St(d)].some(k=>k.kind==="SendActivity")&&p("ms:knowledge-hold-message",d),h==="OnGeneratedResponse"&&f.includes("System.ContinueResponse")&&p("ms:prevent-tool-call-leaks",d);break}case"TaskDialog":{let d=Y(a.action),h=_(d?.connectionReference);d?.kind==="InvokeConnectorTaskAction"&&h&&(p(`connector:${kt(h)}`,d),_(d.operationId)&&p(`operation:${kt(h)}/${d.operationId}`,d)),d?.kind==="InvokeExternalAgentTaskAction"&&Y(d.operationDetails)?.kind==="ModelContextProtocolMetadata"&&h&&p(`mcp:${kt(h)}`,d),d?.kind==="InvokeConnectedAgentTaskAction"&&_(d.botSchemaName)&&p(`calls:${d.botSchemaName}`,d),d?.kind==="InvokeFlowTaskAction"&&_(d.flowId)&&p(`flow:${d.flowId}`,d);break}case"KnowledgeSourceConfiguration":{let d=Y(a.source);_(d?.kind)&&p(`knowledge:${d.kind}`,d),d&&"triggerCondition"in d&&p("yaml-only:triggerCondition",d),r.push({file:i.path,line:o.lineOf(a)});break}case"GlobalVariableComponent":{let d=Y(a.variable)??a,h=_(d.name)??(_(a.schemaName)?Pr(a.schemaName,"."):void 0);if(!h)break;p(`var:${h}`),d.isExternalInitializationAllowed===!0&&p(`var-in:${h}`);break}case"ConnectionReferencesSourceFile":for(let d of Tr(a.connectionReferences).map(Y)){let h=_(d?.connectorId)?Pr(d.connectorId,"/"):_(d?.connectionReferenceLogicalName)?kt(d.connectionReferenceLogicalName):void 0;h&&p(`connref:${h}`,d)}break}for(let d of St(a)){if(np.has(d.kind)&&p(`node:${d.kind}`,d),d.kind==="InvokeConnectorAction"&&_(d.connectionReference)){let g=kt(d.connectionReference);p(`connector:${g}`,d),_(d.operationId)&&p(`operation:${g}/${d.operationId}`,d)}if(d.kind==="InvokeFlowAction"&&_(d.flowId)&&p(`flow:${d.flowId}`,d),(d.kind==="BeginDialog"||d.kind==="ReplaceDialog")&&_(d.dialog)){let g=d.dialog;g.startsWith("=")?g.includes("Switch(")&&p("ms:dynamic-topic-redirect",d):p(`calls:topic:${Pr(g,".topic.")}`,d)}let h=g=>typeof g=="string"&&g.includes("System.Activity.ChannelId");(d.kind==="ConditionGroup"&&Tr(d.conditions).some(g=>h(Y(g)?.condition))||d.kind==="SetVariable"&&h(d.value))&&p("ms:channel-aware-behavior",d),(d.kind==="SendActivity"||d.kind==="Question")&&JSON.stringify(d).includes("<br")&&p("ms:line-breaks-in-messages",d)}}r.length&&(s.facts[`knowledge:count=${r.length}`]=r);for(let i of[s.facts,...s.children.map(o=>o.facts)])for(let[o,a]of Object.entries(i))i[o]=a.filter((l,c)=>a.findIndex(p=>p.file===l.file&&p.line===l.line)===c);return s}function rp(t){let e=new Set,n=r=>{if(!r||typeof r!="object")return;let{const:i,enum:o}=r;if(typeof i=="string"&&e.add(i),Array.isArray(o))for(let a of o)typeof a=="string"&&e.add(a)},s=r=>{if(Array.isArray(r))return r.forEach(s);if(!r||typeof r!="object")return;let i=r;n(i.kind),n(i.properties?.kind);for(let o of Object.values(i))s(o)};for(let r of Object.values(t.definitions??{}))s(r);return e}var je=Wn(xn(),1);function Mn(t,e){let n=new je.LineCounter,s=(0,je.parseDocument)(t,{lineCounter:n,prettyErrors:!1}),r=o=>{for(let a=o;a.length;a=a.slice(0,-1)){let l=s.getIn(a,!0);if(l?.range)return n.linePos(l.range[0]).line}return 1};if(s.errors.length)return{ok:!1,problem:{line:n.linePos(s.errors[0].pos[0]).line,key:"syntax",detail:s.errors[0].code}};let i=s.toJS();return!i||typeof i!="object"||Array.isArray(i)||i.format!==e||!(0,je.isMap)(s.contents)?{ok:!1,problem:{line:r(["format"]),key:"format"}}:{ok:!0,format:{raw:i,doc:s,at:r,lineOf:o=>n.linePos(o).line}}}var Da="cast-list/profile-v1",Ir=["orchestrator","specialist"],Mr={roles:{},threshold:.7,minAgents:3,rules:[],focusAreas:[],ignore:[],microsoftPatterns:!0},ip=["format","name","roles","threshold","min_agents","rules","focus_areas","ignore","microsoft_patterns"],Lr=t=>!!t&&typeof t=="object"&&!Array.isArray(t),z=t=>typeof t=="string"?t.trim():typeof t=="number"?String(t):"",xr=t=>Array.isArray(t)?t.map(z).filter(Boolean):z(t)?[z(t)]:[],Ra=t=>Ir.includes(t);function op(t){let e=Mn(t,Da);if(!e.ok)return{problems:[e.problem.key==="format"?{...e.problem,format:Da}:e.problem]};let{raw:n,at:s}=e.format,r=[];for(let k of Object.keys(n))ip.includes(k)||r.push({line:s([k]),key:"unknownKey",what:k});let i=(k,$,E)=>(z(k)||r.push({line:s(E),key:"missing",what:$}),z(k)),o=(k,$)=>{let E=new Set;$.forEach((y,S)=>{y&&E.has(y)&&r.push({line:s([k,S]),key:"duplicate",what:k,id:y}),E.add(y)})},a=k=>Array.isArray(n[k])?n[k]:[],l=n.threshold===void 0?Mr.threshold:Number(n.threshold);l>0&&l<=1||r.push({line:s(["threshold"]),key:"threshold",value:z(n.threshold)});let c=n.min_agents===void 0?Mr.minAgents:Number(n.min_agents);Number.isInteger(c)&&c>=1||r.push({line:s(["min_agents"]),key:"minAgents",value:z(n.min_agents)});let p={},u=Lr(n.roles)?n.roles:{};for(let k of Object.keys(u))Ra(k)?p[k]=z(u[k])==="*"?"*":xr(u[k]):r.push({line:s(["roles",k]),key:"role",what:`roles.${k}`,value:k});let f=(k,$,E)=>(Ra(z(k))||r.push({line:s(E),key:"role",what:$,value:z(k)}),z(k)),m=a("rules").filter(Lr).map((k,$)=>{let E=i(k.has,`rules[${$}].has`,["rules",$]);return{id:i(k.id,`rules[${$}].id`,["rules",$]),role:f(k.role,`rules[${$}].role`,["rules",$,"role"]),has:E,says:z(k.says)||E}});o("rules",m.map(k=>k.id));let d=a("focus_areas").filter(Lr).map((k,$)=>{let E=xr(k.facts);E.length||r.push({line:s(["focus_areas",$]),key:"missing",what:`focus_areas[${$}].facts`});let y=i(k.id,`focus_areas[${$}].id`,["focus_areas",$]);return{id:y,name:z(k.name)||y,facts:E}});o("focus_areas",d.map(k=>k.id));let h=n.microsoft_patterns,g={...z(n.name)?{name:z(n.name)}:{},roles:p,threshold:l,minAgents:c,rules:m,focusAreas:d,ignore:xr(n.ignore),microsoftPatterns:!(h===!1||z(h).toLowerCase()==="off")};return r.length?{problems:r}:{profile:g,problems:r}}var ap=t=>Object.keys(t.facts).some(e=>e.startsWith("calls:")&&!e.startsWith("calls:topic:"));function _a(t,e,n={}){let{orchestrator:s,specialist:r}=e.roles,i=(c,p)=>Array.isArray(c)&&c.includes(p),o=Object.fromEntries(t.map(c=>[c.id,i(s,c.id)?"orchestrator":i(r,c.id)?"specialist":n[c.id]??(s==="*"?"orchestrator":r==="*"?"specialist":ap(c)?"orchestrator":"specialist")])),a=new Set(t.map(c=>c.id)),l=[s,r].flatMap(c=>Array.isArray(c)?c:[]).filter(c=>!a.has(c));return{roles:o,unmatched:l}}var ae=Wn(xn());var vt="cast-list/cast-v1",lp=["accepted","rejected"],cp=["platform","specialist","orchestrator"],fp=["format","name","agents","declared","decisions"],up=t=>!!t&&typeof t=="object"&&!Array.isArray(t),Q=t=>typeof t=="string"?t.trim():typeof t=="number"||typeof t=="boolean"?String(t):"";function dp(t){let e=Mn(t,vt);if(!e.ok)return{problems:[e.problem.key==="format"?{...e.problem,format:vt}:e.problem]};let{raw:n,at:s}=e.format,r=[];for(let u of Object.keys(n))fp.includes(u)||r.push({line:s([u]),key:"unknownKey",what:u});let i=u=>(Array.isArray(n[u])?n[u]:[]).filter(up),o=(u,f,m)=>(Q(u)||r.push({line:s(m),key:"missing",what:f}),Q(u)),a=(u,f)=>{let m=new Set;f.forEach((d,h)=>{d&&m.has(d)&&r.push({line:s([u,h]),key:"duplicate",what:u,id:d}),m.add(d)})},l=i("agents").map((u,f)=>{let m=Q(u.role);return Ir.includes(m)||r.push({line:s(["agents",f,"role"]),key:"role",what:`agents[${f}].role`,value:m}),{id:o(u.id,`agents[${f}].id`,["agents",f]),role:m}});a("agents",l.map(u=>u.id));let c=i("declared").map((u,f)=>({agent:o(u.agent,`declared[${f}].agent`,["declared",f]),key:o(u.key,`declared[${f}].key`,["declared",f]),value:Q(u.value),source:Q(u.source)}));a("declared",c.map(u=>`${u.agent} ${u.key}`));let p=i("decisions").map((u,f)=>{let m=Q(u.status),d=Q(u.scope);return lp.includes(m)||r.push({line:s(["decisions",f,"status"]),key:"status",value:m}),cp.includes(d)||r.push({line:s(["decisions",f,"scope"]),key:"scope",value:d}),{key:o(u.key,`decisions[${f}].key`,["decisions",f]),status:m,scope:d,why:Q(u.why)}});return a("decisions",p.map(u=>u.key)),r.length?{problems:r}:{cast:{...Q(n.name)?{name:Q(n.name)}:{},agents:l,declared:c,decisions:p},problems:r}}var pp=` What people said about the agents, and what was decided. build.mjs keeps it up to date; edit it, or fill the
140
- workbook's \xABDeclared\xBB sheet and the \xABDecision\xBB column and read it back with --from.`,hp={agents:t=>Q(t.id),declared:t=>`${Q(t.agent)} ${Q(t.key)}`,decisions:t=>Q(t.key)},mp=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==""&&e!==void 0));function gp(t,e){let n=e?(0,ae.parseDocument)(e):void 0,s=n&&!n.errors.length&&(0,ae.isMap)(n.contents)?n:new ae.Document({format:vt});s!==n&&(s.commentBefore=pp),s.get("format")!==vt&&s.set("format",vt),t.name===void 0?s.delete("name"):s.get("name")!==t.name&&s.set("name",t.name);for(let[r,i]of Object.entries(hp)){let o=t[r];if(!o.length){s.delete(r);continue}let a=s.get(r,!0);if((0,ae.isSeq)(a)||s.set(r,a=s.createNode([])),!(0,ae.isSeq)(a))continue;let l=new Map(a.items.filter(ae.isMap).map(c=>[i(c.toJSON()),c]));a.items=o.map(c=>{let p=mp(c),u=l.get(i(p));if(!u){let f=s.createNode(p);return f.flow=!0,f}for(let[f,m]of Object.entries(p))u.get(f)!==m&&u.set(f,m);for(let f of Object.keys(u.toJSON()))f in p||u.delete(f);return u})}return s.toString({lineWidth:0,flowCollectionPadding:!0})}function yp(t,e="en"){let n=e==="pt";switch(t.key){case"syntax":return n?`n\xE3o se l\xEA como YAML (${t.detail})`:`does not read as YAML (${t.detail})`;case"format":return n?`\xABformat\xBB precisa ser ${t.format}`:`\xABformat\xBB must be ${t.format}`;case"missing":return n?`falta \xAB${t.what}\xBB`:`\xAB${t.what}\xBB is missing`;case"duplicate":return n?`${t.what}: o id \xAB${t.id}\xBB se repete`:`${t.what}: the id \xAB${t.id}\xBB is repeated`;case"unknownKey":return n?`\xAB${t.what}\xBB n\xE3o \xE9 um campo deste arquivo`:`\xAB${t.what}\xBB is not a field of this file`;case"threshold":return n?`\xABthreshold\xBB vai de 0 a 1, como 0.7 (est\xE1 \xAB${t.value}\xBB)`:`\xABthreshold\xBB goes from 0 to 1, like 0.7 (it is \xAB${t.value}\xBB)`;case"minAgents":return n?`\xABmin_agents\xBB \xE9 um n\xFAmero inteiro a partir de 1 (est\xE1 \xAB${t.value}\xBB)`:`\xABmin_agents\xBB is a whole number from 1 (it is \xAB${t.value}\xBB)`;case"role":return n?`\xAB${t.what}\xBB \xE9 orchestrator ou specialist (est\xE1 \xAB${t.value}\xBB)`:`\xAB${t.what}\xBB is orchestrator or specialist (it is \xAB${t.value}\xBB)`;case"status":return n?`\xABstatus\xBB \xE9 accepted ou rejected (est\xE1 \xAB${t.value}\xBB)`:`\xABstatus\xBB is accepted or rejected (it is \xAB${t.value}\xBB)`;case"scope":return n?`\xABscope\xBB \xE9 platform, specialist ou orchestrator (est\xE1 \xAB${t.value}\xBB)`:`\xABscope\xBB is platform, specialist or orchestrator (it is \xAB${t.value}\xBB)`}}var In=[{id:"orchestrator-variables",name:"Orchestrator-Generated Variables",sign:"an OnRecognizedIntent topic with an AutomaticTaskInput that has shouldPromptUser: false"},{id:"rai-error-handling",name:"RAI Error Handling",sign:"the OnError topic reads System.Error.SubCode"},{id:"knowledge-hold-message",name:"Knowledge Hold Message",sign:"an OnKnowledgeRequested topic that sends a message"},{id:"prevent-tool-call-leaks",name:"Prevent Tool Call Leaks",sign:"an OnGeneratedResponse topic that sets System.ContinueResponse"},{id:"dynamic-topic-redirect",name:"Dynamic Topic Redirect",sign:"a BeginDialog whose dialog is a =Switch( expression"},{id:"channel-aware-behavior",name:"Channel-Aware Behavior",sign:"a condition or SetVariable that reads System.Activity.ChannelId (not a tool input)"},{id:"date-context",name:"Date Context",sign:"the instructions use Today() or Now()"},{id:"line-breaks-in-messages",name:"Line Breaks in Messages",sign:"<br /> inside a SendActivity or Question"},{id:"conversation-history-variable",name:"Conversation History Variable"},{id:"chain-of-thought-logging",name:"Chain of Thought Logging"},{id:"deterministic-mcp-calls",name:"Deterministic MCP Calls"},{id:"prevent-child-agent-responses",name:"Prevent Child Agent Responses"},{id:"jit-glossary",name:"JIT Glossary"},{id:"jit-user-context",name:"JIT User Context"},{id:"teams-production-hardening",name:"Teams Production Hardening"}];var bp=/^(no|não|nao|false|off|0)$/i,wp=new Set(In.filter(t=>!t.sign).map(t=>`ms:${t.id}`)),kp=t=>t.includes(":")&&!t.startsWith("declared:")&&!wp.has(t),Sp=t=>t.startsWith("declared:")?t:`declared:${t}`;function vp(t,e,n){let s=Object.fromEntries(n.agents.map(y=>[y.id,y.role])),{roles:r,unmatched:i}=_a(t,e,s),o=y=>e.ignore.includes(y)||!e.microsoftPatterns&&y.startsWith("ms:"),a=[],l=t.map(y=>{let S=Object.fromEntries(Object.entries(y.facts).filter(([A])=>!o(A)));for(let A of n.declared.filter(T=>T.agent===y.id)){let T=!bp.test(A.value);if(kp(A.key)){let N=A.key in y.facts;T!==N&&a.push({agent:y.id,key:A.key,declared:A.value||"yes",observed:N,source:A.source})}else T&&(S[Sp(A.key)]??=[]).push({file:A.source?`declared: ${A.source}`:"declared"})}return{id:y.id,role:r[y.id],...y.schemaName?{schemaName:y.schemaName}:{},...y.displayName?{displayName:y.displayName}:{},facts:S,children:y.children}}),c=y=>l.filter(S=>S.role===y),p=(y,S=l)=>S.filter(A=>y in A.facts),u=(y,S=l)=>S.flatMap(A=>A.facts[y]??[]),f=[...new Set(l.flatMap(y=>Object.keys(y.facts)))].sort(),m=y=>n.decisions.find(S=>S.key===y),d=y=>y==="platform"?l:c(y),h=[];for(let y of["specialist","orchestrator"]){let S=c(y);if(S.length<e.minAgents)continue;let A=c(y==="specialist"?"orchestrator":"specialist");for(let T of f){if(T.startsWith("declared:")||h.some(q=>q.key===T))continue;let w=p(T,S).length/S.length;if(w<e.threshold)continue;let L=A.length>0&&p(T,A).length/A.length>=(A.length>=e.minAgents?e.threshold:1),v=m(T);h.push({key:T,role:y,scope:v?.scope??(L?"platform":y),share:w,agents:p(T).map(q=>q.id),sources:u(T),...v?{decision:v}:{}})}}for(let y of n.decisions.filter(S=>S.status==="accepted"&&!h.some(A=>A.key===S.key))){let S=d(y.scope),A=p(y.key,S);h.push({key:y.key,role:y.scope==="orchestrator"?"orchestrator":"specialist",scope:y.scope,share:S.length?A.length/S.length:0,agents:A.map(T=>T.id),sources:u(y.key),decision:y})}h.sort((y,S)=>y.scope.localeCompare(S.scope)||y.key.localeCompare(S.key));let g=h.filter(y=>y.decision?.status!=="rejected").flatMap(y=>d(y.scope).filter(S=>!(y.key in S.facts)).map(S=>({agent:S.id,key:y.key,scope:y.scope}))).sort((y,S)=>y.agent.localeCompare(S.agent)||y.key.localeCompare(S.key)),k=[],$=[];for(let y of f){if(y.startsWith("declared:"))continue;let S=p(y),A={key:y,agents:S.map(T=>T.id),sources:u(y)};S.every(T=>T.role==="orchestrator")?$.push(A):S.length===1&&k.push(A)}let E=e.rules.map(y=>({rule:y,agents:c(y.role).filter(S=>!(y.has in S.facts)).map(S=>S.id)})).filter(y=>y.agents.length);return{...e.name??n.name?{name:e.name??n.name}:{},roles:r,unmatched:i,agents:l,patterns:h,offPattern:g,solos:k,orchestratorDoes:$,gaps:E,conflicts:a,unknown:t.flatMap(y=>y.unknown.map(S=>({...S,agent:y.id})))}}var Dr={conversation:{en:"A. Conversation",pt:"A. Conversa"},integrations:{en:"B. Integrations",pt:"B. Integra\xE7\xF5es"},knowledge:{en:"C. Knowledge",pt:"C. Conhecimento"},orchestration:{en:"D. Orchestrator",pt:"D. Orquestrador"},governance:{en:"E. Governance",pt:"E. Governan\xE7a"},microsoft:{en:"Microsoft patterns",pt:"Padr\xF5es Microsoft"},declared:{en:"Declared",pt:"Declarado"}},Dn={"trigger:OnConversationStart":{dim:"conversation",en:"Greeting",pt:"Boas-vindas"},"trigger:OnUnknownIntent":{dim:"conversation",en:"Fallback (when it does not understand)",pt:"Fallback (quando n\xE3o entende)"},"trigger:OnEscalate":{dim:"conversation",en:"Escalation to a person",pt:"Escalonamento para humano",lacks:{en:["does not escalate to a person","do not escalate to a person"],pt:["n\xE3o escala para humano","n\xE3o escalam para humano"]}},"trigger:OnError":{dim:"conversation",en:"Error handling",pt:"Tratamento de erro",lacks:{en:["does not handle errors","do not handle errors"],pt:["n\xE3o trata erro","n\xE3o tratam erro"]}},"trigger:OnRecognizedIntent":{dim:"conversation",en:"A topic of its own, by intent",pt:"T\xF3pico pr\xF3prio, por inten\xE7\xE3o"},"trigger:OnRedirect":{dim:"orchestration",en:"Takes a call from the orchestrator",pt:"Recebe chamada do orquestrador",lacks:{en:["takes no call from the orchestrator","take no call from the orchestrator"],pt:["n\xE3o recebe chamada do orquestrador","n\xE3o recebem chamada do orquestrador"]}},"trigger:OnSelectIntent":{dim:"conversation",en:"Disambiguation (\xABdid you mean\u2026\xBB)",pt:"Desambigua\xE7\xE3o (\xABvoc\xEA quis dizer\u2026\xBB)"},"trigger:OnSignIn":{dim:"conversation",en:"Sign-in",pt:"Login"},"trigger:OnGeneratedResponse":{dim:"conversation",en:"Reviews the generated answer",pt:"Revisa a resposta gerada"},"trigger:OnKnowledgeRequested":{dim:"knowledge",en:"Before searching knowledge",pt:"Antes de buscar no conhecimento"},"trigger:OnToolSelected":{dim:"orchestration",en:"Child chosen as a tool",pt:"Filho escolhido como ferramenta"},"trigger:OnActivity":{dim:"conversation",en:"On every message",pt:"Em toda mensagem"},"setting:generative=on":{dim:"conversation",en:"Generative orchestration on",pt:"Orquestra\xE7\xE3o generativa ligada"},"setting:generative=off":{dim:"conversation",en:"Generative orchestration off",pt:"Orquestra\xE7\xE3o generativa desligada"},"setting:connectable":{dim:"orchestration",en:"Can be called by an orchestrator",pt:"Pode ser chamado por um orquestrador"},"topics:with-model-description":{dim:"conversation",en:"Topics described for the model",pt:"T\xF3picos descritos para o modelo"},"instructions:present":{dim:"governance",en:"Has instructions",pt:"Tem instru\xE7\xF5es",lacks:{en:["has no instructions","have no instructions"],pt:["n\xE3o tem instru\xE7\xF5es","n\xE3o t\xEAm instru\xE7\xF5es"]}},"node:LogCustomTelemetryEvent":{dim:"governance",en:"Logs telemetry",pt:"Registra telemetria",lacks:{en:["logs no telemetry","log no telemetry"],pt:["n\xE3o registra telemetria","n\xE3o registram telemetria"]}},"node:CSATQuestion":{dim:"governance",en:"Asks for satisfaction (CSAT)",pt:"Pergunta a satisfa\xE7\xE3o (CSAT)",lacks:{en:["does not ask for satisfaction","do not ask for satisfaction"],pt:["n\xE3o pergunta a satisfa\xE7\xE3o","n\xE3o perguntam a satisfa\xE7\xE3o"]}},"node:SearchAndSummarizeContent":{dim:"knowledge",en:"Generative answers from knowledge",pt:"Respostas generativas sobre o conhecimento"},"node:SearchKnowledgeSources":{dim:"knowledge",en:"Searches the knowledge sources",pt:"Busca nas fontes de conhecimento"},"yaml-only:triggerCondition":{dim:"knowledge",en:"Search condition only in YAML (the editor may erase it)",pt:"Condi\xE7\xE3o de busca s\xF3 no YAML (a tela pode apagar)"},"knowledge:SharePointSearchSource":{dim:"knowledge",en:"Knowledge in SharePoint",pt:"Conhecimento no SharePoint"},"declared:kpi":{dim:"declared",en:"KPI declared",pt:"KPI declarado",lacks:{en:["has no KPI declared","have no KPI declared"],pt:["n\xE3o tem KPI declarado","n\xE3o t\xEAm KPI declarado"]}},"declared:owner":{dim:"declared",en:"Owner declared",pt:"Dono declarado",lacks:{en:["has no owner declared","have no owner declared"],pt:["n\xE3o tem dono declarado","n\xE3o t\xEAm dono declarado"]}}},$p=Object.fromEntries(In.map(t=>[t.id,t.name])),Ap=[["calls:topic:","conversation","Calls the topic","Chama o t\xF3pico"],["trigger:","conversation","Trigger","Gatilho"],["setting:","conversation","Setting","Configura\xE7\xE3o"],["connector:","integrations","Connector","Conector"],["operation:","integrations","Operation","Opera\xE7\xE3o"],["connref:","integrations","Connection reference","Refer\xEAncia de conex\xE3o"],["mcp:","integrations","MCP server","Servidor MCP"],["flow:","integrations","Flow","Fluxo"],["knowledge:","knowledge","Knowledge","Conhecimento"],["node:","governance","Node","N\xF3"],["calls:","orchestration","Calls","Chama"],["child:","orchestration","Child","Filho"],["var-in:","orchestration","Receives from the orchestrator","Recebe do orquestrador"],["var:","orchestration","Global variable","Vari\xE1vel global"],["model:","governance","Model","Modelo"],["auth:","governance","Sign-in","Login"],["ms:","microsoft","Microsoft pattern:","Padr\xE3o Microsoft:"],["declared:","declared","Declared:","Declarado:"]],Fa=t=>Ap.find(([e])=>t.startsWith(e)),ja=t=>!!Dn[t]?.lacks;function Rn(t){return Dn[t]?.dim??Fa(t)?.[1]??"governance"}function ee(t,e){let n=Dn[t];if(n)return n[e];let s=/^knowledge:count=(\d+)$/.exec(t);if(s){let o=Number(s[1]);return e==="pt"?`${o} ${o===1?"fonte":"fontes"} de conhecimento`:`${o} knowledge ${o===1?"source":"sources"}`}let r=Fa(t);if(!r)return t;let i=t.slice(r[0].length);return r[0]==="ms:"&&(i=$p[i]??i),r[0]==="auth:"&&i==="None"?e==="pt"?"Sem login":"No sign-in":`${r[e==="pt"?3:2]} ${i}`}function _n(t,e,n){let s=Dn[t]?.lacks?.[e];if(s)return s[n===1?0:1];if(t.startsWith("calls:topic:"))return e==="pt"?`${n===1?"n\xE3o chama":"n\xE3o chamam"} o t\xF3pico ${t.slice(12)}`:`${n===1?"does":"do"} not call the topic ${t.slice(12)}`;let r=ee(t,e);return e==="pt"?`${n===1?"n\xE3o tem":"n\xE3o t\xEAm"} \xAB${r}\xBB`:`${n===1?"does":"do"} not have \xAB${r}\xBB`}var Op={specialist:{en:["specialist","specialists"],pt:["especialista","especialistas"]},orchestrator:{en:["orchestrator","orchestrators"],pt:["orquestrador","orquestradores"]}},Ee=(t,e,n)=>Op[t][e][n===1?0:1],Fn={en:{summary:"Summary",matrix:"Matrix",patterns:"Patterns",off:"Off pattern",gaps:"Gaps",conflicts:"Conflicts",agents:"Cast",evidence:"Evidence",declared:"Declared",unknown:"Not understood",dimension:"Dimension",fact:"Fact",key:"Key",agent:"Who",name:"Name",role:"Role",scope:"Scope",share:"Share",have:"Who has it",lack:"Who lacks it",decision:"Decision",why:"Why",missing:"Missing",accepted:"Accepted pattern",rule:"Rule",says:"Says",notMet:"Who does not meet it",value:"Value",source:"Source",inYaml:"In the YAML",file:"File",line:"Line",facts:"Facts",alone:"Only it has",children:"Children",kind:"Kind",yes:"yes",no:"no",accept:"accepted",reject:"rejected",platform:"platform",specialist:"specialist",orchestrator:"orchestrator",title:"The cast, compared",look:"To look at",nothing:"Nothing to look at",privacy:"This file holds the client\u2019s data: keep it in the client\u2019s environment.",count:{agents:"In the cast",orchestrators:"Orchestrators",specialists:"Specialists",patterns:"Patterns",off:"Off a pattern",gaps:"Rules not met",conflicts:"Conflicts",solos:"Only one has it"},why_:{yaml:"YAML that does not read",empty:"empty",kind:"a kind Copilot Studio does not have",file:"not a Copilot Studio file"}},pt:{summary:"Resumo",matrix:"Matriz",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Lacunas",conflicts:"Conflitos",agents:"Elenco",evidence:"Evid\xEAncias",declared:"Declarado",unknown:"N\xE3o entendeu",dimension:"Dimens\xE3o",fact:"Fato",key:"Chave",agent:"Quem",name:"Nome",role:"Papel",scope:"Escopo",share:"Quantos",have:"Quem tem",lack:"Quem falta",decision:"Decis\xE3o",why:"Por qu\xEA",missing:"Falta",accepted:"Padr\xE3o aceito",rule:"Regra",says:"Diz",notMet:"Quem n\xE3o cumpre",value:"Valor",source:"Fonte",inYaml:"No YAML",file:"Arquivo",line:"Linha",facts:"Fatos",alone:"S\xF3 ele tem",children:"Filhos",kind:"Kind",yes:"sim",no:"n\xE3o",accept:"aceito",reject:"rejeitado",platform:"plataforma",specialist:"especialista",orchestrator:"orquestrador",title:"Elenco comparado",look:"Para olhar",nothing:"Nada para olhar",privacy:"Este arquivo tem dados do cliente: deixe-o no ambiente dele.",count:{agents:"No elenco",orchestrators:"Orquestradores",specialists:"Especialistas",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Regras n\xE3o cumpridas",conflicts:"Conflitos",solos:"S\xF3 um tem"},why_:{yaml:"YAML que n\xE3o se l\xEA",empty:"vazio",kind:"um kind que o Copilot Studio n\xE3o tem",file:"n\xE3o \xE9 arquivo do Copilot Studio"}}};var $t=t=>t.join(", ");function Np(t){let e=[];for(let i of t.conflicts){let o=i.source?`\xAB${i.source}\xBB`:null,[a,l]=[ee(i.key,"en"),ee(i.key,"pt")];e.push(i.observed?{key:"conflict",agents:[i.agent],fact:i.key,en:`${i.agent}: ${o??"what was declared"} says it does not have \xAB${a}\xBB, but the YAML has it`,pt:`${i.agent}: ${o??"o declarado"} diz que n\xE3o tem \xAB${l}\xBB, mas o YAML tem`}:{key:"conflict",agents:[i.agent],fact:i.key,en:`${i.agent}: ${o??"what was declared"} says it has \xAB${a}\xBB, but the YAML does not`,pt:`${i.agent}: ${o??"o declarado"} diz que tem \xAB${l}\xBB, mas o YAML n\xE3o tem`})}let n=new Map;for(let i of t.offPattern){let o=t.roles[i.agent],a=n.get(`${i.key} ${o}`)??{key:i.key,role:o,agents:[]};a.agents.push(i.agent),n.set(`${i.key} ${o}`,a)}for(let i of n.values()){let o=i.agents.length,a=t.patterns.find(c=>c.key===i.key)?.decision?.status==="accepted",l=c=>`${o} ${Ee(i.role,c,o)} ${_n(i.key,c,o)} (${$t(i.agents)})`;e.push({key:"off",agents:i.agents,fact:i.key,en:a?`${l("en")}, and the pattern was accepted: correct it?`:`${l("en")}: on purpose?`,pt:a?`${l("pt")}, e o padr\xE3o foi aceito: corrigir?`:`${l("pt")}: \xE9 intencional?`})}for(let i of t.gaps){let o=i.agents.filter(l=>!t.offPattern.some(c=>c.agent===l&&c.key===i.rule.has)).sort(),a=o.length;a&&e.push({key:"gap",agents:o,fact:i.rule.has,en:`Rule \xAB${i.rule.says}\xBB: ${a} ${Ee(i.rule.role,"en",a)} ${a===1?"does":"do"} not meet it (${$t(o)})`,pt:`Regra \xAB${i.rule.says}\xBB: ${a} ${Ee(i.rule.role,"pt",a)} n\xE3o ${a===1?"cumpre":"cumprem"} (${$t(o)})`})}let s=new Set(t.solos.filter(i=>/^(connector|mcp):/.test(i.key)).map(i=>`${i.agents[0]} ${i.key.slice(i.key.indexOf(":")+1)}`));for(let i of t.solos){let o=i.agents[0],a=i.key.startsWith("connref:")?i.key.slice(8):i.key.startsWith("operation:")?i.key.slice(10).split("/")[0]:void 0;a&&s.has(`${o} ${a}`)||e.push({key:"solo",agents:[o],fact:i.key,en:`Only ${o} has \xAB${ee(i.key,"en")}\xBB: innovation or debt?`,pt:`S\xF3 ${o} tem \xAB${ee(i.key,"pt")}\xBB: inova\xE7\xE3o ou d\xEDvida?`})}let r=new Map;for(let i of t.unknown)r.set(i.agent,[...r.get(i.agent)??[],i.file]);for(let[i,o]of r){let a=o.length;e.push({key:"unknown",agents:[i],en:`${i}: the analysis did not understand ${a} ${a===1?"file":"files"} (${$t(o)})`,pt:`${i}: a an\xE1lise n\xE3o entendeu ${a} ${a===1?"arquivo":"arquivos"} (${$t(o)})`})}for(let i of t.unmatched)e.push({key:"unmatched",agents:[],en:`The profile names \xAB${i}\xBB, which is not in the folder`,pt:`O perfil cita \xAB${i}\xBB, que n\xE3o est\xE1 na pasta`});return e}function At(t){let e=n=>n.share===1&&!n.decision&&!t.offPattern.some(s=>s.key===n.key);return{look:t.patterns.filter(n=>!e(n)),everyone:t.patterns.filter(e)}}var Ba=new TextEncoder,Rr=t=>t.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e]).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,""),Ot=t=>t<26?String.fromCharCode(65+t):Ot(Math.floor(t/26)-1)+String.fromCharCode(65+t%26),Ep=t=>t.replace(/[:\\/?*[\]]/g," ").slice(0,31)||"Sheet";function Cp(t){let e=[{}],n=f=>JSON.stringify([f.bold??!1,f.fill??"",f.color??"",f.center??!1,f.wrap??!1]),s=new Map([[n({}),0]]);for(let f of t)for(let m of f.rows)for(let d of m){if(typeof d!="object")continue;let{v:h,...g}=d,k=n(g);s.has(k)||(s.set(k,e.length),e.push(g))}let r=new Map([["|",0]]),i=new Map([["",0]]),o=f=>{let m=`${f.bold?"b":""}|${f.color??""}`;return r.has(m)||r.set(m,r.size),r.get(m)},a=f=>f.fill?(i.has(f.fill)||i.set(f.fill,i.size+1),i.get(f.fill)):0,l=e.map(f=>{let m=f.center||f.wrap?`<alignment${f.center?' horizontal="center"':""}${f.wrap?' wrapText="1"':""} vertical="top"/>`:'<alignment vertical="top"/>';return`<xf numFmtId="0" fontId="${o(f)}" fillId="${a(f)}" borderId="${f.fill||f.bold?1:0}" xfId="0" applyFont="1" applyFill="1" applyBorder="1" applyAlignment="1">${m}</xf>`}),c=[...r.keys()].map(f=>{let[m,d]=f.split("|");return`<font>${m?"<b/>":""}<sz val="11"/>${d?`<color rgb="FF${d}"/>`:""}<name val="Calibri"/><family val="2"/></font>`}),p=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>',...[...i.keys()].filter(Boolean).map(f=>`<fill><patternFill patternType="solid"><fgColor rgb="FF${f}"/><bgColor indexed="64"/></patternFill></fill>`)];return{xml:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
139
+ `,n)+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 n=xn(e),s=Fe(n);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 n=xn(e),s=Fe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!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;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Ta.Parser=qr});var Ia=N(wt=>{"use strict";var Pa=gr(),Fd=ft(),bt=pt(),jd=hs(),Bd=M(),Kd=Cr(),La=Tr();function xa(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Kd.LineCounter||null,prettyErrors:e}}function Ud(t,e={}){let{lineCounter:n,prettyErrors:s}=xa(e),r=new La.Parser(n?.addNewLine),i=new Pa.Composer(e),o=Array.from(i.compose(r.parse(t)));if(s&&n)for(let a of o)a.errors.forEach(bt.prettifyError(t,n)),a.warnings.forEach(bt.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function Ma(t,e={}){let{lineCounter:n,prettyErrors:s}=xa(e),r=new La.Parser(n?.addNewLine),i=new Pa.Composer(e),o=null;for(let a of i.compose(r.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new bt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(bt.prettifyError(t,n)),o.warnings.forEach(bt.prettifyError(t,n))),o}function Yd(t,e,n){let s;typeof e=="function"?s=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=Ma(t,n);if(!r)return null;if(r.warnings.forEach(i=>jd.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function zd(t,e,n){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return Bd.isDocument(t)&&!s?t.toString(n):new Fd.Document(t,s,n).toString(n)}wt.parse=Yd;wt.parseAllDocuments=Ud;wt.parseDocument=Ma;wt.stringify=zd});var Dn=N(I=>{"use strict";var Vd=gr(),Wd=ft(),Jd=Xs(),Pr=pt(),Gd=Je(),we=M(),Xd=he(),Hd=j(),Qd=ge(),Zd=ye(),ep=Pn(),tp=Nr(),np=Cr(),sp=Tr(),In=Ia(),Da=Ye();I.Composer=Vd.Composer;I.Document=Wd.Document;I.Schema=Jd.Schema;I.YAMLError=Pr.YAMLError;I.YAMLParseError=Pr.YAMLParseError;I.YAMLWarning=Pr.YAMLWarning;I.Alias=Gd.Alias;I.isAlias=we.isAlias;I.isCollection=we.isCollection;I.isDocument=we.isDocument;I.isMap=we.isMap;I.isNode=we.isNode;I.isPair=we.isPair;I.isScalar=we.isScalar;I.isSeq=we.isSeq;I.Pair=Xd.Pair;I.Scalar=Hd.Scalar;I.YAMLMap=Qd.YAMLMap;I.YAMLSeq=Zd.YAMLSeq;I.CST=ep;I.Lexer=tp.Lexer;I.LineCounter=np.LineCounter;I.Parser=sp.Parser;I.parse=In.parse;I.parseAllDocuments=In.parseAllDocuments;I.parseDocument=In.parseDocument;I.stringify=In.stringify;I.visit=Da.visit;I.visitAsync=Da.visitAsync});import{readdirSync as Ol,readFileSync as Nl}from"node:fs";import{basename as El,join as Hn}from"node:path";var Cl=/^agent\.mcs\.ya?ml$/,ql=/\.ya?ml$/,zr=t=>Ol(t,{withFileTypes:!0}).filter(e=>!e.name.startsWith(".")&&e.name!=="node_modules");function Vr(t,e=""){return zr(t).flatMap(n=>{let s=e?`${e}/${n.name}`:n.name;return n.isDirectory()?Vr(Hn(t,n.name),s):n.isFile()?[{path:s,text:ql.test(n.name)?Nl(Hn(t,n.name),"utf8"):""}]:[]})}function Wr(t){let e=zr(t);return e.some(n=>n.isFile()&&Cl.test(n.name))?[{id:El(t),dir:t,files:Vr(t)}]:e.filter(n=>n.isDirectory()).flatMap(n=>Wr(Hn(t,n.name)))}var re=Xn(Dn()),Y=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,_=t=>typeof t=="string"&&t.trim()?t:void 0,Lr=t=>Array.isArray(t)?t:[];function rp(t){if(!t.trim())return"empty";let e=new re.LineCounter,n=(0,re.parseDocument)(t,{lineCounter:e,uniqueKeys:!1});if(n.errors.length)return"yaml";let s=new WeakMap,r=o=>{if((0,re.isMap)(o)){let a={};o.range&&s.set(a,o.range[0]);for(let l of o.items)a[String((0,re.isScalar)(l.key)?l.key.value:l.key)]=r(l.value);return a}return(0,re.isSeq)(o)?o.items.map(r):(0,re.isScalar)(o)?o.value:o},i=r(n.contents);return i==null?"empty":{data:i,lineOf:o=>o&&typeof o=="object"&&s.has(o)?e.linePos(s.get(o)).line:void 0}}function*vt(t){if(Array.isArray(t))for(let n of t)yield*vt(n);let e=Y(t);if(e){typeof e.kind=="string"&&(yield e);for(let n of Object.values(e))yield*vt(n)}}var kt=t=>t.split(".")[1]??t,St=(t,e)=>t.slice(t.lastIndexOf(e)+(t.includes(e)?e.length:0)),ip=new Set(["LogCustomTelemetryEvent","CSATQuestion","SearchAndSummarizeContent","SearchKnowledgeSources"]);function op(t,e,n){let s={id:t,facts:{},children:[],unknown:[],names:{}},r=[],i=new Map,o=[],a=l=>St(l,"/").replace(/(\.topic)?\.mcs\.ya?ml$|\.ya?ml$/,"");for(let l of[...e].sort((c,d)=>c.path.localeCompare(d.path))){if(!/\.ya?ml$/.test(l.path)){s.unknown.push({file:l.path,why:"file"});continue}let c=rp(l.text);if(c==="yaml"||c==="empty"){s.unknown.push({file:l.path,why:c});continue}let d=Y(c.data),f=/^agents\/([^/]+)\//.exec(l.path)?.[1],u=s.facts;if(f){let p=s.children.find(S=>S.name===f);p||s.children.push(p={name:f,facts:{}}),u=p.facts}let h=(p,S,A=u)=>(A[p]??=[]).push({file:l.path,line:c.lineOf(S??d)});if(f&&h(`child:${f}`,d,s.facts),!f&&/^settings\.mcs\.ya?ml$/.test(l.path)&&d){s.schemaName=_(d.schemaName)??s.schemaName,s.displayName=_(d.displayName)??s.displayName,_(d.authenticationMode)&&h(`auth:${d.authenticationMode}`);let p=Y(d.configuration),S=Y(p?.settings)?.GenerativeActionsEnabled;typeof S=="boolean"&&h(`setting:generative=${S?"on":"off"}`,p),p?.isAgentConnectable===!0&&h("setting:connectable",p);continue}let k=n?[...vt(d)].map(p=>p.kind).find(p=>!n.has(p)):void 0;if(k&&s.unknown.push({file:l.path,why:"kind",kind:k}),typeof d?.kind!="string"){k||s.unknown.push({file:l.path,why:"kind"});continue}let m=l.text,y=(p,S)=>{_(p)&&(h("instructions:present",S),/\b(Today|Now)\(\)/.test(p)&&h("ms:date-context",S))};switch(d.kind){case"GptComponentMetadata":{s.displayName??=_(d.displayName),y(d.instructions,d);let p=Y(Y(d.aISettings)?.model);_(p?.modelNameHint)&&h(`model:${p.modelNameHint}`,p);break}case"AgentDialog":{let p=Y(d.beginDialog);_(p?.kind)&&h(`trigger:${p.kind}`,p),y(Y(d.settings)?.instructions,d.settings);break}case"AdaptiveDialog":{let p=Y(d.beginDialog),S=_(p?.kind);S&&h(`trigger:${S}`,p),S&&i.set(`${f??""}/${a(l.path)}`,S),_(d.modelDescription)&&h("topics:with-model-description");let A=Lr(d.inputs).some(g=>Y(g)?.kind==="AutomaticTaskInput"&&Y(g)?.shouldPromptUser===!1);S==="OnRecognizedIntent"&&A&&h("ms:orchestrator-variables",p),S==="OnError"&&m.includes("System.Error.SubCode")&&h("ms:rai-error-handling",p),S==="OnKnowledgeRequested"&&[...vt(p)].some(g=>g.kind==="SendActivity")&&h("ms:knowledge-hold-message",p),S==="OnGeneratedResponse"&&m.includes("System.ContinueResponse")&&h("ms:prevent-tool-call-leaks",p);break}case"TaskDialog":{let p=Y(d.action),S=_(p?.connectionReference);p?.kind==="InvokeConnectorTaskAction"&&S&&(h(`connector:${kt(S)}`,p),_(p.operationId)&&h(`operation:${kt(S)}/${p.operationId}`,p)),p?.kind==="InvokeExternalAgentTaskAction"&&Y(p.operationDetails)?.kind==="ModelContextProtocolMetadata"&&S&&h(`mcp:${kt(S)}`,p),p?.kind==="InvokeConnectedAgentTaskAction"&&_(p.botSchemaName)&&h(`calls:${p.botSchemaName}`,p),p?.kind==="InvokeFlowTaskAction"&&_(p.flowId)&&h(`flow:${p.flowId}`,p);break}case"KnowledgeSourceConfiguration":{let p=Y(d.source);_(p?.kind)&&h(`knowledge:${p.kind}`,p),p&&"triggerCondition"in p&&h("yaml-only:triggerCondition",p),r.push({file:l.path,line:c.lineOf(d)});break}case"GlobalVariableComponent":{let p=Y(d.variable)??d,S=_(p.name)??(_(d.schemaName)?St(d.schemaName,"."):void 0);if(!S)break;h(`var:${S}`),p.isExternalInitializationAllowed===!0&&h(`var-in:${S}`);break}case"ConnectionReferencesSourceFile":for(let p of Lr(d.connectionReferences).map(Y)){let S=_(p?.connectorId)?St(p.connectorId,"/"):_(p?.connectionReferenceLogicalName)?kt(p.connectionReferenceLogicalName):void 0;S&&h(`connref:${S}`,p),S&&_(p?.displayName)&&(s.names[S]=p.displayName)}break}for(let p of vt(d)){if(ip.has(p.kind)&&h(`node:${p.kind}`,p),p.kind==="InvokeConnectorAction"&&_(p.connectionReference)){let A=kt(p.connectionReference);h(`connector:${A}`,p),_(p.operationId)&&h(`operation:${A}/${p.operationId}`,p)}if(p.kind==="InvokeFlowAction"&&_(p.flowId)&&h(`flow:${p.flowId}`,p),(p.kind==="BeginDialog"||p.kind==="ReplaceDialog")&&_(p.dialog)){let A=p.dialog;A.startsWith("=")?A.includes("Switch(")&&h("ms:dynamic-topic-redirect",p):o.push({topic:`${f??""}/${St(A,".topic.")}`,into:u,at:{file:l.path,line:c.lineOf(p)}})}let S=A=>typeof A=="string"&&A.includes("System.Activity.ChannelId");(p.kind==="ConditionGroup"&&Lr(p.conditions).some(A=>S(Y(A)?.condition))||p.kind==="SetVariable"&&S(p.value))&&h("ms:channel-aware-behavior",p),(p.kind==="SendActivity"||p.kind==="Question")&&JSON.stringify(p).includes("<br")&&h("ms:line-breaks-in-messages",p)}}r.length&&(s.facts[`knowledge:count=${r.length}`]=r);for(let l of o){let c=i.get(l.topic);(l.into[c?`reaches:${c}`:`calls:topic:${St(l.topic,"/")}`]??=[]).push(l.at)}for(let l of[s.facts,...s.children.map(c=>c.facts)])for(let[c,d]of Object.entries(l))l[c]=d.filter((f,u)=>d.findIndex(h=>h.file===f.file&&h.line===f.line)===u);return s}function ap(t){let e=new Set,n=r=>{if(!r||typeof r!="object")return;let{const:i,enum:o}=r;if(typeof i=="string"&&e.add(i),Array.isArray(o))for(let a of o)typeof a=="string"&&e.add(a)},s=r=>{if(Array.isArray(r))return r.forEach(s);if(!r||typeof r!="object")return;let i=r;n(i.kind),n(i.properties?.kind);for(let o of Object.values(i))s(o)};for(let r of Object.values(t.definitions??{}))s(r);return e}var je=Xn(Dn(),1);function Rn(t,e){let n=new je.LineCounter,s=(0,je.parseDocument)(t,{lineCounter:n,prettyErrors:!1}),r=o=>{for(let a=o;a.length;a=a.slice(0,-1)){let l=s.getIn(a,!0);if(l?.range)return n.linePos(l.range[0]).line}return 1};if(s.errors.length)return{ok:!1,problem:{line:n.linePos(s.errors[0].pos[0]).line,key:"syntax",detail:s.errors[0].code}};let i=s.toJS();return!i||typeof i!="object"||Array.isArray(i)||i.format!==e||!(0,je.isMap)(s.contents)?{ok:!1,problem:{line:r(["format"]),key:"format"}}:{ok:!0,format:{raw:i,doc:s,at:r,lineOf:o=>n.linePos(o).line}}}var Ra="cast-list/profile-v1",Dr=["orchestrator","specialist"],Ir={roles:{},threshold:.7,minAgents:3,rules:[],focusAreas:[],ignore:[],microsoftPatterns:!0},lp=["format","name","roles","threshold","min_agents","rules","focus_areas","ignore","microsoft_patterns"],xr=t=>!!t&&typeof t=="object"&&!Array.isArray(t),z=t=>typeof t=="string"?t.trim():typeof t=="number"?String(t):"",Mr=t=>Array.isArray(t)?t.map(z).filter(Boolean):z(t)?[z(t)]:[],_a=t=>Dr.includes(t);function cp(t){let e=Rn(t,Ra);if(!e.ok)return{problems:[e.problem.key==="format"?{...e.problem,format:Ra}:e.problem]};let{raw:n,at:s}=e.format,r=[];for(let p of Object.keys(n))lp.includes(p)||r.push({line:s([p]),key:"unknownKey",what:p});let i=(p,S,A)=>(z(p)||r.push({line:s(A),key:"missing",what:S}),z(p)),o=(p,S)=>{let A=new Set;S.forEach((g,v)=>{g&&A.has(g)&&r.push({line:s([p,v]),key:"duplicate",what:p,id:g}),A.add(g)})},a=p=>Array.isArray(n[p])?n[p]:[],l=n.threshold===void 0?Ir.threshold:Number(n.threshold);l>0&&l<=1||r.push({line:s(["threshold"]),key:"threshold",value:z(n.threshold)});let c=n.min_agents===void 0?Ir.minAgents:Number(n.min_agents);Number.isInteger(c)&&c>=1||r.push({line:s(["min_agents"]),key:"minAgents",value:z(n.min_agents)});let d={},f=xr(n.roles)?n.roles:{};for(let p of Object.keys(f))_a(p)?d[p]=z(f[p])==="*"?"*":Mr(f[p]):r.push({line:s(["roles",p]),key:"role",what:`roles.${p}`,value:p});let u=(p,S,A)=>(_a(z(p))||r.push({line:s(A),key:"role",what:S,value:z(p)}),z(p)),h=a("rules").filter(xr).map((p,S)=>{let A=i(p.has,`rules[${S}].has`,["rules",S]);return{id:i(p.id,`rules[${S}].id`,["rules",S]),role:u(p.role,`rules[${S}].role`,["rules",S,"role"]),has:A,says:z(p.says)||A}});o("rules",h.map(p=>p.id));let k=a("focus_areas").filter(xr).map((p,S)=>{let A=Mr(p.facts);A.length||r.push({line:s(["focus_areas",S]),key:"missing",what:`focus_areas[${S}].facts`});let g=i(p.id,`focus_areas[${S}].id`,["focus_areas",S]);return{id:g,name:z(p.name)||g,facts:A}});o("focus_areas",k.map(p=>p.id));let m=n.microsoft_patterns,y={...z(n.name)?{name:z(n.name)}:{},roles:d,threshold:l,minAgents:c,rules:h,focusAreas:k,ignore:Mr(n.ignore),microsoftPatterns:!(m===!1||z(m).toLowerCase()==="off")};return r.length?{problems:r}:{profile:y,problems:r}}var fp=t=>Object.keys(t.facts).some(e=>e.startsWith("calls:")&&!e.startsWith("calls:topic:"));function Fa(t,e,n={}){let{orchestrator:s,specialist:r}=e.roles,i=(c,d)=>Array.isArray(c)&&c.includes(d),o=Object.fromEntries(t.map(c=>[c.id,i(s,c.id)?"orchestrator":i(r,c.id)?"specialist":n[c.id]??(s==="*"?"orchestrator":r==="*"?"specialist":fp(c)?"orchestrator":"specialist")])),a=new Set(t.map(c=>c.id)),l=[s,r].flatMap(c=>Array.isArray(c)?c:[]).filter(c=>!a.has(c));return{roles:o,unmatched:l}}var ae=Xn(Dn());var $t="cast-list/cast-v1",up=["accepted","rejected"],dp=["platform","specialist","orchestrator"],pp=["format","name","agents","declared","decisions"],hp=t=>!!t&&typeof t=="object"&&!Array.isArray(t),Q=t=>typeof t=="string"?t.trim():typeof t=="number"||typeof t=="boolean"?String(t):"";function mp(t){let e=Rn(t,$t);if(!e.ok)return{problems:[e.problem.key==="format"?{...e.problem,format:$t}:e.problem]};let{raw:n,at:s}=e.format,r=[];for(let f of Object.keys(n))pp.includes(f)||r.push({line:s([f]),key:"unknownKey",what:f});let i=f=>(Array.isArray(n[f])?n[f]:[]).filter(hp),o=(f,u,h)=>(Q(f)||r.push({line:s(h),key:"missing",what:u}),Q(f)),a=(f,u)=>{let h=new Set;u.forEach((k,m)=>{k&&h.has(k)&&r.push({line:s([f,m]),key:"duplicate",what:f,id:k}),h.add(k)})},l=i("agents").map((f,u)=>{let h=Q(f.role);return Dr.includes(h)||r.push({line:s(["agents",u,"role"]),key:"role",what:`agents[${u}].role`,value:h}),{id:o(f.id,`agents[${u}].id`,["agents",u]),role:h}});a("agents",l.map(f=>f.id));let c=i("declared").map((f,u)=>({agent:o(f.agent,`declared[${u}].agent`,["declared",u]),key:o(f.key,`declared[${u}].key`,["declared",u]),value:Q(f.value),source:Q(f.source)}));a("declared",c.map(f=>`${f.agent} ${f.key}`));let d=i("decisions").map((f,u)=>{let h=Q(f.status),k=Q(f.scope);return up.includes(h)||r.push({line:s(["decisions",u,"status"]),key:"status",value:h}),dp.includes(k)||r.push({line:s(["decisions",u,"scope"]),key:"scope",value:k}),{key:o(f.key,`decisions[${u}].key`,["decisions",u]),status:h,scope:k,why:Q(f.why)}});return a("decisions",d.map(f=>f.key)),r.length?{problems:r}:{cast:{...Q(n.name)?{name:Q(n.name)}:{},agents:l,declared:c,decisions:d},problems:r}}var gp=` What people said about the agents, and what was decided. build.mjs keeps it up to date; edit it, or fill the
140
+ workbook's \xABDeclared\xBB sheet and the \xABDecision\xBB column and read it back with --from.`,yp={agents:t=>Q(t.id),declared:t=>`${Q(t.agent)} ${Q(t.key)}`,decisions:t=>Q(t.key)},bp=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==""&&e!==void 0));function wp(t,e){let n=e?(0,ae.parseDocument)(e):void 0,s=n&&!n.errors.length&&(0,ae.isMap)(n.contents)?n:new ae.Document({format:$t});s!==n&&(s.commentBefore=gp),s.get("format")!==$t&&s.set("format",$t),t.name===void 0?s.delete("name"):s.get("name")!==t.name&&s.set("name",t.name);for(let[r,i]of Object.entries(yp)){let o=t[r];if(!o.length){s.delete(r);continue}let a=s.get(r,!0);if((0,ae.isSeq)(a)||s.set(r,a=s.createNode([])),!(0,ae.isSeq)(a))continue;let l=new Map(a.items.filter(ae.isMap).map(c=>[i(c.toJSON()),c]));a.items=o.map(c=>{let d=bp(c),f=l.get(i(d));if(!f){let u=s.createNode(d);return u.flow=!0,u}for(let[u,h]of Object.entries(d))f.get(u)!==h&&f.set(u,h);for(let u of Object.keys(f.toJSON()))u in d||f.delete(u);return f})}return s.toString({lineWidth:0,flowCollectionPadding:!0})}function kp(t,e="en"){let n=e==="pt";switch(t.key){case"syntax":return n?`n\xE3o se l\xEA como YAML (${t.detail})`:`does not read as YAML (${t.detail})`;case"format":return n?`\xABformat\xBB precisa ser ${t.format}`:`\xABformat\xBB must be ${t.format}`;case"missing":return n?`falta \xAB${t.what}\xBB`:`\xAB${t.what}\xBB is missing`;case"duplicate":return n?`${t.what}: o id \xAB${t.id}\xBB se repete`:`${t.what}: the id \xAB${t.id}\xBB is repeated`;case"unknownKey":return n?`\xAB${t.what}\xBB n\xE3o \xE9 um campo deste arquivo`:`\xAB${t.what}\xBB is not a field of this file`;case"threshold":return n?`\xABthreshold\xBB vai de 0 a 1, como 0.7 (est\xE1 \xAB${t.value}\xBB)`:`\xABthreshold\xBB goes from 0 to 1, like 0.7 (it is \xAB${t.value}\xBB)`;case"minAgents":return n?`\xABmin_agents\xBB \xE9 um n\xFAmero inteiro a partir de 1 (est\xE1 \xAB${t.value}\xBB)`:`\xABmin_agents\xBB is a whole number from 1 (it is \xAB${t.value}\xBB)`;case"role":return n?`\xAB${t.what}\xBB \xE9 orchestrator ou specialist (est\xE1 \xAB${t.value}\xBB)`:`\xAB${t.what}\xBB is orchestrator or specialist (it is \xAB${t.value}\xBB)`;case"status":return n?`\xABstatus\xBB \xE9 accepted ou rejected (est\xE1 \xAB${t.value}\xBB)`:`\xABstatus\xBB is accepted or rejected (it is \xAB${t.value}\xBB)`;case"scope":return n?`\xABscope\xBB \xE9 platform, specialist ou orchestrator (est\xE1 \xAB${t.value}\xBB)`:`\xABscope\xBB is platform, specialist or orchestrator (it is \xAB${t.value}\xBB)`}}var _n=[{id:"orchestrator-variables",name:"Orchestrator-Generated Variables",sign:"an OnRecognizedIntent topic with an AutomaticTaskInput that has shouldPromptUser: false"},{id:"rai-error-handling",name:"RAI Error Handling",sign:"the OnError topic reads System.Error.SubCode"},{id:"knowledge-hold-message",name:"Knowledge Hold Message",sign:"an OnKnowledgeRequested topic that sends a message"},{id:"prevent-tool-call-leaks",name:"Prevent Tool Call Leaks",sign:"an OnGeneratedResponse topic that sets System.ContinueResponse"},{id:"dynamic-topic-redirect",name:"Dynamic Topic Redirect",sign:"a BeginDialog whose dialog is a =Switch( expression"},{id:"channel-aware-behavior",name:"Channel-Aware Behavior",sign:"a condition or SetVariable that reads System.Activity.ChannelId (not a tool input)"},{id:"date-context",name:"Date Context",sign:"the instructions use Today() or Now()"},{id:"line-breaks-in-messages",name:"Line Breaks in Messages",sign:"<br /> inside a SendActivity or Question"},{id:"conversation-history-variable",name:"Conversation History Variable"},{id:"chain-of-thought-logging",name:"Chain of Thought Logging"},{id:"deterministic-mcp-calls",name:"Deterministic MCP Calls"},{id:"prevent-child-agent-responses",name:"Prevent Child Agent Responses"},{id:"jit-glossary",name:"JIT Glossary"},{id:"jit-user-context",name:"JIT User Context"},{id:"teams-production-hardening",name:"Teams Production Hardening"}];var Rr={conversation:{en:"A. Conversation",pt:"A. Conversa"},integrations:{en:"B. Integrations",pt:"B. Integra\xE7\xF5es"},knowledge:{en:"C. Knowledge",pt:"C. Conhecimento"},orchestration:{en:"D. Orchestrator",pt:"D. Orquestrador"},governance:{en:"E. Governance",pt:"E. Governan\xE7a"},microsoft:{en:"Microsoft patterns",pt:"Padr\xF5es Microsoft"},declared:{en:"Declared",pt:"Declarado"}},Fn={"trigger:OnConversationStart":{dim:"conversation",en:"Greeting",pt:"Boas-vindas"},"trigger:OnUnknownIntent":{dim:"conversation",en:"Fallback (when it does not understand)",pt:"Fallback (quando n\xE3o entende)"},"trigger:OnEscalate":{dim:"conversation",en:"Escalation to a person",pt:"Escalonamento para humano",lacks:{en:["does not escalate to a person","do not escalate to a person"],pt:["n\xE3o escala para humano","n\xE3o escalam para humano"]}},"trigger:OnError":{dim:"conversation",en:"Error handling",pt:"Tratamento de erro",lacks:{en:["does not handle errors","do not handle errors"],pt:["n\xE3o trata erro","n\xE3o tratam erro"]}},"trigger:OnRecognizedIntent":{dim:"conversation",en:"A topic of its own, by intent",pt:"T\xF3pico pr\xF3prio, por inten\xE7\xE3o"},"trigger:OnRedirect":{dim:"orchestration",en:"Takes a call from the orchestrator",pt:"Recebe chamada do orquestrador",lacks:{en:["takes no call from the orchestrator","take no call from the orchestrator"],pt:["n\xE3o recebe chamada do orquestrador","n\xE3o recebem chamada do orquestrador"]}},"trigger:OnSelectIntent":{dim:"conversation",en:"Disambiguation (\xABdid you mean\u2026\xBB)",pt:"Desambigua\xE7\xE3o (\xABvoc\xEA quis dizer\u2026\xBB)"},"trigger:OnSignIn":{dim:"conversation",en:"Sign-in",pt:"Login"},"trigger:OnGeneratedResponse":{dim:"conversation",en:"Reviews the generated answer",pt:"Revisa a resposta gerada"},"trigger:OnKnowledgeRequested":{dim:"knowledge",en:"Before searching knowledge",pt:"Antes de buscar no conhecimento"},"trigger:OnToolSelected":{dim:"orchestration",en:"Child chosen as a tool",pt:"Filho escolhido como ferramenta"},"trigger:OnActivity":{dim:"conversation",en:"On every message",pt:"Em toda mensagem"},"setting:generative=on":{dim:"conversation",en:"Generative orchestration on",pt:"Orquestra\xE7\xE3o generativa ligada"},"setting:generative=off":{dim:"conversation",en:"Generative orchestration off",pt:"Orquestra\xE7\xE3o generativa desligada"},"setting:connectable":{dim:"orchestration",en:"Can be called by an orchestrator",pt:"Pode ser chamado por um orquestrador"},"topics:with-model-description":{dim:"conversation",en:"Topics described for the model",pt:"T\xF3picos descritos para o modelo"},"instructions:present":{dim:"governance",en:"Has instructions",pt:"Tem instru\xE7\xF5es",lacks:{en:["has no instructions","have no instructions"],pt:["n\xE3o tem instru\xE7\xF5es","n\xE3o t\xEAm instru\xE7\xF5es"]}},"node:LogCustomTelemetryEvent":{dim:"governance",en:"Logs telemetry",pt:"Registra telemetria",lacks:{en:["logs no telemetry","log no telemetry"],pt:["n\xE3o registra telemetria","n\xE3o registram telemetria"]}},"node:CSATQuestion":{dim:"governance",en:"Asks for satisfaction (CSAT)",pt:"Pergunta a satisfa\xE7\xE3o (CSAT)",lacks:{en:["does not ask for satisfaction","do not ask for satisfaction"],pt:["n\xE3o pergunta a satisfa\xE7\xE3o","n\xE3o perguntam a satisfa\xE7\xE3o"]}},"node:SearchAndSummarizeContent":{dim:"knowledge",en:"Generative answers from knowledge",pt:"Respostas generativas sobre o conhecimento"},"node:SearchKnowledgeSources":{dim:"knowledge",en:"Searches the knowledge sources",pt:"Busca nas fontes de conhecimento"},"yaml-only:triggerCondition":{dim:"knowledge",en:"Search condition only in YAML (the editor may erase it)",pt:"Condi\xE7\xE3o de busca s\xF3 no YAML (a tela pode apagar)"},"knowledge:SharePointSearchSource":{dim:"knowledge",en:"Knowledge in SharePoint",pt:"Conhecimento no SharePoint"},"declared:kpi":{dim:"declared",en:"KPI declared",pt:"KPI declarado",lacks:{en:["has no KPI declared","have no KPI declared"],pt:["n\xE3o tem KPI declarado","n\xE3o t\xEAm KPI declarado"]}},"declared:owner":{dim:"declared",en:"Owner declared",pt:"Dono declarado",lacks:{en:["has no owner declared","have no owner declared"],pt:["n\xE3o tem dono declarado","n\xE3o t\xEAm dono declarado"]}}},Sp=Object.fromEntries(_n.map(t=>[t.id,t.name])),vp=[["reaches:","conversation","A topic leads to it (part of trigger:<value>)","Um t\xF3pico leva a ele (parte de trigger:<valor>)"],["calls:topic:","conversation","Calls the topic (one not found)","Chama o t\xF3pico (n\xE3o encontrado)"],["trigger:","conversation","Trigger","Gatilho"],["setting:","conversation","Setting","Configura\xE7\xE3o"],["connector:","integrations","Connector","Conector"],["operation:","integrations","Operation","Opera\xE7\xE3o"],["connref:","integrations","Connection reference","Refer\xEAncia de conex\xE3o"],["mcp:","integrations","MCP server","Servidor MCP"],["flow:","integrations","Flow","Fluxo"],["knowledge:","knowledge","Knowledge","Conhecimento"],["node:","governance","Node","N\xF3"],["calls:","orchestration","Calls","Chama"],["child:","orchestration","Child","Filho"],["var-in:","orchestration","Receives from the orchestrator","Recebe do orquestrador"],["var:","orchestration","Global variable","Vari\xE1vel global"],["model:","governance","Model","Modelo"],["auth:","governance","Sign-in","Login"],["ms:","microsoft","Microsoft pattern:","Padr\xE3o Microsoft:"],["declared:","declared","Declared:","Declarado:"]],Ba=t=>vp.find(([e])=>t.startsWith(e)),Ka=t=>!!Fn[t]?.lacks;function At(t){return t.startsWith("reaches:")?At(`trigger:${t.slice(8)}`):Fn[t]?.dim??Ba(t)?.[1]??"governance"}var Ot=t=>t.startsWith("reaches:")?`trigger:${t.slice(8)}`:void 0,ja=(t,e)=>e?.[t]??t;function Z(t,e,n){let s=Fn[t];if(s)return s[e];if(t.startsWith("reaches:")){let a=Z(`trigger:${t.slice(8)}`,e);return e==="pt"?`Um t\xF3pico leva a \xAB${a}\xBB`:`A topic leads to \xAB${a}\xBB`}let r=/^knowledge:count=(\d+)$/.exec(t);if(r){let a=Number(r[1]);return e==="pt"?`${a} ${a===1?"fonte":"fontes"} de conhecimento`:`${a} knowledge ${a===1?"source":"sources"}`}let i=Ba(t);if(!i)return t;let o=t.slice(i[0].length);if(i[0]==="ms:"&&(o=Sp[o]??o),i[0]==="auth:"&&o==="None")return e==="pt"?"Sem login":"No sign-in";if(["connector:","connref:","mcp:","calls:"].includes(i[0])&&(o=ja(o,n)),i[0]==="operation:"){let[a,l]=[o.slice(0,o.indexOf("/")),o.slice(o.indexOf("/")+1)];o=`${ja(a,n)} \xB7 ${l}`}return`${i[e==="pt"?3:2]} ${o}`}function jn(t,e,n,s){let r=Fn[t]?.lacks?.[e];if(r)return r[n===1?0:1];if(t.startsWith("reaches:")){let o=Z(`trigger:${t.slice(8)}`,e);return e==="pt"?`${n===1?"tem":"t\xEAm"} \xAB${o}\xBB, mas nenhum t\xF3pico leva a ele`:`${n===1?"has":"have"} \xAB${o}\xBB, but no topic leads to it`}if(t.startsWith("calls:topic:"))return e==="pt"?`${n===1?"n\xE3o chama":"n\xE3o chamam"} o t\xF3pico ${t.slice(12)}`:`${n===1?"does":"do"} not call the topic ${t.slice(12)}`;let i=Z(t,e,s);return e==="pt"?`${n===1?"n\xE3o tem":"n\xE3o t\xEAm"} \xAB${i}\xBB`:`${n===1?"does":"do"} not have \xAB${i}\xBB`}var $p=/^(no|não|nao|false|off|0)$/i,Ap=new Set(_n.filter(t=>!t.sign).map(t=>`ms:${t.id}`)),Op=t=>t.includes(":")&&!t.startsWith("declared:")&&!Ap.has(t),Np=t=>t.startsWith("declared:")?t:`declared:${t}`;function Ep(t,e,n){let s=Object.fromEntries(n.agents.map(g=>[g.id,g.role])),{roles:r,unmatched:i}=Fa(t,e,s),o=g=>e.ignore.includes(g)||!e.microsoftPatterns&&g.startsWith("ms:"),a=[],l=t.map(g=>{let v=Object.fromEntries(Object.entries(g.facts).filter(([O])=>!o(O)));for(let O of n.declared.filter(T=>T.agent===g.id)){let T=!$p.test(O.value);if(Op(O.key)){let E=O.key in g.facts;T!==E&&a.push({agent:g.id,key:O.key,declared:O.value||"yes",observed:E,source:O.source})}else T&&(v[Np(O.key)]??=[]).push({file:O.source?`declared: ${O.source}`:"declared"})}return{id:g.id,role:r[g.id],...g.schemaName?{schemaName:g.schemaName}:{},...g.displayName?{displayName:g.displayName}:{},facts:v,children:g.children}}),c=g=>l.filter(v=>v.role===g),d=(g,v=l)=>v.filter(O=>g in O.facts),f=(g,v=l)=>v.flatMap(O=>O.facts[g]??[]),u=[...new Set(l.flatMap(g=>Object.keys(g.facts)))].sort(),h=g=>n.decisions.find(v=>v.key===g),k=g=>g==="platform"?l:c(g),m=[];for(let g of["specialist","orchestrator"]){let v=c(g);if(v.length<e.minAgents)continue;let O=c(g==="specialist"?"orchestrator":"specialist");for(let T of u){if(T.startsWith("declared:")||Ot(T)||m.some(q=>q.key===T))continue;let b=d(T,v).length/v.length;if(b<e.threshold)continue;let L=O.length>0&&d(T,O).length/O.length>=(O.length>=e.minAgents?e.threshold:1),$=h(T);m.push({key:T,role:g,scope:$?.scope??(L?"platform":g),share:b,agents:d(T).map(q=>q.id),sources:f(T),...$?{decision:$}:{}})}}for(let g of n.decisions.filter(v=>v.status==="accepted"&&!m.some(O=>O.key===v.key))){let v=k(g.scope),O=d(g.key,v);m.push({key:g.key,role:g.scope==="orchestrator"?"orchestrator":"specialist",scope:g.scope,share:v.length?O.length/v.length:0,agents:O.map(T=>T.id),sources:f(g.key),decision:g})}for(let g of u.filter(v=>Ot(v))){let v=m.find(b=>b.key===Ot(g));if(!v)continue;let O=k(v.scope).filter(b=>v.key in b.facts),T=O.length?d(g,O).length/O.length:0;if(T<e.threshold)continue;let E=h(g)??v.decision;m.push({key:g,role:v.role,scope:v.scope,share:T,agents:d(g).map(b=>b.id),sources:f(g),partOf:v.key,...E?{decision:E}:{}})}m.sort((g,v)=>g.scope.localeCompare(v.scope)||g.key.localeCompare(v.key));let y=m.filter(g=>g.decision?.status!=="rejected").flatMap(g=>k(g.scope).filter(v=>!(g.key in v.facts)&&(!g.partOf||g.partOf in v.facts)).map(v=>({agent:v.id,key:g.key,scope:g.scope,...g.partOf?{partOf:g.partOf}:{}}))).sort((g,v)=>g.agent.localeCompare(v.agent)||g.key.localeCompare(v.key)),p=[],S=[];for(let g of u){if(g.startsWith("declared:")||Ot(g))continue;let v=d(g),O={key:g,agents:v.map(T=>T.id),sources:f(g)};v.every(T=>T.role==="orchestrator")?S.push(O):v.length===1&&p.push(O)}let A=e.rules.map(g=>({rule:g,agents:c(g.role).filter(v=>!(g.has in v.facts)).map(v=>v.id)})).filter(g=>g.agents.length);return{...e.name??n.name?{name:e.name??n.name}:{},roles:r,unmatched:i,agents:l,patterns:m,offPattern:y,solos:p,orchestratorDoes:S,gaps:A,conflicts:a,unknown:t.flatMap(g=>g.unknown.map(v=>({...v,agent:g.id}))),names:Object.assign({},...t.map(g=>g.names??{}),...t.map(g=>g.schemaName&&g.displayName?{[g.schemaName]:g.displayName}:{}))}}var Cp={specialist:{en:["specialist","specialists"],pt:["especialista","especialistas"]},orchestrator:{en:["orchestrator","orchestrators"],pt:["orquestrador","orquestradores"]}},Ee=(t,e,n)=>Cp[t][e][n===1?0:1],Bn={en:{summary:"Summary",matrix:"Matrix",patterns:"Patterns",off:"Off pattern",gaps:"Gaps",conflicts:"Conflicts",agents:"Cast",evidence:"Evidence",declared:"Declared",unknown:"Not understood",dimension:"Dimension",fact:"Fact",key:"Key",agent:"Who",name:"Name",role:"Role",scope:"Scope",share:"Share",have:"Who has it",lack:"Who lacks it",decision:"Decision",why:"Why",missing:"Missing",accepted:"Accepted pattern",rule:"Rule",says:"Says",notMet:"Who does not meet it",value:"Value",source:"Source",inYaml:"In the YAML",file:"File",line:"Line",facts:"Facts",alone:"Only it has",children:"Children",kind:"Kind",yes:"yes",no:"no",accept:"accepted",reject:"rejected",platform:"platform",specialist:"specialist",orchestrator:"orchestrator",title:"The cast, compared",look:"To look at",nothing:"Nothing to look at",privacy:"This file holds the client\u2019s data: keep it in the client\u2019s environment.",count:{agents:"In the cast",orchestrators:"Orchestrators",specialists:"Specialists",patterns:"Patterns",off:"Off a pattern",gaps:"Rules not met",conflicts:"Conflicts",solos:"Only one has it"},why_:{yaml:"YAML that does not read",empty:"empty",kind:"a kind Copilot Studio does not have",file:"not a Copilot Studio file"}},pt:{summary:"Resumo",matrix:"Matriz",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Lacunas",conflicts:"Conflitos",agents:"Elenco",evidence:"Evid\xEAncias",declared:"Declarado",unknown:"N\xE3o entendeu",dimension:"Dimens\xE3o",fact:"Fato",key:"Chave",agent:"Quem",name:"Nome",role:"Papel",scope:"Escopo",share:"Quantos",have:"Quem tem",lack:"Quem falta",decision:"Decis\xE3o",why:"Por qu\xEA",missing:"Falta",accepted:"Padr\xE3o aceito",rule:"Regra",says:"Diz",notMet:"Quem n\xE3o cumpre",value:"Valor",source:"Fonte",inYaml:"No YAML",file:"Arquivo",line:"Linha",facts:"Fatos",alone:"S\xF3 ele tem",children:"Filhos",kind:"Kind",yes:"sim",no:"n\xE3o",accept:"aceito",reject:"rejeitado",platform:"plataforma",specialist:"especialista",orchestrator:"orquestrador",title:"Elenco comparado",look:"Para olhar",nothing:"Nada para olhar",privacy:"Este arquivo tem dados do cliente: deixe-o no ambiente dele.",count:{agents:"No elenco",orchestrators:"Orquestradores",specialists:"Especialistas",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Regras n\xE3o cumpridas",conflicts:"Conflitos",solos:"S\xF3 um tem"},why_:{yaml:"YAML que n\xE3o se l\xEA",empty:"vazio",kind:"um kind que o Copilot Studio n\xE3o tem",file:"n\xE3o \xE9 arquivo do Copilot Studio"}}};var Nt=t=>t.join(", ");function qp(t){let e=[];for(let i of t.conflicts){let o=i.source?`\xAB${i.source}\xBB`:null,[a,l]=[Z(i.key,"en",t.names),Z(i.key,"pt",t.names)];e.push(i.observed?{key:"conflict",agents:[i.agent],fact:i.key,en:`${i.agent}: ${o??"what was declared"} says it does not have \xAB${a}\xBB, but the YAML has it`,pt:`${i.agent}: ${o??"o declarado"} diz que n\xE3o tem \xAB${l}\xBB, mas o YAML tem`}:{key:"conflict",agents:[i.agent],fact:i.key,en:`${i.agent}: ${o??"what was declared"} says it has \xAB${a}\xBB, but the YAML does not`,pt:`${i.agent}: ${o??"o declarado"} diz que tem \xAB${l}\xBB, mas o YAML n\xE3o tem`})}let n=new Map;for(let i of t.offPattern){let o=t.roles[i.agent],a=n.get(`${i.key} ${o}`)??{key:i.key,role:o,agents:[]};a.agents.push(i.agent),n.set(`${i.key} ${o}`,a)}for(let i of n.values()){let o=i.agents.length,a=t.patterns.find(c=>c.key===i.key)?.decision?.status==="accepted",l=c=>`${o} ${Ee(i.role,c,o)} ${jn(i.key,c,o,t.names)} (${Nt(i.agents)})`;e.push({key:"off",agents:i.agents,fact:i.key,en:a?`${l("en")}, and the pattern was accepted: correct it?`:`${l("en")}: on purpose?`,pt:a?`${l("pt")}, e o padr\xE3o foi aceito: corrigir?`:`${l("pt")}: \xE9 intencional?`})}for(let i of t.gaps){let o=i.agents.filter(l=>!t.offPattern.some(c=>c.agent===l&&c.key===i.rule.has)).sort(),a=o.length;a&&e.push({key:"gap",agents:o,fact:i.rule.has,en:`Rule \xAB${i.rule.says}\xBB: ${a} ${Ee(i.rule.role,"en",a)} ${a===1?"does":"do"} not meet it (${Nt(o)})`,pt:`Regra \xAB${i.rule.says}\xBB: ${a} ${Ee(i.rule.role,"pt",a)} n\xE3o ${a===1?"cumpre":"cumprem"} (${Nt(o)})`})}let s=new Set(t.solos.filter(i=>/^(connector|mcp):/.test(i.key)).map(i=>`${i.agents[0]} ${i.key.slice(i.key.indexOf(":")+1)}`));for(let i of t.solos){let o=i.agents[0],a=i.key.startsWith("connref:")?i.key.slice(8):i.key.startsWith("operation:")?i.key.slice(10).split("/")[0]:void 0;a&&s.has(`${o} ${a}`)||e.push({key:"solo",agents:[o],fact:i.key,en:`Only ${o} has \xAB${Z(i.key,"en",t.names)}\xBB: innovation or debt?`,pt:`S\xF3 ${o} tem \xAB${Z(i.key,"pt",t.names)}\xBB: inova\xE7\xE3o ou d\xEDvida?`})}let r=new Map;for(let i of t.unknown)r.set(i.agent,[...r.get(i.agent)??[],i.file]);for(let[i,o]of r){let a=o.length;e.push({key:"unknown",agents:[i],en:`${i}: the analysis did not understand ${a} ${a===1?"file":"files"} (${Nt(o)})`,pt:`${i}: a an\xE1lise n\xE3o entendeu ${a} ${a===1?"arquivo":"arquivos"} (${Nt(o)})`})}for(let i of t.unmatched)e.push({key:"unmatched",agents:[],en:`The profile names \xAB${i}\xBB, which is not in the folder`,pt:`O perfil cita \xAB${i}\xBB, que n\xE3o est\xE1 na pasta`});return e}function Et(t){let e=r=>t.offPattern.some(i=>i.key===r.key||i.partOf===r.key),n=r=>r.share===1&&!r.decision&&!e(r),s=t.patterns.filter(r=>!r.partOf);return{look:s.filter(r=>!n(r)),everyone:s.filter(n)}}var Ua=new TextEncoder,_r=t=>t.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e]).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,""),Ct=t=>t<26?String.fromCharCode(65+t):Ct(Math.floor(t/26)-1)+String.fromCharCode(65+t%26),Tp=t=>t.replace(/[:\\/?*[\]]/g," ").slice(0,31)||"Sheet";function Pp(t){let e=[{}],n=u=>JSON.stringify([u.bold??!1,u.fill??"",u.color??"",u.center??!1,u.wrap??!1]),s=new Map([[n({}),0]]);for(let u of t)for(let h of u.rows)for(let k of h){if(typeof k!="object")continue;let{v:m,...y}=k,p=n(y);s.has(p)||(s.set(p,e.length),e.push(y))}let r=new Map([["|",0]]),i=new Map([["",0]]),o=u=>{let h=`${u.bold?"b":""}|${u.color??""}`;return r.has(h)||r.set(h,r.size),r.get(h)},a=u=>u.fill?(i.has(u.fill)||i.set(u.fill,i.size+1),i.get(u.fill)):0,l=e.map(u=>{let h=u.center||u.wrap?`<alignment${u.center?' horizontal="center"':""}${u.wrap?' wrapText="1"':""} vertical="top"/>`:'<alignment vertical="top"/>';return`<xf numFmtId="0" fontId="${o(u)}" fillId="${a(u)}" borderId="${u.fill||u.bold?1:0}" xfId="0" applyFont="1" applyFill="1" applyBorder="1" applyAlignment="1">${h}</xf>`}),c=[...r.keys()].map(u=>{let[h,k]=u.split("|");return`<font>${h?"<b/>":""}<sz val="11"/>${k?`<color rgb="FF${k}"/>`:""}<name val="Calibri"/><family val="2"/></font>`}),d=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>',...[...i.keys()].filter(Boolean).map(u=>`<fill><patternFill patternType="solid"><fgColor rgb="FF${u}"/><bgColor indexed="64"/></patternFill></fill>`)];return{xml:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
141
141
  <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
142
142
  <fonts count="${c.length}">${c.join("")}</fonts>
143
- <fills count="${p.length}">${p.join("")}</fills>
143
+ <fills count="${d.length}">${d.join("")}</fills>
144
144
  <borders count="2"><border><left/><right/><top/><bottom/><diagonal/></border><border><left style="thin"><color rgb="FFD0D7E2"/></left><right style="thin"><color rgb="FFD0D7E2"/></right><top style="thin"><color rgb="FFD0D7E2"/></top><bottom style="thin"><color rgb="FFD0D7E2"/></bottom><diagonal/></border></borders>
145
145
  <cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
146
146
  <cellXfs count="${l.length}">${l.join("")}</cellXfs>
147
147
  <cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>
148
- </styleSheet>`,styleOf:f=>typeof f=="object"?s.get(n((({v:m,...d})=>d)(f)))??0:0}}function qp(t,e){let n=Math.max(t.columns.length,...t.rows.map(l=>l.length),1),s=t.rows.map((l,c)=>{let p=l.map((u,f)=>{let m=`${Ot(f)}${c+1}`,d=typeof u=="object"?u.v:u,h=e(u),g=h?` s="${h}"`:"";return d===""||d===void 0||d===null?h?`<c r="${m}"${g}/>`:"":typeof d=="number"?`<c r="${m}"${g}><v>${d}</v></c>`:`<c r="${m}"${g} t="inlineStr"><is><t xml:space="preserve">${Rr(String(d))}</t></is></c>`}).join("");return`<row r="${c+1}">${p}</row>`}),r=`${Ot(n-1)}${Math.max(1,t.rows.length)}`,i=t.header?'<pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft" activeCell="A2" sqref="A2"/>':"",o=t.columns.length?`<cols>${t.columns.map((l,c)=>`<col min="${c+1}" max="${c+1}" width="${l.width}" customWidth="1"/>`).join("")}</cols>`:"",a=t.header&&t.rows.length>1?`<autoFilter ref="A1:${Ot(Math.max(0,t.columns.length-1))}${t.rows.length}"/>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
148
+ </styleSheet>`,styleOf:u=>typeof u=="object"?s.get(n((({v:h,...k})=>k)(u)))??0:0}}function Lp(t,e){let n=Math.max(t.columns.length,...t.rows.map(l=>l.length),1),s=t.rows.map((l,c)=>{let d=l.map((f,u)=>{let h=`${Ct(u)}${c+1}`,k=typeof f=="object"?f.v:f,m=e(f),y=m?` s="${m}"`:"";return k===""||k===void 0||k===null?m?`<c r="${h}"${y}/>`:"":typeof k=="number"?`<c r="${h}"${y}><v>${k}</v></c>`:`<c r="${h}"${y} t="inlineStr"><is><t xml:space="preserve">${_r(String(k))}</t></is></c>`}).join("");return`<row r="${c+1}">${d}</row>`}),r=`${Ct(n-1)}${Math.max(1,t.rows.length)}`,i=t.header?'<pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft" activeCell="A2" sqref="A2"/>':"",o=t.columns.length?`<cols>${t.columns.map((l,c)=>`<col min="${c+1}" max="${c+1}" width="${l.width}" customWidth="1"/>`).join("")}</cols>`:"",a=t.header&&t.rows.length>1?`<autoFilter ref="A1:${Ct(Math.max(0,t.columns.length-1))}${t.rows.length}"/>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
149
149
  <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
150
150
  <dimension ref="A1:${r}"/><sheetViews><sheetView workbookViewId="0">${i}</sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>${o}<sheetData>${s.join("")}</sheetData>${a}
151
- </worksheet>`}function Ka(t){let{xml:e,styleOf:n}=Cp(t),s=t.map(o=>Ep(o.name)),r=t.map((o,a)=>o.header&&o.rows.length>1?`<definedName name="_xlnm._FilterDatabase" localSheetId="${a}" hidden="1">'${Rr(s[a]).replace(/'/g,"''")}'!$A$1:$${Ot(Math.max(0,o.columns.length-1))}$${o.rows.length}</definedName>`:"").join(""),i=[["[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
151
+ </worksheet>`}function Ya(t){let{xml:e,styleOf:n}=Pp(t),s=t.map(o=>Tp(o.name)),r=t.map((o,a)=>o.header&&o.rows.length>1?`<definedName name="_xlnm._FilterDatabase" localSheetId="${a}" hidden="1">'${_r(s[a]).replace(/'/g,"''")}'!$A$1:$${Ct(Math.max(0,o.columns.length-1))}$${o.rows.length}</definedName>`:"").join(""),i=[["[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
152
152
  <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>${t.map((o,a)=>`<Override PartName="/xl/worksheets/sheet${a+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")}</Types>`],["_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
153
153
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`],["xl/workbook.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
154
- <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><bookViews><workbookView/></bookViews><sheets>${s.map((o,a)=>`<sheet name="${Rr(o)}" sheetId="${a+1}" r:id="rId${a+1}"/>`).join("")}</sheets>${r?`<definedNames>${r}</definedNames>`:""}</workbook>`],["xl/_rels/workbook.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
155
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${t.map((o,a)=>`<Relationship Id="rId${a+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${a+1}.xml"/>`).join("")}<Relationship Id="rId${t.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`],["xl/styles.xml",e],...t.map((o,a)=>[`xl/worksheets/sheet${a+1}.xml`,qp(o,n)])];return Lp(i.map(([o,a])=>[o,Ba.encode(a)]))}var Tp=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function Pp(t){let e=4294967295;for(let n=0;n<t.length;n++)e=Tp[(e^t[n])&255]^e>>>8;return(e^4294967295)>>>0}function Lp(t){let e=[],n=[],s=0;for(let[c,p]of t){let u=Ba.encode(c),f=Pp(p),m=new DataView(new ArrayBuffer(30));m.setUint32(0,67324752,!0),m.setUint16(4,20,!0),m.setUint16(6,2048,!0),m.setUint16(8,0,!0),m.setUint32(14,f,!0),m.setUint32(18,p.length,!0),m.setUint32(22,p.length,!0),m.setUint16(26,u.length,!0),e.push(new Uint8Array(m.buffer),u,p);let d=new DataView(new ArrayBuffer(46));d.setUint32(0,33639248,!0),d.setUint16(4,20,!0),d.setUint16(6,20,!0),d.setUint16(8,2048,!0),d.setUint32(16,f,!0),d.setUint32(20,p.length,!0),d.setUint32(24,p.length,!0),d.setUint16(28,u.length,!0),d.setUint32(42,s,!0),n.push(new Uint8Array(d.buffer),u),s+=30+u.length+p.length}let r=n.reduce((c,p)=>c+p.length,0),i=new DataView(new ArrayBuffer(22));i.setUint32(0,101010256,!0),i.setUint16(8,t.length,!0),i.setUint16(10,t.length,!0),i.setUint32(12,r,!0),i.setUint32(16,s,!0);let o=[...e,...n,new Uint8Array(i.buffer)],a=new Uint8Array(o.reduce((c,p)=>c+p.length,0)),l=0;for(let c of o)a.set(c,l),l+=c.length;return a}var xp=t=>Ka(t),Mp={bold:!0,fill:"E8EEF7"},Ip={v:"\u25CF",fill:"DDF3E6",center:!0},Dp={v:"\xD7",fill:"FFD5CC",center:!0,bold:!0},Rp={v:"\u25D0",fill:"FFF3C4",center:!0},Ua=Object.keys(Dr);function _p(t,e,n,s="en"){let r=Fn[s],i=(w,L,v)=>({key:w,name:r[w],header:!0,columns:L.map(([q,D])=>({title:q,width:D})),rows:[L.map(([q])=>({v:q,...Mp})),...v]}),o=w=>r[t.roles[w]],a=w=>r[w],l=w=>ee(w,s),c=[...t.agents].sort((w,L)=>w.role===L.role?w.id.localeCompare(L.id):w.role==="orchestrator"?-1:1),p=[...new Set([...c.flatMap(w=>Object.keys(w.facts)),...t.patterns.map(w=>w.key)])].sort((w,L)=>Ua.indexOf(Rn(w))-Ua.indexOf(Rn(L))||w.localeCompare(L)),u=new Set(t.offPattern.map(w=>`${w.agent} ${w.key}`)),f=w=>t.agents.filter(L=>L.role===w).length,m={key:"summary",name:r.summary,header:!1,columns:[{title:"",width:28},{title:"",width:100}],rows:[[{v:t.name??r.title,bold:!0},""],[{v:r.privacy,color:"B42318"},""],[r.count.agents,t.agents.length],[r.count.orchestrators,f("orchestrator")],[r.count.specialists,f("specialist")],[r.count.patterns,t.patterns.length],[r.count.off,new Set(t.offPattern.map(w=>w.agent)).size],[r.count.gaps,t.gaps.length],[r.count.conflicts,t.conflicts.length],[r.count.solos,e.filter(w=>w.key==="solo").length],["",""],[{v:e.length?r.look:r.nothing,bold:!0},""],...e.map(w=>["",{v:w[s],wrap:!0}])]},d=i("matrix",[[r.dimension,18],[r.fact,40],[r.key,34],...c.map(w=>[w.id,14])],p.map(w=>[Dr[Rn(w)][s],l(w),w,...c.map(L=>w in L.facts?w.startsWith("declared:")?Rp:Ip:u.has(`${L.id} ${w}`)?Dp:"")])),{look:h,everyone:g}=At(t),k=i("patterns",[[r.key,34],[r.fact,40],[r.scope,14],[r.role,14],[r.share,10],[r.have,50],[r.lack,40],[r.decision,12],[r.why,50]],[...h,...g].map(w=>{let L=t.offPattern.filter(v=>v.key===w.key).map(v=>v.agent);return[w.key,l(w.key),a(w.scope),r[w.role],`${Math.round(w.share*100)}%`,w.agents.join(", "),L.join(", "),w.decision?r[w.decision.status==="accepted"?"accept":"reject"]:"",w.decision?.why??""]})),$=i("off",[[r.agent,24],[r.role,14],[r.missing,44],[r.key,34],[r.scope,14],[r.accepted,14]],t.offPattern.map(w=>[w.agent,o(w.agent),l(w.key),w.key,a(w.scope),t.patterns.find(L=>L.key===w.key)?.decision?.status==="accepted"?r.yes:""])),E=i("gaps",[[r.rule,16],[r.says,50],[r.role,14],[r.notMet,60]],t.gaps.map(w=>[w.rule.id,w.rule.says,r[w.rule.role],w.agents.join(", ")])),y=i("conflicts",[[r.agent,24],[r.fact,40],[r.key,34],[r.declared,20],[r.source,40],[r.inYaml,12]],t.conflicts.map(w=>[w.agent,l(w.key),w.key,w.declared,w.source,w.observed?r.yes:r.no])),S=i("agents",[[r.agent,24],[r.name,32],[r.role,14],[r.facts,8],[r.off,44],[r.alone,44],[r.children,24],[r.unknown,12]],c.map(w=>[w.id,w.displayName??"",r[w.role],Object.keys(w.facts).length,t.offPattern.filter(L=>L.agent===w.id).map(L=>l(L.key)).join("; "),t.solos.filter(L=>L.agents[0]===w.id).map(L=>l(L.key)).join("; "),w.children.map(L=>L.name).join(", "),t.unknown.filter(L=>L.agent===w.id).length||""])),A=i("evidence",[[r.agent,30],[r.fact,40],[r.key,34],[r.file,50],[r.line,8]],c.flatMap(w=>[{who:w.id,facts:w.facts},...w.children.map(L=>({who:`${w.id} \u203A ${L.name}`,facts:L.facts}))]).flatMap(({who:w,facts:L})=>Object.entries(L).sort(([v],[q])=>v.localeCompare(q)).flatMap(([v,q])=>q.map(D=>[w,l(v),v,D.file,D.line??""])))),T=i("declared",[[r.agent,24],[r.key,34],[r.value,40],[r.source,40]],n.declared.map(w=>[w.agent,w.key,w.value,w.source])),N=[m,d,k,$,E,y,S,A,T];return t.unknown.length&&N.push(i("unknown",[[r.agent,24],[r.file,50],[r.why,40],[r.kind,24]],t.unknown.map(w=>[w.agent,w.file,r.why_[w.why],w.kind??""]))),N}var Be=t=>String(t??"").normalize("NFD").replace(/[̀-ͯ]/g,"").trim().toLowerCase(),Nt=Object.values(Fn),Ya=(t,e)=>t.find(n=>Nt.some(s=>Be(s[e])===Be(n.name)));function za(t,...e){let n=e.map(s=>t?.rows[0]?.findIndex(r=>Nt.some(i=>Be(i[s])===Be(r)))??-1);return s=>n.map(r=>r<0?"":String(s[r]??"").trim())}var Va=(t,e)=>e.find(([,n])=>Nt.some(s=>Be(s[n])===Be(t)))?.[0],Ja=t=>t.slice(1).filter(e=>e.some(n=>String(n??"").trim())),Wa=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function Fp(t,e){let n=[],s=[],r=Ya(e,"declared");if(r){let o=za(r,"agent","key","value","source"),a=[];Ja(r.rows).forEach((p,u)=>{let[f,m,d,h]=o(p);!f||!m?s.push(`${r.name}, ${u+2}: \xAB${o(r.rows[0])[f?1:0]}\xBB ?`):a.push({agent:f,key:m,value:d,source:h})});let l=p=>`${p.agent} ${p.key}`,c=0;for(let p of a){let u=t.declared.find(f=>l(f)===l(p));u?Wa(u,p)||n.push({key:`d${++c}`,kind:"declared",op:"set",before:u,after:p}):n.push({key:`d${++c}`,kind:"declared",op:"add",after:p})}for(let p of t.declared)a.some(u=>l(u)===l(p))||n.push({key:`d${++c}`,kind:"declared",op:"remove",before:p})}let i=Ya(e,"patterns");if(i){let o=za(i,"key","scope","decision","why"),a=0;for(let l of Ja(i.rows)){let[c,p,u,f]=o(l);if(!c)continue;let m=t.decisions.find(g=>g.key===c);if(!u){m&&n.push({key:`p${++a}`,kind:"decision",op:"remove",before:m});continue}let d=Va(u,[["accepted","accept"],["rejected","reject"]]),h=Va(p,[["platform","platform"],["specialist","specialist"],["orchestrator","orchestrator"]]);if(!d)s.push(`${i.name}, ${c}: \xAB${u}\xBB \u2014 ${Nt.map(g=>`${g.accept}/${g.reject}`).join(", ")}`);else if(!h)s.push(`${i.name}, ${c}: \xAB${p}\xBB \u2014 ${Nt.map(g=>`${g.platform}/${g.specialist}/${g.orchestrator}`).join(", ")}`);else{let g={key:c,status:d,scope:h,why:f};m?Wa(m,g)||n.push({key:`p${++a}`,kind:"decision",op:"set",before:m,after:g}):n.push({key:`p${++a}`,kind:"decision",op:"add",after:g})}}}return{changes:n,problems:s}}function jp(t,e,n){let s={...t,declared:[...t.declared],decisions:[...t.decisions]};for(let r of e.filter(i=>n.includes(i.key)))if(r.kind==="declared"){let i=a=>`${a.agent} ${a.key}`,o=r.before?s.declared.findIndex(a=>i(a)===i(r.before)):-1;r.op==="add"?s.declared.push(r.after):r.op==="set"?s.declared[o]=r.after:s.declared.splice(o,1)}else{let i=r.before?s.decisions.findIndex(o=>o.key===r.before.key):-1;r.op==="add"?s.decisions.push(r.after):r.op==="set"?s.decisions[i]=r.after:s.decisions.splice(i,1)}return s}var Et="#8C8578";var jn="#C8442C",Xa="#2E8F62";var Ga=t=>Math.round(t*10)/10,_r=t=>[Ga(t[0]),Ga(t[1])],ke=(t,e,n=22,s="start",r)=>({type:"text",at:_r(t),text:e,size:n,anchor:s,...r?{style:{color:r}}:{}});var Ha=(t,e,n)=>({type:"arrow",from:_r(t),to:_r(e),...n?{style:n}:{}});var Bp=(t,e)=>t.length*e*.48;function Bn(t,e,n){let s=[],r="";for(let i of t.split(/\s+/).filter(Boolean)){let o=r?`${r} ${i}`:i;r&&Bp(o,e)>n?(s.push(r),r=i):r=o}return r&&s.push(r),s.length?s:[""]}var Kn=150,Ct=40,Kp=24,Qa=250,Za=20,Fr=6,jr=4,Up=/^(auth|model|setting|topics|connref|operation):/,Yp={en:{chapters:["The cast","What repeats","Who is off","What is missing","What to decide"],cast:(t,e)=>t?`${t} ${t===1?"orchestrator calls":"orchestrators call"} ${e} ${e===1?"specialist":"specialists"}.`:`${e} ${e===1?"specialist":"specialists"}, with no orchestrator.`,repeats:(t,e,n)=>t?`${t} patterns: ${e} of the platform, ${n} of the specialists.`:"Nothing repeats enough to be a pattern yet.",off:t=>t.length?`Off a pattern: ${t.join(", ")}.`:"Nobody is off a pattern.",missing:t=>t?`${t} ${t===1?"rule is":"rules are"} not met.`:"Every rule is met.",decide:t=>t?`${t} ${t===1?"thing":"things"} to decide.`:"Nothing left to decide.",pattern:t=>`A pattern? \xAB${t}\xBB`,platform:"platform",specialist:"specialists",more:t=>`+ ${t} more`,none:"nothing"},pt:{chapters:["O elenco","O que se repete","Quem est\xE1 fora","O que falta","O que decidir"],cast:(t,e)=>t?`${t} ${t===1?"orquestrador chama":"orquestradores chamam"} ${e} ${e===1?"especialista":"especialistas"}.`:`${e} ${e===1?"especialista":"especialistas"}, sem orquestrador.`,repeats:(t,e,n)=>t?`${t} padr\xF5es: ${e} da plataforma, ${n} dos especialistas.`:"Nada se repete o bastante para ser padr\xE3o ainda.",off:t=>t.length?`Fora do padr\xE3o: ${t.join(", ")}.`:"Ningu\xE9m est\xE1 fora do padr\xE3o.",missing:t=>t?`${t} ${t===1?"regra n\xE3o \xE9 cumprida":"regras n\xE3o s\xE3o cumpridas"}.`:"Todas as regras s\xE3o cumpridas.",decide:t=>t?`${t} ${t===1?"coisa":"coisas"} para decidir.`:"Nada em aberto para decidir.",pattern:t=>`Padr\xE3o? \xAB${t}\xBB`,platform:"plataforma",specialist:"especialistas",more:t=>`+ ${t}`,none:"nada"}};function zp(t,e,n="en"){let s=Yp[n],r=t.agents.filter(v=>v.role==="orchestrator").sort((v,q)=>v.id.localeCompare(q.id)),i=t.agents.filter(v=>v.role==="specialist").sort((v,q)=>v.id.localeCompare(q.id)),o=Math.max(1,Math.ceil(i.length/Kp)),a=Math.max(1,Math.ceil(i.length/o)),l=Math.max(1e3,Ct*2+Math.max(a,r.length)*Kn),c=(v,q)=>l/2+(v-(q-1)/2)*Kn,p=[{...ke([Ct,52],t.name??s.chapters[0],30),chapter:s.chapters[0],say:`${t.name?`${t.name}: `:""}${s.cast(r.length,i.length)}`}],u=(v,q,D)=>Bn(v,15,Kn-12).slice(0,2).forEach((B,G)=>p.push(ke([q[0],q[1]+G*18],B,15,"middle",D))),f=170,m=new Map;r.forEach((v,q)=>{let D=c(q,r.length);m.set(v.id,[D,f]),p.push({type:"prop",name:"robot",at:[D,f],size:70}),u(v.id,[D,f+24],Et)}),i.forEach((v,q)=>{let D=Math.floor(q/a),B=Math.min(a,i.length-D*a),G=[c(q%a,B),340+D*Qa];m.set(v.id,G),p.push({type:"prop",name:"robot",at:G,size:64}),u(v.id,[G[0],G[1]+24])});for(let v of r){let q=m.get(v.id);for(let D of i.filter(B=>B.schemaName&&`calls:${B.schemaName}`in v.facts)){let B=m.get(D.id);B[1]===340&&p.push(Ha([q[0],q[1]+44],[B[0],B[1]-76],{color:Et}))}}let d=340+(o-1)*Qa+160,h=(l-Ct*2)/3,g=d,k=(v,q,D,B,G)=>{let Tt=Ct+v*h;p.push({...ke([Tt,d],q,22,"start",G),chapter:q,say:D});let Vn=d+34,Pt=B.slice(0,Fr);B.length>Fr&&Pt.push(s.more(B.length-Fr)),Pt.length||Pt.push(s.none);for(let hl of Pt){let Lt=Bn(hl,15,h-30),Kr=Lt.length>jr?[...Lt.slice(0,jr-1),`${Lt[jr-1]}\u2026`]:Lt;Kr.forEach((ml,Jn)=>p.push(ke([Tt+(Jn?14:0),Vn+Jn*Za],`${Jn?"":"\xB7 "}${ml}`,15,"start",Et))),Vn+=Kr.length*Za+6}g=Math.max(g,Vn)},$=v=>ja(v)?0:Up.test(v)?2:1,E=[...t.patterns].sort((v,q)=>$(v.key)-$(q.key)||(v.scope===q.scope?0:v.scope==="platform"?-1:1)||q.share-v.share||v.key.localeCompare(q.key)),y=v=>v==="platform"?s.platform:s.specialist;k(0,s.chapters[1],s.repeats(t.patterns.length,t.patterns.filter(v=>v.scope==="platform").length,t.patterns.filter(v=>v.scope!=="platform").length),E.map(v=>`${ee(v.key,n)} \xB7 ${y(v.scope)}${v.share<1?` \xB7 ${Math.round(v.share*100)}%`:""}`),Xa);let S=[...new Set(t.offPattern.map(v=>v.agent))].sort();S.forEach((v,q)=>{let D=m.get(v),B=t.offPattern.filter(G=>G.agent===v).flatMap(G=>Bn(_n(G.key,n,1),13,Kn-10)).slice(0,4);p.push({...ke([D[0]+34,D[1]-50],"\xD7",30,"middle",jn),...q===0?{chapter:s.chapters[2],say:s.off(S)}:{}}),B.forEach((G,Tt)=>p.push(ke([D[0],D[1]+66+Tt*16],G,13,"middle",jn)))}),S.length||p.push({...ke([l-Ct,92],s.off([]),16,"end",Et),chapter:s.chapters[2],say:s.off([])});let A=t.gaps.flatMap(v=>{let q=v.agents.filter(D=>!t.offPattern.some(B=>B.agent===D&&B.key===v.rule.has)).length;return q?[n==="pt"?`\xAB${v.rule.says}\xBB: ${q} ${Ee(v.rule.role,n,q)} n\xE3o ${q===1?"cumpre":"cumprem"}`:`\xAB${v.rule.says}\xBB: ${q} ${Ee(v.rule.role,n,q)} ${q===1?"does":"do"} not meet it`]:[]}),T=t.unknown.length;T&&A.push(n==="pt"?`${T} ${T===1?"arquivo n\xE3o entendido":"arquivos n\xE3o entendidos"}`:`${T} ${T===1?"file":"files"} not understood`),k(1,s.chapters[3],s.missing(e.filter(v=>v.key==="gap").length),A,jn);let{look:N}=At(t),w=[...N.filter(v=>!v.decision).map(v=>s.pattern(ee(v.key,n))),...e.filter(v=>v.key==="solo"||v.key==="conflict").map(v=>v[n])];return k(2,s.chapters[4],s.decide(w.length),w),{id:(t.name??"cast").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"cast",title:t.name??s.chapters[0],width:l,height:Math.min(4e3,g+40),background:"plain",locale:n==="pt"?"pt-BR":"en-US",steps:p}}var el=["and","or","not"];var Br=["person","person-pointing","person-sitting","house","car","bus","coin","phone","document","server","bank","cloud","queue","desk","computer","clock","lock","money-arrow","tree","school","hospital","factory","truck","cart","safe","bulb","gear","database","robot","ship","container","warehouse","box","pallet","shop","shelf","field","cup","function","api-gateway","cache","cluster","board","book","pencil"],Un={pessoa:"person","pessoa-apontando":"person-pointing","pessoa-sentada":"person-sitting",casa:"house",carro:"car",onibus:"bus",moeda:"coin",celular:"phone",documento:"document",servidor:"server",banco:"bank",nuvem:"cloud",fila:"queue",mesa:"desk",computador:"computer",relogio:"clock",cadeado:"lock","seta-dinheiro":"money-arrow"},Yn=t=>Br.includes(t)?t:typeof t=="string"&&Object.hasOwn(Un,t)?Un[t]:void 0;var nl=t=>Yn(t)!==void 0,b={skin:"#E8C6A5",shirt:"#A9BCC3",wood:"#D8C29C",gold:"#F2C94C",paper:"#FFFFFF",screen:"#DCE8F0",device:"#5B6B7C",roof:"#D9785F",wall:"#F3E3C3",car:"#7FA7C9",bus:"#E9C46A",green:"#7DBE8A",dark:"#4A4A4A",metal:"#C9D3DD",board:"#2F4F3F",chalk:"#F2EFE6"},C=(t,e,n,s,r,i)=>({kind:"polygon",points:[[t,e],[t+n,e],[t+n,e+s],[t,e+s]],fill:r,main:i}),P=(...t)=>({kind:"polyline",points:t});function sl(t){return[{kind:"polygon",points:[[-.15,-.72],[.15,-.72],[.19,-.38],[-.19,-.38]],fill:b.shirt,main:!0},{kind:"circle",c:[0,-.87],r:.11,fill:b.skin},...t,P([-.08,-.38],[-.1,0]),P([.08,-.38],[.1,0])]}var tl=sl([P([-.15,-.7],[-.25,-.42]),P([.15,-.7],[.25,-.42])]);function Vp(t,e,n){let s=([r,i])=>[n+r*e,i*e];return t.map(r=>r.kind==="circle"?{...r,c:s(r.c),r:r.r*e}:{...r,points:r.points.map(s)})}function Jp(){let t=[[-.28,-.3,.18],[-.06,-.45,.25],[.2,-.4,.21],[.37,-.27,.13]],e=[];for(let n=0;n<=24;n++){let s=-.46+.96*n/24,r=t.filter(([i,,o])=>Math.abs(s-i)<=o).map(([i,o,a])=>o-Math.sqrt(Math.max(0,a*a-(s-i)**2)));r.length&&e.push([s,Math.min(...r)])}return[...e,[.42,-.12],[-.4,-.12]]}var sg={person:tl,"person-pointing":sl([P([-.15,-.7],[-.25,-.42]),P([.15,-.69],[.47,-.73])]),"person-sitting":[P([-.3,-.8],[-.27,-.4]),P([-.32,-.4],[.2,-.4]),P([-.27,-.4],[-.27,0]),P([.16,-.4],[.16,0]),{kind:"polygon",points:[[-.22,-.77],[.04,-.77],[.06,-.44],[-.22,-.44]],fill:b.shirt,main:!0},{kind:"circle",c:[-.08,-.9],r:.1,fill:b.skin},P([-.1,-.44],[.3,-.44],[.32,0]),P([0,-.74],[.18,-.55],[.3,-.58])],house:[C(-.4,-.6,.8,.6,b.wall,!0),{kind:"polygon",points:[[-.5,-.58],[0,-1],[.5,-.58]],fill:b.roof},C(-.08,-.32,.16,.32,b.wood),C(.16,-.46,.16,.14,b.screen)],car:[{kind:"polygon",fill:b.car,main:!0,points:[[-.5,-.14],[-.5,-.32],[-.3,-.36],[-.18,-.56],[.2,-.56],[.32,-.36],[.5,-.32],[.5,-.14]]},{kind:"polygon",points:[[-.14,-.51],[.17,-.51],[.25,-.37],[-.22,-.37]],fill:b.screen},{kind:"circle",c:[-.28,-.12],r:.1,fill:b.dark},{kind:"circle",c:[.28,-.12],r:.1,fill:b.dark}],bus:[C(-.5,-.66,1,.52,b.bus,!0),...[-.42,-.21,0,.21].map(t=>C(t,-.6,.15,.16,b.screen)),P([-.5,-.3],[.5,-.3]),{kind:"circle",c:[-.3,-.12],r:.1,fill:b.dark},{kind:"circle",c:[.3,-.12],r:.1,fill:b.dark}],coin:[{kind:"circle",c:[0,-.42],r:.4,fill:b.gold,main:!0},{kind:"circle",c:[0,-.42],r:.3},{kind:"curve",points:[[.1,-.56],[-.08,-.57],[-.09,-.46],[.08,-.39],[.08,-.29],[-.11,-.28]]},P([0,-.64],[0,-.2])],phone:[C(-.26,-1,.52,1,b.device,!0),C(-.2,-.92,.4,.76,b.screen),{kind:"circle",c:[0,-.08],r:.035,fill:b.paper}],document:[{kind:"polygon",points:[[-.36,-1],[.16,-1],[.36,-.8],[.36,0],[-.36,0]],fill:b.paper,main:!0},P([.16,-1],[.16,-.8],[.36,-.8]),...[-.66,-.5,-.34,-.18].map(t=>P([-.22,t],[.22,t]))],server:[-1,-.66,-.32].flatMap(t=>[C(-.36,t,.72,.3,b.metal,!0),P([-.26,t+.15],[.06,t+.15]),{kind:"circle",c:[.22,t+.15],r:.035,fill:b.green}]),bank:[{kind:"polygon",points:[[-.5,-.74],[0,-1],[.5,-.74]],fill:b.wall,main:!0},C(-.45,-.74,.9,.08,b.wall),...[-.33,-.11,.11,.33].map(t=>C(t-.04,-.66,.08,.56,b.paper)),C(-.5,-.1,1,.1,b.wall)],cloud:[{kind:"polygon",points:Jp(),fill:b.paper,main:!0}],queue:[-.32,0,.32].flatMap(t=>Vp(tl,.7,t)),desk:[C(-.5,-.5,1,.07,b.wood,!0),P([-.42,-.43],[-.42,0]),P([.42,-.43],[.42,0])],computer:[C(-.45,-1,.9,.6,b.device,!0),C(-.39,-.94,.78,.48,b.screen),{kind:"polygon",points:[[-.06,-.4],[.06,-.4],[.1,-.1],[-.1,-.1]],fill:b.device},C(-.25,-.1,.5,.08,b.device)],clock:[{kind:"circle",c:[0,-.48],r:.45,fill:b.paper,main:!0},...[[0,-.9,0,-.82],[.42,-.48,.34,-.48],[0,-.06,0,-.14],[-.42,-.48,-.34,-.48]].map(([t,e,n,s])=>P([t,e],[n,s])),P([0,-.48],[0,-.78]),P([0,-.48],[.2,-.48])],lock:[{kind:"curve",points:[[-.22,-.52],[-.22,-.76],[0,-.96],[.22,-.76],[.22,-.52]]},C(-.36,-.54,.72,.54,b.bus,!0),{kind:"circle",c:[0,-.32],r:.06,fill:b.dark},P([0,-.28],[0,-.14])],"money-arrow":[{kind:"polygon",fill:b.green,main:!0,points:[[-.5,-.4],[.12,-.4],[.12,-.56],[.5,-.3],[.12,-.04],[.12,-.2],[-.5,-.2]]},{kind:"circle",c:[-.2,-.3],r:.16,fill:b.gold},P([-.2,-.4],[-.2,-.2])],tree:[C(-.07,-.36,.14,.36,b.wood),{kind:"circle",c:[0,-.64],r:.3,fill:b.green,main:!0}],school:[C(-.45,-.6,.9,.6,b.wall,!0),{kind:"polygon",points:[[-.5,-.6],[0,-.82],[.5,-.6]],fill:b.roof},C(-.08,-.28,.16,.28,b.wood),C(-.36,-.48,.16,.12,b.screen),C(.2,-.48,.16,.12,b.screen),P([0,-.82],[0,-1]),{kind:"polygon",points:[[0,-1],[.17,-.95],[0,-.9]],fill:b.roof}],hospital:[C(-.4,-.8,.8,.8,b.paper,!0),C(-.045,-.7,.09,.26,"#C8442C"),C(-.13,-.615,.26,.09,"#C8442C"),C(-.1,-.24,.2,.24,b.metal)],factory:[{kind:"polygon",points:[[-.5,0],[-.5,-.5],[-.25,-.65],[-.25,-.5],[0,-.65],[0,-.5],[.25,-.65],[.25,-.5],[.5,-.5],[.5,0]],fill:b.wall,main:!0},C(.3,-.95,.12,.3,b.dark),C(-.38,-.32,.16,.12,b.screen),C(-.08,-.32,.16,.12,b.screen),C(.22,-.32,.16,.12,b.screen)],truck:[C(-.5,-.62,.62,.46,b.metal,!0),{kind:"polygon",points:[[.12,-.16],[.12,-.5],[.34,-.5],[.48,-.32],[.48,-.16]],fill:b.bus},{kind:"polygon",points:[[.18,-.46],[.32,-.46],[.42,-.33],[.18,-.33]],fill:b.screen},{kind:"circle",c:[-.3,-.1],r:.1,fill:b.dark},{kind:"circle",c:[.3,-.1],r:.1,fill:b.dark}],cart:[P([-.48,-.78],[-.4,-.62]),{kind:"polygon",points:[[-.4,-.62],[.42,-.62],[.32,-.26],[-.3,-.26]],fill:b.metal,main:!0},P([-.3,-.26],[-.3,-.14],[.32,-.14]),{kind:"circle",c:[-.22,-.07],r:.06,fill:b.dark},{kind:"circle",c:[.24,-.07],r:.06,fill:b.dark}],safe:[C(-.4,-.82,.8,.82,b.device,!0),C(-.3,-.72,.6,.62,b.metal),{kind:"circle",c:[0,-.41],r:.13,fill:b.paper},P([0,-.41],[.08,-.47])],bulb:[{kind:"circle",c:[0,-.62],r:.3,fill:b.gold,main:!0},C(-.13,-.33,.26,.2,b.metal),{kind:"curve",points:[[-.09,-.52],[0,-.66],[.09,-.52]]},P([-.08,-.08],[.08,-.08])],gear:[{kind:"polygon",points:[[.42,-.5],[.296,-.378],[.297,-.203],[.122,-.204],[0,-.08],[-.122,-.204],[-.297,-.203],[-.296,-.378],[-.42,-.5],[-.296,-.622],[-.297,-.797],[-.122,-.796],[-0,-.92],[.122,-.796],[.297,-.797],[.296,-.622]],fill:b.metal,main:!0},{kind:"circle",c:[0,-.5],r:.12,fill:b.paper}],database:[{kind:"polygon",points:[[-.35,-.8],[.35,-.8],[.35,-.16],[-.35,-.16]],fill:b.screen,main:!0},{kind:"polygon",points:[[.35,-.8],[.303,-.755],[.175,-.722],[0,-.71],[-.175,-.722],[-.303,-.755],[-.35,-.8],[-.303,-.845],[-.175,-.878],[-0,-.89],[.175,-.878],[.303,-.845]],fill:b.metal},{kind:"curve",points:[[-.35,-.16],[0,-.06],[.35,-.16]]},{kind:"curve",points:[[-.35,-.58],[0,-.48],[.35,-.58]]},{kind:"curve",points:[[-.35,-.37],[0,-.27],[.35,-.37]]}],robot:[P([0,-.95],[0,-1]),C(-.22,-.95,.44,.3,b.metal),{kind:"circle",c:[-.09,-.81],r:.045,fill:b.screen},{kind:"circle",c:[.09,-.81],r:.045,fill:b.screen},C(-.28,-.62,.56,.42,b.metal,!0),P([-.28,-.55],[-.42,-.35]),P([.28,-.55],[.42,-.35]),C(-.2,-.2,.12,.2,b.device),C(.08,-.2,.12,.2,b.device)],ship:[{kind:"polygon",points:[[-.48,-.3],[.48,-.3],[.36,-.04],[-.4,-.04]],fill:b.car,main:!0},C(-.42,-.62,.14,.32,b.wall),C(-.24,-.5,.2,.2,b.roof),C(-.02,-.5,.2,.2,b.bus),C(.2,-.5,.2,.2,b.green),{kind:"curve",points:[[-.5,0],[-.3,-.04],[-.1,0],[.1,-.04],[.3,0],[.5,-.04]]}],container:[C(-.46,-.52,.92,.52,b.roof,!0),...[-.3,-.15,0,.15,.3].map(t=>P([t,-.48],[t,-.04]))],warehouse:[{kind:"polygon",points:[[-.46,0],[.46,0],[.46,-.55],[0,-.82],[-.46,-.55]],fill:b.wall,main:!0},C(-.2,-.38,.4,.38,b.metal),P([-.2,-.26],[.2,-.26]),P([-.2,-.13],[.2,-.13])],box:[C(-.36,-.5,.52,.5,b.wood,!0),{kind:"polygon",points:[[-.36,-.5],[.16,-.5],[.36,-.64],[-.16,-.64]],fill:b.wood},{kind:"polygon",points:[[.16,0],[.36,-.14],[.36,-.64],[.16,-.5]],fill:b.wood},P([-.1,-.5],[.1,-.64])],pallet:[C(-.46,-.12,.92,.06,b.wood),...[-.42,-.05,.32].map(t=>C(t,-.06,.1,.06,b.wood)),C(-.42,-.5,.4,.38,b.wood,!0),C(.02,-.5,.4,.38,b.wood),C(-.2,-.82,.4,.32,b.wood)],shop:[C(-.42,-.6,.84,.6,b.wall,!0),{kind:"polygon",points:[[-.48,-.6],[.48,-.6],[.42,-.78],[-.42,-.78]],fill:b.roof},C(-.34,-.48,.34,.26,b.screen),C(.08,-.42,.24,.42,b.wood)],shelf:[C(-.4,-.92,.8,.92,b.paper,!0),P([-.4,-.62],[.4,-.62]),P([-.4,-.32],[.4,-.32]),C(-.32,-.8,.16,.18,b.roof),C(-.1,-.78,.14,.16,b.bus),C(.1,-.5,.22,.18,b.green),C(-.3,-.2,.24,.2,b.wood)],field:[P([-.48,0],[.48,0]),...[-.3,0,.3].flatMap(t=>[{kind:"curve",points:[[t,0],[t-.02,-.25],[t,-.5]]},{kind:"circle",c:[t-.08,-.32],r:.07,fill:b.green,main:!0},{kind:"circle",c:[t+.08,-.42],r:.07,fill:b.green,main:!0},{kind:"circle",c:[t,-.52],r:.06,fill:b.roof}])],cup:[{kind:"polygon",points:[[-.26,-.52],[.26,-.52],[.2,-.1],[-.2,-.1]],fill:b.paper,main:!0},{kind:"curve",points:[[.24,-.44],[.4,-.38],[.22,-.2]]},{kind:"polygon",points:[[-.46,-.1],[.46,-.1],[.36,0],[-.36,0]],fill:b.paper},{kind:"curve",points:[[-.08,-.62],[-.02,-.72],[-.08,-.84]]},{kind:"curve",points:[[.08,-.62],[.14,-.72],[.08,-.84]]}],function:[C(-.38,-.72,.76,.62,b.screen,!0),P([-.14,-.62],[0,-.62],[.14,-.2]),P([.02,-.42],[-.14,-.2])],"api-gateway":[C(-.12,-.8,.24,.8,b.metal,!0),P([-.48,-.55],[-.16,-.55]),P([-.24,-.62],[-.16,-.55],[-.24,-.48]),P([.16,-.3],[.48,-.3]),P([.4,-.37],[.48,-.3],[.4,-.23])],cache:[C(-.34,-.66,.68,.66,b.metal,!0),{kind:"polygon",points:[[.04,-.58],[-.12,-.3],[0,-.3],[-.06,-.08],[.14,-.38],[.02,-.38]],fill:b.gold}],cluster:[{kind:"curve",points:[[-.4,-.8],[0,-.86],[.4,-.8],[.48,-.45],[.4,-.1],[0,-.04],[-.4,-.1],[-.48,-.45],[-.4,-.8]]},C(-.3,-.7,.24,.2,b.screen,!0),C(.06,-.7,.24,.2,b.screen,!0),C(-.12,-.38,.24,.2,b.screen,!0)],board:[C(-.48,-.9,.96,.6,b.board,!0),C(-.34,-.76,.42,.03,b.chalk),C(-.34,-.62,.58,.03,b.chalk),C(-.34,-.48,.3,.03,b.chalk),P([-.3,-.3],[-.36,0]),P([.3,-.3],[.36,0])],book:[{kind:"polygon",points:[[0,-.62],[-.46,-.7],[-.46,-.1],[0,-.04]],fill:b.paper,main:!0},{kind:"polygon",points:[[0,-.62],[.46,-.7],[.46,-.1],[0,-.04]],fill:b.paper,main:!0},P([-.36,-.52],[-.1,-.48]),P([-.36,-.38],[-.1,-.34]),P([.1,-.48],[.36,-.52]),P([.1,-.34],[.36,-.38])],pencil:[{kind:"polygon",points:[[-.38,-.12],[.22,-.72],[.34,-.6],[-.26,0]],fill:b.bus,main:!0},{kind:"polygon",points:[[.22,-.72],[.34,-.6],[.44,-.86]],fill:b.wood},{kind:"polygon",points:[[-.38,-.12],[-.26,0],[-.46,-.02]],fill:b.roof}]},rl=["happy","sad","surprised","worried","idea"],Wp={person:[0,-.87,.11],"person-pointing":[0,-.87,.11],"person-sitting":[-.08,-.9,.1]},il=t=>{let e=Yn(t);return!!e&&e in Wp};var ol=["spin","drive","steam","talk","pulse","float"],Gp=["lesson","pitch","arch","decision","data","timeline","story"],al=8,ll=6,cl=2e5,fl=6e5,ul=24;var pl=["card","line","arrow","polyline","polygon","curve","circle","ellipse","plot","text","highlight","pause","prop","repeat","when","move","link","counter","row","column","grid","axis","timeline","balloon","brace","note","table","bars","chain","animate","lottie"],Ke=["text","prop","card","counter","circle","ellipse"],dl=["row","column","grid","chain"],Xp=50;function F(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e}: expected an object.`)}function R(t,e){if(typeof t!="string"||!t.trim()||t.length>2e3)throw new Error(`${e}: expected text of 1 to 2000 characters.`)}function x(t,e,n=-1e4,s=1e4){if(typeof t!="number"||!Number.isFinite(t)||t<n||t>s)throw new Error(`${e}: expected a number between ${n} and ${s}.`)}function J(t,e){if(typeof t=="string"){if(R(t,e),t.length>300)throw new Error(`${e}: expression too long.`)}else x(t,e)}function V(t,e){if(!Array.isArray(t)||t.length!==2)throw new Error(`${e}: expected [x, y].`);t.forEach((n,s)=>J(n,`${e}[${s}]`))}function te(t,e){t!==void 0&&R(t,e)}function W(t,e,n){if(t!==void 0&&(typeof t!="string"||!e.includes(t)))throw new Error(`${n}: choose one of ${e.join(", ")}.`)}function zn(t){if(!/^[A-Za-z_][A-Za-z_0-9]*$/.test(t)||["__proto__","constructor","prototype",...el].includes(t))throw new Error(`Invalid variable name: "${t}".`)}var Ue=(t,e)=>e.includes("{")||t.exact.has(e)||[...t.repeated].some(n=>e.startsWith(`${n}-`)&&/^\d+$/.test(e.slice(n.length+1)));function Ce(t,e,n,s){s&&t[e]===void 0&&(t[e]=[0,0]),V(t[e],`${n}.${e}`)}function qt(t,e,n,s,r=!1){if(F(t,e),++n.count>500)throw new Error(`${e}: a recipe draws at most 500 steps, counting those inside repeat and when.`);if(s){for(let a of["chapter","say","duration"])if(t[a]!==void 0)throw new Error(`${e}.${a}: put it on the ${s} step itself, not on a step inside it.`);if(t.type==="pause")throw new Error(`${e}: a pause cannot go inside ${s}.`);if(t.type==="repeat"&&s==="repeat")throw new Error(`${e}: a repeat cannot go inside another repeat.`);if(dl.includes(s)&&t.place!==void 0)throw new Error(`${e}.place: the ${s} places the steps inside it.`)}if(!pl.includes(t.type))throw new Error(`${e}: unknown type "${t.type}".`);for(let a of["id","say","chapter"])te(t[a],`${e}.${a}`);if(t.duration!==void 0&&x(t.duration,`${e}.duration`,0,3e4),t.nudge!==void 0){if(["pause","move","link","animate"].includes(t.type))throw new Error(`${e}.nudge: a ${t.type} has no place of its own to move.`);if(!Array.isArray(t.nudge)||t.nudge.length!==2)throw new Error(`${e}.nudge: use [dx, dy].`);t.nudge.forEach((a,l)=>x(a,`${e}.nudge[${l}]`,-900,900))}let i=s!==null&&dl.includes(s)||r;if(t.place!==void 0){if(!Ke.includes(t.type))throw new Error(`${e}.place: only ${Ke.join(", ")} can be placed.`);if(F(t.place,`${e}.place`),R(t.place.to,`${e}.place.to`),!Ue(n,String(t.place.to)))throw new Error(`${e}.place.to: no earlier step has the id "${t.place.to}".`);if(!["below","above","left","right"].includes(t.place.side))throw new Error(`${e}.place.side: choose one of below, above, left, right.`);t.place.gap!==void 0&&x(t.place.gap,`${e}.place.gap`,-200,400),W(t.place.align,["center","start","end"],`${e}.place.align`)}let o=i||t.place!==void 0;if(t.style!==void 0){F(t.style,`${e}.style`);for(let a of["color","fill"]){let l=t.style[a];if(l!==void 0&&(typeof l!="string"||!/^(#[\da-f]{3,8}|[a-z]+)$/i.test(l)))throw new Error(`${e}.style.${a}: use a hex colour or a colour name, no URLs.`)}for(let a of["width","roughness","bowing"])t.style[a]!==void 0&&x(t.style[a],`${e}.style.${a}`,0,20);if(t.style.opacity!==void 0&&x(t.style.opacity,`${e}.style.opacity`,0,1),t.style.dashed!==void 0&&typeof t.style.dashed!="boolean")throw new Error(`${e}: dashed must be a boolean.`);W(t.style.fillStyle,["hachure","solid","zigzag","cross-hatch","dots"],`${e}.style.fillStyle`)}switch(t.type){case"line":case"arrow":case"highlight":V(t.from,`${e}.from`),V(t.to,`${e}.to`),t.thickness!==void 0&&x(t.thickness,`${e}.thickness`,1,200);break;case"polyline":case"polygon":case"curve":if(!Array.isArray(t.points)||t.points.length<(t.type==="polygon"?3:2)||t.points.length>500)throw new Error(`${e}: points needs ${t.type==="polygon"?3:2} to 500 points.`);t.points.forEach((a,l)=>V(a,`${e}.points[${l}]`));break;case"circle":case"ellipse":Ce(t,"center",e,o);for(let a of t.type==="circle"?["r"]:["rx","ry"])J(t[a],`${e}.${a}`),typeof t[a]=="number"&&x(t[a],`${e}.${a}`,0);break;case"text":Ce(t,"at",e,o),R(t.text,`${e}.text`),t.size!==void 0&&x(t.size,`${e}.size`,1,200),t.rotate!==void 0&&x(t.rotate,`${e}.rotate`,-360,360),W(t.font,["hand","body"],`${e}.font`),W(t.anchor,["start","middle","end"],`${e}.anchor`);break;case"card":Ce(t,"at",e,o),J(t.w,`${e}.w`),J(t.h,`${e}.h`);for(let a of["w","h"])typeof t[a]=="number"&&x(t[a],`${e}.${a}`,40);if(R(t.title,`${e}.title`),t.lines!==void 0){if(!Array.isArray(t.lines)||t.lines.length>6)throw new Error(`${e}: at most 6 lines per card.`);t.lines.forEach((a,l)=>R(a,`${e}.lines[${l}]`))}break;case"plot":R(t.fn,`${e}.fn`),t.var!==void 0&&(R(t.var,`${e}.var`),zn(String(t.var))),V(t.domain,`${e}.domain`),V(t.range,`${e}.range`),F(t.box,`${e}.box`);for(let a of["x","y","w","h"])J(t.box[a],`${e}.box.${a}`);if(t.samples!==void 0&&(x(t.samples,`${e}.samples`,2,1e3),!Number.isInteger(t.samples)))throw new Error(`${e}: samples must be an integer.`);break;case"pause":x(t.ms,`${e}.ms`,0,3e4),te(t.ask,`${e}.ask`);break;case"prop":if(!nl(t.name)&&!n.figures.has(String(t.name))){let a=n.figures.size?`, or one the recipe defines (${[...n.figures].join(", ")})`:"";throw new Error(`${e}.name: unknown prop "${String(t.name)}"; use one of ${Br.join(", ")}${a}.`)}if(Ce(t,"at",e,o),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,10,1e3)),te(t.label,`${e}.label`),t.flip!==void 0&&typeof t.flip!="boolean")throw new Error(`${e}.flip: expected true or false.`);if(t.mood!==void 0){if(!il(t.name))throw new Error(`${e}.mood: only a person (person, person-pointing, person-sitting) has a face.`);W(t.mood,rl,`${e}.mood`)}break;case"repeat":if(J(t.times,`${e}.times`),typeof t.times=="number"&&(x(t.times,`${e}.times`,0,Xp),!Number.isInteger(t.times)))throw new Error(`${e}.times: expected a whole number.`);qt(t.step,`${e}.step`,n,"repeat",i);break;case"when":if(J(t.if,`${e}.if`),!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>50)throw new Error(`${e}.steps: expected 1 to 50 steps.`);t.steps.forEach((a,l)=>qt(a,`${e}.steps[${l}]`,n,s??"when"));break;case"move":if(R(t.target,`${e}.target`),!Ue(n,String(t.target)))throw new Error(`${e}.target: no earlier step has the id "${t.target}".`);V(t.to,`${e}.to`),W(t.along,["line","curve"],`${e}.along`),t.ms!==void 0&&x(t.ms,`${e}.ms`,200,5e3);break;case"lottie":if(R(t.src,`${e}.src`),V(t.at,`${e}.at`),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,24,1e3)),t.loop!==void 0&&typeof t.loop!="boolean")throw new Error(`${e}.loop: expected true or false.`);break;case"animate":if(R(t.target,`${e}.target`),!Ue(n,String(t.target)))throw new Error(`${e}.target: no earlier step has the id "${t.target}".`);if(W(t.effect,[...ol,"stop"],`${e}.effect`),t.effect===void 0)throw new Error(`${e}.effect: choose one of ${[...ol,"stop"].join(", ")}.`);W(t.speed,["slow","fast"],`${e}.speed`);break;case"link":for(let a of["from","to"])if(R(t[a],`${e}.${a}`),!Ue(n,String(t[a])))throw new Error(`${e}.${a}: no earlier step has the id "${t[a]}".`);te(t.label,`${e}.label`);break;case"counter":if(Ce(t,"at",e,o),J(t.value,`${e}.value`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "R$ {v:0}".`);t.size!==void 0&&x(t.size,`${e}.size`,1,200),W(t.anchor,["start","middle","end"],`${e}.anchor`);break;case"row":case"column":case"grid":if(i)throw new Error(`${e}: a ${t.type} cannot go inside another ${s}.`);if(Ce(t,"at",e,!1),t.gap!==void 0&&x(t.gap,`${e}.gap`,0,400),t.type==="grid"){if(x(t.columns,`${e}.columns`,1,12),!Number.isInteger(t.columns))throw new Error(`${e}.columns: expected a whole number.`)}else W(t.align,["center","start","end"],`${e}.align`);if(!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>50)throw new Error(`${e}.steps: expected 1 to 50 steps.`);t.steps.forEach((a,l)=>{F(a,`${e}.steps[${l}]`);let c=a.type==="repeat"?a.step?.type:a.type;if(!Ke.includes(c))throw new Error(`${e}.steps[${l}]: a ${t.type} holds only ${Ke.join(", ")} (or a repeat of one).`);qt(a,`${e}.steps[${l}]`,n,t.type)});break;case"chain":if(i)throw new Error(`${e}: a chain cannot go inside a ${s}.`);if(Ce(t,"at",e,!1),t.gap!==void 0&&t.gap!=="auto"&&x(t.gap,`${e}.gap`,0,400),W(t.direction,["right","down"],`${e}.direction`),t.wrap!==void 0&&typeof t.wrap!="boolean")throw new Error(`${e}.wrap: expected true or false.`);if(te(t.forward,`${e}.forward`),te(t.back,`${e}.back`),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,10,1e3)),!Array.isArray(t.steps)||t.steps.length<2||t.steps.length>12)throw new Error(`${e}.steps: a chain joins 2 to 12 pieces.`);t.steps.forEach((a,l)=>{if(F(a,`${e}.steps[${l}]`),!Ke.includes(a.type))throw new Error(`${e}.steps[${l}]: a chain holds only ${Ke.join(", ")}.`);qt(a,`${e}.steps[${l}]`,n,"chain")});break;case"axis":case"timeline":if(V(t.from,`${e}.from`),V(t.to,`${e}.to`),V(t.domain,`${e}.domain`),t.type==="axis"){if(t.ticks!==void 0){if(Array.isArray(t.ticks)){if(t.ticks.length>30)throw new Error(`${e}.ticks: at most 30 marks.`);t.ticks.forEach((a,l)=>x(a,`${e}.ticks[${l}]`))}else if(x(t.ticks,`${e}.ticks`,0,30),!Number.isInteger(t.ticks))throw new Error(`${e}.ticks: expected a whole number.`)}if(te(t.label,`${e}.label`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "{v} km".`)}else{if(!Array.isArray(t.marks)||t.marks.length===0||t.marks.length>20)throw new Error(`${e}.marks: expected 1 to 20 marks.`);t.marks.forEach((a,l)=>{F(a,`${e}.marks[${l}]`),J(a.at,`${e}.marks[${l}].at`),te(a.label,`${e}.marks[${l}].label`),te(a.text,`${e}.marks[${l}].text`)})}break;case"balloon":if(R(t.to,`${e}.to`),!Ue(n,String(t.to)))throw new Error(`${e}.to: no earlier step has the id "${t.to}".`);if(R(t.text,`${e}.text`),String(t.text).length>300)throw new Error(`${e}.text: keep a balloon under 300 characters.`);W(t.side,["below","above","left","right"],`${e}.side`),W(t.kind,["speech","thought"],`${e}.kind`),t.width!==void 0&&x(t.width,`${e}.width`,80,600),t.size!==void 0&&x(t.size,`${e}.size`,12,60);break;case"brace":if(V(t.from,`${e}.from`),V(t.to,`${e}.to`),te(t.label,`${e}.label`),t.flip!==void 0&&typeof t.flip!="boolean")throw new Error(`${e}.flip: expected true or false.`);break;case"note":if(V(t.at,`${e}.at`),R(t.text,`${e}.text`),t.to===void 0==(t.point===void 0))throw new Error(`${e}: a note points either to an element (to) or to a point (point).`);if(t.to!==void 0){if(R(t.to,`${e}.to`),!Ue(n,String(t.to)))throw new Error(`${e}.to: no earlier step has the id "${t.to}".`)}else V(t.point,`${e}.point`);t.size!==void 0&&x(t.size,`${e}.size`,12,60);break;case"table":if(V(t.at,`${e}.at`),!Array.isArray(t.rows)||t.rows.length===0||t.rows.length>12)throw new Error(`${e}.rows: expected 1 to 12 rows.`);if(t.rows.forEach((a,l)=>{if(!Array.isArray(a)||a.length===0||a.length>6)throw new Error(`${e}.rows[${l}]: expected 1 to 6 cells.`);a.forEach((c,p)=>{if(typeof c!="string"||c.length>120)throw new Error(`${e}.rows[${l}][${p}]: expected text of up to 120 characters.`)})}),t.header!==void 0&&typeof t.header!="boolean")throw new Error(`${e}.header: expected true or false.`);t.size!==void 0&&x(t.size,`${e}.size`,12,40);break;case"bars":F(t.box,`${e}.box`);for(let a of["x","y","w","h"])J(t.box[a],`${e}.box.${a}`);if(!Array.isArray(t.values)||t.values.length===0||t.values.length>12)throw new Error(`${e}.values: expected 1 to 12 values.`);if(t.values.forEach((a,l)=>J(a,`${e}.values[${l}]`)),t.labels!==void 0){if(!Array.isArray(t.labels)||t.labels.length>t.values.length)throw new Error(`${e}.labels: at most one label per value.`);t.labels.forEach((a,l)=>R(a,`${e}.labels[${l}]`))}if(t.max!==void 0&&J(t.max,`${e}.max`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "{v}%".`);break}typeof t.id=="string"&&(s==="repeat"?n.repeated:n.exact).add(t.id)}function Hp(t,e){let n=`defs.${t}`;if(!/^[a-z][a-z0-9-]{1,30}$/.test(t))throw new Error(`${n}: a figure's name is 2 to 31 lowercase letters, digits or -, starting with a letter.`);if(Yn(t)||Object.hasOwn(Un,t)||pl.includes(t)||["define","title","param","switch","var"].includes(t))throw new Error(`${n}: "${t}" is already a prop or a step; choose another name.`);if(F(e,n),!Array.isArray(e.shapes)||e.shapes.length===0||e.shapes.length>ul)throw new Error(`${n}.shapes: expected 1 to ${ul} shapes.`);let s=(r,i)=>{if(typeof r!="number"||!Number.isInteger(r)||r<0||r>100)throw new Error(`${i}: expected a whole number from 0 to 100 (the figure's grid, y down; it stands at 50,100).`)};e.shapes.forEach((r,i)=>{let o=`${n}.shapes[${i}]`;if(F(r,o),r.fill!==void 0&&(typeof r.fill!="string"||!/^(#[0-9a-fA-F]{3,8}|[a-z]{3,20})$/.test(r.fill)))throw new Error(`${o}.fill: a colour, as hex or a plain name.`);if(r.kind==="circle"){if(!Array.isArray(r.c)||r.c.length!==2)throw new Error(`${o}.c: expected [x, y].`);r.c.forEach((l,c)=>s(l,`${o}.c[${c}]`)),s(r.r,`${o}.r`);return}if(!["polygon","polyline","curve"].includes(r.kind))throw new Error(`${o}.kind: choose one of polygon, polyline, curve, circle.`);let a=r.kind==="polygon"?3:2;if(!Array.isArray(r.points)||r.points.length<a||r.points.length>40)throw new Error(`${o}.points: a ${r.kind} takes ${a} to 40 points.`);r.points.forEach((l,c)=>{if(!Array.isArray(l)||l.length!==2)throw new Error(`${o}.points[${c}]: expected [x, y].`);l.forEach((p,u)=>s(p,`${o}.points[${c}][${u}]`))})})}function Qp(t,e){let n=`lottie "${t}"`;F(e,n);let s=JSON.stringify(e).length;if(s>cl)throw new Error(`${n}: ${Math.round(s/1e3)} KB; an animation can have at most ${cl/1e3} KB.`);for(let i of["fr","ip","op","w","h"])x(e[i],`${n}.${i}`,0,1e5);if(typeof e.v!="string"||!Array.isArray(e.layers))throw new Error(`${n}: not a Lottie animation (it needs v and layers).`);let r=(i,o)=>{if(Array.isArray(i))return i.forEach((a,l)=>r(a,`${o}[${l}]`));if(!(!i||typeof i!="object"))for(let[a,l]of Object.entries(i)){if(a==="x"&&typeof l=="string")throw new Error(`${n}: the animation has an expression (code inside it, at ${o}); only animations without expressions play.`);r(l,`${o}.${a}`)}};r(e.layers,"layers");for(let i of Array.isArray(e.assets)?e.assets:[]){let o=i?.p;if(typeof o=="string"&&o&&!o.startsWith("data:")&&!Array.isArray(i.layers))throw new Error(`${n}: an image from outside the animation ("${o.slice(0,40)}"); only images inside it (data:) are kept.`)}return s}function Zp(t){F(t,"The recipe");let e=t;x(e.width,"width",100,4e3),x(e.height,"height",100,4e3);for(let r of["id","title","category"])te(e[r],r);if(e.locale!==void 0&&!(typeof e.locale=="string"&&/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(e.locale)&&Intl.NumberFormat.supportedLocalesOf([e.locale]).length>0))throw new Error('locale: expected a language tag such as "en-US" or "pt-BR".');if(W(e.background,["dots","grid","plain"],"background"),W(e.kind,Gp,"kind"),te(e.source,"source"),e.quiz!==void 0&&e.kind!==void 0&&e.kind!=="lesson")throw new Error(`quiz: only a lesson has a quiz (this drawing is a ${e.kind}).`);if(W(e.theme,["paper","chalkboard"],"theme"),e.quiz!==void 0){if(F(e.quiz,"quiz"),R(e.quiz.question,"quiz.question"),!Array.isArray(e.quiz.options)||e.quiz.options.length<2||e.quiz.options.length>4)throw new Error("quiz.options: expected 2 to 4 options.");if(e.quiz.options.forEach((r,i)=>{if(F(r,`quiz.options[${i}]`),R(r.text,`quiz.options[${i}].text`),R(r.why,`quiz.options[${i}].why`),typeof r.right!="boolean")throw new Error(`quiz.options[${i}].right: expected true or false.`)}),e.quiz.options.filter(r=>r.right===!0).length!==1)throw new Error("quiz.options: exactly one option is right.")}if(e.learning!==void 0){F(e.learning,"learning");for(let r of["goal","question","answer","caveat"])R(e.learning[r],`learning.${r}`)}if(e.params!==void 0){F(e.params,"params");for(let[r,i]of Object.entries(e.params))if(zn(r),F(i,`params.${r}`),R(i.label,`params.${r}.label`),x(i.min,`${r}.min`),x(i.max,`${r}.max`),x(i.step,`${r}.step`,1e-6),x(i.value,`${r}.value`,i.min,i.max),i.max<=i.min)throw new Error(`${r}: max must be greater than min.`)}if(e.vars!==void 0){F(e.vars,"vars");for(let[r,i]of Object.entries(e.vars))zn(r),J(i,`vars.${r}`)}if(e.switches!==void 0){F(e.switches,"switches");let r=Object.entries(e.switches);if(r.length>8)throw new Error("switches: at most 8.");for(let[i,o]of r){if(zn(i),Object.hasOwn(e.params??{},i)||Object.hasOwn(e.vars??{},i))throw new Error(`switches.${i}: the name is already a param or a var.`);if(F(o,`switches.${i}`),R(o.label,`switches.${i}.label`),typeof o.on!="boolean")throw new Error(`switches.${i}.on: expected true or false.`)}}if(!Array.isArray(e.steps)||e.steps.length===0||e.steps.length>250)throw new Error("A recipe needs 1 to 250 steps.");let n=new Set;if(e.defs!==void 0){F(e.defs,"defs");let r=Object.entries(e.defs);if(r.length>al)throw new Error(`defs: at most ${al} figures.`);for(let[i,o]of r)Hp(i,o),n.add(i)}if(e.lotties!==void 0){F(e.lotties,"lotties");let r=Object.entries(e.lotties);if(r.length>ll)throw new Error(`lotties: at most ${ll} animations.`);let i=r.reduce((o,[a,l])=>o+Qp(a,l),0);if(i>fl)throw new Error(`lotties: ${Math.round(i/1e3)} KB in all; at most ${fl/1e3} KB.`)}if(e.credits!==void 0){if(!Array.isArray(e.credits)||e.credits.length>5)throw new Error("credits: at most 5 lines.");e.credits.forEach((r,i)=>R(r,`credits[${i}]`))}let s={exact:new Set,repeated:new Set,count:0,figures:n};return e.steps.forEach((r,i)=>qt(r,`Step ${i+1}`,s,null)),{...e,id:e.id??"pasted",title:e.title??"",background:e.background??"dots"}}export{Mr as DEFAULT_PROFILE,Vr as agentsIn,jp as applyChanges,vp as compare,sp as extractAgent,Fp as fromSheets,At as groupPatterns,rp as knownKinds,ee as labelOf,zp as lessonOf,yp as problemText,dp as readCast,op as readProfile,Np as reviewCast,Zp as validateScene,xp as workbookFile,_p as workbookOf,gp as writeCast};
154
+ <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><bookViews><workbookView/></bookViews><sheets>${s.map((o,a)=>`<sheet name="${_r(o)}" sheetId="${a+1}" r:id="rId${a+1}"/>`).join("")}</sheets>${r?`<definedNames>${r}</definedNames>`:""}</workbook>`],["xl/_rels/workbook.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
155
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${t.map((o,a)=>`<Relationship Id="rId${a+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${a+1}.xml"/>`).join("")}<Relationship Id="rId${t.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`],["xl/styles.xml",e],...t.map((o,a)=>[`xl/worksheets/sheet${a+1}.xml`,Lp(o,n)])];return Ip(i.map(([o,a])=>[o,Ua.encode(a)]))}var xp=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function Mp(t){let e=4294967295;for(let n=0;n<t.length;n++)e=xp[(e^t[n])&255]^e>>>8;return(e^4294967295)>>>0}function Ip(t){let e=[],n=[],s=0;for(let[c,d]of t){let f=Ua.encode(c),u=Mp(d),h=new DataView(new ArrayBuffer(30));h.setUint32(0,67324752,!0),h.setUint16(4,20,!0),h.setUint16(6,2048,!0),h.setUint16(8,0,!0),h.setUint32(14,u,!0),h.setUint32(18,d.length,!0),h.setUint32(22,d.length,!0),h.setUint16(26,f.length,!0),e.push(new Uint8Array(h.buffer),f,d);let k=new DataView(new ArrayBuffer(46));k.setUint32(0,33639248,!0),k.setUint16(4,20,!0),k.setUint16(6,20,!0),k.setUint16(8,2048,!0),k.setUint32(16,u,!0),k.setUint32(20,d.length,!0),k.setUint32(24,d.length,!0),k.setUint16(28,f.length,!0),k.setUint32(42,s,!0),n.push(new Uint8Array(k.buffer),f),s+=30+f.length+d.length}let r=n.reduce((c,d)=>c+d.length,0),i=new DataView(new ArrayBuffer(22));i.setUint32(0,101010256,!0),i.setUint16(8,t.length,!0),i.setUint16(10,t.length,!0),i.setUint32(12,r,!0),i.setUint32(16,s,!0);let o=[...e,...n,new Uint8Array(i.buffer)],a=new Uint8Array(o.reduce((c,d)=>c+d.length,0)),l=0;for(let c of o)a.set(c,l),l+=c.length;return a}var Dp=t=>Ya(t),Rp={bold:!0,fill:"E8EEF7"},_p={v:"\u25CF",fill:"DDF3E6",center:!0},Fp={v:"\xD7",fill:"FFD5CC",center:!0,bold:!0},jp={v:"\u25D0",fill:"FFF3C4",center:!0},za=Object.keys(Rr);function Bp(t,e,n,s="en"){let r=Bn[s],i=(b,L,$)=>({key:b,name:r[b],header:!0,columns:L.map(([q,D])=>({title:q,width:D})),rows:[L.map(([q])=>({v:q,...Rp})),...$]}),o=b=>r[t.roles[b]],a=b=>r[b],l=b=>Z(b,s,t.names),c=[...t.agents].sort((b,L)=>b.role===L.role?b.id.localeCompare(L.id):b.role==="orchestrator"?-1:1),d=[...new Set([...c.flatMap(b=>Object.keys(b.facts)),...t.patterns.map(b=>b.key)])].sort((b,L)=>za.indexOf(At(b))-za.indexOf(At(L))||b.localeCompare(L)),f=new Set(t.offPattern.map(b=>`${b.agent} ${b.key}`)),u=b=>t.agents.filter(L=>L.role===b).length,h={key:"summary",name:r.summary,header:!1,columns:[{title:"",width:28},{title:"",width:100}],rows:[[{v:t.name??r.title,bold:!0},""],[{v:r.privacy,color:"B42318"},""],[r.count.agents,t.agents.length],[r.count.orchestrators,u("orchestrator")],[r.count.specialists,u("specialist")],[r.count.patterns,t.patterns.length],[r.count.off,new Set(t.offPattern.map(b=>b.agent)).size],[r.count.gaps,t.gaps.length],[r.count.conflicts,t.conflicts.length],[r.count.solos,e.filter(b=>b.key==="solo").length],["",""],[{v:e.length?r.look:r.nothing,bold:!0},""],...e.map(b=>["",{v:b[s],wrap:!0}])]},k=i("matrix",[[r.dimension,18],[r.fact,40],[r.key,34],...c.map(b=>[b.id,14])],d.map(b=>[Rr[At(b)][s],l(b),b,...c.map(L=>b in L.facts?b.startsWith("declared:")?jp:_p:f.has(`${L.id} ${b}`)?Fp:"")])),{look:m,everyone:y}=Et(t),p=i("patterns",[[r.key,34],[r.fact,40],[r.scope,14],[r.role,14],[r.share,10],[r.have,50],[r.lack,40],[r.decision,12],[r.why,50]],[...m,...y].map(b=>{let L=t.offPattern.filter($=>$.key===b.key).map($=>$.agent);return[b.key,l(b.key),a(b.scope),r[b.role],`${Math.round(b.share*100)}%`,b.agents.join(", "),L.join(", "),b.decision?r[b.decision.status==="accepted"?"accept":"reject"]:"",b.decision?.why??""]})),S=i("off",[[r.agent,24],[r.role,14],[r.missing,44],[r.key,34],[r.scope,14],[r.accepted,14]],t.offPattern.map(b=>[b.agent,o(b.agent),l(b.key),b.key,a(b.scope),t.patterns.find(L=>L.key===b.key)?.decision?.status==="accepted"?r.yes:""])),A=i("gaps",[[r.rule,16],[r.says,50],[r.role,14],[r.notMet,60]],t.gaps.map(b=>[b.rule.id,b.rule.says,r[b.rule.role],b.agents.join(", ")])),g=i("conflicts",[[r.agent,24],[r.fact,40],[r.key,34],[r.declared,20],[r.source,40],[r.inYaml,12]],t.conflicts.map(b=>[b.agent,l(b.key),b.key,b.declared,b.source,b.observed?r.yes:r.no])),v=i("agents",[[r.agent,24],[r.name,32],[r.role,14],[r.facts,8],[r.off,44],[r.alone,44],[r.children,24],[r.unknown,12]],c.map(b=>[b.id,b.displayName??"",r[b.role],Object.keys(b.facts).length,t.offPattern.filter(L=>L.agent===b.id).map(L=>l(L.key)).join("; "),t.solos.filter(L=>L.agents[0]===b.id).map(L=>l(L.key)).join("; "),b.children.map(L=>L.name).join(", "),t.unknown.filter(L=>L.agent===b.id).length||""])),O=i("evidence",[[r.agent,30],[r.fact,40],[r.key,34],[r.file,50],[r.line,8]],c.flatMap(b=>[{who:b.id,facts:b.facts},...b.children.map(L=>({who:`${b.id} \u203A ${L.name}`,facts:L.facts}))]).flatMap(({who:b,facts:L})=>Object.entries(L).sort(([$],[q])=>$.localeCompare(q)).flatMap(([$,q])=>q.map(D=>[b,l($),$,D.file,D.line??""])))),T=i("declared",[[r.agent,24],[r.key,34],[r.value,40],[r.source,40]],n.declared.map(b=>[b.agent,b.key,b.value,b.source])),E=[h,k,p,S,A,g,v,O,T];return t.unknown.length&&E.push(i("unknown",[[r.agent,24],[r.file,50],[r.why,40],[r.kind,24]],t.unknown.map(b=>[b.agent,b.file,r.why_[b.why],b.kind??""]))),E}var Be=t=>String(t??"").normalize("NFD").replace(/[̀-ͯ]/g,"").trim().toLowerCase(),qt=Object.values(Bn),Va=(t,e)=>t.find(n=>qt.some(s=>Be(s[e])===Be(n.name)));function Wa(t,...e){let n=e.map(s=>t?.rows[0]?.findIndex(r=>qt.some(i=>Be(i[s])===Be(r)))??-1);return s=>n.map(r=>r<0?"":String(s[r]??"").trim())}var Ja=(t,e)=>e.find(([,n])=>qt.some(s=>Be(s[n])===Be(t)))?.[0],Ga=t=>t.slice(1).filter(e=>e.some(n=>String(n??"").trim())),Xa=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function Kp(t,e){let n=[],s=[],r=Va(e,"declared");if(r){let o=Wa(r,"agent","key","value","source"),a=[];Ga(r.rows).forEach((d,f)=>{let[u,h,k,m]=o(d);!u||!h?s.push(`${r.name}, ${f+2}: \xAB${o(r.rows[0])[u?1:0]}\xBB ?`):a.push({agent:u,key:h,value:k,source:m})});let l=d=>`${d.agent} ${d.key}`,c=0;for(let d of a){let f=t.declared.find(u=>l(u)===l(d));f?Xa(f,d)||n.push({key:`d${++c}`,kind:"declared",op:"set",before:f,after:d}):n.push({key:`d${++c}`,kind:"declared",op:"add",after:d})}for(let d of t.declared)a.some(f=>l(f)===l(d))||n.push({key:`d${++c}`,kind:"declared",op:"remove",before:d})}let i=Va(e,"patterns");if(i){let o=Wa(i,"key","scope","decision","why"),a=0;for(let l of Ga(i.rows)){let[c,d,f,u]=o(l);if(!c)continue;let h=t.decisions.find(y=>y.key===c);if(!f){h&&n.push({key:`p${++a}`,kind:"decision",op:"remove",before:h});continue}let k=Ja(f,[["accepted","accept"],["rejected","reject"]]),m=Ja(d,[["platform","platform"],["specialist","specialist"],["orchestrator","orchestrator"]]);if(!k)s.push(`${i.name}, ${c}: \xAB${f}\xBB \u2014 ${qt.map(y=>`${y.accept}/${y.reject}`).join(", ")}`);else if(!m)s.push(`${i.name}, ${c}: \xAB${d}\xBB \u2014 ${qt.map(y=>`${y.platform}/${y.specialist}/${y.orchestrator}`).join(", ")}`);else{let y={key:c,status:k,scope:m,why:u};h?Xa(h,y)||n.push({key:`p${++a}`,kind:"decision",op:"set",before:h,after:y}):n.push({key:`p${++a}`,kind:"decision",op:"add",after:y})}}}return{changes:n,problems:s}}function Up(t,e,n){let s={...t,declared:[...t.declared],decisions:[...t.decisions]};for(let r of e.filter(i=>n.includes(i.key)))if(r.kind==="declared"){let i=a=>`${a.agent} ${a.key}`,o=r.before?s.declared.findIndex(a=>i(a)===i(r.before)):-1;r.op==="add"?s.declared.push(r.after):r.op==="set"?s.declared[o]=r.after:s.declared.splice(o,1)}else{let i=r.before?s.decisions.findIndex(o=>o.key===r.before.key):-1;r.op==="add"?s.decisions.push(r.after):r.op==="set"?s.decisions[i]=r.after:s.decisions.splice(i,1)}return s}var Tt="#8C8578";var Kn="#C8442C",Qa="#2E8F62";var Ha=t=>Math.round(t*10)/10,Fr=t=>[Ha(t[0]),Ha(t[1])],ke=(t,e,n=22,s="start",r)=>({type:"text",at:Fr(t),text:e,size:n,anchor:s,...r?{style:{color:r}}:{}});var Za=(t,e,n)=>({type:"arrow",from:Fr(t),to:Fr(e),...n?{style:n}:{}});var Yp=(t,e)=>t.length*e*.48;function Un(t,e,n){let s=[],r="";for(let i of t.split(/\s+/).filter(Boolean)){let o=r?`${r} ${i}`:i;r&&Yp(o,e)>n?(s.push(r),r=i):r=o}return r&&s.push(r),s.length?s:[""]}var Yn=150,Pt=40,zp=24,el=250,tl=17,nl=23,jr=5,Br=4,Vp=/^(auth|model|setting|topics|connref|operation):/,Wp={en:{chapters:["The cast","What repeats","Who is off","What is missing","What to decide"],cast:(t,e)=>t?`${t} ${t===1?"orchestrator calls":"orchestrators call"} ${e} ${e===1?"specialist":"specialists"}.`:`${e} ${e===1?"specialist":"specialists"}, with no orchestrator.`,repeats:(t,e,n)=>t?`${t} patterns: ${e} of the platform, ${n} of the specialists.`:"Nothing repeats enough to be a pattern yet.",off:t=>t.length?`Off a pattern: ${t.join(", ")}.`:"Nobody is off a pattern.",missing:t=>t?`${t} ${t===1?"rule is":"rules are"} not met.`:"Every rule is met.",decide:t=>t?`${t} ${t===1?"thing":"things"} to decide.`:"Nothing left to decide.",pattern:t=>`A pattern? \xAB${t}\xBB`,platform:"platform",specialist:"specialists",more:t=>`and ${t} more on the map`,none:"nothing"},pt:{chapters:["O elenco","O que se repete","Quem est\xE1 fora","O que falta","O que decidir"],cast:(t,e)=>t?`${t} ${t===1?"orquestrador chama":"orquestradores chamam"} ${e} ${e===1?"especialista":"especialistas"}.`:`${e} ${e===1?"especialista":"especialistas"}, sem orquestrador.`,repeats:(t,e,n)=>t?`${t} padr\xF5es: ${e} da plataforma, ${n} dos especialistas.`:"Nada se repete o bastante para ser padr\xE3o ainda.",off:t=>t.length?`Fora do padr\xE3o: ${t.join(", ")}.`:"Ningu\xE9m est\xE1 fora do padr\xE3o.",missing:t=>t?`${t} ${t===1?"regra n\xE3o \xE9 cumprida":"regras n\xE3o s\xE3o cumpridas"}.`:"Todas as regras s\xE3o cumpridas.",decide:t=>t?`${t} ${t===1?"coisa":"coisas"} para decidir.`:"Nada em aberto para decidir.",pattern:t=>`Padr\xE3o? \xAB${t}\xBB`,platform:"plataforma",specialist:"especialistas",more:t=>`e mais ${t} no mapa`,none:"nada"}};function Jp(t,e,n="en"){let s=Wp[n],r=t.agents.filter($=>$.role==="orchestrator").sort(($,q)=>$.id.localeCompare(q.id)),i=t.agents.filter($=>$.role==="specialist").sort(($,q)=>$.id.localeCompare(q.id)),o=Math.max(1,Math.ceil(i.length/zp)),a=Math.max(1,Math.ceil(i.length/o)),l=Math.max(1e3,Pt*2+Math.max(a,r.length)*Yn),c=($,q)=>l/2+($-(q-1)/2)*Yn,d=[{...ke([Pt,52],t.name??s.chapters[0],30),chapter:s.chapters[0],say:`${t.name?`${t.name}: `:""}${s.cast(r.length,i.length)}`}],f=($,q,D)=>Un($,15,Yn-12).slice(0,2).forEach((B,G)=>d.push(ke([q[0],q[1]+G*18],B,15,"middle",D))),u=170,h=new Map;r.forEach(($,q)=>{let D=c(q,r.length);h.set($.id,[D,u]),d.push({type:"prop",name:"robot",at:[D,u],size:70}),f($.id,[D,u+24],Tt)}),i.forEach(($,q)=>{let D=Math.floor(q/a),B=Math.min(a,i.length-D*a),G=[c(q%a,B),340+D*el];h.set($.id,G),d.push({type:"prop",name:"robot",at:G,size:64}),f($.id,[G[0],G[1]+24])});for(let $ of r){let q=h.get($.id);for(let D of i.filter(B=>B.schemaName&&`calls:${B.schemaName}`in $.facts)){let B=h.get(D.id);B[1]===340&&d.push(Za([q[0],q[1]+44],[B[0],B[1]-76],{color:Tt}))}}let k=340+(o-1)*el+160,m=(l-Pt*2)/3,y=k,p=($,q,D,B,G)=>{let xt=Pt+$*m;d.push({...ke([xt,k],q,22,"start",G),chapter:q,say:D});let Jn=k+34,Mt=B.slice(0,jr);B.length>jr&&Mt.push(s.more(B.length-jr)),Mt.length||Mt.push(s.none);for(let yl of Mt){let It=Un(yl,tl,m-30),Ur=It.length>Br?[...It.slice(0,Br-1),`${It[Br-1]}\u2026`]:It;Ur.forEach((bl,Gn)=>d.push(ke([xt+(Gn?14:0),Jn+Gn*nl],`${Gn?"":"\xB7 "}${bl}`,tl,"start",Tt))),Jn+=Ur.length*nl+6}y=Math.max(y,Jn)},S=$=>Ka($)?0:Vp.test($)?2:1,A=t.patterns.filter($=>!$.partOf).sort(($,q)=>S($.key)-S(q.key)||($.scope===q.scope?0:$.scope==="platform"?-1:1)||q.share-$.share||$.key.localeCompare(q.key)),g=$=>$==="platform"?s.platform:s.specialist;p(0,s.chapters[1],s.repeats(t.patterns.length,t.patterns.filter($=>$.scope==="platform").length,t.patterns.filter($=>$.scope!=="platform").length),A.map($=>`${Z($.key,n,t.names)} \xB7 ${g($.scope)}${$.share<1?` \xB7 ${Math.round($.share*100)}%`:""}`),Qa);let v=[...new Set(t.offPattern.map($=>$.agent))].sort();v.forEach(($,q)=>{let D=h.get($),B=t.offPattern.filter(G=>G.agent===$).flatMap(G=>Un(jn(G.key,n,1,t.names),13,Yn-10)).slice(0,4);d.push({...ke([D[0]+34,D[1]-50],"\xD7",30,"middle",Kn),...q===0?{chapter:s.chapters[2],say:s.off(v)}:{}}),B.forEach((G,xt)=>d.push(ke([D[0],D[1]+66+xt*16],G,13,"middle",Kn)))}),v.length||d.push({...ke([l-Pt,92],s.off([]),16,"end",Tt),chapter:s.chapters[2],say:s.off([])});let O=t.gaps.flatMap($=>{let q=$.agents.filter(D=>!t.offPattern.some(B=>B.agent===D&&B.key===$.rule.has)).length;return q?[n==="pt"?`\xAB${$.rule.says}\xBB: ${q} ${Ee($.rule.role,n,q)} n\xE3o ${q===1?"cumpre":"cumprem"}`:`\xAB${$.rule.says}\xBB: ${q} ${Ee($.rule.role,n,q)} ${q===1?"does":"do"} not meet it`]:[]}),T=t.unknown.length;T&&O.push(n==="pt"?`${T} ${T===1?"arquivo n\xE3o entendido":"arquivos n\xE3o entendidos"}`:`${T} ${T===1?"file":"files"} not understood`),p(1,s.chapters[3],s.missing(e.filter($=>$.key==="gap").length),O,Kn);let{look:E}=Et(t),b=[...e.filter($=>$.key==="conflict").map($=>$[n]),...E.filter($=>!$.decision).map($=>s.pattern(Z($.key,n,t.names))),...e.filter($=>$.key==="solo").map($=>$[n])];return p(2,s.chapters[4],s.decide(b.length),b),{id:(t.name??"cast").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"cast",title:t.name??s.chapters[0],width:l,height:Math.min(4e3,y+40),background:"plain",locale:n==="pt"?"pt-BR":"en-US",steps:d}}var sl=["and","or","not"];var Kr=["person","person-pointing","person-sitting","house","car","bus","coin","phone","document","server","bank","cloud","queue","desk","computer","clock","lock","money-arrow","tree","school","hospital","factory","truck","cart","safe","bulb","gear","database","robot","ship","container","warehouse","box","pallet","shop","shelf","field","cup","function","api-gateway","cache","cluster","board","book","pencil"],zn={pessoa:"person","pessoa-apontando":"person-pointing","pessoa-sentada":"person-sitting",casa:"house",carro:"car",onibus:"bus",moeda:"coin",celular:"phone",documento:"document",servidor:"server",banco:"bank",nuvem:"cloud",fila:"queue",mesa:"desk",computador:"computer",relogio:"clock",cadeado:"lock","seta-dinheiro":"money-arrow"},Vn=t=>Kr.includes(t)?t:typeof t=="string"&&Object.hasOwn(zn,t)?zn[t]:void 0;var il=t=>Vn(t)!==void 0,w={skin:"#E8C6A5",shirt:"#A9BCC3",wood:"#D8C29C",gold:"#F2C94C",paper:"#FFFFFF",screen:"#DCE8F0",device:"#5B6B7C",roof:"#D9785F",wall:"#F3E3C3",car:"#7FA7C9",bus:"#E9C46A",green:"#7DBE8A",dark:"#4A4A4A",metal:"#C9D3DD",board:"#2F4F3F",chalk:"#F2EFE6"},C=(t,e,n,s,r,i)=>({kind:"polygon",points:[[t,e],[t+n,e],[t+n,e+s],[t,e+s]],fill:r,main:i}),P=(...t)=>({kind:"polyline",points:t});function ol(t){return[{kind:"polygon",points:[[-.15,-.72],[.15,-.72],[.19,-.38],[-.19,-.38]],fill:w.shirt,main:!0},{kind:"circle",c:[0,-.87],r:.11,fill:w.skin},...t,P([-.08,-.38],[-.1,0]),P([.08,-.38],[.1,0])]}var rl=ol([P([-.15,-.7],[-.25,-.42]),P([.15,-.7],[.25,-.42])]);function Gp(t,e,n){let s=([r,i])=>[n+r*e,i*e];return t.map(r=>r.kind==="circle"?{...r,c:s(r.c),r:r.r*e}:{...r,points:r.points.map(s)})}function Xp(){let t=[[-.28,-.3,.18],[-.06,-.45,.25],[.2,-.4,.21],[.37,-.27,.13]],e=[];for(let n=0;n<=24;n++){let s=-.46+.96*n/24,r=t.filter(([i,,o])=>Math.abs(s-i)<=o).map(([i,o,a])=>o-Math.sqrt(Math.max(0,a*a-(s-i)**2)));r.length&&e.push([s,Math.min(...r)])}return[...e,[.42,-.12],[-.4,-.12]]}var ag={person:rl,"person-pointing":ol([P([-.15,-.7],[-.25,-.42]),P([.15,-.69],[.47,-.73])]),"person-sitting":[P([-.3,-.8],[-.27,-.4]),P([-.32,-.4],[.2,-.4]),P([-.27,-.4],[-.27,0]),P([.16,-.4],[.16,0]),{kind:"polygon",points:[[-.22,-.77],[.04,-.77],[.06,-.44],[-.22,-.44]],fill:w.shirt,main:!0},{kind:"circle",c:[-.08,-.9],r:.1,fill:w.skin},P([-.1,-.44],[.3,-.44],[.32,0]),P([0,-.74],[.18,-.55],[.3,-.58])],house:[C(-.4,-.6,.8,.6,w.wall,!0),{kind:"polygon",points:[[-.5,-.58],[0,-1],[.5,-.58]],fill:w.roof},C(-.08,-.32,.16,.32,w.wood),C(.16,-.46,.16,.14,w.screen)],car:[{kind:"polygon",fill:w.car,main:!0,points:[[-.5,-.14],[-.5,-.32],[-.3,-.36],[-.18,-.56],[.2,-.56],[.32,-.36],[.5,-.32],[.5,-.14]]},{kind:"polygon",points:[[-.14,-.51],[.17,-.51],[.25,-.37],[-.22,-.37]],fill:w.screen},{kind:"circle",c:[-.28,-.12],r:.1,fill:w.dark},{kind:"circle",c:[.28,-.12],r:.1,fill:w.dark}],bus:[C(-.5,-.66,1,.52,w.bus,!0),...[-.42,-.21,0,.21].map(t=>C(t,-.6,.15,.16,w.screen)),P([-.5,-.3],[.5,-.3]),{kind:"circle",c:[-.3,-.12],r:.1,fill:w.dark},{kind:"circle",c:[.3,-.12],r:.1,fill:w.dark}],coin:[{kind:"circle",c:[0,-.42],r:.4,fill:w.gold,main:!0},{kind:"circle",c:[0,-.42],r:.3},{kind:"curve",points:[[.1,-.56],[-.08,-.57],[-.09,-.46],[.08,-.39],[.08,-.29],[-.11,-.28]]},P([0,-.64],[0,-.2])],phone:[C(-.26,-1,.52,1,w.device,!0),C(-.2,-.92,.4,.76,w.screen),{kind:"circle",c:[0,-.08],r:.035,fill:w.paper}],document:[{kind:"polygon",points:[[-.36,-1],[.16,-1],[.36,-.8],[.36,0],[-.36,0]],fill:w.paper,main:!0},P([.16,-1],[.16,-.8],[.36,-.8]),...[-.66,-.5,-.34,-.18].map(t=>P([-.22,t],[.22,t]))],server:[-1,-.66,-.32].flatMap(t=>[C(-.36,t,.72,.3,w.metal,!0),P([-.26,t+.15],[.06,t+.15]),{kind:"circle",c:[.22,t+.15],r:.035,fill:w.green}]),bank:[{kind:"polygon",points:[[-.5,-.74],[0,-1],[.5,-.74]],fill:w.wall,main:!0},C(-.45,-.74,.9,.08,w.wall),...[-.33,-.11,.11,.33].map(t=>C(t-.04,-.66,.08,.56,w.paper)),C(-.5,-.1,1,.1,w.wall)],cloud:[{kind:"polygon",points:Xp(),fill:w.paper,main:!0}],queue:[-.32,0,.32].flatMap(t=>Gp(rl,.7,t)),desk:[C(-.5,-.5,1,.07,w.wood,!0),P([-.42,-.43],[-.42,0]),P([.42,-.43],[.42,0])],computer:[C(-.45,-1,.9,.6,w.device,!0),C(-.39,-.94,.78,.48,w.screen),{kind:"polygon",points:[[-.06,-.4],[.06,-.4],[.1,-.1],[-.1,-.1]],fill:w.device},C(-.25,-.1,.5,.08,w.device)],clock:[{kind:"circle",c:[0,-.48],r:.45,fill:w.paper,main:!0},...[[0,-.9,0,-.82],[.42,-.48,.34,-.48],[0,-.06,0,-.14],[-.42,-.48,-.34,-.48]].map(([t,e,n,s])=>P([t,e],[n,s])),P([0,-.48],[0,-.78]),P([0,-.48],[.2,-.48])],lock:[{kind:"curve",points:[[-.22,-.52],[-.22,-.76],[0,-.96],[.22,-.76],[.22,-.52]]},C(-.36,-.54,.72,.54,w.bus,!0),{kind:"circle",c:[0,-.32],r:.06,fill:w.dark},P([0,-.28],[0,-.14])],"money-arrow":[{kind:"polygon",fill:w.green,main:!0,points:[[-.5,-.4],[.12,-.4],[.12,-.56],[.5,-.3],[.12,-.04],[.12,-.2],[-.5,-.2]]},{kind:"circle",c:[-.2,-.3],r:.16,fill:w.gold},P([-.2,-.4],[-.2,-.2])],tree:[C(-.07,-.36,.14,.36,w.wood),{kind:"circle",c:[0,-.64],r:.3,fill:w.green,main:!0}],school:[C(-.45,-.6,.9,.6,w.wall,!0),{kind:"polygon",points:[[-.5,-.6],[0,-.82],[.5,-.6]],fill:w.roof},C(-.08,-.28,.16,.28,w.wood),C(-.36,-.48,.16,.12,w.screen),C(.2,-.48,.16,.12,w.screen),P([0,-.82],[0,-1]),{kind:"polygon",points:[[0,-1],[.17,-.95],[0,-.9]],fill:w.roof}],hospital:[C(-.4,-.8,.8,.8,w.paper,!0),C(-.045,-.7,.09,.26,"#C8442C"),C(-.13,-.615,.26,.09,"#C8442C"),C(-.1,-.24,.2,.24,w.metal)],factory:[{kind:"polygon",points:[[-.5,0],[-.5,-.5],[-.25,-.65],[-.25,-.5],[0,-.65],[0,-.5],[.25,-.65],[.25,-.5],[.5,-.5],[.5,0]],fill:w.wall,main:!0},C(.3,-.95,.12,.3,w.dark),C(-.38,-.32,.16,.12,w.screen),C(-.08,-.32,.16,.12,w.screen),C(.22,-.32,.16,.12,w.screen)],truck:[C(-.5,-.62,.62,.46,w.metal,!0),{kind:"polygon",points:[[.12,-.16],[.12,-.5],[.34,-.5],[.48,-.32],[.48,-.16]],fill:w.bus},{kind:"polygon",points:[[.18,-.46],[.32,-.46],[.42,-.33],[.18,-.33]],fill:w.screen},{kind:"circle",c:[-.3,-.1],r:.1,fill:w.dark},{kind:"circle",c:[.3,-.1],r:.1,fill:w.dark}],cart:[P([-.48,-.78],[-.4,-.62]),{kind:"polygon",points:[[-.4,-.62],[.42,-.62],[.32,-.26],[-.3,-.26]],fill:w.metal,main:!0},P([-.3,-.26],[-.3,-.14],[.32,-.14]),{kind:"circle",c:[-.22,-.07],r:.06,fill:w.dark},{kind:"circle",c:[.24,-.07],r:.06,fill:w.dark}],safe:[C(-.4,-.82,.8,.82,w.device,!0),C(-.3,-.72,.6,.62,w.metal),{kind:"circle",c:[0,-.41],r:.13,fill:w.paper},P([0,-.41],[.08,-.47])],bulb:[{kind:"circle",c:[0,-.62],r:.3,fill:w.gold,main:!0},C(-.13,-.33,.26,.2,w.metal),{kind:"curve",points:[[-.09,-.52],[0,-.66],[.09,-.52]]},P([-.08,-.08],[.08,-.08])],gear:[{kind:"polygon",points:[[.42,-.5],[.296,-.378],[.297,-.203],[.122,-.204],[0,-.08],[-.122,-.204],[-.297,-.203],[-.296,-.378],[-.42,-.5],[-.296,-.622],[-.297,-.797],[-.122,-.796],[-0,-.92],[.122,-.796],[.297,-.797],[.296,-.622]],fill:w.metal,main:!0},{kind:"circle",c:[0,-.5],r:.12,fill:w.paper}],database:[{kind:"polygon",points:[[-.35,-.8],[.35,-.8],[.35,-.16],[-.35,-.16]],fill:w.screen,main:!0},{kind:"polygon",points:[[.35,-.8],[.303,-.755],[.175,-.722],[0,-.71],[-.175,-.722],[-.303,-.755],[-.35,-.8],[-.303,-.845],[-.175,-.878],[-0,-.89],[.175,-.878],[.303,-.845]],fill:w.metal},{kind:"curve",points:[[-.35,-.16],[0,-.06],[.35,-.16]]},{kind:"curve",points:[[-.35,-.58],[0,-.48],[.35,-.58]]},{kind:"curve",points:[[-.35,-.37],[0,-.27],[.35,-.37]]}],robot:[P([0,-.95],[0,-1]),C(-.22,-.95,.44,.3,w.metal),{kind:"circle",c:[-.09,-.81],r:.045,fill:w.screen},{kind:"circle",c:[.09,-.81],r:.045,fill:w.screen},C(-.28,-.62,.56,.42,w.metal,!0),P([-.28,-.55],[-.42,-.35]),P([.28,-.55],[.42,-.35]),C(-.2,-.2,.12,.2,w.device),C(.08,-.2,.12,.2,w.device)],ship:[{kind:"polygon",points:[[-.48,-.3],[.48,-.3],[.36,-.04],[-.4,-.04]],fill:w.car,main:!0},C(-.42,-.62,.14,.32,w.wall),C(-.24,-.5,.2,.2,w.roof),C(-.02,-.5,.2,.2,w.bus),C(.2,-.5,.2,.2,w.green),{kind:"curve",points:[[-.5,0],[-.3,-.04],[-.1,0],[.1,-.04],[.3,0],[.5,-.04]]}],container:[C(-.46,-.52,.92,.52,w.roof,!0),...[-.3,-.15,0,.15,.3].map(t=>P([t,-.48],[t,-.04]))],warehouse:[{kind:"polygon",points:[[-.46,0],[.46,0],[.46,-.55],[0,-.82],[-.46,-.55]],fill:w.wall,main:!0},C(-.2,-.38,.4,.38,w.metal),P([-.2,-.26],[.2,-.26]),P([-.2,-.13],[.2,-.13])],box:[C(-.36,-.5,.52,.5,w.wood,!0),{kind:"polygon",points:[[-.36,-.5],[.16,-.5],[.36,-.64],[-.16,-.64]],fill:w.wood},{kind:"polygon",points:[[.16,0],[.36,-.14],[.36,-.64],[.16,-.5]],fill:w.wood},P([-.1,-.5],[.1,-.64])],pallet:[C(-.46,-.12,.92,.06,w.wood),...[-.42,-.05,.32].map(t=>C(t,-.06,.1,.06,w.wood)),C(-.42,-.5,.4,.38,w.wood,!0),C(.02,-.5,.4,.38,w.wood),C(-.2,-.82,.4,.32,w.wood)],shop:[C(-.42,-.6,.84,.6,w.wall,!0),{kind:"polygon",points:[[-.48,-.6],[.48,-.6],[.42,-.78],[-.42,-.78]],fill:w.roof},C(-.34,-.48,.34,.26,w.screen),C(.08,-.42,.24,.42,w.wood)],shelf:[C(-.4,-.92,.8,.92,w.paper,!0),P([-.4,-.62],[.4,-.62]),P([-.4,-.32],[.4,-.32]),C(-.32,-.8,.16,.18,w.roof),C(-.1,-.78,.14,.16,w.bus),C(.1,-.5,.22,.18,w.green),C(-.3,-.2,.24,.2,w.wood)],field:[P([-.48,0],[.48,0]),...[-.3,0,.3].flatMap(t=>[{kind:"curve",points:[[t,0],[t-.02,-.25],[t,-.5]]},{kind:"circle",c:[t-.08,-.32],r:.07,fill:w.green,main:!0},{kind:"circle",c:[t+.08,-.42],r:.07,fill:w.green,main:!0},{kind:"circle",c:[t,-.52],r:.06,fill:w.roof}])],cup:[{kind:"polygon",points:[[-.26,-.52],[.26,-.52],[.2,-.1],[-.2,-.1]],fill:w.paper,main:!0},{kind:"curve",points:[[.24,-.44],[.4,-.38],[.22,-.2]]},{kind:"polygon",points:[[-.46,-.1],[.46,-.1],[.36,0],[-.36,0]],fill:w.paper},{kind:"curve",points:[[-.08,-.62],[-.02,-.72],[-.08,-.84]]},{kind:"curve",points:[[.08,-.62],[.14,-.72],[.08,-.84]]}],function:[C(-.38,-.72,.76,.62,w.screen,!0),P([-.14,-.62],[0,-.62],[.14,-.2]),P([.02,-.42],[-.14,-.2])],"api-gateway":[C(-.12,-.8,.24,.8,w.metal,!0),P([-.48,-.55],[-.16,-.55]),P([-.24,-.62],[-.16,-.55],[-.24,-.48]),P([.16,-.3],[.48,-.3]),P([.4,-.37],[.48,-.3],[.4,-.23])],cache:[C(-.34,-.66,.68,.66,w.metal,!0),{kind:"polygon",points:[[.04,-.58],[-.12,-.3],[0,-.3],[-.06,-.08],[.14,-.38],[.02,-.38]],fill:w.gold}],cluster:[{kind:"curve",points:[[-.4,-.8],[0,-.86],[.4,-.8],[.48,-.45],[.4,-.1],[0,-.04],[-.4,-.1],[-.48,-.45],[-.4,-.8]]},C(-.3,-.7,.24,.2,w.screen,!0),C(.06,-.7,.24,.2,w.screen,!0),C(-.12,-.38,.24,.2,w.screen,!0)],board:[C(-.48,-.9,.96,.6,w.board,!0),C(-.34,-.76,.42,.03,w.chalk),C(-.34,-.62,.58,.03,w.chalk),C(-.34,-.48,.3,.03,w.chalk),P([-.3,-.3],[-.36,0]),P([.3,-.3],[.36,0])],book:[{kind:"polygon",points:[[0,-.62],[-.46,-.7],[-.46,-.1],[0,-.04]],fill:w.paper,main:!0},{kind:"polygon",points:[[0,-.62],[.46,-.7],[.46,-.1],[0,-.04]],fill:w.paper,main:!0},P([-.36,-.52],[-.1,-.48]),P([-.36,-.38],[-.1,-.34]),P([.1,-.48],[.36,-.52]),P([.1,-.34],[.36,-.38])],pencil:[{kind:"polygon",points:[[-.38,-.12],[.22,-.72],[.34,-.6],[-.26,0]],fill:w.bus,main:!0},{kind:"polygon",points:[[.22,-.72],[.34,-.6],[.44,-.86]],fill:w.wood},{kind:"polygon",points:[[-.38,-.12],[-.26,0],[-.46,-.02]],fill:w.roof}]},al=["happy","sad","surprised","worried","idea"],Hp={person:[0,-.87,.11],"person-pointing":[0,-.87,.11],"person-sitting":[-.08,-.9,.1]},ll=t=>{let e=Vn(t);return!!e&&e in Hp};var cl=["spin","drive","steam","talk","pulse","float"],Qp=["lesson","pitch","arch","decision","data","timeline","story"],fl=8,ul=6,dl=2e5,pl=6e5,hl=24;var gl=["card","line","arrow","polyline","polygon","curve","circle","ellipse","plot","text","highlight","pause","prop","repeat","when","move","link","counter","row","column","grid","axis","timeline","balloon","brace","note","table","bars","chain","animate","lottie"],Ke=["text","prop","card","counter","circle","ellipse"],ml=["row","column","grid","chain"],Zp=50;function F(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e}: expected an object.`)}function R(t,e){if(typeof t!="string"||!t.trim()||t.length>2e3)throw new Error(`${e}: expected text of 1 to 2000 characters.`)}function x(t,e,n=-1e4,s=1e4){if(typeof t!="number"||!Number.isFinite(t)||t<n||t>s)throw new Error(`${e}: expected a number between ${n} and ${s}.`)}function W(t,e){if(typeof t=="string"){if(R(t,e),t.length>300)throw new Error(`${e}: expression too long.`)}else x(t,e)}function V(t,e){if(!Array.isArray(t)||t.length!==2)throw new Error(`${e}: expected [x, y].`);t.forEach((n,s)=>W(n,`${e}[${s}]`))}function te(t,e){t!==void 0&&R(t,e)}function J(t,e,n){if(t!==void 0&&(typeof t!="string"||!e.includes(t)))throw new Error(`${n}: choose one of ${e.join(", ")}.`)}function Wn(t){if(!/^[A-Za-z_][A-Za-z_0-9]*$/.test(t)||["__proto__","constructor","prototype",...sl].includes(t))throw new Error(`Invalid variable name: "${t}".`)}var Ue=(t,e)=>e.includes("{")||t.exact.has(e)||[...t.repeated].some(n=>e.startsWith(`${n}-`)&&/^\d+$/.test(e.slice(n.length+1)));function Ce(t,e,n,s){s&&t[e]===void 0&&(t[e]=[0,0]),V(t[e],`${n}.${e}`)}function Lt(t,e,n,s,r=!1){if(F(t,e),++n.count>500)throw new Error(`${e}: a recipe draws at most 500 steps, counting those inside repeat and when.`);if(s){for(let a of["chapter","say","duration"])if(t[a]!==void 0)throw new Error(`${e}.${a}: put it on the ${s} step itself, not on a step inside it.`);if(t.type==="pause")throw new Error(`${e}: a pause cannot go inside ${s}.`);if(t.type==="repeat"&&s==="repeat")throw new Error(`${e}: a repeat cannot go inside another repeat.`);if(ml.includes(s)&&t.place!==void 0)throw new Error(`${e}.place: the ${s} places the steps inside it.`)}if(!gl.includes(t.type))throw new Error(`${e}: unknown type "${t.type}".`);for(let a of["id","say","chapter"])te(t[a],`${e}.${a}`);if(t.duration!==void 0&&x(t.duration,`${e}.duration`,0,3e4),t.nudge!==void 0){if(["pause","move","link","animate"].includes(t.type))throw new Error(`${e}.nudge: a ${t.type} has no place of its own to move.`);if(!Array.isArray(t.nudge)||t.nudge.length!==2)throw new Error(`${e}.nudge: use [dx, dy].`);t.nudge.forEach((a,l)=>x(a,`${e}.nudge[${l}]`,-900,900))}let i=s!==null&&ml.includes(s)||r;if(t.place!==void 0){if(!Ke.includes(t.type))throw new Error(`${e}.place: only ${Ke.join(", ")} can be placed.`);if(F(t.place,`${e}.place`),R(t.place.to,`${e}.place.to`),!Ue(n,String(t.place.to)))throw new Error(`${e}.place.to: no earlier step has the id "${t.place.to}".`);if(!["below","above","left","right"].includes(t.place.side))throw new Error(`${e}.place.side: choose one of below, above, left, right.`);t.place.gap!==void 0&&x(t.place.gap,`${e}.place.gap`,-200,400),J(t.place.align,["center","start","end"],`${e}.place.align`)}let o=i||t.place!==void 0;if(t.style!==void 0){F(t.style,`${e}.style`);for(let a of["color","fill"]){let l=t.style[a];if(l!==void 0&&(typeof l!="string"||!/^(#[\da-f]{3,8}|[a-z]+)$/i.test(l)))throw new Error(`${e}.style.${a}: use a hex colour or a colour name, no URLs.`)}for(let a of["width","roughness","bowing"])t.style[a]!==void 0&&x(t.style[a],`${e}.style.${a}`,0,20);if(t.style.opacity!==void 0&&x(t.style.opacity,`${e}.style.opacity`,0,1),t.style.dashed!==void 0&&typeof t.style.dashed!="boolean")throw new Error(`${e}: dashed must be a boolean.`);J(t.style.fillStyle,["hachure","solid","zigzag","cross-hatch","dots"],`${e}.style.fillStyle`)}switch(t.type){case"line":case"arrow":case"highlight":V(t.from,`${e}.from`),V(t.to,`${e}.to`),t.thickness!==void 0&&x(t.thickness,`${e}.thickness`,1,200);break;case"polyline":case"polygon":case"curve":if(!Array.isArray(t.points)||t.points.length<(t.type==="polygon"?3:2)||t.points.length>500)throw new Error(`${e}: points needs ${t.type==="polygon"?3:2} to 500 points.`);t.points.forEach((a,l)=>V(a,`${e}.points[${l}]`));break;case"circle":case"ellipse":Ce(t,"center",e,o);for(let a of t.type==="circle"?["r"]:["rx","ry"])W(t[a],`${e}.${a}`),typeof t[a]=="number"&&x(t[a],`${e}.${a}`,0);break;case"text":Ce(t,"at",e,o),R(t.text,`${e}.text`),t.size!==void 0&&x(t.size,`${e}.size`,1,200),t.rotate!==void 0&&x(t.rotate,`${e}.rotate`,-360,360),J(t.font,["hand","body"],`${e}.font`),J(t.anchor,["start","middle","end"],`${e}.anchor`);break;case"card":Ce(t,"at",e,o),W(t.w,`${e}.w`),W(t.h,`${e}.h`);for(let a of["w","h"])typeof t[a]=="number"&&x(t[a],`${e}.${a}`,40);if(R(t.title,`${e}.title`),t.lines!==void 0){if(!Array.isArray(t.lines)||t.lines.length>6)throw new Error(`${e}: at most 6 lines per card.`);t.lines.forEach((a,l)=>R(a,`${e}.lines[${l}]`))}break;case"plot":R(t.fn,`${e}.fn`),t.var!==void 0&&(R(t.var,`${e}.var`),Wn(String(t.var))),V(t.domain,`${e}.domain`),V(t.range,`${e}.range`),F(t.box,`${e}.box`);for(let a of["x","y","w","h"])W(t.box[a],`${e}.box.${a}`);if(t.samples!==void 0&&(x(t.samples,`${e}.samples`,2,1e3),!Number.isInteger(t.samples)))throw new Error(`${e}: samples must be an integer.`);break;case"pause":x(t.ms,`${e}.ms`,0,3e4),te(t.ask,`${e}.ask`);break;case"prop":if(!il(t.name)&&!n.figures.has(String(t.name))){let a=n.figures.size?`, or one the recipe defines (${[...n.figures].join(", ")})`:"";throw new Error(`${e}.name: unknown prop "${String(t.name)}"; use one of ${Kr.join(", ")}${a}.`)}if(Ce(t,"at",e,o),t.size!==void 0&&(W(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,10,1e3)),te(t.label,`${e}.label`),t.flip!==void 0&&typeof t.flip!="boolean")throw new Error(`${e}.flip: expected true or false.`);if(t.mood!==void 0){if(!ll(t.name))throw new Error(`${e}.mood: only a person (person, person-pointing, person-sitting) has a face.`);J(t.mood,al,`${e}.mood`)}break;case"repeat":if(W(t.times,`${e}.times`),typeof t.times=="number"&&(x(t.times,`${e}.times`,0,Zp),!Number.isInteger(t.times)))throw new Error(`${e}.times: expected a whole number.`);Lt(t.step,`${e}.step`,n,"repeat",i);break;case"when":if(W(t.if,`${e}.if`),!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>50)throw new Error(`${e}.steps: expected 1 to 50 steps.`);t.steps.forEach((a,l)=>Lt(a,`${e}.steps[${l}]`,n,s??"when"));break;case"move":if(R(t.target,`${e}.target`),!Ue(n,String(t.target)))throw new Error(`${e}.target: no earlier step has the id "${t.target}".`);V(t.to,`${e}.to`),J(t.along,["line","curve"],`${e}.along`),t.ms!==void 0&&x(t.ms,`${e}.ms`,200,5e3);break;case"lottie":if(R(t.src,`${e}.src`),V(t.at,`${e}.at`),t.size!==void 0&&(W(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,24,1e3)),t.loop!==void 0&&typeof t.loop!="boolean")throw new Error(`${e}.loop: expected true or false.`);break;case"animate":if(R(t.target,`${e}.target`),!Ue(n,String(t.target)))throw new Error(`${e}.target: no earlier step has the id "${t.target}".`);if(J(t.effect,[...cl,"stop"],`${e}.effect`),t.effect===void 0)throw new Error(`${e}.effect: choose one of ${[...cl,"stop"].join(", ")}.`);J(t.speed,["slow","fast"],`${e}.speed`);break;case"link":for(let a of["from","to"])if(R(t[a],`${e}.${a}`),!Ue(n,String(t[a])))throw new Error(`${e}.${a}: no earlier step has the id "${t[a]}".`);te(t.label,`${e}.label`);break;case"counter":if(Ce(t,"at",e,o),W(t.value,`${e}.value`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "R$ {v:0}".`);t.size!==void 0&&x(t.size,`${e}.size`,1,200),J(t.anchor,["start","middle","end"],`${e}.anchor`);break;case"row":case"column":case"grid":if(i)throw new Error(`${e}: a ${t.type} cannot go inside another ${s}.`);if(Ce(t,"at",e,!1),t.gap!==void 0&&x(t.gap,`${e}.gap`,0,400),t.type==="grid"){if(x(t.columns,`${e}.columns`,1,12),!Number.isInteger(t.columns))throw new Error(`${e}.columns: expected a whole number.`)}else J(t.align,["center","start","end"],`${e}.align`);if(!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>50)throw new Error(`${e}.steps: expected 1 to 50 steps.`);t.steps.forEach((a,l)=>{F(a,`${e}.steps[${l}]`);let c=a.type==="repeat"?a.step?.type:a.type;if(!Ke.includes(c))throw new Error(`${e}.steps[${l}]: a ${t.type} holds only ${Ke.join(", ")} (or a repeat of one).`);Lt(a,`${e}.steps[${l}]`,n,t.type)});break;case"chain":if(i)throw new Error(`${e}: a chain cannot go inside a ${s}.`);if(Ce(t,"at",e,!1),t.gap!==void 0&&t.gap!=="auto"&&x(t.gap,`${e}.gap`,0,400),J(t.direction,["right","down"],`${e}.direction`),t.wrap!==void 0&&typeof t.wrap!="boolean")throw new Error(`${e}.wrap: expected true or false.`);if(te(t.forward,`${e}.forward`),te(t.back,`${e}.back`),t.size!==void 0&&(W(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,10,1e3)),!Array.isArray(t.steps)||t.steps.length<2||t.steps.length>12)throw new Error(`${e}.steps: a chain joins 2 to 12 pieces.`);t.steps.forEach((a,l)=>{if(F(a,`${e}.steps[${l}]`),!Ke.includes(a.type))throw new Error(`${e}.steps[${l}]: a chain holds only ${Ke.join(", ")}.`);Lt(a,`${e}.steps[${l}]`,n,"chain")});break;case"axis":case"timeline":if(V(t.from,`${e}.from`),V(t.to,`${e}.to`),V(t.domain,`${e}.domain`),t.type==="axis"){if(t.ticks!==void 0){if(Array.isArray(t.ticks)){if(t.ticks.length>30)throw new Error(`${e}.ticks: at most 30 marks.`);t.ticks.forEach((a,l)=>x(a,`${e}.ticks[${l}]`))}else if(x(t.ticks,`${e}.ticks`,0,30),!Number.isInteger(t.ticks))throw new Error(`${e}.ticks: expected a whole number.`)}if(te(t.label,`${e}.label`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "{v} km".`)}else{if(!Array.isArray(t.marks)||t.marks.length===0||t.marks.length>20)throw new Error(`${e}.marks: expected 1 to 20 marks.`);t.marks.forEach((a,l)=>{F(a,`${e}.marks[${l}]`),W(a.at,`${e}.marks[${l}].at`),te(a.label,`${e}.marks[${l}].label`),te(a.text,`${e}.marks[${l}].text`)})}break;case"balloon":if(R(t.to,`${e}.to`),!Ue(n,String(t.to)))throw new Error(`${e}.to: no earlier step has the id "${t.to}".`);if(R(t.text,`${e}.text`),String(t.text).length>300)throw new Error(`${e}.text: keep a balloon under 300 characters.`);J(t.side,["below","above","left","right"],`${e}.side`),J(t.kind,["speech","thought"],`${e}.kind`),t.width!==void 0&&x(t.width,`${e}.width`,80,600),t.size!==void 0&&x(t.size,`${e}.size`,12,60);break;case"brace":if(V(t.from,`${e}.from`),V(t.to,`${e}.to`),te(t.label,`${e}.label`),t.flip!==void 0&&typeof t.flip!="boolean")throw new Error(`${e}.flip: expected true or false.`);break;case"note":if(V(t.at,`${e}.at`),R(t.text,`${e}.text`),t.to===void 0==(t.point===void 0))throw new Error(`${e}: a note points either to an element (to) or to a point (point).`);if(t.to!==void 0){if(R(t.to,`${e}.to`),!Ue(n,String(t.to)))throw new Error(`${e}.to: no earlier step has the id "${t.to}".`)}else V(t.point,`${e}.point`);t.size!==void 0&&x(t.size,`${e}.size`,12,60);break;case"table":if(V(t.at,`${e}.at`),!Array.isArray(t.rows)||t.rows.length===0||t.rows.length>12)throw new Error(`${e}.rows: expected 1 to 12 rows.`);if(t.rows.forEach((a,l)=>{if(!Array.isArray(a)||a.length===0||a.length>6)throw new Error(`${e}.rows[${l}]: expected 1 to 6 cells.`);a.forEach((c,d)=>{if(typeof c!="string"||c.length>120)throw new Error(`${e}.rows[${l}][${d}]: expected text of up to 120 characters.`)})}),t.header!==void 0&&typeof t.header!="boolean")throw new Error(`${e}.header: expected true or false.`);t.size!==void 0&&x(t.size,`${e}.size`,12,40);break;case"bars":F(t.box,`${e}.box`);for(let a of["x","y","w","h"])W(t.box[a],`${e}.box.${a}`);if(!Array.isArray(t.values)||t.values.length===0||t.values.length>12)throw new Error(`${e}.values: expected 1 to 12 values.`);if(t.values.forEach((a,l)=>W(a,`${e}.values[${l}]`)),t.labels!==void 0){if(!Array.isArray(t.labels)||t.labels.length>t.values.length)throw new Error(`${e}.labels: at most one label per value.`);t.labels.forEach((a,l)=>R(a,`${e}.labels[${l}]`))}if(t.max!==void 0&&W(t.max,`${e}.max`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "{v}%".`);break}typeof t.id=="string"&&(s==="repeat"?n.repeated:n.exact).add(t.id)}function eh(t,e){let n=`defs.${t}`;if(!/^[a-z][a-z0-9-]{1,30}$/.test(t))throw new Error(`${n}: a figure's name is 2 to 31 lowercase letters, digits or -, starting with a letter.`);if(Vn(t)||Object.hasOwn(zn,t)||gl.includes(t)||["define","title","param","switch","var"].includes(t))throw new Error(`${n}: "${t}" is already a prop or a step; choose another name.`);if(F(e,n),!Array.isArray(e.shapes)||e.shapes.length===0||e.shapes.length>hl)throw new Error(`${n}.shapes: expected 1 to ${hl} shapes.`);let s=(r,i)=>{if(typeof r!="number"||!Number.isInteger(r)||r<0||r>100)throw new Error(`${i}: expected a whole number from 0 to 100 (the figure's grid, y down; it stands at 50,100).`)};e.shapes.forEach((r,i)=>{let o=`${n}.shapes[${i}]`;if(F(r,o),r.fill!==void 0&&(typeof r.fill!="string"||!/^(#[0-9a-fA-F]{3,8}|[a-z]{3,20})$/.test(r.fill)))throw new Error(`${o}.fill: a colour, as hex or a plain name.`);if(r.kind==="circle"){if(!Array.isArray(r.c)||r.c.length!==2)throw new Error(`${o}.c: expected [x, y].`);r.c.forEach((l,c)=>s(l,`${o}.c[${c}]`)),s(r.r,`${o}.r`);return}if(!["polygon","polyline","curve"].includes(r.kind))throw new Error(`${o}.kind: choose one of polygon, polyline, curve, circle.`);let a=r.kind==="polygon"?3:2;if(!Array.isArray(r.points)||r.points.length<a||r.points.length>40)throw new Error(`${o}.points: a ${r.kind} takes ${a} to 40 points.`);r.points.forEach((l,c)=>{if(!Array.isArray(l)||l.length!==2)throw new Error(`${o}.points[${c}]: expected [x, y].`);l.forEach((d,f)=>s(d,`${o}.points[${c}][${f}]`))})})}function th(t,e){let n=`lottie "${t}"`;F(e,n);let s=JSON.stringify(e).length;if(s>dl)throw new Error(`${n}: ${Math.round(s/1e3)} KB; an animation can have at most ${dl/1e3} KB.`);for(let i of["fr","ip","op","w","h"])x(e[i],`${n}.${i}`,0,1e5);if(typeof e.v!="string"||!Array.isArray(e.layers))throw new Error(`${n}: not a Lottie animation (it needs v and layers).`);let r=(i,o)=>{if(Array.isArray(i))return i.forEach((a,l)=>r(a,`${o}[${l}]`));if(!(!i||typeof i!="object"))for(let[a,l]of Object.entries(i)){if(a==="x"&&typeof l=="string")throw new Error(`${n}: the animation has an expression (code inside it, at ${o}); only animations without expressions play.`);r(l,`${o}.${a}`)}};r(e.layers,"layers");for(let i of Array.isArray(e.assets)?e.assets:[]){let o=i?.p;if(typeof o=="string"&&o&&!o.startsWith("data:")&&!Array.isArray(i.layers))throw new Error(`${n}: an image from outside the animation ("${o.slice(0,40)}"); only images inside it (data:) are kept.`)}return s}function nh(t){F(t,"The recipe");let e=t;x(e.width,"width",100,4e3),x(e.height,"height",100,4e3);for(let r of["id","title","category"])te(e[r],r);if(e.locale!==void 0&&!(typeof e.locale=="string"&&/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(e.locale)&&Intl.NumberFormat.supportedLocalesOf([e.locale]).length>0))throw new Error('locale: expected a language tag such as "en-US" or "pt-BR".');if(J(e.background,["dots","grid","plain"],"background"),J(e.kind,Qp,"kind"),te(e.source,"source"),e.quiz!==void 0&&e.kind!==void 0&&e.kind!=="lesson")throw new Error(`quiz: only a lesson has a quiz (this drawing is a ${e.kind}).`);if(J(e.theme,["paper","chalkboard"],"theme"),e.quiz!==void 0){if(F(e.quiz,"quiz"),R(e.quiz.question,"quiz.question"),!Array.isArray(e.quiz.options)||e.quiz.options.length<2||e.quiz.options.length>4)throw new Error("quiz.options: expected 2 to 4 options.");if(e.quiz.options.forEach((r,i)=>{if(F(r,`quiz.options[${i}]`),R(r.text,`quiz.options[${i}].text`),R(r.why,`quiz.options[${i}].why`),typeof r.right!="boolean")throw new Error(`quiz.options[${i}].right: expected true or false.`)}),e.quiz.options.filter(r=>r.right===!0).length!==1)throw new Error("quiz.options: exactly one option is right.")}if(e.learning!==void 0){F(e.learning,"learning");for(let r of["goal","question","answer","caveat"])R(e.learning[r],`learning.${r}`)}if(e.params!==void 0){F(e.params,"params");for(let[r,i]of Object.entries(e.params))if(Wn(r),F(i,`params.${r}`),R(i.label,`params.${r}.label`),x(i.min,`${r}.min`),x(i.max,`${r}.max`),x(i.step,`${r}.step`,1e-6),x(i.value,`${r}.value`,i.min,i.max),i.max<=i.min)throw new Error(`${r}: max must be greater than min.`)}if(e.vars!==void 0){F(e.vars,"vars");for(let[r,i]of Object.entries(e.vars))Wn(r),W(i,`vars.${r}`)}if(e.switches!==void 0){F(e.switches,"switches");let r=Object.entries(e.switches);if(r.length>8)throw new Error("switches: at most 8.");for(let[i,o]of r){if(Wn(i),Object.hasOwn(e.params??{},i)||Object.hasOwn(e.vars??{},i))throw new Error(`switches.${i}: the name is already a param or a var.`);if(F(o,`switches.${i}`),R(o.label,`switches.${i}.label`),typeof o.on!="boolean")throw new Error(`switches.${i}.on: expected true or false.`)}}if(!Array.isArray(e.steps)||e.steps.length===0||e.steps.length>250)throw new Error("A recipe needs 1 to 250 steps.");let n=new Set;if(e.defs!==void 0){F(e.defs,"defs");let r=Object.entries(e.defs);if(r.length>fl)throw new Error(`defs: at most ${fl} figures.`);for(let[i,o]of r)eh(i,o),n.add(i)}if(e.lotties!==void 0){F(e.lotties,"lotties");let r=Object.entries(e.lotties);if(r.length>ul)throw new Error(`lotties: at most ${ul} animations.`);let i=r.reduce((o,[a,l])=>o+th(a,l),0);if(i>pl)throw new Error(`lotties: ${Math.round(i/1e3)} KB in all; at most ${pl/1e3} KB.`)}if(e.credits!==void 0){if(!Array.isArray(e.credits)||e.credits.length>5)throw new Error("credits: at most 5 lines.");e.credits.forEach((r,i)=>R(r,`credits[${i}]`))}let s={exact:new Set,repeated:new Set,count:0,figures:n};return e.steps.forEach((r,i)=>Lt(r,`Step ${i+1}`,s,null)),{...e,id:e.id??"pasted",title:e.title??"",background:e.background??"dots"}}export{Ir as DEFAULT_PROFILE,Wr as agentsIn,Up as applyChanges,Ep as compare,op as extractAgent,Kp as fromSheets,Et as groupPatterns,ap as knownKinds,Z as labelOf,Jp as lessonOf,kp as problemText,mp as readCast,cp as readProfile,qp as reviewCast,nh as validateScene,Dp as workbookFile,Bp as workbookOf,wp as writeCast};