@directus-labs/super-header-interface
Version:
A super powerful header interface for Directus that allows you to create rich page headers with titles, subtitles, help information, and interactive actions. Perfect for enhancing the user experience with contextual information and quick access to common
1 lines • 299 kB
JavaScript
import{useApi as e,useStores as t,defineInterface as n}from"@directus/extensions-sdk";import{defineComponent as r,openBlock as i,createElementBlock as o,createCommentVNode as s,ref as a,computed as l,inject as c,onMounted as u,onUnmounted as f,watch as d,resolveComponent as p,resolveDirective as h,createElementVNode as m,normalizeStyle as _,createBlock as g,createVNode as v,Fragment as y,withCtx as b,createTextVNode as w,toDisplayString as x,unref as $,withDirectives as k,renderList as j}from"vue";import{useI18n as R}from"vue-i18n";import{useRouter as S}from"vue-router";function A(e){return e.charAt(0).toUpperCase()+e.substring(1)}var O=["2D","3D","4WD","A2O","AI","API","BIOS","CC","CCTV","CCV","CD","CD-ROM","CIA","CMS","COBOL","CSS","CSV","CV","DB","DIY","DNA","DVD","E3","EIN","ESPN","FAQ","FAQs","FBI","FORTRAN","FPS","FTP","HTML","HTTP","HTTPS","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2A","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SDK","SITCOM","SKU","SMTP","SQL","SSL","SSN","SWAT","TBS","TLS","TNA","TS","TTL","TV","UI","URL","USB","UWP","VIP","W3C","WWE","WWF","WWW","WYSIWYG"],E=["a","an","the"],C=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],I=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],T=["2FA","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","FMS","GitHub","GPT","HD","IBMid","IDs","iMac","IMAX","iOS","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","OpenAI","PDFs","PIM","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function D(e,t,n){const r=e.toLowerCase(),i=e.toUpperCase();for(const e of T)if(e.toLowerCase()===r)return e;return O.includes(i)?i:0===t||t===n.length-1||e.length>=4?e:I.includes(r)||C.includes(r)||E.includes(r)?r:e}function N(e,t){return`${e} ${t}`}var M=function(e,t=new RegExp("\\s|-|_","g")){return(n=e,n.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()).split(t).map(A).map(D).reduce(N);var n};var L=(0).constructor,F=L.isFinite;L.isInteger;var P=[].constructor.isArray;function z(e){return null!==e&&"object"==typeof e}function q(e,t){return void 0===t&&(t=0),"string"==typeof e&&e.length>=t}function U(e){return F(e)}function W(e){return P(e)}function B(e,t){return z(e)&&t in e}var V=new(function(){function e(e){this.size=e,this.reset()}return e.prototype.reset=function(){this.oldestIndex=0,this.map={},this.cachedKeys=new Array(this.size)},e.prototype.get=function(e){return this.map[e]},e.prototype.set=function(e,t){this.map[e]=t;var n=this.cachedKeys[this.oldestIndex];void 0!==n&&delete this.map[n],this.cachedKeys[this.oldestIndex]=e,this.oldestIndex++,this.oldestIndex%=this.size},e}())(1e3);function G(e){var t=e.charAt(0),n=e.substr(-1);if("'\"`".includes(t)||"'\"`".includes(n)){if(e.length<2||t!==n)throw new SyntaxError('Mismatching string quotation: "'+e+'"');return e.substring(1,e.length-1)}if(e.includes("["))throw new SyntaxError('Missing ] in varName "'+e+'"');return"+"===t?e.substr(1):e}function H(e,t,n){var r=t.trim();if(""===r)return e;if(r.startsWith(".")){if(!n)throw new SyntaxError('Unexpected . at the start of "'+t+'"');if(""===(r=r.substr(1).trim()))return e}else if(n)throw new SyntaxError('Missing . at the start of "'+t+'"');if(r.endsWith("."))throw new SyntaxError('Unexpected "." at the end of "'+t+'"');for(var i=0,o=r.split(".");i<o.length;i++){var s=o[i].trim();if(""===s)throw new SyntaxError('Empty prop name when parsing "'+t+'"');e.push(s)}return e}function K(e){if(!q(e))throw new TypeError("Cannot parse path. Expected string. Got a "+typeof e);for(var t,n,r=0,i=!1,o=new Array(0),s=0;s<e.length&&-1!==(t=e.indexOf("[",s));s=r){if(-1===(r=e.indexOf("]",t)))throw new SyntaxError('Missing ] in varName "'+e+'"');if(0===(n=e.substring(t+1,r).trim()).length)throw new SyntaxError("Unexpected token ]");r++,H(o,e.substring(s,t),i),o.push(G(n)),i=!0}return H(o,e.substring(r),i)}function Z(e,t,n){if(void 0===n&&(n={}),!z(n))throw new TypeError("get expects an object option. Got "+typeof n);var r=n.depth,i=void 0===r?10:r;if(!U(i)||i<=0)throw new RangeError("Expected a positive number for depth. Got "+i);var o=Array.isArray(t)?t:K.cached(t),s=function(){return o.join(" > ")};if(o.length>i)throw new ReferenceError("The path cannot be deeper than "+i+' levels. Got "'+s()+'"');for(var a=e,l=0,c=o;l<c.length;l++){var u=c[l];if(!B(a,u)){if(n.propsExist)throw new ReferenceError(u+' is not defined in the scope at path: "'+s()+'"');return}a=a[u]}return a}K.cached=function(e){var t=V.get(e);return void 0===t&&(t=K(e),V.set(e,t)),t};var Y=function(){function e(e,t){var n=this;if(void 0===t&&(t={}),this.tokens=e,this.options=t,this.render=function(e){void 0===e&&(e={});var t=n.tokens.varNames.length;n.cacheParsedPaths();for(var r=new Array(t),i=0;i<t;i++)r[i]=Z(e,n.toPathCache[i],n.options);return n.stringify(r)},this.renderFn=function(e,t){void 0===t&&(t={});var r=n.resolveVarNames(e,t);return n.stringify(r)},this.renderFnAsync=function(e,t){return void 0===t&&(t={}),Promise.all(n.resolveVarNames(e,t)).then((function(e){return n.stringify(e)}))},!z(e)||!W(e.strings)||!W(e.varNames)||e.strings.length!==e.varNames.length+1)throw new TypeError("Invalid tokens object");if(!z(t))throw new TypeError("Options should be an object. Got a "+typeof t);t.validateVarNames&&this.cacheParsedPaths()}return e.prototype.cacheParsedPaths=function(){var e=this.tokens.varNames;if(void 0===this.toPathCache){this.toPathCache=new Array(e.length);for(var t=0;t<e.length;t++)this.toPathCache[t]=K.cached(e[t])}},e.prototype.resolveVarNames=function(e,t){void 0===t&&(t={});var n=this.tokens.varNames;if(!function(e){return"function"==typeof e}(e))throw new TypeError("Expected a resolver function. Got "+String(e));for(var r=n.length,i=new Array(r),o=0;o<r;o++)i[o]=e.call(null,n[o],t);return i},e.prototype.stringify=function(e){for(var t=this.tokens.strings,n=this.options.explicit,r=e.length,i="",o=0;o<r;o++){i+=t[o];var s=e[o];(n||null!=s)&&(i+=s)}return i+=t[r]},e}();function J(e,t){void 0===t&&(t={});var n=function(e,t){if(void 0===t&&(t={}),!q(e))throw new TypeError("The template parameter must be a string. Got a "+typeof e);if(!z(t))throw new TypeError("Options should be an object. Got a "+typeof t);var n=t.tags,r=void 0===n?["{{","}}"]:n,i=t.maxVarNameLength,o=void 0===i?1e3:i;if(!W(r)||2!==r.length)throw TypeError("tags should be an array of two elements. Got "+String(r));var s=r[0],a=r[1];if(!q(s,1)||!q(a,1)||s===a)throw new TypeError('The open and close symbols should be two distinct non-empty strings. Got "'+s+'" and "'+a+'"');if(!U(o)||o<=0)throw new Error("Expected a positive number for maxVarNameLength. Got "+o);for(var l,c,u=s.length,f=a.length,d=0,p=[],h=[],m=0;m<e.length&&-1!==(l=e.indexOf(s,m));){var _=l+u;if(-1===(d=e.substr(_,o+f).indexOf(a)))throw new SyntaxError('Missing "'+a+'" in the template for the "'+s+'" at position '+l+" within "+o+" characters");if(d+=_,0===(c=e.substring(_,d).trim()).length)throw new SyntaxError('Unexpected "'+a+'" tag found at position '+l);if(c.includes(s))throw new SyntaxError('Variable names cannot have "'+s+'". But at position '+l+'. Got "'+c+'"');h.push(c),d+=f,p.push(e.substring(m,l)),m=d}return p.push(e.substring(d)),{strings:p,varNames:h}}(e,t);return new Y(n,t)}var Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ee,te={exports:{}};ee=te,function(e,t){ee.exports=t()}(self,(()=>{return e={7629:(e,t,n)=>{const r=n(375),i=n(8571),o=n(9474),s=n(1687),a=n(8652),l=n(8160),c=n(3292),u=n(6354),f=n(8901),d=n(9708),p=n(6914),h=n(2294),m=n(6133),_=n(1152),g=n(8863),v=n(2036),y={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new h.Ids,this._preferences=null,this._refs=new m.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return r("function"==typeof d.describe,"Manifest functionality disabled"),d.describe(this)}allow(...e){return l.verifyFlat(e,"allow"),this._values(e,"_valids")}alter(e){r(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),r(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const n in e){const i=e[n];r("function"==typeof i,"Alteration adjuster for",n,"must be a function"),t.$_terms.alterations.push({target:n,adjuster:i})}return t.$_temp.ruleset=!1,t}artifact(e){return r(void 0!==e,"Artifact cannot be undefined"),r(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return r(!1===e||"string"==typeof e,"Invalid to value"),r(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return r(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return r(e,"Missing error"),r(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e,t={}){return r(void 0!==e,"Missing example"),l.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(r(!t,"Cannot combine options with description"),t=e.description,e=e.method),r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(r("string"==typeof e,"id must be a non-empty string"),r(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(...e){return this._values(e,"_invalids")}label(e){return r(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return r(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(...e){r(e.length,"Missing notes");for(const t of e)r(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!0){return r("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){r(e,"Missing preferences"),r(void 0===e.context,"Cannot override context"),r(void 0===e.externals,"Cannot override externals"),r(void 0===e.warnings,"Cannot override warnings"),r(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);const t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return r(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(e=!0){return this.$_setFlag("result",e?"raw":void 0)}result(e){return r(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),n=void 0!==e&&!e;return t._preferences=l.preferences(t._preferences,{convert:n}),t}strip(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){r(e.length,"Missing tags");for(const t of e)r(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return r(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){l.verifyFlat(e,"valid");const t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){const n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);const i=c.when(n,e,t);if(!["any","link"].includes(n.type)){const e=i.is?[i]:i.switch;for(const t of e)r(!t.then||"any"===t.then.type||t.then.type===n.type,"Cannot combine",n.type,"with",t.then&&t.then.type),r(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===n.type,"Cannot combine",n.type,"with",t.otherwise&&t.otherwise.type)}return n.$_terms.whens.push(i),n.$_mutateRebuild()}cache(e){r(!this._inRuleset(),"Cannot set caching inside a ruleset"),r(!this._cache,"Cannot override schema cache"),r(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||a.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){r(l.isSchema(e),"Invalid schema object"),r("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),r(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),r(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const n=e.clone();for(const e of Object.keys(t))"type"!==e&&(n[e]=t[e]);t=n}t._ids.concat(e._ids),t._refs.register(e,m.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=v.merge(t._valids,e._valids,e._invalids),t._invalids=v.merge(t._invalids,e._invalids,e._valids);for(const n of e._singleRules.keys())t._singleRules.has(n)&&(t._rules=t._rules.filter((e=>e.keep||e.name!==n)),t._singleRules.delete(n));for(const n of e._rules)e._definition.rules[n.method].multi||t._singleRules.set(n.name,n),t._rules.push(n);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const n=Object.assign({},e._flags);delete n.empty,s(t._flags,n)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const n=Object.assign({},e._flags);delete n.empty,s(t._flags,n)}else s(t._flags,e._flags);for(const n in e.$_terms){const r=e.$_terms[n];r?t.$_terms[n]?t.$_terms[n]=t.$_terms[n].concat(r):t.$_terms[n]=r.slice():t.$_terms[n]||(t.$_terms[n]=r)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return r(!e.base,"Cannot extend type with another base"),f.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){r(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(e))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,t,n);return n.$_temp.ruleset=!1,n}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),r(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const n=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;r(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");const o=this.clone();for(let s=n;s<o._rules.length;++s){const n=o._rules[s],a=i(n);for(const i in e)t.modifiers[i](a,e[i]),r(a.name===n.name,"Cannot change rule name");o._rules[s]=a,o._singleRules.get(a.name)===n&&o._singleRules.set(a.name,a)}return o.$_temp.ruleset=!1,o.$_mutateRebuild()}get ruleset(){r(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),r(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(const{target:n,adjuster:i}of this.$_terms.alterations)e.includes(n)&&(t=i(t),r(l.isSchema(t),"Alteration adjuster for",n,"failed to return a schema object"));return t=t.$_modify({each:t=>t.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return _.location?_.location(this):this}validate(e,t){return g.entry(e,this,t)}validateAsync(e,t){return g.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),r(e&&"object"==typeof e,"Invalid options"),r(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)r("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const n=this._definition.rules[t.method],i=t.args;r(n,"Unknown rule",t.method);const o=this.clone();if(i){r(1===Object.keys(i).length||Object.keys(i).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in i){let s=i[e];if(n.argsByName){const a=n.argsByName.get(e);if(a.ref&&l.isResolvable(s))t._resolve.push(e),o.$_mutateRegister(s);else if(a.normalize&&(s=a.normalize(s),i[e]=s),a.assert){const t=l.validateArg(s,e,a);r(!t,t,"or reference")}}void 0!==s?i[e]=s:delete i[e]}}return n.multi||(o._ruleRemove(t.name,{clone:!1}),o._singleRules.set(t.name,t)),!1===o.$_temp.ruleset&&(o.$_temp.ruleset=null),n.priority?o._rules.unshift(t):o._rules.push(t),o}$_compile(e,t){return c.schema(this.$_root,e,t)}$_createError(e,t,n,r,i,o={}){const s=!1!==o.flags?this._flags:{},a=o.messages?p.merge(this._definition.messages,o.messages):this._definition.messages;return new u.Report(e,t,n,s,a,r,i)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,n,r){(n=Object.assign({},n)).abortEarly=!0,n._externals=!1,t.snapshot();const i=!g.validate(e,this,t,n,r).errors;return t.restore(),i}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),h.schema(this,e)||this}$_mutateRebuild(){return r(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,{source:t,name:n,path:r,key:i})=>{const o=this._definition[t][n]&&this._definition[t][n].register;!1!==o&&this.$_mutateRegister(e,{family:o,key:i})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:n}={}){this._refs.register(e,t),this._ids.register(e,{key:n})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,n={}){r("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const i=this._definition.flags[e]||{};if(o(t,i.default)&&(t=void 0),o(t,this._flags[e]))return this;const s=!1!==n.clone?this.clone():this;return void 0!==t?(s._flags[e]=t,s.$_mutateRegister(t)):delete s._flags[e],"_"!==e[0]&&(s.$_temp.ruleset=!1),s}$_parent(e,...t){return this[e][l.symbols.parent].call(this,...t)}$_validate(e,t,n){return g.validate(e,this,t,n)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=i(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const n in t){const r=t[n];e.$_terms[n]=r.init}return e.$_mutateRebuild()}_default(e,t,n={}){return l.assertOptions(n,"literal"),r(void 0!==t,"Missing",e,"value"),r("function"==typeof t||!n.literal,"Only function value supports literal option"),"function"==typeof t&&n.literal&&(t={[l.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,n){if(!this.$_terms.whens)return{schema:this};const r=[],i=[];for(let o=0;o<this.$_terms.whens.length;++o){const s=this.$_terms.whens[o];if(s.concat){r.push(s.concat),i.push(`${o}.concat`);continue}const a=s.ref?s.ref.resolve(e,t,n):e,l=s.is?[s]:s.switch,c=i.length;for(let c=0;c<l.length;++c){const{is:u,then:f,otherwise:d}=l[c],p=`${o}${s.switch?"."+c:""}`;if(u.$_match(a,t.nest(u,`${p}.is`),n)){if(f){const o=t.localize([...t.path,`${p}.then`],t.ancestors,t.schemas),{schema:s,id:a}=f._generate(e,o,n);r.push(s),i.push(`${p}.then${a?`(${a})`:""}`);break}}else if(d){const o=t.localize([...t.path,`${p}.otherwise`],t.ancestors,t.schemas),{schema:s,id:a}=d._generate(e,o,n);r.push(s),i.push(`${p}.otherwise${a?`(${a})`:""}`);break}}if(s.break&&i.length>c)break}const o=i.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",o),!o)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[o])return{schema:this.$_temp.whens[o],id:o};let s=this;this._definition.generate&&(s=this._definition.generate(this,e,t,n));for(const e of r)s=s.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(s,[this,...r]),this.$_temp.whens[o]=s,{schema:s,id:o}}_inner(e,t,n={}){r(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const i=this.clone();return i.$_terms[e]&&!n.override||(i.$_terms[e]=[]),n.single?i.$_terms[e].push(t):i.$_terms[e].push(...t),i.$_temp.ruleset=!1,i}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){if(!this._singleRules.has(e))return this;const n=!1!==t.clone?this.clone():this;n._singleRules.delete(e);const r=[];for(let t=0;t<n._rules.length;++t){const i=n._rules[t];i.name!==e||i.keep?r.push(i):n._inRuleset()&&t<n.$_temp.ruleset&&--n.$_temp.ruleset}return n._rules=r,n}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const n=this.clone(),i=e[0]===l.symbols.override;if(i&&(e=e.slice(1)),!n[t]&&e.length?n[t]=new v:i&&(n[t]=e.length?new v:null,n.$_mutateRebuild()),!n[t])return n;i&&n[t].override();for(const i of e){r(void 0!==i,"Cannot call allow/valid/invalid with undefined"),r(i!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";n[e]&&(n[e].remove(i),n[e].length||(r("_valids"===t||!n._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),n[e]=null)),n[t].add(i,n._refs)}return n}}};y.Base.prototype[l.symbols.any]={version:l.version,compile:c.compile,root:"$_root"},y.Base.prototype.isImmutable=!0,y.Base.prototype.deny=y.Base.prototype.invalid,y.Base.prototype.disallow=y.Base.prototype.invalid,y.Base.prototype.equal=y.Base.prototype.valid,y.Base.prototype.exist=y.Base.prototype.required,y.Base.prototype.not=y.Base.prototype.invalid,y.Base.prototype.options=y.Base.prototype.prefs,y.Base.prototype.preferences=y.Base.prototype.prefs,e.exports=new y.Base},8652:(e,t,n)=>{const r=n(375),i=n(8571),o=n(8160),s={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new s.Cache(e)},s.Cache=class{constructor(e={}){o.assertOptions(e,["max"]),r(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||s.max,this._map=new Map,this._list=new s.List}get length(){return this._map.size}set(e,t){if(null!==e&&!s.supported.has(typeof e))return;let n=this._map.get(e);if(n)return n.value=t,void this._list.first(n);n=this._list.unshift({key:e,value:t}),this._map.set(e,n),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),i(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},s.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:n}=e;return t.prev=n,n&&(n.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},8160:(e,t,n)=>{const r=n(375),i=n(7916),o=n(5934);let s,a;const l={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=o.version,t.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},t.assertOptions=function(e,t,n="Options"){r(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const i=Object.keys(e).filter((e=>!t.includes(e)));r(0===i.length,`${n} contain unknown keys: ${i}`)},t.checkPreferences=function(e){a=a||n(3378);const t=a.preferences.validate(e);if(t.error)throw new i([t.error.details[0].message])},t.compare=function(e,t,n){switch(n){case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}},t.default=function(e,t){return void 0===e?t:e},t.isIsoDate=function(e){return l.isoDate.test(e)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isResolvable=function(e){return!!e&&(e[t.symbols.ref]||e[t.symbols.template])},t.isSchema=function(e,n={}){const i=e&&e[t.symbols.any];return!!i&&(r(n.legacy||i.version===t.version,"Cannot mix different versions of joi schemas"),!0)},t.isValues=function(e){return e[t.symbols.values]},t.limit=function(e){return Number.isSafeInteger(e)&&e>=0},t.preferences=function(e,r){s=s||n(6914),e=e||{},r=r||{};const i=Object.assign({},e,r);return r.errors&&e.errors&&(i.errors=Object.assign({},e.errors,r.errors),i.errors.wrap=Object.assign({},e.errors.wrap,r.errors.wrap)),r.messages&&(i.messages=s.compile(r.messages,e.messages)),delete i[t.symbols.prefs],i},t.tryWithPath=function(e,t,n={}){try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,n.append&&(e.message=`${e.message} (${e.path})`),e}},t.validateArg=function(e,n,{assert:r,message:i}){if(t.isSchema(r)){const t=r.validate(e);if(!t.error)return;return t.error.message}if(!r(e))return n?`${n} ${i}`:i},t.verifyFlat=function(e,t){for(const n of e)r(!Array.isArray(n),"Method no longer accepts array arguments:",t)}},3292:(e,t,n)=>{const r=n(375),i=n(8160),o=n(6133),s={};t.schema=function(e,t,n={}){i.assertOptions(n,["appendPath","override"]);try{return s.schema(e,t,n)}catch(e){throw n.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},s.schema=function(e,t,n){r(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(r(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));const o=(t,...r)=>!1!==n.override?t.valid(e.override,...r):t.valid(...r);if(s.simple(t))return o(e,t);if("function"==typeof t)return e.custom(t);if(r("object"==typeof t,"Invalid schema content:",typeof t),i.isResolvable(t))return o(e,t);if(i.isSchema(t))return t;if(Array.isArray(t)){for(const n of t)if(!s.simple(n))return e.alternatives().try(...t);return o(e,...t)}return t instanceof RegExp?e.string().regex(t):t instanceof Date?o(e.date(),t):(r(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(t))},t.ref=function(e,t){return o.isRef(e)?e:o.create(e,t)},t.compile=function(e,n,o={}){i.assertOptions(o,["legacy"]);const a=n&&n[i.symbols.any];if(a)return r(o.legacy||a.version===i.version,"Cannot mix different versions of joi schemas:",a.version,i.version),n;if("object"!=typeof n||!o.legacy)return t.schema(e,n,{appendPath:!0});const l=s.walk(n);return l?l.compile(l.root,n):t.schema(e,n,{appendPath:!0})},s.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=s.walk(t);if(e)return e}return null}const t=e[i.symbols.any];if(t)return{root:e[t.root],compile:t.compile};r(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const n=s.walk(e[t]);if(n)return n}return null},s.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,n,a){if(void 0===a&&(r(n&&"object"==typeof n,"Missing options"),a=n,n=o.create(".")),Array.isArray(a)&&(a={switch:a}),i.assertOptions(a,["is","not","then","otherwise","switch","break"]),i.isSchema(n))return r(void 0===a.is,'"is" can not be used with a schema condition'),r(void 0===a.not,'"not" can not be used with a schema condition'),r(void 0===a.switch,'"switch" can not be used with a schema condition'),s.condition(e,{is:n,then:a.then,otherwise:a.otherwise,break:a.break});if(r(o.isRef(n)||"string"==typeof n,"Invalid condition:",n),r(void 0===a.not||void 0===a.is,'Cannot combine "is" with "not"'),void 0===a.switch){let l=a;void 0!==a.not&&(l={is:a.not,then:a.otherwise,otherwise:a.then,break:a.break});let c=void 0!==l.is?e.$_compile(l.is):e.$_root.invalid(null,!1,0,"").required();return r(void 0!==l.then||void 0!==l.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),r(void 0===l.break||void 0===l.then||void 0===l.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===a.is||o.isRef(a.is)||i.isSchema(a.is)||(c=c.required()),s.condition(e,{ref:t.ref(n),is:c,then:l.then,otherwise:l.otherwise,break:l.break})}r(Array.isArray(a.switch),'"switch" must be an array'),r(void 0===a.is,'Cannot combine "switch" with "is"'),r(void 0===a.not,'Cannot combine "switch" with "not"'),r(void 0===a.then,'Cannot combine "switch" with "then"');const l={ref:t.ref(n),switch:[],break:a.break};for(let t=0;t<a.switch.length;++t){const n=a.switch[t],s=t===a.switch.length-1;i.assertOptions(n,s?["is","then","otherwise"]:["is","then"]),r(void 0!==n.is,'Switch statement missing "is"'),r(void 0!==n.then,'Switch statement missing "then"');const c={is:e.$_compile(n.is),then:e.$_compile(n.then)};if(o.isRef(n.is)||i.isSchema(n.is)||(c.is=c.is.required()),s){r(void 0===a.otherwise||void 0===n.otherwise,'Cannot specify "otherwise" inside and outside a "switch"');const t=void 0!==a.otherwise?a.otherwise:n.otherwise;void 0!==t&&(r(void 0===l.break,"Cannot specify both otherwise and break"),c.otherwise=e.$_compile(t))}l.switch.push(c)}return l},s.condition=function(e,t){for(const n of["then","otherwise"])void 0===t[n]?delete t[n]:t[n]=e.$_compile(t[n]);return t}},6354:(e,t,n)=>{const r=n(5688),i=n(8160),o=n(3328);t.Report=class{constructor(e,n,r,i,o,s,a){if(this.code=e,this.flags=i,this.messages=o,this.path=s.path,this.prefs=a,this.state=s,this.value=n,this.message=null,this.template=null,this.local=r||{},this.local.label=t.label(this.flags,this.state,this.prefs,this.messages),void 0===this.value||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];"object"!=typeof e&&(this.local.key=e)}}_setTemplate(e){if(this.template=e,!this.flags.label&&0===this.path.length){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const e=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return void 0===t?`Error code "${e}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(e,n){return t.template(this.value,e,n||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(const n of e)"object"!=typeof n&&("string"==typeof n?(t&&(t+="."),t+=n):t+=`[${n}]`);return t},t.template=function(e,t,n,r,s){if(!t)return;if(o.isTemplate(t))return"root"!==n?t:null;let a=s.errors.language;if(i.isResolvable(a)&&(a=a.resolve(e,r,s)),a&&t[a]){if(void 0!==t[a][n])return t[a][n];if(void 0!==t[a]["*"])return t[a]["*"]}return t[n]?t[n]:t["*"]},t.label=function(e,n,r,i){if(!r.errors.label)return"";if(e.label)return e.label;let o=n.path;return"key"===r.errors.label&&n.path.length>1&&(o=n.path.slice(-1)),t.path(o)||t.template(null,r.messages,"root",n,r)||i&&t.template(null,i,"root",n,r)||"value"},t.process=function(e,n,r){if(!e)return null;const{override:i,message:o,details:s}=t.details(e);if(i)return i;if(r.errors.stack)return new t.ValidationError(o,s,n);const a=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new t.ValidationError(o,s,n);return Error.stackTraceLimit=a,l},t.details=function(e,t={}){let n=[];const r=[];for(const i of e){if(i instanceof Error){if(!1!==t.override)return{override:i};const e=i.toString();n.push(e),r.push({message:e,type:"override",context:{error:i}});continue}const e=i.toString();n.push(e),r.push({message:e,path:i.path.filter((e=>"object"!=typeof e)),type:i.code,context:i.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}},t.ValidationError=class extends Error{constructor(e,t,n){super(e),this._original=n,this.details=t}static isError(e){return e instanceof t.ValidationError}},t.ValidationError.prototype.isJoi=!0,t.ValidationError.prototype.name="ValidationError",t.ValidationError.prototype.annotate=r.error},8901:(e,t,n)=>{const r=n(375),i=n(8571),o=n(8160),s=n(6914),a={};t.type=function(e,t){const n=Object.getPrototypeOf(e),l=i(n),c=e._assign(Object.create(l)),u=Object.assign({},t);delete u.base,l._definition=u;const f=n._definition||{};u.messages=s.merge(f.messages,u.messages),u.properties=Object.assign({},f.properties,u.properties),c.type=u.type,u.flags=Object.assign({},f.flags,u.flags);const d=Object.assign({},f.terms);if(u.terms)for(const e in u.terms){const t=u.terms[e];r(void 0===c.$_terms[e],"Invalid term override for",u.type,e),c.$_terms[e]=t.init,d[e]=t}u.terms=d,u.args||(u.args=f.args),u.prepare=a.prepare(u.prepare,f.prepare),u.coerce&&("function"==typeof u.coerce&&(u.coerce={method:u.coerce}),u.coerce.from&&!Array.isArray(u.coerce.from)&&(u.coerce={method:u.coerce.method,from:[].concat(u.coerce.from)})),u.coerce=a.coerce(u.coerce,f.coerce),u.validate=a.validate(u.validate,f.validate);const p=Object.assign({},f.rules);if(u.rules)for(const e in u.rules){const t=u.rules[e];r("object"==typeof t,"Invalid rule definition for",u.type,e);let n=t.method;if(void 0===n&&(n=function(){return this.$_addRule(e)}),n&&(r(!l[e],"Rule conflict in",u.type,e),l[e]=n),r(!p[e],"Rule conflict in",u.type,e),p[e]=t,t.alias){const e=[].concat(t.alias);for(const n of e)l[n]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map((e=>("string"==typeof e&&(e={name:e}),r(!t.argsByName.has(e.name),"Duplicated argument name",e.name),o.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e))))}u.rules=p;const h=Object.assign({},f.modifiers);if(u.modifiers)for(const e in u.modifiers){r(!l[e],"Rule conflict in",u.type,e);const t=u.modifiers[e];r("function"==typeof t,"Invalid modifier definition for",u.type,e);const n=function(t){return this.rule({[e]:t})};l[e]=n,h[e]=t}if(u.modifiers=h,u.overrides){l._super=n,c.$_super={};for(const e in u.overrides)r(n[e],"Cannot override missing",e),u.overrides[e][o.symbols.parent]=n[e],c.$_super[e]=n[e].bind(c);Object.assign(l,u.overrides)}u.cast=Object.assign({},f.cast,u.cast);const m=Object.assign({},f.manifest,u.manifest);return m.build=a.build(u.manifest&&u.manifest.build,f.manifest&&f.manifest.build),u.manifest=m,u.rebuild=a.rebuild(u.rebuild,f.rebuild),c},a.build=function(e,t){return e&&t?function(n,r){return t(e(n,r),r)}:e||t},a.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(n,r){let i;if((!t.from||t.from.includes(typeof n))&&(i=t.method(n,r),i)){if(i.errors||void 0===i.value)return i;n=i.value}if(!e.from||e.from.includes(typeof n)){const t=e.method(n,r);if(t)return t}return i}}:e||t},a.prepare=function(e,t){return e&&t?function(n,r){const i=e(n,r);if(i){if(i.errors||void 0===i.value)return i;n=i.value}return t(n,r)||i}:e||t},a.rebuild=function(e,t){return e&&t?function(n){t(n),e(n)}:e||t},a.validate=function(e,t){return e&&t?function(n,r){const i=t(n,r);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;n=i.value}return e(n,r)||i}:e||t}},5107:(e,t,n)=>{const r=n(375),i=n(8571),o=n(8652),s=n(8160),a=n(3292),l=n(6354),c=n(8901),u=n(9708),f=n(6133),d=n(3328),p=n(1152);let h;const m={types:{alternatives:n(4946),any:n(8068),array:n(546),boolean:n(4937),date:n(7500),function:n(390),link:n(8785),number:n(3832),object:n(8966),string:n(7417),symbol:n(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const e={_types:new Set(Object.keys(m.types))};for(const t of e._types)e[t]=function(...e){return r(!e.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments"),m.generate(this,m.types[t],e)};for(const t of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])e[t]=function(...e){return this.any()[t](...e)};Object.assign(e,m.methods);for(const t in m.aliases){const n=m.aliases[t];e[t]=e[n]}return e.x=e.expression,p.setup&&p.setup(e),e}};m.methods={ValidationError:l.ValidationError,version:s.version,cache:o.provider,assert(e,t,...n){m.assert(e,t,!0,n)},attempt:(e,t,...n)=>m.assert(e,t,!1,n),build(e){return r("function"==typeof u.build,"Manifest functionality disabled"),u.build(this,e)},checkPreferences(e){s.checkPreferences(e)},compile(e,t){return a.compile(this,e,t)},defaults(e){r("function"==typeof e,"modifier must be a function");const t=Object.assign({},this);for(const n of t._types){const i=e(t[n]());r(s.isSchema(i),"modifier must return a valid schema object"),t[n]=function(...e){return m.generate(this,i,e)}}return t},expression:(...e)=>new d(...e),extend(...e){s.verifyFlat(e,"extend"),h=h||n(3378),r(e.length,"You need to provide at least one extension"),this.assert(e,h.extensions);const t=Object.assign({},this);t._types=new Set(t._types);for(let n of e){"function"==typeof n&&(n=n(t)),this.assert(n,h.extension);const e=m.expandExtension(n,t);for(const n of e){r(void 0===t[n.type]||t._types.has(n.type),"Cannot override name",n.type);const e=n.base||this.any(),i=c.type(e,n);t._types.add(n.type),t[n.type]=function(...e){return m.generate(this,i,e)}}}return t},isError:l.ValidationError.isError,isExpression:d.isTemplate,isRef:f.isRef,isSchema:s.isSchema,in:(...e)=>f.in(...e),override:s.symbols.override,ref:(...e)=>f.create(...e),types(){const e={};for(const t of this._types)e[t]=this[t]();for(const t in m.aliases)e[t]=this[t]();return e}},m.assert=function(e,t,n,r){const o=r[0]instanceof Error||"string"==typeof r[0]?r[0]:null,a=null!==o?r[1]:r[0],c=t.validate(e,s.preferences({errors:{stack:!0}},a||{}));let u=c.error;if(!u)return c.value;if(o instanceof Error)throw o;const f=n&&"function"==typeof u.annotate?u.annotate():u.message;throw u instanceof l.ValidationError==0&&(u=i(u)),u.message=o?`${o} ${f}`:f,u},m.generate=function(e,t,n){return r(e,"Must be invoked on a Joi instance."),t.$_root=e,t._definition.args&&n.length?t._definition.args(t,...n):t},m.expandExtension=function(e,t){if("string"==typeof e.type)return[e];const n=[];for(const r of t._types)if(e.type.test(r)){const i=Object.assign({},e);i.type=r,i.base=t[r](),n.push(i)}return n},e.exports=m.root()},6914:(e,t,n)=>{const r=n(375),i=n(8571),o=n(3328);t.compile=function(e,t){if("string"==typeof e)return r(!t,"Cannot set single message string"),new o(e);if(o.isTemplate(e))return r(!t,"Cannot set single message template"),e;r("object"==typeof e&&!Array.isArray(e),"Invalid message options"),t=t?i(t):{};for(let n in e){const i=e[n];if("root"===n||o.isTemplate(i)){t[n]=i;continue}if("string"==typeof i){t[n]=new o(i);continue}r("object"==typeof i&&!Array.isArray(i),"Invalid message for",n);const s=n;for(n in t[s]=t[s]||{},i){const e=i[n];"root"===n||o.isTemplate(e)?t[s][n]=e:(r("string"==typeof e,"Invalid message for",n,"in",s),t[s][n]=new o(e))}}return t},t.decompile=function(e){const t={};for(let n in e){const r=e[n];if("root"===n){t.root=r;continue}if(o.isTemplate(r)){t[n]=r.describe({compact:!0});continue}const i=n;for(n in t[i]={},r){const e=r[n];"root"!==n?t[i][n]=e.describe({compact:!0}):t[i].root=e}}return t},t.merge=function(e,n){if(!e)return t.compile(n);if(!n)return e;if("string"==typeof n)return new o(n);if(o.isTemplate(n))return n;const s=i(e);for(let e in n){const t=n[e];if("root"===e||o.isTemplate(t)){s[e]=t;continue}if("string"==typeof t){s[e]=new o(t);continue}r("object"==typeof t&&!Array.isArray(t),"Invalid message for",e);const i=e;for(e in s[i]=s[i]||{},t){const n=t[e];"root"===e||o.isTemplate(n)?s[i][e]=n:(r("string"==typeof n,"Invalid message for",e,"in",i),s[i][e]=new o(n))}}return s}},2294:(e,t,n)=>{const r=n(375),i=n(8160),o=n(6133),s={};t.Ids=s.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new s.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,n]of e._byId.entries())r(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,n);for(const[t,n]of e._byKey.entries())r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,n)}fork(e,t,n){const o=this._collect(e);o.push({schema:n});const a=o.shift();let l={id:a.id,schema:t(a.schema)};r(i.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of o)l={id:e.id,schema:s.fork(e.schema,l.id,l.schema)};return l.schema}labels(e,t=[]){const n=e[0],r=this._get(n);if(!r)return[...t,...e].join(".");const i=e.slice(1);return t=[...t,r.schema._flags.label||n],i.length?r.schema._ids.labels(i,t):t.join(".")}reach(e,t=[]){const n=e[0],i=this._get(n);r(i,"Schema does not contain path",[...t,...e].join("."));const o=e.slice(1);return o.length?i.schema._ids.reach(o,[...t,n]):i.schema}register(e,{key:t}={}){if(!e||!i.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const n=e._flags.id;if(n){const t=this._byId.get(n);r(!t||t.schema===e,"Cannot add different schemas with the same id:",n),r(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:e,id:n})}t&&(r(!this._byKey.has(t),"Schema already contains key:",t),r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,t=[],n=[]){const i=e[0],o=this._get(i);r(o,"Schema does not contain path",[...t,...e].join(".")),n=[o,...n];const s=e.slice(1);return s.length?o.schema._ids._collect(s,[...t,i],n):n}_get(e){return this._byId.get(e)||this._byKey.get(e)}},s.fork=function(e,n,r){const i=t.schema(e,{each:(e,{key:t})=>{if(n===(e._flags.id||t))return r},ref:!1});return i?i.$_mutateRebuild():e},t.schema=function(e,t){let n;for(const r in e._flags){if("_"===r[0])continue;const i=s.scan(e._flags[r],{source:"flags",name:r},t);void 0!==i&&(n=n||e.clone(),n._flags[r]=i)}for(let r=0;r<e._rules.length;++r){const i=e._rules[r],o=s.scan(i.args,{source:"rules",name:i.name},t);if(void 0!==o){n=n||e.clone();const t=Object.assign({},i);t.args=o,n._rules[r]=t,n._singleRules.get(i.name)===i&&n._singleRules.set(i.name,t)}}for(const r in e.$_terms){if("_"===r[0])continue;const i=s.scan(e.$_terms[r],{source:"terms",name:r},t);void 0!==i&&(n=n||e.clone(),n.$_terms[r]=i)}return n},s.scan=function(e,t,n,r,a){const l=r||[];if(null===e||"object"!=typeof e)return;let c;if(Array.isArray(e)){for(let r=0;r<e.length;++r){const i="terms"===t.source&&"keys"===t.name&&e[r].key,o=s.scan(e[r],t,n,[r,...l],i);void 0!==o&&(c=c||e.slice(),c[r]=o)}return c}if(!1!==n.schema&&i.isSchema(e)||!1!==n.ref&&o.isRef(e)){const r=n.each(e,{...t,path:l,key:a});if(r===e)return;return r}for(const r in e){if("_"===r[0])continue;const i=s.scan(e[r],t,n,[r,...l],a);void 0!==i&&(c=c||Object.assign({},e),c[r]=i)}return c}},6133:(e,t,n)=>{const r=n(375),i=n(8571),o=n(9621),s=n(8160);let a;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e,t={}){r("string"==typeof e,"Invalid reference key:",e),s.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),r(!t.prefix||"object"==typeof t.prefix,"options.prefix must be of type object");const n=Object.assign({},l.defaults,t);delete n.prefix;const i=n.separator,o=l.context(e,i,t.prefix);if(n.type=o.type,e=o.key,"value"===n.type)if(o.root&&(r(!i||e[0]!==i,"Cannot specify relative path with root prefix"),n.ancestor="root",e||(e=null)),i&&i===e)e=null,n.ancestor=0;else if(void 0!==n.ancestor)r(!i||!e||e[0]!==i,"Cannot combine prefix with ancestor option");else{const[t,r]=l.ancestor(e,i);r&&""===(e=e.slice(r))&&(e=null),n.ancestor=t}return n.path=i?null===e?[]:e.split(i):[e],new l.Ref(n)},t.in=function(e,n={}){return t.create(e,{...n,in:!0})},t.isRef=function(e){return!!e&&!!e[s.symbols.ref]},l.Ref=class{constructor(e){r("object"==typeof e,"Invalid reference construction"),s.assertOptions(e,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),r([!1,void 0].includes(e.separator)||"string"==typeof e.separator&&1===e.separator.length,"Invalid separator"),r(!e.adjust||"function"==typeof e.adjust,"options.adjust must be a function"),r(!e.map||Array.isArray(e.map),"options.map must be an array"),r(!e.map||!e.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,e),r("value"===this.type||void 0===this.ancestor,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(e,t,n,i,o={}){return r(!this.in||o.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(n.context,t,o):"local"===this.type?this._resolve(i,t,o):this.ancestor?"root"===this.ancestor?this._resolve(t.ancestors[t.ancestors.length-1],t,o):(r(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,o)):this._resolve(e,t,o)}_resolve(e,t,n){let r;if("value"===this.type&&t.mainstay.shadow&&!1!==n.shadow&&(r=t.mainstay.shadow.get(this.absolute(t))),void 0===r&&(r=o(e,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){const e=this.map.get(r);void 0!==e&&(r=e)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,r),r}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const e={path:this.path};"value"!==this.type&&(e.type=this.type),"."!==this.separator&&(e.separator=this.separator),"value"===this.type&&1!==this.ancestor&&(e.ancestor=this.ancestor),this.map&&(e.map=[...this.map]);for(const t of["adjust","iterables","render"])null!==this[t]&&void 0!==this[t]&&(e[t]=this[t]);return!1!==this.in&&(e.in=!0),{ref:e}}updateDisplay(){const e=null!==this.key?this.key:"";if("value"!==this.type)return void(this.display=`ref:${this.type}:${e}`);if(!this.separator)return void(this.display=`ref:${e}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${e}`);if("root"===this.ancestor)return void(this.display=`ref:root:${e}`);if(1===this.ancestor)return void(this.display=`ref:${e||".."}`);const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}},l.Ref.prototype[s.symbols.ref]=!0,t.build=function(e){return"value"===(e=Object.assign({},l.defaults,e)).type&&void 0===e.ancestor&&(e.ancestor=1),new l.Ref(e)},l.context=function(e,t,n={}){if(e=e.trim(),n){const r=void 0===n.global?"$":n.global;if(r!==t&&e.startsWith(r))return{key:e.slice(r.length),type:"global"};const i=void 0===n.local?"#":n.local;if(i!==t&&e.startsWith(i))return{key:e.slice(i.length),type:"local"};const o=void 0===n.root?"/":n.root;if(o!==t&&e.startsWith(o))return{key:e.slice(o.length),type:"value",root:!0}}return{key:e,type:"value"}},l.ancestor=function(e,t){if(!t)return[1,0];if(e[0]!==t)return[1,0];if(e[1]!==t)return[0,1];let n=2;for(;e[n]===t;)++n;return[n-1,n]},t.toSibling=0,t.toParent=1,t.Manager=class{constructor(){this.refs=[]}register(e,r){if(e)if(r=void 0===r?t.toParent:r,Array.isArray(e))for(const t of e)this.register(t,r);else if(s.isSchema(e))for(const t of e._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-r>=0&&this.refs.push({ancestor:e.ancestor-r,root:e.root}),a=a||n(3328),a.isTemplate(e)&&this.register(e.refs(),r)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=i(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter((e=>!e.ancestor)).map((e=>e.root))}}},3378:(e,t,n)=>{const r=n(5107),i={};i.wrap=r.string().min(1).max(2).allow(!1),t.preferences=r.object({allowUnknown:r.boolean(),abortEarly