house-lights 1.2.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/package.json +1 -1
  2. package/skills/cast-list/assets/map.html +80 -33
  3. package/skills/cast-list/examples/agents/bodega-cupons/actions/AbrirChamadoERP.mcs.yml +15 -0
  4. package/skills/cast-list/examples/agents/bodega-cupons/actions/ConsultarCuponsAtivos.mcs.yml +1 -1
  5. package/skills/cast-list/examples/agents/bodega-cupons/actions/EnviarCupomEmail.mcs.yml +1 -1
  6. package/skills/cast-list/examples/agents/bodega-cupons/actions/PromocoesMCP.mcs.yml +1 -1
  7. package/skills/cast-list/examples/agents/bodega-cupons/agent.mcs.yml +12 -0
  8. package/skills/cast-list/examples/agents/bodega-cupons/connectionreferences.mcs.yml +7 -7
  9. package/skills/cast-list/examples/agents/bodega-cupons/topics/ConsultarRegulamentoCupons.topic.mcs.yml +3 -3
  10. package/skills/cast-list/examples/agents/bodega-cupons/topics/Escalate.topic.mcs.yml +1 -1
  11. package/skills/cast-list/examples/agents/bodega-cupons/topics/Fallback.topic.mcs.yml +5 -5
  12. package/skills/cast-list/examples/agents/bodega-cupons/topics/Greeting.topic.mcs.yml +1 -1
  13. package/skills/cast-list/examples/agents/bodega-cupons/topics/OnError.topic.mcs.yml +7 -7
  14. package/skills/cast-list/examples/agents/bodega-cupons/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
  15. package/skills/cast-list/examples/agents/bodega-cupons/workflows/AbrirChamadoERP-7d1c2a4e/metadata.yml +3 -0
  16. package/skills/cast-list/examples/agents/bodega-cupons/workflows/AbrirChamadoERP-7d1c2a4e/workflow.json +41 -0
  17. package/skills/cast-list/examples/agents/bodega-devolucoes/actions/AbrirChamadoERP.mcs.yml +15 -0
  18. package/skills/cast-list/examples/agents/bodega-devolucoes/actions/AbrirSolicitacaoDevolucao.mcs.yml +1 -1
  19. package/skills/cast-list/examples/agents/bodega-devolucoes/agent.mcs.yml +13 -0
  20. package/skills/cast-list/examples/agents/bodega-devolucoes/connectionreferences.mcs.yml +2 -2
  21. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/ConsultarPoliticaDevolucoes.topic.mcs.yml +3 -3
  22. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Escalate.topic.mcs.yml +1 -1
  23. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Fallback.topic.mcs.yml +5 -5
  24. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Greeting.topic.mcs.yml +1 -1
  25. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/OnError.topic.mcs.yml +7 -7
  26. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
  27. package/skills/cast-list/examples/agents/bodega-devolucoes/workflows/AbrirChamadoERP-7d1c2a4e/metadata.yml +3 -0
  28. package/skills/cast-list/examples/agents/bodega-devolucoes/workflows/AbrirChamadoERP-7d1c2a4e/workflow.json +56 -0
  29. package/skills/cast-list/examples/agents/bodega-frete/actions/EnviarOpcoesFrete.mcs.yml +1 -1
  30. package/skills/cast-list/examples/agents/bodega-frete/agent.mcs.yml +7 -0
  31. package/skills/cast-list/examples/agents/bodega-frete/connectionreferences.mcs.yml +2 -2
  32. package/skills/cast-list/examples/agents/bodega-frete/topics/ConsultarTabelaFrete.topic.mcs.yml +3 -3
  33. package/skills/cast-list/examples/agents/bodega-frete/topics/Desambiguar.topic.mcs.yml +11 -0
  34. package/skills/cast-list/examples/agents/bodega-frete/topics/Fallback.topic.mcs.yml +5 -5
  35. package/skills/cast-list/examples/agents/bodega-frete/topics/Greeting.topic.mcs.yml +1 -1
  36. package/skills/cast-list/examples/agents/bodega-frete/topics/OnError.topic.mcs.yml +7 -7
  37. package/skills/cast-list/examples/agents/bodega-frete/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
  38. package/skills/cast-list/examples/agents/bodega-frete/variables/PreferenciaAntiga.mcs.yml +9 -0
  39. package/skills/cast-list/examples/agents/bodega-loja-fisica/actions/EnviarInstrucoesRetirada.mcs.yml +1 -1
  40. package/skills/cast-list/examples/agents/bodega-loja-fisica/agent.mcs.yml +12 -0
  41. package/skills/cast-list/examples/agents/bodega-loja-fisica/connectionreferences.mcs.yml +2 -2
  42. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/AvisoAntigo.topic.mcs.yml +12 -0
  43. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/ConsultarGuiaLojaFisica.topic.mcs.yml +3 -3
  44. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Escalate.topic.mcs.yml +1 -1
  45. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Fallback.topic.mcs.yml +5 -5
  46. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Greeting.topic.mcs.yml +1 -1
  47. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/OnError.topic.mcs.yml +6 -6
  48. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
  49. package/skills/cast-list/examples/agents/bodega-loja-fisica/workflows/ListarLojas-3f2a9c1d/metadata.yml +3 -0
  50. package/skills/cast-list/examples/agents/bodega-loja-fisica/workflows/ListarLojas-3f2a9c1d/workflow.json +56 -0
  51. package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteCupons.mcs.yml +1 -1
  52. package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteFidelidade.mcs.yml +24 -0
  53. package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteFrete.mcs.yml +2 -14
  54. package/skills/cast-list/examples/agents/bodega-orquestrador/agent.mcs.yml +2 -0
  55. package/skills/cast-list/examples/agents/bodega-pedidos/actions/AbrirChamadoERP.mcs.yml +15 -0
  56. package/skills/cast-list/examples/agents/bodega-pedidos/actions/EnviarResumoPedido.mcs.yml +1 -1
  57. package/skills/cast-list/examples/agents/bodega-pedidos/agent.mcs.yml +10 -0
  58. package/skills/cast-list/examples/agents/bodega-pedidos/connectionreferences.mcs.yml +2 -2
  59. package/skills/cast-list/examples/agents/bodega-pedidos/topics/ConsultarPoliticasPedidos Copy.topic.mcs.yml +56 -0
  60. package/skills/cast-list/examples/agents/bodega-pedidos/topics/Escalate.topic.mcs.yml +5 -0
  61. package/skills/cast-list/examples/agents/bodega-pedidos/workflows/AbrirChamadoERP-7d1c2a4e/metadata.yml +3 -0
  62. package/skills/cast-list/examples/agents/bodega-pedidos/workflows/AbrirChamadoERP-7d1c2a4e/workflow.json +56 -0
  63. package/skills/cast-list/examples/profile.cast.yaml +28 -0
  64. package/skills/cast-list/references/format.md +30 -3
  65. package/skills/cast-list/references/keys.md +26 -0
  66. package/skills/cast-list/references/profile.md +35 -0
  67. package/skills/cast-list/scripts/build.mjs +6 -4
  68. package/skills/cast-list/scripts/engine.mjs +128 -124
