1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="ea164ee9-179b-0aa0-60d8-330f9c5c82d0")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,151321,(e,t,r)=>{var s,a;self,s={7629:(e,t,r)=>{"use strict";let s=r(375),a=r(8571),i=r(9474),n=r(1687),o=r(8652),l=r(8160),u=r(3292),c=r(6354),f=r(8901),m=r(9708),h=r(6914),d=r(2294),p=r(6133),g=r(1152),y=r(8863),b=r(2036),v=class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new d.Ids,this._preferences=null,this._refs=new p.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 s("function"==typeof m.describe,"Manifest functionality disabled"),m.describe(this)}allow(...e){return l.verifyFlat(e,"allow"),this._values(e,"_valids")}alter(e){s(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),s(!this._inRuleset(),"Cannot set alterations inside a ruleset");let t=this.clone();for(let r in t.$_terms.alterations=t.$_terms.alterations||[],e){let a=e[r];s("function"==typeof a,"Alteration adjuster for",r,"must be a function"),t.$_terms.alterations.push({target:r,adjuster:a})}return t.$_temp.ruleset=!1,t}artifact(e){return s(void 0!==e,"Artifact cannot be undefined"),s(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return s(!1===e||"string"==typeof e,"Invalid to value"),s(!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 s(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){let t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return s(e,"Missing error"),s(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e,t={}){return s(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&&(s(!t,"Cannot combine options with description"),t=e.description,e=e.method),s("function"==typeof e,"Method must be a function"),s(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)}
2forbidden(){return this.presence("forbidden")}id(e){return e?(s("string"==typeof e,"id must be a non-empty string"),s(/^[^\.]+$/.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 s(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return s(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(...e){for(let t of(s(e.length,"Missing notes"),e))s(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!0){return s("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){s(e,"Missing preferences"),s(void 0===e.context,"Cannot override context"),s(void 0===e.externals,"Cannot override externals"),s(void 0===e.warnings,"Cannot override warnings"),s(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);let t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return s(["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 s(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){let t=this.clone();return t._preferences=l.preferences(t._preferences,{convert:void 0!==e&&!e}),t}strip(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){for(let t of(s(e.length,"Missing tags"),e))s(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return s(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){l.verifyFlat(e,"valid");let t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){let r=this.clone();r.$_terms.whens||(r.$_terms.whens=[]);let a=u.when(r,e,t);if(!["any","link"].includes(r.type))for(let e of a.is?[a]:a.switch)s(!e.then||"any"===e.then.type||e.then.type===r.type,"Cannot combine",r.type,"with",e.then&&e.then.type),s(!e.otherwise||"any"===e.otherwise.type||e.otherwise.type===r.type,"Cannot combine",r.type,"with",e.otherwise&&e.otherwise.type);return r.$_terms.whens.push(a),r.$_mutateRebuild()}cache(e){s(!this._inRuleset(),"Cannot set caching inside a ruleset"),s(!this._cache,"Cannot override schema cache"),s(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");let t=this.clone();return t._cache=e||o.provider.provision(),t.$_temp.ruleset=!1,t}clone(){let e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){s(l.isSchema(e),"Invalid schema object"),s("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),s(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),s(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){let r=e.clone();for(let e of Object.keys(t))"type"!==e&&(r[e]=t[e]);t=r}for(let r of(t._ids.concat(e._ids),t._refs.register(e,p.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=b.merge(t._valids,e._valids,e._invalids),t._invalids=b.merge(t._invalids,e._invalids,e._valids),e._singleRules.keys()))t._singleRules.has(r)&&(t._rules=t._rules.filter(e=>e.keep||e.name!==r),t._singleRules.delete(r));for(let r of e._rules)e._definition.rules[r.method].multi||t._singleRules.set(r.name,r),t._rules.push(r);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.c
2oncat(e._flags.empty);let r=Object.assign({},e._flags);delete r.empty,n(t._flags,r)}else if(e._flags.empty){t._flags.empty=e._flags.empty;let r=Object.assign({},e._flags);delete r.empty,n(t._flags,r)}else n(t._flags,e._flags);for(let r in e.$_terms){let s=e.$_terms[r];s?t.$_terms[r]?t.$_terms[r]=t.$_terms[r].concat(s):t.$_terms[r]=s.slice():t.$_terms[r]||(t.$_terms[r]=s)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return s(!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){s(!this._inRuleset(),"Cannot fork inside a ruleset");let r=this;for(let s of[].concat(e))s=Array.isArray(s)?s:s.split("."),r=r._ids.fork(s,t,r);return r.$_temp.ruleset=!1,r}rule(e){let t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),s(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");let r=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;s(r>=0&&r<this._rules.length,"Cannot apply rules to empty ruleset");let i=this.clone();for(let n=r;n<i._rules.length;++n){let r=i._rules[n],o=a(r);for(let a in e)t.modifiers[a](o,e[a]),s(o.name===r.name,"Cannot change rule name");i._rules[n]=o,i._singleRules.get(o.name)===r&&i._singleRules.set(o.name,o)}return i.$_temp.ruleset=!1,i.$_mutateRebuild()}get ruleset(){s(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");let e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),s(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(let{target:r,adjuster:a}of this.$_terms.alterations)e.includes(r)&&(t=a(t),s(l.isSchema(t),"Alteration adjuster for",r,"failed to return a schema object"));return(t=t.$_modify({each:t=>t.tailor(e),ref:!1})).$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){for(let t in"string"==typeof e&&(e={name:e}),s(e&&"object"==typeof e,"Invalid options"),s(e.name&&"string"==typeof e.name,"Invalid rule name"),e)s("_"!==t[0],"Cannot set private rule properties");let t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;let r=this._definition.rules[t.method],a=t.args;s(r,"Unknown rule",t.method);let i=this.clone();if(a)for(let e in s(1===Object.keys(a).length||Object.keys(a).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name),a){let n=a[e];if(r.argsByName){let o=r.argsByName.get(e);if(o.ref&&l.isResolvable(n))t._resolve.push(e),i.$_mutateRegister(n);else if(o.normalize&&(n=o.normalize(n),a[e]=n),o.assert){let t=l.validateArg(n,e,o);s(!t,t,"or reference")}}void 0!==n?a[e]=n:delete a[e]}return r.multi||(i._ruleRemove(t.name,{clone:!1}),i._singleRules.set(t.name,t)),!1===i.$_temp.ruleset&&(i.$_temp.ruleset=null),r.priority?i._rules.unshift(t):i._rules.push(t),i}$_compile(e,t){return u.schema(this.$_root,e,t)}$_createError(e,t,r,s,a,i={}){let n=!1!==i.flags?this._flags:{},o=i.messages?h.merge(this._definition.messages,i.messages):this._definition.messages;return new c.Report(e,t,r,n,o,s,a)}$_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,r,s){(r=Object.assign({},r)).abortEarly=!0,r._externals=!1,t.snapshot();let a=!y.validate(e,this,t,r,s).errors;return t.restore(),a}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),d.schema(this,e)||this}$_mutateRebuild(){return s(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,{source:t,name:r,path:s,key:a})=>{let i=this._definition[t][r]&&this._definition[t][r].register;!1!==i&&this.$_mutateRegister(e,{family:i,key:a})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:r}={}){this._refs.register(e,t),this._ids.register(e,{key:r})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,r={}){s("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");let a=this._definition.flags[e]||{};if(i(t,a.default)&&(t=void 0),i(t,this._flags[e]))return this;let n=!1!==r.clone?this.clone():this;return void 0!==t?(n._flags[e]=t,n.$_mutateRegister(t)):delete n._flags[e],"_"!==e[0]&&(n.$_temp.ruleset=!1),n}$_parent(e,...t){return this[e][l.symbols.parent].call(this,...t)}
2$_validate(e,t,r){return y.validate(e,this,t,r)}_assign(e){for(let t in 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=a(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={},this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;for(let t in e.$_super={},this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){let e=this.clone();e._reset();let t=e._definition.terms;for(let r in t){let s=t[r];e.$_terms[r]=s.init}return e.$_mutateRebuild()}_default(e,t,r={}){return l.assertOptions(r,"literal"),s(void 0!==t,"Missing",e,"value"),s("function"==typeof t||!r.literal,"Only function value supports literal option"),"function"==typeof t&&r.literal&&(t={[l.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,r){if(!this.$_terms.whens)return{schema:this};let s=[],a=[];for(let i=0;i<this.$_terms.whens.length;++i){let n=this.$_terms.whens[i];if(n.concat){s.push(n.concat),a.push(`${i}.concat`);continue}let o=n.ref?n.ref.resolve(e,t,r):e,l=n.is?[n]:n.switch,u=a.length;for(let u=0;u<l.length;++u){let{is:c,then:f,otherwise:m}=l[u],h=`${i}${n.switch?"."+u:""}`;if(c.$_match(o,t.nest(c,`${h}.is`),r)){if(f){let i=t.localize([...t.path,`${h}.then`],t.ancestors,t.schemas),{schema:n,id:o}=f._generate(e,i,r);s.push(n),a.push(`${h}.then${o?`(${o})`:""}`);break}}else if(m){let i=t.localize([...t.path,`${h}.otherwise`],t.ancestors,t.schemas),{schema:n,id:o}=m._generate(e,i,r);s.push(n),a.push(`${h}.otherwise${o?`(${o})`:""}`);break}}if(n.break&&a.length>u)break}let i=a.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",i),!i)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[i])return{schema:this.$_temp.whens[i],id:i};let n=this;for(let a of(this._definition.generate&&(n=this._definition.generate(this,e,t,r)),s))n=n.concat(a);return this.$_root._tracer&&this.$_root._tracer._combine(n,[this,...s]),this.$_temp.whens[i]=n,{schema:n,id:i}}_inner(e,t,r={}){s(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);let a=this.clone();return a.$_terms[e]&&!r.override||(a.$_terms[e]=[]),r.single?a.$_terms[e].push(t):a.$_terms[e].push(...t),a.$_temp.ruleset=!1,a}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){if(!this._singleRules.has(e))return this;let r=!1!==t.clone?this.clone():this;r._singleRules.delete(e);let s=[];for(let t=0;t<r._rules.length;++t){let a=r._rules[t];a.name!==e||a.keep?s.push(a):r._inRuleset()&&t<r.$_temp.ruleset&&--r.$_temp.ruleset}return r._rules=s,r}_values(e,t){l.verifyFlat(e,t.slice(1,-1));let r=this.clone(),a=e[0]===l.symbols.override;if(a&&(e=e.slice(1)),!r[t]&&e.length?r[t]=new b:a&&(r[t]=e.length?new b:null,r.$_mutateRebuild()),!r[t])return r;for(let i of(a&&r[t].override(),e)){s(void 0!==i,"Cannot call allow/valid/invalid with undefined"),s(i!==l.symbols.override,"Override must be the first value");let e="_invalids"===t?"_valids":"_invalids";r[e]&&(r[e].remove(i),r[e].length||(s("_valids"===t||!r._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),r[e]=null)),r[t].add(i,r._refs)}return r}};v.prototype[l.symbols.any]={version:l.version,compile:u.compile,root:"$_root"},v.prototype.isImmutable=!0,v.prototype.deny=v.prototype.invalid,v.prototype.disallow=v.prototype.invalid,v.prototype.equal=v.prototype.valid,v.prototype.exist=v.prototype.required,v.prototype.not=v.prototype.invalid,v.prototype.options=v.prototype.prefs,v.prototype.preferences=v.prototype.prefs,e.exports=new v},8652:(e,t,r)=>{"use strict";let s=r(375),a=r(8571),i=r(8160),n={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new n.Cache(e)},n.Cache=class{constructor(e={}){i.assertOptions(e,["max"]),s(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||n.max,this._map=new Map,this._list=new n.List}get length(){return this._map.size}set(e,t){if(null!==e&&!n.supported.has(typeof e))return;let r=this._map.get(e);r?(r.value=t,this._list.first(r)):(r=this._list.unshift({key:e,value:t}),this._map.set(e,r),this._compact())}get(e){let t=this._map.get(e);if(t)return this._list.first(t),a(t.value)}_compact(){if(this._map.size>this._max){let e=this._list.pop();this._map.delete(e.key)}}},n.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){let{next:t,prev:r}=e;return t.prev=r,r&&(r.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},8160:(e,t,r)=>{"use strict";let s,a,i=r(375),n=r(7916),o=r(5934),l=/^(?:[-+]\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)?)?)?)?$/;
2t.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,r="Options"){i(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");let s=Object.keys(e).filter(e=>!t.includes(e));i(0===s.length,`${r} contain unknown keys: ${s}`)},t.checkPreferences=function(e){let t=(a=a||r(3378)).preferences.validate(e);if(t.error)throw new n([t.error.details[0].message])},t.compare=function(e,t,r){switch(r){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.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,r={}){let s=e&&e[t.symbols.any];return!!s&&(i(r.legacy||s.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,a){s=s||r(6914);let i=Object.assign({},e=e||{},a=a||{});return a.errors&&e.errors&&(i.errors=Object.assign({},e.errors,a.errors),i.errors.wrap=Object.assign({},e.errors.wrap,a.errors.wrap)),a.messages&&(i.messages=s.compile(a.messages,e.messages)),delete i[t.symbols.prefs],i},t.tryWithPath=function(e,t,r={}){try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,r.append&&(e.message=`${e.message} (${e.path})`),e}},t.validateArg=function(e,r,{assert:s,message:a}){if(t.isSchema(s)){let t=s.validate(e);if(!t.error)return;return t.error.message}if(!s(e))return r?`${r} ${a}`:a},t.verifyFlat=function(e,t){for(let r of e)i(!Array.isArray(r),"Method no longer accepts array arguments:",t)}},3292:(e,t,r)=>{"use strict";let s=r(375),a=r(8160),i=r(6133),n={};t.schema=function(e,t,r={}){a.assertOptions(r,["appendPath","override"]);try{return n.schema(e,t,r)}catch(e){throw r.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},n.schema=function(e,t,r){s(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(s(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));let i=(t,...s)=>!1!==r.override?t.valid(e.override,...s):t.valid(...s);if(n.simple(t))return i(e,t);if("function"==typeof t)return e.custom(t);if(s("object"==typeof t,"Invalid schema content:",typeof t),a.isResolvable(t))return i(e,t);if(a.isSchema(t))return t;if(Array.isArray(t)){for(let r of t)if(!n.simple(r))return e.alternatives().try(...t);return i(e,...t)}return t instanceof RegExp?e.string().regex(t):t instanceof Date?i(e.date(),t):(s(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(t))},t.ref=function(e,t){return i.isRef(e)?e:i.create(e,t)},t.compile=function(e,r,i={}){a.assertOptions(i,["legacy"]);let o=r&&r[a.symbols.any];if(o)return s(i.legacy||o.version===a.version,"Cannot mix different versions of joi schemas:",o.version,a.version),r;if("object"!=typeof r||!i.legacy)return t.schema(e,r,{appendPath:!0});let l=n.walk(r);return l?l.compile(l.root,r):t.schema(e,r,{appendPath:!0})},n.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(let t of e){let e=n.walk(t);if(e)return e}return null}let t=e[a.symbols.any];if(t)return{root:e[t.root],compile:t.compile};for(let t in s(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e){let r=n.walk(e[t]);if(r)return r}return null},n.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,r,o){if(void 0===o&&(s(r&&"object"==typeof r,"Missing options"),o=r,r=i.create(".")),Array.isArray(o)&&(o={switch:o}),a.assertOptions(o,["is","not","then","otherwise","switch","break"]),a.isSchema(r))return s(void 0===o.is,'"is" can not be used with a schema condition'),s(void 0===o.not,'"not" can not be used with a schema condition'),s(void 0===o.switch,'"switch" can not be used with a schema condition'),n.c
2ondition(e,{is:r,then:o.then,otherwise:o.otherwise,break:o.break});if(s(i.isRef(r)||"string"==typeof r,"Invalid condition:",r),s(void 0===o.not||void 0===o.is,'Cannot combine "is" with "not"'),void 0===o.switch){let l=o;void 0!==o.not&&(l={is:o.not,then:o.otherwise,otherwise:o.then,break:o.break});let u=void 0!==l.is?e.$_compile(l.is):e.$_root.invalid(null,!1,0,"").required();return s(void 0!==l.then||void 0!==l.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),s(void 0===l.break||void 0===l.then||void 0===l.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===o.is||i.isRef(o.is)||a.isSchema(o.is)||(u=u.required()),n.condition(e,{ref:t.ref(r),is:u,then:l.then,otherwise:l.otherwise,break:l.break})}s(Array.isArray(o.switch),'"switch" must be an array'),s(void 0===o.is,'Cannot combine "switch" with "is"'),s(void 0===o.not,'Cannot combine "switch" with "not"'),s(void 0===o.then,'Cannot combine "switch" with "then"');let l={ref:t.ref(r),switch:[],break:o.break};for(let t=0;t<o.switch.length;++t){let r=o.switch[t],n=t===o.switch.length-1;a.assertOptions(r,n?["is","then","otherwise"]:["is","then"]),s(void 0!==r.is,'Switch statement missing "is"'),s(void 0!==r.then,'Switch statement missing "then"');let u={is:e.$_compile(r.is),then:e.$_compile(r.then)};if(i.isRef(r.is)||a.isSchema(r.is)||(u.is=u.is.required()),n){s(void 0===o.otherwise||void 0===r.otherwise,'Cannot specify "otherwise" inside and outside a "switch"');let t=void 0!==o.otherwise?o.otherwise:r.otherwise;void 0!==t&&(s(void 0===l.break,"Cannot specify both otherwise and break"),u.otherwise=e.$_compile(t))}l.switch.push(u)}return l},n.condition=function(e,t){for(let r of["then","otherwise"])void 0===t[r]?delete t[r]:t[r]=e.$_compile(t[r]);return t}},6354:(e,t,r)=>{"use strict";let s=r(5688),a=r(8160),i=r(3328);t.Report=class{constructor(e,r,s,a,i,n,o){if(this.code=e,this.flags=a,this.messages=i,this.path=n.path,this.prefs=o,this.state=n,this.value=r,this.message=null,this.template=null,this.local=s||{},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){let e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;let e=this.code;if(!this.prefs.errors.render)return this.code;let 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,r){return t.template(this.value,e,r||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(let r of e)"object"!=typeof r&&("string"==typeof r?(t&&(t+="."),t+=r):t+=`[${r}]`);return t},t.template=function(e,t,r,s,n){if(!t)return;if(i.isTemplate(t))return"root"!==r?t:null;let o=n.errors.language;if(a.isResolvable(o)&&(o=o.resolve(e,s,n)),o&&t[o]){if(void 0!==t[o][r])return t[o][r];if(void 0!==t[o]["*"])return t[o]["*"]}return t[r]?t[r]:t["*"]},t.label=function(e,r,s,a){if(!s.errors.label)return"";if(e.label)return e.label;let i=r.path;return"key"===s.errors.label&&r.path.length>1&&(i=r.path.slice(-1)),t.path(i)||t.template(null,s.messages,"root",r,s)||a&&t.template(null,a,"root",r,s)||"value"},t.process=function(e,r,s){if(!e)return null;let{override:a,message:i,details:n}=t.details(e);if(a)return a;if(s.errors.stack)return new t.ValidationError(i,n,r);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let l=new t.ValidationError(i,n,r);return Error.stackTraceLimit=o,l},t.details=function(e,t={}){let r=[],s=[];for(let a of e){if(a instanceof Error){if(!1!==t.override)return{override:a};let e=a.toString();r.push(e),s.push({message:e,type:"override",context:{error:a}});continue}let e=a.toString();r.push(e),s.push({message:e,path:a.path.filter(e=>"object"!=typeof e),type:a.code,context:a.local})}return r.length>1&&(r=[...new Set(r)]),{message:r.join(". "),details:s}}
2,t.ValidationError=class extends Error{constructor(e,t,r){super(e),this._original=r,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=s.error},8901:(e,t,r)=>{"use strict";let s=r(375),a=r(8571),i=r(8160),n=r(6914),o={};t.type=function(e,t){let r=Object.getPrototypeOf(e),l=a(r),u=e._assign(Object.create(l)),c=Object.assign({},t);delete c.base,l._definition=c;let f=r._definition||{};c.messages=n.merge(f.messages,c.messages),c.properties=Object.assign({},f.properties,c.properties),u.type=c.type,c.flags=Object.assign({},f.flags,c.flags);let m=Object.assign({},f.terms);if(c.terms)for(let e in c.terms){let t=c.terms[e];s(void 0===u.$_terms[e],"Invalid term override for",c.type,e),u.$_terms[e]=t.init,m[e]=t}c.terms=m,c.args||(c.args=f.args),c.prepare=o.prepare(c.prepare,f.prepare),c.coerce&&("function"==typeof c.coerce&&(c.coerce={method:c.coerce}),c.coerce.from&&!Array.isArray(c.coerce.from)&&(c.coerce={method:c.coerce.method,from:[].concat(c.coerce.from)})),c.coerce=o.coerce(c.coerce,f.coerce),c.validate=o.validate(c.validate,f.validate);let h=Object.assign({},f.rules);if(c.rules)for(let e in c.rules){let t=c.rules[e];s("object"==typeof t,"Invalid rule definition for",c.type,e);let r=t.method;if(void 0===r&&(r=function(){return this.$_addRule(e)}),r&&(s(!l[e],"Rule conflict in",c.type,e),l[e]=r),s(!h[e],"Rule conflict in",c.type,e),h[e]=t,t.alias)for(let e of[].concat(t.alias))l[e]=t.method;t.args&&(t.argsByName=new Map,t.args=t.args.map(e=>("string"==typeof e&&(e={name:e}),s(!t.argsByName.has(e.name),"Duplicated argument name",e.name),i.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e)))}c.rules=h;let d=Object.assign({},f.modifiers);if(c.modifiers)for(let e in c.modifiers){s(!l[e],"Rule conflict in",c.type,e);let t=c.modifiers[e];s("function"==typeof t,"Invalid modifier definition for",c.type,e);let r=function(t){return this.rule({[e]:t})};l[e]=r,d[e]=t}if(c.modifiers=d,c.overrides){for(let e in l._super=r,u.$_super={},c.overrides)s(r[e],"Cannot override missing",e),c.overrides[e][i.symbols.parent]=r[e],u.$_super[e]=r[e].bind(u);Object.assign(l,c.overrides)}c.cast=Object.assign({},f.cast,c.cast);let p=Object.assign({},f.manifest,c.manifest);return p.build=o.build(c.manifest&&c.manifest.build,f.manifest&&f.manifest.build),c.manifest=p,c.rebuild=o.rebuild(c.rebuild,f.rebuild),u},o.build=function(e,t){return e&&t?function(r,s){return t(e(r,s),s)}:e||t},o.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(r,s){let a;if((!t.from||t.from.includes(typeof r))&&(a=t.method(r,s))){if(a.errors||void 0===a.value)return a;r=a.value}if(!e.from||e.from.includes(typeof r)){let t=e.method(r,s);if(t)return t}return a}}:e||t},o.prepare=function(e,t){return e&&t?function(r,s){let a=e(r,s);if(a){if(a.errors||void 0===a.value)return a;r=a.value}return t(r,s)||a}:e||t},o.rebuild=function(e,t){return e&&t?function(r){t(r),e(r)}:e||t},o.validate=function(e,t){return e&&t?function(r,s){let a=t(r,s);if(a){if(a.errors&&(!Array.isArray(a.errors)||a.errors.length))return a;r=a.value}return e(r,s)||a}:e||t}},5107:(e,t,r)=>{"use strict";let s,a=r(375),i=r(8571),n=r(8652),o=r(8160),l=r(3292),u=r(6354),c=r(8901),f=r(9708),m=r(6133),h=r(3328),d=r(1152),p={types:{alternatives:r(4946),any:r(8068),array:r(546),boolean:r(4937),date:r(7500),function:r(390),link:r(8785),number:r(3832),object:r(8966),string:r(7417),symbol:r(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){let e={_types:new Set(Object.keys(p.types))};for(let t of e._types)e[t]=function(...e){return a(!e.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments"),p.generate(this,p.types[t],e)};for(let 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)};for(let t in Object.assign(e,p.methods),p.aliases){let r=p.aliases[t];e[t]=e[r]}return e.x=e.expression,d.setup&&d.setup(e),e}};
2p.methods={ValidationError:u.ValidationError,version:o.version,cache:n.provider,assert(e,t,...r){p.assert(e,t,!0,r)},attempt:(e,t,...r)=>p.assert(e,t,!1,r),build(e){return a("function"==typeof f.build,"Manifest functionality disabled"),f.build(this,e)},checkPreferences(e){o.checkPreferences(e)},compile(e,t){return l.compile(this,e,t)},defaults(e){a("function"==typeof e,"modifier must be a function");let t=Object.assign({},this);for(let r of t._types){let s=e(t[r]());a(o.isSchema(s),"modifier must return a valid schema object"),t[r]=function(...e){return p.generate(this,s,e)}}return t},expression:(...e)=>new h(...e),extend(...e){o.verifyFlat(e,"extend"),s=s||r(3378),a(e.length,"You need to provide at least one extension"),this.assert(e,s.extensions);let t=Object.assign({},this);for(let r of(t._types=new Set(t._types),e))for(let e of("function"==typeof r&&(r=r(t)),this.assert(r,s.extension),p.expandExtension(r,t))){a(void 0===t[e.type]||t._types.has(e.type),"Cannot override name",e.type);let r=e.base||this.any(),s=c.type(r,e);t._types.add(e.type),t[e.type]=function(...e){return p.generate(this,s,e)}}return t},isError:u.ValidationError.isError,isExpression:h.isTemplate,isRef:m.isRef,isSchema:o.isSchema,in:(...e)=>m.in(...e),override:o.symbols.override,ref:(...e)=>m.create(...e),types(){let e={};for(let t of this._types)e[t]=this[t]();for(let t in p.aliases)e[t]=this[t]();return e}},p.assert=function(e,t,r,s){let a=s[0]instanceof Error||"string"==typeof s[0]?s[0]:null,n=null!==a?s[1]:s[0],l=t.validate(e,o.preferences({errors:{stack:!0}},n||{})),c=l.error;if(!c)return l.value;if(a instanceof Error)throw a;let f=r&&"function"==typeof c.annotate?c.annotate():c.message;throw c instanceof u.ValidationError==0&&(c=i(c)),c.message=a?`${a} ${f}`:f,c},p.generate=function(e,t,r){return a(e,"Must be invoked on a Joi instance."),t.$_root=e,t._definition.args&&r.length?t._definition.args(t,...r):t},p.expandExtension=function(e,t){if("string"==typeof e.type)return[e];let r=[];for(let s of t._types)if(e.type.test(s)){let a=Object.assign({},e);a.type=s,a.base=t[s](),r.push(a)}return r},e.exports=p.root()},6914:(e,t,r)=>{"use strict";let s=r(375),a=r(8571),i=r(3328);t.compile=function(e,t){if("string"==typeof e)return s(!t,"Cannot set single message string"),new i(e);if(i.isTemplate(e))return s(!t,"Cannot set single message template"),e;for(let r in s("object"==typeof e&&!Array.isArray(e),"Invalid message options"),t=t?a(t):{},e){let a=e[r];if("root"===r||i.isTemplate(a)){t[r]=a;continue}if("string"==typeof a){t[r]=new i(a);continue}for(r in s("object"==typeof a&&!Array.isArray(a),"Invalid message for",r),t[r]=t[r]||{},a){let e=a[r];"root"===r||i.isTemplate(e)?t[r][r]=e:(s("string"==typeof e,"Invalid message for",r,"in",r),t[r][r]=new i(e))}}return t},t.decompile=function(e){let t={};for(let r in e){let s=e[r];if("root"===r){t.root=s;continue}if(i.isTemplate(s)){t[r]=s.describe({compact:!0});continue}for(r in t[r]={},s){let e=s[r];"root"!==r?t[r][r]=e.describe({compact:!0}):t[r].root=e}}return t},t.merge=function(e,r){if(!e)return t.compile(r);if(!r)return e;if("string"==typeof r)return new i(r);if(i.isTemplate(r))return r;let n=a(e);for(let e in r){let t=r[e];if("root"===e||i.isTemplate(t)){n[e]=t;continue}if("string"==typeof t){n[e]=new i(t);continue}for(e in s("object"==typeof t&&!Array.isArray(t),"Invalid message for",e),n[e]=n[e]||{},t){let r=t[e];"root"===e||i.isTemplate(r)?n[e][e]=r:(s("string"==typeof r,"Invalid message for",e,"in",e),n[e][e]=new i(r))}}return n}},2294:(e,t,r)=>{"use strict";let s=r(375),a=r(8160),i=r(6133),n={};t.Ids=n.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let e=new n.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){for(let[t,r]of(e._schemaChain&&(this._schemaChain=!0),e._byId.entries()))s(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,r);for(let[t,r]of e._byKey.entries())s(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,r)}fork(e,t,r){let i=this._collect(e);i.push({schema:r});let o=i.shift(),l={id:o.id,schema:t(o.schema)};for(let e of(s(a.isSchema(l.schema),"adjuster function failed to return a joi schema type"),i))l={id:e.id,schema:n.fork(e.schema,l.id,l.schema)};return l.schema}labels(e,t=[]){let r=e[0],s=this._get(r);if(!s)return[...t,...e].join(".");let a=e.slice(1);return t=[...t,s.schema._flags.label||r],a.length?s.schema._ids.labels(a,t):t.join(".")}reach(e,t=[]){let r=e[0],a=this._get(r);s(a,"Schema does not contain path",[...t,...e].join("."));let i=e.slice(1);return i.length?a.schema._ids.reach(i,[...t,r]):a.schema}register(e,{key:t}={}){if(!e||!a.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);let r=e._flags.id;if(r){let t=this._byId.get(r);s(!t||t.schema===e,"Cannot add different schemas with the same id:",r),s(!this._byKey.has(r),"Schema id conflicts with existing key:",r),this._byId.set(r,{schema:e,id:r})}t&&(s(!this._byKey.has(t),"Schema already contains key:",t),s(!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=[],r=[]){let a=e[0],i=this._get(a);s(i,"Schema does not contain path",[...t,...e].join(".")),r=[i,...r];let n=e.slice(1);return n.length?i.schema._ids._collect(n,[...t,a],r):r}_get(e){return this._byId.get(e)||this._byKey.get(e)}},n.fork=function(e,r,s){let a=t.schema(e,{each:(e,{key:t})=>{if(r===(e._flags.id||t))return s},ref:!1});return a?a.$_mutateRebuild():e},t.schema=function(e,t){let r;for(let s in e._flags){if("_"===s[0])continue;let a=n.scan(e._flags[s],{source:"flags",name:s},t);void 0!==a&&((r=r||e.clone())._flags[s]=a)}for(let s=0;s<e._rules.length;++s){let a=e._rules[s],i=n.scan(a.args,{source:"rules",name:a.name},t);if(void 0!==i){r=r||e.clone();let t=Object.assign({},a);t.args=i,r._rules[s]=t,r._singleRules.get(a.name)===a&&r._singleRules.set(a.name,t)}}
2for(let s in e.$_terms){if("_"===s[0])continue;let a=n.scan(e.$_terms[s],{source:"terms",name:s},t);void 0!==a&&((r=r||e.clone()).$_terms[s]=a)}return r},n.scan=function(e,t,r,s,o){let l,u=s||[];if(null!==e&&"object"==typeof e){if(Array.isArray(e)){for(let s=0;s<e.length;++s){let a="terms"===t.source&&"keys"===t.name&&e[s].key,i=n.scan(e[s],t,r,[s,...u],a);void 0!==i&&((l=l||e.slice())[s]=i)}return l}if(!1!==r.schema&&a.isSchema(e)||!1!==r.ref&&i.isRef(e)){let s=r.each(e,{...t,path:u,key:o});if(s===e)return;return s}for(let s in e){if("_"===s[0])continue;let a=n.scan(e[s],t,r,[s,...u],o);void 0!==a&&((l=l||Object.assign({},e))[s]=a)}return l}}},6133:(e,t,r)=>{"use strict";let s,a=r(375),i=r(8571),n=r(9621),o=r(8160),l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e,t={}){a("string"==typeof e,"Invalid reference key:",e),o.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!t.prefix||"object"==typeof t.prefix,"options.prefix must be of type object");let r=Object.assign({},l.defaults,t);delete r.prefix;let s=r.separator,i=l.context(e,s,t.prefix);if(r.type=i.type,e=i.key,"value"===r.type)if(i.root&&(a(!s||e[0]!==s,"Cannot specify relative path with root prefix"),r.ancestor="root",e||(e=null)),s&&s===e)e=null,r.ancestor=0;else if(void 0!==r.ancestor)a(!s||!e||e[0]!==s,"Cannot combine prefix with ancestor option");else{let[t,a]=l.ancestor(e,s);a&&""===(e=e.slice(a))&&(e=null),r.ancestor=t}return r.path=s?null===e?[]:e.split(s):[e],new l.Ref(r)},t.in=function(e,r={}){return t.create(e,{...r,in:!0})},t.isRef=function(e){return!!e&&!!e[o.symbols.ref]},l.Ref=class{constructor(e){a("object"==typeof e,"Invalid reference construction"),o.assertOptions(e,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(e.separator)||"string"==typeof e.separator&&1===e.separator.length,"Invalid separator"),a(!e.adjust||"function"==typeof e.adjust,"options.adjust must be a function"),a(!e.map||Array.isArray(e.map),"options.map must be an array"),a(!e.map||!e.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,e),a("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,r,s,i={}){return a(!this.in||i.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(r.context,t,i):"local"===this.type?this._resolve(s,t,i):this.ancestor?"root"===this.ancestor?this._resolve(t.ancestors[t.ancestors.length-1],t,i):(a(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,i)):this._resolve(e,t,i)}_resolve(e,t,r){let s;if("value"===this.type&&t.mainstay.shadow&&!1!==r.shadow&&(s=t.mainstay.shadow.get(this.absolute(t))),void 0===s&&(s=n(e,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(s=this.adjust(s)),this.map){let e=this.map.get(s);void 0!==e&&(s=e)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,s),s}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){let e={path:this.path};for(let t of("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]),["adjust","iterables","render"]))null!==this[t]&&void 0!==this[t]&&(e[t]=this[t]);return!1!==this.in&&(e.in=!0),{ref:e}}updateDisplay(){let 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||".."}`);let t=Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}},l.Ref.prototype[o.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,r={}){if(e=e.trim(),r){let s=void 0===r.global?"$":r.global;if(s!==t&&e.startsWith(s))return{key:e.slice(s.length),type:"global"};let a=void 0===r.local?"#":r.local;if(a!==t&&e.startsWith(a))return{key:e.slice(a.length),type:"local"};let i=void 0===r.root?"/":r.root;if(i!==t&&e.startsWith(i))return{key:e.slice(i.length),type:"value",root:!0}}return{key:e,type:"value"}},l.ancestor=function(e,t){if(!t||e[0]!==t)return[1,0];if(e[1]!==t)return[0,1];let r=2;for(;e[r]===t;)++r;return[r-1,r]},t.toSibling=0,t.toParent=1,t.Manager=class{constructor(){this.refs=[]}register(e,a){if(e)if(a=void 0===a?t.toParent:a,Array.isArray(e))for(let t of e)this.register(t,a);else if(o.isSchema(e))for(let t of e._refs.refs)t.ancestor-a>=0&&this.refs.push({ancestor:t.ancestor-a,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-a>=0&&this.refs.push({ancestor:e.ancestor-a,root:e.root}),(s=s||r(3328)).isTemplate(e)&&this.register(e.refs(),a)}get length(){return this.refs.length}clone(){let 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,r)=>{"use strict";let s=r(5107),a={};a.wrap=s.string().min(1).max(2).allow(!1),t.preferences=s.object({allowUnknown:s.boolean(),abortEarly:s.boolean(),artifacts:s.boolean(),cache:s.boolean(),context:s.object(),convert:s.boolean(),dateFormat:s.valid("date","iso","string","time","utc"),debug:s.boolean(),errors:{escapeHtml:s.boolean(),label:s.valid("path","key",!1),language:[s.string(),s.object().ref()],render:s.boolean(),stack:s.boolean(),wrap:{label:a.wrap,array:a.wrap,string:a.wrap}},externals:s.boolean(),messages:s.object(),noDefaults:s.boolean(),nonEnumerables:s.boolean(),presence:s.valid("required","optional","forbidden"),skipFunctions:s.boolean(),stripUnknown:s.object({arrays:s.boolean(),objects:s.boolean()}).or("arrays","objects").allow(!0,!1),warnings:s.boolean()}).strict(),a.nameRx=/^[a-zA-Z0-9]\w*$/,a.rule=s.object({alias:s.array().items(s.string().pattern(a.nameRx)).single(),args:s.array().items(s.string(),s.object({name:s.string().pattern(a.nameRx).required(),ref:s.boolean(),assert:s.alternatives([s.function(),s.object().schema()]).conditional("ref",{is:!0,then:s.required()}),normalize:s.function(),message:s.string().when("assert",{is:s.function(),then:s.required()})})),convert:s.boolean(),manifest:s.boolean(),method:s.function().allow(!1),multi:s.boolean(),validate:s.function()}),t.extension=s.object({type:s.alternatives([s.string(),s.object().regex()]).required(),args:s.function(),cast:s.object().pattern(a.nameRx,s.object({from:s.function().maxArity(1).required(),to:s.function().minArity(1).maxArity(2).required()})),base:s.object().schema().when("type",{is:s.object().regex(),then:s.forbidden()}),coerce:[s.function().maxArity(3),s.object({method:s.function().maxArity(3).required(),from:s.array().items(s.string()).single()})],flags:s.object().pattern(a.nameRx,s.object({setter:s.string(),default:s.any()})),manifest:{build:s.function().arity(2)},messages:[s.object(),s.string()],modifiers:s.object().pattern(a.nameRx,s.function().minArity(1).maxArity(2)),overrides:s.object().pattern(a.nameRx,s.function()),prepare:s.function().maxArity(3),rebuild:s.function().arity(1),rules:s.object().pattern(a.nameRx,a.rule),terms:s.object().pattern(a.nameRx,s.object({init:s.array().allow(null).required(),manifest:s.object().pattern(/.+/,[s.valid("schema","single"),s.object({mapped:s.object({from:s.string().required(),to:s.string().required()}).required()})])}
vendor: 4,223 bytes, line 2
2)),validate:s.function().maxArity(3)}).strict(),t.extensions=s.array().items(s.object(),s.function().arity(1)).strict(),a.desc={buffer:s.object({buffer:s.string()}),func:s.object({function:s.function().required(),options:{literal:!0}}),override:s.object({override:!0}),ref:s.object({ref:s.object({type:s.valid("value","global","local"),path:s.array().required(),separator:s.string().length(1).allow(!1),ancestor:s.number().min(0).integer().allow("root"),map:s.array().items(s.array().length(2)).min(1),adjust:s.function(),iterables:s.boolean(),in:s.boolean(),render:s.boolean()}).required()}),regex:s.object({regex:s.string().min(3)}),special:s.object({special:s.valid("deep").required()}),template:s.object({template:s.string().required(),options:s.object()}),value:s.object({value:s.alternatives([s.object(),s.array()]).required()})},a.desc.entity=s.alternatives([s.array().items(s.link("...")),s.boolean(),s.function(),s.number(),s.string(),a.desc.buffer,a.desc.func,a.desc.ref,a.desc.regex,a.desc.special,a.desc.template,a.desc.value,s.link("/")]),a.desc.values=s.array().items(null,s.boolean(),s.function(),s.number().allow(1/0,-1/0),s.string().allow(""),s.symbol(),a.desc.buffer,a.desc.func,a.desc.override,a.desc.ref,a.desc.regex,a.desc.template,a.desc.value),a.desc.messages=s.object().pattern(/.+/,[s.string(),a.desc.template,s.object().pattern(/.+/,[s.string(),a.desc.template])]),t.description=s.object({type:s.string().required(),flags:s.object({cast:s.string(),default:s.any(),description:s.string(),empty:s.link("/"),failover:a.desc.entity,id:s.string(),label:s.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:s.boolean(),unit:s.string()}).unknown(),preferences:{allowUnknown:s.boolean(),abortEarly:s.boolean(),artifacts:s.boolean(),cache:s.boolean(),convert:s.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:s.boolean(),label:["path","key"],language:[s.string(),a.desc.ref],wrap:{label:a.wrap,array:a.wrap}},externals:s.boolean(),messages:a.desc.messages,noDefaults:s.boolean(),nonEnumerables:s.boolean(),presence:["required","optional","forbidden"],skipFunctions:s.boolean(),stripUnknown:s.object({arrays:s.boolean(),objects:s.boolean()}).or("arrays","objects").allow(!0,!1),warnings:s.boolean()},allow:a.desc.values,invalid:a.desc.values,rules:s.array().min(1).items({name:s.string().required(),args:s.object().min(1),keep:s.boolean(),message:[s.string(),a.desc.messages],warn:s.boolean()}),keys:s.object().pattern(/.*/,s.link("/")),link:a.desc.ref}).pattern(/^[a-z]\w*$/,s.any())},493:(e,t,r)=>{"use strict";let s=r(8571),a=r(9621),i=r(8160),n={value:Symbol("value")};e.exports=n.State=class{constructor(e,t,r){this.path=e,this.ancestors=t,this.mainstay=r.mainstay,this.schemas=r.schemas,this.debug=null}localize(e,t=null,r=null){let s=new n.State(e,t,this);return r&&s.schemas&&(s.schemas=[n.schemas(r),...s.schemas]),s}nest(e,t){let r=new n.State(this.path,this.ancestors,this);return r.schemas=r.schemas&&[n.schemas(e),...r.schemas],r.debug=t,r}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new n.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=s(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},n.schemas=function(e){return i.isSchema(e)?{schema:e}:e},n.Shadow=class{constructor(){this._values=null}set(e,t,r){if(!e.length||"strip"===r&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let s=this._values;for(let t=0;t<e.length;++t){let r=e[t],a=s.get(r);a||(a=new Map,s.set(r,a)),s=a}s[n.value]=t}get(e){let t=this.node(e);if(t)return t[n.value]}node(e){if(this._values)return a(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;let r=e.slice(0,-1),s=e[e.length-1],i=a(this._values,r,{iterables:!0});t?i.set(s,t):i&&i.delete(s)}}},3328:(e,t,r)=>{"use strict";let s=r(375),a=r(8571),i=r(5277),n=r(1447),o=r(8160),l=r(6354),u=r(6133),c={symbol
2:Symbol("template"),opens:Array(1e3).join("\0"),closes:Array(1e3).join("\x01"),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};e.exports=c.Template=class{constructor(e,t){if(s("string"==typeof e,"Template source must be a string"),s(!e.includes("\0")&&!e.includes("\x01"),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,t){const{functions:e,...r}=t;this._settings=Object.keys(r).length?a(r):void 0,this._functions=e,this._functions&&(s(Object.keys(this._functions).every(e=>"string"==typeof e),"Functions keys must be strings"),s(Object.values(this._functions).every(e=>"function"==typeof e),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;let e=c.encode(this.source),t=c.split(e),r=!1,s=[],a=t.shift();for(let e of(a&&s.push(a),t)){let t="{"!==e[0],a=t?"}":"}}",i=e.indexOf(a);if(-1===i||"{"===e[1]){s.push(`{${c.decode(e)}`);continue}let n=e.slice(+!t,i),o=":"===n[0];o&&(n=n.slice(1));let l=this._ref(c.decode(n),{raw:t,wrapped:o});s.push(l),"string"!=typeof l&&(r=!0);let u=e.slice(i+a.length);u&&s.push(c.decode(u))}r?this._template=s:this.rendered=s.join("")}static date(e,t){return c.dateFormat[t.dateFormat].call(e)}describe(e={}){if(!this._settings&&e.compact)return this.source;let t={template:this.source};return this._settings&&(t.options=this._settings),this._functions&&(t.functions=this._functions),t}static build(e){return new c.Template(e.template,e.options||e.functions?{...e.options,functions:e.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[o.symbols.template]}refs(){if(!this._template)return;let e=[];for(let t of this._template)"string"!=typeof t&&e.push(...t.refs);return e}resolve(e,t,r,s){return this._template&&1===this._template.length?this._part(this._template[0],e,t,r,s,{}):this.render(e,t,r,s)}_part(e,...t){return e.ref?e.ref.resolve(...t):e.formula.evaluate(t)}render(e,t,r,s,a={}){if(!this.isDynamic())return this.rendered;let n=[];for(let o of this._template)if("string"==typeof o)n.push(o);else{let l=this._part(o,e,t,r,s,a),u=c.stringify(l,e,t,r,s,a);if(void 0!==u){let e=o.raw||!1===(a.errors&&a.errors.escapeHtml)?u:i(u);n.push(c.wrap(e,o.wrapped&&r.errors.wrap.label))}}return n.join("")}_ref(e,{raw:t,wrapped:r}){let s=[],a=e=>{let t=u.create(e,this._settings);return s.push(t),e=>{let r=t.resolve(...e);return void 0!==r?r:null}};try{let t=this._functions?{...c.functions,...this._functions}:c.functions;var i=new n.Parser(e,{reference:a,functions:t,constants:c.constants})}catch(t){throw t.message=`Invalid template variable "${e}" fails due to: ${t.message}`,t}if(i.single){if("reference"===i.single.type){let e=s[0];return{ref:e,raw:t,refs:s,wrapped:r||"local"===e.type&&"label"===e.key}}return c.stringify(i.single.value)}return{formula:i,raw:t,refs:s}}toString(){return this.source}},c.Template.prototype[o.symbols.template]=!0,c.Template.prototype.isImmutable=!0,c.encode=function(e){return e.replace(/\\(\{+)/g,(e,t)=>c.opens.slice(0,t.length)).replace(/\\(\}+)/g,(e,t)=>c.closes.slice(0,t.length))},c.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},c.split=function(e){let t=[],r="";for(let s=0;s<e.length;++s){let a=e[s];if("{"===a){let a="";for(;s+1<e.length&&"{"===e[s+1];)a+="{",++s;t.push(r),r=a}else r+=a}return t.push(r),t},c.wrap=function(e,t){return t?1===t.length?`${t}${e}${t}`:`${t[0]}${e}${t[1]}`:e},c.stringify=function(e,t,r,s,a,i={}){let n=typeof e,o=s&&s.errors&&s.errors.wrap||{},l=!1;if(u.isRef(e)&&e.render&&(l=e.in,e=e.resolve(t,r,s,a,{in:e.in,...i})),null===e)return"null";if("string"===n)return c.wrap(e,i.arrayItems&&o.string);if("number"===n||"function"===n||"symbol"===n)return e.toString();if("object"!==n)return JSON.stringify(e);if(e instanceof Date)return c.Template.date(e,s);if(e instanceof Map){let t=[];for(let[r,s]of e.entries())t.push(`${r.toString()} -> ${s.toString()}`);e=t}if(!Array.isArray(e))return e.toString();let f=[];for(let n of e)f.push(c.stringify(n,t,r,s,a,{arrayItems:!0,...i}));return c.wrap(f.join(", "),!l&&o.array)},c.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},c.functions={if:(e,t,r)=>e?t:r,length:e=>"string"==typeof e?e.length:e&&"object"==typeof e?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){let[t,r,s,a,i]=this,n=i.messages;if(!n)return"";let o=l.template(t,n[0],e,r,s)||l.template(t,n[1],e,r,s);return o?o.render(t,r,s,a,i):""},number:e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e):"boolean"==typeof e?+!!e:e instanceof Date?e.getTime():null}},4946:(e,t,r)=>{"use strict";let s=r(375),a=r(1687),i=r(8068),n=r(8160),o=r(3292),l=r(6354),u=r(6133),c={};e.exports=i.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:u.toSibling}},args:(e,...t)=>1===t.length&&Array.isArray(t[0])?e.try(...t[0]):e.try(...t),validate(e,t){let{schema:r,error:s,state:i,prefs:n}=t;if(r._flags.match){let t=[],o=[];for(let s=0;s<r.$_terms.matches.length;++s){let a=r.$_terms.matches[s],l=i.nest(a.schema,`match.${s}`);l.snapshot();let u=a.schema.$_validate(e,l,n);
2u.errors?(o.push(u.errors),l.restore()):(t.push(u.value),l.commit())}if(0===t.length)return{errors:s("alternatives.any",{details:o.map(e=>l.details(e,{override:!1}))})};if("one"===r._flags.match)return 1===t.length?{value:t[0]}:{errors:s("alternatives.one")};if(t.length!==r.$_terms.matches.length)return{errors:s("alternatives.all",{details:o.map(e=>l.details(e,{override:!1}))})};let u=e=>e.$_terms.matches.some(e=>"object"===e.schema.type||"alternatives"===e.schema.type&&u(e.schema));return u(r)?{value:t.reduce((e,t)=>a(e,t,{mergeArrays:!1}))}:{value:t[t.length-1]}}let o=[];for(let t=0;t<r.$_terms.matches.length;++t){let s=r.$_terms.matches[t];if(s.schema){let r=i.nest(s.schema,`match.${t}`);r.snapshot();let a=s.schema.$_validate(e,r,n);if(!a.errors)return r.commit(),a;r.restore(),o.push({schema:s.schema,reports:a.errors});continue}let a=s.ref?s.ref.resolve(e,i,n):e,l=s.is?[s]:s.switch;for(let r=0;r<l.length;++r){let{is:o,then:u,otherwise:c}=l[r],f=`match.${t}${s.switch?"."+r:""}`;if(o.$_match(a,i.nest(o,`${f}.is`),n)){if(u)return u.$_validate(e,i.nest(u,`${f}.then`),n)}else if(c)return c.$_validate(e,i.nest(c,`${f}.otherwise`),n)}}return c.errors(o,t)},rules:{conditional:{method(e,t){s(!this._flags._endedSwitch,"Unreachable condition"),s(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),s(void 0===t.break,"Cannot use break option with alternatives conditional");let r=this.clone(),a=o.when(r,e,t);for(let e of a.is?[a]:a.switch)if(e.then&&e.otherwise){r.$_setFlag("_endedSwitch",!0,{clone:!1});break}return r.$_terms.matches.push(a),r.$_mutateRebuild()}},match:{method(e){if(s(["any","one","all"].includes(e),"Invalid alternatives match mode",e),"any"!==e)for(let t of this.$_terms.matches)s(t.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(...e){s(e.length,"Missing alternative schemas"),n.verifyFlat(e,"try"),s(!this._flags._endedSwitch,"Unreachable condition");let t=this.clone();for(let r of e)t.$_terms.matches.push({schema:t.$_compile(r)});return t.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,r)=>"is"!==r.path[0]&&"string"!=typeof t._flags.label?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{n.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(let r of t.matches){let{schema:t,ref:s,is:a,not:i,then:n,otherwise:o}=r;e=t?e.try(t):s?e.conditional(s,{is:a,then:n,not:i,otherwise:o,switch:r.switch}):e.conditional(a,{then:n,otherwise:o})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),c.errors=function(e,{error:t,state:r}){if(!e.length)return{errors:t("alternatives.any")};if(1===e.length)return{errors:e[0].reports};let s=new Set,a=[];for(let{reports:i,schema:n}of e){if(i.length>1)return c.unmatched(e,t);let o=i[0];if(o instanceof l.Report==0)return c.unmatched(e,t);if(o.state.path.length!==r.path.length){a.push({type:n.type,report:o});continue}if("any.only"===o.code){for(let e of o.local.valids)s.add(e);continue}let[u,f]=o.code.split(".");"base"!==f?a.push({type:n.type,report:o}):"object.base"===o.code?s.add(o.local.type):s.add(u)}return a.length?1===a.length?{errors:a[0].report}:c.unmatched(e,t):{errors:t("alternatives.types",{types:[...s]})}},c.unmatched=function(e,t){let r=[];for(let t of e)r.push(...t.reports);return{errors:t("alternatives.match",l.details(r,{override:!1}))}}},8068:(e,t,r)=>{"use strict";let s=r(375),a=r(7629),i=r(8160),n=r(6914);e.exports=a.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return s("function"==typeof e,"Method must be a function"),s(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,{method:r}){try{return r(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){s(i.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");let t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return s(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate:(e,t,{code:r,local:s})=>t.error(r,s),args:["code","local"],multi:!0}},modifiers:{keep(e,t=!0){e.keep=t},message(e,t){e.message=n.compile(t)},warn(e,t=!0){e.warn=t}},manifest:{build(e,t){for(let r in t){let s=t[r];
2if(["examples","externals","metas","notes","tags"].includes(r))for(let t of s)e=e[r.slice(0,-1)](t);else if("alterations"!==r)if("whens"!==r){if("shared"===r)for(let t of s)e=e.shared(t)}else for(let t of s){let{ref:r,is:s,not:a,then:i,otherwise:n,concat:o}=t;e=o?e.concat(o):r?e.when(r,{is:s,not:a,then:i,otherwise:n,switch:t.switch,break:t.break}):e.when(s,{then:i,otherwise:n,break:t.break})}else{let t={};for(let{target:e,adjuster:r}of s)t[e]=r;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(e,t,r)=>{"use strict";let s=r(375),a=r(9474),i=r(9621),n=r(8068),o=r(8160),l=r(3292),u={};e.exports=n.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,{schema:t,state:r,prefs:s}){if(!Array.isArray(e))return;let a=t.$_getRule("sort");return a?u.sort(t,e,a.args.options,r,s):void 0}},validate(e,{schema:t,error:r}){if(!Array.isArray(e)){if(t._flags.single){let t=[e];return t[o.symbols.arraySingle]=!0,{value:t}}return{errors:r("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});let t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,{state:t,prefs:r,error:s},{schema:a}){let i=[e,...t.ancestors];for(let s=0;s<e.length;++s){let n=t.localize([...t.path,s],i,a);if(a.$_match(e[s],n,r))return e}let n=a._flags.label;return n?s("array.hasKnown",{patternLabel:n}):s("array.hasUnknown",null)},multi:!0},items:{method(...e){o.verifyFlat(e,"items");let t=this.$_addRule("items");for(let r=0;r<e.length;++r){let s=o.tryWithPath(()=>this.$_compile(e[r]),r,{append:!0});t.$_terms.items.push(s)}return t.$_mutateRebuild()},validate(e,{schema:t,error:r,state:s,prefs:a,errorsArray:i}){let n=t.$_terms._requireds.slice(),l=t.$_terms.ordered.slice(),c=[...t.$_terms._inclusions,...n],f=!e[o.symbols.arraySingle];delete e[o.symbols.arraySingle];let m=i(),h=e.length;for(let i=0;i<h;++i){let o=e[i],d=!1,p=!1,g=f?i:new Number(i),y=[...s.path,g];if(!t._flags.sparse&&void 0===o){if(m.push(r("array.sparse",{key:g,path:y,pos:i,value:void 0},s.localize(y))),a.abortEarly)return m;l.shift();continue}let b=[e,...s.ancestors];for(let e of t.$_terms._exclusions)if(e.$_match(o,s.localize(y,b,e),a,{presence:"ignore"})){if(m.push(r("array.excludes",{pos:i,value:o},s.localize(y))),a.abortEarly)return m;d=!0,l.shift();break}if(d)continue;if(t.$_terms.ordered.length){if(l.length){let n=l.shift(),c=n.$_validate(o,s.localize(y,b,n),a);if(c.errors){if(m.push(...c.errors),a.abortEarly)return m}else if("strip"===n._flags.result)u.fastSplice(e,i),--i,--h;else{if(!t._flags.sparse&&void 0===c.value){if(m.push(r("array.sparse",{key:g,path:y,pos:i,value:void 0},s.localize(y))),a.abortEarly)return m;continue}e[i]=c.value}continue}if(!t.$_terms.items.length){if(m.push(r("array.orderedLength",{pos:i,limit:t.$_terms.ordered.length})),a.abortEarly)return m;break}}let v=[],_=n.length;for(let l=0;l<_;++l){let c=s.localize(y,b,n[l]);c.snapshot();let f=n[l].$_validate(o,c,a);if(v[l]=f,!f.errors){if(c.commit(),e[i]=f.value,p=!0,u.fastSplice(n,l),--l,--_,!t._flags.sparse&&void 0===f.value&&(m.push(r("array.sparse",{key:g,path:y,pos:i,value:void 0},s.localize(y))),a.abortEarly))return m;break}c.restore()}if(p)continue;let w=a.stripUnknown&&!!a.stripUnknown.arrays||!1;for(let l of(_=c.length,c)){let c,f=n.indexOf(l);if(-1!==f)c=v[f];else{let n=s.localize(y,b,l);if(n.snapshot(),!(c=l.$_validate(o,n,a)).errors){n.commit(),"strip"===l._flags.result?(u.fastSplice(e,i),--i,--h):t._flags.sparse||void 0!==c.value?e[i]=c.value:(m.push(r("array.sparse",{key:g,path:y,pos:i,value:void 0},s.localize(y))),d=!0),p=!0;break}
2n.restore()}if(1===_){if(w){u.fastSplice(e,i),--i,--h,p=!0;break}if(m.push(...c.errors),a.abortEarly)return m;d=!0;break}}if(!d&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!p){if(w){u.fastSplice(e,i),--i,--h;continue}if(m.push(r("array.includes",{pos:i,value:o},s.localize(y))),a.abortEarly)return m}}return n.length&&u.fillMissedErrors(t,m,n,e,s,a),l.length&&(u.fillOrderedErrors(t,m,l,e,s,a),m.length||u.fillDefault(l,e,s,a)),m.length?m:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:s,operator:a,args:i})=>o.compare(e.length,r,a)?e:t.error("array."+s,{limit:i.limit,value:e}),args:[{name:"limit",ref:!0,assert:o.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(...e){o.verifyFlat(e,"ordered");let t=this.$_addRule("items");for(let r=0;r<e.length;++r){let s=o.tryWithPath(()=>this.$_compile(e[r]),r,{append:!0});u.validateSingle(s,t),t.$_mutateRegister(s),t.$_terms.ordered.push(s)}return t.$_mutateRebuild()}},single:{method(e){let t=void 0===e||!!e;return s(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(e={}){o.assertOptions(e,["by","order"]);let t={order:e.order||"ascending"};return e.by&&(t.by=l.ref(e.by,{ancestor:0}),s(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,{error:t,state:r,prefs:s,schema:a},{options:i}){let{value:n,errors:o}=u.sort(a,e,i,r,s);if(o)return o;for(let r=0;r<e.length;++r)if(e[r]!==n[r])return t("array.sort",{order:i.order,by:i.by?i.by.key:"value"});return e},convert:!0},sparse:{method(e){let t=void 0===e||!!e;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(e,t={}){s(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),o.assertOptions(t,["ignoreUndefined","separator"]);let r={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){let s=o.default(t.separator,".");r.path=s?e.split(s):[e]}else r.comparator=e;return this.$_addRule(r)},validate(e,{state:t,error:r,schema:n},{comparator:o,options:l},{comparator:u,path:c}){let f={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},m=u||a,h=l.ignoreUndefined;for(let a=0;a<e.length;++a){let n=c?i(e[a],c):e[a],l=u?f.custom:f[typeof n];if(s(l,"Failed to find unique map container for type",typeof n),l instanceof Map){let s,i=l.entries();for(;!(s=i.next()).done;)if(m(s.value[0],n)){let i=t.localize([...t.path,a],[e,...t.ancestors]),n={pos:a,value:e[a],dupePos:s.value[1],dupeValue:e[s.value[1]]};return c&&(n.path=o),r("array.unique",n,i)}l.set(n,a)}else{if((!h||void 0!==n)&&void 0!==l[n]){let s={pos:a,value:e[a],dupePos:l[n],dupeValue:e[l[n]]};return c&&(s.path=o),r("array.unique",s,t.localize([...t.path,a],[e,...t.ancestors]))}l[n]=a}}return e},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(e,t)=>new Set(e)}},rebuild(e){for(let t of(e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[],e.$_terms.items))u.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(let t of e.$_terms.ordered)u.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),u.fillMissedErrors=function(e,t,r,s,a,i){let n=[],o=0;for(let e of r){let t=e._flags.label;t?n.push(t):++o}n.length?o?t.push(e.$_createError("array.includesRequiredBoth",s,{knownMisses:n,unknownMisses:o},a,i)):t.push(e.$_createError("array.includesRequiredKnowns",s,{knownMisses:n},a,i)):t.push(e.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:o},a,i))},u.fillOrderedErrors=function(e,t,r,s,a,i){let n=[];for(let e of r)"required"===e._flags.presence&&n.push(e);n.length&&u.fillMissedErrors(e,t,n,s,a,i)},u.fillDefault=function(e,t,r,s){let a=[],i=!0;for(let n=e.length-1;n>=0;--n){let o=e[n],l=[t,...r.ancestors],u=o.$_validate(void 0,r.localize(r.path,l,o),s).value;if(i){if(void 0===u)continue;i=!1}a.unshift(u)}a.length&&t.push(...a)},u.fastSplice=function(e,t){let r=t;for(;r<e.length;)e[r++]=e[r];--e.length},u.validateSingle=function(e,t){("array"===e.type||e._flags._arrayItems)&&(s(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},u.sort=function(e,t,r,s,a){let i="ascending"===r.order?1:-1,n=-1*i;try{return{value:t.slice().sort((o,l)=>{let c=u.compare(o,l,n,i);if(null!==c||(r.by&&(o=r.by.resolve(o,s,a),l=r.by.resolve(l,s,a)),null!==(c=u.compare(o,l,n,i))))return c;let f=typeof o;if(f!==typeof l)throw e.$_createError("array.sort.mismatching",t,null,s,a);if("number"!==f&&"string"!==f)throw e.$_createError("array.sort.unsupported",t,{type:f},s,a);return"number"===f?(o-l)*i:o<l?n:i})}}catch(e){return{errors:e}}},u.compare=function(e,t,r,s){return e===t?0:void 0===e?1:void 0===t?-1:null===e?s:null===t?r:null}},4937:(e,t,r)=>{"use strict";let s=r(375),a=r(8068),i=r(8160),n=r(2036),o=function(e){return"boolean"==typeof e};e.exports=a.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,{schema:t}){if("boolean"!=typeof e){if("string"==typeof e){let r=t._flags.sensitive?e:e.toLowerCase();e="true"===r||"false"!==r&&e}return"boolean"!=typeof e&&(e=t.$_terms.truthy&&t.$_terms.truthy.has(e,null,null,!t._flags.sensitive)||(!t.$_terms.falsy||!t.$_terms.falsy.has(e,null,null,!t._flags.sensitive))&&e),{value:e}}},validate(e,{error:t}){if("boolean"!=typeof e)return{value:e,errors:t("boolean.base")}},rules:{truthy:{method(...e){i.verifyFlat(e,"truthy");let t=this.clone();t.$_terms.truthy=t.$_terms.truthy||new n;for(let r=0;r<e.length;++r){let a=e[r];s(void 0!==a,"Cannot call truthy with undefined"),t.$_terms.truthy.add(a)}return t}},falsy:{method(...e){i.verifyFlat(e,"falsy");let t=this.clone();t.$_terms.falsy=t.$_terms.falsy||new n;for(let r=0;r<e.length;++r){let a=e[r];s(void 0!==a,"Cannot call falsy with undefined"),t.$_terms.falsy.add(a)}return t}},sensitive:{method(e=!0){return this.$_setFlag("sensitive",e)}}},cast:{number:{from:o,to:(e,t)=>+!!e},string:{from:o,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(e,t,r)=>{"use strict";let s=r(375),a=r(8068),i=r(8160),n=r(3328),o={isDate:function(e){return e instanceof Date}};e.exports=a.extend({type:"date",coerce:{from:["number","string"],method:(e,{schema:t})=>({value:o.parse(e,t._flags.format)||e})},validate(e,{schema:t,error:r,prefs:s}){if(e instanceof Date&&!isNaN(e.getTime()))return;let a=t._flags.format;return s.convert&&a&&"string"==typeof e?{value:e,errors:r("date.format",{format:a})}:{value:e,errors:r("date.base")}},rules:{compare:{method:!1,validate(e,t,{date:r},{name:s,operator:a,args:n}){let o="now"===r?Date.now():r.getTime();return i.compare(e.getTime(),o,a)?e:t.error("date."+s,{limit:n.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:o.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return s(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(e="javascript"){return s(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:o.isDate,to:(e,t)=>e.getTime()},string:{from:o.isDate,to:(e,{prefs:t})=>n.date(e,t)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),o.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e))||/^\s*$/.test(e))return null;if("iso"===t)return i.isIsoDate(e)?o.date(e.toString()):null;let r=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return o.date(+e);if("unix"===t)return o.date(1e3*e);if("string"==typeof r)return null}return o.date(e)},o.date=function(e){let t=new Date(e);return isNaN(t.getTime())?null:t}},390:(e,t,r)=>{"use strict";let s=r(375);e.exports=r(7824).extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return s(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate:(e,t,{n:r})=>e.length===r?e:t.error("function.arity",{n:r})},class:{method(){return this.$_addRule("class")},validate:(e,t)=>
2/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return s(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate:(e,t,{n:r})=>e.length>=r?e:t.error("function.minArity",{n:r})},maxArity:{method(e){return s(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate:(e,t,{n:r})=>e.length<=r?e:t.error("function.maxArity",{n:r})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(e,t,r)=>{"use strict";let s=r(978),a=r(375),i=r(8571),n=r(3652),o=r(8068),l=r(8160),u=r(3292),c=r(6354),f=r(6133),m=r(3328),h={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=o.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(e,t)=>e.keys(t),validate(e,{schema:t,error:r,state:s,prefs:a}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e))return{value:e,errors:r("object.base",{type:t.$_property("typeof")})};if(!(t.$_terms.renames||t.$_terms.dependencies||t.$_terms.keys||t.$_terms.patterns||t.$_terms.externals))return;e=h.clone(e,a);let i=[];if(t.$_terms.renames&&!h.rename(t,e,s,a,i)||!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies)return{value:e,errors:i};let n=new Set(Object.keys(e));if(t.$_terms.keys){let r=[e,...s.ancestors];for(let o of t.$_terms.keys){let t=o.key,l=e[t];n.delete(t);let u=s.localize([...s.path,t],r,o),c=o.schema.$_validate(l,u,a);if(c.errors){if(a.abortEarly)return{value:e,errors:c.errors};void 0!==c.value&&(e[t]=c.value),i.push(...c.errors)}else"strip"===o.schema._flags.result||void 0===c.value&&void 0!==l?delete e[t]:void 0!==c.value&&(e[t]=c.value)}}if(n.size||t._flags._hasPatternMatch){let r=h.unknown(t,e,n,i,s,a);if(r)return r}if(t.$_terms.dependencies)for(let r of t.$_terms.dependencies){if(null!==r.key&&!1===h.isPresent(r.options)(r.key.resolve(e,s,a,null,{shadow:!1})))continue;let n=h.dependencies[r.rel](t,r,e,s,a);if(n){let r=t.$_createError(n.code,e,n.context,s,a);if(a.abortEarly)return{value:e,errors:r};i.push(r)}}return{value:e,errors:i}},rules:{and:{method(...e){return l.verifyFlat(e,"and"),h.dependency(this,"and",null,e)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,r){m.isTemplate(e)||(e=u.ref(e)),a(void 0===r||"string"==typeof r,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});let s=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:r}});return s.$_mutateRegister(e),s.$_mutateRegister(t),s},validate(e,{error:t,prefs:r,state:s},{subject:a,schema:i,message:n}){let o=a.resolve(e,s,r),l=f.isRef(a)?a.absolute(s):[];return i.$_match(o,s.localize(l,[e,...s.ancestors],i),r)?e:t("object.assert",{subject:a,message:n})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return a("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate:(e,t,{constructor:r,name:s})=>e instanceof r?e:t.error("object.instance",{type:s,value:e}),args:["constructor","name"]},keys:{method(e){a(void 0===e||"object"==typeof e,"Object schema must be a valid object"),a(!l.isSchema(e),"Object schema cannot be a joi schema");let t=this.clone();if(e)if(Object.keys(e).length)for(let r in t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter(t=>!e.hasOwnProperty(t.key)):new h.Keys,e)l.tryWithPath(()=>t.$_terms.keys.push({key:r,schema:this.$_compile(e[r])}),r);else t.$_terms.keys=new h.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:s,operator:a,args:i})=>l.compare(Object.keys(e).length,r,a)?e:t.error("object."+s,{limit:i.limit,value:e}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(...e){return l.verifyFlat(e,"nand"),h.dependency(this,"nand",null,e)}},or:{method(...e){return l.verifyFlat(e,"or"),h.dependency(this,"or",null,e)}},oxor:{method(...e){return h.dependency(this,"oxor",null,e)}},pattern:{method(e,t,r={}){let s=e instanceof RegExp;
2s||(e=this.$_compile(e,{appendPath:!0})),a(void 0!==t,"Invalid rule"),l.assertOptions(r,["fallthrough","matches"]),s&&a(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});let i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];let n={[s?"regex":"schema"]:e,rule:t};return r.matches&&(n.matches=this.$_compile(r.matches),"array"!==n.matches.type&&(n.matches=n.matches.$_root.array().items(n.matches)),i.$_mutateRegister(n.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),r.fallthrough&&(n.fallthrough=!0),i.$_terms.patterns.push(n),i.$_mutateRegister(t),i}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>f.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t,r={}){a("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),a("string"==typeof t||t instanceof m,"Invalid rename to argument"),a(t!==e,"Cannot rename key to same name:",e),l.assertOptions(r,["alias","ignoreUndefined","override","multiple"]);let i=this.clone();for(let t of(i.$_terms.renames=i.$_terms.renames||[],i.$_terms.renames))a(t.from!==e,"Cannot rename the same key multiple times");return t instanceof m&&i.$_mutateRegister(t),i.$_terms.renames.push({from:e,to:t,options:s(h.renameDefaults,r)}),i}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate:(e,t,{type:r})=>l.isSchema(e)&&("any"===r||e.type===r)?e:t.error("object.schema",{type:r})},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t,r={}){return h.dependency(this,"with",e,t,r)}},without:{method(e,t,r={}){return h.dependency(this,"without",e,t,r)}},xor:{method(...e){return l.verifyFlat(e,"xor"),h.dependency(this,"xor",null,e)}}},overrides:{default(e,t){return void 0===e&&(e=l.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){let t=new n.Sorter;for(let r of e.$_terms.keys)l.tryWithPath(()=>t.add(r,{after:r.schema.$_rootReferences(),group:r.key}),r.key);e.$_terms.keys=new h.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(let{rel:r,key:s=null,peers:a,options:i}of t.dependencies)e=h.dependency(e,r,s,a,i);if(t.patterns)for(let{regex:r,schema:s,rule:a,fallthrough:i,matches:n}of t.patterns)e=e.pattern(r||s,a,{fallthrough:i,matches:n});if(t.renames)for(let{from:r,to:s,options:a}of t.renames)e=e.rename(r,s,a);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),h.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return i(e,{shallow:!0});let r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e),r}let r=function(...t){return e.apply(this,t)};return r.prototype=i(e.prototype),Object.defineProperty(r,"name",{value:e.name,writable:!1}),Object.defineProperty(r,"length",{value:e.length,writable:!1}),Object.assign(r,e),r},h.dependency=function(e,t,r,s,i){a(null===r||"string"==typeof r,t,"key must be a strings"),i||(i=s.length>1&&"object"==typeof s[s.length-1]?s.pop():{}),l.assertOptions(i,["separator","isPresent"]),s=[].concat(s);let n=l.default(i.separator,"."),o=[];for(let e of s)a("string"==typeof e,t,"peers must be strings"),o.push(u.ref(e,{separator:n,ancestor:0,prefix:!1}));null!==r&&(r=u.ref(r,{separator:n,ancestor:0,prefix:!1}));let c=e.clone();return c.$_terms.dependencies=c.$_terms.dependencies||[],c.$_terms.dependencies.push(new h.Dependency(t,r,o,s,i)),c},h.dependencies={and(e,t,r,s,a){let i=[],n=[],o=t.peers.length,l=h.isPresent(t.options);for(let e of t.peers)!1===l(e.resolve(r,s,a,null,{shadow:!1}))?i.push(e.key):n.push(e.key);if(i.length!==o&&n.length!==o)return{code:"object.and",context:{present:n,presentWithLabels:h.keysToLabels(e,n),missing:i,missingWithLabels:h.keysToLabels(e,i)}}},nand(e,t,r,s,a){let i=[],n=h.isPresent(t.options);for(let e of t.peers)n(e.resolve(r,s,a,null,{shadow:!1}))&&i.push(e.key);if(i.length!==t.peers.length)return;let o=t.paths[0],l=t.paths.slice(1);return{code:"object.nand",context:{main:o,mainWithLabel:h.keysToLabels(e,o),peers:l,peersWithLabels:h.keysToLabels(e,l)}}},or(e,t,r,s,a){let i=h.isPresent(t.options);for(let e of t.peers)if(i(e.resolve(r,s,a,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:h.keysToLabels(e,t.paths)}}},oxor(e,t,r,s,a){let i=[],n=h.isPresent(t.options);for(let e of t.peers)n(e.resolve(r,s,a,null,{shadow:!1}))&&i.push(e.key);if(!i.length||1===i.length)return;let o={peers:t.paths,peersWithLabels:h.keysToLabels(e,t.paths)};return o.present=i,o.presentWithLabels=h.keysToLabels(e,i),{code:"object.oxor",context:o}},with(e,t,r,s,a){let i=h.isPresent(t.options);for(let n of t.peers)if(!1===i(n.resolve(r,s,a,null,{shadow:!1})))return{code:"object.with",context:{main:t.key.key,mainWithLabel:h.keysToLabels(e,t.key.key),peer:n.key,peerWithLabel:h.keysToLabels(e,n.key)}}},without(e,t,r,s,a){let i=h.isPresent(t.options);for(let n of t.peers)if(i(n.resolve(r,s,a,null,{shadow:!1})))return{code:"object.without",context:{main:t.key.key,mainWithLabel:h.keysToLabels(e,t.key.key),peer:n.key,peerWithLabel:h.keysToLabels(e,n.key)}}},xor(e,t,r,s,a){let i=[],n=h.isPresent(t.options);for(let e of t.peers)n(e.resolve(r,s,a,null,{shadow:!1}))&&i.push(e.key);if(1===i.length)return;let o={peers:t.paths,peersWithLabels:h.keysToLabels(e,t.paths)};return 0===i.length?{code:"object.missing",context:o}:(o.present=i,o.presentWithLabels=h.keysToLabels(e,i),{code:"object.xor",context:o})}},h.keysToLabels=function(e,t){return Array.isArray(t)?t.map(t=>e.$_mapLabels(t)):e.$_mapLabels(t)},h.isPresent=function(e){return"function"==typeof e.isPresent?e.isPresent:e=>void 0!==e},h.rename=function(e,t,r,s,a){let i={};for(let n of e.$_terms.renames){let o=[],l="string"!=typeof n.from;if(l)for(let e in t){if(void 0===t[e]&&n.options.ignoreUndefined||e===n.to)continue;let r=n.from.exec(e);r&&o.push({from:e,to:n.to,match:r})}else!Object.prototype.hasOwnProperty.call(t,n.from)||void 0===t[n.from]&&n.options.ignoreUndefined||o.push(n);for(let u of o){let o=u.from,c=u.to;if(c instanceof m&&(c=c.render(t,r,s,u.match)),o!==c){if(!n.options.multiple&&i[c]&&(a.push(e.$_createError("object.rename.multiple",t,{from:o,to:c,pattern:l},r,s)),s.abortEarly)||Object.prototype.hasOwnProperty.call(t,c)&&!n.options.override&&!i[c]&&(a.push(e.$_createError("object.rename.override",t,{from:o,to:c,pattern:l},r,s)),s.abortEarly))return!1;void 0===t[o]?delete t[c]:t[c]=t[o],i[c]=!0,n.options.alias||delete t[o]}}}return!0},h.unknown=function(e,t,r,s,a,i){if(e.$_terms.patterns){let n=!1,o=e.$_terms.patterns.map(e=>{if(e.matches)return n=!0,[]}),l=[t,...a.ancestors];for(let n of r){let u=t[n],c=[...a.path,n];for(let f=0;f<e.$_terms.patterns.length;++f){let m=e.$_terms.patterns[f];if(m.regex){let e=m.regex.test(n);if(a.mainstay.tracer.debug(a,"rule",`pattern.${f}`,e?"pass":"error"),!e)continue}
2else if(!m.schema.$_match(n,a.nest(m.schema,`pattern.${f}`),i))continue;r.delete(n);let h=a.localize(c,l,{schema:m.rule,key:n}),d=m.rule.$_validate(u,h,i);if(d.errors){if(i.abortEarly)return{value:t,errors:d.errors};s.push(...d.errors)}if(m.matches&&o[f].push(n),t[n]=d.value,!m.fallthrough)break}}if(n)for(let r=0;r<o.length;++r){let n=o[r];if(!n)continue;let u=e.$_terms.patterns[r].matches,f=a.localize(a.path,l,u),m=u.$_validate(n,f,i);if(m.errors){let r=c.details(m.errors,{override:!1});r.matches=n;let o=e.$_createError("object.pattern.match",t,r,a,i);if(i.abortEarly)return{value:t,errors:o};s.push(o)}}}if(r.size&&(e.$_terms.keys||e.$_terms.patterns)){if(i.stripUnknown&&void 0===e._flags.unknown||i.skipFunctions){let e=!(!i.stripUnknown||!0!==i.stripUnknown&&!i.stripUnknown.objects);for(let s of r)e?(delete t[s],r.delete(s)):"function"==typeof t[s]&&r.delete(s)}if(!l.default(e._flags.unknown,i.allowUnknown))for(let n of r){let r=a.localize([...a.path,n],[]),o=e.$_createError("object.unknown",t[n],{child:n},r,i,{flags:!1});if(i.abortEarly)return{value:t,errors:o};s.push(o)}}},h.Dependency=class{constructor(e,t,r,s,a){this.rel=e,this.key=t,this.peers=r,this.paths=s,this.options=a}describe(){let e={rel:this.rel,peers:this.paths};return null!==this.key&&(e.key=this.key.key),"."!==this.peers[0].separator&&(e.options={...e.options,separator:this.peers[0].separator}),this.options.isPresent&&(e.options={...e.options,isPresent:this.options.isPresent}),e}},h.Keys=class extends Array{concat(e){let t=this.slice(),r=new Map;for(let e=0;e<t.length;++e)r.set(t[e].key,e);for(let s of e){let e=s.key,a=r.get(e);void 0!==a?t[a]={key:e,schema:t[a].schema.concat(s.schema)}:t.push(s)}return t}}},8785:(e,t,r)=>{"use strict";let s=r(375),a=r(8068),i=r(8160),n=r(3292),o=r(6354),l={};e.exports=a.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,{schema:t,state:r,prefs:a}){s(t.$_terms.link,"Uninitialized link schema");let i=l.generate(t,e,r,a),n=t.$_terms.link[0].ref;return i.$_validate(e,r.nest(i,`link:${n.display}:${i.type}`),a)},generate:(e,t,r,s)=>l.generate(e,t,r,s),rules:{ref:{method(e){s(!this.$_terms.link,"Cannot reinitialize schema"),s("value"===(e=n.ref(e)).type||"local"===e.type,"Invalid reference type:",e.type),s("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");let t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(e=!0){return this.$_setFlag("relative",e)}}},overrides:{concat(e){s(this.$_terms.link,"Uninitialized link schema"),s(i.isSchema(e),"Invalid schema object"),s("link"!==e.type,"Cannot merge type link with another link");let t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(s(t.link,"Invalid link description missing link"),e.ref(t.link))}}),l.generate=function(e,t,r,s){let a=r.mainstay.links.get(e);if(a)return a._generate(t,r,s).schema;let i=e.$_terms.link[0].ref,{perspective:n,path:o}=l.perspective(i,r);l.assert(n,"which is outside of schema boundaries",i,e,r,s);try{a=o.length?n.$_reach(o):n}catch(t){l.assert(!1,"to non-existing schema",i,e,r,s)}return l.assert("link"!==a.type,"which is another link",i,e,r,s),e._flags.relative||r.mainstay.links.set(e,a),a._generate(t,r,s).schema},l.perspective=function(e,t){if("local"===e.type){for(let{schema:r,key:s}of t.schemas){if((r._flags.id||s)===e.path[0])return{perspective:r,path:e.path.slice(1)};if(r.$_terms.shared){for(let t of r.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},l.assert=function(e,t,r,a,i,n){e||s(!1,`"${o.label(a._flags,i,n)}" contains link reference "${r.display}" ${t}`)}},3832:(e,t,r)=>{"use strict";let s=r(375),a=r(8068),i=r(8160),n={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){let t=e.toString(),r=t.indexOf("."),s=t.indexOf("e");return(r<0?0:(s<0?t.length:s)-r-1)+(s<0?0:Math.max(0,-parseInt(t.slice(s+1))))}};e.exports=a.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:t,error:r}){if(!e.match(n.numberRx))return;let s={value:parseFloat(e=e.trim())};if(0===s.value&&(s.value=0),!t._flags.unsafe)if(e.match(/e/i)){if(n.extractSignificantDigits(e)!==n.extractSignificantDigits(String(s.value)))return s.errors=r("number.unsafe"),s}else{let t=s.value.toString();if(t.match(/e/i))return s;if(t!==n.normalizeDecimal(e))return s.errors=r("number.unsafe"),s}return s}},validate(e,{schema:t,error:r,prefs:s}){if(e===1/0||e===-1/0)return{value:e,errors:r("number.infinity")};if(!i.isNumber(e))return{value:e,errors:r("number.base")};let a={value:e};if(s.convert){let e=t.$_getRule("precision");if(e){let t=Math.pow(10,e.args.limit);a.value=Math.round(a.value*t)/t}}
2return 0===a.value&&(a.value=0),!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(a.errors=r("number.unsafe")),a},rules:{compare:{method:!1,validate:(e,t,{limit:r},{name:s,operator:a,args:n})=>i.compare(e,r,a)?e:t.error("number."+s,{limit:n.limit,value:e}),args:[{name:"limit",ref:!0,assert:i.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){let t="number"==typeof e?n.decimalPlaces(e):null,r=Math.pow(10,t);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:t,pfactor:r}})},validate:(e,t,{base:r,baseDecimalPlace:s,pfactor:a},i)=>n.decimalPlaces(e)>s?t.error("number.multiple",{multiple:i.args.base,value:e}):Math.round(a*e)%Math.round(a*r)==0?e:t.error("number.multiple",{multiple:i.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return s(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,{limit:r}){let s=e.toString().match(n.precisionRx);return Math.max((s[1]?s[1].length:0)-(s[2]?parseInt(s[2],10):0),0)<=r?e:t.error("number.precision",{limit:r,value:e})},convert:!0},sign:{method(e){return s(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,t,{sign:r})=>"negative"===r&&e<0||"positive"===r&&e>0?e:t.error(`number.${r}`)},unsafe:{method(e=!0){return s("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),n.extractSignificantDigits=function(e){return e.replace(n.exponentialPartRegex,"").replace(n.dotRegex,"").replace(n.trailingZerosRegex,"").replace(n.leadingSignAndZerosRegex,"")},n.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},8966:(e,t,r)=>{"use strict";e.exports=r(7824).extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},7417:(e,t,r)=>{"use strict";let s=r(375),a=r(5380),i=r(1745),n=r(9959),o=r(6064),l=r(9926),u=r(5752),c=r(8068),f=r(8160),m={tlds:l instanceof Set&&{tlds:{allow:l,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:n.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=c.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:t,state:r,prefs:s}){let a=t.$_getRule("normalize");a&&(e=e.normalize(a.args.form));let i=t.$_getRule("case");i&&(e="upper"===i.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());let n=t.$_getRule("trim");if(n&&n.args.enabled&&(e=e.trim()),t.$_terms.replacements)for(let r of t.$_terms.replacements)e=e.replace(r.pattern,r.replacement);let o=t.$_getRule("hex");
2if(o&&o.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),t.$_getRule("isoDate")){let t=m.isoDate(e);t&&(e=t)}if(t._flags.truncate){let a=t.$_getRule("max");if(a){let i=a.args.limit;if(f.isResolvable(i)&&(i=i.resolve(e,r,s),!f.limit(i)))return{value:e,errors:t.$_createError("any.ref",i,{ref:a.args.limit,arg:"limit",reason:"must be a positive integer"},r,s)};e=e.slice(0,i)}}return{value:e}}},validate(e,{schema:t,error:r}){if("string"!=typeof e)return{value:e,errors:r("string.base")};if(""===e){let s=t.$_getRule("min");if(s&&0===s.args.limit)return;return{value:e,errors:r("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(e={}){return f.assertOptions(e,["paddingRequired","urlSafe"]),s("boolean"==typeof(e={urlSafe:!1,paddingRequired:!0,...e}).paddingRequired,"paddingRequired must be boolean"),s("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,t,{options:r})=>m.base64Regex[r.paddingRequired][r.urlSafe].test(e)?e:t.error("string.base64")},case:{method(e){return s(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,t,{direction:r})=>"lower"===r&&e===e.toLocaleLowerCase()||"upper"===r&&e===e.toLocaleUpperCase()?e:t.error(`string.${r}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let r=e.length,s=0,a=1;for(;r--;){let t=e.charAt(r)*a;s+=t-9*(t>9),a^=3}return s>0&&s%10==0?e:t.error("string.creditCard")}},dataUri:{method(e={}){return f.assertOptions(e,["paddingRequired"]),s("boolean"==typeof(e={paddingRequired:!0,...e}).paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,{options:r}){let s=e.match(m.dataUriRegex);return s&&(!s[2]||"base64"!==s[2]||m.base64Regex[r.paddingRequired].false.test(s[3]))?e:t.error("string.dataUri")}},domain:{method(e){e&&f.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let t=m.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate:(e,t,r,{address:s})=>a.isValid(e,s)?e:t.error("string.domain")},email:{method(e={}){f.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),s(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");let t=m.addressOptions(e),r=RegExp(`\\s*[${e.separator?o(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:r,address:t})},validate(e,t,{options:r},{regex:s,address:a}){let n=r.multiple?e.split(s):[e],o=[];for(let e of n)i.isValid(e,a)||o.push(e);return o.length?t.error("string.email",{value:e,invalids:o}):e}},guid:{alias:"uuid",method(e={}){f.assertOptions(e,["version","separator"]);let t="";if(e.version){let r=[].concat(e.version);s(r.length>=1,"version must have at least 1 valid version specified");let a=new Set;for(let e=0;e<r.length;++e){let i=r[e];s("string"==typeof i,"version at position "+e+" must be a string");let n=m.guidVersions[i.toLowerCase()];s(n,"version at position "+e+" must be one of "+Object.keys(m.guidVersions).join(", ")),s(!a.has(n),"version at position "+e+" must not be a duplicate"),t+=n,a.add(n)}}s(m.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');let r=void 0===e.separator?"[:-]?":!0===e.separator?"[:-]":!1===e.separator?"[]?":`\\${e.separator}`,a=RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${r})[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:a})},validate(e,t,r,{regex:s}){let a=s.exec(e);return a?m.guidBrackets[a[1]]!==a[a.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(e={}){return f.assertOptions(e,["byteAligned","prefix"]),s("boolean"==typeof(e={byteAligned:!1,prefix:!1,...e}).byteAligned,"byteAligned must be boolean"),s("boolean"==typeof e.prefix||"optional"===e.prefix,'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,t,{options:r})=>("optional"===r.prefix?m.hexRegex.withOptionalPrefix:!0===r.prefix?m.hexRegex.withPrefix:m.hexRegex.withoutPrefix).test(e)?r.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>
2a.isValid(e,{minDomainSegments:1})||m.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){f.assertOptions(e,["cidr","version"]);let{cidr:t,versions:r,regex:s}=n.regex(e),a=e.version?r:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:a}},regex:s})},validate:(e,t,{options:r},{regex:s})=>s.test(e)?e:r.version?t.error("string.ipVersion",{value:e,cidr:r.cidr,version:r.version}):t.error("string.ip",{value:e,cidr:r.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:t})=>m.isoDate(e)?e:t("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>m.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return m.length(this,"length",e,"=",t)},validate(e,t,{limit:r,encoding:s},{name:a,operator:i,args:n}){let o=!s&&e.length;return f.compare(o,r,i)?e:t.error("string."+a,{limit:n.limit,value:e,encoding:s})},args:[{name:"limit",ref:!0,assert:f.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return m.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return m.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){return s(m.normalizationForms.includes(e),"normalization form must be one of "+m.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:t},{form:r})=>e===e.normalize(r)?e:t("string.normalize",{value:e,form:r}),convert:!0},pattern:{alias:"regex",method(e,t={}){s(e instanceof RegExp,"regex must be a RegExp"),s(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),f.assertOptions(t,["invert","name"]);let r="string.pattern"+(t.invert?".invert":"")+(t.name?".name":".base");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:r})},validate:(e,t,{regex:r,options:s},{errorCode:a})=>r.test(e)^s.invert?e:t.error(a,{name:s.name,regex:r,value:e}),args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=RegExp(o(e),"g")),s(e instanceof RegExp,"pattern must be a RegExp"),s("string"==typeof t,"replacement must be a String");let r=this.clone();return r.$_terms.replacements||(r.$_terms.replacements=[]),r.$_terms.replacements.push({pattern:e,replacement:t}),r}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(e=!0){return s("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,t,{enabled:r})=>r&&e!==e.trim()?t.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return s("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){f.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),e.domain&&f.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:t,scheme:r}=u.regex(e),s=e.domain?m.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:s,scheme:r})},validate(e,t,{options:r},{regex:s,domain:i,scheme:n}){if(["http:/","https:/"].includes(e))return t.error("string.uri");let o=s.exec(e);if(!o&&t.prefs.convert&&r.encodeUri){let t=encodeURI(e);(o=s.exec(t))&&(e=t)}if(o){let s=o[1]||o[2];return!i||r.allowRelative&&!s||a.isValid(s,i)?e:t.error("string.domain",{value:s})}return r.relativeOnly?t.error("string.uriRelativeOnly"):r.scheme?t.error("string.uriCustomScheme",{scheme:n,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(let{pattern:r,replacement:s}of t.replacements)e=e.replace(r,s);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),m.addressOptions=function(e){if(!e)return m.tlds||e;if(s(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),s(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return s(m.tlds,"Built-in TLD list disabled"),Object.assign({},e,m.tlds);s("object"==typeof e.tlds,"tlds must be true, false, or an object");let t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),s(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),s(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),m.validateTlds(e.tlds.deny,"tlds.deny"),e;let r=e.tlds.allow;return r?!0===r?(s(m.tlds,"Built-in TLD list disabled"),Object.assign({},e,m.tlds)):(Array.isArray(r)&&(e=Object.assign({},e,{tlds:{allow:new Set(r)}})),s(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),m.validateTlds(e.tlds.allow,"tlds.allow"),e):e},m.validateTlds=function(e,t){for(let r of e)s(a.isValid(r,{minDomainSegments:1,maxDomainSegments:1}),`${t} must contain valid top level domain names`)},m.isoDate=function(e){if(!f.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");let t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},m.length=function(e,t,r,a,i){return s(!i,"Invalid encoding:",i),e.$_addRule({name:t,method:"length",args:{limit:r,encoding:i},operator:a})}},8826:(e,t,r)=>{"use strict";let s=r(375),a=r(8068),i={};i.Map=class extends Map{slice(){return new i.Map(this)}},e.exports=a.extend({type:"symbol",terms:{map:{init:new i.Map}},coerce:{method(e,{schema:t,error:r}){let s=t.$_terms.map.get(e);return s&&(e=s),t._flags.only&&"symbol"!=typeof e?{value:e,errors:r("symbol.map",{map:t.$_terms.map})}:{value:e}}},validate(e,{error:t}){if("symbol"!=typeof e)return{value:e,errors:t("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),s(e&&e[Symbol.iterator],"Iterable must be an iterable or object");let t=this.clone(),r=[];for(let a of e){s(a&&a[Symbol.iterator],"Entry must be an iterable");let[e,i]=a;s("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),s("symbol"==typeof i,"Value must be a Symbol"),t.$_terms.map.set(e,i),r.push(i)}return t.valid(...r)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(e,t,r)=>{"use strict";let s=r(375),a=r(8571),i=r(738),n=r(9621),o=r(8160),l=r(6354),u=r(493),c={result:Symbol("result")};t.entry=function(e,t,r){let a=o.defaults;r&&(s(void 0===r.warnings,"Cannot override warnings preference in synchronous validation"),s(void 0===r.artifacts,"Cannot override artifacts preference in synchronous validation"),a=o.preferences(o.defaults,r));let i=c.entry(e,t,a);s(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");let n={value:i.value};return i.error&&(n.error=i.error),i.mainstay.warnings.length&&(n.warning=l.details(i.mainstay.warnings)
2),i.mainstay.debug&&(n.debug=i.mainstay.debug),i.mainstay.artifacts&&(n.artifacts=i.mainstay.artifacts),n},t.entryAsync=async function(e,t,r){let s=o.defaults;r&&(s=o.preferences(o.defaults,r));let a=c.entry(e,t,s),i=a.mainstay;if(a.error)throw i.debug&&(a.error.debug=i.debug),a.error;if(i.externals.length){let t=a.value,u=[];for(let a of i.externals){let f=a.state.path,m="link"===a.schema.type?i.links.get(a.schema):null,h,d,p=t,g=f.length?[t]:[],y=f.length?n(e,f):e;if(f.length){h=f[f.length-1];let e=t;for(let t of f.slice(0,-1))e=e[t],g.unshift(e);p=(d=g[0])[h]}try{let e=(e,t)=>(m||a.schema).$_createError(e,p,t,a.state,s),n=await a.method(p,{schema:a.schema,linked:m,state:a.state,prefs:r,original:y,error:e,errorsArray:c.errorsArray,warn:(e,t)=>i.warnings.push((m||a.schema).$_createError(e,p,t,a.state,s)),message:(e,t)=>(m||a.schema).$_createError("external",p,t,a.state,s,{messages:e})});if(void 0===n||n===p)continue;if(n instanceof l.Report){if(i.tracer.log(a.schema,a.state,"rule","external","error"),u.push(n),s.abortEarly)break;continue}if(Array.isArray(n)&&n[o.symbols.errors]){if(i.tracer.log(a.schema,a.state,"rule","external","error"),u.push(...n),s.abortEarly)break;continue}d?(i.tracer.value(a.state,"rule",p,n,"external"),d[h]=n):(i.tracer.value(a.state,"rule",t,n,"external"),t=n)}catch(e){throw s.errors.label&&(e.message+=` (${a.label})`),e}}if(a.value=t,u.length)throw a.error=l.process(u,e,s),i.debug&&(a.error.debug=i.debug),a.error}if(!s.warnings&&!s.debug&&!s.artifacts)return a.value;let u={value:a.value};return i.warnings.length&&(u.warning=l.details(i.warnings)),i.debug&&(u.debug=i.debug),i.artifacts&&(u.artifacts=i.artifacts),u},c.Mainstay=class{constructor(e,t,r){this.externals=[],this.warnings=[],this.tracer=e,this.debug=t,this.links=r,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){let e=this._snapshots.pop();this.externals=e.externals,this.warnings=e.warnings}commit(){this._snapshots.pop()}},c.entry=function(e,r,s){let{tracer:a,cleanup:i}=c.tracer(r,s),n=s.debug?[]:null,o=r._ids._schemaChain?new Map:null,f=new c.Mainstay(a,n,o),m=new u([],[],{mainstay:f,schemas:r._ids._schemaChain?[{schema:r}]:null}),h=t.validate(e,r,m,s);i&&r.$_root.untrace();let d=l.process(h.errors,e,s);return{value:h.value,error:d,mainstay:f}},c.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(s(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:c.ignore}},t.validate=function(e,t,r,s,a={}){if(t.$_terms.whens&&(t=t._generate(e,r,s).schema),t._preferences&&(s=c.prefs(t,s)),t._cache&&s.cache){let s=t._cache.get(e);if(r.mainstay.tracer.debug(r,"validate","cached",!!s),s)return s}let i=(a,i,n)=>t.$_createError(a,e,i,n||r,s),n={original:e,prefs:s,schema:t,state:r,error:i,errorsArray:c.errorsArray,warn:(e,t,s)=>r.mainstay.warnings.push(i(e,t,s)),message:(a,i)=>t.$_createError("custom",e,i,r,s,{messages:a})};r.mainstay.tracer.entry(t,r);let l=t._definition;if(l.prepare&&void 0!==e&&s.convert){let t=l.prepare(e,n);if(t){if(r.mainstay.tracer.value(r,"prepare",e,t.value),t.errors)return c.finalize(t.value,[].concat(t.errors),n);e=t.value}}if(l.coerce&&void 0!==e&&s.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){let t=l.coerce.method(e,n);if(t){if(r.mainstay.tracer.value(r,"coerced",e,t.value),t.errors)return c.finalize(t.value,[].concat(t.errors),n);e=t.value}}let u=t._flags.empty;u&&u.$_match(c.trim(e,t),r.nest(u),o.defaults)&&(r.mainstay.tracer.value(r,"empty",e,void 0),e=void 0);let f=a.presence||t._flags.presence||(t._flags._endedSwitch?null:s.presence);if(void 0===e){if("forbidden"===f)return c.finalize(e,null,n);if("required"===f)return c.finalize(e,[t.$_createError("any.required",e,null,r,s)],n);if("optional"===f){if(t._flags.default!==o.symbols.deepDefault)return c.finalize(e,null,n);r.mainstay.tracer.value(r,"default",e,{}),e={}}}else if("forbidden"===f)return c.finalize(e,[t.$_createError("any.unknown",e,null,r,s)],n);let m=[];
2if(t._valids){let a=t._valids.get(e,r,s,t._flags.insensitive);if(a)return s.convert&&(r.mainstay.tracer.value(r,"valids",e,a.value),e=a.value),r.mainstay.tracer.filter(t,r,"valid",a),c.finalize(e,null,n);if(t._flags.only){let a=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},r,s);if(s.abortEarly)return c.finalize(e,[a],n);m.push(a)}}if(t._invalids){let a=t._invalids.get(e,r,s,t._flags.insensitive);if(a){r.mainstay.tracer.filter(t,r,"invalid",a);let i=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},r,s);if(s.abortEarly)return c.finalize(e,[i],n);m.push(i)}}if(l.validate){let t=l.validate(e,n);if(t&&(r.mainstay.tracer.value(r,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return m.push(t.errors),c.finalize(e,m,n);if(t.errors.length)return m.push(...t.errors),c.finalize(e,m,n)}}return t._rules.length?c.rules(e,m,n):c.finalize(e,m,n)},c.rules=function(e,t,r){let{schema:s,state:a,prefs:i}=r;for(let n of s._rules){let l=s._definition.rules[n.method];if(l.convert&&i.convert){a.mainstay.tracer.log(s,a,"rule",n.name,"full");continue}let u,f=n.args;if(n._resolve.length)for(let t of(f=Object.assign({},f),n._resolve)){let r=l.argsByName.get(t),n=f[t].resolve(e,a,i),c=r.normalize?r.normalize(n):n,m=o.validateArg(c,null,r);if(m){u=s.$_createError("any.ref",n,{arg:t,ref:f[t],reason:m},a,i);break}f[t]=c}u=u||l.validate(e,r,f,n);let m=c.rule(u,n);if(m.errors){if(a.mainstay.tracer.log(s,a,"rule",n.name,"error"),n.warn){a.mainstay.warnings.push(...m.errors);continue}if(i.abortEarly)return c.finalize(e,m.errors,r);t.push(...m.errors)}else a.mainstay.tracer.log(s,a,"rule",n.name,"pass"),a.mainstay.tracer.value(a,"rule",e,m.value,n.name),e=m.value}return c.finalize(e,t,r)},c.rule=function(e,t){return e instanceof l.Report?(c.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[o.symbols.errors]?(e.forEach(e=>c.error(e,t)),{errors:e,value:null}):{errors:null,value:e}},c.error=function(e,t){return t.message&&e._setTemplate(t.message),e},c.finalize=function(e,t,r){let{schema:a,state:i,prefs:n}=r;if((t=t||[]).length){let s=c.default("failover",void 0,t,r);void 0!==s&&(i.mainstay.tracer.value(i,"failover",e,s),e=s,t=[])}if(t.length&&a._flags.error)if("function"==typeof a._flags.error)for(let e of(Array.isArray(t=a._flags.error(t))||(t=[t]),t))s(e instanceof Error||e instanceof l.Report,"error() must return an Error object");else t=[a._flags.error];if(void 0===e){let s=c.default("default",e,t,r);i.mainstay.tracer.value(i,"default",e,s),e=s}if(a._flags.cast&&void 0!==e){let t=a._definition.cast[a._flags.cast];if(t.from(e)){let s=t.to(e,r);i.mainstay.tracer.value(i,"cast",e,s,a._flags.cast),e=s}}if(a.$_terms.externals&&n.externals&&!1!==n._externals)for(let{method:e}of a.$_terms.externals)i.mainstay.externals.push({method:e,schema:a,state:i,label:l.label(a._flags,i,n)});let o={value:e,errors:t.length?t:null};return a._flags.result&&(o.value="strip"===a._flags.result?void 0:r.original,i.mainstay.tracer.value(i,a._flags.result,e,o.value),i.shadow(e,a._flags.result)),a._cache&&!1!==n.cache&&!a._refs.length&&a._cache.set(r.original,o),void 0===e||o.errors||void 0===a._flags.artifact||(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(a._flags.artifact)||i.mainstay.artifacts.set(a._flags.artifact,[]),i.mainstay.artifacts.get(a._flags.artifact).push(i.path)),o},c.prefs=function(e,t){let r=t===o.defaults;return r&&e._preferences[o.symbols.prefs]?e._preferences[o.symbols.prefs]:(t=o.preferences(t,e._preferences),r&&(e._preferences[o.symbols.prefs]=t),t)},c.default=function(e,t,r,s){let{schema:i,state:n,prefs:l}=s,u=i._flags[e];if(l.noDefaults||void 0===u)return t;if(n.mainstay.tracer.log(i,n,"rule",e,"full"),!u)return u;if("function"==typeof u){let t=u.length?[a(n.ancestors[0]),s]:[];try{return u(...t)}catch(t){return void r.push(i.$_createError(`any.${e}`,null,{error:t},n,l))}}return"object"!=typeof u?u:u[o.symbols.literal]?u.literal:o.isResolvable(u)?u.resolve(t,n,l):a(u)},c.trim=function(e,t){if("string"!=typeof e)return e;let r=t.$_getRule("trim");return r&&r.args.enabled?e.trim():e},c.ignore={active:!1,debug:i,entry:i,filter:i,log:i,resolve:i,value:i},c.errorsArray=function(){let e=[];return e[o.symbols.errors]=!0,e}},2036:(e,t,r)=>{"use strict";let s=r(375),a=r(9474),i=r(8160),n={};e.exports=n.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=n.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){i.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,r){if(e=e||new n.Values,t){if(t._override)return t.clone();for(let r of[...t._values,...t._refs])e.add(r)}if(r)for(let t of[...r._values,...r._refs])e.remove(t);return e.length?e:null}remove(e){i.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,r,s){return!!this.get(e,t,r,s)}get(e,t,r,s){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&s){let t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e){for(let t of this._values)if(a(t,e))return{value:t}}if(t)for(let i of this._refs){let n=i.resolve(e,t,r,null,{in:!0});if(void 0!==n){for(let t of i.in&&"object"==typeof n?Array.isArray(n)?n:Object.keys(n):[n])if(typeof t==typeof e){if(s&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:i}}else if(a(t,e))return{value:t,ref:i}}}}return!1}override(){this._override=!0}values(e){if(e&&e.display){let e=[];for(let t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){let e=new n.Values(this._values,this._refs);return e._override=this._override,e}concat(e){s(!e._override,"Cannot concat override set of values");let t=new n.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){let e=[];for(let t of(this._override&&e.push({override:!0}
2),this._values.values()))e.push(t&&"object"==typeof t?{value:t}:t);for(let t of this._refs.values())e.push(t.describe());return e}},n.Values.prototype[i.symbols.values]=!0,n.Values.prototype.slice=n.Values.prototype.clone,n.lowercases=function(e){let t=new Map;if(e)for(let r of e)"string"==typeof r&&t.set(r.toLowerCase(),r);return t}},978:(e,t,r)=>{"use strict";let s=r(375),a=r(8571),i=r(1687),n=r(9621),o={};e.exports=function(e,t,r={}){if(s(e&&"object"==typeof e,"Invalid defaults value: must be an object"),s(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),s("object"==typeof r,"Invalid options: must be an object"),!t)return null;if(r.shallow)return o.applyToDefaultsWithShallow(e,t,r);let n=a(e);return!0===t?n:i(n,t,{nullOverride:void 0!==r.nullOverride&&r.nullOverride,mergeArrays:!1})},o.applyToDefaultsWithShallow=function(e,t,r){let l=r.shallow;s(Array.isArray(l),"Invalid keys");let u=new Map,c=!0===t?null:new Set;for(let r of l){let s=n(e,r=Array.isArray(r)?r:r.split("."));s&&"object"==typeof s?u.set(s,c&&n(t,r)||s):c&&c.add(r)}let f=a(e,{},u);if(!c)return f;for(let e of c)o.reachCopy(f,t,e);return i(f,t,{nullOverride:void 0!==r.nullOverride&&r.nullOverride,mergeArrays:!1})},o.reachCopy=function(e,t,r){for(let e of r){if(!(e in t))return;let r=t[e];if("object"!=typeof r||null===r)return;t=r}let s=t,a=e;for(let e=0;e<r.length-1;++e){let t=r[e];"object"!=typeof a[t]&&(a[t]={}),a=a[t]}a[r[r.length-1]]=s}},375:(e,t,r)=>{"use strict";let s=r(7916);e.exports=function(e,...t){if(!e){if(1===t.length&&t[0]instanceof Error)throw t[0];throw new s(t)}}},8571:(e,t,r)=>{"use strict";let s=r(9621),a=r(4277),i=r(7043),n={needsProtoHack:new Set([a.set,a.map,a.weakSet,a.weakMap])};e.exports=n.clone=function(e,t={},r=null){if("object"!=typeof e||null===e)return e;let s=n.clone,o=r;if(t.shallow){if(!0!==t.shallow)return n.cloneWithShallow(e,t);s=e=>e}else if(o){let t=o.get(e);if(t)return t}else o=new Map;let l=a.getInternalProto(e);if(l===a.buffer)return!1;if(l===a.date)return new Date(e.getTime());if(l===a.regex)return new RegExp(e);let u=n.base(e,l,t);if(u===e)return e;if(o&&o.set(e,u),l===a.set)for(let r of e)u.add(s(r,t,o));else if(l===a.map)for(let[r,a]of e)u.set(r,s(a,t,o));for(let r of i.keys(e,t)){if("__proto__"===r)continue;if(l===a.array&&"length"===r){u.length=e.length;continue}let i=Object.getOwnPropertyDescriptor(e,r);i?i.get||i.set?Object.defineProperty(u,r,i):i.enumerable?u[r]=s(e[r],t,o):Object.defineProperty(u,r,{enumerable:!1,writable:!0,configurable:!0,value:s(e[r],t,o)}):Object.defineProperty(u,r,{enumerable:!0,writable:!0,configurable:!0,value:s(e[r],t,o)})}return u},n.cloneWithShallow=function(e,t){let r=t.shallow;(t=Object.assign({},t)).shallow=!1;let a=new Map;for(let t of r){let r=s(e,t);"object"!=typeof r&&"function"!=typeof r||a.set(r,r)}return n.clone(e,t,a)},n.base=function(e,t,r){if(!1===r.prototype)return n.needsProtoHack.has(t)?new t.constructor:t===a.array?[]:{};let s=Object.getPrototypeOf(e);if(s&&s.isImmutable)return e;if(t===a.array){let e=[];return s!==t&&Object.setPrototypeOf(e,s),e}if(n.needsProtoHack.has(t)){let e=new s.constructor;return s!==t&&Object.setPrototypeOf(e,s),e}return Object.create(s)}},9474:(e,t,r)=>{"use strict";let s=r(4277),a={mismatched:null};e.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!a.isDeepEqual(e,t,r,[])},a.isDeepEqual=function(e,t,r,i){if(e===t)return 0!==e||1/e==1/t;let n=typeof e;if(n!==typeof t||null===e||null===t)return!1;if("function"===n){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if("object"!==n)return e!=e&&t!=t;let o=a.getSharedType(e,t,!!r.prototype);switch(o){case s.buffer:return!1;case s.promise:return e===t;case s.regex:return e.toString()===t.toString();case a.mismatched:return!1}for(let r=i.length-1;r>=0;--r)if(i[r].isSame(e,t))return!0;i.push(new a.SeenEntry(e,t));try{return!!a.isDeepEqualObj(o,e,t,r,i)}finally{i.pop()}},a.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?a.mismatched:s.getInternalProto(e);let i=s.getInternalProto(e);return i!==s.getInternalProto(t)?a.mismatched:i},a.valueOf=function(e){let t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},a.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},a.isSetSimpleEqual=function(e,t){for(let r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0}
2,a.isDeepEqualObj=function(e,t,r,i,n){let{isDeepEqual:o,valueOf:l,hasOwnEnumerableProperty:u}=a,{keys:c,getOwnPropertySymbols:f}=Object;if(e===s.array){if(!i.part){if(t.length!==r.length)return!1;for(let e=0;e<t.length;++e)if(!o(t[e],r[e],i,n))return!1;return!0}for(let e of t)for(let t of r)if(o(e,t,i,n))return!0}else if(e===s.set){if(t.size!==r.size)return!1;if(!a.isSetSimpleEqual(t,r)){let e=new Set(Set.prototype.values.call(r));for(let r of Set.prototype.values.call(t)){if(e.delete(r))continue;let t=!1;for(let s of e)if(o(r,s,i,n)){e.delete(s),t=!0;break}if(!t)return!1}}}else if(e===s.map){if(t.size!==r.size)return!1;for(let[e,s]of Map.prototype.entries.call(t))if(void 0===s&&!Map.prototype.has.call(r,e)||!o(s,Map.prototype.get.call(r,e),i,n))return!1}else if(e===s.error&&(t.name!==r.name||t.message!==r.message))return!1;let m=l(t),h=l(r);if((t!==m||r!==h)&&!o(m,h,i,n))return!1;let d=c(t);if(!i.part&&d.length!==c(r).length&&!i.skip)return!1;let p=0;for(let e of d)if(i.skip&&i.skip.includes(e))void 0===r[e]&&++p;else if(!u(r,e)||!o(t[e],r[e],i,n))return!1;if(!i.part&&d.length-p!==c(r).length)return!1;if(!1!==i.symbols){let e=f(t),s=new Set(f(r));for(let a of e){if(!i.skip||!i.skip.includes(a)){if(u(t,a)){if(!u(r,a)||!o(t[a],r[a],i,n))return!1}else if(u(r,a))return!1}s.delete(a)}for(let e of s)if(u(r,e))return!1}return!0},a.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}},7916:(e,t,r)=>{"use strict";let s=r(8761);e.exports=class extends Error{constructor(e){super(e.filter(e=>""!==e).map(e=>"string"==typeof e?e:e instanceof Error?e.message:s(e)).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.assert)}}},5277:e=>{"use strict";let t={};e.exports=function(e){if(!e)return"";let r="";for(let s=0;s<e.length;++s){let a=e.charCodeAt(s);t.isSafe(a)?r+=e[s]:r+=t.escapeHtmlChar(a)}return r},t.escapeHtmlChar=function(e){return t.namedHtml.get(e)||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)},t.isSafe=function(e){return t.safeCharCodes.has(e)},t.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),t.safeCharCodes=function(){let e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&e.add(t);return e}()},6064:e=>{"use strict";e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:e=>{"use strict";e.exports=function(){}},1687:(e,t,r)=>{"use strict";let s=r(375),a=r(8571),i=r(7043),n={};e.exports=n.merge=function(e,t,r){if(s(e&&"object"==typeof e,"Invalid target value: must be an object"),s(null==t||"object"==typeof t,"Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){s(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let s=0;s<t.length;++s)e.push(a(t[s],{symbols:r.symbols}));return e}let o=i.keys(t,r);for(let s=0;s<o.length;++s){let i=o[s];if("__proto__"===i||!Object.prototype.propertyIsEnumerable.call(t,i))continue;let l=t[i];if(l&&"object"==typeof l){if(e[i]===l)continue;!e[i]||"object"!=typeof e[i]||Array.isArray(e[i])!==Array.isArray(l)||l instanceof Date||l instanceof RegExp?e[i]=a(l,{symbols:r.symbols}):n.merge(e[i],l,r)}else(null!=l||r.nullOverride)&&(e[i]=l)}return e}},9621:(e,t,r)=>{"use strict";let s=r(375),a={};e.exports=function(e,t,r){if(!1===t||null==t)return e;"string"==typeof(r=r||{})&&(r={separator:r});let i=Array.isArray(t);s(!i||!r.separator,"Separator option is not valid for array-based chain");let n=i?t:t.split(r.separator||"."),o=e;for(let e=0;e<n.length;++e){let i=n[e],l=r.iterables&&a.iterables(o);if(Array.isArray(o)||"set"===l){let e=Number(i);Number.isInteger(e)&&(i=e<0?o.length+e:e)}if(!o||"function"==typeof o&&!1===r.functions||!l&&void 0===o[i]){s(!r.strict||e+1===n.length,"Missing segment",i,"in reach path ",t),s("object"==typeof o||!0===r.functions||"function"!=typeof o,"Invalid segment",i,"in reach path ",t),o=r.default;break}o=l?"set"===l?[...o][i]:o.get(i):o[i]}return o},a.iterables=function(e){return e instanceof Set?"set":e instanceof Map?"map":void 0}},8761:e=>{"use strict";e.exports=function(...e){try{return JSON.stringify(...e)}catch(e){return"[Cannot display object: "+e.message+"]"}}},4277:(e,t)=>{"use strict";let r={};r.typeMap=new Map([["[object Error]",(t=e.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype}).error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;let s=Object.prototype.toString.call(e);return r.typeMap.get(s)||t.generic}},7043:(e,t)=>
2{"use strict";t.keys=function(e,t={}){return!1!==t.symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},3652:(e,t,r)=>{"use strict";let s=r(375),a={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){let r=[].concat((t=t||{}).before||[]),a=[].concat(t.after||[]),i=t.group||"?",n=t.sort||0;for(let t of(s(!r.includes(i),`Item cannot come before itself: ${i}`),s(!r.includes("?"),"Item cannot come before unassociated items"),s(!a.includes(i),`Item cannot come after itself: ${i}`),s(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]),e)){let e={seq:this._items.length,sort:n,before:r,after:a,group:i,node:t};this._items.push(e)}return t.manual||s(this._sort(),"item","?"!==i?`added into group ${i}`:"","created a dependencies error"),this.nodes}merge(e){for(let t of(Array.isArray(e)||(e=[e]),e))if(t)for(let e of t._items)this._items.push(Object.assign({},e));this._items.sort(a.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;return s(this._sort(),"merge created a dependencies error"),this.nodes}sort(){return s(this._sort(),"sort created a dependencies error"),this.nodes}_sort(){let e={},t=Object.create(null),r=Object.create(null);for(let s of this._items){let a=s.seq,i=s.group;for(let n of(r[i]=r[i]||[],r[i].push(a),e[a]=s.before,s.after))t[n]=t[n]||[],t[n].push(a)}for(let t in e){let s=[];for(let a in e[t]){let i=e[t][a];r[i]=r[i]||[],s.push(...r[i])}e[t]=s}for(let s in t)if(r[s])for(let a of r[s])e[a].push(...t[s]);let s={};for(let t in e)for(let r of e[t])s[r]=s[r]||[],s[r].push(t);let a={},i=[];for(let e=0;e<this._items.length;++e){let t=e;if(s[e]){t=null;for(let e=0;e<this._items.length;++e){if(!0===a[e])continue;s[e]||(s[e]=[]);let r=s[e].length,i=0;for(let t=0;t<r;++t)a[s[e][t]]&&++i;if(i===r){t=e;break}}}null!==t&&(a[t]=!0,i.push(t))}if(i.length!==this._items.length)return!1;let n={};for(let e of this._items)n[e.seq]=e;for(let e of(this._items=[],this.nodes=[],i)){let t=n[e];this.nodes.push(t.node),this._items.push(t)}return!0}},a.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1}
2,5380:(e,t,r)=>{"use strict";let s=r(443),a=r(2178),i={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:s.URL||URL};t.analyze=function(e,t={}){if(!e)return a.code("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw Error("Invalid input: domain must be a string");if(e.length>256)return a.code("DOMAIN_TOO_LONG");if(i.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return a.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(i.domainControlRx.test(e))return a.code("DOMAIN_INVALID_CHARS");e=i.punycode(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));let r=t.minDomainSegments||i.minDomainSegments,s=e.split(".");if(s.length<r)return a.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&s.length>t.maxDomainSegments)return a.code("DOMAIN_SEGMENTS_COUNT_MAX");let n=t.tlds;if(n){let e=s[s.length-1].toLowerCase();if(n.deny&&n.deny.has(e)||n.allow&&!n.allow.has(e))return a.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<s.length;++e){let t=s[e];if(!t.length)return a.code("DOMAIN_EMPTY_SEGMENT");if(t.length>63)return a.code("DOMAIN_LONG_SEGMENT");if(e<s.length-1){if(!i.domainSegmentRx.test(t))return a.code("DOMAIN_INVALID_CHARS")}else if(!i.tldSegmentRx.test(t))return a.code("DOMAIN_INVALID_TLDS_CHARS")}return null},t.isValid=function(e,r){return!t.analyze(e,r)},i.punycode=function(e){e.includes("%")&&(e=e.replace(/%/g,"%25"));try{return new i.URL(`http://${e}`).host}catch(t){return e}}},1745:(e,t,r)=>{"use strict";let s=r(9848),a=r(5380),i=r(2178),n={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(s.TextEncoder||TextEncoder)};t.analyze=function(e,t){return n.email(e,t)},t.isValid=function(e,t){return!n.email(e,t)},n.email=function(e,t={}){if("string"!=typeof e)throw Error("Invalid input: email must be a string");if(!e)return i.code("EMPTY_STRING");let r=!n.nonAsciiRx.test(e);if(!r){if(!1===t.allowUnicode)return i.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}let s=e.split("@");if(2!==s.length)return s.length>2?i.code("MULTIPLE_AT_CHAR"):i.code("MISSING_AT_CHAR");let[o,l]=s;if(!o)return i.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return i.code("ADDRESS_TOO_LONG");if(n.encoder.encode(o).length>64)return i.code("LOCAL_TOO_LONG")}return n.local(o,r)||a.analyze(l,t)},n.local=function(e,t){for(let r of e.split(".")){if(!r.length)return i.code("EMPTY_LOCAL_SEGMENT");if(t){if(!n.atextRx.test(r))return i.code("INVALID_LOCAL_CHARS")}else for(let e of r){if(n.atextRx.test(e))continue;let t=n.binary(e);if(!n.atomRx.test(t))return i.code("INVALID_LOCAL_CHARS")}}},n.binary=function(e){return Array.from(n.encoder.encode(e)).map(e=>String.fromCharCode(e)).join("")},n.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,n.atomRx=RegExp("(?:[\\xc2-\\xdf][\\x80-\\xbf])|(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})|(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})")},2178:(e,t)=>{"use strict";t.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @
2character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},t.code=function(e){return{code:e,error:t.codes[e]}}},9959:(e,t,r)=>{"use strict";let s=r(375),a=r(5752);t.regex=function(e={}){s(void 0===e.cidr||"string"==typeof e.cidr,"options.cidr must be a string");let t=e.cidr?e.cidr.toLowerCase():"optional";s(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),s(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let r=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(r)||(r=[r]),s(r.length>=1,"options.version must have at least 1 version specified");for(let e=0;e<r.length;++e)s("string"==typeof r[e],"options.version must only contain strings"),r[e]=r[e].toLowerCase(),s(["ipv4","ipv6","ipvfuture"].includes(r[e]),"options.version contains unknown version "+r[e]+" - must be one of ipv4, ipv6, ipvfuture");r=Array.from(new Set(r));let i=`(?:${r.map(e=>{if("forbidden"===t)return a.ip[e];let r=`\\/${"ipv4"===e?a.ip.v4Cidr:a.ip.v6Cidr}`;return"required"===t?`${a.ip[e]}${r}`:`${a.ip[e]}(?:${r})?`}).join("|")})`;return{cidr:t,versions:r,regex:RegExp(`^${i}$`),raw:i}}},5752:(e,t,r)=>{"use strict";let s=r(375),a=r(6064),i={generate:function(){let e={},t="\\dA-Fa-f",r="["+t+"]",s="\\w-\\.~",a="!\\$&'\\(\\)\\*\\+,;=",i="%"+t,n=s+i+a+":@",o="["+n+"]",l="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+l+"\\.){3}"+l;let u=r+"{1,4}",c="(?:"+u+":"+u+"|"+e.ipv4address+")",f="(?:(?:"+u+":){0,1}"+u+")?::(?:"+u+":){3}"+c,m="(?:(?:"+u+":){0,2}"+u+")?::(?:"+u+":){2}"+c,h="(?:(?:"+u+":){0,3}"+u+")?::"+u+":"+c;e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:(?:"+u+":){6}"+c+"|"+("::(?:"+u)+":){5}"+c+"|"+("(?:"+u+")?::(?:"+u)+":){4}"+c+"|"+f+"|"+m+"|"+h+"|"+("(?:(?:"+u+":){0,4}"+u)+")?::"+c+"|"+("(?:(?:"+u+":){0,5}"+u)+")?::"+u+"|"+("(?:(?:"+u+":){0,6}")+u+")?::)",e.ipvFuture="v"+r+"+\\.["+s+a+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);let d="["+s+i+a+":]*",p="(?:\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]|"+e.ipv4address+"|"+("["+s+i)+a+"]{1,255})",g="(?:"+d+"@)?"+p+"(?::\\d*)?",y="(?:"+d+"@)?("+p+")(?::\\d*)?",b=o+"*",v=o+"+",_="(?:\\/"+b+")*",w="\\/(?:"+v+_+")?",$=v+_,x="["+s+i+a+"@]+"+_;return e.hierPart="(?:(?:\\/\\/"+g+_+")|"+w+"|"+$+"|"+("(?:\\/\\/\\/"+b)+_+"))",e.hierPartCapture="(?:(?:\\/\\/"+y+_+")|"+w+"|"+$+")",e.relativeRef="(?:(?:\\/\\/"+g+_+")|"+w+"|"+x+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+y+_+")|"+w+"|"+x+"|)",e.query="["+n+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+n+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+n+"\\/\\?]*",e}};i.rfc3986=i.generate(),t.ip={v4Cidr:i.rfc3986.ipv4Cidr,v6Cidr:i.rfc3986.ipv6Cidr,ipv4:i.rfc3986.ipv4address,ipv6:i.rfc3986.ipv6address,ipvfuture:i.rfc3986.ipvFuture},i.createRegex=function(e){let t=i.rfc3986,r="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",n=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return i.wrap(n+r);let o="";if(e.scheme){s(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");let r=[].concat(e.scheme);s(r.length>=1,"scheme must have at least 1 scheme specified");let i=[];for(let e=0;e<r.length;++e){let n=r[e];s(n instanceof RegExp||"string"==typeof n,"scheme at position "+e+" must be a RegExp or String"),n instanceof RegExp?i.push(n.source.toString()):(s(t.schemeRegex.test(n),"scheme at position "+e+" must be a valid scheme"),i.push(a(n)))}o=i.join("|")}let l="(?:"+(o?"(?:"+o+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")",u=e.allowRelative?"(?:"+l+"|"+n+")":l;return i.wrap(u+r,o)}
2,i.wrap=function(e,t){return{raw:e=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${e}`,regex:RegExp(`^${e}$`),scheme:t}},i.uriRegex=i.createRegex({}),t.regex=function(e={}){return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?i.createRegex(e):i.uriRegex}},1447:(e,t)=>{"use strict";let r={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e,t={}){if(!t[r.settings]&&t.constants)for(const e in t.constants){const r=t.constants[e];if(null!==r&&!["boolean","number","string"].includes(typeof r))throw Error(`Formula constant ${e} contains invalid ${typeof r} value type`)}this.settings=t[r.settings]?t:Object.assign({[r.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let s=[],a="",i=0,n=!1,o=e=>{if(i)throw Error("Formula missing closing parenthesis");let o=s.length?s[s.length-1]:null;if(n||a||e){if(o&&"reference"===o.type&&")"===e)return o.type="function",o.value=this._subFormula(a,o.value),void(a="");if(")"===e){let e=new t.Parser(a,this.settings);s.push({type:"segment",value:e})}else if(n){if("]"===n)return s.push({type:"reference",value:a}),void(a="");s.push({type:"literal",value:a})}else if(r.operatorCharacters.includes(a))o&&"operator"===o.type&&r.operators.includes(o.value+a)?o.value+=a:s.push({type:"operator",value:a});else if(a.match(r.numberRx))s.push({type:"constant",value:parseFloat(a)});else if(void 0!==this.settings.constants[a])s.push({type:"constant",value:this.settings.constants[a]});else{if(!a.match(r.tokenRx))throw Error(`Formula contains invalid token: ${a}`);s.push({type:"reference",value:a})}a=""}};for(let t of e)n?t===n?(o(),n=!1):a+=t:i?"("===t?(a+=t,++i):")"===t?--i?a+=t:o(t):a+=t:t in r.literals?n=r.literals[t]:"("===t?(o(),++i):r.operatorCharacters.includes(t)?(o(),a=t,o()):" "!==t?a+=t:o();o();let l=!1;for(let e of s=s.map((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==s[t-1].type?e:{type:"operator",value:"n"})){if("operator"===e.type){if(r.operatorsPrefix.includes(e.value))continue;if(!l)throw Error("Formula contains an operator in invalid position");if(!r.operators.includes(e.value))throw Error(`Formula contains an unknown operator ${e.value}`)}else if(l)throw Error("Formula missing expected operator");l=!l}if(!l)throw Error("Formula contains invalid trailing operator");1===s.length&&["reference","literal","constant"].includes(s[0].type)&&(this.single={type:"reference"===s[0].type?"reference":"value",value:s[0].value}),this._parts=s.map(e=>{if("operator"===e.type)return r.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw Error(`Formula contains invalid reference ${e.value}`);return this.settings.reference?this.settings.reference(e.value):r.reference(e.value)})}_subFormula(e,s){let a=this.settings.functions[s];if("function"!=typeof a)throw Error(`Formula contains unknown function ${s}`);let i=[];if(e){let t="",a=0,n=!1,o=()=>{if(!t)throw Error(`Formula contains function ${s} with invalid arguments ${e}`);i.push(t),t=""};for(let s=0;s<e.length;++s){let i=e[s];n?(t+=i,i===n&&(n=!1)):i in r.literals&&!a?(t+=i,n=r.literals[i]):","!==i||a?(t+=i,"("===i?++a:")"===i&&--a):o()}o()}return i=i.map(e=>new t.Parser(e,this.settings)),function(e){let t=[];for(let r of i)t.push(r.evaluate(e));return a.call(e,...t)}}evaluate(e){let t=this._parts.slice();for(let s=t.length-2;s>=0;--s){let a=t[s];if(a&&"operator"===a.type){let i=t[s+1];t.splice(s+1,1);let n=r.evaluate(i,e);t[s]=r.single(a.value,n)}}return r.operatorsOrder.forEach(s=>{for(let a=1;a<t.length-1;)if(s.includes(t[a])){let s=t[a],i=r.evaluate(t[a-1],e),n=r.evaluate(t[a+1],e);t.splice(a,2);let o=r.calculate(s,i,n);t[a-1]=0===o?0:o}else a+=2}),r.evaluate(t[0],e)}},t.Parser.prototype[r.symbol]=!0,r.reference=function(e){return function(t){return t&&void 0!==t[e]?t[e]:null}},r.evaluate=function(e,t){return null===e?null:"function"==typeof e?e(t):e[r.symbol]?e.evaluate(t):e},r.single=function(e,t){if("!"===e)return!t;let r=-t;return 0===r?0:r},r.calculate=function(e,t,s){if("??"===e)return r.exists(t)?t:s;if("string"==typeof t||"string"==typeof s){if("+"===e)return(t=r.exists(t)?t:"")+(r.exists(s)?s:"")}else switch(e){case"^":return Math.pow(t,s);case"*":return t*s;case"/":return t/s;case"%":return t%s;case"+":return t+s;case"-":return t-s}switch(e){case"<":return t<s;case"<=":return t<=s;case">":return t>s;case">=":return t>=s;case"==":return t===s;case"!=":return t!==s;case"&&":return t&&s;case"||":return t||s}return null},r.exists=function(e){return null!=e}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:e=>{"use strict";e.exports=JSON.parse('{"version":"17.13.3"}')}},a={}
2,t.exports=function e(t){var r=a[t];if(void 0!==r)return r.exports;var i=a[t]={exports:{}};return s[t](i,i.exports,e),i.exports}(5107)}]); 3 4//# debugId=ea164ee9-179b-0aa0-60d8-330f9c5c82d0
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.