Edit file File name : donationFormApp.js Content :(()=>{var e={4184:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var o=s.apply(null,r);o&&e.push(o)}}else if("object"===i){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}}return e.join(" ")}e.exports?(s.default=s,e.exports=s):void 0===(r=function(){return s}.apply(t,[]))||(e.exports=r)}()},2705:e=>{var t;self,t=()=>{return e={7629:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(9474),o=r(1687),a=r(8652),l=r(8160),c=r(3292),u=r(6354),f=r(8901),d=r(9708),m=r(6914),p=r(2294),h=r(6133),g=r(1152),y=r(8863),b=r(2036),v={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new p.Ids,this._preferences=null,this._refs=new h.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 n("function"==typeof d.describe,"Manifest functionality disabled"),d.describe(this)}allow(...e){return l.verifyFlat(e,"allow"),this._values(e,"_valids")}alter(e){n(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),n(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const r in e){const s=e[r];n("function"==typeof s,"Alteration adjuster for",r,"must be a function"),t.$_terms.alterations.push({target:r,adjuster:s})}return t.$_temp.ruleset=!1,t}artifact(e){return n(void 0!==e,"Artifact cannot be undefined"),n(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return n(!1===e||"string"==typeof e,"Invalid to value"),n(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return n(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return n(e,"Missing error"),n(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e,t={}){return n(void 0!==e,"Missing example"),l.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(n(!t,"Cannot combine options with description"),t=e.description,e=e.method),n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(n("string"==typeof e,"id must be a non-empty string"),n(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(...e){return this._values(e,"_invalids")}label(e){return n(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return n(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(...e){n(e.length,"Missing notes");for(const t of e)n(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!0){return n("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){n(e,"Missing preferences"),n(void 0===e.context,"Cannot override context"),n(void 0===e.externals,"Cannot override externals"),n(void 0===e.warnings,"Cannot override warnings"),n(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);const t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return n(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(e=!0){return this.$_setFlag("result",e?"raw":void 0)}result(e){return n(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),r=void 0!==e&&!e;return t._preferences=l.preferences(t._preferences,{convert:r}),t}strip(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){n(e.length,"Missing tags");for(const t of e)n(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return n(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){l.verifyFlat(e,"valid");const t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){const r=this.clone();r.$_terms.whens||(r.$_terms.whens=[]);const s=c.when(r,e,t);if(!["any","link"].includes(r.type)){const e=s.is?[s]:s.switch;for(const t of e)n(!t.then||"any"===t.then.type||t.then.type===r.type,"Cannot combine",r.type,"with",t.then&&t.then.type),n(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===r.type,"Cannot combine",r.type,"with",t.otherwise&&t.otherwise.type)}return r.$_terms.whens.push(s),r.$_mutateRebuild()}cache(e){n(!this._inRuleset(),"Cannot set caching inside a ruleset"),n(!this._cache,"Cannot override schema cache"),n(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||a.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){n(l.isSchema(e),"Invalid schema object"),n("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),n(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),n(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const r=e.clone();for(const e of Object.keys(t))"type"!==e&&(r[e]=t[e]);t=r}t._ids.concat(e._ids),t._refs.register(e,h.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=b.merge(t._valids,e._valids,e._invalids),t._invalids=b.merge(t._invalids,e._invalids,e._valids);for(const r of e._singleRules.keys())t._singleRules.has(r)&&(t._rules=t._rules.filter((e=>e.keep||e.name!==r)),t._singleRules.delete(r));for(const r of e._rules)e._definition.rules[r.method].multi||t._singleRules.set(r.name,r),t._rules.push(r);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const r=Object.assign({},e._flags);delete r.empty,o(t._flags,r)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const r=Object.assign({},e._flags);delete r.empty,o(t._flags,r)}else o(t._flags,e._flags);for(const r in e.$_terms){const n=e.$_terms[r];n?t.$_terms[r]?t.$_terms[r]=t.$_terms[r].concat(n):t.$_terms[r]=n.slice():t.$_terms[r]||(t.$_terms[r]=n)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return n(!e.base,"Cannot extend type with another base"),f.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){n(!this._inRuleset(),"Cannot fork inside a ruleset");let r=this;for(let n of[].concat(e))n=Array.isArray(n)?n:n.split("."),r=r._ids.fork(n,t,r);return r.$_temp.ruleset=!1,r}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),n(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const r=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;n(r>=0&&r<this._rules.length,"Cannot apply rules to empty ruleset");const i=this.clone();for(let o=r;o<i._rules.length;++o){const r=i._rules[o],a=s(r);for(const s in e)t.modifiers[s](a,e[s]),n(a.name===r.name,"Cannot change rule name");i._rules[o]=a,i._singleRules.get(a.name)===r&&i._singleRules.set(a.name,a)}return i.$_temp.ruleset=!1,i.$_mutateRebuild()}get ruleset(){n(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),n(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(const{target:r,adjuster:s}of this.$_terms.alterations)e.includes(r)&&(t=s(t),n(l.isSchema(t),"Alteration adjuster for",r,"failed to return a schema object"));return t=t.$_modify({each:t=>t.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),n(e&&"object"==typeof e,"Invalid options"),n(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)n("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const r=this._definition.rules[t.method],s=t.args;n(r,"Unknown rule",t.method);const i=this.clone();if(s){n(1===Object.keys(s).length||Object.keys(s).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in s){let o=s[e];if(r.argsByName){const a=r.argsByName.get(e);if(a.ref&&l.isResolvable(o))t._resolve.push(e),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),s[e]=o),a.assert){const t=l.validateArg(o,e,a);n(!t,t,"or reference")}}void 0!==o?s[e]=o:delete s[e]}}return r.multi||(i._ruleRemove(t.name,{clone:!1}),i._singleRules.set(t.name,t)),!1===i.$_temp.ruleset&&(i.$_temp.ruleset=null),r.priority?i._rules.unshift(t):i._rules.push(t),i}$_compile(e,t){return c.schema(this.$_root,e,t)}$_createError(e,t,r,n,s,i={}){const o=!1!==i.flags?this._flags:{},a=i.messages?m.merge(this._definition.messages,i.messages):this._definition.messages;return new u.Report(e,t,r,o,a,n,s)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,r,n){(r=Object.assign({},r)).abortEarly=!0,r._externals=!1,t.snapshot();const s=!y.validate(e,this,t,r,n).errors;return t.restore(),s}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),p.schema(this,e)||this}$_mutateRebuild(){return n(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,{source:t,name:r,path:n,key:s})=>{const i=this._definition[t][r]&&this._definition[t][r].register;!1!==i&&this.$_mutateRegister(e,{family:i,key:s})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:r}={}){this._refs.register(e,t),this._ids.register(e,{key:r})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,r={}){n("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const s=this._definition.flags[e]||{};if(i(t,s.default)&&(t=void 0),i(t,this._flags[e]))return this;const o=!1!==r.clone?this.clone():this;return void 0!==t?(o._flags[e]=t,o.$_mutateRegister(t)):delete o._flags[e],"_"!==e[0]&&(o.$_temp.ruleset=!1),o}$_parent(e,...t){return this[e][l.symbols.parent].call(this,...t)}$_validate(e,t,r){return y.validate(e,this,t,r)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=s(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const r in t){const n=t[r];e.$_terms[r]=n.init}return e.$_mutateRebuild()}_default(e,t,r={}){return l.assertOptions(r,"literal"),n(void 0!==t,"Missing",e,"value"),n("function"==typeof t||!r.literal,"Only function value supports literal option"),"function"==typeof t&&r.literal&&(t={[l.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,r){if(!this.$_terms.whens)return{schema:this};const n=[],s=[];for(let i=0;i<this.$_terms.whens.length;++i){const o=this.$_terms.whens[i];if(o.concat){n.push(o.concat),s.push(`${i}.concat`);continue}const a=o.ref?o.ref.resolve(e,t,r):e,l=o.is?[o]:o.switch,c=s.length;for(let c=0;c<l.length;++c){const{is:u,then:f,otherwise:d}=l[c],m=`${i}${o.switch?"."+c:""}`;if(u.$_match(a,t.nest(u,`${m}.is`),r)){if(f){const i=t.localize([...t.path,`${m}.then`],t.ancestors,t.schemas),{schema:o,id:a}=f._generate(e,i,r);n.push(o),s.push(`${m}.then${a?`(${a})`:""}`);break}}else if(d){const i=t.localize([...t.path,`${m}.otherwise`],t.ancestors,t.schemas),{schema:o,id:a}=d._generate(e,i,r);n.push(o),s.push(`${m}.otherwise${a?`(${a})`:""}`);break}}if(o.break&&s.length>c)break}const i=s.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",i),!i)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[i])return{schema:this.$_temp.whens[i],id:i};let o=this;this._definition.generate&&(o=this._definition.generate(this,e,t,r));for(const e of n)o=o.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(o,[this,...n]),this.$_temp.whens[i]=o,{schema:o,id:i}}_inner(e,t,r={}){n(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const s=this.clone();return s.$_terms[e]&&!r.override||(s.$_terms[e]=[]),r.single?s.$_terms[e].push(t):s.$_terms[e].push(...t),s.$_temp.ruleset=!1,s}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){if(!this._singleRules.has(e))return this;const r=!1!==t.clone?this.clone():this;r._singleRules.delete(e);const n=[];for(let t=0;t<r._rules.length;++t){const s=r._rules[t];s.name!==e||s.keep?n.push(s):r._inRuleset()&&t<r.$_temp.ruleset&&--r.$_temp.ruleset}return r._rules=n,r}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const r=this.clone(),s=e[0]===l.symbols.override;if(s&&(e=e.slice(1)),!r[t]&&e.length?r[t]=new b:s&&(r[t]=e.length?new b:null,r.$_mutateRebuild()),!r[t])return r;s&&r[t].override();for(const s of e){n(void 0!==s,"Cannot call allow/valid/invalid with undefined"),n(s!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";r[e]&&(r[e].remove(s),r[e].length||(n("_valids"===t||!r._flags.only,"Setting invalid value",s,"leaves schema rejecting all values due to previous valid rule"),r[e]=null)),r[t].add(s,r._refs)}return r}}};v.Base.prototype[l.symbols.any]={version:l.version,compile:c.compile,root:"$_root"},v.Base.prototype.isImmutable=!0,v.Base.prototype.deny=v.Base.prototype.invalid,v.Base.prototype.disallow=v.Base.prototype.invalid,v.Base.prototype.equal=v.Base.prototype.valid,v.Base.prototype.exist=v.Base.prototype.required,v.Base.prototype.not=v.Base.prototype.invalid,v.Base.prototype.options=v.Base.prototype.prefs,v.Base.prototype.preferences=v.Base.prototype.prefs,e.exports=new v.Base},8652:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(8160),o={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new o.Cache(e)},o.Cache=class{constructor(e={}){i.assertOptions(e,["max"]),n(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||o.max,this._map=new Map,this._list=new o.List}get length(){return this._map.size}set(e,t){if(null!==e&&!o.supported.has(typeof e))return;let r=this._map.get(e);if(r)return r.value=t,void this._list.first(r);r=this._list.unshift({key:e,value:t}),this._map.set(e,r),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),s(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},o.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:r}=e;return t.prev=r,r&&(r.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},8160:(e,t,r)=>{"use strict";const n=r(375),s=r(7916),i=r(5934);let o,a;const l={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=i.version,t.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},t.assertOptions=function(e,t,r="Options"){n(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const s=Object.keys(e).filter((e=>!t.includes(e)));n(0===s.length,`${r} contain unknown keys: ${s}`)},t.checkPreferences=function(e){a=a||r(3378);const t=a.preferences.validate(e);if(t.error)throw new s([t.error.details[0].message])},t.compare=function(e,t,r){switch(r){case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}},t.default=function(e,t){return void 0===e?t:e},t.isIsoDate=function(e){return l.isoDate.test(e)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isResolvable=function(e){return!!e&&(e[t.symbols.ref]||e[t.symbols.template])},t.isSchema=function(e,r={}){const s=e&&e[t.symbols.any];return!!s&&(n(r.legacy||s.version===t.version,"Cannot mix different versions of joi schemas"),!0)},t.isValues=function(e){return e[t.symbols.values]},t.limit=function(e){return Number.isSafeInteger(e)&&e>=0},t.preferences=function(e,n){o=o||r(6914),e=e||{},n=n||{};const s=Object.assign({},e,n);return n.errors&&e.errors&&(s.errors=Object.assign({},e.errors,n.errors),s.errors.wrap=Object.assign({},e.errors.wrap,n.errors.wrap)),n.messages&&(s.messages=o.compile(n.messages,e.messages)),delete s[t.symbols.prefs],s},t.tryWithPath=function(e,t,r={}){try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,r.append&&(e.message=`${e.message} (${e.path})`),e}},t.validateArg=function(e,r,{assert:n,message:s}){if(t.isSchema(n)){const t=n.validate(e);if(!t.error)return;return t.error.message}if(!n(e))return r?`${r} ${s}`:s},t.verifyFlat=function(e,t){for(const r of e)n(!Array.isArray(r),"Method no longer accepts array arguments:",t)}},3292:(e,t,r)=>{"use strict";const n=r(375),s=r(8160),i=r(6133),o={};t.schema=function(e,t,r={}){s.assertOptions(r,["appendPath","override"]);try{return o.schema(e,t,r)}catch(e){throw r.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},o.schema=function(e,t,r){n(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(n(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));const i=(t,...n)=>!1!==r.override?t.valid(e.override,...n):t.valid(...n);if(o.simple(t))return i(e,t);if("function"==typeof t)return e.custom(t);if(n("object"==typeof t,"Invalid schema content:",typeof t),s.isResolvable(t))return i(e,t);if(s.isSchema(t))return t;if(Array.isArray(t)){for(const r of t)if(!o.simple(r))return e.alternatives().try(...t);return i(e,...t)}return t instanceof RegExp?e.string().regex(t):t instanceof Date?i(e.date(),t):(n(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(t))},t.ref=function(e,t){return i.isRef(e)?e:i.create(e,t)},t.compile=function(e,r,i={}){s.assertOptions(i,["legacy"]);const a=r&&r[s.symbols.any];if(a)return n(i.legacy||a.version===s.version,"Cannot mix different versions of joi schemas:",a.version,s.version),r;if("object"!=typeof r||!i.legacy)return t.schema(e,r,{appendPath:!0});const l=o.walk(r);return l?l.compile(l.root,r):t.schema(e,r,{appendPath:!0})},o.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=o.walk(t);if(e)return e}return null}const t=e[s.symbols.any];if(t)return{root:e[t.root],compile:t.compile};n(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const r=o.walk(e[t]);if(r)return r}return null},o.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,r,a){if(void 0===a&&(n(r&&"object"==typeof r,"Missing options"),a=r,r=i.create(".")),Array.isArray(a)&&(a={switch:a}),s.assertOptions(a,["is","not","then","otherwise","switch","break"]),s.isSchema(r))return n(void 0===a.is,'"is" can not be used with a schema condition'),n(void 0===a.not,'"not" can not be used with a schema condition'),n(void 0===a.switch,'"switch" can not be used with a schema condition'),o.condition(e,{is:r,then:a.then,otherwise:a.otherwise,break:a.break});if(n(i.isRef(r)||"string"==typeof r,"Invalid condition:",r),n(void 0===a.not||void 0===a.is,'Cannot combine "is" with "not"'),void 0===a.switch){let l=a;void 0!==a.not&&(l={is:a.not,then:a.otherwise,otherwise:a.then,break:a.break});let c=void 0!==l.is?e.$_compile(l.is):e.$_root.invalid(null,!1,0,"").required();return n(void 0!==l.then||void 0!==l.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),n(void 0===l.break||void 0===l.then||void 0===l.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===a.is||i.isRef(a.is)||s.isSchema(a.is)||(c=c.required()),o.condition(e,{ref:t.ref(r),is:c,then:l.then,otherwise:l.otherwise,break:l.break})}n(Array.isArray(a.switch),'"switch" must be an array'),n(void 0===a.is,'Cannot combine "switch" with "is"'),n(void 0===a.not,'Cannot combine "switch" with "not"'),n(void 0===a.then,'Cannot combine "switch" with "then"');const l={ref:t.ref(r),switch:[],break:a.break};for(let t=0;t<a.switch.length;++t){const r=a.switch[t],o=t===a.switch.length-1;s.assertOptions(r,o?["is","then","otherwise"]:["is","then"]),n(void 0!==r.is,'Switch statement missing "is"'),n(void 0!==r.then,'Switch statement missing "then"');const c={is:e.$_compile(r.is),then:e.$_compile(r.then)};if(i.isRef(r.is)||s.isSchema(r.is)||(c.is=c.is.required()),o){n(void 0===a.otherwise||void 0===r.otherwise,'Cannot specify "otherwise" inside and outside a "switch"');const t=void 0!==a.otherwise?a.otherwise:r.otherwise;void 0!==t&&(n(void 0===l.break,"Cannot specify both otherwise and break"),c.otherwise=e.$_compile(t))}l.switch.push(c)}return l},o.condition=function(e,t){for(const r of["then","otherwise"])void 0===t[r]?delete t[r]:t[r]=e.$_compile(t[r]);return t}},6354:(e,t,r)=>{"use strict";const n=r(5688),s=r(8160),i=r(3328);t.Report=class{constructor(e,r,n,s,i,o,a){if(this.code=e,this.flags=s,this.messages=i,this.path=o.path,this.prefs=a,this.state=o,this.value=r,this.message=null,this.template=null,this.local=n||{},this.local.label=t.label(this.flags,this.state,this.prefs,this.messages),void 0===this.value||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];"object"!=typeof e&&(this.local.key=e)}}_setTemplate(e){if(this.template=e,!this.flags.label&&0===this.path.length){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const e=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return void 0===t?`Error code "${e}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(e,r){return t.template(this.value,e,r||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(const r of e)"object"!=typeof r&&("string"==typeof r?(t&&(t+="."),t+=r):t+=`[${r}]`);return t},t.template=function(e,t,r,n,o){if(!t)return;if(i.isTemplate(t))return"root"!==r?t:null;let a=o.errors.language;if(s.isResolvable(a)&&(a=a.resolve(e,n,o)),a&&t[a]){if(void 0!==t[a][r])return t[a][r];if(void 0!==t[a]["*"])return t[a]["*"]}return t[r]?t[r]:t["*"]},t.label=function(e,r,n,s){if(e.label)return e.label;if(!n.errors.label)return"";let i=r.path;return"key"===n.errors.label&&r.path.length>1&&(i=r.path.slice(-1)),t.path(i)||t.template(null,n.messages,"root",r,n)||s&&t.template(null,s,"root",r,n)||"value"},t.process=function(e,r,n){if(!e)return null;const{override:s,message:i,details:o}=t.details(e);if(s)return s;if(n.errors.stack)return new t.ValidationError(i,o,r);const a=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new t.ValidationError(i,o,r);return Error.stackTraceLimit=a,l},t.details=function(e,t={}){let r=[];const n=[];for(const s of e){if(s instanceof Error){if(!1!==t.override)return{override:s};const e=s.toString();r.push(e),n.push({message:e,type:"override",context:{error:s}});continue}const e=s.toString();r.push(e),n.push({message:e,path:s.path.filter((e=>"object"!=typeof e)),type:s.code,context:s.local})}return r.length>1&&(r=[...new Set(r)]),{message:r.join(". "),details:n}},t.ValidationError=class extends Error{constructor(e,t,r){super(e),this._original=r,this.details=t}static isError(e){return e instanceof t.ValidationError}},t.ValidationError.prototype.isJoi=!0,t.ValidationError.prototype.name="ValidationError",t.ValidationError.prototype.annotate=n.error},8901:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(8160),o=r(6914),a={};t.type=function(e,t){const r=Object.getPrototypeOf(e),l=s(r),c=e._assign(Object.create(l)),u=Object.assign({},t);delete u.base,l._definition=u;const f=r._definition||{};u.messages=o.merge(f.messages,u.messages),u.properties=Object.assign({},f.properties,u.properties),c.type=u.type,u.flags=Object.assign({},f.flags,u.flags);const d=Object.assign({},f.terms);if(u.terms)for(const e in u.terms){const t=u.terms[e];n(void 0===c.$_terms[e],"Invalid term override for",u.type,e),c.$_terms[e]=t.init,d[e]=t}u.terms=d,u.args||(u.args=f.args),u.prepare=a.prepare(u.prepare,f.prepare),u.coerce&&("function"==typeof u.coerce&&(u.coerce={method:u.coerce}),u.coerce.from&&!Array.isArray(u.coerce.from)&&(u.coerce={method:u.coerce.method,from:[].concat(u.coerce.from)})),u.coerce=a.coerce(u.coerce,f.coerce),u.validate=a.validate(u.validate,f.validate);const m=Object.assign({},f.rules);if(u.rules)for(const e in u.rules){const t=u.rules[e];n("object"==typeof t,"Invalid rule definition for",u.type,e);let r=t.method;if(void 0===r&&(r=function(){return this.$_addRule(e)}),r&&(n(!l[e],"Rule conflict in",u.type,e),l[e]=r),n(!m[e],"Rule conflict in",u.type,e),m[e]=t,t.alias){const e=[].concat(t.alias);for(const r of e)l[r]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map((e=>("string"==typeof e&&(e={name:e}),n(!t.argsByName.has(e.name),"Duplicated argument name",e.name),i.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e))))}u.rules=m;const p=Object.assign({},f.modifiers);if(u.modifiers)for(const e in u.modifiers){n(!l[e],"Rule conflict in",u.type,e);const t=u.modifiers[e];n("function"==typeof t,"Invalid modifier definition for",u.type,e);const r=function(t){return this.rule({[e]:t})};l[e]=r,p[e]=t}if(u.modifiers=p,u.overrides){l._super=r,c.$_super={};for(const e in u.overrides)n(r[e],"Cannot override missing",e),u.overrides[e][i.symbols.parent]=r[e],c.$_super[e]=r[e].bind(c);Object.assign(l,u.overrides)}u.cast=Object.assign({},f.cast,u.cast);const h=Object.assign({},f.manifest,u.manifest);return h.build=a.build(u.manifest&&u.manifest.build,f.manifest&&f.manifest.build),u.manifest=h,u.rebuild=a.rebuild(u.rebuild,f.rebuild),c},a.build=function(e,t){return e&&t?function(r,n){return t(e(r,n),n)}:e||t},a.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(r,n){let s;if((!t.from||t.from.includes(typeof r))&&(s=t.method(r,n),s)){if(s.errors||void 0===s.value)return s;r=s.value}if(!e.from||e.from.includes(typeof r)){const t=e.method(r,n);if(t)return t}return s}}:e||t},a.prepare=function(e,t){return e&&t?function(r,n){const s=e(r,n);if(s){if(s.errors||void 0===s.value)return s;r=s.value}return t(r,n)||s}:e||t},a.rebuild=function(e,t){return e&&t?function(r){t(r),e(r)}:e||t},a.validate=function(e,t){return e&&t?function(r,n){const s=t(r,n);if(s){if(s.errors&&(!Array.isArray(s.errors)||s.errors.length))return s;r=s.value}return e(r,n)||s}:e||t}},5107:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(8652),o=r(8160),a=r(3292),l=r(6354),c=r(8901),u=r(9708),f=r(6133),d=r(3328),m=r(1152);let p;const h={types:{alternatives:r(4946),any:r(8068),array:r(546),boolean:r(4937),date:r(7500),function:r(390),link:r(8785),number:r(3832),object:r(8966),string:r(7417),symbol:r(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const e={_types:new Set(Object.keys(h.types))};for(const t of e._types)e[t]=function(...e){return n(!e.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments"),h.generate(this,h.types[t],e)};for(const t of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])e[t]=function(...e){return this.any()[t](...e)};Object.assign(e,h.methods);for(const t in h.aliases){const r=h.aliases[t];e[t]=e[r]}return e.x=e.expression,m.setup&&m.setup(e),e}};h.methods={ValidationError:l.ValidationError,version:o.version,cache:i.provider,assert(e,t,...r){h.assert(e,t,!0,r)},attempt:(e,t,...r)=>h.assert(e,t,!1,r),build(e){return n("function"==typeof u.build,"Manifest functionality disabled"),u.build(this,e)},checkPreferences(e){o.checkPreferences(e)},compile(e,t){return a.compile(this,e,t)},defaults(e){n("function"==typeof e,"modifier must be a function");const t=Object.assign({},this);for(const r of t._types){const s=e(t[r]());n(o.isSchema(s),"modifier must return a valid schema object"),t[r]=function(...e){return h.generate(this,s,e)}}return t},expression:(...e)=>new d(...e),extend(...e){o.verifyFlat(e,"extend"),p=p||r(3378),n(e.length,"You need to provide at least one extension"),this.assert(e,p.extensions);const t=Object.assign({},this);t._types=new Set(t._types);for(let r of e){"function"==typeof r&&(r=r(t)),this.assert(r,p.extension);const e=h.expandExtension(r,t);for(const r of e){n(void 0===t[r.type]||t._types.has(r.type),"Cannot override name",r.type);const e=r.base||this.any(),s=c.type(e,r);t._types.add(r.type),t[r.type]=function(...e){return h.generate(this,s,e)}}}return t},isError:l.ValidationError.isError,isExpression:d.isTemplate,isRef:f.isRef,isSchema:o.isSchema,in:(...e)=>f.in(...e),override:o.symbols.override,ref:(...e)=>f.create(...e),types(){const e={};for(const t of this._types)e[t]=this[t]();for(const t in h.aliases)e[t]=this[t]();return e}},h.assert=function(e,t,r,n){const i=n[0]instanceof Error||"string"==typeof n[0]?n[0]:null,a=null!==i?n[1]:n[0],c=t.validate(e,o.preferences({errors:{stack:!0}},a||{}));let u=c.error;if(!u)return c.value;if(i instanceof Error)throw i;const f=r&&"function"==typeof u.annotate?u.annotate():u.message;throw u instanceof l.ValidationError==0&&(u=s(u)),u.message=i?`${i} ${f}`:f,u},h.generate=function(e,t,r){return n(e,"Must be invoked on a Joi instance."),t.$_root=e,t._definition.args&&r.length?t._definition.args(t,...r):t},h.expandExtension=function(e,t){if("string"==typeof e.type)return[e];const r=[];for(const n of t._types)if(e.type.test(n)){const s=Object.assign({},e);s.type=n,s.base=t[n](),r.push(s)}return r},e.exports=h.root()},6914:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(3328);t.compile=function(e,t){if("string"==typeof e)return n(!t,"Cannot set single message string"),new i(e);if(i.isTemplate(e))return n(!t,"Cannot set single message template"),e;n("object"==typeof e&&!Array.isArray(e),"Invalid message options"),t=t?s(t):{};for(let r in e){const s=e[r];if("root"===r||i.isTemplate(s)){t[r]=s;continue}if("string"==typeof s){t[r]=new i(s);continue}n("object"==typeof s&&!Array.isArray(s),"Invalid message for",r);const o=r;for(r in t[o]=t[o]||{},s){const e=s[r];"root"===r||i.isTemplate(e)?t[o][r]=e:(n("string"==typeof e,"Invalid message for",r,"in",o),t[o][r]=new i(e))}}return t},t.decompile=function(e){const t={};for(let r in e){const n=e[r];if("root"===r){t.root=n;continue}if(i.isTemplate(n)){t[r]=n.describe({compact:!0});continue}const s=r;for(r in t[s]={},n){const e=n[r];"root"!==r?t[s][r]=e.describe({compact:!0}):t[s].root=e}}return t},t.merge=function(e,r){if(!e)return t.compile(r);if(!r)return e;if("string"==typeof r)return new i(r);if(i.isTemplate(r))return r;const o=s(e);for(let e in r){const t=r[e];if("root"===e||i.isTemplate(t)){o[e]=t;continue}if("string"==typeof t){o[e]=new i(t);continue}n("object"==typeof t&&!Array.isArray(t),"Invalid message for",e);const s=e;for(e in o[s]=o[s]||{},t){const r=t[e];"root"===e||i.isTemplate(r)?o[s][e]=r:(n("string"==typeof r,"Invalid message for",e,"in",s),o[s][e]=new i(r))}}return o}},2294:(e,t,r)=>{"use strict";const n=r(375),s=r(8160),i=r(6133),o={};t.Ids=o.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new o.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,r]of e._byId.entries())n(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,r);for(const[t,r]of e._byKey.entries())n(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,r)}fork(e,t,r){const i=this._collect(e);i.push({schema:r});const a=i.shift();let l={id:a.id,schema:t(a.schema)};n(s.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of i)l={id:e.id,schema:o.fork(e.schema,l.id,l.schema)};return l.schema}labels(e,t=[]){const r=e[0],n=this._get(r);if(!n)return[...t,...e].join(".");const s=e.slice(1);return t=[...t,n.schema._flags.label||r],s.length?n.schema._ids.labels(s,t):t.join(".")}reach(e,t=[]){const r=e[0],s=this._get(r);n(s,"Schema does not contain path",[...t,...e].join("."));const i=e.slice(1);return i.length?s.schema._ids.reach(i,[...t,r]):s.schema}register(e,{key:t}={}){if(!e||!s.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const r=e._flags.id;if(r){const t=this._byId.get(r);n(!t||t.schema===e,"Cannot add different schemas with the same id:",r),n(!this._byKey.has(r),"Schema id conflicts with existing key:",r),this._byId.set(r,{schema:e,id:r})}t&&(n(!this._byKey.has(t),"Schema already contains key:",t),n(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,t=[],r=[]){const s=e[0],i=this._get(s);n(i,"Schema does not contain path",[...t,...e].join(".")),r=[i,...r];const o=e.slice(1);return o.length?i.schema._ids._collect(o,[...t,s],r):r}_get(e){return this._byId.get(e)||this._byKey.get(e)}},o.fork=function(e,r,n){const s=t.schema(e,{each:(e,{key:t})=>{if(r===(e._flags.id||t))return n},ref:!1});return s?s.$_mutateRebuild():e},t.schema=function(e,t){let r;for(const n in e._flags){if("_"===n[0])continue;const s=o.scan(e._flags[n],{source:"flags",name:n},t);void 0!==s&&(r=r||e.clone(),r._flags[n]=s)}for(let n=0;n<e._rules.length;++n){const s=e._rules[n],i=o.scan(s.args,{source:"rules",name:s.name},t);if(void 0!==i){r=r||e.clone();const t=Object.assign({},s);t.args=i,r._rules[n]=t,r._singleRules.get(s.name)===s&&r._singleRules.set(s.name,t)}}for(const n in e.$_terms){if("_"===n[0])continue;const s=o.scan(e.$_terms[n],{source:"terms",name:n},t);void 0!==s&&(r=r||e.clone(),r.$_terms[n]=s)}return r},o.scan=function(e,t,r,n,a){const l=n||[];if(null===e||"object"!=typeof e)return;let c;if(Array.isArray(e)){for(let n=0;n<e.length;++n){const s="terms"===t.source&&"keys"===t.name&&e[n].key,i=o.scan(e[n],t,r,[n,...l],s);void 0!==i&&(c=c||e.slice(),c[n]=i)}return c}if(!1!==r.schema&&s.isSchema(e)||!1!==r.ref&&i.isRef(e)){const n=r.each(e,{...t,path:l,key:a});if(n===e)return;return n}for(const n in e){if("_"===n[0])continue;const s=o.scan(e[n],t,r,[n,...l],a);void 0!==s&&(c=c||Object.assign({},e),c[n]=s)}return c}},6133:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(9621),o=r(8160);let a;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e,t={}){n("string"==typeof e,"Invalid reference key:",e),o.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),n(!t.prefix||"object"==typeof t.prefix,"options.prefix must be of type object");const r=Object.assign({},l.defaults,t);delete r.prefix;const s=r.separator,i=l.context(e,s,t.prefix);if(r.type=i.type,e=i.key,"value"===r.type)if(i.root&&(n(!s||e[0]!==s,"Cannot specify relative path with root prefix"),r.ancestor="root",e||(e=null)),s&&s===e)e=null,r.ancestor=0;else if(void 0!==r.ancestor)n(!s||!e||e[0]!==s,"Cannot combine prefix with ancestor option");else{const[t,n]=l.ancestor(e,s);n&&""===(e=e.slice(n))&&(e=null),r.ancestor=t}return r.path=s?null===e?[]:e.split(s):[e],new l.Ref(r)},t.in=function(e,r={}){return t.create(e,{...r,in:!0})},t.isRef=function(e){return!!e&&!!e[o.symbols.ref]},l.Ref=class{constructor(e){n("object"==typeof e,"Invalid reference construction"),o.assertOptions(e,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),n([!1,void 0].includes(e.separator)||"string"==typeof e.separator&&1===e.separator.length,"Invalid separator"),n(!e.adjust||"function"==typeof e.adjust,"options.adjust must be a function"),n(!e.map||Array.isArray(e.map),"options.map must be an array"),n(!e.map||!e.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,e),n("value"===this.type||void 0===this.ancestor,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(e,t,r,s,i={}){return n(!this.in||i.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(r.context,t,i):"local"===this.type?this._resolve(s,t,i):this.ancestor?"root"===this.ancestor?this._resolve(t.ancestors[t.ancestors.length-1],t,i):(n(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,i)):this._resolve(e,t,i)}_resolve(e,t,r){let n;if("value"===this.type&&t.mainstay.shadow&&!1!==r.shadow&&(n=t.mainstay.shadow.get(this.absolute(t))),void 0===n&&(n=i(e,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(n=this.adjust(n)),this.map){const e=this.map.get(n);void 0!==e&&(n=e)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,n),n}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const e={path:this.path};"value"!==this.type&&(e.type=this.type),"."!==this.separator&&(e.separator=this.separator),"value"===this.type&&1!==this.ancestor&&(e.ancestor=this.ancestor),this.map&&(e.map=[...this.map]);for(const t of["adjust","iterables","render"])null!==this[t]&&void 0!==this[t]&&(e[t]=this[t]);return!1!==this.in&&(e.in=!0),{ref:e}}updateDisplay(){const e=null!==this.key?this.key:"";if("value"!==this.type)return void(this.display=`ref:${this.type}:${e}`);if(!this.separator)return void(this.display=`ref:${e}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${e}`);if("root"===this.ancestor)return void(this.display=`ref:root:${e}`);if(1===this.ancestor)return void(this.display=`ref:${e||".."}`);const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}},l.Ref.prototype[o.symbols.ref]=!0,t.build=function(e){return"value"===(e=Object.assign({},l.defaults,e)).type&&void 0===e.ancestor&&(e.ancestor=1),new l.Ref(e)},l.context=function(e,t,r={}){if(e=e.trim(),r){const n=void 0===r.global?"$":r.global;if(n!==t&&e.startsWith(n))return{key:e.slice(n.length),type:"global"};const s=void 0===r.local?"#":r.local;if(s!==t&&e.startsWith(s))return{key:e.slice(s.length),type:"local"};const i=void 0===r.root?"/":r.root;if(i!==t&&e.startsWith(i))return{key:e.slice(i.length),type:"value",root:!0}}return{key:e,type:"value"}},l.ancestor=function(e,t){if(!t)return[1,0];if(e[0]!==t)return[1,0];if(e[1]!==t)return[0,1];let r=2;for(;e[r]===t;)++r;return[r-1,r]},t.toSibling=0,t.toParent=1,t.Manager=class{constructor(){this.refs=[]}register(e,n){if(e)if(n=void 0===n?t.toParent:n,Array.isArray(e))for(const t of e)this.register(t,n);else if(o.isSchema(e))for(const t of e._refs.refs)t.ancestor-n>=0&&this.refs.push({ancestor:t.ancestor-n,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-n>=0&&this.refs.push({ancestor:e.ancestor-n,root:e.root}),a=a||r(3328),a.isTemplate(e)&&this.register(e.refs(),n)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=s(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter((e=>!e.ancestor)).map((e=>e.root))}}},3378:(e,t,r)=>{"use strict";const n=r(5107),s={};s.wrap=n.string().min(1).max(2).allow(!1),t.preferences=n.object({allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),context:n.object(),convert:n.boolean(),dateFormat:n.valid("date","iso","string","time","utc"),debug:n.boolean(),errors:{escapeHtml:n.boolean(),label:n.valid("path","key",!1),language:[n.string(),n.object().ref()],render:n.boolean(),stack:n.boolean(),wrap:{label:s.wrap,array:s.wrap,string:s.wrap}},externals:n.boolean(),messages:n.object(),noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:n.valid("required","optional","forbidden"),skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()}).strict(),s.nameRx=/^[a-zA-Z0-9]\w*$/,s.rule=n.object({alias:n.array().items(n.string().pattern(s.nameRx)).single(),args:n.array().items(n.string(),n.object({name:n.string().pattern(s.nameRx).required(),ref:n.boolean(),assert:n.alternatives([n.function(),n.object().schema()]).conditional("ref",{is:!0,then:n.required()}),normalize:n.function(),message:n.string().when("assert",{is:n.function(),then:n.required()})})),convert:n.boolean(),manifest:n.boolean(),method:n.function().allow(!1),multi:n.boolean(),validate:n.function()}),t.extension=n.object({type:n.alternatives([n.string(),n.object().regex()]).required(),args:n.function(),cast:n.object().pattern(s.nameRx,n.object({from:n.function().maxArity(1).required(),to:n.function().minArity(1).maxArity(2).required()})),base:n.object().schema().when("type",{is:n.object().regex(),then:n.forbidden()}),coerce:[n.function().maxArity(3),n.object({method:n.function().maxArity(3).required(),from:n.array().items(n.string()).single()})],flags:n.object().pattern(s.nameRx,n.object({setter:n.string(),default:n.any()})),manifest:{build:n.function().arity(2)},messages:[n.object(),n.string()],modifiers:n.object().pattern(s.nameRx,n.function().minArity(1).maxArity(2)),overrides:n.object().pattern(s.nameRx,n.function()),prepare:n.function().maxArity(3),rebuild:n.function().arity(1),rules:n.object().pattern(s.nameRx,s.rule),terms:n.object().pattern(s.nameRx,n.object({init:n.array().allow(null).required(),manifest:n.object().pattern(/.+/,[n.valid("schema","single"),n.object({mapped:n.object({from:n.string().required(),to:n.string().required()}).required()})])})),validate:n.function().maxArity(3)}).strict(),t.extensions=n.array().items(n.object(),n.function().arity(1)).strict(),s.desc={buffer:n.object({buffer:n.string()}),func:n.object({function:n.function().required(),options:{literal:!0}}),override:n.object({override:!0}),ref:n.object({ref:n.object({type:n.valid("value","global","local"),path:n.array().required(),separator:n.string().length(1).allow(!1),ancestor:n.number().min(0).integer().allow("root"),map:n.array().items(n.array().length(2)).min(1),adjust:n.function(),iterables:n.boolean(),in:n.boolean(),render:n.boolean()}).required()}),regex:n.object({regex:n.string().min(3)}),special:n.object({special:n.valid("deep").required()}),template:n.object({template:n.string().required(),options:n.object()}),value:n.object({value:n.alternatives([n.object(),n.array()]).required()})},s.desc.entity=n.alternatives([n.array().items(n.link("...")),n.boolean(),n.function(),n.number(),n.string(),s.desc.buffer,s.desc.func,s.desc.ref,s.desc.regex,s.desc.special,s.desc.template,s.desc.value,n.link("/")]),s.desc.values=n.array().items(null,n.boolean(),n.function(),n.number().allow(1/0,-1/0),n.string().allow(""),n.symbol(),s.desc.buffer,s.desc.func,s.desc.override,s.desc.ref,s.desc.regex,s.desc.template,s.desc.value),s.desc.messages=n.object().pattern(/.+/,[n.string(),s.desc.template,n.object().pattern(/.+/,[n.string(),s.desc.template])]),t.description=n.object({type:n.string().required(),flags:n.object({cast:n.string(),default:n.any(),description:n.string(),empty:n.link("/"),failover:s.desc.entity,id:n.string(),label:n.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:n.boolean(),unit:n.string()}).unknown(),preferences:{allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),convert:n.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:n.boolean(),label:["path","key"],language:[n.string(),s.desc.ref],wrap:{label:s.wrap,array:s.wrap}},externals:n.boolean(),messages:s.desc.messages,noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:["required","optional","forbidden"],skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()},allow:s.desc.values,invalid:s.desc.values,rules:n.array().min(1).items({name:n.string().required(),args:n.object().min(1),keep:n.boolean(),message:[n.string(),s.desc.messages],warn:n.boolean()}),keys:n.object().pattern(/.*/,n.link("/")),link:s.desc.ref}).pattern(/^[a-z]\w*$/,n.any())},493:(e,t,r)=>{"use strict";const n=r(8571),s=r(9621),i=r(8160),o={value:Symbol("value")};e.exports=o.State=class{constructor(e,t,r){this.path=e,this.ancestors=t,this.mainstay=r.mainstay,this.schemas=r.schemas,this.debug=null}localize(e,t=null,r=null){const n=new o.State(e,t,this);return r&&n.schemas&&(n.schemas=[o.schemas(r),...n.schemas]),n}nest(e,t){const r=new o.State(this.path,this.ancestors,this);return r.schemas=r.schemas&&[o.schemas(e),...r.schemas],r.debug=t,r}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new o.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=n(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()}},o.schemas=function(e){return i.isSchema(e)?{schema:e}:e},o.Shadow=class{constructor(){this._values=null}set(e,t,r){if(!e.length)return;if("strip"===r&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let n=this._values;for(let t=0;t<e.length;++t){const r=e[t];let s=n.get(r);s||(s=new Map,n.set(r,s)),n=s}n[o.value]=t}get(e){const t=this.node(e);if(t)return t[o.value]}node(e){if(this._values)return s(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;const r=e.slice(0,-1),n=e[e.length-1],i=s(this._values,r,{iterables:!0});t?i.set(n,t):i&&i.delete(n)}}},3328:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(5277),o=r(1447),a=r(8160),l=r(6354),c=r(6133),u={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}};e.exports=u.Template=class{constructor(e,t){if(n("string"==typeof e,"Template source must be a string"),n(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,t){const{functions:e,...r}=t;this._settings=Object.keys(r).length?s(r):void 0,this._functions=e,this._functions&&(n(Object.keys(this._functions).every((e=>"string"==typeof e)),"Functions keys must be strings"),n(Object.values(this._functions).every((e=>"function"==typeof e)),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const e=u.encode(this.source),t=u.split(e);let r=!1;const n=[],s=t.shift();s&&n.push(s);for(const e of t){const t="{"!==e[0],s=t?"}":"}}",i=e.indexOf(s);if(-1===i||"{"===e[1]){n.push(`{${u.decode(e)}`);continue}let o=e.slice(t?0:1,i);const a=":"===o[0];a&&(o=o.slice(1));const l=this._ref(u.decode(o),{raw:t,wrapped:a});n.push(l),"string"!=typeof l&&(r=!0);const c=e.slice(i+s.length);c&&n.push(u.decode(c))}r?this._template=n:this.rendered=n.join("")}static date(e,t){return u.dateFormat[t.dateFormat].call(e)}describe(e={}){if(!this._settings&&e.compact)return this.source;const t={template:this.source};return this._settings&&(t.options=this._settings),this._functions&&(t.functions=this._functions),t}static build(e){return new u.Template(e.template,e.options||e.functions?{...e.options,functions:e.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[a.symbols.template]}refs(){if(!this._template)return;const e=[];for(const t of this._template)"string"!=typeof t&&e.push(...t.refs);return e}resolve(e,t,r,n){return this._template&&1===this._template.length?this._part(this._template[0],e,t,r,n,{}):this.render(e,t,r,n)}_part(e,...t){return e.ref?e.ref.resolve(...t):e.formula.evaluate(t)}render(e,t,r,n,s={}){if(!this.isDynamic())return this.rendered;const o=[];for(const a of this._template)if("string"==typeof a)o.push(a);else{const l=this._part(a,e,t,r,n,s),c=u.stringify(l,e,t,r,n,s);if(void 0!==c){const e=a.raw||!1===(s.errors&&s.errors.escapeHtml)?c:i(c);o.push(u.wrap(e,a.wrapped&&r.errors.wrap.label))}}return o.join("")}_ref(e,{raw:t,wrapped:r}){const n=[],s=e=>{const t=c.create(e,this._settings);return n.push(t),e=>{const r=t.resolve(...e);return void 0!==r?r:null}};try{const t=this._functions?{...u.functions,...this._functions}:u.functions;var i=new o.Parser(e,{reference:s,functions:t,constants:u.constants})}catch(t){throw t.message=`Invalid template variable "${e}" fails due to: ${t.message}`,t}if(i.single){if("reference"===i.single.type){const e=n[0];return{ref:e,raw:t,refs:n,wrapped:r||"local"===e.type&&"label"===e.key}}return u.stringify(i.single.value)}return{formula:i,raw:t,refs:n}}toString(){return this.source}},u.Template.prototype[a.symbols.template]=!0,u.Template.prototype.isImmutable=!0,u.encode=function(e){return e.replace(/\\(\{+)/g,((e,t)=>u.opens.slice(0,t.length))).replace(/\\(\}+)/g,((e,t)=>u.closes.slice(0,t.length)))},u.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},u.split=function(e){const t=[];let r="";for(let n=0;n<e.length;++n){const s=e[n];if("{"===s){let s="";for(;n+1<e.length&&"{"===e[n+1];)s+="{",++n;t.push(r),r=s}else r+=s}return t.push(r),t},u.wrap=function(e,t){return t?1===t.length?`${t}${e}${t}`:`${t[0]}${e}${t[1]}`:e},u.stringify=function(e,t,r,n,s,i={}){const o=typeof e,a=n&&n.errors&&n.errors.wrap||{};let l=!1;if(c.isRef(e)&&e.render&&(l=e.in,e=e.resolve(t,r,n,s,{in:e.in,...i})),null===e)return"null";if("string"===o)return u.wrap(e,i.arrayItems&&a.string);if("number"===o||"function"===o||"symbol"===o)return e.toString();if("object"!==o)return JSON.stringify(e);if(e instanceof Date)return u.Template.date(e,n);if(e instanceof Map){const t=[];for(const[r,n]of e.entries())t.push(`${r.toString()} -> ${n.toString()}`);e=t}if(!Array.isArray(e))return e.toString();const f=[];for(const o of e)f.push(u.stringify(o,t,r,n,s,{arrayItems:!0,...i}));return u.wrap(f.join(", "),!l&&a.array)},u.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},u.functions={if:(e,t,r)=>e?t:r,length:e=>"string"==typeof e?e.length:e&&"object"==typeof e?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){const[t,r,n,s,i]=this,o=i.messages;if(!o)return"";const a=l.template(t,o[0],e,r,n)||l.template(t,o[1],e,r,n);return a?a.render(t,r,n,s,i):""},number:e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e):"boolean"==typeof e?e?1:0:e instanceof Date?e.getTime():null}},4946:(e,t,r)=>{"use strict";const n=r(375),s=r(1687),i=r(8068),o=r(8160),a=r(3292),l=r(6354),c=r(6133),u={};e.exports=i.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:c.toSibling}},args:(e,...t)=>1===t.length&&Array.isArray(t[0])?e.try(...t[0]):e.try(...t),validate(e,t){const{schema:r,error:n,state:i,prefs:o}=t;if(r._flags.match){const t=[],a=[];for(let n=0;n<r.$_terms.matches.length;++n){const s=r.$_terms.matches[n],l=i.nest(s.schema,`match.${n}`);l.snapshot();const c=s.schema.$_validate(e,l,o);c.errors?(a.push(c.errors),l.restore()):(t.push(c.value),l.commit())}if(0===t.length)return{errors:n("alternatives.any",{details:a.map((e=>l.details(e,{override:!1})))})};if("one"===r._flags.match)return 1===t.length?{value:t[0]}:{errors:n("alternatives.one")};if(t.length!==r.$_terms.matches.length)return{errors:n("alternatives.all",{details:a.map((e=>l.details(e,{override:!1})))})};const c=e=>e.$_terms.matches.some((e=>"object"===e.schema.type||"alternatives"===e.schema.type&&c(e.schema)));return c(r)?{value:t.reduce(((e,t)=>s(e,t,{mergeArrays:!1})))}:{value:t[t.length-1]}}const a=[];for(let t=0;t<r.$_terms.matches.length;++t){const n=r.$_terms.matches[t];if(n.schema){const r=i.nest(n.schema,`match.${t}`);r.snapshot();const s=n.schema.$_validate(e,r,o);if(!s.errors)return r.commit(),s;r.restore(),a.push({schema:n.schema,reports:s.errors});continue}const s=n.ref?n.ref.resolve(e,i,o):e,l=n.is?[n]:n.switch;for(let r=0;r<l.length;++r){const a=l[r],{is:c,then:u,otherwise:f}=a,d=`match.${t}${n.switch?"."+r:""}`;if(c.$_match(s,i.nest(c,`${d}.is`),o)){if(u)return u.$_validate(e,i.nest(u,`${d}.then`),o)}else if(f)return f.$_validate(e,i.nest(f,`${d}.otherwise`),o)}}return u.errors(a,t)},rules:{conditional:{method(e,t){n(!this._flags._endedSwitch,"Unreachable condition"),n(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),n(void 0===t.break,"Cannot use break option with alternatives conditional");const r=this.clone(),s=a.when(r,e,t),i=s.is?[s]:s.switch;for(const e of i)if(e.then&&e.otherwise){r.$_setFlag("_endedSwitch",!0,{clone:!1});break}return r.$_terms.matches.push(s),r.$_mutateRebuild()}},match:{method(e){if(n(["any","one","all"].includes(e),"Invalid alternatives match mode",e),"any"!==e)for(const t of this.$_terms.matches)n(t.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(...e){n(e.length,"Missing alternative schemas"),o.verifyFlat(e,"try"),n(!this._flags._endedSwitch,"Unreachable condition");const t=this.clone();for(const r of e)t.$_terms.matches.push({schema:t.$_compile(r)});return t.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,r)=>"is"!==r.path[0]&&"string"!=typeof t._flags.label?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{o.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const r of t.matches){const{schema:t,ref:n,is:s,not:i,then:o,otherwise:a}=r;e=t?e.try(t):n?e.conditional(n,{is:s,then:o,not:i,otherwise:a,switch:r.switch}):e.conditional(s,{then:o,otherwise:a})}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}}"}}),u.errors=function(e,{error:t,state:r}){if(!e.length)return{errors:t("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const n=new Set,s=[];for(const{reports:i,schema:o}of e){if(i.length>1)return u.unmatched(e,t);const a=i[0];if(a instanceof l.Report==0)return u.unmatched(e,t);if(a.state.path.length!==r.path.length){s.push({type:o.type,report:a});continue}if("any.only"===a.code){for(const e of a.local.valids)n.add(e);continue}const[c,f]=a.code.split(".");"base"===f?n.add(c):s.push({type:o.type,report:a})}return s.length?1===s.length?{errors:s[0].report}:u.unmatched(e,t):{errors:t("alternatives.types",{types:[...n]})}},u.unmatched=function(e,t){const r=[];for(const t of e)r.push(...t.reports);return{errors:t("alternatives.match",l.details(r,{override:!1}))}}},8068:(e,t,r)=>{"use strict";const n=r(375),s=r(7629),i=r(8160),o=r(6914);e.exports=s.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,{method:r}){try{return r(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){n(i.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return n(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate:(e,t,{code:r,local:n})=>t.error(r,n),args:["code","local"],multi:!0}},modifiers:{keep(e,t=!0){e.keep=t},message(e,t){e.message=o.compile(t)},warn(e,t=!0){e.warn=t}},manifest:{build(e,t){for(const r in t){const n=t[r];if(["examples","externals","metas","notes","tags"].includes(r))for(const t of n)e=e[r.slice(0,-1)](t);else if("alterations"!==r)if("whens"!==r){if("shared"===r)for(const t of n)e=e.shared(t)}else for(const t of n){const{ref:r,is:n,not:s,then:i,otherwise:o,concat:a}=t;e=a?e.concat(a):r?e.when(r,{is:n,not:s,then:i,otherwise:o,switch:t.switch,break:t.break}):e.when(n,{then:i,otherwise:o,break:t.break})}else{const t={};for(const{target:e,adjuster:r}of n)t[e]=r;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(e,t,r)=>{"use strict";const n=r(375),s=r(9474),i=r(9621),o=r(8068),a=r(8160),l=r(3292),c={};e.exports=o.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,{schema:t,state:r,prefs:n}){if(!Array.isArray(e))return;const s=t.$_getRule("sort");return s?c.sort(t,e,s.args.options,r,n):void 0}},validate(e,{schema:t,error:r}){if(!Array.isArray(e)){if(t._flags.single){const t=[e];return t[a.symbols.arraySingle]=!0,{value:t}}return{errors:r("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,{state:t,prefs:r,error:n},{schema:s}){const i=[e,...t.ancestors];for(let n=0;n<e.length;++n){const o=t.localize([...t.path,n],i,s);if(s.$_match(e[n],o,r))return e}const o=s._flags.label;return o?n("array.hasKnown",{patternLabel:o}):n("array.hasUnknown",null)},multi:!0},items:{method(...e){a.verifyFlat(e,"items");const t=this.$_addRule("items");for(let r=0;r<e.length;++r){const n=a.tryWithPath((()=>this.$_compile(e[r])),r,{append:!0});t.$_terms.items.push(n)}return t.$_mutateRebuild()},validate(e,{schema:t,error:r,state:n,prefs:s,errorsArray:i}){const o=t.$_terms._requireds.slice(),l=t.$_terms.ordered.slice(),u=[...t.$_terms._inclusions,...o],f=!e[a.symbols.arraySingle];delete e[a.symbols.arraySingle];const d=i();let m=e.length;for(let i=0;i<m;++i){const a=e[i];let p=!1,h=!1;const g=f?i:new Number(i),y=[...n.path,g];if(!t._flags.sparse&&void 0===a){if(d.push(r("array.sparse",{key:g,path:y,pos:i,value:void 0},n.localize(y))),s.abortEarly)return d;l.shift();continue}const b=[e,...n.ancestors];for(const e of t.$_terms._exclusions)if(e.$_match(a,n.localize(y,b,e),s,{presence:"ignore"})){if(d.push(r("array.excludes",{pos:i,value:a},n.localize(y))),s.abortEarly)return d;p=!0,l.shift();break}if(p)continue;if(t.$_terms.ordered.length){if(l.length){const o=l.shift(),u=o.$_validate(a,n.localize(y,b,o),s);if(u.errors){if(d.push(...u.errors),s.abortEarly)return d}else if("strip"===o._flags.result)c.fastSplice(e,i),--i,--m;else{if(!t._flags.sparse&&void 0===u.value){if(d.push(r("array.sparse",{key:g,path:y,pos:i,value:void 0},n.localize(y))),s.abortEarly)return d;continue}e[i]=u.value}continue}if(!t.$_terms.items.length){if(d.push(r("array.orderedLength",{pos:i,limit:t.$_terms.ordered.length})),s.abortEarly)return d;break}}const v=[];let _=o.length;for(let l=0;l<_;++l){const u=n.localize(y,b,o[l]);u.snapshot();const f=o[l].$_validate(a,u,s);if(v[l]=f,!f.errors){if(u.commit(),e[i]=f.value,h=!0,c.fastSplice(o,l),--l,--_,!t._flags.sparse&&void 0===f.value&&(d.push(r("array.sparse",{key:g,path:y,pos:i,value:void 0},n.localize(y))),s.abortEarly))return d;break}u.restore()}if(h)continue;const w=s.stripUnknown&&!!s.stripUnknown.arrays||!1;_=u.length;for(const l of u){let u;const f=o.indexOf(l);if(-1!==f)u=v[f];else{const o=n.localize(y,b,l);if(o.snapshot(),u=l.$_validate(a,o,s),!u.errors){o.commit(),"strip"===l._flags.result?(c.fastSplice(e,i),--i,--m):t._flags.sparse||void 0!==u.value?e[i]=u.value:(d.push(r("array.sparse",{key:g,path:y,pos:i,value:void 0},n.localize(y))),p=!0),h=!0;break}o.restore()}if(1===_){if(w){c.fastSplice(e,i),--i,--m,h=!0;break}if(d.push(...u.errors),s.abortEarly)return d;p=!0;break}}if(!p&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!h){if(w){c.fastSplice(e,i),--i,--m;continue}if(d.push(r("array.includes",{pos:i,value:a},n.localize(y))),s.abortEarly)return d}}return o.length&&c.fillMissedErrors(t,d,o,e,n,s),l.length&&(c.fillOrderedErrors(t,d,l,e,n,s),d.length||c.fillDefault(l,e,n,s)),d.length?d:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:n,operator:s,args:i})=>a.compare(e.length,r,s)?e:t.error("array."+n,{limit:i.limit,value:e}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(...e){a.verifyFlat(e,"ordered");const t=this.$_addRule("items");for(let r=0;r<e.length;++r){const n=a.tryWithPath((()=>this.$_compile(e[r])),r,{append:!0});c.validateSingle(n,t),t.$_mutateRegister(n),t.$_terms.ordered.push(n)}return t.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return n(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(e={}){a.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=l.ref(e.by,{ancestor:0}),n(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,{error:t,state:r,prefs:n,schema:s},{options:i}){const{value:o,errors:a}=c.sort(s,e,i,r,n);if(a)return a;for(let r=0;r<e.length;++r)if(e[r]!==o[r])return t("array.sort",{order:i.order,by:i.by?i.by.key:"value"});return e},convert:!0},sparse:{method(e){const t=void 0===e||!!e;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(e,t={}){n(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),a.assertOptions(t,["ignoreUndefined","separator"]);const r={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const n=a.default(t.separator,".");r.path=n?e.split(n):[e]}else r.comparator=e;return this.$_addRule(r)},validate(e,{state:t,error:r,schema:o},{comparator:a,options:l},{comparator:c,path:u}){const f={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},d=c||s,m=l.ignoreUndefined;for(let s=0;s<e.length;++s){const o=u?i(e[s],u):e[s],l=c?f.custom:f[typeof o];if(n(l,"Failed to find unique map container for type",typeof o),l instanceof Map){const n=l.entries();let i;for(;!(i=n.next()).done;)if(d(i.value[0],o)){const n=t.localize([...t.path,s],[e,...t.ancestors]),o={pos:s,value:e[s],dupePos:i.value[1],dupeValue:e[i.value[1]]};return u&&(o.path=a),r("array.unique",o,n)}l.set(o,s)}else{if((!m||void 0!==o)&&void 0!==l[o]){const n={pos:s,value:e[s],dupePos:l[o],dupeValue:e[l[o]]};return u&&(n.path=a),r("array.unique",n,t.localize([...t.path,s],[e,...t.ancestors]))}l[o]=s}}return e},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(e,t)=>new Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)c.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)c.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),c.fillMissedErrors=function(e,t,r,n,s,i){const o=[];let a=0;for(const e of r){const t=e._flags.label;t?o.push(t):++a}o.length?a?t.push(e.$_createError("array.includesRequiredBoth",n,{knownMisses:o,unknownMisses:a},s,i)):t.push(e.$_createError("array.includesRequiredKnowns",n,{knownMisses:o},s,i)):t.push(e.$_createError("array.includesRequiredUnknowns",n,{unknownMisses:a},s,i))},c.fillOrderedErrors=function(e,t,r,n,s,i){const o=[];for(const e of r)"required"===e._flags.presence&&o.push(e);o.length&&c.fillMissedErrors(e,t,o,n,s,i)},c.fillDefault=function(e,t,r,n){const s=[];let i=!0;for(let o=e.length-1;o>=0;--o){const a=e[o],l=[t,...r.ancestors],c=a.$_validate(void 0,r.localize(r.path,l,a),n).value;if(i){if(void 0===c)continue;i=!1}s.unshift(c)}s.length&&t.push(...s)},c.fastSplice=function(e,t){let r=t;for(;r<e.length;)e[r++]=e[r];--e.length},c.validateSingle=function(e,t){("array"===e.type||e._flags._arrayItems)&&(n(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},c.sort=function(e,t,r,n,s){const i="ascending"===r.order?1:-1,o=-1*i,a=i,l=(l,u)=>{let f=c.compare(l,u,o,a);if(null!==f)return f;if(r.by&&(l=r.by.resolve(l,n,s),u=r.by.resolve(u,n,s)),f=c.compare(l,u,o,a),null!==f)return f;const d=typeof l;if(d!==typeof u)throw e.$_createError("array.sort.mismatching",t,null,n,s);if("number"!==d&&"string"!==d)throw e.$_createError("array.sort.unsupported",t,{type:d},n,s);return"number"===d?(l-u)*i:l<u?o:a};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}},c.compare=function(e,t,r,n){return e===t?0:void 0===e?1:void 0===t?-1:null===e?n:null===t?r:null}},4937:(e,t,r)=>{"use strict";const n=r(375),s=r(8068),i=r(8160),o=r(2036),a={isBool:function(e){return"boolean"==typeof e}};e.exports=s.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,{schema:t}){if("boolean"!=typeof e){if("string"==typeof e){const r=t._flags.sensitive?e:e.toLowerCase();e="true"===r||"false"!==r&&e}return"boolean"!=typeof e&&(e=t.$_terms.truthy&&t.$_terms.truthy.has(e,null,null,!t._flags.sensitive)||(!t.$_terms.falsy||!t.$_terms.falsy.has(e,null,null,!t._flags.sensitive))&&e),{value:e}}},validate(e,{error:t}){if("boolean"!=typeof e)return{value:e,errors:t("boolean.base")}},rules:{truthy:{method(...e){i.verifyFlat(e,"truthy");const t=this.clone();t.$_terms.truthy=t.$_terms.truthy||new o;for(let r=0;r<e.length;++r){const s=e[r];n(void 0!==s,"Cannot call truthy with undefined"),t.$_terms.truthy.add(s)}return t}},falsy:{method(...e){i.verifyFlat(e,"falsy");const t=this.clone();t.$_terms.falsy=t.$_terms.falsy||new o;for(let r=0;r<e.length;++r){const s=e[r];n(void 0!==s,"Cannot call falsy with undefined"),t.$_terms.falsy.add(s)}return t}},sensitive:{method(e=!0){return this.$_setFlag("sensitive",e)}}},cast:{number:{from:a.isBool,to:(e,t)=>e?1:0},string:{from:a.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(e,t,r)=>{"use strict";const n=r(375),s=r(8068),i=r(8160),o=r(3328),a={isDate:function(e){return e instanceof Date}};e.exports=s.extend({type:"date",coerce:{from:["number","string"],method:(e,{schema:t})=>({value:a.parse(e,t._flags.format)||e})},validate(e,{schema:t,error:r,prefs:n}){if(e instanceof Date&&!isNaN(e.getTime()))return;const s=t._flags.format;return n.convert&&s&&"string"==typeof e?{value:e,errors:r("date.format",{format:s})}:{value:e,errors:r("date.base")}},rules:{compare:{method:!1,validate(e,t,{date:r},{name:n,operator:s,args:o}){const a="now"===r?Date.now():r.getTime();return i.compare(e.getTime(),a,s)?e:t.error("date."+n,{limit:o.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:a.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return n(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(e="javascript"){return n(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:a.isDate,to:(e,t)=>e.getTime()},string:{from:a.isDate,to:(e,{prefs:t})=>o.date(e,t)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),a.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return i.isIsoDate(e)?a.date(e.toString()):null;const r=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return a.date(1*e);if("unix"===t)return a.date(1e3*e);if("string"==typeof r)return null}return a.date(e)},a.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},390:(e,t,r)=>{"use strict";const n=r(375),s=r(7824);e.exports=s.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate:(e,t,{n:r})=>e.length===r?e:t.error("function.arity",{n:r})},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return n(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate:(e,t,{n:r})=>e.length>=r?e:t.error("function.minArity",{n:r})},maxArity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate:(e,t,{n:r})=>e.length<=r?e:t.error("function.maxArity",{n:r})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(e,t,r)=>{"use strict";const n=r(978),s=r(375),i=r(8571),o=r(3652),a=r(8068),l=r(8160),c=r(3292),u=r(6354),f=r(6133),d=r(3328),m={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=a.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:(e,t)=>e.keys(t),validate(e,{schema:t,error:r,state:n,prefs:s}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e))return{value:e,errors:r("object.base",{type:t.$_property("typeof")})};if(!(t.$_terms.renames||t.$_terms.dependencies||t.$_terms.keys||t.$_terms.patterns||t.$_terms.externals))return;e=m.clone(e,s);const i=[];if(t.$_terms.renames&&!m.rename(t,e,n,s,i))return{value:e,errors:i};if(!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies)return{value:e,errors:i};const o=new Set(Object.keys(e));if(t.$_terms.keys){const r=[e,...n.ancestors];for(const a of t.$_terms.keys){const t=a.key,l=e[t];o.delete(t);const c=n.localize([...n.path,t],r,a),u=a.schema.$_validate(l,c,s);if(u.errors){if(s.abortEarly)return{value:e,errors:u.errors};void 0!==u.value&&(e[t]=u.value),i.push(...u.errors)}else"strip"===a.schema._flags.result||void 0===u.value&&void 0!==l?delete e[t]:void 0!==u.value&&(e[t]=u.value)}}if(o.size||t._flags._hasPatternMatch){const r=m.unknown(t,e,o,i,n,s);if(r)return r}if(t.$_terms.dependencies)for(const r of t.$_terms.dependencies){if(null!==r.key&&!1===m.isPresent(r.options)(r.key.resolve(e,n,s,null,{shadow:!1})))continue;const o=m.dependencies[r.rel](t,r,e,n,s);if(o){const r=t.$_createError(o.code,e,o.context,n,s);if(s.abortEarly)return{value:e,errors:r};i.push(r)}}return{value:e,errors:i}},rules:{and:{method(...e){return l.verifyFlat(e,"and"),m.dependency(this,"and",null,e)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,r){d.isTemplate(e)||(e=c.ref(e)),s(void 0===r||"string"==typeof r,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});const n=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:r}});return n.$_mutateRegister(e),n.$_mutateRegister(t),n},validate(e,{error:t,prefs:r,state:n},{subject:s,schema:i,message:o}){const a=s.resolve(e,n,r),l=f.isRef(s)?s.absolute(n):[];return i.$_match(a,n.localize(l,[e,...n.ancestors],i),r)?e:t("object.assert",{subject:s,message:o})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return s("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate:(e,t,{constructor:r,name:n})=>e instanceof r?e:t.error("object.instance",{type:n,value:e}),args:["constructor","name"]},keys:{method(e){s(void 0===e||"object"==typeof e,"Object schema must be a valid object"),s(!l.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(e)if(Object.keys(e).length){t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter((t=>!e.hasOwnProperty(t.key))):new m.Keys;for(const r in e)l.tryWithPath((()=>t.$_terms.keys.push({key:r,schema:this.$_compile(e[r])})),r)}else t.$_terms.keys=new m.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:n,operator:s,args:i})=>l.compare(Object.keys(e).length,r,s)?e:t.error("object."+n,{limit:i.limit,value:e}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(...e){return l.verifyFlat(e,"nand"),m.dependency(this,"nand",null,e)}},or:{method(...e){return l.verifyFlat(e,"or"),m.dependency(this,"or",null,e)}},oxor:{method(...e){return m.dependency(this,"oxor",null,e)}},pattern:{method(e,t,r={}){const n=e instanceof RegExp;n||(e=this.$_compile(e,{appendPath:!0})),s(void 0!==t,"Invalid rule"),l.assertOptions(r,["fallthrough","matches"]),n&&s(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];const o={[n?"regex":"schema"]:e,rule:t};return r.matches&&(o.matches=this.$_compile(r.matches),"array"!==o.matches.type&&(o.matches=o.matches.$_root.array().items(o.matches)),i.$_mutateRegister(o.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),r.fallthrough&&(o.fallthrough=!0),i.$_terms.patterns.push(o),i.$_mutateRegister(t),i}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>f.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t,r={}){s("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),s("string"==typeof t||t instanceof d,"Invalid rename to argument"),s(t!==e,"Cannot rename key to same name:",e),l.assertOptions(r,["alias","ignoreUndefined","override","multiple"]);const i=this.clone();i.$_terms.renames=i.$_terms.renames||[];for(const t of i.$_terms.renames)s(t.from!==e,"Cannot rename the same key multiple times");return t instanceof d&&i.$_mutateRegister(t),i.$_terms.renames.push({from:e,to:t,options:n(m.renameDefaults,r)}),i}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate:(e,t,{type:r})=>!l.isSchema(e)||"any"!==r&&e.type!==r?t.error("object.schema",{type:r}):e},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t,r={}){return m.dependency(this,"with",e,t,r)}},without:{method(e,t,r={}){return m.dependency(this,"without",e,t,r)}},xor:{method(...e){return l.verifyFlat(e,"xor"),m.dependency(this,"xor",null,e)}}},overrides:{default(e,t){return void 0===e&&(e=l.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){const t=new o.Sorter;for(const r of e.$_terms.keys)l.tryWithPath((()=>t.add(r,{after:r.schema.$_rootReferences(),group:r.key})),r.key);e.$_terms.keys=new m.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:r,key:n=null,peers:s,options:i}of t.dependencies)e=m.dependency(e,r,n,s,i);if(t.patterns)for(const{regex:r,schema:n,rule:s,fallthrough:i,matches:o}of t.patterns)e=e.pattern(r||n,s,{fallthrough:i,matches:o});if(t.renames)for(const{from:r,to:n,options:s}of t.renames)e=e.rename(r,n,s);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),m.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return i(e,{shallow:!0});const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e),r}const r=function(...t){return e.apply(this,t)};return r.prototype=i(e.prototype),Object.defineProperty(r,"name",{value:e.name,writable:!1}),Object.defineProperty(r,"length",{value:e.length,writable:!1}),Object.assign(r,e),r},m.dependency=function(e,t,r,n,i){s(null===r||"string"==typeof r,t,"key must be a strings"),i||(i=n.length>1&&"object"==typeof n[n.length-1]?n.pop():{}),l.assertOptions(i,["separator","isPresent"]),n=[].concat(n);const o=l.default(i.separator,"."),a=[];for(const e of n)s("string"==typeof e,t,"peers must be strings"),a.push(c.ref(e,{separator:o,ancestor:0,prefix:!1}));null!==r&&(r=c.ref(r,{separator:o,ancestor:0,prefix:!1}));const u=e.clone();return u.$_terms.dependencies=u.$_terms.dependencies||[],u.$_terms.dependencies.push(new m.Dependency(t,r,a,n,i)),u},m.dependencies={and(e,t,r,n,s){const i=[],o=[],a=t.peers.length,l=m.isPresent(t.options);for(const e of t.peers)!1===l(e.resolve(r,n,s,null,{shadow:!1}))?i.push(e.key):o.push(e.key);if(i.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:m.keysToLabels(e,o),missing:i,missingWithLabels:m.keysToLabels(e,i)}}},nand(e,t,r,n,s){const i=[],o=m.isPresent(t.options);for(const e of t.peers)o(e.resolve(r,n,s,null,{shadow:!1}))&&i.push(e.key);if(i.length!==t.peers.length)return;const a=t.paths[0],l=t.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:m.keysToLabels(e,a),peers:l,peersWithLabels:m.keysToLabels(e,l)}}},or(e,t,r,n,s){const i=m.isPresent(t.options);for(const e of t.peers)if(i(e.resolve(r,n,s,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)}}},oxor(e,t,r,n,s){const i=[],o=m.isPresent(t.options);for(const e of t.peers)o(e.resolve(r,n,s,null,{shadow:!1}))&&i.push(e.key);if(!i.length||1===i.length)return;const a={peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)};return a.present=i,a.presentWithLabels=m.keysToLabels(e,i),{code:"object.oxor",context:a}},with(e,t,r,n,s){const i=m.isPresent(t.options);for(const o of t.peers)if(!1===i(o.resolve(r,n,s,null,{shadow:!1})))return{code:"object.with",context:{main:t.key.key,mainWithLabel:m.keysToLabels(e,t.key.key),peer:o.key,peerWithLabel:m.keysToLabels(e,o.key)}}},without(e,t,r,n,s){const i=m.isPresent(t.options);for(const o of t.peers)if(i(o.resolve(r,n,s,null,{shadow:!1})))return{code:"object.without",context:{main:t.key.key,mainWithLabel:m.keysToLabels(e,t.key.key),peer:o.key,peerWithLabel:m.keysToLabels(e,o.key)}}},xor(e,t,r,n,s){const i=[],o=m.isPresent(t.options);for(const e of t.peers)o(e.resolve(r,n,s,null,{shadow:!1}))&&i.push(e.key);if(1===i.length)return;const a={peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)};return 0===i.length?{code:"object.missing",context:a}:(a.present=i,a.presentWithLabels=m.keysToLabels(e,i),{code:"object.xor",context:a})}},m.keysToLabels=function(e,t){return Array.isArray(t)?t.map((t=>e.$_mapLabels(t))):e.$_mapLabels(t)},m.isPresent=function(e){return"function"==typeof e.isPresent?e.isPresent:e=>void 0!==e},m.rename=function(e,t,r,n,s){const i={};for(const o of e.$_terms.renames){const a=[],l="string"!=typeof o.from;if(l)for(const e in t){if(void 0===t[e]&&o.options.ignoreUndefined)continue;if(e===o.to)continue;const r=o.from.exec(e);r&&a.push({from:e,to:o.to,match:r})}else!Object.prototype.hasOwnProperty.call(t,o.from)||void 0===t[o.from]&&o.options.ignoreUndefined||a.push(o);for(const c of a){const a=c.from;let u=c.to;if(u instanceof d&&(u=u.render(t,r,n,c.match)),a!==u){if(!o.options.multiple&&i[u]&&(s.push(e.$_createError("object.rename.multiple",t,{from:a,to:u,pattern:l},r,n)),n.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,u)&&!o.options.override&&!i[u]&&(s.push(e.$_createError("object.rename.override",t,{from:a,to:u,pattern:l},r,n)),n.abortEarly))return!1;void 0===t[a]?delete t[u]:t[u]=t[a],i[u]=!0,o.options.alias||delete t[a]}}}return!0},m.unknown=function(e,t,r,n,s,i){if(e.$_terms.patterns){let o=!1;const a=e.$_terms.patterns.map((e=>{if(e.matches)return o=!0,[]})),l=[t,...s.ancestors];for(const o of r){const c=t[o],u=[...s.path,o];for(let f=0;f<e.$_terms.patterns.length;++f){const d=e.$_terms.patterns[f];if(d.regex){const e=d.regex.test(o);if(s.mainstay.tracer.debug(s,"rule",`pattern.${f}`,e?"pass":"error"),!e)continue}else if(!d.schema.$_match(o,s.nest(d.schema,`pattern.${f}`),i))continue;r.delete(o);const m=s.localize(u,l,{schema:d.rule,key:o}),p=d.rule.$_validate(c,m,i);if(p.errors){if(i.abortEarly)return{value:t,errors:p.errors};n.push(...p.errors)}if(d.matches&&a[f].push(o),t[o]=p.value,!d.fallthrough)break}}if(o)for(let r=0;r<a.length;++r){const o=a[r];if(!o)continue;const c=e.$_terms.patterns[r].matches,f=s.localize(s.path,l,c),d=c.$_validate(o,f,i);if(d.errors){const r=u.details(d.errors,{override:!1});r.matches=o;const a=e.$_createError("object.pattern.match",t,r,s,i);if(i.abortEarly)return{value:t,errors:a};n.push(a)}}}if(r.size&&(e.$_terms.keys||e.$_terms.patterns)){if(i.stripUnknown&&!e._flags.unknown||i.skipFunctions){const e=!(!i.stripUnknown||!0!==i.stripUnknown&&!i.stripUnknown.objects);for(const n of r)e?(delete t[n],r.delete(n)):"function"==typeof t[n]&&r.delete(n)}if(!l.default(e._flags.unknown,i.allowUnknown))for(const o of r){const r=s.localize([...s.path,o],[]),a=e.$_createError("object.unknown",t[o],{child:o},r,i,{flags:!1});if(i.abortEarly)return{value:t,errors:a};n.push(a)}}},m.Dependency=class{constructor(e,t,r,n,s){this.rel=e,this.key=t,this.peers=r,this.paths=n,this.options=s}describe(){const e={rel:this.rel,peers:this.paths};return null!==this.key&&(e.key=this.key.key),"."!==this.peers[0].separator&&(e.options={...e.options,separator:this.peers[0].separator}),this.options.isPresent&&(e.options={...e.options,isPresent:this.options.isPresent}),e}},m.Keys=class extends Array{concat(e){const t=this.slice(),r=new Map;for(let e=0;e<t.length;++e)r.set(t[e].key,e);for(const n of e){const e=n.key,s=r.get(e);void 0!==s?t[s]={key:e,schema:t[s].schema.concat(n.schema)}:t.push(n)}return t}}},8785:(e,t,r)=>{"use strict";const n=r(375),s=r(8068),i=r(8160),o=r(3292),a=r(6354),l={};e.exports=s.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,{schema:t,state:r,prefs:s}){n(t.$_terms.link,"Uninitialized link schema");const i=l.generate(t,e,r,s),o=t.$_terms.link[0].ref;return i.$_validate(e,r.nest(i,`link:${o.display}:${i.type}`),s)},generate:(e,t,r,n)=>l.generate(e,t,r,n),rules:{ref:{method(e){n(!this.$_terms.link,"Cannot reinitialize schema"),e=o.ref(e),n("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),n("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(e=!0){return this.$_setFlag("relative",e)}}},overrides:{concat(e){n(this.$_terms.link,"Uninitialized link schema"),n(i.isSchema(e),"Invalid schema object"),n("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(n(t.link,"Invalid link description missing link"),e.ref(t.link))}}),l.generate=function(e,t,r,n){let s=r.mainstay.links.get(e);if(s)return s._generate(t,r,n).schema;const i=e.$_terms.link[0].ref,{perspective:o,path:a}=l.perspective(i,r);l.assert(o,"which is outside of schema boundaries",i,e,r,n);try{s=a.length?o.$_reach(a):o}catch(t){l.assert(!1,"to non-existing schema",i,e,r,n)}return l.assert("link"!==s.type,"which is another link",i,e,r,n),e._flags.relative||r.mainstay.links.set(e,s),s._generate(t,r,n).schema},l.perspective=function(e,t){if("local"===e.type){for(const{schema:r,key:n}of t.schemas){if((r._flags.id||n)===e.path[0])return{perspective:r,path:e.path.slice(1)};if(r.$_terms.shared)for(const t of r.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},l.assert=function(e,t,r,s,i,o){e||n(!1,`"${a.label(s._flags,i,o)}" contains link reference "${r.display}" ${t}`)}},3832:(e,t,r)=>{"use strict";const n=r(375),s=r(8068),i=r(8160),o={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const t=e.toString(),r=t.indexOf("."),n=t.indexOf("e");return(r<0?0:(n<0?t.length:n)-r-1)+(n<0?0:Math.max(0,-parseInt(t.slice(n+1))))}};e.exports=s.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:t,error:r}){if(!e.match(o.numberRx))return;e=e.trim();const n={value:parseFloat(e)};if(0===n.value&&(n.value=0),!t._flags.unsafe)if(e.match(/e/i)){if(o.extractSignificantDigits(e)!==o.extractSignificantDigits(String(n.value)))return n.errors=r("number.unsafe"),n}else{const t=n.value.toString();if(t.match(/e/i))return n;if(t!==o.normalizeDecimal(e))return n.errors=r("number.unsafe"),n}return n}},validate(e,{schema:t,error:r,prefs:n}){if(e===1/0||e===-1/0)return{value:e,errors:r("number.infinity")};if(!i.isNumber(e))return{value:e,errors:r("number.base")};const s={value:e};if(n.convert){const e=t.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);s.value=Math.round(s.value*t)/t}}return 0===s.value&&(s.value=0),!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(s.errors=r("number.unsafe")),s},rules:{compare:{method:!1,validate:(e,t,{limit:r},{name:n,operator:s,args:o})=>i.compare(e,r,s)?e:t.error("number."+n,{limit:o.limit,value:e}),args:[{name:"limit",ref:!0,assert:i.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){const t="number"==typeof e?o.decimalPlaces(e):null,r=Math.pow(10,t);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:t,pfactor:r}})},validate:(e,t,{base:r,baseDecimalPlace:n,pfactor:s},i)=>o.decimalPlaces(e)>n?t.error("number.multiple",{multiple:i.args.base,value:e}):Math.round(s*e)%Math.round(s*r)==0?e:t.error("number.multiple",{multiple:i.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return n(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,{limit:r}){const n=e.toString().match(o.precisionRx);return Math.max((n[1]?n[1].length:0)-(n[2]?parseInt(n[2],10):0),0)<=r?e:t.error("number.precision",{limit:r,value:e})},convert:!0},sign:{method(e){return n(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,t,{sign:r})=>"negative"===r&&e<0||"positive"===r&&e>0?e:t.error(`number.${r}`)},unsafe:{method(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),o.extractSignificantDigits=function(e){return e.replace(o.exponentialPartRegex,"").replace(o.dotRegex,"").replace(o.trailingZerosRegex,"").replace(o.leadingSignAndZerosRegex,"")},o.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},8966:(e,t,r)=>{"use strict";const n=r(7824);e.exports=n.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},7417:(e,t,r)=>{"use strict";const n=r(375),s=r(5380),i=r(1745),o=r(9959),a=r(6064),l=r(9926),c=r(5752),u=r(8068),f=r(8160),d={tlds:l instanceof Set&&{tlds:{allow:l,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:o.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=u.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:t,state:r,prefs:n}){const s=t.$_getRule("normalize");s&&(e=e.normalize(s.args.form));const i=t.$_getRule("case");i&&(e="upper"===i.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const o=t.$_getRule("trim");if(o&&o.args.enabled&&(e=e.trim()),t.$_terms.replacements)for(const r of t.$_terms.replacements)e=e.replace(r.pattern,r.replacement);const a=t.$_getRule("hex");if(a&&a.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),t.$_getRule("isoDate")){const t=d.isoDate(e);t&&(e=t)}if(t._flags.truncate){const s=t.$_getRule("max");if(s){let i=s.args.limit;if(f.isResolvable(i)&&(i=i.resolve(e,r,n),!f.limit(i)))return{value:e,errors:t.$_createError("any.ref",i,{ref:s.args.limit,arg:"limit",reason:"must be a positive integer"},r,n)};e=e.slice(0,i)}}return{value:e}}},validate(e,{schema:t,error:r}){if("string"!=typeof e)return{value:e,errors:r("string.base")};if(""===e){const n=t.$_getRule("min");if(n&&0===n.args.limit)return;return{value:e,errors:r("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(e={}){return f.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},n("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),n("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,t,{options:r})=>d.base64Regex[r.paddingRequired][r.urlSafe].test(e)?e:t.error("string.base64")},case:{method(e){return n(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,t,{direction:r})=>"lower"===r&&e===e.toLocaleLowerCase()||"upper"===r&&e===e.toLocaleUpperCase()?e:t.error(`string.${r}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let r=e.length,n=0,s=1;for(;r--;){const t=e.charAt(r)*s;n+=t-9*(t>9),s^=3}return n>0&&n%10==0?e:t.error("string.creditCard")}},dataUri:{method(e={}){return f.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},n("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,{options:r}){const n=e.match(d.dataUriRegex);if(n){if(!n[2])return e;if("base64"!==n[2])return e;if(d.base64Regex[r.paddingRequired].false.test(n[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&f.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const t=d.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate:(e,t,r,{address:n})=>s.isValid(e,n)?e:t.error("string.domain")},email:{method(e={}){f.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),n(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=d.addressOptions(e),r=new RegExp(`\\s*[${e.separator?a(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:r,address:t})},validate(e,t,{options:r},{regex:n,address:s}){const o=r.multiple?e.split(n):[e],a=[];for(const e of o)i.isValid(e,s)||a.push(e);return a.length?t.error("string.email",{value:e,invalids:a}):e}},guid:{alias:"uuid",method(e={}){f.assertOptions(e,["version","separator"]);let t="";if(e.version){const r=[].concat(e.version);n(r.length>=1,"version must have at least 1 valid version specified");const s=new Set;for(let e=0;e<r.length;++e){const i=r[e];n("string"==typeof i,"version at position "+e+" must be a string");const o=d.guidVersions[i.toLowerCase()];n(o,"version at position "+e+" must be one of "+Object.keys(d.guidVersions).join(", ")),n(!s.has(o),"version at position "+e+" must not be a duplicate"),t+=o,s.add(o)}}n(d.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const r=void 0===e.separator?"[:-]?":!0===e.separator?"[:-]":!1===e.separator?"[]?":`\\${e.separator}`,s=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${r})[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:s})},validate(e,t,r,{regex:n}){const s=n.exec(e);return s?d.guidBrackets[s[1]]!==s[s.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(e={}){return f.assertOptions(e,["byteAligned","prefix"]),e={byteAligned:!1,prefix:!1,...e},n("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),n("boolean"==typeof e.prefix||"optional"===e.prefix,'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,t,{options:r})=>("optional"===r.prefix?d.hexRegex.withOptionalPrefix:!0===r.prefix?d.hexRegex.withPrefix:d.hexRegex.withoutPrefix).test(e)?r.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>s.isValid(e,{minDomainSegments:1})||d.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){f.assertOptions(e,["cidr","version"]);const{cidr:t,versions:r,regex:n}=o.regex(e),s=e.version?r:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:s}},regex:n})},validate:(e,t,{options:r},{regex:n})=>n.test(e)?e:r.version?t.error("string.ipVersion",{value:e,cidr:r.cidr,version:r.version}):t.error("string.ip",{value:e,cidr:r.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:t})=>d.isoDate(e)?e:t("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>d.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return d.length(this,"length",e,"=",t)},validate(e,t,{limit:r,encoding:n},{name:s,operator:i,args:o}){const a=!n&&e.length;return f.compare(a,r,i)?e:t.error("string."+s,{limit:o.limit,value:e,encoding:n})},args:[{name:"limit",ref:!0,assert:f.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return d.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return d.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){return n(d.normalizationForms.includes(e),"normalization form must be one of "+d.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:t},{form:r})=>e===e.normalize(r)?e:t("string.normalize",{value:e,form:r}),convert:!0},pattern:{alias:"regex",method(e,t={}){n(e instanceof RegExp,"regex must be a RegExp"),n(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),f.assertOptions(t,["invert","name"]);const r=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:r})},validate:(e,t,{regex:r,options:n},{errorCode:s})=>r.test(e)^n.invert?e:t.error(s,{name:n.name,regex:r,value:e}),args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(a(e),"g")),n(e instanceof RegExp,"pattern must be a RegExp"),n("string"==typeof t,"replacement must be a String");const r=this.clone();return r.$_terms.replacements||(r.$_terms.replacements=[]),r.$_terms.replacements.push({pattern:e,replacement:t}),r}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,t,{enabled:r})=>r&&e!==e.trim()?t.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){f.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&f.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:r}=c.regex(e),n=e.domain?d.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:n,scheme:r})},validate(e,t,{options:r},{regex:n,domain:i,scheme:o}){if(["http:/","https:/"].includes(e))return t.error("string.uri");const a=n.exec(e);if(a){const n=a[1]||a[2];return!i||r.allowRelative&&!n||s.isValid(n,i)?e:t.error("string.domain",{value:n})}return r.relativeOnly?t.error("string.uriRelativeOnly"):r.scheme?t.error("string.uriCustomScheme",{scheme:o,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:r,replacement:n}of t.replacements)e=e.replace(r,n);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),d.addressOptions=function(e){if(!e)return d.tlds||e;if(n(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),n(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return n(d.tlds,"Built-in TLD list disabled"),Object.assign({},e,d.tlds);n("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),n(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),n(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),d.validateTlds(e.tlds.deny,"tlds.deny"),e;const r=e.tlds.allow;return r?!0===r?(n(d.tlds,"Built-in TLD list disabled"),Object.assign({},e,d.tlds)):(Array.isArray(r)&&(e=Object.assign({},e,{tlds:{allow:new Set(r)}})),n(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),d.validateTlds(e.tlds.allow,"tlds.allow"),e):e},d.validateTlds=function(e,t){for(const r of e)n(s.isValid(r,{minDomainSegments:1,maxDomainSegments:1}),`${t} must contain valid top level domain names`)},d.isoDate=function(e){if(!f.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},d.length=function(e,t,r,s,i){return n(!i||!1,"Invalid encoding:",i),e.$_addRule({name:t,method:"length",args:{limit:r,encoding:i},operator:s})}},8826:(e,t,r)=>{"use strict";const n=r(375),s=r(8068),i={};i.Map=class extends Map{slice(){return new i.Map(this)}},e.exports=s.extend({type:"symbol",terms:{map:{init:new i.Map}},coerce:{method(e,{schema:t,error:r}){const n=t.$_terms.map.get(e);return n&&(e=n),t._flags.only&&"symbol"!=typeof e?{value:e,errors:r("symbol.map",{map:t.$_terms.map})}:{value:e}}},validate(e,{error:t}){if("symbol"!=typeof e)return{value:e,errors:t("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),n(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),r=[];for(const s of e){n(s&&s[Symbol.iterator],"Entry must be an iterable");const[e,i]=s;n("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),n("symbol"==typeof i,"Value must be a Symbol"),t.$_terms.map.set(e,i),r.push(i)}return t.valid(...r)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(738),o=r(9621),a=r(8160),l=r(6354),c=r(493),u={result:Symbol("result")};t.entry=function(e,t,r){let s=a.defaults;r&&(n(void 0===r.warnings,"Cannot override warnings preference in synchronous validation"),n(void 0===r.artifacts,"Cannot override artifacts preference in synchronous validation"),s=a.preferences(a.defaults,r));const i=u.entry(e,t,s);n(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");const o={value:i.value};return i.error&&(o.error=i.error),i.mainstay.warnings.length&&(o.warning=l.details(i.mainstay.warnings)),i.mainstay.debug&&(o.debug=i.mainstay.debug),i.mainstay.artifacts&&(o.artifacts=i.mainstay.artifacts),o},t.entryAsync=async function(e,t,r){let n=a.defaults;r&&(n=a.preferences(a.defaults,r));const s=u.entry(e,t,n),i=s.mainstay;if(s.error)throw i.debug&&(s.error.debug=i.debug),s.error;if(i.externals.length){let t=s.value;const c=[];for(const s of i.externals){const f=s.state.path,d="link"===s.schema.type?i.links.get(s.schema):null;let m,p,h=t;const g=f.length?[t]:[],y=f.length?o(e,f):e;if(f.length){m=f[f.length-1];let e=t;for(const t of f.slice(0,-1))e=e[t],g.unshift(e);p=g[0],h=p[m]}try{const e=(e,t)=>(d||s.schema).$_createError(e,h,t,s.state,n),o=await s.method(h,{schema:s.schema,linked:d,state:s.state,prefs:r,original:y,error:e,errorsArray:u.errorsArray,warn:(e,t)=>i.warnings.push((d||s.schema).$_createError(e,h,t,s.state,n)),message:(e,t)=>(d||s.schema).$_createError("external",h,t,s.state,n,{messages:e})});if(void 0===o||o===h)continue;if(o instanceof l.Report){if(i.tracer.log(s.schema,s.state,"rule","external","error"),c.push(o),n.abortEarly)break;continue}if(Array.isArray(o)&&o[a.symbols.errors]){if(i.tracer.log(s.schema,s.state,"rule","external","error"),c.push(...o),n.abortEarly)break;continue}p?(i.tracer.value(s.state,"rule",h,o,"external"),p[m]=o):(i.tracer.value(s.state,"rule",t,o,"external"),t=o)}catch(e){throw n.errors.label&&(e.message+=` (${s.label})`),e}}if(s.value=t,c.length)throw s.error=l.process(c,e,n),i.debug&&(s.error.debug=i.debug),s.error}if(!n.warnings&&!n.debug&&!n.artifacts)return s.value;const c={value:s.value};return i.warnings.length&&(c.warning=l.details(i.warnings)),i.debug&&(c.debug=i.debug),i.artifacts&&(c.artifacts=i.artifacts),c},u.Mainstay=class{constructor(e,t,r){this.externals=[],this.warnings=[],this.tracer=e,this.debug=t,this.links=r,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const e=this._snapshots.pop();this.externals=e.externals,this.warnings=e.warnings}commit(){this._snapshots.pop()}},u.entry=function(e,r,n){const{tracer:s,cleanup:i}=u.tracer(r,n),o=n.debug?[]:null,a=r._ids._schemaChain?new Map:null,f=new u.Mainstay(s,o,a),d=r._ids._schemaChain?[{schema:r}]:null,m=new c([],[],{mainstay:f,schemas:d}),p=t.validate(e,r,m,n);i&&r.$_root.untrace();const h=l.process(p.errors,e,n);return{value:p.value,error:h,mainstay:f}},u.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(n(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:u.ignore}},t.validate=function(e,t,r,n,s={}){if(t.$_terms.whens&&(t=t._generate(e,r,n).schema),t._preferences&&(n=u.prefs(t,n)),t._cache&&n.cache){const n=t._cache.get(e);if(r.mainstay.tracer.debug(r,"validate","cached",!!n),n)return n}const i=(s,i,o)=>t.$_createError(s,e,i,o||r,n),o={original:e,prefs:n,schema:t,state:r,error:i,errorsArray:u.errorsArray,warn:(e,t,n)=>r.mainstay.warnings.push(i(e,t,n)),message:(s,i)=>t.$_createError("custom",e,i,r,n,{messages:s})};r.mainstay.tracer.entry(t,r);const l=t._definition;if(l.prepare&&void 0!==e&&n.convert){const t=l.prepare(e,o);if(t){if(r.mainstay.tracer.value(r,"prepare",e,t.value),t.errors)return u.finalize(t.value,[].concat(t.errors),o);e=t.value}}if(l.coerce&&void 0!==e&&n.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){const t=l.coerce.method(e,o);if(t){if(r.mainstay.tracer.value(r,"coerced",e,t.value),t.errors)return u.finalize(t.value,[].concat(t.errors),o);e=t.value}}const c=t._flags.empty;c&&c.$_match(u.trim(e,t),r.nest(c),a.defaults)&&(r.mainstay.tracer.value(r,"empty",e,void 0),e=void 0);const f=s.presence||t._flags.presence||(t._flags._endedSwitch?null:n.presence);if(void 0===e){if("forbidden"===f)return u.finalize(e,null,o);if("required"===f)return u.finalize(e,[t.$_createError("any.required",e,null,r,n)],o);if("optional"===f){if(t._flags.default!==a.symbols.deepDefault)return u.finalize(e,null,o);r.mainstay.tracer.value(r,"default",e,{}),e={}}}else if("forbidden"===f)return u.finalize(e,[t.$_createError("any.unknown",e,null,r,n)],o);const d=[];if(t._valids){const s=t._valids.get(e,r,n,t._flags.insensitive);if(s)return n.convert&&(r.mainstay.tracer.value(r,"valids",e,s.value),e=s.value),r.mainstay.tracer.filter(t,r,"valid",s),u.finalize(e,null,o);if(t._flags.only){const s=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},r,n);if(n.abortEarly)return u.finalize(e,[s],o);d.push(s)}}if(t._invalids){const s=t._invalids.get(e,r,n,t._flags.insensitive);if(s){r.mainstay.tracer.filter(t,r,"invalid",s);const i=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},r,n);if(n.abortEarly)return u.finalize(e,[i],o);d.push(i)}}if(l.validate){const t=l.validate(e,o);if(t&&(r.mainstay.tracer.value(r,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return d.push(t.errors),u.finalize(e,d,o);if(t.errors.length)return d.push(...t.errors),u.finalize(e,d,o)}}return t._rules.length?u.rules(e,d,o):u.finalize(e,d,o)},u.rules=function(e,t,r){const{schema:n,state:s,prefs:i}=r;for(const o of n._rules){const l=n._definition.rules[o.method];if(l.convert&&i.convert){s.mainstay.tracer.log(n,s,"rule",o.name,"full");continue}let c,f=o.args;if(o._resolve.length){f=Object.assign({},f);for(const t of o._resolve){const r=l.argsByName.get(t),o=f[t].resolve(e,s,i),u=r.normalize?r.normalize(o):o,d=a.validateArg(u,null,r);if(d){c=n.$_createError("any.ref",o,{arg:t,ref:f[t],reason:d},s,i);break}f[t]=u}}c=c||l.validate(e,r,f,o);const d=u.rule(c,o);if(d.errors){if(s.mainstay.tracer.log(n,s,"rule",o.name,"error"),o.warn){s.mainstay.warnings.push(...d.errors);continue}if(i.abortEarly)return u.finalize(e,d.errors,r);t.push(...d.errors)}else s.mainstay.tracer.log(n,s,"rule",o.name,"pass"),s.mainstay.tracer.value(s,"rule",e,d.value,o.name),e=d.value}return u.finalize(e,t,r)},u.rule=function(e,t){return e instanceof l.Report?(u.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[a.symbols.errors]?(e.forEach((e=>u.error(e,t))),{errors:e,value:null}):{errors:null,value:e}},u.error=function(e,t){return t.message&&e._setTemplate(t.message),e},u.finalize=function(e,t,r){t=t||[];const{schema:s,state:i,prefs:o}=r;if(t.length){const n=u.default("failover",void 0,t,r);void 0!==n&&(i.mainstay.tracer.value(i,"failover",e,n),e=n,t=[])}if(t.length&&s._flags.error)if("function"==typeof s._flags.error){t=s._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)n(e instanceof Error||e instanceof l.Report,"error() must return an Error object")}else t=[s._flags.error];if(void 0===e){const n=u.default("default",e,t,r);i.mainstay.tracer.value(i,"default",e,n),e=n}if(s._flags.cast&&void 0!==e){const t=s._definition.cast[s._flags.cast];if(t.from(e)){const n=t.to(e,r);i.mainstay.tracer.value(i,"cast",e,n,s._flags.cast),e=n}}if(s.$_terms.externals&&o.externals&&!1!==o._externals)for(const{method:e}of s.$_terms.externals)i.mainstay.externals.push({method:e,schema:s,state:i,label:l.label(s._flags,i,o)});const a={value:e,errors:t.length?t:null};return s._flags.result&&(a.value="strip"===s._flags.result?void 0:r.original,i.mainstay.tracer.value(i,s._flags.result,e,a.value),i.shadow(e,s._flags.result)),s._cache&&!1!==o.cache&&!s._refs.length&&s._cache.set(r.original,a),void 0===e||a.errors||void 0===s._flags.artifact||(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(s._flags.artifact)||i.mainstay.artifacts.set(s._flags.artifact,[]),i.mainstay.artifacts.get(s._flags.artifact).push(i.path)),a},u.prefs=function(e,t){const r=t===a.defaults;return r&&e._preferences[a.symbols.prefs]?e._preferences[a.symbols.prefs]:(t=a.preferences(t,e._preferences),r&&(e._preferences[a.symbols.prefs]=t),t)},u.default=function(e,t,r,n){const{schema:i,state:o,prefs:l}=n,c=i._flags[e];if(l.noDefaults||void 0===c)return t;if(o.mainstay.tracer.log(i,o,"rule",e,"full"),!c)return c;if("function"==typeof c){const a=c.length?[s(o.ancestors[0]),n]:[];try{return c(...a)}catch(t){return void r.push(i.$_createError(`any.${e}`,null,{error:t},o,l))}}return"object"!=typeof c?c:c[a.symbols.literal]?c.literal:a.isResolvable(c)?c.resolve(t,o,l):s(c)},u.trim=function(e,t){if("string"!=typeof e)return e;const r=t.$_getRule("trim");return r&&r.args.enabled?e.trim():e},u.ignore={active:!1,debug:i,entry:i,filter:i,log:i,resolve:i,value:i},u.errorsArray=function(){const e=[];return e[a.symbols.errors]=!0,e}},2036:(e,t,r)=>{"use strict";const n=r(375),s=r(9474),i=r(8160),o={};e.exports=o.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=o.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){i.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,r){if(e=e||new o.Values,t){if(t._override)return t.clone();for(const r of[...t._values,...t._refs])e.add(r)}if(r)for(const t of[...r._values,...r._refs])e.remove(t);return e.length?e:null}remove(e){i.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,r,n){return!!this.get(e,t,r,n)}get(e,t,r,n){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&n){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e)for(const t of this._values)if(s(t,e))return{value:t};if(t)for(const i of this._refs){const o=i.resolve(e,t,r,null,{in:!0});if(void 0===o)continue;const a=i.in&&"object"==typeof o?Array.isArray(o)?o:Object.keys(o):[o];for(const t of a)if(typeof t==typeof e)if(n&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:i}}else if(s(t,e))return{value:t,ref:i}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){const e=new o.Values(this._values,this._refs);return e._override=this._override,e}concat(e){n(!e._override,"Cannot concat override set of values");const t=new o.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){const e=[];this._override&&e.push({override:!0});for(const t of this._values.values())e.push(t&&"object"==typeof t?{value:t}:t);for(const t of this._refs.values())e.push(t.describe());return e}},o.Values.prototype[i.symbols.values]=!0,o.Values.prototype.slice=o.Values.prototype.clone,o.lowercases=function(e){const t=new Map;if(e)for(const r of e)"string"==typeof r&&t.set(r.toLowerCase(),r);return t}},978:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(1687),o=r(9621),a={};e.exports=function(e,t,r={}){if(n(e&&"object"==typeof e,"Invalid defaults value: must be an object"),n(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),n("object"==typeof r,"Invalid options: must be an object"),!t)return null;if(r.shallow)return a.applyToDefaultsWithShallow(e,t,r);const o=s(e);if(!0===t)return o;const l=void 0!==r.nullOverride&&r.nullOverride;return i(o,t,{nullOverride:l,mergeArrays:!1})},a.applyToDefaultsWithShallow=function(e,t,r){const l=r.shallow;n(Array.isArray(l),"Invalid keys");const c=new Map,u=!0===t?null:new Set;for(let r of l){r=Array.isArray(r)?r:r.split(".");const n=o(e,r);n&&"object"==typeof n?c.set(n,u&&o(t,r)||n):u&&u.add(r)}const f=s(e,{},c);if(!u)return f;for(const e of u)a.reachCopy(f,t,e);const d=void 0!==r.nullOverride&&r.nullOverride;return i(f,t,{nullOverride:d,mergeArrays:!1})},a.reachCopy=function(e,t,r){for(const e of r){if(!(e in t))return;const r=t[e];if("object"!=typeof r||null===r)return;t=r}const n=t;let s=e;for(let e=0;e<r.length-1;++e){const t=r[e];"object"!=typeof s[t]&&(s[t]={}),s=s[t]}s[r[r.length-1]]=n}},375:(e,t,r)=>{"use strict";const n=r(7916);e.exports=function(e,...t){if(!e){if(1===t.length&&t[0]instanceof Error)throw t[0];throw new n(t)}}},8571:(e,t,r)=>{"use strict";const n=r(9621),s=r(4277),i=r(7043),o={needsProtoHack:new Set([s.set,s.map,s.weakSet,s.weakMap])};e.exports=o.clone=function(e,t={},r=null){if("object"!=typeof e||null===e)return e;let n=o.clone,a=r;if(t.shallow){if(!0!==t.shallow)return o.cloneWithShallow(e,t);n=e=>e}else if(a){const t=a.get(e);if(t)return t}else a=new Map;const l=s.getInternalProto(e);if(l===s.buffer)return!1;if(l===s.date)return new Date(e.getTime());if(l===s.regex)return new RegExp(e);const c=o.base(e,l,t);if(c===e)return e;if(a&&a.set(e,c),l===s.set)for(const r of e)c.add(n(r,t,a));else if(l===s.map)for(const[r,s]of e)c.set(r,n(s,t,a));const u=i.keys(e,t);for(const r of u){if("__proto__"===r)continue;if(l===s.array&&"length"===r){c.length=e.length;continue}const i=Object.getOwnPropertyDescriptor(e,r);i?i.get||i.set?Object.defineProperty(c,r,i):i.enumerable?c[r]=n(e[r],t,a):Object.defineProperty(c,r,{enumerable:!1,writable:!0,configurable:!0,value:n(e[r],t,a)}):Object.defineProperty(c,r,{enumerable:!0,writable:!0,configurable:!0,value:n(e[r],t,a)})}return c},o.cloneWithShallow=function(e,t){const r=t.shallow;(t=Object.assign({},t)).shallow=!1;const s=new Map;for(const t of r){const r=n(e,t);"object"!=typeof r&&"function"!=typeof r||s.set(r,r)}return o.clone(e,t,s)},o.base=function(e,t,r){if(!1===r.prototype)return o.needsProtoHack.has(t)?new t.constructor:t===s.array?[]:{};const n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===s.array){const e=[];return n!==t&&Object.setPrototypeOf(e,n),e}if(o.needsProtoHack.has(t)){const e=new n.constructor;return n!==t&&Object.setPrototypeOf(e,n),e}return Object.create(n)}},9474:(e,t,r)=>{"use strict";const n=r(4277),s={mismatched:null};e.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!s.isDeepEqual(e,t,r,[])},s.isDeepEqual=function(e,t,r,i){if(e===t)return 0!==e||1/e==1/t;const o=typeof e;if(o!==typeof t)return!1;if(null===e||null===t)return!1;if("function"===o){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if("object"!==o)return e!=e&&t!=t;const a=s.getSharedType(e,t,!!r.prototype);switch(a){case n.buffer:return!1;case n.promise:return e===t;case n.regex:return e.toString()===t.toString();case s.mismatched:return!1}for(let r=i.length-1;r>=0;--r)if(i[r].isSame(e,t))return!0;i.push(new s.SeenEntry(e,t));try{return!!s.isDeepEqualObj(a,e,t,r,i)}finally{i.pop()}},s.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?s.mismatched:n.getInternalProto(e);const i=n.getInternalProto(e);return i!==n.getInternalProto(t)?s.mismatched:i},s.valueOf=function(e){const t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},s.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},s.isSetSimpleEqual=function(e,t){for(const r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0},s.isDeepEqualObj=function(e,t,r,i,o){const{isDeepEqual:a,valueOf:l,hasOwnEnumerableProperty:c}=s,{keys:u,getOwnPropertySymbols:f}=Object;if(e===n.array){if(!i.part){if(t.length!==r.length)return!1;for(let e=0;e<t.length;++e)if(!a(t[e],r[e],i,o))return!1;return!0}for(const e of t)for(const t of r)if(a(e,t,i,o))return!0}else if(e===n.set){if(t.size!==r.size)return!1;if(!s.isSetSimpleEqual(t,r)){const e=new Set(Set.prototype.values.call(r));for(const r of Set.prototype.values.call(t)){if(e.delete(r))continue;let t=!1;for(const n of e)if(a(r,n,i,o)){e.delete(n),t=!0;break}if(!t)return!1}}}else if(e===n.map){if(t.size!==r.size)return!1;for(const[e,n]of Map.prototype.entries.call(t)){if(void 0===n&&!Map.prototype.has.call(r,e))return!1;if(!a(n,Map.prototype.get.call(r,e),i,o))return!1}}else if(e===n.error&&(t.name!==r.name||t.message!==r.message))return!1;const d=l(t),m=l(r);if((t!==d||r!==m)&&!a(d,m,i,o))return!1;const p=u(t);if(!i.part&&p.length!==u(r).length&&!i.skip)return!1;let h=0;for(const e of p)if(i.skip&&i.skip.includes(e))void 0===r[e]&&++h;else{if(!c(r,e))return!1;if(!a(t[e],r[e],i,o))return!1}if(!i.part&&p.length-h!==u(r).length)return!1;if(!1!==i.symbols){const e=f(t),n=new Set(f(r));for(const s of e){if(!i.skip||!i.skip.includes(s))if(c(t,s)){if(!c(r,s))return!1;if(!a(t[s],r[s],i,o))return!1}else if(c(r,s))return!1;n.delete(s)}for(const e of n)if(c(r,e))return!1}return!0},s.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}},7916:(e,t,r)=>{"use strict";const n=r(8761);e.exports=class extends Error{constructor(e){super(e.filter((e=>""!==e)).map((e=>"string"==typeof e?e:e instanceof Error?e.message:n(e))).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.assert)}}},5277:e=>{"use strict";const t={};e.exports=function(e){if(!e)return"";let r="";for(let n=0;n<e.length;++n){const s=e.charCodeAt(n);t.isSafe(s)?r+=e[n]:r+=t.escapeHtmlChar(s)}return r},t.escapeHtmlChar=function(e){return t.namedHtml.get(e)||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)},t.isSafe=function(e){return t.safeCharCodes.has(e)},t.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),t.safeCharCodes=function(){const e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&e.add(t);return e}()},6064:e=>{"use strict";e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:e=>{"use strict";e.exports=function(){}},1687:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),i=r(7043),o={};e.exports=o.merge=function(e,t,r){if(n(e&&"object"==typeof e,"Invalid target value: must be an object"),n(null==t||"object"==typeof t,"Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){n(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let n=0;n<t.length;++n)e.push(s(t[n],{symbols:r.symbols}));return e}const a=i.keys(t,r);for(let n=0;n<a.length;++n){const i=a[n];if("__proto__"===i||!Object.prototype.propertyIsEnumerable.call(t,i))continue;const l=t[i];if(l&&"object"==typeof l){if(e[i]===l)continue;!e[i]||"object"!=typeof e[i]||Array.isArray(e[i])!==Array.isArray(l)||l instanceof Date||l instanceof RegExp?e[i]=s(l,{symbols:r.symbols}):o.merge(e[i],l,r)}else(null!=l||r.nullOverride)&&(e[i]=l)}return e}},9621:(e,t,r)=>{"use strict";const n=r(375),s={};e.exports=function(e,t,r){if(!1===t||null==t)return e;"string"==typeof(r=r||{})&&(r={separator:r});const i=Array.isArray(t);n(!i||!r.separator,"Separator option is not valid for array-based chain");const o=i?t:t.split(r.separator||".");let a=e;for(let e=0;e<o.length;++e){let i=o[e];const l=r.iterables&&s.iterables(a);if(Array.isArray(a)||"set"===l){const e=Number(i);Number.isInteger(e)&&(i=e<0?a.length+e:e)}if(!a||"function"==typeof a&&!1===r.functions||!l&&void 0===a[i]){n(!r.strict||e+1===o.length,"Missing segment",i,"in reach path ",t),n("object"==typeof a||!0===r.functions||"function"!=typeof a,"Invalid segment",i,"in reach path ",t),a=r.default;break}a=l?"set"===l?[...a][i]:a.get(i):a[i]}return a},s.iterables=function(e){return e instanceof Set?"set":e instanceof Map?"map":void 0}},8761:e=>{"use strict";e.exports=function(...e){try{return JSON.stringify(...e)}catch(e){return"[Cannot display object: "+e.message+"]"}}},4277:(e,t)=>{"use strict";const r={};t=e.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},r.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const n=Object.prototype.toString.call(e);return r.typeMap.get(n)||t.generic}},7043:(e,t)=>{"use strict";t.keys=function(e,t={}){return!1!==t.symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},3652:(e,t,r)=>{"use strict";const n=r(375),s={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){const r=[].concat((t=t||{}).before||[]),s=[].concat(t.after||[]),i=t.group||"?",o=t.sort||0;n(!r.includes(i),`Item cannot come before itself: ${i}`),n(!r.includes("?"),"Item cannot come before unassociated items"),n(!s.includes(i),`Item cannot come after itself: ${i}`),n(!s.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:o,before:r,after:s,group:i,node:t};this._items.push(e)}if(!t.manual){const e=this._sort();n(e,"item","?"!==i?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(e){Array.isArray(e)||(e=[e]);for(const t of e)if(t)for(const e of t._items)this._items.push(Object.assign({},e));this._items.sort(s.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const t=this._sort();return n(t,"merge created a dependencies error"),this.nodes}sort(){const e=this._sort();return n(e,"sort created a dependencies error"),this.nodes}_sort(){const e={},t=Object.create(null),r=Object.create(null);for(const n of this._items){const s=n.seq,i=n.group;r[i]=r[i]||[],r[i].push(s),e[s]=n.before;for(const e of n.after)t[e]=t[e]||[],t[e].push(s)}for(const t in e){const n=[];for(const s in e[t]){const i=e[t][s];r[i]=r[i]||[],n.push(...r[i])}e[t]=n}for(const n in t)if(r[n])for(const s of r[n])e[s].push(...t[n]);const n={};for(const t in e){const r=e[t];for(const e of r)n[e]=n[e]||[],n[e].push(t)}const s={},i=[];for(let e=0;e<this._items.length;++e){let t=e;if(n[e]){t=null;for(let e=0;e<this._items.length;++e){if(!0===s[e])continue;n[e]||(n[e]=[]);const r=n[e].length;let i=0;for(let t=0;t<r;++t)s[n[e][t]]&&++i;if(i===r){t=e;break}}}null!==t&&(s[t]=!0,i.push(t))}if(i.length!==this._items.length)return!1;const o={};for(const e of this._items)o[e.seq]=e;this._items=[],this.nodes=[];for(const e of i){const t=o[e];this.nodes.push(t.node),this._items.push(t)}return!0}},s.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1},5380:(e,t,r)=>{"use strict";const n=r(443),s=r(2178),i={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:n.URL||URL};t.analyze=function(e,t={}){if(!e)return s.code("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return s.code("DOMAIN_TOO_LONG");if(i.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return s.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(i.domainControlRx.test(e))return s.code("DOMAIN_INVALID_CHARS");e=i.punycode(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));const r=t.minDomainSegments||i.minDomainSegments,n=e.split(".");if(n.length<r)return s.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&n.length>t.maxDomainSegments)return s.code("DOMAIN_SEGMENTS_COUNT_MAX");const o=t.tlds;if(o){const e=n[n.length-1].toLowerCase();if(o.deny&&o.deny.has(e)||o.allow&&!o.allow.has(e))return s.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<n.length;++e){const t=n[e];if(!t.length)return s.code("DOMAIN_EMPTY_SEGMENT");if(t.length>63)return s.code("DOMAIN_LONG_SEGMENT");if(e<n.length-1){if(!i.domainSegmentRx.test(t))return s.code("DOMAIN_INVALID_CHARS")}else if(!i.tldSegmentRx.test(t))return s.code("DOMAIN_INVALID_TLDS_CHARS")}return null},t.isValid=function(e,r){return!t.analyze(e,r)},i.punycode=function(e){e.includes("%")&&(e=e.replace(/%/g,"%25"));try{return new i.URL(`http://${e}`).host}catch(t){return e}}},1745:(e,t,r)=>{"use strict";const n=r(9848),s=r(5380),i=r(2178),o={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(n.TextEncoder||TextEncoder)};t.analyze=function(e,t){return o.email(e,t)},t.isValid=function(e,t){return!o.email(e,t)},o.email=function(e,t={}){if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return i.code("EMPTY_STRING");const r=!o.nonAsciiRx.test(e);if(!r){if(!1===t.allowUnicode)return i.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const n=e.split("@");if(2!==n.length)return n.length>2?i.code("MULTIPLE_AT_CHAR"):i.code("MISSING_AT_CHAR");const[a,l]=n;if(!a)return i.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return i.code("ADDRESS_TOO_LONG");if(o.encoder.encode(a).length>64)return i.code("LOCAL_TOO_LONG")}return o.local(a,r)||s.analyze(l,t)},o.local=function(e,t){const r=e.split(".");for(const e of r){if(!e.length)return i.code("EMPTY_LOCAL_SEGMENT");if(t){if(!o.atextRx.test(e))return i.code("INVALID_LOCAL_CHARS")}else for(const t of e){if(o.atextRx.test(t))continue;const e=o.binary(t);if(!o.atomRx.test(e))return i.code("INVALID_LOCAL_CHARS")}}},o.binary=function(e){return Array.from(o.encoder.encode(e)).map((e=>String.fromCharCode(e))).join("")},o.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,o.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:(e,t)=>{"use strict";t.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ 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"},t.code=function(e){return{code:e,error:t.codes[e]}}},9959:(e,t,r)=>{"use strict";const n=r(375),s=r(5752);t.regex=function(e={}){n(void 0===e.cidr||"string"==typeof e.cidr,"options.cidr must be a string");const t=e.cidr?e.cidr.toLowerCase():"optional";n(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),n(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let r=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(r)||(r=[r]),n(r.length>=1,"options.version must have at least 1 version specified");for(let e=0;e<r.length;++e)n("string"==typeof r[e],"options.version must only contain strings"),r[e]=r[e].toLowerCase(),n(["ipv4","ipv6","ipvfuture"].includes(r[e]),"options.version contains unknown version "+r[e]+" - must be one of ipv4, ipv6, ipvfuture");r=Array.from(new Set(r));const i=`(?:${r.map((e=>{if("forbidden"===t)return s.ip[e];const r=`\\/${"ipv4"===e?s.ip.v4Cidr:s.ip.v6Cidr}`;return"required"===t?`${s.ip[e]}${r}`:`${s.ip[e]}(?:${r})?`})).join("|")})`,o=new RegExp(`^${i}$`);return{cidr:t,versions:r,regex:o,raw:i}}},5752:(e,t,r)=>{"use strict";const n=r(375),s=r(6064),i={generate:function(){const e={},t="\\dA-Fa-f",r="["+t+"]",n="\\w-\\.~",s="!\\$&'\\(\\)\\*\\+,;=",i="%"+t,o=n+i+s+":@",a="["+o+"]",l="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+l+"\\.){3}"+l;const c=r+"{1,4}",u="(?:"+c+":"+c+"|"+e.ipv4address+")",f="(?:"+c+":){6}"+u,d="::(?:"+c+":){5}"+u,m="(?:"+c+")?::(?:"+c+":){4}"+u,p="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+u,h="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+u,g="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+u,y="(?:(?:"+c+":){0,4}"+c+")?::"+u,b="(?:(?:"+c+":){0,5}"+c+")?::"+c,v="(?:(?:"+c+":){0,6}"+c+")?::";e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:"+f+"|"+d+"|"+m+"|"+p+"|"+h+"|"+g+"|"+y+"|"+b+"|"+v+")",e.ipvFuture="v"+r+"+\\.["+n+s+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const _="["+n+i+s+":]*",w="["+n+i+s+"]{1,255}",x="(?:\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]|"+e.ipv4address+"|"+w+")",$="(?:"+_+"@)?"+x+"(?::\\d*)?",S="(?:"+_+"@)?("+x+")(?::\\d*)?",k=a+"*",R=a+"+",O="(?:\\/"+k+")*",E="\\/(?:"+R+O+")?",j=R+O,A="["+n+i+s+"@]+"+O,C="(?:\\/\\/\\/"+k+O+")";return e.hierPart="(?:(?:\\/\\/"+$+O+")|"+E+"|"+j+"|"+C+")",e.hierPartCapture="(?:(?:\\/\\/"+S+O+")|"+E+"|"+j+")",e.relativeRef="(?:(?:\\/\\/"+$+O+")|"+E+"|"+A+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+S+O+")|"+E+"|"+A+"|)",e.query="["+o+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+o+"\\/\\?]*",e}};i.rfc3986=i.generate(),t.ip={v4Cidr:i.rfc3986.ipv4Cidr,v6Cidr:i.rfc3986.ipv6Cidr,ipv4:i.rfc3986.ipv4address,ipv6:i.rfc3986.ipv6address,ipvfuture:i.rfc3986.ipvFuture},i.createRegex=function(e){const t=i.rfc3986,r="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",o=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return i.wrap(o+r);let a="";if(e.scheme){n(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const r=[].concat(e.scheme);n(r.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let e=0;e<r.length;++e){const o=r[e];n(o instanceof RegExp||"string"==typeof o,"scheme at position "+e+" must be a RegExp or String"),o instanceof RegExp?i.push(o.source.toString()):(n(t.schemeRegex.test(o),"scheme at position "+e+" must be a valid scheme"),i.push(s(o)))}a=i.join("|")}const l="(?:"+(a?"(?:"+a+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")",c=e.allowRelative?"(?:"+l+"|"+o+")":l;return i.wrap(c+r,a)},i.wrap=function(e,t){return{raw:e=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${e}`,regex:new RegExp(`^${e}$`),scheme:t}},i.uriRegex=i.createRegex({}),t.regex=function(e={}){return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?i.createRegex(e):i.uriRegex}},1447:(e,t)=>{"use strict";const r={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e,t={}){if(!t[r.settings]&&t.constants)for(const e in t.constants){const r=t.constants[e];if(null!==r&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${e} contains invalid ${typeof r} value type`)}this.settings=t[r.settings]?t:Object.assign({[r.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let n=[],s="",i=0,o=!1;const a=e=>{if(i)throw new Error("Formula missing closing parenthesis");const a=n.length?n[n.length-1]:null;if(o||s||e){if(a&&"reference"===a.type&&")"===e)return a.type="function",a.value=this._subFormula(s,a.value),void(s="");if(")"===e){const e=new t.Parser(s,this.settings);n.push({type:"segment",value:e})}else if(o){if("]"===o)return n.push({type:"reference",value:s}),void(s="");n.push({type:"literal",value:s})}else if(r.operatorCharacters.includes(s))a&&"operator"===a.type&&r.operators.includes(a.value+s)?a.value+=s:n.push({type:"operator",value:s});else if(s.match(r.numberRx))n.push({type:"constant",value:parseFloat(s)});else if(void 0!==this.settings.constants[s])n.push({type:"constant",value:this.settings.constants[s]});else{if(!s.match(r.tokenRx))throw new Error(`Formula contains invalid token: ${s}`);n.push({type:"reference",value:s})}s=""}};for(const t of e)o?t===o?(a(),o=!1):s+=t:i?"("===t?(s+=t,++i):")"===t?(--i,i?s+=t:a(t)):s+=t:t in r.literals?o=r.literals[t]:"("===t?(a(),++i):r.operatorCharacters.includes(t)?(a(),s=t,a()):" "!==t?s+=t:a();a(),n=n.map(((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==n[t-1].type?e:{type:"operator",value:"n"}));let l=!1;for(const e of n){if("operator"===e.type){if(r.operatorsPrefix.includes(e.value))continue;if(!l)throw new Error("Formula contains an operator in invalid position");if(!r.operators.includes(e.value))throw new Error(`Formula contains an unknown operator ${e.value}`)}else if(l)throw new Error("Formula missing expected operator");l=!l}if(!l)throw new Error("Formula contains invalid trailing operator");1===n.length&&["reference","literal","constant"].includes(n[0].type)&&(this.single={type:"reference"===n[0].type?"reference":"value",value:n[0].value}),this._parts=n.map((e=>{if("operator"===e.type)return r.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error(`Formula contains invalid reference ${e.value}`);return this.settings.reference?this.settings.reference(e.value):r.reference(e.value)}))}_subFormula(e,n){const s=this.settings.functions[n];if("function"!=typeof s)throw new Error(`Formula contains unknown function ${n}`);let i=[];if(e){let t="",s=0,o=!1;const a=()=>{if(!t)throw new Error(`Formula contains function ${n} with invalid arguments ${e}`);i.push(t),t=""};for(let n=0;n<e.length;++n){const i=e[n];o?(t+=i,i===o&&(o=!1)):i in r.literals&&!s?(t+=i,o=r.literals[i]):","!==i||s?(t+=i,"("===i?++s:")"===i&&--s):a()}a()}return i=i.map((e=>new t.Parser(e,this.settings))),function(e){const t=[];for(const r of i)t.push(r.evaluate(e));return s.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let n=t.length-2;n>=0;--n){const s=t[n];if(s&&"operator"===s.type){const i=t[n+1];t.splice(n+1,1);const o=r.evaluate(i,e);t[n]=r.single(s.value,o)}}return r.operatorsOrder.forEach((n=>{for(let s=1;s<t.length-1;)if(n.includes(t[s])){const n=t[s],i=r.evaluate(t[s-1],e),o=r.evaluate(t[s+1],e);t.splice(s,2);const a=r.calculate(n,i,o);t[s-1]=0===a?0:a}else s+=2})),r.evaluate(t[0],e)}},t.Parser.prototype[r.symbol]=!0,r.reference=function(e){return function(t){return t&&void 0!==t[e]?t[e]:null}},r.evaluate=function(e,t){return null===e?null:"function"==typeof e?e(t):e[r.symbol]?e.evaluate(t):e},r.single=function(e,t){if("!"===e)return!t;const r=-t;return 0===r?0:r},r.calculate=function(e,t,n){if("??"===e)return r.exists(t)?t:n;if("string"==typeof t||"string"==typeof n){if("+"===e)return(t=r.exists(t)?t:"")+(r.exists(n)?n:"")}else switch(e){case"^":return Math.pow(t,n);case"*":return t*n;case"/":return t/n;case"%":return t%n;case"+":return t+n;case"-":return t-n}switch(e){case"<":return t<n;case"<=":return t<=n;case">":return t>n;case">=":return t>=n;case"==":return t===n;case"!=":return t!==n;case"&&":return t&&n;case"||":return t||n}return null},r.exists=function(e){return null!=e}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:e=>{"use strict";e.exports=JSON.parse('{"version":"17.12.3"}')}},t={},function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(5107);var e,t},e.exports=t()},2703:(e,t,r)=>{"use strict";var n=r(414);function s(){}function i(){}i.resetWarningCache=s,e.exports=function(){function e(e,t,r,s,i,o){if(o!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:s};return r.PropTypes=r,r}},5697:(e,t,r)=>{e.exports=r(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5800:function(e,t,r){!function(e,t){"use strict";function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(t);function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}var i={error:null},o=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return(t=e.call.apply(e,[this].concat(n))||this).state=i,t.resetErrorBoundary=function(){for(var e,r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];null==t.props.onReset||(e=t.props).onReset.apply(e,n),t.reset()},t}var r,o;o=e,(r=t).prototype=Object.create(o.prototype),r.prototype.constructor=r,s(r,o),t.getDerivedStateFromError=function(e){return{error:e}};var a=t.prototype;return a.reset=function(){this.setState(i)},a.componentDidCatch=function(e,t){var r,n;null==(r=(n=this.props).onError)||r.call(n,e,t)},a.componentDidUpdate=function(e,t){var r,n,s,i,o=this.state.error,a=this.props.resetKeys;null!==o&&null!==t.error&&(void 0===(s=e.resetKeys)&&(s=[]),void 0===(i=a)&&(i=[]),s.length!==i.length||s.some((function(e,t){return!Object.is(e,i[t])})))&&(null==(r=(n=this.props).onResetKeysChange)||r.call(n,e.resetKeys,a),this.reset())},a.render=function(){var e=this.state.error,t=this.props,r=t.fallbackRender,s=t.FallbackComponent,i=t.fallback;if(null!==e){var o={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(i))return i;if("function"==typeof r)return r(o);if(s)return n.createElement(s,o);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(n.Component);e.ErrorBoundary=o,e.useErrorHandler=function(e){var t=n.useState(null),r=t[0],s=t[1];if(null!=e)throw e;if(null!=r)throw r;return s},e.withErrorBoundary=function(e,t){var r=function(r){return n.createElement(o,t,n.createElement(e,r))},s=e.displayName||e.name||"Unknown";return r.displayName="withErrorBoundary("+s+")",r},Object.defineProperty(e,"__esModule",{value:!0})}(t,r(9196))},9196:e=>{"use strict";e.exports=window.React}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(9196),t=r.n(e);const n=window.wp.element;function s(e){return"field"===e.nodeType}function i(e){return"group"===e.nodeType}function o(e){return"validation_error"===e.type||null!=e.data?.errors}function a(e){return"gateway_error"===e.type}function l(e,t,r){e.forEach((e=>{r&&!r(e)||t(e),i(e)&&l(e.nodes,t,r)}))}function c(e,t,r,n){let s=r;return l(e,(e=>{s=t(s,e)}),n),s}var u=e=>"checkbox"===e.type,f=e=>e instanceof Date,d=e=>null==e;const m=e=>"object"==typeof e;var p=e=>!d(e)&&!Array.isArray(e)&&m(e)&&!f(e),h=e=>p(e)&&e.target?u(e.target)?e.target.checked:e.target.value:e,g=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),y=e=>{const t=e.constructor&&e.constructor.prototype;return p(t)&&t.hasOwnProperty("isPrototypeOf")},b="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function v(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(b&&(e instanceof Blob||e instanceof FileList)||!r&&!p(e))return e;if(t=r?[]:{},r||y(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=v(e[r]));else t=e}return t}var _=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>void 0===e,x=(e,t,r)=>{if(!t||!p(e))return r;const n=_(t.split(/[,[\].]+?/)).reduce(((e,t)=>d(e)?e:e[t]),e);return w(n)||n===e?w(e[t])?r:e[t]:n};const $={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},S={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},k="pattern",R="required",O=e.createContext(null),E=()=>e.useContext(O),j=t=>{const{children:r,...n}=t;return e.createElement(O.Provider,{value:n},r)};var A=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const s=i;return t._proxyFormState[s]!==S.all&&(t._proxyFormState[s]=!n||S.all),r&&(r[s]=!0),e[s]}});return s},C=e=>p(e)&&!Object.keys(e).length,F=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return C(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find((e=>t[e]===(!n||S.all)))},D=e=>Array.isArray(e)?e:[e],M=(e,t,r)=>r&&t?e===t:!e||!t||e===t||D(e).some((e=>e&&(e.startsWith(t)||t.startsWith(e))));function I(t){const r=e.useRef(t);r.current=t,e.useEffect((()=>{const e=!t.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return()=>{e&&e.unsubscribe()}}),[t.disabled])}function T(t){const r=E(),{control:n=r.control,disabled:s,name:i,exact:o}=t||{},[a,l]=e.useState(n._formState),c=e.useRef(!0),u=e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=e.useRef(i);return f.current=i,I({disabled:s,next:e=>c.current&&M(f.current,e.name,o)&&F(e,u.current,n._updateFormState)&&l({...n._formState,...e}),subject:n._subjects.state}),e.useEffect((()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1})),[n]),A(a,n,u.current,!1)}var P=e=>"string"==typeof e,N=(e,t,r,n,s)=>P(e)?(n&&t.watch.add(e),x(r,e,s)):Array.isArray(e)?e.map((e=>(n&&t.watch.add(e),x(r,e)))):(n&&(t.watchAll=!0),r);function L(t){const r=E(),{control:n=r.control,name:s,defaultValue:i,disabled:o,exact:a}=t||{},l=e.useRef(s);l.current=s,I({disabled:o,subject:n._subjects.values,next:e=>{M(l.current,e.name,a)&&u(v(N(l.current,n._names,e.values||n._formValues,!1,i)))}});const[c,u]=e.useState(n._getWatch(s,i));return e.useEffect((()=>n._removeUnmounted())),c}var z=e=>/^\w*$/.test(e),V=e=>_(e.replace(/["|']|\]/g,"").split(/\.|\[/));function q(e,t,r){let n=-1;const s=z(t)?[t]:V(t),i=s.length,o=i-1;for(;++n<i;){const t=s[n];let i=r;if(n!==o){const r=e[t];i=p(r)||Array.isArray(r)?r:isNaN(+s[n+1])?{}:[]}e[t]=i,e=e[t]}return e}var U=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{};const B=(e,t,r)=>{for(const n of r||Object.keys(e)){const r=x(e,n);if(r){const{_f:e,...n}=r;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else p(n)&&B(n,t)}}};var W=e=>({isOnSubmit:!e||e===S.onSubmit,isOnBlur:e===S.onBlur,isOnChange:e===S.onChange,isOnAll:e===S.all,isOnTouch:e===S.onTouched}),H=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),G=(e,t,r)=>{const n=_(x(e,r));return q(n,"root",t[r]),q(e,r,n),e},K=e=>"boolean"==typeof e,Z=e=>"file"===e.type,Y=e=>"function"==typeof e,J=e=>{if(!b)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Q=e=>P(e),X=e=>"radio"===e.type,ee=e=>e instanceof RegExp;const te={value:!1,isValid:!1},re={value:!0,isValid:!0};var ne=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||""===e[0].value?re:{value:e[0].value,isValid:!0}:re:te}return te};const se={isValid:!1,value:null};var ie=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),se):se;function oe(e,t,r="validate"){if(Q(e)||Array.isArray(e)&&e.every(Q)||K(e)&&!e)return{type:r,message:Q(e)?e:"",ref:t}}var ae=e=>p(e)&&!ee(e)?e:{value:e,message:""},le=async(e,t,r,n,s)=>{const{ref:i,refs:o,required:a,maxLength:l,minLength:c,min:f,max:m,pattern:h,validate:g,name:y,valueAsNumber:b,mount:v,disabled:_}=e._f,$=x(t,y);if(!v||_)return{};const S=o?o[0]:i,O=e=>{n&&S.reportValidity&&(S.setCustomValidity(K(e)?"":e||""),S.reportValidity())},E={},j=X(i),A=u(i),F=j||A,D=(b||Z(i))&&w(i.value)&&w($)||J(i)&&""===i.value||""===$||Array.isArray($)&&!$.length,M=U.bind(null,y,r,E),I=(e,t,r,n="maxLength",s="minLength")=>{const o=e?t:r;E[y]={type:e?n:s,message:o,ref:i,...M(e?n:s,o)}};if(s?!Array.isArray($)||!$.length:a&&(!F&&(D||d($))||K($)&&!$||A&&!ne(o).isValid||j&&!ie(o).isValid)){const{value:e,message:t}=Q(a)?{value:!!a,message:a}:ae(a);if(e&&(E[y]={type:R,message:t,ref:S,...M(R,t)},!r))return O(t),E}if(!(D||d(f)&&d(m))){let e,t;const n=ae(m),s=ae(f);if(d($)||isNaN($)){const r=i.valueAsDate||new Date($),o=e=>new Date((new Date).toDateString()+" "+e),a="time"==i.type,l="week"==i.type;P(n.value)&&$&&(e=a?o($)>o(n.value):l?$>n.value:r>new Date(n.value)),P(s.value)&&$&&(t=a?o($)<o(s.value):l?$<s.value:r<new Date(s.value))}else{const r=i.valueAsNumber||($?+$:$);d(n.value)||(e=r>n.value),d(s.value)||(t=r<s.value)}if((e||t)&&(I(!!e,n.message,s.message,"max","min"),!r))return O(E[y].message),E}if((l||c)&&!D&&(P($)||s&&Array.isArray($))){const e=ae(l),t=ae(c),n=!d(e.value)&&$.length>+e.value,s=!d(t.value)&&$.length<+t.value;if((n||s)&&(I(n,e.message,t.message),!r))return O(E[y].message),E}if(h&&!D&&P($)){const{value:e,message:t}=ae(h);if(ee(e)&&!$.match(e)&&(E[y]={type:k,message:t,ref:i,...M(k,t)},!r))return O(t),E}if(g)if(Y(g)){const e=oe(await g($,t),S);if(e&&(E[y]={...e,...M("validate",e.message)},!r))return O(e.message),E}else if(p(g)){let e={};for(const n in g){if(!C(e)&&!r)break;const s=oe(await g[n]($,t),S,n);s&&(e={...s,...M(n,s.message)},O(s.message),r&&(E[y]=e))}if(!C(e)&&(E[y]={ref:S,...e},!r))return E}return O(!0),E};function ce(e,t){const r=Array.isArray(t)?t:z(t)?[t]:V(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=w(e)?n++:e[t[n++]];return e}(e,r),s=r.length-1,i=r[s];return n&&delete n[i],0!==s&&(p(n)&&C(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!w(e[t]))return!1;return!0}(n))&&ce(e,r.slice(0,-1)),e}function ue(){let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var fe=e=>d(e)||!m(e);function de(e,t){if(fe(e)||fe(t))return e===t;if(f(e)&&f(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const r=e[s];if(!n.includes(s))return!1;if("ref"!==s){const e=t[s];if(f(r)&&f(e)||p(r)&&p(e)||Array.isArray(r)&&Array.isArray(e)?!de(r,e):r!==e)return!1}}return!0}var me=e=>"select-multiple"===e.type,pe=e=>X(e)||u(e),he=e=>J(e)&&e.isConnected,ge=e=>{for(const t in e)if(Y(e[t]))return!0;return!1};function ye(e,t={}){const r=Array.isArray(e);if(p(e)||r)for(const r in e)Array.isArray(e[r])||p(e[r])&&!ge(e[r])?(t[r]=Array.isArray(e[r])?[]:{},ye(e[r],t[r])):d(e[r])||(t[r]=!0);return t}function be(e,t,r){const n=Array.isArray(e);if(p(e)||n)for(const n in e)Array.isArray(e[n])||p(e[n])&&!ge(e[n])?w(t)||fe(r[n])?r[n]=Array.isArray(e[n])?ye(e[n],[]):{...ye(e[n])}:be(e[n],d(t)?{}:t[n],r[n]):r[n]=!de(e[n],t[n]);return r}var ve=(e,t)=>be(e,t,ye(t)),_e=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>w(e)?e:t?""===e?NaN:e?+e:e:r&&P(e)?new Date(e):n?n(e):e;function we(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Z(t)?t.files:X(t)?ie(e.refs).value:me(t)?[...t.selectedOptions].map((({value:e})=>e)):u(t)?ne(e.refs).value:_e(w(t.value)?e.ref.value:t.value,e)}var xe=(e,t,r,n)=>{const s={};for(const r of e){const e=x(t,r);e&&q(s,r,e._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},$e=e=>w(e)?e:ee(e)?e.source:p(e)?ee(e.value)?e.value.source:e.value:e,Se=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function ke(e,t,r){const n=x(e,r);if(n||z(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const n=s.join("."),i=x(t,n),o=x(e,n);if(i&&!Array.isArray(i)&&r!==n)return{name:r};if(o&&o.type)return{name:n,error:o};s.pop()}return{name:r}}var Re=(e,t,r,n,s)=>!s.isOnAll&&(!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:!(r?n.isOnChange:s.isOnChange)||e),Oe=(e,t)=>!_(x(e,t)).length&&ce(e,t);const Ee={mode:S.onSubmit,reValidateMode:S.onChange,shouldFocusError:!0};function je(e={},t){let r,n={...Ee,...e},s={submitCount:0,isDirty:!1,isLoading:Y(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},o=(p(n.defaultValues)||p(n.values))&&v(n.defaultValues||n.values)||{},a=n.shouldUnregister?{}:v(o),l={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m=0;const y={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},k={values:ue(),array:ue(),state:ue()},R=e.resetOptions&&e.resetOptions.keepDirtyValues,O=W(n.mode),E=W(n.reValidateMode),j=n.criteriaMode===S.all,A=async e=>{if(y.isValid||e){const e=n.resolver?C((await T()).errors):await L(i,!0);e!==s.isValid&&k.state.next({isValid:e})}},F=e=>y.isValidating&&k.state.next({isValidating:e}),M=(e,t,r,n)=>{const s=x(i,e);if(s){const i=x(a,e,w(r)?x(o,e):r);w(i)||n&&n.defaultChecked||t?q(a,e,t?i:we(s._f)):U(e,i),l.mount&&A()}},I=(e,t,r,n,i)=>{let a=!1,l=!1;const c={name:e};if(!r||n){y.isDirty&&(l=s.isDirty,s.isDirty=c.isDirty=z(),a=l!==c.isDirty);const r=de(x(o,e),t);l=x(s.dirtyFields,e),r?ce(s.dirtyFields,e):q(s.dirtyFields,e,!0),c.dirtyFields=s.dirtyFields,a=a||y.dirtyFields&&l!==!r}if(r){const t=x(s.touchedFields,e);t||(q(s.touchedFields,e,r),c.touchedFields=s.touchedFields,a=a||y.touchedFields&&t!==r)}return a&&i&&k.state.next(c),a?c:{}},T=async e=>n.resolver(a,n.context,xe(e||c.mount,i,n.criteriaMode,n.shouldUseNativeValidation)),L=async(e,t,r={valid:!0})=>{for(const i in e){const o=e[i];if(o){const{_f:e,...i}=o;if(e){const i=c.array.has(e.name),l=await le(o,a,j,n.shouldUseNativeValidation&&!t,i);if(l[e.name]&&(r.valid=!1,t))break;!t&&(x(l,e.name)?i?G(s.errors,l,e.name):q(s.errors,e.name,l[e.name]):ce(s.errors,e.name))}i&&await L(i,t,r)}}return r.valid},z=(e,t)=>(e&&t&&q(a,e,t),!de(re(),o)),V=(e,t,r)=>N(e,c,{...l.mount?a:w(t)?o:P(e)?{[e]:t}:t},r,t),U=(e,t,r={})=>{const n=x(i,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&q(a,e,_e(t,r)),s=J(r.ref)&&d(t)?"":t,me(r.ref)?[...r.ref.options].forEach((e=>e.selected=s.includes(e.value))):r.refs?u(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(s)?!!s.find((t=>t===e.value)):s===e.value))):r.refs[0]&&(r.refs[0].checked=!!s):r.refs.forEach((e=>e.checked=e.value===s)):Z(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||k.values.next({name:e,values:{...a}})))}(r.shouldDirty||r.shouldTouch)&&I(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&te(e)},Q=(e,t,r)=>{for(const n in t){const s=t[n],o=`${e}.${n}`,a=x(i,o);!c.array.has(e)&&fe(s)&&(!a||a._f)||f(s)?U(o,s,r):Q(o,s,r)}},X=(e,r,n={})=>{const u=x(i,e),f=c.array.has(e),m=v(r);q(a,e,m),f?(k.array.next({name:e,values:{...a}}),(y.isDirty||y.dirtyFields)&&n.shouldDirty&&k.state.next({name:e,dirtyFields:ve(o,a),isDirty:z(e,m)})):!u||u._f||d(m)?U(e,m,n):Q(e,m,n),H(e,c)&&k.state.next({...s}),k.values.next({name:e,values:{...a}}),!l.mount&&t()},ee=async t=>{const o=t.target;let l=o.name,u=!0;const f=x(i,l);if(f){let d,p;const g=o.type?we(f._f):h(t),b=t.type===$.BLUR||t.type===$.FOCUS_OUT,v=!Se(f._f)&&!n.resolver&&!x(s.errors,l)&&!f._f.deps||Re(b,x(s.touchedFields,l),s.isSubmitted,E,O),_=H(l,c,b);q(a,l,g),b?(f._f.onBlur&&f._f.onBlur(t),r&&r(0)):f._f.onChange&&f._f.onChange(t);const w=I(l,g,b,!1),S=!C(w)||_;if(!b&&k.values.next({name:l,type:t.type,values:{...a}}),v)return y.isValid&&A(),S&&k.state.next({name:l,..._?{}:w});if(!b&&_&&k.state.next({...s}),F(!0),n.resolver){const{errors:e}=await T([l]),t=ke(s.errors,i,l),r=ke(e,i,t.name||l);d=r.error,l=r.name,p=C(e)}else d=(await le(f,a,j,n.shouldUseNativeValidation))[l],u=isNaN(g)||g===x(a,l,g),u&&(d?p=!1:y.isValid&&(p=await L(i,!0)));u&&(f._f.deps&&te(f._f.deps),((t,n,i,o)=>{const a=x(s.errors,t),l=y.isValid&&K(n)&&s.isValid!==n;var c;if(e.delayError&&i?(c=()=>((e,t)=>{q(s.errors,e,t),k.state.next({errors:s.errors})})(t,i),r=e=>{clearTimeout(m),m=setTimeout(c,e)},r(e.delayError)):(clearTimeout(m),r=null,i?q(s.errors,t,i):ce(s.errors,t)),(i?!de(a,i):a)||!C(o)||l){const e={...o,...l&&K(n)?{isValid:n}:{},errors:s.errors,name:t};s={...s,...e},k.state.next(e)}F(!1)})(l,p,d,w))}},te=async(e,t={})=>{let r,o;const a=D(e);if(F(!0),n.resolver){const t=await(async e=>{const{errors:t}=await T();if(e)for(const r of e){const e=x(t,r);e?q(s.errors,r,e):ce(s.errors,r)}else s.errors=t;return t})(w(e)?e:a);r=C(t),o=e?!a.some((e=>x(t,e))):r}else e?(o=(await Promise.all(a.map((async e=>{const t=x(i,e);return await L(t&&t._f?{[e]:t}:t)})))).every(Boolean),(o||s.isValid)&&A()):o=r=await L(i);return k.state.next({...!P(e)||y.isValid&&r!==s.isValid?{}:{name:e},...n.resolver||!e?{isValid:r}:{},errors:s.errors,isValidating:!1}),t.shouldFocus&&!o&&B(i,(e=>e&&x(s.errors,e)),e?a:c.mount),o},re=e=>{const t={...o,...l.mount?a:{}};return w(e)?t:P(e)?x(t,e):e.map((e=>x(t,e)))},ne=(e,t)=>({invalid:!!x((t||s).errors,e),isDirty:!!x((t||s).dirtyFields,e),isTouched:!!x((t||s).touchedFields,e),error:x((t||s).errors,e)}),se=(e,t,r)=>{const n=(x(i,e,{_f:{}})._f||{}).ref;q(s.errors,e,{...t,ref:n}),k.state.next({name:e,errors:s.errors,isValid:!1}),r&&r.shouldFocus&&n&&n.focus&&n.focus()},ie=(e,t={})=>{for(const r of e?D(e):c.mount)c.mount.delete(r),c.array.delete(r),t.keepValue||(ce(i,r),ce(a,r)),!t.keepError&&ce(s.errors,r),!t.keepDirty&&ce(s.dirtyFields,r),!t.keepTouched&&ce(s.touchedFields,r),!n.shouldUnregister&&!t.keepDefaultValue&&ce(o,r);k.values.next({values:{...a}}),k.state.next({...s,...t.keepDirty?{isDirty:z()}:{}}),!t.keepIsValid&&A()},oe=(e,t={})=>{let r=x(i,e);const s=K(t.disabled);return q(i,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),r?s&&q(a,e,t.disabled?void 0:x(a,e,we(r._f))):M(e,!0,t.value),{...s?{disabled:t.disabled}:{},...n.progressive?{required:!!t.required,min:$e(t.min),max:$e(t.max),minLength:$e(t.minLength),maxLength:$e(t.maxLength),pattern:$e(t.pattern)}:{},name:e,onChange:ee,onBlur:ee,ref:s=>{if(s){oe(e,t),r=x(i,e);const n=w(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,a=pe(n),l=r._f.refs||[];if(a?l.find((e=>e===n)):n===r._f.ref)return;q(i,e,{_f:{...r._f,...a?{refs:[...l.filter(he),n,...Array.isArray(x(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),M(e,!1,void 0,n)}else r=x(i,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!g(c.array,e)||!l.action)&&c.unMount.add(e)}}},ae=()=>n.shouldFocusError&&B(i,(e=>e&&x(s.errors,e)),c.mount),ge=(e,t)=>async r=>{r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let o=v(a);if(k.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await T();s.errors=e,o=t}else await L(i);ce(s.errors,"root"),C(s.errors)?(k.state.next({errors:{}}),await e(o,r)):(t&&await t({...s.errors},r),ae(),setTimeout(ae)),k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:C(s.errors),submitCount:s.submitCount+1,errors:s.errors})},ye=(r,n={})=>{const u=r||o,f=v(u),d=r&&!C(r)?f:o;if(n.keepDefaultValues||(o=u),!n.keepValues){if(n.keepDirtyValues||R)for(const e of c.mount)x(s.dirtyFields,e)?q(d,e,x(a,e)):X(e,x(d,e));else{if(b&&w(r))for(const e of c.mount){const t=x(i,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(J(e)){const t=e.closest("form");if(t){t.reset();break}}}}i={}}a=e.shouldUnregister?n.keepDefaultValues?v(o):{}:v(d),k.array.next({values:{...d}}),k.values.next({values:{...d}})}c={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!y.isValid||!!n.keepIsValid,l.watch=!!e.shouldUnregister,k.state.next({submitCount:n.keepSubmitCount?s.submitCount:0,isDirty:n.keepDirty?s.isDirty:!(!n.keepDefaultValues||de(r,o)),isSubmitted:!!n.keepIsSubmitted&&s.isSubmitted,dirtyFields:n.keepDirtyValues?s.dirtyFields:n.keepDefaultValues&&r?ve(o,r):{},touchedFields:n.keepTouched?s.touchedFields:{},errors:n.keepErrors?s.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},be=(e,t)=>ye(Y(e)?e(a):e,t);return{control:{register:oe,unregister:ie,getFieldState:ne,handleSubmit:ge,setError:se,_executeSchema:T,_getWatch:V,_getDirty:z,_updateValid:A,_removeUnmounted:()=>{for(const e of c.unMount){const t=x(i,e);t&&(t._f.refs?t._f.refs.every((e=>!he(e))):!he(t._f.ref))&&ie(e)}c.unMount=new Set},_updateFieldArray:(e,t=[],r,n,c=!0,u=!0)=>{if(n&&r){if(l.action=!0,u&&Array.isArray(x(i,e))){const t=r(x(i,e),n.argA,n.argB);c&&q(i,e,t)}if(u&&Array.isArray(x(s.errors,e))){const t=r(x(s.errors,e),n.argA,n.argB);c&&q(s.errors,e,t),Oe(s.errors,e)}if(y.touchedFields&&u&&Array.isArray(x(s.touchedFields,e))){const t=r(x(s.touchedFields,e),n.argA,n.argB);c&&q(s.touchedFields,e,t)}y.dirtyFields&&(s.dirtyFields=ve(o,a)),k.state.next({name:e,isDirty:z(e,t),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else q(a,e,t)},_getFieldArray:t=>_(x(l.mount?a:o,t,e.shouldUnregister?x(o,t,[]):[])),_reset:ye,_resetDefaultValues:()=>Y(n.defaultValues)&&n.defaultValues().then((e=>{be(e,n.resetOptions),k.state.next({isLoading:!1})})),_updateFormState:e=>{s={...s,...e}},_subjects:k,_proxyFormState:y,get _fields(){return i},get _formValues(){return a},get _state(){return l},set _state(e){l=e},get _defaultValues(){return o},get _names(){return c},set _names(e){c=e},get _formState(){return s},set _formState(e){s=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:te,register:oe,handleSubmit:ge,watch:(e,t)=>Y(e)?k.values.subscribe({next:r=>e(V(void 0,t),r)}):V(e,t,!0),setValue:X,getValues:re,reset:be,resetField:(e,t={})=>{x(i,e)&&(w(t.defaultValue)?X(e,x(o,e)):(X(e,t.defaultValue),q(o,e,t.defaultValue)),t.keepTouched||ce(s.touchedFields,e),t.keepDirty||(ce(s.dirtyFields,e),s.isDirty=t.defaultValue?z(e,x(o,e)):z()),t.keepError||(ce(s.errors,e),y.isValid&&A()),k.state.next({...s}))},clearErrors:e=>{e&&D(e).forEach((e=>ce(s.errors,e))),k.state.next({errors:e?s.errors:{}})},unregister:ie,setError:se,setFocus:(e,t={})=>{const r=x(i,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:ne}}function Ae(t={}){const r=e.useRef(),n=e.useRef(),[s,i]=e.useState({isDirty:!1,isValidating:!1,isLoading:Y(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Y(t.defaultValues)?void 0:t.defaultValues});r.current||(r.current={...je(t,(()=>i((e=>({...e}))))),formState:s});const o=r.current.control;return o._options=t,I({subject:o._subjects.state,next:e=>{F(e,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),e.useEffect((()=>{t.values&&!de(t.values,n.current)?(o._reset(t.values,o._options.resetOptions),n.current=t.values):o._resetDefaultValues()}),[t.values,o]),e.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),r.current.formState=A(s,o),r.current}var Ce=function(e,t,r){if(e&&"reportValidity"in e){var n=x(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Fe=function(e,t){var r=function(r){var n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Ce(n.ref,r,e):n.refs&&n.refs.forEach((function(t){return Ce(t,r,e)}))};for(var n in t.fields)r(n)},De=function(e,t){t.shouldUseNativeValidation&&Fe(e,t);var r={};for(var n in e){var s=x(t.fields,n);q(r,n,Object.assign(e[n],{ref:s&&s.ref}))}return r},Me=function(e,t,r){return void 0===t&&(t={abortEarly:!1}),void 0===r&&(r={}),function(n,s,i){try{var o=function(){return l.error?{values:{},errors:De((e=l.error,t=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,e.details.length?e.details.reduce((function(e,r){var n=r.path.join(".");if(e[n]||(e[n]={message:r.message,type:r.type}),t){var s=e[n].types,i=s&&s[r.type];e[n]=U(n,t,e,r.type,i?[].concat(i,r.message):r.message)}return e}),{}):{}),i)}:(i.shouldUseNativeValidation&&Fe({},i),{errors:{},values:l.value});var e,t},a=Object.assign({},t,{context:s}),l={},c=function(){if("sync"===r.mode)l=e.validate(n,a);else{var t=function(t,r){try{var s=Promise.resolve(e.validateAsync(n,a)).then((function(e){l.value=e}))}catch(t){return r(t)}return s&&s.then?s.then(void 0,r):s}((function(){return Promise.resolve(e.validateAsync(n,a)).then((function(e){l.value=e}))}),(function(e){l.error=e}));if(t&&t.then)return t.then((function(){}))}}();return Promise.resolve(c&&c.then?c.then(o):o())}catch(e){return Promise.reject(e)}}};function Ie(){return window.givewpDonationFormExports}const Te="update_default_values";function Pe(e,t){return t.type===Te?{...e,defaultValues:{...e.values,...t.values}}:e}const Ne=(0,e.createContext)(null);Ne.displayName="DonationFormState";const Le=(0,e.createContext)(null);Le.displayName="DonationFormStateDispatch";const ze=({initialState:t,children:r})=>{const[n,s]=(0,e.useReducer)(Pe,t);return(0,e.createElement)(Ne.Provider,{value:n},(0,e.createElement)(Le.Provider,{value:s},r))},Ve=()=>(0,e.useContext)(Ne),qe=()=>(0,e.useContext)(Le),Ue=window.givewp.form.templates,Be=Ue.layouts.wrapper;function We(t,r="div",n){const{nodeType:s,type:i}=function(e){let t=null,r=null;return Object.entries(Ue).forEach((n=>{if("object"==typeof n[1]){const s=n[0],i=Object.keys(n[1]).find((t=>n[1][t]===e));i&&(r=i,t=s)}})),{nodeType:t,type:r}}(t);return o=>(0,e.createElement)(Be,{nodeType:s,type:i,htmlTag:r,name:n},(0,e.createElement)(t,{...o}))}function He(t,r="div",n){return(0,e.useMemo)((()=>We(t,r,n)),[t])}const Ge=window.givewp.form.templates,Ke=Ge.layouts.fieldLabel,Ze=Ge.layouts.fieldError;function Ye(t,r,n){const s=function(e,t){return e.hasOwnProperty(t)?e[t].message:null}(n,t.name);return{...t,inputProps:r(t.name,(i=t.validationRules,["required","maxLength","minLength"].reduce(((e,t)=>(i.hasOwnProperty(t)&&(e[t]=i[t]),e)),{}))),fieldError:s,Label:()=>(0,e.createElement)(Ke,{label:t.label,required:t.validationRules.required}),ErrorMessage:()=>(0,e.createElement)(Ze,{error:s,name:t.name})};var i}function Je(e){return(0,n.memo)(e,Qe)}function Qe(e,t){return e.node.name===t.node.name}const Xe=window.givewp.form.templates,et=Je((function({node:t}){const{register:r}=window.givewp.form.hooks.useFormContext(),{errors:n}=window.givewp.form.hooks.useFormState(),s="hidden"!==t.type?He(Xe.fields[t.type],"div",t.name):Xe.fields[t.type],i=Ye(t,r,n);return(0,e.createElement)(s,{key:t.name,...i})})),tt=window.givewp.form.templates,rt=Je((function({node:t}){const r=He(tt.elements[t.type],"div",t.name);return(0,e.createElement)(r,{key:t.name,...t})})),nt=window.givewp.form.templates,st=Je((function({node:t}){const r=He(nt.groups[t.type],"div",t.name),n=t.reduceNodes(((t,r)=>(t[r.name]=t=>(0,e.createElement)(dt,{node:{...r,...t}}),t)),{}),s=t.reduceNodes(((e,t)=>(e[t.name]=t,e)),{});return(0,e.createElement)(r,{key:t.name,nodeComponents:n,nodeProps:s,...t})})),it=We(window.givewp.form.templates.fields.gateways),ot=Je((function({node:t}){const{register:r}=window.givewp.form.hooks.useFormContext(),{errors:n}=window.givewp.form.hooks.useFormState(),s=Ye(t,r,n),{gateways:i}=Ve();return(0,e.createElement)(it,{key:t.name,...s,gateways:i})})),at={"=":(e,t)=>e==t,"!=":(e,t)=>e!=t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,contains:(e,t)=>String(e).includes(t),not_contains:(e,t)=>!String(e).includes(t)};function lt(t){const r=(0,e.useMemo)((()=>t.length?[...t.reduce(ut,new Set).values()]:[]),[t]),n=L({name:r}),s=(0,e.useMemo)((()=>r.reduce(((e,t,r)=>(e.set(t,n[r]),e)),new Map)),[r,n]);return(0,e.useMemo)((()=>!t.length||ct(t,s)),[s])}function ct(e,t){return!e.length||e.reduce((function e(r,n){if("basic"===n.type){const e=t.get(n.field),s=at[n.comparisonOperator](e,n.value);return"and"===n.logicalOperator?(null==r||r)&&s:null!=r&&r||s}return"and"===n.boolean?(null==r||r)&&n.conditions.reduce(e,null):null!=r&&r||n.conditions.reduce(e,null)}),null)}function ut(e,t){return"basic"===t.type?e.add(t.field):t.conditions.reduce(ut,e)}const ft=window.givewp.form.templates,dt=Je((function({node:t}){const r=lt(t.visibilityConditions),{unregister:o}=window.givewp.form.hooks.useFormContext();return(0,n.useEffect)((()=>{r||(s(t)&&o(t.name,{keepDefaultValue:!0}),i(t)&&t.walkNodes((e=>{o(e.name,{keepDefaultValue:!0})}),s))}),[r,o]),r?s(t)&&(c=t,Ue.fields.hasOwnProperty(c.type))?"gateways"===t.type?(0,e.createElement)(ot,{node:t}):(0,e.createElement)(et,{node:t}):function(e){return"element"===e.nodeType}(t)&&(l=t,Ue.elements.hasOwnProperty(l.type))?(0,e.createElement)(rt,{node:t}):i(t)&&(a=t,Ue.groups.hasOwnProperty(a.type))?(0,e.createElement)(st,{node:t}):(console.error(`Node: ${JSON.stringify(t)} does not exist in Form Design: ${JSON.stringify(ft)}`),null):null;var a,l,c}));var mt=r(5800);const pt=window.wp.i18n;function ht({error:t,resetErrorBoundary:r}){const{useFormState:n,useFormContext:s}=window.givewp.form.hooks,{errors:i}=n(),{getValues:o}=s();return console.info({donationFormErrors:i,donationFormValues:o()}),(0,e.createElement)("div",{role:"alert"},(0,e.createElement)("p",null,(0,pt.__)("An error occurred in the form. Please notify the site administrator. The error message is:","give")),(0,e.createElement)("pre",{style:{padding:"0.5rem"}},t.message),(0,e.createElement)("button",{type:"button",onClick:r},(0,pt.__)("Reload form","give")))}function gt({children:t}){return(0,e.createElement)(mt.ErrorBoundary,{FallbackComponent:ht,onReset:()=>{window.location.reload()}},t)}const yt=We(window.givewp.form.templates.layouts.section,"section");function bt({section:t}){const r=lt(t.visibilityConditions),{unregister:i}=window.givewp.form.hooks.useFormContext();return(0,n.useEffect)((()=>{r||t.walkNodes((e=>{i(e.name)}),s)}),[r]),r?(0,e.createElement)(yt,{section:t},t.nodes.map((t=>(0,e.createElement)(gt,{key:t.name},(0,e.createElement)(dt,{node:t}))))):null}const vt=(e,t,r)=>{Object.entries(t).forEach((([t,n])=>{Object.keys(e).includes(t)?r(t,{message:Array.isArray(n)?n[0]:n}):r("FORM_ERROR","gateway_error"===t?{message:Array.isArray(n)?n[0]:n}:{message:(0,pt.__)("Something went wrong, please try again or contact support.","give")})}))};class _t extends Error{constructor(e,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,_t),this.name="FormRequestError",this.errors=e}}const wt=_t;async function xt(e,t){const r=new URL(e);var n,s;(n=new URLSearchParams(r.search),s=t,n.has("givewp-route")&&s.includes(n.get("givewp-route")))?window.location.assign(r):window.top.location.assign(r)}async function $t(e,t){return{response:await fetch(e,{method:"POST",mode:"cors",cache:"default",credentials:"same-origin",redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",headers:{accept:"application/json"},body:t})}}function St(e){const t=new FormData;for(const r in e){const n=e[r];if(null===n||"object"!=typeof n||n instanceof File)t.append(r,n);else for(const e in n)t.append(`${r}[${e}]`,n[e])}return t}async function kt(e,t,r,n,s){if("subscription"===e?.donationType&&!r.supportsSubscriptions)return t("FORM_ERROR",{message:(0,pt.__)("This payment gateway does not support recurring payments, please try selecting another payment gateway.","give")});try{const{originUrl:t,isEmbed:i,embedId:l}=function(){const e=window.top.location.href,t=null!==window.frameElement;return{originUrl:e,isEmbed:t,embedId:t?window.frameElement.hasAttribute("data-givewp-embed-id")?window.frameElement.getAttribute("data-givewp-embed-id"):window.frameElement.id:null}}(),c=St({...e,originUrl:t,isEmbed:i,embedId:l});let u={};if(r.beforeCreatePayment){u=await r.beforeCreatePayment(e);for(const e in u)c.append(`gatewayData[${e}]`,u[e])}const{response:f}=await $t(n,c);(function(e){return!0===e.redirected})(f)&&await xt(f.url,s);const d=await f.json();if(function(e){return"redirect"===e.type}(d)&&await xt(d.data.redirectUrl,s),a(d)||o(d))throw new wt(d.data.errors.errors);r.afterCreatePayment&&await r.afterCreatePayment(d)}catch(r){var i;return r instanceof wt?vt(e,r.errors,t):t("FORM_ERROR",{message:null!==(i=r?.message)&&void 0!==i?i:(0,pt.__)("Something went wrong, please try again or contact support.","give")})}}var Rt=Symbol.for("immer-nothing"),Ot=Symbol.for("immer-draftable"),Et=Symbol.for("immer-state");function jt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var At=Object.getPrototypeOf;function Ct(e){return!!e&&!!e[Et]}function Ft(e){return!!e&&(Mt(e)||Array.isArray(e)||!!e[Ot]||!!e.constructor?.[Ot]||Lt(e)||zt(e))}var Dt=Object.prototype.constructor.toString();function Mt(e){if(!e||"object"!=typeof e)return!1;const t=At(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Dt}function It(e,t){0===Tt(e)?Object.entries(e).forEach((([r,n])=>{t(r,n,e)})):e.forEach(((r,n)=>t(n,r,e)))}function Tt(e){const t=e[Et];return t?t.type_:Array.isArray(e)?1:Lt(e)?2:zt(e)?3:0}function Pt(e,t){return 2===Tt(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nt(e,t,r){const n=Tt(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function Lt(e){return e instanceof Map}function zt(e){return e instanceof Set}function Vt(e){return e.copy_||e.base_}function qt(e,t){if(Lt(e))return new Map(e);if(zt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Mt(e)){if(!At(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const r=Object.getOwnPropertyDescriptors(e);delete r[Et];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const s=n[t],i=r[s];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[s]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[s]})}return Object.create(At(e),r)}function Ut(e,t=!1){return Wt(e)||Ct(e)||!Ft(e)||(Tt(e)>1&&(e.set=e.add=e.clear=e.delete=Bt),Object.freeze(e),t&&It(e,((e,t)=>Ut(t,!0)))),e}function Bt(){jt(2)}function Wt(e){return Object.isFrozen(e)}var Ht,Gt={};function Kt(e){const t=Gt[e];return t||jt(0),t}function Zt(){return Ht}function Yt(e,t){t&&(Kt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Jt(e){Qt(e),e.drafts_.forEach(er),e.drafts_=null}function Qt(e){e===Ht&&(Ht=e.parent_)}function Xt(e){return Ht={drafts_:[],parent_:Ht,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function er(e){const t=e[Et];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function tr(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[Et].modified_&&(Jt(t),jt(4)),Ft(e)&&(e=rr(t,e),t.parent_||sr(t,e)),t.patches_&&Kt("Patches").generateReplacementPatches_(r[Et].base_,e,t.patches_,t.inversePatches_)):e=rr(t,r,[]),Jt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Rt?e:void 0}function rr(e,t,r){if(Wt(t))return t;const n=t[Et];if(!n)return It(t,((s,i)=>nr(e,n,t,s,i,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return sr(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let s=t,i=!1;3===n.type_&&(s=new Set(t),t.clear(),i=!0),It(s,((s,o)=>nr(e,n,t,s,o,r,i))),sr(e,t,!1),r&&e.patches_&&Kt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function nr(e,t,r,n,s,i,o){if(Ct(s)){const o=rr(e,s,i&&t&&3!==t.type_&&!Pt(t.assigned_,n)?i.concat(n):void 0);if(Nt(r,n,o),!Ct(o))return;e.canAutoFreeze_=!1}else o&&r.add(s);if(Ft(s)&&!Wt(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;rr(e,s),t&&t.scope_.parent_||sr(e,s)}}function sr(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ut(t,r)}var ir={get(e,t){if(t===Et)return e;const r=Vt(e);if(!Pt(r,t))return function(e,t,r){const n=lr(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!Ft(n)?n:n===ar(e.base_,t)?(ur(e),e.copy_[t]=fr(n,e)):n},has:(e,t)=>t in Vt(e),ownKeys:e=>Reflect.ownKeys(Vt(e)),set(e,t,r){const n=lr(Vt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=ar(Vt(e),t),o=n?.[Et];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(((s=r)===(i=n)?0!==s||1/s==1/i:s!=s&&i!=i)&&(void 0!==r||Pt(e.base_,t)))return!0;ur(e),cr(e)}var s,i;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==ar(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ur(e),cr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=Vt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){jt(11)},getPrototypeOf:e=>At(e.base_),setPrototypeOf(){jt(12)}},or={};function ar(e,t){const r=e[Et];return(r?Vt(r):e)[t]}function lr(e,t){if(!(t in e))return;let r=At(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=At(r)}}function cr(e){e.modified_||(e.modified_=!0,e.parent_&&cr(e.parent_))}function ur(e){e.copy_||(e.copy_=qt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function fr(e,t){const r=Lt(e)?Kt("MapSet").proxyMap_(e,t):zt(e)?Kt("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Zt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=n,i=ir;r&&(s=[n],i=or);const{revoke:o,proxy:a}=Proxy.revocable(s,i);return n.draft_=a,n.revoke_=o,a}(e,t);return(t?t.scope_:Zt()).drafts_.push(r),r}function dr(e){if(!Ft(e)||Wt(e))return e;const t=e[Et];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=qt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=qt(e,!0);return It(r,((e,t)=>{Nt(r,e,dr(t))})),t&&(t.finalized_=!1),r}It(ir,((e,t)=>{or[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),or.deleteProperty=function(e,t){return or.set.call(this,e,t,void 0)},or.set=function(e,t,r){return ir.set.call(this,e[0],t,r,e[0])};var mr=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...s){return n.produce(e,(e=>t.call(this,e,...s)))}}let n;if("function"!=typeof t&&jt(6),void 0!==r&&"function"!=typeof r&&jt(7),Ft(e)){const s=Xt(this),i=fr(e,void 0);let o=!0;try{n=t(i),o=!1}finally{o?Jt(s):Qt(s)}return Yt(s,r),tr(n,s)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===Rt&&(n=void 0),this.autoFreeze_&&Ut(n,!0),r){const t=[],s=[];Kt("Patches").generateReplacementPatches_(e,n,t,s),r(t,s)}return n}jt(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;Ft(e)||jt(8),Ct(e)&&(Ct(t=e)||jt(10),e=dr(t));const r=Xt(this),n=fr(e,void 0);return n[Et].isManual_=!0,Qt(r),n}finishDraft(e,t){const r=e&&e[Et];r&&r.isManual_||jt(9);const{scope_:n}=r;return Yt(n,t),tr(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=Kt("Patches").applyPatches_;return Ct(e)?n(e,t):this.produce(e,(e=>n(e,t)))}},pr=mr.produce;mr.produceWithPatches.bind(mr),mr.setAutoFreeze.bind(mr),mr.setUseStrictShallowCopy.bind(mr),mr.applyPatches.bind(mr),mr.createDraft.bind(mr),mr.finishDraft.bind(mr);const hr="add_item",gr="remove_item",yr="add_amount_to_total",br="remove_amount_from_total";function vr(e,t){switch(t.type){case hr:e.items[t.item.id]=t.item;break;case gr:delete e.items[t.itemId];break;case yr:e.totals[t.itemId]=t.amount;break;case br:delete e.totals[t.itemId]}}const _r=(0,e.createContext)(null);_r.displayName="DonationSummaryProvider";const wr=(0,e.createContext)(null);wr.displayName="DonationSummaryDispatch";const xr=({initialState:t={items:{},totals:{}},children:r})=>{const[n,s]=(i=vr,o=t,a=(0,e.useMemo)((function(){return pr(i)}),[i]),(0,e.useReducer)(a,o,void 0));var i,o,a;return(0,e.createElement)(_r.Provider,{value:n},(0,e.createElement)(wr.Provider,{value:s},r))},{donateUrl:$r,inlineRedirectRoutes:Sr}=Ie(),kr=We(window.givewp.form.templates.layouts.form);function Rr({defaultValues:t,sections:r,validationSchema:n}){const{gateways:s}=Ve(),i=(0,e.useCallback)((e=>s.find((({id:t})=>t===e))),[]),o=Ae({defaultValues:t,resolver:Me(n),reValidateMode:"onBlur"}),{handleSubmit:a,setError:l,control:c}=o,{errors:u,isSubmitting:f,isSubmitSuccessful:d}=T({control:c}),m=u.hasOwnProperty("FORM_ERROR")?u.FORM_ERROR.message:null;return(0,e.createElement)(j,{...o},(0,e.createElement)(gt,null,(0,e.createElement)(xr,null,(0,e.createElement)(kr,{formProps:{id:"give-next-gen",onSubmit:a((e=>kt(e,l,i(e.gatewayId),$r,Sr)))},isSubmitting:f||d,formError:m},(0,e.createElement)(e.Fragment,null,r.map((t=>(0,e.createElement)(gt,{key:t.name},(0,e.createElement)(bt,{key:t.name,section:t})))))))))}function Or(e,t){!function(e,t,r){l(e.nodes,t,r)}(this,e,t)}function Er(e,t){return function(e,t,r){return function(e,t,r){let n=[];return l(e,(e=>{n.push(t(e))}),r),n}(e.nodes,t,r)}(this,e,t)}function jr(e,t,r){return function(e,t,r,n){return c(e.nodes,t,r,n)}(this,e,t,r)}var Ar=r(2705),Cr=r.n(Ar);const Fr=(0,pt.sprintf)(/* translators: base error message */ (0,pt.__)("This is a required field","give"),"{#label}");function Dr(e,t){return new Intl.NumberFormat(navigator.language,{style:"currency",currency:e,...t})}const Mr=window.givewp.form.templates,Ir=We(Mr.layouts.header),Tr=We(Mr.layouts.headerTitle),Pr=We(Mr.layouts.headerDescription),Nr=We(Mr.layouts.goal),Lr=We(Mr.layouts.headerImage);function zr({form:t}){const r=(0,e.useCallback)((e=>Dr(t.currency,{maximumFractionDigits:0}).format(e)),[]);return(0,e.createElement)(gt,null,(0,e.createElement)(Ir,{isMultiStep:t.design.isMultiStep,HeaderImage:()=>t.settings?.designSettingsImageUrl&&(0,e.createElement)(Lr,{url:t.settings?.designSettingsImageUrl,alt:t.settings?.designSettingsImageAlt||t.settings?.formTitle,color:t.settings?.designSettingsImageColor,opacity:t.settings?.designSettingsImageOpacity}),Title:()=>t.settings?.showHeading&&(0,e.createElement)(Tr,{text:t.settings.heading}),Description:()=>t.settings?.showDescription&&(0,e.createElement)(Pr,{text:t.settings.description}),Goal:()=>t.goal?.show&&(0,e.createElement)(Nr,{currency:t.currency,type:t.goal.type,goalLabel:t.goal.label,progressPercentage:Math.round(t.goal.currentAmount/t.goal.targetAmount*100),currentAmount:t.goal.currentAmount,currentAmountFormatted:t.goal.typeIsMoney?r(t.goal.currentAmount):t.goal.currentAmount.toString(),targetAmount:t.goal.targetAmount,targetAmountFormatted:t.goal.typeIsMoney?r(t.goal.targetAmount):t.goal.targetAmount.toString(),totalRevenue:t.stats.totalRevenue,totalRevenueFormatted:r(t.stats.totalRevenue),totalCountValue:t.stats.totalCountValue,totalCountLabel:t.stats.totalCountLabel})}))}const Vr=(0,e.createContext)(null);Vr.displayName="DonationFormSettings";const qr=({value:t,children:r})=>(0,e.createElement)(Vr.Provider,{value:t},r),Ur=()=>(0,e.useContext)(Vr),Br="set_current_step",Wr="set_next_step";function Hr(e,t){switch(t.type){case Br:return{...e,currentStep:t.step};case Wr:const r=e.steps.map((e=>{const r=!e.visibilityConditions.length||ct(e.visibilityConditions,new Map(Object.entries(t.formValues)));return{...e,isVisible:r}}));return{...e,steps:r,currentStep:r.findIndex(((t,r)=>t.isVisible&&r>e.currentStep))};default:return e}}function Gr(e){return{type:Br,step:e}}const Kr=(0,e.createContext)(null);Kr.displayName="DonationFormMultiStepState";const Zr=(0,e.createContext)(null);Zr.displayName="DonationFormMultiStepStateDispatch";const Yr=({initialState:t,children:r})=>{const[n,s]=(0,e.useReducer)(Hr,t);return(0,e.createElement)(Kr.Provider,{value:n},(0,e.createElement)(Zr.Provider,{value:s},r))},Jr=()=>(0,e.useContext)(Kr),Qr=()=>(0,e.useContext)(Zr);function Xr({isSubmitting:t,submittingText:r=(0,pt.__)("Submitting…","give")}){const{donateButtonCaption:n}=window.givewp.form.hooks.useDonationFormSettings();return(0,e.createElement)("button",{type:"submit",disabled:t,"aria-busy":t},t?r:n)}function en(){const{gateways:t}=Ve();return(0,e.useCallback)((e=>t?.find((({id:t})=>t===e))),[t])}const{validateUrl:tn}=Ie();function rn({buttonText:t=(0,pt.__)("Continue")}){const{steps:r,currentStep:n}=Jr(),s=en(),i=(0,e.useMemo)((()=>{var e;return null!==(e=r.find((({id:e})=>e===n))?.fields)&&void 0!==e?e:[]}),[r,n]),{trigger:l,getValues:c,setError:u}=E(),f=function(){const t=qe(),r=Qr();return(0,e.useCallback)(((e,n)=>{t({type:Te,values:n}),r(function(e){return{type:Wr,formValues:e}}(n))}),[t,r])}(),d=n===r.length-1,[m,p]=(0,e.useState)(!1);return!d&&(0,e.createElement)("button",{className:"givewp-donation-form__steps-button-next",type:"button",disabled:m,"aria-busy":m,onClick:async()=>{if(p(!0),!await l(i))return void p(!1);const e=c(),t=await async function(e,t,r,n){if(void 0!==n&&"subscription"===t?.donationType&&!n.supportsSubscriptions)return r("FORM_ERROR",{message:(0,pt.__)("This payment gateway does not support recurring payments, please try selecting another payment gateway.","give")});try{const r=St(t),{response:n}=await $t(e,r),s=await n.json();if(a(s)||o(s))throw new wt(s.data.errors.errors);return!0}catch(e){var s;return e instanceof wt?vt(t,e.errors,r):r("FORM_ERROR",{message:null!==(s=e?.message)&&void 0!==s?s:(0,pt.__)("Something went wrong, please try again or contact support.","give")})}}(tn,e,u,s(e?.gatewayId));p(!1),t&&f(n,e)}},t)}const{donateUrl:nn,inlineRedirectRoutes:sn}=Ie(),on=We(window.givewp.form.templates.layouts.multiStepForm);function an({currentStep:t,isFirstStep:r,isLastStep:n,children:s}){const{defaultValues:i,validationSchema:o}=Ve(),{multiStepNextButtonText:a,multiStepFirstButtonText:l}=Ur(),c=en(),u=Ae({defaultValues:i,resolver:Me(o),reValidateMode:"onBlur"}),{handleSubmit:f,setError:d,control:m,getValues:p,trigger:h}=u,{errors:g,isSubmitting:y,isSubmitSuccessful:b}=T({control:m}),v=g.hasOwnProperty("FORM_ERROR")?g.FORM_ERROR.message:null;return(0,e.createElement)(j,{...u},(0,e.createElement)(gt,null,(0,e.createElement)(on,{formProps:{className:"givewp-layouts-multiStepForm__form",onSubmit:f((e=>kt(e,d,c(e.gatewayId),nn,sn)))},isSubmitting:y||b,formError:v,previousButton:null,nextButton:!n&&(0,e.createElement)(rn,{buttonText:r?l:a}),submitButton:n&&(0,e.createElement)(Xr,{isSubmitting:y||b})},s)))}var ln=r(4184),cn=r.n(ln);function un({children:t}){const{currentStep:r}=Jr(),n=function(){const t=Qr();return(0,e.useCallback)((e=>{const r=e-1;t(Gr(r<=0?0:r))}),[t])}();return r>0&&(0,e.createElement)("button",{className:"givewp-donation-form__steps-header-previous-button",type:"button",onClick:()=>n(r)},t)}function fn({steps:t,children:r}){const{currentStep:n}=Jr(),{showHeader:s}=Ur(),i=function(e,t){return e?.find((({id:e})=>e===t))}(t,n),o=s?t.length:t.length-1,a=!s||null!==i.title;return(0,e.createElement)("div",{className:"givewp-donation-form__steps"},a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"givewp-donation-form__steps-header"},(0,e.createElement)("div",{className:"givewp-donation-form__steps-header-previous"},(0,e.createElement)(un,null,(0,pt.__)("Previous","give"))),(0,e.createElement)("div",{className:"givewp-donation-form__steps-header-title"},(0,e.createElement)("p",{className:"givewp-donation-form__steps-header-title-text"},i.title))),(0,e.createElement)("progress",{className:"givewp-donation-form__steps-progress",value:n,max:o})),(0,e.createElement)("div",{className:"givewp-donation-form__steps-body"},r),(0,e.createElement)("div",{className:"givewp-donation-form__steps-footer"},(0,e.createElement)("div",{className:"givewp-donation-form__steps-footer-secure"},(0,e.createElement)("i",{className:"fas fa-lock givewp-donation-form__steps-footer-secure-icon"}),(0,e.createElement)("span",{className:"givewp-donation-form__steps-footer-secure-text"},(0,pt.__)("100% Secure Donation","give")))))}function dn({steps:t}){const{currentStep:r}=Jr(),s=function(e){const t=(0,n.useRef)();return(0,n.useEffect)((()=>{t.current=e}),[e]),t.current}(r),i=t?.map((({id:t,element:n})=>{const i=r>=t,o=0===t,a=t===r,l=r>s,c=r<s,u=cn()("givewp-donation-form__step",{"givewp-donation-form__step--start":o,"givewp-donation-form__step--visible":a,"givewp-donation-form__step--hidden":!a,"givewp-donation-form__step--ascending":a&&l,"givewp-donation-form__step--descending":a&&c});return(0,e.createElement)("div",{key:t,id:`givewp-donation-form-step-${t}`,className:u},i&&n)}));return(0,e.createElement)(fn,{steps:t},i)}function mn({form:t}){const r=Qr(),{multiStepFirstButtonText:n}=Ur();return(0,e.createElement)("div",null,(0,e.createElement)(zr,{form:t}),(0,e.createElement)("button",{type:"button",className:"givewp-donation-form__steps-button-next",onClick:()=>{r(Gr(1))}},null!=n?n:(0,pt.__)("Donate","give")))}const pn=We(window.givewp.form.templates.layouts.section,"section"),hn=(t,r)=>{const n=r?t.length+1:t.length;return t.map(((t,i)=>{const o=r?i+1:i,a=0===o,l=o===n-1,c=function(e){return e.reduceNodes(((e,t)=>e.concat(t.name)),[],s)}(t),u=t?.label,f=t?.description;return{id:o,title:u,description:f,element:(0,e.createElement)(an,{key:o,currentStep:o,isFirstStep:a,isLastStep:l},(0,e.createElement)(gt,{key:t.name},(0,e.createElement)(pn,{key:t.name,section:t,hideLabel:!0},t.nodes.map((t=>(0,e.createElement)(gt,{key:t.name},(0,e.createElement)(dt,{key:t.name,node:t}))))))),fields:c,visibilityConditions:t.visibilityConditions,isVisible:!t.visibilityConditions.length}}))};function gn({form:t}){const r=t.design?.includeHeaderInMultiStep&&t.settings?.showHeader,n=hn(t.nodes,r);return r&&n.unshift({id:0,title:null,description:null,element:(0,e.createElement)(mn,{form:t}),fields:[],visibilityConditions:[],isVisible:!0}),(0,e.createElement)(Yr,{initialState:{steps:n,currentStep:0}},(0,e.createElement)(xr,null,(0,e.createElement)(dn,{steps:n})))}window.giveStorageData,window.jQuery;var yn=r(5697),bn=r.n(yn);function vn(){return vn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vn.apply(this,arguments)}function wn(e,t){if(null==e)return{};var r,n,s={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(s[r]=e[r]);return s}var xn,$n,Sn=(xn=function(e){!function(t){if("undefined"!=typeof window){var r,n=0,s=!1,i=!1,o=7,a="[iFrameSizer]",l=a.length,c=null,u=window.requestAnimationFrame,f={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},d={},m=null,p={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}},h={};window.jQuery&&((r=window.jQuery).fn?r.fn.iFrameResize||(r.fn.iFrameResize=function(e){return this.filter("iframe").each((function(t,r){T(r,e)})).end()}):w("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof t&&t.amd?t([],z):e.exports=z(),window.iFrameResize=window.iFrameResize||z()}function g(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function y(e,t,r){e.addEventListener(t,r,!1)}function b(e,t,r){e.removeEventListener(t,r,!1)}function v(e){return d[e]?d[e].log:s}function _(e,t){$("log",e,t,v(e))}function w(e,t){$("info",e,t,v(e))}function x(e,t){$("warn",e,t,!0)}function $(e,t,r,n){!0===n&&"object"==typeof window.console&&console[e](function(e){return a+"["+function(e){var t="Host page: "+e;return window.top!==window.self&&(t=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),t}(e)+"]"}(t),r)}function S(e){function t(){r("Height"),r("Width"),D((function(){F(N),j(L),p("onResized",N)}),N,"init")}function r(e){var t=Number(d[L]["max"+e]),r=Number(d[L]["min"+e]),n=e.toLowerCase(),s=Number(N[n]);_(L,"Checking "+n+" is in range "+r+"-"+t),s<r&&(s=r,_(L,"Set "+n+" to min value")),s>t&&(s=t,_(L,"Set "+n+" to max value")),N[n]=""+s}function n(e){return P.substr(P.indexOf(":")+o+e)}function s(e,t){var r,n;r=function(){var r,n;M("Send Page Info","pageInfo:"+(r=document.body.getBoundingClientRect(),n=N.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-r.top,10),offsetLeft:parseInt(n.left-r.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,t)},h[n=t]||(h[n]=setTimeout((function(){h[n]=null,r()}),32))}function i(e){var t=e.getBoundingClientRect();return E(L),{x:Math.floor(Number(t.left)+Number(c.x)),y:Math.floor(Number(t.top)+Number(c.y))}}function u(e){var t=e?i(N.iframe):{x:0,y:0},r={x:Number(N.width)+t.x,y:Number(N.height)+t.y};_(L,"Reposition requested from iFrame (offset x:"+t.x+" y:"+t.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](r.x,r.y):x(L,"Unable to scroll to requested position, window.parentIFrame not found"):(c=r,f(),_(L,"--"))}function f(){!1!==p("onScroll",c)?j(L):A()}function m(e){p(e,{iframe:N.iframe,screenX:N.width,screenY:N.height,type:N.type})}function p(e,t){return k(L,e,t)}var g,v,$,S,R,T,P=e.data,N={},L=null;"[iFrameResizerChild]Ready"===P?function(){for(var e in d)M("iFrame requested init",I(e),d[e].iframe,e)}():a===(""+P).substr(0,l)&&P.substr(l).split(":")[0]in d?(S=($=P.substr(l).split(":"))[1]?parseInt($[1],10):0,R=d[$[0]]&&d[$[0]].iframe,T=getComputedStyle(R),N={iframe:R,id:$[0],height:S+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(T)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(T),width:$[2],type:$[3]},L=N.id,d[L]&&(d[L].loaded=!0),(v=N.type in{true:1,false:1,undefined:1})&&_(L,"Ignoring init message from meta parent page"),!v&&function(e){var t=!0;return d[e]||(t=!1,x(N.type+" No settings for "+e+". Message was: "+P)),t}(L)&&(_(L,"Received: "+P),g=!0,null===N.iframe&&(x(L,"IFrame ("+N.id+") not found"),g=!1),g&&function(){var t,r=e.origin,n=d[L]&&d[L].checkOrigin;if(n&&""+r!="null"&&!(n.constructor===Array?function(){var e=0,t=!1;for(_(L,"Checking connection is from allowed list of origins: "+n);e<n.length;e++)if(n[e]===r){t=!0;break}return t}():(t=d[L]&&d[L].remoteHost,_(L,"Checking connection is from: "+t),r===t)))throw new Error("Unexpected message received from: "+r+" for "+N.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(d[L]&&d[L].firstRun&&d[L]&&(d[L].firstRun=!1),N.type){case"close":O(N.iframe);break;case"message":l=n(6),_(L,"onMessage passed: {iframe: "+N.iframe.id+", message: "+l+"}"),p("onMessage",{iframe:N.iframe,message:JSON.parse(l)}),_(L,"--");break;case"mouseenter":m("onMouseEnter");break;case"mouseleave":m("onMouseLeave");break;case"autoResize":d[L].autoResize=JSON.parse(n(9));break;case"scrollTo":u(!1);break;case"scrollToOffset":u(!0);break;case"pageInfo":s(d[L]&&d[L].iframe,L),function(){function e(e,n){function i(){d[r]?s(d[r].iframe,r):t()}["scroll","resize"].forEach((function(t){_(r,e+t+" listener for sendPageInfo"),n(window,t,i)}))}function t(){e("Remove ",b)}var r=L;e("Add ",y),d[r]&&(d[r].stopPageInfo=t)}();break;case"pageInfoStop":d[L]&&d[L].stopPageInfo&&(d[L].stopPageInfo(),delete d[L].stopPageInfo);break;case"inPageLink":r=n(9).split("#")[1]||"",o=decodeURIComponent(r),(a=document.getElementById(o)||document.getElementsByName(o)[0])?(e=i(a),_(L,"Moving to in page link (#"+r+") at x: "+e.x+" y: "+e.y),c={x:e.x,y:e.y},f(),_(L,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(r):_(L,"In page link #"+r+" not found and window.parentIFrame not found"):_(L,"In page link #"+r+" not found");break;case"reset":C(N);break;case"init":t(),p("onInit",N.iframe);break;default:t()}var e,r,o,a,l}())):w(L,"Ignored: "+P)}function k(e,t,r){var n=null,s=null;if(d[e]){if("function"!=typeof(n=d[e][t]))throw new TypeError(t+" on iFrame["+e+"] is not a function");s=n(r)}return s}function R(e){var t=e.id;delete d[t]}function O(e){var t=e.id;if(!1!==k(t,"onClose",t)){_(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}k(t,"onClosed",t),_(t,"--"),R(e)}else _(t,"Close iframe cancelled by onClose event")}function E(e){null===c&&_(e,"Get page position: "+(c={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop}).x+","+c.y)}function j(e){null!==c&&(window.scrollTo(c.x,c.y),_(e,"Set page position: "+c.x+","+c.y),A())}function A(){c=null}function C(e){_(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),E(e.id),D((function(){F(e),M("reset","reset",e.iframe,e.id)}),e,"reset")}function F(e){function t(t){i||"0"!==e[t]||(i=!0,_(n,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(d).forEach((function(e){!function(e){function t(t){return"0px"===(d[e]&&d[e].iframe.style[t])}d[e]&&null!==d[e].iframe.offsetParent&&(t("height")||t("width"))&&M("Visibility change","resize",d[e].iframe,e)}(e)}))}function t(t){_("window","Mutation observed: "+t[0].target+" "+t[0].type),P(e,16)}var r,n=g();n&&(r=document.querySelector("body"),new n(t).observe(r,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function r(r){!function(t){e.id?(e.iframe.style[t]=e[t]+"px",_(e.id,"IFrame ("+n+") "+t+" set to "+e[t]+"px")):_("undefined","messageData id not set")}(r),t(r)}var n=e.iframe.id;d[n]&&(d[n].sizeHeight&&r("height"),d[n].sizeWidth&&r("width"))}function D(e,t,r){r!==t.type&&u&&!window.jasmine?(_(t.id,"Requesting animation frame"),u(e)):e()}function M(e,t,r,n,s){var i,o=!1;n=n||r.id,d[n]&&(r&&"contentWindow"in r&&null!==r.contentWindow?(i=d[n]&&d[n].targetOrigin,_(n,"["+e+"] Sending msg to iframe["+n+"] ("+t+") targetOrigin: "+i),r.contentWindow.postMessage(a+t,i)):x(n,"["+e+"] IFrame("+n+") not found"),s&&d[n]&&d[n].warningTimeout&&(d[n].msgTimeout=setTimeout((function(){!d[n]||d[n].loaded||o||(o=!0,x(n,"IFrame has not responded within "+d[n].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),d[n].warningTimeout)))}function I(e){return e+":"+d[e].bodyMarginV1+":"+d[e].sizeWidth+":"+d[e].log+":"+d[e].interval+":"+d[e].enablePublicMethods+":"+d[e].autoResize+":"+d[e].bodyMargin+":"+d[e].heightCalculationMethod+":"+d[e].bodyBackground+":"+d[e].bodyPadding+":"+d[e].tolerance+":"+d[e].inPageLinks+":"+d[e].resizeFrom+":"+d[e].widthCalculationMethod}function T(e,r){function i(e){var t=e.split("Callback");if(2===t.length){var r="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[r]=this[e],delete this[e],x(l,"Deprecated: '"+e+"' has been renamed '"+r+"'. The old method will be removed in the next major version.")}}var o,a,l=function(t){var i;return""===t&&(e.id=(i=r&&r.id||p.id+n++,null!==document.getElementById(i)&&(i+=n++),t=i),s=(r||{}).log,_(t,"Added missing iframe ID: "+t+" ("+e.src+")")),t}(e.id);l in d&&"iFrameResizer"in e?x(l,"Ignored iFrame, already setup."):(function(t){var r;t=t||{},d[l]={firstRun:!0,iframe:e,remoteHost:e.src&&e.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(t),Object.keys(t).forEach(i,t),function(e){for(var t in p)Object.prototype.hasOwnProperty.call(p,t)&&(d[l][t]=Object.prototype.hasOwnProperty.call(e,t)?e[t]:p[t])}(t),d[l]&&(d[l].targetOrigin=!0===d[l].checkOrigin?""===(r=d[l].remoteHost)||null!==r.match(/^(about:blank|javascript:|file:\/\/)/)?"*":r:"*")}(r),function(){switch(_(l,"IFrame scrolling "+(d[l]&&d[l].scrolling?"enabled":"disabled")+" for "+l),e.style.overflow=!1===(d[l]&&d[l].scrolling)?"hidden":"auto",d[l]&&d[l].scrolling){case"omit":break;case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=d[l]?d[l].scrolling:"no"}}(),function(){function t(t){1/0!==d[l][t]&&0!==d[l][t]&&(e.style[t]=d[l][t]+"px",_(l,"Set "+t+" = "+d[l][t]+"px"))}function r(e){if(d[l]["min"+e]>d[l]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}r("Height"),r("Width"),t("maxHeight"),t("minHeight"),t("maxWidth"),t("minWidth")}(),"number"!=typeof(d[l]&&d[l].bodyMargin)&&"0"!==(d[l]&&d[l].bodyMargin)||(d[l].bodyMarginV1=d[l].bodyMargin,d[l].bodyMargin=d[l].bodyMargin+"px"),o=I(l),(a=g())&&function(t){e.parentNode&&new t((function(t){t.forEach((function(t){Array.prototype.slice.call(t.removedNodes).forEach((function(t){t===e&&O(e)}))}))})).observe(e.parentNode,{childList:!0})}(a),y(e,"load",(function(){var r,n;M("iFrame.onload",o,e,t,!0),r=d[l]&&d[l].firstRun,n=d[l]&&d[l].heightCalculationMethod in f,!r&&n&&C({iframe:e,height:0,width:0,type:"init"})})),M("init",o,e,t,!0),d[l]&&(d[l].iframe.iFrameResizer={close:O.bind(null,d[l].iframe),removeListeners:R.bind(null,d[l].iframe),resize:M.bind(null,"Window resize","resize",d[l].iframe),moveToAnchor:function(e){M("Move to anchor","moveToAnchor:"+e,d[l].iframe,l)},sendMessage:function(e){M("Send Message","message:"+(e=JSON.stringify(e)),d[l].iframe,l)}}))}function P(e,t){null===m&&(m=setTimeout((function(){m=null,e()}),t))}function N(){"hidden"!==document.visibilityState&&(_("document","Trigger event: Visiblity change"),P((function(){L("Tab Visable","resize")}),16))}function L(e,t){Object.keys(d).forEach((function(r){(function(e){return d[e]&&"parent"===d[e].resizeFrom&&d[e].autoResize&&!d[e].firstRun})(r)&&M(e,t,d[r].iframe,r)}))}function z(){function e(e,t){t&&(function(){if(!t.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==t.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+t.tagName+">")}(),T(t,e),r.push(t))}var r;return function(){var e,t=["moz","webkit","o","ms"];for(e=0;e<t.length&&!u;e+=1)u=window[t[e]+"RequestAnimationFrame"];u?u=u.bind(window):_("setup","RequestAnimationFrame not supported")}(),y(window,"message",S),y(window,"resize",(function(){_("window","Trigger event: resize"),P((function(){L("Window resize","resize")}),16)})),y(document,"visibilitychange",N),y(document,"-webkit-visibilitychange",N),function(n,s){switch(r=[],function(e){e&&e.enablePublicMethods&&x("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(n),typeof s){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(s||"iframe"),e.bind(t,n));break;case"object":e(n,s);break;default:throw new TypeError("Unexpected data type ("+typeof s+")")}return r}}}()},xn($n={exports:{}}),$n.exports),kn=function(){},Rn=function(r){var n=r.title,s=r.forwardRef,i=wn(r,["title","forwardRef"]),o=function(e){return e.autoResize,e.bodyBackground,e.bodyMargin,e.bodyPadding,e.checkOrigin,e.inPageLinks,e.heightCalculationMethod,e.interval,e.log,e.maxHeight,e.maxWidth,e.minHeight,e.minWidth,e.resizeFrom,e.scrolling,e.sizeHeight,e.sizeWidth,e.warningTimeout,e.tolerance,e.widthCalculationMethod,e.onClosed,e.onInit,e.onMessage,e.onMouseEnter,e.onMouseLeave,e.onResized,wn(e,["autoResize","bodyBackground","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onMouseEnter","onMouseLeave","onResized"])}(i),a=(0,e.useRef)(null),l=function(){return kn(!a.current,"[iframeSizerReact]["+(a&&a.current&&a.current.id)+"] Close event ignored, to remove the iframe update your React component"),!a.current};return(0,e.useEffect)((function(){var e=a.current;return Sn(vn({},i,{onClose:l}),e),function(){return e.iFrameResizer&&e.iFrameResizer.removeListeners()}}),[]),(0,e.useImperativeHandle)(s,(function(){return{resize:function(){return a.current.iFrameResizer.resize()},moveToAnchor:function(e){return a.current.iFrameResizer.moveToAnchor(e)},sendMessage:function(e,t){a.current.iFrameResizer.sendMessage(e,t)}}})),t().createElement("iframe",vn({title:n},o,{ref:a}))};Rn.defaultProps={title:"iframe"},Rn.propTypes={title:bn().string};(0,e.createContext)(null).displayName="FormState";(0,e.createContext)(null).displayName="FormStateDispatch",window.wp.components;const On=(0,e.createRef)(),En={SETTINGS:"preview:settings",GOAL:"preview:goal",COLORS:"preview:colors",CSS:"preview:css",DESIGN_SETTINGS:"preview:design-settings"};const jn=We(window.givewp.form.templates.layouts.goalAchieved),{form:An,previewMode:Cn}=Ie(),Fn=function(e){const{nodes:t,...r}=e;return r}(An);var Dn;(Dn=An).walkNodes=Or.bind(Dn),Dn.mapNodes=Er.bind(Dn),Dn.reduceNodes=jr.bind(Dn),Dn.walkNodes((e=>{e.walkNodes=Or.bind(e),e.mapNodes=Er.bind(e),e.reduceNodes=jr.bind(e)}),i),window.givewp.form.hooks={useFormContext:E,useWatch:L,useFormState:T,useCurrencyFormatter:function(t,r){return(0,e.useMemo)((()=>Dr(t,r)),[t,navigator.language])},useDonationSummary:function(){const{items:t,totals:r}=(0,e.useContext)(_r),s=(0,e.useContext)(wr);return{items:t,totals:r,addItem:(0,n.useCallback)((e=>s(function(e){return{type:hr,item:e}}(e))),[s]),removeItem:(0,n.useCallback)((e=>s(function(e){return{type:gr,itemId:e}}(e))),[s]),addToTotal:(0,n.useCallback)(((e,t)=>s(function(e,t){return{type:yr,itemId:e,amount:t}}(e,t))),[s]),removeFromTotal:(0,n.useCallback)((e=>s(function(e){return{type:br,itemId:e}}(e))),[s])}},useDonationFormSettings:Ur};const Mn=c(An.nodes,((e,t)=>{const r=t.defaultValue;return null!==r&&""!==r&&(e[t.name]=r),e}),{},s),In=function(e){const t=e.reduceNodes(((e,t)=>(e[t.name]=function(e){let t=function(e){let t;return 0===Object.keys(e).length?Cr().any():(e.hasOwnProperty("numeric")||e.hasOwnProperty("integer")?(t=Cr().number(),e.hasOwnProperty("integer")&&(t=t.integer())):e.hasOwnProperty("boolean")?t=Cr().boolean():e.hasOwnProperty("array")?t=Cr().array():e.hasOwnProperty("file")?t=Cr().object():e.hasOwnProperty("dateTime")?t=Cr().date():(t=Cr().string(),e.hasOwnProperty("email")&&(t=t.email({tlds:!1})),e.hasOwnProperty("alpha")&&(t=t.alpha()),e.hasOwnProperty("alphanum")&&(t=t.alphanum())),!e.hasOwnProperty("number")&&e.hasOwnProperty("boolean")||(e.hasOwnProperty("min")&&(t=t.min(e.min)),e.hasOwnProperty("max")&&(t=t.max(e.max))),t=e.required?e.hasOwnProperty("excludeUnless")?t.custom(((t,r)=>{const n=r.state.ancestors[0],s=e.excludeUnless.every((e=>at[e.comparisonOperator](n[e.field],e.value)));return!s||""!==t&&null!==t?s?t:void 0:r.error("required")}),"exclude unless validation"):t.required():t.optional().allow("",null),t=function(e,t){return e.hasOwnProperty("donationType")&&(t=Cr().allow("single","subscription").only().required()),e.hasOwnProperty("subscriptionPeriod")&&(t=Cr().when("donationType",{is:"subscription",then:Cr().allow("day","week","quarter","month","year").only().required(),otherwise:Cr().optional()})),e.hasOwnProperty("subscriptionFrequency")&&(t=Cr().when("donationType",{is:"subscription",then:Cr().number().integer().required(),otherwise:Cr().optional()})),e.hasOwnProperty("subscriptionInstallments")&&(t=Cr().when("donationType",{is:"subscription",then:Cr().number().integer().required(),otherwise:Cr().optional()})),t}(e,t),t)}(e.validationRules);return e.label&&(t=t.label(e.label)),t}(t),e)),{},s);return Cr().object(t).messages({"string.base":Fr,"string.empty":Fr,"any.required":Fr,"number.base":Fr,"object.base":Fr})}(An),Tn={defaultValues:Mn,gateways:window.givewp.gateways.getAll(),validationSchema:In};function Pn({form:t}){return t.goal.isAchieved?(0,e.createElement)(gt,null,(0,e.createElement)(jn,{goalAchievedMessage:t.settings.goalAchievedMessage})):t.design?.isMultiStep?(0,e.createElement)(qr,{value:{...t.settings,...Fn}},(0,e.createElement)(ze,{initialState:Tn},!t.design?.includeHeaderInMultiStep&&t.settings.showHeader&&(0,e.createElement)(zr,{form:t}),(0,e.createElement)(gn,{form:t}))):(0,e.createElement)(qr,{value:{...t.settings,...Fn}},(0,e.createElement)(ze,{initialState:Tn},t.settings?.showHeader&&(0,e.createElement)(zr,{form:t}),(0,e.createElement)(Rr,{defaultValues:Mn,sections:t.nodes,validationSchema:In})))}function Nn(){const{subscribeToGoal:t,subscribeToColors:r,subscribeToSettings:n,subscribeToCss:s,unsubscribeAll:i}=function(){const t={};(0,e.useEffect)((()=>(addEventListener("message",r,!1),()=>removeEventListener("message",r))),[]);const r=e=>{const{event:r,data:n}=(e=>"string"==typeof e.data&&e.data.includes("[iFrameSizer]message:")?JSON.parse(e.data.replace("[iFrameSizer]message:","")):e.data)(e);if(t[r]){const e={};Object.entries(n).forEach((([t,r])=>{"function"!=typeof r&&"object"!=typeof r&&(e[t]=r)})),t[r].forEach((t=>{t(e)}))}},n=(e,r)=>{t[e]||(t[e]=[]),t[e].push(r)},s=(e,t,r)=>{r.current?.sendMessage&&r.current.sendMessage({event:e,data:t})};return{unsubscribe:e=>{t[e]&&delete t[e]},unsubscribeAll:()=>{for(const e in En)delete t[e]},publishGoal:e=>{s(En.GOAL,e,On)},publishGoalType:e=>{const t=["amount","amountFromSubscriptions"].includes(e);s(En.GOAL,{type:e,label:e,typeIsCount:!t,typeIsMoney:t},On)},publishColors:e=>{s(En.COLORS,e,On)},publishCss:e=>{s(En.CSS,e,On)},publishSettings:e=>{s(En.SETTINGS,e,On)},publishDesignSettings:e=>{s(En.DESIGN_SETTINGS,e,On)},subscribeToGoal:e=>{n(En.GOAL,e)},subscribeToColors:e=>{n(En.COLORS,e)},subscribeToSettings:e=>{n(En.SETTINGS,e)},subscribeToCss:e=>{n(En.CSS,e)},subscribeToDesignSettings:e=>{n(En.DESIGN_SETTINGS,e)}}}(),[o,a]=(0,e.useState)(An);return(0,e.useEffect)((()=>(n((e=>{a((t=>({...t,settings:{...t.settings,...e}})))})),t((e=>{a((t=>({...t,goal:{...t.goal,...e}})))})),r((e=>{e.primaryColor&&Ln.style.setProperty("--givewp-primary-color",e.primaryColor),e.secondaryColor&&Ln.style.setProperty("--givewp-secondary-color",e.secondaryColor)})),s((({customCss:e})=>{let t="";const r=new CSSStyleSheet;r.replaceSync(e);for(let e=0;e<r.cssRules.length;e++)t+=r.cssRules[e].cssText+"\n";zn.innerText=t})),()=>i())),[]),(0,e.createElement)(Pn,{form:o})}const Ln=document.getElementById("root-givewp-donation-form"),zn=document.getElementById("root-givewp-donation-form-style");n.createRoot?(0,n.createRoot)(Ln).render(Cn?(0,e.createElement)(Nn,null):(0,e.createElement)(Pn,{form:An})):(0,n.render)(Cn?(0,e.createElement)(Nn,null):(0,e.createElement)(Pn,{form:An}),Ln)})()})();Save