codeassembly-guidance 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.meta/changelog.json +261 -0
- package/CHANGELOG.md +62 -0
- package/README.md +47 -29
- package/bin/codeassembly-validate-preferences.js +2 -8
- package/content/_partials/diff-audit-checklist.md +1 -0
- package/content/_partials/plain-speech.md +2 -2
- package/content/_partials/ticket-assessment.md +3 -3
- package/content/codeassembly-content.yaml +6 -0
- package/content/collections/recommended.md +6 -0
- package/content/collections/williamthorsen.md +2 -1
- package/content/guidance/rulebooks/accessibility-conventions.md +6 -3
- package/content/guidance/rulebooks/cross-repo-migration-conventions.md +27 -0
- package/content/guidance/rulebooks/ui-copy-conventions.md +2 -2
- package/content/guidance/rulebooks/visual-design-conventions.md +58 -0
- package/content/guidance/rulebooks/williamthorsen-collaboration-preferences.md +3 -18
- package/content/guidance/rulebooks/williamthorsen-ticketing-preferences.md +6 -2
- package/content/guidance/rulebooks/williamthorsen-visual-design-preferences.md +14 -0
- package/content/guidance/rulebooks/williamthorsen-workflow-preferences.md +5 -3
- package/content/guidance/rulebooks/williamthorsen-writing-preferences.md +5 -20
- package/content/guidance/shared/AGENTS.md +2 -3
- package/content/scripts/README.md +1 -1
- package/content/scripts/check-branch-currency.mjs +7 -7
- package/content/scripts/check-prose.mjs +38 -38
- package/content/scripts/describe-change.mjs +32 -32
- package/content/scripts/manage-jira-ticket.mjs +148 -146
- package/content/scripts/validate-preferences.mjs +9 -9
- package/content/skills/_data/artifact-conventions.md +3 -3
- package/content/skills/_data/entry-points.md +1 -1
- package/content/skills/_data/reduced-object-relatives.md +15 -0
- package/content/skills/_data/spike-conventions.md +9 -2
- package/content/skills/_data/ticket-evaluation.md +3 -0
- package/content/skills/_partials/implementation-order-list.md +4 -4
- package/content/skills/_partials/merge-settled-criterion.md +1 -0
- package/content/skills/_partials/plan-template.md +1 -1
- package/content/skills/_partials/resolve-plan-and-ticket.md +2 -2
- package/content/skills/_partials/split-ticket-create.md +1 -1
- package/content/skills/_partials/ticket-criteria-conventions.md +2 -0
- package/content/skills/align-ticket-with-implementation/SKILL.md +2 -2
- package/content/skills/analyze-performance/SKILL.md +1 -1
- package/content/skills/assess-code-health/SKILL.md +4 -4
- package/content/skills/assess-code-health/assess-code-health.mjs +20 -20
- package/content/skills/assess-ticket/SKILL.md +3 -1
- package/content/skills/assess-ticket/next-steps-after-assessment.md +11 -14
- package/content/skills/assess-usability/SKILL.md +4 -4
- package/content/skills/capture-event/capture-event.mjs +30 -30
- package/content/skills/capture-lede-decision/SKILL.md +1 -1
- package/content/skills/capture-lede-decision/capture-lede-decision.mjs +37 -37
- package/content/skills/collaborate/SKILL.md +1 -1
- package/content/skills/condense-branch/SKILL.md +18 -36
- package/content/skills/condense-branch/condense-branch.mjs +17 -0
- package/content/skills/create-bitbucket-pr/SKILL.md +9 -11
- package/content/skills/create-commit/SKILL.md +1 -1
- package/content/skills/create-devlog/SKILL.md +4 -4
- package/content/skills/create-gh-pr/SKILL.md +9 -11
- package/content/skills/create-pr/SKILL.md +9 -11
- package/content/skills/create-ticket/SKILL.md +22 -15
- package/content/skills/curate-feedback/SKILL.md +2 -2
- package/content/skills/derive-session-context/derive-session-context.mjs +103 -103
- package/content/skills/design-and-plan/SKILL.md +6 -6
- package/content/skills/groom-backlog/groom-backlog.mjs +15 -15
- package/content/skills/implement-plan/SKILL.md +1 -1
- package/content/skills/implementation-order/implementation-order.mjs +29 -29
- package/content/skills/index-prototypes/SKILL.md +2 -2
- package/content/skills/investigate-spike/SKILL.md +3 -3
- package/content/skills/list-gh-progress-items/SKILL.md +36 -0
- package/content/skills/list-gh-progress-items/list-gh-progress-items.mjs +68 -0
- package/content/skills/list-implementation-order/SKILL.md +2 -2
- package/content/skills/merge-bb-pr/SKILL.md +9 -11
- package/content/skills/merge-gh-pr/SKILL.md +9 -11
- package/content/skills/merge-pr/SKILL.md +10 -12
- package/content/skills/plan/SKILL.md +2 -2
- package/content/skills/prepare-prototype-brief/SKILL.md +2 -2
- package/content/skills/pull-from-backlog/pull-from-backlog.mjs +22 -22
- package/content/skills/refine-plan/SKILL.md +3 -3
- package/content/skills/refine-prototype/SKILL.md +2 -1
- package/content/skills/respond-to-review/SKILL.md +4 -4
- package/content/skills/review-bb-pr/SKILL.md +1 -2
- package/content/skills/review-branch/SKILL.md +18 -13
- package/content/skills/review-criteria/SKILL.md +1 -1
- package/content/skills/review-gh-pr/SKILL.md +1 -2
- package/content/skills/review-pr/SKILL.md +2 -3
- package/content/skills/revise-prose/revise-prose.mjs +52 -52
- package/content/skills/save-artifact/SKILL.md +4 -6
- package/content/skills/save-plan/SKILL.md +2 -2
- package/content/skills/start-ticket/SKILL.md +1 -1
- package/content/skills/streamline-guidance/streamline-guidance.mjs +24 -24
- package/content/skills/summarize-change/SKILL.md +5 -4
- package/content/skills/summarize-chat/SKILL.md +2 -2
- package/content/skills/triage-feedback/SKILL.md +2 -2
- package/content/skills/triage-spike-findings/SKILL.md +26 -22
- package/content/skills/triage-spike-findings/triage-spike-findings.mjs +19 -19
- package/content/skills/update-project-guidance/SKILL.md +1 -1
- package/content/skills/wrap-up/SKILL.md +4 -4
- package/content/skills/write-progress-report/SKILL.md +111 -0
- package/content/skills/write-progress-report/write-progress-report.mjs +150 -0
- package/content/subagents/disposition-challenger.md +7 -6
- package/content/subagents/entry-drafter.md +2 -0
- package/content/subagents/usability-assessor.md +3 -2
- package/package.json +11 -10
- package/schemas/preferences.v1.json +9 -1
- package/schemas/work-types.v1.json +1 -1
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
import { createRequire as __cjsCreateRequire } from 'node:module';
|
|
2
2
|
const require = __cjsCreateRequire(import.meta.url);
|
|
3
|
-
var
|
|
4
|
-
`)}};
|
|
5
|
-
`)?
|
|
3
|
+
var Ml=Object.create;var jn=Object.defineProperty;var jl=Object.getOwnPropertyDescriptor;var Dl=Object.getOwnPropertyNames;var Bl=Object.getPrototypeOf,Fl=Object.prototype.hasOwnProperty;var o=(n,e)=>jn(n,"name",{value:e,configurable:!0}),Tt=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var b=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var Kl=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Dl(e))!Fl.call(n,r)&&r!==t&&jn(n,r,{get:()=>e[r],enumerable:!(s=jl(e,r))||s.enumerable});return n};var Ul=(n,e,t)=>(t=n!=null?Ml(Bl(n)):{},Kl(e||!n||!n.__esModule?jn(t,"default",{value:n,enumerable:!0}):t,n));var N=b(R=>{"use strict";var Dn=Symbol.for("yaml.alias"),zr=Symbol.for("yaml.document"),At=Symbol.for("yaml.map"),Gr=Symbol.for("yaml.pair"),Bn=Symbol.for("yaml.scalar"),xt=Symbol.for("yaml.seq"),Q=Symbol.for("yaml.node.type"),Jl=o(n=>!!n&&typeof n=="object"&&n[Q]===Dn,"isAlias"),Vl=o(n=>!!n&&typeof n=="object"&&n[Q]===zr,"isDocument"),Wl=o(n=>!!n&&typeof n=="object"&&n[Q]===At,"isMap"),Yl=o(n=>!!n&&typeof n=="object"&&n[Q]===Gr,"isPair"),Qr=o(n=>!!n&&typeof n=="object"&&n[Q]===Bn,"isScalar"),zl=o(n=>!!n&&typeof n=="object"&&n[Q]===xt,"isSeq");function Hr(n){if(n&&typeof n=="object")switch(n[Q]){case At:case xt:return!0}return!1}o(Hr,"isCollection");function Gl(n){if(n&&typeof n=="object")switch(n[Q]){case Dn:case At:case Bn:case xt:return!0}return!1}o(Gl,"isNode");var Ql=o(n=>(Qr(n)||Hr(n))&&!!n.anchor,"hasAnchor");R.ALIAS=Dn;R.DOC=zr;R.MAP=At;R.NODE_TYPE=Q;R.PAIR=Gr;R.SCALAR=Bn;R.SEQ=xt;R.hasAnchor=Ql;R.isAlias=Jl;R.isCollection=Hr;R.isDocument=Vl;R.isMap=Wl;R.isNode=Gl;R.isPair=Yl;R.isScalar=Qr;R.isSeq=zl});var De=b(Fn=>{"use strict";var _=N(),j=Symbol("break visit"),Xr=Symbol("skip children"),W=Symbol("remove node");function Nt(n,e){let t=Zr(e);_.isDocument(n)?Ae(null,n.contents,t,Object.freeze([n]))===W&&(n.contents=null):Ae(null,n,t,Object.freeze([]))}o(Nt,"visit");Nt.BREAK=j;Nt.SKIP=Xr;Nt.REMOVE=W;function Ae(n,e,t,s){let r=ei(n,e,t,s);if(_.isNode(r)||_.isPair(r))return ti(n,s,r),Ae(n,r,t,s);if(typeof r!="symbol"){if(_.isCollection(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let a=Ae(i,e.items[i],t,s);if(typeof a=="number")i=a-1;else{if(a===j)return j;a===W&&(e.items.splice(i,1),i-=1)}}}else if(_.isPair(e)){s=Object.freeze(s.concat(e));let i=Ae("key",e.key,t,s);if(i===j)return j;i===W&&(e.key=null);let a=Ae("value",e.value,t,s);if(a===j)return j;a===W&&(e.value=null)}}return r}o(Ae,"visit_");async function Et(n,e){let t=Zr(e);_.isDocument(n)?await xe(null,n.contents,t,Object.freeze([n]))===W&&(n.contents=null):await xe(null,n,t,Object.freeze([]))}o(Et,"visitAsync");Et.BREAK=j;Et.SKIP=Xr;Et.REMOVE=W;async function xe(n,e,t,s){let r=await ei(n,e,t,s);if(_.isNode(r)||_.isPair(r))return ti(n,s,r),xe(n,r,t,s);if(typeof r!="symbol"){if(_.isCollection(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let a=await xe(i,e.items[i],t,s);if(typeof a=="number")i=a-1;else{if(a===j)return j;a===W&&(e.items.splice(i,1),i-=1)}}}else if(_.isPair(e)){s=Object.freeze(s.concat(e));let i=await xe("key",e.key,t,s);if(i===j)return j;i===W&&(e.key=null);let a=await xe("value",e.value,t,s);if(a===j)return j;a===W&&(e.value=null)}}return r}o(xe,"visitAsync_");function Zr(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}o(Zr,"initVisitor");function ei(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(_.isMap(e))return t.Map?.(n,e,s);if(_.isSeq(e))return t.Seq?.(n,e,s);if(_.isPair(e))return t.Pair?.(n,e,s);if(_.isScalar(e))return t.Scalar?.(n,e,s);if(_.isAlias(e))return t.Alias?.(n,e,s)}o(ei,"callVisitor");function ti(n,e,t){let s=e[e.length-1];if(_.isCollection(s))s.items[n]=t;else if(_.isPair(s))n==="key"?s.key=t:s.value=t;else if(_.isDocument(s))s.contents=t;else{let r=_.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}o(ti,"replaceNode");Fn.visit=Nt;Fn.visitAsync=Et});var Kn=b(si=>{"use strict";var ni=N(),Hl=De(),Xl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Zl=o(n=>n.replace(/[!,[\]{}]/g,e=>Xl[e]),"escapeTagName"),Be=class n{static{o(this,"Directives")}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]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[i,a]=s;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let a=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,a),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(a){return t(String(a)),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+Zl(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),r;if(e&&s.length>0&&ni.isNode(e.contents)){let i={};Hl.visit(e.contents,(a,l)=>{ni.isNode(l)&&l.tag&&(i[l.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,a]of s)i==="!!"&&a==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
4
|
+
`)}};Be.defaultYaml={explicit:!1,version:"1.2"};Be.defaultTags={"!!":"tag:yaml.org,2002:"};si.Directives=Be});var Ot=b(Fe=>{"use strict";var ri=N(),ec=De();function tc(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}o(tc,"anchorIsValid");function ii(n){let e=new Set;return ec.visit(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}o(ii,"anchorNames");function ai(n,e){for(let t=1;;++t){let s=`${n}${t}`;if(!e.has(s))return s}}o(ai,"findNewAnchor");function nc(n,e){let t=[],s=new Map,r=null;return{onAnchor:o(i=>{t.push(i),r??(r=ii(n));let a=ai(e,r);return r.add(a),a},"onAnchor"),setAnchors:o(()=>{for(let i of t){let a=s.get(i);if(typeof a=="object"&&a.anchor&&(ri.isScalar(a.node)||ri.isCollection(a.node)))a.node.anchor=a.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},"setAnchors"),sourceObjects:s}}o(nc,"createNodeAnchors");Fe.anchorIsValid=tc;Fe.anchorNames=ii;Fe.createNodeAnchors=nc;Fe.findNewAnchor=ai});var Un=b(oi=>{"use strict";function Ke(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){let a=s[r],l=Ke(n,s,String(r),a);l===void 0?delete s[r]:l!==a&&(s[r]=l)}else if(s instanceof Map)for(let r of Array.from(s.keys())){let i=s.get(r),a=Ke(n,s,r,i);a===void 0?s.delete(r):a!==i&&s.set(r,a)}else if(s instanceof Set)for(let r of Array.from(s)){let i=Ke(n,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(let[r,i]of Object.entries(s)){let a=Ke(n,s,r,i);a===void 0?delete s[r]:a!==i&&(s[r]=a)}return n.call(e,t,s)}o(Ke,"applyReviver");oi.applyReviver=Ke});var ne=b(ci=>{"use strict";var sc=N();function li(n,e,t){if(Array.isArray(n))return n.map((s,r)=>li(s,String(r),t));if(n&&typeof n.toJSON=="function"){if(!t||!sc.hasAnchor(n))return n.toJSON(e,t);let s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=i=>{s.res=i,delete t.onCreate};let r=n.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof n=="bigint"&&!t?.keep?Number(n):n}o(li,"toJS");ci.toJS=li});var Lt=b(fi=>{"use strict";var rc=Un(),ui=N(),ic=ne(),Jn=class{static{o(this,"NodeBase")}constructor(e){Object.defineProperty(this,ui.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!ui.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=ic.toJS(this,"",a);if(typeof r=="function")for(let{count:c,res:u}of a.anchors.values())r(u,c);return typeof i=="function"?rc.applyReviver(i,{"":l},"",l):l}};fi.NodeBase=Jn});var Ue=b(pi=>{"use strict";var ac=Ot(),oc=De(),Ne=N(),lc=Lt(),cc=ne(),Vn=class extends lc.NodeBase{static{o(this,"Alias")}constructor(e){super(Ne.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=[],oc.visit(e,{Node:o((i,a)=>{(Ne.isAlias(a)||Ne.hasAnchor(a))&&s.push(a)},"Node")}),t&&(t.aliasResolveCache=s));let r;for(let i of s){if(i===this)break;i.anchor===this.source&&(r=i)}if(r&&t){let{anchors:i,doc:a,maxAliasCount:l}=t,c=i.get(r);if(c||(cc.toJS(r,null,t),c=i.get(r)),c?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(l>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Pt(a,r,i)),c.count*c.aliasCount>l)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}}return r}toJSON(e,t){if(!t)return{source:this.source};let s=this.resolve(t.doc,t);if(!s){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return t.anchors.get(s).res}toString(e,t,s){let r=`*${this.source}`;if(e){if(ac.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function Pt(n,e,t){if(Ne.isAlias(e)){let s=e.resolve(n),r=t&&s&&t.get(s);return r?r.count*r.aliasCount:0}else if(Ne.isCollection(e)){let s=0;for(let r of e.items){let i=Pt(n,r,t);i>s&&(s=i)}return s}else if(Ne.isPair(e)){let s=Pt(n,e.key,t),r=Pt(n,e.value,t);return Math.max(s,r)}return 1}o(Pt,"getAliasCount");pi.Alias=Vn});var $=b(Wn=>{"use strict";var uc=N(),fc=Lt(),pc=ne(),hc=o(n=>!n||typeof n!="function"&&typeof n!="object","isScalarValue"),se=class extends fc.NodeBase{static{o(this,"Scalar")}constructor(e){super(uc.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:pc.toJS(this.value,e,t)}toString(){return String(this.value)}};se.BLOCK_FOLDED="BLOCK_FOLDED";se.BLOCK_LITERAL="BLOCK_LITERAL";se.PLAIN="PLAIN";se.QUOTE_DOUBLE="QUOTE_DOUBLE";se.QUOTE_SINGLE="QUOTE_SINGLE";Wn.Scalar=se;Wn.isScalarValue=hc});var Je=b(di=>{"use strict";var dc=Ue(),he=N(),hi=$(),gc="tag:yaml.org,2002:";function mc(n,e,t){if(e){let s=t.filter(i=>i.tag===e),r=s.find(i=>!i.format)??s[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(s=>s.identify?.(n)&&!s.format)}o(mc,"findTagObject");function yc(n,e,t){if(he.isDocument(n)&&(n=n.contents),he.isNode(n))return n;if(he.isPair(n)){let f=t.schema[he.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:r,onTagObj:i,schema:a,sourceObjects:l}=t,c;if(s&&n&&typeof n=="object"){if(c=l.get(n),c)return c.anchor??(c.anchor=r(n)),new dc.Alias(c.anchor);c={anchor:null,node:null},l.set(n,c)}e?.startsWith("!!")&&(e=gc+e.slice(2));let u=mc(n,e,a.tags);if(!u){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let f=new hi.Scalar(n);return c&&(c.node=f),f}u=n instanceof Map?a[he.MAP]:Symbol.iterator in Object(n)?a[he.SEQ]:a[he.MAP]}i&&(i(u),delete t.onTagObj);let h=u?.createNode?u.createNode(t.schema,n,t):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(t.schema,n,t):new hi.Scalar(n);return e?h.tag=e:u.default||(h.tag=u.tag),c&&(c.node=h),h}o(yc,"createNode");di.createNode=yc});var $t=b(Ct=>{"use strict";var bc=Je(),Y=N(),kc=Lt();function Yn(n,e,t){let s=t;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let a=[];a[i]=s,s=a}else s=new Map([[i,s]])}return bc.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:o(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:n,sourceObjects:new Map})}o(Yn,"collectionFromPath");var gi=o(n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,"isEmptyPath"),zn=class extends kc.NodeBase{static{o(this,"Collection")}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=>Y.isNode(s)||Y.isPair(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(gi(e))this.add(t);else{let[s,...r]=e,i=this.get(s,!0);if(Y.isCollection(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(s,Yn(this.schema,r,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){let[t,...s]=e;if(s.length===0)return this.delete(t);let r=this.get(t,!0);if(Y.isCollection(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...r]=e,i=this.get(s,!0);return r.length===0?!t&&Y.isScalar(i)?i.value:i:Y.isCollection(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Y.isPair(t))return!1;let s=t.value;return s==null||e&&Y.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 r=this.get(t,!0);return Y.isCollection(r)?r.hasIn(s):!1}setIn(e,t){let[s,...r]=e;if(r.length===0)this.set(s,t);else{let i=this.get(s,!0);if(Y.isCollection(i))i.setIn(r,t);else if(i===void 0&&this.schema)this.set(s,Yn(this.schema,r,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}};Ct.Collection=zn;Ct.collectionFromPath=Yn;Ct.isEmptyPath=gi});var Ve=b(qt=>{"use strict";var wc=o(n=>n.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function Gn(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}o(Gn,"indentComment");var Sc=o((n,e,t)=>n.endsWith(`
|
|
5
|
+
`)?Gn(t,e):t.includes(`
|
|
6
6
|
`)?`
|
|
7
|
-
`+
|
|
8
|
-
`)t===
|
|
9
|
-
`&&g!==" "){let
|
|
10
|
-
`&&
|
|
11
|
-
${e}${
|
|
12
|
-
${e}${
|
|
13
|
-
`);
|
|
14
|
-
`){if(i-a>
|
|
7
|
+
`+Gn(t,e):(n.endsWith(" ")?"":" ")+t,"lineComment");qt.indentComment=Gn;qt.lineComment=Sc;qt.stringifyComment=wc});var yi=b(We=>{"use strict";var vc="flow",Qn="block",It="quoted";function Tc(n,e,t="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return n;r<i&&(i=0);let c=Math.max(1+i,1+r-e.length);if(n.length<=c)return n;let u=[],h={},f=r-e.length;typeof s=="number"&&(s>r-Math.max(2,i)?u.push(0):f=r-s);let p,g,y=!1,d=-1,m=-1,k=-1;t===Qn&&(d=mi(n,d,e.length),d!==-1&&(f=d+c));for(let v;v=n[d+=1];){if(t===It&&v==="\\"){switch(m=d,n[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}k=d}if(v===`
|
|
8
|
+
`)t===Qn&&(d=mi(n,d,e.length)),f=d+e.length+c,p=void 0;else{if(v===" "&&g&&g!==" "&&g!==`
|
|
9
|
+
`&&g!==" "){let T=n[d+1];T&&T!==" "&&T!==`
|
|
10
|
+
`&&T!==" "&&(p=d)}if(d>=f)if(p)u.push(p),f=p+c,p=void 0;else if(t===It){for(;g===" "||g===" ";)g=v,v=n[d+=1],y=!0;let T=d>k+1?d-2:m-1;if(h[T])return n;u.push(T),h[T]=!0,f=T+c,p=void 0}else y=!0}g=v}if(y&&l&&l(),u.length===0)return n;a&&a();let w=n.slice(0,u[0]);for(let v=0;v<u.length;++v){let T=u[v],x=u[v+1]||n.length;T===0?w=`
|
|
11
|
+
${e}${n.slice(0,x)}`:(t===It&&h[T]&&(w+=`${n[T]}\\`),w+=`
|
|
12
|
+
${e}${n.slice(T+1,x)}`)}return w}o(Tc,"foldFlowLines");function mi(n,e,t){let s=e,r=e+1,i=n[r];for(;i===" "||i===" ";)if(e<r+t)i=n[++e];else{do i=n[++e];while(i&&i!==`
|
|
13
|
+
`);s=e,r=e+1,i=n[r]}return s}o(mi,"consumeMoreIndentedLines");We.FOLD_BLOCK=Qn;We.FOLD_FLOW=vc;We.FOLD_QUOTED=It;We.foldFlowLines=Tc});var ze=b(bi=>{"use strict";var K=$(),re=yi(),Rt=o((n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),"getFoldOptions"),Mt=o(n=>/^(%|---|\.\.\.)/m.test(n),"containsDocumentMarker");function Ac(n,e,t){if(!e||e<0)return!1;let s=e-t,r=n.length;if(r<=s)return!1;for(let i=0,a=0;i<r;++i)if(n[i]===`
|
|
14
|
+
`){if(i-a>s)return!0;if(a=i+1,r-a<=s)return!1}return!0}o(Ac,"lineLengthOverLimit");function Ye(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:s}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Mt(n)?" ":""),a="",l=0;for(let c=0,u=t[c];u;u=t[++c])if(u===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(a+=t.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(t[c+1]){case"u":{a+=t.slice(l,c);let h=t.substr(c+2,4);switch(h){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:h.substr(0,2)==="00"?a+="\\x"+h.substr(2):a+=t.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||t[c+2]==='"'||t.length<r)c+=1;else{for(a+=t.slice(l,c)+`
|
|
15
15
|
|
|
16
16
|
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)a+=`
|
|
17
|
-
`,c+=2;a+=i,t[c+2]===" "&&(a+="\\"),c+=1,l=c+1}break;default:c+=1}return a=l?a+t.slice(l):t,
|
|
18
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
19
|
-
${t}`)+"'";return e.implicitKey?
|
|
17
|
+
`,c+=2;a+=i,t[c+2]===" "&&(a+="\\"),c+=1,l=c+1}break;default:c+=1}return a=l?a+t.slice(l):t,s?a:re.foldFlowLines(a,i,re.FOLD_QUOTED,Rt(e,!1))}o(Ye,"doubleQuotedString");function Hn(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return Ye(n,e);let t=e.indent||(Mt(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${t}`)+"'";return e.implicitKey?s:re.foldFlowLines(s,t,re.FOLD_FLOW,Rt(e,!1))}o(Hn,"singleQuotedString");function Ee(n,e){let{singleQuote:t}=e.options,s;if(t===!1)s=Ye;else{let r=n.includes('"'),i=n.includes("'");r&&!i?s=Hn:i&&!r?s=Ye:s=t?Hn:Ye}return s(n,e)}o(Ee,"quotedString");var Xn;try{Xn=new RegExp(`(^|(?<!
|
|
20
20
|
))
|
|
21
21
|
+(?!
|
|
22
|
-
|$)`,"g")}catch{
|
|
22
|
+
|$)`,"g")}catch{Xn=/\n+(?!\n|$)/g}function _t({comment:n,type:e,value:t},s,r,i){let{blockQuote:a,commentString:l,lineWidth:c}=s.options;if(!a||/\n[\t ]+$/.test(t))return Ee(t,s);let u=s.indent||(s.forceBlockIndent||Mt(t)?" ":""),h=a==="literal"?!0:a==="folded"||e===K.Scalar.BLOCK_FOLDED?!1:e===K.Scalar.BLOCK_LITERAL?!0:!Ac(t,c,u.length);if(!t)return h?`|
|
|
23
23
|
`:`>
|
|
24
24
|
`;let f,p;for(p=t.length;p>0;--p){let x=t[p-1];if(x!==`
|
|
25
25
|
`&&x!==" "&&x!==" ")break}let g=t.substring(p),y=g.indexOf(`
|
|
26
26
|
`);y===-1?f="-":t===g||y!==g.length-1?(f="+",i&&i()):f="",g&&(t=t.slice(0,-g.length),g[g.length-1]===`
|
|
27
|
-
`&&(g=g.slice(0,-1)),g=g.replace(
|
|
28
|
-
`)k=m;else break}let w=t.substring(0,k<m?k+1:m);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${u}`));let
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),
|
|
30
|
-
${u}${S}`}return t=t.replace(/\n+/g,`$&${u}`),`|${
|
|
31
|
-
${u}${w}${t}${g}`}o(
|
|
32
|
-
`)||h&&/[[\]{},]/.test(i))return
|
|
33
|
-
`)?
|
|
34
|
-
`))return
|
|
35
|
-
${c}`);if(a){let p=o(d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(f),"test"),{compat:g,tags:y}=e.doc.schema;if(y.some(p)||g?.some(p))return
|
|
36
|
-
${e.indent}${l}`:l}o(
|
|
37
|
-
${l}:`):(m=`${m}:`,p&&(m+=
|
|
38
|
-
`:"",w){let
|
|
39
|
-
${
|
|
40
|
-
`&&v&&(
|
|
27
|
+
`&&(g=g.slice(0,-1)),g=g.replace(Xn,`$&${u}`));let d=!1,m,k=-1;for(m=0;m<t.length;++m){let x=t[m];if(x===" ")d=!0;else if(x===`
|
|
28
|
+
`)k=m;else break}let w=t.substring(0,k<m?k+1:m);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${u}`));let T=(d?u?"2":"1":"")+f;if(n&&(T+=" "+l(n.replace(/ ?[\r\n]+/g," ")),r&&r()),!h){let x=t.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),A=!1,O=Rt(s,!0);a!=="folded"&&e!==K.Scalar.BLOCK_FOLDED&&(O.onOverflow=()=>{A=!0});let S=re.foldFlowLines(`${w}${x}${g}`,u,re.FOLD_BLOCK,O);if(!A)return`>${T}
|
|
30
|
+
${u}${S}`}return t=t.replace(/\n+/g,`$&${u}`),`|${T}
|
|
31
|
+
${u}${w}${t}${g}`}o(_t,"blockString");function xc(n,e,t,s){let{type:r,value:i}=n,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:h}=e;if(l&&i.includes(`
|
|
32
|
+
`)||h&&/[[\]{},]/.test(i))return Ee(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||h||!i.includes(`
|
|
33
|
+
`)?Ee(i,e):_t(n,e,t,s);if(!l&&!h&&r!==K.Scalar.PLAIN&&i.includes(`
|
|
34
|
+
`))return _t(n,e,t,s);if(Mt(i)){if(c==="")return e.forceBlockIndent=!0,_t(n,e,t,s);if(l&&c===u)return Ee(i,e)}let f=i.replace(/\n+/g,`$&
|
|
35
|
+
${c}`);if(a){let p=o(d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(f),"test"),{compat:g,tags:y}=e.doc.schema;if(y.some(p)||g?.some(p))return Ee(i,e)}return l?f:re.foldFlowLines(f,c,re.FOLD_FLOW,Rt(e,!1))}o(xc,"plainString");function Nc(n,e,t,s){let{implicitKey:r,inFlow:i}=e,a=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:l}=n;l!==K.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=K.Scalar.QUOTE_DOUBLE);let c=o(h=>{switch(h){case K.Scalar.BLOCK_FOLDED:case K.Scalar.BLOCK_LITERAL:return r||i?Ee(a.value,e):_t(a,e,t,s);case K.Scalar.QUOTE_DOUBLE:return Ye(a.value,e);case K.Scalar.QUOTE_SINGLE:return Hn(a.value,e);case K.Scalar.PLAIN:return xc(a,e,t,s);default:return null}},"_stringify"),u=c(l);if(u===null){let{defaultKeyType:h,defaultStringType:f}=e.options,p=r&&h||f;if(u=c(p),u===null)throw new Error(`Unsupported default string type ${p}`)}return u}o(Nc,"stringifyString");bi.stringifyString=Nc});var Ge=b(Zn=>{"use strict";var Ec=Ot(),ie=N(),Oc=Ve(),Lc=ze();function Pc(n,e){let t=Object.assign({blockQuote:!0,commentString:Oc.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}}o(Pc,"createStringifyContext");function Cc(n,e){if(e.tag){let r=n.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let t,s;if(ie.isScalar(e)){s=e.value;let r=n.filter(i=>i.identify?.(s));if(r.length>1){let i=r.filter(a=>a.test);i.length>0&&(r=i)}t=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else s=e,t=n.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!t){let r=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return t}o(Cc,"getTagObject");function $c(n,e,{anchors:t,doc:s}){if(!s.directives)return"";let r=[],i=(ie.isScalar(n)||ie.isCollection(n))&&n.anchor;i&&Ec.anchorIsValid(i)&&(t.add(i),r.push(`&${i}`));let a=n.tag??(e.default?null:e.tag);return a&&r.push(s.directives.tagString(a)),r.join(" ")}o($c,"stringifyProps");function qc(n,e,t,s){if(ie.isPair(n))return n.toString(e,t,s);if(ie.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 r,i=ie.isNode(n)?n:e.doc.createNode(n,{onTagObj:o(c=>r=c,"onTagObj")});r??(r=Cc(e.doc.schema.tags,i));let a=$c(i,r,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let l=typeof r.stringify=="function"?r.stringify(i,e,t,s):ie.isScalar(i)?Lc.stringifyString(i,e,t,s):i.toString(e,t,s);return a?ie.isScalar(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
|
|
36
|
+
${e.indent}${l}`:l}o(qc,"stringify");Zn.createStringifyContext=Pc;Zn.stringify=qc});var vi=b(Si=>{"use strict";var H=N(),ki=$(),wi=Ge(),Qe=Ve();function Ic({key:n,value:e},t,s,r){let{allNullValues:i,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:h,simpleKeys:f}}=t,p=H.isNode(n)&&n.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(H.isCollection(n)||!H.isNode(n)&&typeof n=="object"){let O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let g=!f&&(!n||p&&e==null&&!t.inFlow||H.isCollection(n)||(H.isScalar(n)?n.type===ki.Scalar.BLOCK_FOLDED||n.type===ki.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(f||!i),indent:l+c});let y=!1,d=!1,m=wi.stringify(n,t,()=>y=!0,()=>d=!0);if(!g&&!t.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(i||e==null)return y&&s&&s(),m===""?"?":g?`? ${m}`:m}else if(i&&!f||e==null&&g)return m=`? ${m}`,p&&!y?m+=Qe.lineComment(m,t.indent,u(p)):d&&r&&r(),m;y&&(p=null),g?(p&&(m+=Qe.lineComment(m,t.indent,u(p))),m=`? ${m}
|
|
37
|
+
${l}:`):(m=`${m}:`,p&&(m+=Qe.lineComment(m,t.indent,u(p))));let k,w,v;H.isNode(e)?(k=!!e.spaceBefore,w=e.commentBefore,v=e.comment):(k=!1,w=null,v=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!g&&!p&&H.isScalar(e)&&(t.indentAtStart=m.length+1),d=!1,!h&&c.length>=2&&!t.inFlow&&!g&&H.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let T=!1,x=wi.stringify(e,t,()=>T=!0,()=>d=!0),A=" ";if(p||k||w){if(A=k?`
|
|
38
|
+
`:"",w){let O=u(w);A+=`
|
|
39
|
+
${Qe.indentComment(O,t.indent)}`}x===""&&!t.inFlow?A===`
|
|
40
|
+
`&&v&&(A=`
|
|
41
41
|
|
|
42
|
-
`):
|
|
43
|
-
${t.indent}`}else if(!g&&
|
|
44
|
-
`),
|
|
42
|
+
`):A+=`
|
|
43
|
+
${t.indent}`}else if(!g&&H.isCollection(e)){let O=x[0],S=x.indexOf(`
|
|
44
|
+
`),q=S!==-1,te=t.inFlow??e.flow??e.items.length===0;if(q||!te){let Te=!1;if(q&&(O==="&"||O==="!")){let I=x.indexOf(" ");O==="&"&&I!==-1&&I<S&&x[I+1]==="!"&&(I=x.indexOf(" ",I+1)),(I===-1||S<I)&&(Te=!0)}Te||(A=`
|
|
45
45
|
${t.indent}`)}}else(x===""||x[0]===`
|
|
46
|
-
`)&&(
|
|
46
|
+
`)&&(A="");return m+=A+x,t.inFlow?T&&s&&s():v&&!T?m+=Qe.lineComment(m,t.indent,u(v)):d&&r&&r(),m}o(Ic,"stringifyPair");Si.stringifyPair=Ic});var ts=b(es=>{"use strict";var Ti=Tt("process");function _c(n,...e){n==="debug"&&console.log(...e)}o(_c,"debug");function Rc(n,e){(n==="debug"||n==="warn")&&(typeof Ti.emitWarning=="function"?Ti.emitWarning(e):console.warn(e))}o(Rc,"warn");es.debug=_c;es.warn=Rc});var Kt=b(Ft=>{"use strict";var Bt=N(),Ai=$(),jt="<<",Dt={identify:o(n=>n===jt||typeof n=="symbol"&&n.description===jt,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:o(()=>Object.assign(new Ai.Scalar(Symbol(jt)),{addToJSMap:xi}),"resolve"),stringify:o(()=>jt,"stringify")},Mc=o((n,e)=>(Dt.identify(e)||Bt.isScalar(e)&&(!e.type||e.type===Ai.Scalar.PLAIN)&&Dt.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===Dt.tag&&t.default),"isMergeKey");function xi(n,e,t){let s=Ni(n,t);if(Bt.isSeq(s))for(let r of s.items)ns(n,e,r);else if(Array.isArray(s))for(let r of s)ns(n,e,r);else ns(n,e,s)}o(xi,"addMergeToJSMap");function ns(n,e,t){let s=Ni(n,t);if(!Bt.isMap(s))throw new Error("Merge sources must be maps or map aliases");let r=s.toJSON(null,n,Map);for(let[i,a]of r)e instanceof Map?e.has(i)||e.set(i,a):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}o(ns,"mergeValue");function Ni(n,e){return n&&Bt.isAlias(e)?e.resolve(n.doc,n):e}o(Ni,"resolveAliasValue");Ft.addMergeToJSMap=xi;Ft.isMergeKey=Mc;Ft.merge=Dt});var rs=b(Li=>{"use strict";var jc=ts(),Ei=Kt(),Dc=Ge(),Oi=N(),ss=ne();function Bc(n,e,{key:t,value:s}){if(Oi.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(Ei.isMergeKey(n,t))Ei.addMergeToJSMap(n,e,s);else{let r=ss.toJS(t,"",n);if(e instanceof Map)e.set(r,ss.toJS(s,r,n));else if(e instanceof Set)e.add(r);else{let i=Fc(t,r,n),a=ss.toJS(s,i,n);i in e?Object.defineProperty(e,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[i]=a}}return e}o(Bc,"addPairToJSMap");function Fc(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Oi.isNode(n)&&t?.doc){let s=Dc.createStringifyContext(t.doc,{});s.anchors=new Set;for(let i of t.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;let r=n.toString(s);if(!t.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),jc.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}o(Fc,"stringifyKey");Li.addPairToJSMap=Bc});var ae=b(is=>{"use strict";var Pi=Je(),Kc=vi(),Uc=rs(),Ut=N();function Jc(n,e,t){let s=Pi.createNode(n,void 0,t),r=Pi.createNode(e,void 0,t);return new Jt(s,r)}o(Jc,"createPair");var Jt=class n{static{o(this,"Pair")}constructor(e,t=null){Object.defineProperty(this,Ut.NODE_TYPE,{value:Ut.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return Ut.isNode(t)&&(t=t.clone(e)),Ut.isNode(s)&&(s=s.clone(e)),new n(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return Uc.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?Kc.stringifyPair(this,e,t,s):JSON.stringify(this)}};is.Pair=Jt;is.createPair=Jc});var as=b($i=>{"use strict";var de=N(),Ci=Ge(),Vt=Ve();function Vc(n,e,t){return(e.inFlow??n.flow?Yc:Wc)(n,e,t)}o(Vc,"stringifyCollection");function Wc({comment:n,items:e},t,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:a,onComment:l}){let{indent:c,options:{commentString:u}}=t,h=Object.assign({},t,{indent:i,type:null}),f=!1,p=[];for(let y=0;y<e.length;++y){let d=e[y],m=null;if(de.isNode(d))!f&&d.spaceBefore&&p.push(""),Wt(t,p,d.commentBefore,f),d.comment&&(m=d.comment);else if(de.isPair(d)){let w=de.isNode(d.key)?d.key:null;w&&(!f&&w.spaceBefore&&p.push(""),Wt(t,p,w.commentBefore,f))}f=!1;let k=Ci.stringify(d,h,()=>m=null,()=>f=!0);m&&(k+=Vt.lineComment(k,i,u(m))),f&&m&&(f=!1),p.push(s+k)}let g;if(p.length===0)g=r.start+r.end;else{g=p[0];for(let y=1;y<p.length;++y){let d=p[y];g+=d?`
|
|
47
47
|
${c}${d}`:`
|
|
48
|
-
`}}return
|
|
49
|
-
`+
|
|
50
|
-
`)),y<
|
|
48
|
+
`}}return n?(g+=`
|
|
49
|
+
`+Vt.indentComment(u(n),c),l&&l()):f&&a&&a(),g}o(Wc,"stringifyBlockCollection");function Yc({items:n},e,{flowChars:t,itemIndent:s}){let{indent:r,indentStep:i,flowCollectionPadding:a,options:{commentString:l}}=e;s+=i;let c=Object.assign({},e,{indent:s,inFlow:!0,type:null}),u=!1,h=0,f=[];for(let y=0;y<n.length;++y){let d=n[y],m=null;if(de.isNode(d))d.spaceBefore&&f.push(""),Wt(e,f,d.commentBefore,!1),d.comment&&(m=d.comment);else if(de.isPair(d)){let w=de.isNode(d.key)?d.key:null;w&&(w.spaceBefore&&f.push(""),Wt(e,f,w.commentBefore,!1),w.comment&&(u=!0));let v=de.isNode(d.value)?d.value:null;v?(v.comment&&(m=v.comment),v.commentBefore&&(u=!0)):d.value==null&&w?.comment&&(m=w.comment)}m&&(u=!0);let k=Ci.stringify(d,c,()=>m=null);u||(u=f.length>h||k.includes(`
|
|
50
|
+
`)),y<n.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(u||(u=f.reduce((w,v)=>w+v.length+2,2)+(k.length+2)>e.options.lineWidth)),u&&(k+=",")),m&&(k+=Vt.lineComment(k,s,l(m))),f.push(k),h=f.length}let{start:p,end:g}=t;if(f.length===0)return p+g;if(!u){let y=f.reduce((d,m)=>d+m.length+2,2);u=e.options.lineWidth>0&&y>e.options.lineWidth}if(u){let y=p;for(let d of f)y+=d?`
|
|
51
51
|
${i}${r}${d}`:`
|
|
52
52
|
`;return`${y}
|
|
53
|
-
${r}${g}`}else return`${p}${a}${f.join(" ")}${a}${g}`}o(Cc,"stringifyFlowCollection");function Kt({indent:s,options:{commentString:e}},t,n,r){if(n&&r&&(n=n.replace(/^\n+/,"")),n){let i=Ft.indentComment(e(n),s);t.push(i.trimStart())}}o(Kt,"addCommentBefore");xi.stringifyCollection=qc});var ae=b(Hs=>{"use strict";var Ic=Gs(),_c=Ws(),Rc=Ot(),ie=N(),Ut=re(),Mc=q();function Ge(s,e){let t=ie.isScalar(e)?e.value:e;for(let n of s)if(ie.isPair(n)&&(n.key===e||n.key===t||ie.isScalar(n.key)&&n.key.value===t))return n}o(Ge,"findPair");var Qs=class extends Rc.Collection{static{o(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ie.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),l=o((c,u)=>{if(typeof i=="function")u=i.call(t,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||r)&&a.items.push(Ut.createPair(c,u,n))},"add");if(t instanceof Map)for(let[c,u]of t)l(c,u);else if(t&&typeof t=="object")for(let c of Object.keys(t))l(c,t[c]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;ie.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Ut.Pair(e,e?.value):n=new Ut.Pair(e.key,e.value);let r=Ge(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);ie.isScalar(r.value)&&Mc.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let a=this.items.findIndex(l=>i(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let t=Ge(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let r=Ge(this.items,e)?.value;return(!t&&ie.isScalar(r)?r.value:r)??void 0}has(e){return!!Ge(this.items,e)}set(e,t){this.add(new Ut.Pair(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let i of this.items)_c.addPairToJSMap(t,r,i);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let r of this.items)if(!ie.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ic.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Hs.YAMLMap=Qs;Hs.findPair=Ge});var Ee=b(Ei=>{"use strict";var jc=N(),Ni=ae(),Dc={collection:"map",default:!0,nodeClass:Ni.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return jc.isMap(s)||e("Expected a mapping for this tag"),s},createNode:o((s,e,t)=>Ni.YAMLMap.from(s,e,t),"createNode")};Ei.map=Dc});var oe=b(Oi=>{"use strict";var Bc=Ke(),Fc=Gs(),Kc=Ot(),Jt=N(),Uc=q(),Yc=ee(),Zs=class extends Kc.Collection{static{o(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Jt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Yt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Yt(e);if(typeof n!="number")return;let r=this.items[n];return!t&&Jt.isScalar(r)?r.value:r}has(e){let t=Yt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Yt(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Jt.isScalar(r)&&Uc.isScalarValue(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let i of this.items)n.push(Yc.toJS(i,String(r++),t));return n}toString(e,t,n){return e?Fc.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let l of t){if(typeof r=="function"){let c=t instanceof Set?l:String(a++);l=r.call(t,c,l)}i.items.push(Bc.createNode(l,void 0,n))}}return i}};function Yt(s){let e=Jt.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}o(Yt,"asItemIndex");Oi.YAMLSeq=Zs});var Oe=b(Pi=>{"use strict";var Jc=N(),Li=oe(),Vc={collection:"seq",default:!0,nodeClass:Li.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Jc.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:o((s,e,t)=>Li.YAMLSeq.from(s,e,t),"createNode")};Pi.seq=Vc});var Qe=b(qi=>{"use strict";var Wc=Ve(),zc={identify:o(s=>typeof s=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:o(s=>s,"resolve"),stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),Wc.stringifyString(s,e,t,n)}};qi.string=zc});var Vt=b(Ii=>{"use strict";var $i=q(),Ci={identify:o(s=>s==null,"identify"),createNode:o(()=>new $i.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:o(()=>new $i.Scalar(null),"resolve"),stringify:o(({source:s},e)=>typeof s=="string"&&Ci.test.test(s)?s:e.options.nullStr,"stringify")};Ii.nullTag=Ci});var Xs=b(Ri=>{"use strict";var Gc=q(),_i={identify:o(s=>typeof s=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:o(s=>new Gc.Scalar(s[0]==="t"||s[0]==="T"),"resolve"),stringify({source:s,value:e},t){if(s&&_i.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};Ri.boolTag=_i});var Le=b(Mi=>{"use strict";function Qc({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let r=typeof n=="number"?n:Number(n);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let l=e-(i.length-a-1);for(;l-- >0;)i+="0"}return i}o(Qc,"stringifyNumber");Mi.stringifyNumber=Qc});var tn=b(Wt=>{"use strict";var Hc=q(),en=Le(),Zc={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o(s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:en.stringifyNumber},Xc={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:o(s=>parseFloat(s),"resolve"),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():en.stringifyNumber(s)}},eu={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new Hc.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:en.stringifyNumber};Wt.float=eu;Wt.floatExp=Xc;Wt.floatNaN=Zc});var nn=b(Gt=>{"use strict";var ji=Le(),zt=o(s=>typeof s=="bigint"||Number.isInteger(s),"intIdentify"),sn=o((s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t),"intResolve");function Di(s,e,t){let{value:n}=s;return zt(n)&&n>=0?t+n.toString(e):ji.stringifyNumber(s)}o(Di,"intStringify");var tu={identify:o(s=>zt(s)&&s>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:o((s,e,t)=>sn(s,2,8,t),"resolve"),stringify:o(s=>Di(s,8,"0o"),"stringify")},su={identify:zt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:o((s,e,t)=>sn(s,0,10,t),"resolve"),stringify:ji.stringifyNumber},nu={identify:o(s=>zt(s)&&s>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:o((s,e,t)=>sn(s,2,16,t),"resolve"),stringify:o(s=>Di(s,16,"0x"),"stringify")};Gt.int=su;Gt.intHex=nu;Gt.intOct=tu});var Fi=b(Bi=>{"use strict";var ru=Ee(),iu=Vt(),au=Oe(),ou=Qe(),lu=Xs(),rn=tn(),an=nn(),cu=[ru.map,au.seq,ou.string,iu.nullTag,lu.boolTag,an.intOct,an.int,an.intHex,rn.floatNaN,rn.floatExp,rn.float];Bi.schema=cu});var Yi=b(Ui=>{"use strict";var uu=q(),fu=Ee(),pu=Oe();function Ki(s){return typeof s=="bigint"||Number.isInteger(s)}o(Ki,"intIdentify");var Qt=o(({value:s})=>JSON.stringify(s),"stringifyJSON"),hu=[{identify:o(s=>typeof s=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:o(s=>s,"resolve"),stringify:Qt},{identify:o(s=>s==null,"identify"),createNode:o(()=>new uu.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:o(()=>null,"resolve"),stringify:Qt},{identify:o(s=>typeof s=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:o(s=>s==="true","resolve"),stringify:Qt},{identify:Ki,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:o((s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),"resolve"),stringify:o(({value:s})=>Ki(s)?s.toString():JSON.stringify(s),"stringify")},{identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:o(s=>parseFloat(s),"resolve"),stringify:Qt}],du={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},gu=[fu.map,pu.seq].concat(hu,du);Ui.schema=gu});var ln=b(Ji=>{"use strict";var He=kt("buffer"),on=q(),mu=Ve(),yu={identify:o(s=>s instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof He.Buffer=="function")return He.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,r,i){if(!t)return"";let a=t,l;if(typeof He.Buffer=="function")l=a instanceof He.Buffer?a.toString("base64"):He.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let u=0;u<a.length;++u)c+=String.fromCharCode(a[u]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=on.Scalar.BLOCK_LITERAL),e!==on.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),u=Math.ceil(l.length/c),h=new Array(u);for(let f=0,p=0;f<u;++f,p+=c)h[f]=l.substr(p,c);l=h.join(e===on.Scalar.BLOCK_LITERAL?`
|
|
54
|
-
`:" ")}return
|
|
55
|
-
${r.key.commentBefore}`:
|
|
56
|
-
${i.comment}`:n.comment}n=r}s.items[t]=Ht.isPair(n)?n:new cn.Pair(n)}}else e("Expected a sequence for this tag");return s}o(Vi,"resolvePairs");function Wi(s,e,t){let{replacer:n}=t,r=new ku.YAMLSeq(s);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(i++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;r.items.push(cn.createPair(l,c,t))}return r}o(Wi,"createPairs");var wu={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Vi,createNode:Wi};Zt.createPairs=Wi;Zt.pairs=wu;Zt.resolvePairs=Vi});var pn=b(fn=>{"use strict";var zi=N(),un=ee(),Ze=ae(),Su=oe(),Gi=Xt(),de=class s extends Su.YAMLSeq{static{o(this,"YAMLOMap")}constructor(){super(),this.add=Ze.YAMLMap.prototype.add.bind(this),this.delete=Ze.YAMLMap.prototype.delete.bind(this),this.get=Ze.YAMLMap.prototype.get.bind(this),this.has=Ze.YAMLMap.prototype.has.bind(this),this.set=Ze.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let r of this.items){let i,a;if(zi.isPair(r)?(i=un.toJS(r.key,"",t),a=un.toJS(r.value,i,t)):i=un.toJS(r,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,a)}return n}static from(e,t,n){let r=Gi.createPairs(e,t,n),i=new this;return i.items=r.items,i}};de.tag="tag:yaml.org,2002:omap";var vu={collection:"seq",identify:o(s=>s instanceof Map,"identify"),nodeClass:de,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=Gi.resolvePairs(s,e),n=[];for(let{key:r}of t.items)zi.isScalar(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new de,t)},createNode:o((s,e,t)=>de.from(s,e,t),"createNode")};fn.YAMLOMap=de;fn.omap=vu});var ea=b(hn=>{"use strict";var Qi=q();function Hi({value:s,source:e},t){return e&&(s?Zi:Xi).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}o(Hi,"boolStringify");var Zi={identify:o(s=>s===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:o(()=>new Qi.Scalar(!0),"resolve"),stringify:Hi},Xi={identify:o(s=>s===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:o(()=>new Qi.Scalar(!1),"resolve"),stringify:Hi};hn.falseTag=Xi;hn.trueTag=Zi});var ta=b(es=>{"use strict";var Au=q(),dn=Le(),Tu={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o(s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:dn.stringifyNumber},xu={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:o(s=>parseFloat(s.replace(/_/g,"")),"resolve"),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():dn.stringifyNumber(s)}},Nu={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new Au.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:dn.stringifyNumber};es.float=Nu;es.floatExp=xu;es.floatNaN=Tu});var na=b(et=>{"use strict";var sa=Le(),Xe=o(s=>typeof s=="bigint"||Number.isInteger(s),"intIdentify");function ts(s,e,t,{intAsBigInt:n}){let r=s[0];if((r==="-"||r==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let a=BigInt(s);return r==="-"?BigInt(-1)*a:a}let i=parseInt(s,t);return r==="-"?-1*i:i}o(ts,"intResolve");function gn(s,e,t){let{value:n}=s;if(Xe(n)){let r=n.toString(e);return n<0?"-"+t+r.substr(1):t+r}return sa.stringifyNumber(s)}o(gn,"intStringify");var Eu={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:o((s,e,t)=>ts(s,2,2,t),"resolve"),stringify:o(s=>gn(s,2,"0b"),"stringify")},Ou={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:o((s,e,t)=>ts(s,1,8,t),"resolve"),stringify:o(s=>gn(s,8,"0"),"stringify")},Lu={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:o((s,e,t)=>ts(s,0,10,t),"resolve"),stringify:sa.stringifyNumber},Pu={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:o((s,e,t)=>ts(s,2,16,t),"resolve"),stringify:o(s=>gn(s,16,"0x"),"stringify")};et.int=Lu;et.intBin=Eu;et.intHex=Pu;et.intOct=Ou});var yn=b(mn=>{"use strict";var rs=N(),ss=re(),ns=ae(),ge=class s extends ns.YAMLMap{static{o(this,"YAMLSet")}constructor(e){super(e),this.tag=s.tag}add(e){let t;rs.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new ss.Pair(e.key,null):t=new ss.Pair(e,null),ns.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=ns.findPair(this.items,e);return!t&&rs.isPair(n)?rs.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=ns.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new ss.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof r=="function"&&(a=r.call(t,a,a)),i.items.push(ss.createPair(a,null,n));return i}};ge.tag="tag:yaml.org,2002:set";var qu={collection:"map",identify:o(s=>s instanceof Set,"identify"),nodeClass:ge,default:!1,tag:"tag:yaml.org,2002:set",createNode:o((s,e,t)=>ge.from(s,e,t),"createNode"),resolve(s,e){if(rs.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new ge,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};mn.YAMLSet=ge;mn.set=qu});var kn=b(is=>{"use strict";var $u=Le();function bn(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,r=o(a=>e?BigInt(a):Number(a),"num"),i=n.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return t==="-"?r(-1)*i:i}o(bn,"parseSexagesimal");function ra(s){let{value:e}=s,t=o(a=>a,"num");if(typeof e=="bigint")t=o(a=>BigInt(a),"num");else if(isNaN(e)||!isFinite(e))return $u.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let r=t(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),n+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}o(ra,"stringifySexagesimal");var Cu={identify:o(s=>typeof s=="bigint"||Number.isInteger(s),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:o((s,e,{intAsBigInt:t})=>bn(s,t),"resolve"),stringify:ra},Iu={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:o(s=>bn(s,!1),"resolve"),stringify:ra},ia={identify:o(s=>s instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){let e=s.match(ia.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,r,i,a,l]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(t,n-1,r,i||0,a||0,l||0,c),h=e[8];if(h&&h!=="Z"){let f=bn(h,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:o(({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};is.floatTime=Iu;is.intTime=Cu;is.timestamp=ia});var la=b(oa=>{"use strict";var _u=Ee(),Ru=Vt(),Mu=Oe(),ju=Qe(),Du=ln(),aa=ea(),wn=ta(),as=na(),Bu=jt(),Fu=pn(),Ku=Xt(),Uu=yn(),Sn=kn(),Yu=[_u.map,Mu.seq,ju.string,Ru.nullTag,aa.trueTag,aa.falseTag,as.intBin,as.intOct,as.int,as.intHex,wn.floatNaN,wn.floatExp,wn.float,Du.binary,Bu.merge,Fu.omap,Ku.pairs,Uu.set,Sn.intTime,Sn.floatTime,Sn.timestamp];oa.schema=Yu});var ba=b(Tn=>{"use strict";var pa=Ee(),Ju=Vt(),ha=Oe(),Vu=Qe(),Wu=Xs(),vn=tn(),An=nn(),zu=Fi(),Gu=Yi(),da=ln(),tt=jt(),ga=pn(),ma=Xt(),ca=la(),ya=yn(),os=kn(),ua=new Map([["core",zu.schema],["failsafe",[pa.map,ha.seq,Vu.string]],["json",Gu.schema],["yaml11",ca.schema],["yaml-1.1",ca.schema]]),fa={binary:da.binary,bool:Wu.boolTag,float:vn.float,floatExp:vn.floatExp,floatNaN:vn.floatNaN,floatTime:os.floatTime,int:An.int,intHex:An.intHex,intOct:An.intOct,intTime:os.intTime,map:pa.map,merge:tt.merge,null:Ju.nullTag,omap:ga.omap,pairs:ma.pairs,seq:ha.seq,set:ya.set,timestamp:os.timestamp},Qu={"tag:yaml.org,2002:binary":da.binary,"tag:yaml.org,2002:merge":tt.merge,"tag:yaml.org,2002:omap":ga.omap,"tag:yaml.org,2002:pairs":ma.pairs,"tag:yaml.org,2002:set":ya.set,"tag:yaml.org,2002:timestamp":os.timestamp};function Hu(s,e,t){let n=ua.get(e);if(n&&!s)return t&&!n.includes(tt.merge)?n.concat(tt.merge):n.slice();let r=n;if(!r)if(Array.isArray(s))r=[];else{let i=Array.from(ua.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(s))for(let i of s)r=r.concat(i);else typeof s=="function"&&(r=s(r.slice()));return t&&(r=r.concat(tt.merge)),r.reduce((i,a)=>{let l=typeof a=="string"?fa[a]:a;if(!l){let c=JSON.stringify(a),u=Object.keys(fa).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}o(Hu,"getTags");Tn.coreKnownTags=Qu;Tn.getTags=Hu});var En=b(ka=>{"use strict";var xn=N(),Zu=Ee(),Xu=Oe(),ef=Qe(),ls=ba(),tf=o((s,e)=>s.key<e.key?-1:s.key>e.key?1:0,"sortMapEntriesByKey"),Nn=class s{static{o(this,"Schema")}constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?ls.getTags(e,"compat"):e?ls.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?ls.coreKnownTags:{},this.tags=ls.getTags(t,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,xn.MAP,{value:Zu.map}),Object.defineProperty(this,xn.SCALAR,{value:ef.string}),Object.defineProperty(this,xn.SEQ,{value:Xu.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?tf:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};ka.Schema=Nn});var Sa=b(wa=>{"use strict";var sf=N(),On=We(),st=Ue();function nf(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let r=On.createStringifyContext(s,e),{commentString:i}=r.options;if(s.commentBefore){t.length!==1&&t.unshift("");let c=i(s.commentBefore);t.unshift(st.indentComment(c,""))}let a=!1,l=null;if(s.contents){if(sf.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let h=i(s.contents.commentBefore);t.push(st.indentComment(h,""))}r.forceBlockIndent=!!s.comment,l=s.contents.comment}let c=l?void 0:()=>a=!0,u=On.stringify(s.contents,r,()=>l=null,c);l&&(u+=st.lineComment(u,"",i(l))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(On.stringify(s.contents,r));if(s.directives?.docEnd)if(s.comment){let c=i(s.comment);c.includes(`
|
|
57
|
-
`)?(t.push("..."),t.push(
|
|
53
|
+
${r}${g}`}else return`${p}${a}${f.join(" ")}${a}${g}`}o(Yc,"stringifyFlowCollection");function Wt({indent:n,options:{commentString:e}},t,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){let i=Vt.indentComment(e(s),n);t.push(i.trimStart())}}o(Wt,"addCommentBefore");$i.stringifyCollection=Vc});var le=b(ls=>{"use strict";var zc=as(),Gc=rs(),Qc=$t(),oe=N(),Yt=ae(),Hc=$();function He(n,e){let t=oe.isScalar(e)?e.value:e;for(let s of n)if(oe.isPair(s)&&(s.key===e||s.key===t||oe.isScalar(s.key)&&s.key.value===t))return s}o(He,"findPair");var os=class extends Qc.Collection{static{o(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(oe.MAP,e),this.items=[]}static from(e,t,s){let{keepUndefined:r,replacer:i}=s,a=new this(e),l=o((c,u)=>{if(typeof i=="function")u=i.call(t,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||r)&&a.items.push(Yt.createPair(c,u,s))},"add");if(t instanceof Map)for(let[c,u]of t)l(c,u);else if(t&&typeof t=="object")for(let c of Object.keys(t))l(c,t[c]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){let s;oe.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new Yt.Pair(e,e?.value):s=new Yt.Pair(e.key,e.value);let r=He(this.items,s.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${s.key} already set`);oe.isScalar(r.value)&&Hc.isScalarValue(s.value)?r.value.value=s.value:r.value=s.value}else if(i){let a=this.items.findIndex(l=>i(s,l)<0);a===-1?this.items.push(s):this.items.splice(a,0,s)}else this.items.push(s)}delete(e){let t=He(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let r=He(this.items,e)?.value;return(!t&&oe.isScalar(r)?r.value:r)??void 0}has(e){return!!He(this.items,e)}set(e,t){this.add(new Yt.Pair(e,t),!0)}toJSON(e,t,s){let r=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let i of this.items)Gc.addPairToJSMap(t,r,i);return r}toString(e,t,s){if(!e)return JSON.stringify(this);for(let r of this.items)if(!oe.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),zc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}};ls.YAMLMap=os;ls.findPair=He});var Oe=b(Ii=>{"use strict";var Xc=N(),qi=le(),Zc={collection:"map",default:!0,nodeClass:qi.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return Xc.isMap(n)||e("Expected a mapping for this tag"),n},createNode:o((n,e,t)=>qi.YAMLMap.from(n,e,t),"createNode")};Ii.map=Zc});var ce=b(_i=>{"use strict";var eu=Je(),tu=as(),nu=$t(),Gt=N(),su=$(),ru=ne(),cs=class extends nu.Collection{static{o(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Gt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=zt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let s=zt(e);if(typeof s!="number")return;let r=this.items[s];return!t&&Gt.isScalar(r)?r.value:r}has(e){let t=zt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let s=zt(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[s];Gt.isScalar(r)&&su.isScalarValue(t)?r.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let r=0;for(let i of this.items)s.push(ru.toJS(i,String(r++),t));return s}toString(e,t,s){return e?tu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:r}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let l of t){if(typeof r=="function"){let c=t instanceof Set?l:String(a++);l=r.call(t,c,l)}i.items.push(eu.createNode(l,void 0,s))}}return i}};function zt(n){let e=Gt.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}o(zt,"asItemIndex");_i.YAMLSeq=cs});var Le=b(Mi=>{"use strict";var iu=N(),Ri=ce(),au={collection:"seq",default:!0,nodeClass:Ri.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return iu.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:o((n,e,t)=>Ri.YAMLSeq.from(n,e,t),"createNode")};Mi.seq=au});var Xe=b(ji=>{"use strict";var ou=ze(),lu={identify:o(n=>typeof n=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:o(n=>n,"resolve"),stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),ou.stringifyString(n,e,t,s)}};ji.string=lu});var Qt=b(Fi=>{"use strict";var Di=$(),Bi={identify:o(n=>n==null,"identify"),createNode:o(()=>new Di.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:o(()=>new Di.Scalar(null),"resolve"),stringify:o(({source:n},e)=>typeof n=="string"&&Bi.test.test(n)?n:e.options.nullStr,"stringify")};Fi.nullTag=Bi});var us=b(Ui=>{"use strict";var cu=$(),Ki={identify:o(n=>typeof n=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:o(n=>new cu.Scalar(n[0]==="t"||n[0]==="T"),"resolve"),stringify({source:n,value:e},t){if(n&&Ki.test.test(n)){let s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};Ui.boolTag=Ki});var Pe=b(Ji=>{"use strict";function uu({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);let r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let l=e-(i.length-a-1);for(;l-- >0;)i+="0"}return i}o(uu,"stringifyNumber");Ji.stringifyNumber=uu});var ps=b(Ht=>{"use strict";var fu=$(),fs=Pe(),pu={identify:o(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o(n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:fs.stringifyNumber},hu={identify:o(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:o(n=>parseFloat(n),"resolve"),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():fs.stringifyNumber(n)}},du={identify:o(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new fu.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:fs.stringifyNumber};Ht.float=du;Ht.floatExp=hu;Ht.floatNaN=pu});var ds=b(Zt=>{"use strict";var Vi=Pe(),Xt=o(n=>typeof n=="bigint"||Number.isInteger(n),"intIdentify"),hs=o((n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t),"intResolve");function Wi(n,e,t){let{value:s}=n;return Xt(s)&&s>=0?t+s.toString(e):Vi.stringifyNumber(n)}o(Wi,"intStringify");var gu={identify:o(n=>Xt(n)&&n>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:o((n,e,t)=>hs(n,2,8,t),"resolve"),stringify:o(n=>Wi(n,8,"0o"),"stringify")},mu={identify:Xt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:o((n,e,t)=>hs(n,0,10,t),"resolve"),stringify:Vi.stringifyNumber},yu={identify:o(n=>Xt(n)&&n>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:o((n,e,t)=>hs(n,2,16,t),"resolve"),stringify:o(n=>Wi(n,16,"0x"),"stringify")};Zt.int=mu;Zt.intHex=yu;Zt.intOct=gu});var zi=b(Yi=>{"use strict";var bu=Oe(),ku=Qt(),wu=Le(),Su=Xe(),vu=us(),gs=ps(),ms=ds(),Tu=[bu.map,wu.seq,Su.string,ku.nullTag,vu.boolTag,ms.intOct,ms.int,ms.intHex,gs.floatNaN,gs.floatExp,gs.float];Yi.schema=Tu});var Hi=b(Qi=>{"use strict";var Au=$(),xu=Oe(),Nu=Le();function Gi(n){return typeof n=="bigint"||Number.isInteger(n)}o(Gi,"intIdentify");var en=o(({value:n})=>JSON.stringify(n),"stringifyJSON"),Eu=[{identify:o(n=>typeof n=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:o(n=>n,"resolve"),stringify:en},{identify:o(n=>n==null,"identify"),createNode:o(()=>new Au.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:o(()=>null,"resolve"),stringify:en},{identify:o(n=>typeof n=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:o(n=>n==="true","resolve"),stringify:en},{identify:Gi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:o((n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),"resolve"),stringify:o(({value:n})=>Gi(n)?n.toString():JSON.stringify(n),"stringify")},{identify:o(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:o(n=>parseFloat(n),"resolve"),stringify:en}],Ou={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},Lu=[xu.map,Nu.seq].concat(Eu,Ou);Qi.schema=Lu});var bs=b(Xi=>{"use strict";var Ze=Tt("buffer"),ys=$(),Pu=ze(),Cu={identify:o(n=>n instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Ze.Buffer=="function")return Ze.Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let r=0;r<t.length;++r)s[r]=t.charCodeAt(r);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,r,i){if(!t)return"";let a=t,l;if(typeof Ze.Buffer=="function")l=a instanceof Ze.Buffer?a.toString("base64"):Ze.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let u=0;u<a.length;++u)c+=String.fromCharCode(a[u]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=ys.Scalar.BLOCK_LITERAL),e!==ys.Scalar.QUOTE_DOUBLE){let c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(l.length/c),h=new Array(u);for(let f=0,p=0;f<u;++f,p+=c)h[f]=l.substr(p,c);l=h.join(e===ys.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return Pu.stringifyString({comment:n,type:e,value:l},s,r,i)}};Xi.binary=Cu});var sn=b(nn=>{"use strict";var tn=N(),ks=ae(),$u=$(),qu=ce();function Zi(n,e){if(tn.isSeq(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!tn.isPair(s)){if(tn.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let r=s.items[0]||new ks.Pair(new $u.Scalar(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
|
|
55
|
+
${r.key.commentBefore}`:s.commentBefore),s.comment){let i=r.value??r.key;i.comment=i.comment?`${s.comment}
|
|
56
|
+
${i.comment}`:s.comment}s=r}n.items[t]=tn.isPair(s)?s:new ks.Pair(s)}}else e("Expected a sequence for this tag");return n}o(Zi,"resolvePairs");function ea(n,e,t){let{replacer:s}=t,r=new qu.YAMLSeq(n);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof s=="function"&&(a=s.call(e,String(i++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;r.items.push(ks.createPair(l,c,t))}return r}o(ea,"createPairs");var Iu={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Zi,createNode:ea};nn.createPairs=ea;nn.pairs=Iu;nn.resolvePairs=Zi});var vs=b(Ss=>{"use strict";var ta=N(),ws=ne(),et=le(),_u=ce(),na=sn(),ge=class n extends _u.YAMLSeq{static{o(this,"YAMLOMap")}constructor(){super(),this.add=et.YAMLMap.prototype.add.bind(this),this.delete=et.YAMLMap.prototype.delete.bind(this),this.get=et.YAMLMap.prototype.get.bind(this),this.has=et.YAMLMap.prototype.has.bind(this),this.set=et.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 r of this.items){let i,a;if(ta.isPair(r)?(i=ws.toJS(r.key,"",t),a=ws.toJS(r.value,i,t)):i=ws.toJS(r,"",t),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,a)}return s}static from(e,t,s){let r=na.createPairs(e,t,s),i=new this;return i.items=r.items,i}};ge.tag="tag:yaml.org,2002:omap";var Ru={collection:"seq",identify:o(n=>n instanceof Map,"identify"),nodeClass:ge,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=na.resolvePairs(n,e),s=[];for(let{key:r}of t.items)ta.isScalar(r)&&(s.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new ge,t)},createNode:o((n,e,t)=>ge.from(n,e,t),"createNode")};Ss.YAMLOMap=ge;Ss.omap=Ru});var oa=b(Ts=>{"use strict";var sa=$();function ra({value:n,source:e},t){return e&&(n?ia:aa).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}o(ra,"boolStringify");var ia={identify:o(n=>n===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:o(()=>new sa.Scalar(!0),"resolve"),stringify:ra},aa={identify:o(n=>n===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:o(()=>new sa.Scalar(!1),"resolve"),stringify:ra};Ts.falseTag=aa;Ts.trueTag=ia});var la=b(rn=>{"use strict";var Mu=$(),As=Pe(),ju={identify:o(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o(n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:As.stringifyNumber},Du={identify:o(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:o(n=>parseFloat(n.replace(/_/g,"")),"resolve"),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():As.stringifyNumber(n)}},Bu={identify:o(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new Mu.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:As.stringifyNumber};rn.float=Bu;rn.floatExp=Du;rn.floatNaN=ju});var ua=b(nt=>{"use strict";var ca=Pe(),tt=o(n=>typeof n=="bigint"||Number.isInteger(n),"intIdentify");function an(n,e,t,{intAsBigInt:s}){let r=n[0];if((r==="-"||r==="+")&&(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 a=BigInt(n);return r==="-"?BigInt(-1)*a:a}let i=parseInt(n,t);return r==="-"?-1*i:i}o(an,"intResolve");function xs(n,e,t){let{value:s}=n;if(tt(s)){let r=s.toString(e);return s<0?"-"+t+r.substr(1):t+r}return ca.stringifyNumber(n)}o(xs,"intStringify");var Fu={identify:tt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:o((n,e,t)=>an(n,2,2,t),"resolve"),stringify:o(n=>xs(n,2,"0b"),"stringify")},Ku={identify:tt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:o((n,e,t)=>an(n,1,8,t),"resolve"),stringify:o(n=>xs(n,8,"0"),"stringify")},Uu={identify:tt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:o((n,e,t)=>an(n,0,10,t),"resolve"),stringify:ca.stringifyNumber},Ju={identify:tt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:o((n,e,t)=>an(n,2,16,t),"resolve"),stringify:o(n=>xs(n,16,"0x"),"stringify")};nt.int=Uu;nt.intBin=Fu;nt.intHex=Ju;nt.intOct=Ku});var Es=b(Ns=>{"use strict";var cn=N(),on=ae(),ln=le(),me=class n extends ln.YAMLMap{static{o(this,"YAMLSet")}constructor(e){super(e),this.tag=n.tag}add(e){let t;cn.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new on.Pair(e.key,null):t=new on.Pair(e,null),ln.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let s=ln.findPair(this.items,e);return!t&&cn.isPair(s)?cn.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=ln.findPair(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new on.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:r}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof r=="function"&&(a=r.call(t,a,a)),i.items.push(on.createPair(a,null,s));return i}};me.tag="tag:yaml.org,2002:set";var Vu={collection:"map",identify:o(n=>n instanceof Set,"identify"),nodeClass:me,default:!1,tag:"tag:yaml.org,2002:set",createNode:o((n,e,t)=>me.from(n,e,t),"createNode"),resolve(n,e){if(cn.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new me,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};Ns.YAMLSet=me;Ns.set=Vu});var Ls=b(un=>{"use strict";var Wu=Pe();function Os(n,e){let t=n[0],s=t==="-"||t==="+"?n.substring(1):n,r=o(a=>e?BigInt(a):Number(a),"num"),i=s.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return t==="-"?r(-1)*i:i}o(Os,"parseSexagesimal");function fa(n){let{value:e}=n,t=o(a=>a,"num");if(typeof e=="bigint")t=o(a=>BigInt(a),"num");else if(isNaN(e)||!isFinite(e))return Wu.stringifyNumber(n);let s="";e<0&&(s="-",e*=t(-1));let r=t(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),s+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}o(fa,"stringifySexagesimal");var Yu={identify:o(n=>typeof n=="bigint"||Number.isInteger(n),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:o((n,e,{intAsBigInt:t})=>Os(n,t),"resolve"),stringify:fa},zu={identify:o(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:o(n=>Os(n,!1),"resolve"),stringify:fa},pa={identify:o(n=>n instanceof Date,"identify"),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(pa.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,s,r,i,a,l]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(t,s-1,r,i||0,a||0,l||0,c),h=e[8];if(h&&h!=="Z"){let f=Os(h,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:o(({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};un.floatTime=zu;un.intTime=Yu;un.timestamp=pa});var ga=b(da=>{"use strict";var Gu=Oe(),Qu=Qt(),Hu=Le(),Xu=Xe(),Zu=bs(),ha=oa(),Ps=la(),fn=ua(),ef=Kt(),tf=vs(),nf=sn(),sf=Es(),Cs=Ls(),rf=[Gu.map,Hu.seq,Xu.string,Qu.nullTag,ha.trueTag,ha.falseTag,fn.intBin,fn.intOct,fn.int,fn.intHex,Ps.floatNaN,Ps.floatExp,Ps.float,Zu.binary,ef.merge,tf.omap,nf.pairs,sf.set,Cs.intTime,Cs.floatTime,Cs.timestamp];da.schema=rf});var xa=b(Is=>{"use strict";var ka=Oe(),af=Qt(),wa=Le(),of=Xe(),lf=us(),$s=ps(),qs=ds(),cf=zi(),uf=Hi(),Sa=bs(),st=Kt(),va=vs(),Ta=sn(),ma=ga(),Aa=Es(),pn=Ls(),ya=new Map([["core",cf.schema],["failsafe",[ka.map,wa.seq,of.string]],["json",uf.schema],["yaml11",ma.schema],["yaml-1.1",ma.schema]]),ba={binary:Sa.binary,bool:lf.boolTag,float:$s.float,floatExp:$s.floatExp,floatNaN:$s.floatNaN,floatTime:pn.floatTime,int:qs.int,intHex:qs.intHex,intOct:qs.intOct,intTime:pn.intTime,map:ka.map,merge:st.merge,null:af.nullTag,omap:va.omap,pairs:Ta.pairs,seq:wa.seq,set:Aa.set,timestamp:pn.timestamp},ff={"tag:yaml.org,2002:binary":Sa.binary,"tag:yaml.org,2002:merge":st.merge,"tag:yaml.org,2002:omap":va.omap,"tag:yaml.org,2002:pairs":Ta.pairs,"tag:yaml.org,2002:set":Aa.set,"tag:yaml.org,2002:timestamp":pn.timestamp};function pf(n,e,t){let s=ya.get(e);if(s&&!n)return t&&!s.includes(st.merge)?s.concat(st.merge):s.slice();let r=s;if(!r)if(Array.isArray(n))r=[];else{let i=Array.from(ya.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(n))for(let i of n)r=r.concat(i);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(st.merge)),r.reduce((i,a)=>{let l=typeof a=="string"?ba[a]:a;if(!l){let c=JSON.stringify(a),u=Object.keys(ba).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}o(pf,"getTags");Is.coreKnownTags=ff;Is.getTags=pf});var Ms=b(Na=>{"use strict";var _s=N(),hf=Oe(),df=Le(),gf=Xe(),hn=xa(),mf=o((n,e)=>n.key<e.key?-1:n.key>e.key?1:0,"sortMapEntriesByKey"),Rs=class n{static{o(this,"Schema")}constructor({compat:e,customTags:t,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?hn.getTags(e,"compat"):e?hn.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?hn.coreKnownTags:{},this.tags=hn.getTags(t,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,_s.MAP,{value:hf.map}),Object.defineProperty(this,_s.SCALAR,{value:gf.string}),Object.defineProperty(this,_s.SEQ,{value:df.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?mf:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Na.Schema=Rs});var Oa=b(Ea=>{"use strict";var yf=N(),js=Ge(),rt=Ve();function bf(n,e){let t=[],s=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");let r=js.createStringifyContext(n,e),{commentString:i}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=i(n.commentBefore);t.unshift(rt.indentComment(c,""))}let a=!1,l=null;if(n.contents){if(yf.isNode(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){let h=i(n.contents.commentBefore);t.push(rt.indentComment(h,""))}r.forceBlockIndent=!!n.comment,l=n.contents.comment}let c=l?void 0:()=>a=!0,u=js.stringify(n.contents,r,()=>l=null,c);l&&(u+=rt.lineComment(u,"",i(l))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(js.stringify(n.contents,r));if(n.directives?.docEnd)if(n.comment){let c=i(n.comment);c.includes(`
|
|
57
|
+
`)?(t.push("..."),t.push(rt.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||l)&&t[t.length-1]!==""&&t.push(""),t.push(rt.indentComment(i(c),"")))}return t.join(`
|
|
58
58
|
`)+`
|
|
59
|
-
`}o(
|
|
60
|
-
`),a=l+a}if(/[^ ]/.test(a)){let l=1,c=t.linePos[1];c?.line===
|
|
59
|
+
`}o(bf,"stringifyDocument");Ea.stringifyDocument=bf});var it=b(La=>{"use strict";var kf=Ue(),Ce=$t(),F=N(),wf=ae(),Sf=ne(),vf=Ms(),Tf=Oa(),Ds=Ot(),Af=Un(),xf=Je(),Bs=Kn(),Fs=class n{static{o(this,"Document")}constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,F.NODE_TYPE,{value:F.DOC});let r=null;typeof t=="function"||Array.isArray(t)?r=t:s===void 0&&t&&(s=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:a}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Bs.Directives({version:a}),this.setSchema(a,s),this.contents=e===void 0?null:this.createNode(e,r,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=Ds.anchorNames(this);e.anchor=!t||s.has(t)?Ds.findNewAnchor(t||"a",s):t}return new kf.Alias(e.anchor)}createNode(e,t,s){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let m=o(w=>typeof w=="number"||w instanceof String||w instanceof Number,"keyToStr"),k=t.filter(m).map(String);k.length>0&&(t=t.concat(k)),r=t}else s===void 0&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:h}=s??{},{onAnchor:f,setAnchors:p,sourceObjects:g}=Ds.createNodeAnchors(this,a||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:g},d=xf.createNode(e,h,y);return l&&F.isCollection(d)&&(d.flow=!0),p(),d}createPair(e,t,s={}){let r=this.createNode(e,null,s),i=this.createNode(t,null,s);return new wf.Pair(r,i)}delete(e){return $e(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ce.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 Ce.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 Ce.isEmptyPath(e)?this.contents!==void 0:F.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ce.collectionFromPath(this.schema,[e],t):$e(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ce.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ce.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 Bs.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 Bs.Directives({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new vf.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:r,onAnchor:i,reviver:a}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Sf.toJS(this.contents,t??"",l);if(typeof i=="function")for(let{count:u,res:h}of l.anchors.values())i(h,u);return typeof a=="function"?Af.applyReviver(a,{"":c},"",c):c}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 Tf.stringifyDocument(this,e)}};function $e(n){if(F.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}o($e,"assertCollection");La.Document=Fs});var lt=b(ot=>{"use strict";var at=class extends Error{static{o(this,"YAMLError")}constructor(e,t,s,r){super(),this.name=e,this.code=s,this.message=r,this.pos=t}},Ks=class extends at{static{o(this,"YAMLParseError")}constructor(e,t,s){super("YAMLParseError",e,t,s)}},Us=class extends at{static{o(this,"YAMLWarning")}constructor(e,t,s){super("YAMLWarning",e,t,s)}},Nf=o((n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));let{line:s,col:r}=t.linePos[0];t.message+=` at line ${s}, column ${r}`;let i=r-1,a=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){let l=Math.min(i-39,a.length-79);a="\u2026"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(a.substring(0,i))){let l=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
|
|
60
|
+
`),a=l+a}if(/[^ ]/.test(a)){let l=1,c=t.linePos[1];c?.line===s&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-i)));let u=" ".repeat(i)+"^".repeat(l);t.message+=`:
|
|
61
61
|
|
|
62
62
|
${a}
|
|
63
63
|
${u}
|
|
64
|
-
`}},"prettifyError");
|
|
65
|
-
`))return!0;if(
|
|
66
|
-
`+d.comment:l.comment=d.comment);continue}(d.newlineAfterProp
|
|
67
|
-
`+v.comment:w.comment=v.comment);let
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+
|
|
71
|
-
`+m.comment:u.comment=m.comment),u.range=[
|
|
72
|
-
`.repeat(Math.max(1,a.length-1)):"",m=
|
|
73
|
-
`;for(let d=h;d<l;++d){let[m,k]=a[d];u+=m.length+k.length+1;let w=k[k.length-1]==="\r";if(w&&(k=k.slice(0,-1)),k&&m.length<c){let
|
|
64
|
+
`}},"prettifyError");ot.YAMLError=at;ot.YAMLParseError=Ks;ot.YAMLWarning=Us;ot.prettifyError=Nf});var ct=b(Pa=>{"use strict";function Ef(n,{flow:e,indicator:t,next:s,offset:r,onError:i,parentIndent:a,startOnNewline:l}){let c=!1,u=l,h=l,f="",p="",g=!1,y=!1,d=null,m=null,k=null,w=null,v=null,T=null,x=null;for(let S of n)switch(y&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&i(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),S.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&S.source.includes(" ")&&(d=S),h=!0;break;case"comment":{h||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=S.source.substring(1)||" ";f?f+=p+q:f=q,p="",u=!1;break}case"newline":u?f?f+=S.source:(!T||t!=="seq-item-ind")&&(c=!0):p+=S.source,u=!0,g=!0,(m||k)&&(w=S),h=!0;break;case"anchor":m&&i(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&i(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=S,x??(x=S.offset),u=!1,h=!1,y=!0;break;case"tag":{k&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),k=S,x??(x=S.offset),u=!1,h=!1,y=!0;break}case t:(m||k)&&i(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),T&&i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e??"collection"}`),T=S,u=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){v&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=S,u=!1,h=!1;break}default:i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,h=!1}let A=n[n.length-1],O=A?A.offset+A.source.length:r;return y&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(u&&d.indent<=a||s?.type==="block-map"||s?.type==="block-seq")&&i(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:T,spaceBefore:c,comment:f,hasNewline:g,anchor:m,tag:k,newlineAfterProp:w,end:O,start:x??O}}o(Ef,"resolveProps");Pa.resolveProps=Ef});var dn=b(Ca=>{"use strict";function Js(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
65
|
+
`))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(Js(e.key)||Js(e.value))return!0}return!1;default:return!0}}o(Js,"containsNewline");Ca.containsNewline=Js});var Vs=b($a=>{"use strict";var Of=dn();function Lf(n,e,t){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&Of.containsNewline(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}o(Lf,"flowIndentCheck");$a.flowIndentCheck=Lf});var Ws=b(Ia=>{"use strict";var qa=N();function Pf(n,e,t){let{uniqueKeys:s}=n.options;if(s===!1)return!1;let r=typeof s=="function"?s:(i,a)=>i===a||qa.isScalar(i)&&qa.isScalar(a)&&i.value===a.value;return e.some(i=>r(i.key,t))}o(Pf,"mapIncludes");Ia.mapIncludes=Pf});var Ba=b(Da=>{"use strict";var _a=ae(),Cf=le(),Ra=ct(),$f=dn(),Ma=Vs(),qf=Ws(),ja="All mapping items must start at the same column";function If({composeNode:n,composeEmptyNode:e},t,s,r,i){let a=i?.nodeClass??Cf.YAMLMap,l=new a(t.schema);t.atRoot&&(t.atRoot=!1);let c=s.offset,u=null;for(let h of s.items){let{start:f,key:p,sep:g,value:y}=h,d=Ra.resolveProps(f,{indicator:"explicit-key-ind",next:p??g?.[0],offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0}),m=!d.found;if(m){if(p&&(p.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==s.indent&&r(c,"BAD_INDENT",ja)),!d.anchor&&!d.tag&&!g){u=d.end,d.comment&&(l.comment?l.comment+=`
|
|
66
|
+
`+d.comment:l.comment=d.comment);continue}(d.newlineAfterProp||$f.containsNewline(p))&&r(p??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==s.indent&&r(c,"BAD_INDENT",ja);t.atKey=!0;let k=d.end,w=p?n(t,p,d,r):e(t,k,f,null,d,r);t.schema.compat&&Ma.flowIndentCheck(s.indent,p,r),t.atKey=!1,qf.mapIncludes(t,l.items,w)&&r(k,"DUPLICATE_KEY","Map keys must be unique");let v=Ra.resolveProps(g??[],{indicator:"map-value-ind",next:y,offset:w.range[2],onError:r,parentIndent:s.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=v.end,v.found){m&&(y?.type==="block-map"&&!v.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<v.found.offset-1024&&r(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let T=y?n(t,y,v,r):e(t,c,g,null,v,r);t.schema.compat&&Ma.flowIndentCheck(s.indent,y,r),c=T.range[2];let x=new _a.Pair(w,T);t.options.keepSourceTokens&&(x.srcToken=h),l.items.push(x)}else{m&&r(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(w.comment?w.comment+=`
|
|
67
|
+
`+v.comment:w.comment=v.comment);let T=new _a.Pair(w);t.options.keepSourceTokens&&(T.srcToken=h),l.items.push(T)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,c,u??c],l}o(If,"resolveBlockMap");Da.resolveBlockMap=If});var Ka=b(Fa=>{"use strict";var _f=ce(),Rf=ct(),Mf=Vs();function jf({composeNode:n,composeEmptyNode:e},t,s,r,i){let a=i?.nodeClass??_f.YAMLSeq,l=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=s.offset,u=null;for(let{start:h,value:f}of s.items){let p=Rf.resolveProps(h,{indicator:"seq-item-ind",next:f,offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||f)f?.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{u=p.end,p.comment&&(l.comment=p.comment);continue}let g=f?n(t,f,p,r):e(t,p.end,h,null,p,r);t.schema.compat&&Mf.flowIndentCheck(s.indent,f,r),c=g.range[2],l.items.push(g)}return l.range=[s.offset,c,u??c],l}o(jf,"resolveBlockSeq");Fa.resolveBlockSeq=jf});var qe=b(Ua=>{"use strict";function Df(n,e,t,s){let r="";if(n){let i=!1,a="";for(let l of n){let{source:c,type:u}=l;switch(u){case"space":i=!0;break;case"comment":{t&&!i&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let h=c.substring(1)||" ";r?r+=a+h:r=h,a="";break}case"newline":r&&(a+=c),i=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=c.length}}return{comment:r,offset:e}}o(Df,"resolveEnd");Ua.resolveEnd=Df});var Ya=b(Wa=>{"use strict";var Bf=N(),Ff=ae(),Ja=le(),Kf=ce(),Uf=qe(),Va=ct(),Jf=dn(),Vf=Ws(),Ys="Block collections are not allowed within flow collections",zs=o(n=>n&&(n.type==="block-map"||n.type==="block-seq"),"isBlock");function Wf({composeNode:n,composeEmptyNode:e},t,s,r,i){let a=s.start.source==="{",l=a?"flow map":"flow sequence",c=i?.nodeClass??(a?Ja.YAMLMap:Kf.YAMLSeq),u=new c(t.schema);u.flow=!0;let h=t.atRoot;h&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=s.offset+s.start.source.length;for(let m=0;m<s.items.length;++m){let k=s.items[m],{start:w,key:v,sep:T,value:x}=k,A=Va.resolveProps(w,{flow:l,indicator:"explicit-key-ind",next:v??T?.[0],offset:f,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!T&&!x){m===0&&A.comma?r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):m<s.items.length-1&&r(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),A.comment&&(u.comment?u.comment+=`
|
|
68
|
+
`+A.comment:u.comment=A.comment),f=A.end;continue}!a&&t.options.strict&&Jf.containsNewline(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)A.comma&&r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(A.comma||r(A.start,"MISSING_CHAR",`Missing , between ${l} items`),A.comment){let O="";e:for(let S of w)switch(S.type){case"comma":case"space":break;case"comment":O=S.source.substring(1);break e;default:break e}if(O){let S=u.items[u.items.length-1];Bf.isPair(S)&&(S=S.value??S.key),S.comment?S.comment+=`
|
|
69
|
+
`+O:S.comment=O,A.comment=A.comment.substring(O.length+1)}}if(!a&&!T&&!A.found){let O=x?n(t,x,A,r):e(t,A.end,T,null,A,r);u.items.push(O),f=O.range[2],zs(x)&&r(O.range,"BLOCK_IN_FLOW",Ys)}else{t.atKey=!0;let O=A.end,S=v?n(t,v,A,r):e(t,O,w,null,A,r);zs(v)&&r(S.range,"BLOCK_IN_FLOW",Ys),t.atKey=!1;let q=Va.resolveProps(T??[],{flow:l,indicator:"map-value-ind",next:x,offset:S.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(q.found){if(!a&&!A.found&&t.options.strict){if(T)for(let I of T){if(I===q.found)break;if(I.type==="newline"){r(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<q.found.offset-1024&&r(q.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else x&&("source"in x&&x.source?.[0]===":"?r(x,"MISSING_CHAR",`Missing space after : in ${l}`):r(q.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let te=x?n(t,x,q,r):q.found?e(t,q.end,T,null,q,r):null;te?zs(x)&&r(te.range,"BLOCK_IN_FLOW",Ys):q.comment&&(S.comment?S.comment+=`
|
|
70
|
+
`+q.comment:S.comment=q.comment);let Te=new Ff.Pair(S,te);if(t.options.keepSourceTokens&&(Te.srcToken=k),a){let I=u;Vf.mapIncludes(t,I.items,S)&&r(O,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(Te)}else{let I=new Ja.YAMLMap(t.schema);I.flow=!0,I.items.push(Te);let Wr=(te??S).range;I.range=[S.range[0],Wr[1],Wr[2]],u.items.push(I)}f=te?te.range[2]:q.end}}let p=a?"}":"]",[g,...y]=s.end,d=f;if(g?.source===p)d=g.offset+g.source.length;else{let m=l[0].toUpperCase()+l.substring(1),k=h?`${m} must end with a ${p}`:`${m} in block collection must be sufficiently indented and end with a ${p}`;r(f,h?"MISSING_CHAR":"BAD_INDENT",k),g&&g.source.length!==1&&y.unshift(g)}if(y.length>0){let m=Uf.resolveEnd(y,d,t.options.strict,r);m.comment&&(u.comment?u.comment+=`
|
|
71
|
+
`+m.comment:u.comment=m.comment),u.range=[s.offset,d,m.offset]}else u.range=[s.offset,d,d];return u}o(Wf,"resolveFlowCollection");Wa.resolveFlowCollection=Wf});var Ga=b(za=>{"use strict";var Yf=N(),zf=$(),Gf=le(),Qf=ce(),Hf=Ba(),Xf=Ka(),Zf=Ya();function Gs(n,e,t,s,r,i){let a=t.type==="block-map"?Hf.resolveBlockMap(n,e,t,s,i):t.type==="block-seq"?Xf.resolveBlockSeq(n,e,t,s,i):Zf.resolveFlowCollection(n,e,t,s,i),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}o(Gs,"resolveCollection");function ep(n,e,t,s,r){let i=s.tag,a=i?e.directives.tagName(i.source,p=>r(i,"TAG_RESOLVE_FAILED",p)):null;if(t.type==="block-seq"){let{anchor:p,newlineAfterProp:g}=s,y=p&&i?p.offset>i.offset?p:i:p??i;y&&(!g||g.offset<y.offset)&&r(y,"MISSING_CHAR","Missing newline after block sequence props")}let l=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!a||a==="!"||a===Gf.YAMLMap.tagName&&l==="map"||a===Qf.YAMLSeq.tagName&&l==="seq")return Gs(n,e,t,r,a);let c=e.schema.tags.find(p=>p.tag===a&&p.collection===l);if(!c){let p=e.schema.knownTags[a];if(p?.collection===l)e.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?r(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${l} collection, but expects ${p.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Gs(n,e,t,r,a)}let u=Gs(n,e,t,r,a,c),h=c.resolve?.(u,p=>r(i,"TAG_RESOLVE_FAILED",p),e.options)??u,f=Yf.isNode(h)?h:new zf.Scalar(h);return f.range=u.range,f.tag=a,c?.format&&(f.format=c.format),f}o(ep,"composeCollection");za.composeCollection=ep});var Hs=b(Qa=>{"use strict";var Qs=$();function tp(n,e,t){let s=e.offset,r=np(e,n.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};let i=r.mode===">"?Qs.Scalar.BLOCK_FOLDED:Qs.Scalar.BLOCK_LITERAL,a=e.source?sp(e.source):[],l=a.length;for(let d=a.length-1;d>=0;--d){let m=a[d][1];if(m===""||m==="\r")l=d;else break}if(l===0){let d=r.chomp==="+"&&a.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,a.length-1)):"",m=s+r.length;return e.source&&(m+=e.source.length),{value:d,type:i,comment:r.comment,range:[s,m,m]}}let c=e.indent+r.indent,u=e.offset+r.length,h=0;for(let d=0;d<l;++d){let[m,k]=a[d];if(k===""||k==="\r")r.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&t(u+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=m.length),h=d,c===0&&!n.atRoot&&t(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=m.length+k.length+1}for(let d=a.length-1;d>=l;--d)a[d][0].length>c&&(l=d+1);let f="",p="",g=!1;for(let d=0;d<h;++d)f+=a[d][0].slice(c)+`
|
|
73
|
+
`;for(let d=h;d<l;++d){let[m,k]=a[d];u+=m.length+k.length+1;let w=k[k.length-1]==="\r";if(w&&(k=k.slice(0,-1)),k&&m.length<c){let T=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(u-k.length-(w?2:1),"BAD_INDENT",T),m=""}i===Qs.Scalar.BLOCK_LITERAL?(f+=p+m.slice(c)+k,p=`
|
|
74
74
|
`):m.length>c||k[0]===" "?(p===" "?p=`
|
|
75
75
|
`:!g&&p===`
|
|
76
76
|
`&&(p=`
|
|
@@ -83,132 +83,134 @@ ${u}
|
|
|
83
83
|
`+a[d][0].slice(c);f[f.length-1]!==`
|
|
84
84
|
`&&(f+=`
|
|
85
85
|
`);break;default:f+=`
|
|
86
|
-
`}let y=
|
|
86
|
+
`}let y=s+r.length+e.source.length;return{value:f,type:i,comment:r.comment,range:[s,y,y]}}o(tp,"resolveBlockScalar");function np({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:r}=e[0],i=r[0],a=0,l="",c=-1;for(let p=1;p<r.length;++p){let g=r[p];if(!l&&(g==="-"||g==="+"))l=g;else{let y=Number(g);!a&&y?a=y:c===-1&&(c=n+p)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let u=!1,h="",f=r.length;for(let p=1;p<e.length;++p){let g=e[p];switch(g.type){case"space":u=!0;case"newline":f+=g.source.length;break;case"comment":t&&!u&&s(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=g.source.length,h=g.source.substring(1);break;case"error":s(g,"UNEXPECTED_TOKEN",g.message),f+=g.source.length;break;default:{let y=`Unexpected token in block scalar header: ${g.type}`;s(g,"UNEXPECTED_TOKEN",y);let d=g.source;d&&typeof d=="string"&&(f+=d.length)}}}return{mode:i,indent:a,chomp:l,comment:h,length:f}}o(np,"parseBlockScalarHeader");function sp(n){let e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),i=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let a=1;a<e.length;a+=2)i.push([e[a],e[a+1]]);return i}o(sp,"splitLines");Qa.resolveBlockScalar=tp});var Zs=b(Xa=>{"use strict";var Xs=$(),rp=qe();function ip(n,e,t){let{offset:s,type:r,source:i,end:a}=n,l,c,u=o((p,g,y)=>t(s+p,g,y),"_onError");switch(r){case"scalar":l=Xs.Scalar.PLAIN,c=ap(i,u);break;case"single-quoted-scalar":l=Xs.Scalar.QUOTE_SINGLE,c=op(i,u);break;case"double-quoted-scalar":l=Xs.Scalar.QUOTE_DOUBLE,c=lp(i,u);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}let h=s+i.length,f=rp.resolveEnd(a,h,e,t);return{value:c,type:l,comment:f.comment,range:[s,h,f.offset]}}o(ip,"resolveFlowScalar");function ap(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}`),Ha(n)}o(ap,"plainValue");function op(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Ha(n.slice(1,-1)).replace(/''/g,"'")}o(op,"singleQuotedValue");function Ha(n){let e=/(.*?)\r?\n/sy,t=e.exec(n);if(!t)return n;let s,r;try{s=new RegExp("(?<![ ])[ ]+$"),r=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{s=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let i=t[1].replace(s,""),a=" ",l=e.lastIndex;for(;t=e.exec(n);){let u=t[1].replace(r,"");u===""?a===`
|
|
87
87
|
`?i+=a:a=`
|
|
88
|
-
`:(i+=a+u,a=" "),l=e.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=l,t=c.exec(
|
|
88
|
+
`:(i+=a+u,a=" "),l=e.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=l,t=c.exec(n),i+a+(t?.[1]??"")}o(Ha,"unfoldLines");function lp(n,e){let t="";for(let s=1;s<n.length-1;++s){let r=n[s];if(!(r==="\r"&&n[s+1]===`
|
|
89
89
|
`))if(r===`
|
|
90
|
-
`){let{fold:i,offset:a}=
|
|
91
|
-
`)for(i=s
|
|
92
|
-
`)for(i=
|
|
93
|
-
`&&!(a==="\r"&&s
|
|
94
|
-
`)&&(t+=
|
|
95
|
-
`||
|
|
96
|
-
`);)
|
|
90
|
+
`){let{fold:i,offset:a}=cp(n,s);t+=i,s=a}else if(r==="\\"){let i=n[++s],a=up[i];if(a)t+=a;else if(i===`
|
|
91
|
+
`)for(i=n[s+1];i===" "||i===" ";)i=n[++s+1];else if(i==="\r"&&n[s+1]===`
|
|
92
|
+
`)for(i=n[++s+1];i===" "||i===" ";)i=n[++s+1];else if(i==="x"||i==="u"||i==="U"){let l=i==="x"?2:i==="u"?4:8;t+=fp(n,s+1,l,e),s+=l}else{let l=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),t+=l}}else if(r===" "||r===" "){let i=s,a=n[s+1];for(;a===" "||a===" ";)a=n[++s+1];a!==`
|
|
93
|
+
`&&!(a==="\r"&&n[s+2]===`
|
|
94
|
+
`)&&(t+=s>i?n.slice(i,s+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}o(lp,"doubleQuotedValue");function cp(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
|
|
95
|
+
`||s==="\r")&&!(s==="\r"&&n[e+2]!==`
|
|
96
|
+
`);)s===`
|
|
97
97
|
`&&(t+=`
|
|
98
|
-
`),e+=1,n
|
|
99
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
98
|
+
`),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}o(cp,"foldNewline");var up={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fp(n,e,t,s){let r=n.substr(e,t),a=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(a)}catch{let l=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}o(fp,"parseCharCode");Xa.resolveFlowScalar=ip});var to=b(eo=>{"use strict";var ye=N(),Za=$(),pp=Hs(),hp=Zs();function dp(n,e,t,s){let{value:r,type:i,comment:a,range:l}=e.type==="block-scalar"?pp.resolveBlockScalar(n,e,s):hp.resolveFlowScalar(e,n.options.strict,s),c=t?n.directives.tagName(t.source,f=>s(t,"TAG_RESOLVE_FAILED",f)):null,u;n.options.stringKeys&&n.atKey?u=n.schema[ye.SCALAR]:c?u=gp(n.schema,r,c,t,s):e.type==="scalar"?u=mp(n,r,e,s):u=n.schema[ye.SCALAR];let h;try{let f=u.resolve(r,p=>s(t??e,"TAG_RESOLVE_FAILED",p),n.options);h=ye.isScalar(f)?f:new Za.Scalar(f)}catch(f){let p=f instanceof Error?f.message:String(f);s(t??e,"TAG_RESOLVE_FAILED",p),h=new Za.Scalar(r)}return h.range=l,h.source=r,i&&(h.type=i),c&&(h.tag=c),u.format&&(h.format=u.format),a&&(h.comment=a),h}o(dp,"composeScalar");function gp(n,e,t,s,r){if(t==="!")return n[ye.SCALAR];let i=[];for(let l of n.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)i.push(l);else return l;for(let l of i)if(l.test?.test(e))return l;let a=n.knownTags[t];return a&&!a.collection?(n.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[ye.SCALAR])}o(gp,"findScalarTagByName");function mp({atKey:n,directives:e,schema:t},s,r,i){let a=t.tags.find(l=>(l.default===!0||n&&l.default==="key")&&l.test?.test(s))||t[ye.SCALAR];if(t.compat){let l=t.compat.find(c=>c.default&&c.test?.test(s))??t[ye.SCALAR];if(a.tag!==l.tag){let c=e.tagString(a.tag),u=e.tagString(l.tag),h=`Value may be parsed as either ${c} or ${u}`;i(r,"TAG_RESOLVE_FAILED",h,!0)}}return a}o(mp,"findScalarTagByTest");eo.composeScalar=dp});var so=b(no=>{"use strict";function yp(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let r=e[s];switch(r.type){case"space":case"comment":case"newline":n-=r.source.length;continue}for(r=e[++s];r?.type==="space";)n+=r.source.length,r=e[++s];break}}return n}o(yp,"emptyScalarPosition");no.emptyScalarPosition=yp});var ao=b(tr=>{"use strict";var bp=Ue(),kp=N(),wp=Ga(),ro=to(),Sp=qe(),vp=so(),Tp={composeNode:io,composeEmptyNode:er};function io(n,e,t,s){let r=n.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=t,u,h=!0;switch(e.type){case"alias":u=Ap(n,e,s),(l||c)&&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":u=ro.composeScalar(n,e,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=wp.composeCollection(Tp,n,e,t,s),l&&(u.anchor=l.source.substring(1))}catch(f){let p=f instanceof Error?f.message:String(f);s(e,"RESOURCE_EXHAUSTION",p)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),h=!1}}return u??(u=er(n,e.offset,void 0,null,t,s)),l&&u.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&n.options.stringKeys&&(!kp.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?u.comment=a:u.commentBefore=a),n.options.keepSourceTokens&&h&&(u.srcToken=e),u}o(io,"composeNode");function er(n,e,t,s,{spaceBefore:r,comment:i,anchor:a,tag:l,end:c},u){let h={type:"scalar",offset:vp.emptyScalarPosition(e,t,s),indent:-1,source:""},f=ro.composeScalar(n,h,l,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=c),f}o(er,"composeEmptyNode");function Ap({options:n},{offset:e,source:t,end:s},r){let i=new bp.Alias(t.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+t.length,l=Sp.resolveEnd(s,a,n.strict,r);return i.range=[e,a,l.offset],l.comment&&(i.comment=l.comment),i}o(Ap,"composeAlias");tr.composeEmptyNode=er;tr.composeNode=io});var co=b(lo=>{"use strict";var xp=it(),oo=ao(),Np=qe(),Ep=ct();function Op(n,e,{offset:t,start:s,value:r,end:i},a){let l=Object.assign({_directives:e},n),c=new xp.Document(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},h=Ep.resolveProps(s,{indicator:"doc-start",next:r??i?.[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});h.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!h.hasNewline&&a(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?oo.composeNode(u,r,h,a):oo.composeEmptyNode(u,h.end,s,null,h,a);let f=c.contents.range[2],p=Np.resolveEnd(i,f,!1,a);return p.comment&&(c.comment=p.comment),c.range=[t,f,p.offset],c}o(Op,"composeDoc");lo.composeDoc=Op});var sr=b(po=>{"use strict";var Lp=Tt("process"),Pp=Kn(),Cp=it(),ut=lt(),uo=N(),$p=co(),qp=qe();function ft(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)]}o(ft,"getErrorPos");function fo(n){let e="",t=!1,s=!1;for(let r=0;r<n.length;++r){let i=n[r];switch(i[0]){case"#":e+=(e===""?"":s?`
|
|
100
100
|
|
|
101
101
|
`:`
|
|
102
|
-
`)+(i.substring(1)||" "),t=!0,
|
|
103
|
-
${
|
|
104
|
-
${l}`:
|
|
105
|
-
${a}`:
|
|
106
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
102
|
+
`)+(i.substring(1)||" "),t=!0,s=!1;break;case"%":n[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}o(fo,"parsePrelude");var nr=class{static{o(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,r,i)=>{let a=ft(t);i?this.warnings.push(new ut.YAMLWarning(a,s,r)):this.errors.push(new ut.YAMLParseError(a,s,r))},this.directives=new Pp.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:r}=fo(this.prelude);if(s){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${s}`:s;else if(r||e.directives.docStart||!i)e.commentBefore=s;else if(uo.isCollection(i)&&!i.flow&&i.items.length>0){let a=i.items[0];uo.isPair(a)&&(a=a.key);let l=a.commentBefore;a.commentBefore=l?`${s}
|
|
104
|
+
${l}`:s}else{let a=i.commentBefore;i.commentBefore=a?`${s}
|
|
105
|
+
${a}`:s}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:fo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let r of e)yield*this.next(r);yield*this.end(t,s)}*next(e){switch(Lp.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,s,r)=>{let i=ft(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=$p.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 ut.YAMLParseError(ft(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 ut.YAMLParseError(ft(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let t=qp.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}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ut.YAMLParseError(ft(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),r=new Cp.Document(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}};po.Composer=nr});var mo=b(gn=>{"use strict";var Ip=Hs(),_p=Zs(),Rp=lt(),ho=ze();function Mp(n,e=!0,t){if(n){let s=o((r,i,a)=>{let l=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(t)t(l,i,a);else throw new Rp.YAMLParseError([l,l+1],i,a)},"_onError");switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return _p.resolveFlowScalar(n,e,s);case"block-scalar":return Ip.resolveBlockScalar({options:{strict:e}},n,s)}}return null}o(Mp,"resolveAsScalar");function jp(n,e){let{implicitKey:t=!1,indent:s,inFlow:r=!1,offset:i=-1,type:a="PLAIN"}=e,l=ho.stringifyString({type:a,value:n},{implicitKey:t,indent:s>0?" ".repeat(s):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:s,source:`
|
|
107
107
|
`}];switch(l[0]){case"|":case">":{let u=l.indexOf(`
|
|
108
108
|
`),h=l.substring(0,u),f=l.substring(u+1)+`
|
|
109
|
-
`,p=[{type:"block-scalar-header",offset:i,indent:
|
|
110
|
-
`}),{type:"block-scalar",offset:i,indent:
|
|
111
|
-
`),
|
|
112
|
-
`;if(
|
|
113
|
-
`});for(let c of Object.keys(
|
|
114
|
-
`};delete
|
|
109
|
+
`,p=[{type:"block-scalar-header",offset:i,indent:s,source:h}];return go(p,c)||p.push({type:"newline",offset:-1,indent:s,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:i,indent:s,props:p,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:s,source:l,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:s,source:l,end:c};default:return{type:"scalar",offset:i,indent:s,source:l,end:c}}}o(jp,"createScalarToken");function Dp(n,e,t={}){let{afterKey:s=!1,implicitKey:r=!1,inFlow:i=!1,type:a}=t,l="indent"in n?n.indent:null;if(s&&typeof l=="number"&&(l+=2),!a)switch(n.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let u=n.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=ho.stringifyString({type:a,value:e},{implicitKey:r||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Bp(n,c);break;case'"':rr(n,c,"double-quoted-scalar");break;case"'":rr(n,c,"single-quoted-scalar");break;default:rr(n,c,"scalar")}}o(Dp,"setScalarValue");function Bp(n,e){let t=e.indexOf(`
|
|
111
|
+
`),s=e.substring(0,t),r=e.substring(t+1)+`
|
|
112
|
+
`;if(n.type==="block-scalar"){let i=n.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=s,n.source=r}else{let{offset:i}=n,a="indent"in n?n.indent:-1,l=[{type:"block-scalar-header",offset:i,indent:a,source:s}];go(l,"end"in n?n.end:void 0)||l.push({type:"newline",offset:-1,indent:a,source:`
|
|
113
|
+
`});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:a,props:l,source:r})}}o(Bp,"setBlockScalarValue");function go(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}o(go,"addEndtoBlockProps");function rr(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),r=e.length;n.props[0].type==="block-scalar-header"&&(r-=n.props[0].source.length);for(let i of s)i.offset+=r;delete n.props,Object.assign(n,{type:t,source:e,end:s});break}case"block-map":case"block-seq":{let r={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
114
|
+
`};delete n.items,Object.assign(n,{type:t,source:e,end:[r]});break}default:{let s="indent"in n?n.indent:-1,r="end"in n&&Array.isArray(n.end)?n.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(n))i!=="type"&&i!=="offset"&&delete n[i];Object.assign(n,{type:t,indent:s,source:e,end:r})}}}o(rr,"setFlowScalarValue");gn.createScalarToken=jp;gn.resolveAsScalar=Mp;gn.setScalarValue=Dp});var bo=b(yo=>{"use strict";var Fp=o(n=>"type"in n?yn(n):mn(n),"stringify");function yn(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=yn(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=mn(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=mn(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=mn(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}}}o(yn,"stringifyToken");function mn({start:n,key:e,sep:t,value:s}){let r="";for(let i of n)r+=i.source;if(e&&(r+=yn(e)),t)for(let i of t)r+=i.source;return s&&(r+=yn(s)),r}o(mn,"stringifyItem");yo.stringify=Fp});var vo=b(So=>{"use strict";var ir=Symbol("break visit"),Kp=Symbol("skip children"),ko=Symbol("remove item");function be(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),wo(Object.freeze([]),n,e)}o(be,"visit");be.BREAK=ir;be.SKIP=Kp;be.REMOVE=ko;be.itemAtPath=(n,e)=>{let t=n;for(let[s,r]of e){let i=t?.[s];if(i&&"items"in i)t=i.items[r];else return}return t};be.parentCollection=(n,e)=>{let t=be.itemAtPath(n,e.slice(0,-1)),s=e[e.length-1][0],r=t?.[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function wo(n,e,t){let s=t(e,n);if(typeof s=="symbol")return s;for(let r of["key","value"]){let i=e[r];if(i&&"items"in i){for(let a=0;a<i.items.length;++a){let l=wo(Object.freeze(n.concat([[r,a]])),i.items[a],t);if(typeof l=="number")a=l-1;else{if(l===ir)return ir;l===ko&&(i.items.splice(a,1),a-=1)}}typeof s=="function"&&r==="key"&&(s=s(e,n))}}return typeof s=="function"?s(e,n):s}o(wo,"_visit");So.visit=be});var bn=b(D=>{"use strict";var ar=mo(),Up=bo(),Jp=vo(),or="\uFEFF",lr="",cr="",ur="",Vp=o(n=>!!n&&"items"in n,"isCollection"),Wp=o(n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar"),"isScalar");function Yp(n){switch(n){case or:return"<BOM>";case lr:return"<DOC>";case cr:return"<FLOW_END>";case ur:return"<SCALAR>";default:return JSON.stringify(n)}}o(Yp,"prettyToken");function zp(n){switch(n){case or:return"byte-order-mark";case lr:return"doc-mode";case cr:return"flow-error-end";case ur:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
115
|
`:case`\r
|
|
116
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(
|
|
117
|
-
`:case"\r":case" ":return!0;default:return!1}}o(U,"isEmpty");var
|
|
118
|
-
\r `),
|
|
116
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(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}o(zp,"tokenType");D.createScalarToken=ar.createScalarToken;D.resolveAsScalar=ar.resolveAsScalar;D.setScalarValue=ar.setScalarValue;D.stringify=Up.stringify;D.visit=Jp.visit;D.BOM=or;D.DOCUMENT=lr;D.FLOW_END=cr;D.SCALAR=ur;D.isCollection=Vp;D.isScalar=Wp;D.prettyToken=Yp;D.tokenType=zp});var hr=b(Ao=>{"use strict";var pt=bn();function U(n){switch(n){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}o(U,"isEmpty");var To=new Set("0123456789ABCDEFabcdef"),Gp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),kn=new Set(",[]{}"),Qp=new Set(` ,[]{}
|
|
118
|
+
\r `),fr=o(n=>!n||Qp.has(n),"isNotAnchorChar"),pr=class{static{o(this,"Lexer")}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===`
|
|
119
119
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
120
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let
|
|
121
|
-
`||!r&&!this.atEnd)return e+
|
|
122
|
-
`||
|
|
123
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
124
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=
|
|
125
|
-
`,i)}r!==-1&&(t=r-(
|
|
120
|
+
`:!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 r=this.buffer[s+e+1];if(r===`
|
|
121
|
+
`||!r&&!this.atEnd)return e+s+1}return t===`
|
|
122
|
+
`||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&U(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
123
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===pt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){let i=e[s-1];if(i===" "||i===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let i=e[t-1];if(i===" "||i===" ")t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),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 pt.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==="...")&&U(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&&!U(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===":")&&U(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(fr),"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 r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&U(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield pt.FLOW_END,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(fr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||U(a)||a===",")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 i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let s=this.buffer.substring(0,t),r=s.indexOf(`
|
|
124
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
|
|
125
|
+
`,i)}r!==-1&&(t=r-(s[r-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=>U(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":t+=1;break;case`
|
|
126
126
|
`:e=i,t=0;break;case"\r":{let a=this.buffer[i+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
127
|
-
`)break}default:break e}if(!
|
|
128
|
-
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(
|
|
129
|
-
`;)
|
|
130
|
-
`&&i>=this.pos&&i+1+t>l)e=i;else break}while(!0);return yield
|
|
131
|
-
`?(
|
|
132
|
-
`,i=this.buffer[
|
|
133
|
-
`){let a=this.continueScalar(
|
|
127
|
+
`)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 i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
128
|
+
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
129
|
+
`;)s=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let i=e-1,a=this.buffer[i];a==="\r"&&(a=this.buffer[--i]);let l=i;for(;a===" ";)a=this.buffer[--i];if(a===`
|
|
130
|
+
`&&i>=this.pos&&i+1+t>l)e=i;else break}while(!0);return yield pt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){let i=this.buffer[s+1];if(U(i)||e&&kn.has(i))break;t=s}else if(U(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
|
|
131
|
+
`?(s+=1,r=`
|
|
132
|
+
`,i=this.buffer[s+1]):t=s),i==="#"||e&&kn.has(i))break;if(r===`
|
|
133
|
+
`){let a=this.continueScalar(s+1);if(a===-1)break;s=Math.max(s,a-2)}}else{if(e&&kn.has(r))break;t=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield pt.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(fr),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(U(s)||t&&kn.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(;!U(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(Gp.has(t))t=this.buffer[++e];else if(t==="%"&&To.has(this.buffer[e+1])&&To.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===`
|
|
134
134
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
135
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,
|
|
135
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};Ao.Lexer=pr});var gr=b(xo=>{"use strict";var dr=class{static{o(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){let i=t+s>>1;this.lineStarts[i]<e?t=i+1:s=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};xo.LineCounter=dr});var yr=b(Po=>{"use strict";var Hp=Tt("process"),No=bn(),Xp=hr();function ue(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}o(ue,"includesToken");function Eo(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}o(Eo,"findNonEmptyIndex");function Lo(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}o(Lo,"isFlowToken");function wn(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[]}}o(wn,"getPrevProps");function Ie(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)}o(Ie,"getFirstKeyStartProps");function Sn(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}o(Sn,"arrayPushArray");function Oo(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!ue(e.start,"explicit-key-ind")&&!ue(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Lo(e.value)?e.value.end?Sn(e.value.end,e.sep):e.value.end=e.sep:Sn(e.start,e.sep),delete e.sep)}o(Oo,"fixFlowSeqItems");var mr=class{static{o(this,"Parser")}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 Xp.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,Hp.env.LOG_TOKENS&&console.log("|",No.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=No.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"&&Oo(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{let r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{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 r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Eo(r.start)===-1&&(t.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.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":{Eo(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=wn(this.peek(2)),s=Ie(t),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
136
136
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
-
`,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
|
|
137
|
+
`,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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Sn(r,t.start),r.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,r=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&t.sep&&!t.value){let a=[];for(let l=0;l<t.sep.length;++l){let c=t.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(i=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),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):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ue(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Lo(t.key)&&!ue(t.sep,"newline")){let a=Ie(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(ue(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let a=Ie(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):ue(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 a=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ue(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:i});this.stack.push(a);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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Sn(r,t.start),r.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||ue(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 r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let r=wn(s),i=Ie(r);Oo(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
138
138
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
-
`,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=
|
|
140
|
-
`),{scm:
|
|
141
|
-
`),!0}}o(
|
|
142
|
-
`).map(t=>t.trim()).filter(t=>t!=="")}o(
|
|
143
|
-
`),t)}o(gr,"resolveProjectRoot");function qh(s,e){let t=mr(e),n=$h(s);return{activeSite:n,match:n===t,targetSite:t}}o(qh,"compareSites");function mr(s){let e=s.trim(),t=e.includes("://")?e:`https://${e}`,n;try{n=new URL(t).hostname}catch(r){throw new Error(`not a URL or a host: '${s}'`,{cause:r})}if(n==="")throw new Error(`not a URL or a host: '${s}'`);return n.toLowerCase()}o(mr,"normalizeSite");function $h(s){let e=/^\s*Site:\s*(\S+)\s*$/m.exec(s)?.[1];if(e===void 0)return null;try{return mr(e)}catch{return null}}o($h,"parseActiveSite");async function yr(s,e){let t=mr(s),n=await e(["jira","auth","status"]);return n.exitCode!==0?{activeSite:null,match:!1,targetSite:t}:qh(n.stdout,t)}o(yr,"readSiteCheck");function Sr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}o(Sr,"L");var we=Sr();function nl(s){we=s}o(nl,"G");var yt={exec:o(()=>null,"exec")};function O(s,e=""){let t=typeof s=="string"?s:s.source,n={replace:o((r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(M.caret,"$1"),t=t.replace(r,a),n},"replace"),getRegex:o(()=>new RegExp(t,e),"getRegex")};return n}o(O,"d");var Ch=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),M={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o(s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),"headingBeginRegex"),htmlBeginRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex")},Ih=/^(?:[ \t]*(?:\n|$))+/,_h=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Rh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,bt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vr=/(?:[*+-]|\d{1,9}[.)])/,rl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,il=O(rl).replace(/bull/g,vr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),jh=O(rl).replace(/bull/g,vr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ar=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Dh=/^[^\n]+/,Tr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Bh=O(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Fh=O(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,vr).getRegex(),vs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",xr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kh=O("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",xr).replace("tag",vs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),al=O(Ar).replace("hr",bt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vs).getRegex(),Uh=O(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",al).getRegex(),Nr={blockquote:Uh,code:_h,def:Bh,fences:Rh,heading:Mh,hr:bt,html:Kh,lheading:il,list:Fh,newline:Ih,paragraph:al,table:yt,text:Dh},Ho=O("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vs).getRegex(),Yh={...Nr,lheading:jh,table:Ho,paragraph:O(Ar).replace("hr",bt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ho).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vs).getRegex()},Jh={...Nr,html:O(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:yt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:O(Ar).replace("hr",bt).replace("heading",` *#{1,6} *[^
|
|
144
|
-
]`).replace("lheading",
|
|
139
|
+
`,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=wn(e),s=Ie(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=wn(e),s=Ie(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())}}};Po.Parser=mr});var _o=b(dt=>{"use strict";var Co=sr(),Zp=it(),ht=lt(),eh=ts(),th=N(),nh=gr(),$o=yr();function qo(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new nh.LineCounter||null,prettyErrors:e}}o(qo,"parseOptions");function sh(n,e={}){let{lineCounter:t,prettyErrors:s}=qo(e),r=new $o.Parser(t?.addNewLine),i=new Co.Composer(e),a=Array.from(i.compose(r.parse(n)));if(s&&t)for(let l of a)l.errors.forEach(ht.prettifyError(n,t)),l.warnings.forEach(ht.prettifyError(n,t));return a.length>0?a:Object.assign([],{empty:!0},i.streamInfo())}o(sh,"parseAllDocuments");function Io(n,e={}){let{lineCounter:t,prettyErrors:s}=qo(e),r=new $o.Parser(t?.addNewLine),i=new Co.Composer(e),a=null;for(let l of i.compose(r.parse(n),!0,n.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new ht.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(a.errors.forEach(ht.prettifyError(n,t)),a.warnings.forEach(ht.prettifyError(n,t))),a}o(Io,"parseDocument");function rh(n,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=Io(n,t);if(!r)return null;if(r.warnings.forEach(i=>eh.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},t))}o(rh,"parse");function ih(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 r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(n===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return th.isDocument(n)&&!s?n.toString(t):new Zp.Document(n,s,t).toString(t)}o(ih,"stringify");dt.parse=rh;dt.parseAllDocuments=sh;dt.parseDocument=Io;dt.stringify=ih});var Mo=b(P=>{"use strict";var ah=sr(),oh=it(),lh=Ms(),br=lt(),ch=Ue(),fe=N(),uh=ae(),fh=$(),ph=le(),hh=ce(),dh=bn(),gh=hr(),mh=gr(),yh=yr(),vn=_o(),Ro=De();P.Composer=ah.Composer;P.Document=oh.Document;P.Schema=lh.Schema;P.YAMLError=br.YAMLError;P.YAMLParseError=br.YAMLParseError;P.YAMLWarning=br.YAMLWarning;P.Alias=ch.Alias;P.isAlias=fe.isAlias;P.isCollection=fe.isCollection;P.isDocument=fe.isDocument;P.isMap=fe.isMap;P.isNode=fe.isNode;P.isPair=fe.isPair;P.isScalar=fe.isScalar;P.isSeq=fe.isSeq;P.Pair=uh.Pair;P.Scalar=fh.Scalar;P.YAMLMap=ph.YAMLMap;P.YAMLSeq=hh.YAMLSeq;P.CST=dh;P.Lexer=gh.Lexer;P.LineCounter=mh.LineCounter;P.Parser=yh.Parser;P.parse=vn.parse;P.parseAllDocuments=vn.parseAllDocuments;P.parseDocument=vn.parseDocument;P.stringify=vn.stringify;P.visit=Ro.visit;P.visitAsync=Ro.visitAsync});import{execFile as Bd}from"node:child_process";import{mkdtemp as Pl,readFile as Fd,rm as Cl,stat as Kd,writeFile as Jr}from"node:fs/promises";import{tmpdir as $l}from"node:os";import St from"node:path";import B from"node:process";import{promisify as Ud}from"node:util";function Yr(n){return n instanceof Error||Object.prototype.toString.call(n)==="[object Error]"}o(Yr,"isError");function G(n){try{return Yr(n)&&typeof n.message=="string"&&n.message!==""?n.message:String(n)}catch{return"[unstringifiable value]"}}o(G,"describeError");import{readFile as bh}from"node:fs/promises";import{homedir as kh}from"node:os";import wr from"node:path";import wh from"node:process";function je(n,e){let t=new Error(`${n}: ${G(e)}`,{cause:e});return typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(t,je),t}o(je,"chainError");var Jo=Ul(Mo(),1);function kr(n,e){return Do(n)&&n.code===e}o(kr,"isErrorCode");function gt(n){return kr(n,"ENOENT")}o(gt,"isEnoent");function jo(n){return kr(n,"ENOENT")||kr(n,"ENOTDIR")}o(jo,"isMissingFile");function E(n){return Do(n)&&!Array.isArray(n)}o(E,"isRecord");function Do(n){return typeof n=="object"&&n!==null}o(Do,"isObject");var Bo=["both","none","remote"],Fo=["merge","rebase","squash"];async function Vo(n){let e=n.home??kh(),t=wr.join(n.cwd,".agents","preferences.yaml"),s=wr.join(e,".agents","preferences.yaml"),r=await Sr(t),i=await Sr(s);Uo(t,r),Uo(s,i);let a=Sh(i?.value,r?.value),l=Wo(a,{warn:!0}),c={...r!==null&&{project:t},...i!==null&&{global:s}};return{preferences:l,sources:c}}o(Vo,"readPreferences");async function Tn(n){let e=await Sr(wr.join(n,".agents","preferences.yaml"));return E(e?.value)?e.value:{}}o(Tn,"readProjectPreferences");async function Sr(n){let e;try{e=await bh(n,"utf8")}catch(s){if(gt(s))return null;throw s}let t;try{t=(0,Jo.parse)(e)}catch(s){throw je(`${n}: malformed YAML`,s)}return{value:t??{}}}o(Sr,"readOptionalYaml");function Sh(n,e){let t=E(n)?{...n}:{};if(!E(e))return t;for(let[s,r]of Object.entries(e)){let i=t[s];t[s]=E(i)&&E(r)?{...i,...r}:r}return t}o(Sh,"mergeSections");function Wo(n,e){let t=Th(n,e);if(n.project!==void 0){let s=X(n.project,"project"),r={};s.slug!==void 0&&(r.slug=pe(s.slug,"project.slug")),s.ticket_ref_prefix!==void 0&&(r.ticket_ref_prefix=pe(s.ticket_ref_prefix,"project.ticket_ref_prefix")),t.project=r}if(n.repository!==void 0){let s=X(n.repository,"repository"),r={};if(s.slug!==void 0&&(r.slug=pe(s.slug,"repository.slug")),s.default_remote!==void 0){let i=X(s.default_remote,"repository.default_remote"),a={};i.name!==void 0&&(a.name=pe(i.name,"repository.default_remote.name")),i.default_branch!==void 0&&(a.default_branch=pe(i.default_branch,"repository.default_remote.default_branch")),r.default_remote=a}t.repository=r}if(n.artifacts!==void 0){let s=X(n.artifacts,"artifacts"),r={};if(s.base_dir!==void 0&&(r.base_dir=pe(s.base_dir,"artifacts.base_dir")),s.paths!==void 0){let i=X(s.paths,"artifacts.paths"),a={};for(let[l,c]of Object.entries(i))a[l]=pe(c,`artifacts.paths.${l}`);r.paths=a}t.artifacts=r}if(n.ticket!==void 0){let s=X(n.ticket,"ticket"),r={};s.base_url!==void 0&&(r.base_url=pe(s.base_url,"ticket.base_url")),t.ticket=r}if(n.pr!==void 0){let s=X(n.pr,"pr");s.initial_state!==void 0&&(t.pr={initial_state:Nh(s.initial_state)})}return Object.assign(t,vh(n.merge)),Object.assign(t,Ah(n.triage_feedback)),t}o(Wo,"projectPreferences");function vh(n){if(n===void 0)return{};let e=X(n,"merge"),t={};return e.approval!==void 0&&(t.approval=xh(e.approval)),e.deletion_strategy!==void 0&&(t.deletion_strategy=Ko(e.deletion_strategy,"merge.deletion_strategy",Bo)),e.strategy!==void 0&&(t.strategy=Ko(e.strategy,"merge.strategy",Fo)),Object.keys(t).length===0?{}:{merge:t}}o(vh,"projectMerge");function Th(n,e){let t=n.scm??n.platform;return t===void 0?{}:(n.scm===void 0&&e.warn&&wh.stderr.write(`preferences: the top-level 'platform' key is deprecated; rename it to 'scm'.
|
|
140
|
+
`),{scm:Eh(t)})}o(Th,"projectScm");function Ah(n){if(n===void 0)return{};let e=X(n,"triage_feedback");return e.defer_days===void 0?{}:{triage_feedback:{defer_days:Lh(e.defer_days,"triage_feedback.defer_days")}}}o(Ah,"projectTriageFeedback");function xh(n){if(n==="ask"||n==="auto")return n;throw new Error(`preferences: 'merge.approval' must be "ask" or "auto" (got ${ke(n)})`)}o(xh,"expectMergeApproval");function Ko(n,e,t){let s=t.find(r=>r===n);if(s!==void 0)return s;throw new Error(`preferences: '${e}' must be ${Oh(t)} (got ${ke(n)})`)}o(Ko,"expectMember");function Nh(n){if(n==="draft"||n==="ready")return n;throw new Error(`preferences: 'pr.initial_state' must be "draft" or "ready" (got ${ke(n)})`)}o(Nh,"expectPrInitialState");function Eh(n){if(n==="github"||n==="bitbucket")return n;throw new Error(`preferences: 'scm' must be "github" or "bitbucket" (got ${ke(n)})`)}o(Eh,"expectScm");function Oh(n){let e=n.map(t=>JSON.stringify(t));return e.length<=2?e.join(" or "):`${e.slice(0,-1).join(", ")}, or ${e.at(-1)}`}o(Oh,"formatChoices");function Lh(n,e){if(typeof n=="number"&&Number.isSafeInteger(n)&&n>0)return n;throw new Error(`preferences: '${e}' must be a positive integer (got ${ke(n)})`)}o(Lh,"expectPositiveInteger");function pe(n,e){if(typeof n=="string")return n;throw new Error(`preferences: '${e}' must be a string (got ${ke(n)})`)}o(pe,"expectString");function X(n,e){if(E(n))return n;throw new Error(`preferences: '${e}' must be an object (got ${ke(n)})`)}o(X,"expectRecord");function Uo(n,e){if(!(e===null||!E(e.value)))try{Wo(e.value,{warn:!1})}catch(t){throw je(n,t)}}o(Uo,"validateFile");function ke(n){if(typeof n=="string")return JSON.stringify(n);try{return JSON.stringify(n)}catch{return String(n)}}o(ke,"formatValue");import{realpathSync as Yo}from"node:fs";import zo from"node:process";import{fileURLToPath as Ph}from"node:url";function Go(n,e){let t=zo.argv[1];if(t===void 0)return!1;try{return Yo(Ph(n))===Yo(t)}catch(s){return zo.stderr.write(`${e}: warning: could not determine entry point: ${G(s)}
|
|
141
|
+
`),!0}}o(Go,"isEntryPoint");function Qo(n,e){let t=[],s=[];for(let r=0;r<n.length;r+=1){let i=n[r];if(i===void 0)continue;if(!i.startsWith("--")){t.push(i);continue}let a=Ch(i,e);if(a===null)throw new Error(`unknown flag: ${i}`);let{spec:l,inlineValue:c}=a;if(!l.takesValue){if(c!==null)throw new Error(`--${l.name} does not take a value`);s.push({name:l.name,value:null});continue}if(c!==null){s.push({name:l.name,value:c});continue}let u=n[r+1]??null;if(u===null||u.startsWith("--"))throw new Error(`--${l.name} requires a value`);s.push({name:l.name,value:u}),r+=1}return{positionals:t,flags:s}}o(Qo,"scanFlags");function Ho(n){let e={};for(let{name:t,value:s}of n)s!==null&&(e[t]=s);return e}o(Ho,"valueFlagMap");function Ch(n,e){for(let t of e)for(let s of[t.name,...t.aliases??[]]){let r=`--${s}`;if(n===r)return{spec:t,inlineValue:null};if(n.startsWith(`${r}=`))return{spec:t,inlineValue:n.slice(r.length+1)}}return null}o(Ch,"matchFlag");import{readFile as $h}from"node:fs/promises";import qh from"node:path";var vr={markers:{breaking:{emoji:"\u{1F6A8}",label:"Breaking"}},tiers:["public","internal","process"],types:[{aliases:["feature"],breakingPolicy:"optional",description:"A change that gives consumers a new capability or extends an existing one.",emoji:"\u{1F389}",key:"feat",label:"Features",tier:"public",trackerLabel:"feature"},{aliases:[],breakingPolicy:"optional",description:"A change that removes a capability or surface on which consumers depend.",emoji:"\u{1FAA6}",key:"drop",label:"Removed",tier:"public",trackerLabel:"removal"},{aliases:[],breakingPolicy:"forbidden",description:"A change that marks a capability or surface for removal while the capability or surface keeps working.",emoji:"\u{1F5D1}\uFE0F",key:"deprecate",label:"Deprecated",tier:"public",trackerLabel:"deprecation"},{aliases:["bugfix"],breakingPolicy:"optional",description:"A change that corrects behavior that consumers meet and that differs from what was intended.",emoji:"\u{1F41B}",key:"fix",label:"Bug fixes",tier:"public",trackerLabel:"fix"},{aliases:["security"],breakingPolicy:"optional",description:"A change that closes a vulnerability or hardens a consumer-facing surface against attack.",emoji:"\u{1F512}",key:"sec",label:"Security",tier:"public",trackerLabel:"security"},{aliases:["performance"],breakingPolicy:"optional",description:"A change that reduces the time, memory, or other resources that consumer-facing work uses, without changing its result.",emoji:"\u26A1",key:"perf",label:"Performance",tier:"public",trackerLabel:"performance"},{aliases:["utility"],breakingPolicy:"forbidden",description:"A change that adds, extends, or repairs a capability that consumers do not use directly, such as a helper or an internal module.",emoji:"\u{1F3D7}\uFE0F",key:"internal",label:"Internal features",tier:"internal",trackerLabel:"internal"},{aliases:[],breakingPolicy:"forbidden",description:"A change that restructures existing code without changing its behavior.",emoji:"\u267B\uFE0F",key:"refactor",label:"Refactoring",tier:"internal",trackerLabel:"refactoring"},{aliases:["test"],breakingPolicy:"forbidden",description:"A change confined to tests, test fixtures, or test helpers, including one that unblocks a build or a type check.",emoji:"\u{1F9EA}",key:"tests",label:"Tests",tier:"internal",trackerLabel:"tests"},{aliases:[],breakingPolicy:"forbidden",description:"A change to the tools used to develop the project: build, lint, formatting, and release configuration, and development scripts.",emoji:"\u2699\uFE0F",key:"tooling",label:"Tooling",tier:"process",trackerLabel:"tooling"},{aliases:[],breakingPolicy:"forbidden",description:"A change to continuous-integration workflows and their configuration.",emoji:"\u{1F477}",key:"ci",label:"CI",tier:"process",trackerLabel:"ci"},{aliases:["dep"],breakingPolicy:"forbidden",description:"A change that adds, removes, or upgrades a dependency, including its lockfile and version-catalog entries.",emoji:"\u{1F4E6}",key:"deps",label:"Dependencies",tier:"process",trackerLabel:"dependencies"},{aliases:[],breakingPolicy:"forbidden",description:"A change to guidance on working in the repository itself, such as its `AGENTS.md` or a repo-local skill, or to the repository's agent configuration.",emoji:"\u{1F916}",key:"ai",label:"Agentic support",tier:"process",trackerLabel:"ai"},{aliases:["doc"],breakingPolicy:"forbidden",description:"A change to documentation for human readers, such as a README, a guide, or a code comment.",emoji:"\u{1F4DA}",key:"docs",label:"Documentation",tier:"process",trackerLabel:"documentation"},{aliases:[],breakingPolicy:"forbidden",description:"A change to formatting alone, such as whitespace or line wrapping, that leaves the content unchanged.",emoji:"\u{1F3A8}",excludedFromChangelog:!0,key:"fmt",label:"Formatting",tier:"process",trackerLabel:"formatting"}],version:"1.3.0"};function Xo(n=vr){return{...n,types:n.types.map(({trackerLabel:e,...t})=>t)}}o(Xo,"buildWorkTypesDocument");async function Zo(n){let e=await _h(n);if(e===null)return null;let t=[];for(let r of e.types)!E(r)||typeof r.key!="string"||typeof r.tier!="string"||t.push({workType:{key:r.key,tier:r.tier},aliases:Ih(r.aliases)});let s=new Map;for(let{workType:r,aliases:i}of t)for(let a of i)s.set(a,r);for(let{workType:r}of t)s.set(r.key,r);return s}o(Zo,"loadWorkTypes");function el(n,e){let t=n.endsWith("!"),s=e.get(t?n.slice(0,-1):n);return s===void 0?null:{workType:s,breaking:t}}o(el,"resolveWorkType");function tl(n){return!E(n)||!Array.isArray(n.types)?null:{markers:n.markers,tiers:n.tiers,types:n.types}}o(tl,"parseTaxonomy");function Ih(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"):[]}o(Ih,"readAliases");async function _h(n){return n===void 0?tl(Xo()):await Rh(n)}o(_h,"readTaxonomy");async function Rh(n){let e;try{e=await $h(qh.join(n,"work-types.json"),"utf8")}catch(s){if(jo(s))return null;throw s}let t;try{t=JSON.parse(e)}catch{return null}return tl(t)}o(Rh,"readTaxonomyFile");import sl from"node:process";import{execFile as Mh,execFileSync as jh}from"node:child_process";import{promisify as Dh}from"node:util";var nl={findCurrentBranch:Fh,findRemoteUrl:Kh,findTopLevel:Uh,listRemotes:Jh},Tr=Dh(Mh);function Bh(n){let e=E(n)?n.stderr:void 0;return typeof e=="string"&&e.trim()!==""?e.trim():G(n)}o(Bh,"describeGitFailure");async function Fh(n){let{stdout:e}=await Tr("git",["-C",n,"branch","--show-current"]);return e.trim()}o(Fh,"findCurrentBranch");async function Kh(n,e){let{stdout:t}=await Tr("git",["-C",n,"remote","get-url",e]),s=t.trim();return s===""?void 0:s}o(Kh,"findRemoteUrl");function Uh(n){try{let t=jh("git",["-C",n,"rev-parse","--show-toplevel"],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();return t===""?{failure:"git returned an empty working-tree root"}:{root:t}}catch(e){return{failure:Bh(e)}}}o(Uh,"findTopLevel");async function Jh(n){let{stdout:e}=await Tr("git",["-C",n,"remote"]);return e.split(`
|
|
142
|
+
`).map(t=>t.trim()).filter(t=>t!=="")}o(Jh,"listRemotes");function An(n={}){let{cwd:e}=n;if(e!=null&&e!=="")return e;let t=n.startDir??sl.cwd(),s=(n.git??nl).findTopLevel(t);return"root"in s?s.root:(sl.stderr.write(`resolve-project-root: git could not resolve the repository root (${s.failure}); anchoring at ${t}. Repo-relative paths may be wrong if the working directory changed.
|
|
143
|
+
`),t)}o(An,"resolveProjectRoot");function Vh(n,e){let t=Ar(e),s=Wh(n);return{activeSite:s,match:s===t,targetSite:t}}o(Vh,"compareSites");function Ar(n){let e=n.trim(),t=e.includes("://")?e:`https://${e}`,s;try{s=new URL(t).hostname}catch(r){throw new Error(`not a URL or a host: '${n}'`,{cause:r})}if(s==="")throw new Error(`not a URL or a host: '${n}'`);return s.toLowerCase()}o(Ar,"normalizeSite");function Wh(n){let e=/^\s*Site:\s*(\S+)\s*$/m.exec(n)?.[1];if(e===void 0)return null;try{return Ar(e)}catch{return null}}o(Wh,"parseActiveSite");async function xr(n,e){let t=Ar(n),s=await e(["jira","auth","status"]);return s.exitCode!==0?{activeSite:null,match:!1,targetSite:t}:Vh(s.stdout,t)}o(xr,"readSiteCheck");async function rl(n,e){let t={posted:n.post===void 0?"not-requested":"not-run",status:null,transitioned:"not-run"};if(n.post!==void 0){let a=await e(["jira","workitem","comment","list","--key",n.key,"--paginate","--json"]),l=a.exitCode===0?zh(a.stdout):null;if(l===null)return Nn(t,xn("comment list",a));let c=Nr(n.post.firstLine);if(l.some(u=>Nr(u).startsWith(c)))t.posted="skipped";else{let u=await e(["jira","workitem","comment","create","--key",n.key,"--body-file",n.post.adfPath]);if(u.exitCode!==0)return Nn(t,`${xn("comment create",u)}; check the work item before posting again`);t.posted="made"}}let s=await e(["jira","workitem","view",n.key,"--json","--fields","status"]),r=s.exitCode===0?Gh(s.stdout):null;if(r===null)return Nn(t,xn("view",s));if(t.status=r,r.category==="done")return t.transitioned="skipped",{ok:!0,result:t};let i=await e(["jira","workitem","transition","--key",n.key,"--status",n.doneStatus,"--yes"]);return i.exitCode!==0?Nn(t,xn("transition",i)):(t.transitioned="made",{ok:!0,result:t})}o(rl,"closeWorkItem");function il(n){let e=E(n)?n.content:void 0,t=Array.isArray(e)?e[0]:void 0;return Nr(al(t))}o(il,"readFirstLine");var Yh=new Set(["codeBlock","heading","paragraph"]);function al(n){if(!E(n))return"";if(n.type==="text")return typeof n.text=="string"?n.text:"";if(n.type==="hardBreak")return" ";let e=n.content;if(!Array.isArray(e))return"";let t=typeof n.type=="string"&&Yh.has(n.type)?"":" ";return e.map(s=>al(s)).join(t)}o(al,"collectText");function Nr(n){return n.replaceAll(/\s+/g," ").trim()}o(Nr,"collapseWhitespace");function xn(n,e){return e.exitCode===0?`could not read the output of acli jira workitem ${n}`:`acli jira workitem ${n} exited ${e.exitCode}: ${e.stderr.trim()}`}o(xn,"describeFailure");function Nn(n,e){return{ok:!1,result:{...n,error:e}}}o(Nn,"fail");function zh(n){let e=Qh(n);if(e===null)return null;let t=[];for(let s of e){let r=ol(s),i=E(r)?r.comments:void 0;if(!Array.isArray(i))return null;for(let a of i)t.push(E(a)&&typeof a.body=="string"?a.body:"")}return t}o(zh,"parseCommentBodies");function ol(n){try{return JSON.parse(n)}catch{return}}o(ol,"parseJson");function Gh(n){let e=ol(n),t=E(e)?e.fields:void 0,s=E(t)?t.status:void 0,r=E(s)?s.statusCategory:void 0;return!E(s)||typeof s.name!="string"||!E(r)?null:typeof r.key=="string"?{category:r.key,name:s.name}:null}o(Gh,"parseStatus");function Qh(n){let e=[],t=0,s=-1,r=!1,i=!1;for(let a=0;a<n.length;a+=1){if(i){i=!1;continue}let l=n.charAt(a);if(r){i=l==="\\",r=l!=='"';continue}switch(l){case'"':r=!0;break;case"{":t===0&&(s=a),t+=1;break;case"}":t-=1,t===0&&e.push(n.slice(s,a+1));break;default:if(t===0&&!/\s/.test(l))return null}}return t===0&&!r&&e.length>0?e:null}o(Qh,"splitJsonObjects");function Pr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}o(Pr,"L");var Se=Pr();function dl(n){Se=n}o(dl,"G");var kt={exec:o(()=>null,"exec")};function L(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:o((r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(M.caret,"$1"),t=t.replace(r,a),s},"replace"),getRegex:o(()=>new RegExp(t,e),"getRegex")};return s}o(L,"d");var Hh=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),M={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o(n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:o(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:o(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:o(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:o(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),"headingBeginRegex"),htmlBeginRegex:o(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex")},Xh=/^(?:[ \t]*(?:\n|$))+/,Zh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ed=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,wt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,td=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Cr=/(?:[*+-]|\d{1,9}[.)])/,gl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ml=L(gl).replace(/bull/g,Cr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nd=L(gl).replace(/bull/g,Cr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$r=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,sd=/^[^\n]+/,qr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,rd=L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),id=L(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Cr).getRegex(),Cn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ir=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ad=L("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ir).replace("tag",Cn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yl=L($r).replace("hr",wt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Cn).getRegex(),od=L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yl).getRegex(),_r={blockquote:od,code:Zh,def:rd,fences:ed,heading:td,hr:wt,html:ad,lheading:ml,list:id,newline:Xh,paragraph:yl,table:kt,text:sd},ll=L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",wt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Cn).getRegex(),ld={..._r,lheading:nd,table:ll,paragraph:L($r).replace("hr",wt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ll).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Cn).getRegex()},cd={..._r,html:L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ir).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:kt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:L($r).replace("hr",wt).replace("heading",` *#{1,6} *[^
|
|
144
|
+
]`).replace("lheading",ml).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ud=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fd=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bl=/^( {2,}|\\)\n(?!\s*$)/,pd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$n=/[\p{P}\p{S}]/u,Rr=/[\s\p{P}\p{S}]/u,kl=/[^\s\p{P}\p{S}]/u,hd=L(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Rr).getRegex(),wl=/(?!~)[\p{P}\p{S}]/u,dd=/(?!~)[\s\p{P}\p{S}]/u,gd=/(?:[^\s\p{P}\p{S}]|~)/u,md=L(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Hh?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Sl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,yd=L(Sl,"u").replace(/punct/g,$n).getRegex(),bd=L(Sl,"u").replace(/punct/g,wl).getRegex(),vl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kd=L(vl,"gu").replace(/notPunctSpace/g,kl).replace(/punctSpace/g,Rr).replace(/punct/g,$n).getRegex(),wd=L(vl,"gu").replace(/notPunctSpace/g,gd).replace(/punctSpace/g,dd).replace(/punct/g,wl).getRegex(),Sd=L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kl).replace(/punctSpace/g,Rr).replace(/punct/g,$n).getRegex(),vd=L(/\\(punct)/,"gu").replace(/punct/g,$n).getRegex(),Td=L(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ad=L(Ir).replace("(?:-->|$)","-->").getRegex(),xd=L("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ad).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),On=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Nd=L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",On).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Tl=L(/^!?\[(label)\]\[(ref)\]/).replace("label",On).replace("ref",qr).getRegex(),Al=L(/^!?\[(ref)\](?:\[\])?/).replace("ref",qr).getRegex(),Ed=L("reflink|nolink(?!\\()","g").replace("reflink",Tl).replace("nolink",Al).getRegex(),cl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mr={_backpedal:kt,anyPunctuation:vd,autolink:Td,blockSkip:md,br:bl,code:fd,del:kt,emStrongLDelim:yd,emStrongRDelimAst:kd,emStrongRDelimUnd:Sd,escape:ud,link:Nd,nolink:Al,punctuation:hd,reflink:Tl,reflinkSearch:Ed,tag:xd,text:pd,url:kt},Od={...Mr,link:L(/^!?\[(label)\]\((.*?)\)/).replace("label",On).getRegex(),reflink:L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",On).getRegex()},Er={...Mr,emStrongRDelimAst:wd,emStrongLDelim:bd,url:L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",cl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",cl).getRegex()},Ld={...Er,br:L(bl).replace("{2,}","*").getRegex(),text:L(Er.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},En={normal:_r,gfm:ld,pedantic:cd},mt={normal:Mr,gfm:Er,breaks:Ld,pedantic:Od},Pd={"&":"&","<":"<",">":">",'"':""","'":"'"},ul=o(n=>Pd[n],"ge");function z(n,e){if(e){if(M.escapeTest.test(n))return n.replace(M.escapeReplace,ul)}else if(M.escapeTestNoEncode.test(n))return n.replace(M.escapeReplaceNoEncode,ul);return n}o(z,"w");function fl(n){try{n=encodeURI(n).replace(M.percentDecode,"%")}catch{return null}return n}o(fl,"J");function pl(n,e){let t=n.replace(M.findPipe,(i,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),s=t.split(M.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(M.slashPipe,"|");return s}o(pl,"V");function yt(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s;){let i=n.charAt(s-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return n.slice(0,s-r)}o(yt,"z");function Cd(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}o(Cd,"fe");function hl(n,e,t,s,r){let i=e.href,a=e.title||null,l=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,c}o(hl,"me");function $d(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
145
145
|
`).map(i=>{let a=i.match(t.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=r.length?i.slice(r.length):i}).join(`
|
|
146
|
-
`)}o(
|
|
147
|
-
`)}}}fences(
|
|
148
|
-
`)}}blockquote(
|
|
146
|
+
`)}o($d,"Ye");var Ln=class{static{o(this,"y")}options;rules;lexer;constructor(n){this.options=n||Se}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:yt(t,`
|
|
147
|
+
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],s=$d(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=yt(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:yt(e[0],`
|
|
148
|
+
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=yt(e[0],`
|
|
149
149
|
`).split(`
|
|
150
|
-
`),
|
|
150
|
+
`),s="",r="",i=[];for(;t.length>0;){let a=!1,l=[],c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))l.push(t[c]),a=!0;else if(!a)l.push(t[c]);else break;t=t.slice(c);let u=l.join(`
|
|
151
151
|
`),h=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
152
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");
|
|
152
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
153
153
|
${u}`:u,r=r?`${r}
|
|
154
154
|
${h}`:h;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,i,!0),this.lexer.state.top=f,t.length===0)break;let p=i.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let g=p,y=g.raw+`
|
|
155
155
|
`+t.join(`
|
|
156
|
-
`),d=this.blockquote(y);i[i.length-1]=d,
|
|
156
|
+
`),d=this.blockquote(y);i[i.length-1]=d,s=s.substring(0,s.length-g.raw.length)+d.raw,r=r.substring(0,r.length-g.text.length)+d.text;break}else if(p?.type==="list"){let g=p,y=g.raw+`
|
|
157
157
|
`+t.join(`
|
|
158
|
-
`),d=this.list(y);i[i.length-1]=d,
|
|
159
|
-
`);continue}}return{type:"blockquote",raw:
|
|
160
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),p=
|
|
158
|
+
`),d=this.list(y);i[i.length-1]=d,s=s.substring(0,s.length-p.raw.length)+d.raw,r=r.substring(0,r.length-g.raw.length)+d.raw,t=y.substring(i.at(-1).raw.length).split(`
|
|
159
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),s=t.length>1,r={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let i=this.rules.other.listItemRegex(t),a=!1;for(;n;){let c=!1,u="",h="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;u=e[0],n=n.substring(u.length);let f=e[2].split(`
|
|
160
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),p=n.split(`
|
|
161
161
|
`,1)[0],g=!f.trim(),y=0;if(this.options.pedantic?(y=2,h=f.trimStart()):g?y=e[1].length+1:(y=e[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,h=f.slice(y),y+=e[1].length),g&&this.rules.other.blankLine.test(p)&&(u+=p+`
|
|
162
|
-
`,
|
|
163
|
-
`,1)[0],
|
|
164
|
-
`+
|
|
165
|
-
`+p}!g&&!p.trim()&&(g=!0),u+=
|
|
166
|
-
`,
|
|
167
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===
|
|
168
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(
|
|
169
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let
|
|
162
|
+
`,n=n.substring(p.length+1),c=!0),!c){let k=this.rules.other.nextBulletRegex(y),w=this.rules.other.hrRegex(y),v=this.rules.other.fencesBeginRegex(y),T=this.rules.other.headingBeginRegex(y),x=this.rules.other.htmlBeginRegex(y);for(;n;){let A=n.split(`
|
|
163
|
+
`,1)[0],O;if(p=A,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),O=p):O=p.replace(this.rules.other.tabCharGlobal," "),v.test(p)||T.test(p)||x.test(p)||k.test(p)||w.test(p))break;if(O.search(this.rules.other.nonSpaceChar)>=y||!p.trim())h+=`
|
|
164
|
+
`+O.slice(y);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||T.test(f)||w.test(f))break;h+=`
|
|
165
|
+
`+p}!g&&!p.trim()&&(g=!0),u+=A+`
|
|
166
|
+
`,n=n.substring(A.length+1),f=O.slice(y)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let d=null,m;this.options.gfm&&(d=this.rules.other.listIsTask.exec(h),d&&(m=d[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:u,task:!!d,checked:m,loose:!1,text:h,tokens:[]}),r.raw+=u}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){let u=r.items[c].tokens.filter(f=>f.type==="space"),h=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));r.loose=h}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:r}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=pl(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
167
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(pl(a,i.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[c]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
168
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=yt(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=Cd(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),hl(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return hl(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,a,l=r,c=0,u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*n.length+r);(s=u.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(a=[...i].length,s[3]||s[4]){l+=a;continue}else if((s[5]||s[6])&&r%3&&!((r+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let h=[...s[0]][0].length,f=n.slice(0,r+s.index+h+a);if(Math.min(r,a)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},J=class Or{static{o(this,"l")}tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Se,this.options.tokenizer=this.options.tokenizer||new Ln,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:M,block:En.normal,inline:mt.normal};this.options.pedantic?(t.block=En.pedantic,t.inline=mt.pedantic):this.options.gfm&&(t.block=En.gfm,this.options.breaks?t.inline=mt.breaks:t.inline=mt.gfm),this.tokenizer.rules=t}static get rules(){return{block:En,inline:mt}}static lex(e,t){return new Or(t).lex(e)}static lexInline(e,t){return new Or(t).inlineTokens(e)}lex(e){e=e.replace(M.carriageReturn,`
|
|
169
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.options.pedantic&&(e=e.replace(M.tabCharGlobal," ").replace(M.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=t.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
|
|
170
170
|
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
171
171
|
`)?"":`
|
|
172
172
|
`)+r.raw,a.text+=`
|
|
173
173
|
`+r.text,this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
174
174
|
`)?"":`
|
|
175
175
|
`)+r.raw,a.text+=`
|
|
176
|
-
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);
|
|
176
|
+
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
177
177
|
`)?"":`
|
|
178
178
|
`)+r.raw,a.text+=`
|
|
179
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),
|
|
179
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),s=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
180
180
|
`)?"":`
|
|
181
181
|
`)+r.raw,a.text+=`
|
|
182
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let
|
|
183
|
-
`;return
|
|
182
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,r=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=r[2]?r[2].length:0,s=s.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let a=!1,l="";for(;e;){a||(l=""),a=!1;let c;if(this.options.extensions?.inline?.some(h=>(c=h.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);let h=t.at(-1);c.type==="text"&&h?.type==="text"?(h.raw+=c.raw,h.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,s,l)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let u=e;if(this.options.extensions?.startInline){let h=1/0,f=e.slice(1),p;this.options.extensions.startInline.forEach(g=>{p=g.call({lexer:this},f),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(u=e.substring(0,h+1))}if(c=this.tokenizer.inlineText(u)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(l=c.raw.slice(-1)),a=!0;let h=t.at(-1);h?.type==="text"?(h.raw+=c.raw,h.text+=c.text):t.push(c);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},Pn=class{static{o(this,"P")}options;parser;constructor(n){this.options=n||Se}space(n){return""}code({text:n,lang:e,escaped:t}){let s=(e||"").match(M.notSpaceStart)?.[0],r=n.replace(M.endingNewline,"")+`
|
|
183
|
+
`;return s?'<pre><code class="language-'+z(s)+'">'+(t?r:z(r,!0))+`</code></pre>
|
|
184
184
|
`:"<pre><code>"+(t?r:z(r,!0))+`</code></pre>
|
|
185
|
-
`}blockquote({tokens:
|
|
186
|
-
${this.parser.parse(
|
|
187
|
-
`}html({text:
|
|
188
|
-
`}hr(
|
|
189
|
-
`}list(
|
|
190
|
-
`+
|
|
191
|
-
`}listitem(
|
|
192
|
-
`}checkbox({checked:
|
|
193
|
-
`}table(
|
|
185
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
186
|
+
${this.parser.parse(n)}</blockquote>
|
|
187
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
188
|
+
`}hr(n){return`<hr>
|
|
189
|
+
`}list(n){let e=n.ordered,t=n.start,s="";for(let a=0;a<n.items.length;a++){let l=n.items[a];s+=this.listitem(l)}let r=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+r+i+`>
|
|
190
|
+
`+s+"</"+r+`>
|
|
191
|
+
`}listitem(n){let e="";if(n.task){let t=this.checkbox({checked:!!n.checked});n.loose?n.tokens[0]?.type==="paragraph"?(n.tokens[0].text=t+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=t+" "+z(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):e+=t+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
|
|
192
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
193
|
+
`}table(n){let e="",t="";for(let r=0;r<n.header.length;r++)t+=this.tablecell(n.header[r]);e+=this.tablerow({text:t});let s="";for(let r=0;r<n.rows.length;r++){let i=n.rows[r];t="";for(let a=0;a<i.length;a++)t+=this.tablecell(i[a]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
194
194
|
<thead>
|
|
195
195
|
`+e+`</thead>
|
|
196
|
-
`+
|
|
197
|
-
`}tablerow({text:
|
|
198
|
-
${
|
|
199
|
-
`}tablecell(
|
|
200
|
-
`}strong({tokens:
|
|
201
|
-
`+this.renderer.text(l);t?
|
|
202
|
-
Please report this to https://github.com/markedjs/marked.`,s){let n="<p>An error occurred:</p><pre>"+z(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},ke=new gd;function P(s,e){return ke.parse(s,e)}o(P,"k");P.options=P.setOptions=function(s){return ke.setOptions(s),P.defaults=ke.defaults,nl(P.defaults),P};P.getDefaults=Sr;P.defaults=we;P.use=function(...s){return ke.use(...s),P.defaults=ke.defaults,nl(P.defaults),P};P.walkTokens=function(s,e){return ke.walkTokens(s,e)};P.parseInline=ke.parseInline;P.Parser=J;P.parser=J.parse;P.Renderer=Ss;P.TextRenderer=Lr;P.Lexer=Y;P.lexer=Y.lex;P.Tokenizer=ws;P.Hooks=mt;P.parse=P;var yb=P.options,bb=P.setOptions,kb=P.use,wb=P.walkTokens,Sb=P.parseInline;var vb=J.parse,Ab=Y.lex;var Ts=o(()=>globalThis.crypto.randomUUID(),"generateLocalId");function md(s){let e=s.trim().match(/^<adf>([\s\S]*?)<\/adf>$/i);if(!e)return null;let t=e[1].trim();if(t.length===0)throw new Error("<adf> tag content is empty \u2014 expected a JSON object or array");let n;try{n=JSON.parse(t)}catch{throw new Error(`Invalid JSON in <adf> tag: ${t}`)}if(Array.isArray(n))return n.map((i,a)=>{if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`ADF node must be a JSON object or array of objects (item ${a} is not an object)`);let l=i;if(typeof l.type!="string"||l.type.length===0)throw new Error('ADF node must have a "type" string property');return l});if(typeof n!="object"||n===null)throw new Error(`ADF node must be a JSON object or array, got: ${JSON.stringify(n)}`);let r=n;if(typeof r.type!="string"||r.type.length===0)throw new Error('ADF node must have a "type" string property');return r}o(md,"parseAdfTag");function gl(s){let e=P.lexer(s);return{version:1,type:"doc",content:xs(e)}}o(gl,"markdownToAdf");function xs(s){return s?s.map(e=>{switch(e.type){case"paragraph":return Pr(e.tokens);case"heading":return{type:"heading",attrs:{level:e.depth},content:Z(e.tokens)};case"list":return e.items.every(n=>n.task)&&e.items.some(n=>n.task)?{type:"taskList",attrs:{localId:Ts()},content:e.items.map(n=>$r(n))}:{type:e.ordered?"orderedList":"bulletList",...e.ordered?{attrs:{order:e.start||1}}:{},content:e.items.map(n=>qr(n))};case"code":return{type:"codeBlock",attrs:{language:e.lang||"text"},content:[{type:"text",text:e.text}]};case"blockquote":return{type:"blockquote",content:xs(e.tokens)};case"hr":return{type:"rule"};case"table":return yd(e);case"html":{let n=md(e.raw);return n||null}default:return null}}).filter(Boolean).flat():[]}o(xs,"tokensToAdf");function dl(s){return{type:"mediaSingle",attrs:{layout:"center"},content:[{type:"media",attrs:{type:"external",url:s.href,alt:s.text||""}}]}}o(dl,"createMediaNode");function yd(s){let e=s.header.map(r=>({type:"tableHeader",content:Pr(r.tokens)})),t=s.rows.map(r=>({type:"tableRow",content:r.map(i=>{let a=Pr(i.tokens);return a.length===0&&a.push({type:"paragraph",content:[{type:"text",text:" "}]}),{type:"tableCell",content:a}})})),n=[];return e.length&&n.push({type:"tableRow",content:e}),{type:"table",content:n.concat(t)}}o(yd,"processTable");function Pr(s){if(!s)return[];if(s.length===1&&s[0]?.type==="image")return[dl(s[0])];let e=[],t=[];for(let n=0;n<s.length;n++){let r=s[n];r?.type==="image"?(t.length&&(e.push({type:"paragraph",content:Z(t)}),t=[]),e.push(dl(r))):t.push(r)}return t.length&&e.push({type:"paragraph",content:Z(t)}),e}o(Pr,"processParagraph");function qr(s){let e=[],t=[];return(s.tokens||[]).forEach(n=>{if(n.type==="text"||n.type==="em"||n.type==="strong"||n.type==="del"||n.type==="link"||n.type==="codespan")t.push(n);else if(t.length&&(e.push({type:"paragraph",content:Z(t)}),t=[]),n.type==="list")n.items.every(i=>i.task)&&n.items.some(i=>i.task)?e.push({type:"taskList",attrs:{localId:Ts()},content:n.items.map(i=>$r(i))}):e.push({type:n.ordered?"orderedList":"bulletList",...n.ordered?{attrs:{order:n.start||1}}:{},content:n.items.map(i=>qr(i))});else{let r=xs([n]);r.length&&e.push(...r)}}),t.length&&e.push({type:"paragraph",content:Z(t)}),{type:"listItem",content:e}}o(qr,"processListItem");function $r(s){let e=[],t=[];return(s.tokens||[]).forEach(n=>{if(n.type==="text"||n.type==="em"||n.type==="strong"||n.type==="del"||n.type==="link"||n.type==="codespan")t.push(n);else if(t.length&&(e.push(...Z(t)),t=[]),n.type==="list")n.items.every(i=>i.task)&&n.items.some(i=>i.task)?e.push({type:"taskList",attrs:{localId:Ts()},content:n.items.map(i=>$r(i))}):e.push({type:n.ordered?"orderedList":"bulletList",...n.ordered?{attrs:{order:n.start||1}}:{},content:n.items.map(i=>qr(i))});else{let r=xs([n]);r.length&&e.push(...r)}}),t.length&&e.push(...Z(t)),{type:"taskItem",attrs:{localId:Ts(),state:s.checked?"DONE":"TODO"},content:e}}o($r,"processTaskItem");function Se(s){return s.tokens?.length===1&&s.tokens[0]&&"text"in s.tokens[0]?Se(s.tokens[0]):"text"in s?s.text.replace(/\n$/,"").replace(/\n/g," ").replace(/\s+/g," "):""}o(Se,"getSafeText");function Ie(s,e={}){s.type==="em"&&!e.em&&(e.em={type:"em"}),s.type==="strong"&&!e.strong&&(e.strong={type:"strong"}),s.type==="del"&&!e.strike&&(e.strike={type:"strike"}),s.type==="link"&&(e.link={type:"link",attrs:{href:s.href}}),s.type==="codespan"&&!e.code&&(e.code={type:"code"});let t=s.tokens?.[0],n=s.tokens?.length??0;if(t&&n===1)return Ie(t,e);let r=Object.values(e);return e.code?r.filter(i=>i.type==="link"||i.type==="code"):r}o(Ie,"getMarks");function Z(s){return s?s.flatMap(e=>{switch(e.type){case"text":return e.tokens?Z(e.tokens):[{type:"text",text:Se(e),...e.tokens?{content:Z(e.tokens)}:{}}];case"em":return(e.tokens??[]).map(t=>({type:"text",text:Se(t),marks:Ie(t,{em:{type:"em"}})}));case"strong":return(e.tokens??[]).map(t=>({type:"text",text:Se(t),marks:Ie(t,{strong:{type:"strong"}})}));case"del":return(e.tokens??[]).map(t=>({type:"text",text:Se(t),marks:Ie(t,{strike:{type:"strike"}})}));case"link":return[{type:"text",text:Se(e),marks:Ie(e)}];case"codespan":return[{type:"text",text:Se(e),marks:Ie(e)}];case"escape":return[{type:"text",text:e.text}];case"br":return[{type:"hardBreak"}];default:return[]}}).filter(e=>!(e.type==="text"&&!e.text)):[]}o(Z,"inlineToAdf");function Cr(s){return gl(s)}o(Cr,"convertMarkdownToAdf");async function ml(s,e){let t=[],n=!1;if(s.parent!==void 0){let l=await e(["jira","workitem","view",s.parent]);l.exitCode!==0&&(n=!0,t.push(`parent ${s.parent} rejected by acli (exit ${l.exitCode}); creating without it: ${l.stderr.trim()}`))}let r=["jira","workitem","create","--project",s.projectKey,"--type",s.issueType,"--summary",s.summary,"--description-file",s.adfPath,"--json"];s.parent!==void 0&&!n&&r.push("--parent",s.parent);let i=await e(r);if(i.exitCode!==0)return t.push(`acli jira workitem create exited ${i.exitCode}; check Jira before creating again: ${i.stderr.trim()}`),{diagnostics:t,ok:!1,result:{key:null,parentSkipped:n,rawOutput:i.stdout}};let a=bd(i.stdout);return a===null&&t.push("could not read a key from the acli create output; read it from rawOutput and do not create again"),{diagnostics:t,ok:a!==null,result:{key:a,parentSkipped:n,rawOutput:i.stdout}}}o(ml,"createWorkItem");function bd(s){let e;try{e=JSON.parse(s)}catch{return null}return $(e)&&typeof e.key=="string"&&e.key!==""?e.key:null}o(bd,"parseKey");function yl(s){let e=_r(_r(s,"integrations"),"jira","integrations."),t=_r(s,"project"),n={},r=e.issue_types;if(r!=null){if(!$(r))throw new Error("preferences: 'integrations.jira.issue_types' must be an object");for(let[i,a]of Object.entries(r))n[i]=Ir(a,`integrations.jira.issue_types.${i}`)??""}return{issueTypes:n,projectKey:Ir(e.project_key,"integrations.jira.project_key"),ticketRefPrefix:Ir(t.ticket_ref_prefix,"project.ticket_ref_prefix")}}o(yl,"readJiraPreferences");function bl(s,e,t){let n=Wo(s,t);if(n===null)throw new Error(`unknown work type '${s}'`);let r=Rr(e.projectKey)??kd(e.ticketRefPrefix);return r===void 0?{fallback:"no-project-key",warning:"Jira work item not created: neither integrations.jira.project_key nor project.ticket_ref_prefix is set."}:{issueType:wd(n.workType.key,e.issueTypes,t),projectKey:r}}o(bl,"resolveTarget");function kd(s){return Rr(s?.replace(/[^\dA-Za-z]+$/,""))}o(kd,"deriveKeyFromPrefix");function Rr(s){return s===void 0||s===""?void 0:s}o(Rr,"nonEmpty");function Ir(s,e){if(s!=null){if(typeof s!="string")throw new TypeError(`preferences: '${e}' must be a string`);return s}}o(Ir,"readString");function _r(s,e,t=""){let n=s[e];if(n==null)return{};if(!$(n))throw new Error(`preferences: '${t}${e}' must be an object`);return n}o(_r,"readSection");function wd(s,e,t){for(let[n,r]of Object.entries(e))if(n!=="default"&&t.get(n)?.key===s&&r!=="")return r;return Rr(e.default)??"Task"}o(wd,"resolveIssueType");var Od=Ed(Sd),Ld=`usage:
|
|
196
|
+
`+s+`</table>
|
|
197
|
+
`}tablerow({text:n}){return`<tr>
|
|
198
|
+
${n}</tr>
|
|
199
|
+
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
200
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${z(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),r=fl(n);if(r===null)return s;n=r;let i='<a href="'+n+'"';return e&&(i+=' title="'+z(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=fl(n);if(r===null)return z(t);n=r;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${z(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:z(n.text)}},jr=class{static{o(this,"$")}strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},V=class Lr{static{o(this,"l")}options;renderer;textRenderer;constructor(e){this.options=e||Se,this.options.renderer=this.options.renderer||new Pn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jr}static parse(e,t){return new Lr(t).parse(e)}static parseInline(e,t){return new Lr(t).parseInline(e)}parse(e,t=!0){let s="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let l=i,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){s+=c||"";continue}}let a=i;switch(a.type){case"space":{s+=this.renderer.space(a);continue}case"hr":{s+=this.renderer.hr(a);continue}case"heading":{s+=this.renderer.heading(a);continue}case"code":{s+=this.renderer.code(a);continue}case"table":{s+=this.renderer.table(a);continue}case"blockquote":{s+=this.renderer.blockquote(a);continue}case"list":{s+=this.renderer.list(a);continue}case"html":{s+=this.renderer.html(a);continue}case"def":{s+=this.renderer.def(a);continue}case"paragraph":{s+=this.renderer.paragraph(a);continue}case"text":{let l=a,c=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],c+=`
|
|
201
|
+
`+this.renderer.text(l);t?s+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):s+=c;continue}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}parseInline(e,t=this.renderer){let s="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}let a=i;switch(a.type){case"escape":{s+=t.text(a);break}case"html":{s+=t.html(a);break}case"link":{s+=t.link(a);break}case"image":{s+=t.image(a);break}case"strong":{s+=t.strong(a);break}case"em":{s+=t.em(a);break}case"codespan":{s+=t.codespan(a);break}case"br":{s+=t.br(a);break}case"del":{s+=t.del(a);break}case"text":{s+=t.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},bt=class{static{o(this,"S")}options;block;constructor(n){this.options=n||Se}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?J.lex:J.lexInline}provideParser(){return this.block?V.parse:V.parseInline}},qd=class{static{o(this,"B")}defaults=Pr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=V;Renderer=Pn;TextRenderer=jr;Lexer=J;Tokenizer=Ln;Hooks=bt;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(let s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let i of r.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let a of i)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let r=s;t=t.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let a=r[i].flat(1/0);t=t.concat(this.walkTokens(a,e))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){let r=this.defaults.renderer||new Pn(this.defaults);for(let i in t.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=t.renderer[a],c=r[a];r[a]=(...u)=>{let h=l.apply(r,u);return h===!1&&(h=c.apply(r,u)),h||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new Ln(this.defaults);for(let i in t.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=t.tokenizer[a],c=r[a];r[a]=(...u)=>{let h=l.apply(r,u);return h===!1&&(h=c.apply(r,u)),h}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new bt;for(let i in t.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=t.hooks[a],c=r[a];bt.passThroughHooks.has(i)?r[a]=u=>{if(this.defaults.async&&bt.passThroughHooksRespectAsync.has(i))return(async()=>{let f=await l.call(r,u);return c.call(r,f)})();let h=l.call(r,u);return c.call(r,h)}:r[a]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(r,u);return f===!1&&(f=await c.apply(r,u)),f})();let h=l.apply(r,u);return h===!1&&(h=c.apply(r,u)),h}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return J.lex(n,e??this.defaults)}parser(n,e){return V.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=n),r.async)return(async()=>{let a=r.hooks?await r.hooks.preprocess(e):e,l=await(r.hooks?await r.hooks.provideLexer():n?J.lex:J.lexInline)(a,r),c=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser():n?V.parse:V.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let a=(r.hooks?r.hooks.provideLexer():n?J.lex:J.lexInline)(e,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let l=(r.hooks?r.hooks.provideParser():n?V.parse:V.parseInline)(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(n,e){return t=>{if(t.message+=`
|
|
202
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+z(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},we=new qd;function C(n,e){return we.parse(n,e)}o(C,"k");C.options=C.setOptions=function(n){return we.setOptions(n),C.defaults=we.defaults,dl(C.defaults),C};C.getDefaults=Pr;C.defaults=Se;C.use=function(...n){return we.use(...n),C.defaults=we.defaults,dl(C.defaults),C};C.walkTokens=function(n,e){return we.walkTokens(n,e)};C.parseInline=we.parseInline;C.Parser=V;C.parser=V.parse;C.Renderer=Pn;C.TextRenderer=jr;C.Lexer=J;C.lexer=J.lex;C.Tokenizer=Ln;C.Hooks=bt;C.parse=C;var jb=C.options,Db=C.setOptions,Bb=C.use,Fb=C.walkTokens,Kb=C.parseInline;var Ub=V.parse,Jb=J.lex;var qn=o(()=>globalThis.crypto.randomUUID(),"generateLocalId");function Id(n){let e=n.trim().match(/^<adf>([\s\S]*?)<\/adf>$/i);if(!e)return null;let t=e[1].trim();if(t.length===0)throw new Error("<adf> tag content is empty \u2014 expected a JSON object or array");let s;try{s=JSON.parse(t)}catch{throw new Error(`Invalid JSON in <adf> tag: ${t}`)}if(Array.isArray(s))return s.map((i,a)=>{if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`ADF node must be a JSON object or array of objects (item ${a} is not an object)`);let l=i;if(typeof l.type!="string"||l.type.length===0)throw new Error('ADF node must have a "type" string property');return l});if(typeof s!="object"||s===null)throw new Error(`ADF node must be a JSON object or array, got: ${JSON.stringify(s)}`);let r=s;if(typeof r.type!="string"||r.type.length===0)throw new Error('ADF node must have a "type" string property');return r}o(Id,"parseAdfTag");function Nl(n){let e=C.lexer(n);return{version:1,type:"doc",content:In(e)}}o(Nl,"markdownToAdf");function In(n){return n?n.map(e=>{switch(e.type){case"paragraph":return Dr(e.tokens);case"heading":return{type:"heading",attrs:{level:e.depth},content:Z(e.tokens)};case"list":return e.items.every(s=>s.task)&&e.items.some(s=>s.task)?{type:"taskList",attrs:{localId:qn()},content:e.items.map(s=>Fr(s))}:{type:e.ordered?"orderedList":"bulletList",...e.ordered?{attrs:{order:e.start||1}}:{},content:e.items.map(s=>Br(s))};case"code":return{type:"codeBlock",attrs:{language:e.lang||"text"},content:[{type:"text",text:e.text}]};case"blockquote":return{type:"blockquote",content:In(e.tokens)};case"hr":return{type:"rule"};case"table":return _d(e);case"html":{let s=Id(e.raw);return s||null}default:return null}}).filter(Boolean).flat():[]}o(In,"tokensToAdf");function xl(n){return{type:"mediaSingle",attrs:{layout:"center"},content:[{type:"media",attrs:{type:"external",url:n.href,alt:n.text||""}}]}}o(xl,"createMediaNode");function _d(n){let e=n.header.map(r=>({type:"tableHeader",content:Dr(r.tokens)})),t=n.rows.map(r=>({type:"tableRow",content:r.map(i=>{let a=Dr(i.tokens);return a.length===0&&a.push({type:"paragraph",content:[{type:"text",text:" "}]}),{type:"tableCell",content:a}})})),s=[];return e.length&&s.push({type:"tableRow",content:e}),{type:"table",content:s.concat(t)}}o(_d,"processTable");function Dr(n){if(!n)return[];if(n.length===1&&n[0]?.type==="image")return[xl(n[0])];let e=[],t=[];for(let s=0;s<n.length;s++){let r=n[s];r?.type==="image"?(t.length&&(e.push({type:"paragraph",content:Z(t)}),t=[]),e.push(xl(r))):t.push(r)}return t.length&&e.push({type:"paragraph",content:Z(t)}),e}o(Dr,"processParagraph");function Br(n){let e=[],t=[];return(n.tokens||[]).forEach(s=>{if(s.type==="text"||s.type==="em"||s.type==="strong"||s.type==="del"||s.type==="link"||s.type==="codespan")t.push(s);else if(t.length&&(e.push({type:"paragraph",content:Z(t)}),t=[]),s.type==="list")s.items.every(i=>i.task)&&s.items.some(i=>i.task)?e.push({type:"taskList",attrs:{localId:qn()},content:s.items.map(i=>Fr(i))}):e.push({type:s.ordered?"orderedList":"bulletList",...s.ordered?{attrs:{order:s.start||1}}:{},content:s.items.map(i=>Br(i))});else{let r=In([s]);r.length&&e.push(...r)}}),t.length&&e.push({type:"paragraph",content:Z(t)}),{type:"listItem",content:e}}o(Br,"processListItem");function Fr(n){let e=[],t=[];return(n.tokens||[]).forEach(s=>{if(s.type==="text"||s.type==="em"||s.type==="strong"||s.type==="del"||s.type==="link"||s.type==="codespan")t.push(s);else if(t.length&&(e.push(...Z(t)),t=[]),s.type==="list")s.items.every(i=>i.task)&&s.items.some(i=>i.task)?e.push({type:"taskList",attrs:{localId:qn()},content:s.items.map(i=>Fr(i))}):e.push({type:s.ordered?"orderedList":"bulletList",...s.ordered?{attrs:{order:s.start||1}}:{},content:s.items.map(i=>Br(i))});else{let r=In([s]);r.length&&e.push(...r)}}),t.length&&e.push(...Z(t)),{type:"taskItem",attrs:{localId:qn(),state:n.checked?"DONE":"TODO"},content:e}}o(Fr,"processTaskItem");function ve(n){return n.tokens?.length===1&&n.tokens[0]&&"text"in n.tokens[0]?ve(n.tokens[0]):"text"in n?n.text.replace(/\n$/,"").replace(/\n/g," ").replace(/\s+/g," "):""}o(ve,"getSafeText");function _e(n,e={}){n.type==="em"&&!e.em&&(e.em={type:"em"}),n.type==="strong"&&!e.strong&&(e.strong={type:"strong"}),n.type==="del"&&!e.strike&&(e.strike={type:"strike"}),n.type==="link"&&(e.link={type:"link",attrs:{href:n.href}}),n.type==="codespan"&&!e.code&&(e.code={type:"code"});let t=n.tokens?.[0],s=n.tokens?.length??0;if(t&&s===1)return _e(t,e);let r=Object.values(e);return e.code?r.filter(i=>i.type==="link"||i.type==="code"):r}o(_e,"getMarks");function Z(n){return n?n.flatMap(e=>{switch(e.type){case"text":return e.tokens?Z(e.tokens):[{type:"text",text:ve(e),...e.tokens?{content:Z(e.tokens)}:{}}];case"em":return(e.tokens??[]).map(t=>({type:"text",text:ve(t),marks:_e(t,{em:{type:"em"}})}));case"strong":return(e.tokens??[]).map(t=>({type:"text",text:ve(t),marks:_e(t,{strong:{type:"strong"}})}));case"del":return(e.tokens??[]).map(t=>({type:"text",text:ve(t),marks:_e(t,{strike:{type:"strike"}})}));case"link":return[{type:"text",text:ve(e),marks:_e(e)}];case"codespan":return[{type:"text",text:ve(e),marks:_e(e)}];case"escape":return[{type:"text",text:e.text}];case"br":return[{type:"hardBreak"}];default:return[]}}).filter(e=>!(e.type==="text"&&!e.text)):[]}o(Z,"inlineToAdf");function _n(n){return Nl(n)}o(_n,"convertMarkdownToAdf");function Ur(n){let e=Kr(Kr(n,"integrations"),"jira","integrations."),t=Kr(n,"project"),s={},r=e.issue_types;if(r!=null){if(!E(r))throw new Error("preferences: 'integrations.jira.issue_types' must be an object");for(let[i,a]of Object.entries(r))s[i]=Re(a,`integrations.jira.issue_types.${i}`)??""}return{doneStatus:Re(e.done_status,"integrations.jira.done_status"),issueTypes:s,projectKey:Re(e.project_key,"integrations.jira.project_key"),subtaskIssueType:Re(e.subtask_issue_type,"integrations.jira.subtask_issue_type"),ticketRefPrefix:Re(t.ticket_ref_prefix,"project.ticket_ref_prefix"),umbrellaIssueType:Re(e.umbrella_issue_type,"integrations.jira.umbrella_issue_type")}}o(Ur,"readJiraPreferences");function Rn(n,e){return e===void 0?{issueType:n.issueType,parentAllowed:!0}:n.subtaskIssueType===void 0?{issueType:n.issueType,parentAllowed:e>=2}:e===0?{issueType:n.subtaskIssueType,parentAllowed:!0}:{issueType:n.issueType,parentAllowed:e===1}}o(Rn,"resolveChildIssueType");function El(n){return Me(n.doneStatus)??"Done"}o(El,"resolveDoneStatus");function Ol(n,e,t,s){let r=el(n,t);if(r===null)throw new Error(`unknown work type '${n}'`);let i=Me(e.projectKey)??Rd(e.ticketRefPrefix);return i===void 0?{fallback:"no-project-key",warning:"Jira work item not created: neither integrations.jira.project_key nor project.ticket_ref_prefix is set."}:s?.umbrella===!0?{issueType:Me(e.umbrellaIssueType)??"Epic",projectKey:i,subtaskIssueType:void 0}:{issueType:Md(r.workType.key,e.issueTypes,t),projectKey:i,subtaskIssueType:Me(e.subtaskIssueType)??"Subtask"}}o(Ol,"resolveTarget");function Rd(n){return Me(n?.replace(/[^\dA-Za-z]+$/,""))}o(Rd,"deriveKeyFromPrefix");function Me(n){return n===void 0||n===""?void 0:n}o(Me,"nonEmpty");function Re(n,e){if(n!=null){if(typeof n!="string")throw new TypeError(`preferences: '${e}' must be a string`);return n}}o(Re,"readString");function Kr(n,e,t=""){let s=n[e];if(s==null)return{};if(!E(s))throw new Error(`preferences: '${t}${e}' must be an object`);return s}o(Kr,"readSection");function Md(n,e,t){for(let[s,r]of Object.entries(e))if(s!=="default"&&t.get(s)?.key===n&&r!=="")return r;return Me(e.default)??"Task"}o(Md,"resolveIssueType");async function Ll(n,e){let t=[],s=n.parent,r=n.issueType;if(s!==void 0){let u=await e(["jira","workitem","view",s,"--json","--fields","issuetype"]),h=u.exitCode===0?jd(u.stdout):void 0,f=h===void 0?void 0:Rn(n,h);u.exitCode!==0?(t.push(`parent ${s} rejected by acli (exit ${u.exitCode}); creating without it: ${u.stderr.trim()}`),s=void 0):f===void 0?(t.push(`could not read the hierarchy level of parent ${s}; creating without it`),s=void 0):f.parentAllowed?r=f.issueType:(t.push(`parent ${s} is at hierarchy level ${String(h)}, which cannot take a ${r}; creating without it`),s=void 0)}let i=n.parent!==void 0&&s===void 0,a=["jira","workitem","create","--project",n.projectKey,"--type",r,"--summary",n.summary,"--description-file",n.adfPath,"--json"];s!==void 0&&a.push("--parent",s);let l=await e(a);if(l.exitCode!==0)return t.push(`acli jira workitem create exited ${l.exitCode}; check Jira before creating again: ${l.stderr.trim()}`),{diagnostics:t,ok:!1,result:{issueType:r,key:null,parentSkipped:i,rawOutput:l.stdout}};let c=Dd(l.stdout);return c===null&&t.push("could not read a key from the acli create output; read it from rawOutput and do not create again"),{diagnostics:t,ok:c!==null,result:{issueType:r,key:c,parentSkipped:i,rawOutput:l.stdout}}}o(Ll,"createWorkItem");function jd(n){let e;try{e=JSON.parse(n)}catch{return}let t=E(e)?e.fields:void 0,s=E(t)?t.issuetype:void 0,r=E(s)?s.hierarchyLevel:void 0;return typeof r=="number"&&Number.isSafeInteger(r)?r:void 0}o(jd,"parseHierarchyLevel");function Dd(n){let e;try{e=JSON.parse(n)}catch{return null}return E(e)&&typeof e.key=="string"&&e.key!==""?e.key:null}o(Dd,"parseKey");var Jd=Ud(Bd),Vd=`usage:
|
|
203
203
|
manage-jira-ticket check-site --target <url-or-host>
|
|
204
|
-
manage-jira-ticket
|
|
204
|
+
manage-jira-ticket close --key <key> [--post <md>]
|
|
205
|
+
manage-jira-ticket resolve-target --work-type <type> [--umbrella] [--parent-level <n>]
|
|
205
206
|
manage-jira-ticket convert-body --body-file <md> --out <path>
|
|
206
|
-
manage-jira-ticket create --summary <text> --body-file <md> --work-type <type> [--parent <key>]`;async function
|
|
207
|
-
${
|
|
208
|
-
`),
|
|
209
|
-
`),
|
|
210
|
-
`),
|
|
211
|
-
`),
|
|
212
|
-
`),
|
|
213
|
-
`);
|
|
214
|
-
`)}o(
|
|
207
|
+
manage-jira-ticket create --summary <text> --body-file <md> --work-type <type> [--parent <key>] [--umbrella]`;async function Wd(){try{let[n,...e]=B.argv.slice(2);switch(n){case"check-site":await zd(e);break;case"close":await Gd(e);break;case"convert-body":await Qd(e);break;case"create":await Hd(e);break;case"resolve-target":await Xd(e);break;default:throw new Error(n===void 0?"missing subcommand":`unknown subcommand '${n}'`)}}catch(n){B.stderr.write(`manage-jira-ticket: ${G(n)}
|
|
208
|
+
${Vd}
|
|
209
|
+
`),B.exit(1)}}o(Wd,"main");Go(import.meta.url,"manage-jira-ticket")&&await Wd();function ql(n){let e=`acli jira auth switch --site ${n.targetSite}`;return n.activeSite===null?`could not read acli's active site; the ticket is on ${n.targetSite}. Sign in, then run \`${e}\`.`:`acli's active site is ${n.activeSite}, but the ticket is on ${n.targetSite}. Run \`${e}\`.`}o(ql,"describeSiteMismatch");function vt(n,e,t){let{flags:s,positionals:r}=Qo(n,e);if(r.length>0)throw new Error(`unexpected argument: ${r.join(" ")}`);let i=Ho(s);for(let l of t)if(i[l]===void 0||i[l]==="")throw new Error(`--${l} is required`);return{switches:new Set(s.filter(l=>l.value===null).map(l=>l.name)),values:i}}o(vt,"parseFlags");async function Vr(n){try{let e=await Kd(n);if(e.isFile()&&e.size>0)return await Fd(n,"utf8")}catch(e){if(!gt(e))throw e}throw new Error(`Body file missing or empty: ${n}`)}o(Vr,"readBody");function Yd(n){if(n!==void 0){if(!/^-?\d+$/.test(n))throw new Error(`--parent-level must be an integer, not '${n}'`);return Number(n)}}o(Yd,"readParentLevel");async function Il(n,e,t){let s=await Zo();if(s===null)throw new Error("the work-type taxonomy could not be read");return Ol(n,Ur(e),s,{umbrella:t})}o(Il,"readTarget");async function _l(n){let e=(await Vo({cwd:n})).preferences.ticket?.base_url;return e===""?void 0:e}o(_l,"readTicketBaseUrl");async function Rl(n,e){if(n===void 0)return null;let t=await xr(n,Mn);if(t.match)return t.activeSite;let s=`${e}: ${ql(t)}`;ee({activeSite:t.activeSite,fallback:t.activeSite===null?"site-unreadable":"wrong-site",targetSite:t.targetSite,warning:s}),B.stderr.write(`manage-jira-ticket: ${s}
|
|
210
|
+
`),B.exit(1)}o(Rl,"refuseOnSiteMismatch");async function Mn(n){try{let{stderr:e,stdout:t}=await Jd("acli",n,{maxBuffer:16777216});return{exitCode:0,stderr:e,stdout:t}}catch(e){if(gt(e))throw new Error("acli is not installed or not on PATH",{cause:e});if(E(e)&&typeof e.code=="number"&&typeof e.stderr=="string"&&typeof e.stdout=="string")return{exitCode:e.code,stderr:e.stderr,stdout:e.stdout};throw e}}o(Mn,"runAcli");async function zd(n){let{values:e}=vt(n,[{name:"target",takesValue:!0}],["target"]),t=await xr(e.target??"",Mn);ee(t),!t.match&&(B.stderr.write(`manage-jira-ticket: ${ql(t)}
|
|
211
|
+
`),B.exitCode=1)}o(zd,"runCheckSite");async function Gd(n){let{values:e}=vt(n,[{name:"key",takesValue:!0},{name:"post",takesValue:!0}],["key"]),t=e.post===""?void 0:e.post,s=t===void 0?void 0:_n(await Vr(t)),r=s===void 0?"":il(s);if(s!==void 0&&r==="")throw new Error(`the post's first block does not contain any text: ${t}`);let i=An(),a=El(Ur(await Tn(i)));await Rl(await _l(i),"Jira work item not closed");let l=await Pl(St.join($l(),"manage-jira-ticket-"));try{let c;if(s!==void 0){let h=St.join(l,"post.json");await Jr(h,JSON.stringify(s)),c={adfPath:h,firstLine:r}}let u=await rl({doneStatus:a,key:e.key??"",post:c},Mn);ee(u.result),u.ok||(B.stderr.write(`manage-jira-ticket: ${u.result.error??"close failed"}
|
|
212
|
+
`),B.exitCode=1)}finally{await Cl(l,{force:!0,recursive:!0})}}o(Gd,"runClose");async function Qd(n){let{values:e}=vt(n,[{name:"body-file",takesValue:!0},{name:"out",takesValue:!0}],["body-file","out"]),t=St.resolve(e.out??""),s=_n(await Vr(e["body-file"]??""));await Jr(t,`${JSON.stringify(s)}
|
|
213
|
+
`),ee({adfPath:t})}o(Qd,"runConvertBody");async function Hd(n){let{switches:e,values:t}=vt(n,[{name:"body-file",takesValue:!0},{name:"parent",takesValue:!0},{name:"summary",takesValue:!0},{name:"umbrella",takesValue:!1},{name:"work-type",takesValue:!0}],["body-file","summary","work-type"]),s=await Vr(t["body-file"]??""),r=An(),i=await Il(t["work-type"]??"",await Tn(r),e.has("umbrella"));"fallback"in i&&(ee(i),B.stderr.write(`manage-jira-ticket: ${i.warning}
|
|
214
|
+
`),B.exit(1));let a=await Rl(await _l(r),"Jira work item not created"),l=await Pl(St.join($l(),"manage-jira-ticket-"));try{let c=St.join(l,"description.json");await Jr(c,JSON.stringify(_n(s)));let u=t.parent===""?void 0:t.parent,h=await Ll({...i,adfPath:c,parent:u,summary:t.summary??""},Mn);for(let f of h.diagnostics)B.stderr.write(`manage-jira-ticket: ${f}
|
|
215
|
+
`);ee({...h.result,activeSite:a}),h.ok||(B.exitCode=1)}finally{await Cl(l,{force:!0,recursive:!0})}}o(Hd,"runCreate");async function Xd(n){let{switches:e,values:t}=vt(n,[{name:"parent-level",takesValue:!0},{name:"umbrella",takesValue:!1},{name:"work-type",takesValue:!0}],["work-type"]),s=Yd(t["parent-level"]),r=await Tn(An()),i=await Il(t["work-type"]??"",r,e.has("umbrella"));if("fallback"in i){ee(i);return}if(s===void 0){ee({issueType:i.issueType,projectKey:i.projectKey});return}ee({...Rn(i,s),projectKey:i.projectKey})}o(Xd,"runResolveTarget");function ee(n){B.stdout.write(`${JSON.stringify(n,null,2)}
|
|
216
|
+
`)}o(ee,"writeJson");
|