@ppdostudio/ppdo-cli 1.0.0-beta.0 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +96 -54
  2. package/LICENSE +114 -114
  3. package/README.md +381 -331
  4. package/THIRD-PARTY-NOTICES +1 -0
  5. package/dist/bin.js +2 -2
  6. package/dist/chunks/{ado-NLCWVIVQ.js → ado-OTSVKTOE.js} +6 -6
  7. package/dist/chunks/{api-YKKPVMTX.js → api-IRGGH5DJ.js} +1 -1
  8. package/dist/chunks/{api-T5SWGOFX.js → api-TZJXGWWQ.js} +1 -1
  9. package/dist/chunks/auth-7CDWOYJE.js +6 -0
  10. package/dist/chunks/azCli-UEDQHRLP.js +2 -0
  11. package/dist/chunks/batch-LKWCBKAB.js +2 -0
  12. package/dist/chunks/{build-XDCWMEEL.js → build-PBPXO3GJ.js} +3 -3
  13. package/dist/chunks/bulk-NY5XX752.js +2 -0
  14. package/dist/chunks/chunk-2IUXH534.js +2 -0
  15. package/dist/chunks/chunk-3L7657R3.js +5 -0
  16. package/dist/chunks/{chunk-5KZDCOFA.js → chunk-46KBBWEH.js} +1 -1
  17. package/dist/chunks/chunk-6NBCHK6X.js +2 -0
  18. package/dist/chunks/chunk-6VLFO5FJ.js +7 -0
  19. package/dist/chunks/chunk-B3TJ3RJN.js +2 -0
  20. package/dist/chunks/chunk-BG2OIOSN.js +2 -0
  21. package/dist/chunks/chunk-BWOEIEFY.js +6 -0
  22. package/dist/chunks/chunk-ELSYHAYC.js +2 -0
  23. package/dist/chunks/chunk-FOEBNCSD.js +3 -0
  24. package/dist/chunks/{chunk-XL7E7LX5.js → chunk-GLU4X7PT.js} +2 -2
  25. package/dist/chunks/chunk-GQLXEQVQ.js +4 -0
  26. package/dist/chunks/chunk-GY6BUIDP.js +2 -0
  27. package/dist/chunks/chunk-H4OY4EFC.js +3 -0
  28. package/dist/chunks/chunk-HJQJ77F2.js +3 -0
  29. package/dist/chunks/chunk-I7MHI5CU.js +151 -0
  30. package/dist/chunks/chunk-ITP35SAY.js +2 -0
  31. package/dist/chunks/{chunk-J777TCSE.js → chunk-J67P6QFC.js} +2 -2
  32. package/dist/chunks/{chunk-NNHEYYF5.js → chunk-KBZI5UDL.js} +1 -1
  33. package/dist/chunks/chunk-LB7WNZVK.js +5 -0
  34. package/dist/chunks/chunk-MBNUMAAZ.js +2 -0
  35. package/dist/chunks/chunk-MNGA7IHQ.js +4 -0
  36. package/dist/chunks/chunk-P4IFCLVF.js +2 -0
  37. package/dist/chunks/chunk-Q2RD4TRK.js +2 -0
  38. package/dist/chunks/chunk-S6NK6GX2.js +5 -0
  39. package/dist/chunks/chunk-SWXCK5C2.js +2 -0
  40. package/dist/chunks/chunk-T4IH34D7.js +2 -0
  41. package/dist/chunks/{chunk-HLE2WURE.js → chunk-TADCW6ZI.js} +1 -1
  42. package/dist/chunks/{chunk-UYDBLVAM.js → chunk-TCLZ4XM6.js} +1 -1
  43. package/dist/chunks/chunk-VC7ADQ6E.js +2 -0
  44. package/dist/chunks/{chunk-GT52BRS2.js → chunk-XUHLW6B2.js} +18 -18
  45. package/dist/chunks/{commands-GHYN6GZT.js → commands-EOUU353W.js} +1 -1
  46. package/dist/chunks/component-JCIJQELN.js +2 -0
  47. package/dist/chunks/config-WV3NZGTI.js +2 -0
  48. package/dist/chunks/connection-L6CUFUPJ.js +2 -0
  49. package/dist/chunks/connref-IT6K56UT.js +2 -0
  50. package/dist/chunks/convert-ILMJ2HHN.js +5 -0
  51. package/dist/chunks/customizations-AX7ZSXCK.js +2 -0
  52. package/dist/chunks/data-UWOV3LBO.js +5 -0
  53. package/dist/chunks/dependency-V4ZJIWQL.js +3 -0
  54. package/dist/chunks/{discovery-XXVLVHD6.js → discovery-PSGWFMJH.js} +1 -1
  55. package/dist/chunks/{dv-3OESFBNW.js → dv-SD5LTNZJ.js} +109 -48
  56. package/dist/chunks/{env-MZPI3UA2.js → env-6RZCHQUC.js} +2 -2
  57. package/dist/chunks/environment-IBLJHUAL.js +2 -0
  58. package/dist/chunks/{environments-WMBLSAQF.js → environments-3P2I4QUC.js} +1 -1
  59. package/dist/chunks/envvar-KJ2TUZGJ.js +2 -0
  60. package/dist/chunks/fanout-2WQYFUWL.js +2 -0
  61. package/dist/chunks/{fetchxml-ONTNTA6Z.js → fetchxml-M6EOF7N6.js} +1 -1
  62. package/dist/chunks/functions-NILMLS4R.js +2 -0
  63. package/dist/chunks/{graph-JI23YQB5.js → graph-NO2OT2TL.js} +1 -1
  64. package/dist/chunks/{group-DKEPSVRV.js → group-ISSJ4H2A.js} +2 -2
  65. package/dist/chunks/history-JPMLQDJI.js +2 -0
  66. package/dist/chunks/identity-SBQNHSBF.js +2 -0
  67. package/dist/chunks/init-X2VEK4T2.js +2 -0
  68. package/dist/chunks/jobs-XC7EYPBP.js +2 -0
  69. package/dist/chunks/lifecycle-2F7MF6EP.js +2 -0
  70. package/dist/chunks/{main-ZVIKC3VA.js → main-J3O5YMIY.js} +2 -2
  71. package/dist/chunks/metadata-NZFQIAAG.js +2 -0
  72. package/dist/chunks/metadataCreate-XSHK32TR.js +2 -0
  73. package/dist/chunks/msalUser-KC75VDVV.js +2 -0
  74. package/dist/chunks/names-N5JRXO33.js +2 -0
  75. package/dist/chunks/{pack-2UDE25IY.js → pack-3OYGV36R.js} +1 -1
  76. package/dist/chunks/pat-PCMOZYM5.js +2 -0
  77. package/dist/chunks/{pipelines-O3OYNCHT.js → pipelines-OCHSIQ2E.js} +1 -1
  78. package/dist/chunks/pluginRegister-LEVZNDZN.js +4 -0
  79. package/dist/chunks/{plugins-EUDJ7QIS.js → plugins-TEME2R77.js} +1 -1
  80. package/dist/chunks/{policies-KVPQVUHS.js → policies-EWCANNBE.js} +1 -1
  81. package/dist/chunks/{pools-7H2L4QJC.js → pools-54KMEL5D.js} +1 -1
  82. package/dist/chunks/process-KR7LIXZB.js +2 -0
  83. package/dist/chunks/{projects-BHG2B4IX.js → projects-LPVDFLPC.js} +1 -1
  84. package/dist/chunks/protect-X2J7LU7X.js +2 -0
  85. package/dist/chunks/provider-D7DMMAS6.js +2 -0
  86. package/dist/chunks/{prs-NOXIZ7AT.js → prs-C4EKGJWA.js} +1 -1
  87. package/dist/chunks/records-C4RLQXFK.js +2 -0
  88. package/dist/chunks/{run-BXFENCN6.js → run-27MYTWHY.js} +1 -1
  89. package/dist/chunks/run-46PEJS3S.js +2 -0
  90. package/dist/chunks/run-7L6W2YWJ.js +3 -0
  91. package/dist/chunks/run-CD3ZOB5V.js +4 -0
  92. package/dist/chunks/run-EUNN6OZO.js +2 -0
  93. package/dist/chunks/{run-JYU5BTWN.js → run-JDNEQMJC.js} +1 -1
  94. package/dist/chunks/{run-MGLIIM7Z.js → run-T3IIJ7SK.js} +1 -1
  95. package/dist/chunks/run-ZHIDOKQH.js +2 -0
  96. package/dist/chunks/{runtime-VOF7XYXW.js → runtime-FJJPTBEE.js} +1 -1
  97. package/dist/chunks/security-SBIAK6QD.js +2 -0
  98. package/dist/chunks/{service-V2TQEEID.js → service-4N3YP4Z7.js} +1 -1
  99. package/dist/chunks/{service-4PIAYFYF.js → service-HASXLUGE.js} +1 -1
  100. package/dist/chunks/services-C6G4XRXR.js +2 -0
  101. package/dist/chunks/{skills-GD6Z6P3R.js → skills-FW4F3EIW.js} +1 -1
  102. package/dist/chunks/solution-CNBNIS7Z.js +2 -0
  103. package/dist/chunks/solutionExport-Y524HMGN.js +2 -0
  104. package/dist/chunks/{solutionfiles-P223QW2J.js → solutionfiles-2TP3Y2RW.js} +1 -1
  105. package/dist/chunks/spn-YSYMDTOI.js +2 -0
  106. package/dist/chunks/tokenCache-TQFT6LAD.js +2 -0
  107. package/dist/chunks/{unpack-XZLTBUGC.js → unpack-HUH7OJMP.js} +1 -1
  108. package/dist/chunks/{users-KFAPPGF4.js → users-Q7BJKBPP.js} +1 -1
  109. package/dist/chunks/{vargroups-33EZAHGZ.js → vargroups-GNZBODVJ.js} +1 -1
  110. package/dist/chunks/{whoami-ULK5UMZV.js → whoami-6G6UFTNS.js} +1 -1
  111. package/dist/chunks/{workitems-YGES6KKN.js → workitems-2IOGD3EL.js} +1 -1
  112. package/package.json +61 -57
  113. package/schema/ppdo-cli.schema.json +16 -4
  114. package/schema/reference-data.schema.json +192 -0
  115. package/skills/ppdo-cli/SKILL.md +2 -1
  116. package/skills/ppdo-cli-data/SKILL.md +669 -0
  117. package/skills/ppdo-cli-dataverse/SKILL.md +6 -0
  118. package/skills/ppdo-cli-plugins/PluginRegistration.cs +229 -0
  119. package/skills/ppdo-cli-plugins/SKILL.md +95 -0
  120. package/skills/ppdo-cli-plugins/reference.md +72 -0
  121. package/dist/chunks/auth-IP7AOWSF.js +0 -6
  122. package/dist/chunks/azCli-T67ZMIC3.js +0 -2
  123. package/dist/chunks/batch-GCXLGQET.js +0 -4
  124. package/dist/chunks/bulk-5QO343HO.js +0 -2
  125. package/dist/chunks/chunk-3C3GSN3J.js +0 -2
  126. package/dist/chunks/chunk-4S5ETLH4.js +0 -2
  127. package/dist/chunks/chunk-5SBBTR3Y.js +0 -2
  128. package/dist/chunks/chunk-5UOZCXQF.js +0 -5
  129. package/dist/chunks/chunk-BWZ6HZXM.js +0 -2
  130. package/dist/chunks/chunk-JGLUQBCK.js +0 -2
  131. package/dist/chunks/chunk-MME53RWW.js +0 -4
  132. package/dist/chunks/chunk-OP6EXLWQ.js +0 -5
  133. package/dist/chunks/chunk-PDFXH652.js +0 -2
  134. package/dist/chunks/chunk-QE4DELWW.js +0 -2
  135. package/dist/chunks/chunk-RHQP7X6H.js +0 -3
  136. package/dist/chunks/chunk-UKKSN4F7.js +0 -3
  137. package/dist/chunks/chunk-UWFDJKOJ.js +0 -2
  138. package/dist/chunks/chunk-WXCLWAE2.js +0 -2
  139. package/dist/chunks/chunk-X7VWUI6N.js +0 -2
  140. package/dist/chunks/component-PAASRIK6.js +0 -2
  141. package/dist/chunks/config-JN3I5EII.js +0 -2
  142. package/dist/chunks/connection-IWFELK5W.js +0 -2
  143. package/dist/chunks/connref-ZDY7JYK5.js +0 -2
  144. package/dist/chunks/customizations-IE2KO275.js +0 -7
  145. package/dist/chunks/dependency-EFDSIKSN.js +0 -3
  146. package/dist/chunks/environment-NUQHU74A.js +0 -2
  147. package/dist/chunks/envvar-YN35IDWJ.js +0 -2
  148. package/dist/chunks/fanout-DUP5CD5X.js +0 -2
  149. package/dist/chunks/functions-K5TYRB2C.js +0 -2
  150. package/dist/chunks/history-SNSJRV6B.js +0 -2
  151. package/dist/chunks/identity-OW4WCDOA.js +0 -2
  152. package/dist/chunks/jobs-PXNJFWWF.js +0 -2
  153. package/dist/chunks/lifecycle-7RMWV26J.js +0 -2
  154. package/dist/chunks/metadata-74WGGOV5.js +0 -2
  155. package/dist/chunks/metadataCreate-W3NDI5FB.js +0 -2
  156. package/dist/chunks/msalUser-JRNX5HPO.js +0 -2
  157. package/dist/chunks/names-SFYZQY6Q.js +0 -2
  158. package/dist/chunks/process-G7LCTGKS.js +0 -2
  159. package/dist/chunks/protect-WZO3MAHF.js +0 -2
  160. package/dist/chunks/provider-VXRAQRN2.js +0 -2
  161. package/dist/chunks/records-TN7ZKUJ7.js +0 -2
  162. package/dist/chunks/run-F6H4QCWR.js +0 -2
  163. package/dist/chunks/run-HBQCSGYY.js +0 -3
  164. package/dist/chunks/run-MHM3GTGH.js +0 -2
  165. package/dist/chunks/run-SRQPP6N3.js +0 -3
  166. package/dist/chunks/run-ZNDSC7LR.js +0 -2
  167. package/dist/chunks/security-FLEAZ4EA.js +0 -2
  168. package/dist/chunks/services-B6V4VVX5.js +0 -2
  169. package/dist/chunks/solution-HF57MP27.js +0 -2
  170. package/dist/chunks/solutionExport-TLGHMUM5.js +0 -2
  171. package/dist/chunks/spn-AIUWML5R.js +0 -2
  172. package/dist/chunks/tokenCache-3LMJRUTI.js +0 -2
