house-lights 1.2.0 → 1.3.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.
- package/package.json +1 -1
- package/skills/cast-list/assets/map.html +60 -33
- package/skills/cast-list/examples/agents/bodega-cupons/actions/AbrirChamadoERP.mcs.yml +15 -0
- package/skills/cast-list/examples/agents/bodega-cupons/actions/ConsultarCuponsAtivos.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-cupons/actions/EnviarCupomEmail.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-cupons/actions/PromocoesMCP.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-cupons/agent.mcs.yml +12 -0
- package/skills/cast-list/examples/agents/bodega-cupons/connectionreferences.mcs.yml +7 -7
- package/skills/cast-list/examples/agents/bodega-cupons/topics/ConsultarRegulamentoCupons.topic.mcs.yml +3 -3
- package/skills/cast-list/examples/agents/bodega-cupons/topics/Escalate.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-cupons/topics/Fallback.topic.mcs.yml +5 -5
- package/skills/cast-list/examples/agents/bodega-cupons/topics/Greeting.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-cupons/topics/OnError.topic.mcs.yml +7 -7
- package/skills/cast-list/examples/agents/bodega-cupons/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-devolucoes/actions/AbrirChamadoERP.mcs.yml +15 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/actions/AbrirSolicitacaoDevolucao.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-devolucoes/agent.mcs.yml +13 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/connectionreferences.mcs.yml +2 -2
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/ConsultarPoliticaDevolucoes.topic.mcs.yml +3 -3
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Escalate.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Fallback.topic.mcs.yml +5 -5
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Greeting.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/OnError.topic.mcs.yml +7 -7
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-frete/actions/EnviarOpcoesFrete.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-frete/agent.mcs.yml +7 -0
- package/skills/cast-list/examples/agents/bodega-frete/connectionreferences.mcs.yml +2 -2
- package/skills/cast-list/examples/agents/bodega-frete/topics/ConsultarTabelaFrete.topic.mcs.yml +3 -3
- package/skills/cast-list/examples/agents/bodega-frete/topics/Desambiguar.topic.mcs.yml +11 -0
- package/skills/cast-list/examples/agents/bodega-frete/topics/Fallback.topic.mcs.yml +5 -5
- package/skills/cast-list/examples/agents/bodega-frete/topics/Greeting.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-frete/topics/OnError.topic.mcs.yml +7 -7
- package/skills/cast-list/examples/agents/bodega-frete/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-loja-fisica/actions/EnviarInstrucoesRetirada.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-loja-fisica/agent.mcs.yml +12 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/connectionreferences.mcs.yml +2 -2
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/ConsultarGuiaLojaFisica.topic.mcs.yml +3 -3
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Escalate.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Fallback.topic.mcs.yml +5 -5
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Greeting.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/OnError.topic.mcs.yml +6 -6
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-orquestrador/agent.mcs.yml +2 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/actions/AbrirChamadoERP.mcs.yml +15 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/actions/EnviarResumoPedido.mcs.yml +1 -1
- package/skills/cast-list/examples/agents/bodega-pedidos/agent.mcs.yml +10 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/connectionreferences.mcs.yml +2 -2
- package/skills/cast-list/examples/agents/bodega-pedidos/topics/ConsultarPoliticasPedidos Copy.topic.mcs.yml +56 -0
- package/skills/cast-list/examples/profile.cast.yaml +28 -0
- package/skills/cast-list/references/format.md +10 -3
- package/skills/cast-list/references/keys.md +14 -1
- package/skills/cast-list/references/profile.md +35 -0
- package/skills/cast-list/scripts/build.mjs +6 -4
- package/skills/cast-list/scripts/engine.mjs +132 -129
|
@@ -1,155 +1,158 @@
|
|
|
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
|
|
4
|
-
`)}};
|
|
5
|
-
`)?
|
|
3
|
+
var Bl=Object.create;var er=Object.defineProperty;var Kl=Object.getOwnPropertyDescriptor;var Ul=Object.getOwnPropertyNames;var Yl=Object.getPrototypeOf,zl=Object.prototype.hasOwnProperty;var zt=(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 Vl=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ul(t))!zl.call(e,i)&&i!==n&&er(e,i,{get:()=>t[i],enumerable:!(s=Kl(t,i))||s.enumerable});return e};var rs=(e,t,n)=>(n=e!=null?Bl(Yl(e)):{},Vl(t||!e||!e.__esModule?er(n,"default",{value:e,enumerable:!0}):n,e));var D=C(X=>{"use strict";var as=Symbol.for("yaml.alias"),ir=Symbol.for("yaml.document"),Vt=Symbol.for("yaml.map"),rr=Symbol.for("yaml.pair"),ls=Symbol.for("yaml.scalar"),Wt=Symbol.for("yaml.seq"),ge=Symbol.for("yaml.node.type"),Ql=e=>!!e&&typeof e=="object"&&e[ge]===as,Zl=e=>!!e&&typeof e=="object"&&e[ge]===ir,ec=e=>!!e&&typeof e=="object"&&e[ge]===Vt,tc=e=>!!e&&typeof e=="object"&&e[ge]===rr,or=e=>!!e&&typeof e=="object"&&e[ge]===ls,nc=e=>!!e&&typeof e=="object"&&e[ge]===Wt;function ar(e){if(e&&typeof e=="object")switch(e[ge]){case Vt:case Wt:return!0}return!1}function sc(e){if(e&&typeof e=="object")switch(e[ge]){case as:case Vt:case ls:case Wt:return!0}return!1}var ic=e=>(or(e)||ar(e))&&!!e.anchor;X.ALIAS=as;X.DOC=ir;X.MAP=Vt;X.NODE_TYPE=ge;X.PAIR=rr;X.SCALAR=ls;X.SEQ=Wt;X.hasAnchor=ic;X.isAlias=Ql;X.isCollection=ar;X.isDocument=Zl;X.isMap=ec;X.isNode=sc;X.isPair=tc;X.isScalar=or;X.isSeq=nc});var nt=C(cs=>{"use strict";var J=D(),te=Symbol("break visit"),lr=Symbol("skip children"),de=Symbol("remove node");function Jt(e,t){let n=cr(t);J.isDocument(e)?je(null,e.contents,n,Object.freeze([e]))===de&&(e.contents=null):je(null,e,n,Object.freeze([]))}Jt.BREAK=te;Jt.SKIP=lr;Jt.REMOVE=de;function je(e,t,n,s){let i=fr(e,t,n,s);if(J.isNode(i)||J.isPair(i))return ur(e,s,i),je(e,i,n,s);if(typeof i!="symbol"){if(J.isCollection(t)){s=Object.freeze(s.concat(t));for(let r=0;r<t.items.length;++r){let o=je(r,t.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===te)return te;o===de&&(t.items.splice(r,1),r-=1)}}}else if(J.isPair(t)){s=Object.freeze(s.concat(t));let r=je("key",t.key,n,s);if(r===te)return te;r===de&&(t.key=null);let o=je("value",t.value,n,s);if(o===te)return te;o===de&&(t.value=null)}}return i}async function Gt(e,t){let n=cr(t);J.isDocument(e)?await _e(null,e.contents,n,Object.freeze([e]))===de&&(e.contents=null):await _e(null,e,n,Object.freeze([]))}Gt.BREAK=te;Gt.SKIP=lr;Gt.REMOVE=de;async function _e(e,t,n,s){let i=await fr(e,t,n,s);if(J.isNode(i)||J.isPair(i))return ur(e,s,i),_e(e,i,n,s);if(typeof i!="symbol"){if(J.isCollection(t)){s=Object.freeze(s.concat(t));for(let r=0;r<t.items.length;++r){let o=await _e(r,t.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===te)return te;o===de&&(t.items.splice(r,1),r-=1)}}}else if(J.isPair(t)){s=Object.freeze(s.concat(t));let r=await _e("key",t.key,n,s);if(r===te)return te;r===de&&(t.key=null);let o=await _e("value",t.value,n,s);if(o===te)return te;o===de&&(t.value=null)}}return i}function cr(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 fr(e,t,n,s){if(typeof n=="function")return n(e,t,s);if(J.isMap(t))return n.Map?.(e,t,s);if(J.isSeq(t))return n.Seq?.(e,t,s);if(J.isPair(t))return n.Pair?.(e,t,s);if(J.isScalar(t))return n.Scalar?.(e,t,s);if(J.isAlias(t))return n.Alias?.(e,t,s)}function ur(e,t,n){let s=t[t.length-1];if(J.isCollection(s))s.items[e]=n;else if(J.isPair(s))e==="key"?s.key=n:s.value=n;else if(J.isDocument(s))s.contents=n;else{let i=J.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}cs.visit=Jt;cs.visitAsync=Gt});var fs=C(pr=>{"use strict";var dr=D(),rc=nt(),oc={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ac=e=>e.replace(/[!,[\]{}]/g,t=>oc[t]),st=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+ac(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&&dr.isNode(t.contents)){let r={};rc.visit(t.contents,(o,a)=>{dr.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
|
+
`)}};st.defaultYaml={explicit:!1,version:"1.2"};st.defaultTags={"!!":"tag:yaml.org,2002:"};pr.Directives=st});var Xt=C(it=>{"use strict";var hr=D(),lc=nt();function cc(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 mr(e){let t=new Set;return lc.visit(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function gr(e,t){for(let n=1;;++n){let s=`${e}${n}`;if(!t.has(s))return s}}function fc(e,t){let n=[],s=new Map,i=null;return{onAnchor:r=>{n.push(r),i??(i=mr(e));let o=gr(t,i);return i.add(o),o},setAnchors:()=>{for(let r of n){let o=s.get(r);if(typeof o=="object"&&o.anchor&&(hr.isScalar(o.node)||hr.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}}it.anchorIsValid=cc;it.anchorNames=mr;it.createNodeAnchors=fc;it.findNewAnchor=gr});var us=C(yr=>{"use strict";function rt(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=rt(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=rt(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=rt(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=rt(e,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return e.call(t,n,s)}yr.applyReviver=rt});var ke=C(wr=>{"use strict";var uc=D();function br(e,t,n){if(Array.isArray(e))return e.map((s,i)=>br(s,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!uc.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}wr.toJS=br});var Ht=C(Sr=>{"use strict";var dc=us(),kr=D(),pc=ke(),ds=class{constructor(t){Object.defineProperty(this,kr.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(!kr.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=pc.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof r=="function"?dc.applyReviver(r,{"":a},"",a):a}};Sr.NodeBase=ds});var ot=C($r=>{"use strict";var hc=Xt(),mc=nt(),Be=D(),gc=Ht(),yc=ke(),ps=class extends gc.NodeBase{constructor(t){super(Be.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=[],mc.visit(t,{Node:(r,o)=>{(Be.isAlias(o)||Be.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,c=r.get(i);if(c||(yc.toJS(i,null,n),c=r.get(i)),c?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Qt(o,i,r)),c.count*c.aliasCount>a)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}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(hc.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 Qt(e,t,n){if(Be.isAlias(t)){let s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(Be.isCollection(t)){let s=0;for(let i of t.items){let r=Qt(e,i,n);r>s&&(s=r)}return s}else if(Be.isPair(t)){let s=Qt(e,t.key,n),i=Qt(e,t.value,n);return Math.max(s,i)}return 1}$r.Alias=ps});var V=C(hs=>{"use strict";var bc=D(),wc=Ht(),kc=ke(),Sc=e=>!e||typeof e!="function"&&typeof e!="object",Se=class extends wc.NodeBase{constructor(t){super(bc.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:kc.toJS(this.value,t,n)}toString(){return String(this.value)}};Se.BLOCK_FOLDED="BLOCK_FOLDED";Se.BLOCK_LITERAL="BLOCK_LITERAL";Se.PLAIN="PLAIN";Se.QUOTE_DOUBLE="QUOTE_DOUBLE";Se.QUOTE_SINGLE="QUOTE_SINGLE";hs.Scalar=Se;hs.isScalarValue=Sc});var at=C(Ar=>{"use strict";var $c=ot(),qe=D(),vr=V(),vc="tag:yaml.org,2002:";function Ac(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 Oc(e,t,n){if(qe.isDocument(e)&&(e=e.contents),qe.isNode(e))return e;if(qe.isPair(e)){let f=n.schema[qe.MAP].createNode?.(n.schema,null,n);return f.items.push(e),f}(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,c;if(s&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new $c.Alias(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=vc+t.slice(2));let l=Ac(e,t,o.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let f=new vr.Scalar(e);return c&&(c.node=f),f}l=e instanceof Map?o[qe.MAP]:Symbol.iterator in Object(e)?o[qe.SEQ]:o[qe.MAP]}r&&(r(l),delete n.onTagObj);let d=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new vr.Scalar(e);return t?d.tag=t:l.default||(d.tag=l.tag),c&&(c.node=d),d}Ar.createNode=Oc});var en=C(Zt=>{"use strict";var Nc=at(),pe=D(),Ec=Ht();function ms(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 Nc.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 Or=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,gs=class extends Ec.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=>pe.isNode(s)||pe.isPair(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Or(t))this.add(n);else{let[s,...i]=t,r=this.get(s,!0);if(pe.isCollection(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,ms(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(pe.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&&pe.isScalar(r)?r.value:r:pe.isCollection(r)?r.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!pe.isPair(n))return!1;let s=n.value;return s==null||t&&pe.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 pe.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(pe.isCollection(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,ms(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};Zt.Collection=gs;Zt.collectionFromPath=ms;Zt.isEmptyPath=Or});var lt=C(tn=>{"use strict";var xc=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ys(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Cc=(e,t,n)=>e.endsWith(`
|
|
5
|
+
`)?ys(n,t):n.includes(`
|
|
6
6
|
`)?`
|
|
7
|
-
`+
|
|
8
|
-
`)n===
|
|
9
|
-
`&&
|
|
10
|
-
`&&
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
`);s=
|
|
14
|
-
`){if(
|
|
7
|
+
`+ys(n,t):(e.endsWith(" ")?"":" ")+n;tn.indentComment=ys;tn.lineComment=Cc;tn.stringifyComment=xc});var Er=C(ct=>{"use strict";var Tc="flow",bs="block",nn="quoted";function qc(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 c=Math.max(1+r,1+i-t.length);if(e.length<=c)return e;let l=[],d={},f=i-t.length;typeof s=="number"&&(s>i-Math.max(2,r)?l.push(0):f=i-s);let u,p,y=!1,g=-1,w=-1,N=-1;n===bs&&(g=Nr(e,g,t.length),g!==-1&&(f=g+c));for(let k;k=e[g+=1];){if(n===nn&&k==="\\"){switch(w=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}N=g}if(k===`
|
|
8
|
+
`)n===bs&&(g=Nr(e,g,t.length)),f=g+t.length+c,u=void 0;else{if(k===" "&&p&&p!==" "&&p!==`
|
|
9
|
+
`&&p!==" "){let x=e[g+1];x&&x!==" "&&x!==`
|
|
10
|
+
`&&x!==" "&&(u=g)}if(g>=f)if(u)l.push(u),f=u+c,u=void 0;else if(n===nn){for(;p===" "||p===" ";)p=k,k=e[g+=1],y=!0;let x=g>N+1?g-2:w-1;if(d[x])return e;l.push(x),d[x]=!0,f=x+c,u=void 0}else y=!0}p=k}if(y&&a&&a(),l.length===0)return e;o&&o();let h=e.slice(0,l[0]);for(let k=0;k<l.length;++k){let x=l[k],S=l[k+1]||e.length;x===0?h=`
|
|
11
|
+
${t}${e.slice(0,S)}`:(n===nn&&d[x]&&(h+=`${e[x]}\\`),h+=`
|
|
12
|
+
${t}${e.slice(x+1,S)}`)}return h}function Nr(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}ct.FOLD_BLOCK=bs;ct.FOLD_FLOW=Tc;ct.FOLD_QUOTED=nn;ct.foldFlowLines=qc});var ut=C(xr=>{"use strict";var ce=V(),$e=Er(),rn=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),on=e=>/^(%|---|\.\.\.)/m.test(e);function Pc(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 ft(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(on(e)?" ":""),o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let d=n.substr(c+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(c,6)}c+=5,a=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<i)c+=1;else{for(o+=n.slice(a,c)+`
|
|
15
15
|
|
|
16
|
-
`;n[
|
|
17
|
-
`,
|
|
18
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
19
|
-
${n}`)+"'";return
|
|
16
|
+
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
17
|
+
`,c+=2;o+=r,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,s?o:$e.foldFlowLines(o,r,$e.FOLD_QUOTED,rn(t,!1))}function ws(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return ft(e,t);let n=t.indent||(on(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${n}`)+"'";return t.implicitKey?s:$e.foldFlowLines(s,n,$e.FOLD_FLOW,rn(t,!1))}function Ke(e,t){let{singleQuote:n}=t.options,s;if(n===!1)s=ft;else{let i=e.includes('"'),r=e.includes("'");i&&!r?s=ws:r&&!i?s=ft:s=n?ws:ft}return s(e,t)}var ks;try{ks=new RegExp(`(^|(?<!
|
|
20
20
|
))
|
|
21
21
|
+(?!
|
|
22
|
-
|$)`,"g")}catch{
|
|
22
|
+
|$)`,"g")}catch{ks=/\n+(?!\n|$)/g}function sn({comment:e,type:t,value:n},s,i,r){let{blockQuote:o,commentString:a,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return Ke(n,s);let l=s.indent||(s.forceBlockIndent||on(n)?" ":""),d=o==="literal"?!0:o==="folded"||t===ce.Scalar.BLOCK_FOLDED?!1:t===ce.Scalar.BLOCK_LITERAL?!0:!Pc(n,c,l.length);if(!n)return d?`|
|
|
23
23
|
`:`>
|
|
24
|
-
`;let u
|
|
25
|
-
`&&S!==" "&&S!==" ")break}let
|
|
26
|
-
`);
|
|
27
|
-
`&&(
|
|
28
|
-
`)
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
-
`)||
|
|
33
|
-
`)?
|
|
34
|
-
`))return
|
|
35
|
-
${
|
|
36
|
-
${
|
|
37
|
-
${a}:`):(
|
|
38
|
-
`:""
|
|
39
|
-
${
|
|
40
|
-
`&&
|
|
24
|
+
`;let f,u;for(u=n.length;u>0;--u){let S=n[u-1];if(S!==`
|
|
25
|
+
`&&S!==" "&&S!==" ")break}let p=n.substring(u),y=p.indexOf(`
|
|
26
|
+
`);y===-1?f="-":n===p||y!==p.length-1?(f="+",r&&r()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
27
|
+
`&&(p=p.slice(0,-1)),p=p.replace(ks,`$&${l}`));let g=!1,w,N=-1;for(w=0;w<n.length;++w){let S=n[w];if(S===" ")g=!0;else if(S===`
|
|
28
|
+
`)N=w;else break}let h=n.substring(0,N<w?N+1:w);h&&(n=n.substring(h.length),h=h.replace(/\n+/g,`$&${l}`));let x=(g?l?"2":"1":"")+f;if(e&&(x+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){let S=n.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),O=!1,q=rn(s,!0);o!=="folded"&&t!==ce.Scalar.BLOCK_FOLDED&&(q.onOverflow=()=>{O=!0});let E=$e.foldFlowLines(`${h}${S}${p}`,l,$e.FOLD_BLOCK,q);if(!O)return`>${x}
|
|
30
|
+
${l}${E}`}return n=n.replace(/\n+/g,`$&${l}`),`|${x}
|
|
31
|
+
${l}${h}${n}${p}`}function Mc(e,t,n,s){let{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:d}=t;if(a&&r.includes(`
|
|
32
|
+
`)||d&&/[[\]{},]/.test(r))return Ke(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
|
|
33
|
+
`)?Ke(r,t):sn(e,t,n,s);if(!a&&!d&&i!==ce.Scalar.PLAIN&&r.includes(`
|
|
34
|
+
`))return sn(e,t,n,s);if(on(r)){if(c==="")return t.forceBlockIndent=!0,sn(e,t,n,s);if(a&&c===l)return Ke(r,t)}let f=r.replace(/\n+/g,`$&
|
|
35
|
+
${c}`);if(o){let u=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(f),{compat:p,tags:y}=t.doc.schema;if(y.some(u)||p?.some(u))return Ke(r,t)}return a?f:$e.foldFlowLines(f,c,$e.FOLD_FLOW,rn(t,!1))}function Lc(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!==ce.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ce.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case ce.Scalar.BLOCK_FOLDED:case ce.Scalar.BLOCK_LITERAL:return i||r?Ke(o.value,t):sn(o,t,n,s);case ce.Scalar.QUOTE_DOUBLE:return ft(o.value,t);case ce.Scalar.QUOTE_SINGLE:return ws(o.value,t);case ce.Scalar.PLAIN:return Mc(o,t,n,s);default:return null}},l=c(a);if(l===null){let{defaultKeyType:d,defaultStringType:f}=t.options,u=i&&d||f;if(l=c(u),l===null)throw new Error(`Unsupported default string type ${u}`)}return l}xr.stringifyString=Lc});var dt=C(Ss=>{"use strict";var Ic=Xt(),ve=D(),Rc=lt(),Dc=ut();function Fc(e,t){let n=Object.assign({blockQuote:!0,commentString:Rc.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 jc(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(ve.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 _c(e,t,{anchors:n,doc:s}){if(!s.directives)return"";let i=[],r=(ve.isScalar(e)||ve.isCollection(e))&&e.anchor;r&&Ic.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 Bc(e,t,n,s){if(ve.isPair(e))return e.toString(t,n,s);if(ve.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=ve.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=jc(t.doc.schema.tags,r));let o=_c(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):ve.isScalar(r)?Dc.stringifyString(r,t,n,s):r.toString(t,n,s);return o?ve.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
36
|
+
${t.indent}${a}`:a}Ss.createStringifyContext=Fc;Ss.stringify=Bc});var Pr=C(qr=>{"use strict";var ye=D(),Cr=V(),Tr=dt(),pt=lt();function Kc({key:e,value:t},n,s,i){let{allNullValues:r,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:f}}=n,u=ye.isNode(e)&&e.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(ye.isCollection(e)||!ye.isNode(e)&&typeof e=="object"){let q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let p=!f&&(!e||u&&t==null&&!n.inFlow||ye.isCollection(e)||(ye.isScalar(e)?e.type===Cr.Scalar.BLOCK_FOLDED||e.type===Cr.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:a+c});let y=!1,g=!1,w=Tr.stringify(e,n,()=>y=!0,()=>g=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(r||t==null)return y&&s&&s(),w===""?"?":p?`? ${w}`:w}else if(r&&!f||t==null&&p)return w=`? ${w}`,u&&!y?w+=pt.lineComment(w,n.indent,l(u)):g&&i&&i(),w;y&&(u=null),p?(u&&(w+=pt.lineComment(w,n.indent,l(u))),w=`? ${w}
|
|
37
|
+
${a}:`):(w=`${w}:`,u&&(w+=pt.lineComment(w,n.indent,l(u))));let N,h,k;ye.isNode(t)?(N=!!t.spaceBefore,h=t.commentBefore,k=t.comment):(N=!1,h=null,k=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!u&&ye.isScalar(t)&&(n.indentAtStart=w.length+1),g=!1,!d&&c.length>=2&&!n.inFlow&&!p&&ye.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let x=!1,S=Tr.stringify(t,n,()=>x=!0,()=>g=!0),O=" ";if(u||N||h){if(O=N?`
|
|
38
|
+
`:"",h){let q=l(h);O+=`
|
|
39
|
+
${pt.indentComment(q,n.indent)}`}S===""&&!n.inFlow?O===`
|
|
40
|
+
`&&k&&(O=`
|
|
41
41
|
|
|
42
|
-
`):
|
|
43
|
-
${n.indent}`}else if(!
|
|
44
|
-
`),
|
|
42
|
+
`):O+=`
|
|
43
|
+
${n.indent}`}else if(!p&&ye.isCollection(t)){let q=S[0],E=S.indexOf(`
|
|
44
|
+
`),I=E!==-1,b=n.inFlow??t.flow??t.items.length===0;if(I||!b){let m=!1;if(I&&(q==="&"||q==="!")){let v=S.indexOf(" ");q==="&"&&v!==-1&&v<E&&S[v+1]==="!"&&(v=S.indexOf(" ",v+1)),(v===-1||E<v)&&(m=!0)}m||(O=`
|
|
45
45
|
${n.indent}`)}}else(S===""||S[0]===`
|
|
46
|
-
`)&&(
|
|
47
|
-
${
|
|
48
|
-
`}}return
|
|
49
|
-
`+
|
|
50
|
-
`)),
|
|
51
|
-
${
|
|
52
|
-
`;return`${
|
|
53
|
-
${
|
|
54
|
-
`:" ")}return
|
|
55
|
-
${
|
|
56
|
-
${i.comment}`:s.comment}s=r}t.items[n]=dn.isPair(s)?s:new Ts.Pair(s)}}else e("Expected a sequence for this tag");return t}function Zi(t,e,n){let{replacer:s}=n,r=new yf.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;r.items.push(Ts.createPair(a,l,n))}return r}var bf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Qi,createNode:Zi};pn.createPairs=Zi;pn.pairs=bf;pn.resolvePairs=Qi});var xs=O(Ls=>{"use strict";var eo=M(),Ps=fe(),it=ge(),wf=ye(),to=hn(),$e=class t extends wf.YAMLSeq{constructor(){super(),this.add=it.YAMLMap.prototype.add.bind(this),this.delete=it.YAMLMap.prototype.delete.bind(this),this.get=it.YAMLMap.prototype.get.bind(this),this.has=it.YAMLMap.prototype.has.bind(this),this.set=it.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let s=new Map;n?.onCreate&&n.onCreate(s);for(let r of this.items){let i,o;if(eo.isPair(r)?(i=Ps.toJS(r.key,"",n),o=Ps.toJS(r.value,i,n)):i=Ps.toJS(r,"",n),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(e,n,s){let r=to.createPairs(e,n,s),i=new this;return i.items=r.items,i}};$e.tag="tag:yaml.org,2002:omap";var kf={collection:"seq",identify:t=>t instanceof Map,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=to.resolvePairs(t,e),s=[];for(let{key:r}of n.items)eo.isScalar(r)&&(s.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new $e,n)},createNode:(t,e,n)=>$e.from(t,e,n)};Ls.YAMLOMap=$e;Ls.omap=kf});var oo=O(Ms=>{"use strict";var no=j();function so({value:t,source:e},n){return e&&(t?ro:io).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var ro={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new no.Scalar(!0),stringify:so},io={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new no.Scalar(!1),stringify:so};Ms.falseTag=io;Ms.trueTag=ro});var ao=O(mn=>{"use strict";var Sf=j(),Is=Ie(),vf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Is.stringifyNumber},$f={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Is.stringifyNumber(t)}},Af={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Sf.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let s=t.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Is.stringifyNumber};mn.float=Af;mn.floatExp=$f;mn.floatNaN=vf});var co=O(at=>{"use strict";var lo=Ie(),ot=t=>typeof t=="bigint"||Number.isInteger(t);function gn(t,e,n,{intAsBigInt:s}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return r==="-"?-1*i:i}function Ds(t,e,n){let{value:s}=t;if(ot(s)){let r=s.toString(e);return s<0?"-"+n+r.substr(1):n+r}return lo.stringifyNumber(t)}var Of={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>gn(t,2,2,n),stringify:t=>Ds(t,2,"0b")},Nf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>gn(t,1,8,n),stringify:t=>Ds(t,8,"0")},Ef={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>gn(t,0,10,n),stringify:lo.stringifyNumber},Cf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>gn(t,2,16,n),stringify:t=>Ds(t,16,"0x")};at.int=Ef;at.intBin=Of;at.intHex=Cf;at.intOct=Nf});var _s=O(Rs=>{"use strict";var wn=M(),yn=he(),bn=ge(),Ae=class t extends bn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;wn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new yn.Pair(e.key,null):n=new yn.Pair(e,null),bn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let s=bn.findPair(this.items,e);return!n&&wn.isPair(s)?wn.isScalar(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let s=bn.findPair(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new yn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),i.items.push(yn.createPair(o,null,s));return i}};Ae.tag="tag:yaml.org,2002:set";var qf={collection:"map",identify:t=>t instanceof Set,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ae.from(t,e,n),resolve(t,e){if(wn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ae,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Rs.YAMLSet=Ae;Rs.set=qf});var js=O(kn=>{"use strict";var Tf=Ie();function Fs(t,e){let n=t[0],s=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),i=s.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*i:i}function fo(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Tf.stringifyNumber(t);let s="";e<0&&(s="-",e*=n(-1));let r=n(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),s+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Pf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Fs(t,n),stringify:fo},Lf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Fs(t,!1),stringify:fo},uo={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(uo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,s,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,s-1,r,i||0,o||0,a||0,l),p=e[8];if(p&&p!=="Z"){let u=Fs(p,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};kn.floatTime=Lf;kn.intTime=Pf;kn.timestamp=uo});var mo=O(ho=>{"use strict";var xf=xe(),Mf=an(),If=Me(),Df=st(),Rf=qs(),po=oo(),Bs=ao(),Sn=co(),_f=Qt(),Ff=xs(),jf=hn(),Bf=_s(),Ks=js(),Kf=[xf.map,If.seq,Df.string,Mf.nullTag,po.trueTag,po.falseTag,Sn.intBin,Sn.intOct,Sn.int,Sn.intHex,Bs.floatNaN,Bs.floatExp,Bs.float,Rf.binary,_f.merge,Ff.omap,jf.pairs,Bf.set,Ks.intTime,Ks.floatTime,Ks.timestamp];ho.schema=Kf});var Oo=O(zs=>{"use strict";var wo=xe(),Uf=an(),ko=Me(),Yf=st(),zf=Ss(),Us=$s(),Ys=Os(),Vf=Ji(),Jf=Xi(),So=qs(),lt=Qt(),vo=xs(),$o=hn(),go=mo(),Ao=_s(),vn=js(),yo=new Map([["core",Vf.schema],["failsafe",[wo.map,ko.seq,Yf.string]],["json",Jf.schema],["yaml11",go.schema],["yaml-1.1",go.schema]]),bo={binary:So.binary,bool:zf.boolTag,float:Us.float,floatExp:Us.floatExp,floatNaN:Us.floatNaN,floatTime:vn.floatTime,int:Ys.int,intHex:Ys.intHex,intOct:Ys.intOct,intTime:vn.intTime,map:wo.map,merge:lt.merge,null:Uf.nullTag,omap:vo.omap,pairs:$o.pairs,seq:ko.seq,set:Ao.set,timestamp:vn.timestamp},Wf={"tag:yaml.org,2002:binary":So.binary,"tag:yaml.org,2002:merge":lt.merge,"tag:yaml.org,2002:omap":vo.omap,"tag:yaml.org,2002:pairs":$o.pairs,"tag:yaml.org,2002:set":Ao.set,"tag:yaml.org,2002:timestamp":vn.timestamp};function Gf(t,e,n){let s=yo.get(e);if(s&&!t)return n&&!s.includes(lt.merge)?s.concat(lt.merge):s.slice();let r=s;if(!r)if(Array.isArray(t))r=[];else{let i=Array.from(yo.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)r=r.concat(i);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(lt.merge)),r.reduce((i,o)=>{let a=typeof o=="string"?bo[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(bo).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}zs.coreKnownTags=Wf;zs.getTags=Gf});var Ws=O(No=>{"use strict";var Vs=M(),Xf=xe(),Hf=Me(),Qf=st(),$n=Oo(),Zf=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Js=class t{constructor({compat:e,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?$n.getTags(e,"compat"):e?$n.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?$n.coreKnownTags:{},this.tags=$n.getTags(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Vs.MAP,{value:Xf.map}),Object.defineProperty(this,Vs.SCALAR,{value:Qf.string}),Object.defineProperty(this,Vs.SEQ,{value:Hf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Zf:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};No.Schema=Js});var Co=O(Eo=>{"use strict";var eu=M(),Gs=et(),ct=Xe();function tu(t,e){let n=[],s=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),s=!0):t.directives.docStart&&(s=!0)}s&&n.push("---");let r=Gs.createStringifyContext(t,e),{commentString:i}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=i(t.commentBefore);n.unshift(ct.indentComment(l,""))}let o=!1,a=null;if(t.contents){if(eu.isNode(t.contents)){if(t.contents.spaceBefore&&s&&n.push(""),t.contents.commentBefore){let p=i(t.contents.commentBefore);n.push(ct.indentComment(p,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>o=!0,c=Gs.stringify(t.contents,r,()=>a=null,l);a&&(c+=ct.lineComment(c,"",i(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Gs.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let l=i(t.comment);l.includes(`
|
|
57
|
-
`)?(n.push("..."),n.push(
|
|
46
|
+
`)&&(O="");return w+=O+S,n.inFlow?x&&s&&s():k&&!x?w+=pt.lineComment(w,n.indent,l(k)):g&&i&&i(),w}qr.stringifyPair=Kc});var vs=C($s=>{"use strict";var Mr=zt("process");function Uc(e,...t){e==="debug"&&console.log(...t)}function Yc(e,t){(e==="debug"||e==="warn")&&(typeof Mr.emitWarning=="function"?Mr.emitWarning(t):console.warn(t))}$s.debug=Uc;$s.warn=Yc});var un=C(fn=>{"use strict";var cn=D(),Lr=V(),an="<<",ln={identify:e=>e===an||typeof e=="symbol"&&e.description===an,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Lr.Scalar(Symbol(an)),{addToJSMap:Ir}),stringify:()=>an},zc=(e,t)=>(ln.identify(t)||cn.isScalar(t)&&(!t.type||t.type===Lr.Scalar.PLAIN)&&ln.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===ln.tag&&n.default);function Ir(e,t,n){let s=Rr(e,n);if(cn.isSeq(s))for(let i of s.items)As(e,t,i);else if(Array.isArray(s))for(let i of s)As(e,t,i);else As(e,t,s)}function As(e,t,n){let s=Rr(e,n);if(!cn.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 Rr(e,t){return e&&cn.isAlias(t)?t.resolve(e.doc,e):t}fn.addMergeToJSMap=Ir;fn.isMergeKey=zc;fn.merge=ln});var Ns=C(jr=>{"use strict";var Vc=vs(),Dr=un(),Wc=dt(),Fr=D(),Os=ke();function Jc(e,t,{key:n,value:s}){if(Fr.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(Dr.isMergeKey(e,n))Dr.addMergeToJSMap(e,t,s);else{let i=Os.toJS(n,"",e);if(t instanceof Map)t.set(i,Os.toJS(s,i,e));else if(t instanceof Set)t.add(i);else{let r=Gc(n,i,e),o=Os.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 Gc(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Fr.isNode(e)&&n?.doc){let s=Wc.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)+'..."'),Vc.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)}jr.addPairToJSMap=Jc});var Ae=C(Es=>{"use strict";var _r=at(),Xc=Pr(),Hc=Ns(),dn=D();function Qc(e,t,n){let s=_r.createNode(e,void 0,n),i=_r.createNode(t,void 0,n);return new pn(s,i)}var pn=class e{constructor(t,n=null){Object.defineProperty(this,dn.NODE_TYPE,{value:dn.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return dn.isNode(n)&&(n=n.clone(t)),dn.isNode(s)&&(s=s.clone(t)),new e(n,s)}toJSON(t,n){let s=n?.mapAsMap?new Map:{};return Hc.addPairToJSMap(n,s,this)}toString(t,n,s){return t?.doc?Xc.stringifyPair(this,t,n,s):JSON.stringify(this)}};Es.Pair=pn;Es.createPair=Qc});var xs=C(Kr=>{"use strict";var Pe=D(),Br=dt(),hn=lt();function Zc(e,t,n){return(t.inFlow??e.flow?tf:ef)(e,t,n)}function ef({comment:e,items:t},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,d=Object.assign({},n,{indent:r,type:null}),f=!1,u=[];for(let y=0;y<t.length;++y){let g=t[y],w=null;if(Pe.isNode(g))!f&&g.spaceBefore&&u.push(""),mn(n,u,g.commentBefore,f),g.comment&&(w=g.comment);else if(Pe.isPair(g)){let h=Pe.isNode(g.key)?g.key:null;h&&(!f&&h.spaceBefore&&u.push(""),mn(n,u,h.commentBefore,f))}f=!1;let N=Br.stringify(g,d,()=>w=null,()=>f=!0);w&&(N+=hn.lineComment(N,r,l(w))),f&&w&&(f=!1),u.push(s+N)}let p;if(u.length===0)p=i.start+i.end;else{p=u[0];for(let y=1;y<u.length;++y){let g=u[y];p+=g?`
|
|
47
|
+
${c}${g}`:`
|
|
48
|
+
`}}return e?(p+=`
|
|
49
|
+
`+hn.indentComment(l(e),c),a&&a()):f&&o&&o(),p}function tf({items:e},t,{flowChars:n,itemIndent:s}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;s+=r;let c=Object.assign({},t,{indent:s,inFlow:!0,type:null}),l=!1,d=0,f=[];for(let y=0;y<e.length;++y){let g=e[y],w=null;if(Pe.isNode(g))g.spaceBefore&&f.push(""),mn(t,f,g.commentBefore,!1),g.comment&&(w=g.comment);else if(Pe.isPair(g)){let h=Pe.isNode(g.key)?g.key:null;h&&(h.spaceBefore&&f.push(""),mn(t,f,h.commentBefore,!1),h.comment&&(l=!0));let k=Pe.isNode(g.value)?g.value:null;k?(k.comment&&(w=k.comment),k.commentBefore&&(l=!0)):g.value==null&&h?.comment&&(w=h.comment)}w&&(l=!0);let N=Br.stringify(g,c,()=>w=null);l||(l=f.length>d||N.includes(`
|
|
50
|
+
`)),y<e.length-1?N+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=f.reduce((h,k)=>h+k.length+2,2)+(N.length+2)>t.options.lineWidth)),l&&(N+=",")),w&&(N+=hn.lineComment(N,s,a(w))),f.push(N),d=f.length}let{start:u,end:p}=n;if(f.length===0)return u+p;if(!l){let y=f.reduce((g,w)=>g+w.length+2,2);l=t.options.lineWidth>0&&y>t.options.lineWidth}if(l){let y=u;for(let g of f)y+=g?`
|
|
51
|
+
${r}${i}${g}`:`
|
|
52
|
+
`;return`${y}
|
|
53
|
+
${i}${p}`}else return`${u}${o}${f.join(" ")}${o}${p}`}function mn({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let r=hn.indentComment(t(s),e);n.push(r.trimStart())}}Kr.stringifyCollection=Zc});var Ne=C(Ts=>{"use strict";var nf=xs(),sf=Ns(),rf=en(),Oe=D(),gn=Ae(),of=V();function ht(e,t){let n=Oe.isScalar(t)?t.value:t;for(let s of e)if(Oe.isPair(s)&&(s.key===t||s.key===n||Oe.isScalar(s.key)&&s.key.value===n))return s}var Cs=class extends rf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Oe.MAP,t),this.items=[]}static from(t,n,s){let{keepUndefined:i,replacer:r}=s,o=new this(t),a=(c,l)=>{if(typeof r=="function")l=r.call(n,c,l);else if(Array.isArray(r)&&!r.includes(c))return;(l!==void 0||i)&&o.items.push(gn.createPair(c,l,s))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let s;Oe.isPair(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new gn.Pair(t,t?.value):s=new gn.Pair(t.key,t.value);let i=ht(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);Oe.isScalar(i.value)&&of.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=ht(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=ht(this.items,t)?.value;return(!n&&Oe.isScalar(i)?i.value:i)??void 0}has(t){return!!ht(this.items,t)}set(t,n){this.add(new gn.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)sf.addPairToJSMap(n,i,r);return i}toString(t,n,s){if(!t)return JSON.stringify(this);for(let i of this.items)if(!Oe.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})),nf.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};Ts.YAMLMap=Cs;Ts.findPair=ht});var Ue=C(Yr=>{"use strict";var af=D(),Ur=Ne(),lf={collection:"map",default:!0,nodeClass:Ur.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return af.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ur.YAMLMap.from(e,t,n)};Yr.map=lf});var Ee=C(zr=>{"use strict";var cf=at(),ff=xs(),uf=en(),bn=D(),df=V(),pf=ke(),qs=class extends uf.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(bn.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=yn(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let s=yn(t);if(typeof s!="number")return;let i=this.items[s];return!n&&bn.isScalar(i)?i.value:i}has(t){let n=yn(t);return typeof n=="number"&&n<this.items.length}set(t,n){let s=yn(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[s];bn.isScalar(i)&&df.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(pf.toJS(r,String(i++),n));return s}toString(t,n,s){return t?ff.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 c=n instanceof Set?a:String(o++);a=i.call(n,c,a)}r.items.push(cf.createNode(a,void 0,s))}}return r}};function yn(e){let t=bn.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=qs});var Ye=C(Wr=>{"use strict";var hf=D(),Vr=Ee(),mf={collection:"seq",default:!0,nodeClass:Vr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return hf.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Vr.YAMLSeq.from(e,t,n)};Wr.seq=mf});var mt=C(Jr=>{"use strict";var gf=ut(),yf={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),gf.stringifyString(e,t,n,s)}};Jr.string=yf});var wn=C(Hr=>{"use strict";var Gr=V(),Xr={identify:e=>e==null,createNode:()=>new Gr.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Gr.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Xr.test.test(e)?e:t.options.nullStr};Hr.nullTag=Xr});var Ps=C(Zr=>{"use strict";var bf=V(),Qr={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new bf.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Qr.test.test(e)){let s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};Zr.boolTag=Qr});var ze=C(eo=>{"use strict";function wf({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}eo.stringifyNumber=wf});var Ls=C(kn=>{"use strict";var kf=V(),Ms=ze(),Sf={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:Ms.stringifyNumber},$f={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():Ms.stringifyNumber(e)}},vf={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 kf.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ms.stringifyNumber};kn.float=vf;kn.floatExp=$f;kn.floatNaN=Sf});var Rs=C($n=>{"use strict";var to=ze(),Sn=e=>typeof e=="bigint"||Number.isInteger(e),Is=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function no(e,t,n){let{value:s}=e;return Sn(s)&&s>=0?n+s.toString(t):to.stringifyNumber(e)}var Af={identify:e=>Sn(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Is(e,2,8,n),stringify:e=>no(e,8,"0o")},Of={identify:Sn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Is(e,0,10,n),stringify:to.stringifyNumber},Nf={identify:e=>Sn(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Is(e,2,16,n),stringify:e=>no(e,16,"0x")};$n.int=Of;$n.intHex=Nf;$n.intOct=Af});var io=C(so=>{"use strict";var Ef=Ue(),xf=wn(),Cf=Ye(),Tf=mt(),qf=Ps(),Ds=Ls(),Fs=Rs(),Pf=[Ef.map,Cf.seq,Tf.string,xf.nullTag,qf.boolTag,Fs.intOct,Fs.int,Fs.intHex,Ds.floatNaN,Ds.floatExp,Ds.float];so.schema=Pf});var ao=C(oo=>{"use strict";var Mf=V(),Lf=Ue(),If=Ye();function ro(e){return typeof e=="bigint"||Number.isInteger(e)}var vn=({value:e})=>JSON.stringify(e),Rf=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:vn},{identify:e=>e==null,createNode:()=>new Mf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vn},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:vn},{identify:ro,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})=>ro(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:vn}],Df={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Ff=[Lf.map,If.seq].concat(Rf,Df);oo.schema=Ff});var _s=C(lo=>{"use strict";var gt=zt("buffer"),js=V(),jf=ut(),_f={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof gt.Buffer=="function")return gt.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 gt.Buffer=="function")a=o instanceof gt.Buffer?o.toString("base64"):gt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=js.Scalar.BLOCK_LITERAL),t!==js.Scalar.QUOTE_DOUBLE){let c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),l=Math.ceil(a.length/c),d=new Array(l);for(let f=0,u=0;f<l;++f,u+=c)d[f]=a.substr(u,c);a=d.join(t===js.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return jf.stringifyString({comment:e,type:t,value:a},s,i,r)}};lo.binary=_f});var Nn=C(On=>{"use strict";var An=D(),Bs=Ae(),Bf=V(),Kf=Ee();function co(e,t){if(An.isSeq(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!An.isPair(s)){if(An.isMap(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");let i=s.items[0]||new Bs.Pair(new Bf.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]=An.isPair(s)?s:new Bs.Pair(s)}}else t("Expected a sequence for this tag");return e}function fo(e,t,n){let{replacer:s}=n,i=new Kf.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,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;i.items.push(Bs.createPair(a,c,n))}return i}var Uf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:co,createNode:fo};On.createPairs=fo;On.pairs=Uf;On.resolvePairs=co});var Ys=C(Us=>{"use strict";var uo=D(),Ks=ke(),yt=Ne(),Yf=Ee(),po=Nn(),Me=class e extends Yf.YAMLSeq{constructor(){super(),this.add=yt.YAMLMap.prototype.add.bind(this),this.delete=yt.YAMLMap.prototype.delete.bind(this),this.get=yt.YAMLMap.prototype.get.bind(this),this.has=yt.YAMLMap.prototype.has.bind(this),this.set=yt.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(uo.isPair(i)?(r=Ks.toJS(i.key,"",n),o=Ks.toJS(i.value,r,n)):r=Ks.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=po.createPairs(t,n,s),r=new this;return r.items=i.items,r}};Me.tag="tag:yaml.org,2002:omap";var zf={collection:"seq",identify:e=>e instanceof Map,nodeClass:Me,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=po.resolvePairs(e,t),s=[];for(let{key:i}of n.items)uo.isScalar(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new Me,n)},createNode:(e,t,n)=>Me.from(e,t,n)};Us.YAMLOMap=Me;Us.omap=zf});var bo=C(zs=>{"use strict";var ho=V();function mo({value:e,source:t},n){return t&&(e?go:yo).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var go={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 ho.Scalar(!0),stringify:mo},yo={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 ho.Scalar(!1),stringify:mo};zs.falseTag=yo;zs.trueTag=go});var wo=C(En=>{"use strict";var Vf=V(),Vs=ze(),Wf={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:Vs.stringifyNumber},Jf={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():Vs.stringifyNumber(e)}},Gf={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 Vf.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:Vs.stringifyNumber};En.float=Gf;En.floatExp=Jf;En.floatNaN=Wf});var So=C(wt=>{"use strict";var ko=ze(),bt=e=>typeof e=="bigint"||Number.isInteger(e);function xn(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 Ws(e,t,n){let{value:s}=e;if(bt(s)){let i=s.toString(t);return s<0?"-"+n+i.substr(1):n+i}return ko.stringifyNumber(e)}var Xf={identify:bt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>xn(e,2,2,n),stringify:e=>Ws(e,2,"0b")},Hf={identify:bt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>xn(e,1,8,n),stringify:e=>Ws(e,8,"0")},Qf={identify:bt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>xn(e,0,10,n),stringify:ko.stringifyNumber},Zf={identify:bt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>xn(e,2,16,n),stringify:e=>Ws(e,16,"0x")};wt.int=Qf;wt.intBin=Xf;wt.intHex=Zf;wt.intOct=Hf});var Gs=C(Js=>{"use strict";var qn=D(),Cn=Ae(),Tn=Ne(),Le=class e extends Tn.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;qn.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Cn.Pair(t.key,null):n=new Cn.Pair(t,null),Tn.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let s=Tn.findPair(this.items,t);return!n&&qn.isPair(s)?qn.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=Tn.findPair(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Cn.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(Cn.createPair(o,null,s));return r}};Le.tag="tag:yaml.org,2002:set";var eu={collection:"map",identify:e=>e instanceof Set,nodeClass:Le,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Le.from(e,t,n),resolve(e,t){if(qn.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Le,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Js.YAMLSet=Le;Js.set=eu});var Hs=C(Pn=>{"use strict";var tu=ze();function Xs(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 $o(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return tu.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 nu={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})=>Xs(e,n),stringify:$o},su={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=>Xs(e,!1),stringify:$o},vo={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(vo.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),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,s-1,i,r||0,o||0,a||0,c),d=t[8];if(d&&d!=="Z"){let f=Xs(d,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Pn.floatTime=su;Pn.intTime=nu;Pn.timestamp=vo});var No=C(Oo=>{"use strict";var iu=Ue(),ru=wn(),ou=Ye(),au=mt(),lu=_s(),Ao=bo(),Qs=wo(),Mn=So(),cu=un(),fu=Ys(),uu=Nn(),du=Gs(),Zs=Hs(),pu=[iu.map,ou.seq,au.string,ru.nullTag,Ao.trueTag,Ao.falseTag,Mn.intBin,Mn.intOct,Mn.int,Mn.intHex,Qs.floatNaN,Qs.floatExp,Qs.float,lu.binary,cu.merge,fu.omap,uu.pairs,du.set,Zs.intTime,Zs.floatTime,Zs.timestamp];Oo.schema=pu});var Ro=C(ni=>{"use strict";var To=Ue(),hu=wn(),qo=Ye(),mu=mt(),gu=Ps(),ei=Ls(),ti=Rs(),yu=io(),bu=ao(),Po=_s(),kt=un(),Mo=Ys(),Lo=Nn(),Eo=No(),Io=Gs(),Ln=Hs(),xo=new Map([["core",yu.schema],["failsafe",[To.map,qo.seq,mu.string]],["json",bu.schema],["yaml11",Eo.schema],["yaml-1.1",Eo.schema]]),Co={binary:Po.binary,bool:gu.boolTag,float:ei.float,floatExp:ei.floatExp,floatNaN:ei.floatNaN,floatTime:Ln.floatTime,int:ti.int,intHex:ti.intHex,intOct:ti.intOct,intTime:Ln.intTime,map:To.map,merge:kt.merge,null:hu.nullTag,omap:Mo.omap,pairs:Lo.pairs,seq:qo.seq,set:Io.set,timestamp:Ln.timestamp},wu={"tag:yaml.org,2002:binary":Po.binary,"tag:yaml.org,2002:merge":kt.merge,"tag:yaml.org,2002:omap":Mo.omap,"tag:yaml.org,2002:pairs":Lo.pairs,"tag:yaml.org,2002:set":Io.set,"tag:yaml.org,2002:timestamp":Ln.timestamp};function ku(e,t,n){let s=xo.get(t);if(s&&!e)return n&&!s.includes(kt.merge)?s.concat(kt.merge):s.slice();let i=s;if(!i)if(Array.isArray(e))i=[];else{let r=Array.from(xo.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(kt.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Co[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(Co).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return r.includes(a)||r.push(a),r},[])}ni.coreKnownTags=wu;ni.getTags=ku});var ri=C(Do=>{"use strict";var si=D(),Su=Ue(),$u=Ye(),vu=mt(),In=Ro(),Au=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,ii=class e{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?In.getTags(t,"compat"):t?In.getTags(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?In.coreKnownTags:{},this.tags=In.getTags(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,si.MAP,{value:Su.map}),Object.defineProperty(this,si.SCALAR,{value:vu.string}),Object.defineProperty(this,si.SEQ,{value:$u.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Au:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};Do.Schema=ii});var jo=C(Fo=>{"use strict";var Ou=D(),oi=dt(),St=lt();function Nu(e,t){let n=[],s=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");let i=oi.createStringifyContext(e,t),{commentString:r}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=r(e.commentBefore);n.unshift(St.indentComment(c,""))}let o=!1,a=null;if(e.contents){if(Ou.isNode(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){let d=r(e.contents.commentBefore);n.push(St.indentComment(d,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>o=!0,l=oi.stringify(e.contents,i,()=>a=null,c);a&&(l+=St.lineComment(l,"",r(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(oi.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=r(e.comment);c.includes(`
|
|
57
|
+
`)?(n.push("..."),n.push(St.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(St.indentComment(r(c),"")))}return n.join(`
|
|
58
58
|
`)+`
|
|
59
|
-
`}
|
|
60
|
-
`),o=a+o}if(/[^ ]/.test(o)){let a=1,
|
|
59
|
+
`}Fo.stringifyDocument=Nu});var $t=C(_o=>{"use strict";var Eu=ot(),Ve=en(),oe=D(),xu=Ae(),Cu=ke(),Tu=ri(),qu=jo(),ai=Xt(),Pu=us(),Mu=at(),li=fs(),ci=class e{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,oe.NODE_TYPE,{value:oe.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 li.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,{[oe.NODE_TYPE]:{value:oe.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=oe.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){We(this.contents)&&this.contents.add(t)}addIn(t,n){We(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let s=ai.anchorNames(this);t.anchor=!n||s.has(n)?ai.findNewAnchor(n||"a",s):n}return new Eu.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 w=h=>typeof h=="number"||h instanceof String||h instanceof Number,N=n.filter(w).map(String);N.length>0&&(n=n.concat(N)),i=n}else s===void 0&&n&&(s=n,n=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:d}=s??{},{onAnchor:f,setAnchors:u,sourceObjects:p}=ai.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},g=Mu.createNode(t,d,y);return a&&oe.isCollection(g)&&(g.flow=!0),u(),g}createPair(t,n,s={}){let i=this.createNode(t,null,s),r=this.createNode(n,null,s);return new xu.Pair(i,r)}delete(t){return We(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ve.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):We(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return oe.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ve.isEmptyPath(t)?!n&&oe.isScalar(this.contents)?this.contents.value:this.contents:oe.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return oe.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Ve.isEmptyPath(t)?this.contents!==void 0:oe.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Ve.collectionFromPath(this.schema,[t],n):We(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ve.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Ve.collectionFromPath(this.schema,Array.from(t),n):We(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 li.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 li.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 Tu.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},c=Cu.toJS(this.contents,n??"",a);if(typeof r=="function")for(let{count:l,res:d}of a.anchors.values())r(d,l);return typeof o=="function"?Pu.applyReviver(o,{"":c},"",c):c}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 qu.stringifyDocument(this,t)}};function We(e){if(oe.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}_o.Document=ci});var Ot=C(At=>{"use strict";var vt=class extends Error{constructor(t,n,s,i){super(),this.name=t,this.code=s,this.message=i,this.pos=n}},fi=class extends vt{constructor(t,n,s){super("YAMLParseError",t,n,s)}},ui=class extends vt{constructor(t,n,s){super("YAMLWarning",t,n,s)}},Lu=(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,c=n.linePos[1];c?.line===s&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-r)));let l=" ".repeat(r)+"^".repeat(a);n.message+=`:
|
|
61
61
|
|
|
62
62
|
${o}
|
|
63
|
-
${
|
|
64
|
-
`}};
|
|
65
|
-
`))return!0;if(
|
|
66
|
-
`+
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+
|
|
71
|
-
`+
|
|
72
|
-
`.repeat(Math.max(1,o.length-1)):"",
|
|
73
|
-
`;for(let
|
|
74
|
-
`):
|
|
75
|
-
`:!
|
|
76
|
-
`&&(
|
|
63
|
+
${l}
|
|
64
|
+
`}};At.YAMLError=vt;At.YAMLParseError=fi;At.YAMLWarning=ui;At.prettifyError=Lu});var Nt=C(Bo=>{"use strict";function Iu(e,{flow:t,indicator:n,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let c=!1,l=a,d=a,f="",u="",p=!1,y=!1,g=null,w=null,N=null,h=null,k=null,x=null,S=null;for(let E of e)switch(y&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&r(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),g&&(l&&E.type!=="comment"&&E.type!=="newline"&&r(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),E.type){case"space":!t&&(n!=="doc-start"||s?.type!=="flow-collection")&&E.source.includes(" ")&&(g=E),d=!0;break;case"comment":{d||r(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let I=E.source.substring(1)||" ";f?f+=u+I:f=I,u="",l=!1;break}case"newline":l?f?f+=E.source:(!x||n!=="seq-item-ind")&&(c=!0):u+=E.source,l=!0,p=!0,(w||N)&&(h=E),d=!0;break;case"anchor":w&&r(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&r(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=E,S??(S=E.offset),l=!1,d=!1,y=!0;break;case"tag":{N&&r(E,"MULTIPLE_TAGS","A node can have at most one tag"),N=E,S??(S=E.offset),l=!1,d=!1,y=!0;break}case n:(w||N)&&r(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),x&&r(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),x=E,l=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){k&&r(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=E,l=!1,d=!1;break}default:r(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,d=!1}let O=e[e.length-1],q=O?O.offset+O.source.length:i;return y&&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"),g&&(l&&g.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:x,spaceBefore:c,comment:f,hasNewline:p,anchor:w,tag:N,newlineAfterProp:h,end:q,start:S??q}}Bo.resolveProps=Iu});var Rn=C(Ko=>{"use strict";function di(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(di(t.key)||di(t.value))return!0}return!1;default:return!0}}Ko.containsNewline=di});var pi=C(Uo=>{"use strict";var Ru=Rn();function Du(e,t,n){if(t?.type==="flow-collection"){let s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&Ru.containsNewline(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Uo.flowIndentCheck=Du});var hi=C(zo=>{"use strict";var Yo=D();function Fu(e,t,n){let{uniqueKeys:s}=e.options;if(s===!1)return!1;let i=typeof s=="function"?s:(r,o)=>r===o||Yo.isScalar(r)&&Yo.isScalar(o)&&r.value===o.value;return t.some(r=>i(r.key,n))}zo.mapIncludes=Fu});var Ho=C(Xo=>{"use strict";var Vo=Ae(),ju=Ne(),Wo=Nt(),_u=Rn(),Jo=pi(),Bu=hi(),Go="All mapping items must start at the same column";function Ku({composeNode:e,composeEmptyNode:t},n,s,i,r){let o=r?.nodeClass??ju.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,l=null;for(let d of s.items){let{start:f,key:u,sep:p,value:y}=d,g=Wo.resolveProps(f,{indicator:"explicit-key-ind",next:u??p?.[0],offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0}),w=!g.found;if(w){if(u&&(u.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==s.indent&&i(c,"BAD_INDENT",Go)),!g.anchor&&!g.tag&&!p){l=g.end,g.comment&&(a.comment?a.comment+=`
|
|
66
|
+
`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||_u.containsNewline(u))&&i(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==s.indent&&i(c,"BAD_INDENT",Go);n.atKey=!0;let N=g.end,h=u?e(n,u,g,i):t(n,N,f,null,g,i);n.schema.compat&&Jo.flowIndentCheck(s.indent,u,i),n.atKey=!1,Bu.mapIncludes(n,a.items,h)&&i(N,"DUPLICATE_KEY","Map keys must be unique");let k=Wo.resolveProps(p??[],{indicator:"map-value-ind",next:y,offset:h.range[2],onError:i,parentIndent:s.indent,startOnNewline:!u||u.type==="block-scalar"});if(c=k.end,k.found){w&&(y?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<k.found.offset-1024&&i(h.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=y?e(n,y,k,i):t(n,c,p,null,k,i);n.schema.compat&&Jo.flowIndentCheck(s.indent,y,i),c=x.range[2];let S=new Vo.Pair(h,x);n.options.keepSourceTokens&&(S.srcToken=d),a.items.push(S)}else{w&&i(h.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(h.comment?h.comment+=`
|
|
67
|
+
`+k.comment:h.comment=k.comment);let x=new Vo.Pair(h);n.options.keepSourceTokens&&(x.srcToken=d),a.items.push(x)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,c,l??c],a}Xo.resolveBlockMap=Ku});var Zo=C(Qo=>{"use strict";var Uu=Ee(),Yu=Nt(),zu=pi();function Vu({composeNode:e,composeEmptyNode:t},n,s,i,r){let o=r?.nodeClass??Uu.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=s.offset,l=null;for(let{start:d,value:f}of s.items){let u=Yu.resolveProps(d,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=u.end,u.comment&&(a.comment=u.comment);continue}let p=f?e(n,f,u,i):t(n,u.end,d,null,u,i);n.schema.compat&&zu.flowIndentCheck(s.indent,f,i),c=p.range[2],a.items.push(p)}return a.range=[s.offset,c,l??c],a}Qo.resolveBlockSeq=Vu});var Je=C(ea=>{"use strict";function Wu(e,t,n,s){let i="";if(e){let r=!1,o="";for(let a of e){let{source:c,type:l}=a;switch(l){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 d=c.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=c),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}ea.resolveEnd=Wu});var ia=C(sa=>{"use strict";var Ju=D(),Gu=Ae(),ta=Ne(),Xu=Ee(),Hu=Je(),na=Nt(),Qu=Rn(),Zu=hi(),mi="Block collections are not allowed within flow collections",gi=e=>e&&(e.type==="block-map"||e.type==="block-seq");function ed({composeNode:e,composeEmptyNode:t},n,s,i,r){let o=s.start.source==="{",a=o?"flow map":"flow sequence",c=r?.nodeClass??(o?ta.YAMLMap:Xu.YAMLSeq),l=new c(n.schema);l.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 w=0;w<s.items.length;++w){let N=s.items[w],{start:h,key:k,sep:x,value:S}=N,O=na.resolveProps(h,{flow:a,indicator:"explicit-key-ind",next:k??x?.[0],offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!x&&!S){w===0&&O.comma?i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<s.items.length-1&&i(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),O.comment&&(l.comment?l.comment+=`
|
|
68
|
+
`+O.comment:l.comment=O.comment),f=O.end;continue}!o&&n.options.strict&&Qu.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)O.comma&&i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(O.comma||i(O.start,"MISSING_CHAR",`Missing , between ${a} items`),O.comment){let q="";e:for(let E of h)switch(E.type){case"comma":case"space":break;case"comment":q=E.source.substring(1);break e;default:break e}if(q){let E=l.items[l.items.length-1];Ju.isPair(E)&&(E=E.value??E.key),E.comment?E.comment+=`
|
|
69
|
+
`+q:E.comment=q,O.comment=O.comment.substring(q.length+1)}}if(!o&&!x&&!O.found){let q=S?e(n,S,O,i):t(n,O.end,x,null,O,i);l.items.push(q),f=q.range[2],gi(S)&&i(q.range,"BLOCK_IN_FLOW",mi)}else{n.atKey=!0;let q=O.end,E=k?e(n,k,O,i):t(n,q,h,null,O,i);gi(k)&&i(E.range,"BLOCK_IN_FLOW",mi),n.atKey=!1;let I=na.resolveProps(x??[],{flow:a,indicator:"map-value-ind",next:S,offset:E.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(I.found){if(!o&&!O.found&&n.options.strict){if(x)for(let v of x){if(v===I.found)break;if(v.type==="newline"){i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<I.found.offset-1024&&i(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source?.[0]===":"?i(S,"MISSING_CHAR",`Missing space after : in ${a}`):i(I.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let b=S?e(n,S,I,i):I.found?t(n,I.end,x,null,I,i):null;b?gi(S)&&i(b.range,"BLOCK_IN_FLOW",mi):I.comment&&(E.comment?E.comment+=`
|
|
70
|
+
`+I.comment:E.comment=I.comment);let m=new Gu.Pair(E,b);if(n.options.keepSourceTokens&&(m.srcToken=N),o){let v=l;Zu.mapIncludes(n,v.items,E)&&i(q,"DUPLICATE_KEY","Map keys must be unique"),v.items.push(m)}else{let v=new ta.YAMLMap(n.schema);v.flow=!0,v.items.push(m);let P=(b??E).range;v.range=[E.range[0],P[1],P[2]],l.items.push(v)}f=b?b.range[2]:I.end}}let u=o?"}":"]",[p,...y]=s.end,g=f;if(p?.source===u)g=p.offset+p.source.length;else{let w=a[0].toUpperCase()+a.substring(1),N=d?`${w} must end with a ${u}`:`${w} in block collection must be sufficiently indented and end with a ${u}`;i(f,d?"MISSING_CHAR":"BAD_INDENT",N),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let w=Hu.resolveEnd(y,g,n.options.strict,i);w.comment&&(l.comment?l.comment+=`
|
|
71
|
+
`+w.comment:l.comment=w.comment),l.range=[s.offset,g,w.offset]}else l.range=[s.offset,g,g];return l}sa.resolveFlowCollection=ed});var oa=C(ra=>{"use strict";var td=D(),nd=V(),sd=Ne(),id=Ee(),rd=Ho(),od=Zo(),ad=ia();function yi(e,t,n,s,i,r){let o=n.type==="block-map"?rd.resolveBlockMap(e,t,n,s,r):n.type==="block-seq"?od.resolveBlockSeq(e,t,n,s,r):ad.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 ld(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:p}=s,y=u&&r?u.offset>r.offset?u:r:u??r;y&&(!p||p.offset<y.offset)&&i(y,"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===sd.YAMLMap.tagName&&a==="map"||o===id.YAMLSeq.tagName&&a==="seq")return yi(e,t,n,i,o);let c=t.schema.tags.find(u=>u.tag===o&&u.collection===a);if(!c){let u=t.schema.knownTags[o];if(u?.collection===a)t.schema.tags.push(Object.assign({},u,{default:!1})),c=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),yi(e,t,n,i,o)}let l=yi(e,t,n,i,o,c),d=c.resolve?.(l,u=>i(r,"TAG_RESOLVE_FAILED",u),t.options)??l,f=td.isNode(d)?d:new nd.Scalar(d);return f.range=l.range,f.tag=o,c?.format&&(f.format=c.format),f}ra.composeCollection=ld});var wi=C(aa=>{"use strict";var bi=V();function cd(e,t,n){let s=t.offset,i=fd(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};let r=i.mode===">"?bi.Scalar.BLOCK_FOLDED:bi.Scalar.BLOCK_LITERAL,o=t.source?ud(t.source):[],a=o.length;for(let g=o.length-1;g>=0;--g){let w=o[g][1];if(w===""||w==="\r")a=g;else break}if(a===0){let g=i.chomp==="+"&&o.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,o.length-1)):"",w=s+i.length;return t.source&&(w+=t.source.length),{value:g,type:r,comment:i.comment,range:[s,w,w]}}let c=t.indent+i.indent,l=t.offset+i.length,d=0;for(let g=0;g<a;++g){let[w,N]=o[g];if(N===""||N==="\r")i.indent===0&&w.length>c&&(c=w.length);else{w.length<c&&n(l+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=w.length),d=g,c===0&&!e.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=w.length+N.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>c&&(a=g+1);let f="",u="",p=!1;for(let g=0;g<d;++g)f+=o[g][0].slice(c)+`
|
|
73
|
+
`;for(let g=d;g<a;++g){let[w,N]=o[g];l+=w.length+N.length+1;let h=N[N.length-1]==="\r";if(h&&(N=N.slice(0,-1)),N&&w.length<c){let x=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-N.length-(h?2:1),"BAD_INDENT",x),w=""}r===bi.Scalar.BLOCK_LITERAL?(f+=u+w.slice(c)+N,u=`
|
|
74
|
+
`):w.length>c||N[0]===" "?(u===" "?u=`
|
|
75
|
+
`:!p&&u===`
|
|
76
|
+
`&&(u=`
|
|
77
77
|
|
|
78
|
-
`),u
|
|
79
|
-
`,
|
|
80
|
-
`?
|
|
81
|
-
`:
|
|
82
|
-
`:(u
|
|
83
|
-
`+o[
|
|
84
|
-
`&&(
|
|
85
|
-
`);break;default:
|
|
86
|
-
`}let
|
|
87
|
-
`?
|
|
88
|
-
`:(
|
|
89
|
-
`))if(
|
|
90
|
-
`){let{fold:
|
|
91
|
-
`)for(
|
|
92
|
-
`)for(
|
|
93
|
-
`&&!(o==="\r"&&
|
|
94
|
-
`)&&(n+=s>
|
|
95
|
-
`||s==="\r")&&!(s==="\r"&&t
|
|
78
|
+
`),f+=u+w.slice(c)+N,u=`
|
|
79
|
+
`,p=!0):N===""?u===`
|
|
80
|
+
`?f+=`
|
|
81
|
+
`:u=`
|
|
82
|
+
`:(f+=u+N,u=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)f+=`
|
|
83
|
+
`+o[g][0].slice(c);f[f.length-1]!==`
|
|
84
|
+
`&&(f+=`
|
|
85
|
+
`);break;default:f+=`
|
|
86
|
+
`}let y=s+i.length+t.source.length;return{value:f,type:r,comment:i.comment,range:[s,y,y]}}function fd({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="",c=-1;for(let u=1;u<i.length;++u){let p=i[u];if(!a&&(p==="-"||p==="+"))a=p;else{let y=Number(p);!o&&y?o=y:c===-1&&(c=e+u)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,d="",f=i.length;for(let u=1;u<t.length;++u){let p=t[u];switch(p.type){case"space":l=!0;case"newline":f+=p.source.length;break;case"comment":n&&!l&&s(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,d=p.source.substring(1);break;case"error":s(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;s(p,"UNEXPECTED_TOKEN",y);let g=p.source;g&&typeof g=="string"&&(f+=g.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:f}}function ud(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}aa.resolveBlockScalar=cd});var Si=C(ca=>{"use strict";var ki=V(),dd=Je();function pd(e,t,n){let{offset:s,type:i,source:r,end:o}=e,a,c,l=(u,p,y)=>n(s+u,p,y);switch(i){case"scalar":a=ki.Scalar.PLAIN,c=hd(r,l);break;case"single-quoted-scalar":a=ki.Scalar.QUOTE_SINGLE,c=md(r,l);break;case"double-quoted-scalar":a=ki.Scalar.QUOTE_DOUBLE,c=gd(r,l);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 d=s+r.length,f=dd.resolveEnd(o,d,t,n);return{value:c,type:a,comment:f.comment,range:[s,d,f.offset]}}function hd(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}`),la(e)}function md(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),la(e.slice(1,-1)).replace(/''/g,"'")}function la(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 l=n[1].replace(i,"");l===""?o===`
|
|
87
|
+
`?r+=o:o=`
|
|
88
|
+
`:(r+=o+l,o=" "),a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,n=c.exec(e),r+o+(n?.[1]??"")}function gd(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}=yd(e,s);n+=r,s=o}else if(i==="\\"){let r=e[++s],o=bd[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+=wd(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 yd(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
|
-
`),
|
|
99
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
98
|
+
`),t+=1,s=e[t+1];return n||(n=" "),{fold:n,offset:t}}var bd={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 wd(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}}ca.resolveFlowScalar=pd});var da=C(ua=>{"use strict";var Ie=D(),fa=V(),kd=wi(),Sd=Si();function $d(e,t,n,s){let{value:i,type:r,comment:o,range:a}=t.type==="block-scalar"?kd.resolveBlockScalar(e,t,s):Sd.resolveFlowScalar(t,e.options.strict,s),c=n?e.directives.tagName(n.source,f=>s(n,"TAG_RESOLVE_FAILED",f)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[Ie.SCALAR]:c?l=vd(e.schema,i,c,n,s):t.type==="scalar"?l=Ad(e,i,t,s):l=e.schema[Ie.SCALAR];let d;try{let f=l.resolve(i,u=>s(n??t,"TAG_RESOLVE_FAILED",u),e.options);d=Ie.isScalar(f)?f:new fa.Scalar(f)}catch(f){let u=f instanceof Error?f.message:String(f);s(n??t,"TAG_RESOLVE_FAILED",u),d=new fa.Scalar(i)}return d.range=a,d.source=i,r&&(d.type=r),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function vd(e,t,n,s,i){if(n==="!")return e[Ie.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[Ie.SCALAR])}function Ad({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[Ie.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(s))??n[Ie.SCALAR];if(o.tag!==a.tag){let c=t.tagString(o.tag),l=t.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}ua.composeScalar=$d});var ha=C(pa=>{"use strict";function Od(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}pa.emptyScalarPosition=Od});var ya=C(vi=>{"use strict";var Nd=ot(),Ed=D(),xd=oa(),ma=da(),Cd=Je(),Td=ha(),qd={composeNode:ga,composeEmptyNode:$i};function ga(e,t,n,s){let i=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:c}=n,l,d=!0;switch(t.type){case"alias":l=Pd(e,t,s),(a||c)&&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":l=ma.composeScalar(e,t,c,s),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=xd.composeCollection(qd,e,t,n,s),a&&(l.anchor=a.source.substring(1))}catch(f){let u=f instanceof Error?f.message:String(f);s(t,"RESOURCE_EXHAUSTION",u)}break;default:{let f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",f),d=!1}}return l??(l=$i(e,t.offset,void 0,null,n,s)),a&&l.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Ed.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(l.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&d&&(l.srcToken=t),l}function $i(e,t,n,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:c},l){let d={type:"scalar",offset:Td.emptyScalarPosition(t,n,s),indent:-1,source:""},f=ma.composeScalar(e,d,a,l);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=c),f}function Pd({options:e},{offset:t,source:n,end:s},i){let r=new Nd.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=Cd.resolveEnd(s,o,e.strict,i);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}vi.composeEmptyNode=$i;vi.composeNode=ga});var ka=C(wa=>{"use strict";var Md=$t(),ba=ya(),Ld=Je(),Id=Nt();function Rd(e,t,{offset:n,start:s,value:i,end:r},o){let a=Object.assign({_directives:t},e),c=new Md.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Id.resolveProps(s,{indicator:"doc-start",next:i??r?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?ba.composeNode(l,i,d,o):ba.composeEmptyNode(l,d.end,s,null,d,o);let f=c.contents.range[2],u=Ld.resolveEnd(r,f,!1,o);return u.comment&&(c.comment=u.comment),c.range=[n,f,u.offset],c}wa.composeDoc=Rd});var Oi=C(va=>{"use strict";var Dd=zt("process"),Fd=fs(),jd=$t(),Et=Ot(),Sa=D(),_d=ka(),Bd=Je();function xt(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 $a(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
|
-
`)+(
|
|
103
|
-
${s}`:s;else if(
|
|
104
|
-
${a}`:s}else{let o=
|
|
105
|
-
${o}`:s}}if(n){for(let
|
|
106
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new
|
|
107
|
-
`}];switch(a[0]){case"|":case">":{let
|
|
108
|
-
`),
|
|
109
|
-
`,
|
|
110
|
-
`}),{type:"block-scalar",offset:
|
|
111
|
-
`),s=
|
|
112
|
-
`;if(
|
|
113
|
-
`});for(let
|
|
114
|
-
`};delete
|
|
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 Ai=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,i,r)=>{let o=xt(n);r?this.warnings.push(new Et.YAMLWarning(o,s,i)):this.errors.push(new Et.YAMLParseError(o,s,i))},this.directives=new Fd.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:s,afterEmptyLine:i}=$a(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(Sa.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Sa.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:$a(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(Dd.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,s,i)=>{let r=xt(t);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=_d.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 Et.YAMLParseError(xt(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 Et.YAMLParseError(xt(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let n=Bd.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 Et.YAMLParseError(xt(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 jd.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}}};va.Composer=Ai});var Na=C(Dn=>{"use strict";var Kd=wi(),Ud=Si(),Yd=Ot(),Aa=ut();function zd(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 Yd.YAMLParseError([a,a+1],r,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ud.resolveFlowScalar(e,t,s);case"block-scalar":return Kd.resolveBlockScalar({options:{strict:t}},e,s)}}return null}function Vd(e,t){let{implicitKey:n=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=Aa.stringifyString({type:o,value:e},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:s,source:`
|
|
107
|
+
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
108
|
+
`),d=a.substring(0,l),f=a.substring(l+1)+`
|
|
109
|
+
`,u=[{type:"block-scalar-header",offset:r,indent:s,source:d}];return Oa(u,c)||u.push({type:"newline",offset:-1,indent:s,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:r,indent:s,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:c};default:return{type:"scalar",offset:r,indent:s,source:a,end:c}}}function Wd(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 l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Aa.stringifyString({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Jd(e,c);break;case'"':Ni(e,c,"double-quoted-scalar");break;case"'":Ni(e,c,"single-quoted-scalar");break;default:Ni(e,c,"scalar")}}function Jd(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}];Oa(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
113
|
+
`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function Oa(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 Ni(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})}}}Dn.createScalarToken=Vd;Dn.resolveAsScalar=zd;Dn.setScalarValue=Wd});var xa=C(Ea=>{"use strict";var Gd=e=>"type"in e?jn(e):Fn(e);function jn(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=jn(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Fn(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Fn(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Fn(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 Fn({start:e,key:t,sep:n,value:s}){let i="";for(let r of e)i+=r.source;if(t&&(i+=jn(t)),n)for(let r of n)i+=r.source;return s&&(i+=jn(s)),i}Ea.stringify=Gd});var Pa=C(qa=>{"use strict";var Ei=Symbol("break visit"),Xd=Symbol("skip children"),Ca=Symbol("remove item");function Re(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),Ta(Object.freeze([]),e,t)}Re.BREAK=Ei;Re.SKIP=Xd;Re.REMOVE=Ca;Re.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};Re.parentCollection=(e,t)=>{let n=Re.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 Ta(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=Ta(Object.freeze(e.concat([[i,o]])),r.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Ei)return Ei;a===Ca&&(r.items.splice(o,1),o-=1)}}typeof s=="function"&&i==="key"&&(s=s(t,e))}}return typeof s=="function"?s(t,e):s}qa.visit=Re});var _n=C(ne=>{"use strict";var xi=Na(),Hd=xa(),Qd=Pa(),Ci="\uFEFF",Ti="",qi="",Pi="",Zd=e=>!!e&&"items"in e,ep=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function tp(e){switch(e){case Ci:return"<BOM>";case Ti:return"<DOC>";case qi:return"<FLOW_END>";case Pi:return"<SCALAR>";default:return JSON.stringify(e)}}function np(e){switch(e){case Ci:return"byte-order-mark";case Ti:return"doc-mode";case qi:return"flow-error-end";case Pi: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(
|
|
117
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
118
|
-
\r `),
|
|
119
|
-
`?!0:n==="\r"?this.buffer[
|
|
120
|
-
`:!1}charAt(
|
|
121
|
-
`||!
|
|
122
|
-
`||s>=this.indentNext||!n&&!this.atEnd?
|
|
123
|
-
`,this.pos),this.lineEndPos=
|
|
124
|
-
`,this.pos);if(
|
|
125
|
-
`,
|
|
126
|
-
`:
|
|
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
|
|
128
|
-
`,
|
|
129
|
-
`;)s=this.buffer[++
|
|
130
|
-
`&&
|
|
131
|
-
`?(s+=1,
|
|
132
|
-
`,
|
|
133
|
-
`){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(
|
|
134
|
-
`?yield*this.pushCount(1):
|
|
135
|
-
`?yield*this.pushCount(2):0}*pushSpaces(
|
|
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}ne.createScalarToken=xi.createScalarToken;ne.resolveAsScalar=xi.resolveAsScalar;ne.setScalarValue=xi.setScalarValue;ne.stringify=Hd.stringify;ne.visit=Qd.visit;ne.BOM=Ci;ne.DOCUMENT=Ti;ne.FLOW_END=qi;ne.SCALAR=Pi;ne.isCollection=Zd;ne.isScalar=ep;ne.prettyToken=tp;ne.tokenType=np});var Ii=C(La=>{"use strict";var Ct=_n();function fe(e){switch(e){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}var Ma=new Set("0123456789ABCDEFabcdef"),sp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bn=new Set(",[]{}"),ip=new Set(` ,[]{}
|
|
118
|
+
\r `),Mi=e=>!e||ip.has(e),Li=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==="...")&&fe(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]===Ct.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 Ct.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==="...")&&fe(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&&!fe(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===":")&&fe(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(Mi),"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("..."))&&fe(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Ct.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(Mi),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||fe(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=>fe(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 Ct.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(fe(r)||t&&Bn.has(r))break;n=s}else if(fe(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&&Bn.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&&Bn.has(i))break;n=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ct.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(Mi),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,s=this.charAt(1);if(fe(s)||n&&Bn.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(;!fe(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(sp.has(n))n=this.buffer[++t];else if(n==="%"&&Ma.has(this.buffer[t+1])&&Ma.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)}};La.Lexer=Li});var Di=C(Ia=>{"use strict";var Ri=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}}}};Ia.LineCounter=Ri});var ji=C(_a=>{"use strict";var rp=zt("process"),Ra=_n(),op=Ii();function xe(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Da(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 ja(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 Kn(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 Ge(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 Un(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 Fa(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!xe(t.start,"explicit-key-ind")&&!xe(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,ja(t.value)?t.value.end?Un(t.value.end,t.sep):t.value.end=t.sep:Un(t.start,t.sep),delete t.sep)}var Fi=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 op.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,rp.env.LOG_TOKENS&&console.log("|",Ra.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=Ra.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"&&Fa(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&&Da(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":{Da(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=Kn(this.peek(2)),s=Ge(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(
|
|
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)){Un(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 c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.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(xe(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(ja(n.key)&&!xe(n.sep,"newline")){let o=Ge(n.start),a=n.key,c=n.sep;c.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:c}]})}else r.length>0?n.sep=n.sep.concat(r,this.sourceToken):n.sep.push(this.sourceToken);else if(xe(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Ge(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]}):xe(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&&!xe(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)){Un(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||xe(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=Kn(s),r=Ge(i);Fa(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=Tn(e),s=Fe(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Tn(e),s=Fe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};qa.Parser=Er});var Ma=O(wt=>{"use strict";var Ta=hr(),Dd=ft(),bt=pt(),Rd=ds(),_d=M(),Fd=Nr(),Pa=Cr();function La(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Fd.LineCounter||null,prettyErrors:e}}function jd(t,e={}){let{lineCounter:n,prettyErrors:s}=La(e),r=new Pa.Parser(n?.addNewLine),i=new Ta.Composer(e),o=Array.from(i.compose(r.parse(t)));if(s&&n)for(let a of o)a.errors.forEach(bt.prettifyError(t,n)),a.warnings.forEach(bt.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function xa(t,e={}){let{lineCounter:n,prettyErrors:s}=La(e),r=new Pa.Parser(n?.addNewLine),i=new Ta.Composer(e),o=null;for(let a of i.compose(r.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new bt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(bt.prettifyError(t,n)),o.warnings.forEach(bt.prettifyError(t,n))),o}function Bd(t,e,n){let s;typeof e=="function"?s=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=xa(t,n);if(!r)return null;if(r.warnings.forEach(i=>Rd.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function Kd(t,e,n){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return _d.isDocument(t)&&!s?t.toString(n):new Dd.Document(t,s,n).toString(n)}wt.parse=Bd;wt.parseAllDocuments=jd;wt.parseDocument=xa;wt.stringify=Kd});var xn=O(I=>{"use strict";var Ud=hr(),Yd=ft(),zd=Ws(),qr=pt(),Vd=We(),we=M(),Jd=he(),Wd=j(),Gd=ge(),Xd=ye(),Hd=Cn(),Qd=Ar(),Zd=Nr(),ep=Cr(),Ln=Ma(),Ia=Ye();I.Composer=Ud.Composer;I.Document=Yd.Document;I.Schema=zd.Schema;I.YAMLError=qr.YAMLError;I.YAMLParseError=qr.YAMLParseError;I.YAMLWarning=qr.YAMLWarning;I.Alias=Vd.Alias;I.isAlias=we.isAlias;I.isCollection=we.isCollection;I.isDocument=we.isDocument;I.isMap=we.isMap;I.isNode=we.isNode;I.isPair=we.isPair;I.isScalar=we.isScalar;I.isSeq=we.isSeq;I.Pair=Jd.Pair;I.Scalar=Wd.Scalar;I.YAMLMap=Gd.YAMLMap;I.YAMLSeq=Xd.YAMLSeq;I.CST=Hd;I.Lexer=Qd.Lexer;I.LineCounter=Zd.LineCounter;I.Parser=ep.Parser;I.parse=Ln.parse;I.parseAllDocuments=Ln.parseAllDocuments;I.parseDocument=Ln.parseDocument;I.stringify=Ln.stringify;I.visit=Ia.visit;I.visitAsync=Ia.visitAsync});import{readdirSync as vl,readFileSync as $l}from"node:fs";import{basename as Al,join as Gn}from"node:path";var Ol=/^agent\.mcs\.ya?ml$/,Nl=/\.ya?ml$/,Yr=t=>vl(t,{withFileTypes:!0}).filter(e=>!e.name.startsWith(".")&&e.name!=="node_modules");function zr(t,e=""){return Yr(t).flatMap(n=>{let s=e?`${e}/${n.name}`:n.name;return n.isDirectory()?zr(Gn(t,n.name),s):n.isFile()?[{path:s,text:Nl.test(n.name)?$l(Gn(t,n.name),"utf8"):""}]:[]})}function Vr(t){let e=Yr(t);return e.some(n=>n.isFile()&&Ol.test(n.name))?[{id:Al(t),dir:t,files:zr(t)}]:e.filter(n=>n.isDirectory()).flatMap(n=>Vr(Gn(t,n.name)))}var re=Wn(xn()),Y=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,_=t=>typeof t=="string"&&t.trim()?t:void 0,Tr=t=>Array.isArray(t)?t:[];function tp(t){if(!t.trim())return"empty";let e=new re.LineCounter,n=(0,re.parseDocument)(t,{lineCounter:e,uniqueKeys:!1});if(n.errors.length)return"yaml";let s=new WeakMap,r=o=>{if((0,re.isMap)(o)){let a={};o.range&&s.set(a,o.range[0]);for(let l of o.items)a[String((0,re.isScalar)(l.key)?l.key.value:l.key)]=r(l.value);return a}return(0,re.isSeq)(o)?o.items.map(r):(0,re.isScalar)(o)?o.value:o},i=r(n.contents);return i==null?"empty":{data:i,lineOf:o=>o&&typeof o=="object"&&s.has(o)?e.linePos(s.get(o)).line:void 0}}function*St(t){if(Array.isArray(t))for(let n of t)yield*St(n);let e=Y(t);if(e){typeof e.kind=="string"&&(yield e);for(let n of Object.values(e))yield*St(n)}}var kt=t=>t.split(".")[1]??t,Pr=(t,e)=>t.slice(t.lastIndexOf(e)+(t.includes(e)?e.length:0)),np=new Set(["LogCustomTelemetryEvent","CSATQuestion","SearchAndSummarizeContent","SearchKnowledgeSources"]);function sp(t,e,n){let s={id:t,facts:{},children:[],unknown:[]},r=[];for(let i of[...e].sort((o,a)=>o.path.localeCompare(a.path))){if(!/\.ya?ml$/.test(i.path)){s.unknown.push({file:i.path,why:"file"});continue}let o=tp(i.text);if(o==="yaml"||o==="empty"){s.unknown.push({file:i.path,why:o});continue}let a=Y(o.data),l=/^agents\/([^/]+)\//.exec(i.path)?.[1],c=s.facts;if(l){let d=s.children.find(h=>h.name===l);d||s.children.push(d={name:l,facts:{}}),c=d.facts}let p=(d,h,g=c)=>(g[d]??=[]).push({file:i.path,line:o.lineOf(h??a)});if(l&&p(`child:${l}`,a,s.facts),!l&&/^settings\.mcs\.ya?ml$/.test(i.path)&&a){s.schemaName=_(a.schemaName)??s.schemaName,s.displayName=_(a.displayName)??s.displayName,_(a.authenticationMode)&&p(`auth:${a.authenticationMode}`);let d=Y(a.configuration),h=Y(d?.settings)?.GenerativeActionsEnabled;typeof h=="boolean"&&p(`setting:generative=${h?"on":"off"}`,d),d?.isAgentConnectable===!0&&p("setting:connectable",d);continue}let u=n?[...St(a)].map(d=>d.kind).find(d=>!n.has(d)):void 0;if(u&&s.unknown.push({file:i.path,why:"kind",kind:u}),typeof a?.kind!="string"){u||s.unknown.push({file:i.path,why:"kind"});continue}let f=i.text,m=(d,h)=>{_(d)&&(p("instructions:present",h),/\b(Today|Now)\(\)/.test(d)&&p("ms:date-context",h))};switch(a.kind){case"GptComponentMetadata":{s.displayName??=_(a.displayName),m(a.instructions,a);let d=Y(Y(a.aISettings)?.model);_(d?.modelNameHint)&&p(`model:${d.modelNameHint}`,d);break}case"AgentDialog":{let d=Y(a.beginDialog);_(d?.kind)&&p(`trigger:${d.kind}`,d),m(Y(a.settings)?.instructions,a.settings);break}case"AdaptiveDialog":{let d=Y(a.beginDialog),h=_(d?.kind);h&&p(`trigger:${h}`,d),_(a.modelDescription)&&p("topics:with-model-description");let g=Tr(a.inputs).some(k=>Y(k)?.kind==="AutomaticTaskInput"&&Y(k)?.shouldPromptUser===!1);h==="OnRecognizedIntent"&&g&&p("ms:orchestrator-variables",d),h==="OnError"&&f.includes("System.Error.SubCode")&&p("ms:rai-error-handling",d),h==="OnKnowledgeRequested"&&[...St(d)].some(k=>k.kind==="SendActivity")&&p("ms:knowledge-hold-message",d),h==="OnGeneratedResponse"&&f.includes("System.ContinueResponse")&&p("ms:prevent-tool-call-leaks",d);break}case"TaskDialog":{let d=Y(a.action),h=_(d?.connectionReference);d?.kind==="InvokeConnectorTaskAction"&&h&&(p(`connector:${kt(h)}`,d),_(d.operationId)&&p(`operation:${kt(h)}/${d.operationId}`,d)),d?.kind==="InvokeExternalAgentTaskAction"&&Y(d.operationDetails)?.kind==="ModelContextProtocolMetadata"&&h&&p(`mcp:${kt(h)}`,d),d?.kind==="InvokeConnectedAgentTaskAction"&&_(d.botSchemaName)&&p(`calls:${d.botSchemaName}`,d),d?.kind==="InvokeFlowTaskAction"&&_(d.flowId)&&p(`flow:${d.flowId}`,d);break}case"KnowledgeSourceConfiguration":{let d=Y(a.source);_(d?.kind)&&p(`knowledge:${d.kind}`,d),d&&"triggerCondition"in d&&p("yaml-only:triggerCondition",d),r.push({file:i.path,line:o.lineOf(a)});break}case"GlobalVariableComponent":{let d=Y(a.variable)??a,h=_(d.name)??(_(a.schemaName)?Pr(a.schemaName,"."):void 0);if(!h)break;p(`var:${h}`),d.isExternalInitializationAllowed===!0&&p(`var-in:${h}`);break}case"ConnectionReferencesSourceFile":for(let d of Tr(a.connectionReferences).map(Y)){let h=_(d?.connectorId)?Pr(d.connectorId,"/"):_(d?.connectionReferenceLogicalName)?kt(d.connectionReferenceLogicalName):void 0;h&&p(`connref:${h}`,d)}break}for(let d of St(a)){if(np.has(d.kind)&&p(`node:${d.kind}`,d),d.kind==="InvokeConnectorAction"&&_(d.connectionReference)){let g=kt(d.connectionReference);p(`connector:${g}`,d),_(d.operationId)&&p(`operation:${g}/${d.operationId}`,d)}if(d.kind==="InvokeFlowAction"&&_(d.flowId)&&p(`flow:${d.flowId}`,d),(d.kind==="BeginDialog"||d.kind==="ReplaceDialog")&&_(d.dialog)){let g=d.dialog;g.startsWith("=")?g.includes("Switch(")&&p("ms:dynamic-topic-redirect",d):p(`calls:topic:${Pr(g,".topic.")}`,d)}let h=g=>typeof g=="string"&&g.includes("System.Activity.ChannelId");(d.kind==="ConditionGroup"&&Tr(d.conditions).some(g=>h(Y(g)?.condition))||d.kind==="SetVariable"&&h(d.value))&&p("ms:channel-aware-behavior",d),(d.kind==="SendActivity"||d.kind==="Question")&&JSON.stringify(d).includes("<br")&&p("ms:line-breaks-in-messages",d)}}r.length&&(s.facts[`knowledge:count=${r.length}`]=r);for(let i of[s.facts,...s.children.map(o=>o.facts)])for(let[o,a]of Object.entries(i))i[o]=a.filter((l,c)=>a.findIndex(p=>p.file===l.file&&p.line===l.line)===c);return s}function rp(t){let e=new Set,n=r=>{if(!r||typeof r!="object")return;let{const:i,enum:o}=r;if(typeof i=="string"&&e.add(i),Array.isArray(o))for(let a of o)typeof a=="string"&&e.add(a)},s=r=>{if(Array.isArray(r))return r.forEach(s);if(!r||typeof r!="object")return;let i=r;n(i.kind),n(i.properties?.kind);for(let o of Object.values(i))s(o)};for(let r of Object.values(t.definitions??{}))s(r);return e}var je=Wn(xn(),1);function Mn(t,e){let n=new je.LineCounter,s=(0,je.parseDocument)(t,{lineCounter:n,prettyErrors:!1}),r=o=>{for(let a=o;a.length;a=a.slice(0,-1)){let l=s.getIn(a,!0);if(l?.range)return n.linePos(l.range[0]).line}return 1};if(s.errors.length)return{ok:!1,problem:{line:n.linePos(s.errors[0].pos[0]).line,key:"syntax",detail:s.errors[0].code}};let i=s.toJS();return!i||typeof i!="object"||Array.isArray(i)||i.format!==e||!(0,je.isMap)(s.contents)?{ok:!1,problem:{line:r(["format"]),key:"format"}}:{ok:!0,format:{raw:i,doc:s,at:r,lineOf:o=>n.linePos(o).line}}}var Da="cast-list/profile-v1",Ir=["orchestrator","specialist"],Mr={roles:{},threshold:.7,minAgents:3,rules:[],focusAreas:[],ignore:[],microsoftPatterns:!0},ip=["format","name","roles","threshold","min_agents","rules","focus_areas","ignore","microsoft_patterns"],Lr=t=>!!t&&typeof t=="object"&&!Array.isArray(t),z=t=>typeof t=="string"?t.trim():typeof t=="number"?String(t):"",xr=t=>Array.isArray(t)?t.map(z).filter(Boolean):z(t)?[z(t)]:[],Ra=t=>Ir.includes(t);function op(t){let e=Mn(t,Da);if(!e.ok)return{problems:[e.problem.key==="format"?{...e.problem,format:Da}:e.problem]};let{raw:n,at:s}=e.format,r=[];for(let k of Object.keys(n))ip.includes(k)||r.push({line:s([k]),key:"unknownKey",what:k});let i=(k,$,E)=>(z(k)||r.push({line:s(E),key:"missing",what:$}),z(k)),o=(k,$)=>{let E=new Set;$.forEach((y,S)=>{y&&E.has(y)&&r.push({line:s([k,S]),key:"duplicate",what:k,id:y}),E.add(y)})},a=k=>Array.isArray(n[k])?n[k]:[],l=n.threshold===void 0?Mr.threshold:Number(n.threshold);l>0&&l<=1||r.push({line:s(["threshold"]),key:"threshold",value:z(n.threshold)});let c=n.min_agents===void 0?Mr.minAgents:Number(n.min_agents);Number.isInteger(c)&&c>=1||r.push({line:s(["min_agents"]),key:"minAgents",value:z(n.min_agents)});let p={},u=Lr(n.roles)?n.roles:{};for(let k of Object.keys(u))Ra(k)?p[k]=z(u[k])==="*"?"*":xr(u[k]):r.push({line:s(["roles",k]),key:"role",what:`roles.${k}`,value:k});let f=(k,$,E)=>(Ra(z(k))||r.push({line:s(E),key:"role",what:$,value:z(k)}),z(k)),m=a("rules").filter(Lr).map((k,$)=>{let E=i(k.has,`rules[${$}].has`,["rules",$]);return{id:i(k.id,`rules[${$}].id`,["rules",$]),role:f(k.role,`rules[${$}].role`,["rules",$,"role"]),has:E,says:z(k.says)||E}});o("rules",m.map(k=>k.id));let d=a("focus_areas").filter(Lr).map((k,$)=>{let E=xr(k.facts);E.length||r.push({line:s(["focus_areas",$]),key:"missing",what:`focus_areas[${$}].facts`});let y=i(k.id,`focus_areas[${$}].id`,["focus_areas",$]);return{id:y,name:z(k.name)||y,facts:E}});o("focus_areas",d.map(k=>k.id));let h=n.microsoft_patterns,g={...z(n.name)?{name:z(n.name)}:{},roles:p,threshold:l,minAgents:c,rules:m,focusAreas:d,ignore:xr(n.ignore),microsoftPatterns:!(h===!1||z(h).toLowerCase()==="off")};return r.length?{problems:r}:{profile:g,problems:r}}var ap=t=>Object.keys(t.facts).some(e=>e.startsWith("calls:")&&!e.startsWith("calls:topic:"));function _a(t,e,n={}){let{orchestrator:s,specialist:r}=e.roles,i=(c,p)=>Array.isArray(c)&&c.includes(p),o=Object.fromEntries(t.map(c=>[c.id,i(s,c.id)?"orchestrator":i(r,c.id)?"specialist":n[c.id]??(s==="*"?"orchestrator":r==="*"?"specialist":ap(c)?"orchestrator":"specialist")])),a=new Set(t.map(c=>c.id)),l=[s,r].flatMap(c=>Array.isArray(c)?c:[]).filter(c=>!a.has(c));return{roles:o,unmatched:l}}var ae=Wn(xn());var vt="cast-list/cast-v1",lp=["accepted","rejected"],cp=["platform","specialist","orchestrator"],fp=["format","name","agents","declared","decisions"],up=t=>!!t&&typeof t=="object"&&!Array.isArray(t),Q=t=>typeof t=="string"?t.trim():typeof t=="number"||typeof t=="boolean"?String(t):"";function dp(t){let e=Mn(t,vt);if(!e.ok)return{problems:[e.problem.key==="format"?{...e.problem,format:vt}:e.problem]};let{raw:n,at:s}=e.format,r=[];for(let u of Object.keys(n))fp.includes(u)||r.push({line:s([u]),key:"unknownKey",what:u});let i=u=>(Array.isArray(n[u])?n[u]:[]).filter(up),o=(u,f,m)=>(Q(u)||r.push({line:s(m),key:"missing",what:f}),Q(u)),a=(u,f)=>{let m=new Set;f.forEach((d,h)=>{d&&m.has(d)&&r.push({line:s([u,h]),key:"duplicate",what:u,id:d}),m.add(d)})},l=i("agents").map((u,f)=>{let m=Q(u.role);return Ir.includes(m)||r.push({line:s(["agents",f,"role"]),key:"role",what:`agents[${f}].role`,value:m}),{id:o(u.id,`agents[${f}].id`,["agents",f]),role:m}});a("agents",l.map(u=>u.id));let c=i("declared").map((u,f)=>({agent:o(u.agent,`declared[${f}].agent`,["declared",f]),key:o(u.key,`declared[${f}].key`,["declared",f]),value:Q(u.value),source:Q(u.source)}));a("declared",c.map(u=>`${u.agent} ${u.key}`));let p=i("decisions").map((u,f)=>{let m=Q(u.status),d=Q(u.scope);return lp.includes(m)||r.push({line:s(["decisions",f,"status"]),key:"status",value:m}),cp.includes(d)||r.push({line:s(["decisions",f,"scope"]),key:"scope",value:d}),{key:o(u.key,`decisions[${f}].key`,["decisions",f]),status:m,scope:d,why:Q(u.why)}});return a("decisions",p.map(u=>u.key)),r.length?{problems:r}:{cast:{...Q(n.name)?{name:Q(n.name)}:{},agents:l,declared:c,decisions:p},problems:r}}var pp=` What people said about the agents, and what was decided. build.mjs keeps it up to date; edit it, or fill the
|
|
140
|
-
workbook's \xABDeclared\xBB sheet and the \xABDecision\xBB column and read it back with --from.`,hp={agents:t=>Q(t.id),declared:t=>`${Q(t.agent)} ${Q(t.key)}`,decisions:t=>Q(t.key)},mp=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==""&&e!==void 0));function gp(t,e){let n=e?(0,ae.parseDocument)(e):void 0,s=n&&!n.errors.length&&(0,ae.isMap)(n.contents)?n:new ae.Document({format:vt});s!==n&&(s.commentBefore=pp),s.get("format")!==vt&&s.set("format",vt),t.name===void 0?s.delete("name"):s.get("name")!==t.name&&s.set("name",t.name);for(let[r,i]of Object.entries(hp)){let o=t[r];if(!o.length){s.delete(r);continue}let a=s.get(r,!0);if((0,ae.isSeq)(a)||s.set(r,a=s.createNode([])),!(0,ae.isSeq)(a))continue;let l=new Map(a.items.filter(ae.isMap).map(c=>[i(c.toJSON()),c]));a.items=o.map(c=>{let p=mp(c),u=l.get(i(p));if(!u){let f=s.createNode(p);return f.flow=!0,f}for(let[f,m]of Object.entries(p))u.get(f)!==m&&u.set(f,m);for(let f of Object.keys(u.toJSON()))f in p||u.delete(f);return u})}return s.toString({lineWidth:0,flowCollectionPadding:!0})}function yp(t,e="en"){let n=e==="pt";switch(t.key){case"syntax":return n?`n\xE3o se l\xEA como YAML (${t.detail})`:`does not read as YAML (${t.detail})`;case"format":return n?`\xABformat\xBB precisa ser ${t.format}`:`\xABformat\xBB must be ${t.format}`;case"missing":return n?`falta \xAB${t.what}\xBB`:`\xAB${t.what}\xBB is missing`;case"duplicate":return n?`${t.what}: o id \xAB${t.id}\xBB se repete`:`${t.what}: the id \xAB${t.id}\xBB is repeated`;case"unknownKey":return n?`\xAB${t.what}\xBB n\xE3o \xE9 um campo deste arquivo`:`\xAB${t.what}\xBB is not a field of this file`;case"threshold":return n?`\xABthreshold\xBB vai de 0 a 1, como 0.7 (est\xE1 \xAB${t.value}\xBB)`:`\xABthreshold\xBB goes from 0 to 1, like 0.7 (it is \xAB${t.value}\xBB)`;case"minAgents":return n?`\xABmin_agents\xBB \xE9 um n\xFAmero inteiro a partir de 1 (est\xE1 \xAB${t.value}\xBB)`:`\xABmin_agents\xBB is a whole number from 1 (it is \xAB${t.value}\xBB)`;case"role":return n?`\xAB${t.what}\xBB \xE9 orchestrator ou specialist (est\xE1 \xAB${t.value}\xBB)`:`\xAB${t.what}\xBB is orchestrator or specialist (it is \xAB${t.value}\xBB)`;case"status":return n?`\xABstatus\xBB \xE9 accepted ou rejected (est\xE1 \xAB${t.value}\xBB)`:`\xABstatus\xBB is accepted or rejected (it is \xAB${t.value}\xBB)`;case"scope":return n?`\xABscope\xBB \xE9 platform, specialist ou orchestrator (est\xE1 \xAB${t.value}\xBB)`:`\xABscope\xBB is platform, specialist or orchestrator (it is \xAB${t.value}\xBB)`}}var In=[{id:"orchestrator-variables",name:"Orchestrator-Generated Variables",sign:"an OnRecognizedIntent topic with an AutomaticTaskInput that has shouldPromptUser: false"},{id:"rai-error-handling",name:"RAI Error Handling",sign:"the OnError topic reads System.Error.SubCode"},{id:"knowledge-hold-message",name:"Knowledge Hold Message",sign:"an OnKnowledgeRequested topic that sends a message"},{id:"prevent-tool-call-leaks",name:"Prevent Tool Call Leaks",sign:"an OnGeneratedResponse topic that sets System.ContinueResponse"},{id:"dynamic-topic-redirect",name:"Dynamic Topic Redirect",sign:"a BeginDialog whose dialog is a =Switch( expression"},{id:"channel-aware-behavior",name:"Channel-Aware Behavior",sign:"a condition or SetVariable that reads System.Activity.ChannelId (not a tool input)"},{id:"date-context",name:"Date Context",sign:"the instructions use Today() or Now()"},{id:"line-breaks-in-messages",name:"Line Breaks in Messages",sign:"<br /> inside a SendActivity or Question"},{id:"conversation-history-variable",name:"Conversation History Variable"},{id:"chain-of-thought-logging",name:"Chain of Thought Logging"},{id:"deterministic-mcp-calls",name:"Deterministic MCP Calls"},{id:"prevent-child-agent-responses",name:"Prevent Child Agent Responses"},{id:"jit-glossary",name:"JIT Glossary"},{id:"jit-user-context",name:"JIT User Context"},{id:"teams-production-hardening",name:"Teams Production Hardening"}];var bp=/^(no|não|nao|false|off|0)$/i,wp=new Set(In.filter(t=>!t.sign).map(t=>`ms:${t.id}`)),kp=t=>t.includes(":")&&!t.startsWith("declared:")&&!wp.has(t),Sp=t=>t.startsWith("declared:")?t:`declared:${t}`;function vp(t,e,n){let s=Object.fromEntries(n.agents.map(y=>[y.id,y.role])),{roles:r,unmatched:i}=_a(t,e,s),o=y=>e.ignore.includes(y)||!e.microsoftPatterns&&y.startsWith("ms:"),a=[],l=t.map(y=>{let S=Object.fromEntries(Object.entries(y.facts).filter(([A])=>!o(A)));for(let A of n.declared.filter(T=>T.agent===y.id)){let T=!bp.test(A.value);if(kp(A.key)){let N=A.key in y.facts;T!==N&&a.push({agent:y.id,key:A.key,declared:A.value||"yes",observed:N,source:A.source})}else T&&(S[Sp(A.key)]??=[]).push({file:A.source?`declared: ${A.source}`:"declared"})}return{id:y.id,role:r[y.id],...y.schemaName?{schemaName:y.schemaName}:{},...y.displayName?{displayName:y.displayName}:{},facts:S,children:y.children}}),c=y=>l.filter(S=>S.role===y),p=(y,S=l)=>S.filter(A=>y in A.facts),u=(y,S=l)=>S.flatMap(A=>A.facts[y]??[]),f=[...new Set(l.flatMap(y=>Object.keys(y.facts)))].sort(),m=y=>n.decisions.find(S=>S.key===y),d=y=>y==="platform"?l:c(y),h=[];for(let y of["specialist","orchestrator"]){let S=c(y);if(S.length<e.minAgents)continue;let A=c(y==="specialist"?"orchestrator":"specialist");for(let T of f){if(T.startsWith("declared:")||h.some(q=>q.key===T))continue;let w=p(T,S).length/S.length;if(w<e.threshold)continue;let L=A.length>0&&p(T,A).length/A.length>=(A.length>=e.minAgents?e.threshold:1),v=m(T);h.push({key:T,role:y,scope:v?.scope??(L?"platform":y),share:w,agents:p(T).map(q=>q.id),sources:u(T),...v?{decision:v}:{}})}}for(let y of n.decisions.filter(S=>S.status==="accepted"&&!h.some(A=>A.key===S.key))){let S=d(y.scope),A=p(y.key,S);h.push({key:y.key,role:y.scope==="orchestrator"?"orchestrator":"specialist",scope:y.scope,share:S.length?A.length/S.length:0,agents:A.map(T=>T.id),sources:u(y.key),decision:y})}h.sort((y,S)=>y.scope.localeCompare(S.scope)||y.key.localeCompare(S.key));let g=h.filter(y=>y.decision?.status!=="rejected").flatMap(y=>d(y.scope).filter(S=>!(y.key in S.facts)).map(S=>({agent:S.id,key:y.key,scope:y.scope}))).sort((y,S)=>y.agent.localeCompare(S.agent)||y.key.localeCompare(S.key)),k=[],$=[];for(let y of f){if(y.startsWith("declared:"))continue;let S=p(y),A={key:y,agents:S.map(T=>T.id),sources:u(y)};S.every(T=>T.role==="orchestrator")?$.push(A):S.length===1&&k.push(A)}let E=e.rules.map(y=>({rule:y,agents:c(y.role).filter(S=>!(y.has in S.facts)).map(S=>S.id)})).filter(y=>y.agents.length);return{...e.name??n.name?{name:e.name??n.name}:{},roles:r,unmatched:i,agents:l,patterns:h,offPattern:g,solos:k,orchestratorDoes:$,gaps:E,conflicts:a,unknown:t.flatMap(y=>y.unknown.map(S=>({...S,agent:y.id})))}}var Dr={conversation:{en:"A. Conversation",pt:"A. Conversa"},integrations:{en:"B. Integrations",pt:"B. Integra\xE7\xF5es"},knowledge:{en:"C. Knowledge",pt:"C. Conhecimento"},orchestration:{en:"D. Orchestrator",pt:"D. Orquestrador"},governance:{en:"E. Governance",pt:"E. Governan\xE7a"},microsoft:{en:"Microsoft patterns",pt:"Padr\xF5es Microsoft"},declared:{en:"Declared",pt:"Declarado"}},Dn={"trigger:OnConversationStart":{dim:"conversation",en:"Greeting",pt:"Boas-vindas"},"trigger:OnUnknownIntent":{dim:"conversation",en:"Fallback (when it does not understand)",pt:"Fallback (quando n\xE3o entende)"},"trigger:OnEscalate":{dim:"conversation",en:"Escalation to a person",pt:"Escalonamento para humano",lacks:{en:["does not escalate to a person","do not escalate to a person"],pt:["n\xE3o escala para humano","n\xE3o escalam para humano"]}},"trigger:OnError":{dim:"conversation",en:"Error handling",pt:"Tratamento de erro",lacks:{en:["does not handle errors","do not handle errors"],pt:["n\xE3o trata erro","n\xE3o tratam erro"]}},"trigger:OnRecognizedIntent":{dim:"conversation",en:"A topic of its own, by intent",pt:"T\xF3pico pr\xF3prio, por inten\xE7\xE3o"},"trigger:OnRedirect":{dim:"orchestration",en:"Takes a call from the orchestrator",pt:"Recebe chamada do orquestrador",lacks:{en:["takes no call from the orchestrator","take no call from the orchestrator"],pt:["n\xE3o recebe chamada do orquestrador","n\xE3o recebem chamada do orquestrador"]}},"trigger:OnSelectIntent":{dim:"conversation",en:"Disambiguation (\xABdid you mean\u2026\xBB)",pt:"Desambigua\xE7\xE3o (\xABvoc\xEA quis dizer\u2026\xBB)"},"trigger:OnSignIn":{dim:"conversation",en:"Sign-in",pt:"Login"},"trigger:OnGeneratedResponse":{dim:"conversation",en:"Reviews the generated answer",pt:"Revisa a resposta gerada"},"trigger:OnKnowledgeRequested":{dim:"knowledge",en:"Before searching knowledge",pt:"Antes de buscar no conhecimento"},"trigger:OnToolSelected":{dim:"orchestration",en:"Child chosen as a tool",pt:"Filho escolhido como ferramenta"},"trigger:OnActivity":{dim:"conversation",en:"On every message",pt:"Em toda mensagem"},"setting:generative=on":{dim:"conversation",en:"Generative orchestration on",pt:"Orquestra\xE7\xE3o generativa ligada"},"setting:generative=off":{dim:"conversation",en:"Generative orchestration off",pt:"Orquestra\xE7\xE3o generativa desligada"},"setting:connectable":{dim:"orchestration",en:"Can be called by an orchestrator",pt:"Pode ser chamado por um orquestrador"},"topics:with-model-description":{dim:"conversation",en:"Topics described for the model",pt:"T\xF3picos descritos para o modelo"},"instructions:present":{dim:"governance",en:"Has instructions",pt:"Tem instru\xE7\xF5es",lacks:{en:["has no instructions","have no instructions"],pt:["n\xE3o tem instru\xE7\xF5es","n\xE3o t\xEAm instru\xE7\xF5es"]}},"node:LogCustomTelemetryEvent":{dim:"governance",en:"Logs telemetry",pt:"Registra telemetria",lacks:{en:["logs no telemetry","log no telemetry"],pt:["n\xE3o registra telemetria","n\xE3o registram telemetria"]}},"node:CSATQuestion":{dim:"governance",en:"Asks for satisfaction (CSAT)",pt:"Pergunta a satisfa\xE7\xE3o (CSAT)",lacks:{en:["does not ask for satisfaction","do not ask for satisfaction"],pt:["n\xE3o pergunta a satisfa\xE7\xE3o","n\xE3o perguntam a satisfa\xE7\xE3o"]}},"node:SearchAndSummarizeContent":{dim:"knowledge",en:"Generative answers from knowledge",pt:"Respostas generativas sobre o conhecimento"},"node:SearchKnowledgeSources":{dim:"knowledge",en:"Searches the knowledge sources",pt:"Busca nas fontes de conhecimento"},"yaml-only:triggerCondition":{dim:"knowledge",en:"Search condition only in YAML (the editor may erase it)",pt:"Condi\xE7\xE3o de busca s\xF3 no YAML (a tela pode apagar)"},"knowledge:SharePointSearchSource":{dim:"knowledge",en:"Knowledge in SharePoint",pt:"Conhecimento no SharePoint"},"declared:kpi":{dim:"declared",en:"KPI declared",pt:"KPI declarado",lacks:{en:["has no KPI declared","have no KPI declared"],pt:["n\xE3o tem KPI declarado","n\xE3o t\xEAm KPI declarado"]}},"declared:owner":{dim:"declared",en:"Owner declared",pt:"Dono declarado",lacks:{en:["has no owner declared","have no owner declared"],pt:["n\xE3o tem dono declarado","n\xE3o t\xEAm dono declarado"]}}},$p=Object.fromEntries(In.map(t=>[t.id,t.name])),Ap=[["calls:topic:","conversation","Calls the topic","Chama o t\xF3pico"],["trigger:","conversation","Trigger","Gatilho"],["setting:","conversation","Setting","Configura\xE7\xE3o"],["connector:","integrations","Connector","Conector"],["operation:","integrations","Operation","Opera\xE7\xE3o"],["connref:","integrations","Connection reference","Refer\xEAncia de conex\xE3o"],["mcp:","integrations","MCP server","Servidor MCP"],["flow:","integrations","Flow","Fluxo"],["knowledge:","knowledge","Knowledge","Conhecimento"],["node:","governance","Node","N\xF3"],["calls:","orchestration","Calls","Chama"],["child:","orchestration","Child","Filho"],["var-in:","orchestration","Receives from the orchestrator","Recebe do orquestrador"],["var:","orchestration","Global variable","Vari\xE1vel global"],["model:","governance","Model","Modelo"],["auth:","governance","Sign-in","Login"],["ms:","microsoft","Microsoft pattern:","Padr\xE3o Microsoft:"],["declared:","declared","Declared:","Declarado:"]],Fa=t=>Ap.find(([e])=>t.startsWith(e)),ja=t=>!!Dn[t]?.lacks;function Rn(t){return Dn[t]?.dim??Fa(t)?.[1]??"governance"}function ee(t,e){let n=Dn[t];if(n)return n[e];let s=/^knowledge:count=(\d+)$/.exec(t);if(s){let o=Number(s[1]);return e==="pt"?`${o} ${o===1?"fonte":"fontes"} de conhecimento`:`${o} knowledge ${o===1?"source":"sources"}`}let r=Fa(t);if(!r)return t;let i=t.slice(r[0].length);return r[0]==="ms:"&&(i=$p[i]??i),r[0]==="auth:"&&i==="None"?e==="pt"?"Sem login":"No sign-in":`${r[e==="pt"?3:2]} ${i}`}function _n(t,e,n){let s=Dn[t]?.lacks?.[e];if(s)return s[n===1?0:1];if(t.startsWith("calls:topic:"))return e==="pt"?`${n===1?"n\xE3o chama":"n\xE3o chamam"} o t\xF3pico ${t.slice(12)}`:`${n===1?"does":"do"} not call the topic ${t.slice(12)}`;let r=ee(t,e);return e==="pt"?`${n===1?"n\xE3o tem":"n\xE3o t\xEAm"} \xAB${r}\xBB`:`${n===1?"does":"do"} not have \xAB${r}\xBB`}var Op={specialist:{en:["specialist","specialists"],pt:["especialista","especialistas"]},orchestrator:{en:["orchestrator","orchestrators"],pt:["orquestrador","orquestradores"]}},Ee=(t,e,n)=>Op[t][e][n===1?0:1],Fn={en:{summary:"Summary",matrix:"Matrix",patterns:"Patterns",off:"Off pattern",gaps:"Gaps",conflicts:"Conflicts",agents:"Cast",evidence:"Evidence",declared:"Declared",unknown:"Not understood",dimension:"Dimension",fact:"Fact",key:"Key",agent:"Who",name:"Name",role:"Role",scope:"Scope",share:"Share",have:"Who has it",lack:"Who lacks it",decision:"Decision",why:"Why",missing:"Missing",accepted:"Accepted pattern",rule:"Rule",says:"Says",notMet:"Who does not meet it",value:"Value",source:"Source",inYaml:"In the YAML",file:"File",line:"Line",facts:"Facts",alone:"Only it has",children:"Children",kind:"Kind",yes:"yes",no:"no",accept:"accepted",reject:"rejected",platform:"platform",specialist:"specialist",orchestrator:"orchestrator",title:"The cast, compared",look:"To look at",nothing:"Nothing to look at",privacy:"This file holds the client\u2019s data: keep it in the client\u2019s environment.",count:{agents:"In the cast",orchestrators:"Orchestrators",specialists:"Specialists",patterns:"Patterns",off:"Off a pattern",gaps:"Rules not met",conflicts:"Conflicts",solos:"Only one has it"},why_:{yaml:"YAML that does not read",empty:"empty",kind:"a kind Copilot Studio does not have",file:"not a Copilot Studio file"}},pt:{summary:"Resumo",matrix:"Matriz",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Lacunas",conflicts:"Conflitos",agents:"Elenco",evidence:"Evid\xEAncias",declared:"Declarado",unknown:"N\xE3o entendeu",dimension:"Dimens\xE3o",fact:"Fato",key:"Chave",agent:"Quem",name:"Nome",role:"Papel",scope:"Escopo",share:"Quantos",have:"Quem tem",lack:"Quem falta",decision:"Decis\xE3o",why:"Por qu\xEA",missing:"Falta",accepted:"Padr\xE3o aceito",rule:"Regra",says:"Diz",notMet:"Quem n\xE3o cumpre",value:"Valor",source:"Fonte",inYaml:"No YAML",file:"Arquivo",line:"Linha",facts:"Fatos",alone:"S\xF3 ele tem",children:"Filhos",kind:"Kind",yes:"sim",no:"n\xE3o",accept:"aceito",reject:"rejeitado",platform:"plataforma",specialist:"especialista",orchestrator:"orquestrador",title:"Elenco comparado",look:"Para olhar",nothing:"Nada para olhar",privacy:"Este arquivo tem dados do cliente: deixe-o no ambiente dele.",count:{agents:"No elenco",orchestrators:"Orquestradores",specialists:"Especialistas",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Regras n\xE3o cumpridas",conflicts:"Conflitos",solos:"S\xF3 um tem"},why_:{yaml:"YAML que n\xE3o se l\xEA",empty:"vazio",kind:"um kind que o Copilot Studio n\xE3o tem",file:"n\xE3o \xE9 arquivo do Copilot Studio"}}};var $t=t=>t.join(", ");function Np(t){let e=[];for(let i of t.conflicts){let o=i.source?`\xAB${i.source}\xBB`:null,[a,l]=[ee(i.key,"en"),ee(i.key,"pt")];e.push(i.observed?{key:"conflict",agents:[i.agent],fact:i.key,en:`${i.agent}: ${o??"what was declared"} says it does not have \xAB${a}\xBB, but the YAML has it`,pt:`${i.agent}: ${o??"o declarado"} diz que n\xE3o tem \xAB${l}\xBB, mas o YAML tem`}:{key:"conflict",agents:[i.agent],fact:i.key,en:`${i.agent}: ${o??"what was declared"} says it has \xAB${a}\xBB, but the YAML does not`,pt:`${i.agent}: ${o??"o declarado"} diz que tem \xAB${l}\xBB, mas o YAML n\xE3o tem`})}let n=new Map;for(let i of t.offPattern){let o=t.roles[i.agent],a=n.get(`${i.key} ${o}`)??{key:i.key,role:o,agents:[]};a.agents.push(i.agent),n.set(`${i.key} ${o}`,a)}for(let i of n.values()){let o=i.agents.length,a=t.patterns.find(c=>c.key===i.key)?.decision?.status==="accepted",l=c=>`${o} ${Ee(i.role,c,o)} ${_n(i.key,c,o)} (${$t(i.agents)})`;e.push({key:"off",agents:i.agents,fact:i.key,en:a?`${l("en")}, and the pattern was accepted: correct it?`:`${l("en")}: on purpose?`,pt:a?`${l("pt")}, e o padr\xE3o foi aceito: corrigir?`:`${l("pt")}: \xE9 intencional?`})}for(let i of t.gaps){let o=i.agents.filter(l=>!t.offPattern.some(c=>c.agent===l&&c.key===i.rule.has)).sort(),a=o.length;a&&e.push({key:"gap",agents:o,fact:i.rule.has,en:`Rule \xAB${i.rule.says}\xBB: ${a} ${Ee(i.rule.role,"en",a)} ${a===1?"does":"do"} not meet it (${$t(o)})`,pt:`Regra \xAB${i.rule.says}\xBB: ${a} ${Ee(i.rule.role,"pt",a)} n\xE3o ${a===1?"cumpre":"cumprem"} (${$t(o)})`})}let s=new Set(t.solos.filter(i=>/^(connector|mcp):/.test(i.key)).map(i=>`${i.agents[0]} ${i.key.slice(i.key.indexOf(":")+1)}`));for(let i of t.solos){let o=i.agents[0],a=i.key.startsWith("connref:")?i.key.slice(8):i.key.startsWith("operation:")?i.key.slice(10).split("/")[0]:void 0;a&&s.has(`${o} ${a}`)||e.push({key:"solo",agents:[o],fact:i.key,en:`Only ${o} has \xAB${ee(i.key,"en")}\xBB: innovation or debt?`,pt:`S\xF3 ${o} tem \xAB${ee(i.key,"pt")}\xBB: inova\xE7\xE3o ou d\xEDvida?`})}let r=new Map;for(let i of t.unknown)r.set(i.agent,[...r.get(i.agent)??[],i.file]);for(let[i,o]of r){let a=o.length;e.push({key:"unknown",agents:[i],en:`${i}: the analysis did not understand ${a} ${a===1?"file":"files"} (${$t(o)})`,pt:`${i}: a an\xE1lise n\xE3o entendeu ${a} ${a===1?"arquivo":"arquivos"} (${$t(o)})`})}for(let i of t.unmatched)e.push({key:"unmatched",agents:[],en:`The profile names \xAB${i}\xBB, which is not in the folder`,pt:`O perfil cita \xAB${i}\xBB, que n\xE3o est\xE1 na pasta`});return e}function At(t){let e=n=>n.share===1&&!n.decision&&!t.offPattern.some(s=>s.key===n.key);return{look:t.patterns.filter(n=>!e(n)),everyone:t.patterns.filter(e)}}var Ba=new TextEncoder,Rr=t=>t.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e]).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,""),Ot=t=>t<26?String.fromCharCode(65+t):Ot(Math.floor(t/26)-1)+String.fromCharCode(65+t%26),Ep=t=>t.replace(/[:\\/?*[\]]/g," ").slice(0,31)||"Sheet";function Cp(t){let e=[{}],n=f=>JSON.stringify([f.bold??!1,f.fill??"",f.color??"",f.center??!1,f.wrap??!1]),s=new Map([[n({}),0]]);for(let f of t)for(let m of f.rows)for(let d of m){if(typeof d!="object")continue;let{v:h,...g}=d,k=n(g);s.has(k)||(s.set(k,e.length),e.push(g))}let r=new Map([["|",0]]),i=new Map([["",0]]),o=f=>{let m=`${f.bold?"b":""}|${f.color??""}`;return r.has(m)||r.set(m,r.size),r.get(m)},a=f=>f.fill?(i.has(f.fill)||i.set(f.fill,i.size+1),i.get(f.fill)):0,l=e.map(f=>{let m=f.center||f.wrap?`<alignment${f.center?' horizontal="center"':""}${f.wrap?' wrapText="1"':""} vertical="top"/>`:'<alignment vertical="top"/>';return`<xf numFmtId="0" fontId="${o(f)}" fillId="${a(f)}" borderId="${f.fill||f.bold?1:0}" xfId="0" applyFont="1" applyFill="1" applyBorder="1" applyAlignment="1">${m}</xf>`}),c=[...r.keys()].map(f=>{let[m,d]=f.split("|");return`<font>${m?"<b/>":""}<sz val="11"/>${d?`<color rgb="FF${d}"/>`:""}<name val="Calibri"/><family val="2"/></font>`}),p=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>',...[...i.keys()].filter(Boolean).map(f=>`<fill><patternFill patternType="solid"><fgColor rgb="FF${f}"/><bgColor indexed="64"/></patternFill></fill>`)];return{xml:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
139
|
+
`,n)+1}return{type: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=Kn(t),s=Ge(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=Kn(t),s=Ge(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())}}};_a.Parser=Fi});var za=C(qt=>{"use strict";var Ba=Oi(),ap=$t(),Tt=Ot(),lp=vs(),cp=D(),fp=Di(),Ka=ji();function Ua(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new fp.LineCounter||null,prettyErrors:t}}function up(e,t={}){let{lineCounter:n,prettyErrors:s}=Ua(t),i=new Ka.Parser(n?.addNewLine),r=new Ba.Composer(t),o=Array.from(r.compose(i.parse(e)));if(s&&n)for(let a of o)a.errors.forEach(Tt.prettifyError(e,n)),a.warnings.forEach(Tt.prettifyError(e,n));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Ya(e,t={}){let{lineCounter:n,prettyErrors:s}=Ua(t),i=new Ka.Parser(n?.addNewLine),r=new Ba.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 Tt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(Tt.prettifyError(e,n)),o.warnings.forEach(Tt.prettifyError(e,n))),o}function dp(e,t,n){let s;typeof t=="function"?s=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=Ya(e,n);if(!i)return null;if(i.warnings.forEach(r=>lp.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 pp(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 cp.isDocument(e)&&!s?e.toString(n):new ap.Document(e,s,n).toString(n)}qt.parse=dp;qt.parseAllDocuments=up;qt.parseDocument=Ya;qt.stringify=pp});var zn=C(j=>{"use strict";var hp=Oi(),mp=$t(),gp=ri(),_i=Ot(),yp=ot(),Ce=D(),bp=Ae(),wp=V(),kp=Ne(),Sp=Ee(),$p=_n(),vp=Ii(),Ap=Di(),Op=ji(),Yn=za(),Va=nt();j.Composer=hp.Composer;j.Document=mp.Document;j.Schema=gp.Schema;j.YAMLError=_i.YAMLError;j.YAMLParseError=_i.YAMLParseError;j.YAMLWarning=_i.YAMLWarning;j.Alias=yp.Alias;j.isAlias=Ce.isAlias;j.isCollection=Ce.isCollection;j.isDocument=Ce.isDocument;j.isMap=Ce.isMap;j.isNode=Ce.isNode;j.isPair=Ce.isPair;j.isScalar=Ce.isScalar;j.isSeq=Ce.isSeq;j.Pair=bp.Pair;j.Scalar=wp.Scalar;j.YAMLMap=kp.YAMLMap;j.YAMLSeq=Sp.YAMLSeq;j.CST=$p;j.Lexer=vp.Lexer;j.LineCounter=Ap.LineCounter;j.Parser=Op.Parser;j.parse=Yn.parse;j.parseAllDocuments=Yn.parseAllDocuments;j.parseDocument=Yn.parseDocument;j.stringify=Yn.stringify;j.visit=Va.visit;j.visitAsync=Va.visitAsync});import{readdirSync as Wl,readFileSync as Jl}from"node:fs";import{basename as Gl,join as os}from"node:path";var Xl=/^agent\.mcs\.ya?ml$/,Hl=/\.ya?ml$/,tr=e=>Wl(e,{withFileTypes:!0}).filter(t=>!t.name.startsWith(".")&&t.name!=="node_modules");function nr(e,t=""){return tr(e).flatMap(n=>{let s=t?`${t}/${n.name}`:n.name;return n.isDirectory()?nr(os(e,n.name),s):n.isFile()?[{path:s,text:Hl.test(n.name)?Jl(os(e,n.name),"utf8"):""}]:[]})}function sr(e){let t=tr(e);return t.some(n=>n.isFile()&&Xl.test(n.name))?[{id:Gl(e),dir:e,files:nr(e)}]:t.filter(n=>n.isDirectory()).flatMap(n=>sr(os(e,n.name)))}var ue=rs(zn()),W=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:void 0,B=e=>typeof e=="string"&&e.trim()?e:void 0,Bi=e=>Array.isArray(e)?e:[];function Np(e){if(!e.trim())return"empty";let t=new ue.LineCounter,n=(0,ue.parseDocument)(e,{lineCounter:t,uniqueKeys:!1});if(n.errors.length)return"yaml";let s=new WeakMap,i=o=>{if((0,ue.isMap)(o)){let a={};o.range&&s.set(a,o.range[0]);for(let c of o.items)a[String((0,ue.isScalar)(c.key)?c.key.value:c.key)]=i(c.value);return a}return(0,ue.isSeq)(o)?o.items.map(i):(0,ue.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*Mt(e){if(Array.isArray(e))for(let n of e)yield*Mt(n);let t=W(e);if(t){typeof t.kind=="string"&&(yield t);for(let n of Object.values(t))yield*Mt(n)}}var Pt=e=>e.split(".")[1]??e,Xe=(e,t)=>e.slice(e.lastIndexOf(t)+(e.includes(t)?t.length:0)),Ep=/(^|[\s._-])(copy|c[oó]pia|new|test|teste)([\s._-]|$)|\.[a-z]{2}-[A-Z]{2}(\.topic)?\.mcs\.ya?ml$/i,xp=5e4;function Cp(e,t){let n=e.split(`
|
|
140
|
+
`),s=n.findIndex(i=>new RegExp(`^\\s*${t}:`).test(i));return s<0?1:/:\s*[|>][-+]?\s*$/.test(n[s])?s+2:s+1}var Tp=new Set(["LogCustomTelemetryEvent","CSATQuestion","SearchAndSummarizeContent","SearchKnowledgeSources"]);function qp(e,t,n){let s={id:e,facts:{},children:[],unknown:[],names:{},texts:[]},i=[],r=new Map,o=[],a=c=>Xe(c,"/").replace(/(\.topic)?\.mcs\.ya?ml$|\.ya?ml$/,"");for(let c of[...t].sort((l,d)=>l.path.localeCompare(d.path))){if(!/\.ya?ml$/.test(c.path)){s.unknown.push({file:c.path,why:"file"});continue}let l=Np(c.text);if(l==="yaml"||l==="empty"){s.unknown.push({file:c.path,why:l});continue}let d=W(l.data),f=/^agents\/([^/]+)\//.exec(c.path)?.[1],u=s.facts;if(f){let h=s.children.find(k=>k.name===f);h||s.children.push(h={name:f,facts:{}}),u=h.facts}let p=(h,k,x=u)=>(x[h]??=[]).push({file:c.path,line:l.lineOf(k??d)});if(f&&p(`child:${f}`,d,s.facts),!f&&/^settings\.mcs\.ya?ml$/.test(c.path)&&d){s.schemaName=B(d.schemaName)??s.schemaName,s.displayName=B(d.displayName)??s.displayName,B(d.authenticationMode)&&p(`auth:${d.authenticationMode}`);let h=W(d.configuration),k=W(h?.settings)?.GenerativeActionsEnabled;typeof k=="boolean"&&p(`setting:generative=${k?"on":"off"}`,h),h?.isAgentConnectable===!0&&p("setting:connectable",h);continue}let y=n?[...Mt(d)].map(h=>h.kind).find(h=>!n.has(h)):void 0;if(y&&s.unknown.push({file:c.path,why:"kind",kind:y}),typeof d?.kind!="string"){y||s.unknown.push({file:c.path,why:"kind"});continue}let g=c.text,w=(h,k,x)=>{f||!B(x)||Ep.test(Xe(c.path,"/"))||s.texts.push({source:h,file:c.path,line:Cp(g,k),text:x.trimEnd().slice(0,xp)})},N=(h,k)=>{B(h)&&(p("instructions:present",k),/\b(Today|Now)\(\)/.test(h)&&p("ms:date-context",k))};switch(d.kind){case"GptComponentMetadata":{s.displayName??=B(d.displayName),N(d.instructions,d),w("instructions","instructions",d.instructions),w("instructions","responseInstructions",d.responseInstructions);let h=W(d.aISettings),k=O=>O===!0?"on":"off";typeof h?.useModelKnowledge=="boolean"&&p(`setting:model-knowledge=${k(h.useModelKnowledge)}`,h),B(h?.contentModeration)&&p(`setting:moderation=${h.contentModeration.toLowerCase()}`,h),typeof h?.isSemanticSearchEnabled=="boolean"&&p(`setting:semantic-search=${k(h.isSemanticSearchEnabled)}`,h);let x=W(d.gptCapabilities);typeof x?.webBrowsing=="boolean"&&p(`setting:web-browsing=${k(x.webBrowsing)}`,x);let S=W(W(d.aISettings)?.model);B(S?.modelNameHint)&&p(`model:${S.modelNameHint}`,S);break}case"AgentDialog":{let h=W(d.beginDialog);B(h?.kind)&&p(`trigger:${h.kind}`,h),N(W(d.settings)?.instructions,d.settings);break}case"AdaptiveDialog":{let h=W(d.beginDialog),k=B(h?.kind);k&&p(`trigger:${k}`,h),k&&r.set(`${f??""}/${a(c.path)}`,k),B(d.modelDescription)&&p("topics:with-model-description"),w("descriptions","modelDescription",d.modelDescription);let x=Bi(d.inputs).some(S=>W(S)?.kind==="AutomaticTaskInput"&&W(S)?.shouldPromptUser===!1);k==="OnRecognizedIntent"&&x&&p("ms:orchestrator-variables",h),k==="OnError"&&g.includes("System.Error.SubCode")&&p("ms:rai-error-handling",h),k==="OnKnowledgeRequested"&&[...Mt(h)].some(S=>S.kind==="SendActivity")&&p("ms:knowledge-hold-message",h),k==="OnGeneratedResponse"&&g.includes("System.ContinueResponse")&&p("ms:prevent-tool-call-leaks",h);break}case"TaskDialog":{let h=W(d.action);w("descriptions","modelDescription",d.modelDescription);let k=B(h?.connectionReference);if(h?.kind==="InvokeConnectorTaskAction"&&k&&(p(`connector:${Pt(k)}`,h),B(h.operationId)&&p(`operation:${Pt(k)}/${h.operationId}`,h)),h?.kind==="InvokeExternalAgentTaskAction"&&W(h.operationDetails)?.kind==="ModelContextProtocolMetadata"&&k&&p(`mcp:${Pt(k)}`,h),h?.kind==="InvokeConnectedAgentTaskAction"&&B(h.botSchemaName)&&p(`calls:${h.botSchemaName}`,h),h?.kind==="InvokeFlowTaskAction"&&B(h.flowId)){p(`flow:${h.flowId}`,h);let x=B(d.modelDisplayName)??B(W(d["mcs.metadata"])?.componentName);x&&(s.names[h.flowId]??=x)}break}case"KnowledgeSourceConfiguration":{let h=W(d.source);B(h?.kind)&&p(`knowledge:${h.kind}`,h),h&&"triggerCondition"in h&&p("yaml-only:triggerCondition",h),i.push({file:c.path,line:l.lineOf(d)});break}case"GlobalVariableComponent":{let h=W(d.variable)??d,k=B(h.name)??(B(d.schemaName)?Xe(d.schemaName,"."):void 0);if(!k)break;p(`var:${k}`),h.isExternalInitializationAllowed===!0&&p(`var-in:${k}`);break}case"ConnectionReferencesSourceFile":for(let h of Bi(d.connectionReferences).map(W)){let k=B(h?.connectorId)?Xe(h.connectorId,"/"):B(h?.connectionReferenceLogicalName)?Pt(h.connectionReferenceLogicalName):void 0;k&&p(`connref:${k}`,h),k&&B(h?.displayName)&&(s.names[k]=h.displayName)}break}for(let h of Mt(d)){if(Tp.has(h.kind)&&p(`node:${h.kind}`,h),h.kind==="InvokeConnectorAction"&&B(h.connectionReference)){let x=Pt(h.connectionReference);p(`connector:${x}`,h),B(h.operationId)&&p(`operation:${x}/${h.operationId}`,h)}if(h.kind==="InvokeFlowAction"&&B(h.flowId)&&p(`flow:${h.flowId}`,h),(h.kind==="BeginDialog"||h.kind==="ReplaceDialog")&&B(h.dialog)){let x=h.dialog;x.startsWith("=")?x.includes("Switch(")&&p("ms:dynamic-topic-redirect",h):o.push({topic:`${f??""}/${Xe(x,".topic.")}`,into:u,at:{file:c.path,line:l.lineOf(h)}})}let k=x=>typeof x=="string"&&x.includes("System.Activity.ChannelId");(h.kind==="ConditionGroup"&&Bi(h.conditions).some(x=>k(W(x)?.condition))||h.kind==="SetVariable"&&k(h.value))&&p("ms:channel-aware-behavior",h),(h.kind==="SendActivity"||h.kind==="Question")&&JSON.stringify(h).includes("<br")&&p("ms:line-breaks-in-messages",h)}}i.length&&(s.facts[`knowledge:count=${i.length}`]=i);for(let c of o){let l=r.get(c.topic);(c.into[l?`reaches:${l}`:`calls:topic:${Xe(c.topic,"/")}`]??=[]).push(c.at)}for(let c of[s.facts,...s.children.map(l=>l.facts)])for(let[l,d]of Object.entries(c))c[l]=d.filter((f,u)=>d.findIndex(p=>p.file===f.file&&p.line===f.line)===u);return s}function Pp(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 He=rs(zn(),1);function Vn(e,t){let n=new He.LineCounter,s=(0,He.parseDocument)(e,{lineCounter:n,prettyErrors:!1}),i=o=>{for(let a=o;a.length;a=a.slice(0,-1)){let c=s.getIn(a,!0);if(c?.range)return n.linePos(c.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,He.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 Wn=[{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 Ki={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"}},Jn={"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"},"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"]}}},Mp=Object.fromEntries(Wn.map(e=>[e.id,e.name])),Lp=[["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:"]],Ja=e=>Lp.find(([t])=>e.startsWith(t)),Ga=e=>!!Jn[e]?.lacks;function Lt(e){return e.startsWith("reaches:")?Lt(`trigger:${e.slice(8)}`):Jn[e]?.dim??Ja(e)?.[1]??"governance"}var Te=(e,t)=>t.endsWith("*")?e.startsWith(t.slice(0,-1)):e===t,Qe=e=>e.startsWith("reaches:")?`trigger:${e.slice(8)}`:void 0,Wa=(e,t)=>t?.[e]??e;function ae(e,t,n){let s=Jn[e];if(s)return s[t];if(e.startsWith("text:block:")){let a=e.endsWith("~variant"),c=a?e.slice(0,-8):e,l=n?.[c]??c.slice(11);return a?`${l} (${t==="pt"?"varia\xE7\xE3o":"variation"})`:l}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,c]=[e.slice(5).split("=")[0],e.includes("=")?e.slice(e.indexOf("=")+1):void 0],l=n?.[`text:${a}`]??a;return c===void 0?l:`${l} = ${c}`}if(e.startsWith("reaches:")){let a=ae(`trigger:${e.slice(8)}`,t);return t==="pt"?`Um t\xF3pico leva a \xAB${a}\xBB`:`A topic leads to \xAB${a}\xBB`}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=Ja(e);if(!r)return e;let o=e.slice(r[0].length);if(r[0]==="ms:"&&(o=Mp[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:"].includes(r[0])&&(o=Wa(o,n)),r[0]==="operation:"){let[a,c]=[o.slice(0,o.indexOf("/")),o.slice(o.indexOf("/")+1)];o=`${Wa(a,n)} \xB7 ${c}`}return`${r[t==="pt"?3:2]} ${o}`}function Gn(e,t,n,s){let i=Jn[e]?.lacks?.[t];if(i)return i[n===1?0:1];if(e.startsWith("reaches:")){let o=ae(`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("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=ae(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 Xa="cast-list/profile-v1",Yi=["orchestrator","specialist"],Ui={roles:{},threshold:.7,minAgents:3,rules:[],markers:[],blocks:[],types:[],focusAreas:[],ignore:[],microsoftPatterns:!0},Ip=["format","name","roles","threshold","min_agents","rules","markers","blocks","types","focus_areas","ignore","microsoft_patterns"],Rp=["instructions","descriptions","all"],Dp=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"]),Fp=e=>Dp.has(e.split(":")[0]),De=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Y=e=>typeof e=="string"?e.trim():typeof e=="number"?String(e):"",Xn=e=>Array.isArray(e)?e.map(Y).filter(Boolean):Y(e)?[Y(e)]:[],Ha=e=>Yi.includes(e);function jp(e){let t=Vn(e,Xa);if(!t.ok)return{problems:[t.problem.key==="format"?{...t.problem,format:Xa}:t.problem]};let{raw:n,at:s}=t.format,i=[];for(let S of Object.keys(n))Ip.includes(S)||i.push({line:s([S]),key:"unknownKey",what:S});let r=(S,O,q)=>(Y(S)||i.push({line:s(q),key:"missing",what:O}),Y(S)),o=(S,O)=>{let q=new Set;O.forEach((E,I)=>{E&&q.has(E)&&i.push({line:s([S,I]),key:"duplicate",what:S,id:E}),q.add(E)})},a=S=>Array.isArray(n[S])?n[S]:[],c=n.threshold===void 0?Ui.threshold:Number(n.threshold);c>0&&c<=1||i.push({line:s(["threshold"]),key:"threshold",value:Y(n.threshold)});let l=n.min_agents===void 0?Ui.minAgents:Number(n.min_agents);Number.isInteger(l)&&l>=1||i.push({line:s(["min_agents"]),key:"minAgents",value:Y(n.min_agents)});let d={},f=De(n.roles)?n.roles:{};for(let S of Object.keys(f))Ha(S)?d[S]=Y(f[S])==="*"?"*":Xn(f[S]):i.push({line:s(["roles",S]),key:"role",what:`roles.${S}`,value:S});let u=(S,O,q)=>(Ha(Y(S))||i.push({line:s(q),key:"role",what:O,value:Y(S)}),Y(S)),p=(S,O,q)=>{let E=Xn(S);for(let I of E)Fp(I)||i.push({line:s(q),key:"prefix",what:O,value:I});return E},y=a("rules").filter(De).map((S,O)=>{let q=`rules[${O}]`,E=p(S.has,q,["rules",O])[0],I=p(S.not,q,["rules",O])[0],b=p(S.when,q,["rules",O]);return!E&&!I&&i.push({line:s(["rules",O]),key:"rule",what:q}),{id:r(S.id,`${q}.id`,["rules",O]),...S.role!==void 0?{role:u(S.role,`${q}.role`,["rules",O,"role"])}:{},...b.length?{when:b}:{},...E?{has:E}:{},...I?{not:I}:{},says:Y(S.says)||E||`not ${I}`}});o("rules",y.map(S=>S.id));let g=a("markers").filter(De).map((S,O)=>{let q=`markers[${O}]`,E=r(S.pattern,`${q}.pattern`,["markers",O]);try{E&&new RegExp(E,"i")}catch(m){i.push({line:s(["markers",O]),key:"regex",what:`${q}.pattern`,detail:m.message.replace(/^Invalid regular expression: /,"")})}let I=Y(S.in)||"instructions";Rp.includes(I)||i.push({line:s(["markers",O]),key:"in",what:`${q}.in`,value:I});let b=r(S.id,`${q}.id`,["markers",O]);return{id:b,name:Y(S.name)||b,in:I,pattern:E,...Y(S.value)?{value:Y(S.value)}:{}}});o("markers",g.map(S=>S.id));let w=a("blocks").filter(De).map((S,O)=>{let q=r(S.id,`blocks[${O}].id`,["blocks",O]);return{id:q,name:Y(S.name)||q,text:r(S.text,`blocks[${O}].text`,["blocks",O]),role:S.role!==void 0?u(S.role,`blocks[${O}].role`,["blocks",O,"role"]):"specialist"}});o("blocks",w.map(S=>S.id));let N=a("types").filter(De).map((S,O)=>{let q=`types[${O}]`,E=De(S.when)?S.when:{},I=Object.fromEntries(["all","any","none"].filter(v=>E[v]!==void 0).map(v=>[v,p(E[v],q,["types",O])]));!I.all?.length&&!I.any?.length&&i.push({line:s(["types",O]),key:"when",what:q});let b=S.min_agents===void 0?2:Number(S.min_agents);Number.isInteger(b)&&b>=1||i.push({line:s(["types",O,"min_agents"]),key:"minAgents",value:Y(S.min_agents)});let m=r(S.id,`${q}.id`,["types",O]);return{id:m,name:Y(S.name)||m,when:I,minAgents:b}});o("types",N.map(S=>S.id));let h=a("focus_areas").filter(De).map((S,O)=>{let q=Xn(S.facts);q.length||i.push({line:s(["focus_areas",O]),key:"missing",what:`focus_areas[${O}].facts`});let E=r(S.id,`focus_areas[${O}].id`,["focus_areas",O]);return{id:E,name:Y(S.name)||E,facts:q}});o("focus_areas",h.map(S=>S.id));let k=n.microsoft_patterns,x={...Y(n.name)?{name:Y(n.name)}:{},roles:d,threshold:c,minAgents:l,rules:y,markers:g,blocks:w,types:N,focusAreas:h,ignore:Xn(n.ignore),microsoftPatterns:!(k===!1||Y(k).toLowerCase()==="off")};return i.length?{problems:i}:{profile:x,problems:i}}var _p=e=>Object.keys(e.facts).some(t=>t.startsWith("calls:")&&!t.startsWith("calls:topic:"));function Qa(e,t,n={}){let{orchestrator:s,specialist:i}=t.roles,r=(l,d)=>Array.isArray(l)&&l.includes(d),o=Object.fromEntries(e.map(l=>[l.id,r(s,l.id)?"orchestrator":r(i,l.id)?"specialist":n[l.id]??(s==="*"?"orchestrator":i==="*"?"specialist":_p(l)?"orchestrator":"specialist")])),a=new Set(e.map(l=>l.id)),c=[s,i].flatMap(l=>Array.isArray(l)?l:[]).filter(l=>!a.has(l));return{roles:o,unmatched:c}}function Za(e,t,n,s){let i=(r,o)=>Object.keys(r).some(a=>Te(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(c=>i(r.facts,c))&&(!a.any?.length||a.any.some(c=>i(r.facts,c)))&&!(a.none??[]).some(c=>i(r.facts,c)));return[r.id,o.map(a=>a.id)]}))}var he=rs(zn());var It="cast-list/cast-v1",Bp=["accepted","rejected"],Kp=["platform","specialist","orchestrator"],Up=e=>Kp.includes(e)||/^type:[\w-]+$/.test(e),Yp=["format","name","agents","blocks","declared","decisions"],zp=e=>!!e&&typeof e=="object"&&!Array.isArray(e),H=e=>typeof e=="string"?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"";function Vp(e){let t=Vn(e,It);if(!t.ok)return{problems:[t.problem.key==="format"?{...t.problem,format:It}:t.problem]};let{raw:n,at:s}=t.format,i=[];for(let u of Object.keys(n))Yp.includes(u)||i.push({line:s([u]),key:"unknownKey",what:u});let r=u=>(Array.isArray(n[u])?n[u]:[]).filter(zp),o=(u,p,y)=>(H(u)||i.push({line:s(y),key:"missing",what:p}),H(u)),a=(u,p)=>{let y=new Set;p.forEach((g,w)=>{g&&y.has(g)&&i.push({line:s([u,w]),key:"duplicate",what:u,id:g}),y.add(g)})},c=r("agents").map((u,p)=>{let y=H(u.role);Yi.includes(y)||i.push({line:s(["agents",p,"role"]),key:"role",what:`agents[${p}].role`,value:y});let g=Array.isArray(u.types)?u.types.map(H).filter(Boolean):[];return{id:o(u.id,`agents[${p}].id`,["agents",p]),role:y,...g.length?{types:g}:{}}}),l=r("blocks").map((u,p)=>({id:o(u.id,`blocks[${p}].id`,["blocks",p]),text:o(u.text,`blocks[${p}].text`,["blocks",p])}));a("blocks",l.map(u=>u.id)),a("agents",c.map(u=>u.id));let d=r("declared").map((u,p)=>({agent:o(u.agent,`declared[${p}].agent`,["declared",p]),key:o(u.key,`declared[${p}].key`,["declared",p]),value:H(u.value),source:H(u.source)}));a("declared",d.map(u=>`${u.agent} ${u.key}`));let f=r("decisions").map((u,p)=>{let y=H(u.status),g=H(u.scope);return Bp.includes(y)||i.push({line:s(["decisions",p,"status"]),key:"status",value:y}),Up(g)||i.push({line:s(["decisions",p,"scope"]),key:"scope",value:g}),{key:o(u.key,`decisions[${p}].key`,["decisions",p]),status:y,scope:g,why:H(u.why)}});return a("decisions",f.map(u=>u.key)),i.length?{problems:i}:{cast:{...H(n.name)?{name:H(n.name)}:{},agents:c,blocks:l,declared:d,decisions:f},problems:i}}var Wp=` What people said about the agents, and what was decided. build.mjs keeps it up to date; edit it, or fill the
|
|
141
|
+
workbook's \xABDeclared\xBB sheet and the \xABDecision\xBB column and read it back with --from.`,Jp={agents:e=>H(e.id),blocks:e=>H(e.id),declared:e=>`${H(e.agent)} ${H(e.key)}`,decisions:e=>H(e.key)},Gp=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==""&&t!==void 0));function Xp(e,t){let n=t?(0,he.parseDocument)(t):void 0,s=n&&!n.errors.length&&(0,he.isMap)(n.contents)?n:new he.Document({format:It});s!==n&&(s.commentBefore=Wp),s.get("format")!==It&&s.set("format",It),e.name===void 0?s.delete("name"):s.get("name")!==e.name&&s.set("name",e.name);for(let[i,r]of Object.entries(Jp)){let o=e[i];if(!o.length){s.delete(i);continue}let a=s.get(i,!0);if((0,he.isSeq)(a)||s.set(i,a=s.createNode([])),!(0,he.isSeq)(a))continue;let c=new Map(a.items.filter(he.isMap).map(l=>[r(l.toJSON()),l]));a.items=o.map(l=>{let d=Gp(l),f=c.get(r(d));if(!f){let u=s.createNode(d);return u.flow=i!=="blocks",u}for(let[u,p]of Object.entries(d))JSON.stringify(f.toJSON()[u])!==JSON.stringify(p)&&f.set(u,p);for(let u of Object.keys(f.toJSON()))u in d||f.delete(u);return f})}return s.toString({lineWidth:0,flowCollectionPadding:!0})}function Hp(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 el(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 l=n.length-1;l>=0;l--)for(let d=s.length-1;d>=0;d--)i[l][d]=n[l]===s[d]?i[l+1][d+1]+1:Math.max(i[l+1][d],i[l][d+1]);let r=[],o=(l,d)=>{let f=r[r.length-1];f?.op===l?f.text+=` ${d}`:r.push({op:l,text:d})},a=0,c=0;for(;a<n.length||c<s.length;)a<n.length&&c<s.length&&n[a]===s[c]?o("same",(a++,c++,n[a-1])):c<s.length&&(a===n.length||i[a][c+1]>=i[a+1][c])?o("add",s[c++]):o("del",n[a++]);for(let l=0;l+1<r.length;l++)r[l].op==="add"&&r[l+1].op==="del"&&([r[l],r[l+1]]=[r[l+1],r[l]]);return r}var tl=.85,zi=.5,Qp=8,Vi=5;function Zp(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 eh=e=>{if(e.length<=Vi)return new Set([e.join(" ")]);let t=new Set;for(let n=0;n+Vi<=e.length;n++)t.add(e.slice(n,n+Vi).join(" "));return t},il=(e,t)=>{let n=0;for(let s of e)t.has(s)&&n++;return n},nl=(e,t)=>{let n=il(e,t);return n/(e.size+t.size-n||1)},Hn=(e,t)=>il(e,t)/(Math.min(e.size,t.size)||1);var Wi=(e,t,n,s)=>{let i=Zp(e);return{agent:s,file:t,line:n,text:e,words:i,shingles:eh(i)}};function th(e,t){let n=[],s=-1,i=e.text.split(`
|
|
142
|
+
`),r=o=>{if(s<0)return;let a=i.slice(s,o).join(`
|
|
143
|
+
`).trim(),c=Wi(a,e.file,e.line+s,t);c.words.length>=Qp&&n.push(c),s=-1};return i.forEach((o,a)=>{o.trim()?s<0&&(s=a):r(a)}),r(i.length),n}var nh=(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},sl=e=>{let t=e.split(/\s+/).filter(Boolean);return t.slice(0,8).join(" ")+(t.length>8?"\u2026":"")};function rl(e,t,n){let s=e.flatMap(f=>f.texts.flatMap(u=>th(u,f.id))),i=[];for(let f of s){let u=i.find(p=>Hn(p[0].shingles,f.shingles)>=zi);u?u.push(f):i.push([f])}let r=n.map(f=>({...f,block:Wi(f.text,"profile",0)})),o=t.map(f=>({...f,block:Wi(f.text,"cast",0)})),a=new Set([...n.map(f=>f.id),...t.map(f=>f.id)]),c=[],l=new Set;for(let f of i){let u=r.find(h=>!l.has(h.id)&&Hn(h.block.shingles,f[0].shingles)>=zi);if(new Set(f.map(h=>h.agent)).size<2&&!u)continue;let p=h=>f.filter(k=>nl(k.shingles,h.shingles)>=tl).length,y=u?.block??f.reduce((h,k)=>p(k)>p(h)?k:h,f[0]),g=u?void 0:o.find(h=>!l.has(h.id)&&Hn(h.block.shingles,y.shingles)>=zi),w=u?.id??g?.id??nh(y.words,a);l.add(w);let N={id:w,label:sl(y.text),text:y.text,...u?{official:u.name}:{},holders:{},variants:{}};for(let h of f){let k=h.agent,x=nl(y.shingles,h.shingles)>=tl?1:Hn(y.shingles,h.shingles);x===1?(N.holders[k]??={file:h.file,line:h.line},delete N.variants[k]):!N.holders[k]&&(!N.variants[k]||x>N.variants[k].similarity)&&(N.variants[k]={source:{file:h.file,line:h.line},similarity:x,text:h.text,diff:el(y.text,h.text)})}c.push(N)}for(let f of r.filter(u=>!l.has(u.id)))c.push({id:f.id,label:sl(f.text),text:f.text,official:f.name,holders:{},variants:{}});let d=Object.fromEntries(e.map(f=>[f.id,{}]));for(let f of c){for(let[u,p]of Object.entries(f.holders))d[u][`text:block:${f.id}`]=[p];for(let[u,p]of Object.entries(f.variants))d[u][`text:block:${f.id}~variant`]=[p.source]}return{families:c,facts:d}}var sh=/https?:\/\/([^\s/)\]>"'«»]+)/gi,ih=/[\w.+-]+@[\w-]+(\.[\w-]+)+/g,rh=(e,t)=>e.line+(e.text.slice(0,t).match(/\n/g)?.length??0),oh=e=>e.toLowerCase().replace(/\s+/g," ").trim();function ol(e,t){let n={},s={};for(let i of e){let r=n[i.id]={},o=s[i.id]={},a=(c,l,d)=>(r[c]??=[]).push({file:l.file,line:rh(l,d)});for(let c of i.texts){for(let l of t.filter(d=>d.in==="all"||d.in===c.source))for(let d of c.text.matchAll(new RegExp(l.pattern,"gi"))){if(!l.value){a(`text:${l.id}`,c,d.index);continue}let f=oh(l.value.replace(/\$(\d)/g,(u,p)=>d[Number(p)]??""));f&&(a(`text:${l.id}=${f}`,c,d.index),(o[l.id]??=[]).includes(f)||o[l.id].push(f))}if(c.source==="instructions"){for(let l of c.text.matchAll(sh))a(`text:link-domain:${l[1].toLowerCase().replace(/[.,;:]+$/,"")}`,c,l.index);for(let l of c.text.matchAll(ih))a("text:email",c,l.index)}}for(let[c,l]of Object.entries(r))r[c]=l.filter((d,f)=>l.findIndex(u=>u.file===d.file&&u.line===d.line)===f)}return{facts:n,values:s}}function al(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,c]of Object.entries(e))if(n[a]===r)for(let l of c[i.id]??[])(o[l]??=[]).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 ah=/^(no|não|nao|false|off|0)$/i,lh=new Set(Wn.filter(e=>!e.sign).map(e=>`ms:${e.id}`)),ch=e=>e.includes(":")&&!e.startsWith("declared:")&&!lh.has(e),fh=e=>e.startsWith("declared:")?e:`declared:${e}`,Ji=e=>e.endsWith("~variant");function uh(e,t,n){let s=Object.fromEntries(n.agents.map(b=>[b.id,b.role])),{roles:i,unmatched:r}=Qa(e,t,s),o=b=>t.ignore.includes(b)||!t.microsoftPatterns&&b.startsWith("ms:"),a=[],c=rl(e,n.blocks,t.blocks),l=ol(e,t.markers),d=b=>({...b.facts,...c.facts[b.id],...l.facts[b.id]}),f=e.map(b=>{let m=d(b),v=Object.fromEntries(Object.entries(m).filter(([P])=>!o(P)));for(let P of n.declared.filter(U=>U.agent===b.id)){let U=!ah.test(P.value);if(ch(P.key)){let A=P.key in m;U!==A&&a.push({agent:b.id,key:P.key,declared:P.value||"yes",observed:A,source:P.source})}else U&&(v[fh(P.key)]??=[]).push({file:P.source?`declared: ${P.source}`:"declared"})}return{id:b.id,role:i[b.id],...b.schemaName?{schemaName:b.schemaName}:{},...b.displayName?{displayName:b.displayName}:{},facts:v,children:b.children}}),u=b=>f.filter(m=>m.role===b),p=(b,m=f)=>m.filter(v=>b in v.facts),y=(b,m=f)=>m.flatMap(v=>v.facts[b]??[]),g=[...new Set(f.flatMap(b=>Object.keys(b.facts)))].sort(),w=b=>n.decisions.find(m=>m.key===b),N=Za(f,i,t,Object.fromEntries(n.agents.filter(b=>b.types?.length).map(b=>[b.id,b.types]))),h=b=>b==="platform"?f:b.startsWith("type:")?f.filter(m=>N[m.id]?.includes(b.slice(5))):u(b),k=[];for(let b of["specialist","orchestrator"]){let m=u(b);if(m.length<t.minAgents)continue;let v=u(b==="specialist"?"orchestrator":"specialist");for(let P of g){if(P.startsWith("declared:")||Qe(P)||Ji(P)||k.some(_=>_.key===P))continue;let A=p(P,m).length/m.length;if(A<t.threshold)continue;let L=v.length>0&&p(P,v).length/v.length>=(v.length>=t.minAgents?t.threshold:1),F=w(P);k.push({key:P,role:b,scope:F?.scope??(L?"platform":b),share:A,agents:p(P).map(_=>_.id),sources:y(P),...F?{decision:F}:{}})}}let x=[];for(let b of t.types){let m=h(`type:${b.id}`);if(m.length){if(m.length<b.minAgents){x.push({type:b.id,agents:m.map(v=>v.id)});continue}for(let v of g){if(v.startsWith("declared:")||Qe(v)||Ji(v)||k.some(A=>A.key===v))continue;let P=p(v,m).length/m.length;if(P<t.threshold)continue;let U=w(v);k.push({key:v,role:"specialist",scope:U?.scope??`type:${b.id}`,share:P,agents:p(v).map(A=>A.id),sources:y(v),...U?{decision:U}:{}})}}}for(let b of t.blocks){let m=`text:block:${b.id}`,v=k.find(A=>A.key===m);if(v){v.official=b.name;continue}let P=u(b.role),U=w(m);k.push({key:m,role:b.role,scope:U?.scope??b.role,share:P.length?p(m,P).length/P.length:0,agents:p(m).map(A=>A.id),sources:y(m),official:b.name,...U?{decision:U}:{}})}for(let b of n.decisions.filter(m=>m.status==="accepted"&&!k.some(v=>v.key===m.key))){let m=h(b.scope),v=p(b.key,m);k.push({key:b.key,role:b.scope==="orchestrator"?"orchestrator":"specialist",scope:b.scope,share:m.length?v.length/m.length:0,agents:v.map(P=>P.id),sources:y(b.key),decision:b})}for(let b of g.filter(m=>Qe(m))){let m=k.find(A=>A.key===Qe(b));if(!m)continue;let v=h(m.scope).filter(A=>m.key in A.facts),P=v.length?p(b,v).length/v.length:0;if(P<t.threshold)continue;let U=w(b)??m.decision;k.push({key:b,role:m.role,scope:m.scope,share:P,agents:p(b).map(A=>A.id),sources:y(b),partOf:m.key,...U?{decision:U}:{}})}k.sort((b,m)=>b.scope.localeCompare(m.scope)||b.key.localeCompare(m.key));let S=k.filter(b=>b.decision?.status!=="rejected").flatMap(b=>h(b.scope).filter(m=>!(b.key in m.facts)&&(!b.partOf||b.partOf in m.facts)).map(m=>({agent:m.id,key:b.key,scope:b.scope,...b.partOf?{partOf:b.partOf}:{},...`${b.key}~variant`in m.facts?{variant:!0}:{}}))).sort((b,m)=>b.agent.localeCompare(m.agent)||b.key.localeCompare(m.key)),O=[],q=[];for(let b of g){if(b.startsWith("declared:")||Qe(b)||Ji(b))continue;let m=p(b),v={key:b,agents:m.map(P=>P.id),sources:y(b)};m.every(P=>P.role==="orchestrator")?q.push(v):m.length===1&&O.push(v)}let E=(b,m)=>Object.keys(b.facts).some(v=>Te(v,m)),I=t.rules.map(b=>({rule:b,agents:(b.role?u(b.role):f).filter(m=>(b.when??[]).every(v=>E(m,v))).filter(m=>b.has!==void 0&&!E(m,b.has)||b.not!==void 0&&E(m,b.not)).map(m=>m.id)})).filter(b=>b.agents.length);return{...t.name??n.name?{name:t.name??n.name}:{},roles:i,unmatched:r,agents:f,patterns:k,offPattern:S,solos:O,orchestratorDoes:q,gaps:I,conflicts:a,unknown:e.flatMap(b=>b.unknown.map(m=>({...m,agent:b.id}))),names:Object.assign({},...e.map(b=>b.names??{}),...e.map(b=>b.schemaName&&b.displayName?{[b.schemaName]:b.displayName}:{}),...c.families.map(b=>({[`text:block:${b.id}`]:b.official??b.label})),...t.markers.map(b=>({[`text:${b.id}`]:b.name}))),types:N,typeNames:Object.fromEntries(t.types.map(b=>[b.id,b.name])),typeNotes:x,blocks:c.families,markerFindings:al(l.values,t.markers,i)}}var dh={specialist:{en:["specialist","specialists"],pt:["especialista","especialistas"]},orchestrator:{en:["orchestrator","orchestrators"],pt:["orquestrador","orquestradores"]}},ie=(e,t,n)=>dh[e][t][n===1?0:1],Qn={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",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"},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",text:"Texto",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",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"},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 be=e=>e.join(", "),ll=["conflict","contradiction","off","gap","values","twice","solo","type","unknown","unmatched"];function ph(e){let t=[],n=(l,d)=>ae(l,d,e.names);for(let l of e.conflicts){let d=l.source?`\xAB${l.source}\xBB`:null,[f,u]=[n(l.key,"en"),n(l.key,"pt")];t.push(l.observed?{key:"conflict",agents:[l.agent],fact:l.key,en:`${l.agent}: ${d??"what was declared"} says it does not have \xAB${f}\xBB, but the YAML has it`,pt:`${l.agent}: ${d??"o declarado"} diz que n\xE3o tem \xAB${u}\xBB, mas o YAML tem`}:{key:"conflict",agents:[l.agent],fact:l.key,en:`${l.agent}: ${d??"what was declared"} says it has \xAB${f}\xBB, but the YAML does not`,pt:`${l.agent}: ${d??"o declarado"} diz que tem \xAB${u}\xBB, mas o YAML n\xE3o tem`})}let s=(l,d)=>Object.keys(e.agents.find(f=>f.id===l)?.facts??{}).filter(f=>Te(f,d));for(let l of e.gaps.filter(d=>d.rule.not&&!d.rule.has))for(let d of[...l.agents].sort()){let f=s(d,l.rule.not)[0]??l.rule.not,u=(l.rule.when??[]).map(y=>s(d,y)[0]??y),p=y=>u.length?`\xAB${u.map(g=>n(g,y)).join(y==="pt"?"\xBB e \xAB":"\xBB and \xAB")}\xBB, ${y==="pt"?"mas tamb\xE9m":"but also"} \xAB${n(f,y)}\xBB`:`\xAB${n(f,y)}\xBB`;t.push({key:"contradiction",agents:[d],fact:f,en:`${d} has ${p("en")} (rule \xAB${l.rule.says}\xBB)`,pt:`${d} tem ${p("pt")} (regra \xAB${l.rule.says}\xBB)`})}let i=l=>l.startsWith("type:")?e.typeNames[l.slice(5)]??l.slice(5):void 0,r=new Map;for(let l of e.offPattern){let d=e.roles[l.agent],f=`${l.key} ${d} ${l.scope} ${l.variant?"v":""}`,u=r.get(f)??{key:l.key,role:d,type:i(l.scope),variant:!!l.variant,agents:[]};u.agents.push(l.agent),r.set(f,u)}for(let l of r.values()){let d=l.agents.length,f=e.patterns.find(w=>w.key===l.key),u=f?.decision?.status==="accepted",p=w=>l.type?w==="pt"?`${d} ${ie(l.role,w,d)} de ${l.type}`:`${d} ${l.type} ${ie(l.role,w,d)}`:`${d} ${ie(l.role,w,d)}`,y=!!f?.official;if(l.variant){let w=N=>N==="pt"?`do bloco${y?" oficial":""} \xAB${n(l.key,N)}\xBB`:`of the${y?" official":""} block \xAB${n(l.key,N)}\xBB`;t.push({key:"off",agents:l.agents,fact:l.key,en:`${p("en")} ${d===1?"has":"have"} a variation ${w("en")} (${be(l.agents)}): align it?`,pt:`${p("pt")} ${d===1?"tem":"t\xEAm"} uma varia\xE7\xE3o ${w("pt")} (${be(l.agents)}): alinhar?`});continue}let g=w=>`${p(w)} ${Gn(l.key,w,d,e.names)} (${be(l.agents)})`;t.push({key:"off",agents:l.agents,fact:l.key,en:u?`${g("en")}, and the pattern was accepted: correct it?`:y?`${g("en")}: add it?`:`${g("en")}: on purpose?`,pt:u?`${g("pt")}, e o padr\xE3o foi aceito: corrigir?`:y?`${g("pt")}: incluir?`:`${g("pt")}: \xE9 intencional?`})}for(let l of e.gaps.filter(d=>d.rule.has)){let d=l.agents.filter(u=>!e.offPattern.some(p=>p.agent===u&&p.key===l.rule.has)).sort(),f=d.length;f&&t.push({key:"gap",agents:d,fact:l.rule.has,en:`Rule \xAB${l.rule.says}\xBB: ${f}${l.rule.role?` ${ie(l.rule.role,"en",f)}`:""} ${f===1?"does":"do"} not meet it (${be(d)})`,pt:`Regra \xAB${l.rule.says}\xBB: ${f}${l.rule.role?` ${ie(l.rule.role,"pt",f)}`:""} n\xE3o ${f===1?"cumpre":"cumprem"} (${be(d)})`})}for(let l of e.markerFindings)if(l.kind==="values"){let d=[...new Set(Object.values(l.byValue).flat())],f=d.length,u=Object.entries(l.byValue).sort(([y,g],[w,N])=>N.length-g.length||y.localeCompare(w)).map(([y,g])=>`${y} {in} ${g.length}`),p=Object.keys(l.byValue).length;t.push({key:"values",agents:d.sort(),fact:`text:${l.marker.id}`,en:`${f} ${ie(l.role,"en",f)} set \xAB${l.marker.name}\xBB in ${p} ways (${u.join("; ").replace(/\{in\}/g,"in")}): unify?`,pt:`${f} ${ie(l.role,"pt",f)} definem \xAB${l.marker.name}\xBB de ${p} jeitos (${u.join("; ").replace(/\{in\}/g,"em")}): unificar?`})}else t.push({key:"twice",agents:[l.agent],fact:`text:${l.marker.id}`,en:`${l.agent} sets \xAB${l.marker.name}\xBB ${l.values.length===2?"twice":`${l.values.length} times`} (${l.values.join("; ")}): which one holds?`,pt:`${l.agent} define \xAB${l.marker.name}\xBB ${l.values.length===2?"duas vezes":`${l.values.length} vezes`} (${l.values.join("; ")}): qual vale?`});let o=new Set(e.solos.filter(l=>/^(connector|mcp):/.test(l.key)).map(l=>`${l.agents[0]} ${l.key.slice(l.key.indexOf(":")+1)}`)),a=e.gaps.filter(l=>l.rule.not).flatMap(l=>l.agents.map(d=>({agent:d,keys:[...l.rule.when??[],l.rule.not]})));for(let l of e.solos){let d=l.agents[0],f=l.key.startsWith("connref:")?l.key.slice(8):l.key.startsWith("operation:")?l.key.slice(10).split("/")[0]:void 0;f&&o.has(`${d} ${f}`)||a.some(u=>u.agent===d&&u.keys.some(p=>Te(l.key,p)))||t.push({key:"solo",agents:[d],fact:l.key,en:`Only ${d} has \xAB${n(l.key,"en")}\xBB: innovation or debt?`,pt:`S\xF3 ${d} tem \xAB${n(l.key,"pt")}\xBB: inova\xE7\xE3o ou d\xEDvida?`})}for(let l of e.typeNotes){let d=e.typeNames[l.type]??l.type,f=l.agents.length;t.push({key:"type",agents:l.agents,en:`The type \xAB${d}\xBB has ${f} ${ie("specialist","en",f)} (${be(l.agents)}): nothing to compare in it`,pt:`O tipo \xAB${d}\xBB tem ${f} ${ie("specialist","pt",f)} (${be(l.agents)}): nada a comparar dentro dele`})}let c=new Map;for(let l of e.unknown)c.set(l.agent,[...c.get(l.agent)??[],l.file]);for(let[l,d]of c){let f=d.length;t.push({key:"unknown",agents:[l],en:`${l}: the analysis did not understand ${f} ${f===1?"file":"files"} (${be(d)})`,pt:`${l}: a an\xE1lise n\xE3o entendeu ${f} ${f===1?"arquivo":"arquivos"} (${be(d)})`})}for(let l of e.unmatched)t.push({key:"unmatched",agents:[],en:`The profile names \xAB${l}\xBB, which is not in the folder`,pt:`O perfil cita \xAB${l}\xBB, que n\xE3o est\xE1 na pasta`});return t.sort((l,d)=>ll.indexOf(l.key)-ll.indexOf(d.key))}function Rt(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 cl=new TextEncoder,Gi=e=>e.replace(/[&<>"]/g,t=>({"&":"&","<":"<",">":">",'"':"""})[t]).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,""),Dt=e=>e<26?String.fromCharCode(65+e):Dt(Math.floor(e/26)-1)+String.fromCharCode(65+e%26),hh=e=>e.replace(/[:\\/?*[\]]/g," ").slice(0,31)||"Sheet";function mh(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 p of u.rows)for(let y of p){if(typeof y!="object")continue;let{v:g,...w}=y,N=n(w);s.has(N)||(s.set(N,t.length),t.push(w))}let i=new Map([["|",0]]),r=new Map([["",0]]),o=u=>{let p=`${u.bold?"b":""}|${u.color??""}`;return i.has(p)||i.set(p,i.size),i.get(p)},a=u=>u.fill?(r.has(u.fill)||r.set(u.fill,r.size+1),r.get(u.fill)):0,c=t.map(u=>{let p=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">${p}</xf>`}),l=[...i.keys()].map(u=>{let[p,y]=u.split("|");return`<font>${p?"<b/>":""}<sz val="11"/>${y?`<color rgb="FF${y}"/>`:""}<name val="Calibri"/><family val="2"/></font>`}),d=['<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
144
|
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
142
|
-
<fonts count="${
|
|
143
|
-
<fills count="${
|
|
145
|
+
<fonts count="${l.length}">${l.join("")}</fonts>
|
|
146
|
+
<fills count="${d.length}">${d.join("")}</fills>
|
|
144
147
|
<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
148
|
<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
|
|
146
|
-
<cellXfs count="${
|
|
149
|
+
<cellXfs count="${c.length}">${c.join("")}</cellXfs>
|
|
147
150
|
<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>
|
|
148
|
-
</styleSheet>`,styleOf:
|
|
151
|
+
</styleSheet>`,styleOf:u=>typeof u=="object"?s.get(n((({v:p,...y})=>y)(u)))??0:0}}function gh(e,t){let n=Math.max(e.columns.length,...e.rows.map(c=>c.length),1),s=e.rows.map((c,l)=>{let d=c.map((f,u)=>{let p=`${Dt(u)}${l+1}`,y=typeof f=="object"?f.v:f,g=t(f),w=g?` s="${g}"`:"";return y===""||y===void 0||y===null?g?`<c r="${p}"${w}/>`:"":typeof y=="number"?`<c r="${p}"${w}><v>${y}</v></c>`:`<c r="${p}"${w} t="inlineStr"><is><t xml:space="preserve">${Gi(String(y))}</t></is></c>`}).join("");return`<row r="${l+1}">${d}</row>`}),i=`${Dt(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((c,l)=>`<col min="${l+1}" max="${l+1}" width="${c.width}" customWidth="1"/>`).join("")}</cols>`:"",a=e.header&&e.rows.length>1?`<autoFilter ref="A1:${Dt(Math.max(0,e.columns.length-1))}${e.rows.length}"/>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
149
152
|
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
150
|
-
<dimension ref="A1:${
|
|
151
|
-
</worksheet>`}function
|
|
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"/>${
|
|
153
|
+
<dimension ref="A1:${i}"/><sheetViews><sheetView workbookViewId="0">${r}</sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>${o}<sheetData>${s.join("")}</sheetData>${a}
|
|
154
|
+
</worksheet>`}function fl(e){let{xml:t,styleOf:n}=mh(e),s=e.map(o=>hh(o.name)),i=e.map((o,a)=>o.header&&o.rows.length>1?`<definedName name="_xlnm._FilterDatabase" localSheetId="${a}" hidden="1">'${Gi(s[a]).replace(/'/g,"''")}'!$A$1:$${Dt(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"?>
|
|
155
|
+
<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
156
|
<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="${
|
|
155
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${t.map((o,a)=>`<Relationship Id="rId${a+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${a+1}.xml"/>`).join("")}<Relationship Id="rId${t.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`],["xl/styles.xml",e],...t.map((o,a)=>[`xl/worksheets/sheet${a+1}.xml`,qp(o,n)])];return Lp(i.map(([o,a])=>[o,Ba.encode(a)]))}var Tp=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function Pp(t){let e=4294967295;for(let n=0;n<t.length;n++)e=Tp[(e^t[n])&255]^e>>>8;return(e^4294967295)>>>0}function Lp(t){let e=[],n=[],s=0;for(let[c,p]of t){let u=Ba.encode(c),f=Pp(p),m=new DataView(new ArrayBuffer(30));m.setUint32(0,67324752,!0),m.setUint16(4,20,!0),m.setUint16(6,2048,!0),m.setUint16(8,0,!0),m.setUint32(14,f,!0),m.setUint32(18,p.length,!0),m.setUint32(22,p.length,!0),m.setUint16(26,u.length,!0),e.push(new Uint8Array(m.buffer),u,p);let d=new DataView(new ArrayBuffer(46));d.setUint32(0,33639248,!0),d.setUint16(4,20,!0),d.setUint16(6,20,!0),d.setUint16(8,2048,!0),d.setUint32(16,f,!0),d.setUint32(20,p.length,!0),d.setUint32(24,p.length,!0),d.setUint16(28,u.length,!0),d.setUint32(42,s,!0),n.push(new Uint8Array(d.buffer),u),s+=30+u.length+p.length}let r=n.reduce((c,p)=>c+p.length,0),i=new DataView(new ArrayBuffer(22));i.setUint32(0,101010256,!0),i.setUint16(8,t.length,!0),i.setUint16(10,t.length,!0),i.setUint32(12,r,!0),i.setUint32(16,s,!0);let o=[...e,...n,new Uint8Array(i.buffer)],a=new Uint8Array(o.reduce((c,p)=>c+p.length,0)),l=0;for(let c of o)a.set(c,l),l+=c.length;return a}var xp=t=>Ka(t),Mp={bold:!0,fill:"E8EEF7"},Ip={v:"\u25CF",fill:"DDF3E6",center:!0},Dp={v:"\xD7",fill:"FFD5CC",center:!0,bold:!0},Rp={v:"\u25D0",fill:"FFF3C4",center:!0},Ua=Object.keys(Dr);function _p(t,e,n,s="en"){let r=Fn[s],i=(w,L,v)=>({key:w,name:r[w],header:!0,columns:L.map(([q,D])=>({title:q,width:D})),rows:[L.map(([q])=>({v:q,...Mp})),...v]}),o=w=>r[t.roles[w]],a=w=>r[w],l=w=>ee(w,s),c=[...t.agents].sort((w,L)=>w.role===L.role?w.id.localeCompare(L.id):w.role==="orchestrator"?-1:1),p=[...new Set([...c.flatMap(w=>Object.keys(w.facts)),...t.patterns.map(w=>w.key)])].sort((w,L)=>Ua.indexOf(Rn(w))-Ua.indexOf(Rn(L))||w.localeCompare(L)),u=new Set(t.offPattern.map(w=>`${w.agent} ${w.key}`)),f=w=>t.agents.filter(L=>L.role===w).length,m={key:"summary",name:r.summary,header:!1,columns:[{title:"",width:28},{title:"",width:100}],rows:[[{v:t.name??r.title,bold:!0},""],[{v:r.privacy,color:"B42318"},""],[r.count.agents,t.agents.length],[r.count.orchestrators,f("orchestrator")],[r.count.specialists,f("specialist")],[r.count.patterns,t.patterns.length],[r.count.off,new Set(t.offPattern.map(w=>w.agent)).size],[r.count.gaps,t.gaps.length],[r.count.conflicts,t.conflicts.length],[r.count.solos,e.filter(w=>w.key==="solo").length],["",""],[{v:e.length?r.look:r.nothing,bold:!0},""],...e.map(w=>["",{v:w[s],wrap:!0}])]},d=i("matrix",[[r.dimension,18],[r.fact,40],[r.key,34],...c.map(w=>[w.id,14])],p.map(w=>[Dr[Rn(w)][s],l(w),w,...c.map(L=>w in L.facts?w.startsWith("declared:")?Rp:Ip:u.has(`${L.id} ${w}`)?Dp:"")])),{look:h,everyone:g}=At(t),k=i("patterns",[[r.key,34],[r.fact,40],[r.scope,14],[r.role,14],[r.share,10],[r.have,50],[r.lack,40],[r.decision,12],[r.why,50]],[...h,...g].map(w=>{let L=t.offPattern.filter(v=>v.key===w.key).map(v=>v.agent);return[w.key,l(w.key),a(w.scope),r[w.role],`${Math.round(w.share*100)}%`,w.agents.join(", "),L.join(", "),w.decision?r[w.decision.status==="accepted"?"accept":"reject"]:"",w.decision?.why??""]})),$=i("off",[[r.agent,24],[r.role,14],[r.missing,44],[r.key,34],[r.scope,14],[r.accepted,14]],t.offPattern.map(w=>[w.agent,o(w.agent),l(w.key),w.key,a(w.scope),t.patterns.find(L=>L.key===w.key)?.decision?.status==="accepted"?r.yes:""])),E=i("gaps",[[r.rule,16],[r.says,50],[r.role,14],[r.notMet,60]],t.gaps.map(w=>[w.rule.id,w.rule.says,r[w.rule.role],w.agents.join(", ")])),y=i("conflicts",[[r.agent,24],[r.fact,40],[r.key,34],[r.declared,20],[r.source,40],[r.inYaml,12]],t.conflicts.map(w=>[w.agent,l(w.key),w.key,w.declared,w.source,w.observed?r.yes:r.no])),S=i("agents",[[r.agent,24],[r.name,32],[r.role,14],[r.facts,8],[r.off,44],[r.alone,44],[r.children,24],[r.unknown,12]],c.map(w=>[w.id,w.displayName??"",r[w.role],Object.keys(w.facts).length,t.offPattern.filter(L=>L.agent===w.id).map(L=>l(L.key)).join("; "),t.solos.filter(L=>L.agents[0]===w.id).map(L=>l(L.key)).join("; "),w.children.map(L=>L.name).join(", "),t.unknown.filter(L=>L.agent===w.id).length||""])),A=i("evidence",[[r.agent,30],[r.fact,40],[r.key,34],[r.file,50],[r.line,8]],c.flatMap(w=>[{who:w.id,facts:w.facts},...w.children.map(L=>({who:`${w.id} \u203A ${L.name}`,facts:L.facts}))]).flatMap(({who:w,facts:L})=>Object.entries(L).sort(([v],[q])=>v.localeCompare(q)).flatMap(([v,q])=>q.map(D=>[w,l(v),v,D.file,D.line??""])))),T=i("declared",[[r.agent,24],[r.key,34],[r.value,40],[r.source,40]],n.declared.map(w=>[w.agent,w.key,w.value,w.source])),N=[m,d,k,$,E,y,S,A,T];return t.unknown.length&&N.push(i("unknown",[[r.agent,24],[r.file,50],[r.why,40],[r.kind,24]],t.unknown.map(w=>[w.agent,w.file,r.why_[w.why],w.kind??""]))),N}var Be=t=>String(t??"").normalize("NFD").replace(/[̀-ͯ]/g,"").trim().toLowerCase(),Nt=Object.values(Fn),Ya=(t,e)=>t.find(n=>Nt.some(s=>Be(s[e])===Be(n.name)));function za(t,...e){let n=e.map(s=>t?.rows[0]?.findIndex(r=>Nt.some(i=>Be(i[s])===Be(r)))??-1);return s=>n.map(r=>r<0?"":String(s[r]??"").trim())}var Va=(t,e)=>e.find(([,n])=>Nt.some(s=>Be(s[n])===Be(t)))?.[0],Ja=t=>t.slice(1).filter(e=>e.some(n=>String(n??"").trim())),Wa=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function Fp(t,e){let n=[],s=[],r=Ya(e,"declared");if(r){let o=za(r,"agent","key","value","source"),a=[];Ja(r.rows).forEach((p,u)=>{let[f,m,d,h]=o(p);!f||!m?s.push(`${r.name}, ${u+2}: \xAB${o(r.rows[0])[f?1:0]}\xBB ?`):a.push({agent:f,key:m,value:d,source:h})});let l=p=>`${p.agent} ${p.key}`,c=0;for(let p of a){let u=t.declared.find(f=>l(f)===l(p));u?Wa(u,p)||n.push({key:`d${++c}`,kind:"declared",op:"set",before:u,after:p}):n.push({key:`d${++c}`,kind:"declared",op:"add",after:p})}for(let p of t.declared)a.some(u=>l(u)===l(p))||n.push({key:`d${++c}`,kind:"declared",op:"remove",before:p})}let i=Ya(e,"patterns");if(i){let o=za(i,"key","scope","decision","why"),a=0;for(let l of Ja(i.rows)){let[c,p,u,f]=o(l);if(!c)continue;let m=t.decisions.find(g=>g.key===c);if(!u){m&&n.push({key:`p${++a}`,kind:"decision",op:"remove",before:m});continue}let d=Va(u,[["accepted","accept"],["rejected","reject"]]),h=Va(p,[["platform","platform"],["specialist","specialist"],["orchestrator","orchestrator"]]);if(!d)s.push(`${i.name}, ${c}: \xAB${u}\xBB \u2014 ${Nt.map(g=>`${g.accept}/${g.reject}`).join(", ")}`);else if(!h)s.push(`${i.name}, ${c}: \xAB${p}\xBB \u2014 ${Nt.map(g=>`${g.platform}/${g.specialist}/${g.orchestrator}`).join(", ")}`);else{let g={key:c,status:d,scope:h,why:f};m?Wa(m,g)||n.push({key:`p${++a}`,kind:"decision",op:"set",before:m,after:g}):n.push({key:`p${++a}`,kind:"decision",op:"add",after:g})}}}return{changes:n,problems:s}}function jp(t,e,n){let s={...t,declared:[...t.declared],decisions:[...t.decisions]};for(let r of e.filter(i=>n.includes(i.key)))if(r.kind==="declared"){let i=a=>`${a.agent} ${a.key}`,o=r.before?s.declared.findIndex(a=>i(a)===i(r.before)):-1;r.op==="add"?s.declared.push(r.after):r.op==="set"?s.declared[o]=r.after:s.declared.splice(o,1)}else{let i=r.before?s.decisions.findIndex(o=>o.key===r.before.key):-1;r.op==="add"?s.decisions.push(r.after):r.op==="set"?s.decisions[i]=r.after:s.decisions.splice(i,1)}return s}var Et="#8C8578";var jn="#C8442C",Xa="#2E8F62";var Ga=t=>Math.round(t*10)/10,_r=t=>[Ga(t[0]),Ga(t[1])],ke=(t,e,n=22,s="start",r)=>({type:"text",at:_r(t),text:e,size:n,anchor:s,...r?{style:{color:r}}:{}});var Ha=(t,e,n)=>({type:"arrow",from:_r(t),to:_r(e),...n?{style:n}:{}});var Bp=(t,e)=>t.length*e*.48;function Bn(t,e,n){let s=[],r="";for(let i of t.split(/\s+/).filter(Boolean)){let o=r?`${r} ${i}`:i;r&&Bp(o,e)>n?(s.push(r),r=i):r=o}return r&&s.push(r),s.length?s:[""]}var Kn=150,Ct=40,Kp=24,Qa=250,Za=20,Fr=6,jr=4,Up=/^(auth|model|setting|topics|connref|operation):/,Yp={en:{chapters:["The cast","What repeats","Who is off","What is missing","What to decide"],cast:(t,e)=>t?`${t} ${t===1?"orchestrator calls":"orchestrators call"} ${e} ${e===1?"specialist":"specialists"}.`:`${e} ${e===1?"specialist":"specialists"}, with no orchestrator.`,repeats:(t,e,n)=>t?`${t} patterns: ${e} of the platform, ${n} of the specialists.`:"Nothing repeats enough to be a pattern yet.",off:t=>t.length?`Off a pattern: ${t.join(", ")}.`:"Nobody is off a pattern.",missing:t=>t?`${t} ${t===1?"rule is":"rules are"} not met.`:"Every rule is met.",decide:t=>t?`${t} ${t===1?"thing":"things"} to decide.`:"Nothing left to decide.",pattern:t=>`A pattern? \xAB${t}\xBB`,platform:"platform",specialist:"specialists",more:t=>`+ ${t} more`,none:"nothing"},pt:{chapters:["O elenco","O que se repete","Quem est\xE1 fora","O que falta","O que decidir"],cast:(t,e)=>t?`${t} ${t===1?"orquestrador chama":"orquestradores chamam"} ${e} ${e===1?"especialista":"especialistas"}.`:`${e} ${e===1?"especialista":"especialistas"}, sem orquestrador.`,repeats:(t,e,n)=>t?`${t} padr\xF5es: ${e} da plataforma, ${n} dos especialistas.`:"Nada se repete o bastante para ser padr\xE3o ainda.",off:t=>t.length?`Fora do padr\xE3o: ${t.join(", ")}.`:"Ningu\xE9m est\xE1 fora do padr\xE3o.",missing:t=>t?`${t} ${t===1?"regra n\xE3o \xE9 cumprida":"regras n\xE3o s\xE3o cumpridas"}.`:"Todas as regras s\xE3o cumpridas.",decide:t=>t?`${t} ${t===1?"coisa":"coisas"} para decidir.`:"Nada em aberto para decidir.",pattern:t=>`Padr\xE3o? \xAB${t}\xBB`,platform:"plataforma",specialist:"especialistas",more:t=>`+ ${t}`,none:"nada"}};function zp(t,e,n="en"){let s=Yp[n],r=t.agents.filter(v=>v.role==="orchestrator").sort((v,q)=>v.id.localeCompare(q.id)),i=t.agents.filter(v=>v.role==="specialist").sort((v,q)=>v.id.localeCompare(q.id)),o=Math.max(1,Math.ceil(i.length/Kp)),a=Math.max(1,Math.ceil(i.length/o)),l=Math.max(1e3,Ct*2+Math.max(a,r.length)*Kn),c=(v,q)=>l/2+(v-(q-1)/2)*Kn,p=[{...ke([Ct,52],t.name??s.chapters[0],30),chapter:s.chapters[0],say:`${t.name?`${t.name}: `:""}${s.cast(r.length,i.length)}`}],u=(v,q,D)=>Bn(v,15,Kn-12).slice(0,2).forEach((B,G)=>p.push(ke([q[0],q[1]+G*18],B,15,"middle",D))),f=170,m=new Map;r.forEach((v,q)=>{let D=c(q,r.length);m.set(v.id,[D,f]),p.push({type:"prop",name:"robot",at:[D,f],size:70}),u(v.id,[D,f+24],Et)}),i.forEach((v,q)=>{let D=Math.floor(q/a),B=Math.min(a,i.length-D*a),G=[c(q%a,B),340+D*Qa];m.set(v.id,G),p.push({type:"prop",name:"robot",at:G,size:64}),u(v.id,[G[0],G[1]+24])});for(let v of r){let q=m.get(v.id);for(let D of i.filter(B=>B.schemaName&&`calls:${B.schemaName}`in v.facts)){let B=m.get(D.id);B[1]===340&&p.push(Ha([q[0],q[1]+44],[B[0],B[1]-76],{color:Et}))}}let d=340+(o-1)*Qa+160,h=(l-Ct*2)/3,g=d,k=(v,q,D,B,G)=>{let Tt=Ct+v*h;p.push({...ke([Tt,d],q,22,"start",G),chapter:q,say:D});let Vn=d+34,Pt=B.slice(0,Fr);B.length>Fr&&Pt.push(s.more(B.length-Fr)),Pt.length||Pt.push(s.none);for(let hl of Pt){let Lt=Bn(hl,15,h-30),Kr=Lt.length>jr?[...Lt.slice(0,jr-1),`${Lt[jr-1]}\u2026`]:Lt;Kr.forEach((ml,Jn)=>p.push(ke([Tt+(Jn?14:0),Vn+Jn*Za],`${Jn?"":"\xB7 "}${ml}`,15,"start",Et))),Vn+=Kr.length*Za+6}g=Math.max(g,Vn)},$=v=>ja(v)?0:Up.test(v)?2:1,E=[...t.patterns].sort((v,q)=>$(v.key)-$(q.key)||(v.scope===q.scope?0:v.scope==="platform"?-1:1)||q.share-v.share||v.key.localeCompare(q.key)),y=v=>v==="platform"?s.platform:s.specialist;k(0,s.chapters[1],s.repeats(t.patterns.length,t.patterns.filter(v=>v.scope==="platform").length,t.patterns.filter(v=>v.scope!=="platform").length),E.map(v=>`${ee(v.key,n)} \xB7 ${y(v.scope)}${v.share<1?` \xB7 ${Math.round(v.share*100)}%`:""}`),Xa);let S=[...new Set(t.offPattern.map(v=>v.agent))].sort();S.forEach((v,q)=>{let D=m.get(v),B=t.offPattern.filter(G=>G.agent===v).flatMap(G=>Bn(_n(G.key,n,1),13,Kn-10)).slice(0,4);p.push({...ke([D[0]+34,D[1]-50],"\xD7",30,"middle",jn),...q===0?{chapter:s.chapters[2],say:s.off(S)}:{}}),B.forEach((G,Tt)=>p.push(ke([D[0],D[1]+66+Tt*16],G,13,"middle",jn)))}),S.length||p.push({...ke([l-Ct,92],s.off([]),16,"end",Et),chapter:s.chapters[2],say:s.off([])});let A=t.gaps.flatMap(v=>{let q=v.agents.filter(D=>!t.offPattern.some(B=>B.agent===D&&B.key===v.rule.has)).length;return q?[n==="pt"?`\xAB${v.rule.says}\xBB: ${q} ${Ee(v.rule.role,n,q)} n\xE3o ${q===1?"cumpre":"cumprem"}`:`\xAB${v.rule.says}\xBB: ${q} ${Ee(v.rule.role,n,q)} ${q===1?"does":"do"} not meet it`]:[]}),T=t.unknown.length;T&&A.push(n==="pt"?`${T} ${T===1?"arquivo n\xE3o entendido":"arquivos n\xE3o entendidos"}`:`${T} ${T===1?"file":"files"} not understood`),k(1,s.chapters[3],s.missing(e.filter(v=>v.key==="gap").length),A,jn);let{look:N}=At(t),w=[...N.filter(v=>!v.decision).map(v=>s.pattern(ee(v.key,n))),...e.filter(v=>v.key==="solo"||v.key==="conflict").map(v=>v[n])];return k(2,s.chapters[4],s.decide(w.length),w),{id:(t.name??"cast").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"cast",title:t.name??s.chapters[0],width:l,height:Math.min(4e3,g+40),background:"plain",locale:n==="pt"?"pt-BR":"en-US",steps:p}}var el=["and","or","not"];var Br=["person","person-pointing","person-sitting","house","car","bus","coin","phone","document","server","bank","cloud","queue","desk","computer","clock","lock","money-arrow","tree","school","hospital","factory","truck","cart","safe","bulb","gear","database","robot","ship","container","warehouse","box","pallet","shop","shelf","field","cup","function","api-gateway","cache","cluster","board","book","pencil"],Un={pessoa:"person","pessoa-apontando":"person-pointing","pessoa-sentada":"person-sitting",casa:"house",carro:"car",onibus:"bus",moeda:"coin",celular:"phone",documento:"document",servidor:"server",banco:"bank",nuvem:"cloud",fila:"queue",mesa:"desk",computador:"computer",relogio:"clock",cadeado:"lock","seta-dinheiro":"money-arrow"},Yn=t=>Br.includes(t)?t:typeof t=="string"&&Object.hasOwn(Un,t)?Un[t]:void 0;var nl=t=>Yn(t)!==void 0,b={skin:"#E8C6A5",shirt:"#A9BCC3",wood:"#D8C29C",gold:"#F2C94C",paper:"#FFFFFF",screen:"#DCE8F0",device:"#5B6B7C",roof:"#D9785F",wall:"#F3E3C3",car:"#7FA7C9",bus:"#E9C46A",green:"#7DBE8A",dark:"#4A4A4A",metal:"#C9D3DD",board:"#2F4F3F",chalk:"#F2EFE6"},C=(t,e,n,s,r,i)=>({kind:"polygon",points:[[t,e],[t+n,e],[t+n,e+s],[t,e+s]],fill:r,main:i}),P=(...t)=>({kind:"polyline",points:t});function sl(t){return[{kind:"polygon",points:[[-.15,-.72],[.15,-.72],[.19,-.38],[-.19,-.38]],fill:b.shirt,main:!0},{kind:"circle",c:[0,-.87],r:.11,fill:b.skin},...t,P([-.08,-.38],[-.1,0]),P([.08,-.38],[.1,0])]}var tl=sl([P([-.15,-.7],[-.25,-.42]),P([.15,-.7],[.25,-.42])]);function Vp(t,e,n){let s=([r,i])=>[n+r*e,i*e];return t.map(r=>r.kind==="circle"?{...r,c:s(r.c),r:r.r*e}:{...r,points:r.points.map(s)})}function Jp(){let t=[[-.28,-.3,.18],[-.06,-.45,.25],[.2,-.4,.21],[.37,-.27,.13]],e=[];for(let n=0;n<=24;n++){let s=-.46+.96*n/24,r=t.filter(([i,,o])=>Math.abs(s-i)<=o).map(([i,o,a])=>o-Math.sqrt(Math.max(0,a*a-(s-i)**2)));r.length&&e.push([s,Math.min(...r)])}return[...e,[.42,-.12],[-.4,-.12]]}var sg={person:tl,"person-pointing":sl([P([-.15,-.7],[-.25,-.42]),P([.15,-.69],[.47,-.73])]),"person-sitting":[P([-.3,-.8],[-.27,-.4]),P([-.32,-.4],[.2,-.4]),P([-.27,-.4],[-.27,0]),P([.16,-.4],[.16,0]),{kind:"polygon",points:[[-.22,-.77],[.04,-.77],[.06,-.44],[-.22,-.44]],fill:b.shirt,main:!0},{kind:"circle",c:[-.08,-.9],r:.1,fill:b.skin},P([-.1,-.44],[.3,-.44],[.32,0]),P([0,-.74],[.18,-.55],[.3,-.58])],house:[C(-.4,-.6,.8,.6,b.wall,!0),{kind:"polygon",points:[[-.5,-.58],[0,-1],[.5,-.58]],fill:b.roof},C(-.08,-.32,.16,.32,b.wood),C(.16,-.46,.16,.14,b.screen)],car:[{kind:"polygon",fill:b.car,main:!0,points:[[-.5,-.14],[-.5,-.32],[-.3,-.36],[-.18,-.56],[.2,-.56],[.32,-.36],[.5,-.32],[.5,-.14]]},{kind:"polygon",points:[[-.14,-.51],[.17,-.51],[.25,-.37],[-.22,-.37]],fill:b.screen},{kind:"circle",c:[-.28,-.12],r:.1,fill:b.dark},{kind:"circle",c:[.28,-.12],r:.1,fill:b.dark}],bus:[C(-.5,-.66,1,.52,b.bus,!0),...[-.42,-.21,0,.21].map(t=>C(t,-.6,.15,.16,b.screen)),P([-.5,-.3],[.5,-.3]),{kind:"circle",c:[-.3,-.12],r:.1,fill:b.dark},{kind:"circle",c:[.3,-.12],r:.1,fill:b.dark}],coin:[{kind:"circle",c:[0,-.42],r:.4,fill:b.gold,main:!0},{kind:"circle",c:[0,-.42],r:.3},{kind:"curve",points:[[.1,-.56],[-.08,-.57],[-.09,-.46],[.08,-.39],[.08,-.29],[-.11,-.28]]},P([0,-.64],[0,-.2])],phone:[C(-.26,-1,.52,1,b.device,!0),C(-.2,-.92,.4,.76,b.screen),{kind:"circle",c:[0,-.08],r:.035,fill:b.paper}],document:[{kind:"polygon",points:[[-.36,-1],[.16,-1],[.36,-.8],[.36,0],[-.36,0]],fill:b.paper,main:!0},P([.16,-1],[.16,-.8],[.36,-.8]),...[-.66,-.5,-.34,-.18].map(t=>P([-.22,t],[.22,t]))],server:[-1,-.66,-.32].flatMap(t=>[C(-.36,t,.72,.3,b.metal,!0),P([-.26,t+.15],[.06,t+.15]),{kind:"circle",c:[.22,t+.15],r:.035,fill:b.green}]),bank:[{kind:"polygon",points:[[-.5,-.74],[0,-1],[.5,-.74]],fill:b.wall,main:!0},C(-.45,-.74,.9,.08,b.wall),...[-.33,-.11,.11,.33].map(t=>C(t-.04,-.66,.08,.56,b.paper)),C(-.5,-.1,1,.1,b.wall)],cloud:[{kind:"polygon",points:Jp(),fill:b.paper,main:!0}],queue:[-.32,0,.32].flatMap(t=>Vp(tl,.7,t)),desk:[C(-.5,-.5,1,.07,b.wood,!0),P([-.42,-.43],[-.42,0]),P([.42,-.43],[.42,0])],computer:[C(-.45,-1,.9,.6,b.device,!0),C(-.39,-.94,.78,.48,b.screen),{kind:"polygon",points:[[-.06,-.4],[.06,-.4],[.1,-.1],[-.1,-.1]],fill:b.device},C(-.25,-.1,.5,.08,b.device)],clock:[{kind:"circle",c:[0,-.48],r:.45,fill:b.paper,main:!0},...[[0,-.9,0,-.82],[.42,-.48,.34,-.48],[0,-.06,0,-.14],[-.42,-.48,-.34,-.48]].map(([t,e,n,s])=>P([t,e],[n,s])),P([0,-.48],[0,-.78]),P([0,-.48],[.2,-.48])],lock:[{kind:"curve",points:[[-.22,-.52],[-.22,-.76],[0,-.96],[.22,-.76],[.22,-.52]]},C(-.36,-.54,.72,.54,b.bus,!0),{kind:"circle",c:[0,-.32],r:.06,fill:b.dark},P([0,-.28],[0,-.14])],"money-arrow":[{kind:"polygon",fill:b.green,main:!0,points:[[-.5,-.4],[.12,-.4],[.12,-.56],[.5,-.3],[.12,-.04],[.12,-.2],[-.5,-.2]]},{kind:"circle",c:[-.2,-.3],r:.16,fill:b.gold},P([-.2,-.4],[-.2,-.2])],tree:[C(-.07,-.36,.14,.36,b.wood),{kind:"circle",c:[0,-.64],r:.3,fill:b.green,main:!0}],school:[C(-.45,-.6,.9,.6,b.wall,!0),{kind:"polygon",points:[[-.5,-.6],[0,-.82],[.5,-.6]],fill:b.roof},C(-.08,-.28,.16,.28,b.wood),C(-.36,-.48,.16,.12,b.screen),C(.2,-.48,.16,.12,b.screen),P([0,-.82],[0,-1]),{kind:"polygon",points:[[0,-1],[.17,-.95],[0,-.9]],fill:b.roof}],hospital:[C(-.4,-.8,.8,.8,b.paper,!0),C(-.045,-.7,.09,.26,"#C8442C"),C(-.13,-.615,.26,.09,"#C8442C"),C(-.1,-.24,.2,.24,b.metal)],factory:[{kind:"polygon",points:[[-.5,0],[-.5,-.5],[-.25,-.65],[-.25,-.5],[0,-.65],[0,-.5],[.25,-.65],[.25,-.5],[.5,-.5],[.5,0]],fill:b.wall,main:!0},C(.3,-.95,.12,.3,b.dark),C(-.38,-.32,.16,.12,b.screen),C(-.08,-.32,.16,.12,b.screen),C(.22,-.32,.16,.12,b.screen)],truck:[C(-.5,-.62,.62,.46,b.metal,!0),{kind:"polygon",points:[[.12,-.16],[.12,-.5],[.34,-.5],[.48,-.32],[.48,-.16]],fill:b.bus},{kind:"polygon",points:[[.18,-.46],[.32,-.46],[.42,-.33],[.18,-.33]],fill:b.screen},{kind:"circle",c:[-.3,-.1],r:.1,fill:b.dark},{kind:"circle",c:[.3,-.1],r:.1,fill:b.dark}],cart:[P([-.48,-.78],[-.4,-.62]),{kind:"polygon",points:[[-.4,-.62],[.42,-.62],[.32,-.26],[-.3,-.26]],fill:b.metal,main:!0},P([-.3,-.26],[-.3,-.14],[.32,-.14]),{kind:"circle",c:[-.22,-.07],r:.06,fill:b.dark},{kind:"circle",c:[.24,-.07],r:.06,fill:b.dark}],safe:[C(-.4,-.82,.8,.82,b.device,!0),C(-.3,-.72,.6,.62,b.metal),{kind:"circle",c:[0,-.41],r:.13,fill:b.paper},P([0,-.41],[.08,-.47])],bulb:[{kind:"circle",c:[0,-.62],r:.3,fill:b.gold,main:!0},C(-.13,-.33,.26,.2,b.metal),{kind:"curve",points:[[-.09,-.52],[0,-.66],[.09,-.52]]},P([-.08,-.08],[.08,-.08])],gear:[{kind:"polygon",points:[[.42,-.5],[.296,-.378],[.297,-.203],[.122,-.204],[0,-.08],[-.122,-.204],[-.297,-.203],[-.296,-.378],[-.42,-.5],[-.296,-.622],[-.297,-.797],[-.122,-.796],[-0,-.92],[.122,-.796],[.297,-.797],[.296,-.622]],fill:b.metal,main:!0},{kind:"circle",c:[0,-.5],r:.12,fill:b.paper}],database:[{kind:"polygon",points:[[-.35,-.8],[.35,-.8],[.35,-.16],[-.35,-.16]],fill:b.screen,main:!0},{kind:"polygon",points:[[.35,-.8],[.303,-.755],[.175,-.722],[0,-.71],[-.175,-.722],[-.303,-.755],[-.35,-.8],[-.303,-.845],[-.175,-.878],[-0,-.89],[.175,-.878],[.303,-.845]],fill:b.metal},{kind:"curve",points:[[-.35,-.16],[0,-.06],[.35,-.16]]},{kind:"curve",points:[[-.35,-.58],[0,-.48],[.35,-.58]]},{kind:"curve",points:[[-.35,-.37],[0,-.27],[.35,-.37]]}],robot:[P([0,-.95],[0,-1]),C(-.22,-.95,.44,.3,b.metal),{kind:"circle",c:[-.09,-.81],r:.045,fill:b.screen},{kind:"circle",c:[.09,-.81],r:.045,fill:b.screen},C(-.28,-.62,.56,.42,b.metal,!0),P([-.28,-.55],[-.42,-.35]),P([.28,-.55],[.42,-.35]),C(-.2,-.2,.12,.2,b.device),C(.08,-.2,.12,.2,b.device)],ship:[{kind:"polygon",points:[[-.48,-.3],[.48,-.3],[.36,-.04],[-.4,-.04]],fill:b.car,main:!0},C(-.42,-.62,.14,.32,b.wall),C(-.24,-.5,.2,.2,b.roof),C(-.02,-.5,.2,.2,b.bus),C(.2,-.5,.2,.2,b.green),{kind:"curve",points:[[-.5,0],[-.3,-.04],[-.1,0],[.1,-.04],[.3,0],[.5,-.04]]}],container:[C(-.46,-.52,.92,.52,b.roof,!0),...[-.3,-.15,0,.15,.3].map(t=>P([t,-.48],[t,-.04]))],warehouse:[{kind:"polygon",points:[[-.46,0],[.46,0],[.46,-.55],[0,-.82],[-.46,-.55]],fill:b.wall,main:!0},C(-.2,-.38,.4,.38,b.metal),P([-.2,-.26],[.2,-.26]),P([-.2,-.13],[.2,-.13])],box:[C(-.36,-.5,.52,.5,b.wood,!0),{kind:"polygon",points:[[-.36,-.5],[.16,-.5],[.36,-.64],[-.16,-.64]],fill:b.wood},{kind:"polygon",points:[[.16,0],[.36,-.14],[.36,-.64],[.16,-.5]],fill:b.wood},P([-.1,-.5],[.1,-.64])],pallet:[C(-.46,-.12,.92,.06,b.wood),...[-.42,-.05,.32].map(t=>C(t,-.06,.1,.06,b.wood)),C(-.42,-.5,.4,.38,b.wood,!0),C(.02,-.5,.4,.38,b.wood),C(-.2,-.82,.4,.32,b.wood)],shop:[C(-.42,-.6,.84,.6,b.wall,!0),{kind:"polygon",points:[[-.48,-.6],[.48,-.6],[.42,-.78],[-.42,-.78]],fill:b.roof},C(-.34,-.48,.34,.26,b.screen),C(.08,-.42,.24,.42,b.wood)],shelf:[C(-.4,-.92,.8,.92,b.paper,!0),P([-.4,-.62],[.4,-.62]),P([-.4,-.32],[.4,-.32]),C(-.32,-.8,.16,.18,b.roof),C(-.1,-.78,.14,.16,b.bus),C(.1,-.5,.22,.18,b.green),C(-.3,-.2,.24,.2,b.wood)],field:[P([-.48,0],[.48,0]),...[-.3,0,.3].flatMap(t=>[{kind:"curve",points:[[t,0],[t-.02,-.25],[t,-.5]]},{kind:"circle",c:[t-.08,-.32],r:.07,fill:b.green,main:!0},{kind:"circle",c:[t+.08,-.42],r:.07,fill:b.green,main:!0},{kind:"circle",c:[t,-.52],r:.06,fill:b.roof}])],cup:[{kind:"polygon",points:[[-.26,-.52],[.26,-.52],[.2,-.1],[-.2,-.1]],fill:b.paper,main:!0},{kind:"curve",points:[[.24,-.44],[.4,-.38],[.22,-.2]]},{kind:"polygon",points:[[-.46,-.1],[.46,-.1],[.36,0],[-.36,0]],fill:b.paper},{kind:"curve",points:[[-.08,-.62],[-.02,-.72],[-.08,-.84]]},{kind:"curve",points:[[.08,-.62],[.14,-.72],[.08,-.84]]}],function:[C(-.38,-.72,.76,.62,b.screen,!0),P([-.14,-.62],[0,-.62],[.14,-.2]),P([.02,-.42],[-.14,-.2])],"api-gateway":[C(-.12,-.8,.24,.8,b.metal,!0),P([-.48,-.55],[-.16,-.55]),P([-.24,-.62],[-.16,-.55],[-.24,-.48]),P([.16,-.3],[.48,-.3]),P([.4,-.37],[.48,-.3],[.4,-.23])],cache:[C(-.34,-.66,.68,.66,b.metal,!0),{kind:"polygon",points:[[.04,-.58],[-.12,-.3],[0,-.3],[-.06,-.08],[.14,-.38],[.02,-.38]],fill:b.gold}],cluster:[{kind:"curve",points:[[-.4,-.8],[0,-.86],[.4,-.8],[.48,-.45],[.4,-.1],[0,-.04],[-.4,-.1],[-.48,-.45],[-.4,-.8]]},C(-.3,-.7,.24,.2,b.screen,!0),C(.06,-.7,.24,.2,b.screen,!0),C(-.12,-.38,.24,.2,b.screen,!0)],board:[C(-.48,-.9,.96,.6,b.board,!0),C(-.34,-.76,.42,.03,b.chalk),C(-.34,-.62,.58,.03,b.chalk),C(-.34,-.48,.3,.03,b.chalk),P([-.3,-.3],[-.36,0]),P([.3,-.3],[.36,0])],book:[{kind:"polygon",points:[[0,-.62],[-.46,-.7],[-.46,-.1],[0,-.04]],fill:b.paper,main:!0},{kind:"polygon",points:[[0,-.62],[.46,-.7],[.46,-.1],[0,-.04]],fill:b.paper,main:!0},P([-.36,-.52],[-.1,-.48]),P([-.36,-.38],[-.1,-.34]),P([.1,-.48],[.36,-.52]),P([.1,-.34],[.36,-.38])],pencil:[{kind:"polygon",points:[[-.38,-.12],[.22,-.72],[.34,-.6],[-.26,0]],fill:b.bus,main:!0},{kind:"polygon",points:[[.22,-.72],[.34,-.6],[.44,-.86]],fill:b.wood},{kind:"polygon",points:[[-.38,-.12],[-.26,0],[-.46,-.02]],fill:b.roof}]},rl=["happy","sad","surprised","worried","idea"],Wp={person:[0,-.87,.11],"person-pointing":[0,-.87,.11],"person-sitting":[-.08,-.9,.1]},il=t=>{let e=Yn(t);return!!e&&e in Wp};var ol=["spin","drive","steam","talk","pulse","float"],Gp=["lesson","pitch","arch","decision","data","timeline","story"],al=8,ll=6,cl=2e5,fl=6e5,ul=24;var pl=["card","line","arrow","polyline","polygon","curve","circle","ellipse","plot","text","highlight","pause","prop","repeat","when","move","link","counter","row","column","grid","axis","timeline","balloon","brace","note","table","bars","chain","animate","lottie"],Ke=["text","prop","card","counter","circle","ellipse"],dl=["row","column","grid","chain"],Xp=50;function F(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e}: expected an object.`)}function R(t,e){if(typeof t!="string"||!t.trim()||t.length>2e3)throw new Error(`${e}: expected text of 1 to 2000 characters.`)}function x(t,e,n=-1e4,s=1e4){if(typeof t!="number"||!Number.isFinite(t)||t<n||t>s)throw new Error(`${e}: expected a number between ${n} and ${s}.`)}function J(t,e){if(typeof t=="string"){if(R(t,e),t.length>300)throw new Error(`${e}: expression too long.`)}else x(t,e)}function V(t,e){if(!Array.isArray(t)||t.length!==2)throw new Error(`${e}: expected [x, y].`);t.forEach((n,s)=>J(n,`${e}[${s}]`))}function te(t,e){t!==void 0&&R(t,e)}function W(t,e,n){if(t!==void 0&&(typeof t!="string"||!e.includes(t)))throw new Error(`${n}: choose one of ${e.join(", ")}.`)}function zn(t){if(!/^[A-Za-z_][A-Za-z_0-9]*$/.test(t)||["__proto__","constructor","prototype",...el].includes(t))throw new Error(`Invalid variable name: "${t}".`)}var Ue=(t,e)=>e.includes("{")||t.exact.has(e)||[...t.repeated].some(n=>e.startsWith(`${n}-`)&&/^\d+$/.test(e.slice(n.length+1)));function Ce(t,e,n,s){s&&t[e]===void 0&&(t[e]=[0,0]),V(t[e],`${n}.${e}`)}function qt(t,e,n,s,r=!1){if(F(t,e),++n.count>500)throw new Error(`${e}: a recipe draws at most 500 steps, counting those inside repeat and when.`);if(s){for(let a of["chapter","say","duration"])if(t[a]!==void 0)throw new Error(`${e}.${a}: put it on the ${s} step itself, not on a step inside it.`);if(t.type==="pause")throw new Error(`${e}: a pause cannot go inside ${s}.`);if(t.type==="repeat"&&s==="repeat")throw new Error(`${e}: a repeat cannot go inside another repeat.`);if(dl.includes(s)&&t.place!==void 0)throw new Error(`${e}.place: the ${s} places the steps inside it.`)}if(!pl.includes(t.type))throw new Error(`${e}: unknown type "${t.type}".`);for(let a of["id","say","chapter"])te(t[a],`${e}.${a}`);if(t.duration!==void 0&&x(t.duration,`${e}.duration`,0,3e4),t.nudge!==void 0){if(["pause","move","link","animate"].includes(t.type))throw new Error(`${e}.nudge: a ${t.type} has no place of its own to move.`);if(!Array.isArray(t.nudge)||t.nudge.length!==2)throw new Error(`${e}.nudge: use [dx, dy].`);t.nudge.forEach((a,l)=>x(a,`${e}.nudge[${l}]`,-900,900))}let i=s!==null&&dl.includes(s)||r;if(t.place!==void 0){if(!Ke.includes(t.type))throw new Error(`${e}.place: only ${Ke.join(", ")} can be placed.`);if(F(t.place,`${e}.place`),R(t.place.to,`${e}.place.to`),!Ue(n,String(t.place.to)))throw new Error(`${e}.place.to: no earlier step has the id "${t.place.to}".`);if(!["below","above","left","right"].includes(t.place.side))throw new Error(`${e}.place.side: choose one of below, above, left, right.`);t.place.gap!==void 0&&x(t.place.gap,`${e}.place.gap`,-200,400),W(t.place.align,["center","start","end"],`${e}.place.align`)}let o=i||t.place!==void 0;if(t.style!==void 0){F(t.style,`${e}.style`);for(let a of["color","fill"]){let l=t.style[a];if(l!==void 0&&(typeof l!="string"||!/^(#[\da-f]{3,8}|[a-z]+)$/i.test(l)))throw new Error(`${e}.style.${a}: use a hex colour or a colour name, no URLs.`)}for(let a of["width","roughness","bowing"])t.style[a]!==void 0&&x(t.style[a],`${e}.style.${a}`,0,20);if(t.style.opacity!==void 0&&x(t.style.opacity,`${e}.style.opacity`,0,1),t.style.dashed!==void 0&&typeof t.style.dashed!="boolean")throw new Error(`${e}: dashed must be a boolean.`);W(t.style.fillStyle,["hachure","solid","zigzag","cross-hatch","dots"],`${e}.style.fillStyle`)}switch(t.type){case"line":case"arrow":case"highlight":V(t.from,`${e}.from`),V(t.to,`${e}.to`),t.thickness!==void 0&&x(t.thickness,`${e}.thickness`,1,200);break;case"polyline":case"polygon":case"curve":if(!Array.isArray(t.points)||t.points.length<(t.type==="polygon"?3:2)||t.points.length>500)throw new Error(`${e}: points needs ${t.type==="polygon"?3:2} to 500 points.`);t.points.forEach((a,l)=>V(a,`${e}.points[${l}]`));break;case"circle":case"ellipse":Ce(t,"center",e,o);for(let a of t.type==="circle"?["r"]:["rx","ry"])J(t[a],`${e}.${a}`),typeof t[a]=="number"&&x(t[a],`${e}.${a}`,0);break;case"text":Ce(t,"at",e,o),R(t.text,`${e}.text`),t.size!==void 0&&x(t.size,`${e}.size`,1,200),t.rotate!==void 0&&x(t.rotate,`${e}.rotate`,-360,360),W(t.font,["hand","body"],`${e}.font`),W(t.anchor,["start","middle","end"],`${e}.anchor`);break;case"card":Ce(t,"at",e,o),J(t.w,`${e}.w`),J(t.h,`${e}.h`);for(let a of["w","h"])typeof t[a]=="number"&&x(t[a],`${e}.${a}`,40);if(R(t.title,`${e}.title`),t.lines!==void 0){if(!Array.isArray(t.lines)||t.lines.length>6)throw new Error(`${e}: at most 6 lines per card.`);t.lines.forEach((a,l)=>R(a,`${e}.lines[${l}]`))}break;case"plot":R(t.fn,`${e}.fn`),t.var!==void 0&&(R(t.var,`${e}.var`),zn(String(t.var))),V(t.domain,`${e}.domain`),V(t.range,`${e}.range`),F(t.box,`${e}.box`);for(let a of["x","y","w","h"])J(t.box[a],`${e}.box.${a}`);if(t.samples!==void 0&&(x(t.samples,`${e}.samples`,2,1e3),!Number.isInteger(t.samples)))throw new Error(`${e}: samples must be an integer.`);break;case"pause":x(t.ms,`${e}.ms`,0,3e4),te(t.ask,`${e}.ask`);break;case"prop":if(!nl(t.name)&&!n.figures.has(String(t.name))){let a=n.figures.size?`, or one the recipe defines (${[...n.figures].join(", ")})`:"";throw new Error(`${e}.name: unknown prop "${String(t.name)}"; use one of ${Br.join(", ")}${a}.`)}if(Ce(t,"at",e,o),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,10,1e3)),te(t.label,`${e}.label`),t.flip!==void 0&&typeof t.flip!="boolean")throw new Error(`${e}.flip: expected true or false.`);if(t.mood!==void 0){if(!il(t.name))throw new Error(`${e}.mood: only a person (person, person-pointing, person-sitting) has a face.`);W(t.mood,rl,`${e}.mood`)}break;case"repeat":if(J(t.times,`${e}.times`),typeof t.times=="number"&&(x(t.times,`${e}.times`,0,Xp),!Number.isInteger(t.times)))throw new Error(`${e}.times: expected a whole number.`);qt(t.step,`${e}.step`,n,"repeat",i);break;case"when":if(J(t.if,`${e}.if`),!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>50)throw new Error(`${e}.steps: expected 1 to 50 steps.`);t.steps.forEach((a,l)=>qt(a,`${e}.steps[${l}]`,n,s??"when"));break;case"move":if(R(t.target,`${e}.target`),!Ue(n,String(t.target)))throw new Error(`${e}.target: no earlier step has the id "${t.target}".`);V(t.to,`${e}.to`),W(t.along,["line","curve"],`${e}.along`),t.ms!==void 0&&x(t.ms,`${e}.ms`,200,5e3);break;case"lottie":if(R(t.src,`${e}.src`),V(t.at,`${e}.at`),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,24,1e3)),t.loop!==void 0&&typeof t.loop!="boolean")throw new Error(`${e}.loop: expected true or false.`);break;case"animate":if(R(t.target,`${e}.target`),!Ue(n,String(t.target)))throw new Error(`${e}.target: no earlier step has the id "${t.target}".`);if(W(t.effect,[...ol,"stop"],`${e}.effect`),t.effect===void 0)throw new Error(`${e}.effect: choose one of ${[...ol,"stop"].join(", ")}.`);W(t.speed,["slow","fast"],`${e}.speed`);break;case"link":for(let a of["from","to"])if(R(t[a],`${e}.${a}`),!Ue(n,String(t[a])))throw new Error(`${e}.${a}: no earlier step has the id "${t[a]}".`);te(t.label,`${e}.label`);break;case"counter":if(Ce(t,"at",e,o),J(t.value,`${e}.value`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "R$ {v:0}".`);t.size!==void 0&&x(t.size,`${e}.size`,1,200),W(t.anchor,["start","middle","end"],`${e}.anchor`);break;case"row":case"column":case"grid":if(i)throw new Error(`${e}: a ${t.type} cannot go inside another ${s}.`);if(Ce(t,"at",e,!1),t.gap!==void 0&&x(t.gap,`${e}.gap`,0,400),t.type==="grid"){if(x(t.columns,`${e}.columns`,1,12),!Number.isInteger(t.columns))throw new Error(`${e}.columns: expected a whole number.`)}else W(t.align,["center","start","end"],`${e}.align`);if(!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>50)throw new Error(`${e}.steps: expected 1 to 50 steps.`);t.steps.forEach((a,l)=>{F(a,`${e}.steps[${l}]`);let c=a.type==="repeat"?a.step?.type:a.type;if(!Ke.includes(c))throw new Error(`${e}.steps[${l}]: a ${t.type} holds only ${Ke.join(", ")} (or a repeat of one).`);qt(a,`${e}.steps[${l}]`,n,t.type)});break;case"chain":if(i)throw new Error(`${e}: a chain cannot go inside a ${s}.`);if(Ce(t,"at",e,!1),t.gap!==void 0&&t.gap!=="auto"&&x(t.gap,`${e}.gap`,0,400),W(t.direction,["right","down"],`${e}.direction`),t.wrap!==void 0&&typeof t.wrap!="boolean")throw new Error(`${e}.wrap: expected true or false.`);if(te(t.forward,`${e}.forward`),te(t.back,`${e}.back`),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,10,1e3)),!Array.isArray(t.steps)||t.steps.length<2||t.steps.length>12)throw new Error(`${e}.steps: a chain joins 2 to 12 pieces.`);t.steps.forEach((a,l)=>{if(F(a,`${e}.steps[${l}]`),!Ke.includes(a.type))throw new Error(`${e}.steps[${l}]: a chain holds only ${Ke.join(", ")}.`);qt(a,`${e}.steps[${l}]`,n,"chain")});break;case"axis":case"timeline":if(V(t.from,`${e}.from`),V(t.to,`${e}.to`),V(t.domain,`${e}.domain`),t.type==="axis"){if(t.ticks!==void 0){if(Array.isArray(t.ticks)){if(t.ticks.length>30)throw new Error(`${e}.ticks: at most 30 marks.`);t.ticks.forEach((a,l)=>x(a,`${e}.ticks[${l}]`))}else if(x(t.ticks,`${e}.ticks`,0,30),!Number.isInteger(t.ticks))throw new Error(`${e}.ticks: expected a whole number.`)}if(te(t.label,`${e}.label`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "{v} km".`)}else{if(!Array.isArray(t.marks)||t.marks.length===0||t.marks.length>20)throw new Error(`${e}.marks: expected 1 to 20 marks.`);t.marks.forEach((a,l)=>{F(a,`${e}.marks[${l}]`),J(a.at,`${e}.marks[${l}].at`),te(a.label,`${e}.marks[${l}].label`),te(a.text,`${e}.marks[${l}].text`)})}break;case"balloon":if(R(t.to,`${e}.to`),!Ue(n,String(t.to)))throw new Error(`${e}.to: no earlier step has the id "${t.to}".`);if(R(t.text,`${e}.text`),String(t.text).length>300)throw new Error(`${e}.text: keep a balloon under 300 characters.`);W(t.side,["below","above","left","right"],`${e}.side`),W(t.kind,["speech","thought"],`${e}.kind`),t.width!==void 0&&x(t.width,`${e}.width`,80,600),t.size!==void 0&&x(t.size,`${e}.size`,12,60);break;case"brace":if(V(t.from,`${e}.from`),V(t.to,`${e}.to`),te(t.label,`${e}.label`),t.flip!==void 0&&typeof t.flip!="boolean")throw new Error(`${e}.flip: expected true or false.`);break;case"note":if(V(t.at,`${e}.at`),R(t.text,`${e}.text`),t.to===void 0==(t.point===void 0))throw new Error(`${e}: a note points either to an element (to) or to a point (point).`);if(t.to!==void 0){if(R(t.to,`${e}.to`),!Ue(n,String(t.to)))throw new Error(`${e}.to: no earlier step has the id "${t.to}".`)}else V(t.point,`${e}.point`);t.size!==void 0&&x(t.size,`${e}.size`,12,60);break;case"table":if(V(t.at,`${e}.at`),!Array.isArray(t.rows)||t.rows.length===0||t.rows.length>12)throw new Error(`${e}.rows: expected 1 to 12 rows.`);if(t.rows.forEach((a,l)=>{if(!Array.isArray(a)||a.length===0||a.length>6)throw new Error(`${e}.rows[${l}]: expected 1 to 6 cells.`);a.forEach((c,p)=>{if(typeof c!="string"||c.length>120)throw new Error(`${e}.rows[${l}][${p}]: expected text of up to 120 characters.`)})}),t.header!==void 0&&typeof t.header!="boolean")throw new Error(`${e}.header: expected true or false.`);t.size!==void 0&&x(t.size,`${e}.size`,12,40);break;case"bars":F(t.box,`${e}.box`);for(let a of["x","y","w","h"])J(t.box[a],`${e}.box.${a}`);if(!Array.isArray(t.values)||t.values.length===0||t.values.length>12)throw new Error(`${e}.values: expected 1 to 12 values.`);if(t.values.forEach((a,l)=>J(a,`${e}.values[${l}]`)),t.labels!==void 0){if(!Array.isArray(t.labels)||t.labels.length>t.values.length)throw new Error(`${e}.labels: at most one label per value.`);t.labels.forEach((a,l)=>R(a,`${e}.labels[${l}]`))}if(t.max!==void 0&&J(t.max,`${e}.max`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "{v}%".`);break}typeof t.id=="string"&&(s==="repeat"?n.repeated:n.exact).add(t.id)}function Hp(t,e){let n=`defs.${t}`;if(!/^[a-z][a-z0-9-]{1,30}$/.test(t))throw new Error(`${n}: a figure's name is 2 to 31 lowercase letters, digits or -, starting with a letter.`);if(Yn(t)||Object.hasOwn(Un,t)||pl.includes(t)||["define","title","param","switch","var"].includes(t))throw new Error(`${n}: "${t}" is already a prop or a step; choose another name.`);if(F(e,n),!Array.isArray(e.shapes)||e.shapes.length===0||e.shapes.length>ul)throw new Error(`${n}.shapes: expected 1 to ${ul} shapes.`);let s=(r,i)=>{if(typeof r!="number"||!Number.isInteger(r)||r<0||r>100)throw new Error(`${i}: expected a whole number from 0 to 100 (the figure's grid, y down; it stands at 50,100).`)};e.shapes.forEach((r,i)=>{let o=`${n}.shapes[${i}]`;if(F(r,o),r.fill!==void 0&&(typeof r.fill!="string"||!/^(#[0-9a-fA-F]{3,8}|[a-z]{3,20})$/.test(r.fill)))throw new Error(`${o}.fill: a colour, as hex or a plain name.`);if(r.kind==="circle"){if(!Array.isArray(r.c)||r.c.length!==2)throw new Error(`${o}.c: expected [x, y].`);r.c.forEach((l,c)=>s(l,`${o}.c[${c}]`)),s(r.r,`${o}.r`);return}if(!["polygon","polyline","curve"].includes(r.kind))throw new Error(`${o}.kind: choose one of polygon, polyline, curve, circle.`);let a=r.kind==="polygon"?3:2;if(!Array.isArray(r.points)||r.points.length<a||r.points.length>40)throw new Error(`${o}.points: a ${r.kind} takes ${a} to 40 points.`);r.points.forEach((l,c)=>{if(!Array.isArray(l)||l.length!==2)throw new Error(`${o}.points[${c}]: expected [x, y].`);l.forEach((p,u)=>s(p,`${o}.points[${c}][${u}]`))})})}function Qp(t,e){let n=`lottie "${t}"`;F(e,n);let s=JSON.stringify(e).length;if(s>cl)throw new Error(`${n}: ${Math.round(s/1e3)} KB; an animation can have at most ${cl/1e3} KB.`);for(let i of["fr","ip","op","w","h"])x(e[i],`${n}.${i}`,0,1e5);if(typeof e.v!="string"||!Array.isArray(e.layers))throw new Error(`${n}: not a Lottie animation (it needs v and layers).`);let r=(i,o)=>{if(Array.isArray(i))return i.forEach((a,l)=>r(a,`${o}[${l}]`));if(!(!i||typeof i!="object"))for(let[a,l]of Object.entries(i)){if(a==="x"&&typeof l=="string")throw new Error(`${n}: the animation has an expression (code inside it, at ${o}); only animations without expressions play.`);r(l,`${o}.${a}`)}};r(e.layers,"layers");for(let i of Array.isArray(e.assets)?e.assets:[]){let o=i?.p;if(typeof o=="string"&&o&&!o.startsWith("data:")&&!Array.isArray(i.layers))throw new Error(`${n}: an image from outside the animation ("${o.slice(0,40)}"); only images inside it (data:) are kept.`)}return s}function Zp(t){F(t,"The recipe");let e=t;x(e.width,"width",100,4e3),x(e.height,"height",100,4e3);for(let r of["id","title","category"])te(e[r],r);if(e.locale!==void 0&&!(typeof e.locale=="string"&&/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(e.locale)&&Intl.NumberFormat.supportedLocalesOf([e.locale]).length>0))throw new Error('locale: expected a language tag such as "en-US" or "pt-BR".');if(W(e.background,["dots","grid","plain"],"background"),W(e.kind,Gp,"kind"),te(e.source,"source"),e.quiz!==void 0&&e.kind!==void 0&&e.kind!=="lesson")throw new Error(`quiz: only a lesson has a quiz (this drawing is a ${e.kind}).`);if(W(e.theme,["paper","chalkboard"],"theme"),e.quiz!==void 0){if(F(e.quiz,"quiz"),R(e.quiz.question,"quiz.question"),!Array.isArray(e.quiz.options)||e.quiz.options.length<2||e.quiz.options.length>4)throw new Error("quiz.options: expected 2 to 4 options.");if(e.quiz.options.forEach((r,i)=>{if(F(r,`quiz.options[${i}]`),R(r.text,`quiz.options[${i}].text`),R(r.why,`quiz.options[${i}].why`),typeof r.right!="boolean")throw new Error(`quiz.options[${i}].right: expected true or false.`)}),e.quiz.options.filter(r=>r.right===!0).length!==1)throw new Error("quiz.options: exactly one option is right.")}if(e.learning!==void 0){F(e.learning,"learning");for(let r of["goal","question","answer","caveat"])R(e.learning[r],`learning.${r}`)}if(e.params!==void 0){F(e.params,"params");for(let[r,i]of Object.entries(e.params))if(zn(r),F(i,`params.${r}`),R(i.label,`params.${r}.label`),x(i.min,`${r}.min`),x(i.max,`${r}.max`),x(i.step,`${r}.step`,1e-6),x(i.value,`${r}.value`,i.min,i.max),i.max<=i.min)throw new Error(`${r}: max must be greater than min.`)}if(e.vars!==void 0){F(e.vars,"vars");for(let[r,i]of Object.entries(e.vars))zn(r),J(i,`vars.${r}`)}if(e.switches!==void 0){F(e.switches,"switches");let r=Object.entries(e.switches);if(r.length>8)throw new Error("switches: at most 8.");for(let[i,o]of r){if(zn(i),Object.hasOwn(e.params??{},i)||Object.hasOwn(e.vars??{},i))throw new Error(`switches.${i}: the name is already a param or a var.`);if(F(o,`switches.${i}`),R(o.label,`switches.${i}.label`),typeof o.on!="boolean")throw new Error(`switches.${i}.on: expected true or false.`)}}if(!Array.isArray(e.steps)||e.steps.length===0||e.steps.length>250)throw new Error("A recipe needs 1 to 250 steps.");let n=new Set;if(e.defs!==void 0){F(e.defs,"defs");let r=Object.entries(e.defs);if(r.length>al)throw new Error(`defs: at most ${al} figures.`);for(let[i,o]of r)Hp(i,o),n.add(i)}if(e.lotties!==void 0){F(e.lotties,"lotties");let r=Object.entries(e.lotties);if(r.length>ll)throw new Error(`lotties: at most ${ll} animations.`);let i=r.reduce((o,[a,l])=>o+Qp(a,l),0);if(i>fl)throw new Error(`lotties: ${Math.round(i/1e3)} KB in all; at most ${fl/1e3} KB.`)}if(e.credits!==void 0){if(!Array.isArray(e.credits)||e.credits.length>5)throw new Error("credits: at most 5 lines.");e.credits.forEach((r,i)=>R(r,`credits[${i}]`))}let s={exact:new Set,repeated:new Set,count:0,figures:n};return e.steps.forEach((r,i)=>qt(r,`Step ${i+1}`,s,null)),{...e,id:e.id??"pasted",title:e.title??"",background:e.background??"dots"}}export{Mr as DEFAULT_PROFILE,Vr as agentsIn,jp as applyChanges,vp as compare,sp as extractAgent,Fp as fromSheets,At as groupPatterns,rp as knownKinds,ee as labelOf,zp as lessonOf,yp as problemText,dp as readCast,op as readProfile,Np as reviewCast,Zp as validateScene,xp as workbookFile,_p as workbookOf,gp as writeCast};
|
|
157
|
+
<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="${Gi(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"?>
|
|
158
|
+
<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`,gh(o,n)])];return wh(r.map(([o,a])=>[o,cl.encode(a)]))}var yh=(()=>{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 bh(e){let t=4294967295;for(let n=0;n<e.length;n++)t=yh[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function wh(e){let t=[],n=[],s=0;for(let[l,d]of e){let f=cl.encode(l),u=bh(d),p=new DataView(new ArrayBuffer(30));p.setUint32(0,67324752,!0),p.setUint16(4,20,!0),p.setUint16(6,2048,!0),p.setUint16(8,0,!0),p.setUint32(14,u,!0),p.setUint32(18,d.length,!0),p.setUint32(22,d.length,!0),p.setUint16(26,f.length,!0),t.push(new Uint8Array(p.buffer),f,d);let y=new DataView(new ArrayBuffer(46));y.setUint32(0,33639248,!0),y.setUint16(4,20,!0),y.setUint16(6,20,!0),y.setUint16(8,2048,!0),y.setUint32(16,u,!0),y.setUint32(20,d.length,!0),y.setUint32(24,d.length,!0),y.setUint16(28,f.length,!0),y.setUint32(42,s,!0),n.push(new Uint8Array(y.buffer),f),s+=30+f.length+d.length}let i=n.reduce((l,d)=>l+d.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((l,d)=>l+d.length,0)),c=0;for(let l of o)a.set(l,c),c+=l.length;return a}var kh=e=>fl(e),Sh={bold:!0,fill:"E8EEF7"},$h={v:"\u25CF",fill:"DDF3E6",center:!0},vh={v:"\xD7",fill:"FFD5CC",center:!0,bold:!0},Ah={v:"\u25D0",fill:"FFF3C4",center:!0},Oh={v:"\u2248",fill:"FFF6DC",center:!0,bold:!0},ul=Object.keys(Ki);function Nh(e,t,n,s="en"){let i=Qn[s],r=(m,v,P)=>({key:m,name:i[m],header:!0,columns:v.map(([U,A])=>({title:U,width:A})),rows:[v.map(([U])=>({v:U,...Sh})),...P]}),o=m=>i[e.roles[m]],a=m=>m.startsWith("type:")?`${i.type}:${e.typeNames[m.slice(5)]??m.slice(5)}`:i[m],c=m=>(e.types[m]??[]).map(v=>e.typeNames[v]??v).join(" \xB7 "),l=m=>ae(m,s,e.names),d=[...e.agents].sort((m,v)=>m.role===v.role?m.id.localeCompare(v.id):m.role==="orchestrator"?-1:1),f=[...new Set([...d.flatMap(m=>Object.keys(m.facts)),...e.patterns.map(m=>m.key)])].filter(m=>!m.endsWith("~variant")).sort((m,v)=>ul.indexOf(Lt(m))-ul.indexOf(Lt(v))||m.localeCompare(v)),u=new Set(e.offPattern.map(m=>`${m.agent} ${m.key}`)),p=m=>e.agents.filter(v=>v.role===m).length,y={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,p("orchestrator")],[i.count.specialists,p("specialist")],[i.count.patterns,e.patterns.length],[i.count.off,new Set(e.offPattern.map(m=>m.agent)).size],[i.count.gaps,e.gaps.length],[i.count.conflicts,e.conflicts.length],[i.count.solos,t.filter(m=>m.key==="solo").length],["",""],[{v:t.length?i.look:i.nothing,bold:!0},""],...t.map(m=>["",{v:m[s],wrap:!0}])]},g=r("matrix",[[i.dimension,18],[i.fact,40],[i.key,34],...d.map(m=>[m.id,14])],f.map(m=>[Ki[Lt(m)][s],l(m),m,...d.map(v=>m in v.facts?m.startsWith("declared:")?Ah:$h:`${m}~variant`in v.facts?Oh:u.has(`${v.id} ${m}`)?vh:"")])),{look:w,everyone:N}=Rt(e),h=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]],[...w,...N].map(m=>{let v=e.offPattern.filter(P=>P.key===m.key).map(P=>P.agent);return[m.key,l(m.key),a(m.scope),i[m.role],`${Math.round(m.share*100)}%`,m.agents.join(", "),v.join(", "),m.decision?i[m.decision.status==="accepted"?"accept":"reject"]:"",m.decision?.why??""]})),k=r("off",[[i.agent,24],[i.role,14],[i.missing,44],[i.key,34],[i.scope,14],[i.accepted,14]],e.offPattern.map(m=>[m.agent,o(m.agent),l(m.key),m.key,a(m.scope),e.patterns.find(v=>v.key===m.key)?.decision?.status==="accepted"?i.yes:""])),x=r("gaps",[[i.rule,16],[i.says,50],[i.role,14],[i.notMet,60]],e.gaps.map(m=>[m.rule.id,m.rule.says,m.rule.role?i[m.rule.role]:"",m.agents.join(", ")])),S=r("conflicts",[[i.agent,24],[i.fact,40],[i.key,34],[i.declared,20],[i.source,40],[i.inYaml,12]],e.conflicts.map(m=>[m.agent,l(m.key),m.key,m.declared,m.source,m.observed?i.yes:i.no])),O=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]],d.map(m=>[m.id,m.displayName??"",i[m.role],c(m.id),Object.keys(m.facts).length,e.offPattern.filter(v=>v.agent===m.id).map(v=>l(v.key)).join("; "),e.solos.filter(v=>v.agents[0]===m.id).map(v=>l(v.key)).join("; "),m.children.map(v=>v.name).join(", "),e.unknown.filter(v=>v.agent===m.id).length||""])),q=r("evidence",[[i.agent,30],[i.fact,40],[i.key,34],[i.file,50],[i.line,8]],d.flatMap(m=>[{who:m.id,facts:m.facts},...m.children.map(v=>({who:`${m.id} \u203A ${v.name}`,facts:v.facts}))]).flatMap(({who:m,facts:v})=>Object.entries(v).sort(([P],[U])=>P.localeCompare(U)).flatMap(([P,U])=>U.map(A=>[m,l(P),P,A.file,A.line??""])))),E=r("declared",[[i.agent,24],[i.key,34],[i.value,40],[i.source,40]],n.declared.map(m=>[m.agent,m.key,m.value,m.source])),I=r("text",[[i.id,28],[i.label,36],[i.body,70],[i.have,50],[i.variant,40],[i.official,10]],e.blocks.map(m=>[m.id,m.official??m.label,{v:m.text,wrap:!0},Object.keys(m.holders).sort().join(", "),Object.entries(m.variants).sort(([v],[P])=>v.localeCompare(P)).map(([v,P])=>`${v} (${Math.round(P.similarity*100)}%)`).join(", "),m.official?i.yes:""])),b=[y,g,h,...e.blocks.length?[I]:[],k,x,S,O,q,E];return e.unknown.length&&b.push(r("unknown",[[i.agent,24],[i.file,50],[i.why,40],[i.kind,24]],e.unknown.map(m=>[m.agent,m.file,i.why_[m.why],m.kind??""]))),b}var me=e=>String(e??"").normalize("NFD").replace(/[̀-ͯ]/g,"").trim().toLowerCase(),Ft=Object.values(Qn),dl=(e,t)=>e.find(n=>Ft.some(s=>me(s[t])===me(n.name)));function pl(e,...t){let n=t.map(s=>e?.rows[0]?.findIndex(i=>Ft.some(r=>me(r[s])===me(i)))??-1);return s=>n.map(i=>i<0?"":String(s[i]??"").trim())}var hl=(e,t)=>t.find(([,n])=>Ft.some(s=>me(s[n])===me(e)))?.[0],ml=e=>e.slice(1).filter(t=>t.some(n=>String(n??"").trim())),gl=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Eh(e,t,n={}){let s=[],i=[],r=dl(t,"declared");if(r){let a=pl(r,"agent","key","value","source"),c=[];ml(r.rows).forEach((f,u)=>{let[p,y,g,w]=a(f);!p||!y?i.push(`${r.name}, ${u+2}: \xAB${a(r.rows[0])[p?1:0]}\xBB ?`):c.push({agent:p,key:y,value:g,source:w})});let l=f=>`${f.agent} ${f.key}`,d=0;for(let f of c){let u=e.declared.find(p=>l(p)===l(f));u?gl(u,f)||s.push({key:`d${++d}`,kind:"declared",op:"set",before:u,after:f}):s.push({key:`d${++d}`,kind:"declared",op:"add",after:f})}for(let f of e.declared)c.some(u=>l(u)===l(f))||s.push({key:`d${++d}`,kind:"declared",op:"remove",before:f})}let o=dl(t,"patterns");if(o){let a=pl(o,"key","scope","decision","why"),c=0;for(let l of ml(o.rows)){let[d,f,u,p]=a(l);if(!d)continue;let y=e.decisions.find(k=>k.key===d);if(!u){y&&s.push({key:`p${++c}`,kind:"decision",op:"remove",before:y});continue}let g=hl(u,[["accepted","accept"],["rejected","reject"]]),w=/^(tipo|type)\s*:\s*(.+)$/i.exec(f),N=w?Object.entries(n).find(([k,x])=>me(x)===me(w[2])||me(k)===me(w[2]))?.[0]:void 0,h=w?N?`type:${N}`:void 0:hl(f,[["platform","platform"],["specialist","specialist"],["orchestrator","orchestrator"]]);if(!g)i.push(`${o.name}, ${d}: \xAB${u}\xBB \u2014 ${Ft.map(k=>`${k.accept}/${k.reject}`).join(", ")}`);else if(!h)i.push(`${o.name}, ${d}: \xAB${f}\xBB \u2014 ${Ft.map(k=>`${k.platform}/${k.specialist}/${k.orchestrator}`).join(", ")}`);else{let k={key:d,status:g,scope:h,why:p};y?gl(y,k)||s.push({key:`p${++c}`,kind:"decision",op:"set",before:y,after:k}):s.push({key:`p${++c}`,kind:"decision",op:"add",after:k})}}}return{changes:s,problems:i}}function xh(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 _t="#8C8578";var Zn="#C8442C",bl="#2E8F62";var yl=e=>Math.round(e*10)/10,jt=e=>[yl(e[0]),yl(e[1])],we=(e,t,n=22,s="start",i)=>({type:"text",at:jt(e),text:t,size:n,anchor:s,...i?{style:{color:i}}:{}}),wl=(e,t,n)=>({type:"line",from:jt(e),to:jt(t),...n?{style:n}:{}}),kl=(e,t,n)=>({type:"arrow",from:jt(e),to:jt(t),...n?{style:n}:{}});var Ch=(e,t)=>e.length*t*.48;function es(e,t,n){let s=[],i="";for(let r of e.split(/\s+/).filter(Boolean)){let o=i?`${i} ${r}`:r;i&&Ch(o,t)>n?(s.push(i),i=r):i=o}return i&&s.push(i),s.length?s:[""]}var Ze=150,Bt=40,Th=24,Sl=250,$l="#7B4FC9",vl=17,Al=23,Xi=5,Hi=4,qh=/^(auth|model|setting|topics|connref|operation):/,Ph={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.",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.",pattern:e=>`Padr\xE3o? \xAB${e}\xBB`,platform:"plataforma",specialist:"especialistas",more:e=>`e mais ${e} no mapa`,none:"nada"}};function Mh(e,t,n="en"){let s=Ph[n],i=e.agents.filter(A=>A.role==="orchestrator").sort((A,L)=>A.id.localeCompare(L.id)),r=Object.keys(e.typeNames),o=A=>{let L=(e.types[A]??[])[0];return L===void 0?r.length:r.indexOf(L)},a=e.agents.filter(A=>A.role==="specialist").sort((A,L)=>o(A.id)-o(L.id)||A.id.localeCompare(L.id)),c=r.length>0&&a.some(A=>(e.types[A.id]??[]).length),l=c?390:340,d=Math.max(1,Math.ceil(a.length/Th)),f=Math.max(1,Math.ceil(a.length/d)),u=Math.max(1e3,Bt*2+Math.max(f,i.length)*Ze),p=(A,L)=>u/2+(A-(L-1)/2)*Ze,y=A=>Ga(A)?0:qh.test(A)?2:1,g=[{...we([Bt,52],e.name??s.chapters[0],30),chapter:s.chapters[0],say:`${e.name?`${e.name}: `:""}${s.cast(i.length,a.length)}`}],w=(A,L,F)=>es(A,15,Ze-12).slice(0,2).forEach((_,se)=>g.push(we([L[0],L[1]+se*18],_,15,"middle",F))),N=170,h=new Map;i.forEach((A,L)=>{let F=p(L,i.length);h.set(A.id,[F,N]),g.push({type:"prop",name:"robot",at:[F,N],size:70}),w(A.id,[F,N+24],_t)}),a.forEach((A,L)=>{let F=Math.floor(L/f),_=Math.min(f,a.length-F*f),se=[p(L%f,_),l+F*Sl];h.set(A.id,se),g.push({type:"prop",name:"robot",at:se,size:64}),w(A.id,[se[0],se[1]+24])});for(let A of i){let L=h.get(A.id);for(let F of a.filter(_=>_.schemaName&&`calls:${_.schemaName}`in A.facts)){let _=h.get(F.id);_[1]===l&&g.push(kl([L[0],L[1]+44],[_[0],_[1]-(c?118:76)],{color:_t}))}}if(c){let A=[];a.forEach(L=>{let F=(e.types[L.id]??[])[0],_=F===void 0?n==="pt"?"sem tipo":"no type":e.typeNames[F]??F,[se,G]=h.get(L.id),re=A[A.length-1];re&&re.name===_&&re.y===G?re.xs.push(se):A.push({name:_,xs:[se],y:G})});for(let L of A){let[F,_]=[Math.min(...L.xs),Math.max(...L.xs)];g.push(we([(F+_)/2,L.y-92],L.name,16,"middle",$l),wl([F-Ze/2+14,L.y-84],[_+Ze/2-14,L.y-84],{color:$l}))}}let k=l+(d-1)*Sl+160,x=(u-Bt*2)/3,S=k,O=(A,L,F,_,se)=>{let G=Bt+A*x;g.push({...we([G,k],L,22,"start",se),chapter:L,say:F});let re=k+34,Ut=_.slice(0,Xi);_.length>Xi&&Ut.push(s.more(_.length-Xi)),Ut.length||Ut.push(s.none);for(let jl of Ut){let Yt=es(jl,vl,x-30),Zi=Yt.length>Hi?[...Yt.slice(0,Hi-1),`${Yt[Hi-1]}\u2026`]:Yt;Zi.forEach((_l,is)=>g.push(we([G+(is?14:0),re+is*Al],`${is?"":"\xB7 "}${_l}`,vl,"start",_t))),re+=Zi.length*Al+6}S=Math.max(S,re)},q=e.patterns.filter(A=>!A.partOf).sort((A,L)=>y(A.key)-y(L.key)||(A.scope===L.scope?0:A.scope==="platform"?-1:1)||L.share-A.share||A.key.localeCompare(L.key)),E=A=>A==="platform"?s.platform:s.specialist;O(0,s.chapters[1],s.repeats(e.patterns.length,e.patterns.filter(A=>A.scope==="platform").length,e.patterns.filter(A=>A.scope!=="platform").length),q.map(A=>`${ae(A.key,n,e.names)} \xB7 ${E(A.scope)}${A.share<1?` \xB7 ${Math.round(A.share*100)}%`:""}`),bl);let I=[...new Set(e.offPattern.map(A=>A.agent))].sort();I.forEach((A,L)=>{let F=h.get(A),_=G=>G.variant?`${n==="pt"?"varia\xE7\xE3o de":"a variation of"} \xAB${ae(G.key,n,e.names)}\xBB`:Gn(G.key,n,1,e.names),se=e.offPattern.filter(G=>G.agent===A).sort((G,re)=>y(G.key)-y(re.key)).flatMap(G=>es(_(G),13,Ze-10)).slice(0,4);g.push({...we([F[0]+34,F[1]-50],"\xD7",30,"middle",Zn),...L===0?{chapter:s.chapters[2],say:s.off(I)}:{}}),se.forEach((G,re)=>g.push(we([F[0],F[1]+66+re*16],G,13,"middle",Zn)))}),I.length||g.push({...we([u-Bt,92],s.off([]),16,"end",_t),chapter:s.chapters[2],say:s.off([])});let b=e.gaps.flatMap(A=>{let L=A.agents.filter(F=>!e.offPattern.some(_=>_.agent===F&&_.key===A.rule.has)).length;return L?[n==="pt"?`\xAB${A.rule.says}\xBB: ${L}${A.rule.role?` ${ie(A.rule.role,n,L)}`:""} n\xE3o ${L===1?"cumpre":"cumprem"}`:`\xAB${A.rule.says}\xBB: ${L}${A.rule.role?` ${ie(A.rule.role,n,L)}`:""} ${L===1?"does":"do"} not meet it`]:[]}),m=e.unknown.length;m&&b.push(n==="pt"?`${m} ${m===1?"arquivo n\xE3o entendido":"arquivos n\xE3o entendidos"}`:`${m} ${m===1?"file":"files"} not understood`),O(1,s.chapters[3],s.missing(t.filter(A=>A.key==="gap").length),b,Zn);let{look:v}=Rt(e),P=[...t.filter(A=>A.key==="conflict"||A.key==="values"||A.key==="twice").map(A=>A[n]),...v.filter(A=>!A.decision).map(A=>s.pattern(ae(A.key,n,e.names))),...t.filter(A=>A.key==="solo").map(A=>A[n])];return O(2,s.chapters[4],s.decide(P.length),P),{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,S+40),background:"plain",locale:n==="pt"?"pt-BR":"en-US",steps:g}}var Ol=["and","or","not"];var Qi=["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"],ts={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"},ns=e=>Qi.includes(e)?e:typeof e=="string"&&Object.hasOwn(ts,e)?ts[e]:void 0;var El=e=>ns(e)!==void 0,$={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"},T=(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}),M=(...e)=>({kind:"polyline",points:e});function xl(e){return[{kind:"polygon",points:[[-.15,-.72],[.15,-.72],[.19,-.38],[-.19,-.38]],fill:$.shirt,main:!0},{kind:"circle",c:[0,-.87],r:.11,fill:$.skin},...e,M([-.08,-.38],[-.1,0]),M([.08,-.38],[.1,0])]}var Nl=xl([M([-.15,-.7],[-.25,-.42]),M([.15,-.7],[.25,-.42])]);function Lh(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 Ih(){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 e0={person:Nl,"person-pointing":xl([M([-.15,-.7],[-.25,-.42]),M([.15,-.69],[.47,-.73])]),"person-sitting":[M([-.3,-.8],[-.27,-.4]),M([-.32,-.4],[.2,-.4]),M([-.27,-.4],[-.27,0]),M([.16,-.4],[.16,0]),{kind:"polygon",points:[[-.22,-.77],[.04,-.77],[.06,-.44],[-.22,-.44]],fill:$.shirt,main:!0},{kind:"circle",c:[-.08,-.9],r:.1,fill:$.skin},M([-.1,-.44],[.3,-.44],[.32,0]),M([0,-.74],[.18,-.55],[.3,-.58])],house:[T(-.4,-.6,.8,.6,$.wall,!0),{kind:"polygon",points:[[-.5,-.58],[0,-1],[.5,-.58]],fill:$.roof},T(-.08,-.32,.16,.32,$.wood),T(.16,-.46,.16,.14,$.screen)],car:[{kind:"polygon",fill:$.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:$.screen},{kind:"circle",c:[-.28,-.12],r:.1,fill:$.dark},{kind:"circle",c:[.28,-.12],r:.1,fill:$.dark}],bus:[T(-.5,-.66,1,.52,$.bus,!0),...[-.42,-.21,0,.21].map(e=>T(e,-.6,.15,.16,$.screen)),M([-.5,-.3],[.5,-.3]),{kind:"circle",c:[-.3,-.12],r:.1,fill:$.dark},{kind:"circle",c:[.3,-.12],r:.1,fill:$.dark}],coin:[{kind:"circle",c:[0,-.42],r:.4,fill:$.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]]},M([0,-.64],[0,-.2])],phone:[T(-.26,-1,.52,1,$.device,!0),T(-.2,-.92,.4,.76,$.screen),{kind:"circle",c:[0,-.08],r:.035,fill:$.paper}],document:[{kind:"polygon",points:[[-.36,-1],[.16,-1],[.36,-.8],[.36,0],[-.36,0]],fill:$.paper,main:!0},M([.16,-1],[.16,-.8],[.36,-.8]),...[-.66,-.5,-.34,-.18].map(e=>M([-.22,e],[.22,e]))],server:[-1,-.66,-.32].flatMap(e=>[T(-.36,e,.72,.3,$.metal,!0),M([-.26,e+.15],[.06,e+.15]),{kind:"circle",c:[.22,e+.15],r:.035,fill:$.green}]),bank:[{kind:"polygon",points:[[-.5,-.74],[0,-1],[.5,-.74]],fill:$.wall,main:!0},T(-.45,-.74,.9,.08,$.wall),...[-.33,-.11,.11,.33].map(e=>T(e-.04,-.66,.08,.56,$.paper)),T(-.5,-.1,1,.1,$.wall)],cloud:[{kind:"polygon",points:Ih(),fill:$.paper,main:!0}],queue:[-.32,0,.32].flatMap(e=>Lh(Nl,.7,e)),desk:[T(-.5,-.5,1,.07,$.wood,!0),M([-.42,-.43],[-.42,0]),M([.42,-.43],[.42,0])],computer:[T(-.45,-1,.9,.6,$.device,!0),T(-.39,-.94,.78,.48,$.screen),{kind:"polygon",points:[[-.06,-.4],[.06,-.4],[.1,-.1],[-.1,-.1]],fill:$.device},T(-.25,-.1,.5,.08,$.device)],clock:[{kind:"circle",c:[0,-.48],r:.45,fill:$.paper,main:!0},...[[0,-.9,0,-.82],[.42,-.48,.34,-.48],[0,-.06,0,-.14],[-.42,-.48,-.34,-.48]].map(([e,t,n,s])=>M([e,t],[n,s])),M([0,-.48],[0,-.78]),M([0,-.48],[.2,-.48])],lock:[{kind:"curve",points:[[-.22,-.52],[-.22,-.76],[0,-.96],[.22,-.76],[.22,-.52]]},T(-.36,-.54,.72,.54,$.bus,!0),{kind:"circle",c:[0,-.32],r:.06,fill:$.dark},M([0,-.28],[0,-.14])],"money-arrow":[{kind:"polygon",fill:$.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:$.gold},M([-.2,-.4],[-.2,-.2])],tree:[T(-.07,-.36,.14,.36,$.wood),{kind:"circle",c:[0,-.64],r:.3,fill:$.green,main:!0}],school:[T(-.45,-.6,.9,.6,$.wall,!0),{kind:"polygon",points:[[-.5,-.6],[0,-.82],[.5,-.6]],fill:$.roof},T(-.08,-.28,.16,.28,$.wood),T(-.36,-.48,.16,.12,$.screen),T(.2,-.48,.16,.12,$.screen),M([0,-.82],[0,-1]),{kind:"polygon",points:[[0,-1],[.17,-.95],[0,-.9]],fill:$.roof}],hospital:[T(-.4,-.8,.8,.8,$.paper,!0),T(-.045,-.7,.09,.26,"#C8442C"),T(-.13,-.615,.26,.09,"#C8442C"),T(-.1,-.24,.2,.24,$.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:$.wall,main:!0},T(.3,-.95,.12,.3,$.dark),T(-.38,-.32,.16,.12,$.screen),T(-.08,-.32,.16,.12,$.screen),T(.22,-.32,.16,.12,$.screen)],truck:[T(-.5,-.62,.62,.46,$.metal,!0),{kind:"polygon",points:[[.12,-.16],[.12,-.5],[.34,-.5],[.48,-.32],[.48,-.16]],fill:$.bus},{kind:"polygon",points:[[.18,-.46],[.32,-.46],[.42,-.33],[.18,-.33]],fill:$.screen},{kind:"circle",c:[-.3,-.1],r:.1,fill:$.dark},{kind:"circle",c:[.3,-.1],r:.1,fill:$.dark}],cart:[M([-.48,-.78],[-.4,-.62]),{kind:"polygon",points:[[-.4,-.62],[.42,-.62],[.32,-.26],[-.3,-.26]],fill:$.metal,main:!0},M([-.3,-.26],[-.3,-.14],[.32,-.14]),{kind:"circle",c:[-.22,-.07],r:.06,fill:$.dark},{kind:"circle",c:[.24,-.07],r:.06,fill:$.dark}],safe:[T(-.4,-.82,.8,.82,$.device,!0),T(-.3,-.72,.6,.62,$.metal),{kind:"circle",c:[0,-.41],r:.13,fill:$.paper},M([0,-.41],[.08,-.47])],bulb:[{kind:"circle",c:[0,-.62],r:.3,fill:$.gold,main:!0},T(-.13,-.33,.26,.2,$.metal),{kind:"curve",points:[[-.09,-.52],[0,-.66],[.09,-.52]]},M([-.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:$.metal,main:!0},{kind:"circle",c:[0,-.5],r:.12,fill:$.paper}],database:[{kind:"polygon",points:[[-.35,-.8],[.35,-.8],[.35,-.16],[-.35,-.16]],fill:$.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:$.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:[M([0,-.95],[0,-1]),T(-.22,-.95,.44,.3,$.metal),{kind:"circle",c:[-.09,-.81],r:.045,fill:$.screen},{kind:"circle",c:[.09,-.81],r:.045,fill:$.screen},T(-.28,-.62,.56,.42,$.metal,!0),M([-.28,-.55],[-.42,-.35]),M([.28,-.55],[.42,-.35]),T(-.2,-.2,.12,.2,$.device),T(.08,-.2,.12,.2,$.device)],ship:[{kind:"polygon",points:[[-.48,-.3],[.48,-.3],[.36,-.04],[-.4,-.04]],fill:$.car,main:!0},T(-.42,-.62,.14,.32,$.wall),T(-.24,-.5,.2,.2,$.roof),T(-.02,-.5,.2,.2,$.bus),T(.2,-.5,.2,.2,$.green),{kind:"curve",points:[[-.5,0],[-.3,-.04],[-.1,0],[.1,-.04],[.3,0],[.5,-.04]]}],container:[T(-.46,-.52,.92,.52,$.roof,!0),...[-.3,-.15,0,.15,.3].map(e=>M([e,-.48],[e,-.04]))],warehouse:[{kind:"polygon",points:[[-.46,0],[.46,0],[.46,-.55],[0,-.82],[-.46,-.55]],fill:$.wall,main:!0},T(-.2,-.38,.4,.38,$.metal),M([-.2,-.26],[.2,-.26]),M([-.2,-.13],[.2,-.13])],box:[T(-.36,-.5,.52,.5,$.wood,!0),{kind:"polygon",points:[[-.36,-.5],[.16,-.5],[.36,-.64],[-.16,-.64]],fill:$.wood},{kind:"polygon",points:[[.16,0],[.36,-.14],[.36,-.64],[.16,-.5]],fill:$.wood},M([-.1,-.5],[.1,-.64])],pallet:[T(-.46,-.12,.92,.06,$.wood),...[-.42,-.05,.32].map(e=>T(e,-.06,.1,.06,$.wood)),T(-.42,-.5,.4,.38,$.wood,!0),T(.02,-.5,.4,.38,$.wood),T(-.2,-.82,.4,.32,$.wood)],shop:[T(-.42,-.6,.84,.6,$.wall,!0),{kind:"polygon",points:[[-.48,-.6],[.48,-.6],[.42,-.78],[-.42,-.78]],fill:$.roof},T(-.34,-.48,.34,.26,$.screen),T(.08,-.42,.24,.42,$.wood)],shelf:[T(-.4,-.92,.8,.92,$.paper,!0),M([-.4,-.62],[.4,-.62]),M([-.4,-.32],[.4,-.32]),T(-.32,-.8,.16,.18,$.roof),T(-.1,-.78,.14,.16,$.bus),T(.1,-.5,.22,.18,$.green),T(-.3,-.2,.24,.2,$.wood)],field:[M([-.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:$.green,main:!0},{kind:"circle",c:[e+.08,-.42],r:.07,fill:$.green,main:!0},{kind:"circle",c:[e,-.52],r:.06,fill:$.roof}])],cup:[{kind:"polygon",points:[[-.26,-.52],[.26,-.52],[.2,-.1],[-.2,-.1]],fill:$.paper,main:!0},{kind:"curve",points:[[.24,-.44],[.4,-.38],[.22,-.2]]},{kind:"polygon",points:[[-.46,-.1],[.46,-.1],[.36,0],[-.36,0]],fill:$.paper},{kind:"curve",points:[[-.08,-.62],[-.02,-.72],[-.08,-.84]]},{kind:"curve",points:[[.08,-.62],[.14,-.72],[.08,-.84]]}],function:[T(-.38,-.72,.76,.62,$.screen,!0),M([-.14,-.62],[0,-.62],[.14,-.2]),M([.02,-.42],[-.14,-.2])],"api-gateway":[T(-.12,-.8,.24,.8,$.metal,!0),M([-.48,-.55],[-.16,-.55]),M([-.24,-.62],[-.16,-.55],[-.24,-.48]),M([.16,-.3],[.48,-.3]),M([.4,-.37],[.48,-.3],[.4,-.23])],cache:[T(-.34,-.66,.68,.66,$.metal,!0),{kind:"polygon",points:[[.04,-.58],[-.12,-.3],[0,-.3],[-.06,-.08],[.14,-.38],[.02,-.38]],fill:$.gold}],cluster:[{kind:"curve",points:[[-.4,-.8],[0,-.86],[.4,-.8],[.48,-.45],[.4,-.1],[0,-.04],[-.4,-.1],[-.48,-.45],[-.4,-.8]]},T(-.3,-.7,.24,.2,$.screen,!0),T(.06,-.7,.24,.2,$.screen,!0),T(-.12,-.38,.24,.2,$.screen,!0)],board:[T(-.48,-.9,.96,.6,$.board,!0),T(-.34,-.76,.42,.03,$.chalk),T(-.34,-.62,.58,.03,$.chalk),T(-.34,-.48,.3,.03,$.chalk),M([-.3,-.3],[-.36,0]),M([.3,-.3],[.36,0])],book:[{kind:"polygon",points:[[0,-.62],[-.46,-.7],[-.46,-.1],[0,-.04]],fill:$.paper,main:!0},{kind:"polygon",points:[[0,-.62],[.46,-.7],[.46,-.1],[0,-.04]],fill:$.paper,main:!0},M([-.36,-.52],[-.1,-.48]),M([-.36,-.38],[-.1,-.34]),M([.1,-.48],[.36,-.52]),M([.1,-.34],[.36,-.38])],pencil:[{kind:"polygon",points:[[-.38,-.12],[.22,-.72],[.34,-.6],[-.26,0]],fill:$.bus,main:!0},{kind:"polygon",points:[[.22,-.72],[.34,-.6],[.44,-.86]],fill:$.wood},{kind:"polygon",points:[[-.38,-.12],[-.26,0],[-.46,-.02]],fill:$.roof}]},Cl=["happy","sad","surprised","worried","idea"],Rh={person:[0,-.87,.11],"person-pointing":[0,-.87,.11],"person-sitting":[-.08,-.9,.1]},Tl=e=>{let t=ns(e);return!!t&&t in Rh};var ql=["spin","drive","steam","talk","pulse","float"],Dh=["lesson","pitch","arch","decision","data","timeline","story"],Pl=8,Ml=6,Ll=2e5,Il=6e5,Rl=24;var Fl=["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"],et=["text","prop","card","counter","circle","ellipse"],Dl=["row","column","grid","chain"],Fh=50;function z(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t}: expected an object.`)}function K(e,t){if(typeof e!="string"||!e.trim()||e.length>2e3)throw new Error(`${t}: expected text of 1 to 2000 characters.`)}function R(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 Z(e,t){if(typeof e=="string"){if(K(e,t),e.length>300)throw new Error(`${t}: expression too long.`)}else R(e,t)}function Q(e,t){if(!Array.isArray(e)||e.length!==2)throw new Error(`${t}: expected [x, y].`);e.forEach((n,s)=>Z(n,`${t}[${s}]`))}function le(e,t){e!==void 0&&K(e,t)}function ee(e,t,n){if(e!==void 0&&(typeof e!="string"||!t.includes(e)))throw new Error(`${n}: choose one of ${t.join(", ")}.`)}function ss(e){if(!/^[A-Za-z_][A-Za-z_0-9]*$/.test(e)||["__proto__","constructor","prototype",...Ol].includes(e))throw new Error(`Invalid variable name: "${e}".`)}var tt=(e,t)=>t.includes("{")||e.exact.has(t)||[...e.repeated].some(n=>t.startsWith(`${n}-`)&&/^\d+$/.test(t.slice(n.length+1)));function Fe(e,t,n,s){s&&e[t]===void 0&&(e[t]=[0,0]),Q(e[t],`${n}.${t}`)}function Kt(e,t,n,s,i=!1){if(z(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(Dl.includes(s)&&e.place!==void 0)throw new Error(`${t}.place: the ${s} places the steps inside it.`)}if(!Fl.includes(e.type))throw new Error(`${t}: unknown type "${e.type}".`);for(let a of["id","say","chapter"])le(e[a],`${t}.${a}`);if(e.duration!==void 0&&R(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,c)=>R(a,`${t}.nudge[${c}]`,-900,900))}let r=s!==null&&Dl.includes(s)||i;if(e.place!==void 0){if(!et.includes(e.type))throw new Error(`${t}.place: only ${et.join(", ")} can be placed.`);if(z(e.place,`${t}.place`),K(e.place.to,`${t}.place.to`),!tt(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&&R(e.place.gap,`${t}.place.gap`,-200,400),ee(e.place.align,["center","start","end"],`${t}.place.align`)}let o=r||e.place!==void 0;if(e.style!==void 0){z(e.style,`${t}.style`);for(let a of["color","fill"]){let c=e.style[a];if(c!==void 0&&(typeof c!="string"||!/^(#[\da-f]{3,8}|[a-z]+)$/i.test(c)))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&&R(e.style[a],`${t}.style.${a}`,0,20);if(e.style.opacity!==void 0&&R(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.`);ee(e.style.fillStyle,["hachure","solid","zigzag","cross-hatch","dots"],`${t}.style.fillStyle`)}switch(e.type){case"line":case"arrow":case"highlight":Q(e.from,`${t}.from`),Q(e.to,`${t}.to`),e.thickness!==void 0&&R(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,c)=>Q(a,`${t}.points[${c}]`));break;case"circle":case"ellipse":Fe(e,"center",t,o);for(let a of e.type==="circle"?["r"]:["rx","ry"])Z(e[a],`${t}.${a}`),typeof e[a]=="number"&&R(e[a],`${t}.${a}`,0);break;case"text":Fe(e,"at",t,o),K(e.text,`${t}.text`),e.size!==void 0&&R(e.size,`${t}.size`,1,200),e.rotate!==void 0&&R(e.rotate,`${t}.rotate`,-360,360),ee(e.font,["hand","body"],`${t}.font`),ee(e.anchor,["start","middle","end"],`${t}.anchor`);break;case"card":Fe(e,"at",t,o),Z(e.w,`${t}.w`),Z(e.h,`${t}.h`);for(let a of["w","h"])typeof e[a]=="number"&&R(e[a],`${t}.${a}`,40);if(K(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,c)=>K(a,`${t}.lines[${c}]`))}break;case"plot":K(e.fn,`${t}.fn`),e.var!==void 0&&(K(e.var,`${t}.var`),ss(String(e.var))),Q(e.domain,`${t}.domain`),Q(e.range,`${t}.range`),z(e.box,`${t}.box`);for(let a of["x","y","w","h"])Z(e.box[a],`${t}.box.${a}`);if(e.samples!==void 0&&(R(e.samples,`${t}.samples`,2,1e3),!Number.isInteger(e.samples)))throw new Error(`${t}: samples must be an integer.`);break;case"pause":R(e.ms,`${t}.ms`,0,3e4),le(e.ask,`${t}.ask`);break;case"prop":if(!El(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 ${Qi.join(", ")}${a}.`)}if(Fe(e,"at",t,o),e.size!==void 0&&(Z(e.size,`${t}.size`),typeof e.size=="number"&&R(e.size,`${t}.size`,10,1e3)),le(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(!Tl(e.name))throw new Error(`${t}.mood: only a person (person, person-pointing, person-sitting) has a face.`);ee(e.mood,Cl,`${t}.mood`)}break;case"repeat":if(Z(e.times,`${t}.times`),typeof e.times=="number"&&(R(e.times,`${t}.times`,0,Fh),!Number.isInteger(e.times)))throw new Error(`${t}.times: expected a whole number.`);Kt(e.step,`${t}.step`,n,"repeat",r);break;case"when":if(Z(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,c)=>Kt(a,`${t}.steps[${c}]`,n,s??"when"));break;case"move":if(K(e.target,`${t}.target`),!tt(n,String(e.target)))throw new Error(`${t}.target: no earlier step has the id "${e.target}".`);Q(e.to,`${t}.to`),ee(e.along,["line","curve"],`${t}.along`),e.ms!==void 0&&R(e.ms,`${t}.ms`,200,5e3);break;case"lottie":if(K(e.src,`${t}.src`),Q(e.at,`${t}.at`),e.size!==void 0&&(Z(e.size,`${t}.size`),typeof e.size=="number"&&R(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(K(e.target,`${t}.target`),!tt(n,String(e.target)))throw new Error(`${t}.target: no earlier step has the id "${e.target}".`);if(ee(e.effect,[...ql,"stop"],`${t}.effect`),e.effect===void 0)throw new Error(`${t}.effect: choose one of ${[...ql,"stop"].join(", ")}.`);ee(e.speed,["slow","fast"],`${t}.speed`);break;case"link":for(let a of["from","to"])if(K(e[a],`${t}.${a}`),!tt(n,String(e[a])))throw new Error(`${t}.${a}: no earlier step has the id "${e[a]}".`);le(e.label,`${t}.label`);break;case"counter":if(Fe(e,"at",t,o),Z(e.value,`${t}.value`),e.format!==void 0&&(K(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&&R(e.size,`${t}.size`,1,200),ee(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(Fe(e,"at",t,!1),e.gap!==void 0&&R(e.gap,`${t}.gap`,0,400),e.type==="grid"){if(R(e.columns,`${t}.columns`,1,12),!Number.isInteger(e.columns))throw new Error(`${t}.columns: expected a whole number.`)}else ee(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,c)=>{z(a,`${t}.steps[${c}]`);let l=a.type==="repeat"?a.step?.type:a.type;if(!et.includes(l))throw new Error(`${t}.steps[${c}]: a ${e.type} holds only ${et.join(", ")} (or a repeat of one).`);Kt(a,`${t}.steps[${c}]`,n,e.type)});break;case"chain":if(r)throw new Error(`${t}: a chain cannot go inside a ${s}.`);if(Fe(e,"at",t,!1),e.gap!==void 0&&e.gap!=="auto"&&R(e.gap,`${t}.gap`,0,400),ee(e.direction,["right","down"],`${t}.direction`),e.wrap!==void 0&&typeof e.wrap!="boolean")throw new Error(`${t}.wrap: expected true or false.`);if(le(e.forward,`${t}.forward`),le(e.back,`${t}.back`),e.size!==void 0&&(Z(e.size,`${t}.size`),typeof e.size=="number"&&R(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,c)=>{if(z(a,`${t}.steps[${c}]`),!et.includes(a.type))throw new Error(`${t}.steps[${c}]: a chain holds only ${et.join(", ")}.`);Kt(a,`${t}.steps[${c}]`,n,"chain")});break;case"axis":case"timeline":if(Q(e.from,`${t}.from`),Q(e.to,`${t}.to`),Q(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,c)=>R(a,`${t}.ticks[${c}]`))}else if(R(e.ticks,`${t}.ticks`,0,30),!Number.isInteger(e.ticks))throw new Error(`${t}.ticks: expected a whole number.`)}if(le(e.label,`${t}.label`),e.format!==void 0&&(K(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,c)=>{z(a,`${t}.marks[${c}]`),Z(a.at,`${t}.marks[${c}].at`),le(a.label,`${t}.marks[${c}].label`),le(a.text,`${t}.marks[${c}].text`)})}break;case"balloon":if(K(e.to,`${t}.to`),!tt(n,String(e.to)))throw new Error(`${t}.to: no earlier step has the id "${e.to}".`);if(K(e.text,`${t}.text`),String(e.text).length>300)throw new Error(`${t}.text: keep a balloon under 300 characters.`);ee(e.side,["below","above","left","right"],`${t}.side`),ee(e.kind,["speech","thought"],`${t}.kind`),e.width!==void 0&&R(e.width,`${t}.width`,80,600),e.size!==void 0&&R(e.size,`${t}.size`,12,60);break;case"brace":if(Q(e.from,`${t}.from`),Q(e.to,`${t}.to`),le(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(Q(e.at,`${t}.at`),K(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(K(e.to,`${t}.to`),!tt(n,String(e.to)))throw new Error(`${t}.to: no earlier step has the id "${e.to}".`)}else Q(e.point,`${t}.point`);e.size!==void 0&&R(e.size,`${t}.size`,12,60);break;case"table":if(Q(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,c)=>{if(!Array.isArray(a)||a.length===0||a.length>6)throw new Error(`${t}.rows[${c}]: expected 1 to 6 cells.`);a.forEach((l,d)=>{if(typeof l!="string"||l.length>120)throw new Error(`${t}.rows[${c}][${d}]: 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&&R(e.size,`${t}.size`,12,40);break;case"bars":z(e.box,`${t}.box`);for(let a of["x","y","w","h"])Z(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,c)=>Z(a,`${t}.values[${c}]`)),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,c)=>K(a,`${t}.labels[${c}]`))}if(e.max!==void 0&&Z(e.max,`${t}.max`),e.format!==void 0&&(K(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 jh(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(ns(e)||Object.hasOwn(ts,e)||Fl.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(z(t,n),!Array.isArray(t.shapes)||t.shapes.length===0||t.shapes.length>Rl)throw new Error(`${n}.shapes: expected 1 to ${Rl} 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(z(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((c,l)=>s(c,`${o}.c[${l}]`)),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((c,l)=>{if(!Array.isArray(c)||c.length!==2)throw new Error(`${o}.points[${l}]: expected [x, y].`);c.forEach((d,f)=>s(d,`${o}.points[${l}][${f}]`))})})}function _h(e,t){let n=`lottie "${e}"`;z(t,n);let s=JSON.stringify(t).length;if(s>Ll)throw new Error(`${n}: ${Math.round(s/1e3)} KB; an animation can have at most ${Ll/1e3} KB.`);for(let r of["fr","ip","op","w","h"])R(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,c)=>i(a,`${o}[${c}]`));if(!(!r||typeof r!="object"))for(let[a,c]of Object.entries(r)){if(a==="x"&&typeof c=="string")throw new Error(`${n}: the animation has an expression (code inside it, at ${o}); only animations without expressions play.`);i(c,`${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 Bh(e){z(e,"The recipe");let t=e;R(t.width,"width",100,4e3),R(t.height,"height",100,4e3);for(let i of["id","title","category"])le(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(ee(t.background,["dots","grid","plain"],"background"),ee(t.kind,Dh,"kind"),le(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(ee(t.theme,["paper","chalkboard"],"theme"),t.quiz!==void 0){if(z(t.quiz,"quiz"),K(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(z(i,`quiz.options[${r}]`),K(i.text,`quiz.options[${r}].text`),K(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){z(t.learning,"learning");for(let i of["goal","question","answer","caveat"])K(t.learning[i],`learning.${i}`)}if(t.params!==void 0){z(t.params,"params");for(let[i,r]of Object.entries(t.params))if(ss(i),z(r,`params.${i}`),K(r.label,`params.${i}.label`),R(r.min,`${i}.min`),R(r.max,`${i}.max`),R(r.step,`${i}.step`,1e-6),R(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){z(t.vars,"vars");for(let[i,r]of Object.entries(t.vars))ss(i),Z(r,`vars.${i}`)}if(t.switches!==void 0){z(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(ss(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(z(o,`switches.${r}`),K(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){z(t.defs,"defs");let i=Object.entries(t.defs);if(i.length>Pl)throw new Error(`defs: at most ${Pl} figures.`);for(let[r,o]of i)jh(r,o),n.add(r)}if(t.lotties!==void 0){z(t.lotties,"lotties");let i=Object.entries(t.lotties);if(i.length>Ml)throw new Error(`lotties: at most ${Ml} animations.`);let r=i.reduce((o,[a,c])=>o+_h(a,c),0);if(r>Il)throw new Error(`lotties: ${Math.round(r/1e3)} KB in all; at most ${Il/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)=>K(i,`credits[${r}]`))}let s={exact:new Set,repeated:new Set,count:0,figures:n};return t.steps.forEach((i,r)=>Kt(i,`Step ${r+1}`,s,null)),{...t,id:t.id??"pasted",title:t.title??"",background:t.background??"dots"}}export{Ui as DEFAULT_PROFILE,sr as agentsIn,xh as applyChanges,uh as compare,qp as extractAgent,Eh as fromSheets,Rt as groupPatterns,Pp as knownKinds,ae as labelOf,Mh as lessonOf,Hp as problemText,Vp as readCast,jp as readProfile,ph as reviewCast,Bh as validateScene,kh as workbookFile,Nh as workbookOf,Xp as writeCast};
|