@uibot/cli 0.15.1 → 0.17.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/dist/cli.js +116 -116
- package/dist/commands/resource.d.ts +1 -0
- package/dist/index.js +98 -98
- package/dist/resource-runtime.d.ts +1 -1
- package/dist/resources/bundle.json +1 -0
- package/dist/shells/shadcn-admin-shell.yaml +6 -1
- package/dist/templates/shadcn-admin.yaml +60 -5
- package/package.json +8 -8
package/dist/cli.js
CHANGED
|
@@ -1,142 +1,142 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @bun
|
|
3
|
-
var Pd=Object.create;var{getPrototypeOf:Ad,defineProperty:Wo,getOwnPropertyNames:Dd}=Object;var Jo=Object.prototype.hasOwnProperty;function Od(e){return this[e]}var Td,Ld,Nd=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?Td??=new WeakMap:Ld??=new WeakMap,o=i.get(e);if(o)return o}r=e!=null?Pd(Ad(e)):{};let s=t||!e||!e.__esModule||!Jo.call(e,"default")?Wo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Dd(e))if(!Jo.call(s,a))Wo(s,a,{get:Od.bind(e,a),enumerable:!0})}if(n)i.set(e,s);return s};var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var V=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Xt=import.meta.require;var He=y(function(jA,xs){var Vp=Number.MAX_SAFE_INTEGER||9007199254740991,Kp=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Vp,RELEASE_TYPES:Kp,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var mt=y(function(qA,ws){var Hp=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};ws.exports=Hp});var Ge=y(function(ie,vs){var{MAX_SAFE_COMPONENT_LENGTH:Hn,MAX_SAFE_BUILD_LENGTH:Gp,MAX_LENGTH:Yp}=He(),zp=mt();ie=vs.exports={};var Wp=ie.re=[],Jp=ie.safeRe=[],S=ie.src=[],Qp=ie.safeSrc=[],C=ie.t={},Xp=0,Gn="[a-zA-Z0-9-]",Zp=[["\\s",1],["\\d",Yp],[Gn,Gp]],ef=(e)=>{for(let[t,r]of Zp)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},E=(e,t,r)=>{let n=ef(t),i=Xp++;zp(e,i,t),C[e]=i,S[i]=t,Qp[i]=n,Wp[i]=new RegExp(t,r?"g":void 0),Jp[i]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Gn}*`);E("MAINVERSION",`(${S[C.NUMERICIDENTIFIER]})\\.(${S[C.NUMERICIDENTIFIER]})\\.(${S[C.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${S[C.NUMERICIDENTIFIERLOOSE]})\\.(${S[C.NUMERICIDENTIFIERLOOSE]})\\.(${S[C.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${S[C.NONNUMERICIDENTIFIER]}|${S[C.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${S[C.NONNUMERICIDENTIFIER]}|${S[C.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${S[C.PRERELEASEIDENTIFIER]}(?:\\.${S[C.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${S[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${S[C.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${Gn}+`);E("BUILD",`(?:\\+(${S[C.BUILDIDENTIFIER]}(?:\\.${S[C.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${S[C.MAINVERSION]}${S[C.PRERELEASE]}?${S[C.BUILD]}?`);E("FULL",`^${S[C.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${S[C.MAINVERSIONLOOSE]}${S[C.PRERELEASELOOSE]}?${S[C.BUILD]}?`);E("LOOSE",`^${S[C.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${S[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${S[C.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${S[C.XRANGEIDENTIFIER]})(?:\\.(${S[C.XRANGEIDENTIFIER]})(?:\\.(${S[C.XRANGEIDENTIFIER]})(?:${S[C.PRERELEASE]})?${S[C.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${S[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${S[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${S[C.XRANGEIDENTIFIERLOOSE]})(?:${S[C.PRERELEASELOOSE]})?${S[C.BUILD]}?)?)?`);E("XRANGE",`^${S[C.GTLT]}\\s*${S[C.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${S[C.GTLT]}\\s*${S[C.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Hn}})(?:\\.(\\d{1,${Hn}}))?(?:\\.(\\d{1,${Hn}}))?`);E("COERCE",`${S[C.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",S[C.COERCEPLAIN]+`(?:${S[C.PRERELEASE]})?(?:${S[C.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",S[C.COERCE],!0);E("COERCERTLFULL",S[C.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${S[C.LONETILDE]}\\s+`,!0);ie.tildeTrimReplace="$1~";E("TILDE",`^${S[C.LONETILDE]}${S[C.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${S[C.LONETILDE]}${S[C.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${S[C.LONECARET]}\\s+`,!0);ie.caretTrimReplace="$1^";E("CARET",`^${S[C.LONECARET]}${S[C.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${S[C.LONECARET]}${S[C.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${S[C.GTLT]}\\s*(${S[C.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${S[C.GTLT]}\\s*(${S[C.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${S[C.GTLT]}\\s*(${S[C.LOOSEPLAIN]}|${S[C.XRANGEPLAIN]})`,!0);ie.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${S[C.XRANGEPLAIN]})\\s+-\\s+(${S[C.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${S[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${S[C.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var or=y(function(BA,Es){var tf=Object.freeze({loose:!0}),rf=Object.freeze({}),nf=(e)=>{if(!e)return rf;if(typeof e!=="object")return tf;return e};Es.exports=nf});var Yn=y(function(UA,As){var Is=/^[0-9]+$/,Ps=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Is.test(e),n=Is.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},of=(e,t)=>Ps(t,e);As.exports={compareIdentifiers:Ps,rcompareIdentifiers:of}});var q=y(function(VA,Os){var sr=mt(),{MAX_LENGTH:Ds,MAX_SAFE_INTEGER:ar}=He(),{safeRe:cr,t:lr}=Ge(),sf=or(),{compareIdentifiers:zn}=Yn(),af=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(zn(e[n],r[n])!==0)return!1;return!0};class te{constructor(e,t){if(t=sf(t),e instanceof te)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Ds)throw TypeError(`version is longer than ${Ds} characters`);sr("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?cr[lr.LOOSE]:cr[lr.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ar||this.major<0)throw TypeError("Invalid major version");if(this.minor>ar||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>ar||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<ar)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(sr("SemVer.compare",this.version,this.options,e),!(e instanceof te)){if(typeof e==="string"&&e===this.version)return 0;e=new te(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof te))e=new te(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof te))e=new te(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(sr("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return zn(r,n)}while(++t)}compareBuild(e){if(!(e instanceof te))e=new te(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(sr("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return zn(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?cr[lr.PRERELEASELOOSE]:cr[lr.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(af(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Os.exports=te});var me=y(function(KA,Ls){var Ts=q(),cf=(e,t,r=!1)=>{if(e instanceof Ts)return e;try{return new Ts(e,t)}catch(n){if(!r)return null;throw n}};Ls.exports=cf});var $s=y(function(HA,Ns){var lf=me(),uf=(e,t)=>{let r=lf(e,t);return r?r.version:null};Ns.exports=uf});var _s=y(function(GA,Ms){var df=me(),pf=(e,t)=>{let r=df(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Ms.exports=pf});var qs=y(function(YA,js){var Fs=q(),ff=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Fs(e instanceof Fs?e.version:e,r).inc(t,n,i).version}catch(o){return null}};js.exports=ff});var Vs=y(function(zA,Us){var Bs=me(),gf=(e,t)=>{let r=Bs(e,null,!0),n=Bs(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let p=c?"pre":"";if(r.major!==n.major)return p+"major";if(r.minor!==n.minor)return p+"minor";if(r.patch!==n.patch)return p+"patch";return"prerelease"};Us.exports=gf});var Hs=y(function(WA,Ks){var mf=q(),hf=(e,t)=>new mf(e,t).major;Ks.exports=hf});var Ys=y(function(JA,Gs){var yf=q(),bf=(e,t)=>new yf(e,t).minor;Gs.exports=bf});var Ws=y(function(QA,zs){var Sf=q(),Cf=(e,t)=>new Sf(e,t).patch;zs.exports=Cf});var Qs=y(function(XA,Js){var Rf=me(),kf=(e,t)=>{let r=Rf(e,t);return r&&r.prerelease.length?r.prerelease:null};Js.exports=kf});var z=y(function(ZA,Zs){var Xs=q(),xf=(e,t,r)=>new Xs(e,r).compare(new Xs(t,r));Zs.exports=xf});var ta=y(function(eD,ea){var wf=z(),vf=(e,t,r)=>wf(t,e,r);ea.exports=vf});var na=y(function(tD,ra){var Ef=z(),If=(e,t)=>Ef(e,t,!0);ra.exports=If});var ur=y(function(rD,oa){var ia=q(),Pf=(e,t,r)=>{let n=new ia(e,r),i=new ia(t,r);return n.compare(i)||n.compareBuild(i)};oa.exports=Pf});var aa=y(function(nD,sa){var Af=ur(),Df=(e,t)=>e.sort((r,n)=>Af(r,n,t));sa.exports=Df});var la=y(function(iD,ca){var Of=ur(),Tf=(e,t)=>e.sort((r,n)=>Of(n,r,t));ca.exports=Tf});var ht=y(function(oD,ua){var Lf=z(),Nf=(e,t,r)=>Lf(e,t,r)>0;ua.exports=Nf});var dr=y(function(sD,da){var $f=z(),Mf=(e,t,r)=>$f(e,t,r)<0;da.exports=Mf});var Wn=y(function(aD,pa){var _f=z(),Ff=(e,t,r)=>_f(e,t,r)===0;pa.exports=Ff});var Jn=y(function(cD,fa){var jf=z(),qf=(e,t,r)=>jf(e,t,r)!==0;fa.exports=qf});var pr=y(function(lD,ga){var Bf=z(),Uf=(e,t,r)=>Bf(e,t,r)>=0;ga.exports=Uf});var fr=y(function(uD,ma){var Vf=z(),Kf=(e,t,r)=>Vf(e,t,r)<=0;ma.exports=Kf});var Qn=y(function(dD,ha){var Hf=Wn(),Gf=Jn(),Yf=ht(),zf=pr(),Wf=dr(),Jf=fr(),Qf=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return Hf(e,r,n);case"!=":return Gf(e,r,n);case">":return Yf(e,r,n);case">=":return zf(e,r,n);case"<":return Wf(e,r,n);case"<=":return Jf(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};ha.exports=Qf});var ba=y(function(pD,ya){var Xf=q(),Zf=me(),{safeRe:gr,t:mr}=Ge(),eg=(e,t)=>{if(e instanceof Xf)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?gr[mr.COERCEFULL]:gr[mr.COERCE]);else{let c=t.includePrerelease?gr[mr.COERCERTLFULL]:gr[mr.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Zf(`${n}.${i}.${o}${s}${a}`,t)};ya.exports=eg});var Ca=y(function(fD,Sa){var tg=me(),rg=He(),ng=q(),ig=(e,t,r)=>{if(!rg.RELEASE_TYPES.includes(t))return null;let n=og(e,r);return n&&sg(n,t)},og=(e,t)=>{let r=e instanceof ng?e.version:e;return tg(r,t)},sg=(e,t)=>{if(ag(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},ag=(e)=>e.startsWith("pre");Sa.exports=ig});var xa=y(function(gD,ka){class Ra{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}ka.exports=Ra});var W=y(function(mD,Ia){var cg=/\s+/g;class yt{constructor(e,t){if(t=ug(t),e instanceof yt)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new yt(e.raw,t);if(e instanceof Xn)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(cg," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!va(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Sg(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(bg,"");let r=((this.options.includePrerelease&&hg)|(this.options.loose&&yg))+":"+e,n=wa.get(r);if(n)return n;let i=this.options.loose,o=i?U[B.HYPHENRANGELOOSE]:U[B.HYPHENRANGE];e=e.replace(o,Dg(this.options.includePrerelease)),T("hyphen replace",e),e=e.replace(U[B.COMPARATORTRIM],fg),T("comparator trim",e),e=e.replace(U[B.TILDETRIM],gg),T("tilde trim",e),e=e.replace(U[B.CARETTRIM],mg),T("caret trim",e);let s=e.split(" ").map((p)=>Cg(p,this.options)).join(" ").split(/\s+/).map((p)=>Ag(p,this.options));if(i)s=s.filter((p)=>(T("loose invalid filter",p,this.options),!!p.match(U[B.COMPARATORLOOSE])));T("range list",s);let a=new Map,c=s.map((p)=>new Xn(p,this.options));for(let p of c){if(va(p))return[p];a.set(p.value,p)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return wa.set(r,l),l}intersects(e,t){if(!(e instanceof yt))throw TypeError("a Range is required");return this.set.some((r)=>Ea(r,t)&&e.set.some((n)=>Ea(n,t)&&r.every((i)=>n.every((o)=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new dg(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Og(this.set[t],e,this.options))return!0;return!1}}Ia.exports=yt;var lg=xa(),wa=new lg,ug=or(),Xn=bt(),T=mt(),dg=q(),{safeRe:U,src:pg,t:B,comparatorTrimReplace:fg,tildeTrimReplace:gg,caretTrimReplace:mg}=Ge(),{FLAG_INCLUDE_PRERELEASE:hg,FLAG_LOOSE:yg}=He(),bg=new RegExp(pg[B.BUILD],"g"),va=(e)=>e.value==="<0.0.0-0",Sg=(e)=>e.value==="",Ea=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((o)=>i.intersects(o,t)),i=n.pop();return r},Cg=(e,t)=>(e=e.replace(U[B.BUILD],""),T("comp",e,t),e=wg(e,t),T("caret",e),e=kg(e,t),T("tildes",e),e=Eg(e,t),T("xrange",e),e=Pg(e,t),T("stars",e),e),F=(e)=>!e||e.toLowerCase()==="x"||e==="*",Rg=(e,t,r)=>F(e)&&!F(t)||F(t)&&r&&!F(r),kg=(e,t)=>e.trim().split(/\s+/).map((r)=>xg(r,t)).join(" "),xg=(e,t)=>{let r=t.loose?U[B.TILDELOOSE]:U[B.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("tilde",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else if(c)T("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;return T("tilde return",l),l})},wg=(e,t)=>e.trim().split(/\s+/).map((r)=>vg(r,t)).join(" "),vg=(e,t)=>{T("caret",e,t);let r=t.loose?U[B.CARETLOOSE]:U[B.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("caret",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))if(o==="0")l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`;else if(c)if(T("replaceCaret pr",c),o==="0")if(s==="0")l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`;else if(T("no pr"),o==="0")if(s==="0")l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`;return T("caret return",l),l})},Eg=(e,t)=>(T("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Ig(r,t)).join(" ")),Ig=(e,t)=>{e=e.trim();let r=t.loose?U[B.XRANGELOOSE]:U[B.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(T("xRange",e,n,i,o,s,a,c),Rg(o,s,a))return e;let l=F(o),p=l||F(s),d=p||F(a),f=d;if(i==="="&&f)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&f){if(p)s=0;if(a=0,i===">")if(i=">=",p)o=+o+1,s=0,a=0;else s=+s+1,a=0;else if(i==="<=")if(i="<",p)o=+o+1;else s=+s+1;if(i==="<")c="-0";n=`${i+o}.${s}.${a}${c}`}else if(p)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(d)n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`;return T("xRange return",n),n})},Pg=(e,t)=>(T("replaceStars",e,t),e.trim().replace(U[B.STAR],"")),Ag=(e,t)=>(T("replaceGTE0",e,t),e.trim().replace(U[t.includePrerelease?B.GTE0PRE:B.GTE0],"")),Dg=(e)=>(t,r,n,i,o,s,a,c,l,p,d,f)=>{if(F(n))r="";else if(F(i))r=`>=${n}.0.0${e?"-0":""}`;else if(F(o))r=`>=${n}.${i}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(F(l))c="";else if(F(p))c=`<${+l+1}.0.0-0`;else if(F(d))c=`<${l}.${+p+1}.0-0`;else if(f)c=`<=${l}.${p}.${d}-${f}`;else if(e)c=`<${l}.${p}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},Og=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(T(e[n].semver),e[n].semver===Xn.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var bt=y(function(hD,La){var St=Symbol("SemVer ANY");class hr{static get ANY(){return St}constructor(e,t){if(t=Pa(t),e instanceof hr)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),ei("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===St)this.value="";else this.value=this.operator+this.semver.version;ei("comp",this)}parse(e){let t=this.options.loose?Aa[Da.COMPARATORLOOSE]:Aa[Da.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=St;else this.semver=new Oa(r[2],this.options.loose)}toString(){return this.value}test(e){if(ei("Comparator.test",e,this.options.loose),this.semver===St||e===St)return!0;if(typeof e==="string")try{e=new Oa(e,this.options)}catch(t){return!1}return Zn(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof hr))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Ta(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Ta(this.value,t).test(e.semver)}if(t=Pa(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Zn(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Zn(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}La.exports=hr;var Pa=or(),{safeRe:Aa,t:Da}=Ge(),Zn=Qn(),ei=mt(),Oa=q(),Ta=W()});var Ct=y(function(yD,Na){var Tg=W(),Lg=(e,t,r)=>{try{t=new Tg(t,r)}catch(n){return!1}return t.test(e)};Na.exports=Lg});var Ma=y(function(bD,$a){var Ng=W(),$g=(e,t)=>new Ng(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));$a.exports=$g});var Fa=y(function(SD,_a){var Mg=q(),_g=W(),Fg=(e,t,r)=>{let n=null,i=null,o=null;try{o=new _g(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===-1)n=s,i=new Mg(n,r)}}),n};_a.exports=Fg});var qa=y(function(CD,ja){var jg=q(),qg=W(),Bg=(e,t,r)=>{let n=null,i=null,o=null;try{o=new qg(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===1)n=s,i=new jg(n,r)}}),n};ja.exports=Bg});var Va=y(function(RD,Ua){var ti=q(),Ug=W(),Ba=ht(),Vg=(e,t)=>{e=new Ug(e,t);let r=new ti("0.0.0");if(e.test(r))return r;if(r=new ti("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;if(i.forEach((s)=>{let a=new ti(s.semver.version);switch(s.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||Ba(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||Ba(r,o)))r=o}if(r&&e.test(r))return r;return null};Ua.exports=Vg});var Ha=y(function(kD,Ka){var Kg=W(),Hg=(e,t)=>{try{return new Kg(e,t).range||"*"}catch(r){return null}};Ka.exports=Hg});var yr=y(function(xD,Wa){var Gg=q(),za=bt(),{ANY:Yg}=za,zg=W(),Wg=Ct(),Ga=ht(),Ya=dr(),Jg=fr(),Qg=pr(),Xg=(e,t,r,n)=>{e=new Gg(e,n),t=new zg(t,n);let i,o,s,a,c;switch(r){case">":i=Ga,o=Jg,s=Ya,a=">",c=">=";break;case"<":i=Ya,o=Qg,s=Ga,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Wg(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let p=t.set[l],d=null,f=null;if(p.forEach((u)=>{if(u.semver===Yg)u=new za(">=0.0.0");if(d=d||u,f=f||u,i(u.semver,d.semver,n))d=u;else if(s(u.semver,f.semver,n))f=u}),d.operator===a||d.operator===c)return!1;if((!f.operator||f.operator===a)&&o(e,f.semver))return!1;else if(f.operator===c&&s(e,f.semver))return!1}return!0};Wa.exports=Xg});var Qa=y(function(wD,Ja){var Zg=yr(),em=(e,t,r)=>Zg(e,t,">",r);Ja.exports=em});var Za=y(function(vD,Xa){var tm=yr(),rm=(e,t,r)=>tm(e,t,"<",r);Xa.exports=rm});var rc=y(function(ED,tc){var ec=W(),nm=(e,t,r)=>(e=new ec(e,r),t=new ec(t,r),e.intersects(t,r));tc.exports=nm});var ic=y(function(ID,nc){var im=Ct(),om=z();nc.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((p,d)=>om(p,d,r));for(let p of s)if(im(p,t,r)){if(o=p,!i)i=p}else{if(o)n.push([i,o]);o=null,i=null}if(i)n.push([i,null]);let a=[];for(let[p,d]of n)if(p===d)a.push(p);else if(!d&&p===s[0])a.push("*");else if(!d)a.push(`>=${p}`);else if(p===s[0])a.push(`<=${d}`);else a.push(`${p} - ${d}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var uc=y(function(PD,lc){var oc=W(),ii=bt(),{ANY:ri}=ii,ni=Ct(),oi=z(),sm=(e,t,r={})=>{if(e===t)return!0;e=new oc(e,r),t=new oc(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=cm(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},am=[new ii(">=0.0.0-0")],sc=[new ii(">=0.0.0")],cm=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ri)if(t.length===1&&t[0].semver===ri)return!0;else if(r.includePrerelease)e=am;else e=sc;if(t.length===1&&t[0].semver===ri)if(r.includePrerelease)return!0;else t=sc;let n=new Set,i,o;for(let u of e)if(u.operator===">"||u.operator===">=")i=ac(i,u,r);else if(u.operator==="<"||u.operator==="<=")o=cc(o,u,r);else n.add(u.semver);if(n.size>1)return null;let s;if(i&&o){if(s=oi(i.semver,o.semver,r),s>0)return null;else if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let u of n){if(i&&!ni(u,String(i),r))return null;if(o&&!ni(u,String(o),r))return null;for(let m of t)if(!ni(u,String(m),r))return!1;return!0}let a,c,l,p,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0)d=!1;for(let u of t){if(p=p||u.operator===">"||u.operator===">=",l=l||u.operator==="<"||u.operator==="<=",i){if(f){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===f.major&&u.semver.minor===f.minor&&u.semver.patch===f.patch)f=!1}if(u.operator===">"||u.operator===">="){if(a=ac(i,u,r),a===u&&a!==i)return!1}else if(i.operator===">="&&!u.test(i.semver))return!1}if(o){if(d){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===d.major&&u.semver.minor===d.minor&&u.semver.patch===d.patch)d=!1}if(u.operator==="<"||u.operator==="<="){if(c=cc(o,u,r),c===u&&c!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||i)&&s!==0)return!1}if(i&&l&&!o&&s!==0)return!1;if(o&&p&&!i&&s!==0)return!1;if(f||d)return!1;return!0},ac=(e,t,r)=>{if(!e)return t;let n=oi(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},cc=(e,t,r)=>{if(!e)return t;let n=oi(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};lc.exports=sm});var gc=y(function(AD,fc){var si=Ge(),dc=He(),lm=q(),pc=Yn(),um=me(),dm=$s(),pm=_s(),fm=qs(),gm=Vs(),mm=Hs(),hm=Ys(),ym=Ws(),bm=Qs(),Sm=z(),Cm=ta(),Rm=na(),km=ur(),xm=aa(),wm=la(),vm=ht(),Em=dr(),Im=Wn(),Pm=Jn(),Am=pr(),Dm=fr(),Om=Qn(),Tm=ba(),Lm=Ca(),Nm=bt(),$m=W(),Mm=Ct(),_m=Ma(),Fm=Fa(),jm=qa(),qm=Va(),Bm=Ha(),Um=yr(),Vm=Qa(),Km=Za(),Hm=rc(),Gm=ic(),Ym=uc();fc.exports={parse:um,valid:dm,clean:pm,inc:fm,diff:gm,major:mm,minor:hm,patch:ym,prerelease:bm,compare:Sm,rcompare:Cm,compareLoose:Rm,compareBuild:km,sort:xm,rsort:wm,gt:vm,lt:Em,eq:Im,neq:Pm,gte:Am,lte:Dm,cmp:Om,coerce:Tm,truncate:Lm,Comparator:Nm,Range:$m,satisfies:Mm,toComparators:_m,maxSatisfying:Fm,minSatisfying:jm,minVersion:qm,validRange:Bm,outside:Um,gtr:Vm,ltr:Km,intersects:Hm,simplifyRange:Gm,subset:Ym,SemVer:lm,re:si.re,src:si.src,tokens:si.t,SEMVER_SPEC_VERSION:dc.SEMVER_SPEC_VERSION,RELEASE_TYPES:dc.RELEASE_TYPES,compareIdentifiers:pc.compareIdentifiers,rcompareIdentifiers:pc.rcompareIdentifiers}});var zm;var ai=V(()=>{zm=Nd(gc(),1)});var A=y(function(rh){var ci=Symbol.for("yaml.alias"),mc=Symbol.for("yaml.document"),br=Symbol.for("yaml.map"),hc=Symbol.for("yaml.pair"),li=Symbol.for("yaml.scalar"),Sr=Symbol.for("yaml.seq"),pe=Symbol.for("yaml.node.type"),Wm=(e)=>!!e&&typeof e==="object"&&e[pe]===ci,Jm=(e)=>!!e&&typeof e==="object"&&e[pe]===mc,Qm=(e)=>!!e&&typeof e==="object"&&e[pe]===br,Xm=(e)=>!!e&&typeof e==="object"&&e[pe]===hc,yc=(e)=>!!e&&typeof e==="object"&&e[pe]===li,Zm=(e)=>!!e&&typeof e==="object"&&e[pe]===Sr;function bc(e){if(e&&typeof e==="object")switch(e[pe]){case br:case Sr:return!0}return!1}function eh(e){if(e&&typeof e==="object")switch(e[pe]){case ci:case br:case li:case Sr:return!0}return!1}var th=(e)=>(yc(e)||bc(e))&&!!e.anchor;rh.ALIAS=ci;rh.DOC=mc;rh.MAP=br;rh.NODE_TYPE=pe;rh.PAIR=hc;rh.SCALAR=li;rh.SEQ=Sr;rh.hasAnchor=th;rh.isAlias=Wm;rh.isCollection=bc;rh.isDocument=Jm;rh.isMap=Qm;rh.isNode=eh;rh.isPair=Xm;rh.isScalar=yc;rh.isSeq=Zm});var Rt=y(function(Sh){var j=A(),K=Symbol("break visit"),Sc=Symbol("skip children"),oe=Symbol("remove node");function Cr(e,t){let r=Cc(t);if(j.isDocument(e)){if(Ye(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else Ye(null,e,r,Object.freeze([]))}Cr.BREAK=K;Cr.SKIP=Sc;Cr.REMOVE=oe;function Ye(e,t,r,n){let i=Rc(e,t,r,n);if(j.isNode(i)||j.isPair(i))return kc(e,n,i),Ye(e,i,r,n);if(typeof i!=="symbol"){if(j.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=Ye(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===K)return K;else if(s===oe)t.items.splice(o,1),o-=1}}else if(j.isPair(t)){n=Object.freeze(n.concat(t));let o=Ye("key",t.key,r,n);if(o===K)return K;else if(o===oe)t.key=null;let s=Ye("value",t.value,r,n);if(s===K)return K;else if(s===oe)t.value=null}}return i}async function Rr(e,t){let r=Cc(t);if(j.isDocument(e)){if(await ze(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else await ze(null,e,r,Object.freeze([]))}Rr.BREAK=K;Rr.SKIP=Sc;Rr.REMOVE=oe;async function ze(e,t,r,n){let i=await Rc(e,t,r,n);if(j.isNode(i)||j.isPair(i))return kc(e,n,i),ze(e,i,r,n);if(typeof i!=="symbol"){if(j.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=await ze(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===K)return K;else if(s===oe)t.items.splice(o,1),o-=1}}else if(j.isPair(t)){n=Object.freeze(n.concat(t));let o=await ze("key",t.key,r,n);if(o===K)return K;else if(o===oe)t.key=null;let s=await ze("value",t.value,r,n);if(s===K)return K;else if(s===oe)t.value=null}}return i}function Cc(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function Rc(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(j.isMap(t))return r.Map?.(e,t,n);if(j.isSeq(t))return r.Seq?.(e,t,n);if(j.isPair(t))return r.Pair?.(e,t,n);if(j.isScalar(t))return r.Scalar?.(e,t,n);if(j.isAlias(t))return r.Alias?.(e,t,n);return}function kc(e,t,r){let n=t[t.length-1];if(j.isCollection(n))n.items[e]=r;else if(j.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(j.isDocument(n))n.contents=r;else{let i=j.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Sh.visit=Cr;Sh.visitAsync=Rr});var ui=y(function(vh){var xc=A(),kh=Rt(),xh={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},wh=(e)=>e.replace(/[!,[\]{}]/g,(t)=>xh[t]);class J{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},J.defaultYaml,e),this.tags=Object.assign({},J.defaultTags,t)}clone(){let e=new J(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new J(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:J.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},J.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:J.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},J.defaultTags),this.atNextDocument=!1;let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),r.length<2)return!1}let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);if(o==="!"||o==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return o}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(n)}catch(o){return t(String(o)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+wh(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&xc.isNode(e.contents)){let i={};kh.visit(e.contents,(o,s)=>{if(xc.isNode(s)&&s.tag)i[s.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,o]of r){if(i==="!!"&&o==="tag:yaml.org,2002:")continue;if(!e||n.some((s)=>s.startsWith(o)))t.push(`%TAG ${i} ${o}`)}return t.join(`
|
|
4
|
-
`)}}
|
|
5
|
-
`)?
|
|
3
|
+
var $d=Object.create;var{getPrototypeOf:Md,defineProperty:ns,getOwnPropertyNames:_d}=Object;var is=Object.prototype.hasOwnProperty;function Fd(e){return this[e]}var jd,qd,Bd=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?jd??=new WeakMap:qd??=new WeakMap,o=i.get(e);if(o)return o}r=e!=null?$d(Md(e)):{};let s=t||!e||!e.__esModule||!is.call(e,"default")?ns(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of _d(e))if(!is.call(s,a))ns(s,a,{get:Fd.bind(e,a),enumerable:!0})}if(n)i.set(e,s);return s};var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var K=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var er=import.meta.require;var Ye=y(function(nD,As){var ef=Number.MAX_SAFE_INTEGER||9007199254740991,tf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];As.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:ef,RELEASE_TYPES:tf,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var yt=y(function(iD,Ds){var rf=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Ds.exports=rf});var Ge=y(function(ie,Os){var{MAX_SAFE_COMPONENT_LENGTH:Xn,MAX_SAFE_BUILD_LENGTH:nf,MAX_LENGTH:of}=Ye(),sf=yt();ie=Os.exports={};var af=ie.re=[],cf=ie.safeRe=[],R=ie.src=[],lf=ie.safeSrc=[],C=ie.t={},uf=0,Zn="[a-zA-Z0-9-]",df=[["\\s",1],["\\d",of],[Zn,nf]],pf=(e)=>{for(let[t,r]of df)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},P=(e,t,r)=>{let n=pf(t),i=uf++;sf(e,i,t),C[e]=i,R[i]=t,lf[i]=n,af[i]=new RegExp(t,r?"g":void 0),cf[i]=new RegExp(n,r?"g":void 0)};P("NUMERICIDENTIFIER","0|[1-9]\\d*");P("NUMERICIDENTIFIERLOOSE","\\d+");P("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Zn}*`);P("MAINVERSION",`(${R[C.NUMERICIDENTIFIER]})\\.(${R[C.NUMERICIDENTIFIER]})\\.(${R[C.NUMERICIDENTIFIER]})`);P("MAINVERSIONLOOSE",`(${R[C.NUMERICIDENTIFIERLOOSE]})\\.(${R[C.NUMERICIDENTIFIERLOOSE]})\\.(${R[C.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASEIDENTIFIER",`(?:${R[C.NONNUMERICIDENTIFIER]}|${R[C.NUMERICIDENTIFIER]})`);P("PRERELEASEIDENTIFIERLOOSE",`(?:${R[C.NONNUMERICIDENTIFIER]}|${R[C.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASE",`(?:-(${R[C.PRERELEASEIDENTIFIER]}(?:\\.${R[C.PRERELEASEIDENTIFIER]})*))`);P("PRERELEASELOOSE",`(?:-?(${R[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[C.PRERELEASEIDENTIFIERLOOSE]})*))`);P("BUILDIDENTIFIER",`${Zn}+`);P("BUILD",`(?:\\+(${R[C.BUILDIDENTIFIER]}(?:\\.${R[C.BUILDIDENTIFIER]})*))`);P("FULLPLAIN",`v?${R[C.MAINVERSION]}${R[C.PRERELEASE]}?${R[C.BUILD]}?`);P("FULL",`^${R[C.FULLPLAIN]}$`);P("LOOSEPLAIN",`[v=\\s]*${R[C.MAINVERSIONLOOSE]}${R[C.PRERELEASELOOSE]}?${R[C.BUILD]}?`);P("LOOSE",`^${R[C.LOOSEPLAIN]}$`);P("GTLT","((?:<|>)?=?)");P("XRANGEIDENTIFIERLOOSE",`${R[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);P("XRANGEIDENTIFIER",`${R[C.NUMERICIDENTIFIER]}|x|X|\\*`);P("XRANGEPLAIN",`[v=\\s]*(${R[C.XRANGEIDENTIFIER]})(?:\\.(${R[C.XRANGEIDENTIFIER]})(?:\\.(${R[C.XRANGEIDENTIFIER]})(?:${R[C.PRERELEASE]})?${R[C.BUILD]}?)?)?`);P("XRANGEPLAINLOOSE",`[v=\\s]*(${R[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[C.XRANGEIDENTIFIERLOOSE]})(?:${R[C.PRERELEASELOOSE]})?${R[C.BUILD]}?)?)?`);P("XRANGE",`^${R[C.GTLT]}\\s*${R[C.XRANGEPLAIN]}$`);P("XRANGELOOSE",`^${R[C.GTLT]}\\s*${R[C.XRANGEPLAINLOOSE]}$`);P("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Xn}})(?:\\.(\\d{1,${Xn}}))?(?:\\.(\\d{1,${Xn}}))?`);P("COERCE",`${R[C.COERCEPLAIN]}(?:$|[^\\d])`);P("COERCEFULL",R[C.COERCEPLAIN]+`(?:${R[C.PRERELEASE]})?(?:${R[C.BUILD]})?(?:$|[^\\d])`);P("COERCERTL",R[C.COERCE],!0);P("COERCERTLFULL",R[C.COERCEFULL],!0);P("LONETILDE","(?:~>?)");P("TILDETRIM",`(\\s*)${R[C.LONETILDE]}\\s+`,!0);ie.tildeTrimReplace="$1~";P("TILDE",`^${R[C.LONETILDE]}${R[C.XRANGEPLAIN]}$`);P("TILDELOOSE",`^${R[C.LONETILDE]}${R[C.XRANGEPLAINLOOSE]}$`);P("LONECARET","(?:\\^)");P("CARETTRIM",`(\\s*)${R[C.LONECARET]}\\s+`,!0);ie.caretTrimReplace="$1^";P("CARET",`^${R[C.LONECARET]}${R[C.XRANGEPLAIN]}$`);P("CARETLOOSE",`^${R[C.LONECARET]}${R[C.XRANGEPLAINLOOSE]}$`);P("COMPARATORLOOSE",`^${R[C.GTLT]}\\s*(${R[C.LOOSEPLAIN]})$|^$`);P("COMPARATOR",`^${R[C.GTLT]}\\s*(${R[C.FULLPLAIN]})$|^$`);P("COMPARATORTRIM",`(\\s*)${R[C.GTLT]}\\s*(${R[C.LOOSEPLAIN]}|${R[C.XRANGEPLAIN]})`,!0);ie.comparatorTrimReplace="$1$2$3";P("HYPHENRANGE",`^\\s*(${R[C.XRANGEPLAIN]})\\s+-\\s+(${R[C.XRANGEPLAIN]})\\s*$`);P("HYPHENRANGELOOSE",`^\\s*(${R[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[C.XRANGEPLAINLOOSE]})\\s*$`);P("STAR","(<|>)?=?\\s*\\*");P("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");P("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var pr=y(function(oD,Ts){var ff=Object.freeze({loose:!0}),gf=Object.freeze({}),mf=(e)=>{if(!e)return gf;if(typeof e!=="object")return ff;return e};Ts.exports=mf});var ei=y(function(sD,$s){var Ls=/^[0-9]+$/,Ns=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Ls.test(e),n=Ls.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},hf=(e,t)=>Ns(t,e);$s.exports={compareIdentifiers:Ns,rcompareIdentifiers:hf}});var q=y(function(aD,_s){var fr=yt(),{MAX_LENGTH:Ms,MAX_SAFE_INTEGER:gr}=Ye(),{safeRe:mr,t:hr}=Ge(),yf=pr(),{compareIdentifiers:ti}=ei(),bf=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(ti(e[n],r[n])!==0)return!1;return!0};class te{constructor(e,t){if(t=yf(t),e instanceof te)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Ms)throw TypeError(`version is longer than ${Ms} characters`);fr("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?mr[hr.LOOSE]:mr[hr.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>gr||this.major<0)throw TypeError("Invalid major version");if(this.minor>gr||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>gr||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<gr)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(fr("SemVer.compare",this.version,this.options,e),!(e instanceof te)){if(typeof e==="string"&&e===this.version)return 0;e=new te(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof te))e=new te(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof te))e=new te(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(fr("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return ti(r,n)}while(++t)}compareBuild(e){if(!(e instanceof te))e=new te(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(fr("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return ti(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?mr[hr.PRERELEASELOOSE]:mr[hr.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(bf(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}_s.exports=te});var ye=y(function(cD,js){var Fs=q(),Sf=(e,t,r=!1)=>{if(e instanceof Fs)return e;try{return new Fs(e,t)}catch(n){if(!r)return null;throw n}};js.exports=Sf});var Bs=y(function(lD,qs){var Rf=ye(),Cf=(e,t)=>{let r=Rf(e,t);return r?r.version:null};qs.exports=Cf});var Vs=y(function(uD,Us){var kf=ye(),wf=(e,t)=>{let r=kf(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Us.exports=wf});var zs=y(function(dD,Hs){var Ks=q(),xf=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Ks(e instanceof Ks?e.version:e,r).inc(t,n,i).version}catch(o){return null}};Hs.exports=xf});var Ws=y(function(pD,Gs){var Ys=ye(),vf=(e,t)=>{let r=Ys(e,null,!0),n=Ys(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let d=c?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};Gs.exports=vf});var Qs=y(function(fD,Js){var Ef=q(),If=(e,t)=>new Ef(e,t).major;Js.exports=If});var Zs=y(function(gD,Xs){var Pf=q(),Af=(e,t)=>new Pf(e,t).minor;Xs.exports=Af});var ta=y(function(mD,ea){var Df=q(),Of=(e,t)=>new Df(e,t).patch;ea.exports=Of});var na=y(function(hD,ra){var Tf=ye(),Lf=(e,t)=>{let r=Tf(e,t);return r&&r.prerelease.length?r.prerelease:null};ra.exports=Lf});var W=y(function(yD,oa){var ia=q(),Nf=(e,t,r)=>new ia(e,r).compare(new ia(t,r));oa.exports=Nf});var aa=y(function(bD,sa){var $f=W(),Mf=(e,t,r)=>$f(t,e,r);sa.exports=Mf});var la=y(function(SD,ca){var _f=W(),Ff=(e,t)=>_f(e,t,!0);ca.exports=Ff});var yr=y(function(RD,da){var ua=q(),jf=(e,t,r)=>{let n=new ua(e,r),i=new ua(t,r);return n.compare(i)||n.compareBuild(i)};da.exports=jf});var fa=y(function(CD,pa){var qf=yr(),Bf=(e,t)=>e.sort((r,n)=>qf(r,n,t));pa.exports=Bf});var ma=y(function(kD,ga){var Uf=yr(),Vf=(e,t)=>e.sort((r,n)=>Uf(n,r,t));ga.exports=Vf});var bt=y(function(wD,ha){var Kf=W(),Hf=(e,t,r)=>Kf(e,t,r)>0;ha.exports=Hf});var br=y(function(xD,ya){var zf=W(),Yf=(e,t,r)=>zf(e,t,r)<0;ya.exports=Yf});var ri=y(function(vD,ba){var Gf=W(),Wf=(e,t,r)=>Gf(e,t,r)===0;ba.exports=Wf});var ni=y(function(ED,Sa){var Jf=W(),Qf=(e,t,r)=>Jf(e,t,r)!==0;Sa.exports=Qf});var Sr=y(function(ID,Ra){var Xf=W(),Zf=(e,t,r)=>Xf(e,t,r)>=0;Ra.exports=Zf});var Rr=y(function(PD,Ca){var eg=W(),tg=(e,t,r)=>eg(e,t,r)<=0;Ca.exports=tg});var ii=y(function(AD,ka){var rg=ri(),ng=ni(),ig=bt(),og=Sr(),sg=br(),ag=Rr(),cg=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return rg(e,r,n);case"!=":return ng(e,r,n);case">":return ig(e,r,n);case">=":return og(e,r,n);case"<":return sg(e,r,n);case"<=":return ag(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};ka.exports=cg});var xa=y(function(DD,wa){var lg=q(),ug=ye(),{safeRe:Cr,t:kr}=Ge(),dg=(e,t)=>{if(e instanceof lg)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Cr[kr.COERCEFULL]:Cr[kr.COERCE]);else{let c=t.includePrerelease?Cr[kr.COERCERTLFULL]:Cr[kr.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return ug(`${n}.${i}.${o}${s}${a}`,t)};wa.exports=dg});var Ea=y(function(OD,va){var pg=ye(),fg=Ye(),gg=q(),mg=(e,t,r)=>{if(!fg.RELEASE_TYPES.includes(t))return null;let n=hg(e,r);return n&&yg(n,t)},hg=(e,t)=>{let r=e instanceof gg?e.version:e;return pg(r,t)},yg=(e,t)=>{if(bg(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},bg=(e)=>e.startsWith("pre");va.exports=mg});var Aa=y(function(TD,Pa){class Ia{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}Pa.exports=Ia});var J=y(function(LD,La){var Sg=/\s+/g;class St{constructor(e,t){if(t=Cg(t),e instanceof St)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new St(e.raw,t);if(e instanceof oi)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Sg," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Oa(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Dg(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Ag,"");let r=((this.options.includePrerelease&&Ig)|(this.options.loose&&Pg))+":"+e,n=Da.get(r);if(n)return n;let i=this.options.loose,o=i?V[B.HYPHENRANGELOOSE]:V[B.HYPHENRANGE];e=e.replace(o,Bg(this.options.includePrerelease)),T("hyphen replace",e),e=e.replace(V[B.COMPARATORTRIM],xg),T("comparator trim",e),e=e.replace(V[B.TILDETRIM],vg),T("tilde trim",e),e=e.replace(V[B.CARETTRIM],Eg),T("caret trim",e);let s=e.split(" ").map((d)=>Og(d,this.options)).join(" ").split(/\s+/).map((d)=>qg(d,this.options));if(i)s=s.filter((d)=>(T("loose invalid filter",d,this.options),!!d.match(V[B.COMPARATORLOOSE])));T("range list",s);let a=new Map,c=s.map((d)=>new oi(d,this.options));for(let d of c){if(Oa(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return Da.set(r,l),l}intersects(e,t){if(!(e instanceof St))throw TypeError("a Range is required");return this.set.some((r)=>Ta(r,t)&&e.set.some((n)=>Ta(n,t)&&r.every((i)=>n.every((o)=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new kg(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Ug(this.set[t],e,this.options))return!0;return!1}}La.exports=St;var Rg=Aa(),Da=new Rg,Cg=pr(),oi=Rt(),T=yt(),kg=q(),{safeRe:V,src:wg,t:B,comparatorTrimReplace:xg,tildeTrimReplace:vg,caretTrimReplace:Eg}=Ge(),{FLAG_INCLUDE_PRERELEASE:Ig,FLAG_LOOSE:Pg}=Ye(),Ag=new RegExp(wg[B.BUILD],"g"),Oa=(e)=>e.value==="<0.0.0-0",Dg=(e)=>e.value==="",Ta=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((o)=>i.intersects(o,t)),i=n.pop();return r},Og=(e,t)=>(e=e.replace(V[B.BUILD],""),T("comp",e,t),e=$g(e,t),T("caret",e),e=Lg(e,t),T("tildes",e),e=_g(e,t),T("xrange",e),e=jg(e,t),T("stars",e),e),F=(e)=>!e||e.toLowerCase()==="x"||e==="*",Tg=(e,t,r)=>F(e)&&!F(t)||F(t)&&r&&!F(r),Lg=(e,t)=>e.trim().split(/\s+/).map((r)=>Ng(r,t)).join(" "),Ng=(e,t)=>{let r=t.loose?V[B.TILDELOOSE]:V[B.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("tilde",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else if(c)T("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;return T("tilde return",l),l})},$g=(e,t)=>e.trim().split(/\s+/).map((r)=>Mg(r,t)).join(" "),Mg=(e,t)=>{T("caret",e,t);let r=t.loose?V[B.CARETLOOSE]:V[B.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{T("caret",e,i,o,s,a,c);let l;if(F(o))l="";else if(F(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(F(a))if(o==="0")l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`;else if(c)if(T("replaceCaret pr",c),o==="0")if(s==="0")l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`;else if(T("no pr"),o==="0")if(s==="0")l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`;return T("caret return",l),l})},_g=(e,t)=>(T("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Fg(r,t)).join(" ")),Fg=(e,t)=>{e=e.trim();let r=t.loose?V[B.XRANGELOOSE]:V[B.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(T("xRange",e,n,i,o,s,a,c),Tg(o,s,a))return e;let l=F(o),d=l||F(s),p=d||F(a),f=p;if(i==="="&&f)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&f){if(d)s=0;if(a=0,i===">")if(i=">=",d)o=+o+1,s=0,a=0;else s=+s+1,a=0;else if(i==="<=")if(i="<",d)o=+o+1;else s=+s+1;if(i==="<")c="-0";n=`${i+o}.${s}.${a}${c}`}else if(d)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(p)n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`;return T("xRange return",n),n})},jg=(e,t)=>(T("replaceStars",e,t),e.trim().replace(V[B.STAR],"")),qg=(e,t)=>(T("replaceGTE0",e,t),e.trim().replace(V[t.includePrerelease?B.GTE0PRE:B.GTE0],"")),Bg=(e)=>(t,r,n,i,o,s,a,c,l,d,p,f)=>{if(F(n))r="";else if(F(i))r=`>=${n}.0.0${e?"-0":""}`;else if(F(o))r=`>=${n}.${i}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(F(l))c="";else if(F(d))c=`<${+l+1}.0.0-0`;else if(F(p))c=`<${l}.${+d+1}.0-0`;else if(f)c=`<=${l}.${d}.${p}-${f}`;else if(e)c=`<${l}.${d}.${+p+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},Ug=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(T(e[n].semver),e[n].semver===oi.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var Rt=y(function(ND,ja){var Ct=Symbol("SemVer ANY");class wr{static get ANY(){return Ct}constructor(e,t){if(t=Na(t),e instanceof wr)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),ai("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ct)this.value="";else this.value=this.operator+this.semver.version;ai("comp",this)}parse(e){let t=this.options.loose?$a[Ma.COMPARATORLOOSE]:$a[Ma.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=Ct;else this.semver=new _a(r[2],this.options.loose)}toString(){return this.value}test(e){if(ai("Comparator.test",e,this.options.loose),this.semver===Ct||e===Ct)return!0;if(typeof e==="string")try{e=new _a(e,this.options)}catch(t){return!1}return si(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof wr))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Fa(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Fa(this.value,t).test(e.semver)}if(t=Na(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(si(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(si(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}ja.exports=wr;var Na=pr(),{safeRe:$a,t:Ma}=Ge(),si=ii(),ai=yt(),_a=q(),Fa=J()});var kt=y(function($D,qa){var Vg=J(),Kg=(e,t,r)=>{try{t=new Vg(t,r)}catch(n){return!1}return t.test(e)};qa.exports=Kg});var Ua=y(function(MD,Ba){var Hg=J(),zg=(e,t)=>new Hg(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Ba.exports=zg});var Ka=y(function(_D,Va){var Yg=q(),Gg=J(),Wg=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Gg(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===-1)n=s,i=new Yg(n,r)}}),n};Va.exports=Wg});var za=y(function(FD,Ha){var Jg=q(),Qg=J(),Xg=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Qg(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===1)n=s,i=new Jg(n,r)}}),n};Ha.exports=Xg});var Wa=y(function(jD,Ga){var ci=q(),Zg=J(),Ya=bt(),em=(e,t)=>{e=new Zg(e,t);let r=new ci("0.0.0");if(e.test(r))return r;if(r=new ci("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;if(i.forEach((s)=>{let a=new ci(s.semver.version);switch(s.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||Ya(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||Ya(r,o)))r=o}if(r&&e.test(r))return r;return null};Ga.exports=em});var Qa=y(function(qD,Ja){var tm=J(),rm=(e,t)=>{try{return new tm(e,t).range||"*"}catch(r){return null}};Ja.exports=rm});var xr=y(function(BD,tc){var nm=q(),ec=Rt(),{ANY:im}=ec,om=J(),sm=kt(),Xa=bt(),Za=br(),am=Rr(),cm=Sr(),lm=(e,t,r,n)=>{e=new nm(e,n),t=new om(t,n);let i,o,s,a,c;switch(r){case">":i=Xa,o=am,s=Za,a=">",c=">=";break;case"<":i=Za,o=cm,s=Xa,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(sm(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let d=t.set[l],p=null,f=null;if(d.forEach((u)=>{if(u.semver===im)u=new ec(">=0.0.0");if(p=p||u,f=f||u,i(u.semver,p.semver,n))p=u;else if(s(u.semver,f.semver,n))f=u}),p.operator===a||p.operator===c)return!1;if((!f.operator||f.operator===a)&&o(e,f.semver))return!1;else if(f.operator===c&&s(e,f.semver))return!1}return!0};tc.exports=lm});var nc=y(function(UD,rc){var um=xr(),dm=(e,t,r)=>um(e,t,">",r);rc.exports=dm});var oc=y(function(VD,ic){var pm=xr(),fm=(e,t,r)=>pm(e,t,"<",r);ic.exports=fm});var cc=y(function(KD,ac){var sc=J(),gm=(e,t,r)=>(e=new sc(e,r),t=new sc(t,r),e.intersects(t,r));ac.exports=gm});var uc=y(function(HD,lc){var mm=kt(),hm=W();lc.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((d,p)=>hm(d,p,r));for(let d of s)if(mm(d,t,r)){if(o=d,!i)i=d}else{if(o)n.push([i,o]);o=null,i=null}if(i)n.push([i,null]);let a=[];for(let[d,p]of n)if(d===p)a.push(d);else if(!p&&d===s[0])a.push("*");else if(!p)a.push(`>=${d}`);else if(d===s[0])a.push(`<=${p}`);else a.push(`${d} - ${p}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var hc=y(function(zD,mc){var dc=J(),di=Rt(),{ANY:li}=di,ui=kt(),pi=W(),ym=(e,t,r={})=>{if(e===t)return!0;e=new dc(e,r),t=new dc(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=Sm(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},bm=[new di(">=0.0.0-0")],pc=[new di(">=0.0.0")],Sm=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===li)if(t.length===1&&t[0].semver===li)return!0;else if(r.includePrerelease)e=bm;else e=pc;if(t.length===1&&t[0].semver===li)if(r.includePrerelease)return!0;else t=pc;let n=new Set,i,o;for(let u of e)if(u.operator===">"||u.operator===">=")i=fc(i,u,r);else if(u.operator==="<"||u.operator==="<=")o=gc(o,u,r);else n.add(u.semver);if(n.size>1)return null;let s;if(i&&o){if(s=pi(i.semver,o.semver,r),s>0)return null;else if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let u of n){if(i&&!ui(u,String(i),r))return null;if(o&&!ui(u,String(o),r))return null;for(let m of t)if(!ui(u,String(m),r))return!1;return!0}let a,c,l,d,p=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0)p=!1;for(let u of t){if(d=d||u.operator===">"||u.operator===">=",l=l||u.operator==="<"||u.operator==="<=",i){if(f){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===f.major&&u.semver.minor===f.minor&&u.semver.patch===f.patch)f=!1}if(u.operator===">"||u.operator===">="){if(a=fc(i,u,r),a===u&&a!==i)return!1}else if(i.operator===">="&&!u.test(i.semver))return!1}if(o){if(p){if(u.semver.prerelease&&u.semver.prerelease.length&&u.semver.major===p.major&&u.semver.minor===p.minor&&u.semver.patch===p.patch)p=!1}if(u.operator==="<"||u.operator==="<="){if(c=gc(o,u,r),c===u&&c!==o)return!1}else if(o.operator==="<="&&!u.test(o.semver))return!1}if(!u.operator&&(o||i)&&s!==0)return!1}if(i&&l&&!o&&s!==0)return!1;if(o&&d&&!i&&s!==0)return!1;if(f||p)return!1;return!0},fc=(e,t,r)=>{if(!e)return t;let n=pi(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},gc=(e,t,r)=>{if(!e)return t;let n=pi(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};mc.exports=ym});var Rc=y(function(YD,Sc){var fi=Ge(),yc=Ye(),Rm=q(),bc=ei(),Cm=ye(),km=Bs(),wm=Vs(),xm=zs(),vm=Ws(),Em=Qs(),Im=Zs(),Pm=ta(),Am=na(),Dm=W(),Om=aa(),Tm=la(),Lm=yr(),Nm=fa(),$m=ma(),Mm=bt(),_m=br(),Fm=ri(),jm=ni(),qm=Sr(),Bm=Rr(),Um=ii(),Vm=xa(),Km=Ea(),Hm=Rt(),zm=J(),Ym=kt(),Gm=Ua(),Wm=Ka(),Jm=za(),Qm=Wa(),Xm=Qa(),Zm=xr(),eh=nc(),th=oc(),rh=cc(),nh=uc(),ih=hc();Sc.exports={parse:Cm,valid:km,clean:wm,inc:xm,diff:vm,major:Em,minor:Im,patch:Pm,prerelease:Am,compare:Dm,rcompare:Om,compareLoose:Tm,compareBuild:Lm,sort:Nm,rsort:$m,gt:Mm,lt:_m,eq:Fm,neq:jm,gte:qm,lte:Bm,cmp:Um,coerce:Vm,truncate:Km,Comparator:Hm,Range:zm,satisfies:Ym,toComparators:Gm,maxSatisfying:Wm,minSatisfying:Jm,minVersion:Qm,validRange:Xm,outside:Zm,gtr:eh,ltr:th,intersects:rh,simplifyRange:nh,subset:ih,SemVer:Rm,re:fi.re,src:fi.src,tokens:fi.t,SEMVER_SPEC_VERSION:yc.SEMVER_SPEC_VERSION,RELEASE_TYPES:yc.RELEASE_TYPES,compareIdentifiers:bc.compareIdentifiers,rcompareIdentifiers:bc.rcompareIdentifiers}});var oh;var gi=K(()=>{oh=Bd(Rc(),1)});var A=y(function(fh){var mi=Symbol.for("yaml.alias"),Cc=Symbol.for("yaml.document"),vr=Symbol.for("yaml.map"),kc=Symbol.for("yaml.pair"),hi=Symbol.for("yaml.scalar"),Er=Symbol.for("yaml.seq"),pe=Symbol.for("yaml.node.type"),sh=(e)=>!!e&&typeof e==="object"&&e[pe]===mi,ah=(e)=>!!e&&typeof e==="object"&&e[pe]===Cc,ch=(e)=>!!e&&typeof e==="object"&&e[pe]===vr,lh=(e)=>!!e&&typeof e==="object"&&e[pe]===kc,wc=(e)=>!!e&&typeof e==="object"&&e[pe]===hi,uh=(e)=>!!e&&typeof e==="object"&&e[pe]===Er;function xc(e){if(e&&typeof e==="object")switch(e[pe]){case vr:case Er:return!0}return!1}function dh(e){if(e&&typeof e==="object")switch(e[pe]){case mi:case vr:case hi:case Er:return!0}return!1}var ph=(e)=>(wc(e)||xc(e))&&!!e.anchor;fh.ALIAS=mi;fh.DOC=Cc;fh.MAP=vr;fh.NODE_TYPE=pe;fh.PAIR=kc;fh.SCALAR=hi;fh.SEQ=Er;fh.hasAnchor=ph;fh.isAlias=sh;fh.isCollection=xc;fh.isDocument=ah;fh.isMap=ch;fh.isNode=dh;fh.isPair=lh;fh.isScalar=wc;fh.isSeq=uh});var wt=y(function(Dh){var j=A(),z=Symbol("break visit"),vc=Symbol("skip children"),oe=Symbol("remove node");function Ir(e,t){let r=Ec(t);if(j.isDocument(e)){if(We(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else We(null,e,r,Object.freeze([]))}Ir.BREAK=z;Ir.SKIP=vc;Ir.REMOVE=oe;function We(e,t,r,n){let i=Ic(e,t,r,n);if(j.isNode(i)||j.isPair(i))return Pc(e,n,i),We(e,i,r,n);if(typeof i!=="symbol"){if(j.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=We(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===z)return z;else if(s===oe)t.items.splice(o,1),o-=1}}else if(j.isPair(t)){n=Object.freeze(n.concat(t));let o=We("key",t.key,r,n);if(o===z)return z;else if(o===oe)t.key=null;let s=We("value",t.value,r,n);if(s===z)return z;else if(s===oe)t.value=null}}return i}async function Pr(e,t){let r=Ec(t);if(j.isDocument(e)){if(await Je(null,e.contents,r,Object.freeze([e]))===oe)e.contents=null}else await Je(null,e,r,Object.freeze([]))}Pr.BREAK=z;Pr.SKIP=vc;Pr.REMOVE=oe;async function Je(e,t,r,n){let i=await Ic(e,t,r,n);if(j.isNode(i)||j.isPair(i))return Pc(e,n,i),Je(e,i,r,n);if(typeof i!=="symbol"){if(j.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let s=await Je(o,t.items[o],r,n);if(typeof s==="number")o=s-1;else if(s===z)return z;else if(s===oe)t.items.splice(o,1),o-=1}}else if(j.isPair(t)){n=Object.freeze(n.concat(t));let o=await Je("key",t.key,r,n);if(o===z)return z;else if(o===oe)t.key=null;let s=await Je("value",t.value,r,n);if(s===z)return z;else if(s===oe)t.value=null}}return i}function Ec(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function Ic(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(j.isMap(t))return r.Map?.(e,t,n);if(j.isSeq(t))return r.Seq?.(e,t,n);if(j.isPair(t))return r.Pair?.(e,t,n);if(j.isScalar(t))return r.Scalar?.(e,t,n);if(j.isAlias(t))return r.Alias?.(e,t,n);return}function Pc(e,t,r){let n=t[t.length-1];if(j.isCollection(n))n.items[e]=r;else if(j.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(j.isDocument(n))n.contents=r;else{let i=j.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Dh.visit=Ir;Dh.visitAsync=Pr});var yi=y(function(Mh){var Ac=A(),Lh=wt(),Nh={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},$h=(e)=>e.replace(/[!,[\]{}]/g,(t)=>Nh[t]);class Q{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Q.defaultYaml,e),this.tags=Object.assign({},Q.defaultTags,t)}clone(){let e=new Q(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new Q(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Q.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Q.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:Q.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Q.defaultTags),this.atNextDocument=!1;let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),r.length<2)return!1}let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);if(o==="!"||o==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return o}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(n)}catch(o){return t(String(o)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+$h(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&Ac.isNode(e.contents)){let i={};Lh.visit(e.contents,(o,s)=>{if(Ac.isNode(s)&&s.tag)i[s.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,o]of r){if(i==="!!"&&o==="tag:yaml.org,2002:")continue;if(!e||n.some((s)=>s.startsWith(o)))t.push(`%TAG ${i} ${o}`)}return t.join(`
|
|
4
|
+
`)}}Q.defaultYaml={explicit:!1,version:"1.2"};Q.defaultTags={"!!":"tag:yaml.org,2002:"};Mh.Directives=Q});var Ar=y(function(Bh){var Dc=A(),Fh=wt();function jh(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(r)}return!0}function Oc(e){let t=new Set;return Fh.visit(e,{Value(r,n){if(n.anchor)t.add(n.anchor)}}),t}function Tc(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function qh(e,t){let r=[],n=new Map,i=null;return{onAnchor:(o)=>{r.push(o),i??(i=Oc(e));let s=Tc(t,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s==="object"&&s.anchor&&(Dc.isScalar(s.node)||Dc.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}Bh.anchorIsValid=jh;Bh.anchorNames=Oc;Bh.createNodeAnchors=qh;Bh.findNewAnchor=Tc});var bi=y(function(zh){function xt(e,t,r,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let s=n[i],a=xt(e,n,String(i),s);if(a===void 0)delete n[i];else if(a!==s)n[i]=a}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),s=xt(e,n,i,o);if(s===void 0)n.delete(i);else if(s!==o)n.set(i,s)}else if(n instanceof Set)for(let i of Array.from(n)){let o=xt(e,n,i,i);if(o===void 0)n.delete(i);else if(o!==i)n.delete(i),n.add(o)}else for(let[i,o]of Object.entries(n)){let s=xt(e,n,i,o);if(s===void 0)delete n[i];else if(s!==o)n[i]=s}return e.call(t,r,n)}zh.applyReviver=xt});var be=y(function(Wh){var Gh=A();function Lc(e,t,r){if(Array.isArray(e))return e.map((n,i)=>Lc(n,String(i),r));if(e&&typeof e.toJSON==="function"){if(!r||!Gh.hasAnchor(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=(o)=>{n.res=o,delete r.onCreate};let i=e.toJSON(t,r);if(r.onCreate)r.onCreate(i);return i}if(typeof e==="bigint"&&!r?.keep)return Number(e);return e}Wh.toJS=Lc});var Dr=y(function(Zh){var Qh=bi(),Nc=A(),Xh=be();class $c{constructor(e){Object.defineProperty(this,Nc.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:n,reviver:i}={}){if(!Nc.isDocument(e))throw TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r==="number"?r:100},s=Xh.toJS(this,"",o);if(typeof n==="function")for(let{count:a,res:c}of o.anchors.values())n(c,a);return typeof i==="function"?Qh.applyReviver(i,{"":s},"",s):s}}Zh.NodeBase=$c});var vt=y(function(oy){var ty=Ar(),ry=wt(),Qe=A(),ny=Dr(),iy=be();class Mc extends ny.NodeBase{constructor(e){super(Qe.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let r;if(t?.aliasResolveCache)r=t.aliasResolveCache;else if(r=[],ry.visit(e,{Node:(i,o)=>{if(Qe.isAlias(o)||Qe.hasAnchor(o))r.push(o)}}),t)t.aliasResolveCache=r;let n=void 0;for(let i of r){if(i===this)break;if(i.anchor===this.source)n=i}if(n&&t){let{anchors:i,doc:o,maxAliasCount:s}=t,a=i.get(n);if(!a)iy.toJS(n,null,t),a=i.get(n);if(a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(s>=0){if(a.count+=1,a.aliasCount===0)a.aliasCount=Or(o,n,i);if(a.count*a.aliasCount>s)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}}return n}toJSON(e,t){if(!t)return{source:this.source};let r=this.resolve(t.doc,t);if(!r){let n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(n)}return t.anchors.get(r).res}toString(e,t,r){let n=`*${this.source}`;if(e){if(ty.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 Error(i)}if(e.implicitKey)return`${n} `}return n}}function Or(e,t,r){if(Qe.isAlias(t)){let n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Qe.isCollection(t)){let n=0;for(let i of t.items){let o=Or(e,i,r);if(o>n)n=o}return n}else if(Qe.isPair(t)){let n=Or(e,t.key,r),i=Or(e,t.value,r);return Math.max(n,i)}return 1}oy.Alias=Mc});var L=y(function(dy){var ay=A(),cy=Dr(),ly=be(),uy=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class Te extends cy.NodeBase{constructor(e){super(ay.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:ly.toJS(this.value,e,t)}toString(){return String(this.value)}}Te.BLOCK_FOLDED="BLOCK_FOLDED";Te.BLOCK_LITERAL="BLOCK_LITERAL";Te.PLAIN="PLAIN";Te.QUOTE_DOUBLE="QUOTE_DOUBLE";Te.QUOTE_SINGLE="QUOTE_SINGLE";dy.Scalar=Te;dy.isScalarValue=uy});var Et=y(function(by){var gy=vt(),Le=A(),_c=L(),my="tag:yaml.org,2002:";function hy(e,t,r){if(t){let n=r.filter((o)=>o.tag===t),i=n.find((o)=>!o.format)??n[0];if(!i)throw Error(`Tag ${t} not found`);return i}return r.find((n)=>n.identify?.(e)&&!n.format)}function yy(e,t,r){if(Le.isDocument(e))e=e.contents;if(Le.isNode(e))return e;if(Le.isPair(e)){let p=r.schema[Le.MAP].createNode?.(r.schema,null,r);return p.items.push(e),p}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c=void 0;if(n&&e&&typeof e==="object")if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new gy.Alias(c.anchor);else c={anchor:null,node:null},a.set(e,c);if(t?.startsWith("!!"))t=my+t.slice(2);let l=hy(e,t,s.tags);if(!l){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let p=new _c.Scalar(e);if(c)c.node=p;return p}l=e instanceof Map?s[Le.MAP]:(Symbol.iterator in Object(e))?s[Le.SEQ]:s[Le.MAP]}if(o)o(l),delete r.onTagObj;let d=l?.createNode?l.createNode(r.schema,e,r):typeof l?.nodeClass?.from==="function"?l.nodeClass.from(r.schema,e,r):new _c.Scalar(e);if(t)d.tag=t;else if(!l.default)d.tag=l.tag;if(c)c.node=d;return d}by.createNode=yy});var Tr=y(function(ky){var Ry=Et(),se=A(),Cy=Dr();function Si(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){let o=t[i];if(typeof o==="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Ry.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Fc=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class jc extends Cy.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;if(t.items=t.items.map((r)=>se.isNode(r)||se.isPair(r)?r.clone(e):r),this.range)t.range=this.range.slice();return t}addIn(e,t){if(Fc(e))this.add(t);else{let[r,...n]=e,i=this.get(r,!0);if(se.isCollection(i))i.addIn(n,t);else if(i===void 0&&this.schema)this.set(r,Si(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let n=this.get(t,!0);if(se.isCollection(n))return n.deleteIn(r);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,i=this.get(r,!0);if(n.length===0)return!t&&se.isScalar(i)?i.value:i;else return se.isCollection(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!se.isPair(t))return!1;let r=t.value;return r==null||e&&se.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let n=this.get(t,!0);return se.isCollection(n)?n.hasIn(r):!1}setIn(e,t){let[r,...n]=e;if(n.length===0)this.set(r,t);else{let i=this.get(r,!0);if(se.isCollection(i))i.setIn(n,t);else if(i===void 0&&this.schema)this.set(r,Si(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}ky.Collection=jc;ky.collectionFromPath=Si;ky.isEmptyPath=Fc});var It=y(function(Py){var Ey=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ri(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var Iy=(e,t,r)=>e.endsWith(`
|
|
5
|
+
`)?Ri(r,t):r.includes(`
|
|
6
6
|
`)?`
|
|
7
|
-
`+
|
|
8
|
-
`){if(r==="block")g=
|
|
9
|
-
`&&u!=="\t"){let
|
|
10
|
-
`&&
|
|
11
|
-
${t}${e.slice(0,
|
|
12
|
-
${t}${e.slice(
|
|
13
|
-
`);n=t,i=t+1,o=e[i]}return n}
|
|
14
|
-
`){if(o-s>n)return!0;if(s=o+1,i-s<=n)return!1}return!0}function
|
|
7
|
+
`+Ri(r,t):(e.endsWith(" ")?"":" ")+r;Py.indentComment=Ri;Py.lineComment=Iy;Py.stringifyComment=Ey});var Bc=y(function(Ly){function Ty(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return e;if(i<o)o=0;let c=Math.max(1+o,1+i-t.length);if(e.length<=c)return e;let l=[],d={},p=i-t.length;if(typeof n==="number")if(n>i-Math.max(2,o))l.push(0);else p=i-n;let f=void 0,u=void 0,m=!1,g=-1,h=-1,b=-1;if(r==="block"){if(g=qc(e,g,t.length),g!==-1)p=g+c}for(let k;k=e[g+=1];){if(r==="quoted"&&k==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if(k===`
|
|
8
|
+
`){if(r==="block")g=qc(e,g,t.length);p=g+t.length+c,f=void 0}else{if(k===" "&&u&&u!==" "&&u!==`
|
|
9
|
+
`&&u!=="\t"){let v=e[g+1];if(v&&v!==" "&&v!==`
|
|
10
|
+
`&&v!=="\t")f=g}if(g>=p)if(f)l.push(f),p=f+c,f=void 0;else if(r==="quoted"){while(u===" "||u==="\t")u=k,k=e[g+=1],m=!0;let v=g>b+1?g-2:h-1;if(d[v])return e;l.push(v),d[v]=!0,p=v+c,f=void 0}else m=!0}u=k}if(m&&a)a();if(l.length===0)return e;if(s)s();let S=e.slice(0,l[0]);for(let k=0;k<l.length;++k){let v=l[k],E=l[k+1]||e.length;if(v===0)S=`
|
|
11
|
+
${t}${e.slice(0,E)}`;else{if(r==="quoted"&&d[v])S+=`${e[v]}\\`;S+=`
|
|
12
|
+
${t}${e.slice(v+1,E)}`}}return S}function qc(e,t,r){let n=t,i=t+1,o=e[i];while(o===" "||o==="\t")if(t<i+r)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
13
|
+
`);n=t,i=t+1,o=e[i]}return n}Ly.FOLD_BLOCK="block";Ly.FOLD_FLOW="flow";Ly.FOLD_QUOTED="quoted";Ly.foldFlowLines=Ty});var At=y(function(By){var re=L(),Se=Bc(),Nr=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$r=(e)=>/^(%|---|\.\.\.)/m.test(e);function Fy(e,t,r){if(!t||t<0)return!1;let n=t-r,i=e.length;if(i<=n)return!1;for(let o=0,s=0;o<i;++o)if(e[o]===`
|
|
14
|
+
`){if(o-s>n)return!0;if(s=o+1,i-s<=n)return!1}return!0}function Pt(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||($r(e)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c]){if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n")s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\";if(l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let d=r.substr(c+2,4);switch(d){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:if(d.substr(0,2)==="00")s+="\\x"+d.substr(2);else s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{s+=r.slice(a,c)+`
|
|
15
15
|
|
|
16
16
|
`;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')s+=`
|
|
17
|
-
`,c+=2;if(s+=o,r[c+2]===" ")s+="\\";c+=1,a=c+1}break;default:c+=1}}return s=a?s+r.slice(a):r,n?s:
|
|
18
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return
|
|
19
|
-
${r}`)+"'";return t.implicitKey?n:
|
|
17
|
+
`,c+=2;if(s+=o,r[c+2]===" ")s+="\\";c+=1,a=c+1}break;default:c+=1}}return s=a?s+r.slice(a):r,n?s:Se.foldFlowLines(s,o,Se.FOLD_QUOTED,Nr(t,!1))}function Ci(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Pt(e,t);let r=t.indent||($r(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${r}`)+"'";return t.implicitKey?n:Se.foldFlowLines(n,r,Se.FOLD_FLOW,Nr(t,!1))}function Xe(e,t){let{singleQuote:r}=t.options,n;if(r===!1)n=Pt;else{let i=e.includes('"'),o=e.includes("'");if(i&&!o)n=Ci;else if(o&&!i)n=Pt;else n=r?Ci:Pt}return n(e,t)}var ki;try{ki=new RegExp(`(^|(?<!
|
|
20
20
|
))
|
|
21
21
|
+(?!
|
|
22
|
-
|$)`,"g")}catch{
|
|
22
|
+
|$)`,"g")}catch{ki=/\n+(?!\n|$)/g}function Lr({comment:e,type:t,value:r},n,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=n.options;if(!s||/\n[\t ]+$/.test(r))return Xe(r,n);let l=n.indent||(n.forceBlockIndent||$r(r)?" ":""),d=s==="literal"?!0:s==="folded"||t===re.Scalar.BLOCK_FOLDED?!1:t===re.Scalar.BLOCK_LITERAL?!0:!Fy(r,c,l.length);if(!r)return d?`|
|
|
23
23
|
`:`>
|
|
24
|
-
`;let
|
|
25
|
-
`&&
|
|
26
|
-
`);if(m===-1)
|
|
27
|
-
`)u=u.slice(0,-1);u=u.replace(
|
|
28
|
-
`)b=h;else break}let
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),
|
|
30
|
-
${l}${
|
|
31
|
-
${l}${
|
|
32
|
-
`)||
|
|
33
|
-
`)?
|
|
34
|
-
`))return
|
|
35
|
-
${c}`);if(s){let f=(g)=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(
|
|
36
|
-
${t.indent}${a}`}
|
|
37
|
-
${a}:`}else if(h=`${h}:`,f)h+=
|
|
38
|
-
`:"",
|
|
39
|
-
${
|
|
40
|
-
`&&x
|
|
41
|
-
|
|
42
|
-
`}else
|
|
43
|
-
${r.indent}`}else if(!u&&fe.isCollection(t)){let O=
|
|
44
|
-
`),N=
|
|
45
|
-
${r.indent}`}}else if(
|
|
46
|
-
`)
|
|
24
|
+
`;let p,f;for(f=r.length;f>0;--f){let E=r[f-1];if(E!==`
|
|
25
|
+
`&&E!=="\t"&&E!==" ")break}let u=r.substring(f),m=u.indexOf(`
|
|
26
|
+
`);if(m===-1)p="-";else if(r===u||m!==u.length-1){if(p="+",o)o()}else p="";if(u){if(r=r.slice(0,-u.length),u[u.length-1]===`
|
|
27
|
+
`)u=u.slice(0,-1);u=u.replace(ki,`$&${l}`)}let g=!1,h,b=-1;for(h=0;h<r.length;++h){let E=r[h];if(E===" ")g=!0;else if(E===`
|
|
28
|
+
`)b=h;else break}let S=r.substring(0,b<h?b+1:h);if(S)r=r.substring(S.length),S=S.replace(/\n+/g,`$&${l}`);let v=(g?l?"2":"1":"")+p;if(e){if(v+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!d){let E=r.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),x=!1,O=Nr(n,!0);if(s!=="folded"&&t!==re.Scalar.BLOCK_FOLDED)O.onOverflow=()=>{x=!0};let w=Se.foldFlowLines(`${S}${E}${u}`,l,Se.FOLD_BLOCK,O);if(!x)return`>${v}
|
|
30
|
+
${l}${w}`}return r=r.replace(/\n+/g,`$&${l}`),`|${v}
|
|
31
|
+
${l}${S}${r}${u}`}function jy(e,t,r,n){let{type:i,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:d}=t;if(a&&o.includes(`
|
|
32
|
+
`)||d&&/[[\]{},]/.test(o))return Xe(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||d||!o.includes(`
|
|
33
|
+
`)?Xe(o,t):Lr(e,t,r,n);if(!a&&!d&&i!==re.Scalar.PLAIN&&o.includes(`
|
|
34
|
+
`))return Lr(e,t,r,n);if($r(o)){if(c==="")return t.forceBlockIndent=!0,Lr(e,t,r,n);else if(a&&c===l)return Xe(o,t)}let p=o.replace(/\n+/g,`$&
|
|
35
|
+
${c}`);if(s){let f=(g)=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(p),{compat:u,tags:m}=t.doc.schema;if(m.some(f)||u?.some(f))return Xe(o,t)}return a?p:Se.foldFlowLines(p,c,Se.FOLD_FLOW,Nr(t,!1))}function qy(e,t,r,n){let{implicitKey:i,inFlow:o}=t,s=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==re.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value))a=re.Scalar.QUOTE_DOUBLE}let c=(d)=>{switch(d){case re.Scalar.BLOCK_FOLDED:case re.Scalar.BLOCK_LITERAL:return i||o?Xe(s.value,t):Lr(s,t,r,n);case re.Scalar.QUOTE_DOUBLE:return Pt(s.value,t);case re.Scalar.QUOTE_SINGLE:return Ci(s.value,t);case re.Scalar.PLAIN:return jy(s,t,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:d,defaultStringType:p}=t.options,f=i&&d||p;if(l=c(f),l===null)throw Error(`Unsupported default string type ${f}`)}return l}By.stringifyString=qy});var Dt=y(function(Jy){var Vy=Ar(),Re=A(),Ky=It(),Hy=At();function zy(e,t){let r=Object.assign({blockQuote:!0,commentString:Ky.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent==="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Yy(e,t){if(t.tag){let i=e.filter((o)=>o.tag===t.tag);if(i.length>0)return i.find((o)=>o.format===t.format)??i[0]}let r=void 0,n;if(Re.isScalar(t)){n=t.value;let i=e.filter((o)=>o.identify?.(n));if(i.length>1){let o=i.filter((s)=>s.test);if(o.length>0)i=o}r=i.find((o)=>o.format===t.format)??i.find((o)=>!o.format)}else n=t,r=e.find((i)=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw Error(`Tag not resolved for ${i} value`)}return r}function Gy(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Re.isScalar(e)||Re.isCollection(e))&&e.anchor;if(o&&Vy.anchorIsValid(o))r.add(o),i.push(`&${o}`);let s=e.tag??(t.default?null:t.tag);if(s)i.push(n.directives.tagString(s));return i.join(" ")}function Wy(e,t,r,n){if(Re.isPair(e))return e.toString(t,r,n);if(Re.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let i=void 0,o=Re.isNode(e)?e:t.doc.createNode(e,{onTagObj:(c)=>i=c});i??(i=Yy(t.doc.schema.tags,o));let s=Gy(o,i,t);if(s.length>0)t.indentAtStart=(t.indentAtStart??0)+s.length+1;let a=typeof i.stringify==="function"?i.stringify(o,t,r,n):Re.isScalar(o)?Hy.stringifyString(o,t,r,n):o.toString(t,r,n);if(!s)return a;return Re.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
36
|
+
${t.indent}${a}`}Jy.createStringifyContext=zy;Jy.stringify=Wy});var Kc=y(function(eb){var fe=A(),Uc=L(),Vc=Dt(),Ot=It();function Zy({key:e,value:t},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:p}}=r,f=fe.isNode(e)&&e.comment||null;if(p){if(f)throw Error("With simple keys, key nodes cannot have comments");if(fe.isCollection(e)||!fe.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let u=!p&&(!e||f&&t==null&&!r.inFlow||fe.isCollection(e)||(fe.isScalar(e)?e.type===Uc.Scalar.BLOCK_FOLDED||e.type===Uc.Scalar.BLOCK_LITERAL:typeof e==="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!u&&(p||!o),indent:a+c});let m=!1,g=!1,h=Vc.stringify(e,r,()=>m=!0,()=>g=!0);if(!u&&!r.inFlow&&h.length>1024){if(p)throw Error("With simple keys, single line scalar must not span more than 1024 characters");u=!0}if(r.inFlow){if(o||t==null){if(m&&n)n();return h===""?"?":u?`? ${h}`:h}}else if(o&&!p||t==null&&u){if(h=`? ${h}`,f&&!m)h+=Ot.lineComment(h,r.indent,l(f));else if(g&&i)i();return h}if(m)f=null;if(u){if(f)h+=Ot.lineComment(h,r.indent,l(f));h=`? ${h}
|
|
37
|
+
${a}:`}else if(h=`${h}:`,f)h+=Ot.lineComment(h,r.indent,l(f));let b,S,k;if(fe.isNode(t))b=!!t.spaceBefore,S=t.commentBefore,k=t.comment;else if(b=!1,S=null,k=null,t&&typeof t==="object")t=s.createNode(t);if(r.implicitKey=!1,!u&&!f&&fe.isScalar(t))r.indentAtStart=h.length+1;if(g=!1,!d&&c.length>=2&&!r.inFlow&&!u&&fe.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)r.indent=r.indent.substring(2);let v=!1,E=Vc.stringify(t,r,()=>v=!0,()=>g=!0),x=" ";if(f||b||S){if(x=b?`
|
|
38
|
+
`:"",S){let O=l(S);x+=`
|
|
39
|
+
${Ot.indentComment(O,r.indent)}`}if(E===""&&!r.inFlow){if(x===`
|
|
40
|
+
`&&k)x=`
|
|
41
|
+
|
|
42
|
+
`}else x+=`
|
|
43
|
+
${r.indent}`}else if(!u&&fe.isCollection(t)){let O=E[0],w=E.indexOf(`
|
|
44
|
+
`),N=w!==-1,me=r.inFlow??t.flow??t.items.length===0;if(N||!me){let Ue=!1;if(N&&(O==="&"||O==="!")){let M=E.indexOf(" ");if(O==="&"&&M!==-1&&M<w&&E[M+1]==="!")M=E.indexOf(" ",M+1);if(M===-1||w<M)Ue=!0}if(!Ue)x=`
|
|
45
|
+
${r.indent}`}}else if(E===""||E[0]===`
|
|
46
|
+
`)x="";if(h+=x+E,r.inFlow){if(v&&n)n()}else if(k&&!v)h+=Ot.lineComment(h,r.indent,l(k));else if(g&&i)i();return h}eb.stringifyPair=Zy});var wi=y(function(ib){var Hc=er("process");function rb(e,...t){if(e==="debug")console.log(...t)}function nb(e,t){if(e==="debug"||e==="warn")if(typeof Hc.emitWarning==="function")Hc.emitWarning(t);else console.warn(t)}ib.debug=rb;ib.warn=nb});var jr=y(function(cb){var Fr=A(),zc=L(),Mr="<<",_r={identify:(e)=>e===Mr||typeof e==="symbol"&&e.description===Mr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new zc.Scalar(Symbol(Mr)),{addToJSMap:Yc}),stringify:()=>Mr},ab=(e,t)=>(_r.identify(t)||Fr.isScalar(t)&&(!t.type||t.type===zc.Scalar.PLAIN)&&_r.identify(t.value))&&e?.doc.schema.tags.some((r)=>r.tag===_r.tag&&r.default);function Yc(e,t,r){let n=Gc(e,r);if(Fr.isSeq(n))for(let i of n.items)xi(e,t,i);else if(Array.isArray(n))for(let i of n)xi(e,t,i);else xi(e,t,n)}function xi(e,t,r){let n=Gc(e,r);if(!Fr.isMap(n))throw Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,e,Map);for(let[o,s]of i)if(t instanceof Map){if(!t.has(o))t.set(o,s)}else if(t instanceof Set)t.add(o);else if(!Object.prototype.hasOwnProperty.call(t,o))Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function Gc(e,t){return e&&Fr.isAlias(t)?t.resolve(e.doc,e):t}cb.addMergeToJSMap=Yc;cb.isMergeKey=ab;cb.merge=_r});var Ei=y(function(hb){var pb=wi(),Wc=jr(),fb=Dt(),Jc=A(),vi=be();function gb(e,t,{key:r,value:n}){if(Jc.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(Wc.isMergeKey(e,r))Wc.addMergeToJSMap(e,t,n);else{let i=vi.toJS(r,"",e);if(t instanceof Map)t.set(i,vi.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let o=mb(r,i,e),s=vi.toJS(n,o,e);if(o in t)Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});else t[o]=s}}return t}function mb(e,t,r){if(t===null)return"";if(typeof t!=="object")return String(t);if(Jc.isNode(e)&&r?.doc){let n=fb.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);if(o.length>40)o=o.substring(0,36)+'..."';pb.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(t)}hb.addPairToJSMap=gb});var Ce=y(function(Cb){var Qc=Et(),bb=Kc(),Sb=Ei(),qr=A();function Rb(e,t,r){let n=Qc.createNode(e,void 0,r),i=Qc.createNode(t,void 0,r);return new Br(n,i)}class Br{constructor(e,t=null){Object.defineProperty(this,qr.NODE_TYPE,{value:qr.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;if(qr.isNode(t))t=t.clone(e);if(qr.isNode(r))r=r.clone(e);return new Br(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return Sb.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?bb.stringifyPair(this,e,t,r):JSON.stringify(this)}}Cb.Pair=Br;Cb.createPair=Rb});var Ii=y(function(Ib){var Ne=A(),Xc=Dt(),Ur=It();function xb(e,t,r){return(t.inFlow??e.flow?Eb:vb)(e,t,r)}function vb({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,d=Object.assign({},r,{indent:o,type:null}),p=!1,f=[];for(let m=0;m<t.length;++m){let g=t[m],h=null;if(Ne.isNode(g)){if(!p&&g.spaceBefore)f.push("");if(Vr(r,f,g.commentBefore,p),g.comment)h=g.comment}else if(Ne.isPair(g)){let S=Ne.isNode(g.key)?g.key:null;if(S){if(!p&&S.spaceBefore)f.push("");Vr(r,f,S.commentBefore,p)}}p=!1;let b=Xc.stringify(g,d,()=>h=null,()=>p=!0);if(h)b+=Ur.lineComment(b,o,l(h));if(p&&h)p=!1;f.push(n+b)}let u;if(f.length===0)u=i.start+i.end;else{u=f[0];for(let m=1;m<f.length;++m){let g=f[m];u+=g?`
|
|
47
47
|
${c}${g}`:`
|
|
48
48
|
`}}if(e){if(u+=`
|
|
49
|
-
|
|
50
|
-
`)),m<e.length-1)b+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)l||(l=
|
|
49
|
+
`+Ur.indentComment(l(e),c),a)a()}else if(p&&s)s();return u}function Eb({items:e},t,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;n+=o;let c=Object.assign({},t,{indent:n,inFlow:!0,type:null}),l=!1,d=0,p=[];for(let m=0;m<e.length;++m){let g=e[m],h=null;if(Ne.isNode(g)){if(g.spaceBefore)p.push("");if(Vr(t,p,g.commentBefore,!1),g.comment)h=g.comment}else if(Ne.isPair(g)){let S=Ne.isNode(g.key)?g.key:null;if(S){if(S.spaceBefore)p.push("");if(Vr(t,p,S.commentBefore,!1),S.comment)l=!0}let k=Ne.isNode(g.value)?g.value:null;if(k){if(k.comment)h=k.comment;if(k.commentBefore)l=!0}else if(g.value==null&&S?.comment)h=S.comment}if(h)l=!0;let b=Xc.stringify(g,c,()=>h=null);if(l||(l=p.length>d||b.includes(`
|
|
50
|
+
`)),m<e.length-1)b+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)l||(l=p.reduce((S,k)=>S+k.length+2,2)+(b.length+2)>t.options.lineWidth);if(l)b+=","}if(h)b+=Ur.lineComment(b,n,a(h));p.push(b),d=p.length}let{start:f,end:u}=r;if(p.length===0)return f+u;else{if(!l){let m=p.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=f;for(let g of p)m+=g?`
|
|
51
51
|
${o}${i}${g}`:`
|
|
52
52
|
`;return`${m}
|
|
53
|
-
${i}${u}`}else return`${f}${s}${
|
|
54
|
-
`:" ")}return
|
|
53
|
+
${i}${u}`}else return`${f}${s}${p.join(" ")}${s}${u}`}}function Vr({indent:e,options:{commentString:t}},r,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let o=Ur.indentComment(t(n),e);r.push(o.trimStart())}}Ib.stringifyCollection=xb});var we=y(function(Lb){var Ab=Ii(),Db=Ei(),Ob=Tr(),ke=A(),Kr=Ce(),Tb=L();function Tt(e,t){let r=ke.isScalar(t)?t.value:t;for(let n of e)if(ke.isPair(n)){if(n.key===t||n.key===r)return n;if(ke.isScalar(n.key)&&n.key.value===r)return n}return}class Zc extends Ob.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ke.MAP,e);this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:i}=r,o=new this(e),s=(a,c)=>{if(typeof i==="function")c=i.call(t,a,c);else if(Array.isArray(i)&&!i.includes(a))return;if(c!==void 0||n)o.items.push(Kr.createPair(a,c,r))};if(t instanceof Map)for(let[a,c]of t)s(a,c);else if(t&&typeof t==="object")for(let a of Object.keys(t))s(a,t[a]);if(typeof e.sortMapEntries==="function")o.items.sort(e.sortMapEntries);return o}add(e,t){let r;if(ke.isPair(e))r=e;else if(!e||typeof e!=="object"||!("key"in e))r=new Kr.Pair(e,e?.value);else r=new Kr.Pair(e.key,e.value);let n=Tt(this.items,r.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);if(ke.isScalar(n.value)&&Tb.isScalarValue(r.value))n.value.value=r.value;else n.value=r.value}else if(i){let o=this.items.findIndex((s)=>i(r,s)<0);if(o===-1)this.items.push(r);else this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let t=Tt(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=Tt(this.items,e)?.value;return(!t&&ke.isScalar(n)?n.value:n)??void 0}has(e){return!!Tt(this.items,e)}set(e,t){this.add(new Kr.Pair(e,t),!0)}toJSON(e,t,r){let n=r?new r:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(n);for(let i of this.items)Db.addPairToJSMap(t,n,i);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!ke.isPair(n))throw Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return Ab.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}Lb.YAMLMap=Zc;Lb.findPair=Tt});var Ze=y(function(Fb){var Mb=A(),el=we(),_b={collection:"map",default:!0,nodeClass:el.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!Mb.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,r)=>el.YAMLMap.from(e,t,r)};Fb.map=_b});var xe=y(function(Hb){var qb=Et(),Bb=Ii(),Ub=Tr(),zr=A(),Vb=L(),Kb=be();class tl extends Ub.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(zr.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=Hr(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let r=Hr(e);if(typeof r!=="number")return;let n=this.items[r];return!t&&zr.isScalar(n)?n.value:n}has(e){let t=Hr(e);return typeof t==="number"&&t<this.items.length}set(e,t){let r=Hr(e);if(typeof r!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];if(zr.isScalar(n)&&Vb.isScalarValue(t))n.value=t;else this.items[r]=t}toJSON(e,t){let r=[];if(t?.onCreate)t.onCreate(r);let n=0;for(let i of this.items)r.push(Kb.toJS(i,String(n++),t));return r}toString(e,t,r){if(!e)return JSON.stringify(this);return Bb.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t})}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let s of t){if(typeof n==="function"){let a=t instanceof Set?s:String(o++);s=n.call(t,a,s)}i.items.push(qb.createNode(s,void 0,r))}}return i}}function Hr(e){let t=zr.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}Hb.YAMLSeq=tl});var et=y(function(Wb){var Yb=A(),rl=xe(),Gb={collection:"seq",default:!0,nodeClass:rl.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!Yb.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,r)=>rl.YAMLSeq.from(e,t,r)};Wb.seq=Gb});var Lt=y(function(Zb){var Qb=At(),Xb={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,r,n){return t=Object.assign({actualString:!0},t),Qb.stringifyString(e,t,r,n)}};Zb.string=Xb});var Yr=y(function(tS){var nl=L(),il={identify:(e)=>e==null,createNode:()=>new nl.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new nl.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&il.test.test(e)?e:t.options.nullStr};tS.nullTag=il});var Pi=y(function(iS){var nS=L(),ol={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new nS.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},r){if(e&&ol.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};iS.boolTag=ol});var tt=y(function(aS){function sS({format:e,minFractionDigits:t,tag:r,value:n}){if(typeof n==="bigint")return String(n);let i=typeof n==="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");if(s<0)s=o.length,o+=".";let a=t-(o.length-s-1);while(a-- >0)o+="0"}return o}aS.stringifyNumber=sS});var Di=y(function(fS){var lS=L(),Ai=tt(),uS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ai.stringifyNumber},dS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ai.stringifyNumber(e)}},pS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new lS.Scalar(parseFloat(e)),r=e.indexOf(".");if(r!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-r-1;return t},stringify:Ai.stringifyNumber};fS.float=pS;fS.floatExp=dS;fS.floatNaN=uS});var Ti=y(function(RS){var sl=tt(),Gr=(e)=>typeof e==="bigint"||Number.isInteger(e),Oi=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function al(e,t,r){let{value:n}=e;if(Gr(n)&&n>=0)return r+n.toString(t);return sl.stringifyNumber(e)}var yS={identify:(e)=>Gr(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>Oi(e,2,8,r),stringify:(e)=>al(e,8,"0o")},bS={identify:Gr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>Oi(e,0,10,r),stringify:sl.stringifyNumber},SS={identify:(e)=>Gr(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>Oi(e,2,16,r),stringify:(e)=>al(e,16,"0x")};RS.int=bS;RS.intHex=SS;RS.intOct=yS});var cl=y(function(DS){var xS=Ze(),vS=Yr(),ES=et(),IS=Lt(),PS=Pi(),Li=Di(),Ni=Ti(),AS=[xS.map,ES.seq,IS.string,vS.nullTag,PS.boolTag,Ni.intOct,Ni.int,Ni.intHex,Li.floatNaN,Li.floatExp,Li.float];DS.schema=AS});var ul=y(function(FS){var TS=L(),LS=Ze(),NS=et();function ll(e){return typeof e==="bigint"||Number.isInteger(e)}var Wr=({value:e})=>JSON.stringify(e),$S=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:Wr},{identify:(e)=>e==null,createNode:()=>new TS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Wr},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:Wr},{identify:ll,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>ll(e)?e.toString():JSON.stringify(e)},{identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(e)=>parseFloat(e),stringify:Wr}],MS={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},_S=[LS.map,NS.seq].concat($S,MS);FS.schema=_S});var Mi=y(function(US){var Nt=er("buffer"),$i=L(),qS=At(),BS={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Nt.Buffer==="function")return Nt.Buffer.from(e,"base64");else if(typeof atob==="function"){let r=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},n,i,o){if(!r)return"";let s=r,a;if(typeof Nt.Buffer==="function")a=s instanceof Nt.Buffer?s.toString("base64"):Nt.Buffer.from(s.buffer).toString("base64");else if(typeof btoa==="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[l]);a=btoa(c)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=$i.Scalar.BLOCK_LITERAL),t!==$i.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),d=Array(l);for(let p=0,f=0;p<l;++p,f+=c)d[p]=a.substr(f,c);a=d.join(t===$i.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return qS.stringifyString({comment:e,type:t,value:a},n,i,o)}};US.binary=BS});var Qr=y(function(YS){var Jr=A(),_i=Ce(),KS=L(),HS=xe();function dl(e,t){if(Jr.isSeq(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(Jr.isPair(n))continue;else if(Jr.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let i=n.items[0]||new _i.Pair(new KS.Scalar(null));if(n.commentBefore)i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
55
55
|
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment}
|
|
56
|
-
${o.comment}`:n.comment}n=i}e.items[r]=Vr.isPair(n)?n:new Di.Pair(n)}else t("Expected a sequence for this tag");return e}function sl(e,t,r){let{replacer:n}=r,i=new NS.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof n==="function")s=n.call(t,String(o++),s);let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Di.createPair(a,c,r))}return i}var $S={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ol,createNode:sl};MS.createPairs=sl;MS.pairs=$S;MS.resolvePairs=ol});var Ti=y(function(US){var al=A(),Oi=he(),Lt=Re(),qS=ke(),cl=Kr();class Le extends qS.YAMLSeq{constructor(){super();this.add=Lt.YAMLMap.prototype.add.bind(this),this.delete=Lt.YAMLMap.prototype.delete.bind(this),this.get=Lt.YAMLMap.prototype.get.bind(this),this.has=Lt.YAMLMap.prototype.has.bind(this),this.set=Lt.YAMLMap.prototype.set.bind(this),this.tag=Le.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let n of this.items){let i,o;if(al.isPair(n))i=Oi.toJS(n.key,"",t),o=Oi.toJS(n.value,i,t);else i=Oi.toJS(n,"",t);if(r.has(i))throw Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let n=cl.createPairs(e,t,r),i=new this;return i.items=n.items,i}}Le.tag="tag:yaml.org,2002:omap";var BS={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:Le,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=cl.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(al.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new Le,r)},createNode:(e,t,r)=>Le.from(e,t,r)};US.YAMLOMap=Le;US.omap=BS});var fl=y(function(HS){var ll=L();function ul({value:e,source:t},r){if(t&&(e?dl:pl).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var dl={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ll.Scalar(!0),stringify:ul},pl={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ll.Scalar(!1),stringify:ul};HS.falseTag=pl;HS.trueTag=dl});var gl=y(function(XS){var zS=L(),Li=Ze(),WS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Li.stringifyNumber},JS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Li.stringifyNumber(e)}},QS={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new zS.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let n=e.substring(r+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:Li.stringifyNumber};XS.float=QS;XS.floatExp=JS;XS.floatNaN=WS});var hl=y(function(sC){var ml=Ze(),Nt=(e)=>typeof e==="bigint"||Number.isInteger(e);function Hr(e,t,r,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return i==="-"?BigInt(-1)*s:s}let o=parseInt(e,r);return i==="-"?-1*o:o}function Ni(e,t,r){let{value:n}=e;if(Nt(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return ml.stringifyNumber(e)}var rC={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Hr(e,2,2,r),stringify:(e)=>Ni(e,2,"0b")},nC={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Hr(e,1,8,r),stringify:(e)=>Ni(e,8,"0")},iC={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Hr(e,0,10,r),stringify:ml.stringifyNumber},oC={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Hr(e,2,16,r),stringify:(e)=>Ni(e,16,"0x")};sC.int=iC;sC.intBin=rC;sC.intHex=oC;sC.intOct=nC});var $i=y(function(pC){var zr=A(),Gr=Se(),Yr=Re();class Ne extends Yr.YAMLMap{constructor(e){super(e);this.tag=Ne.tag}add(e){let t;if(zr.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new Gr.Pair(e.key,null);else t=new Gr.Pair(e,null);if(!Yr.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=Yr.findPair(this.items,e);return!t&&zr.isPair(r)?zr.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Yr.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new Gr.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,o,o);i.items.push(Gr.createPair(o,null,r))}return i}}Ne.tag="tag:yaml.org,2002:set";var dC={collection:"map",identify:(e)=>e instanceof Set,nodeClass:Ne,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>Ne.from(e,t,r),resolve(e,t){if(zr.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new Ne,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};pC.YAMLSet=Ne;pC.set=dC});var _i=y(function(bC){var mC=Ze();function Mi(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=(s)=>t?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function yl(e){let{value:t}=e,r=(s)=>s;if(typeof t==="bigint")r=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return mC.stringifyNumber(e);let n="";if(t<0)n="-",t*=r(-1);let i=r(60),o=[t%i];if(t<60)o.unshift(0);else if(t=(t-o[0])/i,o.unshift(t%i),t>=60)t=(t-o[0])/i,o.unshift(t);return n+o.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var hC={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>Mi(e,r),stringify:yl},yC={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>Mi(e,!1),stringify:yl},bl={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(bl.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),p=t[8];if(p&&p!=="Z"){let d=Mi(p,!1);if(Math.abs(d)<30)d*=60;l-=60000*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};bC.floatTime=yC;bC.intTime=hC;bC.timestamp=bl});var Cl=y(function(TC){var kC=Qe(),xC=qr(),wC=Xe(),vC=Ot(),EC=Ai(),Sl=fl(),Fi=gl(),Wr=hl(),IC=Tr(),PC=Ti(),AC=Kr(),DC=$i(),ji=_i(),OC=[kC.map,wC.seq,vC.string,xC.nullTag,Sl.trueTag,Sl.falseTag,Wr.intBin,Wr.intOct,Wr.int,Wr.intHex,Fi.floatNaN,Fi.floatExp,Fi.float,EC.binary,IC.merge,PC.omap,AC.pairs,DC.set,ji.intTime,ji.floatTime,ji.timestamp];TC.schema=OC});var Dl=y(function(BC){var wl=Qe(),NC=qr(),vl=Xe(),$C=Ot(),MC=Ri(),qi=xi(),Bi=vi(),_C=rl(),FC=il(),El=Ai(),$t=Tr(),Il=Ti(),Pl=Kr(),Rl=Cl(),Al=$i(),Jr=_i(),kl=new Map([["core",_C.schema],["failsafe",[wl.map,vl.seq,$C.string]],["json",FC.schema],["yaml11",Rl.schema],["yaml-1.1",Rl.schema]]),xl={binary:El.binary,bool:MC.boolTag,float:qi.float,floatExp:qi.floatExp,floatNaN:qi.floatNaN,floatTime:Jr.floatTime,int:Bi.int,intHex:Bi.intHex,intOct:Bi.intOct,intTime:Jr.intTime,map:wl.map,merge:$t.merge,null:NC.nullTag,omap:Il.omap,pairs:Pl.pairs,seq:vl.seq,set:Al.set,timestamp:Jr.timestamp},jC={"tag:yaml.org,2002:binary":El.binary,"tag:yaml.org,2002:merge":$t.merge,"tag:yaml.org,2002:omap":Il.omap,"tag:yaml.org,2002:pairs":Pl.pairs,"tag:yaml.org,2002:set":Al.set,"tag:yaml.org,2002:timestamp":Jr.timestamp};function qC(e,t,r){let n=kl.get(t);if(n&&!e)return r&&!n.includes($t.merge)?n.concat($t.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(kl.keys()).filter((s)=>s!=="yaml11").map((s)=>JSON.stringify(s)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)i=i.concat(o);else if(typeof e==="function")i=e(i.slice());if(r)i=i.concat($t.merge);return i.reduce((o,s)=>{let a=typeof s==="string"?xl[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(xl).map((p)=>JSON.stringify(p)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!o.includes(a))o.push(a);return o},[])}BC.coreKnownTags=jC;BC.getTags=qC});var Ki=y(function(zC){var Ui=A(),KC=Qe(),HC=Xe(),GC=Ot(),Qr=Dl(),YC=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Vi{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Qr.getTags(e,"compat"):e?Qr.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?Qr.coreKnownTags:{},this.tags=Qr.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,Ui.MAP,{value:KC.map}),Object.defineProperty(this,Ui.SCALAR,{value:GC.string}),Object.defineProperty(this,Ui.SEQ,{value:HC.seq}),this.sortMapEntries=typeof o==="function"?o:o===!0?YC:null}clone(){let e=Object.create(Vi.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}zC.Schema=Vi});var Ol=y(function(XC){var JC=A(),Hi=Pt(),Mt=vt();function QC(e,t){let r=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);if(c)r.push(c),n=!0;else if(e.directives.docStart)n=!0}if(n)r.push("---");let i=Hi.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=o(e.commentBefore);r.unshift(Mt.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(JC.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let p=o(e.contents.commentBefore);r.push(Mt.indentComment(p,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=Hi.stringify(e.contents,i,()=>a=null,c);if(a)l+=Mt.lineComment(l,"",o(a));if((l[0]==="|"||l[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${l}`;else r.push(l)}else r.push(Hi.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);if(c.includes(`
|
|
57
|
-
`))r.push("..."),r.push(
|
|
56
|
+
${o.comment}`:n.comment}n=i}e.items[r]=Jr.isPair(n)?n:new _i.Pair(n)}else t("Expected a sequence for this tag");return e}function pl(e,t,r){let{replacer:n}=r,i=new HS.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof n==="function")s=n.call(t,String(o++),s);let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(_i.createPair(a,c,r))}return i}var zS={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dl,createNode:pl};YS.createPairs=pl;YS.pairs=zS;YS.resolvePairs=dl});var ji=y(function(ZS){var fl=A(),Fi=be(),$t=we(),QS=xe(),gl=Qr();class $e extends QS.YAMLSeq{constructor(){super();this.add=$t.YAMLMap.prototype.add.bind(this),this.delete=$t.YAMLMap.prototype.delete.bind(this),this.get=$t.YAMLMap.prototype.get.bind(this),this.has=$t.YAMLMap.prototype.has.bind(this),this.set=$t.YAMLMap.prototype.set.bind(this),this.tag=$e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let n of this.items){let i,o;if(fl.isPair(n))i=Fi.toJS(n.key,"",t),o=Fi.toJS(n.value,i,t);else i=Fi.toJS(n,"",t);if(r.has(i))throw Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let n=gl.createPairs(e,t,r),i=new this;return i.items=n.items,i}}$e.tag="tag:yaml.org,2002:omap";var XS={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=gl.resolvePairs(e,t),n=[];for(let{key:i}of r.items)if(fl.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new $e,r)},createNode:(e,t,r)=>$e.from(e,t,r)};ZS.YAMLOMap=$e;ZS.omap=XS});var Sl=y(function(rR){var ml=L();function hl({value:e,source:t},r){if(t&&(e?yl:bl).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var yl={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ml.Scalar(!0),stringify:hl},bl={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ml.Scalar(!1),stringify:hl};rR.falseTag=bl;rR.trueTag=yl});var Rl=y(function(lR){var oR=L(),qi=tt(),sR={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:qi.stringifyNumber},aR={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():qi.stringifyNumber(e)}},cR={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new oR.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let n=e.substring(r+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:qi.stringifyNumber};lR.float=cR;lR.floatExp=aR;lR.floatNaN=sR});var kl=y(function(yR){var Cl=tt(),Mt=(e)=>typeof e==="bigint"||Number.isInteger(e);function Xr(e,t,r,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return i==="-"?BigInt(-1)*s:s}let o=parseInt(e,r);return i==="-"?-1*o:o}function Bi(e,t,r){let{value:n}=e;if(Mt(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return Cl.stringifyNumber(e)}var fR={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Xr(e,2,2,r),stringify:(e)=>Bi(e,2,"0b")},gR={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Xr(e,1,8,r),stringify:(e)=>Bi(e,8,"0")},mR={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Xr(e,0,10,r),stringify:Cl.stringifyNumber},hR={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Xr(e,2,16,r),stringify:(e)=>Bi(e,16,"0x")};yR.int=mR;yR.intBin=fR;yR.intHex=hR;yR.intOct=gR});var Ui=y(function(wR){var tn=A(),Zr=Ce(),en=we();class Me extends en.YAMLMap{constructor(e){super(e);this.tag=Me.tag}add(e){let t;if(tn.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new Zr.Pair(e.key,null);else t=new Zr.Pair(e,null);if(!en.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=en.findPair(this.items,e);return!t&&tn.isPair(r)?tn.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=en.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new Zr.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,o,o);i.items.push(Zr.createPair(o,null,r))}return i}}Me.tag="tag:yaml.org,2002:set";var kR={collection:"map",identify:(e)=>e instanceof Set,nodeClass:Me,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>Me.from(e,t,r),resolve(e,t){if(tn.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new Me,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};wR.YAMLSet=Me;wR.set=kR});var Ki=y(function(AR){var ER=tt();function Vi(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=(s)=>t?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function wl(e){let{value:t}=e,r=(s)=>s;if(typeof t==="bigint")r=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return ER.stringifyNumber(e);let n="";if(t<0)n="-",t*=r(-1);let i=r(60),o=[t%i];if(t<60)o.unshift(0);else if(t=(t-o[0])/i,o.unshift(t%i),t>=60)t=(t-o[0])/i,o.unshift(t);return n+o.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var IR={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>Vi(e,r),stringify:wl},PR={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>Vi(e,!1),stringify:wl},xl={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(xl.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),d=t[8];if(d&&d!=="Z"){let p=Vi(d,!1);if(Math.abs(p)<30)p*=60;l-=60000*p}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};AR.floatTime=PR;AR.intTime=IR;AR.timestamp=xl});var El=y(function(VR){var LR=Ze(),NR=Yr(),$R=et(),MR=Lt(),_R=Mi(),vl=Sl(),Hi=Rl(),rn=kl(),FR=jr(),jR=ji(),qR=Qr(),BR=Ui(),zi=Ki(),UR=[LR.map,$R.seq,MR.string,NR.nullTag,vl.trueTag,vl.falseTag,rn.intBin,rn.intOct,rn.int,rn.intHex,Hi.floatNaN,Hi.floatExp,Hi.float,_R.binary,FR.merge,jR.omap,qR.pairs,BR.set,zi.intTime,zi.floatTime,zi.timestamp];VR.schema=UR});var Ml=y(function(XR){var Dl=Ze(),HR=Yr(),Ol=et(),zR=Lt(),YR=Pi(),Yi=Di(),Gi=Ti(),GR=cl(),WR=ul(),Tl=Mi(),_t=jr(),Ll=ji(),Nl=Qr(),Il=El(),$l=Ui(),nn=Ki(),Pl=new Map([["core",GR.schema],["failsafe",[Dl.map,Ol.seq,zR.string]],["json",WR.schema],["yaml11",Il.schema],["yaml-1.1",Il.schema]]),Al={binary:Tl.binary,bool:YR.boolTag,float:Yi.float,floatExp:Yi.floatExp,floatNaN:Yi.floatNaN,floatTime:nn.floatTime,int:Gi.int,intHex:Gi.intHex,intOct:Gi.intOct,intTime:nn.intTime,map:Dl.map,merge:_t.merge,null:HR.nullTag,omap:Ll.omap,pairs:Nl.pairs,seq:Ol.seq,set:$l.set,timestamp:nn.timestamp},JR={"tag:yaml.org,2002:binary":Tl.binary,"tag:yaml.org,2002:merge":_t.merge,"tag:yaml.org,2002:omap":Ll.omap,"tag:yaml.org,2002:pairs":Nl.pairs,"tag:yaml.org,2002:set":$l.set,"tag:yaml.org,2002:timestamp":nn.timestamp};function QR(e,t,r){let n=Pl.get(t);if(n&&!e)return r&&!n.includes(_t.merge)?n.concat(_t.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(Pl.keys()).filter((s)=>s!=="yaml11").map((s)=>JSON.stringify(s)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)i=i.concat(o);else if(typeof e==="function")i=e(i.slice());if(r)i=i.concat(_t.merge);return i.reduce((o,s)=>{let a=typeof s==="string"?Al[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Al).map((d)=>JSON.stringify(d)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${l}`)}if(!o.includes(a))o.push(a);return o},[])}XR.coreKnownTags=JR;XR.getTags=QR});var Qi=y(function(oC){var Wi=A(),tC=Ze(),rC=et(),nC=Lt(),on=Ml(),iC=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Ji{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?on.getTags(e,"compat"):e?on.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?on.coreKnownTags:{},this.tags=on.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,Wi.MAP,{value:tC.map}),Object.defineProperty(this,Wi.SCALAR,{value:nC.string}),Object.defineProperty(this,Wi.SEQ,{value:rC.seq}),this.sortMapEntries=typeof o==="function"?o:o===!0?iC:null}clone(){let e=Object.create(Ji.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}oC.Schema=Ji});var _l=y(function(lC){var aC=A(),Xi=Dt(),Ft=It();function cC(e,t){let r=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);if(c)r.push(c),n=!0;else if(e.directives.docStart)n=!0}if(n)r.push("---");let i=Xi.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=o(e.commentBefore);r.unshift(Ft.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(aC.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let d=o(e.contents.commentBefore);r.push(Ft.indentComment(d,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=Xi.stringify(e.contents,i,()=>a=null,c);if(a)l+=Ft.lineComment(l,"",o(a));if((l[0]==="|"||l[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${l}`;else r.push(l)}else r.push(Xi.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);if(c.includes(`
|
|
57
|
+
`))r.push("..."),r.push(Ft.indentComment(c,""));else r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;if(c&&s)c=c.replace(/^\n+/,"");if(c){if((!s||a)&&r[r.length-1]!=="")r.push("");r.push(Ft.indentComment(o(c),""))}}return r.join(`
|
|
58
58
|
`)+`
|
|
59
|
-
`}
|
|
59
|
+
`}lC.stringifyDocument=cC});var jt=y(function(bC){var dC=vt(),rt=Tr(),X=A(),pC=Ce(),fC=be(),gC=Qi(),mC=_l(),Zi=Ar(),hC=bi(),yC=Et(),eo=yi();class to{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,X.NODE_TYPE,{value:X.DOC});let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=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"},r);this.options=i;let{version:o}=i;if(r?._directives){if(this.directives=r._directives.atDocument(),this.directives.yaml.explicit)o=this.directives.yaml.version}else this.directives=new eo.Directives({version:o});this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(to.prototype,{[X.NODE_TYPE]:{value:X.DOC}});if(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();if(e.schema=this.schema.clone(),e.contents=X.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(nt(this.contents))this.contents.add(e)}addIn(e,t){if(nt(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=Zi.anchorNames(this);e.anchor=!t||r.has(t)?Zi.findNewAnchor(t||"a",r):t}return new dC.Alias(e.anchor)}createNode(e,t,r){let n=void 0;if(typeof t==="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let g=(b)=>typeof b==="number"||b instanceof String||b instanceof Number,h=t.filter(g).map(String);if(h.length>0)t=t.concat(h);n=t}else if(r===void 0&&t)r=t,t=void 0;let{aliasDuplicateObjects:i,anchorPrefix:o,flow:s,keepUndefined:a,onTagObj:c,tag:l}=r??{},{onAnchor:d,setAnchors:p,sourceObjects:f}=Zi.createNodeAnchors(this,o||"a"),u={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:d,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:f},m=yC.createNode(e,l,u);if(s&&X.isCollection(m))m.flow=!0;return p(),m}createPair(e,t,r={}){let n=this.createNode(e,null,r),i=this.createNode(t,null,r);return new pC.Pair(n,i)}delete(e){return nt(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(rt.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return nt(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return X.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(rt.isEmptyPath(e))return!t&&X.isScalar(this.contents)?this.contents.value:this.contents;return X.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return X.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(rt.isEmptyPath(e))return this.contents!==void 0;return X.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=rt.collectionFromPath(this.schema,[e],t);else if(nt(this.contents))this.contents.set(e,t)}setIn(e,t){if(rt.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=rt.collectionFromPath(this.schema,Array.from(e),t);else if(nt(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let r;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new eo.Directives({version:"1.1"});r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new eo.Directives({version:e});r={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;r=null;break;default:{let n=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new gC.Schema(Object.assign(r,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n==="number"?n:100},a=fC.toJS(this.contents,t??"",s);if(typeof i==="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o==="function"?hC.applyReviver(o,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw 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 Error(`"indent" option must be a positive integer, not ${t}`)}return mC.stringifyDocument(this,e)}}function nt(e){if(X.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}bC.Document=to});var qt=y(function(CC){class sn extends Error{constructor(e,t,r,n){super();this.name=e,this.code=r,this.message=n,this.pos=t}}class Fl extends sn{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class jl extends sn{constructor(e,t,r){super("YAMLWarning",e,t,r)}}var RC=(e,t)=>(r)=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map((a)=>t.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80)s=s.substring(0,79)+"\u2026";if(n>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);if(a.length>80)a=a.substring(0,79)+`\u2026
|
|
60
60
|
`;s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];if(c?.line===n&&c.col>i)a=Math.max(1,Math.min(c.col-i,80-o));let l=" ".repeat(o)+"^".repeat(a);r.message+=`:
|
|
61
61
|
|
|
62
62
|
${s}
|
|
63
63
|
${l}
|
|
64
|
-
`}};
|
|
65
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(
|
|
66
|
-
`+g.comment;else a.comment=g.comment;continue}if(g.newlineAfterProp||
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+O;else
|
|
70
|
-
`+N.comment;else
|
|
71
|
-
`+h.comment;else l.comment=h.comment;l.range=[n.offset,g,h.offset]}else l.range=[n.offset,g,g];return l}
|
|
72
|
-
`.repeat(Math.max(1,s.length-1)):"",h=n+i.length;if(t.source)h+=t.source.length;return{value:g,type:o,comment:i.comment,range:[n,h,h]}}let c=t.indent+i.indent,l=t.offset+i.length,
|
|
73
|
-
`;for(let g=
|
|
64
|
+
`}};CC.YAMLError=sn;CC.YAMLParseError=Fl;CC.YAMLWarning=jl;CC.prettifyError=RC});var Bt=y(function(IC){function EC(e,{flow:t,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,d=a,p="",f="",u=!1,m=!1,g=null,h=null,b=null,S=null,k=null,v=null,E=null;for(let w of e){if(m){if(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma")o(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");m=!1}if(g){if(l&&w.type!=="comment"&&w.type!=="newline")o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation");g=null}switch(w.type){case"space":if(!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&w.source.includes("\t"))g=w;d=!0;break;case"comment":{if(!d)o(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=w.source.substring(1)||" ";if(!p)p=N;else p+=f+N;f="",l=!1;break}case"newline":if(l){if(p)p+=w.source;else if(!v||r!=="seq-item-ind")c=!0}else f+=w.source;if(l=!0,u=!0,h||b)S=w;d=!0;break;case"anchor":if(h)o(w,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(w.source.endsWith(":"))o(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);h=w,E??(E=w.offset),l=!1,d=!1,m=!0;break;case"tag":{if(b)o(w,"MULTIPLE_TAGS","A node can have at most one tag");b=w,E??(E=w.offset),l=!1,d=!1,m=!0;break}case r:if(h||b)o(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`);if(v)o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${t??"collection"}`);v=w,l=r==="seq-item-ind"||r==="explicit-key-ind",d=!1;break;case"comma":if(t){if(k)o(w,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);k=w,l=!1,d=!1;break}default:o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),l=!1,d=!1}}let x=e[e.length-1],O=x?x.offset+x.source.length:i;if(m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!==""))o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(g&&(l&&g.indent<=s||n?.type==="block-map"||n?.type==="block-seq"))o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:k,found:v,spaceBefore:c,comment:p,hasNewline:u,anchor:h,tag:b,newlineAfterProp:S,end:O,start:E??O}}IC.resolveProps=EC});var an=y(function(AC){function ro(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
65
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(ro(t.key)||ro(t.value))return!0}return!1;default:return!0}}AC.containsNewline=ro});var no=y(function(LC){var OC=an();function TC(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&OC.containsNewline(t))r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}LC.flowIndentCheck=TC});var io=y(function(MC){var ql=A();function $C(e,t,r){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n==="function"?n:(o,s)=>o===s||ql.isScalar(o)&&ql.isScalar(s)&&o.value===s.value;return t.some((o)=>i(o.key,r))}MC.mapIncludes=$C});var Hl=y(function(UC){var Bl=Ce(),FC=we(),Ul=Bt(),jC=an(),Vl=no(),qC=io(),Kl="All mapping items must start at the same column";function BC({composeNode:e,composeEmptyNode:t},r,n,i,o){let a=new(o?.nodeClass??FC.YAMLMap)(r.schema);if(r.atRoot)r.atRoot=!1;let c=n.offset,l=null;for(let d of n.items){let{start:p,key:f,sep:u,value:m}=d,g=Ul.resolveProps(p,{indicator:"explicit-key-ind",next:f??u?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),h=!g.found;if(h){if(f){if(f.type==="block-seq")i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==n.indent)i(c,"BAD_INDENT",Kl)}if(!g.anchor&&!g.tag&&!u){if(l=g.end,g.comment)if(a.comment)a.comment+=`
|
|
66
|
+
`+g.comment;else a.comment=g.comment;continue}if(g.newlineAfterProp||jC.containsNewline(f))i(f??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(g.found?.indent!==n.indent)i(c,"BAD_INDENT",Kl);r.atKey=!0;let b=g.end,S=f?e(r,f,g,i):t(r,b,p,null,g,i);if(r.schema.compat)Vl.flowIndentCheck(n.indent,f,i);if(r.atKey=!1,qC.mapIncludes(r,a.items,S))i(b,"DUPLICATE_KEY","Map keys must be unique");let k=Ul.resolveProps(u??[],{indicator:"map-value-ind",next:m,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){if(h){if(m?.type==="block-map"&&!k.hasNewline)i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(r.options.strict&&g.start<k.found.offset-1024)i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let v=m?e(r,m,k,i):t(r,c,u,null,k,i);if(r.schema.compat)Vl.flowIndentCheck(n.indent,m,i);c=v.range[2];let E=new Bl.Pair(S,v);if(r.options.keepSourceTokens)E.srcToken=d;a.items.push(E)}else{if(h)i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(k.comment)if(S.comment)S.comment+=`
|
|
67
|
+
`+k.comment;else S.comment=k.comment;let v=new Bl.Pair(S);if(r.options.keepSourceTokens)v.srcToken=d;a.items.push(v)}}if(l&&l<c)i(l,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,c,l??c],a}UC.resolveBlockMap=BC});var zl=y(function(GC){var KC=xe(),HC=Bt(),zC=no();function YC({composeNode:e,composeEmptyNode:t},r,n,i,o){let a=new(o?.nodeClass??KC.YAMLSeq)(r.schema);if(r.atRoot)r.atRoot=!1;if(r.atKey)r.atKey=!1;let c=n.offset,l=null;for(let{start:d,value:p}of n.items){let f=HC.resolveProps(d,{indicator:"seq-item-ind",next:p,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||p)if(p?.type==="block-seq")i(f.end,"BAD_INDENT","All sequence items must start at the same column");else i(c,"MISSING_CHAR","Sequence item without - indicator");else{if(l=f.end,f.comment)a.comment=f.comment;continue}let u=p?e(r,p,f,i):t(r,f.end,d,null,f,i);if(r.schema.compat)zC.flowIndentCheck(n.indent,p,i);c=u.range[2],a.items.push(u)}return a.range=[n.offset,c,l??c],a}GC.resolveBlockSeq=YC});var it=y(function(QC){function JC(e,t,r,n){let i="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{if(r&&!o)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";if(!i)i=d;else i+=s+d;s="";break}case"newline":if(i)s+=c;o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}QC.resolveEnd=JC});var Wl=y(function(sk){var ZC=A(),ek=Ce(),Yl=we(),tk=xe(),rk=it(),Gl=Bt(),nk=an(),ik=io(),oo="Block collections are not allowed within flow collections",so=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function ok({composeNode:e,composeEmptyNode:t},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",l=new(o?.nodeClass??(s?Yl.YAMLMap:tk.YAMLSeq))(r.schema);l.flow=!0;let d=r.atRoot;if(d)r.atRoot=!1;if(r.atKey)r.atKey=!1;let p=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let b=n.items[h],{start:S,key:k,sep:v,value:E}=b,x=Gl.resolveProps(S,{flow:a,indicator:"explicit-key-ind",next:k??v?.[0],offset:p,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!x.found){if(!x.anchor&&!x.tag&&!v&&!E){if(h===0&&x.comma)i(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(h<n.items.length-1)i(x.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(x.comment)if(l.comment)l.comment+=`
|
|
68
|
+
`+x.comment;else l.comment=x.comment;p=x.end;continue}if(!s&&r.options.strict&&nk.containsNewline(k))i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0){if(x.comma)i(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!x.comma)i(x.start,"MISSING_CHAR",`Missing , between ${a} items`);if(x.comment){let O="";e:for(let w of S)switch(w.type){case"comma":case"space":break;case"comment":O=w.source.substring(1);break e;default:break e}if(O){let w=l.items[l.items.length-1];if(ZC.isPair(w))w=w.value??w.key;if(w.comment)w.comment+=`
|
|
69
|
+
`+O;else w.comment=O;x.comment=x.comment.substring(O.length+1)}}}if(!s&&!v&&!x.found){let O=E?e(r,E,x,i):t(r,x.end,v,null,x,i);if(l.items.push(O),p=O.range[2],so(E))i(O.range,"BLOCK_IN_FLOW",oo)}else{r.atKey=!0;let O=x.end,w=k?e(r,k,x,i):t(r,O,S,null,x,i);if(so(k))i(w.range,"BLOCK_IN_FLOW",oo);r.atKey=!1;let N=Gl.resolveProps(v??[],{flow:a,indicator:"map-value-ind",next:E,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(N.found){if(!s&&!x.found&&r.options.strict){if(v)for(let M of v){if(M===N.found)break;if(M.type==="newline"){i(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(x.start<N.found.offset-1024)i(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(E)if("source"in E&&E.source?.[0]===":")i(E,"MISSING_CHAR",`Missing space after : in ${a}`);else i(N.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let me=E?e(r,E,N,i):N.found?t(r,N.end,v,null,N,i):null;if(me){if(so(E))i(me.range,"BLOCK_IN_FLOW",oo)}else if(N.comment)if(w.comment)w.comment+=`
|
|
70
|
+
`+N.comment;else w.comment=N.comment;let Ue=new ek.Pair(w,me);if(r.options.keepSourceTokens)Ue.srcToken=b;if(s){let M=l;if(ik.mapIncludes(r,M.items,w))i(O,"DUPLICATE_KEY","Map keys must be unique");M.items.push(Ue)}else{let M=new Yl.YAMLMap(r.schema);M.flow=!0,M.items.push(Ue);let rs=(me??w).range;M.range=[w.range[0],rs[1],rs[2]],l.items.push(M)}p=me?me.range[2]:N.end}}let f=s?"}":"]",[u,...m]=n.end,g=p;if(u?.source===f)g=u.offset+u.source.length;else{let h=a[0].toUpperCase()+a.substring(1),b=d?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;if(i(p,d?"MISSING_CHAR":"BAD_INDENT",b),u&&u.source.length!==1)m.unshift(u)}if(m.length>0){let h=rk.resolveEnd(m,g,r.options.strict,i);if(h.comment)if(l.comment)l.comment+=`
|
|
71
|
+
`+h.comment;else l.comment=h.comment;l.range=[n.offset,g,h.offset]}else l.range=[n.offset,g,g];return l}sk.resolveFlowCollection=ok});var Jl=y(function(hk){var ck=A(),lk=L(),uk=we(),dk=xe(),pk=Hl(),fk=zl(),gk=Wl();function ao(e,t,r,n,i,o){let s=r.type==="block-map"?pk.resolveBlockMap(e,t,r,n,o):r.type==="block-seq"?fk.resolveBlockSeq(e,t,r,n,o):gk.resolveFlowCollection(e,t,r,n,o),a=s.constructor;if(i==="!"||i===a.tagName)return s.tag=a.tagName,s;if(i)s.tag=i;return s}function mk(e,t,r,n,i){let o=n.tag,s=!o?null:t.directives.tagName(o.source,(f)=>i(o,"TAG_RESOLVE_FAILED",f));if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:u}=n,m=f&&o?f.offset>o.offset?f:o:f??o;if(m&&(!u||u.offset<m.offset))i(m,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===uk.YAMLMap.tagName&&a==="map"||s===dk.YAMLSeq.tagName&&a==="seq")return ao(e,t,r,i,s);let c=t.schema.tags.find((f)=>f.tag===s&&f.collection===a);if(!c){let f=t.schema.knownTags[s];if(f?.collection===a)t.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else{if(f)i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0);else i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0);return ao(e,t,r,i,s)}}let l=ao(e,t,r,i,s,c),d=c.resolve?.(l,(f)=>i(o,"TAG_RESOLVE_FAILED",f),t.options)??l,p=ck.isNode(d)?d:new lk.Scalar(d);if(p.range=l.range,p.tag=s,c?.format)p.format=c.format;return p}hk.composeCollection=mk});var lo=y(function(Ck){var co=L();function bk(e,t,r){let n=t.offset,i=Sk(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?co.Scalar.BLOCK_FOLDED:co.Scalar.BLOCK_LITERAL,s=t.source?Rk(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=i.chomp==="+"&&s.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,s.length-1)):"",h=n+i.length;if(t.source)h+=t.source.length;return{value:g,type:o,comment:i.comment,range:[n,h,h]}}let c=t.indent+i.indent,l=t.offset+i.length,d=0;for(let g=0;g<a;++g){let[h,b]=s[g];if(b===""||b==="\r"){if(i.indent===0&&h.length>c)c=h.length}else{if(h.length<c)r(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)c=h.length;if(d=g,c===0&&!e.atRoot)r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+b.length+1}for(let g=s.length-1;g>=a;--g)if(s[g][0].length>c)a=g+1;let p="",f="",u=!1;for(let g=0;g<d;++g)p+=s[g][0].slice(c)+`
|
|
73
|
+
`;for(let g=d;g<a;++g){let[h,b]=s[g];l+=h.length+b.length+1;let S=b[b.length-1]==="\r";if(S)b=b.slice(0,-1);if(b&&h.length<c){let v=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-b.length-(S?2:1),"BAD_INDENT",v),h=""}if(o===co.Scalar.BLOCK_LITERAL)p+=f+h.slice(c)+b,f=`
|
|
74
74
|
`;else if(h.length>c||b[0]==="\t"){if(f===" ")f=`
|
|
75
75
|
`;else if(!u&&f===`
|
|
76
76
|
`)f=`
|
|
77
77
|
|
|
78
|
-
`;
|
|
78
|
+
`;p+=f+h.slice(c)+b,f=`
|
|
79
79
|
`,u=!0}else if(b==="")if(f===`
|
|
80
|
-
`)
|
|
80
|
+
`)p+=`
|
|
81
81
|
`;else f=`
|
|
82
|
-
`;else
|
|
83
|
-
`+s[g][0].slice(c);if(
|
|
84
|
-
`)
|
|
85
|
-
`;break;default:
|
|
86
|
-
`}let m=n+i.length+t.source.length;return{value:
|
|
82
|
+
`;else p+=f+b,f=" ",u=!1}switch(i.chomp){case"-":break;case"+":for(let g=a;g<s.length;++g)p+=`
|
|
83
|
+
`+s[g][0].slice(c);if(p[p.length-1]!==`
|
|
84
|
+
`)p+=`
|
|
85
|
+
`;break;default:p+=`
|
|
86
|
+
`}let m=n+i.length+t.source.length;return{value:p,type:o,comment:i.comment,range:[n,m,m]}}function Sk({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],o=i[0],s=0,a="",c=-1;for(let f=1;f<i.length;++f){let u=i[f];if(!a&&(u==="-"||u==="+"))a=u;else{let m=Number(u);if(!s&&m)s=m;else if(c===-1)c=e+f}}if(c!==-1)n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,d="",p=i.length;for(let f=1;f<t.length;++f){let u=t[f];switch(u.type){case"space":l=!0;case"newline":p+=u.source.length;break;case"comment":if(r&&!l)n(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");p+=u.source.length,d=u.source.substring(1);break;case"error":n(u,"UNEXPECTED_TOKEN",u.message),p+=u.source.length;break;default:{let m=`Unexpected token in block scalar header: ${u.type}`;n(u,"UNEXPECTED_TOKEN",m);let g=u.source;if(g&&typeof g==="string")p+=g.length}}}return{mode:o,indent:s,chomp:a,comment:d,length:p}}function Rk(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),o=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<t.length;s+=2)o.push([t[s],t[s+1]]);return o}Ck.resolveBlockScalar=bk});var po=y(function(Ok){var uo=L(),wk=it();function xk(e,t,r){let{offset:n,type:i,source:o,end:s}=e,a,c,l=(f,u,m)=>r(n+f,u,m);switch(i){case"scalar":a=uo.Scalar.PLAIN,c=vk(o,l);break;case"single-quoted-scalar":a=uo.Scalar.QUOTE_SINGLE,c=Ek(o,l);break;case"double-quoted-scalar":a=uo.Scalar.QUOTE_DOUBLE,c=Ik(o,l);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let d=n+o.length,p=wk.resolveEnd(s,d,t,r);return{value:c,type:a,comment:p.comment,range:[n,d,p.offset]}}function vk(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}if(r)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return Ql(e)}function Ek(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return Ql(e.slice(1,-1)).replace(/''/g,"'")}function Ql(e){let t=/(.*?)\r?\n/sy,r=t.exec(e);if(!r)return e;let n,i;try{n=new RegExp("(?<![ \t])[ \t]+$"),i=new RegExp("^[ \t]+|(?<![ \t])[ \t]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let o=r[1].replace(n,""),s=" ",a=t.lastIndex;while(r=t.exec(e)){let l=r[1].replace(i,"");if(l==="")if(s===`
|
|
87
87
|
`)o+=s;else s=`
|
|
88
|
-
`;else o+=s+l,s=" ";a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),o+s+(r?.[1]??"")}function
|
|
88
|
+
`;else o+=s+l,s=" ";a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),o+s+(r?.[1]??"")}function Ik(e,t){let r="";for(let n=1;n<e.length-1;++n){let i=e[n];if(i==="\r"&&e[n+1]===`
|
|
89
89
|
`)continue;if(i===`
|
|
90
|
-
`){let{fold:o,offset:s}=
|
|
90
|
+
`){let{fold:o,offset:s}=Pk(e,n);r+=o,n=s}else if(i==="\\"){let o=e[++n],s=Ak[o];if(s)r+=s;else if(o===`
|
|
91
91
|
`){o=e[n+1];while(o===" "||o==="\t")o=e[++n+1]}else if(o==="\r"&&e[n+1]===`
|
|
92
|
-
`){o=e[++n+1];while(o===" "||o==="\t")o=e[++n+1]}else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=
|
|
92
|
+
`){o=e[++n+1];while(o===" "||o==="\t")o=e[++n+1]}else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=Dk(e,n+1,a,t),n+=a}else{let a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i==="\t"){let o=n,s=e[n+1];while(s===" "||s==="\t")s=e[++n+1];if(s!==`
|
|
93
93
|
`&&!(s==="\r"&&e[n+2]===`
|
|
94
|
-
`))r+=n>o?e.slice(o,n+1):i}else r+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return r}function
|
|
94
|
+
`))r+=n>o?e.slice(o,n+1):i}else r+=i}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return r}function Pk(e,t){let r="",n=e[t+1];while(n===" "||n==="\t"||n===`
|
|
95
95
|
`||n==="\r"){if(n==="\r"&&e[t+2]!==`
|
|
96
96
|
`)break;if(n===`
|
|
97
97
|
`)r+=`
|
|
98
|
-
`;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var
|
|
99
|
-
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
98
|
+
`;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var Ak={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Dk(e,t,r,n){let i=e.substr(t,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Ok.resolveFlowScalar=xk});var Zl=y(function(Fk){var _e=A(),Xl=L(),Lk=lo(),Nk=po();function $k(e,t,r,n){let{value:i,type:o,comment:s,range:a}=t.type==="block-scalar"?Lk.resolveBlockScalar(e,t,n):Nk.resolveFlowScalar(t,e.options.strict,n),c=r?e.directives.tagName(r.source,(p)=>n(r,"TAG_RESOLVE_FAILED",p)):null,l;if(e.options.stringKeys&&e.atKey)l=e.schema[_e.SCALAR];else if(c)l=Mk(e.schema,i,c,r,n);else if(t.type==="scalar")l=_k(e,i,t,n);else l=e.schema[_e.SCALAR];let d;try{let p=l.resolve(i,(f)=>n(r??t,"TAG_RESOLVE_FAILED",f),e.options);d=_e.isScalar(p)?p:new Xl.Scalar(p)}catch(p){let f=p instanceof Error?p.message:String(p);n(r??t,"TAG_RESOLVE_FAILED",f),d=new Xl.Scalar(i)}if(d.range=a,d.source=i,o)d.type=o;if(c)d.tag=c;if(l.format)d.format=l.format;if(s)d.comment=s;return d}function Mk(e,t,r,n,i){if(r==="!")return e[_e.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[r];if(s&&!s.collection)return e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s;return i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[_e.SCALAR]}function _k({atKey:e,directives:t,schema:r},n,i,o){let s=r.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[_e.SCALAR];if(r.compat){let a=r.compat.find((c)=>c.default&&c.test?.test(n))??r[_e.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",d,!0)}}return s}Fk.composeScalar=$k});var eu=y(function(Bk){function qk(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++n];while(i?.type==="space")e+=i.source.length,i=t[++n];break}}return e}Bk.emptyScalarPosition=qk});var nu=y(function(Jk){var Vk=vt(),Kk=A(),Hk=Jl(),tu=Zl(),zk=it(),Yk=eu(),Gk={composeNode:ru,composeEmptyNode:fo};function ru(e,t,r,n){let i=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,d=!0;switch(t.type){case"alias":if(l=Wk(e,t,n),a||c)n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(l=tu.composeScalar(e,t,c,n),a)l.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(l=Hk.composeCollection(Gk,e,t,r,n),a)l.anchor=a.source.substring(1)}catch(p){let f=p instanceof Error?p.message:String(p);n(t,"RESOURCE_EXHAUSTION",f)}break;default:{let p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",p),d=!1}}if(l??(l=fo(e,t.offset,void 0,null,r,n)),a&&l.anchor==="")n(a,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&e.options.stringKeys&&(!Kk.isScalar(l)||typeof l.value!=="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str"))n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(o)l.spaceBefore=!0;if(s)if(t.type==="scalar"&&t.source==="")l.comment=s;else l.commentBefore=s;if(e.options.keepSourceTokens&&d)l.srcToken=t;return l}function fo(e,t,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let d={type:"scalar",offset:Yk.emptyScalarPosition(t,r,n),indent:-1,source:""},p=tu.composeScalar(e,d,a,l);if(s){if(p.anchor=s.source.substring(1),p.anchor==="")l(s,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)p.spaceBefore=!0;if(o)p.comment=o,p.range[2]=c;return p}function Wk({options:e},{offset:t,source:r,end:n},i){let o=new Vk.Alias(r.substring(1));if(o.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(o.source.endsWith(":"))i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+r.length,a=zk.resolveEnd(n,s,e.strict,i);if(o.range=[t,s,a.offset],a.comment)o.comment=a.comment;return o}Jk.composeEmptyNode=fo;Jk.composeNode=ru});var ou=y(function(nw){var Zk=jt(),iu=nu(),ew=it(),tw=Bt();function rw(e,t,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:t},e),c=new Zk.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=tw.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});if(d.found){if(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline)s(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}c.contents=i?iu.composeNode(l,i,d,s):iu.composeEmptyNode(l,d.end,n,null,d,s);let p=c.contents.range[2],f=ew.resolveEnd(o,p,!1,s);if(f.comment)c.comment=f.comment;return c.range=[r,p,f.offset],c}nw.composeDoc=rw});var go=y(function(uw){var ow=er("process"),sw=yi(),aw=jt(),Ut=qt(),su=A(),cw=ou(),lw=it();function Vt(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:r}=e;return[t,t+(typeof r==="string"?r.length:1)]}function au(e){let t="",r=!1,n=!1;for(let i=0;i<e.length;++i){let o=e[i];switch(o[0]){case"#":t+=(t===""?"":n?`
|
|
100
100
|
|
|
101
101
|
`:`
|
|
102
|
-
`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;r=!1;break;default:if(!r)n=!0;r=!1}}return{comment:t,afterEmptyLine:n}}class
|
|
103
|
-
${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(
|
|
102
|
+
`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;r=!1;break;default:if(!r)n=!0;r=!1}}return{comment:t,afterEmptyLine:n}}class cu{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,n,i)=>{let o=Vt(t);if(i)this.warnings.push(new Ut.YAMLWarning(o,r,n));else this.errors.push(new Ut.YAMLParseError(o,r,n))},this.directives=new sw.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=au(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(su.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];if(su.isPair(o))o=o.key;let s=o.commentBefore;o.commentBefore=s?`${r}
|
|
104
104
|
${s}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
|
|
105
|
-
${o}`:r}}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:
|
|
106
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
105
|
+
${o}`:r}}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:au(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(t,r)}*next(e){if(ow.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let i=Vt(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=cw.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(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,r=new Ut.YAMLParseError(Vt(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(r);else this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new Ut.YAMLParseError(Vt(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=lw.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ut.YAMLParseError(Vt(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 r=Object.assign({_directives:this.directives},this.options),n=new aw.Document(void 0,r);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");n.range=[0,t,t],this.decorate(n,!1),yield n}}}uw.Composer=cu});var du=y(function(Sw){var pw=lo(),fw=po(),gw=qt(),lu=At();function mw(e,t=!0,r){if(e){let n=(i,o,s)=>{let a=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new gw.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fw.resolveFlowScalar(e,t,n);case"block-scalar":return pw.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function hw(e,t){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=t,a=lu.stringifyString({type:s,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
107
107
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
108
|
-
`),
|
|
109
|
-
`,f=[{type:"block-scalar-header",offset:o,indent:n,source:
|
|
110
|
-
`});return{type:"block-scalar",offset:o,indent:n,props:f,source:
|
|
108
|
+
`),d=a.substring(0,l),p=a.substring(l+1)+`
|
|
109
|
+
`,f=[{type:"block-scalar-header",offset:o,indent:n,source:d}];if(!uu(f,c))f.push({type:"newline",offset:-1,indent:n,source:`
|
|
110
|
+
`});return{type:"block-scalar",offset:o,indent:n,props:f,source:p}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function yw(e,t,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in e?e.indent:null;if(n&&typeof a==="number")a+=2;if(!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=lu.stringifyString({type:s,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":bw(e,c);break;case'"':mo(e,c,"double-quoted-scalar");break;case"'":mo(e,c,"single-quoted-scalar");break;default:mo(e,c,"scalar")}}function bw(e,t){let r=t.indexOf(`
|
|
111
111
|
`),n=t.substring(0,r),i=t.substring(r+1)+`
|
|
112
|
-
`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw Error("Invalid block scalar header");o.source=n,e.source=i}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];if(!
|
|
113
|
-
`});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:i})}}function
|
|
114
|
-
`};delete e.items,Object.assign(e,{type:r,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((o)=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))if(o!=="type"&&o!=="offset")delete e[o];Object.assign(e,{type:r,indent:n,source:t,end:i})}}}
|
|
112
|
+
`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw Error("Invalid block scalar header");o.source=n,e.source=i}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];if(!uu(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:s,source:`
|
|
113
|
+
`});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:i})}}function uu(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function mo(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),i=t.length;if(e.props[0].type==="block-scalar-header")i-=e.props[0].source.length;for(let o of n)o.offset+=i;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
114
|
+
`};delete e.items,Object.assign(e,{type:r,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((o)=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))if(o!=="type"&&o!=="offset")delete e[o];Object.assign(e,{type:r,indent:n,source:t,end:i})}}}Sw.createScalarToken=hw;Sw.resolveAsScalar=mw;Sw.setScalarValue=yw});var pu=y(function(xw){var ww=(e)=>("type"in e)?ln(e):cn(e);function ln(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=ln(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=cn(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=cn(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=cn(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function cn({start:e,key:t,sep:r,value:n}){let i="";for(let o of e)i+=o.source;if(t)i+=ln(t);if(r)for(let o of r)i+=o.source;if(n)i+=ln(n);return i}xw.stringify=ww});var mu=y(function(Iw){var ho=Symbol("break visit"),Ew=Symbol("skip children"),fu=Symbol("remove item");function Fe(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};gu(Object.freeze([]),e,t)}Fe.BREAK=ho;Fe.SKIP=Ew;Fe.REMOVE=fu;Fe.itemAtPath=(e,t)=>{let r=e;for(let[n,i]of t){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Fe.parentCollection=(e,t)=>{let r=Fe.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};function gu(e,t,r){let n=r(t,e);if(typeof n==="symbol")return n;for(let i of["key","value"]){let o=t[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=gu(Object.freeze(e.concat([[i,s]])),o.items[s],r);if(typeof a==="number")s=a-1;else if(a===ho)return ho;else if(a===fu)o.items.splice(s,1),s-=1}if(typeof n==="function"&&i==="key")n=n(t,e)}}return typeof n==="function"?n(t,e):n}Iw.visit=Fe});var un=y(function($w){var yo=du(),Aw=pu(),Dw=mu(),bo="\uFEFF",So="\x02",Ro="\x18",Co="\x1F",Ow=(e)=>!!e&&("items"in e),Tw=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Lw(e){switch(e){case bo:return"<BOM>";case So:return"<DOC>";case Ro:return"<FLOW_END>";case Co:return"<SCALAR>";default:return JSON.stringify(e)}}function Nw(e){switch(e){case bo:return"byte-order-mark";case So:return"doc-mode";case Ro:return"flow-error-end";case Co: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(e[0]){case" ":case"\t":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}
|
|
117
|
-
`:case"\r":case"\t":return!0;default:return!1}}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(e[0]){case" ":case"\t":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}$w.createScalarToken=yo.createScalarToken;$w.resolveAsScalar=yo.resolveAsScalar;$w.setScalarValue=yo.setScalarValue;$w.stringify=Aw.stringify;$w.visit=Dw.visit;$w.BOM=bo;$w.DOCUMENT=So;$w.FLOW_END=Ro;$w.SCALAR=Co;$w.isCollection=Ow;$w.isScalar=Tw;$w.prettyToken=Lw;$w.tokenType=Nw});var wo=y(function(Qw){var Kt=un();function ne(e){switch(e){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case"\t":return!0;default:return!1}}var hu=new Set("0123456789ABCDEFabcdef"),Ww=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),dn=new Set(",[]{}"),Jw=new Set(` ,[]{}
|
|
118
|
+
\r `),ko=(e)=>!e||Jw.has(e);class yu{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 r=this.next??"stream";while(r&&(t||this.hasChars(1)))r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
|
|
119
119
|
`)return!0;if(t==="\r")return this.buffer[e+1]===`
|
|
120
120
|
`;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;while(t===" ")t=this.buffer[++r+e];if(t==="\r"){let n=this.buffer[r+e+1];if(n===`
|
|
121
121
|
`||!n&&!this.atEnd)return e+r+1}return t===`
|
|
122
122
|
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&ne(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&e<this.pos)e=this.buffer.indexOf(`
|
|
123
|
-
`,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return 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]===
|
|
123
|
+
`,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return 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]===Kt.BOM)yield*this.pushCount(1),e=e.substring(1);if(e[0]==="%"){let t=e.length,r=e.indexOf("#");while(r!==-1){let i=e[r-1];if(i===" "||i==="\t"){t=r-1;break}else r=e.indexOf("#",r+1)}while(!0){let i=e[t-1];if(i===" "||i==="\t")t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),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 Kt.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==="...")&&ne(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ne(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ne(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"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(ko),"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,r=-1;do{if(e=yield*this.pushNewline(),e>0)t=yield*this.pushSpaces(!1),this.indentValue=r=t;else t=0;t+=yield*this.pushSpaces(!0)}while(e+t>0);let n=this.getLine();if(n===null)return this.setNext("flow");if(r!==-1&&r<this.indentNext&&n[0]!=="#"||r===0&&(n.startsWith("---")||n.startsWith("..."))&&ne(n[3])){if(!(r===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Kt.FLOW_END,yield*this.parseLineStart()}let i=0;while(n[i]===",")i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),n[i]){case void 0:return"flow";case"#":return yield*this.pushCount(n.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(ko),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ne(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")while(t!==-1&&this.buffer[t+1]==="'")t=this.buffer.indexOf("'",t+2);else while(t!==-1){let i=0;while(this.buffer[t-1-i]==="\\")i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf(`
|
|
124
124
|
`,this.pos);if(n!==-1){while(n!==-1){let i=this.continueScalar(n+1);if(i===-1)break;n=r.indexOf(`
|
|
125
125
|
`,i)}if(n!==-1)t=n-(r[n-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;while(!0){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)=>ne(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":t+=1;break;case`
|
|
126
126
|
`:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
127
127
|
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
128
128
|
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;r=this.buffer[n];while(r===" ")r=this.buffer[++n];if(r==="\t"){while(r==="\t"||r===" "||r==="\r"||r===`
|
|
129
129
|
`)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];if(o==="\r")o=this.buffer[--i];let s=i;while(o===" ")o=this.buffer[--i];if(o===`
|
|
130
|
-
`&&i>=this.pos&&i+1+t>s)e=i;else break}while(!0);return yield
|
|
130
|
+
`&&i>=this.pos&&i+1+t>s)e=i;else break}while(!0);return yield Kt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,n;while(n=this.buffer[++r])if(n===":"){let i=this.buffer[r+1];if(ne(i)||e&&dn.has(i))break;t=r}else if(ne(n)){let i=this.buffer[r+1];if(n==="\r")if(i===`
|
|
131
131
|
`)r+=1,n=`
|
|
132
|
-
`,i=this.buffer[r+1];else t=r;if(i==="#"||e&&
|
|
133
|
-
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&
|
|
132
|
+
`,i=this.buffer[r+1];else t=r;if(i==="#"||e&&dn.has(i))break;if(n===`
|
|
133
|
+
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&dn.has(n))break;t=r}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield Kt.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc"}*pushCount(e){if(e>0)return yield this.buffer.substr(this.pos,e),this.pos+=e,e;return 0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);if(r)return yield r,this.pos+=r.length,r.length;else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(!0){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(ko),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(ne(r)||t&&dn.has(r)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!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];while(!ne(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];while(t)if(Ww.has(t))t=this.buffer[++e];else if(t==="%"&&hu.has(this.buffer[e+1])&&hu.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];if(e===`
|
|
134
134
|
`)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
|
|
135
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}
|
|
135
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}Qw.Lexer=yu});var xo=y(function(Zw){class bu{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,r=this.lineStarts.length;while(t<r){let i=t+r>>1;if(this.lineStarts[i]<e)t=i+1;else r=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}Zw.LineCounter=bu});var vo=y(function(nx){var tx=er("process"),Su=un(),rx=wo();function ve(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function Ru(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function ku(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function pn(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function ot(e){if(e.length===0)return[];let t=e.length;e:while(--t>=0)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while(e[++t]?.type==="space");return e.splice(t,e.length)}function fn(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function Cu(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!ve(t.start,"explicit-key-ind")&&!ve(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,ku(t.value))if(t.value.end)fn(t.value.end,t.sep);else t.value.end=t.sep;else fn(t.start,t.sep);delete t.sep}}}class wu{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 rx.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);if(!t)yield*this.end()}*next(e){if(this.source=e,tx.env.LOG_TOKENS)console.log("|",Su.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Su.tokenType(e);if(!t){let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}else if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+e.length);break;case"space":if(this.atNewLine&&e[0]===" ")this.indent+=e.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=e.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){while(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"){while(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 r=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in r?r.indent:0;else if(t.type==="flow-collection"&&r.type==="document")t.indent=0;if(t.type==="flow-collection")Cu(t);switch(r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let n=r.items[r.items.length-1];if(n.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=r.items[r.items.length-1];if(n.value)r.items.push({start:[],value:t});else n.value=t;break}case"flow-collection":{let n=r.items[r.items.length-1];if(!n||n.value)r.items.push({start:[],key:t,sep:[]});else if(n.sep)n.value=t;else Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];if(n&&!n.sep&&!n.value&&n.start.length>0&&Ru(n.start)===-1&&(t.indent===0||n.start.every((i)=>i.type!=="comment"||i.indent<t.indent))){if(r.type==="document")r.end=n.start;else r.items.push({start:n.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:[]};if(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":{if(Ru(e.start)!==-1)yield*this.pop(),yield*this.step();else 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);if(t)this.stack.push(t);else 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=pn(this.peek(2)),r=ot(t),n;if(e.end)n=e.end,n.push(this.sourceToken),delete e.end;else n=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};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;while(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 r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else 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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){
|
|
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 r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else 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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){fn(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(n&&t.sep&&!t.value){let o=[];for(let s=0;s<t.sep.length;++s){let a=t.sep[s];switch(a.type){case"newline":o.push(s);break;case"space":break;case"comment":if(a.indent>e.indent)o.length=0;break;default:o.length=0}}if(o.length>=2)i=t.sep.splice(o[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(n||t.value)i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0});else 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(ve(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=ot(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ve(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(ku(t.key)&&!ve(t.sep,"newline")){let o=ot(t.start),{key:s,sep:a}=t;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:a}]})}else if(i.length>0)t.sep=t.sep.concat(i,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||n)e.items.push({start:i,key:null,sep:[this.sourceToken]});else if(ve(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);if(n||t.value)e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(o);else Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0;return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ve(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 if(r)e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else 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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){fn(n,t.start),n.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;if(t.value||ve(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:n,sep:[]});else if(t.sep)this.stack.push(n);else Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);if(r)this.stack.push(r);else yield*this.pop(),yield*this.step()}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let n=pn(r),i=ot(n);Cu(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
138
138
|
`)+1;while(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=
|
|
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=pn(e),r=ot(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=pn(e),r=ot(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((r)=>r.type==="newline"||r.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}nx.Parser=wu});var Pu=y(function(px){var xu=go(),ox=jt(),Ht=qt(),sx=wi(),ax=A(),cx=xo(),vu=vo();function Eu(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new cx.LineCounter||null,prettyErrors:t}}function lx(e,t={}){let{lineCounter:r,prettyErrors:n}=Eu(t),i=new vu.Parser(r?.addNewLine),o=new xu.Composer(t),s=Array.from(o.compose(i.parse(e)));if(n&&r)for(let a of s)a.errors.forEach(Ht.prettifyError(e,r)),a.warnings.forEach(Ht.prettifyError(e,r));if(s.length>0)return s;return Object.assign([],{empty:!0},o.streamInfo())}function Iu(e,t={}){let{lineCounter:r,prettyErrors:n}=Eu(t),i=new vu.Parser(r?.addNewLine),o=new xu.Composer(t),s=null;for(let a of o.compose(i.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Ht.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&r)s.errors.forEach(Ht.prettifyError(e,r)),s.warnings.forEach(Ht.prettifyError(e,r));return s}function ux(e,t,r){let n=void 0;if(typeof t==="function")n=t;else if(r===void 0&&t&&typeof t==="object")r=t;let i=Iu(e,r);if(!i)return null;if(i.warnings.forEach((o)=>sx.warn(i.options.logLevel,o)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},r))}function dx(e,t,r){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=t;if(typeof r==="string")r=r.length;if(typeof r==="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=r??t??{};if(!i)return}if(ax.isDocument(e)&&!n)return e.toString(r);return new ox.Document(e,n,r).toString(r)}px.parse=ux;px.parseAllDocuments=lx;px.parseDocument=Iu;px.stringify=dx});var yx,bx,Sx,Eo,Rx,Ee,Cx,kx,wx,xx,pO,vx,Ex,Ix,gn,Au,Px,Ax,Dx,Ox,Tx,Lx,Nx,$x,Mx,_x,Fx,jx,qx,Bx,Ux,Vx,Kx,Hx,zx,Yx,Gx,Wx,st,Jx,Qx,Xx,Zx,ev;var mn=K(()=>{yx=go(),bx=jt(),Sx=Qi(),Eo=qt(),Rx=vt(),Ee=A(),Cx=Ce(),kx=L(),wx=we(),xx=xe(),pO=un(),vx=wo(),Ex=xo(),Ix=vo(),gn=Pu(),Au=wt();Px=yx.Composer,Ax=bx.Document,Dx=Sx.Schema,Ox=Eo.YAMLError,Tx=Eo.YAMLParseError,Lx=Eo.YAMLWarning,Nx=Rx.Alias,$x=Ee.isAlias,Mx=Ee.isCollection,_x=Ee.isDocument,Fx=Ee.isMap,jx=Ee.isNode,qx=Ee.isPair,Bx=Ee.isScalar,Ux=Ee.isSeq,Vx=Cx.Pair,Kx=kx.Scalar,Hx=wx.YAMLMap,zx=xx.YAMLSeq,Yx=vx.Lexer,Gx=Ex.LineCounter,Wx=Ix.Parser,st=gn.parse,Jx=gn.parseAllDocuments,Qx=gn.parseDocument,Xx=gn.stringify,Zx=Au.visit,ev=Au.visitAsync});function hn(e){return typeof e==="string"&&e.trim()?e.trim():void 0}function tv(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function je(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return{meta:"",body:e.trim()};return{meta:(t[1]??"").trim(),body:(t[2]??"").trim()}}function zt(e){let{meta:t}=je(e);if(!t)throw Error("design-md file is missing YAML frontmatter");let r=st(t);if(!r||typeof r!=="object")throw Error("design-md frontmatter must be a YAML object");let n=typeof r.title==="string"?r.title.trim():"",i=typeof r.name==="string"?r.name.trim():"",o=n||i;if(!o)throw Error("design-md frontmatter must include a non-empty 'title' or 'name' field");let s=hn(r.id)??hn(r.slug)??tv(o);if(!s)throw Error("design-md frontmatter must include a non-empty 'id' field");let a={id:s,title:o,category:hn(r.category)??"general",tags:Array.isArray(r.tags)?r.tags:[],origin:typeof r.origin==="string"?r.origin:"local"};if(i)a.name=i;if(typeof r.version==="string"&&r.version.trim())a.version=r.version.trim();let c=hn(r.description);if(c)a.description=c;if(typeof r.sourceUrl==="string")a.sourceUrl=r.sourceUrl;if(Array.isArray(r.exemptRules)){let l=r.exemptRules.filter((d)=>typeof d==="string"&&d.trim().length>0);if(l.length>0)a.exemptRules=l.map((d)=>d.trim())}if(Array.isArray(r.extractedTokens))a.extractedTokens=r.extractedTokens;if(typeof r.layer==="string")if(Du.includes(r.layer))a.layer=r.layer;else console.warn(`[design-md] ignoring invalid layer "${r.layer}" on id="${a.id}"; expected one of ${Du.join("|")}`);return a}var Du;var Yt=K(()=>{mn();Du=["auto","user","override"]});function Ie(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function yn(e){return Object.fromEntries(Object.entries(Ie(e)).flatMap(([t,r])=>typeof r==="string"||typeof r==="number"?[[t,String(r)]]:[]))}function Ou(e){return Array.isArray(e)?e.filter((t)=>typeof t==="string"&&t.trim().length>0):[]}function ov(e){return[...e.matchAll(/^```ya?ml[^\n]*\n([\s\S]*?)^```/gim)].map((t)=>t[1]??"")}function sv(e){let{meta:t,body:r}=je(e),n=[],i=[];for(let[o,s]of[t,...ov(r)].entries()){if(!s.trim())continue;let a;try{a=Ie(st(s))}catch(c){if(o===0)n.push({severity:"error",message:`frontmatter is not valid YAML: ${c.message}`});continue}if(o===0||Object.keys(a).some((c)=>Tu.has(c)))i.push(a)}return{sources:i,issues:n}}function av(e){let t={};for(let[r,n]of Object.entries(Ie(e)))if(typeof n==="string")t[r]={fontFamily:n};else{let i={};for(let[o,s]of Object.entries(Ie(n)))if(iv.has(o)&&(typeof s==="string"||typeof s==="number"))i[o]=s;t[r]=i}return t}function Io(e){let{sources:t}=sv(e),r=Object.assign({},...t);if(!Object.keys(r).some((c)=>Tu.has(c)))return;let n={colors:yn(r.colors),typography:av(r.typography),rounded:yn(r.rounded),spacing:Object.fromEntries(Object.entries(Ie(r.spacing)).flatMap(([c,l])=>typeof l==="string"||typeof l==="number"?[[c,l]]:[])),components:Object.fromEntries(Object.entries(Ie(r.components)).map(([c,l])=>[c,yn(l)]))},i=Object.fromEntries(Object.entries(Ie(r.themes)).map(([c,l])=>[c,yn(l)]));if(Object.keys(i).length)n.themes=i;let o=Ie(r.forbidden),s=Ou(o.colors),a=Ou(o.fonts);if(s.length||a.length)n.forbidden={colors:s,fonts:a};return n}var rv,nv,Tu,iv;var Po=K(()=>{mn();Yt();rv=["colors","typography","rounded","spacing","components"],nv=["themes","forbidden"],Tu=new Set([...rv,...nv]),iv=new Set(["fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","fontFeature","fontVariation"])});function Ao(e){let t=new Set,r=[];for(let{pattern:n,group:i}of cv){let o=new RegExp(n.source,n.flags),s;while((s=o.exec(e))!==null){let a=(s[1]??"").trim(),c=(s[2]??"").trim(),l=`${a}:${c}`;if(!t.has(l))t.add(l),r.push({name:a,value:c,group:i})}}return r}var cv;var Do=K(()=>{cv=[{pattern:/`?(--[\w-]+)`?\s*:\s*([#\w()%., ]+)/g,group:"css-var"},{pattern:/`?([\w-]+(?:Color|Bg|Text|Border|Shadow|Radius|Font|Size|Space))`?\s*[=:]\s*["']?([^"'\n,]+)["']?/gi,group:"token"}]});import{readFileSync as lv}from"fs";function Gt(e){let t=lv(e,"utf-8"),{body:r}=je(t),n=zt(t),i=Io(t),o=n.extractedTokens??(i&&Object.keys(i.colors).length?Object.entries(i.colors).map(([a,c])=>({name:a,value:c,group:"color"})):Ao(r)),s={id:n.id,title:n.title,category:n.category,tags:n.tags??[],origin:n.origin??"local",body:r,filePath:e};if(n.sourceUrl)s.sourceUrl=n.sourceUrl;if(n.description)s.description=n.description;if(i)s.tokens=i;if(n.exemptRules)s.exemptRules=n.exemptRules;if(n.layer)s.layer=n.layer;if(o.length>0)s.extractedTokens=o;return s}var Wt=K(()=>{Yt();Po();Do()});var Oo=K(()=>{Wt()});var To=()=>{};var Lo=()=>{};function bn(e){return`# ${e.trim()||"project"} DESIGN
|
|
140
140
|
|
|
141
141
|
Per-project visual contract. Owned by this consumer. UIBot house seeds
|
|
142
142
|
(\`frontend-principles\`, \`control-console\`) are generation defaults only;
|
|
@@ -193,7 +193,7 @@ Page title 20px. Body 14px. Helper \u2265 12px. No marketing display serif.
|
|
|
193
193
|
- No purple-gradient SaaS, ALL-CAPS chrome eyebrows, or emoji as icons.
|
|
194
194
|
- No unscoped \`html, body, *\` CSS. Scope tokens to the product root.
|
|
195
195
|
- No second design system beside this file.
|
|
196
|
-
`}var
|
|
196
|
+
`}var Lu=K(()=>{Wt()});import{fileURLToPath as uv}from"url";import{existsSync as dv,readdirSync as pv}from"fs";import{join as fv}from"path";function Sn(e=Nu){if(!dv(e))return[];let t=[];for(let r of pv(e).sort()){if(r.startsWith("_")||!r.endsWith(".design.md"))continue;try{t.push(Gt(fv(e,r)))}catch(n){console.warn(`[design-md] skipping seed ${r}: ${n.message}`)}}return t}var Nu;var $u=K(()=>{Wt();Nu=uv(new URL("../content",import.meta.url))});import{mkdirSync as Mu,writeFileSync as gv}from"fs";import{dirname as mv,join as hv}from"path";async function _u(e,t=globalThis.fetch){let r=e.trim(),n=yv.exec(r);if(n){let i=n[1],o=n[2],s=(n[3]??"").replace(/^\/+|\/+$/g,""),a=`https://api.github.com/repos/${i}/${o}/contents`+(s?`/${s}`:""),c=await t(a,{headers:{accept:"application/vnd.github+json","user-agent":"uibot-design-md-sync"}});if(!c.ok)throw Error(`Failed to list github:${i}/${o}${s?"/"+s:""} (HTTP ${c.status})`);let l=await c.json(),d=Array.isArray(l)?l:[l],p=[];for(let f of d){if(!f||typeof f!=="object")continue;let u=f;if(u.type==="file"&&u.name&&Fu(u.name)&&u.download_url)p.push(u.download_url)}if(p.length===0)throw Error(`No *.design.md / design markdown files found at github:${i}/${o}`+(s?`/${s}`:""));return{kind:"github",label:`github:${i}/${o}${s?"/"+s:""}`,fileUrls:p}}if(/^https?:\/\//i.test(r))return{kind:"url",label:r,fileUrls:[r]};throw Error(`Unsupported --from value "${e}". Use github:owner/repo[/path] or an https:// URL.`)}function Fu(e){let t=e.toLowerCase();return t.endsWith(".design.md")||t.endsWith(".md")&&!t.startsWith("readme")}function ju(e,t){let{meta:r,body:n}=je(e);if(!r)return`---
|
|
197
197
|
sourceUrl: ${JSON.stringify(t.sourceUrl)}
|
|
198
198
|
license: ${JSON.stringify(t.license)}
|
|
199
199
|
---
|
|
@@ -203,11 +203,11 @@ ${i.join(`
|
|
|
203
203
|
---
|
|
204
204
|
${n?n+(n.endsWith(`
|
|
205
205
|
`)?"":`
|
|
206
|
-
`):""}`}async function
|
|
207
|
-
`)}function Ee(e){if(/^[\w.-]+$/.test(e))return e;return JSON.stringify(e)}var $u=V(()=>{Ht()});var fn=V(()=>{ai();wo();vo();Eo();Yt();Iu();wo();Au();vo();Eo();xo();Ro();Nu();$u()});import{lstatSync as Sp,mkdirSync as gs,readFileSync as Cp,realpathSync as Rp,writeFileSync as ms}from"fs";import{basename as kp,dirname as jn,isAbsolute as xp,resolve as ue,sep as ps}from"path";function Zt(e){let t=e.lockfilePath??"uibot.artifacts.lock.json",r=e.manifest.items??[],n=new Map;for(let s of r)n.set(s.name,s);if(e.lockfile===null)return{ok:!1,lockfilePath:t,registryName:e.manifest.name,lockCount:0,manifestCount:r.length,drifts:[{name:"*",kind:"missing-in-lock",detail:"lockfile missing or unreadable"}]};let i=[],o=new Set;for(let s of e.lockfile.artifacts??[]){o.add(s.name);let a=n.get(s.name);if(!a){i.push({name:s.name,kind:"missing-in-manifest",lockVersion:s.version,detail:`locked ${s.name}@${s.version} not present in registry manifest`});continue}let c=$d(a);if(c&&c!==s.version)i.push({name:s.name,kind:"version-mismatch",lockVersion:s.version,manifestVersion:c,detail:`${s.name}: lock ${s.version} \u2260 registry ${c}`})}return{ok:i.length===0,lockfilePath:t,registryName:e.manifest.name,lockCount:(e.lockfile.artifacts??[]).length,manifestCount:r.length,drifts:i}}function $d(e){return e.artifact?.version??e.version}import{readFileSync as Md,realpathSync as Qo}from"fs";import{resolve as Ue,relative as _d,dirname as Fd,extname as jd,sep as An}from"path";function qd(e){if(e.endsWith(".css"))return"style";if(e.endsWith(".tsx")||e.endsWith(".jsx"))return"component";if(/(^|\/)use-[^/]+\.ts$/.test(e))return"hook";return"lib"}function Dn(e){let t=e.readFile??((c)=>Md(c,"utf8")),r=new Map,n=(c,l=Ue(e.sourceDir))=>{let p=_d(l,Ue(c));if(p===".."||p.startsWith(`..${An}`)||p.startsWith(An))throw Error(`Block dependency outside sourceDir: ${c}`);return p.replaceAll(An,"/")},i=(c)=>{if(n(Ue(e.sourceDir,c)),!e.readFile)n(Qo(Ue(e.sourceDir,c)),Qo(e.sourceDir));let l=r.get(c);if(l!==void 0)return l;let p=t(Ue(e.sourceDir,c));return r.set(c,p),p},o=(c)=>{let l=new Map,p=(d)=>{if(l.has(d))return;let f=i(d);l.set(d,{path:d,type:qd(d),content:f});let u=f.matchAll(/(?:\bfrom\s*|\bimport\s*)["'](\.[^"']+)["']/g);for(let m of u){let g=n(Ue(e.sourceDir,Fd(d),m[1]??"")),h=jd(g)?[g]:[`${g}.ts`,`${g}.tsx`,`${g}/index.ts`,`${g}/index.tsx`],b;for(let R of h)try{i(R),b=R;break}catch(x){if(x instanceof Error&&x.message.includes("outside sourceDir"))throw x}if(!b)throw Error(`Unresolved block dependency: ${d} -> ${m[1]}`);p(b)}};return p(c),[...l.values()]},s=(c)=>{let l=new Set;for(let p of c){if(typeof p.content!=="string")continue;for(let d of p.content.matchAll(/(?:\bfrom\s*|\bimport\s*)["']([^."'/][^"']*|@[^"']+)["']/g)){let f=d[1]??"";if(f.startsWith("node:"))continue;let u=f.startsWith("@")?f.split("/").slice(0,2).join("/"):f.split("/")[0]??"";if(u==="react"||u==="react-dom"||u.startsWith("@uibot/"))continue;l.add(u)}}return[...l].sort()},a=[];for(let c of Object.keys(e.catalog)){let l=e.blockFileMap[c];if(l===void 0)continue;let p=e.catalog[c];if(p===void 0)continue;let d=i(l),f=o(l),u=s(f);a.push({name:c,category:p.category,description:p.description,sourceCode:d,files:f,catalogEntry:p,...u.length>0?{dependencies:u}:{}})}return a}function Xo(e){return e.flatMap((t)=>Dn(t))}import{readdirSync as Bd,readFileSync as Ud,statSync as Vd}from"fs";import{basename as Kd,join as Hd}from"path";var Gd="0.1.0";function er(e){let{dir:t}=e,r;try{r=Bd(t)}catch{return[]}let n=e.defaultVersion??Gd,i=e.defaultLevel??"L4",o=e.defaultCategory??"template",s=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=Hd(t,a);try{if(!Vd(c).isFile())continue}catch{continue}let l=Ud(c,"utf8");if(!l.trim())continue;let p=Kd(a).replace(/\.ya?ml$/i,""),d=Yd(p),f=zd(p),u=Wd(l)??`${f} template`;s.push({name:d,version:n,title:f,description:u,yaml:l,absolutePath:c,templateContract:{name:d,description:u,level:i,category:o,keywords:[d,p.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:Jd(l)}})}return s.sort((a,c)=>a.name.localeCompare(c.name))}function dt(e){let t=new Map;for(let r of e)for(let n of er(r)){let i=t.get(n.name);if(i)throw Error(`duplicate template source name "${n.name}": ${i.absolutePath} and ${n.absolutePath}`);t.set(n.name,n)}return[...t.values()].sort((r,n)=>r.name.localeCompare(n.name))}function tr(e){return{kind:"template",name:e.name,version:e.version,files:[{path:`${e.name}.yaml`,type:"template",content:e.yaml,target:`${e.name}.yaml`}],templateContract:e.templateContract}}function On(e){return{name:e.name,kind:"template",title:e.title,description:e.description,artifact:tr(e)}}function Yd(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function zd(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function Wd(e){return(e.match(/^\s*title:\s*["']?(.+?)["']?\s*$/m)??e.match(/^\s*-\s*id:.*\n\s*path:.*\n\s*title:\s*["']?(.+?)["']?\s*$/m))?.[1]?.trim()}function Jd(e){let t=new Set;for(let r of e.matchAll(/^\s*-\s*type:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}for(let r of e.matchAll(/^\s*template:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}return[...t].sort()}var Qd="0.1.0";function Xd(e,t={}){return{kind:"component",name:e.name,version:t.defaultVersion??Qd,runtime:t.runtime??"react",files:e.files,...e.dependencies?{dependencies:e.dependencies}:{},...e.registryDependencies?{registryDependencies:e.registryDependencies}:{},...e.catalogEntry.tags?{tags:e.catalogEntry.tags}:{},catalogEntry:e.catalogEntry}}function Zd(e,t={}){return{name:e.name,kind:"component",title:e.catalogEntry.name,description:e.description??e.catalogEntry.description,artifact:Xd(e,t)}}function Zo(e,t){let r={...t.runtime?{runtime:t.runtime}:{},...t.defaultVersion?{defaultVersion:t.defaultVersion}:{}},n=e.map((o)=>Zd(o,r)),i=(t.templates??[]).map((o)=>On(o));return{name:t.name,items:[...n,...i]}}var rp={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},KI=Array.from(new Set(Object.values(rp).flat()));var es=["component","template","design-guide","example","skill"],Tn=["experimental","candidate","recommended"];var ts=["missing","declared","verified","external-consumer"],rs=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],Ve=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])})]);var eA=new Set(rs),tA=new Set(ts);var np=/^(unknown|unlicensed|none|n\/?a)$/i;function Ln(e){let t=e?.trim();if(!t||np.test(t))return;return t}var ip="uibot.resource.index.v1";class Ke extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function H(e,t){return e<t?-1:e>t?1:0}function _(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function op(e){let t=_(e).replace(/ /g,"-");if(!t)throw new Ke("invalid-resource-source-id",e);return t}function ce(e,t){return`${e}:${op(t)}`}function rr(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let i=_(n);if(!i||t.has(i))continue;t.set(i,n)}return[...t.entries()].sort(([r],[n])=>H(r,n)).map(([,r])=>r)}function pt(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function sp(e){let t=Ln(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function ft(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:rr(e.tags),aliases:rr(e.aliases),capabilities:rr(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(H),source:sp(e.source),receipt:e.receipt}}function ap(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function cp(e){return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function lp(e){let t=new Map;for(let r of Object.keys(e).sort(H)){let n=e[r];if(!n)continue;let i=ce("component",r);for(let o of rr([r,n.name])){let s=_(o),a=t.get(s)??[];if(!a.includes(i))a.push(i);t.set(s,a.sort(H))}}return t}function up(e,t,r){let n=r.get(_(e))??[];if(n.length===0)throw new Ke("dangling-resource-dependency",`${t} -> ${ce("component",e)}`);if(n.length>1)throw new Ke("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function dp(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return ce("template",i);return up(e,t,r)}function gt(e,t,r){return Ln(r?.[e]??t)}function ns(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>H(t,r)).map(([t,r])=>({id:`${t}-example`,title:`${r.name} Example`,description:r.description,category:r.category,tags:r.keywords,aliases:[`${t} example`,`${r.name} example`],capabilities:["example:template"],dependencies:[ce("template",t)]}))}function is(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],o=e.skills??[],s=e.licenses,a=lp(t),c=[];for(let u of Object.keys(t).sort(H)){let m=t[u];if(!m)continue;let g=ce("component",u),h=gt(g,void 0,s);c.push(ft({id:g,kind:"component",title:m.name,description:m.description,category:m.category,tags:m.tags??[],aliases:[u,m.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:u,...h?{license:h}:{}},receipt:pt(Boolean(h))}))}for(let u of Object.keys(r).sort(H)){let m=r[u];if(!m)continue;let g=ce("template",u),h=gt(g,void 0,s);c.push(ft({id:g,kind:"template",title:m.name,description:m.description,category:m.category,tags:m.keywords,aliases:[u,m.name],capabilities:[],dependencies:(m.composedFrom??[]).map((b)=>dp(b,g,a,r)),source:{type:"template-contract",id:u,...h?{license:h}:{}},receipt:pt(Boolean(h))}))}for(let u of[...n].sort((m,g)=>H(m.id,g.id))){let m=ce("design-guide",u.id),g=gt(m,void 0,s);c.push(ft({id:m,kind:"design-guide",title:u.title,description:ap(u),category:u.category,tags:u.tags,aliases:[u.id,u.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:u.id,...u.sourceUrl?{url:u.sourceUrl}:{},...g?{license:g}:{}},receipt:pt(Boolean(g))}))}for(let u of[...i].sort((m,g)=>H(m.id,g.id))){let m=ce("example",u.id),g=gt(m,u.license,s);c.push(ft({id:m,kind:"example",title:u.title,description:u.description,...u.category?{category:u.category}:{},tags:u.tags??[],aliases:[u.id,u.title,...u.aliases??[]],capabilities:u.capabilities??[],dependencies:u.dependencies??[],source:{type:"example",id:u.id,...u.version?{version:u.version}:{},...u.sourceUrl?{url:u.sourceUrl}:{},...g?{license:g}:{}},receipt:pt(Boolean(g))}))}for(let u of[...o].sort((m,g)=>H(m.id,g.id))){let m=ce("skill",u.id),g=gt(m,void 0,s);c.push(ft({id:m,kind:"skill",title:u.title,description:u.description?.trim()||u.title,tags:[...u.tags??[],...u.triggers??[]],aliases:[u.id,u.title,...u.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:u.id,...u.version?{version:u.version}:{},...g?{license:g}:{}},receipt:pt(Boolean(g))}))}c.sort((u,m)=>H(u.id,m.id));let l=new Set;for(let u of c){if(l.has(u.id))throw new Ke("duplicate-resource-id",u.id);l.add(u.id)}for(let u of c)for(let m of u.dependencies)if(!l.has(m))throw new Ke("dangling-resource-dependency",`${u.id} -> ${m}`);let p=new Map;for(let u of c)for(let m of u.aliases){let g=_(m);if(!g)continue;let h=p.get(g)??new Set;h.add(u.id),p.set(g,h)}let d=Object.freeze(Object.fromEntries([...p.entries()].sort(([u],[m])=>H(u,m)).map(([u,m])=>[u,Object.freeze([...m].sort(H))]))),f=Object.freeze(c.map(cp));return Object.freeze({schemaVersion:ip,resources:f,aliases:d})}var pp=[["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],fp=Object.freeze(pp.map((e)=>Object.freeze([...e]))),os=new Map;for(let e of fp){let t=Object.freeze([...new Set(e.map(_).filter(Boolean))].sort());for(let r of t)os.set(r,t)}function Nn(e){let t=_(e);return os.get(t)??Object.freeze([t])}class ee extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var Fn=Object.freeze({"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),gp=Object.freeze(Object.keys(Fn)),ss=new Map(gp.map((e,t)=>[e,t])),as=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function G(e,t){return e<t?-1:e>t?1:0}function cs(e){return new Set((e??[]).map(_).filter(Boolean))}function $n(e,t){let r=cs(t);if(r.size===0)return!0;let n=cs(e);return[...r].some((i)=>n.has(i))}function mp(e,t){if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!$n(e.tags,t.tags))return!1;if(!$n(e.category?[e.category]:[],t.categories))return!1;if(!$n(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function hp(e){return Boolean(e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function le(e,t,r,n=Fn[t]){if(e.some((i)=>i.code===t&&i.value===r))return;e.push({code:t,value:r,score:n})}function Mn(e,t){return e.find((r)=>_(r)===t)}function _n(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities]}function yp(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(i,o)=>o);for(let i=1;i<=e.length;i+=1){let o=[i],s=i;for(let a=1;a<=t.length;a+=1){let c=(n[a-1]??r+1)+(e[i-1]===t[a-1]?0:1),l=Math.min((n[a]??r+1)+1,(o[a-1]??r+1)+1,c);o.push(l),s=Math.min(s,l)}if(s>r)return r+1;n=o}return n[t.length]??r+1}function bp(e,t){let r=_(t),n=[];if(_(e.id)===r)le(n,"exact-id",e.id);if(_(e.title)===r)le(n,"exact-title",e.title);let i=Mn(e.aliases,r);if(i)le(n,"alias",i);let o=Mn(e.tags,r);if(o)le(n,"tag",o);let s=Mn(e.capabilities,r);if(s)le(n,"capability",s);if(e.category&&_(e.category)===r)le(n,"category",e.category);if(!i){let l=Nn(r).filter((d)=>d!==r),p=new Set(_n(e).map(_));if(l.some((d)=>p.has(d)))le(n,"alias",t.trim())}let a=r.split(" ").filter(Boolean),c=_(_n(e).join(" "));if(a.length>0&&a.every((l)=>c.includes(l)))le(n,"token",t.trim());if(n.length===0&&r.length>=4){let l;for(let p of _n(e)){let d=_(p);if(d.length<4)continue;let f=yp(r,d,2);if(f<=2&&(!l||f<l.distance||f===l.distance&&G(p,l.value)<0))l={value:p,distance:f}}if(l)le(n,"fuzzy",l.value,Fn.fuzzy-l.distance)}return n.sort((l,p)=>{if(l.score!==p.score)return p.score-l.score;return(ss.get(l.code)??99)-(ss.get(p.code)??99)||G(l.value,p.value)})}function ls(e,t,r){if(t.has(r))return[r];let n=_(r),i=e.aliases[n];if(i?.length)return[...i];let o=new Set;for(let s of Nn(n))for(let a of e.aliases[s]??[])o.add(a);return[...o].sort(G)}function us(e,t){return new ee("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function ds(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let i=n.trim(),o=ls(e,t,i);if(o.length===0)throw new ee("resource-not-found",i);if(o.length>1)throw us(i,o);let s=o[0],a=s?t.get(s):void 0;if(!a)throw new ee("resource-not-found",i);return a}return Object.freeze({manifest:()=>e,search(n){let i=n.text?.trim()??"";if(!i&&!hp(n))throw new ee("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new ee("resource-query-invalid-limit",String(n.limit));let o=e.resources.filter((s)=>mp(s,n)).map((s)=>{let a=i?bp(s,i):[];return{resource:s,score:a.reduce((c,l)=>c+l.score,0),reasons:a}}).filter((s)=>!i||s.reasons.length>0).sort((s,a)=>a.score-s.score||G(s.resource.id,a.resource.id));return n.limit===void 0?o:o.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((f)=>!f.trim()))throw new ee("resource-query-empty","at least one build root is required");let i=[],o=new Set;for(let f of n){let u=f.trim(),m=ls(e,t,u);if(m.length===0)i.push({id:u,reason:"missing-resource"});else if(m.length>1)throw us(u,m);else{let g=m[0];if(g)o.add(g)}}let s=new Set,a=new Set,c=new Set,l=[],p=[],d=(f,u)=>{if(s.has(f))return;if(a.has(f)){i.push({id:f,...u?{requiredBy:u}:{},reason:"dependency-cycle"});return}let m=t.get(f);if(!m){i.push({id:f,...u?{requiredBy:u}:{},reason:"missing-resource"});return}a.add(f),c.add(f);let g=[...m.dependencies].sort((h,b)=>{let R=t.get(h),x=t.get(b);return(as.get(R?.kind??"")??99)-(as.get(x?.kind??"")??99)||G(h,b)});for(let h of g)p.push({from:f,to:h,relation:"depends-on"}),d(h,f);a.delete(f),s.add(f),l.push(f)};for(let f of[...o].sort(G))d(f);return{roots:[...o].sort(G),nodes:[...c].sort(G).map((f)=>{let u=t.get(f);if(!u)throw new ee("resource-not-found",f);return{id:f,kind:u.kind,maturity:u.receipt.maturity}}),edges:p.sort((f,u)=>G(f.from,u.from)||G(f.to,u.to)),order:l,gaps:i.sort((f,u)=>G(f.id,u.id)||G(f.requiredBy??"",u.requiredBy??"")||G(f.reason,u.reason))}}})}function wp(e){if(!e.name)throw Error("Artifact registry manifest requires a name");return e}async function vp(e,t){let r=await fetch(e,t?{headers:t}:{});if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return await r.json()}async function qn(e,t){let r=e.endsWith("/registry.json")?e:`${e.replace(/\/$/,"")}/registry.json`,n=await vp(r,t);return wp(n)}class Bn{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=qn(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).items.find((r)=>r.name===e)}}class Un{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}var Ep="uibot.artifacts.lock.json";function Ip(e){return ue(e,"components","registry")}function Pp(e){return ue(e,"templates","registry")}function Ap(e,t){if(e.kind==="component")return ue(t.componentsDir??Ip(t.workspaceRoot));return ue(t.templatesDir??Pp(t.workspaceRoot))}function Dp(e){return ue(e.workspaceRoot,e.lockfilePath??Ep)}function Op(e){try{return JSON.parse(Cp(e,"utf8"))}catch{return{version:1,artifacts:[]}}}function Tp(e,t){gs(jn(e),{recursive:!0}),ms(e,`${JSON.stringify(t,null,2)}
|
|
208
|
-
`,"utf8")}function
|
|
209
|
-
`),t=
|
|
210
|
-
`),r=
|
|
206
|
+
`):""}`}async function $o(e){let t=e.fetchImpl??globalThis.fetch,r=e.defaultLicense??"UNKNOWN",n=[],i=0,o=0,s;try{s=await _u(e.from,t)}catch(a){return{ok:!1,written:0,skipped:0,files:[],error:a instanceof Error?a.message:String(a)}}if(!e.dryRun)Mu(e.outDir,{recursive:!0});for(let a of s.fileUrls){let c;try{let m=await t(a,{headers:{"user-agent":"uibot-design-md-sync"}});if(!m.ok){o+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:`HTTP ${m.status}`});continue}c=await m.text()}catch(m){return{ok:!1,written:i,skipped:o,files:n,error:`Network failure fetching ${a}: ${m instanceof Error?m.message:String(m)}`}}let l=new TextEncoder().encode(c).byteLength;if(l>No){o+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:`exceeds ${No} bytes (${l})`});continue}let d=ju(c,{sourceUrl:a,license:r}),p;try{p=zt(d).id}catch(m){o+=1,n.push({id:a,path:"",sourceUrl:a,status:"skipped",reason:m instanceof Error?m.message:"invalid frontmatter"});continue}let f=`${p}.design.md`,u=hv(e.outDir,f);if(e.dryRun){n.push({id:p,path:u,sourceUrl:a,status:"dry-run"}),i+=1;continue}Mu(mv(u),{recursive:!0}),gv(u,d,"utf8"),i+=1,n.push({id:p,path:u,sourceUrl:a,status:"written"})}return{ok:!0,written:i,skipped:o,files:n}}var No=65536,yv;var qu=K(()=>{Yt();yv=/^github:([^/]+)\/([^/@]+)(?:\/(.+))?$/i});function Mo(e){let t=["---"];if(t.push(`id: ${Pe(e.id)}`),t.push(`title: ${Pe(e.title)}`),t.push(`category: ${Pe(e.category)}`),e.tags?.length)t.push(`tags: [${e.tags.map((r)=>Pe(r)).join(", ")}]`);if(e.origin)t.push(`origin: ${Pe(e.origin)}`);if(e.sourceUrl)t.push(`sourceUrl: ${Pe(e.sourceUrl)}`);if(e.exemptRules?.length)t.push(`exemptRules: [${e.exemptRules.map((r)=>Pe(r)).join(", ")}]`);if(e.layer)t.push(`layer: ${Pe(e.layer)}`);return t.push("---"),t.push(""),t.push(e.body?.trimEnd()??""),t.push(""),t.join(`
|
|
207
|
+
`)}function Pe(e){if(/^[\w.-]+$/.test(e))return e;return JSON.stringify(e)}var Bu=K(()=>{Yt()});var Rn=K(()=>{gi();Oo();To();Lo();Wt();Lu();Oo();$u();To();Lo();Do();Po();qu();Bu()});import{lstatSync as Dp,mkdirSync as Rs,readFileSync as Op,realpathSync as Tp,writeFileSync as Cs}from"fs";import{basename as Lp,dirname as zn,isAbsolute as Np,resolve as ue,sep as bs}from"path";function tr(e){let t=e.lockfilePath??"uibot.artifacts.lock.json",r=e.manifest.items??[],n=new Map;for(let s of r)n.set(s.name,s);if(e.lockfile===null)return{ok:!1,lockfilePath:t,registryName:e.manifest.name,lockCount:0,manifestCount:r.length,drifts:[{name:"*",kind:"missing-in-lock",detail:"lockfile missing or unreadable"}]};let i=[],o=new Set;for(let s of e.lockfile.artifacts??[]){o.add(s.name);let a=n.get(s.name);if(!a){i.push({name:s.name,kind:"missing-in-manifest",lockVersion:s.version,detail:`locked ${s.name}@${s.version} not present in registry manifest`});continue}let c=Ud(a);if(c&&c!==s.version)i.push({name:s.name,kind:"version-mismatch",lockVersion:s.version,manifestVersion:c,detail:`${s.name}: lock ${s.version} \u2260 registry ${c}`})}return{ok:i.length===0,lockfilePath:t,registryName:e.manifest.name,lockCount:(e.lockfile.artifacts??[]).length,manifestCount:r.length,drifts:i}}function Ud(e){return e.artifact?.version??e.version}import{readFileSync as Vd,realpathSync as os}from"fs";import{resolve as Ve,relative as Kd,dirname as Hd,extname as zd,sep as Mn}from"path";function Yd(e){if(e.endsWith(".css"))return"style";if(e.endsWith(".tsx")||e.endsWith(".jsx"))return"component";if(/(^|\/)use-[^/]+\.ts$/.test(e))return"hook";return"lib"}function _n(e){let t=e.readFile??((c)=>Vd(c,"utf8")),r=new Map,n=(c,l=Ve(e.sourceDir))=>{let d=Kd(l,Ve(c));if(d===".."||d.startsWith(`..${Mn}`)||d.startsWith(Mn))throw Error(`Block dependency outside sourceDir: ${c}`);return d.replaceAll(Mn,"/")},i=(c)=>{if(n(Ve(e.sourceDir,c)),!e.readFile)n(os(Ve(e.sourceDir,c)),os(e.sourceDir));let l=r.get(c);if(l!==void 0)return l;let d=t(Ve(e.sourceDir,c));return r.set(c,d),d},o=(c)=>{let l=new Map,d=(p)=>{if(l.has(p))return;let f=i(p);l.set(p,{path:p,type:Yd(p),content:f});let u=f.matchAll(/(?:\bfrom\s*|\bimport\s*)["'](\.[^"']+)["']/g);for(let m of u){let g=n(Ve(e.sourceDir,Hd(p),m[1]??"")),h=zd(g)?[g]:[`${g}.ts`,`${g}.tsx`,`${g}/index.ts`,`${g}/index.tsx`],b;for(let S of h)try{i(S),b=S;break}catch(k){if(k instanceof Error&&k.message.includes("outside sourceDir"))throw k}if(!b)throw Error(`Unresolved block dependency: ${p} -> ${m[1]}`);d(b)}};return d(c),[...l.values()]},s=(c)=>{let l=new Set;for(let d of c){if(typeof d.content!=="string")continue;for(let p of d.content.matchAll(/(?:\bfrom\s*|\bimport\s*)["']([^."'/][^"']*|@[^"']+)["']/g)){let f=p[1]??"";if(f.startsWith("node:"))continue;let u=f.startsWith("@")?f.split("/").slice(0,2).join("/"):f.split("/")[0]??"";if(u==="react"||u==="react-dom"||u.startsWith("@uibot/"))continue;l.add(u)}}return[...l].sort()},a=[];for(let c of Object.keys(e.catalog)){let l=e.blockFileMap[c];if(l===void 0)continue;let d=e.catalog[c];if(d===void 0)continue;let p=i(l),f=o(l),u=s(f);a.push({name:c,category:d.category,description:d.description,sourceCode:p,files:f,catalogEntry:d,...u.length>0?{dependencies:u}:{}})}return a}function ss(e){return e.flatMap((t)=>_n(t))}import{readdirSync as Gd,readFileSync as Wd,statSync as Jd}from"fs";import{basename as Qd,join as Xd}from"path";var Zd="0.1.0";function rr(e){let{dir:t}=e,r;try{r=Gd(t)}catch{return[]}let n=e.defaultVersion??Zd,i=e.defaultLevel??"L4",o=e.defaultCategory??"template",s=[];for(let a of r){if(!/\.ya?ml$/i.test(a))continue;let c=Xd(t,a);try{if(!Jd(c).isFile())continue}catch{continue}let l=Wd(c,"utf8");if(!l.trim())continue;let d=Qd(a).replace(/\.ya?ml$/i,""),p=ep(d),f=tp(d),u=rp(l)??`${f} template`;s.push({name:p,version:n,title:f,description:u,yaml:l,absolutePath:c,templateContract:{name:p,description:u,level:i,category:o,keywords:[p,d.toLowerCase(),"uibot-template",...e.extraKeywords??[]],composedFrom:np(l)}})}return s.sort((a,c)=>a.name.localeCompare(c.name))}function ft(e){let t=new Map;for(let r of e)for(let n of rr(r)){let i=t.get(n.name);if(i)throw Error(`duplicate template source name "${n.name}": ${i.absolutePath} and ${n.absolutePath}`);t.set(n.name,n)}return[...t.values()].sort((r,n)=>r.name.localeCompare(n.name))}function nr(e){return{kind:"template",name:e.name,version:e.version,files:[{path:`${e.name}.yaml`,type:"template",content:e.yaml,target:`${e.name}.yaml`}],templateContract:e.templateContract}}function Fn(e){return{name:e.name,kind:"template",title:e.title,description:e.description,artifact:nr(e)}}function ep(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function tp(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,(t)=>t.toUpperCase())}function rp(e){return(e.match(/^\s*title:\s*["']?(.+?)["']?\s*$/m)??e.match(/^\s*-\s*id:.*\n\s*path:.*\n\s*title:\s*["']?(.+?)["']?\s*$/m))?.[1]?.trim()}function np(e){let t=new Set;for(let r of e.matchAll(/^\s*-\s*type:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}for(let r of e.matchAll(/^\s*template:\s*["']?([^"'#\n]+?)["']?\s*$/gm)){let n=r[1]?.trim();if(n)t.add(n)}return[...t].sort()}var ip="0.1.0";function op(e,t={}){return{kind:"component",name:e.name,version:t.defaultVersion??ip,runtime:t.runtime??"react",files:e.files,...e.dependencies?{dependencies:e.dependencies}:{},...e.registryDependencies?{registryDependencies:e.registryDependencies}:{},...e.catalogEntry.tags?{tags:e.catalogEntry.tags}:{},catalogEntry:e.catalogEntry}}function sp(e,t={}){return{name:e.name,kind:"component",title:e.catalogEntry.name,description:e.description??e.catalogEntry.description,artifact:op(e,t)}}function as(e,t){let r={...t.runtime?{runtime:t.runtime}:{},...t.defaultVersion?{defaultVersion:t.defaultVersion}:{}},n=e.map((o)=>sp(o,r)),i=(t.templates??[]).map((o)=>Fn(o));return{name:t.name,items:[...n,...i]}}var lp={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},rP=Array.from(new Set(Object.values(lp).flat()));var ir=["component","template","design-guide","example","skill","block","package","theme"],gt=["experimental","candidate","recommended"],cs=["declared","verified","external-consumer"],or=["missing","declared","verified","external-consumer"],sr=["source","license","contract","states","accessibility","light-theme","dark-theme","responsive","dependency-closure","packed-install","typecheck","browser"],Ke=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var up=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],aP=[...up,"radius","font-display","font-body","font-mono"];var gA=new Set(sr),mA=new Set(or);var dp=/^(unknown|unlicensed|none|n\/?a)$/i;function jn(e){let t=e?.trim();if(!t||dp.test(t))return;return t}var pp="uibot.resource.index.v1";class ze extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceIndexError"}}function Y(e,t){return e<t?-1:e>t?1:0}function _(e){return e.normalize("NFKC").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").replace(/([\p{Ll}\p{N}])([\p{Lu}])/gu,"$1 $2").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim().replace(/\s+/g," ")}function fp(e){let t=_(e).replace(/ /g,"-");if(!t)throw new ze("invalid-resource-source-id",e);return t}function ce(e,t){return`${e}:${fp(t)}`}function ar(e){let t=new Map;for(let r of e){let n=r?.trim();if(!n)continue;let i=_(n);if(!i||t.has(i))continue;t.set(i,n)}return[...t.entries()].sort(([r],[n])=>Y(r,n)).map(([,r])=>r)}function mt(e){return{level:"declared",maturity:"experimental",checks:{source:"declared",license:e?"declared":"missing",contract:"declared",states:"missing",accessibility:"missing","light-theme":"missing","dark-theme":"missing",responsive:"missing","dependency-closure":"missing","packed-install":"missing",typecheck:"missing",browser:"missing"},evidence:[]}}function gp(e){let t=jn(e.license);return{type:e.type,id:e.id,...e.version?{version:e.version}:{},...e.url?{url:e.url}:{},...t?{license:t}:{}}}function He(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},tags:ar(e.tags),aliases:ar(e.aliases),capabilities:ar(e.capabilities),dependencies:[...new Set(e.dependencies)].sort(Y),source:gp(e.source),receipt:e.receipt}}function mp(e){return(e.body.split(/\r?\n/).map((r)=>r.replace(/^#+\s*/,"").trim()).find(Boolean)??e.title).slice(0,240)}function hp(e){return Object.freeze(e.tags),Object.freeze(e.aliases),Object.freeze(e.capabilities),Object.freeze(e.dependencies),Object.freeze(e.source),Object.freeze(e.receipt.checks),Object.freeze(e.receipt.evidence),Object.freeze(e.receipt),Object.freeze(e)}function yp(e){let t=new Map;for(let r of Object.keys(e).sort(Y)){let n=e[r];if(!n)continue;let i=ce("component",r);for(let o of ar([r,n.name])){let s=_(o),a=t.get(s)??[];if(!a.includes(i))a.push(i);t.set(s,a.sort(Y))}}return t}function bp(e,t,r){let n=r.get(_(e))??[];if(n.length===0)throw new ze("dangling-resource-dependency",`${t} -> ${ce("component",e)}`);if(n.length>1)throw new ze("ambiguous-resource-dependency",`${t} -> ${e}: ${n.join(",")}`);return n[0]}function Sp(e,t,r,n){let i=e.startsWith("template:")?e.slice(9):e;if(Object.hasOwn(n,i))return ce("template",i);return bp(e,t,r)}function ht(e,t,r){return jn(r?.[e]??t)}function ls(e){return Object.entries(e).filter(([,t])=>t.level==="L4").sort(([t],[r])=>Y(t,r)).map(([t,r])=>({id:`${t}-example`,title:`${r.name} Example`,description:r.description,category:r.category,tags:r.keywords,aliases:[`${t} example`,`${r.name} example`],capabilities:["example:template"],dependencies:[ce("template",t)]}))}function us(e){let t=e.components??{},r=e.templates??{},n=e.designGuides??[],i=e.examples??[],o=e.skills??[],s=e.licenses,a=yp(t),c=[];for(let u of Object.keys(t).sort(Y)){let m=t[u];if(!m)continue;let g=ce("component",u),h=ht(g,void 0,s);c.push(He({id:g,kind:"component",title:m.name,description:m.description,category:m.category,tags:m.tags??[],aliases:[u,m.name],capabilities:["catalog:component"],dependencies:[],source:{type:"catalog",id:u,...h?{license:h}:{}},receipt:mt(Boolean(h))}))}for(let u of Object.keys(r).sort(Y)){let m=r[u];if(!m)continue;let g=ce("template",u),h=ht(g,void 0,s);c.push(He({id:g,kind:"template",title:m.name,description:m.description,category:m.category,tags:m.keywords,aliases:[u,m.name],capabilities:[],dependencies:(m.composedFrom??[]).map((b)=>Sp(b,g,a,r)),source:{type:"template-contract",id:u,...h?{license:h}:{}},receipt:mt(Boolean(h))}))}for(let u of[...n].sort((m,g)=>Y(m.id,g.id))){let m=ce("design-guide",u.id),g=ht(m,void 0,s);c.push(He({id:m,kind:"design-guide",title:u.title,description:mp(u),category:u.category,tags:u.tags,aliases:[u.id,u.title],capabilities:["designMd:source"],dependencies:[],source:{type:"design-md",id:u.id,...u.sourceUrl?{url:u.sourceUrl}:{},...g?{license:g}:{}},receipt:mt(Boolean(g))}))}for(let u of[...i].sort((m,g)=>Y(m.id,g.id))){let m=ce("example",u.id),g=ht(m,u.license,s);c.push(He({id:m,kind:"example",title:u.title,description:u.description,...u.category?{category:u.category}:{},tags:u.tags??[],aliases:[u.id,u.title,...u.aliases??[]],capabilities:u.capabilities??[],dependencies:u.dependencies??[],source:{type:"example",id:u.id,...u.version?{version:u.version}:{},...u.sourceUrl?{url:u.sourceUrl}:{},...g?{license:g}:{}},receipt:mt(Boolean(g))}))}for(let u of[...o].sort((m,g)=>Y(m.id,g.id))){let m=ce("skill",u.id),g=ht(m,void 0,s);c.push(He({id:m,kind:"skill",title:u.title,description:u.description?.trim()||u.title,tags:[...u.tags??[],...u.triggers??[]],aliases:[u.id,u.title,...u.triggers??[]],capabilities:["skill:definition"],dependencies:[],source:{type:"skill",id:u.id,...u.version?{version:u.version}:{},...g?{license:g}:{}},receipt:mt(Boolean(g))}))}for(let u of e.additional??[])c.push(He(u));c.sort((u,m)=>Y(u.id,m.id));let l=new Set;for(let u of c){if(l.has(u.id))throw new ze("duplicate-resource-id",u.id);l.add(u.id)}for(let u of c)for(let m of u.dependencies)if(!l.has(m))throw new ze("dangling-resource-dependency",`${u.id} -> ${m}`);let d=new Map;for(let u of c)for(let m of u.aliases){let g=_(m);if(!g)continue;let h=d.get(g)??new Set;h.add(u.id),d.set(g,h)}let p=Object.freeze(Object.fromEntries([...d.entries()].sort(([u],[m])=>Y(u,m)).map(([u,m])=>[u,Object.freeze([...m].sort(Y))]))),f=Object.freeze(c.map(hp));return Object.freeze({schemaVersion:pp,resources:f,aliases:p})}var Rp=[["data table","data grid","datatable","table","\u8868\u683C","\u6570\u636E\u8868","\u6570\u636E\u8868\u683C"],["button","action button","\u6309\u94AE","\u64CD\u4F5C\u6309\u94AE"],["dashboard","admin dashboard","\u4EEA\u8868\u76D8","\u540E\u53F0","\u7BA1\u7406\u540E\u53F0"],["kanban","kanban board","\u770B\u677F","\u4EFB\u52A1\u770B\u677F"],["form","input form","\u8868\u5355","\u8F93\u5165\u8868\u5355"],["navigation","nav","sidebar","\u5BFC\u822A","\u4FA7\u8FB9\u680F"]],Cp=Object.freeze(Rp.map((e)=>Object.freeze([...e]))),ds=new Map;for(let e of Cp){let t=Object.freeze([...new Set(e.map(_).filter(Boolean))].sort());for(let r of t)ds.set(r,t)}function qn(e){let t=_(e);return ds.get(t)??Object.freeze([t])}class H extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceQueryError"}}var Kn=Object.freeze({"exact-id":1000,"exact-title":900,alias:800,tag:600,capability:500,category:400,token:200,fuzzy:100}),kp=Object.freeze(Object.keys(Kn)),ps=new Map(kp.map((e,t)=>[e,t])),fs=new Map([["component",0],["template",1],["design-guide",2],["example",3],["skill",4]]);function G(e,t){return e<t?-1:e>t?1:0}function gs(e){return new Set((e??[]).map(_).filter(Boolean))}function Bn(e,t){let r=gs(t);if(r.size===0)return!0;let n=gs(e);return[...r].some((i)=>n.has(i))}function wp(e,t){if(t.kinds?.length&&!t.kinds.includes(e.kind))return!1;if(!Bn(e.tags,t.tags))return!1;if(!Bn(e.category?[e.category]:[],t.categories))return!1;if(!Bn(e.capabilities,t.capabilities))return!1;if(t.maturities?.length&&!t.maturities.includes(e.receipt.maturity))return!1;return!0}function xp(e){return Boolean(e.kinds?.length||e.tags?.length||e.categories?.length||e.capabilities?.length||e.maturities?.length)}function le(e,t,r,n=Kn[t]){if(e.some((i)=>i.code===t&&i.value===r))return;e.push({code:t,value:r,score:n})}function Un(e,t){return e.find((r)=>_(r)===t)}function Vn(e){return[e.id,e.title,...e.aliases,...e.tags,...e.category?[e.category]:[],...e.capabilities]}function vp(e,t,r){if(Math.abs(e.length-t.length)>r)return r+1;let n=Array.from({length:t.length+1},(i,o)=>o);for(let i=1;i<=e.length;i+=1){let o=[i],s=i;for(let a=1;a<=t.length;a+=1){let c=(n[a-1]??r+1)+(e[i-1]===t[a-1]?0:1),l=Math.min((n[a]??r+1)+1,(o[a-1]??r+1)+1,c);o.push(l),s=Math.min(s,l)}if(s>r)return r+1;n=o}return n[t.length]??r+1}function Ep(e,t){let r=_(t),n=[];if(_(e.id)===r)le(n,"exact-id",e.id);if(_(e.title)===r)le(n,"exact-title",e.title);let i=Un(e.aliases,r);if(i)le(n,"alias",i);let o=Un(e.tags,r);if(o)le(n,"tag",o);let s=Un(e.capabilities,r);if(s)le(n,"capability",s);if(e.category&&_(e.category)===r)le(n,"category",e.category);if(!i){let l=qn(r).filter((p)=>p!==r),d=new Set(Vn(e).map(_));if(l.some((p)=>d.has(p)))le(n,"alias",t.trim())}let a=r.split(" ").filter(Boolean),c=_(Vn(e).join(" "));if(a.length>0&&a.every((l)=>c.includes(l)))le(n,"token",t.trim());if(n.length===0&&r.length>=4){let l;for(let d of Vn(e)){let p=_(d);if(p.length<4)continue;let f=vp(r,p,2);if(f<=2&&(!l||f<l.distance||f===l.distance&&G(d,l.value)<0))l={value:d,distance:f}}if(l)le(n,"fuzzy",l.value,Kn.fuzzy-l.distance)}return n.sort((l,d)=>{if(l.score!==d.score)return d.score-l.score;return(ps.get(l.code)??99)-(ps.get(d.code)??99)||G(l.value,d.value)})}function ms(e,t,r){if(t.has(r))return[r];let n=_(r),i=e.aliases[n];if(i?.length)return[...i];let o=new Set;for(let s of qn(n))for(let a of e.aliases[s]??[])o.add(a);return[...o].sort(G)}function hs(e,t){return new H("resource-alias-ambiguous",`${e.trim()}: ${t.join(",")}`)}function cr(e){let t=new Map(e.resources.map((n)=>[n.id,n]));function r(n){let i=n.trim(),o=ms(e,t,i);if(o.length===0)throw new H("resource-not-found",i);if(o.length>1)throw hs(i,o);let s=o[0],a=s?t.get(s):void 0;if(!a)throw new H("resource-not-found",i);return a}return Object.freeze({manifest:()=>e,search(n){let i=n.text?.trim()??"";if(!i&&!xp(n))throw new H("resource-query-empty","text or filter is required");if(n.limit!==void 0&&(!Number.isInteger(n.limit)||n.limit<=0))throw new H("resource-query-invalid-limit",String(n.limit));let o=e.resources.filter((s)=>wp(s,n)).map((s)=>{let a=i?Ep(s,i):[];return{resource:s,score:a.reduce((c,l)=>c+l.score,0),reasons:a}}).filter((s)=>!i||s.reasons.length>0).sort((s,a)=>a.score-s.score||G(s.resource.id,a.resource.id));return n.limit===void 0?o:o.slice(0,n.limit)},get:r,build(n){if(n.length===0||n.every((f)=>!f.trim()))throw new H("resource-query-empty","at least one build root is required");let i=[],o=new Set;for(let f of n){let u=f.trim(),m=ms(e,t,u);if(m.length===0)i.push({id:u,reason:"missing-resource"});else if(m.length>1)throw hs(u,m);else{let g=m[0];if(g)o.add(g)}}let s=new Set,a=new Set,c=new Set,l=[],d=[],p=(f,u)=>{if(s.has(f))return;if(a.has(f)){i.push({id:f,...u?{requiredBy:u}:{},reason:"dependency-cycle"});return}let m=t.get(f);if(!m){i.push({id:f,...u?{requiredBy:u}:{},reason:"missing-resource"});return}a.add(f),c.add(f);let g=[...m.dependencies].sort((h,b)=>{let S=t.get(h),k=t.get(b);return(fs.get(S?.kind??"")??99)-(fs.get(k?.kind??"")??99)||G(h,b)});for(let h of g)d.push({from:f,to:h,relation:"depends-on"}),p(h,f);a.delete(f),s.add(f),l.push(f)};for(let f of[...o].sort(G))p(f);return{roots:[...o].sort(G),nodes:[...c].sort(G).map((f)=>{let u=t.get(f);if(!u)throw new H("resource-not-found",f);return{id:f,kind:u.kind,maturity:u.receipt.maturity}}),edges:d.sort((f,u)=>G(f.from,u.from)||G(f.to,u.to)),order:l,gaps:i.sort((f,u)=>G(f.id,u.id)||G(f.requiredBy??"",u.requiredBy??"")||G(f.reason,u.reason))}}})}function lr(e){if(!e||typeof e!=="object")throw Error("invalid-public-resource-bundle");Ap(e);let t=e;if(t.schemaVersion!=="uibot.public-resources.v1"||typeof t.release?.version!=="string"||!/^[a-f0-9]{64}$/.test(t.release?.sourceHash)||t.index?.schemaVersion!=="uibot.resource.index.v1"||!Array.isArray(t.index.resources)||!t.index.aliases||!t.showcases)throw Error("invalid-public-resource-bundle");if(t.documents&&(!Array.isArray(t.documents)||t.documents.some((n)=>typeof n.title!=="string"||typeof n.markdown!=="string"||!/^\/(?:en\/)?docs\/[a-z0-9-]+$/.test(n.path))))throw Error("invalid-public-documentation");let r=new Set;for(let n of t.index.resources){if(!n||typeof n.id!=="string"||r.has(n.id)||!ir.includes(n.kind)||!n.id.startsWith(`${n.kind}:`)||typeof n.description!=="string"||typeof n.title!=="string"||!Array.isArray(n.dependencies)||!n.source||!n.receipt||!Array.isArray(n.aliases)||!Array.isArray(n.tags)||!Array.isArray(n.capabilities)||![n.aliases,n.dependencies,n.tags,n.capabilities].every((o)=>o.every((s)=>typeof s==="string"&&s.length<=1000))||!["catalog","template-contract","design-md","example","skill","registry","package","theme"].includes(n.source.type)||typeof n.source.id!=="string"||!gt.includes(n.receipt.maturity)||!cs.includes(n.receipt.level)||!Array.isArray(n.receipt.evidence)||!n.receipt.evidence.every((o)=>typeof o==="string")||!sr.every((o)=>or.includes(n.receipt.checks?.[o])))throw Error("invalid-public-resource");r.add(n.id);let i=t.showcases[n.id];if(!i||i.resourceId!==n.id||typeof i.docs?.zh!=="string"||typeof i.docs?.en!=="string"||!Array.isArray(i.examples)||!Array.isArray(i.distributions))throw Error("invalid-resource-showcase");if(typeof i.title?.zh!=="string"||typeof i.title?.en!=="string"||i.examples.some((o)=>!o||typeof o.id!=="string"||typeof o.title!=="string"||typeof o.code!=="string"||!["spec","tsx","source"].includes(o.mode)||!["tsx","json","yaml","css","ts"].includes(o.language)||!Array.isArray(o.dependencies)||!o.dependencies.every((s)=>typeof s==="string"))||i.distributions.some((o)=>!o||!["spec","npm","shadcn"].includes(o.channel)||typeof o.name!=="string"||!/^[@a-zA-Z0-9._/-]+$/.test(o.name)||typeof o.version!=="string"||!["source","published"].includes(o.availability)))throw Error("invalid-resource-content")}for(let[n,i]of Object.entries(t.index.aliases))if(!n||!Array.isArray(i)||i.some((o)=>!r.has(o)))throw Error("invalid-public-resource-alias");if(Object.keys(t.showcases).some((n)=>!r.has(n)))throw Error("unexpected-public-resource-showcase");for(let n of t.index.resources)for(let i of n.dependencies)if(!r.has(i))throw Error("invalid-public-resource-dependency")}function Hn(e){lr(e),e=JSON.parse(JSON.stringify(e));let t=(i)=>{if(i&&typeof i==="object"){for(let o of Object.values(i))t(o);Object.freeze(i)}};t(e);let r=cr(e.index),n=(i)=>{let o=r.get(i),s=e.showcases[o.id];if(!s)throw new H("resource-not-found",o.id);return s};return Object.freeze({...r,docs(i,o="zh",s=1){if(o!=="zh"&&o!=="en")throw Error("unsupported-resource-locale");let a=n(i);return{resourceId:a.resourceId,locale:o,...Ip(a.docs[o],s),release:e.release}},examples(i,o=1){let s=n(i);return{resourceId:s.resourceId,...Pp(s.examples,o),release:e.release}},installPlan(i){let o=n(i);return{resourceId:o.resourceId,distributions:o.distributions,dependencies:r.build([o.resourceId]),release:e.release}}})}var he=24000;function ys(e,t){if(!Number.isSafeInteger(e)||e<1||e>Math.max(1,t))throw new H("resource-query-invalid-limit","page is outside the available range")}function Ip(e,t){let r=Math.max(1,Math.ceil(e.length/he));return ys(t,r),{markdown:e.slice((t-1)*he,t*he),page:t,totalPages:r,...t<r?{nextPage:t+1}:{}}}function Pp(e,t){let r=e.flatMap((n)=>Array.from({length:Math.max(1,Math.ceil(n.code.length/he))},(i,o)=>({...n,code:n.code.slice(o*he,(o+1)*he),codeOffset:o*he,codeLength:n.code.length,complete:n.code.length<=he})));return ys(t,r.length),{examples:r.slice(t-1,t),page:t,totalPages:r.length,...t<r.length?{nextPage:t+1}:{}}}function Ap(e){let t=0,r=0,n=new Set,i=(o,s)=>{if(++t>300000||s>64)throw Error("public-resource-budget-exceeded");if(typeof o==="string"){if(r+=new TextEncoder().encode(o).length,r>16777216)throw Error("public-resource-budget-exceeded")}else if(o&&typeof o==="object"){if(n.has(o))throw Error("invalid-public-resource-cycle");let a=Object.getPrototypeOf(o);if(!Array.isArray(o)&&a!==Object.prototype&&a!==null)throw Error("invalid-public-resource-object");n.add(o);for(let[c,l]of Object.entries(o))i(c,s+1),i(l,s+1);n.delete(o)}else if(o!==null&&typeof o!=="boolean"&&(typeof o!=="number"||!Number.isFinite(o)))throw Error("invalid-public-resource-json")};i(e,1)}function $p(e){if(!e.name)throw Error("Artifact registry manifest requires a name");return e}async function Mp(e,t){let r=await fetch(e,t?{headers:t}:{});if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return await r.json()}async function Yn(e,t){let r=e.endsWith("/registry.json")?e:`${e.replace(/\/$/,"")}/registry.json`,n=await Mp(r,t);return $p(n)}class Gn{options;id;priority;manifestPromise;constructor(e){this.options=e;this.id=e.id??e.registryUrl,this.priority=e.priority}getManifest(){return this.manifestPromise??=Yn(this.options.registryUrl,this.options.headers),this.manifestPromise}async get(e){return(await this.getManifest()).items.find((r)=>r.name===e)}}class Wn{sources;constructor(e){this.sources=e}async resolve(e){let t=[...this.sources].sort((r,n)=>r.priority-n.priority);for(let r of t){let n=await r.get(e);if(n)return n}return}}var _p="uibot.artifacts.lock.json";function Fp(e){return ue(e,"components","registry")}function jp(e){return ue(e,"templates","registry")}function qp(e,t){if(e.kind==="component")return ue(t.componentsDir??Fp(t.workspaceRoot));return ue(t.templatesDir??jp(t.workspaceRoot))}function Bp(e){return ue(e.workspaceRoot,e.lockfilePath??_p)}function Up(e){try{return JSON.parse(Op(e,"utf8"))}catch{return{version:1,artifacts:[]}}}function Vp(e,t){Rs(zn(e),{recursive:!0}),Cs(e,`${JSON.stringify(t,null,2)}
|
|
208
|
+
`,"utf8")}function Kp(e,t){return{version:1,artifacts:[...e.artifacts.filter((n)=>n.name!==t.name),t].sort((n,i)=>n.name.localeCompare(i.name))}}function Hp(e){if(e.kind==="component")return{components:{[e.name]:e.catalogEntry}};return{templates:{[e.name]:e.templateContract}}}class Oe extends Error{artifactName;offendingPath;baseDir;constructor(e,t,r){super(`Artifact "${e}" file path escapes workspace: "${t}" resolves outside "${r}"`);this.artifactName=e;this.offendingPath=t;this.baseDir=r;this.name="ArtifactContainmentError"}}function ks(e,t){let r=t.endsWith(bs)?t:t+bs;return e===t||e.startsWith(r)}function Ss(e){let t=ue(e),r=[];while(!0)try{return Dp(t),ue(Tp(t),...r)}catch(n){if(n.code!=="ENOENT")throw n;let i=zn(t);if(i===t)throw n;r.unshift(Lp(t)),t=i}}function ws(e,t,r,n){try{let i=Ss(t),o=Ss(e);if(!ks(o,i))throw new Oe(r,n,t)}catch(i){if(i instanceof Oe)throw i;throw new Oe(r,n,t)}}function de(e,t,r){if(e.includes("\x00"))throw new Oe(r,e,t);if(Np(e))throw new Oe(r,e,t);let n=ue(t,e);if(!ks(n,t))throw new Oe(r,e,t);return ws(n,t,r,e),n}function zp(e,t){let r=[];for(let n of e.files){let i=n.target??n.path;r.push(de(i,t,e.name))}return r}function ur(e,t){let r=ue(t.workspaceRoot),n=qp(e,t);ws(n,r,e.name,n);let i=de(e.name,n,e.name),o=zp(e,i),s=[];for(let p=0;p<e.files.length;p++){let f=e.files[p],u=o[p];Rs(zn(u),{recursive:!0}),Cs(u,f.content??"","utf8"),s.push(u)}let a={name:e.name,version:e.version,source:t.source??"registry",installedAt:new Date().toISOString()},c=Bp(t),l=Up(c),d=Kp(l,a);return Vp(c,d),{artifactLock:a,catalogPatch:Hp(e),writtenFiles:s}}var Yp={string:"value","positive-integer":"n","resource-kind":"kind","resource-maturity":"maturity"};function Gp(e){let t=e.positionals.map((n)=>{let i=`${n.name}${"variadic"in n&&n.variadic?"...":""}`;return n.required?`<${i}>`:`[${i}]`}),r=e.options.map((n)=>`[--${n.name} <${Yp[n.type]}${"cliEncoding"in n&&n.cliEncoding==="comma-separated"?",...":""}>]`);return[e.name,...t,...r,"[--mode <text|json>]","[--dense]"].join(" ")}var Wp=Ke.map((e)=>({name:e.name,usage:Gp(e),summary:e.summary,group:"resources"})),Jp=[...Wp,{name:"list",usage:"list [--registry <url>]",summary:"List installable artifact registry entries.",group:"artifacts"},{name:"add",usage:"add <name> [--registry <url>] [--cwd <dir>]",summary:"Install an artifact and its registry dependencies.",group:"artifacts"},{name:"publish",usage:"publish [--out <dir>] [--name <manifest-name>]",summary:"Publish the built-in artifact registry to a directory.",group:"artifacts"},{name:"design-md sync",usage:"design-md sync --from <github:owner/repo|https-url> [--cwd <dir>] [--mode json]",summary:"Pull remote design-md with source and license stamps.",group:"design"},{name:"regressions reverify",usage:"regressions reverify [--cwd <dir>] [--skill <id>] [--mode json]",summary:"Re-run resolved regressions and reactivate failures.",group:"skills"},{name:"skills promote",usage:"skills promote <id> [--cwd <dir>] [--mode json]",summary:"Mark a skill promoted and append its usage receipt.",group:"skills"},{name:"skills rollback",usage:"skills rollback <id> [--cwd <dir>] [--mode json]",summary:"Roll back a promoted skill marker with a usage receipt.",group:"skills"},{name:"project export",usage:"project export <dir> [--cwd <dir>] [--mode json]",summary:"Copy project-local .uibot state to a directory.",group:"project"},{name:"link",usage:"link --spec-dir <relative-dir> [--source-dir <dir>] [--cwd <dir>] [--force] [--mode json]",summary:"Register consumer Spec dir + digest pin (L2 Linked).",group:"linked"},{name:"sync push",usage:"sync push [--from <dir>] [--cwd <dir>] [--mode json]",summary:"Copy YAML Spec + lock digest from sourceDir into consumer.",group:"linked"},{name:"sync pull",usage:"sync pull [--to <dir>] [--cwd <dir>] [--mode json]",summary:"Copy YAML Spec from consumer back to sourceDir.",group:"linked"},{name:"doctor",usage:"doctor [--cwd <dir>] [--registry <url>] [--mode json]",summary:"Compare the artifact lockfile with its registry.",group:"diagnostics"},{name:"init",usage:"init <dir> [--template <name>] | init --into <existing-app> [--force] [--mode json]",summary:"Scaffold a project, or L1 Embed recipe into an existing app.",group:"project"}],xs=Object.freeze(Jp.map((e)=>Object.freeze(e))),Qp=["--mode <text|json> Structured output mode for resource commands.","--dense Compact resource payloads without changing ids/order/codes.","--source <url> Query an explicit versioned public resource bundle (HTTPS or loopback).","--registry <url> Artifact registry base URL.","--cwd <dir> Workspace root (default: cwd).","--out <dir> Output directory for publish.","--from <src> Remote source for design-md sync, or local Spec source for sync push.","--to <dir> Local Spec destination for sync pull.","--spec-dir <dir> Relative consumer Spec directory for link.","--source-dir <dir> Local studio/CP Spec directory recorded by link.","--control-plane-url <url> Hosted CP base URL for remote Spec sync (no secrets).","--project-id <id> Remote Spec project id (default: default).","--force Overwrite existing .uibot/link.json or init --into files.","--into <dir> Existing app root for L1 Embed scaffold (requires package.json).","--spec-path <rel> Relative Spec YAML path for init --into (default: src/pages/home.uibot.yaml).","--mount-path <rel> Relative mount snippet path for init --into.","--template <name> Template name for greenfield init."];function Jn(){let e=xs.map((n)=>` uibot ${n.usage}`).join(`
|
|
209
|
+
`),t=xs.map((n)=>` ${n.name.padEnd(22)} ${n.summary}`).join(`
|
|
210
|
+
`),r=Qp.map((n)=>` ${n}`).join(`
|
|
211
211
|
`);return`uibot \u2014 UIBot resource and artifact CLI
|
|
212
212
|
|
|
213
213
|
Usage:
|
|
@@ -218,17 +218,17 @@ ${t}
|
|
|
218
218
|
|
|
219
219
|
Flags:
|
|
220
220
|
${r}
|
|
221
|
-
`}var
|
|
222
|
-
`,"utf8"),n.push(i);for(let o of t.items){let s=
|
|
223
|
-
`,"utf8"),n.push(s)}return n}async function
|
|
224
|
-
`,"utf-8")}list(e){let t=
|
|
225
|
-
`).filter(Boolean).map((r)=>{try{return JSON.parse(r)}catch{return null}}).filter((r)=>r!==null)}catch{return[]}}active(e){return this.list(e).filter((t)=>t.status==="active")}markResolved(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),o=new Date().toISOString(),s=n.map((c)=>{if(i.has(c.id)&&c.status==="active")return{...c,status:"resolved",resolvedBy:r,resolvedAt:o};return c}),a=
|
|
221
|
+
`}var dr="http://127.0.0.1:3202/api/registry";async function vs(e,t){if(!e)throw Error("uibot add: missing artifact name");let r=t.registry??dr,n=t.log??((l)=>console.log(l)),i=t.sources??[new Gn({registryUrl:r,priority:0})],o=new Wn(i),s=[],a=new Set,c=[e];while(c.length>0){let l=c.shift();if(a.has(l))continue;a.add(l);let d=await o.resolve(l);if(!d)throw Error(`Artifact '${l}' not found in ${r}`);let p=ur(d.artifact,{workspaceRoot:t.workspaceRoot,source:r});s.push({name:d.artifact.name,version:d.artifact.version,files:p.writtenFiles.length});let f=d.artifact.kind==="template"?"template":"component";n(`Installed ${f} ${d.artifact.name}@${d.artifact.version} \u2192 ${p.writtenFiles.length} files`);let u=d.artifact.kind==="component"?d.artifact.registryDependencies:void 0;for(let m of u??[])if(!a.has(m))c.push(m)}return{installed:s}}async function Es(e={}){let t=e.registry??dr,r=e.fetchManifest??((o)=>Yn(o)),n=e.log??((o)=>console.log(o)),i=await r(t);for(let o of i.items)n(`${o.name} ${o.kind} ${o.title??""}`);return i}import{mkdirSync as Xp,writeFileSync as Is}from"fs";import{resolve as Qn}from"path";function Zp(e,t){let r=Qn(e,"artifacts");Xp(r,{recursive:!0});let n=[],i=Qn(e,"registry.json");Is(i,`${JSON.stringify(t,null,2)}
|
|
222
|
+
`,"utf8"),n.push(i);for(let o of t.items){let s=Qn(r,`${o.name}.json`);Is(s,`${JSON.stringify(o,null,2)}
|
|
223
|
+
`,"utf8"),n.push(s)}return n}async function Ps(e){let t=e.log??((o)=>console.log(o)),r=e.sources;if(!r){if(!e.blockFileMap||!e.catalog||!e.sourceDir)throw Error("uibot publish: provide either `sources` or `blockFileMap` + `catalog` + `sourceDir`");r=_n({sourceDir:e.sourceDir,blockFileMap:e.blockFileMap,catalog:e.catalog,...e.readFile?{readFile:e.readFile}:{}})}let n=as(r,{name:e.manifestName??"local",...e.templates?.length?{templates:e.templates}:{}}),i=[];if(e.writeArtifacts)e.writeArtifacts(e.out,n);else i.push(...Zp(e.out,n));return t(`Published ${n.items.length} artifacts \u2192 ${e.out}`),{manifest:n,writtenFiles:i}}Rn();import{join as xv}from"path";async function Uu(e){let t=e.cwd??process.cwd(),r=xv(t,".uibot","design-md"),n=await $o({from:e.from,outDir:r,...e.license?{defaultLicense:e.license}:{},...e.dryRun?{dryRun:!0}:{}});if(e.mode==="json")console.log(JSON.stringify(n,null,2));else if(!n.ok)console.error(`uibot design-md sync: ${n.error??"failed"}`);else{console.log(`synced ${n.written} file(s) \u2192 ${r}`+(n.skipped?` (skipped ${n.skipped})`:""));for(let i of n.files)if(i.status==="written"||i.status==="dry-run")console.log(` + ${i.id} \u2190 ${i.sourceUrl}`);else console.log(` - skip ${i.sourceUrl}: ${i.reason??""}`)}return{code:n.ok?0:1,result:n}}import{readdirSync as Gv,existsSync as Xu,readFileSync as Wv}from"fs";import{join as Zu}from"path";mn();import{fileURLToPath as Pv}from"url";var Av=Pv(new URL("../content",import.meta.url));import{appendFileSync as Ov,existsSync as Vu,mkdirSync as Tv,readFileSync as Lv,writeFileSync as Ku}from"fs";import{join as Hu}from"path";function zu(e,t){return Hu(e,".uibot","skills",t)}function Cn(e,t){return Hu(zu(e,t),"regressions.jsonl")}class kn{options;constructor(e){this.options=e}append(e){let t=zu(this.options.rootDir,e.skillId);if(!Vu(t))Tv(t,{recursive:!0});Ov(Cn(this.options.rootDir,e.skillId),JSON.stringify(e)+`
|
|
224
|
+
`,"utf-8")}list(e){let t=Cn(this.options.rootDir,e);if(!Vu(t))return[];try{return Lv(t,"utf-8").split(`
|
|
225
|
+
`).filter(Boolean).map((r)=>{try{return JSON.parse(r)}catch{return null}}).filter((r)=>r!==null)}catch{return[]}}active(e){return this.list(e).filter((t)=>t.status==="active")}markResolved(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),o=new Date().toISOString(),s=n.map((c)=>{if(i.has(c.id)&&c.status==="active")return{...c,status:"resolved",resolvedBy:r,resolvedAt:o};return c}),a=Cn(this.options.rootDir,e);Ku(a,s.map((c)=>JSON.stringify(c)).join(`
|
|
226
226
|
`)+`
|
|
227
|
-
`,"utf-8")}markActive(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),o=new Date().toISOString(),s=n.map((c)=>{if(i.has(c.id)&&c.status==="resolved")return{...c,status:"active",context:[c.context,`reactivated@${o}: ${r}`].filter(Boolean).join(" | ")};return c}),a=
|
|
227
|
+
`,"utf-8")}markActive(e,t,r){if(t.length===0)return;let n=this.list(e);if(n.length===0)return;let i=new Set(t),o=new Date().toISOString(),s=n.map((c)=>{if(i.has(c.id)&&c.status==="resolved")return{...c,status:"active",context:[c.context,`reactivated@${o}: ${r}`].filter(Boolean).join(" | ")};return c}),a=Cn(this.options.rootDir,e);Ku(a,s.map((c)=>JSON.stringify(c)).join(`
|
|
228
228
|
`)+`
|
|
229
|
-
`,"utf-8")}resolved(e){return this.list(e).filter((t)=>t.status==="resolved")}}
|
|
230
|
-
`).filter((u)=>u.trim().length>0).map((u)=>u.match(/^(\s*)/)?.[1]?.length??0),o=i.length>0?Math.max(...i):0,s=Math.min(1,o/12),a=
|
|
231
|
-
`,"utf8")}function
|
|
229
|
+
`,"utf-8")}resolved(e){return this.list(e).filter((t)=>t.status==="resolved")}}gi();import{createHash as _v}from"crypto";function at(e,t){return _v("sha256").update(JSON.stringify([e,t])).digest("hex")}function _o(e){return typeof e==="number"&&Number.isFinite(e)&&e>=0&&e<=1}var Fv=new Set(["rule-scan","structural-heuristic","model-text","model-screenshot","legacy-provider","unassessed"]),jv=new Set(["empty-input","invalid-score","provider-failed","provider-not-run","invalid-evidence","screenshot-unavailable","timeout"]);async function Yu(e,t,r){let n=at(t,r),i=(o)=>({status:"unavailable",method:"unassessed",subjectHash:n,reason:o});if(!t.trim())return i("empty-input");try{if(e.evaluate){let s=await e.evaluate(t,r);if(!s||s.subjectHash!==n||!Fv.has(s.method))return i("invalid-evidence");if(s.status==="scored"&&s.method!=="unassessed"&&_o(s.score))return{status:"scored",method:s.method,subjectHash:n,score:s.score};if(s.status==="unavailable"&&s.score===void 0&&jv.has(s.reason))return{status:"unavailable",method:s.method,subjectHash:n,reason:s.reason};return i("invalid-evidence")}let o=await e(t,r);return _o(o)?{status:"scored",method:"legacy-provider",subjectHash:n,score:o}:i("invalid-score")}catch{return i("provider-failed")}}var qv=[{label:"_js operator",re:/_js\s*:/g},{label:"_secret operator",re:/_secret\s*:/g},{label:"external URL",re:/https?:\/\/[^\s'"]+/g}];function Bv(e,t){let r=[];for(let{label:n,re:i}of qv){let o=(e.match(i)??[]).length,s=(t.match(i)??[]).length;if(s>o)r.push(`New ${n} introduced (${o} \u2192 ${s})`)}return r}var qe={layout:["PageLayout","Card","Box","Tabs","Drawer","Modal"],nav:["PageSiderMenu","Breadcrumb","MenuLink","Link"],data:["Table","List","Stat"],form:["Form","Form.Input","Form.Select","Form.TextArea","Form.Checkbox"],feedback:["Toast","Dialog","Skeleton"],content:["Heading","Paragraph","Markdown","Divider"],action:["Button"]},Uv=["Form.Submit","Button"];function Vv(e){let t=Object.values(qe).filter((u)=>u.some((m)=>e.includes(m))).length,r=Object.keys(qe).length,n=Math.min(1,t/(r*0.7)),i=e.split(`
|
|
230
|
+
`).filter((u)=>u.trim().length>0).map((u)=>u.match(/^(\s*)/)?.[1]?.length??0),o=i.length>0?Math.max(...i):0,s=Math.min(1,o/12),a=qe.form.some((u)=>e.includes(u)),c=Uv.some((u)=>e.includes(u)),l=!a?1:c?1:0.4,d=[...qe.layout,...qe.data].some((u)=>e.includes(u)),p=[...qe.content,...qe.action].some((u)=>e.includes(u)),f=d&&p?1:d||p?0.6:0.2;return n*0.35+s*0.15+l*0.2+f*0.3}function Gu(e){let t=/```ya?ml[\s\S]*?```/i.test(e),r=/\bpage\s*:/i.test(e),n=/\bblocks\s*:/i.test(e);if(t)return 1;if(r&&n)return 0.9;if(r||n)return 0.5;return 0}function Wu(e,t,r){return e*0.4+t*0.35+r*0.25}class ct{visualScoreProvider;constructor(e={}){this.visualScoreProvider=e.visualScoreProvider??void 0}async run(e,t){let r=Gu(t),n=e.expectedBlocks.filter((a)=>t.toLowerCase().includes(a.toLowerCase())),i=e.expectedBlocks.length===0?1:n.length/e.expectedBlocks.length,o=this.visualScoreProvider?await Yu(this.visualScoreProvider,t,e.intent):this.structuralEvidence(t,e.intent),s=o.status==="scored"?o.score:0;return{renderable:r,schemaValid:i,visualHeuristic:s,visualEvidence:o,overallScore:Wu(r,i,s),safetyOk:!0}}runSync(e,t){let r=Gu(t),n=e.expectedBlocks.filter((a)=>t.toLowerCase().includes(a.toLowerCase())),i=e.expectedBlocks.length===0?1:n.length/e.expectedBlocks.length,o=this.visualScoreProvider?{status:"unavailable",method:"unassessed",subjectHash:at(t,e.intent),reason:"provider-not-run"}:this.structuralEvidence(t,e.intent),s=o.status==="scored"?o.score:0;return{renderable:r,schemaValid:i,visualHeuristic:s,visualEvidence:o,overallScore:Wu(r,i,s),safetyOk:!0}}structuralEvidence(e,t){let r=at(e,t);return e.trim()?{status:"scored",method:"structural-heuristic",subjectHash:r,score:Vv(e)}:{status:"unavailable",method:"unassessed",subjectHash:r,reason:"empty-input"}}checkSafetyRegressions(e,t){return Bv(e,t)}}function Kv(e={}){if(e.runner)return e.runner;return new ct(e.visualScoreProvider!==void 0?{visualScoreProvider:e.visualScoreProvider}:{})}async function wn(e,t,r={}){return Kv(r).run(e,t)}var Qu="title|text|label|content|description|heading|subtitle|placeholder|body|caption|name",ML=new RegExp(`["']?\\b(?:${Qu})["']?\\s*:\\s*["']([^"'\\n]*)["']`,"gi"),_L=new RegExp(`^\\s*-?\\s*(?:${Qu})\\s*:\\s*([^\\s"'{\\[][^\\n]*)$`,"gim");function Jv(e){let t=Zu(e,".uibot","skills");if(!Xu(t))return[];return Gv(t,{withFileTypes:!0}).filter((r)=>r.isDirectory()).map((r)=>r.name)}function Qv(e,t){let r=Zu(e,".uibot","skills",t,"SKILL.md");if(!Xu(r))return"";return Wv(r,"utf8")}async function ed(e={}){let t=e.cwd??process.cwd(),r=new kn({rootDir:t}),n=e.skillId?[e.skillId]:Jv(t),i=[],o=0,s=0;for(let c of n){let l=r.resolved(c),d=Qv(t,c),p=[];for(let f of l){o+=1;let u={id:f.id,intent:f.intent||"regression-reverify",expectedBlocks:f.expectedBlocks??[],skillId:c},m=await wn(u,d),g=(f.expectedBlocks?.length??0)===0||m.schemaValid>=0.99,h=m.renderable>=0.5||!f.intent.trim();if(!g||!h||m.overallScore<0.3)p.push(f.id),s+=1,i.push({skillId:c,id:f.id,action:"reactivated",reason:`overallScore=${m.overallScore.toFixed(3)} schemaValid=${m.schemaValid.toFixed(3)}`});else i.push({skillId:c,id:f.id,action:"pass"})}if(p.length>0)r.markActive(c,p,"reverify-failed")}let a={ok:!0,checked:o,reactivated:s,details:i};if(e.mode==="json")console.log(JSON.stringify(a,null,2));else{console.log(`reverify: checked ${o}, reactivated ${s}`);for(let c of i)if(c.action==="reactivated")console.log(` ! ${c.skillId}/${c.id} \u2192 active (${c.reason})`)}return{code:0,result:a}}import{appendFileSync as Xv,existsSync as xn,mkdirSync as rd,readFileSync as Zv,writeFileSync as td,cpSync as eE}from"fs";import{join as Ae,dirname as tE}from"path";function rE(e){return Ae(e,".uibot","cli-usage.jsonl")}function lt(e,t){let r=rE(e);rd(tE(r),{recursive:!0}),Xv(r,JSON.stringify({...t,at:new Date().toISOString()})+`
|
|
231
|
+
`,"utf8")}function nd(e,t){return Ae(e,".uibot","skills",t)}async function id(e,t={}){let r=t.cwd??process.cwd(),n=nd(r,e);if(!xn(n)){let o={ok:!1,error:`skill not found: ${e}`};if(t.mode==="json")console.log(JSON.stringify(o));else console.error(`uibot skills promote: ${o.error}`);return lt(r,{command:"skills.promote",id:e,ok:!1}),1}let i=Ae(n,"SKILL.md");if(xn(i))td(Ae(n,"SKILL.promoted.md"),Zv(i,"utf8"));if(td(Ae(n,"PROMOTED"),JSON.stringify({id:e,promotedAt:new Date().toISOString()},null,2)),lt(r,{command:"skills.promote",id:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,id:e,action:"promoted"}));else console.log(`promoted skill ${e}`);return 0}async function od(e,t={}){let r=t.cwd??process.cwd(),n=nd(r,e),i=Ae(n,"PROMOTED");if(!xn(i)){let s={ok:!1,error:`no promotion marker for skill: ${e}`};if(t.mode==="json")console.log(JSON.stringify(s));else console.error(`uibot skills rollback: ${s.error}`);return lt(r,{command:"skills.rollback",id:e,ok:!1}),1}let{unlinkSync:o}=await import("fs");if(o(i),lt(r,{command:"skills.rollback",id:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,id:e,action:"rolled-back"}));else console.log(`rolled back skill ${e}`);return 0}async function sd(e,t={}){let r=t.cwd??process.cwd(),n=Ae(r,".uibot");if(!xn(n)){let i={ok:!1,error:"no .uibot directory in workspace"};if(t.mode==="json")console.log(JSON.stringify(i));else console.error(`uibot project export: ${i.error}`);return lt(r,{command:"project.export",outDir:e,ok:!1}),1}if(rd(e,{recursive:!0}),eE(n,Ae(e,".uibot"),{recursive:!0}),lt(r,{command:"project.export",outDir:e,ok:!0}),t.mode==="json")console.log(JSON.stringify({ok:!0,outDir:e}));else console.log(`exported project state \u2192 ${e}`);return 0}import{existsSync as nE,readFileSync as iE}from"fs";import{resolve as oE}from"path";var sE=process.env.UIBOT_REGISTRY_URL?.trim()||"http://127.0.0.1:3202/api/registry/registry.json";async function ad(e={}){let t=e.cwd??process.cwd(),r=oE(t,e.lockfilePath??"uibot.artifacts.lock.json"),n=e.mode??"text",i=null,o=!1;if(!nE(r))o=!0;else try{i=JSON.parse(iE(r,"utf8"))}catch{o=!0}let s=e.manifest;if(!s){let c=e.registry??sE,l=e.fetchImpl??fetch;try{let d=await l(c);if(!d.ok){let p={ok:!1,error:`registry HTTP ${d.status}`,url:c};if(n==="json")console.log(JSON.stringify(p));else console.error(`uibot doctor: failed to fetch registry ${c} (${d.status})`);return 1}s=await d.json()}catch(d){let p=d instanceof Error?d.message:String(d),f="start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor";if(n==="json")console.log(JSON.stringify({ok:!1,error:p,url:c,exitCode:1,hint:"start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor"}));else console.error(`uibot doctor: cannot reach registry ${c}`),console.error(` ${p}`),console.error(" hint: start control-plane (bun run example:control-plane) or pass --registry; offline = not a green doctor");return 1}}if(o){let c=tr({lockfile:null,manifest:s,lockfilePath:r});if(n==="json")console.log(JSON.stringify({...c,exitCode:2}));else console.error(`uibot doctor: no lockfile at ${r}`);return 2}let a=tr({lockfile:i,manifest:s,lockfilePath:r});if(n==="json")console.log(JSON.stringify({...a,exitCode:a.ok?0:1}));else if(a.ok)console.log(`uibot doctor: ok (${a.lockCount} locked, registry ${a.registryName??"?"})`);else{console.error(`uibot doctor: drift detected (${a.drifts.length})`);for(let c of a.drifts)console.error(` - ${c.detail}`)}return a.ok?0:1}import{existsSync as Jt,mkdirSync as qo,writeFileSync as cd,readdirSync as aE,readFileSync as cE,statSync as lE}from"fs";import{dirname as ld,isAbsolute as uE,join as ut,relative as dE,resolve as En,sep as pE}from"path";Rn();class Z extends Error{constructor(e){super(e);this.name="InitIntoError"}}var fE="src/pages/home.uibot.yaml",gE="src/uibot-mount.example.tsx",mE="uibot.embed.md",ud=["@uibot/contracts","@uibot/compiler","@uibot/runtime","@uibot/renderer-react"],hE=`/**
|
|
232
232
|
* Minimal UIBot control-plane entry (scaffold from \`uibot init\`).
|
|
233
233
|
* Wire with your monorepo's createExampleControlPlane or a custom assembly.
|
|
234
234
|
*
|
|
@@ -241,7 +241,7 @@ export async function main(): Promise<void> {
|
|
|
241
241
|
if (import.meta.main) {
|
|
242
242
|
void main();
|
|
243
243
|
}
|
|
244
|
-
`,
|
|
244
|
+
`,yE=`version: "2.0"
|
|
245
245
|
pages:
|
|
246
246
|
- id: home
|
|
247
247
|
path: /
|
|
@@ -258,7 +258,7 @@ pages:
|
|
|
258
258
|
- type: Button
|
|
259
259
|
props:
|
|
260
260
|
label: Get started
|
|
261
|
-
`,
|
|
261
|
+
`,bE=`version: "2.0"
|
|
262
262
|
pages:
|
|
263
263
|
- id: home
|
|
264
264
|
path: /
|
|
@@ -277,7 +277,7 @@ pages:
|
|
|
277
277
|
type: Paragraph
|
|
278
278
|
props:
|
|
279
279
|
text: Keep this *.uibot.yaml beside your routes; host owns router/session/ACL.
|
|
280
|
-
`;function
|
|
280
|
+
`;function SE(e){return`/**
|
|
281
281
|
* L1 Embed mount example \u2014 copy into a route component.
|
|
282
282
|
* Proof: examples/vite-react-live \xB7 smoke:external-consumer --phase app-runtime
|
|
283
283
|
*
|
|
@@ -344,7 +344,7 @@ export async function mountUIBot(rootEl: HTMLElement, registry: unknown): Promis
|
|
|
344
344
|
}),
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
-
`}function
|
|
347
|
+
`}function RE(e,t){let r=ud.join(" ");return`# UIBot L1 Embed
|
|
348
348
|
|
|
349
349
|
Scaffolded with \`uibot init --into\`.
|
|
350
350
|
|
|
@@ -382,9 +382,9 @@ Apps must **not** depend on Studio or \`@uibot/application\`.
|
|
|
382
382
|
\`uibot link --spec-dir <rel>\` then \`uibot sync push|pull\` for Spec-as-code sync.
|
|
383
383
|
|
|
384
384
|
See \`docs/product/progressive-adoption.md\`.
|
|
385
|
-
`}async function
|
|
386
|
-
`),i("control-plane.ts",
|
|
387
|
-
`);return i("README.md",`# ${
|
|
385
|
+
`}async function dd(e){let t=e.log??((d)=>console.log(d)),r=En(e.dir);qo(r,{recursive:!0});let n=[],i=(d,p)=>{let f=ut(r,d);qo(ld(f),{recursive:!0}),cd(f,p,"utf8"),n.push(f)};i("package.json",`${JSON.stringify({name:vn(r),private:!0,type:"module",scripts:{start:"bun run control-plane.ts"}},null,2)}
|
|
386
|
+
`),i("control-plane.ts",hE),i("DESIGN.md",bn(vn(r)));let o=Sn(),a=["frontend-principles","control-console"].map((d)=>o.find((p)=>p.id===d)).filter((d)=>Boolean(d));for(let d of a){let p=ut(".uibot","design-md",`${d.id}.design.md`);i(p,Mo(d))}let c=xE(),l=!1;if(c){let d=rr({dir:c}),p=(e.template?d.find((f)=>f.name===e.template):d.find((f)=>f.name==="saas-landing")??d[0])??null;if(p){let f=nr(p),u=ur(f,{workspaceRoot:r,source:"uibot-init"});n.push(...u.writtenFiles),n.push(ut(r,"uibot.artifacts.lock.json")),l=!0,t(`seeded template ${p.name}`)}}if(!l)i(ut("templates","demo.yaml"),yE),i("uibot.artifacts.lock.json",`${JSON.stringify({version:1,artifacts:[]},null,2)}
|
|
387
|
+
`);return i("README.md",`# ${vn(r)}
|
|
388
388
|
|
|
389
389
|
Scaffolded with \`uibot init\`.
|
|
390
390
|
|
|
@@ -394,11 +394,11 @@ Scaffolded with \`uibot init\`.
|
|
|
394
394
|
- \`control-plane.ts\` \u2014 wire your control-plane assembly
|
|
395
395
|
|
|
396
396
|
Next: point dependencies at \`@uibot/*\` packages and run the control-plane.
|
|
397
|
-
`),t(`initialized project at ${r} (${n.length} files)`),{dir:r,files:n}}function
|
|
397
|
+
`),t(`initialized project at ${r} (${n.length} files)`),{dir:r,files:n}}function pd(e){let t=e.log??((n)=>console.log(n)),r=e.error??((n)=>console.error(n));try{let n=CE(e.into);kE(n);let i=jo(e.specPath??fE,"specPath"),o=jo(e.mountPath??gE,"mountPath"),s=jo(e.recipePath??mE,"recipePath"),a=Fo(i,n,"specPath"),c=Fo(o,n,"mountPath"),l=Fo(s,n,"recipePath"),d="DESIGN.md",p=ut(n,d),f=Jt(p),u=[{abs:a,rel:i,content:bE},{abs:c,rel:o,content:SE(i)},{abs:l,rel:s,content:RE(i,o)}];if(!f)u.push({abs:p,rel:d,content:bn(vn(n))});if(!e.force){let b=u.filter((S)=>Jt(S.abs)).map((S)=>S.rel);if(b.length>0)throw new Z(`refusing to overwrite existing files (pass --force): ${b.join(", ")}`)}let m=[];for(let b of u)qo(ld(b.abs),{recursive:!0}),cd(b.abs,b.content.endsWith(`
|
|
398
398
|
`)?b.content:`${b.content}
|
|
399
|
-
`,"utf8"),m.push(b.abs);let g=[...
|
|
400
|
-
`,"utf8"),t}function
|
|
399
|
+
`,"utf8"),m.push(b.abs);let g=[...ud],h={ok:!0,into:n,files:m.map((b)=>wE(n,b)),dependencies:g};if(e.mode==="json")t(JSON.stringify(h));else{t(`initialized L1 Embed into ${n}`);for(let b of h.files)t(` + ${b}`);if(t(`App Runtime deps: ${g.join(" ")}`),f)t("kept existing DESIGN.md");t(`See ${s} for the copy-paste recipe.`)}return{code:0,into:n,files:m,dependencies:g}}catch(n){let i=n instanceof Error?n.message:String(n);if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:i}));else r(`uibot init --into: ${i}`);return{code:1,error:i}}}function CE(e){if(!e||e.includes("\x00"))throw new Z("--into path is invalid");let t=En(e);if(!Jt(t))throw new Z(`directory does not exist: ${t}`);let r;try{r=lE(t)}catch{throw new Z(`cannot stat --into path: ${t}`)}if(!r.isDirectory())throw new Z(`--into must be a directory: ${t}`);return t}function kE(e){let t=ut(e,"package.json");if(!Jt(t))throw new Z(`missing package.json in ${e} (refuse to scaffold non-app dir)`);try{let r=cE(t,"utf8");JSON.parse(r)}catch{throw new Z(`invalid package.json in ${e}`)}}function Fo(e,t,r){if(!e||e.includes("\x00"))throw new Z(`${r} is invalid`);if(uE(e))throw new Z(`${r} must be a relative path (got absolute: ${e})`);try{return de(e,t,r)}catch(n){let i=n instanceof Error?n.message:String(n);throw new Z(`${r} escapes app root: ${i}`)}}function jo(e,t){let r=e.split(/[/\\]/).join("/");if(!r||r.includes("\x00"))throw new Z(`${t} is invalid`);return r}function wE(e,t){return dE(e,t).split(pE).join("/")}function vn(e){return(e.replace(/\/+$/,"").split("/").pop()||"uibot-app").replace(/[^a-zA-Z0-9._-]/g,"-")}function xE(){let e=[En(process.cwd(),"examples/templates"),En(import.meta.dir,"../../../../examples/templates")];for(let t of e)if(Jt(t))try{if(aE(t).some((r)=>r.endsWith(".yaml")||r.endsWith(".yml")))return t}catch{}return null}import{existsSync as Bo,mkdirSync as Uo,readFileSync as vE,writeFileSync as EE}from"fs";import{dirname as fd,isAbsolute as gd,join as Ko,relative as IE,resolve as In,sep as Vo}from"path";var Ho="uibot.link.v1",zo=Ko(".uibot","link.json"),PE=Ko(".uibot","spec.lock");class D extends Error{constructor(e){super(e);this.name="LinkPathError"}}function AE(e,t){let r=t.endsWith(Vo)?t:t+Vo;return e===t||e.startsWith(r)}function Pn(e,t,r){if(!e||e.includes("\x00"))throw new D(`${r} is invalid`);if(gd(e))throw new D(`${r} must be a relative path (got absolute: ${e})`);try{return de(e,t,r)}catch(n){let i=n instanceof Error?n.message:String(n);throw new D(`${r} escapes consumer root: ${i}`)}}function Yo(e,t){if(!e||e.includes("\x00"))throw new D("sourceDir is invalid");return gd(e)?In(e):In(t,e)}function Qt(e){if(!e||e.includes("\x00"))throw new D("controlPlaneUrl is invalid");let t;try{t=new URL(e.trim())}catch{throw new D(`controlPlaneUrl is not a valid URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new D(`controlPlaneUrl must be http(s) (got ${t.protocol})`);if(t.username||t.password)throw new D("controlPlaneUrl must not embed credentials; use UIBOT_CONTROL_PLANE_AUTH_BEARER / UIBOT_STUDIO_AUTH_BEARER");let r=t.pathname.replace(/\/+$/,"");return`${t.origin}${r==="/"?"":r}`}function Xt(e){let t=e.trim();if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/.test(t))throw new D(`projectId invalid (expected /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/, got ${JSON.stringify(e)})`);return t}function An(e){return Ko(e,zo)}function Dn(e){let t=An(e);if(!Bo(t))throw new D(`missing ${zo}; run \`uibot link\` first`);let r=JSON.parse(vE(t,"utf8"));if(r.schema!==Ho)throw new D(`unsupported link schema: ${String(r.schema)}`);if(!r.consumerRoot||!r.specDir||!r.lockPath)throw new D("link.json missing required fields");if(r.controlPlaneUrl)r.controlPlaneUrl=Qt(r.controlPlaneUrl);if(r.projectId)r.projectId=Xt(r.projectId);return r}function Go(e){let t=An(e.consumerRoot);Uo(fd(t),{recursive:!0});let r={schema:Ho,consumerRoot:e.consumerRoot,specDir:e.specDir,...e.sourceDir?{sourceDir:e.sourceDir}:{},...e.controlPlaneUrl?{controlPlaneUrl:e.controlPlaneUrl}:{},...e.projectId?{projectId:e.projectId}:{},digest:e.digest,lockPath:e.lockPath,createdAt:e.createdAt,...e.updatedAt?{updatedAt:e.updatedAt}:{}};return EE(t,`${JSON.stringify(r,null,2)}
|
|
400
|
+
`,"utf8"),t}function md(e){let t=e.log??((o)=>console.log(o)),r=e.error??((o)=>console.error(o)),n=In(e.cwd??process.cwd()),i=e.lockPath??PE;try{Pn(e.specDir,n,"specDir"),Pn(i,n,"lockPath");let o=An(n);if(Bo(o)&&!e.force){let g=`${zo} already exists (pass --force to overwrite)`;if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:g}));else r(`uibot link: ${g}`);return{code:1}}let s;if(e.sourceDir)s=Yo(e.sourceDir,n);let a;if(e.controlPlaneUrl)a=Qt(e.controlPlaneUrl);let c;if(e.projectId)c=Xt(e.projectId);let l=new Date().toISOString(),d=Bo(o)?Dn(n):void 0,p={schema:Ho,consumerRoot:n,specDir:e.specDir.split(/[/\\]/).join("/"),...s?{sourceDir:s}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},digest:d?.digest??null,lockPath:i.split(/[/\\]/).join("/"),createdAt:d?.createdAt??l,updatedAt:l},f=In(n,p.specDir);if(!AE(f,n))throw new D("specDir escapes consumer root");Uo(f,{recursive:!0}),Uo(fd(An(n)),{recursive:!0});let u=Go(p),m={ok:!0,path:u,consumerRoot:p.consumerRoot,specDir:p.specDir,sourceDir:p.sourceDir??null,controlPlaneUrl:p.controlPlaneUrl??null,projectId:p.projectId??null,digest:p.digest,lockPath:p.lockPath};if(e.mode==="json")t(JSON.stringify(m));else{if(t(`linked consumer \u2192 ${u}`),t(` specDir: ${p.specDir}`),p.sourceDir)t(` sourceDir: ${p.sourceDir}`);if(p.controlPlaneUrl)t(` controlPlaneUrl: ${p.controlPlaneUrl}`);if(p.projectId)t(` projectId: ${p.projectId}`);t(` digest: ${p.digest??"(unset \u2014 run uibot sync push|pull)"}`)}return{code:0,config:p}}catch(o){let s=o instanceof Error?o.message:String(o);if(e.mode==="json")t(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:s}));else r(`uibot link: ${s}`);return{code:1}}}function ae(e){return Pn(e.specDir,e.consumerRoot,"specDir")}function hd(e){return Pn(e.lockPath,e.consumerRoot,"lockPath")}function dt(e,t){return IE(e,t).split(Vo).join("/")}import{createHash as DE}from"crypto";import{copyFileSync as OE,existsSync as Zt,mkdirSync as Be,readdirSync as TE,readFileSync as bd,statSync as LE,unlinkSync as NE,writeFileSync as Sd}from"fs";import{dirname as Qo,join as $E,relative as ME,resolve as Rd,sep as yd}from"path";var _E="uibot.spec.lock.v1",Cd="uibot.spec.sync.v1",FE="/api/studio/spec-sync",kd=/\.ya?ml$/i;function Wo(e,t){let r=t.endsWith(yd)?t:t+yd;return e===t||e.startsWith(r)}function Ln(e){if(!Zt(e))return[];let t=[],r=(n)=>{for(let i of TE(n,{withFileTypes:!0})){if(i.name==="node_modules"||i.name===".git")continue;let o=$E(n,i.name);if(i.isDirectory()){r(o);continue}if(i.isFile()&&kd.test(i.name))t.push(o)}};return r(e),t.sort((n,i)=>n.localeCompare(i))}function Jo(e){return DE("sha256").update(e).digest("hex")}function jE(e){let t=Ln(e).map((i)=>{let o=dt(e,i),s=Jo(bd(i));return{path:o,sha256:s}}),r=t.map((i)=>`${i.path}
|
|
401
401
|
${i.sha256}`).join(`
|
|
402
|
-
`);return{digest:`sha256:${
|
|
403
|
-
`,"utf8")}function wn(e,t){if(!Qt(e)||!kE(e).isDirectory())throw new D(`source Spec directory not found: ${e}`);je(t,{recursive:!0});let r=[];for(let n of En(e)){let i=vE(e,n),o=de(i,t,"sync");je(Ko(o),{recursive:!0}),CE(n,o),r.push(lt(t,o))}return{copied:r,removedNone:!0}}function DE(e,t){je(t,{recursive:!0});let r=[],n=new Set;for(let i of e){if(!i.path||i.path.includes("\x00")||typeof i.content!=="string")throw new D("remote Spec file entry is invalid");if(!hd.test(i.path))throw new D(`remote Spec path is not YAML: ${i.path}`);let o=de(i.path,t,"sync");je(Ko(o),{recursive:!0}),fd(o,i.content,"utf8");let s=lt(t,o);n.add(s),r.push(s)}for(let i of En(t)){let o=lt(t,i);if(!n.has(o))xE(i)}return{copied:r.sort((i,o)=>i.localeCompare(o))}}function OE(e){return En(e).map((t)=>{let r=pd(t,"utf8");return{path:lt(e,t),content:r,sha256:Vo(r)}})}function vn(e,t){let r=t??e.sourceDir;if(!r)throw new D("no sourceDir: pass --from <dir> (push) / --to <dir> (pull), or re-run `uibot link --source-dir <dir>` (or configure --control-plane-url)");let n=qo(r,e.consumerRoot),i={...e,sourceDir:n,updatedAt:new Date().toISOString()};return{sourceDir:n,config:i}}function TE(e=process.env){return e.UIBOT_CONTROL_PLANE_AUTH_BEARER?.trim()||e.UIBOT_STUDIO_AUTH_BEARER?.trim()||""||void 0}function LE(e,t){let r=Wt(e),n=t?Jt(t):"default",i=new URL(`${r}${IE}`);return i.searchParams.set("projectId",n),i.toString()}async function yd(e){let t={accept:"application/json"};if(e.bearer)t.authorization=`Bearer ${e.bearer}`;let r={method:e.method,headers:t};if(e.method==="PUT")t["content-type"]="application/json",r={...r,body:JSON.stringify(e.body)};let n;try{n=await e.fetchImpl(e.url,r)}catch(s){let a=s instanceof Error?s.message:String(s);throw new D(`control-plane request failed: ${a}`)}if(n.status<200||n.status>=300){let s="";try{let a=await n.text();s=a?`: ${a.slice(0,240)}`:""}catch{}throw new D(`control-plane Spec sync HTTP ${n.status}${s}`)}let i;try{i=await n.json()}catch{throw new D("control-plane Spec sync returned non-JSON body")}let o=i;if(!o||o.schema!==md||!Array.isArray(o.files))throw new D("control-plane Spec sync response missing uibot.spec.sync.v1 shape");return o}function bd(e,t){let r=t.env??process.env,n=t.controlPlaneUrl??e.controlPlaneUrl;if(!n)return null;let i=t.projectId??e.projectId,o=Wt(n),s={...e,controlPlaneUrl:o,...i?{projectId:Jt(i)}:{},updatedAt:new Date().toISOString()},a=TE(r);return{config:s,url:LE(o,s.projectId),...a?{bearer:a}:{}}}function Pe(e,t,r,n){let i=e.log??((s)=>console.log(s)),o=e.error??((s)=>console.error(s));if(e.mode==="json")i(JSON.stringify({ok:t,...r}));else if(t)for(let s of n)i(s);else o(`uibot sync: ${String(r.error??"failed")}`);return t?0:1}function ut(e){let t=ae(e),r=ud(e),{digest:n,files:i}=PE(t),o={schema:EE,digest:n,files:i,updatedAt:new Date().toISOString()};AE(r,o);let s={...e,digest:n,updatedAt:o.updatedAt};return Bo(s),{config:s,lock:o}}async function Sd(e={}){try{let t=gd(e.cwd??process.cwd()),r=xn(t);if(r={...r,consumerRoot:t},e.from){let{sourceDir:p,config:d}=vn(r,e.from);if(!Uo(ae(d),d.consumerRoot))throw new D("specDir escapes consumer root");let f=ae(d),{copied:u}=wn(p,f),{config:m,lock:g}=ut(d);return Pe(e,!0,{action:"push",mode:"local",from:p,to:f,copied:u,digest:g.digest,lockPath:m.lockPath},[`sync push: ${u.length} YAML file(s) ${p} \u2192 ${f}`,`digest: ${g.digest}`])}let n=bd(r,e);if(n&&!e.from){let p=e.fetchImpl??fetch,d=await yd({url:n.url,method:"GET",...n.bearer?{bearer:n.bearer}:{},fetchImpl:p}),f=ae(n.config);if(!Uo(f,n.config.consumerRoot))throw new D("specDir escapes consumer root");let{copied:u}=DE(d.files,f),{config:m,lock:g}=ut(n.config);return Pe(e,!0,{action:"push",mode:"remote",from:n.url,to:f,copied:u,remoteDigest:d.digest,digest:g.digest,lockPath:m.lockPath,projectId:d.projectId},[`sync push (remote): ${u.length} YAML file(s) ${n.url} \u2192 ${f}`,`digest: ${g.digest}`])}let{sourceDir:i,config:o}=vn(r,e.from);if(!Uo(ae(o),o.consumerRoot))throw new D("specDir escapes consumer root");let s=ae(o),{copied:a}=wn(i,s),{config:c,lock:l}=ut(o);return Pe(e,!0,{action:"push",mode:"local",from:i,to:s,copied:a,digest:l.digest,lockPath:c.lockPath},[`sync push: ${a.length} YAML file(s) ${i} \u2192 ${s}`,`digest: ${l.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return Pe(e,!1,{action:"push",error:r},[])}}async function Cd(e={}){try{let t=gd(e.cwd??process.cwd()),r=xn(t);r={...r,consumerRoot:t};let n=e.to??e.from;if(n){let{sourceDir:f,config:u}=vn(r,n),m=ae(u);if(!Qt(m))throw new D(`consumer specDir not found: ${m}`);je(f,{recursive:!0});let{copied:g}=wn(m,f),{config:h,lock:b}=ut(u);return Pe(e,!0,{action:"pull",mode:"local",from:m,to:f,copied:g,digest:b.digest,lockPath:h.lockPath},[`sync pull: ${g.length} YAML file(s) ${m} \u2192 ${f}`,`digest: ${b.digest}`])}let i=bd(r,e);if(i){let f=ae(i.config);if(!Qt(f))throw new D(`consumer specDir not found: ${f}`);let u=OE(f),m=e.fetchImpl??fetch,g=await yd({url:i.url,method:"PUT",...i.bearer?{bearer:i.bearer}:{},body:{schema:md,files:u},fetchImpl:m}),{config:h,lock:b}=ut(i.config);return Pe(e,!0,{action:"pull",mode:"remote",from:f,to:i.url,copied:u.map((R)=>R.path),remoteDigest:g.digest,digest:b.digest,lockPath:h.lockPath,projectId:g.projectId},[`sync pull (remote): ${u.length} YAML file(s) ${f} \u2192 ${i.url}`,`digest: ${b.digest}`])}let o=e.to??e.from,{sourceDir:s,config:a}=vn(r,o),c=ae(a);if(!Qt(c))throw new D(`consumer specDir not found: ${c}`);je(s,{recursive:!0});let{copied:l}=wn(c,s),{config:p,lock:d}=ut(a);return Pe(e,!0,{action:"pull",mode:"local",from:c,to:s,copied:l,digest:d.digest,lockPath:p.lockPath},[`sync pull: ${l.length} YAML file(s) ${c} \u2192 ${s}`,`digest: ${d.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return Pe(e,!1,{action:"pull",error:r},[])}}function In(e){let t={_:[]};for(let r=0;r<e.length;r+=1){let n=e[r];if(!n.startsWith("--")){t._.push(n);continue}let i=n.slice(2),o=i.indexOf("=");if(o>=0){t[i.slice(0,o)]=i.slice(o+1);continue}let s=e[r+1];if(s!==void 0&&!s.startsWith("--"))t[i]=s,r+=1;else t[i]=!0}return t}function P(e,t){let r=e[t];return typeof r==="string"?r:void 0}var kd="uibot.resource.envelope.v1",yN=["resource-cli-invalid-mode","resource-cli-invalid-argument","resource-cli-internal-error"];class Y extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceCliError"}}function Ho(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},...e.tags.length?{tags:e.tags}:{},...e.capabilities.length?{capabilities:e.capabilities}:{},...e.dependencies.length?{dependencies:e.dependencies}:{},source:e.source,maturity:e.receipt.maturity,receiptLevel:e.receipt.level,...e.receipt.evidence.length?{evidence:e.receipt.evidence}:{}}}function NE(e){return{id:e.resource.id,score:e.score,reasons:e.reasons,resource:Ho(e.resource)}}function xd(){return typeof crypto.randomUUID==="function"?crypto.randomUUID():`resource-${Date.now().toString(36)}`}function wd(e,t){return{dense:t,encoding:t?"dense-v1":"full",resourceIndexSchemaVersion:e.manifest().schemaVersion}}function $E(e,t,r,n){return{schemaVersion:kd,requestId:r.requestId??xd(),command:e,ok:!0,data:t,meta:wd(r.queryService,n)}}function ME(e,t,r,n){let i=t instanceof ee||t instanceof Y?t.code:"resource-cli-internal-error",o=t instanceof ee||t instanceof Y?t.detail:"resource command failed";return{schemaVersion:kd,requestId:r.requestId??xd(),command:e,ok:!1,error:{code:i,message:`${i}: ${o}`,detail:o},meta:wd(r.queryService,n)}}function Pn(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string")throw new Y("resource-cli-invalid-argument",`--${t} requires a value`);let n=r.split(",").map((i)=>i.trim()).filter(Boolean);if(n.length===0)throw new Y("resource-cli-invalid-argument",`--${t} is empty`);return n}function Rd(e,t,r){let n=Pn(e,t);if(!n)return;for(let i of n)if(!r.includes(i))throw new Y("resource-cli-invalid-argument",`--${t}=${i}; expected one of ${r.join(",")}`);return n}function _E(e){let t=Rd(e,"kind",es),r=Pn(e,"tag"),n=Pn(e,"category"),i=Pn(e,"capability"),o=Rd(e,"maturity",Tn),s=P(e,"limit"),a;if(e.limit!==void 0){if(!s||!/^\d+$/.test(s)||Number(s)<=0)throw new Y("resource-cli-invalid-argument",`--limit=${s??"<missing>"}; expected a positive integer`);a=Number(s)}let c=e._.join(" ").trim();return{...c?{text:c}:{},...t?{kinds:t}:{},...r?{tags:r}:{},...n?{categories:n}:{},...i?{capabilities:i}:{},...o?{maturities:o}:{},...a!==void 0?{limit:a}:{}}}function FE(e,t,r){if(e==="manifest"){let n=t;for(let i of n.index.resources)r(`${i.id} ${i.kind} ${i.receipt.maturity} ${i.title}`);return}if(e==="search"){let n=t;for(let i of n.matches)r(`${i.resource.id} ${i.score} ${i.reasons.map((o)=>o.code).join(",")} ${i.resource.title}`);return}r(JSON.stringify(t,null,2))}async function vd(e,t,r){let n=In(t),i=r.log??((p)=>console.log(p)),o=r.errorLog??((p)=>console.error(p)),s=n.dense,a=s===!0,c=P(n,"mode"),l=c??"text";try{let p=Ve.find((g)=>g.name===e),d=new Set(["mode","dense",...p.options.map((g)=>g.name)]),f=Object.keys(n).find((g)=>g!=="_"&&!d.has(g));if(f)throw new Y("resource-cli-invalid-argument",`unsupported flag --${f} for ${e}`);if(n.mode!==void 0&&c===void 0)throw new Y("resource-cli-invalid-mode","--mode requires text or json");if(l!=="text"&&l!=="json")throw new Y("resource-cli-invalid-mode",`${l}; expected text or json`);if(s!==void 0&&s!==!0)throw new Y("resource-cli-invalid-argument","--dense does not take a value");let u;switch(e){case"manifest":{if(n._.length>0)throw new Y("resource-cli-invalid-argument","manifest does not accept positionals");let g=r.queryService.manifest();u={operations:Ve,index:a?{schemaVersion:g.schemaVersion,resources:g.resources.map(Ho),aliasLookup:Object.entries(g.aliases)}:g};break}case"search":{let g=r.queryService.search(_E(n));u={matches:a?g.map(NE):g};break}case"get":{if(n._.length!==1)throw new Y("resource-cli-invalid-argument","get requires exactly one id or quoted alias");let g=r.queryService.get(n._[0]);u={resource:a?Ho(g):g};break}case"build":{u={plan:r.queryService.build(n._)};break}}let m=$E(e,u,r,a);if(l==="json")i(JSON.stringify(m));else FE(e,u,i);return 0}catch(p){let d=p instanceof Error?p:Error(String(p)),f=ME(e,d,r,a);if(l==="json"||c!==void 0)i(JSON.stringify(f));else o(f.error.message);return 1}}import{existsSync as jE}from"fs";import{resolve as qe}from"path";function Ed(e){for(let t of e)if(jE(t))return t;return null}function Go(e=process.cwd()){return Ed([qe(e,"examples/templates"),qe(import.meta.dir,"templates"),qe(import.meta.dir,"../../../examples/templates")])}function Yo(e=process.cwd()){return Ed([qe(e,"examples/shells"),qe(import.meta.dir,"shells"),qe(import.meta.dir,"../../../examples/shells")])}function qE(e){let t={};for(let r of e)for(let[n,i]of Object.entries(r)){if(t[n])throw Error(`duplicate built-in catalog source id: ${n}`);t[n]=i}return t}async function Id(){let[e,t,r]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-studio"),Promise.resolve().then(() => (fn(),{}))]),n=[],i=Go();if(i)n.push({dir:i});let o=Yo();if(o)n.push({dir:o,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let s=dt(n),a=Object.fromEntries(s.map((c)=>[c.name,c.templateContract]));return ds(is({components:qE([e.CATALOG_ENTRIES,t.STUDIO_CATALOG_ENTRIES]),templates:a,designGuides:pn(qe(import.meta.dir,"../../design-md/content")),examples:ns(a)}))}async function BE(){let[e,t,r,n]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-shadcn/registry-source"),import("@uibot/blocks-studio"),import("@uibot/blocks-studio/registry-source")]);return Xo([{sourceDir:t.SOURCE_DIR,blockFileMap:t.BLOCK_FILE,catalog:e.CATALOG_ENTRIES},{sourceDir:n.SOURCE_DIR,blockFileMap:n.BLOCK_FILE,catalog:r.STUDIO_CATALOG_ENTRIES}])}function Z(e,t){if(P(e,"mode")==="json")console.log(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:t}));else console.error(t);return 1}async function UE(e){let[t,...r]=e,n=In(r),i=P(n,"registry");switch(t){case"manifest":case"search":case"get":case"build":{let o=await Id();return vd(t,r,{queryService:o})}case"list":return await Cs({...i?{registry:i}:{}}),0;case"add":{let o=n._[0];if(!o)return Z(n,"uibot add: missing artifact <name>");return await Ss(o,{...i?{registry:i}:{},workspaceRoot:P(n,"cwd")??process.cwd()}),0}case"publish":{let o=await BE(),s=[],a=Go();if(a)s.push({dir:a});let c=Yo();if(c)s.push({dir:c,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let l=dt(s);return await ks({out:P(n,"out")??"dist/registry",manifestName:P(n,"name")??"uibot",sources:o,...l.length?{templates:l}:{}}),0}case"design-md":{if(n._[0]!=="sync")return Z(n,"uibot design-md: expected subcommand 'sync'");let s=P(n,"from");if(!s)return Z(n,"uibot design-md sync: missing --from <github:owner/repo|https-url>");let c=P(n,"mode")==="json"?"json":"text",l=P(n,"license"),{code:p}=await Mu({from:s,cwd:P(n,"cwd")??process.cwd(),mode:c,...l?{license:l}:{},dryRun:n["dry-run"]===!0});return p}case"regressions":{if(n._[0]!=="reverify")return Z(n,"uibot regressions: expected subcommand 'reverify'");let s=P(n,"mode")==="json"?"json":"text",a=P(n,"skill"),{code:c}=await zu({cwd:P(n,"cwd")??process.cwd(),mode:s,...a?{skillId:a}:{}});return c}case"skills":{let o=n._[0],s=n._[1],a=P(n,"mode")==="json"?"json":"text",c=P(n,"cwd")??process.cwd();if(o==="promote"){if(!s)return Z(n,"uibot skills promote: missing <id>");return Xu(s,{cwd:c,mode:a})}if(o==="rollback"){if(!s)return Z(n,"uibot skills rollback: missing <id>");return Zu(s,{cwd:c,mode:a})}return Z(n,"uibot skills: expected promote|rollback <id>")}case"project":{let o=n._[0],s=n._[1];if(o!=="export"||!s)return Z(n,"uibot project: expected export <dir>");let a=P(n,"mode")==="json"?"json":"text";return ed(s,{cwd:P(n,"cwd")??process.cwd(),mode:a})}case"link":{let o=P(n,"spec-dir")??n._[0];if(!o||typeof o!=="string")return Z(n,"uibot link: missing --spec-dir <relative-dir> (or positional <spec-dir>)");let s=P(n,"source-dir"),a=P(n,"control-plane-url"),c=P(n,"project-id"),l=P(n,"lock-path"),{code:p}=ld({cwd:P(n,"cwd")??process.cwd(),specDir:o,...s?{sourceDir:s}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},...l?{lockPath:l}:{},force:n.force===!0,mode:P(n,"mode")==="json"?"json":"text"});return p}case"sync":{let o=n._[0];if(o!=="push"&&o!=="pull")return Z(n,"uibot sync: expected subcommand 'push' or 'pull'");let s=P(n,"mode")==="json"?"json":"text",a=P(n,"cwd")??process.cwd(),c=P(n,"from"),l=P(n,"to"),p=P(n,"control-plane-url"),d=P(n,"project-id");if(o==="push")return Sd({cwd:a,mode:s,...c?{from:c}:{},...p?{controlPlaneUrl:p}:{},...d?{projectId:d}:{}});return Cd({cwd:a,mode:s,...l?{to:l}:{},...c&&!l?{from:c}:{},...p?{controlPlaneUrl:p}:{},...d?{projectId:d}:{}})}case"doctor":{let o=P(n,"registry");return td({cwd:P(n,"cwd")??process.cwd(),mode:P(n,"mode")==="json"?"json":"text",...o?{registry:o}:{}})}case"init":{let o=P(n,"into");if(o){let c=P(n,"spec-path"),l=P(n,"mount-path"),{code:p}=sd({into:o,...c?{specPath:c}:{},...l?{mountPath:l}:{},force:n.force===!0,mode:P(n,"mode")==="json"?"json":"text"});return p}let s=n._[0];if(!s)return Z(n,"uibot init: missing <dir> (or use --into <existing-app>)");let a=P(n,"template");return await od({dir:s,...a?{template:a}:{}}),0}case"help":case"--help":case"-h":case void 0:return console.log(Vn()),0;default:{let o=`uibot: unknown command '${t}'`;if(P(n,"mode")==="json")return Z(n,o);return console.error(`${o}
|
|
404
|
-
`),console.error(
|
|
402
|
+
`);return{digest:`sha256:${Jo(r||"empty")}`,files:t}}function qE(e,t){Be(Qo(e),{recursive:!0}),Sd(e,`${JSON.stringify(t,null,2)}
|
|
403
|
+
`,"utf8")}function On(e,t){if(!Zt(e)||!LE(e).isDirectory())throw new D(`source Spec directory not found: ${e}`);Be(t,{recursive:!0});let r=[];for(let n of Ln(e)){let i=ME(e,n),o=de(i,t,"sync");Be(Qo(o),{recursive:!0}),OE(n,o),r.push(dt(t,o))}return{copied:r,removedNone:!0}}function BE(e,t){Be(t,{recursive:!0});let r=[],n=new Set;for(let i of e){if(!i.path||i.path.includes("\x00")||typeof i.content!=="string")throw new D("remote Spec file entry is invalid");if(!kd.test(i.path))throw new D(`remote Spec path is not YAML: ${i.path}`);let o=de(i.path,t,"sync");Be(Qo(o),{recursive:!0}),Sd(o,i.content,"utf8");let s=dt(t,o);n.add(s),r.push(s)}for(let i of Ln(t)){let o=dt(t,i);if(!n.has(o))NE(i)}return{copied:r.sort((i,o)=>i.localeCompare(o))}}function UE(e){return Ln(e).map((t)=>{let r=bd(t,"utf8");return{path:dt(e,t),content:r,sha256:Jo(r)}})}function Tn(e,t){let r=t??e.sourceDir;if(!r)throw new D("no sourceDir: pass --from <dir> (push) / --to <dir> (pull), or re-run `uibot link --source-dir <dir>` (or configure --control-plane-url)");let n=Yo(r,e.consumerRoot),i={...e,sourceDir:n,updatedAt:new Date().toISOString()};return{sourceDir:n,config:i}}function VE(e=process.env){return e.UIBOT_CONTROL_PLANE_AUTH_BEARER?.trim()||e.UIBOT_STUDIO_AUTH_BEARER?.trim()||""||void 0}function KE(e,t){let r=Qt(e),n=t?Xt(t):"default",i=new URL(`${r}${FE}`);return i.searchParams.set("projectId",n),i.toString()}async function wd(e){let t={accept:"application/json"};if(e.bearer)t.authorization=`Bearer ${e.bearer}`;let r={method:e.method,headers:t};if(e.method==="PUT")t["content-type"]="application/json",r={...r,body:JSON.stringify(e.body)};let n;try{n=await e.fetchImpl(e.url,r)}catch(s){let a=s instanceof Error?s.message:String(s);throw new D(`control-plane request failed: ${a}`)}if(n.status<200||n.status>=300){let s="";try{let a=await n.text();s=a?`: ${a.slice(0,240)}`:""}catch{}throw new D(`control-plane Spec sync HTTP ${n.status}${s}`)}let i;try{i=await n.json()}catch{throw new D("control-plane Spec sync returned non-JSON body")}let o=i;if(!o||o.schema!==Cd||!Array.isArray(o.files))throw new D("control-plane Spec sync response missing uibot.spec.sync.v1 shape");return o}function xd(e,t){let r=t.env??process.env,n=t.controlPlaneUrl??e.controlPlaneUrl;if(!n)return null;let i=t.projectId??e.projectId,o=Qt(n),s={...e,controlPlaneUrl:o,...i?{projectId:Xt(i)}:{},updatedAt:new Date().toISOString()},a=VE(r);return{config:s,url:KE(o,s.projectId),...a?{bearer:a}:{}}}function De(e,t,r,n){let i=e.log??((s)=>console.log(s)),o=e.error??((s)=>console.error(s));if(e.mode==="json")i(JSON.stringify({ok:t,...r}));else if(t)for(let s of n)i(s);else o(`uibot sync: ${String(r.error??"failed")}`);return t?0:1}function pt(e){let t=ae(e),r=hd(e),{digest:n,files:i}=jE(t),o={schema:_E,digest:n,files:i,updatedAt:new Date().toISOString()};qE(r,o);let s={...e,digest:n,updatedAt:o.updatedAt};return Go(s),{config:s,lock:o}}async function vd(e={}){try{let t=Rd(e.cwd??process.cwd()),r=Dn(t);if(r={...r,consumerRoot:t},e.from){let{sourceDir:d,config:p}=Tn(r,e.from);if(!Wo(ae(p),p.consumerRoot))throw new D("specDir escapes consumer root");let f=ae(p),{copied:u}=On(d,f),{config:m,lock:g}=pt(p);return De(e,!0,{action:"push",mode:"local",from:d,to:f,copied:u,digest:g.digest,lockPath:m.lockPath},[`sync push: ${u.length} YAML file(s) ${d} \u2192 ${f}`,`digest: ${g.digest}`])}let n=xd(r,e);if(n&&!e.from){let d=e.fetchImpl??fetch,p=await wd({url:n.url,method:"GET",...n.bearer?{bearer:n.bearer}:{},fetchImpl:d}),f=ae(n.config);if(!Wo(f,n.config.consumerRoot))throw new D("specDir escapes consumer root");let{copied:u}=BE(p.files,f),{config:m,lock:g}=pt(n.config);return De(e,!0,{action:"push",mode:"remote",from:n.url,to:f,copied:u,remoteDigest:p.digest,digest:g.digest,lockPath:m.lockPath,projectId:p.projectId},[`sync push (remote): ${u.length} YAML file(s) ${n.url} \u2192 ${f}`,`digest: ${g.digest}`])}let{sourceDir:i,config:o}=Tn(r,e.from);if(!Wo(ae(o),o.consumerRoot))throw new D("specDir escapes consumer root");let s=ae(o),{copied:a}=On(i,s),{config:c,lock:l}=pt(o);return De(e,!0,{action:"push",mode:"local",from:i,to:s,copied:a,digest:l.digest,lockPath:c.lockPath},[`sync push: ${a.length} YAML file(s) ${i} \u2192 ${s}`,`digest: ${l.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return De(e,!1,{action:"push",error:r},[])}}async function Ed(e={}){try{let t=Rd(e.cwd??process.cwd()),r=Dn(t);r={...r,consumerRoot:t};let n=e.to??e.from;if(n){let{sourceDir:f,config:u}=Tn(r,n),m=ae(u);if(!Zt(m))throw new D(`consumer specDir not found: ${m}`);Be(f,{recursive:!0});let{copied:g}=On(m,f),{config:h,lock:b}=pt(u);return De(e,!0,{action:"pull",mode:"local",from:m,to:f,copied:g,digest:b.digest,lockPath:h.lockPath},[`sync pull: ${g.length} YAML file(s) ${m} \u2192 ${f}`,`digest: ${b.digest}`])}let i=xd(r,e);if(i){let f=ae(i.config);if(!Zt(f))throw new D(`consumer specDir not found: ${f}`);let u=UE(f),m=e.fetchImpl??fetch,g=await wd({url:i.url,method:"PUT",...i.bearer?{bearer:i.bearer}:{},body:{schema:Cd,files:u},fetchImpl:m}),{config:h,lock:b}=pt(i.config);return De(e,!0,{action:"pull",mode:"remote",from:f,to:i.url,copied:u.map((S)=>S.path),remoteDigest:g.digest,digest:b.digest,lockPath:h.lockPath,projectId:g.projectId},[`sync pull (remote): ${u.length} YAML file(s) ${f} \u2192 ${i.url}`,`digest: ${b.digest}`])}let o=e.to??e.from,{sourceDir:s,config:a}=Tn(r,o),c=ae(a);if(!Zt(c))throw new D(`consumer specDir not found: ${c}`);Be(s,{recursive:!0});let{copied:l}=On(c,s),{config:d,lock:p}=pt(a);return De(e,!0,{action:"pull",mode:"local",from:c,to:s,copied:l,digest:p.digest,lockPath:d.lockPath},[`sync pull: ${l.length} YAML file(s) ${c} \u2192 ${s}`,`digest: ${p.digest}`])}catch(t){let r=t instanceof Error?t.message:String(t);return De(e,!1,{action:"pull",error:r},[])}}function Nn(e){let t={_:[]};for(let r=0;r<e.length;r+=1){let n=e[r];if(!n.startsWith("--")){t._.push(n);continue}let i=n.slice(2),o=i.indexOf("=");if(o>=0){t[i.slice(0,o)]=i.slice(o+1);continue}let s=e[r+1];if(s!==void 0&&!s.startsWith("--"))t[i]=s,r+=1;else t[i]=!0}return t}function I(e,t){let r=e[t];return typeof r==="string"?r:void 0}var Pd="uibot.resource.envelope.v1",$N=["resource-cli-invalid-mode","resource-cli-invalid-argument","resource-cli-internal-error"];class U extends Error{code;detail;constructor(e,t){super(`${e}: ${t}`);this.code=e;this.detail=t;this.name="ResourceCliError"}}function Xo(e){return{id:e.id,kind:e.kind,title:e.title,description:e.description,...e.category?{category:e.category}:{},...e.tags.length?{tags:e.tags}:{},...e.capabilities.length?{capabilities:e.capabilities}:{},...e.dependencies.length?{dependencies:e.dependencies}:{},source:e.source,maturity:e.receipt.maturity,receiptLevel:e.receipt.level,...e.receipt.evidence.length?{evidence:e.receipt.evidence}:{}}}function HE(e){return{id:e.resource.id,score:e.score,reasons:e.reasons,resource:Xo(e.resource)}}function Ad(){return typeof crypto.randomUUID==="function"?crypto.randomUUID():`resource-${Date.now().toString(36)}`}function Dd(e,t){return{dense:t,encoding:t?"dense-v1":"full",resourceIndexSchemaVersion:e.manifest().schemaVersion}}function zE(e,t,r,n){return{schemaVersion:Pd,requestId:r.requestId??Ad(),command:e,ok:!0,data:t,meta:Dd(r.queryService,n)}}function YE(e,t,r,n){let i=t instanceof H||t instanceof U?t.code:"resource-cli-internal-error",o=t instanceof H||t instanceof U?t.detail:"resource command failed";return{schemaVersion:Pd,requestId:r.requestId??Ad(),command:e,ok:!1,error:{code:i,message:`${i}: ${o}`,detail:o},meta:Dd(r.queryService,n)}}function $n(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string")throw new U("resource-cli-invalid-argument",`--${t} requires a value`);let n=r.split(",").map((i)=>i.trim()).filter(Boolean);if(n.length===0)throw new U("resource-cli-invalid-argument",`--${t} is empty`);return n}function Id(e,t,r){let n=$n(e,t);if(!n)return;for(let i of n)if(!r.includes(i))throw new U("resource-cli-invalid-argument",`--${t}=${i}; expected one of ${r.join(",")}`);return n}function GE(e){let t=Id(e,"kind",ir),r=$n(e,"tag"),n=$n(e,"category"),i=$n(e,"capability"),o=Id(e,"maturity",gt),s=I(e,"limit"),a;if(e.limit!==void 0){if(!s||!/^\d+$/.test(s)||Number(s)<=0)throw new U("resource-cli-invalid-argument",`--limit=${s??"<missing>"}; expected a positive integer`);a=Number(s)}let c=e._.join(" ").trim();return{...c?{text:c}:{},...t?{kinds:t}:{},...r?{tags:r}:{},...n?{categories:n}:{},...i?{capabilities:i}:{},...o?{maturities:o}:{},...a!==void 0?{limit:a}:{}}}function WE(e,t,r){if(e==="manifest"){let n=t;for(let i of n.index.resources)r(`${i.id} ${i.kind} ${i.receipt.maturity} ${i.title}`);return}if(e==="search"){let n=t;for(let i of n.matches)r(`${i.resource.id} ${i.score} ${i.reasons.map((o)=>o.code).join(",")} ${i.resource.title}`);return}r(JSON.stringify(t,null,2))}async function Zo(e,t,r){let n=Nn(t),i=r.log??((d)=>console.log(d)),o=r.errorLog??((d)=>console.error(d)),s=n.dense,a=s===!0,c=I(n,"mode"),l=c??"text";try{let d=Ke.find((g)=>g.name===e),p=new Set(["mode","dense",...d.options.map((g)=>g.name)]),f=Object.keys(n).find((g)=>g!=="_"&&!p.has(g));if(f)throw new U("resource-cli-invalid-argument",`unsupported flag --${f} for ${e}`);if(n.mode!==void 0&&c===void 0)throw new U("resource-cli-invalid-mode","--mode requires text or json");if(l!=="text"&&l!=="json")throw new U("resource-cli-invalid-mode",`${l}; expected text or json`);if(s!==void 0&&s!==!0)throw new U("resource-cli-invalid-argument","--dense does not take a value");if(r.sourceError)throw r.sourceError;let u;switch(e){case"manifest":{if(n._.length>0)throw new U("resource-cli-invalid-argument","manifest does not accept positionals");let g=r.queryService.manifest();u={operations:Ke,index:a?{schemaVersion:g.schemaVersion,resources:g.resources.map(Xo),aliasLookup:Object.entries(g.aliases)}:g};break}case"search":{let g=r.queryService.search(GE(n));u={matches:a?g.map(HE):g};break}case"get":{if(n._.length!==1)throw new U("resource-cli-invalid-argument","get requires exactly one id or quoted alias");let g=r.queryService.get(n._[0]);u={resource:a?Xo(g):g};break}case"docs":case"examples":case"install-plan":{if(n._.length!==1)throw new U("resource-cli-invalid-argument",`${e} requires one resource id`);let g=n._[0],h=I(n,"locale")??"zh";if(e==="docs"&&h!=="zh"&&h!=="en")throw new U("resource-cli-invalid-argument","--locale requires zh or en");if(!(e==="docs"?r.queryService.docs:e==="examples"?r.queryService.examples:r.queryService.installPlan))throw new U("resource-cli-invalid-argument",`${e} is unavailable in this resource source`);let S=I(n,"page"),k=S===void 0?void 0:Number(S);if(n.page!==void 0&&(!Number.isSafeInteger(k)||(k??0)<1))throw new U("resource-cli-invalid-argument","--page requires a positive integer");u=e==="docs"?r.queryService.docs?.(g,h,k):e==="examples"?r.queryService.examples?.(g,k):r.queryService.installPlan?.(g);break}case"build":{u={plan:r.queryService.build(n._)};break}}let m=zE(e,u,r,a);if(l==="json")i(JSON.stringify(m));else WE(e,u,i);return 0}catch(d){let p=d instanceof Error?d:Error(String(d)),f=YE(e,p,r,a);if(l==="json"||c!==void 0)i(JSON.stringify(f));else o(f.error.message);return 1}}import{createHash as JE}from"crypto";import{existsSync as Od,readFileSync as QE}from"fs";import{resolve as ge}from"path";function Td(e){for(let t of e)if(Od(t))return t;return null}function es(e=process.cwd()){return Td([ge(e,"examples/templates"),ge(import.meta.dir,"templates"),ge(import.meta.dir,"../../../examples/templates")])}function ts(e=process.cwd()){return Td([ge(e,"examples/shells"),ge(import.meta.dir,"shells"),ge(import.meta.dir,"../../../examples/shells")])}function XE(e){let t={};for(let r of e)for(let[n,i]of Object.entries(r)){if(t[n])throw Error(`duplicate built-in catalog source id: ${n}`);t[n]=i}return t}async function Ld(e){if(e){let d=new URL(e);if(d.protocol!=="https:"&&!(d.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(d.hostname)))throw Error("public-resource-source-must-use-https");let p=await fetch(d,{signal:AbortSignal.timeout(1e4),redirect:"error"});if(!p.ok)throw Error(`public-resource-source-http-${p.status}`);let f=p.body?.getReader();if(!f)throw Error("public-resource-source-empty");let u=[],m=0;try{for(;;){let{value:x,done:O}=await f.read();if(O)break;if(m+=x.byteLength,m>16777216)throw Error("public-resource-source-too-large");u.push(x)}}finally{await f.cancel()}let g=new Uint8Array(m),h=0;for(let x of u)g.set(x,h),h+=x.byteLength;let b=new TextDecoder("utf-8",{fatal:!0}).decode(g),S=JSON.parse(b);lr(S);let{release:k,schemaVersion:v,...E}=S;if(JE("sha256").update(JSON.stringify(E)).digest("hex")!==S.release.sourceHash)throw Error("public-resource-source-hash-mismatch");return Hn(S)}let t=[ge(import.meta.dir,"resources/bundle.json"),ge(import.meta.dir,"../../../public/resources/bundle.json")].find(Od);if(t){let d=JSON.parse(QE(t,"utf8"));return lr(d),Hn(d)}let[r,n,i]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-studio"),Promise.resolve().then(() => (Rn(),{}))]),o=[],s=es();if(s)o.push({dir:s});let a=ts();if(a)o.push({dir:a,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let c=ft(o),l=Object.fromEntries(c.map((d)=>[d.name,d.templateContract]));return cr(us({components:XE([r.CATALOG_ENTRIES,n.STUDIO_CATALOG_ENTRIES]),templates:l,designGuides:Sn(ge(import.meta.dir,"../../design-md/content")),examples:ls(l)}))}async function ZE(){let[e,t,r,n]=await Promise.all([import("@uibot/blocks-shadcn"),import("@uibot/blocks-shadcn/registry-source"),import("@uibot/blocks-studio"),import("@uibot/blocks-studio/registry-source")]);return ss([{sourceDir:t.SOURCE_DIR,blockFileMap:t.BLOCK_FILE,catalog:e.CATALOG_ENTRIES},{sourceDir:n.SOURCE_DIR,blockFileMap:n.BLOCK_FILE,catalog:r.STUDIO_CATALOG_ENTRIES}])}function ee(e,t){if(I(e,"mode")==="json")console.log(JSON.stringify({schema:"uibot.cli.error.v1",ok:!1,error:t}));else console.error(t);return 1}async function Nd(e){if(e[0]==="resource")return Nd(e.slice(1));let[t,...r]=e,n=Nn(r),i=I(n,"registry");switch(t){case"manifest":case"search":case"get":case"build":case"docs":case"examples":case"install-plan":{let o=I(n,"source"),s=r.indexOf("--source"),a=s>=0?r.filter((c,l)=>l!==s&&l!==s+1):r.filter((c)=>!c.startsWith("--source="));try{let c=await Ld(o);return Zo(t,a,{queryService:c})}catch(c){return Zo(t,a,{queryService:{manifest:()=>({schemaVersion:"uibot.resource.index.v1",resources:[],aliases:{}}),search:()=>[],get:()=>{throw Error("unavailable")},build:()=>{throw Error("unavailable")}},sourceError:c instanceof Error?c:Error("resource source unavailable")})}}case"list":return await Es({...i?{registry:i}:{}}),0;case"add":{let o=n._[0];if(!o)return ee(n,"uibot add: missing artifact <name>");return await vs(o,{...i?{registry:i}:{},workspaceRoot:I(n,"cwd")??process.cwd()}),0}case"publish":{let o=await ZE(),s=[],a=es();if(a)s.push({dir:a});let c=ts();if(c)s.push({dir:c,defaultLevel:"L3",defaultCategory:"feature",extraKeywords:["sidebar","app-shell","shell"]});let l=ft(s);return await Ps({out:I(n,"out")??"dist/registry",manifestName:I(n,"name")??"uibot",sources:o,...l.length?{templates:l}:{}}),0}case"design-md":{if(n._[0]!=="sync")return ee(n,"uibot design-md: expected subcommand 'sync'");let s=I(n,"from");if(!s)return ee(n,"uibot design-md sync: missing --from <github:owner/repo|https-url>");let c=I(n,"mode")==="json"?"json":"text",l=I(n,"license"),{code:d}=await Uu({from:s,cwd:I(n,"cwd")??process.cwd(),mode:c,...l?{license:l}:{},dryRun:n["dry-run"]===!0});return d}case"regressions":{if(n._[0]!=="reverify")return ee(n,"uibot regressions: expected subcommand 'reverify'");let s=I(n,"mode")==="json"?"json":"text",a=I(n,"skill"),{code:c}=await ed({cwd:I(n,"cwd")??process.cwd(),mode:s,...a?{skillId:a}:{}});return c}case"skills":{let o=n._[0],s=n._[1],a=I(n,"mode")==="json"?"json":"text",c=I(n,"cwd")??process.cwd();if(o==="promote"){if(!s)return ee(n,"uibot skills promote: missing <id>");return id(s,{cwd:c,mode:a})}if(o==="rollback"){if(!s)return ee(n,"uibot skills rollback: missing <id>");return od(s,{cwd:c,mode:a})}return ee(n,"uibot skills: expected promote|rollback <id>")}case"project":{let o=n._[0],s=n._[1];if(o!=="export"||!s)return ee(n,"uibot project: expected export <dir>");let a=I(n,"mode")==="json"?"json":"text";return sd(s,{cwd:I(n,"cwd")??process.cwd(),mode:a})}case"link":{let o=I(n,"spec-dir")??n._[0];if(!o||typeof o!=="string")return ee(n,"uibot link: missing --spec-dir <relative-dir> (or positional <spec-dir>)");let s=I(n,"source-dir"),a=I(n,"control-plane-url"),c=I(n,"project-id"),l=I(n,"lock-path"),{code:d}=md({cwd:I(n,"cwd")??process.cwd(),specDir:o,...s?{sourceDir:s}:{},...a?{controlPlaneUrl:a}:{},...c?{projectId:c}:{},...l?{lockPath:l}:{},force:n.force===!0,mode:I(n,"mode")==="json"?"json":"text"});return d}case"sync":{let o=n._[0];if(o!=="push"&&o!=="pull")return ee(n,"uibot sync: expected subcommand 'push' or 'pull'");let s=I(n,"mode")==="json"?"json":"text",a=I(n,"cwd")??process.cwd(),c=I(n,"from"),l=I(n,"to"),d=I(n,"control-plane-url"),p=I(n,"project-id");if(o==="push")return vd({cwd:a,mode:s,...c?{from:c}:{},...d?{controlPlaneUrl:d}:{},...p?{projectId:p}:{}});return Ed({cwd:a,mode:s,...l?{to:l}:{},...c&&!l?{from:c}:{},...d?{controlPlaneUrl:d}:{},...p?{projectId:p}:{}})}case"doctor":{let o=I(n,"registry");return ad({cwd:I(n,"cwd")??process.cwd(),mode:I(n,"mode")==="json"?"json":"text",...o?{registry:o}:{}})}case"init":{let o=I(n,"into");if(o){let c=I(n,"spec-path"),l=I(n,"mount-path"),{code:d}=pd({into:o,...c?{specPath:c}:{},...l?{mountPath:l}:{},force:n.force===!0,mode:I(n,"mode")==="json"?"json":"text"});return d}let s=n._[0];if(!s)return ee(n,"uibot init: missing <dir> (or use --into <existing-app>)");let a=I(n,"template");return await dd({dir:s,...a?{template:a}:{}}),0}case"help":case"--help":case"-h":case void 0:return console.log(Jn()),0;default:{let o=`uibot: unknown command '${t}'`;if(I(n,"mode")==="json")return ee(n,o);return console.error(`${o}
|
|
404
|
+
`),console.error(Jn()),1}}}if(import.meta.main)Nd(process.argv.slice(2)).then((e)=>{if(e!==0)process.exit(e)}).catch((e)=>{console.error(e instanceof Error?e.message:String(e)),process.exit(1)});export{Nd as main};
|