@fidget-code/rscripts 1.0.0 → 1.1.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/index.cjs +42 -17
- package/package.json +6 -5
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by esbuild
|
|
2
|
-
// Built on 3/29/2026 @
|
|
2
|
+
// Built on 3/29/2026 @ 3:16:59 PM
|
|
3
3
|
|
|
4
4
|
"use strict";var Sc=Object.create;var yr=Object.defineProperty;var Oc=Object.getOwnPropertyDescriptor;var _c=Object.getOwnPropertyNames;var Ac=Object.getPrototypeOf,kc=Object.prototype.hasOwnProperty;var y=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Ec=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _c(e))!kc.call(i,n)&&n!==t&&yr(i,n,{get:()=>e[n],enumerable:!(s=Oc(e,n))||s.enumerable});return i};var V=(i,e,t)=>(t=i!=null?Sc(Ac(i)):{},Ec(e||!i||!i.__esModule?yr(t,"default",{value:i,enumerable:!0}):t,i));var Qe=y(Gs=>{var Mt=class extends Error{constructor(e,t,s){super(s),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Ys=class extends Mt{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Gs.CommanderError=Mt;Gs.InvalidArgumentError=Ys});var Ft=y(Js=>{var{InvalidArgumentError:Cc}=Qe(),Ws=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,s)=>{if(!this.argChoices.includes(t))throw new Cc(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,s):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Nc(i){let e=i.name()+(i.variadic===!0?"...":"");return i.required?"<"+e+">":"["+e+"]"}Js.Argument=Ws;Js.humanReadableArgName=Nc});var Qs=y(br=>{var{humanReadableArgName:Tc}=Ft(),zs=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(n=>!n._hidden),s=e._getHelpCommand();return s&&!s._hidden&&t.push(s),this.sortSubcommands&&t.sort((n,r)=>n.name().localeCompare(r.name())),t}compareOptions(e,t){let s=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return s(e).localeCompare(s(t))}visibleOptions(e){let t=e.options.filter(n=>!n.hidden),s=e._getHelpOption();if(s&&!s.hidden){let n=s.short&&e._findOption(s.short),r=s.long&&e._findOption(s.long);!n&&!r?t.push(s):s.long&&!r?t.push(e.createOption(s.long,s.description)):s.short&&!n&&t.push(e.createOption(s.short,s.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let s=e.parent;s;s=s.parent){let n=s.options.filter(r=>!r.hidden);t.push(...n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(s=>Tc(s)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((s,n)=>Math.max(s,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((s,n)=>Math.max(s,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((s,n)=>Math.max(s,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((s,n)=>Math.max(s,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let s="";for(let n=e.parent;n;n=n.parent)s=n.name()+" "+s;return s+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(s=>JSON.stringify(s)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(s=>JSON.stringify(s)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let s=`(${t.join(", ")})`;return e.description?`${e.description} ${s}`:s}return e.description}formatHelp(e,t){let s=t.padWidth(e,t),n=t.helpWidth||80,r=2,o=2;function a(g,d){if(d){let m=`${g.padEnd(s+o)}${d}`;return t.wrap(m,n-r,s+o)}return g}function l(g){return g.join(`
|
|
5
5
|
`).replace(/^/gm," ".repeat(r))}let c=[`Usage: ${t.commandUsage(e)}`,""],f=t.commandDescription(e);f.length>0&&(c=c.concat([t.wrap(f,n,0),""]));let u=t.visibleArguments(e).map(g=>a(t.argumentTerm(g),t.argumentDescription(g)));u.length>0&&(c=c.concat(["Arguments:",l(u),""]));let h=t.visibleOptions(e).map(g=>a(t.optionTerm(g),t.optionDescription(g)));if(h.length>0&&(c=c.concat(["Options:",l(h),""])),this.showGlobalOptions){let g=t.visibleGlobalOptions(e).map(d=>a(t.optionTerm(d),t.optionDescription(d)));g.length>0&&(c=c.concat(["Global Options:",l(g),""]))}let p=t.visibleCommands(e).map(g=>a(t.subcommandTerm(g),t.subcommandDescription(g)));return p.length>0&&(c=c.concat(["Commands:",l(p),""])),c.join(`
|
|
@@ -55,15 +55,15 @@ ${c}${A}`}function Lu(i,e,t,s){let{type:n,value:r}=i,{actualString:o,implicitKey
|
|
|
55
55
|
`)?Me(r,e):ts(i,e,t,s);if(!a&&!f&&n!==ie.Scalar.PLAIN&&r.includes(`
|
|
56
56
|
`))return ts(i,e,t,s);if(is(r)){if(l==="")return e.forceBlockIndent=!0,ts(i,e,t,s);if(a&&l===c)return Me(r,e)}let u=r.replace(/\n+/g,`$&
|
|
57
57
|
${l}`);if(o){let h=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:p,tags:g}=e.doc.schema;if(g.some(h)||p?.some(h))return Me(r,e)}return a?u:pe.foldFlowLines(u,l,pe.FOLD_FLOW,ss(e,!1))}function Pu(i,e,t,s){let{implicitKey:n,inFlow:r}=e,o=typeof i.value=="string"?i:Object.assign({},i,{value:String(i.value)}),{type:a}=i;a!==ie.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ie.Scalar.QUOTE_DOUBLE);let l=f=>{switch(f){case ie.Scalar.BLOCK_FOLDED:case ie.Scalar.BLOCK_LITERAL:return n||r?Me(o.value,e):ts(o,e,t,s);case ie.Scalar.QUOTE_DOUBLE:return lt(o.value,e);case ie.Scalar.QUOTE_SINGLE:return ki(o.value,e);case ie.Scalar.PLAIN:return Lu(o,e,t,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:f,defaultStringType:u}=e.options,h=n&&f||u;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}mo.stringifyString=Pu});var ut=y(Ci=>{"use strict";var Mu=Gt(),me=k(),Fu=ot(),Du=ct();function ju(i,e){let t=Object.assign({blockQuote:!0,commentString:Fu.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,trueStr:"true",verifyAliasOrder:!0},i.schema.toStringOptions,e),s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:i,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function Bu(i,e){if(e.tag){let n=i.filter(r=>r.tag===e.tag);if(n.length>0)return n.find(r=>r.format===e.format)??n[0]}let t,s;if(me.isScalar(e)){s=e.value;let n=i.filter(r=>r.identify?.(s));t=n.find(r=>r.format===e.format)??n.find(r=>!r.format)}else s=e,t=i.find(n=>n.nodeClass&&s instanceof n.nodeClass);if(!t){let n=s?.constructor?.name??typeof s;throw new Error(`Tag not resolved for ${n} value`)}return t}function Ru(i,e,{anchors:t,doc:s}){if(!s.directives)return"";let n=[],r=(me.isScalar(i)||me.isCollection(i))&&i.anchor;r&&Mu.anchorIsValid(r)&&(t.add(r),n.push(`&${r}`));let o=i.tag?i.tag:e.default?null:e.tag;return o&&n.push(s.directives.tagString(o)),n.join(" ")}function Vu(i,e,t,s){if(me.isPair(i))return i.toString(e,t,s);if(me.isAlias(i)){if(e.doc.directives)return i.toString(e);if(e.resolvedAliases?.has(i))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(i):e.resolvedAliases=new Set([i]),i=i.resolve(e.doc)}let n,r=me.isNode(i)?i:e.doc.createNode(i,{onTagObj:l=>n=l});n||(n=Bu(e.doc.schema.tags,r));let o=Ru(r,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof n.stringify=="function"?n.stringify(r,e,t,s):me.isScalar(r)?Du.stringifyString(r,e,t,s):r.toString(e,t,s);return o?me.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
58
|
-
${e.indent}${a}`:a}Ci.createStringifyContext=ju;Ci.stringify=Vu});var wo=y(bo=>{"use strict";var ce=k(),go=F(),yo=ut(),ft=ot();function Uu({key:i,value:e},t,s,n){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:f,simpleKeys:u}}=t,h=ce.isNode(i)&&i.comment||null;if(u){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(ce.isCollection(i)||!ce.isNode(i)&&typeof i=="object"){let
|
|
58
|
+
${e.indent}${a}`:a}Ci.createStringifyContext=ju;Ci.stringify=Vu});var wo=y(bo=>{"use strict";var ce=k(),go=F(),yo=ut(),ft=ot();function Uu({key:i,value:e},t,s,n){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:f,simpleKeys:u}}=t,h=ce.isNode(i)&&i.comment||null;if(u){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(ce.isCollection(i)||!ce.isNode(i)&&typeof i=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let p=!u&&(!i||h&&e==null&&!t.inFlow||ce.isCollection(i)||(ce.isScalar(i)?i.type===go.Scalar.BLOCK_FOLDED||i.type===go.Scalar.BLOCK_LITERAL:typeof i=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(u||!r),indent:a+l});let g=!1,d=!1,m=yo.stringify(i,t,()=>g=!0,()=>d=!0);if(!p&&!t.inFlow&&m.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(r||e==null)return g&&s&&s(),m===""?"?":p?`? ${m}`:m}else if(r&&!u||e==null&&p)return m=`? ${m}`,h&&!g?m+=ft.lineComment(m,t.indent,c(h)):d&&n&&n(),m;g&&(h=null),p?(h&&(m+=ft.lineComment(m,t.indent,c(h))),m=`? ${m}
|
|
59
59
|
${a}:`):(m=`${m}:`,h&&(m+=ft.lineComment(m,t.indent,c(h))));let w,b,O;ce.isNode(e)?(w=!!e.spaceBefore,b=e.commentBefore,O=e.comment):(w=!1,b=null,O=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!h&&ce.isScalar(e)&&(t.indentAtStart=m.length+1),d=!1,!f&&l.length>=2&&!t.inFlow&&!p&&ce.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let _=!1,A=yo.stringify(e,t,()=>_=!0,()=>d=!0),S=" ";if(h||w||b){if(S=w?`
|
|
60
|
-
`:"",b){let
|
|
61
|
-
${ft.indentComment(
|
|
60
|
+
`:"",b){let x=c(b);S+=`
|
|
61
|
+
${ft.indentComment(x,t.indent)}`}A===""&&!t.inFlow?S===`
|
|
62
62
|
`&&(S=`
|
|
63
63
|
|
|
64
64
|
`):S+=`
|
|
65
|
-
${t.indent}`}else if(!p&&ce.isCollection(e)){let
|
|
66
|
-
`),I=v!==-1,Q=t.inFlow??e.flow??e.items.length===0;if(I||!Q){let
|
|
65
|
+
${t.indent}`}else if(!p&&ce.isCollection(e)){let x=A[0],v=A.indexOf(`
|
|
66
|
+
`),I=v!==-1,Q=t.inFlow??e.flow??e.items.length===0;if(I||!Q){let q=!1;if(I&&(x==="&"||x==="!")){let T=A.indexOf(" ");x==="&"&&T!==-1&&T<v&&A[T+1]==="!"&&(T=A.indexOf(" ",T+1)),(T===-1||v<T)&&(q=!0)}q||(S=`
|
|
67
67
|
${t.indent}`)}}else(A===""||A[0]===`
|
|
68
68
|
`)&&(S="");return m+=S+A,t.inFlow?_&&s&&s():O&&!_?m+=ft.lineComment(m,t.indent,c(O)):d&&n&&n(),m}bo.stringifyPair=Uu});var Ti=y(Ni=>{"use strict";function Ku(i,...e){i==="debug"&&console.log(...e)}function Hu(i,e){(i==="debug"||i==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Ni.debug=Ku;Ni.warn=Hu});var qi=y(So=>{"use strict";var Yu=Ti(),Gu=ut(),Fe=k(),Wu=F(),$i=he(),vo="<<";function Ju(i,e,{key:t,value:s}){if(i?.doc.schema.merge&&zu(t))if(s=Fe.isAlias(s)?s.resolve(i.doc):s,Fe.isSeq(s))for(let n of s.items)xi(i,e,n);else if(Array.isArray(s))for(let n of s)xi(i,e,n);else xi(i,e,s);else{let n=$i.toJS(t,"",i);if(e instanceof Map)e.set(n,$i.toJS(s,n,i));else if(e instanceof Set)e.add(n);else{let r=Qu(t,n,i),o=$i.toJS(s,r,i);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}var zu=i=>i===vo||Fe.isScalar(i)&&i.value===vo&&(!i.type||i.type===Wu.Scalar.PLAIN);function xi(i,e,t){let s=i&&Fe.isAlias(t)?t.resolve(i.doc):t;if(!Fe.isMap(s))throw new Error("Merge sources must be maps or map aliases");let n=s.toJSON(null,i,Map);for(let[r,o]of n)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Qu(i,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Fe.isNode(i)&&t?.doc){let s=Gu.createStringifyContext(t.doc,{});s.anchors=new Set;for(let r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;let n=i.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(n);r.length>40&&(r=r.substring(0,36)+'..."'),Yu.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return n}return JSON.stringify(e)}So.addPairToJSMap=Ju});var ge=y(Ii=>{"use strict";var Oo=rt(),Zu=wo(),Xu=qi(),ns=k();function ef(i,e,t){let s=Oo.createNode(i,void 0,t),n=Oo.createNode(e,void 0,t);return new rs(s,n)}var rs=class i{constructor(e,t=null){Object.defineProperty(this,ns.NODE_TYPE,{value:ns.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return ns.isNode(t)&&(t=t.clone(e)),ns.isNode(s)&&(s=s.clone(e)),new i(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return Xu.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?Zu.stringifyPair(this,e,t,s):JSON.stringify(this)}};Ii.Pair=rs;Ii.createPair=ef});var Li=y(Ao=>{"use strict";var Ae=k(),_o=ut(),os=ot();function tf(i,e,t){return(e.inFlow??i.flow?nf:sf)(i,e,t)}function sf({comment:i,items:e},t,{blockItemPrefix:s,flowChars:n,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,f=Object.assign({},t,{indent:r,type:null}),u=!1,h=[];for(let g=0;g<e.length;++g){let d=e[g],m=null;if(Ae.isNode(d))!u&&d.spaceBefore&&h.push(""),as(t,h,d.commentBefore,u),d.comment&&(m=d.comment);else if(Ae.isPair(d)){let b=Ae.isNode(d.key)?d.key:null;b&&(!u&&b.spaceBefore&&h.push(""),as(t,h,b.commentBefore,u))}u=!1;let w=_o.stringify(d,f,()=>m=null,()=>u=!0);m&&(w+=os.lineComment(w,r,c(m))),u&&m&&(u=!1),h.push(s+w)}let p;if(h.length===0)p=n.start+n.end;else{p=h[0];for(let g=1;g<h.length;++g){let d=h[g];p+=d?`
|
|
69
69
|
${l}${d}`:`
|
|
@@ -83,13 +83,13 @@ ${r.comment}`:s.comment}s=n}i.items[t]=gs.isPair(s)?s:new Gi.Pair(s)}}else e("Ex
|
|
|
83
83
|
|
|
84
84
|
${o}
|
|
85
85
|
${c}
|
|
86
|
-
`}};vt.YAMLError=wt;vt.YAMLParseError=yn;vt.YAMLWarning=bn;vt.prettifyError=Ph});var Ot=y(Oa=>{"use strict";function Mh(i,{flow:e,indicator:t,next:s,offset:n,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,f=a,u="",h="",p=!1,g=!1,d=null,m=null,w=null,b=null,O=null,_=null,A=null;for(let v of i)switch(g&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&r(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),d&&(c&&v.type!=="comment"&&v.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),v.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&v.source.includes(" ")&&(d=v),f=!0;break;case"comment":{f||r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let I=v.source.substring(1)||" ";u?u+=h+I:u=I,h="",c=!1;break}case"newline":c?u?u+=v.source:l=!0:h+=v.source,c=!0,p=!0,(m||w)&&(b=v),f=!0;break;case"anchor":m&&r(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&r(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=v,A===null&&(A=v.offset),c=!1,f=!1,g=!0;break;case"tag":{w&&r(v,"MULTIPLE_TAGS","A node can have at most one tag"),w=v,A===null&&(A=v.offset),c=!1,f=!1,g=!0;break}case t:(m||w)&&r(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),_&&r(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${e??"collection"}`),_=v,c=t==="seq-item-ind"||t==="explicit-key-ind",f=!1;break;case"comma":if(e){O&&r(v,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),O=v,c=!1,f=!1;break}default:r(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),c=!1,f=!1}let S=i[i.length-1]
|
|
86
|
+
`}};vt.YAMLError=wt;vt.YAMLParseError=yn;vt.YAMLWarning=bn;vt.prettifyError=Ph});var Ot=y(Oa=>{"use strict";function Mh(i,{flow:e,indicator:t,next:s,offset:n,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,f=a,u="",h="",p=!1,g=!1,d=null,m=null,w=null,b=null,O=null,_=null,A=null;for(let v of i)switch(g&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&r(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),d&&(c&&v.type!=="comment"&&v.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),v.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&v.source.includes(" ")&&(d=v),f=!0;break;case"comment":{f||r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let I=v.source.substring(1)||" ";u?u+=h+I:u=I,h="",c=!1;break}case"newline":c?u?u+=v.source:l=!0:h+=v.source,c=!0,p=!0,(m||w)&&(b=v),f=!0;break;case"anchor":m&&r(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&r(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=v,A===null&&(A=v.offset),c=!1,f=!1,g=!0;break;case"tag":{w&&r(v,"MULTIPLE_TAGS","A node can have at most one tag"),w=v,A===null&&(A=v.offset),c=!1,f=!1,g=!0;break}case t:(m||w)&&r(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),_&&r(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${e??"collection"}`),_=v,c=t==="seq-item-ind"||t==="explicit-key-ind",f=!1;break;case"comma":if(e){O&&r(v,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),O=v,c=!1,f=!1;break}default:r(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),c=!1,f=!1}let S=i[i.length-1],x=S?S.offset+S.source.length:n;return g&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:O,found:_,spaceBefore:l,comment:u,hasNewline:p,anchor:m,tag:w,newlineAfterProp:b,end:x,start:A??x}}Oa.resolveProps=Mh});var Ns=y(_a=>{"use strict";function wn(i){if(!i)return null;switch(i.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(i.source.includes(`
|
|
87
87
|
`))return!0;if(i.end){for(let e of i.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of i.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(wn(e.key)||wn(e.value))return!0}return!1;default:return!0}}_a.containsNewline=wn});var vn=y(Aa=>{"use strict";var Fh=Ns();function Dh(i,e,t){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===i&&(s.source==="]"||s.source==="}")&&Fh.containsNewline(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Aa.flowIndentCheck=Dh});var Sn=y(Ea=>{"use strict";var ka=k();function jh(i,e,t){let{uniqueKeys:s}=i.options;if(s===!1)return!1;let n=typeof s=="function"?s:(r,o)=>r===o||ka.isScalar(r)&&ka.isScalar(o)&&r.value===o.value&&!(r.value==="<<"&&i.schema.merge);return e.some(r=>n(r.key,t))}Ea.mapIncludes=jh});var qa=y(xa=>{"use strict";var Ca=ge(),Bh=be(),Na=Ot(),Rh=Ns(),Ta=vn(),Vh=Sn(),$a="All mapping items must start at the same column";function Uh({composeNode:i,composeEmptyNode:e},t,s,n,r){let o=r?.nodeClass??Bh.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=s.offset,c=null;for(let f of s.items){let{start:u,key:h,sep:p,value:g}=f,d=Na.resolveProps(u,{indicator:"explicit-key-ind",next:h??p?.[0],offset:l,onError:n,parentIndent:s.indent,startOnNewline:!0}),m=!d.found;if(m){if(h&&(h.type==="block-seq"?n(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==s.indent&&n(l,"BAD_INDENT",$a)),!d.anchor&&!d.tag&&!p){c=d.end,d.comment&&(a.comment?a.comment+=`
|
|
88
88
|
`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||Rh.containsNewline(h))&&n(h??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==s.indent&&n(l,"BAD_INDENT",$a);let w=d.end,b=h?i(t,h,d,n):e(t,w,u,null,d,n);t.schema.compat&&Ta.flowIndentCheck(s.indent,h,n),Vh.mapIncludes(t,a.items,b)&&n(w,"DUPLICATE_KEY","Map keys must be unique");let O=Na.resolveProps(p??[],{indicator:"map-value-ind",next:g,offset:b.range[2],onError:n,parentIndent:s.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=O.end,O.found){m&&(g?.type==="block-map"&&!O.hasNewline&&n(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<O.found.offset-1024&&n(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let _=g?i(t,g,O,n):e(t,l,p,null,O,n);t.schema.compat&&Ta.flowIndentCheck(s.indent,g,n),l=_.range[2];let A=new Ca.Pair(b,_);t.options.keepSourceTokens&&(A.srcToken=f),a.items.push(A)}else{m&&n(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),O.comment&&(b.comment?b.comment+=`
|
|
89
89
|
`+O.comment:b.comment=O.comment);let _=new Ca.Pair(b);t.options.keepSourceTokens&&(_.srcToken=f),a.items.push(_)}}return c&&c<l&&n(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}xa.resolveBlockMap=Uh});var La=y(Ia=>{"use strict";var Kh=we(),Hh=Ot(),Yh=vn();function Gh({composeNode:i,composeEmptyNode:e},t,s,n,r){let o=r?.nodeClass??Kh.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=s.offset,c=null;for(let{start:f,value:u}of s.items){let h=Hh.resolveProps(f,{indicator:"seq-item-ind",next:u,offset:l,onError:n,parentIndent:s.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||u)u&&u.type==="block-seq"?n(h.end,"BAD_INDENT","All sequence items must start at the same column"):n(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(a.comment=h.comment);continue}let p=u?i(t,u,h,n):e(t,h.end,f,null,h,n);t.schema.compat&&Yh.flowIndentCheck(s.indent,u,n),l=p.range[2],a.items.push(p)}return a.range=[s.offset,l,c??l],a}Ia.resolveBlockSeq=Gh});var Ue=y(Pa=>{"use strict";function Wh(i,e,t,s){let n="";if(i){let r=!1,o="";for(let a of i){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=l.substring(1)||" ";n?n+=o+f:n=f,o="";break}case"newline":n&&(o+=l),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:n,offset:e}}Pa.resolveEnd=Wh});var ja=y(Da=>{"use strict";var Jh=k(),zh=ge(),Ma=be(),Qh=we(),Zh=Ue(),Fa=Ot(),Xh=Ns(),ed=Sn(),On="Block collections are not allowed within flow collections",_n=i=>i&&(i.type==="block-map"||i.type==="block-seq");function td({composeNode:i,composeEmptyNode:e},t,s,n,r){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?Ma.YAMLMap:Qh.YAMLSeq),c=new l(t.schema);c.flow=!0;let f=t.atRoot;f&&(t.atRoot=!1);let u=s.offset+s.start.source.length;for(let m=0;m<s.items.length;++m){let w=s.items[m],{start:b,key:O,sep:_,value:A}=w,S=Fa.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:O??_?.[0],offset:u,onError:n,parentIndent:s.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!_&&!A){m===0&&S.comma?n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<s.items.length-1&&n(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),S.comment&&(c.comment?c.comment+=`
|
|
90
|
-
`+S.comment:c.comment=S.comment),u=S.end;continue}!o&&t.options.strict&&Xh.containsNewline(O)&&n(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)S.comma&&n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(S.comma||n(S.start,"MISSING_CHAR",`Missing , between ${a} items`),S.comment){let
|
|
91
|
-
|
|
92
|
-
`+I.comment:v.comment=I.comment);let
|
|
90
|
+
`+S.comment:c.comment=S.comment),u=S.end;continue}!o&&t.options.strict&&Xh.containsNewline(O)&&n(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)S.comma&&n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(S.comma||n(S.start,"MISSING_CHAR",`Missing , between ${a} items`),S.comment){let x="";e:for(let v of b)switch(v.type){case"comma":case"space":break;case"comment":x=v.source.substring(1);break e;default:break e}if(x){let v=c.items[c.items.length-1];Jh.isPair(v)&&(v=v.value??v.key),v.comment?v.comment+=`
|
|
91
|
+
`+x:v.comment=x,S.comment=S.comment.substring(x.length+1)}}if(!o&&!_&&!S.found){let x=A?i(t,A,S,n):e(t,S.end,_,null,S,n);c.items.push(x),u=x.range[2],_n(A)&&n(x.range,"BLOCK_IN_FLOW",On)}else{let x=S.end,v=O?i(t,O,S,n):e(t,x,b,null,S,n);_n(O)&&n(v.range,"BLOCK_IN_FLOW",On);let I=Fa.resolveProps(_??[],{flow:a,indicator:"map-value-ind",next:A,offset:v.range[2],onError:n,parentIndent:s.indent,startOnNewline:!1});if(I.found){if(!o&&!S.found&&t.options.strict){if(_)for(let T of _){if(T===I.found)break;if(T.type==="newline"){n(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<I.found.offset-1024&&n(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source&&A.source[0]===":"?n(A,"MISSING_CHAR",`Missing space after : in ${a}`):n(I.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Q=A?i(t,A,I,n):I.found?e(t,I.end,_,null,I,n):null;Q?_n(A)&&n(Q.range,"BLOCK_IN_FLOW",On):I.comment&&(v.comment?v.comment+=`
|
|
92
|
+
`+I.comment:v.comment=I.comment);let q=new zh.Pair(v,Q);if(t.options.keepSourceTokens&&(q.srcToken=w),o){let T=c;ed.mapIncludes(t,T.items,v)&&n(x,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(q)}else{let T=new Ma.YAMLMap(t.schema);T.flow=!0,T.items.push(q);let ze=(Q??v).range;T.range=[v.range[0],ze[1],ze[2]],c.items.push(T)}u=Q?Q.range[2]:I.end}}let h=o?"}":"]",[p,...g]=s.end,d=u;if(p&&p.source===h)d=p.offset+p.source.length;else{let m=a[0].toUpperCase()+a.substring(1),w=f?`${m} must end with a ${h}`:`${m} in block collection must be sufficiently indented and end with a ${h}`;n(u,f?"MISSING_CHAR":"BAD_INDENT",w),p&&p.source.length!==1&&g.unshift(p)}if(g.length>0){let m=Zh.resolveEnd(g,d,t.options.strict,n);m.comment&&(c.comment?c.comment+=`
|
|
93
93
|
`+m.comment:c.comment=m.comment),c.range=[s.offset,d,m.offset]}else c.range=[s.offset,d,d];return c}Da.resolveFlowCollection=td});var Ra=y(Ba=>{"use strict";var sd=k(),id=F(),nd=be(),rd=we(),od=qa(),ad=La(),ld=ja();function An(i,e,t,s,n,r){let o=t.type==="block-map"?od.resolveBlockMap(i,e,t,s,r):t.type==="block-seq"?ad.resolveBlockSeq(i,e,t,s,r):ld.resolveFlowCollection(i,e,t,s,r),a=o.constructor;return n==="!"||n===a.tagName?(o.tag=a.tagName,o):(n&&(o.tag=n),o)}function cd(i,e,t,s,n){let r=s.tag,o=r?e.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){let{anchor:h,newlineAfterProp:p}=s,g=h&&r?h.offset>r.offset?h:r:h??r;g&&(!p||p.offset<g.offset)&&n(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===nd.YAMLMap.tagName&&a==="map"||o===rd.YAMLSeq.tagName&&a==="seq")return An(i,e,t,n,o);let l=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){let h=e.schema.knownTags[o];if(h&&h.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?.collection?n(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection}`,!0):n(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),An(i,e,t,n,o)}let c=An(i,e,t,n,o,l),f=l.resolve?.(c,h=>n(r,"TAG_RESOLVE_FAILED",h),e.options)??c,u=sd.isNode(f)?f:new id.Scalar(f);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}Ba.composeCollection=cd});var En=y(Va=>{"use strict";var kn=F();function ud(i,e,t){let s=e.offset,n=fd(e,i.options.strict,t);if(!n)return{value:"",type:null,comment:"",range:[s,s,s]};let r=n.mode===">"?kn.Scalar.BLOCK_FOLDED:kn.Scalar.BLOCK_LITERAL,o=e.source?hd(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let m=o[d][1];if(m===""||m==="\r")a=d;else break}if(a===0){let d=n.chomp==="+"&&o.length>0?`
|
|
94
94
|
`.repeat(Math.max(1,o.length-1)):"",m=s+n.length;return e.source&&(m+=e.source.length),{value:d,type:r,comment:n.comment,range:[s,m,m]}}let l=e.indent+n.indent,c=e.offset+n.length,f=0;for(let d=0;d<a;++d){let[m,w]=o[d];if(w===""||w==="\r")n.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&t(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(l=m.length),f=d,l===0&&!i.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+w.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>l&&(a=d+1);let u="",h="",p=!1;for(let d=0;d<f;++d)u+=o[d][0].slice(l)+`
|
|
95
95
|
`;for(let d=f;d<a;++d){let[m,w]=o[d];c+=m.length+w.length+1;let b=w[w.length-1]==="\r";if(b&&(w=w.slice(0,-1)),w&&m.length<l){let _=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;t(c-w.length-(b?2:1),"BAD_INDENT",_),m=""}r===kn.Scalar.BLOCK_LITERAL?(u+=h+m.slice(l)+w,h=`
|
|
@@ -160,32 +160,57 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
160
160
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
161
161
|
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(n&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):n||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ne(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(vl(t.key)&&!Ne(t.sep,"newline")){let o=He(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(Ne(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=He(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:r,key:null,sep:[this.sourceToken]}):Ne(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);n||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){s&&o.type!=="block-seq"&&e.items.push({start:r}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(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;t.value||Ne(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let n=Ls(s),r=He(n);wl(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
162
162
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
163
|
-
`,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=Ls(e),s=He(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ls(e),s=He(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Sl.Parser=Hn});var El=y(Ct=>{"use strict";var Ol=qn(),rp=bt(),Et=St(),op=Ti(),ap=Kn(),_l=Yn();function Al(i){let e=i.prettyErrors!==!1;return{lineCounter:i.lineCounter||e&&new ap.LineCounter||null,prettyErrors:e}}function lp(i,e={}){let{lineCounter:t,prettyErrors:s}=Al(e),n=new _l.Parser(t?.addNewLine),r=new Ol.Composer(e),o=Array.from(r.compose(n.parse(i)));if(s&&t)for(let a of o)a.errors.forEach(Et.prettifyError(i,t)),a.warnings.forEach(Et.prettifyError(i,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function kl(i,e={}){let{lineCounter:t,prettyErrors:s}=Al(e),n=new _l.Parser(t?.addNewLine),r=new Ol.Composer(e),o=null;for(let a of r.compose(n.parse(i),!0,i.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Et.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(Et.prettifyError(i,t)),o.warnings.forEach(Et.prettifyError(i,t))),o}function cp(i,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);let n=kl(i,t);if(!n)return null;if(n.warnings.forEach(r=>op.warn(n.options.logLevel,r)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:s},t))}function up(i,e,t){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let n=Math.round(t);t=n<1?void 0:n>8?{indent:8}:{indent:n}}if(i===void 0){let{keepUndefined:n}=t??e??{};if(!n)return}return new rp.Document(i,s,t).toString(t)}Ct.parse=cp;Ct.parseAllDocuments=lp;Ct.parseDocument=kl;Ct.stringify=up});var Nl=y(E=>{"use strict";var fp=qn(),hp=bt(),dp=hn(),Gn=St(),pp=nt(),ve=k(),mp=ge(),gp=F(),yp=be(),bp=we(),wp=qs(),vp=Vn(),Sp=Kn(),Op=Yn(),Ps=El(),Cl=et();E.Composer=fp.Composer;E.Document=hp.Document;E.Schema=dp.Schema;E.YAMLError=Gn.YAMLError;E.YAMLParseError=Gn.YAMLParseError;E.YAMLWarning=Gn.YAMLWarning;E.Alias=pp.Alias;E.isAlias=ve.isAlias;E.isCollection=ve.isCollection;E.isDocument=ve.isDocument;E.isMap=ve.isMap;E.isNode=ve.isNode;E.isPair=ve.isPair;E.isScalar=ve.isScalar;E.isSeq=ve.isSeq;E.Pair=mp.Pair;E.Scalar=gp.Scalar;E.YAMLMap=yp.YAMLMap;E.YAMLSeq=bp.YAMLSeq;E.CST=wp;E.Lexer=vp.Lexer;E.LineCounter=Sp.LineCounter;E.Parser=Op.Parser;E.parse=Ps.parse;E.parseAllDocuments=Ps.parseAllDocuments;E.parseDocument=Ps.parseDocument;E.stringify=Ps.stringify;E.visit=Cl.visit;E.visitAsync=Cl.visitAsync});var Ml=y((My,Pl)=>{"use strict";function Te(i){this._maxSize=i,this.clear()}Te.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Te.prototype.get=function(i){return this._values[i]};Te.prototype.set=function(i,e){return this._size>=this._maxSize&&this.clear(),i in this._values||this._size++,this._values[i]=e};var Ap=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ll=/^\d+$/,kp=/^\d/,Ep=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Cp=/^\s*(['"]?)(.*?)(\1)\s*$/,Qn=512,xl=new Te(Qn),ql=new Te(Qn),Il=new Te(Qn);Pl.exports={Cache:Te,split:zn,normalizePath:Jn,setter:function(i){var e=Jn(i);return ql.get(i)||ql.set(i,function(s,n){for(var r=0,o=e.length,a=s;r<o-1;){var l=e[r];if(l==="__proto__"||l==="constructor"||l==="prototype")return s;a=a[e[r++]]}a[e[r]]=n})},getter:function(i,e){var t=Jn(i);return Il.get(i)||Il.set(i,function(n){for(var r=0,o=t.length;r<o;)if(n!=null||!e)n=n[t[r++]];else return;return n})},join:function(i){return i.reduce(function(e,t){return e+(Zn(t)||Ll.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(i,e,t){Np(Array.isArray(i)?i:zn(i),e,t)}};function Jn(i){return xl.get(i)||xl.set(i,zn(i).map(function(e){return e.replace(Cp,"$2")}))}function zn(i){return i.match(Ap)||[""]}function Np(i,e,t){var s=i.length,n,r,o,a;for(r=0;r<s;r++)n=i[r],n&&(xp(n)&&(n='"'+n+'"'),a=Zn(n),o=!a&&/^\d+$/.test(n),e.call(t,n,a,o,r,i))}function Zn(i){return typeof i=="string"&&i&&["'",'"'].indexOf(i.charAt(0))!==-1}function Tp(i){return i.match(kp)&&!i.match(Ll)}function $p(i){return Ep.test(i)}function xp(i){return!Zn(i)&&(Tp(i)||$p(i))}});var jl=y((Fy,Dl)=>{var qp=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ms=i=>i.match(qp)||[],Fs=i=>i[0].toUpperCase()+i.slice(1),Xn=(i,e)=>Ms(i).join(e).toLowerCase(),Fl=i=>Ms(i).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),Ip=i=>Fs(Fl(i)),Lp=i=>Xn(i,"_"),Pp=i=>Xn(i,"-"),Mp=i=>Fs(Xn(i," ")),Fp=i=>Ms(i).map(Fs).join(" ");Dl.exports={words:Ms,upperFirst:Fs,camelCase:Fl,pascalCase:Ip,snakeCase:Lp,kebabCase:Pp,sentenceCase:Mp,titleCase:Fp}});var Rl=y((Dy,er)=>{er.exports=function(i){return Bl(Dp(i),i)};er.exports.array=Bl;function Bl(i,e){var t=i.length,s=new Array(t),n={},r=t,o=jp(e),a=Bp(i);for(e.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});r--;)n[r]||l(i[r],r,new Set);return s;function l(c,f,u){if(u.has(c)){var h;try{h=", node was:"+JSON.stringify(c)}catch{h=""}throw new Error("Cyclic dependency"+h)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!n[f]){n[f]=!0;var p=o.get(c)||new Set;if(p=Array.from(p),f=p.length){u.add(c);do{var g=p[--f];l(g,a.get(g),u)}while(f);u.delete(c)}s[--t]=c}}}function Dp(i){for(var e=new Set,t=0,s=i.length;t<s;t++){var n=i[t];e.add(n[0]),e.add(n[1])}return Array.from(e)}function jp(i){for(var e=new Map,t=0,s=i.length;t<s;t++){var n=i[t];e.has(n[0])||e.set(n[0],new Set),e.has(n[1])||e.set(n[1],new Set),e.get(n[0]).add(n[1])}return e}function Bp(i){for(var e=new Map,t=0,s=i.length;t<s;t++)e.set(i[t],t);return e}});var oc=y(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});var $e=Ml(),tr=jl(),Rp=Rl();function Vp(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var Up=Vp(Rp),Kp=Object.prototype.toString,Hp=Error.prototype.toString,Yp=RegExp.prototype.toString,Gp=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Wp=/^Symbol\((.*)\)(.*)$/;function Jp(i){return i!=+i?"NaN":i===0&&1/i<0?"-0":""+i}function Vl(i,e=!1){if(i==null||i===!0||i===!1)return""+i;let t=typeof i;if(t==="number")return Jp(i);if(t==="string")return e?`"${i}"`:i;if(t==="function")return"[Function "+(i.name||"anonymous")+"]";if(t==="symbol")return Gp.call(i).replace(Wp,"Symbol($1)");let s=Kp.call(i).slice(8,-1);return s==="Date"?isNaN(i.getTime())?""+i:i.toISOString(i):s==="Error"||i instanceof Error?"["+Hp.call(i)+"]":s==="RegExp"?Yp.call(i):null}function re(i,e){let t=Vl(i,e);return t!==null?t:JSON.stringify(i,function(s,n){let r=Vl(this[s],e);return r!==null?r:n},2)}function Hl(i){return i==null?[]:[].concat(i)}var Yl,Gl,Wl,zp=/\$\{\s*(\w+)\s*\}/g;Yl=Symbol.toStringTag;var Rs=class{constructor(e,t,s,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Yl]="Error",this.name="ValidationError",this.value=t,this.path=s,this.type=n,this.errors=[],this.inner=[],Hl(e).forEach(r=>{if(U.isError(r)){this.errors.push(...r.errors);let o=r.inner.length?r.inner:[r];this.inner.push(...o)}else this.errors.push(r)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}};Gl=Symbol.hasInstance;Wl=Symbol.toStringTag;var U=class i extends Error{static formatError(e,t){let s=t.label||t.path||"this";return s!==t.path&&(t=Object.assign({},t,{path:s})),typeof e=="string"?e.replace(zp,(n,r)=>re(t[r])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,s,n,r){let o=new Rs(e,t,s,n);if(r)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Wl]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,i)}static[Gl](e){return Rs[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}},ne={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:i,type:e,value:t,originalValue:s})=>{let n=s!=null&&s!==t?` (cast from the value \`${re(s,!0)}\`).`:".";return e!=="mixed"?`${i} must be a \`${e}\` type, but the final value was: \`${re(t,!0)}\``+n:`${i} must match the configured type. The validated value was: \`${re(t,!0)}\``+n}},Y={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Se={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},sr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},ir={isValue:"${path} field must be ${value}"},nr={noUnknown:"${path} field has unspecified keys: ${unknown}"},js={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Jl={notType:i=>{let{path:e,value:t,spec:s}=i,n=s.types.length;if(Array.isArray(t)){if(t.length<n)return`${e} tuple value has too few items, expected a length of ${n} but got ${t.length} for value: \`${re(t,!0)}\``;if(t.length>n)return`${e} tuple value has too many items, expected a length of ${n} but got ${t.length} for value: \`${re(t,!0)}\``}return U.formatError(ne.notType,i)}},zl=Object.assign(Object.create(null),{mixed:ne,string:Y,number:Se,date:sr,object:nr,array:js,boolean:ir,tuple:Jl}),xe=i=>i&&i.__isYupSchema__,Vs=class i{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:r}=t,o=typeof s=="function"?s:(...a)=>a.every(l=>l===s);return new i(e,(a,l)=>{var c;let f=o(...a)?n:r;return(c=f?.(l))!=null?c:l})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let s=this.refs.map(r=>r.getValue(t?.value,t?.parent,t?.context)),n=this.fn(s,e,t);if(n===void 0||n===e)return e;if(!xe(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}},Ds={context:"$",value:"."};function Qp(i,e){return new oe(i,e)}var oe=class{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Ds.context,this.isValue=this.key[0]===Ds.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?Ds.context:this.isValue?Ds.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&$e.getter(this.path,!0),this.map=t.map}getValue(e,t,s){let n=this.isContext?s:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,t?.parent,t?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};oe.prototype.__isYupRef=!0;var ee=i=>i==null;function Ye(i){function e({value:t,path:s="",options:n,originalValue:r,schema:o},a,l){let{name:c,test:f,params:u,message:h,skipAbsent:p}=i,{parent:g,context:d,abortEarly:m=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=n;function b(x){return oe.isRef(x)?x.getValue(t,g,d):x}function O(x={}){let T=Object.assign({value:t,originalValue:r,label:o.spec.label,path:x.path||s,spec:o.spec,disableStackTrace:x.disableStackTrace||w},u,x.params);for(let gr of Object.keys(T))T[gr]=b(T[gr]);let ze=new U(U.formatError(x.message||h,T),t,T.path,x.type||c,T.disableStackTrace);return ze.params=T,ze}let _=m?a:l,A={path:s,parent:g,type:c,from:n.from,createError:O,resolve:b,options:n,originalValue:r,schema:o},S=x=>{U.isError(x)?_(x):x?l(null):_(O())},$=x=>{U.isError(x)?_(x):a(x)};if(p&&ee(t))return S(!0);let I;try{var Q;if(I=f.call(A,t,A),typeof((Q=I)==null?void 0:Q.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${A.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(I).then(S,$)}}catch(x){$(x);return}S(I)}return e.OPTIONS=i,e}function ar(i,e,t,s=t){let n,r,o;return e?($e.forEach(e,(a,l,c)=>{let f=l?a.slice(1,a.length-1):a;i=i.resolve({context:s,parent:n,value:t});let u=i.type==="tuple",h=c?parseInt(f,10):0;if(i.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(t&&h>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);n=t,t=t&&t[h],i=u?i.spec.types[h]:i.innerType}if(!c){if(!i.fields||!i.fields[f])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${i.type}")`);n=t,t=t&&t[f],i=i.fields[f]}r=f,o=l?"["+a+"]":"."+a}),{schema:i,parent:n,parentPath:r}):{parent:n,parentPath:e,schema:i}}function Zp(i,e,t,s){return ar(i,e,t,s).schema}var Us=class i extends Set{describe(){let e=[];for(let t of this.values())e.push(oe.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(let s of this.values())t.push(e(s));return t}clone(){return new i(this.values())}merge(e,t){let s=this.clone();return e.forEach(n=>s.add(n)),t.forEach(n=>s.delete(n)),s}};function Ge(i,e=new Map){if(xe(i)||!i||typeof i!="object")return i;if(e.has(i))return e.get(i);let t;if(i instanceof Date)t=new Date(i.getTime()),e.set(i,t);else if(i instanceof RegExp)t=new RegExp(i),e.set(i,t);else if(Array.isArray(i)){t=new Array(i.length),e.set(i,t);for(let s=0;s<i.length;s++)t[s]=Ge(i[s],e)}else if(i instanceof Map){t=new Map,e.set(i,t);for(let[s,n]of i.entries())t.set(s,Ge(n,e))}else if(i instanceof Set){t=new Set,e.set(i,t);for(let s of i)t.add(Ge(s,e))}else if(i instanceof Object){t={},e.set(i,t);for(let[s,n]of Object.entries(i))t[s]=Ge(n,e)}else throw Error(`Unable to clone ${i}`);return t}var j=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Us,this._blacklist=new Us,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ne.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e?.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=Ge(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let s=e(this);return this._mutate=t,s}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,s=e.clone(),n=Object.assign({},t.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},t.internalTests,s.internalTests),s._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),s._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),s.tests=t.tests,s.exclusiveTests=t.exclusiveTests,s.withMutation(r=>{e.tests.forEach(o=>{r.test(o.OPTIONS)})}),s.transforms=[...t.transforms,...s.transforms],s}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let s=t.conditions;t=t.clone(),t.conditions=[],t=s.reduce((n,r)=>r.resolve(n,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,s,n,r;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(s=e.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=e.recursive)!=null?n:this.spec.recursive,disableStackTrace:(r=e.disableStackTrace)!=null?r:this.spec.disableStackTrace})}cast(e,t={}){let s=this.resolve(Object.assign({value:e},t)),n=t.assert==="ignore-optionality",r=s._cast(e,t);if(t.assert!==!1&&!s.isType(r)){if(n&&ee(r))return r;let o=re(e),a=re(r);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
163
|
+
`,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=Ls(e),s=He(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ls(e),s=He(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Sl.Parser=Hn});var El=y(Ct=>{"use strict";var Ol=qn(),rp=bt(),Et=St(),op=Ti(),ap=Kn(),_l=Yn();function Al(i){let e=i.prettyErrors!==!1;return{lineCounter:i.lineCounter||e&&new ap.LineCounter||null,prettyErrors:e}}function lp(i,e={}){let{lineCounter:t,prettyErrors:s}=Al(e),n=new _l.Parser(t?.addNewLine),r=new Ol.Composer(e),o=Array.from(r.compose(n.parse(i)));if(s&&t)for(let a of o)a.errors.forEach(Et.prettifyError(i,t)),a.warnings.forEach(Et.prettifyError(i,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function kl(i,e={}){let{lineCounter:t,prettyErrors:s}=Al(e),n=new _l.Parser(t?.addNewLine),r=new Ol.Composer(e),o=null;for(let a of r.compose(n.parse(i),!0,i.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Et.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(Et.prettifyError(i,t)),o.warnings.forEach(Et.prettifyError(i,t))),o}function cp(i,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);let n=kl(i,t);if(!n)return null;if(n.warnings.forEach(r=>op.warn(n.options.logLevel,r)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:s},t))}function up(i,e,t){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let n=Math.round(t);t=n<1?void 0:n>8?{indent:8}:{indent:n}}if(i===void 0){let{keepUndefined:n}=t??e??{};if(!n)return}return new rp.Document(i,s,t).toString(t)}Ct.parse=cp;Ct.parseAllDocuments=lp;Ct.parseDocument=kl;Ct.stringify=up});var Nl=y(E=>{"use strict";var fp=qn(),hp=bt(),dp=hn(),Gn=St(),pp=nt(),ve=k(),mp=ge(),gp=F(),yp=be(),bp=we(),wp=qs(),vp=Vn(),Sp=Kn(),Op=Yn(),Ps=El(),Cl=et();E.Composer=fp.Composer;E.Document=hp.Document;E.Schema=dp.Schema;E.YAMLError=Gn.YAMLError;E.YAMLParseError=Gn.YAMLParseError;E.YAMLWarning=Gn.YAMLWarning;E.Alias=pp.Alias;E.isAlias=ve.isAlias;E.isCollection=ve.isCollection;E.isDocument=ve.isDocument;E.isMap=ve.isMap;E.isNode=ve.isNode;E.isPair=ve.isPair;E.isScalar=ve.isScalar;E.isSeq=ve.isSeq;E.Pair=mp.Pair;E.Scalar=gp.Scalar;E.YAMLMap=yp.YAMLMap;E.YAMLSeq=bp.YAMLSeq;E.CST=wp;E.Lexer=vp.Lexer;E.LineCounter=Sp.LineCounter;E.Parser=Op.Parser;E.parse=Ps.parse;E.parseAllDocuments=Ps.parseAllDocuments;E.parseDocument=Ps.parseDocument;E.stringify=Ps.stringify;E.visit=Cl.visit;E.visitAsync=Cl.visitAsync});var Ml=y((My,Pl)=>{"use strict";function Te(i){this._maxSize=i,this.clear()}Te.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Te.prototype.get=function(i){return this._values[i]};Te.prototype.set=function(i,e){return this._size>=this._maxSize&&this.clear(),i in this._values||this._size++,this._values[i]=e};var Ap=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ll=/^\d+$/,kp=/^\d/,Ep=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Cp=/^\s*(['"]?)(.*?)(\1)\s*$/,Qn=512,xl=new Te(Qn),ql=new Te(Qn),Il=new Te(Qn);Pl.exports={Cache:Te,split:zn,normalizePath:Jn,setter:function(i){var e=Jn(i);return ql.get(i)||ql.set(i,function(s,n){for(var r=0,o=e.length,a=s;r<o-1;){var l=e[r];if(l==="__proto__"||l==="constructor"||l==="prototype")return s;a=a[e[r++]]}a[e[r]]=n})},getter:function(i,e){var t=Jn(i);return Il.get(i)||Il.set(i,function(n){for(var r=0,o=t.length;r<o;)if(n!=null||!e)n=n[t[r++]];else return;return n})},join:function(i){return i.reduce(function(e,t){return e+(Zn(t)||Ll.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(i,e,t){Np(Array.isArray(i)?i:zn(i),e,t)}};function Jn(i){return xl.get(i)||xl.set(i,zn(i).map(function(e){return e.replace(Cp,"$2")}))}function zn(i){return i.match(Ap)||[""]}function Np(i,e,t){var s=i.length,n,r,o,a;for(r=0;r<s;r++)n=i[r],n&&(xp(n)&&(n='"'+n+'"'),a=Zn(n),o=!a&&/^\d+$/.test(n),e.call(t,n,a,o,r,i))}function Zn(i){return typeof i=="string"&&i&&["'",'"'].indexOf(i.charAt(0))!==-1}function Tp(i){return i.match(kp)&&!i.match(Ll)}function $p(i){return Ep.test(i)}function xp(i){return!Zn(i)&&(Tp(i)||$p(i))}});var jl=y((Fy,Dl)=>{var qp=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ms=i=>i.match(qp)||[],Fs=i=>i[0].toUpperCase()+i.slice(1),Xn=(i,e)=>Ms(i).join(e).toLowerCase(),Fl=i=>Ms(i).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),Ip=i=>Fs(Fl(i)),Lp=i=>Xn(i,"_"),Pp=i=>Xn(i,"-"),Mp=i=>Fs(Xn(i," ")),Fp=i=>Ms(i).map(Fs).join(" ");Dl.exports={words:Ms,upperFirst:Fs,camelCase:Fl,pascalCase:Ip,snakeCase:Lp,kebabCase:Pp,sentenceCase:Mp,titleCase:Fp}});var Rl=y((Dy,er)=>{er.exports=function(i){return Bl(Dp(i),i)};er.exports.array=Bl;function Bl(i,e){var t=i.length,s=new Array(t),n={},r=t,o=jp(e),a=Bp(i);for(e.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});r--;)n[r]||l(i[r],r,new Set);return s;function l(c,f,u){if(u.has(c)){var h;try{h=", node was:"+JSON.stringify(c)}catch{h=""}throw new Error("Cyclic dependency"+h)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!n[f]){n[f]=!0;var p=o.get(c)||new Set;if(p=Array.from(p),f=p.length){u.add(c);do{var g=p[--f];l(g,a.get(g),u)}while(f);u.delete(c)}s[--t]=c}}}function Dp(i){for(var e=new Set,t=0,s=i.length;t<s;t++){var n=i[t];e.add(n[0]),e.add(n[1])}return Array.from(e)}function jp(i){for(var e=new Map,t=0,s=i.length;t<s;t++){var n=i[t];e.has(n[0])||e.set(n[0],new Set),e.has(n[1])||e.set(n[1],new Set),e.get(n[0]).add(n[1])}return e}function Bp(i){for(var e=new Map,t=0,s=i.length;t<s;t++)e.set(i[t],t);return e}});var oc=y(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});var $e=Ml(),tr=jl(),Rp=Rl();function Vp(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var Up=Vp(Rp),Kp=Object.prototype.toString,Hp=Error.prototype.toString,Yp=RegExp.prototype.toString,Gp=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Wp=/^Symbol\((.*)\)(.*)$/;function Jp(i){return i!=+i?"NaN":i===0&&1/i<0?"-0":""+i}function Vl(i,e=!1){if(i==null||i===!0||i===!1)return""+i;let t=typeof i;if(t==="number")return Jp(i);if(t==="string")return e?`"${i}"`:i;if(t==="function")return"[Function "+(i.name||"anonymous")+"]";if(t==="symbol")return Gp.call(i).replace(Wp,"Symbol($1)");let s=Kp.call(i).slice(8,-1);return s==="Date"?isNaN(i.getTime())?""+i:i.toISOString(i):s==="Error"||i instanceof Error?"["+Hp.call(i)+"]":s==="RegExp"?Yp.call(i):null}function re(i,e){let t=Vl(i,e);return t!==null?t:JSON.stringify(i,function(s,n){let r=Vl(this[s],e);return r!==null?r:n},2)}function Hl(i){return i==null?[]:[].concat(i)}var Yl,Gl,Wl,zp=/\$\{\s*(\w+)\s*\}/g;Yl=Symbol.toStringTag;var Rs=class{constructor(e,t,s,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Yl]="Error",this.name="ValidationError",this.value=t,this.path=s,this.type=n,this.errors=[],this.inner=[],Hl(e).forEach(r=>{if(U.isError(r)){this.errors.push(...r.errors);let o=r.inner.length?r.inner:[r];this.inner.push(...o)}else this.errors.push(r)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}};Gl=Symbol.hasInstance;Wl=Symbol.toStringTag;var U=class i extends Error{static formatError(e,t){let s=t.label||t.path||"this";return s!==t.path&&(t=Object.assign({},t,{path:s})),typeof e=="string"?e.replace(zp,(n,r)=>re(t[r])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,s,n,r){let o=new Rs(e,t,s,n);if(r)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Wl]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,i)}static[Gl](e){return Rs[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}},ne={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:i,type:e,value:t,originalValue:s})=>{let n=s!=null&&s!==t?` (cast from the value \`${re(s,!0)}\`).`:".";return e!=="mixed"?`${i} must be a \`${e}\` type, but the final value was: \`${re(t,!0)}\``+n:`${i} must match the configured type. The validated value was: \`${re(t,!0)}\``+n}},Y={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Se={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},sr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},ir={isValue:"${path} field must be ${value}"},nr={noUnknown:"${path} field has unspecified keys: ${unknown}"},js={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Jl={notType:i=>{let{path:e,value:t,spec:s}=i,n=s.types.length;if(Array.isArray(t)){if(t.length<n)return`${e} tuple value has too few items, expected a length of ${n} but got ${t.length} for value: \`${re(t,!0)}\``;if(t.length>n)return`${e} tuple value has too many items, expected a length of ${n} but got ${t.length} for value: \`${re(t,!0)}\``}return U.formatError(ne.notType,i)}},zl=Object.assign(Object.create(null),{mixed:ne,string:Y,number:Se,date:sr,object:nr,array:js,boolean:ir,tuple:Jl}),xe=i=>i&&i.__isYupSchema__,Vs=class i{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:r}=t,o=typeof s=="function"?s:(...a)=>a.every(l=>l===s);return new i(e,(a,l)=>{var c;let f=o(...a)?n:r;return(c=f?.(l))!=null?c:l})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let s=this.refs.map(r=>r.getValue(t?.value,t?.parent,t?.context)),n=this.fn(s,e,t);if(n===void 0||n===e)return e;if(!xe(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}},Ds={context:"$",value:"."};function Qp(i,e){return new oe(i,e)}var oe=class{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Ds.context,this.isValue=this.key[0]===Ds.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?Ds.context:this.isValue?Ds.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&$e.getter(this.path,!0),this.map=t.map}getValue(e,t,s){let n=this.isContext?s:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,t?.parent,t?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};oe.prototype.__isYupRef=!0;var ee=i=>i==null;function Ye(i){function e({value:t,path:s="",options:n,originalValue:r,schema:o},a,l){let{name:c,test:f,params:u,message:h,skipAbsent:p}=i,{parent:g,context:d,abortEarly:m=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=n;function b(q){return oe.isRef(q)?q.getValue(t,g,d):q}function O(q={}){let T=Object.assign({value:t,originalValue:r,label:o.spec.label,path:q.path||s,spec:o.spec,disableStackTrace:q.disableStackTrace||w},u,q.params);for(let gr of Object.keys(T))T[gr]=b(T[gr]);let ze=new U(U.formatError(q.message||h,T),t,T.path,q.type||c,T.disableStackTrace);return ze.params=T,ze}let _=m?a:l,A={path:s,parent:g,type:c,from:n.from,createError:O,resolve:b,options:n,originalValue:r,schema:o},S=q=>{U.isError(q)?_(q):q?l(null):_(O())},x=q=>{U.isError(q)?_(q):a(q)};if(p&&ee(t))return S(!0);let I;try{var Q;if(I=f.call(A,t,A),typeof((Q=I)==null?void 0:Q.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${A.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(I).then(S,x)}}catch(q){x(q);return}S(I)}return e.OPTIONS=i,e}function ar(i,e,t,s=t){let n,r,o;return e?($e.forEach(e,(a,l,c)=>{let f=l?a.slice(1,a.length-1):a;i=i.resolve({context:s,parent:n,value:t});let u=i.type==="tuple",h=c?parseInt(f,10):0;if(i.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(t&&h>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);n=t,t=t&&t[h],i=u?i.spec.types[h]:i.innerType}if(!c){if(!i.fields||!i.fields[f])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${i.type}")`);n=t,t=t&&t[f],i=i.fields[f]}r=f,o=l?"["+a+"]":"."+a}),{schema:i,parent:n,parentPath:r}):{parent:n,parentPath:e,schema:i}}function Zp(i,e,t,s){return ar(i,e,t,s).schema}var Us=class i extends Set{describe(){let e=[];for(let t of this.values())e.push(oe.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(let s of this.values())t.push(e(s));return t}clone(){return new i(this.values())}merge(e,t){let s=this.clone();return e.forEach(n=>s.add(n)),t.forEach(n=>s.delete(n)),s}};function Ge(i,e=new Map){if(xe(i)||!i||typeof i!="object")return i;if(e.has(i))return e.get(i);let t;if(i instanceof Date)t=new Date(i.getTime()),e.set(i,t);else if(i instanceof RegExp)t=new RegExp(i),e.set(i,t);else if(Array.isArray(i)){t=new Array(i.length),e.set(i,t);for(let s=0;s<i.length;s++)t[s]=Ge(i[s],e)}else if(i instanceof Map){t=new Map,e.set(i,t);for(let[s,n]of i.entries())t.set(s,Ge(n,e))}else if(i instanceof Set){t=new Set,e.set(i,t);for(let s of i)t.add(Ge(s,e))}else if(i instanceof Object){t={},e.set(i,t);for(let[s,n]of Object.entries(i))t[s]=Ge(n,e)}else throw Error(`Unable to clone ${i}`);return t}var j=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Us,this._blacklist=new Us,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ne.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e?.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=Ge(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let s=e(this);return this._mutate=t,s}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,s=e.clone(),n=Object.assign({},t.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},t.internalTests,s.internalTests),s._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),s._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),s.tests=t.tests,s.exclusiveTests=t.exclusiveTests,s.withMutation(r=>{e.tests.forEach(o=>{r.test(o.OPTIONS)})}),s.transforms=[...t.transforms,...s.transforms],s}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let s=t.conditions;t=t.clone(),t.conditions=[],t=s.reduce((n,r)=>r.resolve(n,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,s,n,r;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(s=e.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=e.recursive)!=null?n:this.spec.recursive,disableStackTrace:(r=e.disableStackTrace)!=null?r:this.spec.disableStackTrace})}cast(e,t={}){let s=this.resolve(Object.assign({value:e},t)),n=t.assert==="ignore-optionality",r=s._cast(e,t);if(t.assert!==!1&&!s.isType(r)){if(n&&ee(r))return r;let o=re(e),a=re(r);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
164
164
|
|
|
165
165
|
attempted value: ${o}
|
|
166
166
|
`+(a!==o?`result of cast: ${a}`:""))}return r}_cast(e,t){let s=e===void 0?e:this.transforms.reduce((n,r)=>r.call(this,n,e,this),e);return s===void 0&&(s=this.getDefault(t)),s}_validate(e,t={},s,n){let{path:r,originalValue:o=e,strict:a=this.spec.strict}=t,l=e;a||(l=this._cast(l,Object.assign({assert:!1},t)));let c=[];for(let f of Object.values(this.internalTests))f&&c.push(f);this.runTests({path:r,value:l,originalValue:o,options:t,tests:c},s,f=>{if(f.length)return n(f,l);this.runTests({path:r,value:l,originalValue:o,options:t,tests:this.tests},s,n)})}runTests(e,t,s){let n=!1,{tests:r,value:o,originalValue:a,path:l,options:c}=e,f=d=>{n||(n=!0,t(d,o))},u=d=>{n||(n=!0,s(d,o))},h=r.length,p=[];if(!h)return u([]);let g={value:o,originalValue:a,path:l,options:c,schema:this};for(let d=0;d<r.length;d++){let m=r[d];m(g,f,function(b){b&&(Array.isArray(b)?p.push(...b):p.push(b)),--h<=0&&u(p)})}}asNestedTest({key:e,index:t,parent:s,parentPath:n,originalParent:r,options:o}){let a=e??t;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");let l=typeof a=="number",c=s[a],f=Object.assign({},o,{strict:!0,parent:s,value:c,originalValue:r[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${n||""}[${l?a:`"${a}"`}]`:(n?`${n}.`:"")+e});return(u,h,p)=>this.resolve(f)._validate(c,f,h,p)}validate(e,t){var s;let n=this.resolve(Object.assign({},t,{value:e})),r=(s=t?.disableStackTrace)!=null?s:n.spec.disableStackTrace;return new Promise((o,a)=>n._validate(e,t,(l,c)=>{U.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new U(l,c,void 0,void 0,r)):o(c)}))}validateSync(e,t){var s;let n=this.resolve(Object.assign({},t,{value:e})),r,o=(s=t?.disableStackTrace)!=null?s:n.spec.disableStackTrace;return n._validate(e,Object.assign({},t,{sync:!0}),(a,l)=>{throw U.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new U(a,e,void 0,void 0,o);r=l}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,s=>{if(U.isError(s))return!1;throw s})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(s){if(U.isError(s))return!1;throw s}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):Ge(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){let s=this.clone({nullable:e});return s.internalTests.nullable=Ye({message:t,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),s}optionality(e,t){let s=this.clone({optional:e});return s.internalTests.optionality=Ye({message:t,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(e=ne.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=ne.notNull){return this.nullability(!1,e)}required(e=ne.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=ne.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=Ye(t),r=t.exclusive||t.name&&s.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(s.exclusiveTests[t.name]=!!t.exclusive),s.tests=s.tests.filter(o=>!(o.OPTIONS.name===t.name&&(r||o.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let s=this.clone(),n=Hl(e).map(r=>new oe(r));return n.forEach(r=>{r.isSibling&&s.deps.push(r.key)}),s.conditions.push(typeof t=="function"?new Vs(n,t):Vs.fromOptions(n,t)),s}typeError(e){let t=this.clone();return t.internalTests.typeError=Ye({message:e,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=ne.oneOf){let s=this.clone();return e.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s.internalTests.whiteList=Ye({message:t,name:"oneOf",skipAbsent:!0,test(n){let r=this.schema._whitelist,o=r.resolveAll(this.resolve);return o.includes(n)?!0:this.createError({params:{values:Array.from(r).join(", "),resolved:o}})}}),s}notOneOf(e,t=ne.notOneOf){let s=this.clone();return e.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s.internalTests.blacklist=Ye({message:t,name:"notOneOf",test(n){let r=this.schema._blacklist,o=r.resolveAll(this.resolve);return o.includes(n)?this.createError({params:{values:Array.from(r).join(", "),resolved:o}}):!0}}),s}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){let t=(e?this.resolve(e):this).clone(),{label:s,meta:n,optional:r,nullable:o}=t.spec;return{meta:n,label:s,optional:r,nullable:o,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,f)=>f.findIndex(u=>u.name===l.name)===c)}}};j.prototype.__isYupSchema__=!0;for(let i of["validate","validateSync"])j.prototype[`${i}At`]=function(e,t,s={}){let{parent:n,parentPath:r,schema:o}=ar(this,e,t,s.context);return o[i](n&&n[r],Object.assign({},s,{parent:n,path:e}))};for(let i of["equals","is"])j.prototype[i]=j.prototype.oneOf;for(let i of["not","nope"])j.prototype[i]=j.prototype.notOneOf;var Xp=()=>!0;function Ql(i){return new Nt(i)}var Nt=class extends j{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:Xp},e))}};Ql.prototype=Nt.prototype;function lr(){return new Tt}var Tt=class extends j{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(s.spec.coerce&&!s.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=ir.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return ee(t)||t===!0}})}isFalse(e=ir.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return ee(t)||t===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}};lr.prototype=Tt.prototype;var em=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function tm(i){let e=rr(i);if(!e)return Date.parse?Date.parse(i):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function rr(i){var e,t;let s=em.exec(i);return s?{year:ue(s[1]),month:ue(s[2],1)-1,day:ue(s[3],1),hour:ue(s[4]),minute:ue(s[5]),second:ue(s[6]),millisecond:s[7]?ue(s[7].substring(0,3)):0,precision:(e=(t=s[7])==null?void 0:t.length)!=null?e:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:ue(s[10]),minuteOffset:ue(s[11])}:null}function ue(i,e=0){return Number(i)||e}var sm=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,im=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,nm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,rm="^\\d{4}-\\d{2}-\\d{2}",om="\\d{2}:\\d{2}:\\d{2}",am="(([+-]\\d{2}(:?\\d{2})?)|Z)",lm=new RegExp(`${rm}T${om}(\\.\\d+)?${am}$`),cm=i=>ee(i)||i===i.trim(),um={}.toString();function Zl(){return new $t}var $t=class extends j{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(!s.spec.coerce||s.isType(e)||Array.isArray(e))return e;let n=e!=null&&e.toString?e.toString():e;return n===um?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||ne.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=Y.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(s){return s.length===this.resolve(e)}})}min(e,t=Y.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s.length>=this.resolve(e)}})}max(e,t=Y.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(s){return s.length<=this.resolve(e)}})}matches(e,t){let s=!1,n,r;return t&&(typeof t=="object"?{excludeEmptyString:s=!1,message:n,name:r}=t:n=t),this.test({name:r||"matches",message:n||Y.matches,params:{regex:e},skipAbsent:!0,test:o=>o===""&&s||o.search(e)!==-1})}email(e=Y.email){return this.matches(sm,{name:"email",message:e,excludeEmptyString:!0})}url(e=Y.url){return this.matches(im,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Y.uuid){return this.matches(nm,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",s,n;return e&&(typeof e=="object"?{message:t="",allowOffset:s=!1,precision:n=void 0}=e:t=e),this.matches(lm,{name:"datetime",message:t||Y.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||Y.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:r=>{if(!r||s)return!0;let o=rr(r);return o?!!o.z:!1}}).test({name:"datetime_precision",message:t||Y.datetime_precision,params:{precision:n},skipAbsent:!0,test:r=>{if(!r||n==null)return!0;let o=rr(r);return o?o.precision===n:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=Y.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:cm})}lowercase(e=Y.lowercase){return this.transform(t=>ee(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>ee(t)||t===t.toLowerCase()})}uppercase(e=Y.uppercase){return this.transform(t=>ee(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>ee(t)||t===t.toUpperCase()})}};Zl.prototype=$t.prototype;var fm=i=>i!=+i;function Xl(){return new xt}var xt=class extends j{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!fm(e)}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(!s.spec.coerce)return e;let n=e;if(typeof n=="string"){if(n=n.replace(/\s/g,""),n==="")return NaN;n=+n}return s.isType(n)||n===null?n:parseFloat(n)})})}min(e,t=Se.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(e)}})}max(e,t=Se.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(e)}})}lessThan(e,t=Se.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(s){return s<this.resolve(e)}})}moreThan(e,t=Se.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(s){return s>this.resolve(e)}})}positive(e=Se.positive){return this.moreThan(0,e)}negative(e=Se.negative){return this.lessThan(0,e)}integer(e=Se.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:t=>Number.isInteger(t)})}truncate(){return this.transform(e=>ee(e)?e:e|0)}round(e){var t;let s=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(s.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(n=>ee(n)?n:Math[e](n))}};Xl.prototype=xt.prototype;var ec=new Date(""),hm=i=>Object.prototype.toString.call(i)==="[object Date]";function cr(){return new We}var We=class i extends j{constructor(){super({type:"date",check(e){return hm(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,s)=>!s.spec.coerce||s.isType(e)||e===null?e:(e=tm(e),isNaN(e)?i.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let s;if(oe.isRef(e))s=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(e,t=sr.min){let s=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(s)}})}max(e,t=sr.max){let s=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(s)}})}};We.INVALID_DATE=ec;cr.prototype=We.prototype;cr.INVALID_DATE=ec;function dm(i,e=[]){let t=[],s=new Set,n=new Set(e.map(([o,a])=>`${o}-${a}`));function r(o,a){let l=$e.split(o)[0];s.add(l),n.has(`${a}-${l}`)||t.push([a,l])}for(let o of Object.keys(i)){let a=i[o];s.add(o),oe.isRef(a)&&a.isSibling?r(a.path,o):xe(a)&&"deps"in a&&a.deps.forEach(l=>r(l,o))}return Up.default.array(Array.from(s),t).reverse()}function Ul(i,e){let t=1/0;return i.some((s,n)=>{var r;if((r=e.path)!=null&&r.includes(s))return t=n,!0}),t}function tc(i){return(e,t)=>Ul(i,e)-Ul(i,t)}var sc=(i,e,t)=>{if(typeof i!="string")return i;let s=i;try{s=JSON.parse(i)}catch{}return t.isType(s)?s:i};function Bs(i){if("fields"in i){let e={};for(let[t,s]of Object.entries(i.fields))e[t]=Bs(s);return i.setFields(e)}if(i.type==="array"){let e=i.optional();return e.innerType&&(e.innerType=Bs(e.innerType)),e}return i.type==="tuple"?i.optional().clone({types:i.spec.types.map(Bs)}):"optional"in i?i.optional():i}var pm=(i,e)=>{let t=[...$e.normalizePath(e)];if(t.length===1)return t[0]in i;let s=t.pop(),n=$e.getter($e.join(t),!0)(i);return!!(n&&s in n)},Kl=i=>Object.prototype.toString.call(i)==="[object Object]";function mm(i,e){let t=Object.keys(i.fields);return Object.keys(e).filter(s=>t.indexOf(s)===-1)}var gm=tc([]);function ic(i){return new qt(i)}var qt=class extends j{constructor(e){super({type:"object",check(t){return Kl(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=gm,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var s;let n=super._cast(e,t);if(n===void 0)return this.getDefault(t);if(!this._typeCheck(n))return n;let r=this.fields,o=(s=t.stripUnknown)!=null?s:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(n).filter(u=>!this._nodes.includes(u))),l={},c=Object.assign({},t,{parent:l,__validating:t.__validating||!1}),f=!1;for(let u of a){let h=r[u],p=u in n;if(h){let g,d=n[u];c.path=(t.path?`${t.path}.`:"")+u,h=h.resolve({value:d,context:t.context,parent:l});let m=h instanceof j?h.spec:void 0,w=m?.strict;if(m!=null&&m.strip){f=f||u in n;continue}g=!t.__validating||!w?h.cast(n[u],c):n[u],g!==void 0&&(l[u]=g)}else p&&!o&&(l[u]=n[u]);(p!==u in l||l[u]!==n[u])&&(f=!0)}return f?l:n}_validate(e,t={},s,n){let{from:r=[],originalValue:o=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:o},...r],t.__validating=!0,t.originalValue=o,super._validate(e,t,s,(l,c)=>{if(!a||!Kl(c)){n(l,c);return}o=o||c;let f=[];for(let u of this._nodes){let h=this.fields[u];!h||oe.isRef(h)||f.push(h.asNestedTest({options:t,key:u,parent:c,parentPath:t.path,originalParent:o}))}this.runTests({tests:f,value:c,originalValue:o,options:t},s,u=>{n(u.sort(this._sortErrors).concat(l),c)})})}clone(e){let t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),s=t.fields;for(let[n,r]of Object.entries(this.fields)){let o=s[n];s[n]=o===void 0?r:o}return t.withMutation(n=>n.setFields(s,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(s=>{var n;let r=this.fields[s],o=e;(n=o)!=null&&n.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[s]})),t[s]=r&&"getDefault"in r?r.getDefault(o):void 0}),t}setFields(e,t){let s=this.clone();return s.fields=e,s._nodes=dm(e,t),s._sortErrors=tc(Object.keys(e)),t&&(s._excludedEdges=t),s}shape(e,t=[]){return this.clone().withMutation(s=>{let n=s._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...s._excludedEdges,...t]),s.setFields(Object.assign(s.fields,e),n)})}partial(){let e={};for(let[t,s]of Object.entries(this.fields))e[t]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(e)}deepPartial(){return Bs(this)}pick(e){let t={};for(let s of e)this.fields[s]&&(t[s]=this.fields[s]);return this.setFields(t,this._excludedEdges.filter(([s,n])=>e.includes(s)&&e.includes(n)))}omit(e){let t=[];for(let s of Object.keys(this.fields))e.includes(s)||t.push(s);return this.pick(t)}from(e,t,s){let n=$e.getter(e,!0);return this.transform(r=>{if(!r)return r;let o=r;return pm(r,e)&&(o=Object.assign({},r),s||delete o[e],o[t]=n(r)),o})}json(){return this.transform(sc)}noUnknown(e=!0,t=nr.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:t,test(n){if(n==null)return!0;let r=mm(this.schema,n);return!e||r.length===0||this.createError({params:{unknown:r.join(", ")}})}});return s.spec.noUnknown=e,s}unknown(e=!0,t=nr.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;let s={};for(let n of Object.keys(t))s[e(n)]=t[n];return s})}camelCase(){return this.transformKeys(tr.camelCase)}snakeCase(){return this.transformKeys(tr.snakeCase)}constantCase(){return this.transformKeys(e=>tr.snakeCase(e).toUpperCase())}describe(e){let t=(e?this.resolve(e):this).clone(),s=super.describe(e);s.fields={};for(let[r,o]of Object.entries(t.fields)){var n;let a=e;(n=a)!=null&&n.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),s.fields[r]=o.describe(a)}return s}};ic.prototype=qt.prototype;function nc(i){return new It(i)}var It=class extends j{constructor(e){super({type:"array",spec:{types:e},check(t){return Array.isArray(t)}}),this.innerType=void 0,this.innerType=e}_cast(e,t){let s=super._cast(e,t);if(!this._typeCheck(s)||!this.innerType)return s;let n=!1,r=s.map((o,a)=>{let l=this.innerType.cast(o,Object.assign({},t,{path:`${t.path||""}[${a}]`}));return l!==o&&(n=!0),l});return n?r:s}_validate(e,t={},s,n){var r;let o=this.innerType,a=(r=t.recursive)!=null?r:this.spec.recursive;t.originalValue!=null&&t.originalValue,super._validate(e,t,s,(l,c)=>{var f;if(!a||!o||!this._typeCheck(c)){n(l,c);return}let u=new Array(c.length);for(let p=0;p<c.length;p++){var h;u[p]=o.asNestedTest({options:t,index:p,parent:c,parentPath:t.path,originalParent:(h=t.originalValue)!=null?h:e})}this.runTests({value:c,tests:u,originalValue:(f=t.originalValue)!=null?f:e,options:t},s,p=>n(p.concat(l),c))})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(sc)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!xe(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+re(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=js.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(s){return s.length===this.resolve(e)}})}min(e,t){return t=t||js.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s.length>=this.resolve(e)}})}max(e,t){return t=t||js.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(s,n,r)=>!e(s,n,r):s=>!!s;return this.transform(s=>s!=null?s.filter(t):s)}describe(e){let t=(e?this.resolve(e):this).clone(),s=super.describe(e);if(t.innerType){var n;let r=e;(n=r)!=null&&n.value&&(r=Object.assign({},r,{parent:r.value,value:r.value[0]})),s.innerType=t.innerType.describe(r)}return s}};nc.prototype=It.prototype;function rc(i){return new Lt(i)}var Lt=class extends j{constructor(e){super({type:"tuple",spec:{types:e},check(t){let s=this.spec.types;return Array.isArray(t)&&t.length===s.length}}),this.withMutation(()=>{this.typeError(Jl.notType)})}_cast(e,t){let{types:s}=this.spec,n=super._cast(e,t);if(!this._typeCheck(n))return n;let r=!1,o=s.map((a,l)=>{let c=a.cast(n[l],Object.assign({},t,{path:`${t.path||""}[${l}]`}));return c!==n[l]&&(r=!0),c});return r?o:n}_validate(e,t={},s,n){let r=this.spec.types;super._validate(e,t,s,(o,a)=>{var l;if(!this._typeCheck(a)){n(o,a);return}let c=[];for(let[u,h]of r.entries()){var f;c[u]=h.asNestedTest({options:t,index:u,parent:a,parentPath:t.path,originalParent:(f=t.originalValue)!=null?f:e})}this.runTests({value:a,tests:c,originalValue:(l=t.originalValue)!=null?l:e,options:t},s,u=>n(u.concat(o),a))})}describe(e){let t=(e?this.resolve(e):this).clone(),s=super.describe(e);return s.innerType=t.spec.types.map((n,r)=>{var o;let a=e;return(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n.describe(a)}),s}};rc.prototype=Lt.prototype;function ym(i){return new or(i)}var or=class i{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(t,s={})=>{let n=this.builder(t,s);if(!xe(n))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(n=n.optional()),n.resolve(s)},this.builder=e,this.spec={meta:void 0,optional:!1}}clone(e){let t=new i(this.builder);return t.spec=Object.assign({},this.spec,e),t}optionality(e){return this.clone({optional:e})}optional(){return this.optionality(!0)}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}asNestedTest(e){let{key:t,index:s,parent:n,options:r}=e,o=n[s??t];return this._resolve(o,Object.assign({},r,{value:o,parent:n})).asNestedTest(e)}validate(e,t){return this._resolve(e,t).validate(e,t)}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,s){return this._resolve(t,s).validateAt(e,t,s)}validateSyncAt(e,t,s){return this._resolve(t,s).validateSyncAt(e,t,s)}isValid(e,t){return this._resolve(e,t).isValid(e,t)}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}describe(e){return e?this.resolve(e).describe(e):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}};function bm(i){Object.keys(i).forEach(e=>{Object.keys(i[e]).forEach(t=>{zl[e][t]=i[e][t]})})}function wm(i,e,t){if(!i||!xe(i.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof e!="string")throw new TypeError("A Method name must be provided");if(typeof t!="function")throw new TypeError("Method function must be provided");i.prototype[e]=t}C.ArraySchema=It;C.BooleanSchema=Tt;C.DateSchema=We;C.MixedSchema=Nt;C.NumberSchema=xt;C.ObjectSchema=qt;C.Schema=j;C.StringSchema=$t;C.TupleSchema=Lt;C.ValidationError=U;C.addMethod=wm;C.array=nc;C.bool=lr;C.boolean=lr;C.date=cr;C.defaultLocale=zl;C.getIn=ar;C.isSchema=xe;C.lazy=ym;C.mixed=Ql;C.number=Xl;C.object=ic;C.printValue=re;C.reach=Zp;C.ref=Qp;C.setLocale=bm;C.string=Zl;C.tuple=rc});var yc=y((ib,gc)=>{"use strict";var mr=Object.defineProperty,Lm=Object.getOwnPropertyDescriptor,Pm=Object.getOwnPropertyNames,Mm=Object.prototype.hasOwnProperty,Fm=(i,e)=>{for(var t in e)mr(i,t,{get:e[t],enumerable:!0})},Dm=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Pm(e))!Mm.call(i,n)&&n!==t&&mr(i,n,{get:()=>e[n],enumerable:!(s=Lm(e,n))||s.enumerable});return i},jm=i=>Dm(mr({},"__esModule",{value:!0}),i),mc={};Fm(mc,{strInterpolator:()=>Bm});gc.exports=jm(mc);function Bm(i,e){return i.replace(/\${(.*?)}/g,(t,s)=>{if(s.includes(".")){let n=s.split("."),r=e;for(let o=0;o<n.length;o++){let a=n[o];if(r[a]!==void 0&&typeof r[a]=="object")r=r[a];else return r[a]!==void 0?r[a]:""}}else return e[s]!==void 0?e[s]:""})}});var $r=V(Tr(),1),{program:Jm,createCommand:zm,createArgument:Qm,createOption:Zm,CommanderError:Xm,InvalidArgumentError:eg,InvalidOptionArgumentError:tg,Command:xr,Argument:sg,Option:ig,Help:ng}=$r.default;var qr=(i=0)=>e=>`\x1B[${e+i}m`,Ir=(i=0)=>e=>`\x1B[${38+i};5;${e}m`,Lr=(i=0)=>(e,t,s)=>`\x1B[${38+i};2;${e};${t};${s}m`,L={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Dt=Object.keys(L.modifier),ai=Object.keys(L.color),li=Object.keys(L.bgColor),jt=[...ai,...li];function Vc(){let i=new Map;for(let[e,t]of Object.entries(L)){for(let[s,n]of Object.entries(t))L[s]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[s]=L[s],i.set(n[0],n[1]);Object.defineProperty(L,e,{value:t,enumerable:!1})}return Object.defineProperty(L,"codes",{value:i,enumerable:!1}),L.color.close="\x1B[39m",L.bgColor.close="\x1B[49m",L.color.ansi=qr(),L.color.ansi256=Ir(),L.color.ansi16m=Lr(),L.bgColor.ansi=qr(10),L.bgColor.ansi256=Ir(10),L.bgColor.ansi16m=Lr(10),Object.defineProperties(L,{rgbToAnsi256:{value(e,t,s){return e===t&&t===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(r=>r+r).join(""));let n=Number.parseInt(s,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>L.rgbToAnsi256(...L.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,s,n;if(e>=232)t=((e-232)*10+8)/255,s=t,n=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,s=Math.floor(a/6)/5,n=a%6/5}let r=Math.max(t,s,n)*2;if(r===0)return 30;let o=30+(Math.round(n)<<2|Math.round(s)<<1|Math.round(t));return r===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,s)=>L.ansi256ToAnsi(L.rgbToAnsi256(e,t,s)),enumerable:!1},hexToAnsi:{value:e=>L.ansi256ToAnsi(L.hexToAnsi256(e)),enumerable:!1}}),L}var Uc=Vc(),Z=Uc;var Rt=V(require("node:process"),1),Mr=V(require("node:os"),1),ci=V(require("node:tty"),1);function J(i,e=globalThis.Deno?globalThis.Deno.args:Rt.default.argv){let t=i.startsWith("-")?"":i.length===1?"-":"--",s=e.indexOf(t+i),n=e.indexOf("--");return s!==-1&&(n===-1||s<n)}var{env:P}=Rt.default,Bt;J("no-color")||J("no-colors")||J("color=false")||J("color=never")?Bt=0:(J("color")||J("colors")||J("color=true")||J("color=always"))&&(Bt=1);function Kc(){if("FORCE_COLOR"in P)return P.FORCE_COLOR==="true"?1:P.FORCE_COLOR==="false"?0:P.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(P.FORCE_COLOR,10),3)}function Hc(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function Yc(i,{streamIsTTY:e,sniffFlags:t=!0}={}){let s=Kc();s!==void 0&&(Bt=s);let n=t?Bt:s;if(n===0)return 0;if(t){if(J("color=16m")||J("color=full")||J("color=truecolor"))return 3;if(J("color=256"))return 2}if("TF_BUILD"in P&&"AGENT_NAME"in P)return 1;if(i&&!e&&n===void 0)return 0;let r=n||0;if(P.TERM==="dumb")return r;if(Rt.default.platform==="win32"){let o=Mr.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in P)return"GITHUB_ACTIONS"in P||"GITEA_ACTIONS"in P?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in P)||P.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in P)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(P.TEAMCITY_VERSION)?1:0;if(P.COLORTERM==="truecolor"||P.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in P){let o=Number.parseInt((P.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(P.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(P.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(P.TERM)||"COLORTERM"in P?1:r}function Pr(i,e={}){let t=Yc(i,{streamIsTTY:i&&i.isTTY,...e});return Hc(t)}var Gc={stdout:Pr({isTTY:ci.default.isatty(1)}),stderr:Pr({isTTY:ci.default.isatty(2)})},Fr=Gc;function Dr(i,e,t){let s=i.indexOf(e);if(s===-1)return i;let n=e.length,r=0,o="";do o+=i.slice(r,s)+e+t,r=s+n,s=i.indexOf(e,r);while(s!==-1);return o+=i.slice(r),o}function jr(i,e,t,s){let n=0,r="";do{let o=i[s-1]==="\r";r+=i.slice(n,o?s-1:s)+e+(o?`\r
|
|
167
167
|
`:`
|
|
168
168
|
`)+t,n=s+1,s=i.indexOf(`
|
|
169
169
|
`,n)}while(s!==-1);return r+=i.slice(n),r}var{stdout:Br,stderr:Rr}=Fr,ui=Symbol("GENERATOR"),qe=Symbol("STYLER"),Ze=Symbol("IS_EMPTY"),Vr=["ansi","ansi","ansi256","ansi16m"],Ie=Object.create(null),Wc=(i,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Br?Br.level:0;i.level=e.level===void 0?t:e.level};var Jc=i=>{let e=(...t)=>t.join(" ");return Wc(e,i),Object.setPrototypeOf(e,Xe.prototype),e};function Xe(i){return Jc(i)}Object.setPrototypeOf(Xe.prototype,Function.prototype);for(let[i,e]of Object.entries(Z))Ie[i]={get(){let t=Vt(this,hi(e.open,e.close,this[qe]),this[Ze]);return Object.defineProperty(this,i,{value:t}),t}};Ie.visible={get(){let i=Vt(this,this[qe],!0);return Object.defineProperty(this,"visible",{value:i}),i}};var fi=(i,e,t,...s)=>i==="rgb"?e==="ansi16m"?Z[t].ansi16m(...s):e==="ansi256"?Z[t].ansi256(Z.rgbToAnsi256(...s)):Z[t].ansi(Z.rgbToAnsi(...s)):i==="hex"?fi("rgb",e,t,...Z.hexToRgb(...s)):Z[t][i](...s),zc=["rgb","hex","ansi256"];for(let i of zc){Ie[i]={get(){let{level:t}=this;return function(...s){let n=hi(fi(i,Vr[t],"color",...s),Z.color.close,this[qe]);return Vt(this,n,this[Ze])}}};let e="bg"+i[0].toUpperCase()+i.slice(1);Ie[e]={get(){let{level:t}=this;return function(...s){let n=hi(fi(i,Vr[t],"bgColor",...s),Z.bgColor.close,this[qe]);return Vt(this,n,this[Ze])}}}}var Qc=Object.defineProperties(()=>{},{...Ie,level:{enumerable:!0,get(){return this[ui].level},set(i){this[ui].level=i}}}),hi=(i,e,t)=>{let s,n;return t===void 0?(s=i,n=e):(s=t.openAll+i,n=e+t.closeAll),{open:i,close:e,openAll:s,closeAll:n,parent:t}},Vt=(i,e,t)=>{let s=(...n)=>Zc(s,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(s,Qc),s[ui]=i,s[qe]=e,s[Ze]=t,s},Zc=(i,e)=>{if(i.level<=0||!e)return i[Ze]?"":e;let t=i[qe];if(t===void 0)return e;let{openAll:s,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Dr(e,t.close,t.open),t=t.parent;let r=e.indexOf(`
|
|
170
|
-
`);return r!==-1&&(e=jr(e,n,s,r)),s+e+n};Object.defineProperties(Xe.prototype,Ie);var Xc=Xe(),hg=Xe({level:Rr?Rr.level:0});var
|
|
170
|
+
`);return r!==-1&&(e=jr(e,n,s,r)),s+e+n};Object.defineProperties(Xe.prototype,Ie);var Xc=Xe(),hg=Xe({level:Rr?Rr.level:0});var $=Xc;var dr=V(require("fs"),1),fc=V(require("path"),1),hc=V(Nl(),1);function Wn({onlyFirst:i=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,i?void 0:"g")}var $l=i=>{if(i.errors!==void 0){let e=[];for(let t of i.errors)Wn().test(t)?console.error(t):e.push(t);e.length!==0&&_p(e)}},Tl=i=>{let e=!1;return/(.+match.+)"(.+)"/.test(i)&&!e&&(i=i.replace(/(.+match.+)"(.+)"/,`$1${$.italic.green("$2")}`),e=!0),/(\n)/.test(i)&&!e&&(i=i.replace(/(\n)/g,"")),/( {2,})/.test(i)&&!e&&(i=i.replace(/( {2,})/g,"")),/( \d+ |.+\[\d+\])/.test(i)&&!e&&(i=i.replace(/( \d+ |.+\[\d+\])/g,$.bold.yellow("$1"))),/(required|inline-script|file-script|script-group)/.test(i)&&!e&&(i=i.replace(/(required|inline-script|file-script|script-group)/g,$.bold.underline.yellow("$1"))),/(`)(\S+)(`)/.test(i)&&!e&&(i=i.replace(/(`)(\S+)(`)/g,$.bold.underline.yellow("$2"))),i},_p=i=>{let e={};for(let t of i){let[s,...n]=t.split(" "),r=n.join(" "),o=s.split(".");e[o[0]]||(o[1]?(e[o[0]]={},e[o[0]][o[1]]=[]):e[o[0]]=[]),!e[o[0]][o[1]]&&o[1]&&(e[o[0]][o[1]]=[]),o[1]?e[o[0]][o[1]].push(r):e[o[0]].push(r)}for(let[t,s]of Object.entries(e))if(Array.isArray(s)){let n=[];for(let r of s)n.push(Tl(r));if(n.length===1)console.error(`${$.bold.blueBright(t)}: ${n[0]}`);else{console.error(`${$.bold.blueBright(t)}: is not valid for multiple reasons`);for(let r of n)console.error(` ${$.bold.redBright("error")} => ${r}`)}}else{console.error(`${$.bold.blueBright(t)}:`);for(let[n,r]of Object.entries(s)){let o=[];for(let a of r)o.push(Tl(a));if(o.length===1)console.error(` ${$.bold.blueBright(n)}: ${o[0]}`);else{console.error(` ${$.bold.blueBright(n)}: is not valid for multiple reasons`);for(let a of o)console.error(` ${$.bold.redBright("error")} => ${a}`)}}}};var N=V(oc(),1),ac=V(require("path"),1),lc=V(require("fs"),1);N.default.addMethod(N.default.object,"properChildrenNames",function(i){return this.test("properChildrenNames",i,function(e){let t=Object.keys(e),s=[];for(let n of t)/^([A-Za-z][A-Za-z\d_-]*(?<![_-]))$/.test(n)||s.push(this.createError({path:`scripts.${n}`,message:`scripts.${n} the script name must match the following: "^([A-Za-z][A-Za-z\\d_-]*(?<![_-]))$"`}));return s.length!==0?this.createError({message:()=>s}):!0})});N.default.addMethod(N.default.object,"properEnv",function(i){return this.test("properEnv",i,function(e){if(e===void 0)return!0;let t=Object.keys(e),s=[];for(let n of t)/^([A-Za-z\d_-]+)$/.test(n)||s.push(this.createError({path:`env.${n}`,message:`env.${n} the environment name must match the following: "^([A-Za-z\\d_-]+)$"`})),["undefined","object","symbol","function"].includes(typeof e[n])&&s.push(this.createError({path:`env.${n}`,message:`env.${n} = ${JSON.stringify(e[n])} (${typeof e[n]}) the environment value must be of type boolean, string, number`}));return s.length!==0?this.createError({message:()=>s}):!0})});N.default.addMethod(N.default.object,"validScriptsInGroups",function(i){return this.test("validScriptsInGroups",i,function(e){let t=[];for(let[s,n]of Object.entries(e))if(Object.keys(n).includes("group"))for(let r of n.group)Object.keys(e).includes(r)||t.push(this.createError({path:`scripts.${s}.group.${r}`,message:`scripts.${s}.group.${r} the script name \`${r}\` is not included as a script definition`}));return t.length!==0?this.createError({message:()=>t}):!0})});N.default.addMethod(N.default.object,"childrenOneOf",function(i,e){return this.test("childrenOneOf",e,function(t){let s=[];for(let[n,r]of Object.entries(t)){let o=Object.keys(i).filter(a=>Object.keys(r).includes(a)).pop();if(o!==void 0)try{i[o].validateSync(r,{abortEarly:!1,stripUnknown:!1})}catch(a){s.push(this.createError({path:`${this.path}.${n}`,message:`${this.path}.${n} is not valid against type ${i[o].meta().type}`}));for(let l of a.errors)s.push(this.createError({path:`${this.path}.${n}`,message:`${this.path}.${n} ${l}`}))}else s.push(this.createError({path:`${this.path}.${n}`,message:`${this.path}.${n} is not valid against any defined schemas`}))}return s.length!==0?this.createError({message:()=>s}):!0})});N.default.addMethod(N.default.string,"pathlike",function(i){return this.test("pathlike",i,function(e){let t=[];if(e!==void 0){if(lc.default.existsSync(ac.default.resolve(e)))return!0;t.push(this.createError({path:this.path,message:`${this.path} is not a valid path`})),t.push(this.createError({path:this.path,message:`${this.path} ${e} does not exist`}))}return t.length!==0?this.createError({message:()=>t}):!0})});var ur=N.default.string().pathlike(),cc=N.default.string().matches(/^(series|parallel)$/),fr=N.default.string().matches(/^(pwsh|cmd|bash|sh|powershell)$/),hr=N.default.object().properEnv().strict().notRequired(),vm=N.default.object({script:N.default.lazy(i=>{switch(Array.isArray(i)){case!0:return N.default.array().of(N.default.string().min(1)).min(1).required();default:return N.default.string().required()}}),shell:fr,pwd:ur,env:hr}).noUnknown().strict().meta({type:"inline-script"}),Sm=N.default.object({file:N.default.string().required(),shell:fr,pwd:ur,env:hr}).noUnknown().strict().meta({type:"file-script"}),Om=N.default.object({group:N.default.array().min(1).of(N.default.string().min(1)).required(),how:cc}).noUnknown().strict().meta({type:"script-group"}),_m=N.default.array().min(1).notRequired().nullable().strict(),Am=N.default.object().childrenOneOf({script:vm,file:Sm,group:Om}).properChildrenNames().validScriptsInGroups().nonNullable().strict().required(),km=N.default.object().shape({shell:fr.required(),how:cc.required(),pwd:ur.required(),env:hr}).nonNullable().strict().required(),uc=N.default.object().shape({variables:_m,defaults:km,scripts:Am}).noUnknown().nonNullable().strict();var B={verbose:!1,version:"1.1.0",config:{},defaultFile:`
|
|
171
|
+
# variables are standard yaml variables you can use for
|
|
172
|
+
# replacement elsewhere
|
|
171
173
|
variables:
|
|
172
174
|
- &var_name "echo done"
|
|
173
175
|
|
|
176
|
+
# defaults apply to all scripts unless overridden elsewhere
|
|
177
|
+
# shell: pwsh | cmd | bash | sh | powershell
|
|
178
|
+
# pwd: private working directory
|
|
179
|
+
# how: series or parallel
|
|
180
|
+
# env: object of keys and values to inject into the environment
|
|
181
|
+
# You can not specify any other defaults besides defined above
|
|
182
|
+
# defaults require
|
|
174
183
|
defaults:
|
|
175
|
-
|
|
184
|
+
shell: pwsh
|
|
176
185
|
pwd: .
|
|
177
186
|
how: series
|
|
187
|
+
env:
|
|
188
|
+
SOMETHING: value
|
|
178
189
|
|
|
190
|
+
# Scripts that you run with rscripts run <name> or rscripts <name>
|
|
191
|
+
# all values in defaults can be overridden
|
|
192
|
+
# then you specify the actions via script, file, group
|
|
193
|
+
# the script field accepts a string or list of strings
|
|
194
|
+
# the file field accepts a string
|
|
195
|
+
# the group field accepts a list of strings
|
|
179
196
|
scripts:
|
|
180
197
|
hello:
|
|
181
198
|
script: echo "hello world"
|
|
182
199
|
pwd: ./src
|
|
183
200
|
done:
|
|
184
|
-
script:
|
|
185
|
-
|
|
186
|
-
|
|
201
|
+
script:
|
|
202
|
+
- *var_name
|
|
203
|
+
shell: cmd
|
|
204
|
+
ex-file:
|
|
205
|
+
file: ./file.sh
|
|
206
|
+
ex-group:
|
|
207
|
+
group:
|
|
208
|
+
- hello
|
|
209
|
+
- ex-file
|
|
210
|
+
how: parallel
|
|
211
|
+
`.trim()};var dc=i=>{if(i.opts().file===void 0){let t=pr();if(t!==void 0)i.setOptionValue("file",t);else{console.error("No file provided and one not found in working directory");return}}if(Cm(i.opts().file)){B.config=hc.default.parse(dr.default.readFileSync(i.opts().file,"utf8"),{schema:"core",prettyErrors:!0,version:"1.2"});try{uc.validateSync(B.config,{abortEarly:!1,stripUnknown:!1}),B.config.variables&&delete B.config.variables}catch(t){console.error(t),console.error($.red(`YAML config error! ${$.bold.underline.redBright("Errors: "+t.errors.length)}`)),$l(t);return}}if(B.config===void 0){console.error("file passed in is not .rscripts.yml, .rscripts.yaml");return}let e=Em();return B.verbose&&(console.log($.cyanBright("Compiled config")),console.log(e)),e},Em=()=>{let i={},e=B.config.defaults;for(let[t,s]of Object.entries(B.config.scripts))i[t]={},s.script!==void 0||s.file!==void 0?(i[t].shell=s.shell===void 0?e.shell:s.shell,i[t].pwd=s.pwd===void 0?e.pwd:s.pwd,s.script?i[t].script=s.script:i[t].file=s.file,i[t].env=s.env===void 0?e.env===void 0?{}:e.env:s.env):(i[t].how=s.how===void 0?e.how:s.how,i[t].group=s.group);return i},pr=()=>{let i=process.cwd();if(dr.default.existsSync(fc.default.join(i,".rscripts.yml")))return".rscripts.yml"},Cm=i=>i.endsWith(".yml")||i.endsWith(".yaml");var vc=V(require("fs"),1);var bc=V(require("child_process"),1),Je=V(require("path"),1),wc=V(require("fs"),1);var Pt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Nm=Object.keys(Pt);var pc=i=>{let e=i.replace("#","");return e.length<6?e=[...e.slice(0,3)].map(t=>t.repeat(2)).join(""):e.length>6&&(e=e.slice(0,6)),"#"+e};var Tm=i=>[...Dt,...jt].includes(i),$m=i=>i.startsWith("bg"),xm=i=>/^#?[a-f\d]{3,8}$/i.test(i),qm=i=>i in Pt,Im=(i,e)=>{let t=e??$;if(!i||i.length===0)return t;let s=i.split(".");for(let n of s){let r=!1;if(Tm(n)){t=t[n];continue}if($m(n)&&(n=n.slice(2),n=n.slice(0,1).toLowerCase()+n.slice(1),r=!0),qm(n)){t=r?t.bgHex(Pt[n]):t.hex(Pt[n]);continue}if(xm(n)){n=pc(n),t=r?t.bgHex(n):t.hex(n);continue}}return t},G=Im;var Ks=V(yc(),1);var fe=class i{static#e={};static#i=0;static#t=0;static#s=0;static log(e,...t){}static verbose(e,...t){}static process(e,t,s,n=""){let r=i.#e[e],o="whiteBright";t==="err"&&(o="white"),s=s.trim();let a=G(r+".dim")("${group}")+G(r)("${script}")+G("dim")("\u276F${from} ")+G(o)("${message}"),l=(0,Ks.strInterpolator)(a,{script:e,message:s,from:t==="out"?"Out ":"Err ",group:n===""?"":n+"\u279C "});console.log(l)}static processExit(e,t,s=""){let n=i.#e[e],r=t===0?"greenBright":"redBright",o=G(n+".dim")("${group}")+G(n)("${script}")+G("dim")("\u276FExit ")+G("whiteBright")("exited with code:")+G(r)(" ${code}"),a=(0,Ks.strInterpolator)(o,{script:e,code:t,group:s===""?"":s+"\u279C "});console.log(a)}static processStart(e,t=""){let s=i.#r()+".bold";i.#e[e]=s;let n=G(s+".dim")("${group}")+G(s)("${script}")+G("dim")(" ")+G("whiteBright")("Started"),r=(0,Ks.strInterpolator)(n,{script:e,group:t===""?"":t+"\u279C "});console.log(r)}static#n(){let e=["green","yellow","blue","magenta","cyan"][i.#t];return i.#t++,e}static#o(){let e=["greenBright","yellowBright","blueBright","magentaBright","cyanBright"][i.#s];return i.#s++,e}static#r(){let e=["green","yellow","blue","magenta","cyan","greenBright","yellowBright","blueBright","magentaBright","cyanBright"][i.#i];return i.#i++,e}};var Hs=class i{constructor(e,t,s=""){this.toRun=e,this.params=t,this.config=B.config[e],this.type=this.config.script===void 0&&this.config.file===void 0?"group":this.config.file===void 0?"script":"file",this.group=this.config.group,this.script=this.config.script,this.file=this.config.file,this.order=this.config.how,this.pwd=this.config.pwd,this.shell=this.config.shell,this.env={...process.env,...this.config.env},this.processes=[],this.promises=[],this.rootGroup=s}async run(){if(this.type==="script")if(this.#e(),this.#s(this.shell)){let e=this.#i(this.script),t=Je.default.resolve(this.pwd);this.promises.push(this.#t(this.shell,t,e,this.env))}else console.error("shell not found");else if(this.type==="file")if(this.#s(this.shell)){let e=this.file,t=Je.default.resolve(this.pwd);this.promises.push(this.#t(this.shell,t,e,this.env))}else console.error("shell not found");else if(console.log("running group"),this.order==="series")for(let e of this.group)await new i(e,this.params,this.toRun).run();else for(let e of this.group){let t=new i(e,this.params,this.toRun);this.promises.push(t.run())}await Promise.all(this.promises)}#e(){Array.isArray(this.script)?this.script=this.script.map(e=>e.trim()):this.script=this.script.split(`
|
|
187
212
|
`).filter(e=>e.length>0).map(e=>e.trim())}#i(e){return this.shell==="cmd"?e.join(" & "):e.join("; ")}#t(e,t,s,n){let r=[],o="";return e==="pwsh"||e==="powershell"?(r=[s],o="&"):e==="cmd"?(r=[s],this.file!==void 0?o="call":o=" "):(e==="bash"||e==="sh")&&(r=[s],o=" "),new Promise((a,l)=>{let c="",f="",u,h=bc.default.spawn(o,r,{cwd:t,env:n,detached:!1,shell:e,windowsHide:!0});h.on("spawn",()=>{fe.processStart(this.toRun,this.rootGroup),this.processes.push(h.pid),u=h.pid}),h.on("exit",p=>{}),h.on("error",p=>{console.log("error",p),l(p)}),h.on("close",p=>{c&&fe.process(this.toRun,"out",c,this.rootGroup),f&&fe.process(this.toRun,"err",f,this.rootGroup),fe.processExit(this.toRun,p,this.rootGroup),this.processes=this.processes.filter(g=>g!==u),a(p)}),h.stdout.on("data",p=>{for(c+=p.toString("utf8");c.indexOf(`
|
|
188
213
|
`)!==-1;){let g=c.indexOf(`
|
|
189
214
|
`);fe.process(this.toRun,"out",c.substring(0,g),this.rootGroup),c=c.substring(g+1)}}),h.stderr.on("data",p=>{for(f+=p.toString("utf8");f.indexOf(`
|
|
190
215
|
`)!==-1;){let g=f.indexOf(`
|
|
191
|
-
`);fe.process(this.toRun,"err",f.substring(0,g),this.rootGroup),f=f.substring(g+1)}})})}#s(e){let t=process.env.PATH||"",s=process.env.PATHEXT||"";return t.replace(/["]+/g,"").split(Je.default.delimiter).map(function(r){return s.split(Je.default.delimiter).map(function(o){return Je.default.join(r,e+o)})}).reduce(function(r,o){return r.concat(o)}).some(r=>{try{return wc.default.statSync(r).isFile()}catch{return!1}})}#n(){}};var Oe=new xr;Oe.name("Repo Scripts").description("A CLI tool to make running scripts from a repo easier").version(B.version).enablePositionalOptions().showHelpAfterError().option("-v, --verbose","verbose output",!1).option("-f, --file <path>","specify a certian file to use").hook("preSubcommand",(i,e)=>{e.name()!=="init"&&(B.config=dc(Oe),B.config===void 0&&(Oe.outputHelp(),process.exit(1)))}).hook("preAction",(i,e)=>{Object.keys(B.config).includes(e.args[0])||Oe.error(
|
|
216
|
+
`);fe.process(this.toRun,"err",f.substring(0,g),this.rootGroup),f=f.substring(g+1)}})})}#s(e){let t=process.env.PATH||"",s=process.env.PATHEXT||"";return t.replace(/["]+/g,"").split(Je.default.delimiter).map(function(r){return s.split(Je.default.delimiter).map(function(o){return Je.default.join(r,e+o)})}).reduce(function(r,o){return r.concat(o)}).some(r=>{try{return wc.default.statSync(r).isFile()}catch{return!1}})}#n(){}};var Oe=new xr;Oe.name("Repo Scripts").description("A CLI tool to make running scripts from a repo easier").version(B.version).enablePositionalOptions().showHelpAfterError().option("-v, --verbose","verbose output",!1).option("-f, --file <path>","specify a certian file to use").hook("preSubcommand",(i,e)=>{e.name()!=="init"&&(B.config=dc(Oe),B.config===void 0&&(Oe.outputHelp(),process.exit(1)))}).hook("preAction",(i,e)=>{i.args[0]!=="init"&&(Object.keys(B.config).includes(e.args[0])||Oe.error($.redBright.bold("ERROR: ")+$.red("could not find ")+$.underline.whiteBright(e.args[0])+$.red(" as a defined script"),{}))}).on("option:verbose",()=>{B.verbose=Oe.opts().verbose});Oe.command("init").description("create a template config").action(i=>{pr()===void 0?(console.log($.bold.greenBright("Creating default config")),vc.default.writeFileSync(".rscripts.yml",B.defaultFile)):console.error($.bold.redBright("ERROR:"),$.red("found a default config already"))});Oe.command("run",{isDefault:!0}).argument("<script>").argument("[params...]").description("run a script defined in config").action(async(i,e)=>{console.log(),console.log($.dim(">"),"rscripts run",i,...e),console.log(),await new Hs(i,e).run()});Oe.parse();
|
package/package.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fidget-code/rscripts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "RScripts is a tool for running scripts in a project agnostic way.",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"bin":
|
|
7
|
-
"rscripts": "dist/index.cjs"
|
|
8
|
-
},
|
|
5
|
+
"main": "dist/indes.cjs",
|
|
6
|
+
"bin": "dist/index.cjs",
|
|
9
7
|
"scripts": {
|
|
10
8
|
"test": "node . -f tests/.rscripts.yml",
|
|
11
9
|
"start": "node .",
|
|
@@ -22,6 +20,9 @@
|
|
|
22
20
|
"files": [
|
|
23
21
|
"dist/**/*"
|
|
24
22
|
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"main": "dist/indes.cjs"
|
|
25
|
+
},
|
|
25
26
|
"license": "MIT",
|
|
26
27
|
"type": "module",
|
|
27
28
|
"devDependencies": {
|