import{E as ke,F as Re}from"../app.js";function ae(P){var F=new Error(P);return F.source="ulid",F}var fe="0123456789ABCDEFGHJKMNPQRSTVWXYZ",se=fe.length,ve=Math.pow(2,48)-1,je=10,Se=16;function Ae(P){var F=Math.floor(P()*se);return F===se&&(F=se-1),fe.charAt(F)}function Oe(P,F){if(isNaN(P))throw new Error(P+" must be a number");if(P>ve)throw ae("cannot encode time greater than "+ve);if(P<0)throw ae("time must be positive");if(Number.isInteger(P)===!1)throw ae("time must be an integer");for(var z=void 0,I="";F>0;F--)z=P%se,I=fe.charAt(z)+I,P=(P-z)/se;return I}function Ee(P,F){for(var z="";P>0;P--)z=Ae(F)+z;return z}function Ce(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,F=arguments[1];F||(F=typeof window<"u"?window:null);var z=F&&(F.crypto||F.msCrypto);if(z)return function(){var R=new Uint8Array(1);return z.getRandomValues(R),R[0]/255};try{var I=require("crypto");return function(){return I.randomBytes(1).readUInt8()/255}}catch{}if(P){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw ae("secure crypto unusable, insecure Math.random not allowed")}function De(P){return P||(P=Ce()),function(z){return isNaN(z)&&(z=Date.now()),Oe(z,je)+Ee(Se,P)}}var Ne=De(),ue={exports:{}};(function(P,F){(function(z,I){var R="1.0.37",x="",y="?",l="function",b="undefined",g="object",m="string",r="major",s="model",n="name",t="type",e="vendor",a="version",i="architecture",o="console",c="mobile",f="tablet",d="smarttv",_="wearable",v="embedded",u=500,h="Amazon",p="Apple",w="ASUS",k="BlackBerry",$="Browser",j="Chrome",S="Edge",E="Firefox",D="Google",U="Huawei",V="LG",M="Microsoft",N="Motorola",B="Opera",W="Samsung",G="Sharp",Z="Sony",Q="Xiaomi",J="Zebra",me="Facebook",he="Chromium OS",de="Mac OS",we=function(C,L){var O={};for(var q in C)L[q]&&L[q].length%2===0?O[q]=L[q].concat(C[q]):O[q]=C[q];return O},ne=function(C){for(var L={},O=0;O0?T.length===2?typeof T[1]==l?this[T[0]]=T[1].call(this,Y):this[T[0]]=T[1]:T.length===3?typeof T[1]===l&&!(T[1].exec&&T[1].test)?this[T[0]]=Y?T[1].call(this,Y,T[2]):I:this[T[0]]=Y?Y.replace(T[1],T[2]):I:T.length===4&&(this[T[0]]=Y?T[3].call(this,Y.replace(T[1],T[2])):I):this[T]=Y||I;O+=2}},le=function(C,L){for(var O in L)if(typeof L[O]===g&&L[O].length>0){for(var q=0;q2&&(A[s]="iPad",A[t]=f),A},this.getEngine=function(){var A={};return A[n]=I,A[a]=I,re.call(A,q,K.engine),A},this.getOS=function(){var A={};return A[n]=I,A[a]=I,re.call(A,q,K.os),T&&!A[n]&&X&&X.platform!="Unknown"&&(A[n]=X.platform.replace(/chrome os/i,he).replace(/macos/i,de)),A},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return q},this.setUA=function(A){return q=typeof A===m&&A.length>u?oe(A,u):A,this},this.setUA(q),this};H.VERSION=R,H.BROWSER=ne([n,a,r]),H.CPU=ne([i]),H.DEVICE=ne([s,e,t,o,c,d,f,_,v]),H.ENGINE=H.OS=ne([n,a]),P.exports&&(F=P.exports=H),F.UAParser=H;var ee=typeof z!==b&&(z.jQuery||z.Zepto);if(ee&&!ee.ua){var ie=new H;ee.ua=ie.getResult(),ee.ua.get=function(){return ie.getUA()},ee.ua.set=function(C){ie.setUA(C);var L=ie.getResult();for(var O in L)ee.ua[O]=L[O]}}})(typeof window=="object"?window:ke)})(ue,ue.exports);var Te=ue.exports,_e={exports:{}};(function(P,F){(function(z,I){P.exports=I()})(self,()=>{return z={7629:(R,x,y)=>{const l=y(375),b=y(8571),g=y(9474),m=y(1687),r=y(8652),s=y(8160),n=y(3292),t=y(6354),e=y(8901),a=y(9708),i=y(6914),o=y(2294),c=y(6133),f=y(1152),d=y(8863),_=y(2036),v={Base:class{constructor(u){this.type=u,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new o.Ids,this._preferences=null,this._refs=new c.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 l(typeof a.describe=="function","Manifest functionality disabled"),a.describe(this)}allow(...u){return s.verifyFlat(u,"allow"),this._values(u,"_valids")}alter(u){l(u&&typeof u=="object"&&!Array.isArray(u),"Invalid targets argument"),l(!this._inRuleset(),"Cannot set alterations inside a ruleset");const h=this.clone();h.$_terms.alterations=h.$_terms.alterations||[];for(const p in u){const w=u[p];l(typeof w=="function","Alteration adjuster for",p,"must be a function"),h.$_terms.alterations.push({target:p,adjuster:w})}return h.$_temp.ruleset=!1,h}artifact(u){return l(u!==void 0,"Artifact cannot be undefined"),l(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",u)}cast(u){return l(u===!1||typeof u=="string","Invalid to value"),l(u===!1||this._definition.cast[u],"Type",this.type,"does not support casting to",u),this.$_setFlag("cast",u===!1?void 0:u)}default(u,h){return this._default("default",u,h)}description(u){return l(u&&typeof u=="string","Description must be a non-empty string"),this.$_setFlag("description",u)}empty(u){const h=this.clone();return u!==void 0&&(u=h.$_compile(u,{override:!1})),h.$_setFlag("empty",u,{clone:!1})}error(u){return l(u,"Missing error"),l(u instanceof Error||typeof u=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",u)}example(u,h={}){return l(u!==void 0,"Missing example"),s.assertOptions(h,["override"]),this._inner("examples",u,{single:!0,override:h.override})}external(u,h){return typeof u=="object"&&(l(!h,"Cannot combine options with description"),h=u.description,u=u.method),l(typeof u=="function","Method must be a function"),l(h===void 0||h&&typeof h=="string","Description must be a non-empty string"),this._inner("externals",{method:u,description:h},{single:!0})}failover(u,h){return this._default("failover",u,h)}forbidden(){return this.presence("forbidden")}id(u){return u?(l(typeof u=="string","id must be a non-empty string"),l(/^[^\.]+$/.test(u),"id cannot contain period character"),this.$_setFlag("id",u)):this.$_setFlag("id",void 0)}invalid(...u){return this._values(u,"_invalids")}label(u){return l(u&&typeof u=="string","Label name must be a non-empty string"),this.$_setFlag("label",u)}meta(u){return l(u!==void 0,"Meta cannot be undefined"),this._inner("metas",u,{single:!0})}note(...u){l(u.length,"Missing notes");for(const h of u)l(h&&typeof h=="string","Notes must be non-empty strings");return this._inner("notes",u)}only(u=!0){return l(typeof u=="boolean","Invalid mode:",u),this.$_setFlag("only",u)}optional(){return this.presence("optional")}prefs(u){l(u,"Missing preferences"),l(u.context===void 0,"Cannot override context"),l(u.externals===void 0,"Cannot override externals"),l(u.warnings===void 0,"Cannot override warnings"),l(u.debug===void 0,"Cannot override debug"),s.checkPreferences(u);const h=this.clone();return h._preferences=s.preferences(h._preferences,u),h}presence(u){return l(["optional","required","forbidden"].includes(u),"Unknown presence mode",u),this.$_setFlag("presence",u)}raw(u=!0){return this.$_setFlag("result",u?"raw":void 0)}result(u){return l(["raw","strip"].includes(u),"Unknown result mode",u),this.$_setFlag("result",u)}required(){return this.presence("required")}strict(u){const h=this.clone(),p=u!==void 0&&!u;return h._preferences=s.preferences(h._preferences,{convert:p}),h}strip(u=!0){return this.$_setFlag("result",u?"strip":void 0)}tag(...u){l(u.length,"Missing tags");for(const h of u)l(h&&typeof h=="string","Tags must be non-empty strings");return this._inner("tags",u)}unit(u){return l(u&&typeof u=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",u)}valid(...u){s.verifyFlat(u,"valid");const h=this.allow(...u);return h.$_setFlag("only",!!h._valids,{clone:!1}),h}when(u,h){const p=this.clone();p.$_terms.whens||(p.$_terms.whens=[]);const w=n.when(p,u,h);if(!["any","link"].includes(p.type)){const k=w.is?[w]:w.switch;for(const $ of k)l(!$.then||$.then.type==="any"||$.then.type===p.type,"Cannot combine",p.type,"with",$.then&&$.then.type),l(!$.otherwise||$.otherwise.type==="any"||$.otherwise.type===p.type,"Cannot combine",p.type,"with",$.otherwise&&$.otherwise.type)}return p.$_terms.whens.push(w),p.$_mutateRebuild()}cache(u){l(!this._inRuleset(),"Cannot set caching inside a ruleset"),l(!this._cache,"Cannot override schema cache"),l(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const h=this.clone();return h._cache=u||r.provider.provision(),h.$_temp.ruleset=!1,h}clone(){const u=Object.create(Object.getPrototypeOf(this));return this._assign(u)}concat(u){l(s.isSchema(u),"Invalid schema object"),l(this.type==="any"||u.type==="any"||u.type===this.type,"Cannot merge type",this.type,"with another type:",u.type),l(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),l(!u._inRuleset(),"Cannot concatenate a schema with open ruleset");let h=this.clone();if(this.type==="any"&&u.type!=="any"){const p=u.clone();for(const w of Object.keys(h))w!=="type"&&(p[w]=h[w]);h=p}h._ids.concat(u._ids),h._refs.register(u,c.toSibling),h._preferences=h._preferences?s.preferences(h._preferences,u._preferences):u._preferences,h._valids=_.merge(h._valids,u._valids,u._invalids),h._invalids=_.merge(h._invalids,u._invalids,u._valids);for(const p of u._singleRules.keys())h._singleRules.has(p)&&(h._rules=h._rules.filter(w=>w.keep||w.name!==p),h._singleRules.delete(p));for(const p of u._rules)u._definition.rules[p.method].multi||h._singleRules.set(p.name,p),h._rules.push(p);if(h._flags.empty&&u._flags.empty){h._flags.empty=h._flags.empty.concat(u._flags.empty);const p=Object.assign({},u._flags);delete p.empty,m(h._flags,p)}else if(u._flags.empty){h._flags.empty=u._flags.empty;const p=Object.assign({},u._flags);delete p.empty,m(h._flags,p)}else m(h._flags,u._flags);for(const p in u.$_terms){const w=u.$_terms[p];w?h.$_terms[p]?h.$_terms[p]=h.$_terms[p].concat(w):h.$_terms[p]=w.slice():h.$_terms[p]||(h.$_terms[p]=w)}return this.$_root._tracer&&this.$_root._tracer._combine(h,[this,u]),h.$_mutateRebuild()}extend(u){return l(!u.base,"Cannot extend type with another base"),e.type(this,u)}extract(u){return u=Array.isArray(u)?u:u.split("."),this._ids.reach(u)}fork(u,h){l(!this._inRuleset(),"Cannot fork inside a ruleset");let p=this;for(let w of[].concat(u))w=Array.isArray(w)?w:w.split("."),p=p._ids.fork(w,h,p);return p.$_temp.ruleset=!1,p}rule(u){const h=this._definition;s.assertOptions(u,Object.keys(h.modifiers)),l(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const p=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;l(p>=0&&pp.tailor(u),ref:!1}),h.$_temp.ruleset=!1,h.$_mutateRebuild()}tracer(){return f.location?f.location(this):this}validate(u,h){return d.entry(u,this,h)}validateAsync(u,h){return d.entryAsync(u,this,h)}$_addRule(u){typeof u=="string"&&(u={name:u}),l(u&&typeof u=="object","Invalid options"),l(u.name&&typeof u.name=="string","Invalid rule name");for(const $ in u)l($[0]!=="_","Cannot set private rule properties");const h=Object.assign({},u);h._resolve=[],h.method=h.method||h.name;const p=this._definition.rules[h.method],w=h.args;l(p,"Unknown rule",h.method);const k=this.clone();if(w){l(Object.keys(w).length===1||Object.keys(w).length===this._definition.rules[h.name].args.length,"Invalid rule definition for",this.type,h.name);for(const $ in w){let j=w[$];if(p.argsByName){const S=p.argsByName.get($);if(S.ref&&s.isResolvable(j))h._resolve.push($),k.$_mutateRegister(j);else if(S.normalize&&(j=S.normalize(j),w[$]=j),S.assert){const E=s.validateArg(j,$,S);l(!E,E,"or reference")}}j!==void 0?w[$]=j:delete w[$]}}return p.multi||(k._ruleRemove(h.name,{clone:!1}),k._singleRules.set(h.name,h)),k.$_temp.ruleset===!1&&(k.$_temp.ruleset=null),p.priority?k._rules.unshift(h):k._rules.push(h),k}$_compile(u,h){return n.schema(this.$_root,u,h)}$_createError(u,h,p,w,k,$={}){const j=$.flags!==!1?this._flags:{},S=$.messages?i.merge(this._definition.messages,$.messages):this._definition.messages;return new t.Report(u,h,p,j,S,w,k)}$_getFlag(u){return this._flags[u]}$_getRule(u){return this._singleRules.get(u)}$_mapLabels(u){return u=Array.isArray(u)?u:u.split("."),this._ids.labels(u)}$_match(u,h,p,w){(p=Object.assign({},p)).abortEarly=!0,p._externals=!1,h.snapshot();const k=!d.validate(u,this,h,p,w).errors;return h.restore(),k}$_modify(u){return s.assertOptions(u,["each","once","ref","schema"]),o.schema(this,u)||this}$_mutateRebuild(){return l(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(u,{source:h,name:p,path:w,key:k})=>{const $=this._definition[h][p]&&this._definition[h][p].register;$!==!1&&this.$_mutateRegister(u,{family:$,key:k})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(u,{family:h,key:p}={}){this._refs.register(u,h),this._ids.register(u,{key:p})}$_property(u){return this._definition.properties[u]}$_reach(u){return this._ids.reach(u)}$_rootReferences(){return this._refs.roots()}$_setFlag(u,h,p={}){l(u[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const w=this._definition.flags[u]||{};if(g(h,w.default)&&(h=void 0),g(h,this._flags[u]))return this;const k=p.clone!==!1?this.clone():this;return h!==void 0?(k._flags[u]=h,k.$_mutateRegister(h)):delete k._flags[u],u[0]!=="_"&&(k.$_temp.ruleset=!1),k}$_parent(u,...h){return this[u][s.symbols.parent].call(this,...h)}$_validate(u,h,p){return d.validate(u,this,h,p)}_assign(u){u.type=this.type,u.$_root=this.$_root,u.$_temp=Object.assign({},this.$_temp),u.$_temp.whens={},u._ids=this._ids.clone(),u._preferences=this._preferences,u._valids=this._valids&&this._valids.clone(),u._invalids=this._invalids&&this._invalids.clone(),u._rules=this._rules.slice(),u._singleRules=b(this._singleRules,{shallow:!0}),u._refs=this._refs.clone(),u._flags=Object.assign({},this._flags),u._cache=null,u.$_terms={};for(const h in this.$_terms)u.$_terms[h]=this.$_terms[h]?this.$_terms[h].slice():null;u.$_super={};for(const h in this.$_super)u.$_super[h]=this._super[h].bind(u);return u}_bare(){const u=this.clone();u._reset();const h=u._definition.terms;for(const p in h){const w=h[p];u.$_terms[p]=w.init}return u.$_mutateRebuild()}_default(u,h,p={}){return s.assertOptions(p,"literal"),l(h!==void 0,"Missing",u,"value"),l(typeof h=="function"||!p.literal,"Only function value supports literal option"),typeof h=="function"&&p.literal&&(h={[s.symbols.literal]:!0,literal:h}),this.$_setFlag(u,h)}_generate(u,h,p){if(!this.$_terms.whens)return{schema:this};const w=[],k=[];for(let S=0;SV)break}const $=k.join(", ");if(h.mainstay.tracer.debug(h,"rule","when",$),!$)return{schema:this};if(!h.mainstay.tracer.active&&this.$_temp.whens[$])return{schema:this.$_temp.whens[$],id:$};let j=this;this._definition.generate&&(j=this._definition.generate(this,u,h,p));for(const S of w)j=j.concat(S);return this.$_root._tracer&&this.$_root._tracer._combine(j,[this,...w]),this.$_temp.whens[$]=j,{schema:j,id:$}}_inner(u,h,p={}){l(!this._inRuleset(),`Cannot set ${u} inside a ruleset`);const w=this.clone();return w.$_terms[u]&&!p.override||(w.$_terms[u]=[]),p.single?w.$_terms[u].push(h):w.$_terms[u].push(...h),w.$_temp.ruleset=!1,w}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(u,h={}){if(!this._singleRules.has(u))return this;const p=h.clone!==!1?this.clone():this;p._singleRules.delete(u);const w=[];for(let k=0;k{const l=y(375),b=y(8571),g=y(8160),m={max:1e3,supported:new Set(["undefined","boolean","number","string"])};x.provider={provision:r=>new m.Cache(r)},m.Cache=class{constructor(r={}){g.assertOptions(r,["max"]),l(r.max===void 0||r.max&&r.max>0&&isFinite(r.max),"Invalid max cache size"),this._max=r.max||m.max,this._map=new Map,this._list=new m.List}get length(){return this._map.size}set(r,s){if(r!==null&&!m.supported.has(typeof r))return;let n=this._map.get(r);if(n)return n.value=s,void this._list.first(n);n=this._list.unshift({key:r,value:s}),this._map.set(r,n),this._compact()}get(r){const s=this._map.get(r);if(s)return this._list.first(s),b(s.value)}_compact(){if(this._map.size>this._max){const r=this._list.pop();this._map.delete(r.key)}}},m.List=class{constructor(){this.tail=null,this.head=null}unshift(r){return r.next=null,r.prev=this.head,this.head&&(this.head.next=r),this.head=r,this.tail||(this.tail=r),r}first(r){r!==this.head&&(this._remove(r),this.unshift(r))}pop(){return this._remove(this.tail)}_remove(r){const{next:s,prev:n}=r;return s.prev=n,n&&(n.next=s),r===this.tail&&(this.tail=s),r.prev=null,r.next=null,r}}},8160:(R,x,y)=>{const l=y(375),b=y(7916),g=y(5934);let m,r;const s={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};x.version=g.version,x.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},x.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")},x.assertOptions=function(n,t,e="Options"){l(n&&typeof n=="object"&&!Array.isArray(n),"Options must be of type object");const a=Object.keys(n).filter(i=>!t.includes(i));l(a.length===0,`${e} contain unknown keys: ${a}`)},x.checkPreferences=function(n){r=r||y(3378);const t=r.preferences.validate(n);if(t.error)throw new b([t.error.details[0].message])},x.compare=function(n,t,e){switch(e){case"=":return n===t;case">":return n>t;case"<":return n=":return n>=t;case"<=":return n<=t}},x.default=function(n,t){return n===void 0?t:n},x.isIsoDate=function(n){return s.isoDate.test(n)},x.isNumber=function(n){return typeof n=="number"&&!isNaN(n)},x.isResolvable=function(n){return!!n&&(n[x.symbols.ref]||n[x.symbols.template])},x.isSchema=function(n,t={}){const e=n&&n[x.symbols.any];return!!e&&(l(t.legacy||e.version===x.version,"Cannot mix different versions of joi schemas"),!0)},x.isValues=function(n){return n[x.symbols.values]},x.limit=function(n){return Number.isSafeInteger(n)&&n>=0},x.preferences=function(n,t){m=m||y(6914),n=n||{},t=t||{};const e=Object.assign({},n,t);return t.errors&&n.errors&&(e.errors=Object.assign({},n.errors,t.errors),e.errors.wrap=Object.assign({},n.errors.wrap,t.errors.wrap)),t.messages&&(e.messages=m.compile(t.messages,n.messages)),delete e[x.symbols.prefs],e},x.tryWithPath=function(n,t,e={}){try{return n()}catch(a){throw a.path!==void 0?a.path=t+"."+a.path:a.path=t,e.append&&(a.message=`${a.message} (${a.path})`),a}},x.validateArg=function(n,t,{assert:e,message:a}){if(x.isSchema(e)){const i=e.validate(n);return i.error?i.error.message:void 0}if(!e(n))return t?`${t} ${a}`:a},x.verifyFlat=function(n,t){for(const e of n)l(!Array.isArray(e),"Method no longer accepts array arguments:",t)}},3292:(R,x,y)=>{const l=y(375),b=y(8160),g=y(6133),m={};x.schema=function(r,s,n={}){b.assertOptions(n,["appendPath","override"]);try{return m.schema(r,s,n)}catch(t){throw n.appendPath&&t.path!==void 0&&(t.message=`${t.message} (${t.path})`),t}},m.schema=function(r,s,n){l(s!==void 0,"Invalid undefined schema"),Array.isArray(s)&&(l(s.length,"Invalid empty array schema"),s.length===1&&(s=s[0]));const t=(e,...a)=>n.override!==!1?e.valid(r.override,...a):e.valid(...a);if(m.simple(s))return t(r,s);if(typeof s=="function")return r.custom(s);if(l(typeof s=="object","Invalid schema content:",typeof s),b.isResolvable(s))return t(r,s);if(b.isSchema(s))return s;if(Array.isArray(s)){for(const e of s)if(!m.simple(e))return r.alternatives().try(...s);return t(r,...s)}return s instanceof RegExp?r.string().regex(s):s instanceof Date?t(r.date(),s):(l(Object.getPrototypeOf(s)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),r.object().keys(s))},x.ref=function(r,s){return g.isRef(r)?r:g.create(r,s)},x.compile=function(r,s,n={}){b.assertOptions(n,["legacy"]);const t=s&&s[b.symbols.any];if(t)return l(n.legacy||t.version===b.version,"Cannot mix different versions of joi schemas:",t.version,b.version),s;if(typeof s!="object"||!n.legacy)return x.schema(r,s,{appendPath:!0});const e=m.walk(s);return e?e.compile(e.root,s):x.schema(r,s,{appendPath:!0})},m.walk=function(r){if(typeof r!="object")return null;if(Array.isArray(r)){for(const n of r){const t=m.walk(n);if(t)return t}return null}const s=r[b.symbols.any];if(s)return{root:r[s.root],compile:s.compile};l(Object.getPrototypeOf(r)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const n in r){const t=m.walk(r[n]);if(t)return t}return null},m.simple=function(r){return r===null||["boolean","string","number"].includes(typeof r)},x.when=function(r,s,n){if(n===void 0&&(l(s&&typeof s=="object","Missing options"),n=s,s=g.create(".")),Array.isArray(n)&&(n={switch:n}),b.assertOptions(n,["is","not","then","otherwise","switch","break"]),b.isSchema(s))return l(n.is===void 0,'"is" can not be used with a schema condition'),l(n.not===void 0,'"not" can not be used with a schema condition'),l(n.switch===void 0,'"switch" can not be used with a schema condition'),m.condition(r,{is:s,then:n.then,otherwise:n.otherwise,break:n.break});if(l(g.isRef(s)||typeof s=="string","Invalid condition:",s),l(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let e=n;n.not!==void 0&&(e={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let a=e.is!==void 0?r.$_compile(e.is):r.$_root.invalid(null,!1,0,"").required();return l(e.then!==void 0||e.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),l(e.break===void 0||e.then===void 0||e.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is===void 0||g.isRef(n.is)||b.isSchema(n.is)||(a=a.required()),m.condition(r,{ref:x.ref(s),is:a,then:e.then,otherwise:e.otherwise,break:e.break})}l(Array.isArray(n.switch),'"switch" must be an array'),l(n.is===void 0,'Cannot combine "switch" with "is"'),l(n.not===void 0,'Cannot combine "switch" with "not"'),l(n.then===void 0,'Cannot combine "switch" with "then"');const t={ref:x.ref(s),switch:[],break:n.break};for(let e=0;e{const l=y(5688),b=y(8160),g=y(3328);x.Report=class{constructor(m,r,s,n,t,e,a){if(this.code=m,this.flags=n,this.messages=t,this.path=e.path,this.prefs=a,this.state=e,this.value=r,this.message=null,this.template=null,this.local=s||{},this.local.label=x.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const i=this.path[this.path.length-1];typeof i!="object"&&(this.local.key=i)}}_setTemplate(m){if(this.template=m,!this.flags.label&&this.path.length===0){const r=this._template(this.template,"root");r&&(this.local.label=r)}}toString(){if(this.message)return this.message;const m=this.code;if(!this.prefs.errors.render)return this.code;const r=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return r===void 0?`Error code "${m}" is not defined, your custom type is missing the correct messages definition`:(this.message=r.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(m,r){return x.template(this.value,m,r||this.code,this.state,this.prefs)}},x.path=function(m){let r="";for(const s of m)typeof s!="object"&&(typeof s=="string"?(r&&(r+="."),r+=s):r+=`[${s}]`);return r},x.template=function(m,r,s,n,t){if(!r)return;if(g.isTemplate(r))return s!=="root"?r:null;let e=t.errors.language;if(b.isResolvable(e)&&(e=e.resolve(m,n,t)),e&&r[e]){if(r[e][s]!==void 0)return r[e][s];if(r[e]["*"]!==void 0)return r[e]["*"]}return r[s]?r[s]:r["*"]},x.label=function(m,r,s,n){if(m.label)return m.label;if(!s.errors.label)return"";let t=r.path;return s.errors.label==="key"&&r.path.length>1&&(t=r.path.slice(-1)),x.path(t)||x.template(null,s.messages,"root",r,s)||n&&x.template(null,n,"root",r,s)||"value"},x.process=function(m,r,s){if(!m)return null;const{override:n,message:t,details:e}=x.details(m);if(n)return n;if(s.errors.stack)return new x.ValidationError(t,e,r);const a=Error.stackTraceLimit;Error.stackTraceLimit=0;const i=new x.ValidationError(t,e,r);return Error.stackTraceLimit=a,i},x.details=function(m,r={}){let s=[];const n=[];for(const t of m){if(t instanceof Error){if(r.override!==!1)return{override:t};const a=t.toString();s.push(a),n.push({message:a,type:"override",context:{error:t}});continue}const e=t.toString();s.push(e),n.push({message:e,path:t.path.filter(a=>typeof a!="object"),type:t.code,context:t.local})}return s.length>1&&(s=[...new Set(s)]),{message:s.join(". "),details:n}},x.ValidationError=class extends Error{constructor(m,r,s){super(m),this._original=s,this.details=r}static isError(m){return m instanceof x.ValidationError}},x.ValidationError.prototype.isJoi=!0,x.ValidationError.prototype.name="ValidationError",x.ValidationError.prototype.annotate=l.error},8901:(R,x,y)=>{const l=y(375),b=y(8571),g=y(8160),m=y(6914),r={};x.type=function(s,n){const t=Object.getPrototypeOf(s),e=b(t),a=s._assign(Object.create(e)),i=Object.assign({},n);delete i.base,e._definition=i;const o=t._definition||{};i.messages=m.merge(o.messages,i.messages),i.properties=Object.assign({},o.properties,i.properties),a.type=i.type,i.flags=Object.assign({},o.flags,i.flags);const c=Object.assign({},o.terms);if(i.terms)for(const v in i.terms){const u=i.terms[v];l(a.$_terms[v]===void 0,"Invalid term override for",i.type,v),a.$_terms[v]=u.init,c[v]=u}i.terms=c,i.args||(i.args=o.args),i.prepare=r.prepare(i.prepare,o.prepare),i.coerce&&(typeof i.coerce=="function"&&(i.coerce={method:i.coerce}),i.coerce.from&&!Array.isArray(i.coerce.from)&&(i.coerce={method:i.coerce.method,from:[].concat(i.coerce.from)})),i.coerce=r.coerce(i.coerce,o.coerce),i.validate=r.validate(i.validate,o.validate);const f=Object.assign({},o.rules);if(i.rules)for(const v in i.rules){const u=i.rules[v];l(typeof u=="object","Invalid rule definition for",i.type,v);let h=u.method;if(h===void 0&&(h=function(){return this.$_addRule(v)}),h&&(l(!e[v],"Rule conflict in",i.type,v),e[v]=h),l(!f[v],"Rule conflict in",i.type,v),f[v]=u,u.alias){const p=[].concat(u.alias);for(const w of p)e[w]=u.method}u.args&&(u.argsByName=new Map,u.args=u.args.map(p=>(typeof p=="string"&&(p={name:p}),l(!u.argsByName.has(p.name),"Duplicated argument name",p.name),g.isSchema(p.assert)&&(p.assert=p.assert.strict().label(p.name)),u.argsByName.set(p.name,p),p)))}i.rules=f;const d=Object.assign({},o.modifiers);if(i.modifiers)for(const v in i.modifiers){l(!e[v],"Rule conflict in",i.type,v);const u=i.modifiers[v];l(typeof u=="function","Invalid modifier definition for",i.type,v);const h=function(p){return this.rule({[v]:p})};e[v]=h,d[v]=u}if(i.modifiers=d,i.overrides){e._super=t,a.$_super={};for(const v in i.overrides)l(t[v],"Cannot override missing",v),i.overrides[v][g.symbols.parent]=t[v],a.$_super[v]=t[v].bind(a);Object.assign(e,i.overrides)}i.cast=Object.assign({},o.cast,i.cast);const _=Object.assign({},o.manifest,i.manifest);return _.build=r.build(i.manifest&&i.manifest.build,o.manifest&&o.manifest.build),i.manifest=_,i.rebuild=r.rebuild(i.rebuild,o.rebuild),a},r.build=function(s,n){return s&&n?function(t,e){return n(s(t,e),e)}:s||n},r.coerce=function(s,n){return s&&n?{from:s.from&&n.from?[...new Set([...s.from,...n.from])]:null,method(t,e){let a;if((!n.from||n.from.includes(typeof t))&&(a=n.method(t,e),a)){if(a.errors||a.value===void 0)return a;t=a.value}if(!s.from||s.from.includes(typeof t)){const i=s.method(t,e);if(i)return i}return a}}:s||n},r.prepare=function(s,n){return s&&n?function(t,e){const a=s(t,e);if(a){if(a.errors||a.value===void 0)return a;t=a.value}return n(t,e)||a}:s||n},r.rebuild=function(s,n){return s&&n?function(t){n(t),s(t)}:s||n},r.validate=function(s,n){return s&&n?function(t,e){const a=n(t,e);if(a){if(a.errors&&(!Array.isArray(a.errors)||a.errors.length))return a;t=a.value}return s(t,e)||a}:s||n}},5107:(R,x,y)=>{const l=y(375),b=y(8571),g=y(8652),m=y(8160),r=y(3292),s=y(6354),n=y(8901),t=y(9708),e=y(6133),a=y(3328),i=y(1152);let o;const c={types:{alternatives:y(4946),any:y(8068),array:y(546),boolean:y(4937),date:y(7500),function:y(390),link:y(8785),number:y(3832),object:y(8966),string:y(7417),symbol:y(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const f={_types:new Set(Object.keys(c.types))};for(const d of f._types)f[d]=function(..._){return l(!_.length||["alternatives","link","object"].includes(d),"The",d,"type does not allow arguments"),c.generate(this,c.types[d],_)};for(const d of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])f[d]=function(..._){return this.any()[d](..._)};Object.assign(f,c.methods);for(const d in c.aliases){const _=c.aliases[d];f[d]=f[_]}return f.x=f.expression,i.setup&&i.setup(f),f}};c.methods={ValidationError:s.ValidationError,version:m.version,cache:g.provider,assert(f,d,..._){c.assert(f,d,!0,_)},attempt:(f,d,..._)=>c.assert(f,d,!1,_),build(f){return l(typeof t.build=="function","Manifest functionality disabled"),t.build(this,f)},checkPreferences(f){m.checkPreferences(f)},compile(f,d){return r.compile(this,f,d)},defaults(f){l(typeof f=="function","modifier must be a function");const d=Object.assign({},this);for(const _ of d._types){const v=f(d[_]());l(m.isSchema(v),"modifier must return a valid schema object"),d[_]=function(...u){return c.generate(this,v,u)}}return d},expression:(...f)=>new a(...f),extend(...f){m.verifyFlat(f,"extend"),o=o||y(3378),l(f.length,"You need to provide at least one extension"),this.assert(f,o.extensions);const d=Object.assign({},this);d._types=new Set(d._types);for(let _ of f){typeof _=="function"&&(_=_(d)),this.assert(_,o.extension);const v=c.expandExtension(_,d);for(const u of v){l(d[u.type]===void 0||d._types.has(u.type),"Cannot override name",u.type);const h=u.base||this.any(),p=n.type(h,u);d._types.add(u.type),d[u.type]=function(...w){return c.generate(this,p,w)}}}return d},isError:s.ValidationError.isError,isExpression:a.isTemplate,isRef:e.isRef,isSchema:m.isSchema,in:(...f)=>e.in(...f),override:m.symbols.override,ref:(...f)=>e.create(...f),types(){const f={};for(const d of this._types)f[d]=this[d]();for(const d in c.aliases)f[d]=this[d]();return f}},c.assert=function(f,d,_,v){const u=v[0]instanceof Error||typeof v[0]=="string"?v[0]:null,h=u!==null?v[1]:v[0],p=d.validate(f,m.preferences({errors:{stack:!0}},h||{}));let w=p.error;if(!w)return p.value;if(u instanceof Error)throw u;const k=_&&typeof w.annotate=="function"?w.annotate():w.message;throw w instanceof s.ValidationError==0&&(w=b(w)),w.message=u?`${u} ${k}`:k,w},c.generate=function(f,d,_){return l(f,"Must be invoked on a Joi instance."),d.$_root=f,d._definition.args&&_.length?d._definition.args(d,..._):d},c.expandExtension=function(f,d){if(typeof f.type=="string")return[f];const _=[];for(const v of d._types)if(f.type.test(v)){const u=Object.assign({},f);u.type=v,u.base=d[v](),_.push(u)}return _},R.exports=c.root()},6914:(R,x,y)=>{const l=y(375),b=y(8571),g=y(3328);x.compile=function(m,r){if(typeof m=="string")return l(!r,"Cannot set single message string"),new g(m);if(g.isTemplate(m))return l(!r,"Cannot set single message template"),m;l(typeof m=="object"&&!Array.isArray(m),"Invalid message options"),r=r?b(r):{};for(let s in m){const n=m[s];if(s==="root"||g.isTemplate(n)){r[s]=n;continue}if(typeof n=="string"){r[s]=new g(n);continue}l(typeof n=="object"&&!Array.isArray(n),"Invalid message for",s);const t=s;for(s in r[t]=r[t]||{},n){const e=n[s];s==="root"||g.isTemplate(e)?r[t][s]=e:(l(typeof e=="string","Invalid message for",s,"in",t),r[t][s]=new g(e))}}return r},x.decompile=function(m){const r={};for(let s in m){const n=m[s];if(s==="root"){r.root=n;continue}if(g.isTemplate(n)){r[s]=n.describe({compact:!0});continue}const t=s;for(s in r[t]={},n){const e=n[s];s!=="root"?r[t][s]=e.describe({compact:!0}):r[t].root=e}}return r},x.merge=function(m,r){if(!m)return x.compile(r);if(!r)return m;if(typeof r=="string")return new g(r);if(g.isTemplate(r))return r;const s=b(m);for(let n in r){const t=r[n];if(n==="root"||g.isTemplate(t)){s[n]=t;continue}if(typeof t=="string"){s[n]=new g(t);continue}l(typeof t=="object"&&!Array.isArray(t),"Invalid message for",n);const e=n;for(n in s[e]=s[e]||{},t){const a=t[n];n==="root"||g.isTemplate(a)?s[e][n]=a:(l(typeof a=="string","Invalid message for",n,"in",e),s[e][n]=new g(a))}}return s}},2294:(R,x,y)=>{const l=y(375),b=y(8160),g=y(6133),m={};x.Ids=m.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const r=new m.Ids;return r._byId=new Map(this._byId),r._byKey=new Map(this._byKey),r._schemaChain=this._schemaChain,r}concat(r){r._schemaChain&&(this._schemaChain=!0);for(const[s,n]of r._byId.entries())l(!this._byKey.has(s),"Schema id conflicts with existing key:",s),this._byId.set(s,n);for(const[s,n]of r._byKey.entries())l(!this._byId.has(s),"Schema key conflicts with existing id:",s),this._byKey.set(s,n)}fork(r,s,n){const t=this._collect(r);t.push({schema:n});const e=t.shift();let a={id:e.id,schema:s(e.schema)};l(b.isSchema(a.schema),"adjuster function failed to return a joi schema type");for(const i of t)a={id:i.id,schema:m.fork(i.schema,a.id,a.schema)};return a.schema}labels(r,s=[]){const n=r[0],t=this._get(n);if(!t)return[...s,...r].join(".");const e=r.slice(1);return s=[...s,t.schema._flags.label||n],e.length?t.schema._ids.labels(e,s):s.join(".")}reach(r,s=[]){const n=r[0],t=this._get(n);l(t,"Schema does not contain path",[...s,...r].join("."));const e=r.slice(1);return e.length?t.schema._ids.reach(e,[...s,n]):t.schema}register(r,{key:s}={}){if(!r||!b.isSchema(r))return;(r.$_property("schemaChain")||r._ids._schemaChain)&&(this._schemaChain=!0);const n=r._flags.id;if(n){const t=this._byId.get(n);l(!t||t.schema===r,"Cannot add different schemas with the same id:",n),l(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:r,id:n})}s&&(l(!this._byKey.has(s),"Schema already contains key:",s),l(!this._byId.has(s),"Schema key conflicts with existing id:",s),this._byKey.set(s,{schema:r,id:s}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(r,s=[],n=[]){const t=r[0],e=this._get(t);l(e,"Schema does not contain path",[...s,...r].join(".")),n=[e,...n];const a=r.slice(1);return a.length?e.schema._ids._collect(a,[...s,t],n):n}_get(r){return this._byId.get(r)||this._byKey.get(r)}},m.fork=function(r,s,n){const t=x.schema(r,{each:(e,{key:a})=>{if(s===(e._flags.id||a))return n},ref:!1});return t?t.$_mutateRebuild():r},x.schema=function(r,s){let n;for(const t in r._flags){if(t[0]==="_")continue;const e=m.scan(r._flags[t],{source:"flags",name:t},s);e!==void 0&&(n=n||r.clone(),n._flags[t]=e)}for(let t=0;t{const l=y(375),b=y(8571),g=y(9621),m=y(8160);let r;const s={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};x.create=function(n,t={}){l(typeof n=="string","Invalid reference key:",n),m.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),l(!t.prefix||typeof t.prefix=="object","options.prefix must be of type object");const e=Object.assign({},s.defaults,t);delete e.prefix;const a=e.separator,i=s.context(n,a,t.prefix);if(e.type=i.type,n=i.key,e.type==="value")if(i.root&&(l(!a||n[0]!==a,"Cannot specify relative path with root prefix"),e.ancestor="root",n||(n=null)),a&&a===n)n=null,e.ancestor=0;else if(e.ancestor!==void 0)l(!a||!n||n[0]!==a,"Cannot combine prefix with ancestor option");else{const[o,c]=s.ancestor(n,a);c&&(n=n.slice(c))===""&&(n=null),e.ancestor=o}return e.path=a?n===null?[]:n.split(a):[n],new s.Ref(e)},x.in=function(n,t={}){return x.create(n,{...t,in:!0})},x.isRef=function(n){return!!n&&!!n[m.symbols.ref]},s.Ref=class{constructor(n){l(typeof n=="object","Invalid reference construction"),m.assertOptions(n,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),l([!1,void 0].includes(n.separator)||typeof n.separator=="string"&&n.separator.length===1,"Invalid separator"),l(!n.adjust||typeof n.adjust=="function","options.adjust must be a function"),l(!n.map||Array.isArray(n.map),"options.map must be an array"),l(!n.map||!n.adjust,"Cannot set both map and adjust options"),Object.assign(this,s.defaults,n),l(this.type==="value"||this.ancestor===void 0,"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(n,t,e,a,i={}){return l(!this.in||i.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(e.context,t,i):this.type==="local"?this._resolve(a,t,i):this.ancestor?this.ancestor==="root"?this._resolve(t.ancestors[t.ancestors.length-1],t,i):(l(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,i)):this._resolve(n,t,i)}_resolve(n,t,e){let a;if(this.type==="value"&&t.mainstay.shadow&&e.shadow!==!1&&(a=t.mainstay.shadow.get(this.absolute(t))),a===void 0&&(a=g(n,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(a=this.adjust(a)),this.map){const i=this.map.get(a);i!==void 0&&(a=i)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,a),a}toString(){return this.display}absolute(n){return[...n.path.slice(0,-this.ancestor),...this.path]}clone(){return new s.Ref(this)}describe(){const n={path:this.path};this.type!=="value"&&(n.type=this.type),this.separator!=="."&&(n.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(n.ancestor=this.ancestor),this.map&&(n.map=[...this.map]);for(const t of["adjust","iterables","render"])this[t]!==null&&this[t]!==void 0&&(n[t]=this[t]);return this.in!==!1&&(n.in=!0),{ref:n}}updateDisplay(){const n=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${n}`);if(!this.separator)return void(this.display=`ref:${n}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${n}`);if(this.ancestor==="root")return void(this.display=`ref:root:${n}`);if(this.ancestor===1)return void(this.display=`ref:${n||".."}`);const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${n||""}`}},s.Ref.prototype[m.symbols.ref]=!0,x.build=function(n){return(n=Object.assign({},s.defaults,n)).type==="value"&&n.ancestor===void 0&&(n.ancestor=1),new s.Ref(n)},s.context=function(n,t,e={}){if(n=n.trim(),e){const a=e.global===void 0?"$":e.global;if(a!==t&&n.startsWith(a))return{key:n.slice(a.length),type:"global"};const i=e.local===void 0?"#":e.local;if(i!==t&&n.startsWith(i))return{key:n.slice(i.length),type:"local"};const o=e.root===void 0?"/":e.root;if(o!==t&&n.startsWith(o))return{key:n.slice(o.length),type:"value",root:!0}}return{key:n,type:"value"}},s.ancestor=function(n,t){if(!t)return[1,0];if(n[0]!==t)return[1,0];if(n[1]!==t)return[0,1];let e=2;for(;n[e]===t;)++e;return[e-1,e]},x.toSibling=0,x.toParent=1,x.Manager=class{constructor(){this.refs=[]}register(n,t){if(n)if(t=t===void 0?x.toParent:t,Array.isArray(n))for(const e of n)this.register(e,t);else if(m.isSchema(n))for(const e of n._refs.refs)e.ancestor-t>=0&&this.refs.push({ancestor:e.ancestor-t,root:e.root});else x.isRef(n)&&n.type==="value"&&n.ancestor-t>=0&&this.refs.push({ancestor:n.ancestor-t,root:n.root}),r=r||y(3328),r.isTemplate(n)&&this.register(n.refs(),t)}get length(){return this.refs.length}clone(){const n=new x.Manager;return n.refs=b(this.refs),n}reset(){this.refs=[]}roots(){return this.refs.filter(n=>!n.ancestor).map(n=>n.root)}}},3378:(R,x,y)=>{const l=y(5107),b={};b.wrap=l.string().min(1).max(2).allow(!1),x.preferences=l.object({allowUnknown:l.boolean(),abortEarly:l.boolean(),artifacts:l.boolean(),cache:l.boolean(),context:l.object(),convert:l.boolean(),dateFormat:l.valid("date","iso","string","time","utc"),debug:l.boolean(),errors:{escapeHtml:l.boolean(),label:l.valid("path","key",!1),language:[l.string(),l.object().ref()],render:l.boolean(),stack:l.boolean(),wrap:{label:b.wrap,array:b.wrap,string:b.wrap}},externals:l.boolean(),messages:l.object(),noDefaults:l.boolean(),nonEnumerables:l.boolean(),presence:l.valid("required","optional","forbidden"),skipFunctions:l.boolean(),stripUnknown:l.object({arrays:l.boolean(),objects:l.boolean()}).or("arrays","objects").allow(!0,!1),warnings:l.boolean()}).strict(),b.nameRx=/^[a-zA-Z0-9]\w*$/,b.rule=l.object({alias:l.array().items(l.string().pattern(b.nameRx)).single(),args:l.array().items(l.string(),l.object({name:l.string().pattern(b.nameRx).required(),ref:l.boolean(),assert:l.alternatives([l.function(),l.object().schema()]).conditional("ref",{is:!0,then:l.required()}),normalize:l.function(),message:l.string().when("assert",{is:l.function(),then:l.required()})})),convert:l.boolean(),manifest:l.boolean(),method:l.function().allow(!1),multi:l.boolean(),validate:l.function()}),x.extension=l.object({type:l.alternatives([l.string(),l.object().regex()]).required(),args:l.function(),cast:l.object().pattern(b.nameRx,l.object({from:l.function().maxArity(1).required(),to:l.function().minArity(1).maxArity(2).required()})),base:l.object().schema().when("type",{is:l.object().regex(),then:l.forbidden()}),coerce:[l.function().maxArity(3),l.object({method:l.function().maxArity(3).required(),from:l.array().items(l.string()).single()})],flags:l.object().pattern(b.nameRx,l.object({setter:l.string(),default:l.any()})),manifest:{build:l.function().arity(2)},messages:[l.object(),l.string()],modifiers:l.object().pattern(b.nameRx,l.function().minArity(1).maxArity(2)),overrides:l.object().pattern(b.nameRx,l.function()),prepare:l.function().maxArity(3),rebuild:l.function().arity(1),rules:l.object().pattern(b.nameRx,b.rule),terms:l.object().pattern(b.nameRx,l.object({init:l.array().allow(null).required(),manifest:l.object().pattern(/.+/,[l.valid("schema","single"),l.object({mapped:l.object({from:l.string().required(),to:l.string().required()}).required()})])})),validate:l.function().maxArity(3)}).strict(),x.extensions=l.array().items(l.object(),l.function().arity(1)).strict(),b.desc={buffer:l.object({buffer:l.string()}),func:l.object({function:l.function().required(),options:{literal:!0}}),override:l.object({override:!0}),ref:l.object({ref:l.object({type:l.valid("value","global","local"),path:l.array().required(),separator:l.string().length(1).allow(!1),ancestor:l.number().min(0).integer().allow("root"),map:l.array().items(l.array().length(2)).min(1),adjust:l.function(),iterables:l.boolean(),in:l.boolean(),render:l.boolean()}).required()}),regex:l.object({regex:l.string().min(3)}),special:l.object({special:l.valid("deep").required()}),template:l.object({template:l.string().required(),options:l.object()}),value:l.object({value:l.alternatives([l.object(),l.array()]).required()})},b.desc.entity=l.alternatives([l.array().items(l.link("...")),l.boolean(),l.function(),l.number(),l.string(),b.desc.buffer,b.desc.func,b.desc.ref,b.desc.regex,b.desc.special,b.desc.template,b.desc.value,l.link("/")]),b.desc.values=l.array().items(null,l.boolean(),l.function(),l.number().allow(1/0,-1/0),l.string().allow(""),l.symbol(),b.desc.buffer,b.desc.func,b.desc.override,b.desc.ref,b.desc.regex,b.desc.template,b.desc.value),b.desc.messages=l.object().pattern(/.+/,[l.string(),b.desc.template,l.object().pattern(/.+/,[l.string(),b.desc.template])]),x.description=l.object({type:l.string().required(),flags:l.object({cast:l.string(),default:l.any(),description:l.string(),empty:l.link("/"),failover:b.desc.entity,id:l.string(),label:l.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:l.boolean(),unit:l.string()}).unknown(),preferences:{allowUnknown:l.boolean(),abortEarly:l.boolean(),artifacts:l.boolean(),cache:l.boolean(),convert:l.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:l.boolean(),label:["path","key"],language:[l.string(),b.desc.ref],wrap:{label:b.wrap,array:b.wrap}},externals:l.boolean(),messages:b.desc.messages,noDefaults:l.boolean(),nonEnumerables:l.boolean(),presence:["required","optional","forbidden"],skipFunctions:l.boolean(),stripUnknown:l.object({arrays:l.boolean(),objects:l.boolean()}).or("arrays","objects").allow(!0,!1),warnings:l.boolean()},allow:b.desc.values,invalid:b.desc.values,rules:l.array().min(1).items({name:l.string().required(),args:l.object().min(1),keep:l.boolean(),message:[l.string(),b.desc.messages],warn:l.boolean()}),keys:l.object().pattern(/.*/,l.link("/")),link:b.desc.ref}).pattern(/^[a-z]\w*$/,l.any())},493:(R,x,y)=>{const l=y(8571),b=y(9621),g=y(8160),m={value:Symbol("value")};R.exports=m.State=class{constructor(r,s,n){this.path=r,this.ancestors=s,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(r,s=null,n=null){const t=new m.State(r,s,this);return n&&t.schemas&&(t.schemas=[m.schemas(n),...t.schemas]),t}nest(r,s){const n=new m.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[m.schemas(r),...n.schemas],n.debug=s,n}shadow(r,s){this.mainstay.shadow=this.mainstay.shadow||new m.Shadow,this.mainstay.shadow.set(this.path,r,s)}snapshot(){this.mainstay.shadow&&(this._snapshot=l(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()}},m.schemas=function(r){return g.isSchema(r)?{schema:r}:r},m.Shadow=class{constructor(){this._values=null}set(r,s,n){if(!r.length||n==="strip"&&typeof r[r.length-1]=="number")return;this._values=this._values||new Map;let t=this._values;for(let e=0;e{const l=y(375),b=y(8571),g=y(5277),m=y(1447),r=y(8160),s=y(6354),n=y(6133),t={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};R.exports=t.Template=class{constructor(e,a){if(l(typeof e=="string","Template source must be a string"),l(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,a){const{functions:i,...o}=a;this._settings=Object.keys(o).length?b(o):void 0,this._functions=i,this._functions&&(l(Object.keys(this._functions).every(c=>typeof c=="string"),"Functions keys must be strings"),l(Object.values(this._functions).every(c=>typeof c=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const e=t.encode(this.source),a=t.split(e);let i=!1;const o=[],c=a.shift();c&&o.push(c);for(const f of a){const d=f[0]!=="{",_=d?"}":"}}",v=f.indexOf(_);if(v===-1||f[1]==="{"){o.push(`{${t.decode(f)}`);continue}let u=f.slice(d?0:1,v);const h=u[0]===":";h&&(u=u.slice(1));const p=this._ref(t.decode(u),{raw:d,wrapped:h});o.push(p),typeof p!="string"&&(i=!0);const w=f.slice(v+_.length);w&&o.push(t.decode(w))}i?this._template=o:this.rendered=o.join("")}static date(e,a){return t.dateFormat[a.dateFormat].call(e)}describe(e={}){if(!this._settings&&e.compact)return this.source;const a={template:this.source};return this._settings&&(a.options=this._settings),this._functions&&(a.functions=this._functions),a}static build(e){return new t.Template(e.template,e.options||e.functions?{...e.options,functions:e.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[r.symbols.template]}refs(){if(!this._template)return;const e=[];for(const a of this._template)typeof a!="string"&&e.push(...a.refs);return e}resolve(e,a,i,o){return this._template&&this._template.length===1?this._part(this._template[0],e,a,i,o,{}):this.render(e,a,i,o)}_part(e,...a){return e.ref?e.ref.resolve(...a):e.formula.evaluate(a)}render(e,a,i,o,c={}){if(!this.isDynamic())return this.rendered;const f=[];for(const d of this._template)if(typeof d=="string")f.push(d);else{const _=this._part(d,e,a,i,o,c),v=t.stringify(_,e,a,i,o,c);if(v!==void 0){const u=d.raw||(c.errors&&c.errors.escapeHtml)===!1?v:g(v);f.push(t.wrap(u,d.wrapped&&i.errors.wrap.label))}}return f.join("")}_ref(e,{raw:a,wrapped:i}){const o=[],c=d=>{const _=n.create(d,this._settings);return o.push(_),v=>{const u=_.resolve(...v);return u!==void 0?u:null}};try{const d=this._functions?{...t.functions,...this._functions}:t.functions;var f=new m.Parser(e,{reference:c,functions:d,constants:t.constants})}catch(d){throw d.message=`Invalid template variable "${e}" fails due to: ${d.message}`,d}if(f.single){if(f.single.type==="reference"){const d=o[0];return{ref:d,raw:a,refs:o,wrapped:i||d.type==="local"&&d.key==="label"}}return t.stringify(f.single.value)}return{formula:f,raw:a,refs:o}}toString(){return this.source}},t.Template.prototype[r.symbols.template]=!0,t.Template.prototype.isImmutable=!0,t.encode=function(e){return e.replace(/\\(\{+)/g,(a,i)=>t.opens.slice(0,i.length)).replace(/\\(\}+)/g,(a,i)=>t.closes.slice(0,i.length))},t.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},t.split=function(e){const a=[];let i="";for(let o=0;o ${w.toString()}`);e=h}if(!Array.isArray(e))return e.toString();const u=[];for(const h of e)u.push(t.stringify(h,a,i,o,c,{arrayItems:!0,...f}));return t.wrap(u.join(", "),!v&&_.array)},t.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},t.functions={if:(e,a,i)=>e?a:i,length:e=>typeof e=="string"?e.length:e&&typeof e=="object"?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){const[a,i,o,c,f]=this,d=f.messages;if(!d)return"";const _=s.template(a,d[0],e,i,o)||s.template(a,d[1],e,i,o);return _?_.render(a,i,o,c,f):""},number:e=>typeof e=="number"?e:typeof e=="string"?parseFloat(e):typeof e=="boolean"?e?1:0:e instanceof Date?e.getTime():null}},4946:(R,x,y)=>{const l=y(375),b=y(1687),g=y(8068),m=y(8160),r=y(3292),s=y(6354),n=y(6133),t={};R.exports=g.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:n.toSibling}},args:(e,...a)=>a.length===1&&Array.isArray(a[0])?e.try(...a[0]):e.try(...a),validate(e,a){const{schema:i,error:o,state:c,prefs:f}=a;if(i._flags.match){const _=[],v=[];for(let h=0;hs.details(h,{override:!1}))})};if(i._flags.match==="one")return _.length===1?{value:_[0]}:{errors:o("alternatives.one")};if(_.length!==i.$_terms.matches.length)return{errors:o("alternatives.all",{details:v.map(h=>s.details(h,{override:!1}))})};const u=h=>h.$_terms.matches.some(p=>p.schema.type==="object"||p.schema.type==="alternatives"&&u(p.schema));return u(i)?{value:_.reduce((h,p)=>b(h,p,{mergeArrays:!1}))}:{value:_[_.length-1]}}const d=[];for(let _=0;_i.path[0]!=="is"&&typeof a._flags.label!="string"?a.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:a=>{m.isSchema(a)&&a.type==="array"&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,a){if(a.matches)for(const i of a.matches){const{schema:o,ref:c,is:f,not:d,then:_,otherwise:v}=i;e=o?e.try(o):c?e.conditional(c,{is:f,then:_,not:d,otherwise:v,switch:i.switch}):e.conditional(f,{then:_,otherwise:v})}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}}"}}),t.errors=function(e,{error:a,state:i}){if(!e.length)return{errors:a("alternatives.any")};if(e.length===1)return{errors:e[0].reports};const o=new Set,c=[];for(const{reports:f,schema:d}of e){if(f.length>1)return t.unmatched(e,a);const _=f[0];if(_ instanceof s.Report==0)return t.unmatched(e,a);if(_.state.path.length!==i.path.length){c.push({type:d.type,report:_});continue}if(_.code==="any.only"){for(const h of _.local.valids)o.add(h);continue}const[v,u]=_.code.split(".");u==="base"?o.add(v):c.push({type:d.type,report:_})}return c.length?c.length===1?{errors:c[0].report}:t.unmatched(e,a):{errors:a("alternatives.types",{types:[...o]})}},t.unmatched=function(e,a){const i=[];for(const o of e)i.push(...o.reports);return{errors:a("alternatives.match",s.details(i,{override:!1}))}}},8068:(R,x,y)=>{const l=y(375),b=y(7629),g=y(8160),m=y(6914);R.exports=b.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(r,s){return l(typeof r=="function","Method must be a function"),l(s===void 0||s&&typeof s=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:r,description:s}})},validate(r,s,{method:n}){try{return n(r,s)}catch(t){return s.error("any.custom",{error:t})}},args:["method","description"],multi:!0},messages:{method(r){return this.prefs({messages:r})}},shared:{method(r){l(g.isSchema(r)&&r._flags.id,"Schema must be a schema with an id");const s=this.clone();return s.$_terms.shared=s.$_terms.shared||[],s.$_terms.shared.push(r),s.$_mutateRegister(r),s}},warning:{method(r,s){return l(r&&typeof r=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:r,local:s},warn:!0})},validate:(r,s,{code:n,local:t})=>s.error(n,t),args:["code","local"],multi:!0}},modifiers:{keep(r,s=!0){r.keep=s},message(r,s){r.message=m.compile(s)},warn(r,s=!0){r.warn=s}},manifest:{build(r,s){for(const n in s){const t=s[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const e of t)r=r[n.slice(0,-1)](e);else if(n!=="alterations")if(n!=="whens"){if(n==="shared")for(const e of t)r=r.shared(e)}else for(const e of t){const{ref:a,is:i,not:o,then:c,otherwise:f,concat:d}=e;r=d?r.concat(d):a?r.when(a,{is:i,not:o,then:c,otherwise:f,switch:e.switch,break:e.break}):r.when(i,{then:c,otherwise:f,break:e.break})}else{const e={};for(const{target:a,adjuster:i}of t)e[a]=i;r=r.alter(e)}}return r}},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:(R,x,y)=>{const l=y(375),b=y(9474),g=y(9621),m=y(8068),r=y(8160),s=y(3292),n={};R.exports=m.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(t,{schema:e,state:a,prefs:i}){if(!Array.isArray(t))return;const o=e.$_getRule("sort");return o?n.sort(e,t,o.args.options,a,i):void 0}},validate(t,{schema:e,error:a}){if(!Array.isArray(t)){if(e._flags.single){const i=[t];return i[r.symbols.arraySingle]=!0,{value:i}}return{errors:a("array.base")}}if(e.$_getRule("items")||e.$_terms.externals)return{value:t.slice()}},rules:{has:{method(t){t=this.$_compile(t,{appendPath:!0});const e=this.$_addRule({name:"has",args:{schema:t}});return e.$_mutateRegister(t),e},validate(t,{state:e,prefs:a,error:i},{schema:o}){const c=[t,...e.ancestors];for(let d=0;dthis.$_compile(t[a]),a,{append:!0});e.$_terms.items.push(i)}return e.$_mutateRebuild()},validate(t,{schema:e,error:a,state:i,prefs:o,errorsArray:c}){const f=e.$_terms._requireds.slice(),d=e.$_terms.ordered.slice(),_=[...e.$_terms._inclusions,...f],v=!t[r.symbols.arraySingle];delete t[r.symbols.arraySingle];const u=c();let h=t.length;for(let p=0;p="})}},ordered:{method(...t){r.verifyFlat(t,"ordered");const e=this.$_addRule("items");for(let a=0;athis.$_compile(t[a]),a,{append:!0});n.validateSingle(i,e),e.$_mutateRegister(i),e.$_terms.ordered.push(i)}return e.$_mutateRebuild()}},single:{method(t){const e=t===void 0||!!t;return l(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){r.assertOptions(t,["by","order"]);const e={order:t.order||"ascending"};return t.by&&(e.by=s.ref(t.by,{ancestor:0}),l(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(t,{error:e,state:a,prefs:i,schema:o},{options:c}){const{value:f,errors:d}=n.sort(o,t,c,a,i);if(d)return d;for(let _=0;_new Set(t)}},rebuild(t){t.$_terms._inclusions=[],t.$_terms._exclusions=[],t.$_terms._requireds=[];for(const e of t.$_terms.items)n.validateSingle(e,t),e._flags.presence==="required"?t.$_terms._requireds.push(e):e._flags.presence==="forbidden"?t.$_terms._exclusions.push(e):t.$_terms._inclusions.push(e);for(const e of t.$_terms.ordered)n.validateSingle(e,t)},manifest:{build:(t,e)=>(e.items&&(t=t.items(...e.items)),e.ordered&&(t=t.ordered(...e.ordered)),t)},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"}}),n.fillMissedErrors=function(t,e,a,i,o,c){const f=[];let d=0;for(const _ of a){const v=_._flags.label;v?f.push(v):++d}f.length?d?e.push(t.$_createError("array.includesRequiredBoth",i,{knownMisses:f,unknownMisses:d},o,c)):e.push(t.$_createError("array.includesRequiredKnowns",i,{knownMisses:f},o,c)):e.push(t.$_createError("array.includesRequiredUnknowns",i,{unknownMisses:d},o,c))},n.fillOrderedErrors=function(t,e,a,i,o,c){const f=[];for(const d of a)d._flags.presence==="required"&&f.push(d);f.length&&n.fillMissedErrors(t,e,f,i,o,c)},n.fillDefault=function(t,e,a,i){const o=[];let c=!0;for(let f=t.length-1;f>=0;--f){const d=t[f],_=[e,...a.ancestors],v=d.$_validate(void 0,a.localize(a.path,_,d),i).value;if(c){if(v===void 0)continue;c=!1}o.unshift(v)}o.length&&e.push(...o)},n.fastSplice=function(t,e){let a=e;for(;a{let h=n.compare(v,u,f,d);if(h!==null||(a.by&&(v=a.by.resolve(v,i,o),u=a.by.resolve(u,i,o)),h=n.compare(v,u,f,d),h!==null))return h;const p=typeof v;if(p!==typeof u)throw t.$_createError("array.sort.mismatching",e,null,i,o);if(p!=="number"&&p!=="string")throw t.$_createError("array.sort.unsupported",e,{type:p},i,o);return p==="number"?(v-u)*c:v{const l=y(375),b=y(8068),g=y(8160),m=y(2036),r={isBool:function(s){return typeof s=="boolean"}};R.exports=b.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(s,{schema:n}){if(typeof s!="boolean"){if(typeof s=="string"){const t=n._flags.sensitive?s:s.toLowerCase();s=t==="true"||t!=="false"&&s}return typeof s!="boolean"&&(s=n.$_terms.truthy&&n.$_terms.truthy.has(s,null,null,!n._flags.sensitive)||(!n.$_terms.falsy||!n.$_terms.falsy.has(s,null,null,!n._flags.sensitive))&&s),{value:s}}},validate(s,{error:n}){if(typeof s!="boolean")return{value:s,errors:n("boolean.base")}},rules:{truthy:{method(...s){g.verifyFlat(s,"truthy");const n=this.clone();n.$_terms.truthy=n.$_terms.truthy||new m;for(let t=0;ts?1:0},string:{from:r.isBool,to:(s,n)=>s?"true":"false"}},manifest:{build:(s,n)=>(n.truthy&&(s=s.truthy(...n.truthy)),n.falsy&&(s=s.falsy(...n.falsy)),s)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(R,x,y)=>{const l=y(375),b=y(8068),g=y(8160),m=y(3328),r={isDate:function(s){return s instanceof Date}};R.exports=b.extend({type:"date",coerce:{from:["number","string"],method:(s,{schema:n})=>({value:r.parse(s,n._flags.format)||s})},validate(s,{schema:n,error:t,prefs:e}){if(s instanceof Date&&!isNaN(s.getTime()))return;const a=n._flags.format;return e.convert&&a&&typeof s=="string"?{value:s,errors:t("date.format",{format:a})}:{value:s,errors:t("date.base")}},rules:{compare:{method:!1,validate(s,n,{date:t},{name:e,operator:a,args:i}){const o=t==="now"?Date.now():t.getTime();return g.compare(s.getTime(),o,a)?s:n.error("date."+e,{limit:i.date,value:s})},args:[{name:"date",ref:!0,normalize:s=>s==="now"?s:r.parse(s),assert:s=>s!==null,message:"must have a valid date format"}]},format:{method(s){return l(["iso","javascript","unix"].includes(s),"Unknown date format",s),this.$_setFlag("format",s)}},greater:{method(s){return this.$_addRule({name:"greater",method:"compare",args:{date:s},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(s){return this.$_addRule({name:"less",method:"compare",args:{date:s},operator:"<"})}},max:{method(s){return this.$_addRule({name:"max",method:"compare",args:{date:s},operator:"<="})}},min:{method(s){return this.$_addRule({name:"min",method:"compare",args:{date:s},operator:">="})}},timestamp:{method(s="javascript"){return l(["javascript","unix"].includes(s),'"type" must be one of "javascript, unix"'),this.format(s)}}},cast:{number:{from:r.isDate,to:(s,n)=>s.getTime()},string:{from:r.isDate,to:(s,{prefs:n})=>m.date(s,n)}},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"}}),r.parse=function(s,n){if(s instanceof Date)return s;if(typeof s!="string"&&(isNaN(s)||!isFinite(s))||/^\s*$/.test(s))return null;if(n==="iso")return g.isIsoDate(s)?r.date(s.toString()):null;const t=s;if(typeof s=="string"&&/^[+-]?\d+(\.\d+)?$/.test(s)&&(s=parseFloat(s)),n){if(n==="javascript")return r.date(1*s);if(n==="unix")return r.date(1e3*s);if(typeof t=="string")return null}return r.date(s)},r.date=function(s){const n=new Date(s);return isNaN(n.getTime())?null:n}},390:(R,x,y)=>{const l=y(375),b=y(7824);R.exports=b.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(g){return l(Number.isSafeInteger(g)&&g>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:g}})},validate:(g,m,{n:r})=>g.length===r?g:m.error("function.arity",{n:r})},class:{method(){return this.$_addRule("class")},validate:(g,m)=>/^\s*class\s/.test(g.toString())?g:m.error("function.class",{value:g})},minArity:{method(g){return l(Number.isSafeInteger(g)&&g>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:g}})},validate:(g,m,{n:r})=>g.length>=r?g:m.error("function.minArity",{n:r})},maxArity:{method(g){return l(Number.isSafeInteger(g)&&g>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:g}})},validate:(g,m,{n:r})=>g.length<=r?g:m.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:(R,x,y)=>{const l=y(978),b=y(375),g=y(8571),m=y(3652),r=y(8068),s=y(8160),n=y(3292),t=y(6354),e=y(6133),a=y(3328),i={renameDefaults:{alias:!1,multiple:!1,override:!1}};R.exports=r.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(o,c)=>o.keys(c),validate(o,{schema:c,error:f,state:d,prefs:_}){if(!o||typeof o!==c.$_property("typeof")||Array.isArray(o))return{value:o,errors:f("object.base",{type:c.$_property("typeof")})};if(!(c.$_terms.renames||c.$_terms.dependencies||c.$_terms.keys||c.$_terms.patterns||c.$_terms.externals))return;o=i.clone(o,_);const v=[];if(c.$_terms.renames&&!i.rename(c,o,d,_,v))return{value:o,errors:v};if(!c.$_terms.keys&&!c.$_terms.patterns&&!c.$_terms.dependencies)return{value:o,errors:v};const u=new Set(Object.keys(o));if(c.$_terms.keys){const h=[o,...d.ancestors];for(const p of c.$_terms.keys){const w=p.key,k=o[w];u.delete(w);const $=d.localize([...d.path,w],h,p),j=p.schema.$_validate(k,$,_);if(j.errors){if(_.abortEarly)return{value:o,errors:j.errors};j.value!==void 0&&(o[w]=j.value),v.push(...j.errors)}else p.schema._flags.result==="strip"||j.value===void 0&&k!==void 0?delete o[w]:j.value!==void 0&&(o[w]=j.value)}}if(u.size||c._flags._hasPatternMatch){const h=i.unknown(c,o,u,v,d,_);if(h)return h}if(c.$_terms.dependencies)for(const h of c.$_terms.dependencies){if(h.key!==null&&i.isPresent(h.options)(h.key.resolve(o,d,_,null,{shadow:!1}))===!1)continue;const p=i.dependencies[h.rel](c,h,o,d,_);if(p){const w=c.$_createError(p.code,o,p.context,d,_);if(_.abortEarly)return{value:o,errors:w};v.push(w)}}return{value:o,errors:v}},rules:{and:{method(...o){return s.verifyFlat(o,"and"),i.dependency(this,"and",null,o)}},append:{method(o){return o==null||Object.keys(o).length===0?this:this.keys(o)}},assert:{method(o,c,f){a.isTemplate(o)||(o=n.ref(o)),b(f===void 0||typeof f=="string","Message must be a string"),c=this.$_compile(c,{appendPath:!0});const d=this.$_addRule({name:"assert",args:{subject:o,schema:c,message:f}});return d.$_mutateRegister(o),d.$_mutateRegister(c),d},validate(o,{error:c,prefs:f,state:d},{subject:_,schema:v,message:u}){const h=_.resolve(o,d,f),p=e.isRef(_)?_.absolute(d):[];return v.$_match(h,d.localize(p,[o,...d.ancestors],v),f)?o:c("object.assert",{subject:_,message:u})},args:["subject","schema","message"],multi:!0},instance:{method(o,c){return b(typeof o=="function","constructor must be a function"),c=c||o.name,this.$_addRule({name:"instance",args:{constructor:o,name:c}})},validate:(o,c,{constructor:f,name:d})=>o instanceof f?o:c.error("object.instance",{type:d,value:o}),args:["constructor","name"]},keys:{method(o){b(o===void 0||typeof o=="object","Object schema must be a valid object"),b(!s.isSchema(o),"Object schema cannot be a joi schema");const c=this.clone();if(o)if(Object.keys(o).length){c.$_terms.keys=c.$_terms.keys?c.$_terms.keys.filter(f=>!o.hasOwnProperty(f.key)):new i.Keys;for(const f in o)s.tryWithPath(()=>c.$_terms.keys.push({key:f,schema:this.$_compile(o[f])}),f)}else c.$_terms.keys=new i.Keys;else c.$_terms.keys=null;return c.$_mutateRebuild()}},length:{method(o){return this.$_addRule({name:"length",args:{limit:o},operator:"="})},validate:(o,c,{limit:f},{name:d,operator:_,args:v})=>s.compare(Object.keys(o).length,f,_)?o:c.error("object."+d,{limit:v.limit,value:o}),args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"}]},max:{method(o){return this.$_addRule({name:"max",method:"length",args:{limit:o},operator:"<="})}},min:{method(o){return this.$_addRule({name:"min",method:"length",args:{limit:o},operator:">="})}},nand:{method(...o){return s.verifyFlat(o,"nand"),i.dependency(this,"nand",null,o)}},or:{method(...o){return s.verifyFlat(o,"or"),i.dependency(this,"or",null,o)}},oxor:{method(...o){return i.dependency(this,"oxor",null,o)}},pattern:{method(o,c,f={}){const d=o instanceof RegExp;d||(o=this.$_compile(o,{appendPath:!0})),b(c!==void 0,"Invalid rule"),s.assertOptions(f,["fallthrough","matches"]),d&&b(!o.flags.includes("g")&&!o.flags.includes("y"),"pattern should not use global or sticky mode"),c=this.$_compile(c,{appendPath:!0});const _=this.clone();_.$_terms.patterns=_.$_terms.patterns||[];const v={[d?"regex":"schema"]:o,rule:c};return f.matches&&(v.matches=this.$_compile(f.matches),v.matches.type!=="array"&&(v.matches=v.matches.$_root.array().items(v.matches)),_.$_mutateRegister(v.matches),_.$_setFlag("_hasPatternMatch",!0,{clone:!1})),f.fallthrough&&(v.fallthrough=!0),_.$_terms.patterns.push(v),_.$_mutateRegister(c),_}},ref:{method(){return this.$_addRule("ref")},validate:(o,c)=>e.isRef(o)?o:c.error("object.refType",{value:o})},regex:{method(){return this.$_addRule("regex")},validate:(o,c)=>o instanceof RegExp?o:c.error("object.regex",{value:o})},rename:{method(o,c,f={}){b(typeof o=="string"||o instanceof RegExp,"Rename missing the from argument"),b(typeof c=="string"||c instanceof a,"Invalid rename to argument"),b(c!==o,"Cannot rename key to same name:",o),s.assertOptions(f,["alias","ignoreUndefined","override","multiple"]);const d=this.clone();d.$_terms.renames=d.$_terms.renames||[];for(const _ of d.$_terms.renames)b(_.from!==o,"Cannot rename the same key multiple times");return c instanceof a&&d.$_mutateRegister(c),d.$_terms.renames.push({from:o,to:c,options:l(i.renameDefaults,f)}),d}},schema:{method(o="any"){return this.$_addRule({name:"schema",args:{type:o}})},validate:(o,c,{type:f})=>!s.isSchema(o)||f!=="any"&&o.type!==f?c.error("object.schema",{type:f}):o},unknown:{method(o){return this.$_setFlag("unknown",o!==!1)}},with:{method(o,c,f={}){return i.dependency(this,"with",o,c,f)}},without:{method(o,c,f={}){return i.dependency(this,"without",o,c,f)}},xor:{method(...o){return s.verifyFlat(o,"xor"),i.dependency(this,"xor",null,o)}}},overrides:{default(o,c){return o===void 0&&(o=s.symbols.deepDefault),this.$_parent("default",o,c)}},rebuild(o){if(o.$_terms.keys){const c=new m.Sorter;for(const f of o.$_terms.keys)s.tryWithPath(()=>c.add(f,{after:f.schema.$_rootReferences(),group:f.key}),f.key);o.$_terms.keys=new i.Keys(...c.nodes)}},manifest:{build(o,c){if(c.keys&&(o=o.keys(c.keys)),c.dependencies)for(const{rel:f,key:d=null,peers:_,options:v}of c.dependencies)o=i.dependency(o,f,d,_,v);if(c.patterns)for(const{regex:f,schema:d,rule:_,fallthrough:v,matches:u}of c.patterns)o=o.pattern(f||d,_,{fallthrough:v,matches:u});if(c.renames)for(const{from:f,to:d,options:_}of c.renames)o=o.rename(f,d,_);return o}},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}}"}}),i.clone=function(o,c){if(typeof o=="object"){if(c.nonEnumerables)return g(o,{shallow:!0});const d=Object.create(Object.getPrototypeOf(o));return Object.assign(d,o),d}const f=function(...d){return o.apply(this,d)};return f.prototype=g(o.prototype),Object.defineProperty(f,"name",{value:o.name,writable:!1}),Object.defineProperty(f,"length",{value:o.length,writable:!1}),Object.assign(f,o),f},i.dependency=function(o,c,f,d,_){b(f===null||typeof f=="string",c,"key must be a strings"),_||(_=d.length>1&&typeof d[d.length-1]=="object"?d.pop():{}),s.assertOptions(_,["separator","isPresent"]),d=[].concat(d);const v=s.default(_.separator,"."),u=[];for(const p of d)b(typeof p=="string",c,"peers must be strings"),u.push(n.ref(p,{separator:v,ancestor:0,prefix:!1}));f!==null&&(f=n.ref(f,{separator:v,ancestor:0,prefix:!1}));const h=o.clone();return h.$_terms.dependencies=h.$_terms.dependencies||[],h.$_terms.dependencies.push(new i.Dependency(c,f,u,d,_)),h},i.dependencies={and(o,c,f,d,_){const v=[],u=[],h=c.peers.length,p=i.isPresent(c.options);for(const w of c.peers)p(w.resolve(f,d,_,null,{shadow:!1}))===!1?v.push(w.key):u.push(w.key);if(v.length!==h&&u.length!==h)return{code:"object.and",context:{present:u,presentWithLabels:i.keysToLabels(o,u),missing:v,missingWithLabels:i.keysToLabels(o,v)}}},nand(o,c,f,d,_){const v=[],u=i.isPresent(c.options);for(const w of c.peers)u(w.resolve(f,d,_,null,{shadow:!1}))&&v.push(w.key);if(v.length!==c.peers.length)return;const h=c.paths[0],p=c.paths.slice(1);return{code:"object.nand",context:{main:h,mainWithLabel:i.keysToLabels(o,h),peers:p,peersWithLabels:i.keysToLabels(o,p)}}},or(o,c,f,d,_){const v=i.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,d,_,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:c.paths,peersWithLabels:i.keysToLabels(o,c.paths)}}},oxor(o,c,f,d,_){const v=[],u=i.isPresent(c.options);for(const p of c.peers)u(p.resolve(f,d,_,null,{shadow:!1}))&&v.push(p.key);if(!v.length||v.length===1)return;const h={peers:c.paths,peersWithLabels:i.keysToLabels(o,c.paths)};return h.present=v,h.presentWithLabels=i.keysToLabels(o,v),{code:"object.oxor",context:h}},with(o,c,f,d,_){const v=i.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,d,_,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:c.key.key,mainWithLabel:i.keysToLabels(o,c.key.key),peer:u.key,peerWithLabel:i.keysToLabels(o,u.key)}}},without(o,c,f,d,_){const v=i.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,d,_,null,{shadow:!1})))return{code:"object.without",context:{main:c.key.key,mainWithLabel:i.keysToLabels(o,c.key.key),peer:u.key,peerWithLabel:i.keysToLabels(o,u.key)}}},xor(o,c,f,d,_){const v=[],u=i.isPresent(c.options);for(const p of c.peers)u(p.resolve(f,d,_,null,{shadow:!1}))&&v.push(p.key);if(v.length===1)return;const h={peers:c.paths,peersWithLabels:i.keysToLabels(o,c.paths)};return v.length===0?{code:"object.missing",context:h}:(h.present=v,h.presentWithLabels=i.keysToLabels(o,v),{code:"object.xor",context:h})}},i.keysToLabels=function(o,c){return Array.isArray(c)?c.map(f=>o.$_mapLabels(f)):o.$_mapLabels(c)},i.isPresent=function(o){return typeof o.isPresent=="function"?o.isPresent:c=>c!==void 0},i.rename=function(o,c,f,d,_){const v={};for(const u of o.$_terms.renames){const h=[],p=typeof u.from!="string";if(p)for(const w in c){if(c[w]===void 0&&u.options.ignoreUndefined||w===u.to)continue;const k=u.from.exec(w);k&&h.push({from:w,to:u.to,match:k})}else!Object.prototype.hasOwnProperty.call(c,u.from)||c[u.from]===void 0&&u.options.ignoreUndefined||h.push(u);for(const w of h){const k=w.from;let $=w.to;if($ instanceof a&&($=$.render(c,f,d,w.match)),k!==$){if(!u.options.multiple&&v[$]&&(_.push(o.$_createError("object.rename.multiple",c,{from:k,to:$,pattern:p},f,d)),d.abortEarly)||Object.prototype.hasOwnProperty.call(c,$)&&!u.options.override&&!v[$]&&(_.push(o.$_createError("object.rename.override",c,{from:k,to:$,pattern:p},f,d)),d.abortEarly))return!1;c[k]===void 0?delete c[$]:c[$]=c[k],v[$]=!0,u.options.alias||delete c[k]}}}return!0},i.unknown=function(o,c,f,d,_,v){if(o.$_terms.patterns){let u=!1;const h=o.$_terms.patterns.map(w=>{if(w.matches)return u=!0,[]}),p=[c,..._.ancestors];for(const w of f){const k=c[w],$=[..._.path,w];for(let j=0;j{const l=y(375),b=y(8068),g=y(8160),m=y(3292),r=y(6354),s={};R.exports=b.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(n,t)=>n.ref(t),validate(n,{schema:t,state:e,prefs:a}){l(t.$_terms.link,"Uninitialized link schema");const i=s.generate(t,n,e,a),o=t.$_terms.link[0].ref;return i.$_validate(n,e.nest(i,`link:${o.display}:${i.type}`),a)},generate:(n,t,e,a)=>s.generate(n,t,e,a),rules:{ref:{method(n){l(!this.$_terms.link,"Cannot reinitialize schema"),n=m.ref(n),l(n.type==="value"||n.type==="local","Invalid reference type:",n.type),l(n.type==="local"||n.ancestor==="root"||n.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:n}],t}},relative:{method(n=!0){return this.$_setFlag("relative",n)}}},overrides:{concat(n){l(this.$_terms.link,"Uninitialized link schema"),l(g.isSchema(n),"Invalid schema object"),l(n.type!=="link","Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:n}),t.$_mutateRebuild()}},manifest:{build:(n,t)=>(l(t.link,"Invalid link description missing link"),n.ref(t.link))}}),s.generate=function(n,t,e,a){let i=e.mainstay.links.get(n);if(i)return i._generate(t,e,a).schema;const o=n.$_terms.link[0].ref,{perspective:c,path:f}=s.perspective(o,e);s.assert(c,"which is outside of schema boundaries",o,n,e,a);try{i=f.length?c.$_reach(f):c}catch{s.assert(!1,"to non-existing schema",o,n,e,a)}return s.assert(i.type!=="link","which is another link",o,n,e,a),n._flags.relative||e.mainstay.links.set(n,i),i._generate(t,e,a).schema},s.perspective=function(n,t){if(n.type==="local"){for(const{schema:e,key:a}of t.schemas){if((e._flags.id||a)===n.path[0])return{perspective:e,path:n.path.slice(1)};if(e.$_terms.shared){for(const i of e.$_terms.shared)if(i._flags.id===n.path[0])return{perspective:i,path:n.path.slice(1)}}}return{perspective:null,path:null}}return n.ancestor==="root"?{perspective:t.schemas[t.schemas.length-1].schema,path:n.path}:{perspective:t.schemas[n.ancestor]&&t.schemas[n.ancestor].schema,path:n.path}},s.assert=function(n,t,e,a,i,o){n||l(!1,`"${r.label(a._flags,i,o)}" contains link reference "${e.display}" ${t}`)}},3832:(R,x,y)=>{const l=y(375),b=y(8068),g=y(8160),m={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(r){const s=r.toString(),n=s.indexOf("."),t=s.indexOf("e");return(n<0?0:(t<0?s.length:t)-n-1)+(t<0?0:Math.max(0,-parseInt(s.slice(t+1))))}};R.exports=b.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(r,{schema:s,error:n}){if(!r.match(m.numberRx))return;r=r.trim();const t={value:parseFloat(r)};if(t.value===0&&(t.value=0),!s._flags.unsafe)if(r.match(/e/i)){if(m.extractSignificantDigits(r)!==m.extractSignificantDigits(String(t.value)))return t.errors=n("number.unsafe"),t}else{const e=t.value.toString();if(e.match(/e/i))return t;if(e!==m.normalizeDecimal(r))return t.errors=n("number.unsafe"),t}return t}},validate(r,{schema:s,error:n,prefs:t}){if(r===1/0||r===-1/0)return{value:r,errors:n("number.infinity")};if(!g.isNumber(r))return{value:r,errors:n("number.base")};const e={value:r};if(t.convert){const a=s.$_getRule("precision");if(a){const i=Math.pow(10,a.args.limit);e.value=Math.round(e.value*i)/i}}return e.value===0&&(e.value=0),!s._flags.unsafe&&(r>Number.MAX_SAFE_INTEGER||rg.compare(r,n,e)?r:s.error("number."+t,{limit:a.limit,value:r}),args:[{name:"limit",ref:!0,assert:g.isNumber,message:"must be a number"}]},greater:{method(r){return this.$_addRule({name:"greater",method:"compare",args:{limit:r},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(r,s)=>Math.trunc(r)-r==0?r:s.error("number.integer")},less:{method(r){return this.$_addRule({name:"less",method:"compare",args:{limit:r},operator:"<"})}},max:{method(r){return this.$_addRule({name:"max",method:"compare",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"compare",args:{limit:r},operator:">="})}},multiple:{method(r){const s=typeof r=="number"?m.decimalPlaces(r):null,n=Math.pow(10,s);return this.$_addRule({name:"multiple",args:{base:r,baseDecimalPlace:s,pfactor:n}})},validate:(r,s,{base:n,baseDecimalPlace:t,pfactor:e},a)=>m.decimalPlaces(r)>t?s.error("number.multiple",{multiple:a.args.base,value:r}):Math.round(e*r)%Math.round(e*n)==0?r:s.error("number.multiple",{multiple:a.args.base,value:r}),args:[{name:"base",ref:!0,assert:r=>typeof r=="number"&&isFinite(r)&&r>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(r,s)=>Number.isSafeInteger(r)&&r>=0&&r<=65535?r:s.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(r){return l(Number.isSafeInteger(r),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:r}})},validate(r,s,{limit:n}){const t=r.toString().match(m.precisionRx);return Math.max((t[1]?t[1].length:0)-(t[2]?parseInt(t[2],10):0),0)<=n?r:s.error("number.precision",{limit:n,value:r})},convert:!0},sign:{method(r){return l(["negative","positive"].includes(r),"Invalid sign",r),this.$_addRule({name:"sign",args:{sign:r}})},validate:(r,s,{sign:n})=>n==="negative"&&r<0||n==="positive"&&r>0?r:s.error(`number.${n}`)},unsafe:{method(r=!0){return l(typeof r=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",r)}}},cast:{string:{from:r=>typeof r=="number",to:(r,s)=>r.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"}}),m.extractSignificantDigits=function(r){return r.replace(m.exponentialPartRegex,"").replace(m.dotRegex,"").replace(m.trailingZerosRegex,"").replace(m.leadingSignAndZerosRegex,"")},m.normalizeDecimal=function(r){return(r=r.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&r.endsWith("0")&&(r=r.replace(/0+$/,"")),r==="-0"?"0":r}},8966:(R,x,y)=>{const l=y(7824);R.exports=l.extend({type:"object",cast:{map:{from:b=>b&&typeof b=="object",to:(b,g)=>new Map(Object.entries(b))}}})},7417:(R,x,y)=>{const l=y(375),b=y(5380),g=y(1745),m=y(9959),r=y(6064),s=y(9926),n=y(5752),t=y(8068),e=y(8160),a={tlds:s instanceof Set&&{tlds:{allow:s,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:m.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"]};R.exports=t.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(i,{schema:o,state:c,prefs:f}){const d=o.$_getRule("normalize");d&&(i=i.normalize(d.args.form));const _=o.$_getRule("case");_&&(i=_.args.direction==="upper"?i.toLocaleUpperCase():i.toLocaleLowerCase());const v=o.$_getRule("trim");if(v&&v.args.enabled&&(i=i.trim()),o.$_terms.replacements)for(const h of o.$_terms.replacements)i=i.replace(h.pattern,h.replacement);const u=o.$_getRule("hex");if(u&&u.args.options.byteAligned&&i.length%2!=0&&(i=`0${i}`),o.$_getRule("isoDate")){const h=a.isoDate(i);h&&(i=h)}if(o._flags.truncate){const h=o.$_getRule("max");if(h){let p=h.args.limit;if(e.isResolvable(p)&&(p=p.resolve(i,c,f),!e.limit(p)))return{value:i,errors:o.$_createError("any.ref",p,{ref:h.args.limit,arg:"limit",reason:"must be a positive integer"},c,f)};i=i.slice(0,p)}}return{value:i}}},validate(i,{schema:o,error:c}){if(typeof i!="string")return{value:i,errors:c("string.base")};if(i===""){const f=o.$_getRule("min");return f&&f.args.limit===0?void 0:{value:i,errors:c("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(i,o)=>/^[a-zA-Z0-9]+$/.test(i)?i:o.error("string.alphanum")},base64:{method(i={}){return e.assertOptions(i,["paddingRequired","urlSafe"]),i={urlSafe:!1,paddingRequired:!0,...i},l(typeof i.paddingRequired=="boolean","paddingRequired must be boolean"),l(typeof i.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:i}})},validate:(i,o,{options:c})=>a.base64Regex[c.paddingRequired][c.urlSafe].test(i)?i:o.error("string.base64")},case:{method(i){return l(["lower","upper"].includes(i),"Invalid case:",i),this.$_addRule({name:"case",args:{direction:i}})},validate:(i,o,{direction:c})=>c==="lower"&&i===i.toLocaleLowerCase()||c==="upper"&&i===i.toLocaleUpperCase()?i:o.error(`string.${c}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(i,o){let c=i.length,f=0,d=1;for(;c--;){const _=i.charAt(c)*d;f+=_-9*(_>9),d^=3}return f>0&&f%10==0?i:o.error("string.creditCard")}},dataUri:{method(i={}){return e.assertOptions(i,["paddingRequired"]),i={paddingRequired:!0,...i},l(typeof i.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:i}})},validate(i,o,{options:c}){const f=i.match(a.dataUriRegex);return f&&(!f[2]||f[2]!=="base64"||a.base64Regex[c.paddingRequired].false.test(f[3]))?i:o.error("string.dataUri")}},domain:{method(i){i&&e.assertOptions(i,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const o=a.addressOptions(i);return this.$_addRule({name:"domain",args:{options:i},address:o})},validate:(i,o,c,{address:f})=>b.isValid(i,f)?i:o.error("string.domain")},email:{method(i={}){e.assertOptions(i,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),l(i.multiple===void 0||typeof i.multiple=="boolean","multiple option must be an boolean");const o=a.addressOptions(i),c=new RegExp(`\\s*[${i.separator?r(i.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:i},regex:c,address:o})},validate(i,o,{options:c},{regex:f,address:d}){const _=c.multiple?i.split(f):[i],v=[];for(const u of _)g.isValid(u,d)||v.push(u);return v.length?o.error("string.email",{value:i,invalids:v}):i}},guid:{alias:"uuid",method(i={}){e.assertOptions(i,["version","separator"]);let o="";if(i.version){const d=[].concat(i.version);l(d.length>=1,"version must have at least 1 valid version specified");const _=new Set;for(let v=0;v(c.prefix==="optional"?a.hexRegex.withOptionalPrefix:c.prefix===!0?a.hexRegex.withPrefix:a.hexRegex.withoutPrefix).test(i)?c.byteAligned&&i.length%2!=0?o.error("string.hexAlign"):i:o.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(i,o)=>b.isValid(i,{minDomainSegments:1})||a.ipRegex.test(i)?i:o.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(i={}){e.assertOptions(i,["cidr","version"]);const{cidr:o,versions:c,regex:f}=m.regex(i),d=i.version?c:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:o,version:d}},regex:f})},validate:(i,o,{options:c},{regex:f})=>f.test(i)?i:c.version?o.error("string.ipVersion",{value:i,cidr:c.cidr,version:c.version}):o.error("string.ip",{value:i,cidr:c.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(i,{error:o})=>a.isoDate(i)?i:o("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(i,o)=>a.isoDurationRegex.test(i)?i:o.error("string.isoDuration")},length:{method(i,o){return a.length(this,"length",i,"=",o)},validate(i,o,{limit:c,encoding:f},{name:d,operator:_,args:v}){const u=!f&&i.length;return e.compare(u,c,_)?i:o.error("string."+d,{limit:v.limit,value:i,encoding:f})},args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(i,o){return a.length(this,"max",i,"<=",o)},args:["limit","encoding"]},min:{method(i,o){return a.length(this,"min",i,">=",o)},args:["limit","encoding"]},normalize:{method(i="NFC"){return l(a.normalizationForms.includes(i),"normalization form must be one of "+a.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:i}})},validate:(i,{error:o},{form:c})=>i===i.normalize(c)?i:o("string.normalize",{value:i,form:c}),convert:!0},pattern:{alias:"regex",method(i,o={}){l(i instanceof RegExp,"regex must be a RegExp"),l(!i.flags.includes("g")&&!i.flags.includes("y"),"regex should not use global or sticky mode"),typeof o=="string"&&(o={name:o}),e.assertOptions(o,["invert","name"]);const c=["string.pattern",o.invert?".invert":"",o.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:i,options:o},errorCode:c})},validate:(i,o,{regex:c,options:f},{errorCode:d})=>c.test(i)^f.invert?i:o.error(d,{name:f.name,regex:c,value:i}),args:["regex","options"],multi:!0},replace:{method(i,o){typeof i=="string"&&(i=new RegExp(r(i),"g")),l(i instanceof RegExp,"pattern must be a RegExp"),l(typeof o=="string","replacement must be a String");const c=this.clone();return c.$_terms.replacements||(c.$_terms.replacements=[]),c.$_terms.replacements.push({pattern:i,replacement:o}),c}},token:{method(){return this.$_addRule("token")},validate:(i,o)=>/^\w+$/.test(i)?i:o.error("string.token")},trim:{method(i=!0){return l(typeof i=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:i}})},validate:(i,o,{enabled:c})=>c&&i!==i.trim()?o.error("string.trim"):i,convert:!0},truncate:{method(i=!0){return l(typeof i=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",i)}},uppercase:{method(){return this.case("upper")}},uri:{method(i={}){e.assertOptions(i,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),i.domain&&e.assertOptions(i.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:o,scheme:c}=n.regex(i),f=i.domain?a.addressOptions(i.domain):null;return this.$_addRule({name:"uri",args:{options:i},regex:o,domain:f,scheme:c})},validate(i,o,{options:c},{regex:f,domain:d,scheme:_}){if(["http:/","https:/"].includes(i))return o.error("string.uri");const v=f.exec(i);if(v){const u=v[1]||v[2];return!d||c.allowRelative&&!u||b.isValid(u,d)?i:o.error("string.domain",{value:u})}return c.relativeOnly?o.error("string.uriRelativeOnly"):c.scheme?o.error("string.uriCustomScheme",{scheme:_,value:i}):o.error("string.uri")}}},manifest:{build(i,o){if(o.replacements)for(const{pattern:c,replacement:f}of o.replacements)i=i.replace(c,f);return i}},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"}}),a.addressOptions=function(i){if(!i||(l(i.minDomainSegments===void 0||Number.isSafeInteger(i.minDomainSegments)&&i.minDomainSegments>0,"minDomainSegments must be a positive integer"),l(i.maxDomainSegments===void 0||Number.isSafeInteger(i.maxDomainSegments)&&i.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),i.tlds===!1))return i;if(i.tlds===!0||i.tlds===void 0)return l(a.tlds,"Built-in TLD list disabled"),Object.assign({},i,a.tlds);l(typeof i.tlds=="object","tlds must be true, false, or an object");const o=i.tlds.deny;if(o)return Array.isArray(o)&&(i=Object.assign({},i,{tlds:{deny:new Set(o)}})),l(i.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),l(!i.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),a.validateTlds(i.tlds.deny,"tlds.deny"),i;const c=i.tlds.allow;return c?c===!0?(l(a.tlds,"Built-in TLD list disabled"),Object.assign({},i,a.tlds)):(Array.isArray(c)&&(i=Object.assign({},i,{tlds:{allow:new Set(c)}})),l(i.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),a.validateTlds(i.tlds.allow,"tlds.allow"),i):i},a.validateTlds=function(i,o){for(const c of i)l(b.isValid(c,{minDomainSegments:1,maxDomainSegments:1}),`${o} must contain valid top level domain names`)},a.isoDate=function(i){if(!e.isIsoDate(i))return null;/.*T.*[+-]\d\d$/.test(i)&&(i+="00");const o=new Date(i);return isNaN(o.getTime())?null:o.toISOString()},a.length=function(i,o,c,f,d){return l(!d||!1,"Invalid encoding:",d),i.$_addRule({name:o,method:"length",args:{limit:c,encoding:d},operator:f})}},8826:(R,x,y)=>{const l=y(375),b=y(8068),g={};g.Map=class extends Map{slice(){return new g.Map(this)}},R.exports=b.extend({type:"symbol",terms:{map:{init:new g.Map}},coerce:{method(m,{schema:r,error:s}){const n=r.$_terms.map.get(m);return n&&(m=n),r._flags.only&&typeof m!="symbol"?{value:m,errors:s("symbol.map",{map:r.$_terms.map})}:{value:m}}},validate(m,{error:r}){if(typeof m!="symbol")return{value:m,errors:r("symbol.base")}},rules:{map:{method(m){m&&!m[Symbol.iterator]&&typeof m=="object"&&(m=Object.entries(m)),l(m&&m[Symbol.iterator],"Iterable must be an iterable or object");const r=this.clone(),s=[];for(const n of m){l(n&&n[Symbol.iterator],"Entry must be an iterable");const[t,e]=n;l(typeof t!="object"&&typeof t!="function"&&typeof t!="symbol","Key must not be of type object, function, or Symbol"),l(typeof e=="symbol","Value must be a Symbol"),r.$_terms.map.set(t,e),s.push(e)}return r.valid(...s)}}},manifest:{build:(m,r)=>(r.map&&(m=m.map(r.map)),m)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(R,x,y)=>{const l=y(375),b=y(8571),g=y(738),m=y(9621),r=y(8160),s=y(6354),n=y(493),t={result:Symbol("result")};x.entry=function(e,a,i){let o=r.defaults;i&&(l(i.warnings===void 0,"Cannot override warnings preference in synchronous validation"),l(i.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),o=r.preferences(r.defaults,i));const c=t.entry(e,a,o);l(!c.mainstay.externals.length,"Schema with external rules must use validateAsync()");const f={value:c.value};return c.error&&(f.error=c.error),c.mainstay.warnings.length&&(f.warning=s.details(c.mainstay.warnings)),c.mainstay.debug&&(f.debug=c.mainstay.debug),c.mainstay.artifacts&&(f.artifacts=c.mainstay.artifacts),f},x.entryAsync=async function(e,a,i){let o=r.defaults;i&&(o=r.preferences(r.defaults,i));const c=t.entry(e,a,o),f=c.mainstay;if(c.error)throw f.debug&&(c.error.debug=f.debug),c.error;if(f.externals.length){let _=c.value;const v=[];for(const u of f.externals){const h=u.state.path,p=u.schema.type==="link"?f.links.get(u.schema):null;let w,k,$=_;const j=h.length?[_]:[],S=h.length?m(e,h):e;if(h.length){w=h[h.length-1];let E=_;for(const D of h.slice(0,-1))E=E[D],j.unshift(E);k=j[0],$=k[w]}try{const E=(U,V)=>(p||u.schema).$_createError(U,$,V,u.state,o),D=await u.method($,{schema:u.schema,linked:p,state:u.state,prefs:i,original:S,error:E,errorsArray:t.errorsArray,warn:(U,V)=>f.warnings.push((p||u.schema).$_createError(U,$,V,u.state,o)),message:(U,V)=>(p||u.schema).$_createError("external",$,V,u.state,o,{messages:U})});if(D===void 0||D===$)continue;if(D instanceof s.Report){if(f.tracer.log(u.schema,u.state,"rule","external","error"),v.push(D),o.abortEarly)break;continue}if(Array.isArray(D)&&D[r.symbols.errors]){if(f.tracer.log(u.schema,u.state,"rule","external","error"),v.push(...D),o.abortEarly)break;continue}k?(f.tracer.value(u.state,"rule",$,D,"external"),k[w]=D):(f.tracer.value(u.state,"rule",_,D,"external"),_=D)}catch(E){throw o.errors.label&&(E.message+=` (${u.label})`),E}}if(c.value=_,v.length)throw c.error=s.process(v,e,o),f.debug&&(c.error.debug=f.debug),c.error}if(!o.warnings&&!o.debug&&!o.artifacts)return c.value;const d={value:c.value};return f.warnings.length&&(d.warning=s.details(f.warnings)),f.debug&&(d.debug=f.debug),f.artifacts&&(d.artifacts=f.artifacts),d},t.Mainstay=class{constructor(e,a,i){this.externals=[],this.warnings=[],this.tracer=e,this.debug=a,this.links=i,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const e=this._snapshots.pop();this.externals=e.externals,this.warnings=e.warnings}commit(){this._snapshots.pop()}},t.entry=function(e,a,i){const{tracer:o,cleanup:c}=t.tracer(a,i),f=i.debug?[]:null,d=a._ids._schemaChain?new Map:null,_=new t.Mainstay(o,f,d),v=a._ids._schemaChain?[{schema:a}]:null,u=new n([],[],{mainstay:_,schemas:v}),h=x.validate(e,a,u,i);c&&a.$_root.untrace();const p=s.process(h.errors,e,i);return{value:h.value,error:p,mainstay:_}},t.tracer=function(e,a){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:a.debug?(l(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:t.ignore}},x.validate=function(e,a,i,o,c={}){if(a.$_terms.whens&&(a=a._generate(e,i,o).schema),a._preferences&&(o=t.prefs(a,o)),a._cache&&o.cache){const p=a._cache.get(e);if(i.mainstay.tracer.debug(i,"validate","cached",!!p),p)return p}const f=(p,w,k)=>a.$_createError(p,e,w,k||i,o),d={original:e,prefs:o,schema:a,state:i,error:f,errorsArray:t.errorsArray,warn:(p,w,k)=>i.mainstay.warnings.push(f(p,w,k)),message:(p,w)=>a.$_createError("custom",e,w,i,o,{messages:p})};i.mainstay.tracer.entry(a,i);const _=a._definition;if(_.prepare&&e!==void 0&&o.convert){const p=_.prepare(e,d);if(p){if(i.mainstay.tracer.value(i,"prepare",e,p.value),p.errors)return t.finalize(p.value,[].concat(p.errors),d);e=p.value}}if(_.coerce&&e!==void 0&&o.convert&&(!_.coerce.from||_.coerce.from.includes(typeof e))){const p=_.coerce.method(e,d);if(p){if(i.mainstay.tracer.value(i,"coerced",e,p.value),p.errors)return t.finalize(p.value,[].concat(p.errors),d);e=p.value}}const v=a._flags.empty;v&&v.$_match(t.trim(e,a),i.nest(v),r.defaults)&&(i.mainstay.tracer.value(i,"empty",e,void 0),e=void 0);const u=c.presence||a._flags.presence||(a._flags._endedSwitch?null:o.presence);if(e===void 0){if(u==="forbidden")return t.finalize(e,null,d);if(u==="required")return t.finalize(e,[a.$_createError("any.required",e,null,i,o)],d);if(u==="optional"){if(a._flags.default!==r.symbols.deepDefault)return t.finalize(e,null,d);i.mainstay.tracer.value(i,"default",e,{}),e={}}}else if(u==="forbidden")return t.finalize(e,[a.$_createError("any.unknown",e,null,i,o)],d);const h=[];if(a._valids){const p=a._valids.get(e,i,o,a._flags.insensitive);if(p)return o.convert&&(i.mainstay.tracer.value(i,"valids",e,p.value),e=p.value),i.mainstay.tracer.filter(a,i,"valid",p),t.finalize(e,null,d);if(a._flags.only){const w=a.$_createError("any.only",e,{valids:a._valids.values({display:!0})},i,o);if(o.abortEarly)return t.finalize(e,[w],d);h.push(w)}}if(a._invalids){const p=a._invalids.get(e,i,o,a._flags.insensitive);if(p){i.mainstay.tracer.filter(a,i,"invalid",p);const w=a.$_createError("any.invalid",e,{invalids:a._invalids.values({display:!0})},i,o);if(o.abortEarly)return t.finalize(e,[w],d);h.push(w)}}if(_.validate){const p=_.validate(e,d);if(p&&(i.mainstay.tracer.value(i,"base",e,p.value),e=p.value,p.errors)){if(!Array.isArray(p.errors))return h.push(p.errors),t.finalize(e,h,d);if(p.errors.length)return h.push(...p.errors),t.finalize(e,h,d)}}return a._rules.length?t.rules(e,h,d):t.finalize(e,h,d)},t.rules=function(e,a,i){const{schema:o,state:c,prefs:f}=i;for(const d of o._rules){const _=o._definition.rules[d.method];if(_.convert&&f.convert){c.mainstay.tracer.log(o,c,"rule",d.name,"full");continue}let v,u=d.args;if(d._resolve.length){u=Object.assign({},u);for(const p of d._resolve){const w=_.argsByName.get(p),k=u[p].resolve(e,c,f),$=w.normalize?w.normalize(k):k,j=r.validateArg($,null,w);if(j){v=o.$_createError("any.ref",k,{arg:p,ref:u[p],reason:j},c,f);break}u[p]=$}}v=v||_.validate(e,i,u,d);const h=t.rule(v,d);if(h.errors){if(c.mainstay.tracer.log(o,c,"rule",d.name,"error"),d.warn){c.mainstay.warnings.push(...h.errors);continue}if(f.abortEarly)return t.finalize(e,h.errors,i);a.push(...h.errors)}else c.mainstay.tracer.log(o,c,"rule",d.name,"pass"),c.mainstay.tracer.value(c,"rule",e,h.value,d.name),e=h.value}return t.finalize(e,a,i)},t.rule=function(e,a){return e instanceof s.Report?(t.error(e,a),{errors:[e],value:null}):Array.isArray(e)&&e[r.symbols.errors]?(e.forEach(i=>t.error(i,a)),{errors:e,value:null}):{errors:null,value:e}},t.error=function(e,a){return a.message&&e._setTemplate(a.message),e},t.finalize=function(e,a,i){a=a||[];const{schema:o,state:c,prefs:f}=i;if(a.length){const _=t.default("failover",void 0,a,i);_!==void 0&&(c.mainstay.tracer.value(c,"failover",e,_),e=_,a=[])}if(a.length&&o._flags.error)if(typeof o._flags.error=="function"){a=o._flags.error(a),Array.isArray(a)||(a=[a]);for(const _ of a)l(_ instanceof Error||_ instanceof s.Report,"error() must return an Error object")}else a=[o._flags.error];if(e===void 0){const _=t.default("default",e,a,i);c.mainstay.tracer.value(c,"default",e,_),e=_}if(o._flags.cast&&e!==void 0){const _=o._definition.cast[o._flags.cast];if(_.from(e)){const v=_.to(e,i);c.mainstay.tracer.value(c,"cast",e,v,o._flags.cast),e=v}}if(o.$_terms.externals&&f.externals&&f._externals!==!1)for(const{method:_}of o.$_terms.externals)c.mainstay.externals.push({method:_,schema:o,state:c,label:s.label(o._flags,c,f)});const d={value:e,errors:a.length?a:null};return o._flags.result&&(d.value=o._flags.result==="strip"?void 0:i.original,c.mainstay.tracer.value(c,o._flags.result,e,d.value),c.shadow(e,o._flags.result)),o._cache&&f.cache!==!1&&!o._refs.length&&o._cache.set(i.original,d),e===void 0||d.errors||o._flags.artifact===void 0||(c.mainstay.artifacts=c.mainstay.artifacts||new Map,c.mainstay.artifacts.has(o._flags.artifact)||c.mainstay.artifacts.set(o._flags.artifact,[]),c.mainstay.artifacts.get(o._flags.artifact).push(c.path)),d},t.prefs=function(e,a){const i=a===r.defaults;return i&&e._preferences[r.symbols.prefs]?e._preferences[r.symbols.prefs]:(a=r.preferences(a,e._preferences),i&&(e._preferences[r.symbols.prefs]=a),a)},t.default=function(e,a,i,o){const{schema:c,state:f,prefs:d}=o,_=c._flags[e];if(d.noDefaults||_===void 0)return a;if(f.mainstay.tracer.log(c,f,"rule",e,"full"),!_)return _;if(typeof _=="function"){const v=_.length?[b(f.ancestors[0]),o]:[];try{return _(...v)}catch(u){return void i.push(c.$_createError(`any.${e}`,null,{error:u},f,d))}}return typeof _!="object"?_:_[r.symbols.literal]?_.literal:r.isResolvable(_)?_.resolve(a,f,d):b(_)},t.trim=function(e,a){if(typeof e!="string")return e;const i=a.$_getRule("trim");return i&&i.args.enabled?e.trim():e},t.ignore={active:!1,debug:g,entry:g,filter:g,log:g,resolve:g,value:g},t.errorsArray=function(){const e=[];return e[r.symbols.errors]=!0,e}},2036:(R,x,y)=>{const l=y(375),b=y(9474),g=y(8160),m={};R.exports=m.Values=class{constructor(r,s){this._values=new Set(r),this._refs=new Set(s),this._lowercase=m.lowercases(r),this._override=!1}get length(){return this._values.size+this._refs.size}add(r,s){g.isResolvable(r)?this._refs.has(r)||(this._refs.add(r),s&&s.register(r)):this.has(r,null,null,!1)||(this._values.add(r),typeof r=="string"&&this._lowercase.set(r.toLowerCase(),r))}static merge(r,s,n){if(r=r||new m.Values,s){if(s._override)return s.clone();for(const t of[...s._values,...s._refs])r.add(t)}if(n)for(const t of[...n._values,...n._refs])r.remove(t);return r.length?r:null}remove(r){g.isResolvable(r)?this._refs.delete(r):(this._values.delete(r),typeof r=="string"&&this._lowercase.delete(r.toLowerCase()))}has(r,s,n,t){return!!this.get(r,s,n,t)}get(r,s,n,t){if(!this.length)return!1;if(this._values.has(r))return{value:r};if(typeof r=="string"&&r&&t){const e=this._lowercase.get(r.toLowerCase());if(e)return{value:e}}if(!this._refs.size&&typeof r!="object")return!1;if(typeof r=="object"){for(const e of this._values)if(b(e,r))return{value:e}}if(s)for(const e of this._refs){const a=e.resolve(r,s,n,null,{in:!0});if(a===void 0)continue;const i=e.in&&typeof a=="object"?Array.isArray(a)?a:Object.keys(a):[a];for(const o of i)if(typeof o==typeof r){if(t&&r&&typeof r=="string"){if(o.toLowerCase()===r.toLowerCase())return{value:o,ref:e}}else if(b(o,r))return{value:o,ref:e}}}return!1}override(){this._override=!0}values(r){if(r&&r.display){const s=[];for(const n of[...this._values,...this._refs])n!==void 0&&s.push(n);return s}return Array.from([...this._values,...this._refs])}clone(){const r=new m.Values(this._values,this._refs);return r._override=this._override,r}concat(r){l(!r._override,"Cannot concat override set of values");const s=new m.Values([...this._values,...r._values],[...this._refs,...r._refs]);return s._override=this._override,s}describe(){const r=[];this._override&&r.push({override:!0});for(const s of this._values.values())r.push(s&&typeof s=="object"?{value:s}:s);for(const s of this._refs.values())r.push(s.describe());return r}},m.Values.prototype[g.symbols.values]=!0,m.Values.prototype.slice=m.Values.prototype.clone,m.lowercases=function(r){const s=new Map;if(r)for(const n of r)typeof n=="string"&&s.set(n.toLowerCase(),n);return s}},978:(R,x,y)=>{const l=y(375),b=y(8571),g=y(1687),m=y(9621),r={};R.exports=function(s,n,t={}){if(l(s&&typeof s=="object","Invalid defaults value: must be an object"),l(!n||n===!0||typeof n=="object","Invalid source value: must be true, falsy or an object"),l(typeof t=="object","Invalid options: must be an object"),!n)return null;if(t.shallow)return r.applyToDefaultsWithShallow(s,n,t);const e=b(s);if(n===!0)return e;const a=t.nullOverride!==void 0&&t.nullOverride;return g(e,n,{nullOverride:a,mergeArrays:!1})},r.applyToDefaultsWithShallow=function(s,n,t){const e=t.shallow;l(Array.isArray(e),"Invalid keys");const a=new Map,i=n===!0?null:new Set;for(let f of e){f=Array.isArray(f)?f:f.split(".");const d=m(s,f);d&&typeof d=="object"?a.set(d,i&&m(n,f)||d):i&&i.add(f)}const o=b(s,{},a);if(!i)return o;for(const f of i)r.reachCopy(o,n,f);const c=t.nullOverride!==void 0&&t.nullOverride;return g(o,n,{nullOverride:c,mergeArrays:!1})},r.reachCopy=function(s,n,t){for(const i of t){if(!(i in n))return;const o=n[i];if(typeof o!="object"||o===null)return;n=o}const e=n;let a=s;for(let i=0;i{const l=y(7916);R.exports=function(b,...g){if(!b)throw g.length===1&&g[0]instanceof Error?g[0]:new l(g)}},8571:(R,x,y)=>{const l=y(9621),b=y(4277),g=y(7043),m={needsProtoHack:new Set([b.set,b.map,b.weakSet,b.weakMap])};R.exports=m.clone=function(r,s={},n=null){if(typeof r!="object"||r===null)return r;let t=m.clone,e=n;if(s.shallow){if(s.shallow!==!0)return m.cloneWithShallow(r,s);t=c=>c}else if(e){const c=e.get(r);if(c)return c}else e=new Map;const a=b.getInternalProto(r);if(a===b.buffer)return!1;if(a===b.date)return new Date(r.getTime());if(a===b.regex)return new RegExp(r);const i=m.base(r,a,s);if(i===r)return r;if(e&&e.set(r,i),a===b.set)for(const c of r)i.add(t(c,s,e));else if(a===b.map)for(const[c,f]of r)i.set(c,t(f,s,e));const o=g.keys(r,s);for(const c of o){if(c==="__proto__")continue;if(a===b.array&&c==="length"){i.length=r.length;continue}const f=Object.getOwnPropertyDescriptor(r,c);f?f.get||f.set?Object.defineProperty(i,c,f):f.enumerable?i[c]=t(r[c],s,e):Object.defineProperty(i,c,{enumerable:!1,writable:!0,configurable:!0,value:t(r[c],s,e)}):Object.defineProperty(i,c,{enumerable:!0,writable:!0,configurable:!0,value:t(r[c],s,e)})}return i},m.cloneWithShallow=function(r,s){const n=s.shallow;(s=Object.assign({},s)).shallow=!1;const t=new Map;for(const e of n){const a=l(r,e);typeof a!="object"&&typeof a!="function"||t.set(a,a)}return m.clone(r,s,t)},m.base=function(r,s,n){if(n.prototype===!1)return m.needsProtoHack.has(s)?new s.constructor:s===b.array?[]:{};const t=Object.getPrototypeOf(r);if(t&&t.isImmutable)return r;if(s===b.array){const e=[];return t!==s&&Object.setPrototypeOf(e,t),e}if(m.needsProtoHack.has(s)){const e=new t.constructor;return t!==s&&Object.setPrototypeOf(e,t),e}return Object.create(t)}},9474:(R,x,y)=>{const l=y(4277),b={mismatched:null};R.exports=function(g,m,r){return r=Object.assign({prototype:!0},r),!!b.isDeepEqual(g,m,r,[])},b.isDeepEqual=function(g,m,r,s){if(g===m)return g!==0||1/g==1/m;const n=typeof g;if(n!==typeof m||g===null||m===null)return!1;if(n==="function"){if(!r.deepFunction||g.toString()!==m.toString())return!1}else if(n!=="object")return g!=g&&m!=m;const t=b.getSharedType(g,m,!!r.prototype);switch(t){case l.buffer:return!1;case l.promise:return g===m;case l.regex:return g.toString()===m.toString();case b.mismatched:return!1}for(let e=s.length-1;e>=0;--e)if(s[e].isSame(g,m))return!0;s.push(new b.SeenEntry(g,m));try{return!!b.isDeepEqualObj(t,g,m,r,s)}finally{s.pop()}},b.getSharedType=function(g,m,r){if(r)return Object.getPrototypeOf(g)!==Object.getPrototypeOf(m)?b.mismatched:l.getInternalProto(g);const s=l.getInternalProto(g);return s!==l.getInternalProto(m)?b.mismatched:s},b.valueOf=function(g){const m=g.valueOf;if(m===void 0)return g;try{return m.call(g)}catch(r){return r}},b.hasOwnEnumerableProperty=function(g,m){return Object.prototype.propertyIsEnumerable.call(g,m)},b.isSetSimpleEqual=function(g,m){for(const r of Set.prototype.values.call(g))if(!Set.prototype.has.call(m,r))return!1;return!0},b.isDeepEqualObj=function(g,m,r,s,n){const{isDeepEqual:t,valueOf:e,hasOwnEnumerableProperty:a}=b,{keys:i,getOwnPropertySymbols:o}=Object;if(g===l.array){if(!s.part){if(m.length!==r.length)return!1;for(let v=0;v{const l=y(8761);R.exports=class extends Error{constructor(b){super(b.filter(g=>g!=="").map(g=>typeof g=="string"?g:g instanceof Error?g.message:l(g)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,x.assert)}}},5277:R=>{const x={};R.exports=function(y){if(!y)return"";let l="";for(let b=0;b=256?"&#"+y+";":`&#x${y.toString(16).padStart(2,"0")};`)},x.isSafe=function(y){return x.safeCharCodes.has(y)},x.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),x.safeCharCodes=function(){const y=new Set;for(let l=32;l<123;++l)(l>=97||l>=65&&l<=90||l>=48&&l<=57||l===32||l===46||l===44||l===45||l===58||l===95)&&y.add(l);return y}()},6064:R=>{R.exports=function(x){return x.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:R=>{R.exports=function(){}},1687:(R,x,y)=>{const l=y(375),b=y(8571),g=y(7043),m={};R.exports=m.merge=function(r,s,n){if(l(r&&typeof r=="object","Invalid target value: must be an object"),l(s==null||typeof s=="object","Invalid source value: must be null, undefined, or an object"),!s)return r;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(s)){l(Array.isArray(r),"Cannot merge array onto an object"),n.mergeArrays||(r.length=0);for(let e=0;e{const l=y(375),b={};R.exports=function(g,m,r){if(m===!1||m==null)return g;typeof(r=r||{})=="string"&&(r={separator:r});const s=Array.isArray(m);l(!s||!r.separator,"Separator option is not valid for array-based chain");const n=s?m:m.split(r.separator||".");let t=g;for(let e=0;e{R.exports=function(...x){try{return JSON.stringify(...x)}catch(y){return"[Cannot display object: "+y.message+"]"}}},4277:(R,x)=>{const y={};x=R.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},y.typeMap=new Map([["[object Error]",x.error],["[object Map]",x.map],["[object Promise]",x.promise],["[object Set]",x.set],["[object WeakMap]",x.weakMap],["[object WeakSet]",x.weakSet]]),x.getInternalProto=function(l){if(Array.isArray(l))return x.array;if(l instanceof Date)return x.date;if(l instanceof RegExp)return x.regex;if(l instanceof Error)return x.error;const b=Object.prototype.toString.call(l);return y.typeMap.get(b)||x.generic}},7043:(R,x)=>{x.keys=function(y,l={}){return l.symbols!==!1?Reflect.ownKeys(y):Object.getOwnPropertyNames(y)}},3652:(R,x,y)=>{const l=y(375),b={};x.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(g,m){const r=[].concat((m=m||{}).before||[]),s=[].concat(m.after||[]),n=m.group||"?",t=m.sort||0;l(!r.includes(n),`Item cannot come before itself: ${n}`),l(!r.includes("?"),"Item cannot come before unassociated items"),l(!s.includes(n),`Item cannot come after itself: ${n}`),l(!s.includes("?"),"Item cannot come after unassociated items"),Array.isArray(g)||(g=[g]);for(const e of g){const a={seq:this._items.length,sort:t,before:r,after:s,group:n,node:e};this._items.push(a)}if(!m.manual){const e=this._sort();l(e,"item",n!=="?"?`added into group ${n}`:"","created a dependencies error")}return this.nodes}merge(g){Array.isArray(g)||(g=[g]);for(const r of g)if(r)for(const s of r._items)this._items.push(Object.assign({},s));this._items.sort(b.mergeSort);for(let r=0;rg.sort===m.sort?0:g.sort{const l=y(443),b=y(2178),g={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:l.URL||URL};x.analyze=function(m,r={}){if(!m)return b.code("DOMAIN_NON_EMPTY_STRING");if(typeof m!="string")throw new Error("Invalid input: domain must be a string");if(m.length>256)return b.code("DOMAIN_TOO_LONG");if(g.nonAsciiRx.test(m)){if(r.allowUnicode===!1)return b.code("DOMAIN_INVALID_UNICODE_CHARS");m=m.normalize("NFC")}if(g.domainControlRx.test(m))return b.code("DOMAIN_INVALID_CHARS");m=g.punycode(m),r.allowFullyQualified&&m[m.length-1]==="."&&(m=m.slice(0,-1));const s=r.minDomainSegments||g.minDomainSegments,n=m.split(".");if(n.lengthr.maxDomainSegments)return b.code("DOMAIN_SEGMENTS_COUNT_MAX");const t=r.tlds;if(t){const e=n[n.length-1].toLowerCase();if(t.deny&&t.deny.has(e)||t.allow&&!t.allow.has(e))return b.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e63)return b.code("DOMAIN_LONG_SEGMENT");if(e{const l=y(9848),b=y(5380),g=y(2178),m={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(l.TextEncoder||TextEncoder)};x.analyze=function(r,s){return m.email(r,s)},x.isValid=function(r,s){return!m.email(r,s)},m.email=function(r,s={}){if(typeof r!="string")throw new Error("Invalid input: email must be a string");if(!r)return g.code("EMPTY_STRING");const n=!m.nonAsciiRx.test(r);if(!n){if(s.allowUnicode===!1)return g.code("FORBIDDEN_UNICODE");r=r.normalize("NFC")}const t=r.split("@");if(t.length!==2)return t.length>2?g.code("MULTIPLE_AT_CHAR"):g.code("MISSING_AT_CHAR");const[e,a]=t;if(!e)return g.code("EMPTY_LOCAL");if(!s.ignoreLength){if(r.length>254)return g.code("ADDRESS_TOO_LONG");if(m.encoder.encode(e).length>64)return g.code("LOCAL_TOO_LONG")}return m.local(e,n)||b.analyze(a,s)},m.local=function(r,s){const n=r.split(".");for(const t of n){if(!t.length)return g.code("EMPTY_LOCAL_SEGMENT");if(s){if(!m.atextRx.test(t))return g.code("INVALID_LOCAL_CHARS")}else for(const e of t){if(m.atextRx.test(e))continue;const a=m.binary(e);if(!m.atomRx.test(a))return g.code("INVALID_LOCAL_CHARS")}}},m.binary=function(r){return Array.from(m.encoder.encode(r)).map(s=>String.fromCharCode(s)).join("")},m.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,m.atomRx=new 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})"].join("|"))},2178:(R,x)=>{x.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 @ character",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"},x.code=function(y){return{code:y,error:x.codes[y]}}},9959:(R,x,y)=>{const l=y(375),b=y(5752);x.regex=function(g={}){l(g.cidr===void 0||typeof g.cidr=="string","options.cidr must be a string");const m=g.cidr?g.cidr.toLowerCase():"optional";l(["required","optional","forbidden"].includes(m),"options.cidr must be one of required, optional, forbidden"),l(g.version===void 0||typeof g.version=="string"||Array.isArray(g.version),"options.version must be a string or an array of string");let r=g.version||["ipv4","ipv6","ipvfuture"];Array.isArray(r)||(r=[r]),l(r.length>=1,"options.version must have at least 1 version specified");for(let t=0;t{if(m==="forbidden")return b.ip[t];const e=`\\/${t==="ipv4"?b.ip.v4Cidr:b.ip.v6Cidr}`;return m==="required"?`${b.ip[t]}${e}`:`${b.ip[t]}(?:${e})?`}).join("|")})`,n=new RegExp(`^${s}$`);return{cidr:m,versions:r,regex:n,raw:s}}},5752:(R,x,y)=>{const l=y(375),b=y(6064),g={generate:function(){const m={},r="\\dA-Fa-f",s="["+r+"]",n="\\w-\\.~",t="!\\$&'\\(\\)\\*\\+,;=",e="%"+r,a=n+e+t+":@",i="["+a+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";m.ipv4address="(?:"+o+"\\.){3}"+o;const c=s+"{1,4}",f="(?:"+c+":"+c+"|"+m.ipv4address+")",d="(?:"+c+":){6}"+f,_="::(?:"+c+":){5}"+f,v="(?:"+c+")?::(?:"+c+":){4}"+f,u="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+f,h="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+f,p="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+f,w="(?:(?:"+c+":){0,4}"+c+")?::"+f,k="(?:(?:"+c+":){0,5}"+c+")?::"+c,$="(?:(?:"+c+":){0,6}"+c+")?::";m.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",m.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",m.ipv6address="(?:"+d+"|"+_+"|"+v+"|"+u+"|"+h+"|"+p+"|"+w+"|"+k+"|"+$+")",m.ipvFuture="v"+s+"+\\.["+n+t+":]+",m.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",m.schemeRegex=new RegExp(m.scheme);const j="["+n+e+t+":]*",S="["+n+e+t+"]{1,255}",E="(?:\\[(?:"+m.ipv6address+"|"+m.ipvFuture+")\\]|"+m.ipv4address+"|"+S+")",D="(?:"+j+"@)?"+E+"(?::\\d*)?",U="(?:"+j+"@)?("+E+")(?::\\d*)?",V=i+"*",M=i+"+",N="(?:\\/"+V+")*",B="\\/(?:"+M+N+")?",W=M+N,G="["+n+e+t+"@]+"+N,Z="(?:\\/\\/\\/"+V+N+")";return m.hierPart="(?:(?:\\/\\/"+D+N+")|"+B+"|"+W+"|"+Z+")",m.hierPartCapture="(?:(?:\\/\\/"+U+N+")|"+B+"|"+W+")",m.relativeRef="(?:(?:\\/\\/"+D+N+")|"+B+"|"+G+"|)",m.relativeRefCapture="(?:(?:\\/\\/"+U+N+")|"+B+"|"+G+"|)",m.query="["+a+"\\/\\?]*(?=#|$)",m.queryWithSquareBrackets="["+a+"\\[\\]\\/\\?]*(?=#|$)",m.fragment="["+a+"\\/\\?]*",m}};g.rfc3986=g.generate(),x.ip={v4Cidr:g.rfc3986.ipv4Cidr,v6Cidr:g.rfc3986.ipv6Cidr,ipv4:g.rfc3986.ipv4address,ipv6:g.rfc3986.ipv6address,ipvfuture:g.rfc3986.ipvFuture},g.createRegex=function(m){const r=g.rfc3986,s="(?:\\?"+(m.allowQuerySquareBrackets?r.queryWithSquareBrackets:r.query)+")?(?:#"+r.fragment+")?",n=m.domain?r.relativeRefCapture:r.relativeRef;if(m.relativeOnly)return g.wrap(n+s);let t="";if(m.scheme){l(m.scheme instanceof RegExp||typeof m.scheme=="string"||Array.isArray(m.scheme),"scheme must be a RegExp, String, or Array");const i=[].concat(m.scheme);l(i.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let c=0;c{const y={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};x.Parser=class{constructor(l,b={}){if(!b[y.settings]&&b.constants)for(const g in b.constants){const m=b.constants[g];if(m!==null&&!["boolean","number","string"].includes(typeof m))throw new Error(`Formula constant ${g} contains invalid ${typeof m} value type`)}this.settings=b[y.settings]?b:Object.assign({[y.settings]:!0,constants:{},functions:{}},b),this.single=null,this._parts=null,this._parse(l)}_parse(l){let b=[],g="",m=0,r=!1;const s=t=>{if(m)throw new Error("Formula missing closing parenthesis");const e=b.length?b[b.length-1]:null;if(r||g||t){if(e&&e.type==="reference"&&t===")")return e.type="function",e.value=this._subFormula(g,e.value),void(g="");if(t===")"){const a=new x.Parser(g,this.settings);b.push({type:"segment",value:a})}else if(r){if(r==="]")return b.push({type:"reference",value:g}),void(g="");b.push({type:"literal",value:g})}else if(y.operatorCharacters.includes(g))e&&e.type==="operator"&&y.operators.includes(e.value+g)?e.value+=g:b.push({type:"operator",value:g});else if(g.match(y.numberRx))b.push({type:"constant",value:parseFloat(g)});else if(this.settings.constants[g]!==void 0)b.push({type:"constant",value:this.settings.constants[g]});else{if(!g.match(y.tokenRx))throw new Error(`Formula contains invalid token: ${g}`);b.push({type:"reference",value:g})}g=""}};for(const t of l)r?t===r?(s(),r=!1):g+=t:m?t==="("?(g+=t,++m):t===")"?(--m,m?g+=t:s(t)):g+=t:t in y.literals?r=y.literals[t]:t==="("?(s(),++m):y.operatorCharacters.includes(t)?(s(),g=t,s()):t!==" "?g+=t:s();s(),b=b.map((t,e)=>t.type!=="operator"||t.value!=="-"||e&&b[e-1].type!=="operator"?t:{type:"operator",value:"n"});let n=!1;for(const t of b){if(t.type==="operator"){if(y.operatorsPrefix.includes(t.value))continue;if(!n)throw new Error("Formula contains an operator in invalid position");if(!y.operators.includes(t.value))throw new Error(`Formula contains an unknown operator ${t.value}`)}else if(n)throw new Error("Formula missing expected operator");n=!n}if(!n)throw new Error("Formula contains invalid trailing operator");b.length===1&&["reference","literal","constant"].includes(b[0].type)&&(this.single={type:b[0].type==="reference"?"reference":"value",value:b[0].value}),this._parts=b.map(t=>{if(t.type==="operator")return y.operatorsPrefix.includes(t.value)?t:t.value;if(t.type!=="reference")return t.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(t.value))throw new Error(`Formula contains invalid reference ${t.value}`);return this.settings.reference?this.settings.reference(t.value):y.reference(t.value)})}_subFormula(l,b){const g=this.settings.functions[b];if(typeof g!="function")throw new Error(`Formula contains unknown function ${b}`);let m=[];if(l){let r="",s=0,n=!1;const t=()=>{if(!r)throw new Error(`Formula contains function ${b} with invalid arguments ${l}`);m.push(r),r=""};for(let e=0;enew x.Parser(r,this.settings)),function(r){const s=[];for(const n of m)s.push(n.evaluate(r));return g.call(r,...s)}}evaluate(l){const b=this._parts.slice();for(let g=b.length-2;g>=0;--g){const m=b[g];if(m&&m.type==="operator"){const r=b[g+1];b.splice(g+1,1);const s=y.evaluate(r,l);b[g]=y.single(m.value,s)}}return y.operatorsOrder.forEach(g=>{for(let m=1;m":return b>g;case">=":return b>=g;case"==":return b===g;case"!=":return b!==g;case"&&":return b&&g;case"||":return b||g}return null},y.exists=function(l){return l!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:R=>{R.exports=JSON.parse('{"version":"17.12.0"}')}},I={},function R(x){var y=I[x];if(y!==void 0)return y.exports;var l=I[x]={exports:{}};return z[x](l,l.exports,R),l.exports}(5107);var z,I})})(_e);var Ie=_e.exports;const Le=Re(Ie);export{Le as J,Te as a,Ne as u};