@@ -0,0 +1,151 @@
1
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
+ import{a as di,b as pi,c as yn}from"./chunk-6VLFO5FJ.js";import{e as hi}from"./chunk-FOEBNCSD.js";import{d as fi}from"./chunk-KBZI5UDL.js";import{b as ui}from"./chunk-2IUXH534.js";import{a as li,b as ci}from"./chunk-WXOTXJNG.js";import{a as at,b,d as Va}from"./chunk-ZHHVG47C.js";var L=b(P=>{"use strict";var kn=Symbol.for("yaml.alias"),mi=Symbol.for("yaml.document"),ct=Symbol.for("yaml.map"),gi=Symbol.for("yaml.pair"),vn=Symbol.for("yaml.scalar"),ut=Symbol.for("yaml.seq"),H=Symbol.for("yaml.node.type"),Xa=n=>!!n&&typeof n=="object"&&n[H]===kn,za=n=>!!n&&typeof n=="object"&&n[H]===mi,Qa=n=>!!n&&typeof n=="object"&&n[H]===ct,Za=n=>!!n&&typeof n=="object"&&n[H]===gi,yi=n=>!!n&&typeof n=="object"&&n[H]===vn,el=n=>!!n&&typeof n=="object"&&n[H]===ut;function bi(n){if(n&&typeof n=="object")switch(n[H]){case ct:case ut:return!0}return!1}function tl(n){if(n&&typeof n=="object")switch(n[H]){case kn:case ct:case vn:case ut:return!0}return!1}var nl=n=>(yi(n)||bi(n))&&!!n.anchor;P.ALIAS=kn;P.DOC=mi;P.MAP=ct;P.NODE_TYPE=H;P.PAIR=gi;P.SCALAR=vn;P.SEQ=ut;P.hasAnchor=nl;P.isAlias=Xa;P.isCollection=bi;P.isDocument=za;P.isMap=Qa;P.isNode=tl;P.isPair=Za;P.isScalar=yi;P.isSeq=el});var Oe=b(Nn=>{"use strict";var q=L(),_=Symbol("break visit"),wi=Symbol("skip children"),V=Symbol("remove node");function ft(n,e){let t=Si(e);q.isDocument(n)?ye(null,n.contents,t,Object.freeze([n]))===V&&(n.contents=null):ye(null,n,t,Object.freeze([]))}ft.BREAK=_;ft.SKIP=wi;ft.REMOVE=V;function ye(n,e,t,s){let i=ki(n,e,t,s);if(q.isNode(i)||q.isPair(i))return vi(n,s,i),ye(n,i,t,s);if(typeof i!="symbol"){if(q.isCollection(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=ye(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===_)return _;o===V&&(e.items.splice(r,1),r-=1)}}}else if(q.isPair(e)){s=Object.freeze(s.concat(e));let r=ye("key",e.key,t,s);if(r===_)return _;r===V&&(e.key=null);let o=ye("value",e.value,t,s);if(o===_)return _;o===V&&(e.value=null)}}return i}async function ht(n,e){let t=Si(e);q.isDocument(n)?await be(null,n.contents,t,Object.freeze([n]))===V&&(n.contents=null):await be(null,n,t,Object.freeze([]))}ht.BREAK=_;ht.SKIP=wi;ht.REMOVE=V;async function be(n,e,t,s){let i=await ki(n,e,t,s);if(q.isNode(i)||q.isPair(i))return vi(n,s,i),be(n,i,t,s);if(typeof i!="symbol"){if(q.isCollection(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=await be(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===_)return _;o===V&&(e.items.splice(r,1),r-=1)}}}else if(q.isPair(e)){s=Object.freeze(s.concat(e));let r=await be("key",e.key,t,s);if(r===_)return _;r===V&&(e.key=null);let o=await be("value",e.value,t,s);if(o===_)return _;o===V&&(e.value=null)}}return i}function Si(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function ki(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(q.isMap(e))return t.Map?.(n,e,s);if(q.isSeq(e))return t.Seq?.(n,e,s);if(q.isPair(e))return t.Pair?.(n,e,s);if(q.isScalar(e))return t.Scalar?.(n,e,s);if(q.isAlias(e))return t.Alias?.(n,e,s)}function vi(n,e,t){let s=e[e.length-1];if(q.isCollection(s))s.items[n]=t;else if(q.isPair(s))n==="key"?s.key=t:s.value=t;else if(q.isDocument(s))s.contents=t;else{let i=q.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Nn.visit=ft;Nn.visitAsync=ht});var An=b(Ai=>{"use strict";var Ni=L(),sl=Oe(),il={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},rl=n=>n.replace(/[!,[\]{}]/g,e=>il[e]),Ce=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+rl(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),i;if(e&&s.length>0&&Ni.isNode(e.contents)){let r={};sl.visit(e.contents,(o,a)=>{Ni.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
3
+ `)}};Ce.defaultYaml={explicit:!1,version:"1.2"};Ce.defaultTags={"!!":"tag:yaml.org,2002:"};Ai.Directives=Ce});var dt=b(qe=>{"use strict";var $i=L(),ol=Oe();function al(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Ei(n){let e=new Set;return ol.visit(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function Li(n,e){for(let t=1;;++t){let s=`${n}${t}`;if(!e.has(s))return s}}function ll(n,e){let t=[],s=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Ei(n));let o=Li(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=s.get(r);if(typeof o=="object"&&o.anchor&&($i.isScalar(o.node)||$i.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}}qe.anchorIsValid=al;qe.anchorNames=Ei;qe.createNodeAnchors=ll;qe.findNewAnchor=Li});var $n=b(Ti=>{"use strict";function Pe(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){let o=s[i],a=Pe(n,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(let i of Array.from(s.keys())){let r=s.get(i),o=Pe(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(let i of Array.from(s)){let r=Pe(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(let[i,r]of Object.entries(s)){let o=Pe(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}Ti.applyReviver=Pe});var z=b(Ci=>{"use strict";var cl=L();function Oi(n,e,t){if(Array.isArray(n))return n.map((s,i)=>Oi(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!cl.hasAnchor(n))return n.toJSON(e,t);let s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};let i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}Ci.toJS=Oi});var pt=b(Pi=>{"use strict";var ul=$n(),qi=L(),fl=z(),En=class{constructor(e){Object.defineProperty(this,qi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!qi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=fl.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?ul.applyReviver(r,{"":a},"",a):a}};Pi.NodeBase=En});var Me=b(Mi=>{"use strict";var hl=dt(),dl=Oe(),we=L(),pl=pt(),ml=z(),Ln=class extends pl.NodeBase{constructor(e){super(we.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],dl.visit(e,{Node:(r,o)=>{(we.isAlias(o)||we.hasAnchor(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let i;for(let r of s){if(r===this)break;r.anchor===this.source&&(i=r)}if(i&&t){let{anchors:r,doc:o,maxAliasCount:a}=t,l=r.get(i);if(l||(ml.toJS(i,null,t),l=r.get(i)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=mt(o,i,r)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return i}toJSON(e,t){if(!t)return{source:this.source};let s=this.resolve(t.doc,t);if(!s){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(s).res}toString(e,t,s){let i=`*${this.source}`;if(e){if(hl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function mt(n,e,t){if(we.isAlias(e)){let s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(we.isCollection(e)){let s=0;for(let i of e.items){let r=mt(n,i,t);r>s&&(s=r)}return s}else if(we.isPair(e)){let s=mt(n,e.key,t),i=mt(n,e.value,t);return Math.max(s,i)}return 1}Mi.Alias=Ln});var C=b(Tn=>{"use strict";var gl=L(),yl=pt(),bl=z(),wl=n=>!n||typeof n!="function"&&typeof n!="object",Q=class extends yl.NodeBase{constructor(e){super(gl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:bl.toJS(this.value,e,t)}toString(){return String(this.value)}};Q.BLOCK_FOLDED="BLOCK_FOLDED";Q.BLOCK_LITERAL="BLOCK_LITERAL";Q.PLAIN="PLAIN";Q.QUOTE_DOUBLE="QUOTE_DOUBLE";Q.QUOTE_SINGLE="QUOTE_SINGLE";Tn.Scalar=Q;Tn.isScalarValue=wl});var Ie=b(Di=>{"use strict";var Sl=Me(),ae=L(),Ii=C(),kl="tag:yaml.org,2002:";function vl(n,e,t){if(e){let s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}function Nl(n,e,t){if(ae.isDocument(n)&&(n=n.contents),ae.isNode(n))return n;if(ae.isPair(n)){let f=t.schema[ae.MAP].createNode?.(t.schema,null,t);return f.items.push(n),f}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(s&&n&&typeof n=="object"){if(l=a.get(n),l)return l.anchor??(l.anchor=i(n)),new Sl.Alias(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=kl+e.slice(2));let c=vl(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let f=new Ii.Scalar(n);return l&&(l.node=f),f}c=n instanceof Map?o[ae.MAP]:Symbol.iterator in Object(n)?o[ae.SEQ]:o[ae.MAP]}r&&(r(c),delete t.onTagObj);let u=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new Ii.Scalar(n);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}Di.createNode=Nl});var yt=b(gt=>{"use strict";var Al=Ie(),J=L(),$l=pt();function On(n,e,t){let s=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return Al.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var _i=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,Cn=class extends $l.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>J.isNode(s)||J.isPair(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(_i(e))this.add(t);else{let[s,...i]=e,r=this.get(s,!0);if(J.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,On(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){let[t,...s]=e;if(s.length===0)return this.delete(t);let i=this.get(t,!0);if(J.isCollection(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&J.isScalar(r)?r.value:r:J.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!J.isPair(t))return!1;let s=t.value;return s==null||e&&J.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(s.length===0)return this.has(t);let i=this.get(t,!0);return J.isCollection(i)?i.hasIn(s):!1}setIn(e,t){let[s,...i]=e;if(i.length===0)this.set(s,t);else{let r=this.get(s,!0);if(J.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,On(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};gt.Collection=Cn;gt.collectionFromPath=On;gt.isEmptyPath=_i});var De=b(bt=>{"use strict";var El=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function qn(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var Ll=(n,e,t)=>n.endsWith(`
4
+ `)?qn(t,e):t.includes(`
5
+ `)?`
6
+ `+qn(t,e):(n.endsWith(" ")?"":" ")+t;bt.indentComment=qn;bt.lineComment=Ll;bt.stringifyComment=El});var Bi=b(_e=>{"use strict";var Tl="flow",Pn="block",wt="quoted";function Ol(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return n;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(n.length<=l)return n;let c=[],u={},f=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):f=i-s);let h,m,w=!1,d=-1,p=-1,S=-1;t===Pn&&(d=Ri(n,d,e.length),d!==-1&&(f=d+l));for(let $;$=n[d+=1];){if(t===wt&&$==="\\"){switch(p=d,n[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}S=d}if($===`
7
+ `)t===Pn&&(d=Ri(n,d,e.length)),f=d+e.length+l,h=void 0;else{if($===" "&&m&&m!==" "&&m!==`
8
+ `&&m!==" "){let g=n[d+1];g&&g!==" "&&g!==`
9
+ `&&g!==" "&&(h=d)}if(d>=f)if(h)c.push(h),f=h+l,h=void 0;else if(t===wt){for(;m===" "||m===" ";)m=$,$=n[d+=1],w=!0;let g=d>S+1?d-2:p-1;if(u[g])return n;c.push(g),u[g]=!0,f=g+l,h=void 0}else w=!0}m=$}if(w&&a&&a(),c.length===0)return n;o&&o();let k=n.slice(0,c[0]);for(let $=0;$<c.length;++$){let g=c[$],v=c[$+1]||n.length;g===0?k=`
10
+ ${e}${n.slice(0,v)}`:(t===wt&&u[g]&&(k+=`${n[g]}\\`),k+=`
11
+ ${e}${n.slice(g+1,v)}`)}return k}function Ri(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
12
+ `);s=e,i=e+1,r=n[i]}return s}_e.FOLD_BLOCK=Pn;_e.FOLD_FLOW=Tl;_e.FOLD_QUOTED=wt;_e.foldFlowLines=Ol});var Be=b(Fi=>{"use strict";var x=C(),Z=Bi(),kt=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),vt=n=>/^(%|---|\.\.\.)/m.test(n);function Cl(n,e,t){if(!e||e<0)return!1;let s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
13
+ `){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function Re(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(vt(n)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let u=t.substr(l+2,4);switch(u){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:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
14
+
15
+ `;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
16
+ `,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,s?o:Z.foldFlowLines(o,r,Z.FOLD_QUOTED,kt(e,!1))}function Mn(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
17
+ `)||/[ \t]\n|\n[ \t]/.test(n))return Re(n,e);let t=e.indent||(vt(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
18
+ ${t}`)+"'";return e.implicitKey?s:Z.foldFlowLines(s,t,Z.FOLD_FLOW,kt(e,!1))}function Se(n,e){let{singleQuote:t}=e.options,s;if(t===!1)s=Re;else{let i=n.includes('"'),r=n.includes("'");i&&!r?s=Mn:r&&!i?s=Re:s=t?Mn:Re}return s(n,e)}var In;try{In=new RegExp(`(^|(?<!
19
+ ))
20
+ +(?!
21
+ |$)`,"g")}catch{In=/\n+(?!\n|$)/g}function St({comment:n,type:e,value:t},s,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(t))return Se(t,s);let c=s.indent||(s.forceBlockIndent||vt(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===x.Scalar.BLOCK_FOLDED?!1:e===x.Scalar.BLOCK_LITERAL?!0:!Cl(t,l,c.length);if(!t)return u?`|
22
+ `:`>
23
+ `;let f,h;for(h=t.length;h>0;--h){let v=t[h-1];if(v!==`
24
+ `&&v!==" "&&v!==" ")break}let m=t.substring(h),w=m.indexOf(`
25
+ `);w===-1?f="-":t===m||w!==m.length-1?(f="+",r&&r()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
26
+ `&&(m=m.slice(0,-1)),m=m.replace(In,`$&${c}`));let d=!1,p,S=-1;for(p=0;p<t.length;++p){let v=t[p];if(v===" ")d=!0;else if(v===`
27
+ `)S=p;else break}let k=t.substring(0,S<p?S+1:p);k&&(t=t.substring(k.length),k=k.replace(/\n+/g,`$&${c}`));let g=(d?c?"2":"1":"")+f;if(n&&(g+=" "+a(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let v=t.replace(/\n+/g,`
28
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,N=kt(s,!0);o!=="folded"&&e!==x.Scalar.BLOCK_FOLDED&&(N.onOverflow=()=>{A=!0});let y=Z.foldFlowLines(`${k}${v}${m}`,c,Z.FOLD_BLOCK,N);if(!A)return`>${g}
29
+ ${c}${y}`}return t=t.replace(/\n+/g,`$&${c}`),`|${g}
30
+ ${c}${k}${t}${m}`}function ql(n,e,t,s){let{type:i,value:r}=n,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&r.includes(`
31
+ `)||u&&/[[\]{},]/.test(r))return Se(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||u||!r.includes(`
32
+ `)?Se(r,e):St(n,e,t,s);if(!a&&!u&&i!==x.Scalar.PLAIN&&r.includes(`
33
+ `))return St(n,e,t,s);if(vt(r)){if(l==="")return e.forceBlockIndent=!0,St(n,e,t,s);if(a&&l===c)return Se(r,e)}let f=r.replace(/\n+/g,`$&
34
+ ${l}`);if(o){let h=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(f),{compat:m,tags:w}=e.doc.schema;if(w.some(h)||m?.some(h))return Se(r,e)}return a?f:Z.foldFlowLines(f,l,Z.FOLD_FLOW,kt(e,!1))}function Pl(n,e,t,s){let{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==x.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=x.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case x.Scalar.BLOCK_FOLDED:case x.Scalar.BLOCK_LITERAL:return i||r?Se(o.value,e):St(o,e,t,s);case x.Scalar.QUOTE_DOUBLE:return Re(o.value,e);case x.Scalar.QUOTE_SINGLE:return Mn(o.value,e);case x.Scalar.PLAIN:return ql(o,e,t,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,h=i&&u||f;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}Fi.stringifyString=Pl});var Fe=b(Dn=>{"use strict";var Ml=dt(),ee=L(),Il=De(),Dl=Be();function _l(n,e){let t=Object.assign({blockQuote:!0,commentString:Il.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e),s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function Rl(n,e){if(e.tag){let i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(ee.isScalar(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){let i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}function Bl(n,e,{anchors:t,doc:s}){if(!s.directives)return"";let i=[],r=(ee.isScalar(n)||ee.isCollection(n))&&n.anchor;r&&Ml.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function Fl(n,e,t,s){if(ee.isPair(n))return n.toString(e,t,s);if(ee.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i,r=ee.isNode(n)?n:e.doc.createNode(n,{onTagObj:l=>i=l});i??(i=Rl(e.doc.schema.tags,r));let o=Bl(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,s):ee.isScalar(r)?Dl.stringifyString(r,e,t,s):r.toString(e,t,s);return o?ee.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
35
+ ${e.indent}${a}`:a}Dn.createStringifyContext=_l;Dn.stringify=Fl});var Ui=b(Ki=>{"use strict";var X=L(),xi=C(),ji=Fe(),xe=De();function xl({key:n,value:e},t,s,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=t,h=X.isNode(n)&&n.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(X.isCollection(n)||!X.isNode(n)&&typeof n=="object"){let N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let m=!f&&(!n||h&&e==null&&!t.inFlow||X.isCollection(n)||(X.isScalar(n)?n.type===xi.Scalar.BLOCK_FOLDED||n.type===xi.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:a+l});let w=!1,d=!1,p=ji.stringify(n,t,()=>w=!0,()=>d=!0);if(!m&&!t.inFlow&&p.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(r||e==null)return w&&s&&s(),p===""?"?":m?`? ${p}`:p}else if(r&&!f||e==null&&m)return p=`? ${p}`,h&&!w?p+=xe.lineComment(p,t.indent,c(h)):d&&i&&i(),p;w&&(h=null),m?(h&&(p+=xe.lineComment(p,t.indent,c(h))),p=`? ${p}
36
+ ${a}:`):(p=`${p}:`,h&&(p+=xe.lineComment(p,t.indent,c(h))));let S,k,$;X.isNode(e)?(S=!!e.spaceBefore,k=e.commentBefore,$=e.comment):(S=!1,k=null,$=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!h&&X.isScalar(e)&&(t.indentAtStart=p.length+1),d=!1,!u&&l.length>=2&&!t.inFlow&&!m&&X.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let g=!1,v=ji.stringify(e,t,()=>g=!0,()=>d=!0),A=" ";if(h||S||k){if(A=S?`
37
+ `:"",k){let N=c(k);A+=`
38
+ ${xe.indentComment(N,t.indent)}`}v===""&&!t.inFlow?A===`
39
+ `&&$&&(A=`
40
+
41
+ `):A+=`
42
+ ${t.indent}`}else if(!m&&X.isCollection(e)){let N=v[0],y=v.indexOf(`
43
+ `),E=y!==-1,I=t.inFlow??e.flow??e.items.length===0;if(E||!I){let D=!1;if(E&&(N==="&"||N==="!")){let O=v.indexOf(" ");N==="&"&&O!==-1&&O<y&&v[O+1]==="!"&&(O=v.indexOf(" ",O+1)),(O===-1||y<O)&&(D=!0)}D||(A=`
44
+ ${t.indent}`)}}else(v===""||v[0]===`
45
+ `)&&(A="");return p+=A+v,t.inFlow?g&&s&&s():$&&!g?p+=xe.lineComment(p,t.indent,c($)):d&&i&&i(),p}Ki.stringifyPair=xl});var Rn=b(_n=>{"use strict";var Yi=at("process");function jl(n,...e){n==="debug"&&console.log(...e)}function Kl(n,e){(n==="debug"||n==="warn")&&(typeof Yi.emitWarning=="function"?Yi.emitWarning(e):console.warn(e))}_n.debug=jl;_n.warn=Kl});var Lt=b(Et=>{"use strict";var $t=L(),Vi=C(),Nt="<<",At={identify:n=>n===Nt||typeof n=="symbol"&&n.description===Nt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Vi.Scalar(Symbol(Nt)),{addToJSMap:Ji}),stringify:()=>Nt},Ul=(n,e)=>(At.identify(e)||$t.isScalar(e)&&(!e.type||e.type===Vi.Scalar.PLAIN)&&At.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===At.tag&&t.default);function Ji(n,e,t){let s=Gi(n,t);if($t.isSeq(s))for(let i of s.items)Bn(n,e,i);else if(Array.isArray(s))for(let i of s)Bn(n,e,i);else Bn(n,e,s)}function Bn(n,e,t){let s=Gi(n,t);if(!$t.isMap(s))throw new Error("Merge sources must be maps or map aliases");let i=s.toJSON(null,n,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Gi(n,e){return n&&$t.isAlias(e)?e.resolve(n.doc,n):e}Et.addMergeToJSMap=Ji;Et.isMergeKey=Ul;Et.merge=At});var xn=b(Xi=>{"use strict";var Yl=Rn(),Wi=Lt(),Vl=Fe(),Hi=L(),Fn=z();function Jl(n,e,{key:t,value:s}){if(Hi.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(Wi.isMergeKey(n,t))Wi.addMergeToJSMap(n,e,s);else{let i=Fn.toJS(t,"",n);if(e instanceof Map)e.set(i,Fn.toJS(s,i,n));else if(e instanceof Set)e.add(i);else{let r=Gl(t,i,n),o=Fn.toJS(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Gl(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Hi.isNode(n)&&t?.doc){let s=Vl.createStringifyContext(t.doc,{});s.anchors=new Set;for(let r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;let i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Yl.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}Xi.addPairToJSMap=Jl});var te=b(jn=>{"use strict";var zi=Ie(),Wl=Ui(),Hl=xn(),Tt=L();function Xl(n,e,t){let s=zi.createNode(n,void 0,t),i=zi.createNode(e,void 0,t);return new Ot(s,i)}var Ot=class n{constructor(e,t=null){Object.defineProperty(this,Tt.NODE_TYPE,{value:Tt.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return Tt.isNode(t)&&(t=t.clone(e)),Tt.isNode(s)&&(s=s.clone(e)),new n(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return Hl.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?Wl.stringifyPair(this,e,t,s):JSON.stringify(this)}};jn.Pair=Ot;jn.createPair=Xl});var Kn=b(Zi=>{"use strict";var le=L(),Qi=Fe(),Ct=De();function zl(n,e,t){return(e.inFlow??n.flow?Zl:Ql)(n,e,t)}function Ql({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,u=Object.assign({},t,{indent:r,type:null}),f=!1,h=[];for(let w=0;w<e.length;++w){let d=e[w],p=null;if(le.isNode(d))!f&&d.spaceBefore&&h.push(""),qt(t,h,d.commentBefore,f),d.comment&&(p=d.comment);else if(le.isPair(d)){let k=le.isNode(d.key)?d.key:null;k&&(!f&&k.spaceBefore&&h.push(""),qt(t,h,k.commentBefore,f))}f=!1;let S=Qi.stringify(d,u,()=>p=null,()=>f=!0);p&&(S+=Ct.lineComment(S,r,c(p))),f&&p&&(f=!1),h.push(s+S)}let m;if(h.length===0)m=i.start+i.end;else{m=h[0];for(let w=1;w<h.length;++w){let d=h[w];m+=d?`
46
+ ${l}${d}`:`
47
+ `}}return n?(m+=`
48
+ `+Ct.indentComment(c(n),l),a&&a()):f&&o&&o(),m}function Zl({items:n},e,{flowChars:t,itemIndent:s}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;s+=r;let l=Object.assign({},e,{indent:s,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let w=0;w<n.length;++w){let d=n[w],p=null;if(le.isNode(d))d.spaceBefore&&f.push(""),qt(e,f,d.commentBefore,!1),d.comment&&(p=d.comment);else if(le.isPair(d)){let k=le.isNode(d.key)?d.key:null;k&&(k.spaceBefore&&f.push(""),qt(e,f,k.commentBefore,!1),k.comment&&(c=!0));let $=le.isNode(d.value)?d.value:null;$?($.comment&&(p=$.comment),$.commentBefore&&(c=!0)):d.value==null&&k?.comment&&(p=k.comment)}p&&(c=!0);let S=Qi.stringify(d,l,()=>p=null);c||(c=f.length>u||S.includes(`
49
+ `)),w<n.length-1?S+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((k,$)=>k+$.length+2,2)+(S.length+2)>e.options.lineWidth)),c&&(S+=",")),p&&(S+=Ct.lineComment(S,s,a(p))),f.push(S),u=f.length}let{start:h,end:m}=t;if(f.length===0)return h+m;if(!c){let w=f.reduce((d,p)=>d+p.length+2,2);c=e.options.lineWidth>0&&w>e.options.lineWidth}if(c){let w=h;for(let d of f)w+=d?`
50
+ ${r}${i}${d}`:`
51
+ `;return`${w}
52
+ ${i}${m}`}else return`${h}${o}${f.join(" ")}${o}${m}`}function qt({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let r=Ct.indentComment(e(s),n);t.push(r.trimStart())}}Zi.stringifyCollection=zl});var se=b(Yn=>{"use strict";var ec=Kn(),tc=xn(),nc=yt(),ne=L(),Pt=te(),sc=C();function je(n,e){let t=ne.isScalar(e)?e.value:e;for(let s of n)if(ne.isPair(s)&&(s.key===e||s.key===t||ne.isScalar(s.key)&&s.key.value===t))return s}var Un=class extends nc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ne.MAP,e),this.items=[]}static from(e,t,s){let{keepUndefined:i,replacer:r}=s,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(Pt.createPair(l,c,s))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;ne.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new Pt.Pair(e,e?.value):s=new Pt.Pair(e.key,e.value);let i=je(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);ne.isScalar(i.value)&&sc.isScalarValue(s.value)?i.value.value=s.value:i.value=s.value}else if(r){let o=this.items.findIndex(a=>r(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let t=je(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=je(this.items,e)?.value;return(!t&&ne.isScalar(i)?i.value:i)??void 0}has(e){return!!je(this.items,e)}set(e,t){this.add(new Pt.Pair(e,t),!0)}toJSON(e,t,s){let i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)tc.addPairToJSMap(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ne.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ec.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}};Yn.YAMLMap=Un;Yn.findPair=je});var ke=b(tr=>{"use strict";var ic=L(),er=se(),rc={collection:"map",default:!0,nodeClass:er.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return ic.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>er.YAMLMap.from(n,e,t)};tr.map=rc});var ie=b(nr=>{"use strict";var oc=Ie(),ac=Kn(),lc=yt(),It=L(),cc=C(),uc=z(),Vn=class extends lc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(It.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Mt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let s=Mt(e);if(typeof s!="number")return;let i=this.items[s];return!t&&It.isScalar(i)?i.value:i}has(e){let t=Mt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let s=Mt(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[s];It.isScalar(i)&&cc.isScalarValue(t)?i.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let i=0;for(let r of this.items)s.push(uc.toJS(r,String(i++),t));return s}toString(e,t,s){return e?ac.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(oc.createNode(a,void 0,s))}}return r}};function Mt(n){let e=It.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}nr.YAMLSeq=Vn});var ve=b(ir=>{"use strict";var fc=L(),sr=ie(),hc={collection:"seq",default:!0,nodeClass:sr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return fc.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>sr.YAMLSeq.from(n,e,t)};ir.seq=hc});var Ke=b(rr=>{"use strict";var dc=Be(),pc={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),dc.stringifyString(n,e,t,s)}};rr.string=pc});var Dt=b(lr=>{"use strict";var or=C(),ar={identify:n=>n==null,createNode:()=>new or.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new or.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&ar.test.test(n)?n:e.options.nullStr};lr.nullTag=ar});var Jn=b(ur=>{"use strict";var mc=C(),cr={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new mc.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&cr.test.test(n)){let s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};ur.boolTag=cr});var Ne=b(fr=>{"use strict";function gc({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);let i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}fr.stringifyNumber=gc});var Wn=b(_t=>{"use strict";var yc=C(),Gn=Ne(),bc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Gn.stringifyNumber},wc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Gn.stringifyNumber(n)}},Sc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new yc.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Gn.stringifyNumber};_t.float=Sc;_t.floatExp=wc;_t.floatNaN=bc});var Xn=b(Bt=>{"use strict";var hr=Ne(),Rt=n=>typeof n=="bigint"||Number.isInteger(n),Hn=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function dr(n,e,t){let{value:s}=n;return Rt(s)&&s>=0?t+s.toString(e):hr.stringifyNumber(n)}var kc={identify:n=>Rt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Hn(n,2,8,t),stringify:n=>dr(n,8,"0o")},vc={identify:Rt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Hn(n,0,10,t),stringify:hr.stringifyNumber},Nc={identify:n=>Rt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Hn(n,2,16,t),stringify:n=>dr(n,16,"0x")};Bt.int=vc;Bt.intHex=Nc;Bt.intOct=kc});var mr=b(pr=>{"use strict";var Ac=ke(),$c=Dt(),Ec=ve(),Lc=Ke(),Tc=Jn(),zn=Wn(),Qn=Xn(),Oc=[Ac.map,Ec.seq,Lc.string,$c.nullTag,Tc.boolTag,Qn.intOct,Qn.int,Qn.intHex,zn.floatNaN,zn.floatExp,zn.float];pr.schema=Oc});var br=b(yr=>{"use strict";var Cc=C(),qc=ke(),Pc=ve();function gr(n){return typeof n=="bigint"||Number.isInteger(n)}var Ft=({value:n})=>JSON.stringify(n),Mc=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Ft},{identify:n=>n==null,createNode:()=>new Cc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ft},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Ft},{identify:gr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>gr(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Ft}],Ic={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},Dc=[qc.map,Pc.seq].concat(Mc,Ic);yr.schema=Dc});var es=b(wr=>{"use strict";var Ue=at("buffer"),Zn=C(),_c=Be(),Rc={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Ue.Buffer=="function")return Ue.Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";let o=t,a;if(typeof Ue.Buffer=="function")a=o instanceof Ue.Buffer?o.toString("base64"):Ue.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Zn.Scalar.BLOCK_LITERAL),e!==Zn.Scalar.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=l)u[f]=a.substr(h,l);a=u.join(e===Zn.Scalar.BLOCK_LITERAL?`
53
+ `:" ")}return _c.stringifyString({comment:n,type:e,value:a},s,i,r)}};wr.binary=Rc});var Kt=b(jt=>{"use strict";var xt=L(),ts=te(),Bc=C(),Fc=ie();function Sr(n,e){if(xt.isSeq(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!xt.isPair(s)){if(xt.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let i=s.items[0]||new ts.Pair(new Bc.Scalar(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
54
+ ${i.key.commentBefore}`:s.commentBefore),s.comment){let r=i.value??i.key;r.comment=r.comment?`${s.comment}
55
+ ${r.comment}`:s.comment}s=i}n.items[t]=xt.isPair(s)?s:new ts.Pair(s)}}else e("Expected a sequence for this tag");return n}function kr(n,e,t){let{replacer:s}=t,i=new Fc.YAMLSeq(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(ts.createPair(a,l,t))}return i}var xc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Sr,createNode:kr};jt.createPairs=kr;jt.pairs=xc;jt.resolvePairs=Sr});var is=b(ss=>{"use strict";var vr=L(),ns=z(),Ye=se(),jc=ie(),Nr=Kt(),ce=class n extends jc.YAMLSeq{constructor(){super(),this.add=Ye.YAMLMap.prototype.add.bind(this),this.delete=Ye.YAMLMap.prototype.delete.bind(this),this.get=Ye.YAMLMap.prototype.get.bind(this),this.has=Ye.YAMLMap.prototype.has.bind(this),this.set=Ye.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;t?.onCreate&&t.onCreate(s);for(let i of this.items){let r,o;if(vr.isPair(i)?(r=ns.toJS(i.key,"",t),o=ns.toJS(i.value,r,t)):r=ns.toJS(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){let i=Nr.createPairs(e,t,s),r=new this;return r.items=i.items,r}};ce.tag="tag:yaml.org,2002:omap";var Kc={collection:"seq",identify:n=>n instanceof Map,nodeClass:ce,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=Nr.resolvePairs(n,e),s=[];for(let{key:i}of t.items)vr.isScalar(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new ce,t)},createNode:(n,e,t)=>ce.from(n,e,t)};ss.YAMLOMap=ce;ss.omap=Kc});var Tr=b(rs=>{"use strict";var Ar=C();function $r({value:n,source:e},t){return e&&(n?Er:Lr).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var Er={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ar.Scalar(!0),stringify:$r},Lr={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ar.Scalar(!1),stringify:$r};rs.falseTag=Lr;rs.trueTag=Er});var Or=b(Ut=>{"use strict";var Uc=C(),os=Ne(),Yc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:os.stringifyNumber},Vc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():os.stringifyNumber(n)}},Jc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new Uc.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:os.stringifyNumber};Ut.float=Jc;Ut.floatExp=Vc;Ut.floatNaN=Yc});var qr=b(Je=>{"use strict";var Cr=Ne(),Ve=n=>typeof n=="bigint"||Number.isInteger(n);function Yt(n,e,t,{intAsBigInt:s}){let i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return i==="-"?BigInt(-1)*o:o}let r=parseInt(n,t);return i==="-"?-1*r:r}function as(n,e,t){let{value:s}=n;if(Ve(s)){let i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return Cr.stringifyNumber(n)}var Gc={identify:Ve,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Yt(n,2,2,t),stringify:n=>as(n,2,"0b")},Wc={identify:Ve,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Yt(n,1,8,t),stringify:n=>as(n,8,"0")},Hc={identify:Ve,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Yt(n,0,10,t),stringify:Cr.stringifyNumber},Xc={identify:Ve,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Yt(n,2,16,t),stringify:n=>as(n,16,"0x")};Je.int=Hc;Je.intBin=Gc;Je.intHex=Xc;Je.intOct=Wc});var cs=b(ls=>{"use strict";var Gt=L(),Vt=te(),Jt=se(),ue=class n extends Jt.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;Gt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Vt.Pair(e.key,null):t=new Vt.Pair(e,null),Jt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let s=Jt.findPair(this.items,e);return!t&&Gt.isPair(s)?Gt.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=Jt.findPair(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new Vt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Vt.createPair(o,null,s));return r}};ue.tag="tag:yaml.org,2002:set";var zc={collection:"map",identify:n=>n instanceof Set,nodeClass:ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>ue.from(n,e,t),resolve(n,e){if(Gt.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new ue,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};ls.YAMLSet=ue;ls.set=zc});var fs=b(Wt=>{"use strict";var Qc=Ne();function us(n,e){let t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function Pr(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Qc.stringifyNumber(n);let s="";e<0&&(s="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Zc={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>us(n,t),stringify:Pr},eu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>us(n,!1),stringify:Pr},Mr={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(Mr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,s,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,s-1,i,r||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=us(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Wt.floatTime=eu;Wt.intTime=Zc;Wt.timestamp=Mr});var _r=b(Dr=>{"use strict";var tu=ke(),nu=Dt(),su=ve(),iu=Ke(),ru=es(),Ir=Tr(),hs=Or(),Ht=qr(),ou=Lt(),au=is(),lu=Kt(),cu=cs(),ds=fs(),uu=[tu.map,su.seq,iu.string,nu.nullTag,Ir.trueTag,Ir.falseTag,Ht.intBin,Ht.intOct,Ht.int,Ht.intHex,hs.floatNaN,hs.floatExp,hs.float,ru.binary,ou.merge,au.omap,lu.pairs,cu.set,ds.intTime,ds.floatTime,ds.timestamp];Dr.schema=uu});var Jr=b(gs=>{"use strict";var xr=ke(),fu=Dt(),jr=ve(),hu=Ke(),du=Jn(),ps=Wn(),ms=Xn(),pu=mr(),mu=br(),Kr=es(),Ge=Lt(),Ur=is(),Yr=Kt(),Rr=_r(),Vr=cs(),Xt=fs(),Br=new Map([["core",pu.schema],["failsafe",[xr.map,jr.seq,hu.string]],["json",mu.schema],["yaml11",Rr.schema],["yaml-1.1",Rr.schema]]),Fr={binary:Kr.binary,bool:du.boolTag,float:ps.float,floatExp:ps.floatExp,floatNaN:ps.floatNaN,floatTime:Xt.floatTime,int:ms.int,intHex:ms.intHex,intOct:ms.intOct,intTime:Xt.intTime,map:xr.map,merge:Ge.merge,null:fu.nullTag,omap:Ur.omap,pairs:Yr.pairs,seq:jr.seq,set:Vr.set,timestamp:Xt.timestamp},gu={"tag:yaml.org,2002:binary":Kr.binary,"tag:yaml.org,2002:merge":Ge.merge,"tag:yaml.org,2002:omap":Ur.omap,"tag:yaml.org,2002:pairs":Yr.pairs,"tag:yaml.org,2002:set":Vr.set,"tag:yaml.org,2002:timestamp":Xt.timestamp};function yu(n,e,t){let s=Br.get(e);if(s&&!n)return t&&!s.includes(Ge.merge)?s.concat(Ge.merge):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{let r=Array.from(Br.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(let r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(Ge.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Fr[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Fr).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}gs.coreKnownTags=gu;gs.getTags=yu});var ws=b(Gr=>{"use strict";var ys=L(),bu=ke(),wu=ve(),Su=Ke(),zt=Jr(),ku=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,bs=class n{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?zt.getTags(e,"compat"):e?zt.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?zt.coreKnownTags:{},this.tags=zt.getTags(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,ys.MAP,{value:bu.map}),Object.defineProperty(this,ys.SCALAR,{value:Su.string}),Object.defineProperty(this,ys.SEQ,{value:wu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?ku:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Gr.Schema=bs});var Hr=b(Wr=>{"use strict";var vu=L(),Ss=Fe(),We=De();function Nu(n,e){let t=[],s=e.directives===!0;if(e.directives!==!1&&n.directives){let l=n.directives.toString(n);l?(t.push(l),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");let i=Ss.createStringifyContext(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");let l=r(n.commentBefore);t.unshift(We.indentComment(l,""))}let o=!1,a=null;if(n.contents){if(vu.isNode(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){let u=r(n.contents.commentBefore);t.push(We.indentComment(u,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}let l=a?void 0:()=>o=!0,c=Ss.stringify(n.contents,i,()=>a=null,l);a&&(c+=We.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(Ss.stringify(n.contents,i));if(n.directives?.docEnd)if(n.comment){let l=r(n.comment);l.includes(`
56
+ `)?(t.push("..."),t.push(We.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(We.indentComment(r(l),"")))}return t.join(`
57
+ `)+`
58
+ `}Wr.stringifyDocument=Nu});var He=b(Xr=>{"use strict";var Au=Me(),Ae=yt(),F=L(),$u=te(),Eu=z(),Lu=ws(),Tu=Hr(),ks=dt(),Ou=$n(),Cu=Ie(),vs=An(),Ns=class n{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,F.NODE_TYPE,{value:F.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new vs.Directives({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){let e=Object.create(n.prototype,{[F.NODE_TYPE]:{value:F.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=F.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){$e(this.contents)&&this.contents.add(e)}addIn(e,t){$e(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=ks.anchorNames(this);e.anchor=!t||s.has(t)?ks.findNewAnchor(t||"a",s):t}return new Au.Alias(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let p=k=>typeof k=="number"||k instanceof String||k instanceof Number,S=t.filter(p).map(String);S.length>0&&(t=t.concat(S)),i=t}else s===void 0&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=s??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=ks.createNodeAnchors(this,o||"a"),w={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},d=Cu.createNode(e,u,w);return a&&F.isCollection(d)&&(d.flow=!0),h(),d}createPair(e,t,s={}){let i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new $u.Pair(i,r)}delete(e){return $e(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ae.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):$e(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return F.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ae.isEmptyPath(e)?!t&&F.isScalar(this.contents)?this.contents.value:this.contents:F.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return F.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ae.isEmptyPath(e)?this.contents!==void 0:F.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ae.collectionFromPath(this.schema,[e],t):$e(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ae.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ae.collectionFromPath(this.schema,Array.from(e),t):$e(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new vs.Directives({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new vs.Directives({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Lu.Schema(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Eu.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:u}of a.anchors.values())r(u,c);return typeof o=="function"?Ou.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Tu.stringifyDocument(this,e)}};function $e(n){if(F.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}Xr.Document=Ns});var Qe=b(ze=>{"use strict";var Xe=class extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}},As=class extends Xe{constructor(e,t,s){super("YAMLParseError",e,t,s)}},$s=class extends Xe{constructor(e,t,s){super("YAMLWarning",e,t,s)}},qu=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(o.substring(0,r))){let a=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
59
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===s&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
60
+
61
+ ${o}
62
+ ${c}
63
+ `}};ze.YAMLError=Xe;ze.YAMLParseError=As;ze.YAMLWarning=$s;ze.prettifyError=qu});var Ze=b(zr=>{"use strict";function Pu(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",h="",m=!1,w=!1,d=null,p=null,S=null,k=null,$=null,g=null,v=null;for(let y of n)switch(w&&(y.type!=="space"&&y.type!=="newline"&&y.type!=="comma"&&r(y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),d&&(c&&y.type!=="comment"&&y.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),y.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&y.source.includes(" ")&&(d=y),u=!0;break;case"comment":{u||r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=y.source.substring(1)||" ";f?f+=h+E:f=E,h="",c=!1;break}case"newline":c?f?f+=y.source:(!g||t!=="seq-item-ind")&&(l=!0):h+=y.source,c=!0,m=!0,(p||S)&&(k=y),u=!0;break;case"anchor":p&&r(y,"MULTIPLE_ANCHORS","A node can have at most one anchor"),y.source.endsWith(":")&&r(y.offset+y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=y,v??(v=y.offset),c=!1,u=!1,w=!0;break;case"tag":{S&&r(y,"MULTIPLE_TAGS","A node can have at most one tag"),S=y,v??(v=y.offset),c=!1,u=!1,w=!0;break}case t:(p||S)&&r(y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${y.source} indicator`),g&&r(y,"UNEXPECTED_TOKEN",`Unexpected ${y.source} in ${e??"collection"}`),g=y,c=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){$&&r(y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),$=y,c=!1,u=!1;break}default:r(y,"UNEXPECTED_TOKEN",`Unexpected ${y.type} token`),c=!1,u=!1}let A=n[n.length-1],N=A?A.offset+A.source.length:i;return w&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:$,found:g,spaceBefore:l,comment:f,hasNewline:m,anchor:p,tag:S,newlineAfterProp:k,end:N,start:v??N}}zr.resolveProps=Pu});var Qt=b(Qr=>{"use strict";function Es(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
64
+ `))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Es(e.key)||Es(e.value))return!0}return!1;default:return!0}}Qr.containsNewline=Es});var Ls=b(Zr=>{"use strict";var Mu=Qt();function Iu(n,e,t){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&Mu.containsNewline(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Zr.flowIndentCheck=Iu});var Ts=b(to=>{"use strict";var eo=L();function Du(n,e,t){let{uniqueKeys:s}=n.options;if(s===!1)return!1;let i=typeof s=="function"?s:(r,o)=>r===o||eo.isScalar(r)&&eo.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}to.mapIncludes=Du});var ao=b(oo=>{"use strict";var no=te(),_u=se(),so=Ze(),Ru=Qt(),io=Ls(),Bu=Ts(),ro="All mapping items must start at the same column";function Fu({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??_u.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=s.offset,c=null;for(let u of s.items){let{start:f,key:h,sep:m,value:w}=u,d=so.resolveProps(f,{indicator:"explicit-key-ind",next:h??m?.[0],offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0}),p=!d.found;if(p){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==s.indent&&i(l,"BAD_INDENT",ro)),!d.anchor&&!d.tag&&!m){c=d.end,d.comment&&(a.comment?a.comment+=`
65
+ `+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||Ru.containsNewline(h))&&i(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==s.indent&&i(l,"BAD_INDENT",ro);t.atKey=!0;let S=d.end,k=h?n(t,h,d,i):e(t,S,f,null,d,i);t.schema.compat&&io.flowIndentCheck(s.indent,h,i),t.atKey=!1,Bu.mapIncludes(t,a.items,k)&&i(S,"DUPLICATE_KEY","Map keys must be unique");let $=so.resolveProps(m??[],{indicator:"map-value-ind",next:w,offset:k.range[2],onError:i,parentIndent:s.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=$.end,$.found){p&&(w?.type==="block-map"&&!$.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<$.found.offset-1024&&i(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let g=w?n(t,w,$,i):e(t,l,m,null,$,i);t.schema.compat&&io.flowIndentCheck(s.indent,w,i),l=g.range[2];let v=new no.Pair(k,g);t.options.keepSourceTokens&&(v.srcToken=u),a.items.push(v)}else{p&&i(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),$.comment&&(k.comment?k.comment+=`
66
+ `+$.comment:k.comment=$.comment);let g=new no.Pair(k);t.options.keepSourceTokens&&(g.srcToken=u),a.items.push(g)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}oo.resolveBlockMap=Fu});var co=b(lo=>{"use strict";var xu=ie(),ju=Ze(),Ku=Ls();function Uu({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??xu.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=s.offset,c=null;for(let{start:u,value:f}of s.items){let h=ju.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?i(h.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(a.comment=h.comment);continue}let m=f?n(t,f,h,i):e(t,h.end,u,null,h,i);t.schema.compat&&Ku.flowIndentCheck(s.indent,f,i),l=m.range[2],a.items.push(m)}return a.range=[s.offset,l,c??l],a}lo.resolveBlockSeq=Uu});var Ee=b(uo=>{"use strict";function Yu(n,e,t,s){let i="";if(n){let r=!1,o="";for(let a of n){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";i?i+=o+u:i=u,o="";break}case"newline":i&&(o+=l),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}uo.resolveEnd=Yu});var mo=b(po=>{"use strict";var Vu=L(),Ju=te(),fo=se(),Gu=ie(),Wu=Ee(),ho=Ze(),Hu=Qt(),Xu=Ts(),Os="Block collections are not allowed within flow collections",Cs=n=>n&&(n.type==="block-map"||n.type==="block-seq");function zu({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?fo.YAMLMap:Gu.YAMLSeq),c=new l(t.schema);c.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=s.offset+s.start.source.length;for(let p=0;p<s.items.length;++p){let S=s.items[p],{start:k,key:$,sep:g,value:v}=S,A=ho.resolveProps(k,{flow:a,indicator:"explicit-key-ind",next:$??g?.[0],offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!g&&!v){p===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<s.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
67
+ `+A.comment:c.comment=A.comment),f=A.end;continue}!o&&t.options.strict&&Hu.containsNewline($)&&i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let N="";e:for(let y of k)switch(y.type){case"comma":case"space":break;case"comment":N=y.source.substring(1);break e;default:break e}if(N){let y=c.items[c.items.length-1];Vu.isPair(y)&&(y=y.value??y.key),y.comment?y.comment+=`
68
+ `+N:y.comment=N,A.comment=A.comment.substring(N.length+1)}}if(!o&&!g&&!A.found){let N=v?n(t,v,A,i):e(t,A.end,g,null,A,i);c.items.push(N),f=N.range[2],Cs(v)&&i(N.range,"BLOCK_IN_FLOW",Os)}else{t.atKey=!0;let N=A.end,y=$?n(t,$,A,i):e(t,N,k,null,A,i);Cs($)&&i(y.range,"BLOCK_IN_FLOW",Os),t.atKey=!1;let E=ho.resolveProps(g??[],{flow:a,indicator:"map-value-ind",next:v,offset:y.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(E.found){if(!o&&!A.found&&t.options.strict){if(g)for(let O of g){if(O===E.found)break;if(O.type==="newline"){i(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<E.found.offset-1024&&i(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else v&&("source"in v&&v.source?.[0]===":"?i(v,"MISSING_CHAR",`Missing space after : in ${a}`):i(E.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let I=v?n(t,v,E,i):E.found?e(t,E.end,g,null,E,i):null;I?Cs(v)&&i(I.range,"BLOCK_IN_FLOW",Os):E.comment&&(y.comment?y.comment+=`
69
+ `+E.comment:y.comment=E.comment);let D=new Ju.Pair(y,I);if(t.options.keepSourceTokens&&(D.srcToken=S),o){let O=c;Xu.mapIncludes(t,O.items,y)&&i(N,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(D)}else{let O=new fo.YAMLMap(t.schema);O.flow=!0,O.items.push(D);let ot=(I??y).range;O.range=[y.range[0],ot[1],ot[2]],c.items.push(O)}f=I?I.range[2]:E.end}}let h=o?"}":"]",[m,...w]=s.end,d=f;if(m?.source===h)d=m.offset+m.source.length;else{let p=a[0].toUpperCase()+a.substring(1),S=u?`${p} must end with a ${h}`:`${p} in block collection must be sufficiently indented and end with a ${h}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",S),m&&m.source.length!==1&&w.unshift(m)}if(w.length>0){let p=Wu.resolveEnd(w,d,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
70
+ `+p.comment:c.comment=p.comment),c.range=[s.offset,d,p.offset]}else c.range=[s.offset,d,d];return c}po.resolveFlowCollection=zu});var yo=b(go=>{"use strict";var Qu=L(),Zu=C(),ef=se(),tf=ie(),nf=ao(),sf=co(),rf=mo();function qs(n,e,t,s,i,r){let o=t.type==="block-map"?nf.resolveBlockMap(n,e,t,s,r):t.type==="block-seq"?sf.resolveBlockSeq(n,e,t,s,r):rf.resolveFlowCollection(n,e,t,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function of(n,e,t,s,i){let r=s.tag,o=r?e.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){let{anchor:h,newlineAfterProp:m}=s,w=h&&r?h.offset>r.offset?h:r:h??r;w&&(!m||m.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===ef.YAMLMap.tagName&&a==="map"||o===tf.YAMLSeq.tagName&&a==="seq")return qs(n,e,t,i,o);let l=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){let h=e.schema.knownTags[o];if(h?.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),qs(n,e,t,i,o)}let c=qs(n,e,t,i,o,l),u=l.resolve?.(c,h=>i(r,"TAG_RESOLVE_FAILED",h),e.options)??c,f=Qu.isNode(u)?u:new Zu.Scalar(u);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}go.composeCollection=of});var Ms=b(bo=>{"use strict";var Ps=C();function af(n,e,t){let s=e.offset,i=lf(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};let r=i.mode===">"?Ps.Scalar.BLOCK_FOLDED:Ps.Scalar.BLOCK_LITERAL,o=e.source?cf(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let p=o[d][1];if(p===""||p==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&o.length>0?`
71
+ `.repeat(Math.max(1,o.length-1)):"",p=s+i.length;return e.source&&(p+=e.source.length),{value:d,type:r,comment:i.comment,range:[s,p,p]}}let l=e.indent+i.indent,c=e.offset+i.length,u=0;for(let d=0;d<a;++d){let[p,S]=o[d];if(S===""||S==="\r")i.indent===0&&p.length>l&&(l=p.length);else{p.length<l&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=p.length),u=d,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+S.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>l&&(a=d+1);let f="",h="",m=!1;for(let d=0;d<u;++d)f+=o[d][0].slice(l)+`
72
+ `;for(let d=u;d<a;++d){let[p,S]=o[d];c+=p.length+S.length+1;let k=S[S.length-1]==="\r";if(k&&(S=S.slice(0,-1)),S&&p.length<l){let g=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-S.length-(k?2:1),"BAD_INDENT",g),p=""}r===Ps.Scalar.BLOCK_LITERAL?(f+=h+p.slice(l)+S,h=`
73
+ `):p.length>l||S[0]===" "?(h===" "?h=`
74
+ `:!m&&h===`
75
+ `&&(h=`
76
+
77
+ `),f+=h+p.slice(l)+S,h=`
78
+ `,m=!0):S===""?h===`
79
+ `?f+=`
80
+ `:h=`
81
+ `:(f+=h+S,h=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)f+=`
82
+ `+o[d][0].slice(l);f[f.length-1]!==`
83
+ `&&(f+=`
84
+ `);break;default:f+=`
85
+ `}let w=s+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[s,w,w]}}function lf({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",l=-1;for(let h=1;h<i.length;++h){let m=i[h];if(!a&&(m==="-"||m==="+"))a=m;else{let w=Number(m);!o&&w?o=w:l===-1&&(l=n+h)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,u="",f=i.length;for(let h=1;h<e.length;++h){let m=e[h];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&s(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,u=m.source.substring(1);break;case"error":s(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{let w=`Unexpected token in block scalar header: ${m.type}`;s(m,"UNEXPECTED_TOKEN",w);let d=m.source;d&&typeof d=="string"&&(f+=d.length)}}}return{mode:r,indent:o,chomp:a,comment:u,length:f}}function cf(n){let e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}bo.resolveBlockScalar=af});var Ds=b(So=>{"use strict";var Is=C(),uf=Ee();function ff(n,e,t){let{offset:s,type:i,source:r,end:o}=n,a,l,c=(h,m,w)=>t(s+h,m,w);switch(i){case"scalar":a=Is.Scalar.PLAIN,l=hf(r,c);break;case"single-quoted-scalar":a=Is.Scalar.QUOTE_SINGLE,l=df(r,c);break;case"double-quoted-scalar":a=Is.Scalar.QUOTE_DOUBLE,l=pf(r,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}let u=s+r.length,f=uf.resolveEnd(o,u,e,t);return{value:l,type:a,comment:f.comment,range:[s,u,f.offset]}}function hf(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),wo(n)}function df(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),wo(n.slice(1,-1)).replace(/''/g,"'")}function wo(n){let e=/(.*?)\r?\n/sy,t=e.exec(n);if(!t)return n;let s,i;try{s=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{s=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=t[1].replace(s,""),o=" ",a=e.lastIndex;for(;t=e.exec(n);){let c=t[1].replace(i,"");c===""?o===`
86
+ `?r+=o:o=`
87
+ `:(r+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,t=l.exec(n),r+o+(t?.[1]??"")}function pf(n,e){let t="";for(let s=1;s<n.length-1;++s){let i=n[s];if(!(i==="\r"&&n[s+1]===`
88
+ `))if(i===`
89
+ `){let{fold:r,offset:o}=mf(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s],o=gf[r];if(o)t+=o;else if(r===`
90
+ `)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
91
+ `)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;t+=yf(n,s+1,a,e),s+=a}else{let a=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let r=s,o=n[s+1];for(;o===" "||o===" ";)o=n[++s+1];o!==`
92
+ `&&!(o==="\r"&&n[s+2]===`
93
+ `)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function mf(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
94
+ `||s==="\r")&&!(s==="\r"&&n[e+2]!==`
95
+ `);)s===`
96
+ `&&(t+=`
97
+ `),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}var gf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
98
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yf(n,e,t,s){let i=n.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}So.resolveFlowScalar=ff});var No=b(vo=>{"use strict";var fe=L(),ko=C(),bf=Ms(),wf=Ds();function Sf(n,e,t,s){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?bf.resolveBlockScalar(n,e,s):wf.resolveFlowScalar(e,n.options.strict,s),l=t?n.directives.tagName(t.source,f=>s(t,"TAG_RESOLVE_FAILED",f)):null,c;n.options.stringKeys&&n.atKey?c=n.schema[fe.SCALAR]:l?c=kf(n.schema,i,l,t,s):e.type==="scalar"?c=vf(n,i,e,s):c=n.schema[fe.SCALAR];let u;try{let f=c.resolve(i,h=>s(t??e,"TAG_RESOLVE_FAILED",h),n.options);u=fe.isScalar(f)?f:new ko.Scalar(f)}catch(f){let h=f instanceof Error?f.message:String(f);s(t??e,"TAG_RESOLVE_FAILED",h),u=new ko.Scalar(i)}return u.range=a,u.source=i,r&&(u.type=r),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function kf(n,e,t,s,i){if(t==="!")return n[fe.SCALAR];let r=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[fe.SCALAR])}function vf({atKey:n,directives:e,schema:t},s,i,r){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(s))||t[fe.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(s))??t[fe.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}vo.composeScalar=Sf});var $o=b(Ao=>{"use strict";function Nf(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}Ao.emptyScalarPosition=Nf});var To=b(Rs=>{"use strict";var Af=Me(),$f=L(),Ef=yo(),Eo=No(),Lf=Ee(),Tf=$o(),Of={composeNode:Lo,composeEmptyNode:_s};function Lo(n,e,t,s){let i=n.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,u=!0;switch(e.type){case"alias":c=Cf(n,e,s),(a||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Eo.composeScalar(n,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Ef.composeCollection(Of,n,e,t,s),a&&(c.anchor=a.source.substring(1))}catch(f){let h=f instanceof Error?f.message:String(f);s(e,"RESOURCE_EXHAUSTION",h)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=_s(n,e.offset,void 0,null,t,s)),a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!$f.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&u&&(c.srcToken=e),c}function _s(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let u={type:"scalar",offset:Tf.emptyScalarPosition(e,t,s),indent:-1,source:""},f=Eo.composeScalar(n,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Cf({options:n},{offset:e,source:t,end:s},i){let r=new Af.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Lf.resolveEnd(s,o,n.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Rs.composeEmptyNode=_s;Rs.composeNode=Lo});var qo=b(Co=>{"use strict";var qf=He(),Oo=To(),Pf=Ee(),Mf=Ze();function If(n,e,{offset:t,start:s,value:i,end:r},o){let a=Object.assign({_directives:e},n),l=new qf.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Mf.resolveProps(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Oo.composeNode(c,i,u,o):Oo.composeEmptyNode(c,u.end,s,null,u,o);let f=l.contents.range[2],h=Pf.resolveEnd(r,f,!1,o);return h.comment&&(l.comment=h.comment),l.range=[t,f,h.offset],l}Co.composeDoc=If});var Fs=b(Io=>{"use strict";var Df=at("process"),_f=An(),Rf=He(),et=Qe(),Po=L(),Bf=qo(),Ff=Ee();function tt(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Mo(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){let r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
99
+
100
+ `:`
101
+ `)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}var Bs=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{let o=tt(t);r?this.warnings.push(new et.YAMLWarning(o,s,i)):this.errors.push(new et.YAMLParseError(o,s,i))},this.directives=new _f.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:i}=Mo(this.prelude);if(s){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
102
+ ${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(Po.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Po.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${s}
103
+ ${a}`:s}else{let o=r.commentBefore;r.commentBefore=o?`${s}
104
+ ${o}`:s}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Mo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(Df.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{let r=tt(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Bf.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new et.YAMLParseError(tt(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){let s="Unexpected doc-end without preceding document";this.errors.push(new et.YAMLParseError(tt(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let t=Ff.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
105
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new et.YAMLParseError(tt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),i=new Rf.Document(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};Io.Composer=Bs});var Ro=b(Zt=>{"use strict";var xf=Ms(),jf=Ds(),Kf=Qe(),Do=Be();function Uf(n,e=!0,t){if(n){let s=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new Kf.YAMLParseError([a,a+1],r,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jf.resolveFlowScalar(n,e,s);case"block-scalar":return xf.resolveBlockScalar({options:{strict:e}},n,s)}}return null}function Yf(n,e){let{implicitKey:t=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Do.stringifyString({type:o,value:n},{implicitKey:t,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:s,source:`
106
+ `}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
107
+ `),u=a.substring(0,c),f=a.substring(c+1)+`
108
+ `,h=[{type:"block-scalar-header",offset:r,indent:s,source:u}];return _o(h,l)||h.push({type:"newline",offset:-1,indent:s,source:`
109
+ `}),{type:"block-scalar",offset:r,indent:s,props:h,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:l};default:return{type:"scalar",offset:r,indent:s,source:a,end:l}}}function Vf(n,e,t={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in n?n.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=n.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=Do.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Jf(n,l);break;case'"':xs(n,l,"double-quoted-scalar");break;case"'":xs(n,l,"single-quoted-scalar");break;default:xs(n,l,"scalar")}}function Jf(n,e){let t=e.indexOf(`
110
+ `),s=e.substring(0,t),i=e.substring(t+1)+`
111
+ `;if(n.type==="block-scalar"){let r=n.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=s,n.source=i}else{let{offset:r}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:s}];_o(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
112
+ `});for(let l of Object.keys(n))l!=="type"&&l!=="offset"&&delete n[l];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:i})}}function _o(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function xs(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let s=n.props.slice(1),i=e.length;n.props[0].type==="block-scalar-header"&&(i-=n.props[0].source.length);for(let r of s)r.offset+=i;delete n.props,Object.assign(n,{type:t,source:e,end:s});break}case"block-map":case"block-seq":{let i={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
113
+ `};delete n.items,Object.assign(n,{type:t,source:e,end:[i]});break}default:{let s="indent"in n?n.indent:-1,i="end"in n&&Array.isArray(n.end)?n.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(n))r!=="type"&&r!=="offset"&&delete n[r];Object.assign(n,{type:t,indent:s,source:e,end:i})}}}Zt.createScalarToken=Yf;Zt.resolveAsScalar=Uf;Zt.setScalarValue=Vf});var Fo=b(Bo=>{"use strict";var Gf=n=>"type"in n?tn(n):en(n);function tn(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=tn(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=en(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=en(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=en(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function en({start:n,key:e,sep:t,value:s}){let i="";for(let r of n)i+=r.source;if(e&&(i+=tn(e)),t)for(let r of t)i+=r.source;return s&&(i+=tn(s)),i}Bo.stringify=Gf});var Uo=b(Ko=>{"use strict";var js=Symbol("break visit"),Wf=Symbol("skip children"),xo=Symbol("remove item");function he(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),jo(Object.freeze([]),n,e)}he.BREAK=js;he.SKIP=Wf;he.REMOVE=xo;he.itemAtPath=(n,e)=>{let t=n;for(let[s,i]of e){let r=t?.[s];if(r&&"items"in r)t=r.items[i];else return}return t};he.parentCollection=(n,e)=>{let t=he.itemAtPath(n,e.slice(0,-1)),s=e[e.length-1][0],i=t?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function jo(n,e,t){let s=t(e,n);if(typeof s=="symbol")return s;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=jo(Object.freeze(n.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===js)return js;a===xo&&(r.items.splice(o,1),o-=1)}}typeof s=="function"&&i==="key"&&(s=s(e,n))}}return typeof s=="function"?s(e,n):s}Ko.visit=he});var nn=b(R=>{"use strict";var Ks=Ro(),Hf=Fo(),Xf=Uo(),Us="\uFEFF",Ys="",Vs="",Js="",zf=n=>!!n&&"items"in n,Qf=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function Zf(n){switch(n){case Us:return"<BOM>";case Ys:return"<DOC>";case Vs:return"<FLOW_END>";case Js:return"<SCALAR>";default:return JSON.stringify(n)}}function eh(n){switch(n){case Us:return"byte-order-mark";case Ys:return"doc-mode";case Vs:return"flow-error-end";case Js:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
114
+ `:case`\r
115
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}R.createScalarToken=Ks.createScalarToken;R.resolveAsScalar=Ks.resolveAsScalar;R.setScalarValue=Ks.setScalarValue;R.stringify=Hf.stringify;R.visit=Xf.visit;R.BOM=Us;R.DOCUMENT=Ys;R.FLOW_END=Vs;R.SCALAR=Js;R.isCollection=zf;R.isScalar=Qf;R.prettyToken=Zf;R.tokenType=eh});var Hs=b(Vo=>{"use strict";var nt=nn();function j(n){switch(n){case void 0:case" ":case`
116
+ `:case"\r":case" ":return!0;default:return!1}}var Yo=new Set("0123456789ABCDEFabcdef"),th=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),sn=new Set(",[]{}"),nh=new Set(` ,[]{}
117
+ \r `),Gs=n=>!n||nh.has(n),Ws=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
118
+ `?!0:t==="\r"?this.buffer[e+1]===`
119
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){let i=this.buffer[s+e+1];if(i===`
120
+ `||!i&&!this.atEnd)return e+s+1}return t===`
121
+ `||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&j(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
122
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===nt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){let r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield nt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&j(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!j(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&j(t)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Gs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&j(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield nt.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(Gs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||j(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let s=this.buffer.substring(0,t),i=s.indexOf(`
123
+ `,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
124
+ `,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>j(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
125
+ `:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
126
+ `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
127
+ `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
128
+ `;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
129
+ `&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield nt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){let r=this.buffer[s+1];if(j(r)||e&&sn.has(r))break;t=s}else if(j(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
130
+ `?(s+=1,i=`
131
+ `,r=this.buffer[s+1]):t=s),r==="#"||e&&sn.has(r))break;if(i===`
132
+ `){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&sn.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield nt.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Gs),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(j(s)||t&&sn.has(s)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!j(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(th.has(t))t=this.buffer[++e];else if(t==="%"&&Yo.has(this.buffer[e+1])&&Yo.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
133
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
134
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};Vo.Lexer=Ws});var zs=b(Jo=>{"use strict";var Xs=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){let r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};Jo.LineCounter=Xs});var Zs=b(zo=>{"use strict";var sh=at("process"),Go=nn(),ih=Hs();function re(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Wo(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Xo(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function rn(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Le(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function on(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}function Ho(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!re(e.start,"explicit-key-ind")&&!re(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Xo(e.value)?e.value.end?on(e.value.end,e.sep):e.value.end=e.sep:on(e.start,e.sep),delete e.sep)}var Qs=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new ih.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,sh.env.LOG_TOKENS&&console.log("|",Go.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Go.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Ho(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{let i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Wo(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Wo(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=rn(this.peek(2)),s=Le(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
135
+ `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
136
+ `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){on(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(re(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Xo(t.key)&&!re(t.sep,"newline")){let o=Le(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(re(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Le(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):re(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!re(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){on(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||re(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let i=rn(s),r=Le(i);Ho(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
137
+ `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
138
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=rn(e),s=Le(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=rn(e),s=Le(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};zo.Parser=Qs});var na=b(it=>{"use strict";var Qo=Fs(),rh=He(),st=Qe(),oh=Rn(),ah=L(),lh=zs(),Zo=Zs();function ea(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new lh.LineCounter||null,prettyErrors:e}}function ch(n,e={}){let{lineCounter:t,prettyErrors:s}=ea(e),i=new Zo.Parser(t?.addNewLine),r=new Qo.Composer(e),o=Array.from(r.compose(i.parse(n)));if(s&&t)for(let a of o)a.errors.forEach(st.prettifyError(n,t)),a.warnings.forEach(st.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ta(n,e={}){let{lineCounter:t,prettyErrors:s}=ea(e),i=new Zo.Parser(t?.addNewLine),r=new Qo.Composer(e),o=null;for(let a of r.compose(i.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new st.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(st.prettifyError(n,t)),o.warnings.forEach(st.prettifyError(n,t))),o}function uh(n,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=ta(n,t);if(!i)return null;if(i.warnings.forEach(r=>oh.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},t))}function fh(n,e,t){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(n===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return ah.isDocument(n)&&!s?n.toString(t):new rh.Document(n,s,t).toString(t)}it.parse=uh;it.parseAllDocuments=ch;it.parseDocument=ta;it.stringify=fh});var ia=b(T=>{"use strict";var hh=Fs(),dh=He(),ph=ws(),ei=Qe(),mh=Me(),oe=L(),gh=te(),yh=C(),bh=se(),wh=ie(),Sh=nn(),kh=Hs(),vh=zs(),Nh=Zs(),an=na(),sa=Oe();T.Composer=hh.Composer;T.Document=dh.Document;T.Schema=ph.Schema;T.YAMLError=ei.YAMLError;T.YAMLParseError=ei.YAMLParseError;T.YAMLWarning=ei.YAMLWarning;T.Alias=mh.Alias;T.isAlias=oe.isAlias;T.isCollection=oe.isCollection;T.isDocument=oe.isDocument;T.isMap=oe.isMap;T.isNode=oe.isNode;T.isPair=oe.isPair;T.isScalar=oe.isScalar;T.isSeq=oe.isSeq;T.Pair=gh.Pair;T.Scalar=yh.Scalar;T.YAMLMap=bh.YAMLMap;T.YAMLSeq=wh.YAMLSeq;T.CST=Sh;T.Lexer=kh.Lexer;T.LineCounter=vh.LineCounter;T.Parser=Nh.Parser;T.parse=an.parse;T.parseAllDocuments=an.parseAllDocuments;T.parseDocument=an.parseDocument;T.stringify=an.stringify;T.visit=sa.visit;T.visitAsync=sa.visitAsync});var bn=20;function wn(n){let e=n.slice(0,bn).join("; ");return n.length>bn?`${e}; and ${n.length-bn} more`:e}function lt(n,e,t,s){return new li(t,{code:e,exitCode:n,...s?{hint:s}:{}})}function W(n,e,t=[],s){return lt(2,n,t.length?`${e}: ${wn(t)}`:e,s)}function Rd(n,e,t=[],s){return lt(1,n,t.length?`${e}: ${wn(t)}`:e,s)}function Sn(n,e,t=[],s){return lt(4,n,t.length?`${e}: ${wn(t)}`:e,s)}function Bd(n,e,t){return lt(6,n,e,t)}var M=Va(ia(),1),U=class{text;constructor(e){let t=oa(e);if(t===null)throw new Error(`not a number: ${e}`);this.text=t}toJSON(){return Number(this.text)}toString(){return this.text}},cn=class{constructor(e){this.entries=e}},un=class{constructor(e){this.items=e}},fn=class{constructor(e,t){this.value=e;this.comment=t}},Te=class{constructor(e){this.entries=e}},ra=/^([+-]?)(\d*)(?:\.(\d*))?(?:[eE]([+-]?\d+))?$/;function oa(n){let e=ra.exec(n.trim());if(!e)return null;let[,t="",s="",i="",r="0"]=e;if(!s&&!i)return null;let o=s+i,a=s.length+parseInt(r,10),l=o.length-o.replace(/^0+/,"").length;if(o=o.slice(l),a-=l,o=o.replace(/0+$/,""),!o)return"0";let c;return a<=0?c="0."+"0".repeat(-a)+o:a>=o.length?c=o+"0".repeat(a-o.length):c=o.slice(0,a)+"."+o.slice(a),(t==="-"?"-":"")+c}var Ah=/^[A-Za-z_][A-Za-z0-9_ ./()+-]*$/,$h=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,aa="\x7F-\x9F\u2028\u2029\uFEFF",Eh="\\",Lh=new RegExp("["+aa+"]","g"),Th=new RegExp("[\0-"+aa+"]"),la=new Set(["true","false","null","yes","no","on","off","y","n","~"]);function Oh(n){return $h.test(n)?!0:Ah.test(n)&&!n.endsWith(" ")&&!la.has(n.toLowerCase())}function ca(n){return JSON.stringify(n).replace(Lh,e=>Eh+"u"+e.charCodeAt(0).toString(16).padStart(4,"0"))}function Ch(n){if(!n.includes(`
139
+ `))return null;let e=n.split(`
140
+ `);if(n.endsWith(`
141
+ `)||/^[ ]/.test(n))return null;for(let t of e)if(/[ ]$/.test(t)||Th.test(t))return null;return e}function ua(n){return n===null?"null":typeof n=="boolean"?n?"true":"false":n instanceof U?n.text:Oh(n)?n:ca(n)}function ti(n){if(n instanceof cn)return"{ "+n.entries.map(([e,t])=>`${hn(e)}: ${ti(t)}`).join(", ")+" }";if(n instanceof un)return"["+n.items.map(ti).join(", ")+"]";if(n instanceof fn||n instanceof Te||Array.isArray(n))throw new Error("a block value cannot be in a flow value");return ua(n)}function hn(n){return/^\$?[A-Za-z_][A-Za-z0-9_]*$/.test(n)&&!la.has(n.toLowerCase())?n:ca(n)}function de(n){return n===null||n===""?"":" # "+n.replace(/\r\n|\r|\n/g," ")}function ln(n,e,t,s){let i=null;if(s instanceof fn&&(i=s.comment,s=s.value),s instanceof Te){if(!s.entries.length){n.push(`${e}${t} {}${de(i)}`);return}if(t==="-"){let r=e+" ";s.entries.forEach(([o,a],l)=>{let c=[];ln(c,r,`${hn(o)}:`,a),l===0&&(c[0]=e+"- "+c[0].slice(r.length)),n.push(...c)});return}n.push(`${e}${t}${de(i)}`);for(let[r,o]of s.entries)ln(n,e+" ",`${hn(r)}:`,o);return}if(Array.isArray(s)){if(!s.length){n.push(`${e}${t} []${de(i)}`);return}n.push(`${e}${t}${de(i)}`);for(let r of s)ln(n,e+" ","-",r);return}if(s instanceof cn||s instanceof un){n.push(`${e}${t} ${ti(s)}${de(i)}`);return}if(typeof s=="string"){let r=Ch(s.replace(/\r\n/g,`
142
+ `));if(r){n.push(`${e}${t} |-${de(i)}`);let o=e+" ";for(let a of r)n.push(a?o+a:"");return}}n.push(`${e}${t} ${ua(s)}${de(i)}`)}function im(n){let e=[];for(let[t,s]of n.entries)ln(e,"",`${hn(t)}:`,s);return e.join(`
143
+ `)+`
144
+ `}var K=class extends Error{constructor(t,s){super(`${t}: ${s.join("; ")}`);this.file=t;this.problems=s}};function pe(n,e){if(e===void 0)return 0;let t=1;for(let s=0;s<e&&s<n.length;s++)n.charCodeAt(s)===10&&t++;return t}function ni(n,e,t){if((0,M.isScalar)(n)){let s=n.value;if(s==null)return null;if(typeof s=="boolean"||typeof s=="string")return s;if(typeof s=="number"||typeof s=="bigint"){let i=typeof n.source=="string"&&ra.test(n.source)?n.source:String(s),r=oa(i);if(r===null)throw new K(t,[`line ${pe(e,n.range?.[0])}: ${i} is not a finite number`]);return new U(r)}throw new K(t,[`line ${pe(e,n.range?.[0])}: a value of an unknown type`])}if((0,M.isSeq)(n))return n.items.map(s=>ni(s,e,t));if((0,M.isMap)(n)){let s={};for(let i of n.items){let r=(0,M.isScalar)(i.key)?i.key.value:void 0;if(typeof r!="string"){let o=(0,M.isNode)(i.key)?i.key.range?.[0]:void 0;throw new K(t,[`line ${pe(e,o)}: a key must be text`])}s[r]=i.value===null||i.value===void 0?null:ni(i.value,e,t)}return s}if(n==null)return null;throw new K(t,["an unknown YAML node"])}function dn(n,e){n.charCodeAt(0)===65279&&(n=n.slice(1));let t=(0,M.parseDocument)(n,{version:"1.2",schema:"core",merge:!1,uniqueKeys:!0,prettyErrors:!1}),s=t.errors.map(i=>{let r=i.linePos?.[0]?.line??pe(n,i.pos?.[0]),o=i.code==="DUPLICATE_KEY"?"a duplicate key":i.message.split(`
145
+ `)[0];return`line ${r}: ${o}`});if(s.length||(0,M.visit)(t,(i,r)=>{if((0,M.isAlias)(r)){s.push(`line ${pe(n,r.range?.[0])}: an alias is not permitted`);return}let o=r;(0,M.isNode)(o)&&(o.anchor&&s.push(`line ${pe(n,o.range?.[0])}: an anchor is not permitted`),o.tag&&s.push(`line ${pe(n,o.range?.[0])}: a tag is not permitted`))}),s.length)throw new K(e,s);return ni(t.contents,n,e)}function B(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof U)?n:null}import{existsSync as me,mkdirSync as qh,readdirSync as pn,readFileSync as pa,renameSync as Ph,rmSync as Mh,rmdirSync as Ih,statSync as rt,writeFileSync as Dh}from"node:fs";import{dirname as _h,join as Y}from"node:path";var fa="data/tables",Rh="data/relationships",ii="data/files",um="data/overlays";function fm(n,e){return{table:n.table,layout:n.layout,match:n.match??[e],columns:n.columns.map(t=>t.name),filter:n.filter,fetchXmlFilter:n.fetchXmlFilter}}function hm(n,e){let t=[],s=i=>i.join(", ");return n.layout!==e.layout&&t.push(`the layout is ${n.layout} in the file and ${e.layout} in the schema`),s(n.match)!==s(e.match)&&t.push(`match is [${s(n.match)}] in the file and [${s(e.match)}] in the schema`),s(n.columns)!==s(e.columns)&&t.push("the columns are different"),(n.filter??null)!==(e.filter??null)&&t.push("the filter is different"),(n.fetchXmlFilter??null)!==(e.fetchXmlFilter??null)&&t.push("fetchXmlFilter is different"),t}function si(n,e,t){try{return dn(pa(Y(n,e),"utf8"),e)}catch(s){if(s instanceof K){t.push(...s.problems.map(i=>`${e}: ${i}`));return}throw s}}function ha(n){return!Array.isArray(n)||!n.every(e=>typeof e=="string")?null:n}function Bh(n,e,t){let s=ha(n.match),i=ha(n.columns),r=n.layout===void 0?"table":n.layout;typeof n.table!="string"&&t.push(`${e}: the header has no table`),s||t.push(`${e}: the header has no match list`),i||t.push(`${e}: the header has no columns list`),r!=="table"&&r!=="record"&&t.push(`${e}: layout must be table or record`);for(let o of["filter","fetchXmlFilter"])n[o]!==void 0&&typeof n[o]!="string"&&t.push(`${e}: ${o} must be text`);return typeof n.table!="string"||!s||!i||r!=="table"&&r!=="record"?null:{table:n.table,layout:r,match:s,columns:i,filter:typeof n.filter=="string"?n.filter:null,fetchXmlFilter:typeof n.fetchXmlFilter=="string"?n.fetchXmlFilter:null}}var Fh=["table","layout","match","columns","filter","fetchXmlFilter","records"];function dm(n,e,t){let s=`${fa}/${e}.yaml`;if(!me(Y(n,s)))return null;let i=B(si(n,s,t)??null);if(!i)return t.some(l=>l.startsWith(s))||t.push(`${s}: the file must be a map with a header`),null;for(let l of Object.keys(i))Fh.includes(l)||t.push(`${s}: unknown property '${l}'`);let r=Bh(i,s,t);if(!r)return null;r.table!==e&&t.push(`${s}: table is '${r.table}', but the file name is '${e}.yaml'`);let o=[],a=[];if(r.layout==="table"){let l=i.records??[];Array.isArray(l)?l.forEach((c,u)=>{let f=B(c);f?o.push({file:s,index:u,values:f}):t.push(`${s}: record ${u+1} must be a map`)}):t.push(`${s}: records must be a list`)}else{i.records!==void 0&&t.push(`${s}: a table with the layout record has no records in its header file`);let l=`${fa}/${e}`,c=Y(n,l);if(me(c)&&rt(c).isDirectory())for(let u of pn(c).sort()){if(!u.endsWith(".yaml"))continue;let f=`${l}/${u}`;a.push(f);let h=B(si(n,f,t)??null);if(!h){t.some(m=>m.startsWith(f))||t.push(`${f}: a record file must be a map`);continue}o.push({file:f,index:0,values:h})}}return{table:e,file:s,header:r,records:o,recordFiles:a}}function pm(n,e,t){let s=`${Rh}/${e.toLowerCase()}.yaml`;if(!me(Y(n,s)))return null;let i=B(si(n,s,t)??null);if(!i)return t.some(c=>c.startsWith(s))||t.push(`${s}: the file must be a map`),null;let r=i.from,o=i.to;if((typeof i.relationship!="string"||i.relationship.toLowerCase()!==e.toLowerCase())&&t.push(`${s}: relationship must be '${e}'`),typeof r!="string"||typeof o!="string")return t.push(`${s}: the header must have from and to`),null;let a=[],l=i.links??[];return Array.isArray(l)?l.forEach((c,u)=>{let f=B(c);if(!f||!("from"in f)||!Array.isArray(f.to)){t.push(`${s}: link ${u+1} must have from and a to list`);return}a.push({from:f.from,to:f.to,file:s,index:u})}):t.push(`${s}: links must be a list`),{name:e,file:s,from:r,to:o,links:a}}function mm(n){let e=[["table",n.table]];return n.layout==="record"&&e.push(["layout","record"]),e.push(["match",n.match],["columns",n.columns]),n.filter!==null&&e.push(["filter",n.filter]),n.fetchXmlFilter!==null&&e.push(["fetchXmlFilter",n.fetchXmlFilter]),e}var da=class{files=new Map;owned=new Set;ownedFiles=new Set;put(e,t){this.files.set(e,t)}own(e){this.owned.add(e)}ownFile(e){this.ownedFiles.add(e)}};function ma(n,e,t){let s=Y(n,e);if(!(!me(s)||!rt(s).isDirectory()))for(let i of pn(s)){let r=`${e}/${i}`;rt(Y(n,r)).isDirectory()?ma(n,r,t):t.push(r)}}function xh(n,e){if(!me(n))return!1;let t=pa(n),s=typeof e=="string"?Buffer.from(e,"utf8"):e;return t.equals(s)}function gm(n,e,t){let s=[],i=[];for(let[o,a]of[...e.files].sort(([l],[c])=>l<c?-1:l>c?1:0)){let l=Y(n,o);if(xh(l,a)||(s.push(o),!t))continue;qh(_h(l),{recursive:!0});let c=`${l}.${process.pid}.tmp`;Dh(c,a),Ph(c,l)}let r=[];for(let o of e.owned)ma(n,o,r);for(let o of e.ownedFiles)me(Y(n,o))&&r.push(o);for(let o of[...new Set(r)].sort())e.files.has(o)||(i.push(o),t&&Mh(Y(n,o),{force:!0}));if(t)for(let o of e.owned)ga(Y(n,o),!0);return{written:s,removed:i}}function ga(n,e){if(!(!me(n)||!rt(n).isDirectory())){for(let t of pn(n)){let s=Y(n,t);rt(s).isDirectory()&&ga(s,!1)}!e&&!pn(n).length&&Ih(n)}}function ym(n){return new Te(n)}import{existsSync as Vh,readFileSync as Jh}from"node:fs";import{join as Gh}from"node:path";var wm="{$id}.{$column}.{$ext}",ya=["$id","$column","$filename","$stem","$ext"];var jh=/^([a-z][a-z0-9_]*)(\.name)?$/;function wa(n){let e=[];n.includes("\\")&&e.push("use / to make a folder, not \\"),(n.startsWith("/")||/^[A-Za-z]:/.test(n))&&e.push("must be a relative path");let t=[];for(let s of n.split("/")){let i=[],r=0;for(;r<s.length;){let o=s.indexOf("{",r),a=s.indexOf("}",r);if(a>=0&&(o<0||a<o)){e.push(`a '}' with no '{' at position ${r+1} of '${s}'`);break}if(o<0){i.push({kind:"text",text:s.slice(r)});break}o>r&&i.push({kind:"text",text:s.slice(r,o)});let l=s.indexOf("}",o);if(l<0){e.push(`a '{' with no '}' in '${s}'`);break}let c=s.slice(o+1,l);if(ya.includes(c))i.push({kind:"special",token:c});else{let u=jh.exec(c);u?i.push({kind:"column",column:u[1],name:!!u[2]}):e.push(`unknown token '{${c}}': use ${ya.map(f=>`{${f}}`).join(", ")}, {<column>} or {<lookup column>.name}`)}r=l+1}i.length?i.every(o=>o.kind==="text")&&/^\.+$/.test(i.map(o=>o.text).join(""))&&e.push(`'${s}' is not a folder name`):e.push(s===""?"a folder name is empty (two / together, or / at the end)":`'${s}' is empty`),t.push(i)}return e.length?{pattern:null,problems:e}:{pattern:{source:n,segments:t},problems:e}}function Sa(n){return n.segments.flat().filter(e=>e.kind==="column").map(e=>({column:e.column,name:e.name}))}var Kh=/[<>:"/\\|?*\x00-\x1f]/g,Uh=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i;function ba(n){let e=n.replace(Kh,"_").replace(/[. ]+$/,t=>"_".repeat(t.length));return e||(e="_"),Uh.test(e)&&(e="_"+e),e}function Yh(n,e){return n?e&&n.toLowerCase().endsWith("."+e)?n.slice(0,n.length-e.length-1):n:""}function Sm(n,e){let t=[];return n.segments.forEach((s,i)=>{let r=i===n.segments.length-1,o="";for(let c of s)if(c.kind==="text")o+=c.text;else if(c.kind==="special"){let u;c.token==="$id"?u=e.id:c.token==="$column"?u=e.column:c.token==="$filename"?u=e.filename??"":c.token==="$stem"?u=Yh(e.filename,e.ext):u=e.ext,c.token==="$ext"&&!u&&o.endsWith(".")&&(o=o.slice(0,-1)),o+=u.replace(/\//g,"_")}else o+=e.value(c.column,c.name).replace(/\//g,"_");let a=r&&e.ext&&!o.toLowerCase().endsWith("."+e.ext.toLowerCase())?"."+e.ext:"",l=ba(o);if(l.length+a.length>100){let c=r&&!a?/\.[A-Za-z0-9]{1,10}$/.exec(l)?.[0]??"":"";l=ba(l.slice(0,100-a.length-c.length)+c)}t.push(l+a)}),t.join("/")}function ka(n){return!n||n.includes("\\")||n.startsWith("/")||/^[A-Za-z]:/.test(n)?!1:n.split("/").every(e=>e!==""&&e!=="."&&e!=="..")}var Wh=40*1024*1024,Lm=10*1024*1024,Tm=10,Hh="V";function Xh(n){if(!n)return"";let e=/\.([A-Za-z0-9]{1,10})$/.exec(n);return e?e[1].toLowerCase():""}function Om(n){return n.length>=8&&n.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10]))?"png":n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255?"jpg":n.length>=6&&(n.subarray(0,6).toString("latin1")==="GIF87a"||n.subarray(0,6).toString("latin1")==="GIF89a")?"gif":n.length>=2&&n[0]===66&&n[1]===77?"bmp":"bin"}function zh(n,e,t){return`${n}.${e}${t?"."+t:""}`}var Aa={annotation:{column:"documentbody",nameColumn:"filename"},activitymimeattachment:{column:"body",nameColumn:"filename"}};function $a(n,e){let t=Aa[n];return t&&t.column===e?t.nameColumn:null}function Cm(n,e,t,s){let i=Buffer.from(t,"base64");return{fname:zh(n,e,Xh(typeof s=="string"?s:null)),bytes:i}}function qm(n,e,t){let s=Aa[e.table];if(s)for(let i of e.records){let r=i.values[s.column];if(r==null||typeof r=="string")continue;let o=typeof r=="object"&&!Array.isArray(r)?r:null,a=o?.$file,l=`${i.file}${e.header.layout==="table"?` record ${i.index+1}`:""} ${s.column}`;if(!o||typeof a!="string"||!a||Object.keys(o).length!==1){t.push(`[file_missing] ${l}: the value must be { $file: <name> } or base64 text`);continue}let c=Gh(n,ii,e.table,a);if(!ka(a)||!Vh(c)){t.push(`[file_missing] ${l}: ${ii}/${e.table}/${a} is not in the folder`);continue}let u=Jh(c);i.values={...i.values,[s.column]:u.length?u.toString("base64"):null}}}function Qh(n){return/[^\x20-\x7e]/.test(n)}function Zh(n){return Buffer.from(n,"utf8").toString("latin1")}async function Pm(n,e,t,s){let i=`${e.entitySet}(${t})/${s.name}/$value`;if(s.kind==="image"&&s.fullImage){let o=await n.request("GET",i,{params:[["size","full"]],check:!1});if(o.status===200)return va(o.body,e,s,t);if(o.status!==204&&o.status!==404)throw n.client.service.error(o)}let r=await n.request("GET",i,{check:!1});if(r.status===204||r.status===404)return null;if(r.status>=400)throw n.client.service.error(r);return va(r.body,e,s,t)}function va(n,e,t,s){if(n.length>Wh)throw W("file_too_large",`${e.table} ${s} ${t.name}: the file is ${n.length} bytes; version 1 handles files to 40 MB`);return n}async function Mm(n,e){let t=new Map;for(let s=0;s<e.length;s+=20){let i=e.slice(s,s+20),r=await n.rows("fileattachments",[["$select","fileattachmentid,filename,filesizeinbytes"],["$filter",i.map(o=>`fileattachmentid eq ${o}`).join(" or ")]],!1);for(let o of r)t.set(String(o.fileattachmentid).toLowerCase(),{name:o.filename??null,size:Number(String(o.filesizeinbytes??0))})}return t}var Na=4*1024*1024;async function Im(n,e,t,s,i,r,o){if(Qh(r)){await ed(n,e,t,s,i,r,o);return}await n.request("PATCH",`${e.entitySet}(${t})/${s.name}`,{body:i,headers:{...o,"Content-Type":"application/octet-stream","x-ms-file-name":Zh(r)}})}var ri=n=>Buffer.from(JSON.stringify(n),"utf8");async function ed(n,e,t,s,i,r,o){let l=(await n.request("POST","InitializeFileBlocksUpload",{headers:o,body:ri({Target:{"@odata.type":`Microsoft.Dynamics.CRM.${e.table}`,[e.primaryId]:t},FileAttributeName:s.name,FileName:r})})).json()?.FileContinuationToken;if(typeof l!="string")throw new Error("InitializeFileBlocksUpload gave no FileContinuationToken");let c=[];for(let u=0,f=0;u<i.length||f===0;u+=Na,f++){let h=Buffer.from(String(f).padStart(8,"0")).toString("base64");c.push(h),await n.request("POST","UploadBlock",{headers:o,body:ri({BlockId:h,BlockData:i.subarray(u,u+Na).toString("base64"),FileContinuationToken:l})})}await n.request("POST","CommitFileBlocksUpload",{headers:o,body:ri({FileName:r,MimeType:"application/octet-stream",BlockList:c,FileContinuationToken:l})})}async function Dm(n,e,t,s,i){await n.request("DELETE",`${e.entitySet}(${t})/${s.name}`,{headers:i,cls:Hh})}import{closeSync as td,mkdirSync as nd,openSync as sd,writeSync as id}from"node:fs";import{dirname as rd}from"node:path";var mn=class n{constructor(e,t,s="dv data"){this.verbose=e;this.file=t;this.command=s;if(t)try{nd(rd(t),{recursive:!0}),this.fd=sd(t,"w")}catch(i){throw new ci(`cannot write the log file ${t}: ${i.message}`)}}started=Date.now();fd=null;retries=0;peakMemory=0;static none(){return new n(!1,null)}get active(){return this.verbose||this.fd!==null}elapsed(){return((Date.now()-this.started)/1e3).toFixed(1).padStart(7)}log(e){if(!this.active)return;this.peakMemory=Math.max(this.peakMemory,process.memoryUsage().rss);let t=`${this.elapsed()}s ${e}`;this.verbose&&process.stderr.write(`[${this.command}] ${t}
146
+ `),this.write(`${new Date().toISOString()} ${t}`)}http(e){/retrying|throttle/i.test(e)&&(this.retries++,this.write(`${new Date().toISOString()} ${this.elapsed()}s http: ${e.trim()}`))}raw(e,t){this.write(`${new Date().toISOString()} ${this.elapsed()}s ${e}:
147
+ ${t}`)}write(e){this.fd!==null&&id(this.fd,e+`
148
+ `)}close(){this.fd!==null&&(td(this.fd),this.fd=null)}};function xm(n){return n.toLocaleString("en-US")}async function jm(n,e,t,s){let i=Date.now(),r=await t();return n.log(`${e}${s?": "+s(r):""} (${((Date.now()-i)/1e3).toFixed(1)} s)`),r}var Ea='odata.include-annotations="OData.Community.Display.V1.FormattedValue,Microsoft.Dynamics.CRM.lookuplogicalname"',Gm="@OData.Community.Display.V1.FormattedValue",Wm="@Microsoft.Dynamics.CRM.lookuplogicalname",od=5e3;function La(n){return n.length?JSON.parse(n,((e,t,s)=>typeof t!="number"?t:new U(s&&typeof s.source=="string"?s.source:String(t)))):null}function Ta(n){if(n instanceof U)return n.text;if(n==null)return"null";if(Array.isArray(n))return"["+n.map(Ta).join(",")+"]";if(typeof n=="object"){let e=[];for(let[t,s]of Object.entries(n))s!==void 0&&e.push(JSON.stringify(t)+":"+Ta(s));return"{"+e.join(",")+"}"}return JSON.stringify(n)}async function oi(n,e,t){let s=new Array(n.length),i=0,r=null,o=async()=>{for(;r===null;){let a=i++;if(a>=n.length)return;try{s[a]=await t(n[a],a)}catch(l){r??=l}}};if(await Promise.all(Array.from({length:Math.max(1,Math.min(e,n.length))},o)),r!==null)throw r;return s}var Oa=class{constructor(e,t,s="R",i=mn.none()){this.rt=e;this.client=t;this.readClass=s;this.progress=i}get origin(){return this.client.service.origin}async request(e,t,s={}){return ui(this.rt,this.client,e,t,s.body??null,s.cls??(e==="GET"?this.readClass:null)),this.client.request(e,t,{params:s.params??null,headers:s.headers??null,body:s.body??null,check:s.check??!0})}async getJson(e,t=null,s=null){let r=(await this.request("GET",e,{params:t,headers:s})).json();return r&&typeof r=="object"?r:{}}async rows(e,t=null,s=!0){let i=[`odata.maxpagesize=${od}`];s&&i.push(Ea);let r={Prefer:i.join(", ")},o=[],a=await this.request("GET",e,{params:t,headers:r});for(;;){let l=La(a.text);for(let u of l?.value??[])o.push(u);let c=fi(a);if(!c)return o;a=await this.request("GET",c,{headers:r})}}async fetchRows(e,t){let s={Prefer:Ea},i=[],r=1,o=null;for(;;){let a=await this.request("GET",e,{params:[["fetchXml",t(r,o)]],headers:s}),l=La(a.text);for(let f of l?.value??[])i.push(f);if(!l?.["@Microsoft.Dynamics.CRM.morerecords"])return i;let c=String(l["@Microsoft.Dynamics.CRM.fetchxmlpagingcookie"]??""),u=/pagingcookie="([^"]*)"/.exec(c);o=u?decodeURIComponent(decodeURIComponent(u[1])):null,r++}}};function ad(n,e){switch(n){case"String":case"Memo":case"EntityName":return"text";case"Integer":case"BigInt":return"int";case"Decimal":case"Double":case"Money":return"decimal";case"Boolean":return"bool";case"Picklist":case"State":case"Status":return"choice";case"DateTime":return"datetime";case"Lookup":case"Customer":case"Owner":return"lookup";case"Uniqueidentifier":return"guid";case"Virtual":return e==="MultiSelectPicklistType"?"choices":e==="FileType"?"file":e==="ImageType"?"image":"other";default:return"other"}}function ld(n){let e=n,t=e?.UserLocalizedLabel;if(t?.Label)return String(t.Label);for(let s of e?.LocalizedLabels??[])if(s.Label)return String(s.Label);return null}var Pa=n=>`EntityDefinitions(LogicalName='${n}')`,cd=new Set(["syncerror","duplicaterecord","mailboxtrackingfolder","userentityinstancedata","bulkdeletefailure","principalobjectattributeaccess","asyncoperation","processsession","fileattachment"]);function ud(n){return n.attributeType==="PartyList"?"is an activity party column, which is not supported":n.kind==="other"||n.attributeType==="Uniqueidentifier"?`is a ${n.attributeType||n.typeName} column, which cannot be exported or imported`:n.kind!=="file"&&n.kind!=="image"&&!n.validForCreate&&!n.validForUpdate?"cannot be written (the metadata permits no create and no update): Dataverse sets its value (a calculated, rollup or formula column, or a system column)":n.kind==="lookup"&&!n.targets.length?"is a lookup with no target table":null}async function Ca(n,e,t=null){let s=await n.request("GET",Pa(e),{params:[["$select","LogicalName,EntitySetName,PrimaryIdAttribute,PrimaryNameAttribute,PrimaryImageAttribute"],["$expand","Attributes($select=LogicalName,AttributeType,AttributeTypeName,IsValidForCreate,IsValidForUpdate,IsValidForRead,AttributeOf,IsCustomAttribute),Keys($select=KeyAttributes,EntityKeyIndexStatus),ManyToOneRelationships($select=SchemaName,ReferencingAttribute,ReferencedEntity,ReferencingEntityNavigationPropertyName),OneToManyRelationships($select=SchemaName,ReferencingEntity,CascadeConfiguration),ManyToManyRelationships($select=SchemaName,Entity1LogicalName,Entity2LogicalName,IntersectEntityName,Entity1IntersectAttribute,Entity2IntersectAttribute,Entity1NavigationPropertyName,Entity2NavigationPropertyName)"]],check:!1});if(s.status===404)return null;if(s.status>=400)throw n.client.service.error(s);let i=s.json(),r=new Map;for(let u of i.Attributes??[]){let f=String(u.AttributeType??""),h=String(u.AttributeTypeName?.Value??"");r.set(u.LogicalName,{name:u.LogicalName,kind:ad(f,h),attributeType:f,typeName:h,validForCreate:!!u.IsValidForCreate,validForUpdate:!!u.IsValidForUpdate,validForRead:u.IsValidForRead!==!1,custom:!!u.IsCustomAttribute,attributeOf:u.AttributeOf??null,targets:[],navigation:new Map,options:new Map,stateOf:new Map,primaryImage:!1,fullImage:!1,dateOnly:!1})}for(let u of i.ManyToOneRelationships??[]){let f=r.get(u.ReferencingAttribute);if(!f)continue;let h=u.ReferencingEntityNavigationPropertyName;h&&!f.navigation.has(u.ReferencedEntity)&&f.navigation.set(u.ReferencedEntity,h)}let o=new Map;for(let u of i.ManyToManyRelationships??[])o.set(String(u.SchemaName).toLowerCase(),{schemaName:u.SchemaName,entity1:u.Entity1LogicalName,entity2:u.Entity2LogicalName,intersect:u.IntersectEntityName,attr1:u.Entity1IntersectAttribute,attr2:u.Entity2IntersectAttribute,nav1:u.Entity1NavigationPropertyName,nav2:u.Entity2NavigationPropertyName});let a=(i.OneToManyRelationships??[]).filter(u=>u.CascadeConfiguration?.Delete==="Cascade"&&u.ReferencingEntity!==e).filter(u=>!cd.has(String(u.ReferencingEntity))).map(u=>String(u.SchemaName)).sort(),l=(i.Keys??[]).filter(u=>u.EntityKeyIndexStatus==="Active").map(u=>u.KeyAttributes??[]),c={table:e,entitySet:i.EntitySetName,primaryId:i.PrimaryIdAttribute,primaryName:i.PrimaryNameAttribute??null,primaryImage:i.PrimaryImageAttribute??null,columns:r,keys:l,manyToMany:o,cascades:a,bulkCreate:!0,bulkUpdate:!0};return await fd(n,c,t),c}async function fd(n,e,t){let s=c=>t===null||t.has(c.name),i=[...e.columns.values()].filter(s),r=c=>i.some(c),o=c=>`${Pa(e.table)}/Attributes/Microsoft.Dynamics.CRM.${c}`,a=[];r(c=>c.kind==="lookup")&&a.push(async()=>{for(let c of(await n.getJson(o("LookupAttributeMetadata"),[["$select","LogicalName,Targets"]])).value??[]){let u=e.columns.get(c.LogicalName);u&&(u.targets=(c.Targets??[]).slice())}});let l=async(c,u)=>{let f=u?"OptionSet($select=Options),GlobalOptionSet($select=Options)":"OptionSet($select=Options)";for(let h of(await n.getJson(o(c),[["$select","LogicalName"],["$expand",f]])).value??[]){let m=e.columns.get(h.LogicalName);if(!m)continue;let w=h.OptionSet??h.GlobalOptionSet;for(let d of w?.Options??[]){let p=Number(d.Value);m.options.set(p,ld(d.Label)??String(p)),d.State!==void 0&&d.State!==null&&m.stateOf.set(p,Number(d.State)),d.DefaultStatus!==void 0&&d.DefaultStatus!==null&&m.stateOf.set(p,Number(d.DefaultStatus))}}};r(c=>c.attributeType==="Picklist")&&a.push(()=>l("PicklistAttributeMetadata",!0)),r(c=>c.kind==="choices")&&a.push(()=>l("MultiSelectPicklistAttributeMetadata",!0)),e.columns.has("statecode")&&(a.push(()=>l("StateAttributeMetadata",!1)),a.push(()=>l("StatusAttributeMetadata",!1))),r(c=>c.kind==="datetime")&&a.push(async()=>{for(let c of(await n.getJson(o("DateTimeAttributeMetadata"),[["$select","LogicalName,Format"]])).value??[]){let u=e.columns.get(c.LogicalName);u&&c.Format==="DateOnly"&&(u.kind="date",u.dateOnly=!0)}}),r(c=>c.kind==="image")&&a.push(async()=>{for(let c of(await n.getJson(o("ImageAttributeMetadata"),[["$select","LogicalName,CanStoreFullImage,IsPrimaryImage"]])).value??[]){let u=e.columns.get(c.LogicalName);u&&(u.fullImage=!!c.CanStoreFullImage,u.primaryImage=!!c.IsPrimaryImage)}}),await oi(a,4,c=>c())}async function hd(n,e){if(!e.length)return;let t=[...new Set(e.map(r=>r.table))],s=new Set,i=new Set;for(let r=0;r<t.length;r+=25){let o=t.slice(r,r+25).map(l=>`primaryobjecttypecode eq ${hi(l)}`).join(" or "),a=await n.rows("sdkmessagefilters",[["$select","primaryobjecttypecode"],["$expand","sdkmessageid($select=name)"],["$filter",`(sdkmessageid/name eq 'CreateMultiple' or sdkmessageid/name eq 'UpdateMultiple') and (${o})`]],!1);for(let l of a){let c=l.sdkmessageid?.name;c==="CreateMultiple"&&s.add(l.primaryobjecttypecode),c==="UpdateMultiple"&&i.add(l.primaryobjecttypecode)}}for(let r of e)r.bulkCreate=s.has(r.table),r.bulkUpdate=i.has(r.table)}var qa=class{constructor(e,t){this.dv=e;this.schema=t}tables=new Map;extra=new Map;meta(e){let t=this.tables.get(e);if(!t)throw new Error(`no metadata for ${e}`);return t}async other(e){let t=this.tables.get(e);if(t)return t;let s=this.extra.get(e);return s||(s=Ca(this.dv,e,new Set),this.extra.set(e,s)),s}async load(){let e=await oi(this.schema.tables,4,async s=>{let i=new Set([...s.columns.map(r=>r.name),"statecode","statuscode"]);return[s,await Ca(this.dv,s.table,i)]}),t=e.filter(([,s])=>!s).map(([s])=>`${s.file}: the environment has no table '${s.table}'`);if(t.length)throw Sn("not_found","the environment does not have each table of the schema",t);for(let[s,i]of e)this.tables.set(s.table,i);await hd(this.dv,[...this.tables.values()]),this.check()}check(){let e=[],t=[];for(let s of this.schema.tables){let i=this.meta(s.table);s.match&&(s.match.length!==1||s.match[0]!==i.primaryId)&&t.push(`${s.file}: match: only the primary key ('${i.primaryId}') is supported; a record is identified by its GUID (remove match, or write [${i.primaryId}])`);for(let o of s.columns){let a=i.columns.get(o.name);if(!a){e.push(`${s.file}: the table has no column '${o.name}'`);continue}if(o.name===i.primaryId){t.push(`${s.file}: '${o.name}' is the primary key; each record has it, so do not put it in columns`);continue}let l=ud(a);l&&t.push(`${s.file}: '${o.name}' ${l}; remove it from the schema file`)}let r=[];s.files.name&&r.push(["files.name",s.files.name]);for(let o of s.columns){if(!o.file)continue;let a=i.columns.get(o.name);a&&a.kind!=="file"&&a.kind!=="image"&&!$a(s.table,o.name)&&t.push(`${s.file}: '${o.name}' has file, but it is not a file, image or base64 column`),r.push([`${o.name}.file`,o.file])}for(let[o,a]of r)for(let l of Sa(a)){let c=`{${l.column}${l.name?".name":""}}`;l.column!==i.primaryId&&!s.columns.some(u=>u.name===l.column)?t.push(`${s.file}: ${o}: ${c} needs '${l.column}' in columns`):l.name&&i.columns.get(l.column)?.kind!=="lookup"&&t.push(`${s.file}: ${o}: ${c}: '${l.column}' is not a lookup`)}s.delete.action==="deactivate"&&!i.columns.has("statecode")&&t.push(`${s.file}: delete.action is deactivate, but the table has no statecode`);for(let o of s.relationships){let a=i.manyToMany.get(o.name.toLowerCase());if(!a){e.push(`${s.file}: '${s.table}' has no many-to-many relationship '${o.name}'`);continue}for(let l of[a.entity1,a.entity2])this.schema.byName.get(l)||t.push(`${s.file}: the relationship '${o.name}' needs a schema file for '${l}'`)}}if(t.length)throw W("schema_invalid","the schema is not valid for this environment",t);if(e.length)throw Sn("not_found","the environment does not have each column and relationship of the schema",e)}relationship(e){for(let t of this.tables.values()){let s=t.manyToMany.get(e.toLowerCase());if(s)return s}throw new Error(`no relationship ${e}`)}dataTables(){return this.schema.tables}};import{existsSync as dd,readdirSync as pd,readFileSync as md,statSync as gd}from"node:fs";import{join as Ma}from"node:path";var yd=["table","record"],Ia=["upsert","create"],Da=["clear","ignore"],_a=["off","manifest","mirror"],bd=["delete","deactivate"],Ra=["error","skip"],wd=["none","sync","async","all"],Sd=["filter","link-entity"],kd=["attribute","all-attributes","order"];function vd(n,e,t=!1){let s;try{s=pi(`<ppdo-filter>${n}</ppdo-filter>`)}catch(a){throw a instanceof di?new Error(`is not valid XML (${a.message})`):a}let i=s.children,r=i.length===1&&i[0].tag==="fetch"?i[0]:null;if(r){let a=r.find("entity");if(!a)throw new Error("is a <fetch> with no <entity>");let l=a.get("name");if(l&&e&&l.toLowerCase()!==e.toLowerCase())throw new Error(`is a <fetch> for '${l}', not for '${e}'`);i=a.children.filter(c=>!kd.includes(c.tag))}let o=i.find(a=>!Sd.includes(a.tag));if(o)throw new Error(`can have <filter> and <link-entity> elements only, not <${o.tag}>`);return t?i.map(a=>(Ua(a,0),yn(a))).join(`
149
+ `):i.map(a=>yn(a)).join("")}var Ba=n=>!n||!n.trim();function Ua(n,e){if(!n.children.length)return;let t=`
150
+ `+" ".repeat(e+1);Ba(n.text)&&(n.text=t),n.children.forEach((s,i)=>{Ua(s,e+1),Ba(s.tail)&&(s.tail=i===n.children.length-1?`
151
+ `+" ".repeat(e):t)})}var Nd=["version","table","match","columns","layout","filter","fetchXmlFilter","write","nullValues","delete","missingLookup","bypass","batchSize","files","relationships"],Ad=["name","write","missingLookup","nullValues","file"],$d=["name"],Ed=["mode","action"],Ld=["plugins","steps","flows"],Td=["name","delete"],Od=["mode"],Cd=/^[a-z][a-z0-9_]*$/,qd=/^[A-Za-z][A-Za-z0-9_]*$/,Pd=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,ai=class{constructor(e){this.file=e}list=[];add(e,t){this.list.push(`${this.file}: ${e?e+": ":""}${t}`)}},Fa={reference:"reference tables are removed: a lookup is always the GUID of its target; give an environment-specific GUID in an overlay",max:"the delete maximum is removed; --check lists each delete"};function ge(n,e,t,s){for(let i of Object.keys(t))s.includes(i)||n.add(e,Fa[i]?`'${i}': ${Fa[i]}`:`unknown property '${i}'`)}function xa(n,e,t){return t==="flag"||t==="log"?(n.add(e,`'${t}' is now 'manifest' (one of ${_a.join(", ")})`),"off"):G(n,e,t,_a,"off")}function G(n,e,t,s,i){return t==null?(t===null&&n.add(e,`must be one of ${s.join(", ")}`),i):typeof t!="string"||!s.includes(t)?(n.add(e,`must be one of ${s.join(", ")}`),i):t}function Md(n,e,t,s,i){if(t===void 0)return null;if(!(t instanceof U)||!/^-?\d+$/.test(t.text))return n.add(e,"must be an integer"),null;let r=Number(t.text);return r<s||i!==null&&r>i?(n.add(e,i===null?`must be ${s} or more`:`must be ${s} to ${i}`),null):r}function Id(n,e,t,s){return t===void 0?s:typeof t!="boolean"?(n.add(e,"must be true or false"),s):t}function gn(n,e,t){return typeof t!="string"||!Cd.test(t)?(n.add(e,"must be a logical name (lower case: a-z, 0-9 and _)"),null):t}function ja(n,e,t){if(t===void 0)return null;if(typeof t!="string"||!t.length)return n.add(e,'must be a file name pattern, for example "{$id}/{$filename}"'),null;let s=wa(t);for(let i of s.problems)n.add(e,i);return s.pattern}function Ka(n,e,t){return t===void 0?null:typeof t!="string"||!t.length?(n.add(e,"must be a text that is not empty"),null):t}function Dd(n,e,t){let s=new ai(e),i;try{i=dn(n,e)}catch(g){if(g instanceof K)return{schema:null,problems:[...g.problems.map(v=>`${e}: ${v}`)]};throw g}let r=B(i);if(!r)return s.add("","must be a map with version, table and columns"),{schema:null,problems:s.list};"version"in r?(!(r.version instanceof U)||r.version.text!=="1")&&s.add("version","must be 1"):s.add("","missing property 'version'"),"table"in r||s.add("","missing property 'table'");let o="table"in r?gn(s,"table",r.table):null;o&&t!==null&&o!==t&&s.add("table",`is '${o}', but the file name is '${t}.yaml'`);let a=null;if("match"in r){let g=r.match;!Array.isArray(g)||!g.length?s.add("match","must be a list of one or more column names"):(a=[],g.forEach((v,A)=>{let N=gn(s,`match[${A}]`,v);N&&a.includes(N)?s.add(`match[${A}]`,`'${N}' is in the list two times`):N&&a.push(N)}))}ge(s,"",r,Nd),"columns"in r||s.add("","missing property 'columns'"),"filter"in r&&"fetchXmlFilter"in r&&s.add("","use filter or fetchXmlFilter, not the two");let l=G(s,"nullValues",r.nullValues,Da,"clear"),c=G(s,"missingLookup",r.missingLookup,Ra,"error"),u=[];if("columns"in r){let g=r.columns;!Array.isArray(g)||!g.length?s.add("columns","must be a list of one or more columns"):g.forEach((v,A)=>{let N=`columns[${A}]`,y=null;if(typeof v=="string"){let E=gn(s,N,v);E&&(y={name:E,write:"upsert",missingLookup:c,nullValues:l,file:null})}else{let E=B(v);if(!E){s.add(N,"must be a column name or a map with name");return}ge(s,N,E,Ad),"name"in E||s.add(N,"missing property 'name'");let I="name"in E?gn(s,`${N}.name`,E.name):null,D=G(s,`${N}.write`,E.write,Ia,"upsert"),O=G(s,`${N}.missingLookup`,E.missingLookup,Ra,c),ot=G(s,`${N}.nullValues`,E.nullValues,Da,l),Ya=ja(s,`${N}.file`,E.file);I&&(y={name:I,write:D,missingLookup:O,nullValues:ot,file:Ya})}y&&(u.some(E=>E.name===y.name)?s.add(N,`'${y.name}' is in columns two times`):a?.includes(y.name)?s.add(N,`'${y.name}' is a match key column; do not repeat it in columns`):u.push(y))})}let f=G(s,"layout",r.layout,yd,"table"),h=Ka(s,"filter",r.filter),m=Ka(s,"fetchXmlFilter",r.fetchXmlFilter);if(m!==null)try{vd(m,o??"")}catch(g){s.add("fetchXmlFilter",g.message)}let w=G(s,"write",r.write,Ia,"upsert"),d={mode:"off",action:"delete"};if("delete"in r){let g=B(r.delete);g?(ge(s,"delete",g,Ed),d.mode=xa(s,"delete.mode",g.mode),d.action=G(s,"delete.action",g.action,bd,"delete")):s.add("delete","must be a map")}let p={plugins:"none",steps:[],flows:!1};if("bypass"in r){let g=B(r.bypass);if(!g)s.add("bypass","must be a map");else if(ge(s,"bypass",g,Ld),p.plugins=G(s,"bypass.plugins",g.plugins,wd,"none"),p.flows=Id(s,"bypass.flows",g.flows,!1),"steps"in g){let v=g.steps;Array.isArray(v)?v.forEach((A,N)=>{typeof A!="string"||!Pd.test(A)?s.add(`bypass.steps[${N}]`,"must be a plug-in step ID (a GUID)"):p.steps.includes(A.toLowerCase())?s.add(`bypass.steps[${N}]`,"is in the list two times"):p.steps.push(A.toLowerCase())}):s.add("bypass.steps","must be a list of plug-in step IDs")}}let S=Md(s,"batchSize",r.batchSize,1,1e3),k={name:null};if("files"in r){let g=B(r.files);g?(ge(s,"files",g,$d),k.name=ja(s,"files.name",g.name)):s.add("files","must be a map with name")}let $=[];if("relationships"in r){let g=r.relationships;Array.isArray(g)?g.forEach((v,A)=>{let N=`relationships[${A}]`,y=B(v);if(!y){s.add(N,"must be a map with name");return}ge(s,N,y,Td);let E=y.name;if(typeof E!="string"||!qd.test(E)){s.add(`${N}.name`,"must be the schema name of a many-to-many relationship");return}let I={mode:"off"};if("delete"in y){let D=B(y.delete);D?(ge(s,`${N}.delete`,D,Od),I.mode=xa(s,`${N}.delete.mode`,D.mode)):s.add(`${N}.delete`,"must be a map")}$.some(D=>D.name.toLowerCase()===E.toLowerCase())?s.add(N,`'${E}' is in the list two times`):$.push({name:E,owner:o??"",delete:I})}):s.add("relationships","must be a list")}return s.list.length||!o?{schema:null,problems:s.list}:{schema:{file:e,table:o,match:a,columns:u,layout:f,filter:h,fetchXmlFilter:m,write:w,nullValues:l,missingLookup:c,delete:d,bypass:p,batchSize:S,files:k,relationships:$},problems:[]}}function cg(n){let e=Ma(n,"schema");if(!dd(e)||!gd(e).isDirectory())throw W("schema_invalid",`${e} does not exist`,[],"run: ppdo-cli dv data init <folder> --table <name>");let t=pd(e).filter(o=>o.toLowerCase().endsWith(".yaml")).sort();if(!t.length)throw W("schema_invalid",`${e} has no schema file`,[],"run: ppdo-cli dv data init <folder> --table <name>");let s=[],i=[];for(let o of t){let a=`schema/${o}`,l=o.slice(0,-5);if(!o.endsWith(".yaml")){s.push(`${a}: the extension must be .yaml in lower case`);continue}let c=Dd(md(Ma(e,o),"utf8"),a,l);s.push(...c.problems),c.schema&&i.push(c.schema)}let r=new Map;for(let o of i)for(let a of o.relationships){let l=a.name.toLowerCase(),c=r.get(l);c?s.push(`${o.file}: the relationship '${a.name}' is also in schema/${c}.yaml; write it in one schema file only`):r.set(l,o.table)}if(s.length)throw W("schema_invalid","the schema is not valid",s);return{folder:n,tables:i,byName:new Map(i.map(o=>[o.table,o])),relationships:i.flatMap(o=>o.relationships)}}export{W as a,Rd as b,Sn as c,Bd as d,wm as e,wa as f,Sm as g,ka as h,U as i,cn as j,un as k,fn as l,Te as m,oa as n,im as o,K as p,dn as q,B as r,fa as s,Rh as t,ii as u,um as v,fm as w,hm as x,dm as y,pm as z,mm as A,da as B,gm as C,ym as D,Wh as E,Lm as F,Tm as G,Xh as H,Om as I,$a as J,Cm as K,qm as L,Qh as M,Pm as N,Mm as O,Im as P,Dm as Q,mn as R,xm as S,jm as T,Gm as U,Wm as V,Ta as W,oi as X,Oa as Y,ud as Z,Ca as _,qa as $,vd as aa,Cd as ba,cg as ca};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
+ import{a as q}from"./chunk-ZUXLC5VX.js";import{b as f,c as u,e as a,f as o,g as h,j as C,n as x,t as c,u as S,w as T,x as b,z as j}from"./chunk-BG2OIOSN.js";import{d as l,i as E}from"./chunk-FOEBNCSD.js";import{x as w}from"./chunk-BALEFXOL.js";import{b as p}from"./chunk-2IUXH534.js";import{e as R}from"./chunk-S4KF5Z3S.js";import{a as y,f as $}from"./chunk-WXOTXJNG.js";var P="name,operationtype,statecode,statuscode,message,friendlymessage,createdon,startedon,completedon",g=3,D=30,_=31,F=32,v={waiting:"statecode eq 0",suspended:"statecode eq 1",running:"statecode eq 2",succeeded:"statuscode eq 30",failed:"statuscode eq 31",canceled:"statuscode eq 32"};async function m(e,t,s){let n=await t.request("GET",`asyncoperations(${l(s)})`,{params:[["$select",P]],headers:{Prefer:`odata.include-annotations="${f}"`}});return A(h(n.json()))}function A(e){let t={id:o(e,"asyncoperationid"),name:o(e,"name"),operation:a(o(e,`operationtype${u}`),o(e,"operationtype")),state:a(o(e,`statecode${u}`),o(e,"statecode")),status:a(o(e,`statuscode${u}`),o(e,"statuscode")),statecode:o(e,"statecode"),statuscode:o(e,"statuscode"),message:a(o(e,"friendlymessage"),o(e,"message")),created:o(e,"createdon"),started:o(e,"startedon"),completed:o(e,"completedon")};return C(t)}async function B(e,t,s){return q(()=>m(e,t,s),n=>o(n,"statecode")===g,{timeout:e.timeout||3600,describe:n=>`job ${s}: ${r(o(n,"status"))}`,log:R})}function r(e){return e==null?"None":e===!0?"True":e===!1?"False":String(e)}function L(e,t=null){if(o(e,"statuscode")!==D){let s="status"in e?r(e.status):"failed";throw new y(`system job ${s.toLowerCase()}: ${r(a(o(e,"message"),"no message"))}`,{service:"dataverse",code:r(o(e,"statuscode")),...t!==null?{hint:t}:{}})}}async function z(e){let t=await c(e);await e.emit(await m(e,t,String(e.args.id)))}async function J(e){let t=await c(e),s=await B(e,t,String(e.args.id));await e.emit(s),L(s)}async function K(e){let t=e.args,s=await c(e),n=[];t.state&&n.push(v[String(t.state)]),t.name&&n.push(E("name",String(t.name))),typeof t.type=="number"&&n.push(`operationtype eq ${t.type}`),t.since&&n.push(`createdon ge ${w(String(t.since))}`);let i=[["$select",P],["$orderby","createdon desc"]];n.length&&i.push(["$filter",n.join(" and ")]),p(e,s,"GET","asyncoperations",null);let[d]=await j(e,s,"asyncoperations",i,b(`odata.include-annotations="${f}"`),x(t),"jobs");await e.emit(d.map(A))}async function Q(e){let t=await c(e),s=l(String(e.args.id)),n=`asyncoperations(${s})`,i=T({statecode:g,statuscode:F});p(e,t,"PATCH",n,i);let d=await t.lookups(()=>m(e,t,s));if(o(d,"statecode")===g)throw new $(`job ${s} has already finished (${r(o(d,"status"))})`,{service:"dataverse"});await S(e,t,"PATCH",n,{body:i,headers:{"If-Match":"*"}}),await e.emit(await m(e,t,s))}export{P as a,g as b,D as c,_ as d,F as e,v as f,m as g,A as h,B as i,L as j,z as k,J as l,K as m,Q as n};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a as h}from"./chunk-UCTMKA2J.js";import{w as f,y as p}from"./chunk-BALEFXOL.js";import{b as l}from"./chunk-5SBBTR3Y.js";import{b as d}from"./chunk-WXOTXJNG.js";import{statSync as g}from"node:fs";function v(t){let e={};for(let[n,o]of f(t,"--header"))e[n]=o;return e}function b(t){if(Object.keys(t).some(e=>["authorization","host"].includes(e.toLowerCase())))throw new d("--header cannot set Authorization or Host")}function x(t,e){if(!(t===null||Object.keys(e).some(n=>n.toLowerCase()==="content-type")))try{h(t.toString("utf8"))}catch(n){throw new d(`--body is not valid JSON: ${n.message}`,{hint:"pass a file with --body @file.json"})}}async function j(t,e,n){if(e.savedTo)await t.emit({status:e.status,saved:e.savedTo,bytes:g(e.savedTo).size});else if(e.body.length)if(e.isJson)await t.emit(e.json());else{let o=e.text;process.stdout.write(o.endsWith(`
2
+ import{a as h}from"./chunk-UCTMKA2J.js";import{w as f,y as p}from"./chunk-BALEFXOL.js";import{b as l}from"./chunk-2IUXH534.js";import{b as d}from"./chunk-WXOTXJNG.js";import{statSync as g}from"node:fs";function v(t){let e={};for(let[n,o]of f(t,"--header"))e[n]=o;return e}function b(t){if(Object.keys(t).some(e=>["authorization","host"].includes(e.toLowerCase())))throw new d("--header cannot set Authorization or Host")}function x(t,e){if(!(t===null||Object.keys(e).some(n=>n.toLowerCase()==="content-type")))try{h(t.toString("utf8"))}catch(n){throw new d(`--body is not valid JSON: ${n.message}`,{hint:"pass a file with --body @file.json"})}}async function j(t,e,n){if(e.savedTo)await t.emit({status:e.status,saved:e.savedTo,bytes:g(e.savedTo).size});else if(e.body.length)if(e.isJson)await t.emit(e.json());else{let o=e.text;process.stdout.write(o.endsWith(`
3
3
  `)?o:o+`
4
- `)}else{let o={status:e.status};if(n){let a=e.header("odata-entityid")||e.header("location");a&&(o.entity_id=a)}await t.emit(o)}}async function S(t){let e=t.args,n=String(e.method),o=String(e.path),a=typeof e.limit=="number"?e.limit:null,s=v(e.header);b(s);let r=Object.entries(s).filter(([i])=>i.toLowerCase()==="prefer").map(([,i])=>i);s=Object.fromEntries(Object.entries(s).filter(([i])=>i.toLowerCase()!=="prefer")),e.annotations&&r.push('odata.include-annotations="*"'),e.paginate&&a&&a<5e3&&!r.some(i=>i.includes("maxpagesize"))&&r.push(`odata.maxpagesize=${a}`),r.length&&(s.Prefer=r.join(", "));let c=p(typeof e.body=="string"?e.body:null);x(c,s);let m=await t.client("dataverse");l(t,m,n,o,c);let u=f(e.param,"--param");if(e.paginate){if(n!=="GET")throw new d("--paginate only applies to GET");let i=await import("./service-4PIAYFYF.js");await t.emitStream(m.paginate(o,{params:u,headers:s,limit:a,nextLink:i.nextLink,items:i.items}));return}let y=typeof e.save=="string"?e.save:null,w=await m.request(n,o,{params:u,headers:s,body:c,saveTo:y});await j(t,w,!0)}export{v as a,b,x as c,j as d,S as e};
4
+ `)}else{let o={status:e.status};if(n){let a=e.header("odata-entityid")||e.header("location");a&&(o.entity_id=a)}await t.emit(o)}}async function S(t){let e=t.args,n=String(e.method),o=String(e.path),a=typeof e.limit=="number"?e.limit:null,s=v(e.header);b(s);let r=Object.entries(s).filter(([i])=>i.toLowerCase()==="prefer").map(([,i])=>i);s=Object.fromEntries(Object.entries(s).filter(([i])=>i.toLowerCase()!=="prefer")),e.annotations&&r.push('odata.include-annotations="*"'),e.paginate&&a&&a<5e3&&!r.some(i=>i.includes("maxpagesize"))&&r.push(`odata.maxpagesize=${a}`),r.length&&(s.Prefer=r.join(", "));let c=p(typeof e.body=="string"?e.body:null);x(c,s);let m=await t.client("dataverse");l(t,m,n,o,c);let u=f(e.param,"--param");if(e.paginate){if(n!=="GET")throw new d("--paginate only applies to GET");let i=await import("./service-HASXLUGE.js");await t.emitStream(m.paginate(o,{params:u,headers:s,limit:a,nextLink:i.nextLink,items:i.items}));return}let y=typeof e.save=="string"?e.save:null,w=await m.request(n,o,{params:u,headers:s,body:c,saveTo:y});await j(t,w,!0)}export{v as a,b,x as c,j as d,S as e};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{b as d,c as a}from"./chunk-4S5ETLH4.js";import{c,g as u}from"./chunk-J4R6QXW7.js";var f="/api/data/v9.2/",g=/\r?\n\s+at /,y="\u2026";function p(e,n=1e3){if(!e)return e;let t=g.exec(e);t&&(e=e.slice(0,t.index)),e=e.trim();let r=[...e];return r.length<=n?e:r.slice(0,n-1).join("")+y}function s(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var h=class extends d{name="dataverse";origin;host;constructor(n){super(),this.origin=(n.url??"").replace(/\/+$/,""),this.host=u(this.origin).host}scope(){return this.origin+"/.default"}url(n,t){let r;return n.includes("://")?r=n:n.startsWith("/")?r=this.origin+n:r=this.origin+f+n,t&&t.length&&(r+=(r.includes("?")?"&":"?")+c(t,"$'(),/:@*")),r}allowed(n){let t=u(n);return t.scheme==="https"&&!!t.host&&t.host===this.host}defaultHeaders(){return{Accept:"application/json","OData-MaxVersion":"4.0","OData-Version":"4.0"}}requestId(n){return n.header("x-ms-service-request-id")||n.header("req_id")}error(n){let t=null,r=null,l=null;if(n.body.length)try{let i=n.json(),o=s(i)&&s(i.error)?i.error:{};t=typeof o.code=="string"?o.code:null,r=p(typeof o.message=="string"?o.message:null)}catch{r=n.text.trim().slice(0,500)||null}if(n.status===401){let i=n.header("401_error_reason");r=r||(i?`unauthorised: ${i}`:"unauthorised"),l="the token was rejected; check the identity's tenant, then run: ppdo-cli auth login <identity>";let o=/login\.microsoftonline\.com\/([0-9a-fA-F-]{36})\//.exec(n.header("www-authenticate")??"");o&&(l=`the token was rejected; this environment's tenant is ${o[1]}. Check the identity's tenant, then run: ppdo-cli auth login <identity>`)}return a(this.name,n,t,r,this.requestId(n),l)}};function k(e){let n=e.isJson?e.json():null;if(!s(n))return null;let t=n["@odata.nextLink"];return typeof t=="string"&&t?t:null}function j(e){let n=e.isJson?e.json():null;return s(n)&&Array.isArray(n.value)?n.value:n!=null?[n]:[]}export{f as a,p as b,h as c,k as d,j as e};
2
+ import{b as d,c as a}from"./chunk-GY6BUIDP.js";import{c,g as u}from"./chunk-J4R6QXW7.js";var f="/api/data/v9.2/",g=/\r?\n\s+at /,y="\u2026";function p(e,n=1e3){if(!e)return e;let t=g.exec(e);t&&(e=e.slice(0,t.index)),e=e.trim();let r=[...e];return r.length<=n?e:r.slice(0,n-1).join("")+y}function s(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var h=class extends d{name="dataverse";origin;host;constructor(n){super(),this.origin=(n.url??"").replace(/\/+$/,""),this.host=u(this.origin).host}scope(){return this.origin+"/.default"}url(n,t){let r;return n.includes("://")?r=n:n.startsWith("/")?r=this.origin+n:r=this.origin+f+n,t&&t.length&&(r+=(r.includes("?")?"&":"?")+c(t,"$'(),/:@*")),r}allowed(n){let t=u(n);return t.scheme==="https"&&!!t.host&&t.host===this.host}defaultHeaders(){return{Accept:"application/json","OData-MaxVersion":"4.0","OData-Version":"4.0"}}requestId(n){return n.header("x-ms-service-request-id")||n.header("req_id")}error(n){let t=null,r=null,l=null;if(n.body.length)try{let i=n.json(),o=s(i)&&s(i.error)?i.error:{};t=typeof o.code=="string"?o.code:null,r=p(typeof o.message=="string"?o.message:null)}catch{r=n.text.trim().slice(0,500)||null}if(n.status===401){let i=n.header("401_error_reason");r=r||(i?`unauthorised: ${i}`:"unauthorised"),l="the token was rejected; check the identity's tenant, then run: ppdo-cli auth login <identity>";let o=/login\.microsoftonline\.com\/([0-9a-fA-F-]{36})\//.exec(n.header("www-authenticate")??"");o&&(l=`the token was rejected; this environment's tenant is ${o[1]}. Check the identity's tenant, then run: ppdo-cli auth login <identity>`)}return a(this.name,n,t,r,this.requestId(n),l)}};function k(e){let n=e.isJson?e.json():null;if(!s(n))return null;let t=n["@odata.nextLink"];return typeof t=="string"&&t?t:null}function j(e){let n=e.isJson?e.json():null;return s(n)&&Array.isArray(n.value)?n.value:n!=null?[n]:[]}export{f as a,p as b,h as c,k as d,j as e};
@@ -0,0 +1,5 @@
1
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
+ import{g as m}from"./chunk-WXOTXJNG.js";var p={stdin:process.stdin,stderr:process.stderr};function h(e=p){return!!(e.stdin.isTTY&&e.stderr.isTTY)}function P(e){return new Promise((s,t)=>{let n="",i=r=>{e.off("data",f),e.off("end",c),e.off("error",o),e.pause(),s(r.replace(/\r$/,""))},f=r=>{n+=r.toString();let l=n.indexOf(`
3
+ `);l>=0&&i(n.slice(0,l))},c=()=>i(n),o=r=>{e.off("data",f),e.off("end",c),t(r)};e.on("data",f),e.once("end",c),e.once("error",o),e.resume()})}async function S(e,s,t=p){if(!h(t))throw new m(`${s} needs a person at a terminal`,{hint:"ask the user to run this command themselves in a terminal"});return t.stderr.write(e),(await P(t.stdin)).trim()}function E(e,s=p){let{stdin:t,stderr:n}=s;if(!h(s)||typeof t.setRawMode!="function")return Promise.reject(new m("this needs a person typing at a terminal",{hint:"ask the user to run this command themselves in a terminal"}));let i=t.setRawMode.bind(t);return new Promise((f,c)=>{n.write(e);let o="",r=!1,l=t.isRaw??!1;i(!0),t.resume(),"setEncoding"in t&&typeof t.setEncoding=="function"&&t.setEncoding("utf8");let w=u=>{try{i(l)}finally{t.pause(),t.off("data",g),n.write(`
4
+ `),u?c(u):f(o)}},g=u=>{for(let d of u.toString()){let a=d.charCodeAt(0);if(r){/[A-Za-z~]/.test(d)&&(r=!1);continue}if(a===27){r=!0;continue}if(d==="\r"||d===`
5
+ `||a===4)return w();if(a===3)return w(Object.assign(new Error("interrupted"),{code:"SIGINT"}));a===8||a===127?o=o.slice(0,-1):a>=32&&(o+=d)}};t.on("data",g)})}export{h as a,P as b,S as c,E as d};