@@ -1,155 +1,159 @@
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 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(`
3
+ var Xl=Object.create;var ar=Object.defineProperty;var Ql=Object.getOwnPropertyDescriptor;var Zl=Object.getOwnPropertyNames;var ec=Object.getPrototypeOf,tc=Object.prototype.hasOwnProperty;var Ht=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var nc=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zl(t))!tc.call(e,i)&&i!==n&&ar(e,i,{get:()=>t[i],enumerable:!(s=Ql(t,i))||s.enumerable});return e};var ds=(e,t,n)=>(n=e!=null?Xl(ec(e)):{},nc(t||!e||!e.__esModule?ar(n,"default",{value:e,enumerable:!0}):n,e));var K=C(Q=>{"use strict";var ms=Symbol.for("yaml.alias"),dr=Symbol.for("yaml.document"),Qt=Symbol.for("yaml.map"),pr=Symbol.for("yaml.pair"),gs=Symbol.for("yaml.scalar"),Zt=Symbol.for("yaml.seq"),be=Symbol.for("yaml.node.type"),dc=e=>!!e&&typeof e=="object"&&e[be]===ms,pc=e=>!!e&&typeof e=="object"&&e[be]===dr,hc=e=>!!e&&typeof e=="object"&&e[be]===Qt,mc=e=>!!e&&typeof e=="object"&&e[be]===pr,hr=e=>!!e&&typeof e=="object"&&e[be]===gs,gc=e=>!!e&&typeof e=="object"&&e[be]===Zt;function mr(e){if(e&&typeof e=="object")switch(e[be]){case Qt:case Zt:return!0}return!1}function yc(e){if(e&&typeof e=="object")switch(e[be]){case ms:case Qt:case gs:case Zt:return!0}return!1}var bc=e=>(hr(e)||mr(e))&&!!e.anchor;Q.ALIAS=ms;Q.DOC=dr;Q.MAP=Qt;Q.NODE_TYPE=be;Q.PAIR=pr;Q.SCALAR=gs;Q.SEQ=Zt;Q.hasAnchor=bc;Q.isAlias=dc;Q.isCollection=mr;Q.isDocument=pc;Q.isMap=hc;Q.isNode=yc;Q.isPair=mc;Q.isScalar=hr;Q.isSeq=gc});var lt=C(ys=>{"use strict";var H=K(),re=Symbol("break visit"),gr=Symbol("skip children"),he=Symbol("remove node");function en(e,t){let n=yr(t);H.isDocument(e)?Ke(null,e.contents,n,Object.freeze([e]))===he&&(e.contents=null):Ke(null,e,n,Object.freeze([]))}en.BREAK=re;en.SKIP=gr;en.REMOVE=he;function Ke(e,t,n,s){let i=br(e,t,n,s);if(H.isNode(i)||H.isPair(i))return wr(e,s,i),Ke(e,i,n,s);if(typeof i!="symbol"){if(H.isCollection(t)){s=Object.freeze(s.concat(t));for(let r=0;r<t.items.length;++r){let o=Ke(r,t.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===re)return re;o===he&&(t.items.splice(r,1),r-=1)}}}else if(H.isPair(t)){s=Object.freeze(s.concat(t));let r=Ke("key",t.key,n,s);if(r===re)return re;r===he&&(t.key=null);let o=Ke("value",t.value,n,s);if(o===re)return re;o===he&&(t.value=null)}}return i}async function tn(e,t){let n=yr(t);H.isDocument(e)?await Ue(null,e.contents,n,Object.freeze([e]))===he&&(e.contents=null):await Ue(null,e,n,Object.freeze([]))}tn.BREAK=re;tn.SKIP=gr;tn.REMOVE=he;async function Ue(e,t,n,s){let i=await br(e,t,n,s);if(H.isNode(i)||H.isPair(i))return wr(e,s,i),Ue(e,i,n,s);if(typeof i!="symbol"){if(H.isCollection(t)){s=Object.freeze(s.concat(t));for(let r=0;r<t.items.length;++r){let o=await Ue(r,t.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===re)return re;o===he&&(t.items.splice(r,1),r-=1)}}}else if(H.isPair(t)){s=Object.freeze(s.concat(t));let r=await Ue("key",t.key,n,s);if(r===re)return re;r===he&&(t.key=null);let o=await Ue("value",t.value,n,s);if(o===re)return re;o===he&&(t.value=null)}}return i}function yr(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function br(e,t,n,s){if(typeof n=="function")return n(e,t,s);if(H.isMap(t))return n.Map?.(e,t,s);if(H.isSeq(t))return n.Seq?.(e,t,s);if(H.isPair(t))return n.Pair?.(e,t,s);if(H.isScalar(t))return n.Scalar?.(e,t,s);if(H.isAlias(t))return n.Alias?.(e,t,s)}function wr(e,t,n){let s=t[t.length-1];if(H.isCollection(s))s.items[e]=n;else if(H.isPair(s))e==="key"?s.key=n:s.value=n;else if(H.isDocument(s))s.contents=n;else{let i=H.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}ys.visit=en;ys.visitAsync=tn});var bs=C($r=>{"use strict";var kr=K(),wc=lt(),kc={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},$c=e=>e.replace(/[!,[\]{}]/g,t=>kc[t]),ct=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let s=t.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,s,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);let r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+$c(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),i;if(t&&s.length>0&&kr.isNode(t.contents)){let r={};wc.visit(t.contents,(o,a)=>{kr.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
4
+ `)}};ct.defaultYaml={explicit:!1,version:"1.2"};ct.defaultTags={"!!":"tag:yaml.org,2002:"};$r.Directives=ct});var nn=C(ft=>{"use strict";var Sr=K(),Sc=lt();function vc(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function vr(e){let t=new Set;return Sc.visit(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function Or(e,t){for(let n=1;;++n){let s=`${e}${n}`;if(!t.has(s))return s}}function Oc(e,t){let n=[],s=new Map,i=null;return{onAnchor:r=>{n.push(r),i??(i=vr(e));let o=Or(t,i);return i.add(o),o},setAnchors:()=>{for(let r of n){let o=s.get(r);if(typeof o=="object"&&o.anchor&&(Sr.isScalar(o.node)||Sr.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}ft.anchorIsValid=vc;ft.anchorNames=vr;ft.createNodeAnchors=Oc;ft.findNewAnchor=Or});var ws=C(Ar=>{"use strict";function ut(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){let o=s[i],a=ut(e,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(let i of Array.from(s.keys())){let r=s.get(i),o=ut(e,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(let i of Array.from(s)){let r=ut(e,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(let[i,r]of Object.entries(s)){let o=ut(e,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return e.call(t,n,s)}Ar.applyReviver=ut});var ve=C(Er=>{"use strict";var Ac=K();function Nr(e,t,n){if(Array.isArray(e))return e.map((s,i)=>Nr(s,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!Ac.hasAnchor(e))return e.toJSON(t,n);let s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=r=>{s.res=r,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}Er.toJS=Nr});var sn=C(Cr=>{"use strict";var Nc=ws(),xr=K(),Ec=ve(),ks=class{constructor(t){Object.defineProperty(this,xr.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!xr.isDocument(t))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Ec.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:f}of o.anchors.values())i(f,l);return typeof r=="function"?Nc.applyReviver(r,{"":a},"",a):a}};Cr.NodeBase=ks});var dt=C(Tr=>{"use strict";var xc=nn(),Cc=lt(),Ye=K(),Tc=sn(),qc=ve(),$s=class extends Tc.NodeBase{constructor(t){super(Ye.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],Cc.visit(t,{Node:(r,o)=>{(Ye.isAlias(o)||Ye.hasAnchor(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let i;for(let r of s){if(r===this)break;r.anchor===this.source&&(i=r)}if(i&&n){let{anchors:r,doc:o,maxAliasCount:a}=n,l=r.get(i);if(l||(qc.toJS(i,null,n),l=r.get(i)),l?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=rn(o,i,r)),l.count*l.aliasCount>a)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}}return i}toJSON(t,n){if(!n)return{source:this.source};let s=this.resolve(n.doc,n);if(!s){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return n.anchors.get(s).res}toString(t,n,s){let i=`*${this.source}`;if(t){if(xc.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${i} `}return i}};function rn(e,t,n){if(Ye.isAlias(t)){let s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(Ye.isCollection(t)){let s=0;for(let i of t.items){let r=rn(e,i,n);r>s&&(s=r)}return s}else if(Ye.isPair(t)){let s=rn(e,t.key,n),i=rn(e,t.value,n);return Math.max(s,i)}return 1}Tr.Alias=$s});var G=C(Ss=>{"use strict";var Mc=K(),Pc=sn(),Lc=ve(),Ic=e=>!e||typeof e!="function"&&typeof e!="object",Oe=class extends Pc.NodeBase{constructor(t){super(Mc.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Lc.toJS(this.value,t,n)}toString(){return String(this.value)}};Oe.BLOCK_FOLDED="BLOCK_FOLDED";Oe.BLOCK_LITERAL="BLOCK_LITERAL";Oe.PLAIN="PLAIN";Oe.QUOTE_DOUBLE="QUOTE_DOUBLE";Oe.QUOTE_SINGLE="QUOTE_SINGLE";Ss.Scalar=Oe;Ss.isScalarValue=Ic});var pt=C(Mr=>{"use strict";var Rc=dt(),Le=K(),qr=G(),Fc="tag:yaml.org,2002:";function Dc(e,t,n){if(t){let s=n.filter(r=>r.tag===t),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(s=>s.identify?.(e)&&!s.format)}function jc(e,t,n){if(Le.isDocument(e)&&(e=e.contents),Le.isNode(e))return e;if(Le.isPair(e)){let d=n.schema[Le.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=n,l;if(s&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=i(e)),new Rc.Alias(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=Fc+t.slice(2));let f=Dc(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new qr.Scalar(e);return l&&(l.node=d),d}f=e instanceof Map?o[Le.MAP]:Symbol.iterator in Object(e)?o[Le.SEQ]:o[Le.MAP]}r&&(r(f),delete n.onTagObj);let c=f?.createNode?f.createNode(n.schema,e,n):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(n.schema,e,n):new qr.Scalar(e);return t?c.tag=t:f.default||(c.tag=f.tag),l&&(l.node=c),c}Mr.createNode=jc});var an=C(on=>{"use strict";var _c=pt(),me=K(),Bc=sn();function vs(e,t,n){let s=n;for(let i=t.length-1;i>=0;--i){let r=t[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return _c.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Pr=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,Os=class extends Bc.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>me.isNode(s)||me.isPair(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Pr(t))this.add(n);else{let[s,...i]=t,r=this.get(s,!0);if(me.isCollection(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,vs(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(t){let[n,...s]=t;if(s.length===0)return this.delete(n);let i=this.get(n,!0);if(me.isCollection(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){let[s,...i]=t,r=this.get(s,!0);return i.length===0?!n&&me.isScalar(r)?r.value:r:me.isCollection(r)?r.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!me.isPair(n))return!1;let s=n.value;return s==null||t&&me.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){let[n,...s]=t;if(s.length===0)return this.has(n);let i=this.get(n,!0);return me.isCollection(i)?i.hasIn(s):!1}setIn(t,n){let[s,...i]=t;if(i.length===0)this.set(s,n);else{let r=this.get(s,!0);if(me.isCollection(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,vs(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};on.Collection=Os;on.collectionFromPath=vs;on.isEmptyPath=Pr});var ht=C(ln=>{"use strict";var Kc=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function As(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Uc=(e,t,n)=>e.endsWith(`
5
+ `)?As(n,t):n.includes(`
6
6
  `)?`
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)+`
7
+ `+As(n,t):(e.endsWith(" ")?"":" ")+n;ln.indentComment=As;ln.lineComment=Uc;ln.stringifyComment=Kc});var Ir=C(mt=>{"use strict";var Yc="flow",Ns="block",cn="quoted";function zc(e,t,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;i<r&&(r=0);let l=Math.max(1+r,1+i-t.length);if(e.length<=l)return e;let f=[],c={},d=i-t.length;typeof s=="number"&&(s>i-Math.max(2,r)?f.push(0):d=i-s);let u,h,b=!1,m=-1,y=-1,O=-1;n===Ns&&(m=Lr(e,m,t.length),m!==-1&&(d=m+l));for(let S;S=e[m+=1];){if(n===cn&&S==="\\"){switch(y=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}O=m}if(S===`
8
+ `)n===Ns&&(m=Lr(e,m,t.length)),d=m+t.length+l,u=void 0;else{if(S===" "&&h&&h!==" "&&h!==`
9
+ `&&h!==" "){let M=e[m+1];M&&M!==" "&&M!==`
10
+ `&&M!==" "&&(u=m)}if(m>=d)if(u)f.push(u),d=u+l,u=void 0;else if(n===cn){for(;h===" "||h===" ";)h=S,S=e[m+=1],b=!0;let M=m>O+1?m-2:y-1;if(c[M])return e;f.push(M),c[M]=!0,d=M+l,u=void 0}else b=!0}h=S}if(b&&a&&a(),f.length===0)return e;o&&o();let v=e.slice(0,f[0]);for(let S=0;S<f.length;++S){let M=f[S],$=f[S+1]||e.length;M===0?v=`
11
+ ${t}${e.slice(0,$)}`:(n===cn&&c[M]&&(v+=`${e[M]}\\`),v+=`
12
+ ${t}${e.slice(M+1,$)}`)}return v}function Lr(e,t,n){let s=t,i=t+1,r=e[i];for(;r===" "||r===" ";)if(t<i+n)r=e[++t];else{do r=e[++t];while(r&&r!==`
13
+ `);s=t,i=t+1,r=e[i]}return s}mt.FOLD_BLOCK=Ns;mt.FOLD_FLOW=Yc;mt.FOLD_QUOTED=cn;mt.foldFlowLines=zc});var yt=C(Rr=>{"use strict";var ue=G(),Ae=Ir(),un=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),dn=e=>/^(%|---|\.\.\.)/m.test(e);function Wc(e,t,n){if(!t||t<0)return!1;let s=t-n,i=e.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(e[r]===`
14
+ `){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function gt(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(dn(e)?" ":""),o="",a=0;for(let l=0,f=n[l];f;f=n[++l])if(f===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,f="\\"),f==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);let c=n.substr(l+2,4);switch(c){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:c.substr(0,2)==="00"?o+="\\x"+c.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<i)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,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(`(^|(?<!
17
+ `,l+=2;o+=r,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,s?o:Ae.foldFlowLines(o,r,Ae.FOLD_QUOTED,un(t,!1))}function Es(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
18
+ `)||/[ \t]\n|\n[ \t]/.test(e))return gt(e,t);let n=t.indent||(dn(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
19
+ ${n}`)+"'";return t.implicitKey?s:Ae.foldFlowLines(s,n,Ae.FOLD_FLOW,un(t,!1))}function ze(e,t){let{singleQuote:n}=t.options,s;if(n===!1)s=gt;else{let i=e.includes('"'),r=e.includes("'");i&&!r?s=Es:r&&!i?s=gt:s=n?Es:gt}return s(e,t)}var xs;try{xs=new RegExp(`(^|(?<!
20
20
  ))
21
21
  +(?!
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?`|
22
+ |$)`,"g")}catch{xs=/\n+(?!\n|$)/g}function fn({comment:e,type:t,value:n},s,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n))return ze(n,s);let f=s.indent||(s.forceBlockIndent||dn(n)?" ":""),c=o==="literal"?!0:o==="folded"||t===ue.Scalar.BLOCK_FOLDED?!1:t===ue.Scalar.BLOCK_LITERAL?!0:!Wc(n,l,f.length);if(!n)return c?`|
23
23
  `:`>
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=`
24
+ `;let d,u;for(u=n.length;u>0;--u){let $=n[u-1];if($!==`
25
+ `&&$!==" "&&$!==" ")break}let h=n.substring(u),b=h.indexOf(`
26
+ `);b===-1?d="-":n===h||b!==h.length-1?(d="+",r&&r()):d="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
27
+ `&&(h=h.slice(0,-1)),h=h.replace(xs,`$&${f}`));let m=!1,y,O=-1;for(y=0;y<n.length;++y){let $=n[y];if($===" ")m=!0;else if($===`
28
+ `)O=y;else break}let v=n.substring(0,O<y?O+1:y);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${f}`));let M=(m?f?"2":"1":"")+d;if(e&&(M+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!c){let $=n.replace(/\n+/g,`
29
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`),N=!1,q=un(s,!0);o!=="folded"&&t!==ue.Scalar.BLOCK_FOLDED&&(q.onOverflow=()=>{N=!0});let g=Ae.foldFlowLines(`${v}${$}${h}`,f,Ae.FOLD_BLOCK,q);if(!N)return`>${M}
30
+ ${f}${g}`}return n=n.replace(/\n+/g,`$&${f}`),`|${M}
31
+ ${f}${v}${n}${h}`}function Vc(e,t,n,s){let{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:l,indentStep:f,inFlow:c}=t;if(a&&r.includes(`
32
+ `)||c&&/[[\]{},]/.test(r))return ze(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||c||!r.includes(`
33
+ `)?ze(r,t):fn(e,t,n,s);if(!a&&!c&&i!==ue.Scalar.PLAIN&&r.includes(`
34
+ `))return fn(e,t,n,s);if(dn(r)){if(l==="")return t.forceBlockIndent=!0,fn(e,t,n,s);if(a&&l===f)return ze(r,t)}let d=r.replace(/\n+/g,`$&
35
+ ${l}`);if(o){let u=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(d),{compat:h,tags:b}=t.doc.schema;if(b.some(u)||h?.some(u))return ze(r,t)}return a?d:Ae.foldFlowLines(d,l,Ae.FOLD_FLOW,un(t,!1))}function Jc(e,t,n,s){let{implicitKey:i,inFlow:r}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==ue.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ue.Scalar.QUOTE_DOUBLE);let l=c=>{switch(c){case ue.Scalar.BLOCK_FOLDED:case ue.Scalar.BLOCK_LITERAL:return i||r?ze(o.value,t):fn(o,t,n,s);case ue.Scalar.QUOTE_DOUBLE:return gt(o.value,t);case ue.Scalar.QUOTE_SINGLE:return Es(o.value,t);case ue.Scalar.PLAIN:return Vc(o,t,n,s);default:return null}},f=l(a);if(f===null){let{defaultKeyType:c,defaultStringType:d}=t.options,u=i&&c||d;if(f=l(u),f===null)throw new Error(`Unsupported default string type ${u}`)}return f}Rr.stringifyString=Jc});var bt=C(Cs=>{"use strict";var Gc=nn(),Ne=K(),Hc=ht(),Xc=yt();function Qc(e,t){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},e.schema.toStringOptions,t),s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Zc(e,t){if(t.tag){let i=e.filter(r=>r.tag===t.tag);if(i.length>0)return i.find(r=>r.format===t.format)??i[0]}let n,s;if(Ne.isScalar(t)){s=t.value;let i=e.filter(r=>r.identify?.(s));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}n=i.find(r=>r.format===t.format)??i.find(r=>!r.format)}else s=t,n=e.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!n){let i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return n}function ef(e,t,{anchors:n,doc:s}){if(!s.directives)return"";let i=[],r=(Ne.isScalar(e)||Ne.isCollection(e))&&e.anchor;r&&Gc.anchorIsValid(r)&&(n.add(r),i.push(`&${r}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function tf(e,t,n,s){if(Ne.isPair(e))return e.toString(t,n,s);if(Ne.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,r=Ne.isNode(e)?e:t.doc.createNode(e,{onTagObj:l=>i=l});i??(i=Zc(t.doc.schema.tags,r));let o=ef(r,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,t,n,s):Ne.isScalar(r)?Xc.stringifyString(r,t,n,s):r.toString(t,n,s);return o?Ne.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
36
+ ${t.indent}${a}`:a}Cs.createStringifyContext=Qc;Cs.stringify=tf});var _r=C(jr=>{"use strict";var we=K(),Fr=G(),Dr=bt(),wt=ht();function nf({key:e,value:t},n,s,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:f,indentSeq:c,simpleKeys:d}}=n,u=we.isNode(e)&&e.comment||null;if(d){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(we.isCollection(e)||!we.isNode(e)&&typeof e=="object"){let q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let h=!d&&(!e||u&&t==null&&!n.inFlow||we.isCollection(e)||(we.isScalar(e)?e.type===Fr.Scalar.BLOCK_FOLDED||e.type===Fr.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!r),indent:a+l});let b=!1,m=!1,y=Dr.stringify(e,n,()=>b=!0,()=>m=!0);if(!h&&!n.inFlow&&y.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(r||t==null)return b&&s&&s(),y===""?"?":h?`? ${y}`:y}else if(r&&!d||t==null&&h)return y=`? ${y}`,u&&!b?y+=wt.lineComment(y,n.indent,f(u)):m&&i&&i(),y;b&&(u=null),h?(u&&(y+=wt.lineComment(y,n.indent,f(u))),y=`? ${y}
37
+ ${a}:`):(y=`${y}:`,u&&(y+=wt.lineComment(y,n.indent,f(u))));let O,v,S;we.isNode(t)?(O=!!t.spaceBefore,v=t.commentBefore,S=t.comment):(O=!1,v=null,S=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!h&&!u&&we.isScalar(t)&&(n.indentAtStart=y.length+1),m=!1,!c&&l.length>=2&&!n.inFlow&&!h&&we.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let M=!1,$=Dr.stringify(t,n,()=>M=!0,()=>m=!0),N=" ";if(u||O||v){if(N=O?`
38
+ `:"",v){let q=f(v);N+=`
39
+ ${wt.indentComment(q,n.indent)}`}$===""&&!n.inFlow?N===`
40
+ `&&S&&(N=`
41
41
 
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?`
42
+ `):N+=`
43
+ ${n.indent}`}else if(!h&&we.isCollection(t)){let q=$[0],g=$.indexOf(`
44
+ `),E=g!==-1,L=n.inFlow??t.flow??t.items.length===0;if(E||!L){let Y=!1;if(E&&(q==="&"||q==="!")){let F=$.indexOf(" ");q==="&"&&F!==-1&&F<g&&$[F+1]==="!"&&(F=$.indexOf(" ",F+1)),(F===-1||g<F)&&(Y=!0)}Y||(N=`
45
+ ${n.indent}`)}}else($===""||$[0]===`
46
+ `)&&(N="");return y+=N+$,n.inFlow?M&&s&&s():S&&!M?y+=wt.lineComment(y,n.indent,f(S)):m&&i&&i(),y}jr.stringifyPair=nf});var qs=C(Ts=>{"use strict";var Br=Ht("process");function sf(e,...t){e==="debug"&&console.log(...t)}function rf(e,t){(e==="debug"||e==="warn")&&(typeof Br.emitWarning=="function"?Br.emitWarning(t):console.warn(t))}Ts.debug=sf;Ts.warn=rf});var yn=C(gn=>{"use strict";var mn=K(),Kr=G(),pn="<<",hn={identify:e=>e===pn||typeof e=="symbol"&&e.description===pn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Kr.Scalar(Symbol(pn)),{addToJSMap:Ur}),stringify:()=>pn},of=(e,t)=>(hn.identify(t)||mn.isScalar(t)&&(!t.type||t.type===Kr.Scalar.PLAIN)&&hn.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===hn.tag&&n.default);function Ur(e,t,n){let s=Yr(e,n);if(mn.isSeq(s))for(let i of s.items)Ms(e,t,i);else if(Array.isArray(s))for(let i of s)Ms(e,t,i);else Ms(e,t,s)}function Ms(e,t,n){let s=Yr(e,n);if(!mn.isMap(s))throw new Error("Merge sources must be maps or map aliases");let i=s.toJSON(null,e,Map);for(let[r,o]of i)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Yr(e,t){return e&&mn.isAlias(t)?t.resolve(e.doc,e):t}gn.addMergeToJSMap=Ur;gn.isMergeKey=of;gn.merge=hn});var Ls=C(Vr=>{"use strict";var af=qs(),zr=yn(),lf=bt(),Wr=K(),Ps=ve();function cf(e,t,{key:n,value:s}){if(Wr.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(zr.isMergeKey(e,n))zr.addMergeToJSMap(e,t,s);else{let i=Ps.toJS(n,"",e);if(t instanceof Map)t.set(i,Ps.toJS(s,i,e));else if(t instanceof Set)t.add(i);else{let r=ff(n,i,e),o=Ps.toJS(s,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function ff(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Wr.isNode(e)&&n?.doc){let s=lf.createStringifyContext(n.doc,{});s.anchors=new Set;for(let r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;let i=e.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),af.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}Vr.addPairToJSMap=cf});var Ee=C(Is=>{"use strict";var Jr=pt(),uf=_r(),df=Ls(),bn=K();function pf(e,t,n){let s=Jr.createNode(e,void 0,n),i=Jr.createNode(t,void 0,n);return new wn(s,i)}var wn=class e{constructor(t,n=null){Object.defineProperty(this,bn.NODE_TYPE,{value:bn.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return bn.isNode(n)&&(n=n.clone(t)),bn.isNode(s)&&(s=s.clone(t)),new e(n,s)}toJSON(t,n){let s=n?.mapAsMap?new Map:{};return df.addPairToJSMap(n,s,this)}toString(t,n,s){return t?.doc?uf.stringifyPair(this,t,n,s):JSON.stringify(this)}};Is.Pair=wn;Is.createPair=pf});var Rs=C(Hr=>{"use strict";var Ie=K(),Gr=bt(),kn=ht();function hf(e,t,n){return(t.inFlow??e.flow?gf:mf)(e,t,n)}function mf({comment:e,items:t},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:f}}=n,c=Object.assign({},n,{indent:r,type:null}),d=!1,u=[];for(let b=0;b<t.length;++b){let m=t[b],y=null;if(Ie.isNode(m))!d&&m.spaceBefore&&u.push(""),$n(n,u,m.commentBefore,d),m.comment&&(y=m.comment);else if(Ie.isPair(m)){let v=Ie.isNode(m.key)?m.key:null;v&&(!d&&v.spaceBefore&&u.push(""),$n(n,u,v.commentBefore,d))}d=!1;let O=Gr.stringify(m,c,()=>y=null,()=>d=!0);y&&(O+=kn.lineComment(O,r,f(y))),d&&y&&(d=!1),u.push(s+O)}let h;if(u.length===0)h=i.start+i.end;else{h=u[0];for(let b=1;b<u.length;++b){let m=u[b];h+=m?`
47
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
- ${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]=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
- `)?(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(`
48
+ `}}return e?(h+=`
49
+ `+kn.indentComment(f(e),l),a&&a()):d&&o&&o(),h}function gf({items:e},t,{flowChars:n,itemIndent:s}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;s+=r;let l=Object.assign({},t,{indent:s,inFlow:!0,type:null}),f=!1,c=0,d=[];for(let b=0;b<e.length;++b){let m=e[b],y=null;if(Ie.isNode(m))m.spaceBefore&&d.push(""),$n(t,d,m.commentBefore,!1),m.comment&&(y=m.comment);else if(Ie.isPair(m)){let v=Ie.isNode(m.key)?m.key:null;v&&(v.spaceBefore&&d.push(""),$n(t,d,v.commentBefore,!1),v.comment&&(f=!0));let S=Ie.isNode(m.value)?m.value:null;S?(S.comment&&(y=S.comment),S.commentBefore&&(f=!0)):m.value==null&&v?.comment&&(y=v.comment)}y&&(f=!0);let O=Gr.stringify(m,l,()=>y=null);f||(f=d.length>c||O.includes(`
50
+ `)),b<e.length-1?O+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(f||(f=d.reduce((v,S)=>v+S.length+2,2)+(O.length+2)>t.options.lineWidth)),f&&(O+=",")),y&&(O+=kn.lineComment(O,s,a(y))),d.push(O),c=d.length}let{start:u,end:h}=n;if(d.length===0)return u+h;if(!f){let b=d.reduce((m,y)=>m+y.length+2,2);f=t.options.lineWidth>0&&b>t.options.lineWidth}if(f){let b=u;for(let m of d)b+=m?`
51
+ ${r}${i}${m}`:`
52
+ `;return`${b}
53
+ ${i}${h}`}else return`${u}${o}${d.join(" ")}${o}${h}`}function $n({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let r=kn.indentComment(t(s),e);n.push(r.trimStart())}}Hr.stringifyCollection=hf});var Ce=C(Ds=>{"use strict";var yf=Rs(),bf=Ls(),wf=an(),xe=K(),Sn=Ee(),kf=G();function kt(e,t){let n=xe.isScalar(t)?t.value:t;for(let s of e)if(xe.isPair(s)&&(s.key===t||s.key===n||xe.isScalar(s.key)&&s.key.value===n))return s}var Fs=class extends wf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(xe.MAP,t),this.items=[]}static from(t,n,s){let{keepUndefined:i,replacer:r}=s,o=new this(t),a=(l,f)=>{if(typeof r=="function")f=r.call(n,l,f);else if(Array.isArray(r)&&!r.includes(l))return;(f!==void 0||i)&&o.items.push(Sn.createPair(l,f,s))};if(n instanceof Map)for(let[l,f]of n)a(l,f);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let s;xe.isPair(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Sn.Pair(t,t?.value):s=new Sn.Pair(t.key,t.value);let i=kt(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);xe.isScalar(i.value)&&kf.isScalarValue(s.value)?i.value.value=s.value:i.value=s.value}else if(r){let o=this.items.findIndex(a=>r(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(t){let n=kt(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=kt(this.items,t)?.value;return(!n&&xe.isScalar(i)?i.value:i)??void 0}has(t){return!!kt(this.items,t)}set(t,n){this.add(new Sn.Pair(t,n),!0)}toJSON(t,n,s){let i=s?new s:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let r of this.items)bf.addPairToJSMap(n,i,r);return i}toString(t,n,s){if(!t)return JSON.stringify(this);for(let i of this.items)if(!xe.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),yf.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};Ds.YAMLMap=Fs;Ds.findPair=kt});var We=C(Qr=>{"use strict";var $f=K(),Xr=Ce(),Sf={collection:"map",default:!0,nodeClass:Xr.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return $f.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Xr.YAMLMap.from(e,t,n)};Qr.map=Sf});var Te=C(Zr=>{"use strict";var vf=pt(),Of=Rs(),Af=an(),On=K(),Nf=G(),Ef=ve(),js=class extends Af.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(On.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=vn(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let s=vn(t);if(typeof s!="number")return;let i=this.items[s];return!n&&On.isScalar(i)?i.value:i}has(t){let n=vn(t);return typeof n=="number"&&n<this.items.length}set(t,n){let s=vn(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[s];On.isScalar(i)&&Nf.isScalarValue(n)?i.value=n:this.items[s]=n}toJSON(t,n){let s=[];n?.onCreate&&n.onCreate(s);let i=0;for(let r of this.items)s.push(Ef.toJS(r,String(i++),n));return s}toString(t,n,s){return t?Of.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){let{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof i=="function"){let l=n instanceof Set?a:String(o++);a=i.call(n,l,a)}r.items.push(vf.createNode(a,void 0,s))}}return r}};function vn(e){let t=On.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Zr.YAMLSeq=js});var Ve=C(to=>{"use strict";var xf=K(),eo=Te(),Cf={collection:"seq",default:!0,nodeClass:eo.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return xf.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>eo.YAMLSeq.from(e,t,n)};to.seq=Cf});var $t=C(no=>{"use strict";var Tf=yt(),qf={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),Tf.stringifyString(e,t,n,s)}};no.string=qf});var An=C(ro=>{"use strict";var so=G(),io={identify:e=>e==null,createNode:()=>new so.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new so.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&io.test.test(e)?e:t.options.nullStr};ro.nullTag=io});var _s=C(ao=>{"use strict";var Mf=G(),oo={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Mf.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&oo.test.test(e)){let s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};ao.boolTag=oo});var Je=C(lo=>{"use strict";function Pf({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);let i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=t-(r.length-o-1);for(;a-- >0;)r+="0"}return r}lo.stringifyNumber=Pf});var Ks=C(Nn=>{"use strict";var Lf=G(),Bs=Je(),If={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Bs.stringifyNumber},Rf={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Bs.stringifyNumber(e)}},Ff={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Lf.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Bs.stringifyNumber};Nn.float=Ff;Nn.floatExp=Rf;Nn.floatNaN=If});var Ys=C(xn=>{"use strict";var co=Je(),En=e=>typeof e=="bigint"||Number.isInteger(e),Us=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function fo(e,t,n){let{value:s}=e;return En(s)&&s>=0?n+s.toString(t):co.stringifyNumber(e)}var Df={identify:e=>En(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Us(e,2,8,n),stringify:e=>fo(e,8,"0o")},jf={identify:En,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Us(e,0,10,n),stringify:co.stringifyNumber},_f={identify:e=>En(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Us(e,2,16,n),stringify:e=>fo(e,16,"0x")};xn.int=jf;xn.intHex=_f;xn.intOct=Df});var po=C(uo=>{"use strict";var Bf=We(),Kf=An(),Uf=Ve(),Yf=$t(),zf=_s(),zs=Ks(),Ws=Ys(),Wf=[Bf.map,Uf.seq,Yf.string,Kf.nullTag,zf.boolTag,Ws.intOct,Ws.int,Ws.intHex,zs.floatNaN,zs.floatExp,zs.float];uo.schema=Wf});var go=C(mo=>{"use strict";var Vf=G(),Jf=We(),Gf=Ve();function ho(e){return typeof e=="bigint"||Number.isInteger(e)}var Cn=({value:e})=>JSON.stringify(e),Hf=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Cn},{identify:e=>e==null,createNode:()=>new Vf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Cn},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Cn},{identify:ho,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>ho(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Cn}],Xf={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Qf=[Jf.map,Gf.seq].concat(Hf,Xf);mo.schema=Qf});var Js=C(yo=>{"use strict";var St=Ht("buffer"),Vs=G(),Zf=yt(),eu={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof St.Buffer=="function")return St.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i<n.length;++i)s[i]=n.charCodeAt(i);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,i,r){if(!n)return"";let o=n,a;if(typeof St.Buffer=="function")a=o instanceof St.Buffer?o.toString("base64"):St.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let f=0;f<o.length;++f)l+=String.fromCharCode(o[f]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Vs.Scalar.BLOCK_LITERAL),t!==Vs.Scalar.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),f=Math.ceil(a.length/l),c=new Array(f);for(let d=0,u=0;d<f;++d,u+=l)c[d]=a.substr(u,l);a=c.join(t===Vs.Scalar.BLOCK_LITERAL?`
54
+ `:" ")}return Zf.stringifyString({comment:e,type:t,value:a},s,i,r)}};yo.binary=eu});var Mn=C(qn=>{"use strict";var Tn=K(),Gs=Ee(),tu=G(),nu=Te();function bo(e,t){if(Tn.isSeq(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!Tn.isPair(s)){if(Tn.isMap(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");let i=s.items[0]||new Gs.Pair(new tu.Scalar(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
55
+ ${i.key.commentBefore}`:s.commentBefore),s.comment){let r=i.value??i.key;r.comment=r.comment?`${s.comment}
56
+ ${r.comment}`:s.comment}s=i}e.items[n]=Tn.isPair(s)?s:new Gs.Pair(s)}}else t("Expected a sequence for this tag");return e}function wo(e,t,n){let{replacer:s}=n,i=new nu.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let f=Object.keys(o);if(f.length===1)a=f[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else a=o;i.items.push(Gs.createPair(a,l,n))}return i}var su={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:bo,createNode:wo};qn.createPairs=wo;qn.pairs=su;qn.resolvePairs=bo});var Qs=C(Xs=>{"use strict";var ko=K(),Hs=ve(),vt=Ce(),iu=Te(),$o=Mn(),Re=class e extends iu.YAMLSeq{constructor(){super(),this.add=vt.YAMLMap.prototype.add.bind(this),this.delete=vt.YAMLMap.prototype.delete.bind(this),this.get=vt.YAMLMap.prototype.get.bind(this),this.has=vt.YAMLMap.prototype.has.bind(this),this.set=vt.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let s=new Map;n?.onCreate&&n.onCreate(s);for(let i of this.items){let r,o;if(ko.isPair(i)?(r=Hs.toJS(i.key,"",n),o=Hs.toJS(i.value,r,n)):r=Hs.toJS(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(t,n,s){let i=$o.createPairs(t,n,s),r=new this;return r.items=i.items,r}};Re.tag="tag:yaml.org,2002:omap";var ru={collection:"seq",identify:e=>e instanceof Map,nodeClass:Re,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=$o.resolvePairs(e,t),s=[];for(let{key:i}of n.items)ko.isScalar(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new Re,n)},createNode:(e,t,n)=>Re.from(e,t,n)};Xs.YAMLOMap=Re;Xs.omap=ru});var No=C(Zs=>{"use strict";var So=G();function vo({value:e,source:t},n){return t&&(e?Oo:Ao).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Oo={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new So.Scalar(!0),stringify:vo},Ao={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new So.Scalar(!1),stringify:vo};Zs.falseTag=Ao;Zs.trueTag=Oo});var Eo=C(Pn=>{"use strict";var ou=G(),ei=Je(),au={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ei.stringifyNumber},lu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():ei.stringifyNumber(e)}},cu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new ou.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:ei.stringifyNumber};Pn.float=cu;Pn.floatExp=lu;Pn.floatNaN=au});var Co=C(At=>{"use strict";var xo=Je(),Ot=e=>typeof e=="bigint"||Number.isInteger(e);function Ln(e,t,n,{intAsBigInt:s}){let i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return i==="-"?BigInt(-1)*o:o}let r=parseInt(e,n);return i==="-"?-1*r:r}function ti(e,t,n){let{value:s}=e;if(Ot(s)){let i=s.toString(t);return s<0?"-"+n+i.substr(1):n+i}return xo.stringifyNumber(e)}var fu={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Ln(e,2,2,n),stringify:e=>ti(e,2,"0b")},uu={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Ln(e,1,8,n),stringify:e=>ti(e,8,"0")},du={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Ln(e,0,10,n),stringify:xo.stringifyNumber},pu={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Ln(e,2,16,n),stringify:e=>ti(e,16,"0x")};At.int=du;At.intBin=fu;At.intHex=pu;At.intOct=uu});var si=C(ni=>{"use strict";var Fn=K(),In=Ee(),Rn=Ce(),Fe=class e extends Rn.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;Fn.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new In.Pair(t.key,null):n=new In.Pair(t,null),Rn.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let s=Rn.findPair(this.items,t);return!n&&Fn.isPair(s)?Fn.isScalar(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let s=Rn.findPair(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new In.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){let{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),r.items.push(In.createPair(o,null,s));return r}};Fe.tag="tag:yaml.org,2002:set";var hu={collection:"map",identify:e=>e instanceof Set,nodeClass:Fe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Fe.from(e,t,n),resolve(e,t){if(Fn.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Fe,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};ni.YAMLSet=Fe;ni.set=hu});var ri=C(Dn=>{"use strict";var mu=Je();function ii(e,t){let n=e[0],s=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*r:r}function To(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return mu.stringifyNumber(e);let s="";t<0&&(s="-",t*=n(-1));let i=n(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var gu={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ii(e,n),stringify:To},yu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ii(e,!1),stringify:To},qo={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(qo.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,s,i,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,f=Date.UTC(n,s-1,i,r||0,o||0,a||0,l),c=t[8];if(c&&c!=="Z"){let d=ii(c,!1);Math.abs(d)<30&&(d*=60),f-=6e4*d}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Dn.floatTime=yu;Dn.intTime=gu;Dn.timestamp=qo});var Lo=C(Po=>{"use strict";var bu=We(),wu=An(),ku=Ve(),$u=$t(),Su=Js(),Mo=No(),oi=Eo(),jn=Co(),vu=yn(),Ou=Qs(),Au=Mn(),Nu=si(),ai=ri(),Eu=[bu.map,ku.seq,$u.string,wu.nullTag,Mo.trueTag,Mo.falseTag,jn.intBin,jn.intOct,jn.int,jn.intHex,oi.floatNaN,oi.floatExp,oi.float,Su.binary,vu.merge,Ou.omap,Au.pairs,Nu.set,ai.intTime,ai.floatTime,ai.timestamp];Po.schema=Eu});var Yo=C(fi=>{"use strict";var Do=We(),xu=An(),jo=Ve(),Cu=$t(),Tu=_s(),li=Ks(),ci=Ys(),qu=po(),Mu=go(),_o=Js(),Nt=yn(),Bo=Qs(),Ko=Mn(),Io=Lo(),Uo=si(),_n=ri(),Ro=new Map([["core",qu.schema],["failsafe",[Do.map,jo.seq,Cu.string]],["json",Mu.schema],["yaml11",Io.schema],["yaml-1.1",Io.schema]]),Fo={binary:_o.binary,bool:Tu.boolTag,float:li.float,floatExp:li.floatExp,floatNaN:li.floatNaN,floatTime:_n.floatTime,int:ci.int,intHex:ci.intHex,intOct:ci.intOct,intTime:_n.intTime,map:Do.map,merge:Nt.merge,null:xu.nullTag,omap:Bo.omap,pairs:Ko.pairs,seq:jo.seq,set:Uo.set,timestamp:_n.timestamp},Pu={"tag:yaml.org,2002:binary":_o.binary,"tag:yaml.org,2002:merge":Nt.merge,"tag:yaml.org,2002:omap":Bo.omap,"tag:yaml.org,2002:pairs":Ko.pairs,"tag:yaml.org,2002:set":Uo.set,"tag:yaml.org,2002:timestamp":_n.timestamp};function Lu(e,t,n){let s=Ro.get(t);if(s&&!e)return n&&!s.includes(Nt.merge)?s.concat(Nt.merge):s.slice();let i=s;if(!i)if(Array.isArray(e))i=[];else{let r=Array.from(Ro.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(let r of e)i=i.concat(r);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Nt.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Fo[o]:o;if(!a){let l=JSON.stringify(o),f=Object.keys(Fo).map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${f}`)}return r.includes(a)||r.push(a),r},[])}fi.coreKnownTags=Pu;fi.getTags=Lu});var pi=C(zo=>{"use strict";var ui=K(),Iu=We(),Ru=Ve(),Fu=$t(),Bn=Yo(),Du=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,di=class e{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Bn.getTags(t,"compat"):t?Bn.getTags(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Bn.coreKnownTags:{},this.tags=Bn.getTags(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,ui.MAP,{value:Iu.map}),Object.defineProperty(this,ui.SCALAR,{value:Fu.string}),Object.defineProperty(this,ui.SEQ,{value:Ru.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Du:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};zo.Schema=di});var Vo=C(Wo=>{"use strict";var ju=K(),hi=bt(),Et=ht();function _u(e,t){let n=[],s=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);l?(n.push(l),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");let i=hi.createStringifyContext(e,t),{commentString:r}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let l=r(e.commentBefore);n.unshift(Et.indentComment(l,""))}let o=!1,a=null;if(e.contents){if(ju.isNode(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){let c=r(e.contents.commentBefore);n.push(Et.indentComment(c,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>o=!0,f=hi.stringify(e.contents,i,()=>a=null,l);a&&(f+=Et.lineComment(f,"",r(a))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(hi.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let l=r(e.comment);l.includes(`
57
+ `)?(n.push("..."),n.push(Et.indentComment(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=e.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(Et.indentComment(r(l),"")))}return n.join(`
58
58
  `)+`
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
- `),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+=`:
59
+ `}Wo.stringifyDocument=_u});var xt=C(Jo=>{"use strict";var Bu=dt(),Ge=an(),le=K(),Ku=Ee(),Uu=ve(),Yu=pi(),zu=Vo(),mi=nn(),Wu=ws(),Vu=pt(),gi=bs(),yi=class e{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,le.NODE_TYPE,{value:le.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new gi.Directives({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,i,s)}clone(){let t=Object.create(e.prototype,{[le.NODE_TYPE]:{value:le.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=le.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){He(this.contents)&&this.contents.add(t)}addIn(t,n){He(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let s=mi.anchorNames(this);t.anchor=!n||s.has(n)?mi.findNewAnchor(n||"a",s):n}return new Bu.Alias(t.anchor)}createNode(t,n,s){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){let y=v=>typeof v=="number"||v instanceof String||v instanceof Number,O=n.filter(y).map(String);O.length>0&&(n=n.concat(O)),i=n}else s===void 0&&n&&(s=n,n=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:f,tag:c}=s??{},{onAnchor:d,setAnchors:u,sourceObjects:h}=mi.createNodeAnchors(this,o||"a"),b={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:h},m=Vu.createNode(t,c,b);return a&&le.isCollection(m)&&(m.flow=!0),u(),m}createPair(t,n,s={}){let i=this.createNode(t,null,s),r=this.createNode(n,null,s);return new Ku.Pair(i,r)}delete(t){return He(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ge.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):He(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return le.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ge.isEmptyPath(t)?!n&&le.isScalar(this.contents)?this.contents.value:this.contents:le.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return le.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Ge.isEmptyPath(t)?this.contents!==void 0:le.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Ge.collectionFromPath(this.schema,[t],n):He(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ge.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Ge.collectionFromPath(this.schema,Array.from(t),n):He(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new gi.Directives({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new gi.Directives({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new Yu.Schema(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Uu.toJS(this.contents,n??"",a);if(typeof r=="function")for(let{count:f,res:c}of a.anchors.values())r(c,f);return typeof o=="function"?Wu.applyReviver(o,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return zu.stringifyDocument(this,t)}};function He(e){if(le.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}Jo.Document=yi});var qt=C(Tt=>{"use strict";var Ct=class extends Error{constructor(t,n,s,i){super(),this.name=t,this.code=s,this.message=i,this.pos=n}},bi=class extends Ct{constructor(t,n,s){super("YAMLParseError",t,n,s)}},wi=class extends Ct{constructor(t,n,s){super("YAMLWarning",t,n,s)}},Ju=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
60
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1,l=n.linePos[1];l?.line===s&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let f=" ".repeat(r)+"^".repeat(a);n.message+=`:
61
61
 
62
62
  ${o}
63
- ${c}
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=`
63
+ ${f}
64
+ `}};Tt.YAMLError=Ct;Tt.YAMLParseError=bi;Tt.YAMLWarning=wi;Tt.prettifyError=Ju});var Mt=C(Go=>{"use strict";function Gu(e,{flow:t,indicator:n,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,f=a,c=a,d="",u="",h=!1,b=!1,m=null,y=null,O=null,v=null,S=null,M=null,$=null;for(let g of e)switch(b&&(g.type!=="space"&&g.type!=="newline"&&g.type!=="comma"&&r(g.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),m&&(f&&g.type!=="comment"&&g.type!=="newline"&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),g.type){case"space":!t&&(n!=="doc-start"||s?.type!=="flow-collection")&&g.source.includes(" ")&&(m=g),c=!0;break;case"comment":{c||r(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=g.source.substring(1)||" ";d?d+=u+E:d=E,u="",f=!1;break}case"newline":f?d?d+=g.source:(!M||n!=="seq-item-ind")&&(l=!0):u+=g.source,f=!0,h=!0,(y||O)&&(v=g),c=!0;break;case"anchor":y&&r(g,"MULTIPLE_ANCHORS","A node can have at most one anchor"),g.source.endsWith(":")&&r(g.offset+g.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=g,$??($=g.offset),f=!1,c=!1,b=!0;break;case"tag":{O&&r(g,"MULTIPLE_TAGS","A node can have at most one tag"),O=g,$??($=g.offset),f=!1,c=!1,b=!0;break}case n:(y||O)&&r(g,"BAD_PROP_ORDER",`Anchors and tags must be after the ${g.source} indicator`),M&&r(g,"UNEXPECTED_TOKEN",`Unexpected ${g.source} in ${t??"collection"}`),M=g,f=n==="seq-item-ind"||n==="explicit-key-ind",c=!1;break;case"comma":if(t){S&&r(g,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),S=g,f=!1,c=!1;break}default:r(g,"UNEXPECTED_TOKEN",`Unexpected ${g.type} token`),f=!1,c=!1}let N=e[e.length-1],q=N?N.offset+N.source.length:i;return b&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(f&&m.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:M,spaceBefore:l,comment:d,hasNewline:h,anchor:y,tag:O,newlineAfterProp:v,end:q,start:$??q}}Go.resolveProps=Gu});var Kn=C(Ho=>{"use strict";function ki(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
65
+ `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(ki(t.key)||ki(t.value))return!0}return!1;default:return!0}}Ho.containsNewline=ki});var $i=C(Xo=>{"use strict";var Hu=Kn();function Xu(e,t,n){if(t?.type==="flow-collection"){let s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&Hu.containsNewline(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Xo.flowIndentCheck=Xu});var Si=C(Zo=>{"use strict";var Qo=K();function Qu(e,t,n){let{uniqueKeys:s}=e.options;if(s===!1)return!1;let i=typeof s=="function"?s:(r,o)=>r===o||Qo.isScalar(r)&&Qo.isScalar(o)&&r.value===o.value;return t.some(r=>i(r.key,n))}Zo.mapIncludes=Qu});var ra=C(ia=>{"use strict";var ea=Ee(),Zu=Ce(),ta=Mt(),ed=Kn(),na=$i(),td=Si(),sa="All mapping items must start at the same column";function nd({composeNode:e,composeEmptyNode:t},n,s,i,r){let o=r?.nodeClass??Zu.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,f=null;for(let c of s.items){let{start:d,key:u,sep:h,value:b}=c,m=ta.resolveProps(d,{indicator:"explicit-key-ind",next:u??h?.[0],offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0}),y=!m.found;if(y){if(u&&(u.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==s.indent&&i(l,"BAD_INDENT",sa)),!m.anchor&&!m.tag&&!h){f=m.end,m.comment&&(a.comment?a.comment+=`
66
+ `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||ed.containsNewline(u))&&i(u??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==s.indent&&i(l,"BAD_INDENT",sa);n.atKey=!0;let O=m.end,v=u?e(n,u,m,i):t(n,O,d,null,m,i);n.schema.compat&&na.flowIndentCheck(s.indent,u,i),n.atKey=!1,td.mapIncludes(n,a.items,v)&&i(O,"DUPLICATE_KEY","Map keys must be unique");let S=ta.resolveProps(h??[],{indicator:"map-value-ind",next:b,offset:v.range[2],onError:i,parentIndent:s.indent,startOnNewline:!u||u.type==="block-scalar"});if(l=S.end,S.found){y&&(b?.type==="block-map"&&!S.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<S.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let M=b?e(n,b,S,i):t(n,l,h,null,S,i);n.schema.compat&&na.flowIndentCheck(s.indent,b,i),l=M.range[2];let $=new ea.Pair(v,M);n.options.keepSourceTokens&&($.srcToken=c),a.items.push($)}else{y&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(v.comment?v.comment+=`
67
+ `+S.comment:v.comment=S.comment);let M=new ea.Pair(v);n.options.keepSourceTokens&&(M.srcToken=c),a.items.push(M)}}return f&&f<l&&i(f,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,f??l],a}ia.resolveBlockMap=nd});var aa=C(oa=>{"use strict";var sd=Te(),id=Mt(),rd=$i();function od({composeNode:e,composeEmptyNode:t},n,s,i,r){let o=r?.nodeClass??sd.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=s.offset,f=null;for(let{start:c,value:d}of s.items){let u=id.resolveProps(c,{indicator:"seq-item-ind",next:d,offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||d)d?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{f=u.end,u.comment&&(a.comment=u.comment);continue}let h=d?e(n,d,u,i):t(n,u.end,c,null,u,i);n.schema.compat&&rd.flowIndentCheck(s.indent,d,i),l=h.range[2],a.items.push(h)}return a.range=[s.offset,l,f??l],a}oa.resolveBlockSeq=od});var Xe=C(la=>{"use strict";function ad(e,t,n,s){let i="";if(e){let r=!1,o="";for(let a of e){let{source:l,type:f}=a;switch(f){case"space":r=!0;break;case"comment":{n&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let c=l.substring(1)||" ";i?i+=o+c:i=c,o="";break}case"newline":i&&(o+=l),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=l.length}}return{comment:i,offset:t}}la.resolveEnd=ad});var da=C(ua=>{"use strict";var ld=K(),cd=Ee(),ca=Ce(),fd=Te(),ud=Xe(),fa=Mt(),dd=Kn(),pd=Si(),vi="Block collections are not allowed within flow collections",Oi=e=>e&&(e.type==="block-map"||e.type==="block-seq");function hd({composeNode:e,composeEmptyNode:t},n,s,i,r){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?ca.YAMLMap:fd.YAMLSeq),f=new l(n.schema);f.flow=!0;let c=n.atRoot;c&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let y=0;y<s.items.length;++y){let O=s.items[y],{start:v,key:S,sep:M,value:$}=O,N=fa.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:S??M?.[0],offset:d,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!M&&!$){y===0&&N.comma?i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<s.items.length-1&&i(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(f.comment?f.comment+=`
68
+ `+N.comment:f.comment=N.comment),d=N.end;continue}!o&&n.options.strict&&dd.containsNewline(S)&&i(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0)N.comma&&i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||i(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let q="";e:for(let g of v)switch(g.type){case"comma":case"space":break;case"comment":q=g.source.substring(1);break e;default:break e}if(q){let g=f.items[f.items.length-1];ld.isPair(g)&&(g=g.value??g.key),g.comment?g.comment+=`
69
+ `+q:g.comment=q,N.comment=N.comment.substring(q.length+1)}}if(!o&&!M&&!N.found){let q=$?e(n,$,N,i):t(n,N.end,M,null,N,i);f.items.push(q),d=q.range[2],Oi($)&&i(q.range,"BLOCK_IN_FLOW",vi)}else{n.atKey=!0;let q=N.end,g=S?e(n,S,N,i):t(n,q,v,null,N,i);Oi(S)&&i(g.range,"BLOCK_IN_FLOW",vi),n.atKey=!1;let E=fa.resolveProps(M??[],{flow:a,indicator:"map-value-ind",next:$,offset:g.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(E.found){if(!o&&!N.found&&n.options.strict){if(M)for(let F of M){if(F===E.found)break;if(F.type==="newline"){i(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<E.found.offset-1024&&i(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else $&&("source"in $&&$.source?.[0]===":"?i($,"MISSING_CHAR",`Missing space after : in ${a}`):i(E.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let L=$?e(n,$,E,i):E.found?t(n,E.end,M,null,E,i):null;L?Oi($)&&i(L.range,"BLOCK_IN_FLOW",vi):E.comment&&(g.comment?g.comment+=`
70
+ `+E.comment:g.comment=E.comment);let Y=new cd.Pair(g,L);if(n.options.keepSourceTokens&&(Y.srcToken=O),o){let F=f;pd.mapIncludes(n,F.items,g)&&i(q,"DUPLICATE_KEY","Map keys must be unique"),F.items.push(Y)}else{let F=new ca.YAMLMap(n.schema);F.flow=!0,F.items.push(Y);let k=(L??g).range;F.range=[g.range[0],k[1],k[2]],f.items.push(F)}d=L?L.range[2]:E.end}}let u=o?"}":"]",[h,...b]=s.end,m=d;if(h?.source===u)m=h.offset+h.source.length;else{let y=a[0].toUpperCase()+a.substring(1),O=c?`${y} must end with a ${u}`:`${y} in block collection must be sufficiently indented and end with a ${u}`;i(d,c?"MISSING_CHAR":"BAD_INDENT",O),h&&h.source.length!==1&&b.unshift(h)}if(b.length>0){let y=ud.resolveEnd(b,m,n.options.strict,i);y.comment&&(f.comment?f.comment+=`
71
+ `+y.comment:f.comment=y.comment),f.range=[s.offset,m,y.offset]}else f.range=[s.offset,m,m];return f}ua.resolveFlowCollection=hd});var ha=C(pa=>{"use strict";var md=K(),gd=G(),yd=Ce(),bd=Te(),wd=ra(),kd=aa(),$d=da();function Ai(e,t,n,s,i,r){let o=n.type==="block-map"?wd.resolveBlockMap(e,t,n,s,r):n.type==="block-seq"?kd.resolveBlockSeq(e,t,n,s,r):$d.resolveFlowCollection(e,t,n,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Sd(e,t,n,s,i){let r=s.tag,o=r?t.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null;if(n.type==="block-seq"){let{anchor:u,newlineAfterProp:h}=s,b=u&&r?u.offset>r.offset?u:r:u??r;b&&(!h||h.offset<b.offset)&&i(b,"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(!r||!o||o==="!"||o===yd.YAMLMap.tagName&&a==="map"||o===bd.YAMLSeq.tagName&&a==="seq")return Ai(e,t,n,i,o);let l=t.schema.tags.find(u=>u.tag===o&&u.collection===a);if(!l){let u=t.schema.knownTags[o];if(u?.collection===a)t.schema.tags.push(Object.assign({},u,{default:!1})),l=u;else return u?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ai(e,t,n,i,o)}let f=Ai(e,t,n,i,o,l),c=l.resolve?.(f,u=>i(r,"TAG_RESOLVE_FAILED",u),t.options)??f,d=md.isNode(c)?c:new gd.Scalar(c);return d.range=f.range,d.tag=o,l?.format&&(d.format=l.format),d}pa.composeCollection=Sd});var Ei=C(ma=>{"use strict";var Ni=G();function vd(e,t,n){let s=t.offset,i=Od(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};let r=i.mode===">"?Ni.Scalar.BLOCK_FOLDED:Ni.Scalar.BLOCK_LITERAL,o=t.source?Ad(t.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=i.chomp==="+"&&o.length>0?`
72
+ `.repeat(Math.max(1,o.length-1)):"",y=s+i.length;return t.source&&(y+=t.source.length),{value:m,type:r,comment:i.comment,range:[s,y,y]}}let l=t.indent+i.indent,f=t.offset+i.length,c=0;for(let m=0;m<a;++m){let[y,O]=o[m];if(O===""||O==="\r")i.indent===0&&y.length>l&&(l=y.length);else{y.length<l&&n(f+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=y.length),c=m,l===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=y.length+O.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>l&&(a=m+1);let d="",u="",h=!1;for(let m=0;m<c;++m)d+=o[m][0].slice(l)+`
73
+ `;for(let m=c;m<a;++m){let[y,O]=o[m];f+=y.length+O.length+1;let v=O[O.length-1]==="\r";if(v&&(O=O.slice(0,-1)),O&&y.length<l){let M=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-O.length-(v?2:1),"BAD_INDENT",M),y=""}r===Ni.Scalar.BLOCK_LITERAL?(d+=u+y.slice(l)+O,u=`
74
+ `):y.length>l||O[0]===" "?(u===" "?u=`
75
75
  `:!h&&u===`
76
76
  `&&(u=`
77
77
 
78
- `),f+=u+y.slice(l)+p,u=`
79
- `,h=!0):p===""?u===`
80
- `?f+=`
78
+ `),d+=u+y.slice(l)+O,u=`
79
+ `,h=!0):O===""?u===`
80
+ `?d+=`
81
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
- `?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 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
- `))if(r===`
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
- `)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+=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
- `&&!(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 Gu(t,e){let n="",s=t[e+1];for(;(s===" "||s===" "||s===`
95
- `||s==="\r")&&!(s==="\r"&&t[e+2]!==`
82
+ `:(d+=u+O,u=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let m=a;m<o.length;++m)d+=`
83
+ `+o[m][0].slice(l);d[d.length-1]!==`
84
+ `&&(d+=`
85
+ `);break;default:d+=`
86
+ `}let b=s+i.length+t.source.length;return{value:d,type:r,comment:i.comment,range:[s,b,b]}}function Od({offset:e,props:t},n,s){if(t[0].type!=="block-scalar-header")return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],r=i[0],o=0,a="",l=-1;for(let u=1;u<i.length;++u){let h=i[u];if(!a&&(h==="-"||h==="+"))a=h;else{let b=Number(h);!o&&b?o=b:l===-1&&(l=e+u)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,c="",d=i.length;for(let u=1;u<t.length;++u){let h=t[u];switch(h.type){case"space":f=!0;case"newline":d+=h.source.length;break;case"comment":n&&!f&&s(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=h.source.length,c=h.source.substring(1);break;case"error":s(h,"UNEXPECTED_TOKEN",h.message),d+=h.source.length;break;default:{let b=`Unexpected token in block scalar header: ${h.type}`;s(h,"UNEXPECTED_TOKEN",b);let m=h.source;m&&typeof m=="string"&&(d+=m.length)}}}return{mode:r,indent:o,chomp:a,comment:c,length:d}}function Ad(e){let t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),r=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}ma.resolveBlockScalar=vd});var Ci=C(ya=>{"use strict";var xi=G(),Nd=Xe();function Ed(e,t,n){let{offset:s,type:i,source:r,end:o}=e,a,l,f=(u,h,b)=>n(s+u,h,b);switch(i){case"scalar":a=xi.Scalar.PLAIN,l=xd(r,f);break;case"single-quoted-scalar":a=xi.Scalar.QUOTE_SINGLE,l=Cd(r,f);break;case"double-quoted-scalar":a=xi.Scalar.QUOTE_DOUBLE,l=Td(r,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}let c=s+r.length,d=Nd.resolveEnd(o,c,t,n);return{value:l,type:a,comment:d.comment,range:[s,c,d.offset]}}function xd(e,t){let n="";switch(e[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 ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),ga(e)}function Cd(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ga(e.slice(1,-1)).replace(/''/g,"'")}function ga(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let s,i;try{s=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{s=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=n[1].replace(s,""),o=" ",a=t.lastIndex;for(;n=t.exec(e);){let f=n[1].replace(i,"");f===""?o===`
87
+ `?r+=o:o=`
88
+ `:(r+=o+f,o=" "),a=t.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(e),r+o+(n?.[1]??"")}function Td(e,t){let n="";for(let s=1;s<e.length-1;++s){let i=e[s];if(!(i==="\r"&&e[s+1]===`
89
+ `))if(i===`
90
+ `){let{fold:r,offset:o}=qd(e,s);n+=r,s=o}else if(i==="\\"){let r=e[++s],o=Md[r];if(o)n+=o;else if(r===`
91
+ `)for(r=e[s+1];r===" "||r===" ";)r=e[++s+1];else if(r==="\r"&&e[s+1]===`
92
+ `)for(r=e[++s+1];r===" "||r===" ";)r=e[++s+1];else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;n+=Pd(e,s+1,a,t),s+=a}else{let a=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){let r=s,o=e[s+1];for(;o===" "||o===" ";)o=e[++s+1];o!==`
93
+ `&&!(o==="\r"&&e[s+2]===`
94
+ `)&&(n+=s>r?e.slice(r,s+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function qd(e,t){let n="",s=e[t+1];for(;(s===" "||s===" "||s===`
95
+ `||s==="\r")&&!(s==="\r"&&e[t+2]!==`
96
96
  `);)s===`
97
97
  `&&(n+=`
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?`
98
+ `),t+=1,s=e[t+1];return n||(n=" "),{fold:n,offset:t}}var Md={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 Pd(e,t,n,s){let i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}ya.resolveFlowScalar=Ed});var ka=C(wa=>{"use strict";var De=K(),ba=G(),Ld=Ei(),Id=Ci();function Rd(e,t,n,s){let{value:i,type:r,comment:o,range:a}=t.type==="block-scalar"?Ld.resolveBlockScalar(e,t,s):Id.resolveFlowScalar(t,e.options.strict,s),l=n?e.directives.tagName(n.source,d=>s(n,"TAG_RESOLVE_FAILED",d)):null,f;e.options.stringKeys&&e.atKey?f=e.schema[De.SCALAR]:l?f=Fd(e.schema,i,l,n,s):t.type==="scalar"?f=Dd(e,i,t,s):f=e.schema[De.SCALAR];let c;try{let d=f.resolve(i,u=>s(n??t,"TAG_RESOLVE_FAILED",u),e.options);c=De.isScalar(d)?d:new ba.Scalar(d)}catch(d){let u=d instanceof Error?d.message:String(d);s(n??t,"TAG_RESOLVE_FAILED",u),c=new ba.Scalar(i)}return c.range=a,c.source=i,r&&(c.type=r),l&&(c.tag=l),f.format&&(c.format=f.format),o&&(c.comment=o),c}function Fd(e,t,n,s,i){if(n==="!")return e[De.SCALAR];let r=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(t))return a;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[De.SCALAR])}function Dd({atKey:e,directives:t,schema:n},s,i,r){let o=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(s))||n[De.SCALAR];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(s))??n[De.SCALAR];if(o.tag!==a.tag){let l=t.tagString(o.tag),f=t.tagString(a.tag),c=`Value may be parsed as either ${l} or ${f}`;r(i,"TAG_RESOLVE_FAILED",c,!0)}}return o}wa.composeScalar=Rd});var Sa=C($a=>{"use strict";function jd(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let i=t[s];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++s];i?.type==="space";)e+=i.source.length,i=t[++s];break}}return e}$a.emptyScalarPosition=jd});var Aa=C(qi=>{"use strict";var _d=dt(),Bd=K(),Kd=ha(),va=ka(),Ud=Xe(),Yd=Sa(),zd={composeNode:Oa,composeEmptyNode:Ti};function Oa(e,t,n,s){let i=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=n,f,c=!0;switch(t.type){case"alias":f=Wd(e,t,s),(a||l)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=va.composeScalar(e,t,l,s),a&&(f.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{f=Kd.composeCollection(zd,e,t,n,s),a&&(f.anchor=a.source.substring(1))}catch(d){let u=d instanceof Error?d.message:String(d);s(t,"RESOURCE_EXHAUSTION",u)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",d),c=!1}}return f??(f=Ti(e,t.offset,void 0,null,n,s)),a&&f.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Bd.isScalar(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&s(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(f.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?f.comment=o:f.commentBefore=o),e.options.keepSourceTokens&&c&&(f.srcToken=t),f}function Ti(e,t,n,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},f){let c={type:"scalar",offset:Yd.emptyScalarPosition(t,n,s),indent:-1,source:""},d=va.composeScalar(e,c,a,f);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),r&&(d.comment=r,d.range[2]=l),d}function Wd({options:e},{offset:t,source:n,end:s},i){let r=new _d.Alias(n.substring(1));r.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+n.length,a=Ud.resolveEnd(s,o,e.strict,i);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}qi.composeEmptyNode=Ti;qi.composeNode=Oa});var xa=C(Ea=>{"use strict";var Vd=xt(),Na=Aa(),Jd=Xe(),Gd=Mt();function Hd(e,t,{offset:n,start:s,value:i,end:r},o){let a=Object.assign({_directives:t},e),l=new Vd.Document(void 0,a),f={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},c=Gd.resolveProps(s,{indicator:"doc-start",next:i??r?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});c.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!c.hasNewline&&o(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Na.composeNode(f,i,c,o):Na.composeEmptyNode(f,c.end,s,null,c,o);let d=l.contents.range[2],u=Jd.resolveEnd(r,d,!1,o);return u.comment&&(l.comment=u.comment),l.range=[n,d,u.offset],l}Ea.composeDoc=Hd});var Pi=C(qa=>{"use strict";var Xd=Ht("process"),Qd=bs(),Zd=xt(),Pt=qt(),Ca=K(),ep=xa(),tp=Xe();function Lt(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Ta(e){let t="",n=!1,s=!1;for(let i=0;i<e.length;++i){let r=e[i];switch(r[0]){case"#":t+=(t===""?"":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 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
- ${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: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
- `}];switch(a[0]){case"|":case">":{let c=a.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
- `),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}];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`
102
+ `)+(r.substring(1)||" "),n=!0,s=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}var Mi=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,i,r)=>{let o=Lt(n);r?this.warnings.push(new Pt.YAMLWarning(o,s,i)):this.errors.push(new Pt.YAMLParseError(o,s,i))},this.directives=new Qd.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:s,afterEmptyLine:i}=Ta(this.prelude);if(s){let r=t.contents;if(n)t.comment=t.comment?`${t.comment}
103
+ ${s}`:s;else if(i||t.directives.docStart||!r)t.commentBefore=s;else if(Ca.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Ca.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${s}
104
+ ${a}`:s}else{let o=r.commentBefore;r.commentBefore=o?`${s}
105
+ ${o}`:s}}if(n){for(let r=0;r<this.errors.length;++r)t.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)t.warnings.push(this.warnings[r])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ta(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,s=-1){for(let i of t)yield*this.next(i);yield*this.end(n,s)}*next(t){switch(Xd.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,s,i)=>{let r=Lt(t);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=ep.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"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(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new Pt.YAMLParseError(Lt(t),"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 Pt.YAMLParseError(Lt(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let n=tp.resolveEnd(t.end,t.offset+t.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 Pt.YAMLParseError(Lt(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let s=Object.assign({_directives:this.directives},this.options),i=new Zd.Document(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};qa.Composer=Mi});var La=C(Un=>{"use strict";var np=Ei(),sp=Ci(),ip=qt(),Ma=yt();function rp(e,t=!0,n){if(e){let s=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,r,o);else throw new ip.YAMLParseError([a,a+1],r,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return sp.resolveFlowScalar(e,t,s);case"block-scalar":return np.resolveBlockScalar({options:{strict:t}},e,s)}}return null}function op(e,t){let{implicitKey:n=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=Ma.stringifyString({type:o,value:e},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:s,source:`
107
+ `}];switch(a[0]){case"|":case">":{let f=a.indexOf(`
108
+ `),c=a.substring(0,f),d=a.substring(f+1)+`
109
+ `,u=[{type:"block-scalar-header",offset:r,indent:s,source:c}];return Pa(u,l)||u.push({type:"newline",offset:-1,indent:s,source:`
110
+ `}),{type:"block-scalar",offset:r,indent:s,props:u,source:d}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:l};default:return{type:"scalar",offset:r,indent:s,source:a,end:l}}}function ap(e,t,n={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=n,a="indent"in e?e.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let f=e.props[0];if(f.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=f.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=Ma.stringifyString({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":lp(e,l);break;case'"':Li(e,l,"double-quoted-scalar");break;case"'":Li(e,l,"single-quoted-scalar");break;default:Li(e,l,"scalar")}}function lp(e,t){let n=t.indexOf(`
111
+ `),s=t.substring(0,n),i=t.substring(n+1)+`
112
+ `;if(e.type==="block-scalar"){let r=e.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=s,e.source=i}else{let{offset:r}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:s}];Pa(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
113
+ `});for(let l of Object.keys(e))l!=="type"&&l!=="offset"&&delete e[l];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function Pa(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function Li(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let s=e.props.slice(1),i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(let r of s)r.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:s});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
114
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{let s="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(e))r!=="type"&&r!=="offset"&&delete e[r];Object.assign(e,{type:n,indent:s,source:t,end:i})}}}Un.createScalarToken=op;Un.resolveAsScalar=rp;Un.setScalarValue=ap});var Ra=C(Ia=>{"use strict";var cp=e=>"type"in e?zn(e):Yn(e);function zn(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=zn(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Yn(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Yn(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Yn(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function Yn({start:e,key:t,sep:n,value:s}){let i="";for(let r of e)i+=r.source;if(t&&(i+=zn(t)),n)for(let r of n)i+=r.source;return s&&(i+=zn(s)),i}Ia.stringify=cp});var _a=C(ja=>{"use strict";var Ii=Symbol("break visit"),fp=Symbol("skip children"),Fa=Symbol("remove item");function je(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),Da(Object.freeze([]),e,t)}je.BREAK=Ii;je.SKIP=fp;je.REMOVE=Fa;je.itemAtPath=(e,t)=>{let n=e;for(let[s,i]of t){let r=n?.[s];if(r&&"items"in r)n=r.items[i];else return}return n};je.parentCollection=(e,t)=>{let n=je.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],i=n?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Da(e,t,n){let s=n(t,e);if(typeof s=="symbol")return s;for(let i of["key","value"]){let r=t[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=Da(Object.freeze(e.concat([[i,o]])),r.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Ii)return Ii;a===Fa&&(r.items.splice(o,1),o-=1)}}typeof s=="function"&&i==="key"&&(s=s(t,e))}}return typeof s=="function"?s(t,e):s}ja.visit=je});var Wn=C(oe=>{"use strict";var Ri=La(),up=Ra(),dp=_a(),Fi="\uFEFF",Di="",ji="",_i="",pp=e=>!!e&&"items"in e,hp=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function mp(e){switch(e){case Fi:return"<BOM>";case Di:return"<DOC>";case ji:return"<FLOW_END>";case _i:return"<SCALAR>";default:return JSON.stringify(e)}}function gp(e){switch(e){case Fi:return"byte-order-mark";case Di:return"doc-mode";case ji:return"flow-error-end";case _i: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=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
- `?!0:n==="\r"?this.buffer[e+1]===`
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
- `||!r&&!this.atEnd)return e+s+1}return n===`
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(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
- `,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
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
- `: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
- `)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
- `,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
- `;)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&&Ln.has(i))break;n=s}else if(se(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
131
- `?(s+=1,r=`
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
- `?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)}};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(`
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(e[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}oe.createScalarToken=Ri.createScalarToken;oe.resolveAsScalar=Ri.resolveAsScalar;oe.setScalarValue=Ri.setScalarValue;oe.stringify=up.stringify;oe.visit=dp.visit;oe.BOM=Fi;oe.DOCUMENT=Di;oe.FLOW_END=ji;oe.SCALAR=_i;oe.isCollection=pp;oe.isScalar=hp;oe.prettyToken=mp;oe.tokenType=gp});var Ui=C(Ka=>{"use strict";var It=Wn();function de(e){switch(e){case void 0:case" ":case`
117
+ `:case"\r":case" ":return!0;default:return!1}}var Ba=new Set("0123456789ABCDEFabcdef"),yp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vn=new Set(",[]{}"),bp=new Set(` ,[]{}
118
+ \r `),Bi=e=>!e||bp.has(e),Ki=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(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
119
+ `?!0:n==="\r"?this.buffer[t+1]===`
120
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+t];if(n==="\r"){let i=this.buffer[s+t+1];if(i===`
121
+ `||!i&&!this.atEnd)return t+s+1}return n===`
122
+ `||s>=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){let s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&de(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
123
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){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 t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===It.BOM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){let r=t[s-1];if(r===" "||r===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){let r=t[n-1];if(r===" "||r===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield It.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&de(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&&!de(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&de(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 t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.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(Bi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&de(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield It.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Bi),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||de(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 t=this.charAt(0),n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let r=0;for(;this.buffer[n-1-r]==="\\";)r+=1;if(r%2===0)break;n=this.buffer.indexOf('"',n+1)}let s=this.buffer.substring(0,n),i=s.indexOf(`
124
+ `,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
125
+ `,r)}i!==-1&&(n=i-(s[i-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 t=this.pos;for(;;){let n=this.buffer[++t];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=>de(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":n+=1;break;case`
126
+ `:t=r,n=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
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 r=this.continueScalar(t+1);if(r===-1)break;t=this.buffer.indexOf(`
128
+ `,r)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
129
+ `;)s=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let r=t-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
130
+ `&&r>=this.pos&&r+1+n>a)t=r;else break}while(!0);return yield It.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){let r=this.buffer[s+1];if(de(r)||t&&Vn.has(r))break;n=s}else if(de(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
131
+ `?(s+=1,i=`
132
+ `,r=this.buffer[s+1]):n=s),r==="#"||t&&Vn.has(r))break;if(i===`
133
+ `){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(t&&Vn.has(i))break;n=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield It.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Bi),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,s=this.charAt(1);if(de(s)||n&&Vn.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!de(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(yp.has(n))n=this.buffer[++t];else if(n==="%"&&Ba.has(this.buffer[t+1])&&Ba.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
134
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
135
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||t&&s===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Ka.Lexer=Ki});var zi=C(Ua=>{"use strict";var Yi=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){let r=n+s>>1;this.lineStarts[r]<t?n=r+1:s=r}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}};Ua.LineCounter=Yi});var Vi=C(Ja=>{"use strict";var wp=Ht("process"),Ya=Wn(),kp=Ui();function qe(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function za(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Va(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Jn(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Qe(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function Gn(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Wa(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!qe(t.start,"explicit-key-ind")&&!qe(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Va(t.value)?t.value.end?Gn(t.value.end,t.sep):t.value.end=t.sep:Gn(t.start,t.sep),delete t.sep)}var Wi=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new kp.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(t,n))yield*this.next(s);n||(yield*this.end())}*next(t){if(this.source=t,wp.env.LOG_TOKENS&&console.log("|",Ya.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=Ya.tokenType(t);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+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let s=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:t}),this.offset+=t.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 t=this.peek(1);if(this.type==="doc-end"&&t?.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(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??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"&&Wa(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{let i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{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 i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&za(i.start)===-1&&(n.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<n.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.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 t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{za(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=Jn(this.peek(2)),s=Qe(n),i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];let r={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.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)){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(`
137
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.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):t.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)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Gn(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&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>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(r.push(this.sourceToken),t.items.push({start:r}),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):i||n.value?(r.push(this.sourceToken),t.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(qe(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Va(n.key)&&!qe(n.sep,"newline")){let o=Qe(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 r.length>0?n.sep=n.sep.concat(r,this.sourceToken):n.sep.push(this.sourceToken);else if(qe(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Qe(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||i?t.items.push({start:r,key:null,sep:[this.sourceToken]}):qe(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);i||n.value?(t.items.push({start:r,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(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!qe(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&&t.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.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):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Gn(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||qe(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.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(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.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?t.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 i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let s=this.startBlockValue(t);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===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let i=Jn(s),r=Qe(i);Wa(t);let o=t.end.splice(1,t.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){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=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"?>
139
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){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=Jn(t),s=Qe(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=Jn(t),s=Qe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){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:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Ja.Parser=Wi});var Za=C(Ft=>{"use strict";var Ga=Pi(),$p=xt(),Rt=qt(),Sp=qs(),vp=K(),Op=zi(),Ha=Vi();function Xa(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Op.LineCounter||null,prettyErrors:t}}function Ap(e,t={}){let{lineCounter:n,prettyErrors:s}=Xa(t),i=new Ha.Parser(n?.addNewLine),r=new Ga.Composer(t),o=Array.from(r.compose(i.parse(e)));if(s&&n)for(let a of o)a.errors.forEach(Rt.prettifyError(e,n)),a.warnings.forEach(Rt.prettifyError(e,n));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Qa(e,t={}){let{lineCounter:n,prettyErrors:s}=Xa(t),i=new Ha.Parser(n?.addNewLine),r=new Ga.Composer(t),o=null;for(let a of r.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Rt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(Rt.prettifyError(e,n)),o.warnings.forEach(Rt.prettifyError(e,n))),o}function Np(e,t,n){let s;typeof t=="function"?s=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=Qa(e,n);if(!i)return null;if(i.warnings.forEach(r=>Sp.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))}function Ep(e,t,n){let s=null;if(typeof t=="function"||Array.isArray(t)?s=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}return vp.isDocument(e)&&!s?e.toString(n):new $p.Document(e,s,n).toString(n)}Ft.parse=Np;Ft.parseAllDocuments=Ap;Ft.parseDocument=Qa;Ft.stringify=Ep});var Xn=C(U=>{"use strict";var xp=Pi(),Cp=xt(),Tp=pi(),Ji=qt(),qp=dt(),Me=K(),Mp=Ee(),Pp=G(),Lp=Ce(),Ip=Te(),Rp=Wn(),Fp=Ui(),Dp=zi(),jp=Vi(),Hn=Za(),el=lt();U.Composer=xp.Composer;U.Document=Cp.Document;U.Schema=Tp.Schema;U.YAMLError=Ji.YAMLError;U.YAMLParseError=Ji.YAMLParseError;U.YAMLWarning=Ji.YAMLWarning;U.Alias=qp.Alias;U.isAlias=Me.isAlias;U.isCollection=Me.isCollection;U.isDocument=Me.isDocument;U.isMap=Me.isMap;U.isNode=Me.isNode;U.isPair=Me.isPair;U.isScalar=Me.isScalar;U.isSeq=Me.isSeq;U.Pair=Mp.Pair;U.Scalar=Pp.Scalar;U.YAMLMap=Lp.YAMLMap;U.YAMLSeq=Ip.YAMLSeq;U.CST=Rp;U.Lexer=Fp.Lexer;U.LineCounter=Dp.LineCounter;U.Parser=jp.Parser;U.parse=Hn.parse;U.parseAllDocuments=Hn.parseAllDocuments;U.parseDocument=Hn.parseDocument;U.stringify=Hn.stringify;U.visit=el.visit;U.visitAsync=el.visitAsync});import{readdirSync as sc,readFileSync as ic}from"node:fs";import{basename as rc,join as ps}from"node:path";var oc=/^agent\.mcs\.ya?ml$/,ac=/\.ya?ml$/,lc=/(^|\/)workflows\/.+\.json$/,lr=e=>sc(e,{withFileTypes:!0}).filter(t=>!t.name.startsWith(".")&&t.name!=="node_modules");function cr(e,t=""){return lr(e).flatMap(n=>{let s=t?`${t}/${n.name}`:n.name;return n.isDirectory()?cr(ps(e,n.name),s):n.isFile()?[{path:s,text:ac.test(n.name)||lc.test(s)?ic(ps(e,n.name),"utf8"):""}]:[]})}function fr(e){let t=lr(e);return t.some(n=>n.isFile()&&oc.test(n.name))?[{id:rc(e),dir:e,files:cr(e)}]:t.filter(n=>n.isDirectory()).flatMap(n=>fr(ps(e,n.name)))}var se=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:void 0,Xt=e=>typeof e=="string"&&e.trim()?e:void 0;function cc(e){let t=se(se(se(e)?.properties)?.definition)??se(se(e)?.definition);return t&&(se(t.actions)||se(t.triggers))?t:void 0}function*at(e){for(let[t,n]of Object.entries(se(e)??{})){let s=se(n);if(s){yield[t,s],yield*at(s.actions),yield*at(se(s.else)?.actions);for(let i of Object.values(se(s.cases)??{}))yield*at(se(i)?.actions);yield*at(se(s.default)?.actions)}}}var fc=e=>/^https?:\/\/([^/?#:@]+)/i.exec(e)?.[1]?.toLowerCase(),uc=e=>e.slice(e.lastIndexOf("/")+1);function ur(e){let t=cc(e);if(!t)return;let n={uses:[]},s=(i,r)=>n.uses.some(o=>o.key===i)||n.uses.push({key:i,action:r});for(let[i,r]of at(t.actions)){let o=se(r.inputs),a=se(o?.host);switch(r.type){case"OpenApiConnection":case"OpenApiConnectionWebhook":{let l=Xt(a?.apiId)?uc(a.apiId):Xt(a?.connectionName);if(!l)break;s(`connector:${l}`,i),Xt(a?.operationId)&&s(`operation:${l}/${a.operationId}`,i);break}case"Http":{let l=Xt(o?.uri)&&fc(o.uri);l&&s(`http:${l}`,i);break}case"Workflow":s("child-flow",i);break;case"Response":n.returns??=i;break}}return n}function hs(e,t){let n=e.indexOf(`${JSON.stringify(t)}:`);return n<0?1:e.slice(0,n).split(`
140
+ `).length}var pe=ds(Xn()),W=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:void 0,_=e=>typeof e=="string"&&e.trim()?e:void 0,Dt=e=>Array.isArray(e)?e:[];function tl(e){if(!e.trim())return"empty";let t=new pe.LineCounter,n=(0,pe.parseDocument)(e,{lineCounter:t,uniqueKeys:!1});if(n.errors.length)return"yaml";let s=new WeakMap,i=o=>{if((0,pe.isMap)(o)){let a={};o.range&&s.set(a,o.range[0]);for(let l of o.items)a[String((0,pe.isScalar)(l.key)?l.key.value:l.key)]=i(l.value);return a}return(0,pe.isSeq)(o)?o.items.map(i):(0,pe.isScalar)(o)?o.value:o},r=i(n.contents);return r==null?"empty":{data:r,lineOf:o=>o&&typeof o=="object"&&s.has(o)?t.linePos(s.get(o)).line:void 0}}function*et(e,t=!1){if(Array.isArray(e))for(let s of e)yield*et(s,t);let n=W(e);if(n){if(n.disabled===!0){t&&typeof n.kind=="string"&&(yield n);return}typeof n.kind=="string"&&!t&&(yield n);for(let s of Object.values(n))yield*et(s,t)}}var jt=e=>e.split(".")[1]??e,Ze=(e,t)=>e.slice(e.lastIndexOf(t)+(e.includes(t)?t.length:0)),_p=/(^|[\s._-])(copy|c[oó]pia|new|test|teste)([\s._-]|$)|\.[a-z]{2}-[A-Z]{2}(\.topic)?\.mcs\.ya?ml$/i,Bp=5e4;function Kp(e,t){let n=e.split(`
141
+ `),s=n.findIndex(i=>new RegExp(`^\\s*${t}:`).test(i));return s<0?1:/:\s*[|>][-+]?\s*$/.test(n[s])?s+2:s+1}var Up=new Set(["LogCustomTelemetryEvent","CSATQuestion","SearchAndSummarizeContent","SearchKnowledgeSources"]),Yp={topics:"topic",actions:"action",knowledge:"knowledge",variables:"variable"},zp=/^workflows\/([^/]+)\/(.+)$/;function Wp(e,t,n){let s={id:e,facts:{},children:[],unknown:[],names:{},texts:[],contract:[],flows:[]},i=[],r=new Map,o=[],a=h=>Ze(h,"/").replace(/(\.topic)?\.mcs\.ya?ml$|\.ya?ml$/,""),l=[],f=[],c=[],d=new Map;for(let h of[...t].sort((b,m)=>b.path.localeCompare(m.path))){let b=zp.exec(h.path);if(b&&(/\.json$/.test(h.path)||/^metadata\.ya?ml$/.test(b[2]))){let g=d.get(b[1])??{json:{}};if(d.set(b[1],g),/\.json$/.test(h.path)){try{g.json[b[2]]={file:h.path,text:h.text,data:JSON.parse(h.text)}}catch{s.unknown.push({file:h.path,why:"json"})}continue}let E=tl(h.text);E==="yaml"||E==="empty"?s.unknown.push({file:h.path,why:E}):[g.meta,g.metaFile]=[W(E.data),h.path];continue}if(!/\.ya?ml$/.test(h.path)){s.unknown.push({file:h.path,why:"file"});continue}let m=tl(h.text);if(m==="yaml"||m==="empty"){s.unknown.push({file:h.path,why:m});continue}let y=W(m.data),O=/^agents\/([^/]+)\//.exec(h.path)?.[1],v=s.facts;if(O){let g=s.children.find(E=>E.name===O);g||s.children.push(g={name:O,facts:{}}),v=g.facts}let S=(g,E,L=v)=>(L[g]??=[]).push({file:h.path,line:m.lineOf(E??y)});if(O&&S(`child:${O}`,y,s.facts),!O&&/^settings\.mcs\.ya?ml$/.test(h.path)&&y){s.schemaName=_(y.schemaName)??s.schemaName,s.displayName=_(y.displayName)??s.displayName,_(y.authenticationMode)&&S(`auth:${y.authenticationMode}`);let g=W(y.configuration),E=W(g?.settings)?.GenerativeActionsEnabled;typeof E=="boolean"&&S(`setting:generative=${E?"on":"off"}`,g),g?.isAgentConnectable===!0&&S("setting:connectable",g);continue}let M=n?[...et(y)].map(g=>g.kind).find(g=>!n.has(g)):void 0;if(M&&s.unknown.push({file:h.path,why:"kind",kind:M}),typeof y?.kind!="string"){M||s.unknown.push({file:h.path,why:"kind"});continue}if(y.state==="Inactive"||y.status==="Inactive"){S(`disabled:${Yp[h.path.split("/")[O?2:0]]??"component"}:${a(h.path)}`);continue}let $=h.text,N=(g,E,L)=>{O||!_(L)||_p.test(Ze(h.path,"/"))||s.texts.push({source:g,file:h.path,line:Kp($,E),text:L.trimEnd().slice(0,Bp)})},q=(g,E)=>{_(g)&&(S("instructions:present",E),/\b(Today|Now)\(\)/.test(g)&&S("ms:date-context",E))};switch(y.kind){case"GptComponentMetadata":{s.displayName??=_(y.displayName),q(y.instructions,y),N("instructions","instructions",y.instructions),N("instructions","responseInstructions",y.responseInstructions);let g=W(y.aISettings),E=F=>F===!0?"on":"off";typeof g?.useModelKnowledge=="boolean"&&S(`setting:model-knowledge=${E(g.useModelKnowledge)}`,g),_(g?.contentModeration)&&S(`setting:moderation=${g.contentModeration.toLowerCase()}`,g),typeof g?.isSemanticSearchEnabled=="boolean"&&S(`setting:semantic-search=${E(g.isSemanticSearchEnabled)}`,g);let L=W(y.gptCapabilities);typeof L?.webBrowsing=="boolean"&&S(`setting:web-browsing=${E(L.webBrowsing)}`,L);let Y=W(W(y.aISettings)?.model);_(Y?.modelNameHint)&&S(`model:${Y.modelNameHint}`,Y);break}case"AgentDialog":{let g=W(y.beginDialog);_(g?.kind)&&S(`trigger:${g.kind}`,g),q(W(y.settings)?.instructions,y.settings);break}case"AdaptiveDialog":{let g=W(y.beginDialog),E=_(g?.kind);E&&S(`trigger:${E}`,g),E&&r.set(`${O??""}/${a(h.path)}`,E),_(y.modelDescription)&&S("topics:with-model-description");let L=Dt(W(g?.intent)?.triggerQueries).length;!O&&E==="OnRecognizedIntent"&&!_(y.modelDescription)&&!L&&f.push({kind:"topic",name:a(h.path),at:{file:h.path,line:m.lineOf(y)}}),N("descriptions","modelDescription",y.modelDescription);let Y=Dt(y.inputs).some(F=>W(F)?.kind==="AutomaticTaskInput"&&W(F)?.shouldPromptUser===!1);E==="OnRecognizedIntent"&&Y&&S("ms:orchestrator-variables",g),E==="OnError"&&$.includes("System.Error.SubCode")&&S("ms:rai-error-handling",g),E==="OnKnowledgeRequested"&&[...et(g)].some(F=>F.kind==="SendActivity")&&S("ms:knowledge-hold-message",g),E==="OnGeneratedResponse"&&$.includes("System.ContinueResponse")&&S("ms:prevent-tool-call-leaks",g);break}case"TaskDialog":{let g=W(y.action);N("descriptions","modelDescription",y.modelDescription),!O&&!_(y.modelDescription)&&f.push({kind:"action",name:a(h.path),at:{file:h.path,line:m.lineOf(y)}});let E=_(g?.connectionReference);if(g?.kind==="InvokeConnectorTaskAction"&&E&&(S(`connector:${jt(E)}`,g),_(g.operationId)&&S(`operation:${jt(E)}/${g.operationId}`,g)),g?.kind==="InvokeExternalAgentTaskAction"&&W(g.operationDetails)?.kind==="ModelContextProtocolMetadata"&&E&&S(`mcp:${jt(E)}`,g),g?.kind==="InvokeConnectedAgentTaskAction"&&_(g.botSchemaName)&&(S(`calls:${g.botSchemaName}`,g),O||s.contract.push({calls:g.botSchemaName,..._(y.modelDisplayName)?{name:y.modelDisplayName}:{},history:W(g.historyType)?.kind==="ConversationHistory",inputs:Dt(y.inputs).map(L=>_(W(L)?.propertyName)).filter(L=>!!L),description:_(y.modelDescription)?.trim()??"",file:h.path,line:m.lineOf(g)})),g?.kind==="InvokeFlowTaskAction"&&_(g.flowId)){S(`flow:${g.flowId}`,g);let L=_(y.modelDisplayName)??_(W(y["mcs.metadata"])?.componentName);L&&(s.names[g.flowId]??=L)}break}case"KnowledgeSourceConfiguration":{let g=W(y.source);_(g?.kind)&&S(`knowledge:${g.kind}`,g),g&&"triggerCondition"in g&&S("yaml-only:triggerCondition",g),i.push({file:h.path,line:m.lineOf(y)});break}case"GlobalVariableComponent":{let g=W(y.variable)??y,E=_(g.name)??(_(y.schemaName)?Ze(y.schemaName,"."):void 0);if(!E)break;S(`var:${E}`),g.isExternalInitializationAllowed===!0&&S(`var-in:${E}`),O||c.push({name:E,at:{file:h.path,line:m.lineOf(y)}});break}case"ConnectionReferencesSourceFile":for(let g of Dt(y.connectionReferences).map(W)){let E=_(g?.connectorId)?Ze(g.connectorId,"/"):_(g?.connectionReferenceLogicalName)?jt(g.connectionReferenceLogicalName):void 0;E&&S(`connref:${E}`,g),E&&_(g?.displayName)&&(s.names[E]=g.displayName)}break}for(let g of et(y,!0))S(`disabled:node:${g.kind}`,g);for(let g of et(y)){if(Up.has(g.kind)&&S(`node:${g.kind}`,g),g.kind==="InvokeConnectorAction"&&_(g.connectionReference)){let L=jt(g.connectionReference);S(`connector:${L}`,g),_(g.operationId)&&S(`operation:${L}/${g.operationId}`,g)}if(g.kind==="InvokeFlowAction"&&_(g.flowId)&&S(`flow:${g.flowId}`,g),(g.kind==="BeginDialog"||g.kind==="ReplaceDialog")&&_(g.dialog)){let L=g.dialog;l.push(L),L.startsWith("=")?L.includes("Switch(")&&S("ms:dynamic-topic-redirect",g):o.push({topic:`${O??""}/${Ze(L,".topic.")}`,into:v,at:{file:h.path,line:m.lineOf(g)}})}let E=L=>typeof L=="string"&&L.includes("System.Activity.ChannelId");(g.kind==="ConditionGroup"&&Dt(g.conditions).some(L=>E(W(L)?.condition))||g.kind==="SetVariable"&&E(g.value))&&S("ms:channel-aware-behavior",g),(g.kind==="SendActivity"||g.kind==="Question")&&JSON.stringify(g).includes("<br")&&S("ms:line-breaks-in-messages",g)}}i.length&&(s.facts[`knowledge:count=${i.length}`]=i);let u=new Set([s.facts,...s.children.map(h=>h.facts)].flatMap(h=>Object.keys(h)).filter(h=>h.startsWith("flow:")).map(h=>h.slice(5)));for(let[h,{meta:b,metaFile:m,json:y}]of[...d].sort(([O],[v])=>O.localeCompare(v))){let O=_(b?.jsonFileName)??Object.keys(y)[0],v=O?y[O]:void 0,S=_(b?.workflowId),M=h.replace(/-[0-9a-f]{6,}$/i,"");if(!v){m&&s.unknown.push({file:m,why:"flow"});continue}let $=ur(v.data);if(!$||!S){s.unknown.push({file:v.file,why:"flow"});continue}let N=_(b?.displayName)??_(W(W(v.data)?.properties)?.displayName)??M,q=u.has(S);if(s.flows.push({id:S,name:N,folder:h,uses:$.uses.map(g=>g.key),returns:!!$.returns,called:q,file:v.file}),s.names[S]??=N,!q){(s.facts[`orphan:flow:${M}`]??=[]).push({file:m??v.file,line:1}),s.names[M]??=N;continue}for(let g of $.uses)(s.facts[`flow-uses:${g.key}`]??=[]).push({file:v.file,line:hs(v.text,g.action)});$.returns&&(s.facts["flow-returns"]??=[]).push({file:v.file,line:hs(v.text,$.returns)})}for(let h of f)l.some(b=>b===h.name||b.endsWith(`.${h.name}`))||(s.facts[`orphan:${h.kind}:${h.name}`]??=[]).push(h.at);for(let h of c)t.some(m=>m.path!==h.at.file&&new RegExp(`\\bGlobal\\.${h.name}\\b`).test(m.text))||(delete s.facts[`var:${h.name}`],delete s.facts[`var-in:${h.name}`],(s.facts[`orphan:variable:${h.name}`]??=[]).push(h.at));for(let h of o){let b=r.get(h.topic);(h.into[b?`reaches:${b}`:`calls:topic:${Ze(h.topic,"/")}`]??=[]).push(h.at)}for(let h of[s.facts,...s.children.map(b=>b.facts)])for(let[b,m]of Object.entries(h))h[b]=m.filter((y,O)=>m.findIndex(v=>v.file===y.file&&v.line===y.line)===O);return s}function Vp(e){let t=new Set,n=i=>{if(!i||typeof i!="object")return;let{const:r,enum:o}=i;if(typeof r=="string"&&t.add(r),Array.isArray(o))for(let a of o)typeof a=="string"&&t.add(a)},s=i=>{if(Array.isArray(i))return i.forEach(s);if(!i||typeof i!="object")return;let r=i;n(r.kind),n(r.properties?.kind);for(let o of Object.values(r))s(o)};for(let i of Object.values(e.definitions??{}))s(i);return t}var tt=ds(Xn(),1);function Qn(e,t){let n=new tt.LineCounter,s=(0,tt.parseDocument)(e,{lineCounter:n,prettyErrors:!1}),i=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 r=s.toJS();return!r||typeof r!="object"||Array.isArray(r)||r.format!==t||!(0,tt.isMap)(s.contents)?{ok:!1,problem:{line:i(["format"]),key:"format"}}:{ok:!0,format:{raw:r,doc:s,at:i,lineOf:o=>n.linePos(o).line}}}var Zn=[{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 Gi={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"},text:{en:"F. Text",pt:"F. Texto"},microsoft:{en:"Microsoft patterns",pt:"Padr\xF5es Microsoft"},declared:{en:"Declared",pt:"Declarado"}},es={"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:model-knowledge=on":{dim:"governance",en:"The model's general knowledge on",pt:"Conhecimento geral do modelo ligado"},"setting:model-knowledge=off":{dim:"governance",en:"The model's general knowledge off",pt:"Conhecimento geral do modelo desligado"},"setting:semantic-search=on":{dim:"knowledge",en:"Semantic search on",pt:"Busca sem\xE2ntica ligada"},"setting:semantic-search=off":{dim:"knowledge",en:"Semantic search off",pt:"Busca sem\xE2ntica desligada"},"setting:web-browsing=on":{dim:"knowledge",en:"Web browsing on",pt:"Navega\xE7\xE3o na web ligada"},"setting:web-browsing=off":{dim:"knowledge",en:"Web browsing off",pt:"Navega\xE7\xE3o na web desligada"},"setting:connectable":{dim:"orchestration",en:"Can be called by an orchestrator",pt:"Pode ser chamado por um orquestrador"},"called-with:history":{dim:"orchestration",en:"Receives the conversation history",pt:"Recebe o hist\xF3rico da conversa",lacks:{en:["does not receive the conversation history from the orchestrator","do not receive the conversation history from the orchestrator"],pt:["n\xE3o recebe o hist\xF3rico da conversa do orquestrador","n\xE3o recebem o hist\xF3rico da conversa do orquestrador"]}},"routing:described":{dim:"orchestration",en:"Has a routing description",pt:"Tem descri\xE7\xE3o de roteamento",lacks:{en:["has no routing description","have no routing description"],pt:["n\xE3o tem descri\xE7\xE3o de roteamento","n\xE3o t\xEAm descri\xE7\xE3o de roteamento"]}},"flow-returns":{dim:"integrations",en:"The flow returns an answer",pt:"O fluxo devolve uma resposta",lacks:{en:["has a flow that returns nothing","have a flow that returns nothing"],pt:["tem fluxo que n\xE3o devolve nada","t\xEAm fluxo que n\xE3o devolve nada"]}},"flow-uses:child-flow":{dim:"integrations",en:"The flow calls another flow",pt:"O fluxo chama outro fluxo"},"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"]}}},Jp=Object.fromEntries(Zn.map(e=>[e.id,e.name])),Gp=[["called-with:input:","orchestration","Receives <value> from the orchestrator","Recebe <valor> do orquestrador"],["flow-uses:http:","integrations","Flow calls","Fluxo chama"],["flow-uses:connector:","integrations","Flow uses the connector","Fluxo usa o conector"],["flow-uses:operation:","integrations","Flow uses the operation","Fluxo usa a opera\xE7\xE3o"],["orphan:topic:","governance","Topic nobody calls","T\xF3pico que ningu\xE9m chama"],["orphan:action:","governance","Tool nobody can choose","Ferramenta que ningu\xE9m escolhe"],["orphan:variable:","governance","Variable nobody uses","Vari\xE1vel que ningu\xE9m usa"],["orphan:flow:","governance","Flow nobody calls","Fluxo que ningu\xE9m chama"],["disabled:node:","governance","Switched-off node","N\xF3 desligado"],["disabled:","governance","Switched off","Desligado"],["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:"],["text:","text","Text:","Texto:"],["declared:","declared","Declared:","Declarado:"]],sl=e=>Gp.find(([t])=>e.startsWith(t)),il=e=>!!es[e]?.lacks;function _t(e){return e.startsWith("reaches:")?_t(`trigger:${e.slice(8)}`):es[e]?.dim??sl(e)?.[1]??"governance"}var Pe=(e,t)=>t.endsWith("*")?e.startsWith(t.slice(0,-1)):e===t,rl=80,nt=e=>e.startsWith("reaches:")?`trigger:${e.slice(8)}`:void 0,nl=(e,t)=>t?.[e]??e;function ce(e,t,n){let s=es[e];if(s)return s[t];if(e.startsWith("text:block:")){let a=e.endsWith("~variant"),l=a?e.slice(0,-8):e,f=n?.[l]??l.slice(11);return a?`${f} (${t==="pt"?"varia\xE7\xE3o":"variation"})`:f}if(e.startsWith("text:link-domain:"))return`${t==="pt"?"Link para":"Link to"} ${e.slice(17)}`;if(e==="text:email")return t==="pt"?"Cita um e-mail":"Mentions an e-mail";if(e.startsWith("text:")){let[a,l]=[e.slice(5).split("=")[0],e.includes("=")?e.slice(e.indexOf("=")+1):void 0],f=n?.[`text:${a}`]??a;return l===void 0?f:`${f} = ${l}`}if(e.startsWith("reaches:")){let a=ce(`trigger:${e.slice(8)}`,t);return t==="pt"?`Um t\xF3pico leva a \xAB${a}\xBB`:`A topic leads to \xAB${a}\xBB`}if(e.startsWith("called-with:input:"))return t==="pt"?`Recebe \xAB${e.slice(18)}\xBB do orquestrador`:`Receives \xAB${e.slice(18)}\xBB from the orchestrator`;let i=/^knowledge:count=(\d+)$/.exec(e);if(i){let a=Number(i[1]);return t==="pt"?`${a} ${a===1?"fonte":"fontes"} de conhecimento`:`${a} knowledge ${a===1?"source":"sources"}`}let r=sl(e);if(!r)return e;let o=e.slice(r[0].length);if(r[0]==="ms:"&&(o=Jp[o]??o),r[0]==="auth:"&&o==="None")return t==="pt"?"Sem login":"No sign-in";if(e.startsWith("setting:moderation="))return t==="pt"?`Modera\xE7\xE3o de conte\xFAdo: ${e.slice(19)}`:`Content moderation: ${e.slice(19)}`;if(["connector:","connref:","mcp:","calls:","flow:","flow-uses:connector:","orphan:flow:"].includes(r[0])&&(o=nl(o,n)),r[0]==="disabled:"&&(o=o.replace(":"," ")),r[0]==="operation:"||r[0]==="flow-uses:operation:"){let[a,l]=[o.slice(0,o.indexOf("/")),o.slice(o.indexOf("/")+1)];o=`${nl(a,n)} \xB7 ${l}`}return`${r[t==="pt"?3:2]} ${o}`}function ts(e,t,n,s){let i=es[e]?.lacks?.[t];if(i)return i[n===1?0:1];if(e.startsWith("reaches:")){let o=ce(`trigger:${e.slice(8)}`,t);return t==="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(e.startsWith("called-with:input:"))return t==="pt"?`${n===1?"n\xE3o recebe":"n\xE3o recebem"} \xAB${e.slice(18)}\xBB do orquestrador`:`${n===1?"does":"do"} not receive \xAB${e.slice(18)}\xBB from the orchestrator`;if(e.startsWith("calls:topic:"))return t==="pt"?`${n===1?"n\xE3o chama":"n\xE3o chamam"} o t\xF3pico ${e.slice(12)}`:`${n===1?"does":"do"} not call the topic ${e.slice(12)}`;let r=ce(e,t,s);return t==="pt"?`${n===1?"n\xE3o tem":"n\xE3o t\xEAm"} \xAB${r}\xBB`:`${n===1?"does":"do"} not have \xAB${r}\xBB`}var ol="cast-list/profile-v1",Xi=["orchestrator","specialist"],Hi={roles:{},threshold:.7,minAgents:3,rules:[],markers:[],blocks:[],types:[],focusAreas:[],ignore:[],microsoftPatterns:!0},Hp=["format","name","roles","threshold","min_agents","rules","markers","blocks","types","focus_areas","ignore","microsoft_patterns"],Xp=["instructions","descriptions","all"],Qp=new Set(["trigger","setting","topics","instructions","connector","operation","connref","mcp","flow","knowledge","node","calls","reaches","child","var","var-in","model","auth","ms","declared","text","yaml-only","called-with","routing","flow-uses","flow-returns","orphan","disabled"]),Zp=e=>Qp.has(e.split(":")[0]),_e=e=>!!e&&typeof e=="object"&&!Array.isArray(e),V=e=>typeof e=="string"?e.trim():typeof e=="number"?String(e):"",ns=e=>Array.isArray(e)?e.map(V).filter(Boolean):V(e)?[V(e)]:[],al=e=>Xi.includes(e);function eh(e){let t=Qn(e,ol);if(!t.ok)return{problems:[t.problem.key==="format"?{...t.problem,format:ol}:t.problem]};let{raw:n,at:s}=t.format,i=[];for(let $ of Object.keys(n))Hp.includes($)||i.push({line:s([$]),key:"unknownKey",what:$});let r=($,N,q)=>(V($)||i.push({line:s(q),key:"missing",what:N}),V($)),o=($,N)=>{let q=new Set;N.forEach((g,E)=>{g&&q.has(g)&&i.push({line:s([$,E]),key:"duplicate",what:$,id:g}),q.add(g)})},a=$=>Array.isArray(n[$])?n[$]:[],l=n.threshold===void 0?Hi.threshold:Number(n.threshold);l>0&&l<=1||i.push({line:s(["threshold"]),key:"threshold",value:V(n.threshold)});let f=n.min_agents===void 0?Hi.minAgents:Number(n.min_agents);Number.isInteger(f)&&f>=1||i.push({line:s(["min_agents"]),key:"minAgents",value:V(n.min_agents)});let c={},d=_e(n.roles)?n.roles:{};for(let $ of Object.keys(d))al($)?c[$]=V(d[$])==="*"?"*":ns(d[$]):i.push({line:s(["roles",$]),key:"role",what:`roles.${$}`,value:$});let u=($,N,q)=>(al(V($))||i.push({line:s(q),key:"role",what:N,value:V($)}),V($)),h=($,N,q)=>{let g=ns($);for(let E of g)Zp(E)||i.push({line:s(q),key:"prefix",what:N,value:E});return g},b=a("rules").filter(_e).map(($,N)=>{let q=`rules[${N}]`,g=h($.has,q,["rules",N])[0],E=h($.not,q,["rules",N])[0],L=h($.when,q,["rules",N]);return!g&&!E&&i.push({line:s(["rules",N]),key:"rule",what:q}),{id:r($.id,`${q}.id`,["rules",N]),...$.role!==void 0?{role:u($.role,`${q}.role`,["rules",N,"role"])}:{},...L.length?{when:L}:{},...g?{has:g}:{},...E?{not:E}:{},says:V($.says)||g||`not ${E}`}});o("rules",b.map($=>$.id));let m=a("markers").filter(_e).map(($,N)=>{let q=`markers[${N}]`,g=r($.pattern,`${q}.pattern`,["markers",N]);try{g&&new RegExp(g,"i")}catch(Y){i.push({line:s(["markers",N]),key:"regex",what:`${q}.pattern`,detail:Y.message.replace(/^Invalid regular expression: /,"")})}let E=V($.in)||"instructions";Xp.includes(E)||i.push({line:s(["markers",N]),key:"in",what:`${q}.in`,value:E});let L=r($.id,`${q}.id`,["markers",N]);return{id:L,name:V($.name)||L,in:E,pattern:g,...V($.value)?{value:V($.value)}:{}}});o("markers",m.map($=>$.id));let y=a("blocks").filter(_e).map(($,N)=>{let q=r($.id,`blocks[${N}].id`,["blocks",N]);return{id:q,name:V($.name)||q,text:r($.text,`blocks[${N}].text`,["blocks",N]),role:$.role!==void 0?u($.role,`blocks[${N}].role`,["blocks",N,"role"]):"specialist"}});o("blocks",y.map($=>$.id));let O=a("types").filter(_e).map(($,N)=>{let q=`types[${N}]`,g=_e($.when)?$.when:{},E=Object.fromEntries(["all","any","none"].filter(F=>g[F]!==void 0).map(F=>[F,h(g[F],q,["types",N])]));!E.all?.length&&!E.any?.length&&i.push({line:s(["types",N]),key:"when",what:q});let L=$.min_agents===void 0?2:Number($.min_agents);Number.isInteger(L)&&L>=1||i.push({line:s(["types",N,"min_agents"]),key:"minAgents",value:V($.min_agents)});let Y=r($.id,`${q}.id`,["types",N]);return{id:Y,name:V($.name)||Y,when:E,minAgents:L}});o("types",O.map($=>$.id));let v=a("focus_areas").filter(_e).map(($,N)=>{let q=ns($.facts);q.length||i.push({line:s(["focus_areas",N]),key:"missing",what:`focus_areas[${N}].facts`});let g=r($.id,`focus_areas[${N}].id`,["focus_areas",N]);return{id:g,name:V($.name)||g,facts:q}});o("focus_areas",v.map($=>$.id));let S=n.microsoft_patterns,M={...V(n.name)?{name:V(n.name)}:{},roles:c,threshold:l,minAgents:f,rules:b,markers:m,blocks:y,types:O,focusAreas:v,ignore:ns(n.ignore),microsoftPatterns:!(S===!1||V(S).toLowerCase()==="off")};return i.length?{problems:i}:{profile:M,problems:i}}var th=e=>Object.keys(e.facts).some(t=>t.startsWith("calls:")&&!t.startsWith("calls:topic:"));function ll(e,t,n={}){let{orchestrator:s,specialist:i}=t.roles,r=(f,c)=>Array.isArray(f)&&f.includes(c),o=Object.fromEntries(e.map(f=>[f.id,r(s,f.id)?"orchestrator":r(i,f.id)?"specialist":n[f.id]??(s==="*"?"orchestrator":i==="*"?"specialist":th(f)?"orchestrator":"specialist")])),a=new Set(e.map(f=>f.id)),l=[s,i].flatMap(f=>Array.isArray(f)?f:[]).filter(f=>!a.has(f));return{roles:o,unmatched:l}}function cl(e,t,n,s){let i=(r,o)=>Object.keys(r).some(a=>Pe(a,o));return Object.fromEntries(e.map(r=>{if(t[r.id]!=="specialist")return[r.id,[]];if(s[r.id]?.length)return[r.id,s[r.id]];let o=n.types.filter(({when:a})=>(a.all??[]).every(l=>i(r.facts,l))&&(!a.any?.length||a.any.some(l=>i(r.facts,l)))&&!(a.none??[]).some(l=>i(r.facts,l)));return[r.id,o.map(a=>a.id)]}))}var ge=ds(Xn());var Bt="cast-list/cast-v1",nh=["accepted","rejected"],sh=["platform","specialist","orchestrator"],ih=e=>sh.includes(e)||/^type:[\w-]+$/.test(e),rh=["format","name","agents","blocks","declared","decisions"],oh=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Z=e=>typeof e=="string"?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"";function ah(e){let t=Qn(e,Bt);if(!t.ok)return{problems:[t.problem.key==="format"?{...t.problem,format:Bt}:t.problem]};let{raw:n,at:s}=t.format,i=[];for(let u of Object.keys(n))rh.includes(u)||i.push({line:s([u]),key:"unknownKey",what:u});let r=u=>(Array.isArray(n[u])?n[u]:[]).filter(oh),o=(u,h,b)=>(Z(u)||i.push({line:s(b),key:"missing",what:h}),Z(u)),a=(u,h)=>{let b=new Set;h.forEach((m,y)=>{m&&b.has(m)&&i.push({line:s([u,y]),key:"duplicate",what:u,id:m}),b.add(m)})},l=r("agents").map((u,h)=>{let b=Z(u.role);Xi.includes(b)||i.push({line:s(["agents",h,"role"]),key:"role",what:`agents[${h}].role`,value:b});let m=Array.isArray(u.types)?u.types.map(Z).filter(Boolean):[];return{id:o(u.id,`agents[${h}].id`,["agents",h]),role:b,...m.length?{types:m}:{}}}),f=r("blocks").map((u,h)=>({id:o(u.id,`blocks[${h}].id`,["blocks",h]),text:o(u.text,`blocks[${h}].text`,["blocks",h])}));a("blocks",f.map(u=>u.id)),a("agents",l.map(u=>u.id));let c=r("declared").map((u,h)=>({agent:o(u.agent,`declared[${h}].agent`,["declared",h]),key:o(u.key,`declared[${h}].key`,["declared",h]),value:Z(u.value),source:Z(u.source)}));a("declared",c.map(u=>`${u.agent} ${u.key}`));let d=r("decisions").map((u,h)=>{let b=Z(u.status),m=Z(u.scope);return nh.includes(b)||i.push({line:s(["decisions",h,"status"]),key:"status",value:b}),ih(m)||i.push({line:s(["decisions",h,"scope"]),key:"scope",value:m}),{key:o(u.key,`decisions[${h}].key`,["decisions",h]),status:b,scope:m,why:Z(u.why)}});return a("decisions",d.map(u=>u.key)),i.length?{problems:i}:{cast:{...Z(n.name)?{name:Z(n.name)}:{},agents:l,blocks:f,declared:c,decisions:d},problems:i}}var lh=` What people said about the agents, and what was decided. build.mjs keeps it up to date; edit it, or fill the
142
+ workbook's \xABDeclared\xBB sheet and the \xABDecision\xBB column and read it back with --from.`,ch={agents:e=>Z(e.id),blocks:e=>Z(e.id),declared:e=>`${Z(e.agent)} ${Z(e.key)}`,decisions:e=>Z(e.key)},fh=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==""&&t!==void 0));function uh(e,t){let n=t?(0,ge.parseDocument)(t):void 0,s=n&&!n.errors.length&&(0,ge.isMap)(n.contents)?n:new ge.Document({format:Bt});s!==n&&(s.commentBefore=lh),s.get("format")!==Bt&&s.set("format",Bt),e.name===void 0?s.delete("name"):s.get("name")!==e.name&&s.set("name",e.name);for(let[i,r]of Object.entries(ch)){let o=e[i];if(!o.length){s.delete(i);continue}let a=s.get(i,!0);if((0,ge.isSeq)(a)||s.set(i,a=s.createNode([])),!(0,ge.isSeq)(a))continue;let l=new Map(a.items.filter(ge.isMap).map(f=>[r(f.toJSON()),f]));a.items=o.map(f=>{let c=fh(f),d=l.get(r(c));if(!d){let u=s.createNode(c);return u.flow=i!=="blocks",u}for(let[u,h]of Object.entries(c))JSON.stringify(d.toJSON()[u])!==JSON.stringify(h)&&d.set(u,h);for(let u of Object.keys(d.toJSON()))u in c||d.delete(u);return d})}return s.toString({lineWidth:0,flowCollectionPadding:!0})}function dh(e,t="en"){let n=t==="pt";switch(e.key){case"syntax":return n?`n\xE3o se l\xEA como YAML (${e.detail})`:`does not read as YAML (${e.detail})`;case"format":return n?`\xABformat\xBB precisa ser ${e.format}`:`\xABformat\xBB must be ${e.format}`;case"missing":return n?`falta \xAB${e.what}\xBB`:`\xAB${e.what}\xBB is missing`;case"duplicate":return n?`${e.what}: o id \xAB${e.id}\xBB se repete`:`${e.what}: the id \xAB${e.id}\xBB is repeated`;case"unknownKey":return n?`\xAB${e.what}\xBB n\xE3o \xE9 um campo deste arquivo`:`\xAB${e.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${e.value}\xBB)`:`\xABthreshold\xBB goes from 0 to 1, like 0.7 (it is \xAB${e.value}\xBB)`;case"minAgents":return n?`\xABmin_agents\xBB \xE9 um n\xFAmero inteiro a partir de 1 (est\xE1 \xAB${e.value}\xBB)`:`\xABmin_agents\xBB is a whole number from 1 (it is \xAB${e.value}\xBB)`;case"role":return n?`\xAB${e.what}\xBB \xE9 orchestrator ou specialist (est\xE1 \xAB${e.value}\xBB)`:`\xAB${e.what}\xBB is orchestrator or specialist (it is \xAB${e.value}\xBB)`;case"status":return n?`\xABstatus\xBB \xE9 accepted ou rejected (est\xE1 \xAB${e.value}\xBB)`:`\xABstatus\xBB is accepted or rejected (it is \xAB${e.value}\xBB)`;case"scope":return n?`\xABscope\xBB \xE9 platform, specialist, orchestrator ou type:<tipo> (est\xE1 \xAB${e.value}\xBB)`:`\xABscope\xBB is platform, specialist, orchestrator or type:<type> (it is \xAB${e.value}\xBB)`;case"regex":return n?`\xAB${e.what}\xBB n\xE3o \xE9 uma express\xE3o regular v\xE1lida (${e.detail})`:`\xAB${e.what}\xBB is not a valid regular expression (${e.detail})`;case"in":return n?`\xAB${e.what}\xBB \xE9 instructions, descriptions ou all (est\xE1 \xAB${e.value}\xBB)`:`\xAB${e.what}\xBB is instructions, descriptions or all (it is \xAB${e.value}\xBB)`;case"when":return n?`\xAB${e.what}\xBB precisa de \xABwhen\xBB com all, any ou none`:`\xAB${e.what}\xBB needs a \xABwhen\xBB with all, any or none`;case"prefix":return n?`\xAB${e.what}\xBB: nenhuma chave come\xE7a como \xAB${e.value}\xBB (veja references/keys.md)`:`\xAB${e.what}\xBB: no key starts like \xAB${e.value}\xBB (see references/keys.md)`;case"rule":return n?`\xAB${e.what}\xBB precisa de \xABhas\xBB ou \xABnot\xBB: o que conferir`:`\xAB${e.what}\xBB needs \xABhas\xBB or \xABnot\xBB: what to check`}}function fl(e,t){let n=e.split(/\s+/).filter(Boolean),s=t.split(/\s+/).filter(Boolean);if(n.length>2e3||s.length>2e3)return[{op:"del",text:n.join(" ")},{op:"add",text:s.join(" ")}];let i=Array.from({length:n.length+1},()=>new Uint16Array(s.length+1));for(let f=n.length-1;f>=0;f--)for(let c=s.length-1;c>=0;c--)i[f][c]=n[f]===s[c]?i[f+1][c+1]+1:Math.max(i[f+1][c],i[f][c+1]);let r=[],o=(f,c)=>{let d=r[r.length-1];d?.op===f?d.text+=` ${c}`:r.push({op:f,text:c})},a=0,l=0;for(;a<n.length||l<s.length;)a<n.length&&l<s.length&&n[a]===s[l]?o("same",(a++,l++,n[a-1])):l<s.length&&(a===n.length||i[a][l+1]>=i[a+1][l])?o("add",s[l++]):o("del",n[a++]);for(let f=0;f+1<r.length;f++)r[f].op==="add"&&r[f+1].op==="del"&&([r[f],r[f+1]]=[r[f+1],r[f]]);return r}var ul=.85,Qi=.5,ph=8,Zi=5;function hh(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/https?:\/\/\S+|www\.\S+/g," #url ").replace(/\d+([.,]\d+)?/g," #n ").replace(/[^a-z#\s]+/g," ").split(/\s+/).filter(Boolean)}var mh=e=>{if(e.length<=Zi)return new Set([e.join(" ")]);let t=new Set;for(let n=0;n+Zi<=e.length;n++)t.add(e.slice(n,n+Zi).join(" "));return t},hl=(e,t)=>{let n=0;for(let s of e)t.has(s)&&n++;return n},dl=(e,t)=>{let n=hl(e,t);return n/(e.size+t.size-n||1)},ss=(e,t)=>hl(e,t)/(Math.min(e.size,t.size)||1);var er=(e,t,n,s)=>{let i=hh(e);return{agent:s,file:t,line:n,text:e,words:i,shingles:mh(i)}};function gh(e,t){let n=[],s=-1,i=e.text.split(`
143
+ `),r=o=>{if(s<0)return;let a=i.slice(s,o).join(`
144
+ `).trim(),l=er(a,e.file,e.line+s,t);l.words.length>=ph&&n.push(l),s=-1};return i.forEach((o,a)=>{o.trim()?s<0&&(s=a):r(a)}),r(i.length),n}var yh=(e,t)=>{let n=e.filter(i=>!i.startsWith("#")).slice(0,5).join("-")||"block",s=n;for(let i=2;t.has(s);i++)s=`${n}-${i}`;return t.add(s),s},pl=e=>{let t=e.split(/\s+/).filter(Boolean);return t.slice(0,8).join(" ")+(t.length>8?"\u2026":"")};function ml(e,t,n){let s=e.flatMap(d=>d.texts.flatMap(u=>gh(u,d.id))),i=[];for(let d of s){let u=i.find(h=>ss(h[0].shingles,d.shingles)>=Qi);u?u.push(d):i.push([d])}let r=n.map(d=>({...d,block:er(d.text,"profile",0)})),o=t.map(d=>({...d,block:er(d.text,"cast",0)})),a=new Set([...n.map(d=>d.id),...t.map(d=>d.id)]),l=[],f=new Set;for(let d of i){let u=r.find(v=>!f.has(v.id)&&ss(v.block.shingles,d[0].shingles)>=Qi);if(new Set(d.map(v=>v.agent)).size<2&&!u)continue;let h=v=>d.filter(S=>dl(S.shingles,v.shingles)>=ul).length,b=u?.block??d.reduce((v,S)=>h(S)>h(v)?S:v,d[0]),m=u?void 0:o.find(v=>!f.has(v.id)&&ss(v.block.shingles,b.shingles)>=Qi),y=u?.id??m?.id??yh(b.words,a);f.add(y);let O={id:y,label:pl(b.text),text:b.text,...u?{official:u.name}:{},holders:{},variants:{}};for(let v of d){let S=v.agent,M=dl(b.shingles,v.shingles)>=ul?1:ss(b.shingles,v.shingles);M===1?(O.holders[S]??={file:v.file,line:v.line},delete O.variants[S]):!O.holders[S]&&(!O.variants[S]||M>O.variants[S].similarity)&&(O.variants[S]={source:{file:v.file,line:v.line},similarity:M,text:v.text,diff:fl(b.text,v.text)})}l.push(O)}for(let d of r.filter(u=>!f.has(u.id)))l.push({id:d.id,label:pl(d.text),text:d.text,official:d.name,holders:{},variants:{}});let c=Object.fromEntries(e.map(d=>[d.id,{}]));for(let d of l){for(let[u,h]of Object.entries(d.holders))c[u][`text:block:${d.id}`]=[h];for(let[u,h]of Object.entries(d.variants))c[u][`text:block:${d.id}~variant`]=[h.source]}return{families:l,facts:c}}var bh=/https?:\/\/([^\s/)\]>"'«»]+)/gi,wh=/[\w.+-]+@[\w-]+(\.[\w-]+)+/g,kh=(e,t)=>e.line+(e.text.slice(0,t).match(/\n/g)?.length??0),$h=e=>e.toLowerCase().replace(/\s+/g," ").trim();function gl(e,t){let n={},s={};for(let i of e){let r=n[i.id]={},o=s[i.id]={},a=(l,f,c)=>(r[l]??=[]).push({file:f.file,line:kh(f,c)});for(let l of i.texts){for(let f of t.filter(c=>c.in==="all"||c.in===l.source))for(let c of l.text.matchAll(new RegExp(f.pattern,"gi"))){if(!f.value){a(`text:${f.id}`,l,c.index);continue}let d=$h(f.value.replace(/\$(\d)/g,(u,h)=>c[Number(h)]??""));d&&(a(`text:${f.id}=${d}`,l,c.index),(o[f.id]??=[]).includes(d)||o[f.id].push(d))}if(l.source==="instructions"){for(let f of l.text.matchAll(bh))a(`text:link-domain:${f[1].toLowerCase().replace(/[.,;:]+$/,"")}`,l,f.index);for(let f of l.text.matchAll(wh))a("text:email",l,f.index)}}for(let[l,f]of Object.entries(r))r[l]=f.filter((c,d)=>f.findIndex(u=>u.file===c.file&&u.line===c.line)===d)}return{facts:n,values:s}}function yl(e,t,n){let s=[];for(let i of t.filter(r=>r.value)){for(let r of["specialist","orchestrator"]){let o={};for(let[a,l]of Object.entries(e))if(n[a]===r)for(let f of l[i.id]??[])(o[f]??=[]).push(a);Object.keys(o).length>1&&s.push({kind:"values",marker:i,role:r,byValue:o})}for(let[r,o]of Object.entries(e))(o[i.id]??[]).length>1&&s.push({kind:"twice",marker:i,agent:r,values:o[i.id]})}return s}var Sh=/^(no|não|nao|false|off|0)$/i,vh=new Set(Zn.filter(e=>!e.sign).map(e=>`ms:${e.id}`)),Oh=e=>e.includes(":")&&!e.startsWith("declared:")&&!vh.has(e),Ah=e=>e.startsWith("declared:")?e:`declared:${e}`,tr=e=>e.endsWith("~variant"),is=e=>/^(orphan|disabled):/.test(e);function Nh(e,t,n){let s=Object.fromEntries(n.agents.map(p=>[p.id,p.role])),{roles:i,unmatched:r}=ll(e,t,s),o=p=>t.ignore.includes(p)||!t.microsoftPatterns&&p.startsWith("ms:"),a=[],l=ml(e,n.blocks,t.blocks),f=gl(e,t.markers),c=new Map(e.filter(p=>p.schemaName).map(p=>[p.schemaName,p.id])),d=e.flatMap(p=>(p.contract??[]).map(w=>({...w,caller:p.id,...c.has(w.calls)?{agent:c.get(w.calls)}:{}}))),u={};for(let p of d.filter(w=>w.agent)){let w=u[p.agent]??={},x={file:`${p.caller}/${p.file}`,line:p.line},T=j=>(w[j]??=[]).push(x);p.history&&T("called-with:history");for(let j of p.inputs)T(`called-with:input:${j}`);p.description&&T("routing:described")}let h=p=>({...p.facts,...l.facts[p.id],...f.facts[p.id],...u[p.id]}),b=e.map(p=>{let w=h(p),x=Object.fromEntries(Object.entries(w).filter(([T])=>!o(T)));for(let T of n.declared.filter(j=>j.agent===p.id)){let j=!Sh.test(T.value);if(Oh(T.key)){let D=T.key in w;j!==D&&a.push({agent:p.id,key:T.key,declared:T.value||"yes",observed:D,source:T.source})}else j&&(x[Ah(T.key)]??=[]).push({file:T.source?`declared: ${T.source}`:"declared"})}return{id:p.id,role:i[p.id],...p.schemaName?{schemaName:p.schemaName}:{},...p.displayName?{displayName:p.displayName}:{},facts:x,children:p.children}}),m=p=>b.filter(w=>w.role===p),y=(p,w=b)=>w.filter(x=>p in x.facts),O=(p,w=b)=>w.flatMap(x=>x.facts[p]??[]),v=[...new Set(b.flatMap(p=>Object.keys(p.facts)))].sort(),S=p=>n.decisions.find(w=>w.key===p),M=cl(b,i,t,Object.fromEntries(n.agents.filter(p=>p.types?.length).map(p=>[p.id,p.types]))),$=p=>p==="platform"?b:p.startsWith("type:")?b.filter(w=>M[w.id]?.includes(p.slice(5))):m(p),N=[];for(let p of["specialist","orchestrator"]){let w=m(p);if(w.length<t.minAgents)continue;let x=m(p==="specialist"?"orchestrator":"specialist");for(let T of v){if(T.startsWith("declared:")||nt(T)||tr(T)||is(T)||N.some(ot=>ot.key===T))continue;let D=y(T,w).length/w.length;if(D<t.threshold)continue;let ie=x.length>0&&y(T,x).length/x.length>=(x.length>=t.minAgents?t.threshold:1),Se=S(T);N.push({key:T,role:p,scope:Se?.scope??(ie?"platform":p),share:D,agents:y(T).map(ot=>ot.id),sources:O(T),...Se?{decision:Se}:{}})}}let q=[];for(let p of t.types){let w=$(`type:${p.id}`);if(w.length){if(w.length<p.minAgents){q.push({type:p.id,agents:w.map(x=>x.id)});continue}for(let x of v){if(x.startsWith("declared:")||nt(x)||tr(x)||is(x)||N.some(D=>D.key===x))continue;let T=y(x,w).length/w.length;if(T<t.threshold)continue;let j=S(x);N.push({key:x,role:"specialist",scope:j?.scope??`type:${p.id}`,share:T,agents:y(x).map(D=>D.id),sources:O(x),...j?{decision:j}:{}})}}}for(let p of t.blocks){let w=`text:block:${p.id}`,x=N.find(D=>D.key===w);if(x){x.official=p.name;continue}let T=m(p.role),j=S(w);N.push({key:w,role:p.role,scope:j?.scope??p.role,share:T.length?y(w,T).length/T.length:0,agents:y(w).map(D=>D.id),sources:O(w),official:p.name,...j?{decision:j}:{}})}for(let p of n.decisions.filter(w=>w.status==="accepted"&&!N.some(x=>x.key===w.key))){let w=$(p.scope),x=y(p.key,w);N.push({key:p.key,role:p.scope==="orchestrator"?"orchestrator":"specialist",scope:p.scope,share:w.length?x.length/w.length:0,agents:x.map(T=>T.id),sources:O(p.key),decision:p})}for(let p of v.filter(w=>nt(w))){let w=N.find(D=>D.key===nt(p));if(!w)continue;let x=$(w.scope).filter(D=>w.key in D.facts),T=x.length?y(p,x).length/x.length:0;if(T<t.threshold)continue;let j=S(p)??w.decision;N.push({key:p,role:w.role,scope:w.scope,share:T,agents:y(p).map(D=>D.id),sources:O(p),partOf:w.key,...j?{decision:j}:{}})}N.sort((p,w)=>p.scope.localeCompare(w.scope)||p.key.localeCompare(w.key));let g=N.filter(p=>p.decision?.status!=="rejected").flatMap(p=>$(p.scope).filter(w=>!(p.key in w.facts)&&(!p.partOf||p.partOf in w.facts)).map(w=>({agent:w.id,key:p.key,scope:p.scope,...p.partOf?{partOf:p.partOf}:{},...`${p.key}~variant`in w.facts?{variant:!0}:{}}))).sort((p,w)=>p.agent.localeCompare(w.agent)||p.key.localeCompare(w.key)),E=[],L=[];for(let p of v){if(p.startsWith("declared:")||nt(p)||tr(p)||is(p))continue;let w=y(p),x={key:p,agents:w.map(T=>T.id),sources:O(p)};w.every(T=>T.role==="orchestrator")?L.push(x):w.length===1&&E.push(x)}let Y=(p,w)=>Object.keys(p.facts).some(x=>Pe(x,w)),F=t.rules.map(p=>({rule:p,agents:(p.role?m(p.role):b).filter(w=>(p.when??[]).every(x=>Y(w,x))).filter(w=>p.has!==void 0&&!Y(w,p.has)||p.not!==void 0&&Y(w,p.not)).map(w=>w.id)})).filter(p=>p.agents.length),k=b.some(p=>p.role==="orchestrator"),I=new Set(d.map(p=>p.agent)),X=b.flatMap(p=>Object.keys(p.facts).filter(is).sort().map(w=>{let[x,T,...j]=w.split(":");return{agent:p.id,key:w,how:x,what:T,name:j.join(":"),sources:p.facts[w]}}));return{...t.name??n.name?{name:t.name??n.name}:{},roles:i,unmatched:r,agents:b,patterns:N,offPattern:g,solos:E,orchestratorDoes:L,gaps:F,conflicts:a,unknown:e.flatMap(p=>p.unknown.map(w=>({...w,agent:p.id}))),names:Object.assign({},...e.map(p=>p.names??{}),...e.map(p=>p.schemaName&&p.displayName?{[p.schemaName]:p.displayName}:{}),...l.families.map(p=>({[`text:block:${p.id}`]:p.official??p.label})),...t.markers.map(p=>({[`text:${p.id}`]:p.name}))),types:M,typeNames:Object.fromEntries(t.types.map(p=>[p.id,p.name])),typeNotes:q,blocks:l.families,markerFindings:yl(f.values,t.markers,i),contract:{routes:d,missing:d.filter(p=>!p.agent),uncalled:k?b.filter(p=>p.role==="specialist"&&!I.has(p.id)).map(p=>p.id):[],short:d.filter(p=>p.description&&p.description.length<rl)},flows:e.flatMap(p=>(p.flows??[]).map(w=>({...w,agent:p.id}))),unused:X}}var Eh={specialist:{en:["specialist","specialists"],pt:["especialista","especialistas"]},orchestrator:{en:["orchestrator","orchestrators"],pt:["orquestrador","orquestradores"]}},ae=(e,t,n)=>Eh[e][t][n===1?0:1],rs={en:{summary:"Summary",matrix:"Matrix",patterns:"Patterns",text:"Text",off:"Off pattern",gaps:"Gaps",conflicts:"Conflicts",agents:"Cast",evidence:"Evidence",declared:"Declared",unknown:"Not understood",routing:"Routing",unused:"Unused",caller:"Caller",called:"Called",history:"History",inputs:"Inputs",routingText:"Routing description",chars:"Characters",notInFolder:"not in the folder",what:"What",how:"How",thing:{topic:"topic",action:"tool",variable:"variable",flow:"flow",node:"node",knowledge:"knowledge source"},orphan:"nobody uses it",disabled:"switched off",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",types:"Types",id:"Id",label:"Label",body:"Text",variant:"Variation",official:"Official",type:"type",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",unused:"Unused or switched off"},why_:{yaml:"YAML that does not read",empty:"empty",kind:"a kind Copilot Studio does not have",file:"not a Copilot Studio file",json:"JSON that does not read",flow:"a flow in a shape the analysis does not know"}},pt:{summary:"Resumo",matrix:"Matriz",patterns:"Padr\xF5es",text:"Texto",off:"Fora do padr\xE3o",gaps:"Lacunas",conflicts:"Conflitos",agents:"Elenco",evidence:"Evid\xEAncias",declared:"Declarado",unknown:"N\xE3o entendeu",routing:"Roteamento",unused:"Sem uso",caller:"Quem chama",called:"Chamado",history:"Hist\xF3rico",inputs:"Entradas",routingText:"Descri\xE7\xE3o de roteamento",chars:"Caracteres",notInFolder:"n\xE3o est\xE1 na pasta",what:"O qu\xEA",how:"Como",thing:{topic:"t\xF3pico",action:"ferramenta",variable:"vari\xE1vel",flow:"fluxo",node:"n\xF3",knowledge:"fonte de conhecimento"},orphan:"ningu\xE9m usa",disabled:"desligado",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",types:"Tipos",id:"Id",label:"R\xF3tulo",body:"Texto",variant:"Varia\xE7\xE3o",official:"Oficial",type:"tipo",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",unused:"Sem uso ou desligado"},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",json:"JSON que n\xE3o se l\xEA",flow:"um fluxo num formato que a an\xE1lise n\xE3o conhece"}}};var ke=e=>e.join(", "),bl=["conflict","contradiction","contract","flow","off","gap","values","twice","solo","unused","type","unknown","unmatched"],wl=e=>e.replace(/(\.topic)?\.mcs\.ya?ml$/,"");function xh(e){let t=[],n=(c,d)=>ce(c,d,e.names);for(let c of e.conflicts){let d=c.source?`\xAB${c.source}\xBB`:null,[u,h]=[n(c.key,"en"),n(c.key,"pt")];t.push(c.observed?{key:"conflict",agents:[c.agent],fact:c.key,en:`${c.agent}: ${d??"what was declared"} says it does not have \xAB${u}\xBB, but the YAML has it`,pt:`${c.agent}: ${d??"o declarado"} diz que n\xE3o tem \xAB${h}\xBB, mas o YAML tem`}:{key:"conflict",agents:[c.agent],fact:c.key,en:`${c.agent}: ${d??"what was declared"} says it has \xAB${u}\xBB, but the YAML does not`,pt:`${c.agent}: ${d??"o declarado"} diz que tem \xAB${h}\xBB, mas o YAML n\xE3o tem`})}let s=(c,d)=>Object.keys(e.agents.find(u=>u.id===c)?.facts??{}).filter(u=>Pe(u,d));for(let c of e.gaps.filter(d=>d.rule.not&&!d.rule.has))for(let d of[...c.agents].sort()){let u=s(d,c.rule.not)[0]??c.rule.not,h=(c.rule.when??[]).map(m=>s(d,m)[0]??m),b=m=>h.length?`\xAB${h.map(y=>n(y,m)).join(m==="pt"?"\xBB e \xAB":"\xBB and \xAB")}\xBB, ${m==="pt"?"mas tamb\xE9m":"but also"} \xAB${n(u,m)}\xBB`:`\xAB${n(u,m)}\xBB`;t.push({key:"contradiction",agents:[d],fact:u,en:`${d} has ${b("en")} (rule \xAB${c.rule.says}\xBB)`,pt:`${d} tem ${b("pt")} (regra \xAB${c.rule.says}\xBB)`})}for(let c of e.contract.missing)t.push({key:"contract",agents:[c.caller],fact:`calls:${c.calls}`,en:`The orchestrator calls \xAB${c.name??c.calls}\xBB, which is not in the folder`,pt:`O orquestrador chama \xAB${c.name??c.calls}\xBB, que n\xE3o est\xE1 na pasta`});for(let c of e.contract.uncalled)t.push({key:"contract",agents:[c],en:`${c} is in the folder, but no orchestrator calls it`,pt:`${c} est\xE1 na pasta, mas nenhum orquestrador o chama`});for(let c of e.contract.short){let d=c.description.length;t.push({key:"contract",agents:[c.agent],fact:"routing:described",en:`The routing description of ${c.agent} has only ${d} characters`,pt:`A descri\xE7\xE3o de roteamento de ${c.agent} tem s\xF3 ${d} caracteres`})}for(let c of e.flows.filter(d=>d.called&&!d.returns))t.push({key:"flow",agents:[c.agent],fact:"flow-returns",en:`The flow \xAB${c.name}\xBB of ${c.agent} returns nothing`,pt:`O fluxo \xAB${c.name}\xBB de ${c.agent} n\xE3o devolve nada`});let i=c=>c.startsWith("type:")?e.typeNames[c.slice(5)]??c.slice(5):void 0,r=new Map;for(let c of e.offPattern){let d=e.roles[c.agent],u=`${c.key} ${d} ${c.scope} ${c.variant?"v":""}`,h=r.get(u)??{key:c.key,role:d,type:i(c.scope),variant:!!c.variant,agents:[]};h.agents.push(c.agent),r.set(u,h)}for(let c of r.values()){let d=c.agents.length,u=e.patterns.find(O=>O.key===c.key),h=u?.decision?.status==="accepted",b=O=>c.type?O==="pt"?`${d} ${ae(c.role,O,d)} de ${c.type}`:`${d} ${c.type} ${ae(c.role,O,d)}`:`${d} ${ae(c.role,O,d)}`,m=!!u?.official;if(c.variant){let O=v=>v==="pt"?`do bloco${m?" oficial":""} \xAB${n(c.key,v)}\xBB`:`of the${m?" official":""} block \xAB${n(c.key,v)}\xBB`;t.push({key:"off",agents:c.agents,fact:c.key,en:`${b("en")} ${d===1?"has":"have"} a variation ${O("en")} (${ke(c.agents)}): align it?`,pt:`${b("pt")} ${d===1?"tem":"t\xEAm"} uma varia\xE7\xE3o ${O("pt")} (${ke(c.agents)}): alinhar?`});continue}let y=O=>`${b(O)} ${ts(c.key,O,d,e.names)} (${ke(c.agents)})`;t.push({key:"off",agents:c.agents,fact:c.key,en:h?`${y("en")}, and the pattern was accepted: correct it?`:m?`${y("en")}: add it?`:`${y("en")}: on purpose?`,pt:h?`${y("pt")}, e o padr\xE3o foi aceito: corrigir?`:m?`${y("pt")}: incluir?`:`${y("pt")}: \xE9 intencional?`})}for(let c of e.gaps.filter(d=>d.rule.has)){let d=c.agents.filter(h=>!e.offPattern.some(b=>b.agent===h&&b.key===c.rule.has)).sort(),u=d.length;u&&t.push({key:"gap",agents:d,fact:c.rule.has,en:`Rule \xAB${c.rule.says}\xBB: ${u}${c.rule.role?` ${ae(c.rule.role,"en",u)}`:""} ${u===1?"does":"do"} not meet it (${ke(d)})`,pt:`Regra \xAB${c.rule.says}\xBB: ${u}${c.rule.role?` ${ae(c.rule.role,"pt",u)}`:""} n\xE3o ${u===1?"cumpre":"cumprem"} (${ke(d)})`})}for(let c of e.markerFindings)if(c.kind==="values"){let d=[...new Set(Object.values(c.byValue).flat())],u=d.length,h=Object.entries(c.byValue).sort(([m,y],[O,v])=>v.length-y.length||m.localeCompare(O)).map(([m,y])=>`${m} {in} ${y.length}`),b=Object.keys(c.byValue).length;t.push({key:"values",agents:d.sort(),fact:`text:${c.marker.id}`,en:`${u} ${ae(c.role,"en",u)} set \xAB${c.marker.name}\xBB in ${b} ways (${h.join("; ").replace(/\{in\}/g,"in")}): unify?`,pt:`${u} ${ae(c.role,"pt",u)} definem \xAB${c.marker.name}\xBB de ${b} jeitos (${h.join("; ").replace(/\{in\}/g,"em")}): unificar?`})}else t.push({key:"twice",agents:[c.agent],fact:`text:${c.marker.id}`,en:`${c.agent} sets \xAB${c.marker.name}\xBB ${c.values.length===2?"twice":`${c.values.length} times`} (${c.values.join("; ")}): which one holds?`,pt:`${c.agent} define \xAB${c.marker.name}\xBB ${c.values.length===2?"duas vezes":`${c.values.length} vezes`} (${c.values.join("; ")}): qual vale?`});let o=new Set(e.solos.filter(c=>/^(connector|mcp):/.test(c.key)).map(c=>`${c.agents[0]} ${c.key.slice(c.key.indexOf(":")+1)}`)),a=e.gaps.filter(c=>c.rule.not).flatMap(c=>c.agents.map(d=>({agent:d,keys:[...c.rule.when??[],c.rule.not]})));for(let c of e.solos){let d=c.agents[0],u=c.key.startsWith("connref:")?c.key.slice(8):c.key.startsWith("operation:")?c.key.slice(10).split("/")[0]:void 0;u&&o.has(`${d} ${u}`)||a.some(h=>h.agent===d&&h.keys.some(b=>Pe(c.key,b)))||t.push({key:"solo",agents:[d],fact:c.key,en:`Only ${d} has \xAB${n(c.key,"en")}\xBB: innovation or debt?`,pt:`S\xF3 ${d} tem \xAB${n(c.key,"pt")}\xBB: inova\xE7\xE3o ou d\xEDvida?`})}let l={topic:["the topic","o t\xF3pico"],action:["the tool","a ferramenta"],variable:["the variable","a vari\xE1vel"],flow:["the flow","o fluxo"],knowledge:["the knowledge source","a fonte de conhecimento"]};for(let c of e.unused){let[d,u]=l[c.what]??["",""],h=e.names[c.name]??c.name;if(c.how==="orphan"){let b=c.what==="variable"?["remove it?","remover?"]:["remove it or switch it on?","remover ou ligar?"],m=c.what==="variable"?["uses","usa"]:c.what==="action"?["can choose","pode escolher"]:["calls","chama"];t.push({key:"unused",agents:[c.agent],fact:c.key,en:`Nobody ${m[0]} ${d} \xAB${h}\xBB (${c.agent}): ${b[0]}`,pt:`Ningu\xE9m ${m[1]} ${u} \xAB${h}\xBB (${c.agent}): ${b[1]}`})}else if(c.what==="node")for(let b of[...new Set(c.sources.map(m=>m.file))])t.push({key:"unused",agents:[c.agent],fact:c.key,en:`${c.agent} has a switched-off node in \xAB${wl(b)}\xBB (${c.name}): remove it?`,pt:`${c.agent} tem um n\xF3 desligado em \xAB${wl(b)}\xBB (${c.name}): remover?`});else t.push({key:"unused",agents:[c.agent],fact:c.key,en:`${c.agent} has ${d||c.what} \xAB${h}\xBB switched off: remove it?`,pt:`${c.agent} tem ${u||c.what} \xAB${h}\xBB ${u.startsWith("a ")?"desligada":"desligado"}: remover?`})}for(let c of e.typeNotes){let d=e.typeNames[c.type]??c.type,u=c.agents.length;t.push({key:"type",agents:c.agents,en:`The type \xAB${d}\xBB has ${u} ${ae("specialist","en",u)} (${ke(c.agents)}): nothing to compare in it`,pt:`O tipo \xAB${d}\xBB tem ${u} ${ae("specialist","pt",u)} (${ke(c.agents)}): nada a comparar dentro dele`})}let f=new Map;for(let c of e.unknown)f.set(c.agent,[...f.get(c.agent)??[],c.file]);for(let[c,d]of f){let u=d.length;t.push({key:"unknown",agents:[c],en:`${c}: the analysis did not understand ${u} ${u===1?"file":"files"} (${ke(d)})`,pt:`${c}: a an\xE1lise n\xE3o entendeu ${u} ${u===1?"arquivo":"arquivos"} (${ke(d)})`})}for(let c of e.unmatched)t.push({key:"unmatched",agents:[],en:`The profile names \xAB${c}\xBB, which is not in the folder`,pt:`O perfil cita \xAB${c}\xBB, que n\xE3o est\xE1 na pasta`});return t.sort((c,d)=>bl.indexOf(c.key)-bl.indexOf(d.key))}function Kt(e){let t=i=>e.offPattern.some(r=>r.key===i.key||r.partOf===i.key),n=i=>i.share===1&&!i.decision&&!t(i),s=e.patterns.filter(i=>!i.partOf);return{look:s.filter(i=>!n(i)),everyone:s.filter(n)}}var kl=new TextEncoder,nr=e=>e.replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t]).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,""),Ut=e=>e<26?String.fromCharCode(65+e):Ut(Math.floor(e/26)-1)+String.fromCharCode(65+e%26),Ch=e=>e.replace(/[:\\/?*[\]]/g," ").slice(0,31)||"Sheet";function Th(e){let t=[{}],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 e)for(let h of u.rows)for(let b of h){if(typeof b!="object")continue;let{v:m,...y}=b,O=n(y);s.has(O)||(s.set(O,t.length),t.push(y))}let i=new Map([["|",0]]),r=new Map([["",0]]),o=u=>{let h=`${u.bold?"b":""}|${u.color??""}`;return i.has(h)||i.set(h,i.size),i.get(h)},a=u=>u.fill?(r.has(u.fill)||r.set(u.fill,r.size+1),r.get(u.fill)):0,l=t.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>`}),f=[...i.keys()].map(u=>{let[h,b]=u.split("|");return`<font>${h?"<b/>":""}<sz val="11"/>${b?`<color rgb="FF${b}"/>`:""}<name val="Calibri"/><family val="2"/></font>`}),c=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>',...[...r.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
145
  <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
142
- <fonts count="${c.length}">${c.join("")}</fonts>
143
- <fills count="${d.length}">${d.join("")}</fills>
146
+ <fonts count="${f.length}">${f.join("")}</fonts>
147
+ <fills count="${c.length}">${c.join("")}</fills>
144
148
  <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
149
  <cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
146
150
  <cellXfs count="${l.length}">${l.join("")}</cellXfs>
147
151
  <cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>
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"?>
152
+ </styleSheet>`,styleOf:u=>typeof u=="object"?s.get(n((({v:h,...b})=>b)(u)))??0:0}}function qh(e,t){let n=Math.max(e.columns.length,...e.rows.map(l=>l.length),1),s=e.rows.map((l,f)=>{let c=l.map((d,u)=>{let h=`${Ut(u)}${f+1}`,b=typeof d=="object"?d.v:d,m=t(d),y=m?` s="${m}"`:"";return b===""||b===void 0||b===null?m?`<c r="${h}"${y}/>`:"":typeof b=="number"?`<c r="${h}"${y}><v>${b}</v></c>`:`<c r="${h}"${y} t="inlineStr"><is><t xml:space="preserve">${nr(String(b))}</t></is></c>`}).join("");return`<row r="${f+1}">${c}</row>`}),i=`${Ut(n-1)}${Math.max(1,e.rows.length)}`,r=e.header?'<pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft" activeCell="A2" sqref="A2"/>':"",o=e.columns.length?`<cols>${e.columns.map((l,f)=>`<col min="${f+1}" max="${f+1}" width="${l.width}" customWidth="1"/>`).join("")}</cols>`:"",a=e.header&&e.rows.length>1?`<autoFilter ref="A1:${Ut(Math.max(0,e.columns.length-1))}${e.rows.length}"/>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
149
153
  <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
150
- <dimension ref="A1:${r}"/><sheetViews><sheetView workbookViewId="0">${i}</sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>${o}<sheetData>${s.join("")}</sheetData>${a}
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
- <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"?>
154
+ <dimension ref="A1:${i}"/><sheetViews><sheetView workbookViewId="0">${r}</sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>${o}<sheetData>${s.join("")}</sheetData>${a}
155
+ </worksheet>`}function $l(e){let{xml:t,styleOf:n}=Th(e),s=e.map(o=>Ch(o.name)),i=e.map((o,a)=>o.header&&o.rows.length>1?`<definedName name="_xlnm._FilterDatabase" localSheetId="${a}" hidden="1">'${nr(s[a]).replace(/'/g,"''")}'!$A$1:$${Ut(Math.max(0,o.columns.length-1))}$${o.rows.length}</definedName>`:"").join(""),r=[["[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
156
+ <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"/>${e.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
157
  <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="${_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};
158
+ <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="${nr(o)}" sheetId="${a+1}" r:id="rId${a+1}"/>`).join("")}</sheets>${i?`<definedNames>${i}</definedNames>`:""}</workbook>`],["xl/_rels/workbook.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
159
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${e.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${e.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`],["xl/styles.xml",t],...e.map((o,a)=>[`xl/worksheets/sheet${a+1}.xml`,qh(o,n)])];return Lh(r.map(([o,a])=>[o,kl.encode(a)]))}var Mh=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function Ph(e){let t=4294967295;for(let n=0;n<e.length;n++)t=Mh[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function Lh(e){let t=[],n=[],s=0;for(let[f,c]of e){let d=kl.encode(f),u=Ph(c),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,c.length,!0),h.setUint32(22,c.length,!0),h.setUint16(26,d.length,!0),t.push(new Uint8Array(h.buffer),d,c);let b=new DataView(new ArrayBuffer(46));b.setUint32(0,33639248,!0),b.setUint16(4,20,!0),b.setUint16(6,20,!0),b.setUint16(8,2048,!0),b.setUint32(16,u,!0),b.setUint32(20,c.length,!0),b.setUint32(24,c.length,!0),b.setUint16(28,d.length,!0),b.setUint32(42,s,!0),n.push(new Uint8Array(b.buffer),d),s+=30+d.length+c.length}let i=n.reduce((f,c)=>f+c.length,0),r=new DataView(new ArrayBuffer(22));r.setUint32(0,101010256,!0),r.setUint16(8,e.length,!0),r.setUint16(10,e.length,!0),r.setUint32(12,i,!0),r.setUint32(16,s,!0);let o=[...t,...n,new Uint8Array(r.buffer)],a=new Uint8Array(o.reduce((f,c)=>f+c.length,0)),l=0;for(let f of o)a.set(f,l),l+=f.length;return a}var Ih=e=>$l(e),Rh={bold:!0,fill:"E8EEF7"},Fh={v:"\u25CF",fill:"DDF3E6",center:!0},Dh={v:"\xD7",fill:"FFD5CC",center:!0,bold:!0},jh={v:"\u25D0",fill:"FFF3C4",center:!0},_h={v:"\u2248",fill:"FFF6DC",center:!0,bold:!0},Sl=Object.keys(Gi);function Bh(e,t,n,s="en"){let i=rs[s],r=(k,I,X)=>({key:k,name:i[k],header:!0,columns:I.map(([p,w])=>({title:p,width:w})),rows:[I.map(([p])=>({v:p,...Rh})),...X]}),o=k=>i[e.roles[k]],a=k=>k.startsWith("type:")?`${i.type}:${e.typeNames[k.slice(5)]??k.slice(5)}`:i[k],l=k=>(e.types[k]??[]).map(I=>e.typeNames[I]??I).join(" \xB7 "),f=k=>ce(k,s,e.names),c=[...e.agents].sort((k,I)=>k.role===I.role?k.id.localeCompare(I.id):k.role==="orchestrator"?-1:1),d=[...new Set([...c.flatMap(k=>Object.keys(k.facts)),...e.patterns.map(k=>k.key)])].filter(k=>!k.endsWith("~variant")).sort((k,I)=>Sl.indexOf(_t(k))-Sl.indexOf(_t(I))||k.localeCompare(I)),u=new Set(e.offPattern.map(k=>`${k.agent} ${k.key}`)),h=k=>e.agents.filter(I=>I.role===k).length,b={key:"summary",name:i.summary,header:!1,columns:[{title:"",width:28},{title:"",width:100}],rows:[[{v:e.name??i.title,bold:!0},""],[{v:i.privacy,color:"B42318"},""],[i.count.agents,e.agents.length],[i.count.orchestrators,h("orchestrator")],[i.count.specialists,h("specialist")],[i.count.patterns,e.patterns.length],[i.count.off,new Set(e.offPattern.map(k=>k.agent)).size],[i.count.gaps,e.gaps.length],[i.count.conflicts,e.conflicts.length],[i.count.solos,t.filter(k=>k.key==="solo").length],[i.count.unused,e.unused.length],["",""],[{v:t.length?i.look:i.nothing,bold:!0},""],...t.map(k=>["",{v:k[s],wrap:!0}])]},m=r("matrix",[[i.dimension,18],[i.fact,40],[i.key,34],...c.map(k=>[k.id,14])],d.map(k=>[Gi[_t(k)][s],f(k),k,...c.map(I=>k in I.facts?k.startsWith("declared:")?jh:Fh:`${k}~variant`in I.facts?_h:u.has(`${I.id} ${k}`)?Dh:"")])),{look:y,everyone:O}=Kt(e),v=r("patterns",[[i.key,34],[i.fact,40],[i.scope,14],[i.role,14],[i.share,10],[i.have,50],[i.lack,40],[i.decision,12],[i.why,50]],[...y,...O].map(k=>{let I=e.offPattern.filter(X=>X.key===k.key).map(X=>X.agent);return[k.key,f(k.key),a(k.scope),i[k.role],`${Math.round(k.share*100)}%`,k.agents.join(", "),I.join(", "),k.decision?i[k.decision.status==="accepted"?"accept":"reject"]:"",k.decision?.why??""]})),S=r("off",[[i.agent,24],[i.role,14],[i.missing,44],[i.key,34],[i.scope,14],[i.accepted,14]],e.offPattern.map(k=>[k.agent,o(k.agent),f(k.key),k.key,a(k.scope),e.patterns.find(I=>I.key===k.key)?.decision?.status==="accepted"?i.yes:""])),M=r("gaps",[[i.rule,16],[i.says,50],[i.role,14],[i.notMet,60]],e.gaps.map(k=>[k.rule.id,k.rule.says,k.rule.role?i[k.rule.role]:"",k.agents.join(", ")])),$=r("conflicts",[[i.agent,24],[i.fact,40],[i.key,34],[i.declared,20],[i.source,40],[i.inYaml,12]],e.conflicts.map(k=>[k.agent,f(k.key),k.key,k.declared,k.source,k.observed?i.yes:i.no])),N=r("agents",[[i.agent,24],[i.name,32],[i.role,14],[i.types,24],[i.facts,8],[i.off,44],[i.alone,44],[i.children,24],[i.unknown,12]],c.map(k=>[k.id,k.displayName??"",i[k.role],l(k.id),Object.keys(k.facts).length,e.offPattern.filter(I=>I.agent===k.id).map(I=>f(I.key)).join("; "),e.solos.filter(I=>I.agents[0]===k.id).map(I=>f(I.key)).join("; "),k.children.map(I=>I.name).join(", "),e.unknown.filter(I=>I.agent===k.id).length||""])),q=r("evidence",[[i.agent,30],[i.fact,40],[i.key,34],[i.file,50],[i.line,8]],c.flatMap(k=>[{who:k.id,facts:k.facts},...k.children.map(I=>({who:`${k.id} \u203A ${I.name}`,facts:I.facts}))]).flatMap(({who:k,facts:I})=>Object.entries(I).sort(([X],[p])=>X.localeCompare(p)).flatMap(([X,p])=>p.map(w=>[k,f(X),X,w.file,w.line??""])))),g=r("declared",[[i.agent,24],[i.key,34],[i.value,40],[i.source,40]],n.declared.map(k=>[k.agent,k.key,k.value,k.source])),E=r("text",[[i.id,28],[i.label,36],[i.body,70],[i.have,50],[i.variant,40],[i.official,10]],e.blocks.map(k=>[k.id,k.official??k.label,{v:k.text,wrap:!0},Object.keys(k.holders).sort().join(", "),Object.entries(k.variants).sort(([I],[X])=>I.localeCompare(X)).map(([I,X])=>`${I} (${Math.round(X.similarity*100)}%)`).join(", "),k.official?i.yes:""])),L=r("routing",[[i.caller,24],[i.called,30],[i.history,10],[i.inputs,30],[i.routingText,70],[i.chars,10],[i.file,44]],e.contract.routes.map(k=>[k.caller,k.agent??`${k.name??k.calls} (${i.notInFolder})`,k.history?i.yes:i.no,k.inputs.join(", "),{v:k.description,wrap:!0},k.description.length,`${k.file}${k.line?`:${k.line}`:""}`])),Y=r("unused",[[i.agent,24],[i.what,16],[i.name,30],[i.how,14],[i.file,50]],e.unused.flatMap(k=>k.sources.map(I=>[k.agent,i.thing[k.what]??k.what,e.names[k.name]??k.name,i[k.how],`${I.file}${I.line?`:${I.line}`:""}`]))),F=[b,m,v,...e.blocks.length?[E]:[],...e.contract.routes.length?[L]:[],S,M,$,...e.unused.length?[Y]:[],N,q,g];return e.unknown.length&&F.push(r("unknown",[[i.agent,24],[i.file,50],[i.why,40],[i.kind,24]],e.unknown.map(k=>[k.agent,k.file,i.why_[k.why],k.kind??""]))),F}var ye=e=>String(e??"").normalize("NFD").replace(/[̀-ͯ]/g,"").trim().toLowerCase(),Yt=Object.values(rs),vl=(e,t)=>e.find(n=>Yt.some(s=>ye(s[t])===ye(n.name)));function Ol(e,...t){let n=t.map(s=>e?.rows[0]?.findIndex(i=>Yt.some(r=>ye(r[s])===ye(i)))??-1);return s=>n.map(i=>i<0?"":String(s[i]??"").trim())}var Al=(e,t)=>t.find(([,n])=>Yt.some(s=>ye(s[n])===ye(e)))?.[0],Nl=e=>e.slice(1).filter(t=>t.some(n=>String(n??"").trim())),El=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Kh(e,t,n={}){let s=[],i=[],r=vl(t,"declared");if(r){let a=Ol(r,"agent","key","value","source"),l=[];Nl(r.rows).forEach((d,u)=>{let[h,b,m,y]=a(d);!h||!b?i.push(`${r.name}, ${u+2}: \xAB${a(r.rows[0])[h?1:0]}\xBB ?`):l.push({agent:h,key:b,value:m,source:y})});let f=d=>`${d.agent} ${d.key}`,c=0;for(let d of l){let u=e.declared.find(h=>f(h)===f(d));u?El(u,d)||s.push({key:`d${++c}`,kind:"declared",op:"set",before:u,after:d}):s.push({key:`d${++c}`,kind:"declared",op:"add",after:d})}for(let d of e.declared)l.some(u=>f(u)===f(d))||s.push({key:`d${++c}`,kind:"declared",op:"remove",before:d})}let o=vl(t,"patterns");if(o){let a=Ol(o,"key","scope","decision","why"),l=0;for(let f of Nl(o.rows)){let[c,d,u,h]=a(f);if(!c)continue;let b=e.decisions.find(S=>S.key===c);if(!u){b&&s.push({key:`p${++l}`,kind:"decision",op:"remove",before:b});continue}let m=Al(u,[["accepted","accept"],["rejected","reject"]]),y=/^(tipo|type)\s*:\s*(.+)$/i.exec(d),O=y?Object.entries(n).find(([S,M])=>ye(M)===ye(y[2])||ye(S)===ye(y[2]))?.[0]:void 0,v=y?O?`type:${O}`:void 0:Al(d,[["platform","platform"],["specialist","specialist"],["orchestrator","orchestrator"]]);if(!m)i.push(`${o.name}, ${c}: \xAB${u}\xBB \u2014 ${Yt.map(S=>`${S.accept}/${S.reject}`).join(", ")}`);else if(!v)i.push(`${o.name}, ${c}: \xAB${d}\xBB \u2014 ${Yt.map(S=>`${S.platform}/${S.specialist}/${S.orchestrator}`).join(", ")}`);else{let S={key:c,status:m,scope:v,why:h};b?El(b,S)||s.push({key:`p${++l}`,kind:"decision",op:"set",before:b,after:S}):s.push({key:`p${++l}`,kind:"decision",op:"add",after:S})}}}return{changes:s,problems:i}}function Uh(e,t,n){let s={...e,declared:[...e.declared],decisions:[...e.decisions]};for(let i of t.filter(r=>n.includes(r.key)))if(i.kind==="declared"){let r=a=>`${a.agent} ${a.key}`,o=i.before?s.declared.findIndex(a=>r(a)===r(i.before)):-1;i.op==="add"?s.declared.push(i.after):i.op==="set"?s.declared[o]=i.after:s.declared.splice(o,1)}else{let r=i.before?s.decisions.findIndex(o=>o.key===i.before.key):-1;i.op==="add"?s.decisions.push(i.after):i.op==="set"?s.decisions[r]=i.after:s.decisions.splice(r,1)}return s}var Wt="#8C8578";var os="#C8442C",Cl="#2E8F62";var xl=e=>Math.round(e*10)/10,zt=e=>[xl(e[0]),xl(e[1])],$e=(e,t,n=22,s="start",i)=>({type:"text",at:zt(e),text:t,size:n,anchor:s,...i?{style:{color:i}}:{}}),Tl=(e,t,n)=>({type:"line",from:zt(e),to:zt(t),...n?{style:n}:{}}),ql=(e,t,n)=>({type:"arrow",from:zt(e),to:zt(t),...n?{style:n}:{}});var Yh=(e,t)=>e.length*t*.48;function as(e,t,n){let s=[],i="";for(let r of e.split(/\s+/).filter(Boolean)){let o=i?`${i} ${r}`:r;i&&Yh(o,t)>n?(s.push(i),i=r):i=o}return i&&s.push(i),s.length?s:[""]}var st=150,Vt=40,zh=24,Ml=250,Pl="#7B4FC9",Ll=17,Il=23,sr=5,ir=4,Wh=/^(auth|model|setting|topics|connref|operation):/,Vh={en:{chapters:["The cast","What repeats","Who is off","What is missing","What to decide"],cast:(e,t)=>e?`${e} ${e===1?"orchestrator calls":"orchestrators call"} ${t} ${t===1?"specialist":"specialists"}.`:`${t} ${t===1?"specialist":"specialists"}, with no orchestrator.`,repeats:(e,t,n)=>e?`${e} patterns: ${t} of the platform, ${n} of the specialists.`:"Nothing repeats enough to be a pattern yet.",off:e=>e.length?`Off a pattern: ${e.join(", ")}.`:"Nobody is off a pattern.",missing:e=>e?`${e} ${e===1?"rule is":"rules are"} not met.`:"Every rule is met.",decide:e=>e?`${e} ${e===1?"thing":"things"} to decide.`:"Nothing left to decide.",unused:e=>`${e} ${e===1?"thing nobody uses or switched off":"things nobody uses or switched off"}: remove or switch on?`,pattern:e=>`A pattern? \xAB${e}\xBB`,platform:"platform",specialist:"specialists",more:e=>`and ${e} 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:(e,t)=>e?`${e} ${e===1?"orquestrador chama":"orquestradores chamam"} ${t} ${t===1?"especialista":"especialistas"}.`:`${t} ${t===1?"especialista":"especialistas"}, sem orquestrador.`,repeats:(e,t,n)=>e?`${e} padr\xF5es: ${t} da plataforma, ${n} dos especialistas.`:"Nada se repete o bastante para ser padr\xE3o ainda.",off:e=>e.length?`Fora do padr\xE3o: ${e.join(", ")}.`:"Ningu\xE9m est\xE1 fora do padr\xE3o.",missing:e=>e?`${e} ${e===1?"regra n\xE3o \xE9 cumprida":"regras n\xE3o s\xE3o cumpridas"}.`:"Todas as regras s\xE3o cumpridas.",decide:e=>e?`${e} ${e===1?"coisa":"coisas"} para decidir.`:"Nada em aberto para decidir.",unused:e=>`${e} ${e===1?"coisa sem uso ou desligada":"coisas sem uso ou desligadas"}: remover ou ligar?`,pattern:e=>`Padr\xE3o? \xAB${e}\xBB`,platform:"plataforma",specialist:"especialistas",more:e=>`e mais ${e} no mapa`,none:"nada"}};function Jh(e,t,n="en"){let s=Vh[n],i=e.agents.filter(p=>p.role==="orchestrator").sort((p,w)=>p.id.localeCompare(w.id)),r=Object.keys(e.typeNames),o=p=>{let w=(e.types[p]??[])[0];return w===void 0?r.length:r.indexOf(w)},a=e.agents.filter(p=>p.role==="specialist").sort((p,w)=>o(p.id)-o(w.id)||p.id.localeCompare(w.id)),l=r.length>0&&a.some(p=>(e.types[p.id]??[]).length),f=l?390:340,c=Math.max(1,Math.ceil(a.length/zh)),d=Math.max(1,Math.ceil(a.length/c)),u=Math.max(1e3,Vt*2+Math.max(d,i.length)*st),h=(p,w)=>u/2+(p-(w-1)/2)*st,b=p=>il(p)?0:Wh.test(p)?2:1,m=[{...$e([Vt,52],e.name??s.chapters[0],30),chapter:s.chapters[0],say:`${e.name?`${e.name}: `:""}${s.cast(i.length,a.length)}`}],y=(p,w,x)=>as(p,15,st-12).slice(0,2).forEach((T,j)=>m.push($e([w[0],w[1]+j*18],T,15,"middle",x))),O=170,v=new Map;i.forEach((p,w)=>{let x=h(w,i.length);v.set(p.id,[x,O]),m.push({type:"prop",name:"robot",at:[x,O],size:70}),y(p.id,[x,O+24],Wt)}),a.forEach((p,w)=>{let x=Math.floor(w/d),T=Math.min(d,a.length-x*d),j=[h(w%d,T),f+x*Ml];v.set(p.id,j),m.push({type:"prop",name:"robot",at:j,size:64}),y(p.id,[j[0],j[1]+24])});for(let p of i){let w=v.get(p.id);for(let x of a.filter(T=>T.schemaName&&`calls:${T.schemaName}`in p.facts)){let T=v.get(x.id);T[1]===f&&m.push(ql([w[0],w[1]+44],[T[0],T[1]-(l?118:76)],{color:Wt}))}}if(l){let p=[];a.forEach(w=>{let x=(e.types[w.id]??[])[0],T=x===void 0?n==="pt"?"sem tipo":"no type":e.typeNames[x]??x,[j,D]=v.get(w.id),ie=p[p.length-1];ie&&ie.name===T&&ie.y===D?ie.xs.push(j):p.push({name:T,xs:[j],y:D})});for(let w of p){let[x,T]=[Math.min(...w.xs),Math.max(...w.xs)];m.push($e([(x+T)/2,w.y-92],w.name,16,"middle",Pl),Tl([x-st/2+14,w.y-84],[T+st/2-14,w.y-84],{color:Pl}))}}let S=f+(c-1)*Ml+160,M=(u-Vt*2)/3,$=S,N=(p,w,x,T,j)=>{let D=Vt+p*M;m.push({...$e([D,S],w,22,"start",j),chapter:w,say:x});let ie=S+34,Se=T.slice(0,sr);T.length>sr&&Se.push(s.more(T.length-sr)),Se.length||Se.push(s.none);for(let ot of Se){let Gt=as(ot,Ll,M-30),or=Gt.length>ir?[...Gt.slice(0,ir-1),`${Gt[ir-1]}\u2026`]:Gt;or.forEach((Hl,us)=>m.push($e([D+(us?14:0),ie+us*Il],`${us?"":"\xB7 "}${Hl}`,Ll,"start",Wt))),ie+=or.length*Il+6}$=Math.max($,ie)},q=e.patterns.filter(p=>!p.partOf).sort((p,w)=>b(p.key)-b(w.key)||(p.scope===w.scope?0:p.scope==="platform"?-1:1)||w.share-p.share||p.key.localeCompare(w.key)),g=p=>p==="platform"?s.platform:s.specialist;N(0,s.chapters[1],s.repeats(e.patterns.length,e.patterns.filter(p=>p.scope==="platform").length,e.patterns.filter(p=>p.scope!=="platform").length),q.map(p=>`${ce(p.key,n,e.names)} \xB7 ${g(p.scope)}${p.share<1?` \xB7 ${Math.round(p.share*100)}%`:""}`),Cl);let E=[...new Set(e.offPattern.map(p=>p.agent))].sort();E.forEach((p,w)=>{let x=v.get(p),T=D=>D.variant?`${n==="pt"?"varia\xE7\xE3o de":"a variation of"} \xAB${ce(D.key,n,e.names)}\xBB`:ts(D.key,n,1,e.names),j=e.offPattern.filter(D=>D.agent===p).sort((D,ie)=>b(D.key)-b(ie.key)).flatMap(D=>as(T(D),13,st-10)).slice(0,4);m.push({...$e([x[0]+34,x[1]-50],"\xD7",30,"middle",os),...w===0?{chapter:s.chapters[2],say:s.off(E)}:{}}),j.forEach((D,ie)=>m.push($e([x[0],x[1]+66+ie*16],D,13,"middle",os)))}),E.length||m.push({...$e([u-Vt,92],s.off([]),16,"end",Wt),chapter:s.chapters[2],say:s.off([])});let L=e.gaps.flatMap(p=>{let w=p.agents.filter(x=>!e.offPattern.some(T=>T.agent===x&&T.key===p.rule.has)).length;return w?[n==="pt"?`\xAB${p.rule.says}\xBB: ${w}${p.rule.role?` ${ae(p.rule.role,n,w)}`:""} n\xE3o ${w===1?"cumpre":"cumprem"}`:`\xAB${p.rule.says}\xBB: ${w}${p.rule.role?` ${ae(p.rule.role,n,w)}`:""} ${w===1?"does":"do"} not meet it`]:[]});L.push(...t.filter(p=>p.key==="contract"||p.key==="flow").map(p=>p[n]));let Y=e.unknown.length;Y&&L.push(n==="pt"?`${Y} ${Y===1?"arquivo n\xE3o entendido":"arquivos n\xE3o entendidos"}`:`${Y} ${Y===1?"file":"files"} not understood`),N(1,s.chapters[3],s.missing(t.filter(p=>p.key==="gap").length),L,os);let F=t.filter(p=>p.key==="unused").length,{look:k}=Kt(e),I=[...t.filter(p=>p.key==="conflict"||p.key==="values"||p.key==="twice").map(p=>p[n]),...F?[s.unused(F)]:[],...k.filter(p=>!p.decision).map(p=>s.pattern(ce(p.key,n,e.names))),...t.filter(p=>p.key==="solo").map(p=>p[n])];return N(2,s.chapters[4],s.decide(I.length),I),{id:(e.name??"cast").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"cast",title:e.name??s.chapters[0],width:u,height:Math.min(4e3,$+40),background:"plain",locale:n==="pt"?"pt-BR":"en-US",steps:m}}var Rl=["and","or","not"];var rr=["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"],ls={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"},cs=e=>rr.includes(e)?e:typeof e=="string"&&Object.hasOwn(ls,e)?ls[e]:void 0;var Dl=e=>cs(e)!==void 0,A={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"},P=(e,t,n,s,i,r)=>({kind:"polygon",points:[[e,t],[e+n,t],[e+n,t+s],[e,t+s]],fill:i,main:r}),R=(...e)=>({kind:"polyline",points:e});function jl(e){return[{kind:"polygon",points:[[-.15,-.72],[.15,-.72],[.19,-.38],[-.19,-.38]],fill:A.shirt,main:!0},{kind:"circle",c:[0,-.87],r:.11,fill:A.skin},...e,R([-.08,-.38],[-.1,0]),R([.08,-.38],[.1,0])]}var Fl=jl([R([-.15,-.7],[-.25,-.42]),R([.15,-.7],[.25,-.42])]);function Gh(e,t,n){let s=([i,r])=>[n+i*t,r*t];return e.map(i=>i.kind==="circle"?{...i,c:s(i.c),r:i.r*t}:{...i,points:i.points.map(s)})}function Hh(){let e=[[-.28,-.3,.18],[-.06,-.45,.25],[.2,-.4,.21],[.37,-.27,.13]],t=[];for(let n=0;n<=24;n++){let s=-.46+.96*n/24,i=e.filter(([r,,o])=>Math.abs(s-r)<=o).map(([r,o,a])=>o-Math.sqrt(Math.max(0,a*a-(s-r)**2)));i.length&&t.push([s,Math.min(...i)])}return[...t,[.42,-.12],[-.4,-.12]]}var y0={person:Fl,"person-pointing":jl([R([-.15,-.7],[-.25,-.42]),R([.15,-.69],[.47,-.73])]),"person-sitting":[R([-.3,-.8],[-.27,-.4]),R([-.32,-.4],[.2,-.4]),R([-.27,-.4],[-.27,0]),R([.16,-.4],[.16,0]),{kind:"polygon",points:[[-.22,-.77],[.04,-.77],[.06,-.44],[-.22,-.44]],fill:A.shirt,main:!0},{kind:"circle",c:[-.08,-.9],r:.1,fill:A.skin},R([-.1,-.44],[.3,-.44],[.32,0]),R([0,-.74],[.18,-.55],[.3,-.58])],house:[P(-.4,-.6,.8,.6,A.wall,!0),{kind:"polygon",points:[[-.5,-.58],[0,-1],[.5,-.58]],fill:A.roof},P(-.08,-.32,.16,.32,A.wood),P(.16,-.46,.16,.14,A.screen)],car:[{kind:"polygon",fill:A.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:A.screen},{kind:"circle",c:[-.28,-.12],r:.1,fill:A.dark},{kind:"circle",c:[.28,-.12],r:.1,fill:A.dark}],bus:[P(-.5,-.66,1,.52,A.bus,!0),...[-.42,-.21,0,.21].map(e=>P(e,-.6,.15,.16,A.screen)),R([-.5,-.3],[.5,-.3]),{kind:"circle",c:[-.3,-.12],r:.1,fill:A.dark},{kind:"circle",c:[.3,-.12],r:.1,fill:A.dark}],coin:[{kind:"circle",c:[0,-.42],r:.4,fill:A.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]]},R([0,-.64],[0,-.2])],phone:[P(-.26,-1,.52,1,A.device,!0),P(-.2,-.92,.4,.76,A.screen),{kind:"circle",c:[0,-.08],r:.035,fill:A.paper}],document:[{kind:"polygon",points:[[-.36,-1],[.16,-1],[.36,-.8],[.36,0],[-.36,0]],fill:A.paper,main:!0},R([.16,-1],[.16,-.8],[.36,-.8]),...[-.66,-.5,-.34,-.18].map(e=>R([-.22,e],[.22,e]))],server:[-1,-.66,-.32].flatMap(e=>[P(-.36,e,.72,.3,A.metal,!0),R([-.26,e+.15],[.06,e+.15]),{kind:"circle",c:[.22,e+.15],r:.035,fill:A.green}]),bank:[{kind:"polygon",points:[[-.5,-.74],[0,-1],[.5,-.74]],fill:A.wall,main:!0},P(-.45,-.74,.9,.08,A.wall),...[-.33,-.11,.11,.33].map(e=>P(e-.04,-.66,.08,.56,A.paper)),P(-.5,-.1,1,.1,A.wall)],cloud:[{kind:"polygon",points:Hh(),fill:A.paper,main:!0}],queue:[-.32,0,.32].flatMap(e=>Gh(Fl,.7,e)),desk:[P(-.5,-.5,1,.07,A.wood,!0),R([-.42,-.43],[-.42,0]),R([.42,-.43],[.42,0])],computer:[P(-.45,-1,.9,.6,A.device,!0),P(-.39,-.94,.78,.48,A.screen),{kind:"polygon",points:[[-.06,-.4],[.06,-.4],[.1,-.1],[-.1,-.1]],fill:A.device},P(-.25,-.1,.5,.08,A.device)],clock:[{kind:"circle",c:[0,-.48],r:.45,fill:A.paper,main:!0},...[[0,-.9,0,-.82],[.42,-.48,.34,-.48],[0,-.06,0,-.14],[-.42,-.48,-.34,-.48]].map(([e,t,n,s])=>R([e,t],[n,s])),R([0,-.48],[0,-.78]),R([0,-.48],[.2,-.48])],lock:[{kind:"curve",points:[[-.22,-.52],[-.22,-.76],[0,-.96],[.22,-.76],[.22,-.52]]},P(-.36,-.54,.72,.54,A.bus,!0),{kind:"circle",c:[0,-.32],r:.06,fill:A.dark},R([0,-.28],[0,-.14])],"money-arrow":[{kind:"polygon",fill:A.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:A.gold},R([-.2,-.4],[-.2,-.2])],tree:[P(-.07,-.36,.14,.36,A.wood),{kind:"circle",c:[0,-.64],r:.3,fill:A.green,main:!0}],school:[P(-.45,-.6,.9,.6,A.wall,!0),{kind:"polygon",points:[[-.5,-.6],[0,-.82],[.5,-.6]],fill:A.roof},P(-.08,-.28,.16,.28,A.wood),P(-.36,-.48,.16,.12,A.screen),P(.2,-.48,.16,.12,A.screen),R([0,-.82],[0,-1]),{kind:"polygon",points:[[0,-1],[.17,-.95],[0,-.9]],fill:A.roof}],hospital:[P(-.4,-.8,.8,.8,A.paper,!0),P(-.045,-.7,.09,.26,"#C8442C"),P(-.13,-.615,.26,.09,"#C8442C"),P(-.1,-.24,.2,.24,A.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:A.wall,main:!0},P(.3,-.95,.12,.3,A.dark),P(-.38,-.32,.16,.12,A.screen),P(-.08,-.32,.16,.12,A.screen),P(.22,-.32,.16,.12,A.screen)],truck:[P(-.5,-.62,.62,.46,A.metal,!0),{kind:"polygon",points:[[.12,-.16],[.12,-.5],[.34,-.5],[.48,-.32],[.48,-.16]],fill:A.bus},{kind:"polygon",points:[[.18,-.46],[.32,-.46],[.42,-.33],[.18,-.33]],fill:A.screen},{kind:"circle",c:[-.3,-.1],r:.1,fill:A.dark},{kind:"circle",c:[.3,-.1],r:.1,fill:A.dark}],cart:[R([-.48,-.78],[-.4,-.62]),{kind:"polygon",points:[[-.4,-.62],[.42,-.62],[.32,-.26],[-.3,-.26]],fill:A.metal,main:!0},R([-.3,-.26],[-.3,-.14],[.32,-.14]),{kind:"circle",c:[-.22,-.07],r:.06,fill:A.dark},{kind:"circle",c:[.24,-.07],r:.06,fill:A.dark}],safe:[P(-.4,-.82,.8,.82,A.device,!0),P(-.3,-.72,.6,.62,A.metal),{kind:"circle",c:[0,-.41],r:.13,fill:A.paper},R([0,-.41],[.08,-.47])],bulb:[{kind:"circle",c:[0,-.62],r:.3,fill:A.gold,main:!0},P(-.13,-.33,.26,.2,A.metal),{kind:"curve",points:[[-.09,-.52],[0,-.66],[.09,-.52]]},R([-.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:A.metal,main:!0},{kind:"circle",c:[0,-.5],r:.12,fill:A.paper}],database:[{kind:"polygon",points:[[-.35,-.8],[.35,-.8],[.35,-.16],[-.35,-.16]],fill:A.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:A.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:[R([0,-.95],[0,-1]),P(-.22,-.95,.44,.3,A.metal),{kind:"circle",c:[-.09,-.81],r:.045,fill:A.screen},{kind:"circle",c:[.09,-.81],r:.045,fill:A.screen},P(-.28,-.62,.56,.42,A.metal,!0),R([-.28,-.55],[-.42,-.35]),R([.28,-.55],[.42,-.35]),P(-.2,-.2,.12,.2,A.device),P(.08,-.2,.12,.2,A.device)],ship:[{kind:"polygon",points:[[-.48,-.3],[.48,-.3],[.36,-.04],[-.4,-.04]],fill:A.car,main:!0},P(-.42,-.62,.14,.32,A.wall),P(-.24,-.5,.2,.2,A.roof),P(-.02,-.5,.2,.2,A.bus),P(.2,-.5,.2,.2,A.green),{kind:"curve",points:[[-.5,0],[-.3,-.04],[-.1,0],[.1,-.04],[.3,0],[.5,-.04]]}],container:[P(-.46,-.52,.92,.52,A.roof,!0),...[-.3,-.15,0,.15,.3].map(e=>R([e,-.48],[e,-.04]))],warehouse:[{kind:"polygon",points:[[-.46,0],[.46,0],[.46,-.55],[0,-.82],[-.46,-.55]],fill:A.wall,main:!0},P(-.2,-.38,.4,.38,A.metal),R([-.2,-.26],[.2,-.26]),R([-.2,-.13],[.2,-.13])],box:[P(-.36,-.5,.52,.5,A.wood,!0),{kind:"polygon",points:[[-.36,-.5],[.16,-.5],[.36,-.64],[-.16,-.64]],fill:A.wood},{kind:"polygon",points:[[.16,0],[.36,-.14],[.36,-.64],[.16,-.5]],fill:A.wood},R([-.1,-.5],[.1,-.64])],pallet:[P(-.46,-.12,.92,.06,A.wood),...[-.42,-.05,.32].map(e=>P(e,-.06,.1,.06,A.wood)),P(-.42,-.5,.4,.38,A.wood,!0),P(.02,-.5,.4,.38,A.wood),P(-.2,-.82,.4,.32,A.wood)],shop:[P(-.42,-.6,.84,.6,A.wall,!0),{kind:"polygon",points:[[-.48,-.6],[.48,-.6],[.42,-.78],[-.42,-.78]],fill:A.roof},P(-.34,-.48,.34,.26,A.screen),P(.08,-.42,.24,.42,A.wood)],shelf:[P(-.4,-.92,.8,.92,A.paper,!0),R([-.4,-.62],[.4,-.62]),R([-.4,-.32],[.4,-.32]),P(-.32,-.8,.16,.18,A.roof),P(-.1,-.78,.14,.16,A.bus),P(.1,-.5,.22,.18,A.green),P(-.3,-.2,.24,.2,A.wood)],field:[R([-.48,0],[.48,0]),...[-.3,0,.3].flatMap(e=>[{kind:"curve",points:[[e,0],[e-.02,-.25],[e,-.5]]},{kind:"circle",c:[e-.08,-.32],r:.07,fill:A.green,main:!0},{kind:"circle",c:[e+.08,-.42],r:.07,fill:A.green,main:!0},{kind:"circle",c:[e,-.52],r:.06,fill:A.roof}])],cup:[{kind:"polygon",points:[[-.26,-.52],[.26,-.52],[.2,-.1],[-.2,-.1]],fill:A.paper,main:!0},{kind:"curve",points:[[.24,-.44],[.4,-.38],[.22,-.2]]},{kind:"polygon",points:[[-.46,-.1],[.46,-.1],[.36,0],[-.36,0]],fill:A.paper},{kind:"curve",points:[[-.08,-.62],[-.02,-.72],[-.08,-.84]]},{kind:"curve",points:[[.08,-.62],[.14,-.72],[.08,-.84]]}],function:[P(-.38,-.72,.76,.62,A.screen,!0),R([-.14,-.62],[0,-.62],[.14,-.2]),R([.02,-.42],[-.14,-.2])],"api-gateway":[P(-.12,-.8,.24,.8,A.metal,!0),R([-.48,-.55],[-.16,-.55]),R([-.24,-.62],[-.16,-.55],[-.24,-.48]),R([.16,-.3],[.48,-.3]),R([.4,-.37],[.48,-.3],[.4,-.23])],cache:[P(-.34,-.66,.68,.66,A.metal,!0),{kind:"polygon",points:[[.04,-.58],[-.12,-.3],[0,-.3],[-.06,-.08],[.14,-.38],[.02,-.38]],fill:A.gold}],cluster:[{kind:"curve",points:[[-.4,-.8],[0,-.86],[.4,-.8],[.48,-.45],[.4,-.1],[0,-.04],[-.4,-.1],[-.48,-.45],[-.4,-.8]]},P(-.3,-.7,.24,.2,A.screen,!0),P(.06,-.7,.24,.2,A.screen,!0),P(-.12,-.38,.24,.2,A.screen,!0)],board:[P(-.48,-.9,.96,.6,A.board,!0),P(-.34,-.76,.42,.03,A.chalk),P(-.34,-.62,.58,.03,A.chalk),P(-.34,-.48,.3,.03,A.chalk),R([-.3,-.3],[-.36,0]),R([.3,-.3],[.36,0])],book:[{kind:"polygon",points:[[0,-.62],[-.46,-.7],[-.46,-.1],[0,-.04]],fill:A.paper,main:!0},{kind:"polygon",points:[[0,-.62],[.46,-.7],[.46,-.1],[0,-.04]],fill:A.paper,main:!0},R([-.36,-.52],[-.1,-.48]),R([-.36,-.38],[-.1,-.34]),R([.1,-.48],[.36,-.52]),R([.1,-.34],[.36,-.38])],pencil:[{kind:"polygon",points:[[-.38,-.12],[.22,-.72],[.34,-.6],[-.26,0]],fill:A.bus,main:!0},{kind:"polygon",points:[[.22,-.72],[.34,-.6],[.44,-.86]],fill:A.wood},{kind:"polygon",points:[[-.38,-.12],[-.26,0],[-.46,-.02]],fill:A.roof}]},_l=["happy","sad","surprised","worried","idea"],Xh={person:[0,-.87,.11],"person-pointing":[0,-.87,.11],"person-sitting":[-.08,-.9,.1]},Bl=e=>{let t=cs(e);return!!t&&t in Xh};var Kl=["spin","drive","steam","talk","pulse","float"],Qh=["lesson","pitch","arch","decision","data","timeline","story"],Ul=8,Yl=6,zl=2e5,Wl=6e5,Vl=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"],it=["text","prop","card","counter","circle","ellipse"],Jl=["row","column","grid","chain"],Zh=50;function J(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t}: expected an object.`)}function z(e,t){if(typeof e!="string"||!e.trim()||e.length>2e3)throw new Error(`${t}: expected text of 1 to 2000 characters.`)}function B(e,t,n=-1e4,s=1e4){if(typeof e!="number"||!Number.isFinite(e)||e<n||e>s)throw new Error(`${t}: expected a number between ${n} and ${s}.`)}function te(e,t){if(typeof e=="string"){if(z(e,t),e.length>300)throw new Error(`${t}: expression too long.`)}else B(e,t)}function ee(e,t){if(!Array.isArray(e)||e.length!==2)throw new Error(`${t}: expected [x, y].`);e.forEach((n,s)=>te(n,`${t}[${s}]`))}function fe(e,t){e!==void 0&&z(e,t)}function ne(e,t,n){if(e!==void 0&&(typeof e!="string"||!t.includes(e)))throw new Error(`${n}: choose one of ${t.join(", ")}.`)}function fs(e){if(!/^[A-Za-z_][A-Za-z_0-9]*$/.test(e)||["__proto__","constructor","prototype",...Rl].includes(e))throw new Error(`Invalid variable name: "${e}".`)}var rt=(e,t)=>t.includes("{")||e.exact.has(t)||[...e.repeated].some(n=>t.startsWith(`${n}-`)&&/^\d+$/.test(t.slice(n.length+1)));function Be(e,t,n,s){s&&e[t]===void 0&&(e[t]=[0,0]),ee(e[t],`${n}.${t}`)}function Jt(e,t,n,s,i=!1){if(J(e,t),++n.count>500)throw new Error(`${t}: a recipe draws at most 500 steps, counting those inside repeat and when.`);if(s){for(let a of["chapter","say","duration"])if(e[a]!==void 0)throw new Error(`${t}.${a}: put it on the ${s} step itself, not on a step inside it.`);if(e.type==="pause")throw new Error(`${t}: a pause cannot go inside ${s}.`);if(e.type==="repeat"&&s==="repeat")throw new Error(`${t}: a repeat cannot go inside another repeat.`);if(Jl.includes(s)&&e.place!==void 0)throw new Error(`${t}.place: the ${s} places the steps inside it.`)}if(!Gl.includes(e.type))throw new Error(`${t}: unknown type "${e.type}".`);for(let a of["id","say","chapter"])fe(e[a],`${t}.${a}`);if(e.duration!==void 0&&B(e.duration,`${t}.duration`,0,3e4),e.nudge!==void 0){if(["pause","move","link","animate"].includes(e.type))throw new Error(`${t}.nudge: a ${e.type} has no place of its own to move.`);if(!Array.isArray(e.nudge)||e.nudge.length!==2)throw new Error(`${t}.nudge: use [dx, dy].`);e.nudge.forEach((a,l)=>B(a,`${t}.nudge[${l}]`,-900,900))}let r=s!==null&&Jl.includes(s)||i;if(e.place!==void 0){if(!it.includes(e.type))throw new Error(`${t}.place: only ${it.join(", ")} can be placed.`);if(J(e.place,`${t}.place`),z(e.place.to,`${t}.place.to`),!rt(n,String(e.place.to)))throw new Error(`${t}.place.to: no earlier step has the id "${e.place.to}".`);if(!["below","above","left","right"].includes(e.place.side))throw new Error(`${t}.place.side: choose one of below, above, left, right.`);e.place.gap!==void 0&&B(e.place.gap,`${t}.place.gap`,-200,400),ne(e.place.align,["center","start","end"],`${t}.place.align`)}let o=r||e.place!==void 0;if(e.style!==void 0){J(e.style,`${t}.style`);for(let a of["color","fill"]){let l=e.style[a];if(l!==void 0&&(typeof l!="string"||!/^(#[\da-f]{3,8}|[a-z]+)$/i.test(l)))throw new Error(`${t}.style.${a}: use a hex colour or a colour name, no URLs.`)}for(let a of["width","roughness","bowing"])e.style[a]!==void 0&&B(e.style[a],`${t}.style.${a}`,0,20);if(e.style.opacity!==void 0&&B(e.style.opacity,`${t}.style.opacity`,0,1),e.style.dashed!==void 0&&typeof e.style.dashed!="boolean")throw new Error(`${t}: dashed must be a boolean.`);ne(e.style.fillStyle,["hachure","solid","zigzag","cross-hatch","dots"],`${t}.style.fillStyle`)}switch(e.type){case"line":case"arrow":case"highlight":ee(e.from,`${t}.from`),ee(e.to,`${t}.to`),e.thickness!==void 0&&B(e.thickness,`${t}.thickness`,1,200);break;case"polyline":case"polygon":case"curve":if(!Array.isArray(e.points)||e.points.length<(e.type==="polygon"?3:2)||e.points.length>500)throw new Error(`${t}: points needs ${e.type==="polygon"?3:2} to 500 points.`);e.points.forEach((a,l)=>ee(a,`${t}.points[${l}]`));break;case"circle":case"ellipse":Be(e,"center",t,o);for(let a of e.type==="circle"?["r"]:["rx","ry"])te(e[a],`${t}.${a}`),typeof e[a]=="number"&&B(e[a],`${t}.${a}`,0);break;case"text":Be(e,"at",t,o),z(e.text,`${t}.text`),e.size!==void 0&&B(e.size,`${t}.size`,1,200),e.rotate!==void 0&&B(e.rotate,`${t}.rotate`,-360,360),ne(e.font,["hand","body"],`${t}.font`),ne(e.anchor,["start","middle","end"],`${t}.anchor`);break;case"card":Be(e,"at",t,o),te(e.w,`${t}.w`),te(e.h,`${t}.h`);for(let a of["w","h"])typeof e[a]=="number"&&B(e[a],`${t}.${a}`,40);if(z(e.title,`${t}.title`),e.lines!==void 0){if(!Array.isArray(e.lines)||e.lines.length>6)throw new Error(`${t}: at most 6 lines per card.`);e.lines.forEach((a,l)=>z(a,`${t}.lines[${l}]`))}break;case"plot":z(e.fn,`${t}.fn`),e.var!==void 0&&(z(e.var,`${t}.var`),fs(String(e.var))),ee(e.domain,`${t}.domain`),ee(e.range,`${t}.range`),J(e.box,`${t}.box`);for(let a of["x","y","w","h"])te(e.box[a],`${t}.box.${a}`);if(e.samples!==void 0&&(B(e.samples,`${t}.samples`,2,1e3),!Number.isInteger(e.samples)))throw new Error(`${t}: samples must be an integer.`);break;case"pause":B(e.ms,`${t}.ms`,0,3e4),fe(e.ask,`${t}.ask`);break;case"prop":if(!Dl(e.name)&&!n.figures.has(String(e.name))){let a=n.figures.size?`, or one the recipe defines (${[...n.figures].join(", ")})`:"";throw new Error(`${t}.name: unknown prop "${String(e.name)}"; use one of ${rr.join(", ")}${a}.`)}if(Be(e,"at",t,o),e.size!==void 0&&(te(e.size,`${t}.size`),typeof e.size=="number"&&B(e.size,`${t}.size`,10,1e3)),fe(e.label,`${t}.label`),e.flip!==void 0&&typeof e.flip!="boolean")throw new Error(`${t}.flip: expected true or false.`);if(e.mood!==void 0){if(!Bl(e.name))throw new Error(`${t}.mood: only a person (person, person-pointing, person-sitting) has a face.`);ne(e.mood,_l,`${t}.mood`)}break;case"repeat":if(te(e.times,`${t}.times`),typeof e.times=="number"&&(B(e.times,`${t}.times`,0,Zh),!Number.isInteger(e.times)))throw new Error(`${t}.times: expected a whole number.`);Jt(e.step,`${t}.step`,n,"repeat",r);break;case"when":if(te(e.if,`${t}.if`),!Array.isArray(e.steps)||e.steps.length===0||e.steps.length>50)throw new Error(`${t}.steps: expected 1 to 50 steps.`);e.steps.forEach((a,l)=>Jt(a,`${t}.steps[${l}]`,n,s??"when"));break;case"move":if(z(e.target,`${t}.target`),!rt(n,String(e.target)))throw new Error(`${t}.target: no earlier step has the id "${e.target}".`);ee(e.to,`${t}.to`),ne(e.along,["line","curve"],`${t}.along`),e.ms!==void 0&&B(e.ms,`${t}.ms`,200,5e3);break;case"lottie":if(z(e.src,`${t}.src`),ee(e.at,`${t}.at`),e.size!==void 0&&(te(e.size,`${t}.size`),typeof e.size=="number"&&B(e.size,`${t}.size`,24,1e3)),e.loop!==void 0&&typeof e.loop!="boolean")throw new Error(`${t}.loop: expected true or false.`);break;case"animate":if(z(e.target,`${t}.target`),!rt(n,String(e.target)))throw new Error(`${t}.target: no earlier step has the id "${e.target}".`);if(ne(e.effect,[...Kl,"stop"],`${t}.effect`),e.effect===void 0)throw new Error(`${t}.effect: choose one of ${[...Kl,"stop"].join(", ")}.`);ne(e.speed,["slow","fast"],`${t}.speed`);break;case"link":for(let a of["from","to"])if(z(e[a],`${t}.${a}`),!rt(n,String(e[a])))throw new Error(`${t}.${a}: no earlier step has the id "${e[a]}".`);fe(e.label,`${t}.label`);break;case"counter":if(Be(e,"at",t,o),te(e.value,`${t}.value`),e.format!==void 0&&(z(e.format,`${t}.format`),!String(e.format).includes("{v")))throw new Error(`${t}.format: show the number as {v}, e.g. "R$ {v:0}".`);e.size!==void 0&&B(e.size,`${t}.size`,1,200),ne(e.anchor,["start","middle","end"],`${t}.anchor`);break;case"row":case"column":case"grid":if(r)throw new Error(`${t}: a ${e.type} cannot go inside another ${s}.`);if(Be(e,"at",t,!1),e.gap!==void 0&&B(e.gap,`${t}.gap`,0,400),e.type==="grid"){if(B(e.columns,`${t}.columns`,1,12),!Number.isInteger(e.columns))throw new Error(`${t}.columns: expected a whole number.`)}else ne(e.align,["center","start","end"],`${t}.align`);if(!Array.isArray(e.steps)||e.steps.length===0||e.steps.length>50)throw new Error(`${t}.steps: expected 1 to 50 steps.`);e.steps.forEach((a,l)=>{J(a,`${t}.steps[${l}]`);let f=a.type==="repeat"?a.step?.type:a.type;if(!it.includes(f))throw new Error(`${t}.steps[${l}]: a ${e.type} holds only ${it.join(", ")} (or a repeat of one).`);Jt(a,`${t}.steps[${l}]`,n,e.type)});break;case"chain":if(r)throw new Error(`${t}: a chain cannot go inside a ${s}.`);if(Be(e,"at",t,!1),e.gap!==void 0&&e.gap!=="auto"&&B(e.gap,`${t}.gap`,0,400),ne(e.direction,["right","down"],`${t}.direction`),e.wrap!==void 0&&typeof e.wrap!="boolean")throw new Error(`${t}.wrap: expected true or false.`);if(fe(e.forward,`${t}.forward`),fe(e.back,`${t}.back`),e.size!==void 0&&(te(e.size,`${t}.size`),typeof e.size=="number"&&B(e.size,`${t}.size`,10,1e3)),!Array.isArray(e.steps)||e.steps.length<2||e.steps.length>12)throw new Error(`${t}.steps: a chain joins 2 to 12 pieces.`);e.steps.forEach((a,l)=>{if(J(a,`${t}.steps[${l}]`),!it.includes(a.type))throw new Error(`${t}.steps[${l}]: a chain holds only ${it.join(", ")}.`);Jt(a,`${t}.steps[${l}]`,n,"chain")});break;case"axis":case"timeline":if(ee(e.from,`${t}.from`),ee(e.to,`${t}.to`),ee(e.domain,`${t}.domain`),e.type==="axis"){if(e.ticks!==void 0){if(Array.isArray(e.ticks)){if(e.ticks.length>30)throw new Error(`${t}.ticks: at most 30 marks.`);e.ticks.forEach((a,l)=>B(a,`${t}.ticks[${l}]`))}else if(B(e.ticks,`${t}.ticks`,0,30),!Number.isInteger(e.ticks))throw new Error(`${t}.ticks: expected a whole number.`)}if(fe(e.label,`${t}.label`),e.format!==void 0&&(z(e.format,`${t}.format`),!String(e.format).includes("{v")))throw new Error(`${t}.format: show the number as {v}, e.g. "{v} km".`)}else{if(!Array.isArray(e.marks)||e.marks.length===0||e.marks.length>20)throw new Error(`${t}.marks: expected 1 to 20 marks.`);e.marks.forEach((a,l)=>{J(a,`${t}.marks[${l}]`),te(a.at,`${t}.marks[${l}].at`),fe(a.label,`${t}.marks[${l}].label`),fe(a.text,`${t}.marks[${l}].text`)})}break;case"balloon":if(z(e.to,`${t}.to`),!rt(n,String(e.to)))throw new Error(`${t}.to: no earlier step has the id "${e.to}".`);if(z(e.text,`${t}.text`),String(e.text).length>300)throw new Error(`${t}.text: keep a balloon under 300 characters.`);ne(e.side,["below","above","left","right"],`${t}.side`),ne(e.kind,["speech","thought"],`${t}.kind`),e.width!==void 0&&B(e.width,`${t}.width`,80,600),e.size!==void 0&&B(e.size,`${t}.size`,12,60);break;case"brace":if(ee(e.from,`${t}.from`),ee(e.to,`${t}.to`),fe(e.label,`${t}.label`),e.flip!==void 0&&typeof e.flip!="boolean")throw new Error(`${t}.flip: expected true or false.`);break;case"note":if(ee(e.at,`${t}.at`),z(e.text,`${t}.text`),e.to===void 0==(e.point===void 0))throw new Error(`${t}: a note points either to an element (to) or to a point (point).`);if(e.to!==void 0){if(z(e.to,`${t}.to`),!rt(n,String(e.to)))throw new Error(`${t}.to: no earlier step has the id "${e.to}".`)}else ee(e.point,`${t}.point`);e.size!==void 0&&B(e.size,`${t}.size`,12,60);break;case"table":if(ee(e.at,`${t}.at`),!Array.isArray(e.rows)||e.rows.length===0||e.rows.length>12)throw new Error(`${t}.rows: expected 1 to 12 rows.`);if(e.rows.forEach((a,l)=>{if(!Array.isArray(a)||a.length===0||a.length>6)throw new Error(`${t}.rows[${l}]: expected 1 to 6 cells.`);a.forEach((f,c)=>{if(typeof f!="string"||f.length>120)throw new Error(`${t}.rows[${l}][${c}]: expected text of up to 120 characters.`)})}),e.header!==void 0&&typeof e.header!="boolean")throw new Error(`${t}.header: expected true or false.`);e.size!==void 0&&B(e.size,`${t}.size`,12,40);break;case"bars":J(e.box,`${t}.box`);for(let a of["x","y","w","h"])te(e.box[a],`${t}.box.${a}`);if(!Array.isArray(e.values)||e.values.length===0||e.values.length>12)throw new Error(`${t}.values: expected 1 to 12 values.`);if(e.values.forEach((a,l)=>te(a,`${t}.values[${l}]`)),e.labels!==void 0){if(!Array.isArray(e.labels)||e.labels.length>e.values.length)throw new Error(`${t}.labels: at most one label per value.`);e.labels.forEach((a,l)=>z(a,`${t}.labels[${l}]`))}if(e.max!==void 0&&te(e.max,`${t}.max`),e.format!==void 0&&(z(e.format,`${t}.format`),!String(e.format).includes("{v")))throw new Error(`${t}.format: show the number as {v}, e.g. "{v}%".`);break}typeof e.id=="string"&&(s==="repeat"?n.repeated:n.exact).add(e.id)}function em(e,t){let n=`defs.${e}`;if(!/^[a-z][a-z0-9-]{1,30}$/.test(e))throw new Error(`${n}: a figure's name is 2 to 31 lowercase letters, digits or -, starting with a letter.`);if(cs(e)||Object.hasOwn(ls,e)||Gl.includes(e)||["define","title","param","switch","var"].includes(e))throw new Error(`${n}: "${e}" is already a prop or a step; choose another name.`);if(J(t,n),!Array.isArray(t.shapes)||t.shapes.length===0||t.shapes.length>Vl)throw new Error(`${n}.shapes: expected 1 to ${Vl} shapes.`);let s=(i,r)=>{if(typeof i!="number"||!Number.isInteger(i)||i<0||i>100)throw new Error(`${r}: expected a whole number from 0 to 100 (the figure's grid, y down; it stands at 50,100).`)};t.shapes.forEach((i,r)=>{let o=`${n}.shapes[${r}]`;if(J(i,o),i.fill!==void 0&&(typeof i.fill!="string"||!/^(#[0-9a-fA-F]{3,8}|[a-z]{3,20})$/.test(i.fill)))throw new Error(`${o}.fill: a colour, as hex or a plain name.`);if(i.kind==="circle"){if(!Array.isArray(i.c)||i.c.length!==2)throw new Error(`${o}.c: expected [x, y].`);i.c.forEach((l,f)=>s(l,`${o}.c[${f}]`)),s(i.r,`${o}.r`);return}if(!["polygon","polyline","curve"].includes(i.kind))throw new Error(`${o}.kind: choose one of polygon, polyline, curve, circle.`);let a=i.kind==="polygon"?3:2;if(!Array.isArray(i.points)||i.points.length<a||i.points.length>40)throw new Error(`${o}.points: a ${i.kind} takes ${a} to 40 points.`);i.points.forEach((l,f)=>{if(!Array.isArray(l)||l.length!==2)throw new Error(`${o}.points[${f}]: expected [x, y].`);l.forEach((c,d)=>s(c,`${o}.points[${f}][${d}]`))})})}function tm(e,t){let n=`lottie "${e}"`;J(t,n);let s=JSON.stringify(t).length;if(s>zl)throw new Error(`${n}: ${Math.round(s/1e3)} KB; an animation can have at most ${zl/1e3} KB.`);for(let r of["fr","ip","op","w","h"])B(t[r],`${n}.${r}`,0,1e5);if(typeof t.v!="string"||!Array.isArray(t.layers))throw new Error(`${n}: not a Lottie animation (it needs v and layers).`);let i=(r,o)=>{if(Array.isArray(r))return r.forEach((a,l)=>i(a,`${o}[${l}]`));if(!(!r||typeof r!="object"))for(let[a,l]of Object.entries(r)){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.`);i(l,`${o}.${a}`)}};i(t.layers,"layers");for(let r of Array.isArray(t.assets)?t.assets:[]){let o=r?.p;if(typeof o=="string"&&o&&!o.startsWith("data:")&&!Array.isArray(r.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 nm(e){J(e,"The recipe");let t=e;B(t.width,"width",100,4e3),B(t.height,"height",100,4e3);for(let i of["id","title","category"])fe(t[i],i);if(t.locale!==void 0&&!(typeof t.locale=="string"&&/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(t.locale)&&Intl.NumberFormat.supportedLocalesOf([t.locale]).length>0))throw new Error('locale: expected a language tag such as "en-US" or "pt-BR".');if(ne(t.background,["dots","grid","plain"],"background"),ne(t.kind,Qh,"kind"),fe(t.source,"source"),t.quiz!==void 0&&t.kind!==void 0&&t.kind!=="lesson")throw new Error(`quiz: only a lesson has a quiz (this drawing is a ${t.kind}).`);if(ne(t.theme,["paper","chalkboard"],"theme"),t.quiz!==void 0){if(J(t.quiz,"quiz"),z(t.quiz.question,"quiz.question"),!Array.isArray(t.quiz.options)||t.quiz.options.length<2||t.quiz.options.length>4)throw new Error("quiz.options: expected 2 to 4 options.");if(t.quiz.options.forEach((i,r)=>{if(J(i,`quiz.options[${r}]`),z(i.text,`quiz.options[${r}].text`),z(i.why,`quiz.options[${r}].why`),typeof i.right!="boolean")throw new Error(`quiz.options[${r}].right: expected true or false.`)}),t.quiz.options.filter(i=>i.right===!0).length!==1)throw new Error("quiz.options: exactly one option is right.")}if(t.learning!==void 0){J(t.learning,"learning");for(let i of["goal","question","answer","caveat"])z(t.learning[i],`learning.${i}`)}if(t.params!==void 0){J(t.params,"params");for(let[i,r]of Object.entries(t.params))if(fs(i),J(r,`params.${i}`),z(r.label,`params.${i}.label`),B(r.min,`${i}.min`),B(r.max,`${i}.max`),B(r.step,`${i}.step`,1e-6),B(r.value,`${i}.value`,r.min,r.max),r.max<=r.min)throw new Error(`${i}: max must be greater than min.`)}if(t.vars!==void 0){J(t.vars,"vars");for(let[i,r]of Object.entries(t.vars))fs(i),te(r,`vars.${i}`)}if(t.switches!==void 0){J(t.switches,"switches");let i=Object.entries(t.switches);if(i.length>8)throw new Error("switches: at most 8.");for(let[r,o]of i){if(fs(r),Object.hasOwn(t.params??{},r)||Object.hasOwn(t.vars??{},r))throw new Error(`switches.${r}: the name is already a param or a var.`);if(J(o,`switches.${r}`),z(o.label,`switches.${r}.label`),typeof o.on!="boolean")throw new Error(`switches.${r}.on: expected true or false.`)}}if(!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>250)throw new Error("A recipe needs 1 to 250 steps.");let n=new Set;if(t.defs!==void 0){J(t.defs,"defs");let i=Object.entries(t.defs);if(i.length>Ul)throw new Error(`defs: at most ${Ul} figures.`);for(let[r,o]of i)em(r,o),n.add(r)}if(t.lotties!==void 0){J(t.lotties,"lotties");let i=Object.entries(t.lotties);if(i.length>Yl)throw new Error(`lotties: at most ${Yl} animations.`);let r=i.reduce((o,[a,l])=>o+tm(a,l),0);if(r>Wl)throw new Error(`lotties: ${Math.round(r/1e3)} KB in all; at most ${Wl/1e3} KB.`)}if(t.credits!==void 0){if(!Array.isArray(t.credits)||t.credits.length>5)throw new Error("credits: at most 5 lines.");t.credits.forEach((i,r)=>z(i,`credits[${r}]`))}let s={exact:new Set,repeated:new Set,count:0,figures:n};return t.steps.forEach((i,r)=>Jt(i,`Step ${r+1}`,s,null)),{...t,id:t.id??"pasted",title:t.title??"",background:t.background??"dots"}}export{Hi as DEFAULT_PROFILE,fr as agentsIn,Uh as applyChanges,Nh as compare,Wp as extractAgent,Kh as fromSheets,Kt as groupPatterns,Vp as knownKinds,ce as labelOf,Jh as lessonOf,dh as problemText,ah as readCast,eh as readProfile,xh as reviewCast,nm as validateScene,Ih as workbookFile,Bh as workbookOf,uh as writeCast};