@abtnode/blocklet-services 1.16.45-beta-20250630-024910-24ef8c24 → 1.16.45-beta-20250630-233332-04c2bd6f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/assets/{access-control-BI8hR4m6.js → access-control-D6jgL4-Q.js} +1 -1
  2. package/dist/assets/{add-component-core-DJ6wP3Fb.js → add-component-core-BG8enqM8.js} +1 -1
  3. package/dist/assets/{add-resource-Xzrl9J9E.js → add-resource-DBw6Hwrb.js} +1 -1
  4. package/dist/assets/{advanced-DAKR9vq6.js → advanced-BpYEMYw4.js} +1 -1
  5. package/dist/assets/{appearance-CLcBa2If.js → appearance-CjcxJ6ic.js} +1 -1
  6. package/dist/assets/{audit-logs-BpxjWxH9.js → audit-logs-BFnhmmF4.js} +1 -1
  7. package/dist/assets/{authorize-CJAHvI6f.js → authorize-Gx35POqY.js} +1 -1
  8. package/dist/assets/{branding-Ds5vrS60.js → branding-CgdEHwXJ.js} +2 -2
  9. package/dist/assets/{branding-BqmpdYqw.js → branding-DepEIhg-.js} +1 -1
  10. package/dist/assets/{bundle-avatar-DAWssS61.js → bundle-avatar-DZSSBP_H.js} +1 -1
  11. package/dist/assets/{complete-CoItwYYG.js → complete-DTGHOMGf.js} +1 -1
  12. package/dist/assets/{component-D4dOU94T.js → component-DHj65rcS.js} +3 -3
  13. package/dist/assets/{config-CrGTIwll.js → config-CJAobwc5.js} +1 -1
  14. package/dist/assets/{config-navigation-Ba_9bXNB.js → config-navigation-C-BE_6dA.js} +3 -3
  15. package/dist/assets/{config-space-C_-wUm8x.js → config-space-D4KxQRvm.js} +1 -1
  16. package/dist/assets/{confirm-Cr4yXaP3.js → confirm-C4bZXKUn.js} +1 -1
  17. package/dist/assets/connect-DuQLxqA4.js +5 -0
  18. package/dist/assets/{connect-LANmhgqd.js → connect-igCX-2p5.js} +1 -1
  19. package/dist/assets/{connect-to-CcDyzDBC.js → connect-to-ge1ZQPSM.js} +1 -1
  20. package/dist/assets/{dashboard-BrJfe1tK.js → dashboard-D5eoQ8IH.js} +3 -3
  21. package/dist/assets/{delete-confirm-BTxOYOoY.js → delete-confirm-BnUaxWhM.js} +1 -1
  22. package/dist/assets/{domain-action-card-C9RDnMzS.js → domain-action-card-BPy2Ol9a.js} +1 -1
  23. package/dist/assets/domain-iBSqIwzr.js +9 -0
  24. package/dist/assets/domains-CWzmnE49.js +1 -0
  25. package/dist/assets/dot-DRiNXWva.js +7 -0
  26. package/dist/assets/{email-CslWHpNP.js → email-xNJcprp1.js} +1 -1
  27. package/dist/assets/{exchange-passport-CkSkVesx.js → exchange-passport-xYyJcB-J.js} +1 -1
  28. package/dist/assets/{fuel-BWsBctX0.js → fuel-Ckwg6eTe.js} +1 -1
  29. package/dist/assets/{gen-access-key-jpSB31VW.js → gen-access-key-DEIbVQFA.js} +1 -1
  30. package/dist/assets/{index-CCuD6_Rj.js → index-2BZwphUf.js} +1 -1
  31. package/dist/assets/{index-Bv_IEtVv.js → index-Ao_gDiOd.js} +1 -1
  32. package/dist/assets/{index-C0WYw-jd.js → index-BK3wAAMT.js} +1 -1
  33. package/dist/assets/{index-D-vHTvCV.js → index-BMxp4XYs.js} +1 -1
  34. package/dist/assets/{index-DUGQ4cKm.js → index-BmL5CdAn.js} +1 -1
  35. package/dist/assets/{index-DzRGp0If.js → index-BngwF-PN.js} +3 -3
  36. package/dist/assets/{index-GAl9W53I.js → index-CRqllBas.js} +4 -4
  37. package/dist/assets/{index-YO79r625.js → index-CTczgaOQ.js} +1 -1
  38. package/dist/assets/{index-B6novXpp.js → index-Cf3dTiyQ.js} +1 -1
  39. package/dist/assets/{index-C0kIXw5r.js → index-D2bUzebR.js} +2 -2
  40. package/dist/assets/{index-B8h7EuKB.js → index-DKsTz8U6.js} +1 -1
  41. package/dist/assets/{index-l5blEEs7.js → index-DL4w482x.js} +1 -1
  42. package/dist/assets/{index-D4KLEWFm.js → index-DwZjLaMe.js} +1 -1
  43. package/dist/assets/{index-CYp1xoZ4.js → index-_99_qC2a.js} +1 -1
  44. package/dist/assets/{index-ha4GQCBu.js → index-b_hFKwRq.js} +1 -1
  45. package/dist/assets/{index-Br-eR92d.js → index-rlbe1JM_.js} +1 -1
  46. package/dist/assets/{invitation-49Fgeotv.js → invitation-Cxmm6AFq.js} +1 -1
  47. package/dist/assets/{invite-DLJIQmdJ.js → invite-DO-4LQH8.js} +1 -1
  48. package/dist/assets/{issue-passport-DDCqVv1N.js → issue-passport-C7gVa0yz.js} +1 -1
  49. package/dist/assets/{item-fK0vcLaQ.js → item-BYHK6spa.js} +1 -1
  50. package/dist/assets/{layout-feohUWg7.js → layout-Ccou1sEP.js} +1 -1
  51. package/dist/assets/{list-C8TeMgEe.js → list-8RFvyNnQ.js} +1 -1
  52. package/dist/assets/{list-DeTNTY_6.js → list-CtZmVtTv.js} +2 -2
  53. package/dist/assets/{log-BiuahUh0.js → log-BirUybVP.js} +1 -1
  54. package/dist/assets/{login-5jPX--4W.js → login-myX9lDqn.js} +1 -1
  55. package/dist/assets/{logo-uploader-DC4SpQmr.js → logo-uploader-Btt6h3-w.js} +3 -3
  56. package/dist/assets/{lost-passport-BNyxQig9.js → lost-passport-CqYRKR7e.js} +1 -1
  57. package/dist/assets/{overview-DtickflS.js → overview-eq98s4cm.js} +1 -1
  58. package/dist/assets/{passport-item-BTBWvJCh.js → passport-item-DHlh26r-.js} +1 -1
  59. package/dist/assets/{publish-resource-DyUoB0-C.js → publish-resource-CCGxby4r.js} +1 -1
  60. package/dist/assets/{runtime-Bta2wOnU.js → runtime-B2GP2ZaR.js} +1 -1
  61. package/dist/assets/{security-Bs24V5aw.js → security-CDJf-siQ.js} +1 -1
  62. package/dist/assets/setup-C3ECwM0S.js +30 -0
  63. package/dist/assets/{start-CxjnQYOx.js → start-37CP03ge.js} +1 -1
  64. package/dist/assets/{status-Cht9_8hC.js → status-DQ2_UfyN.js} +1 -1
  65. package/dist/assets/{step-actions-BaBVLHSP.js → step-actions-OF8wtaVt.js} +1 -1
  66. package/dist/assets/{traffic-BdpKUL58.js → traffic-rj9mSgdM.js} +1 -1
  67. package/dist/assets/{transfer-CyBsVivd.js → transfer-DQB6PRl7.js} +1 -1
  68. package/dist/assets/{unsubscribe-DUaYCo9A.js → unsubscribe-Bd0HynPK.js} +1 -1
  69. package/dist/assets/{use-blocklet-logo-fumCZVth.js → use-blocklet-logo-C4yfnUqa.js} +1 -1
  70. package/dist/assets/useAsync-LB28iJ2a.js +1 -0
  71. package/dist/assets/useAsync-egXtU13O.js +1 -0
  72. package/dist/assets/{user-center-DxImDlwk.js → user-center-Puvbe55Q.js} +1 -1
  73. package/dist/assets/{util-BMWW9F7x.js → util-DeHM07tQ.js} +1 -1
  74. package/dist/assets/{wrap-locale-BQFJOrpH.js → wrap-locale-rGr2CQ98.js} +1 -1
  75. package/dist/index.html +1 -1
  76. package/dist/service-worker.js +1 -1
  77. package/package.json +24 -24
  78. package/dist/assets/connect-CT4V0Shw.js +0 -5
  79. package/dist/assets/domain-q-cSvLb-.js +0 -9
  80. package/dist/assets/domains-DzDEWZRA.js +0 -1
  81. package/dist/assets/dot-4jhL56kz.js +0 -7
  82. package/dist/assets/setup-DLQmZAqt.js +0 -30
  83. package/dist/assets/useAsync-C62uE2pS.js +0 -1
@@ -1,2 +1,2 @@
1
- import{g as qe,r as U}from"./vendor-react-DEoibe3W.js";import{j as O,A as ze,T as H,ab as Y,bx as Fe,O as Ue,ak as We,bJ as $e,H as I,a9 as ie,e as Be,y as G,at as Ve,q as be,aa as B,aq as Ke,bw as ve,bZ as He,af as Ge,ad as Ze}from"./vendor-mui-core-Bq8gXTan.js";import{k as oe,a as ee,ar as Je,B as _e,r as ae,a3 as K,be as Ye}from"./vendor-ux-did-connect-pzpsrvqx.js";import{v as Qe,c as Xe}from"./vendor-arcblock-CwufDgLV.js";import{D as le,ac as et,G as tt}from"./index-C0kIXw5r.js";import{f as Q}from"./index-8eXqqyHQ.js";import{d as ke}from"./Launch-DFS3fgjy.js";import{d as rt}from"./Done-ASNftAOL.js";import{A as re}from"./vendor-utils-BfZ4tlod.js";import{d as je}from"./DeleteOutline-BKSMNwfT.js";import{D as st}from"./delete-confirm-BTxOYOoY.js";import{C as nt}from"./confirm-Cr4yXaP3.js";import{u as it}from"./session-BGdAM8zS.js";import{g as X}from"./get-safe-url-B0-S5PGZ.js";import{W as ot}from"./did-address-NnOD1W_A.js";import{u as at}from"./vendor-hooks-DqdmWCmo.js";var lt={};const{NODE_MODES:we}=oe,ct=({mode:R,previousMode:A}={})=>R===we.SERVERLESS||A===we.SERVERLESS||lt.ABT_NODE_DEBUG_AS_SERVERLESS==="true";var ut={isInServerlessMode:ct},Re={exports:{}};(function(R,A){(function(E,k){R.exports=k()})(self,()=>{return E={7629:($,w,b)=>{const a=b(375),h=b(8571),p=b(9474),d=b(1687),e=b(8652),n=b(8160),i=b(3292),r=b(6354),t=b(8901),l=b(9708),s=b(6914),o=b(2294),c=b(6133),f=b(1152),g=b(8863),_=b(2036),v={Base:class{constructor(u){this.type=u,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new o.Ids,this._preferences=null,this._refs=new c.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof l.describe=="function","Manifest functionality disabled"),l.describe(this)}allow(...u){return n.verifyFlat(u,"allow"),this._values(u,"_valids")}alter(u){a(u&&typeof u=="object"&&!Array.isArray(u),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const m=this.clone();m.$_terms.alterations=m.$_terms.alterations||[];for(const y in u){const x=u[y];a(typeof x=="function","Alteration adjuster for",y,"must be a function"),m.$_terms.alterations.push({target:y,adjuster:x})}return m.$_temp.ruleset=!1,m}artifact(u){return a(u!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",u)}cast(u){return a(u===!1||typeof u=="string","Invalid to value"),a(u===!1||this._definition.cast[u],"Type",this.type,"does not support casting to",u),this.$_setFlag("cast",u===!1?void 0:u)}default(u,m){return this._default("default",u,m)}description(u){return a(u&&typeof u=="string","Description must be a non-empty string"),this.$_setFlag("description",u)}empty(u){const m=this.clone();return u!==void 0&&(u=m.$_compile(u,{override:!1})),m.$_setFlag("empty",u,{clone:!1})}error(u){return a(u,"Missing error"),a(u instanceof Error||typeof u=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",u)}example(u,m={}){return a(u!==void 0,"Missing example"),n.assertOptions(m,["override"]),this._inner("examples",u,{single:!0,override:m.override})}external(u,m){return typeof u=="object"&&(a(!m,"Cannot combine options with description"),m=u.description,u=u.method),a(typeof u=="function","Method must be a function"),a(m===void 0||m&&typeof m=="string","Description must be a non-empty string"),this._inner("externals",{method:u,description:m},{single:!0})}failover(u,m){return this._default("failover",u,m)}forbidden(){return this.presence("forbidden")}id(u){return u?(a(typeof u=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(u),"id cannot contain period character"),this.$_setFlag("id",u)):this.$_setFlag("id",void 0)}invalid(...u){return this._values(u,"_invalids")}label(u){return a(u&&typeof u=="string","Label name must be a non-empty string"),this.$_setFlag("label",u)}meta(u){return a(u!==void 0,"Meta cannot be undefined"),this._inner("metas",u,{single:!0})}note(...u){a(u.length,"Missing notes");for(const m of u)a(m&&typeof m=="string","Notes must be non-empty strings");return this._inner("notes",u)}only(u=!0){return a(typeof u=="boolean","Invalid mode:",u),this.$_setFlag("only",u)}optional(){return this.presence("optional")}prefs(u){a(u,"Missing preferences"),a(u.context===void 0,"Cannot override context"),a(u.externals===void 0,"Cannot override externals"),a(u.warnings===void 0,"Cannot override warnings"),a(u.debug===void 0,"Cannot override debug"),n.checkPreferences(u);const m=this.clone();return m._preferences=n.preferences(m._preferences,u),m}presence(u){return a(["optional","required","forbidden"].includes(u),"Unknown presence mode",u),this.$_setFlag("presence",u)}raw(u=!0){return this.$_setFlag("result",u?"raw":void 0)}result(u){return a(["raw","strip"].includes(u),"Unknown result mode",u),this.$_setFlag("result",u)}required(){return this.presence("required")}strict(u){const m=this.clone(),y=u!==void 0&&!u;return m._preferences=n.preferences(m._preferences,{convert:y}),m}strip(u=!0){return this.$_setFlag("result",u?"strip":void 0)}tag(...u){a(u.length,"Missing tags");for(const m of u)a(m&&typeof m=="string","Tags must be non-empty strings");return this._inner("tags",u)}unit(u){return a(u&&typeof u=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",u)}valid(...u){n.verifyFlat(u,"valid");const m=this.allow(...u);return m.$_setFlag("only",!!m._valids,{clone:!1}),m}when(u,m){const y=this.clone();y.$_terms.whens||(y.$_terms.whens=[]);const x=i.when(y,u,m);if(!["any","link"].includes(y.type)){const j=x.is?[x]:x.switch;for(const S of j)a(!S.then||S.then.type==="any"||S.then.type===y.type,"Cannot combine",y.type,"with",S.then&&S.then.type),a(!S.otherwise||S.otherwise.type==="any"||S.otherwise.type===y.type,"Cannot combine",y.type,"with",S.otherwise&&S.otherwise.type)}return y.$_terms.whens.push(x),y.$_mutateRebuild()}cache(u){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const m=this.clone();return m._cache=u||e.provider.provision(),m.$_temp.ruleset=!1,m}clone(){const u=Object.create(Object.getPrototypeOf(this));return this._assign(u)}concat(u){a(n.isSchema(u),"Invalid schema object"),a(this.type==="any"||u.type==="any"||u.type===this.type,"Cannot merge type",this.type,"with another type:",u.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!u._inRuleset(),"Cannot concatenate a schema with open ruleset");let m=this.clone();if(this.type==="any"&&u.type!=="any"){const y=u.clone();for(const x of Object.keys(m))x!=="type"&&(y[x]=m[x]);m=y}m._ids.concat(u._ids),m._refs.register(u,c.toSibling),m._preferences=m._preferences?n.preferences(m._preferences,u._preferences):u._preferences,m._valids=_.merge(m._valids,u._valids,u._invalids),m._invalids=_.merge(m._invalids,u._invalids,u._valids);for(const y of u._singleRules.keys())m._singleRules.has(y)&&(m._rules=m._rules.filter(x=>x.keep||x.name!==y),m._singleRules.delete(y));for(const y of u._rules)u._definition.rules[y.method].multi||m._singleRules.set(y.name,y),m._rules.push(y);if(m._flags.empty&&u._flags.empty){m._flags.empty=m._flags.empty.concat(u._flags.empty);const y=Object.assign({},u._flags);delete y.empty,d(m._flags,y)}else if(u._flags.empty){m._flags.empty=u._flags.empty;const y=Object.assign({},u._flags);delete y.empty,d(m._flags,y)}else d(m._flags,u._flags);for(const y in u.$_terms){const x=u.$_terms[y];x?m.$_terms[y]?m.$_terms[y]=m.$_terms[y].concat(x):m.$_terms[y]=x.slice():m.$_terms[y]||(m.$_terms[y]=x)}return this.$_root._tracer&&this.$_root._tracer._combine(m,[this,u]),m.$_mutateRebuild()}extend(u){return a(!u.base,"Cannot extend type with another base"),t.type(this,u)}extract(u){return u=Array.isArray(u)?u:u.split("."),this._ids.reach(u)}fork(u,m){a(!this._inRuleset(),"Cannot fork inside a ruleset");let y=this;for(let x of[].concat(u))x=Array.isArray(x)?x:x.split("."),y=y._ids.fork(x,m,y);return y.$_temp.ruleset=!1,y}rule(u){const m=this._definition;n.assertOptions(u,Object.keys(m.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const y=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(y>=0&&y<this._rules.length,"Cannot apply rules to empty ruleset");const x=this.clone();for(let j=y;j<x._rules.length;++j){const S=x._rules[j],D=h(S);for(const C in u)m.modifiers[C](D,u[C]),a(D.name===S.name,"Cannot change rule name");x._rules[j]=D,x._singleRules.get(D.name)===S&&x._singleRules.set(D.name,D)}return x.$_temp.ruleset=!1,x.$_mutateRebuild()}get ruleset(){a(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const u=this.clone();return u.$_temp.ruleset=u._rules.length,u}get $(){return this.ruleset}tailor(u){u=[].concat(u),a(!this._inRuleset(),"Cannot tailor inside a ruleset");let m=this;if(this.$_terms.alterations)for(const{target:y,adjuster:x}of this.$_terms.alterations)u.includes(y)&&(m=x(m),a(n.isSchema(m),"Alteration adjuster for",y,"failed to return a schema object"));return m=m.$_modify({each:y=>y.tailor(u),ref:!1}),m.$_temp.ruleset=!1,m.$_mutateRebuild()}tracer(){return f.location?f.location(this):this}validate(u,m){return g.entry(u,this,m)}validateAsync(u,m){return g.entryAsync(u,this,m)}$_addRule(u){typeof u=="string"&&(u={name:u}),a(u&&typeof u=="object","Invalid options"),a(u.name&&typeof u.name=="string","Invalid rule name");for(const S in u)a(S[0]!=="_","Cannot set private rule properties");const m=Object.assign({},u);m._resolve=[],m.method=m.method||m.name;const y=this._definition.rules[m.method],x=m.args;a(y,"Unknown rule",m.method);const j=this.clone();if(x){a(Object.keys(x).length===1||Object.keys(x).length===this._definition.rules[m.name].args.length,"Invalid rule definition for",this.type,m.name);for(const S in x){let D=x[S];if(y.argsByName){const C=y.argsByName.get(S);if(C.ref&&n.isResolvable(D))m._resolve.push(S),j.$_mutateRegister(D);else if(C.normalize&&(D=C.normalize(D),x[S]=D),C.assert){const L=n.validateArg(D,S,C);a(!L,L,"or reference")}}D!==void 0?x[S]=D:delete x[S]}}return y.multi||(j._ruleRemove(m.name,{clone:!1}),j._singleRules.set(m.name,m)),j.$_temp.ruleset===!1&&(j.$_temp.ruleset=null),y.priority?j._rules.unshift(m):j._rules.push(m),j}$_compile(u,m){return i.schema(this.$_root,u,m)}$_createError(u,m,y,x,j,S={}){const D=S.flags!==!1?this._flags:{},C=S.messages?s.merge(this._definition.messages,S.messages):this._definition.messages;return new r.Report(u,m,y,D,C,x,j)}$_getFlag(u){return this._flags[u]}$_getRule(u){return this._singleRules.get(u)}$_mapLabels(u){return u=Array.isArray(u)?u:u.split("."),this._ids.labels(u)}$_match(u,m,y,x){(y=Object.assign({},y)).abortEarly=!0,y._externals=!1,m.snapshot();const j=!g.validate(u,this,m,y,x).errors;return m.restore(),j}$_modify(u){return n.assertOptions(u,["each","once","ref","schema"]),o.schema(this,u)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(u,{source:m,name:y,path:x,key:j})=>{const S=this._definition[m][y]&&this._definition[m][y].register;S!==!1&&this.$_mutateRegister(u,{family:S,key:j})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(u,{family:m,key:y}={}){this._refs.register(u,m),this._ids.register(u,{key:y})}$_property(u){return this._definition.properties[u]}$_reach(u){return this._ids.reach(u)}$_rootReferences(){return this._refs.roots()}$_setFlag(u,m,y={}){a(u[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const x=this._definition.flags[u]||{};if(p(m,x.default)&&(m=void 0),p(m,this._flags[u]))return this;const j=y.clone!==!1?this.clone():this;return m!==void 0?(j._flags[u]=m,j.$_mutateRegister(m)):delete j._flags[u],u[0]!=="_"&&(j.$_temp.ruleset=!1),j}$_parent(u,...m){return this[u][n.symbols.parent].call(this,...m)}$_validate(u,m,y){return g.validate(u,this,m,y)}_assign(u){u.type=this.type,u.$_root=this.$_root,u.$_temp=Object.assign({},this.$_temp),u.$_temp.whens={},u._ids=this._ids.clone(),u._preferences=this._preferences,u._valids=this._valids&&this._valids.clone(),u._invalids=this._invalids&&this._invalids.clone(),u._rules=this._rules.slice(),u._singleRules=h(this._singleRules,{shallow:!0}),u._refs=this._refs.clone(),u._flags=Object.assign({},this._flags),u._cache=null,u.$_terms={};for(const m in this.$_terms)u.$_terms[m]=this.$_terms[m]?this.$_terms[m].slice():null;u.$_super={};for(const m in this.$_super)u.$_super[m]=this._super[m].bind(u);return u}_bare(){const u=this.clone();u._reset();const m=u._definition.terms;for(const y in m){const x=m[y];u.$_terms[y]=x.init}return u.$_mutateRebuild()}_default(u,m,y={}){return n.assertOptions(y,"literal"),a(m!==void 0,"Missing",u,"value"),a(typeof m=="function"||!y.literal,"Only function value supports literal option"),typeof m=="function"&&y.literal&&(m={[n.symbols.literal]:!0,literal:m}),this.$_setFlag(u,m)}_generate(u,m,y){if(!this.$_terms.whens)return{schema:this};const x=[],j=[];for(let C=0;C<this.$_terms.whens.length;++C){const L=this.$_terms.whens[C];if(L.concat){x.push(L.concat),j.push(`${C}.concat`);continue}const T=L.ref?L.ref.resolve(u,m,y):u,N=L.is?[L]:L.switch,q=j.length;for(let M=0;M<N.length;++M){const{is:P,then:F,otherwise:W}=N[M],V=`${C}${L.switch?"."+M:""}`;if(P.$_match(T,m.nest(P,`${V}.is`),y)){if(F){const Z=m.localize([...m.path,`${V}.then`],m.ancestors,m.schemas),{schema:ne,id:J}=F._generate(u,Z,y);x.push(ne),j.push(`${V}.then${J?`(${J})`:""}`);break}}else if(W){const Z=m.localize([...m.path,`${V}.otherwise`],m.ancestors,m.schemas),{schema:ne,id:J}=W._generate(u,Z,y);x.push(ne),j.push(`${V}.otherwise${J?`(${J})`:""}`);break}}if(L.break&&j.length>q)break}const S=j.join(", ");if(m.mainstay.tracer.debug(m,"rule","when",S),!S)return{schema:this};if(!m.mainstay.tracer.active&&this.$_temp.whens[S])return{schema:this.$_temp.whens[S],id:S};let D=this;this._definition.generate&&(D=this._definition.generate(this,u,m,y));for(const C of x)D=D.concat(C);return this.$_root._tracer&&this.$_root._tracer._combine(D,[this,...x]),this.$_temp.whens[S]=D,{schema:D,id:S}}_inner(u,m,y={}){a(!this._inRuleset(),`Cannot set ${u} inside a ruleset`);const x=this.clone();return x.$_terms[u]&&!y.override||(x.$_terms[u]=[]),y.single?x.$_terms[u].push(m):x.$_terms[u].push(...m),x.$_temp.ruleset=!1,x}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(u,m={}){if(!this._singleRules.has(u))return this;const y=m.clone!==!1?this.clone():this;y._singleRules.delete(u);const x=[];for(let j=0;j<y._rules.length;++j){const S=y._rules[j];S.name!==u||S.keep?x.push(S):y._inRuleset()&&j<y.$_temp.ruleset&&--y.$_temp.ruleset}return y._rules=x,y}_values(u,m){n.verifyFlat(u,m.slice(1,-1));const y=this.clone(),x=u[0]===n.symbols.override;if(x&&(u=u.slice(1)),!y[m]&&u.length?y[m]=new _:x&&(y[m]=u.length?new _:null,y.$_mutateRebuild()),!y[m])return y;x&&y[m].override();for(const j of u){a(j!==void 0,"Cannot call allow/valid/invalid with undefined"),a(j!==n.symbols.override,"Override must be the first value");const S=m==="_invalids"?"_valids":"_invalids";y[S]&&(y[S].remove(j),y[S].length||(a(m==="_valids"||!y._flags.only,"Setting invalid value",j,"leaves schema rejecting all values due to previous valid rule"),y[S]=null)),y[m].add(j,y._refs)}return y}}};v.Base.prototype[n.symbols.any]={version:n.version,compile:i.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,$.exports=new v.Base},8652:($,w,b)=>{const a=b(375),h=b(8571),p=b(8160),d={max:1e3,supported:new Set(["undefined","boolean","number","string"])};w.provider={provision:e=>new d.Cache(e)},d.Cache=class{constructor(e={}){p.assertOptions(e,["max"]),a(e.max===void 0||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||d.max,this._map=new Map,this._list=new d.List}get length(){return this._map.size}set(e,n){if(e!==null&&!d.supported.has(typeof e))return;let i=this._map.get(e);if(i)return i.value=n,void this._list.first(i);i=this._list.unshift({key:e,value:n}),this._map.set(e,i),this._compact()}get(e){const n=this._map.get(e);if(n)return this._list.first(n),h(n.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},d.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:n,prev:i}=e;return n.prev=i,i&&(i.next=n),e===this.tail&&(this.tail=n),e.prev=null,e.next=null,e}}},8160:($,w,b)=>{const a=b(375),h=b(7916),p=b(5934);let d,e;const n={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)?)?)?)?$/};w.version=p.version,w.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},w.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")},w.assertOptions=function(i,r,t="Options"){a(i&&typeof i=="object"&&!Array.isArray(i),"Options must be of type object");const l=Object.keys(i).filter(s=>!r.includes(s));a(l.length===0,`${t} contain unknown keys: ${l}`)},w.checkPreferences=function(i){e=e||b(3378);const r=e.preferences.validate(i);if(r.error)throw new h([r.error.details[0].message])},w.compare=function(i,r,t){switch(t){case"=":return i===r;case">":return i>r;case"<":return i<r;case">=":return i>=r;case"<=":return i<=r}},w.default=function(i,r){return i===void 0?r:i},w.isIsoDate=function(i){return n.isoDate.test(i)},w.isNumber=function(i){return typeof i=="number"&&!isNaN(i)},w.isResolvable=function(i){return!!i&&(i[w.symbols.ref]||i[w.symbols.template])},w.isSchema=function(i,r={}){const t=i&&i[w.symbols.any];return!!t&&(a(r.legacy||t.version===w.version,"Cannot mix different versions of joi schemas"),!0)},w.isValues=function(i){return i[w.symbols.values]},w.limit=function(i){return Number.isSafeInteger(i)&&i>=0},w.preferences=function(i,r){d=d||b(6914),i=i||{},r=r||{};const t=Object.assign({},i,r);return r.errors&&i.errors&&(t.errors=Object.assign({},i.errors,r.errors),t.errors.wrap=Object.assign({},i.errors.wrap,r.errors.wrap)),r.messages&&(t.messages=d.compile(r.messages,i.messages)),delete t[w.symbols.prefs],t},w.tryWithPath=function(i,r,t={}){try{return i()}catch(l){throw l.path!==void 0?l.path=r+"."+l.path:l.path=r,t.append&&(l.message=`${l.message} (${l.path})`),l}},w.validateArg=function(i,r,{assert:t,message:l}){if(w.isSchema(t)){const s=t.validate(i);return s.error?s.error.message:void 0}if(!t(i))return r?`${r} ${l}`:l},w.verifyFlat=function(i,r){for(const t of i)a(!Array.isArray(t),"Method no longer accepts array arguments:",r)}},3292:($,w,b)=>{const a=b(375),h=b(8160),p=b(6133),d={};w.schema=function(e,n,i={}){h.assertOptions(i,["appendPath","override"]);try{return d.schema(e,n,i)}catch(r){throw i.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},d.schema=function(e,n,i){a(n!==void 0,"Invalid undefined schema"),Array.isArray(n)&&(a(n.length,"Invalid empty array schema"),n.length===1&&(n=n[0]));const r=(t,...l)=>i.override!==!1?t.valid(e.override,...l):t.valid(...l);if(d.simple(n))return r(e,n);if(typeof n=="function")return e.custom(n);if(a(typeof n=="object","Invalid schema content:",typeof n),h.isResolvable(n))return r(e,n);if(h.isSchema(n))return n;if(Array.isArray(n)){for(const t of n)if(!d.simple(t))return e.alternatives().try(...n);return r(e,...n)}return n instanceof RegExp?e.string().regex(n):n instanceof Date?r(e.date(),n):(a(Object.getPrototypeOf(n)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(n))},w.ref=function(e,n){return p.isRef(e)?e:p.create(e,n)},w.compile=function(e,n,i={}){h.assertOptions(i,["legacy"]);const r=n&&n[h.symbols.any];if(r)return a(i.legacy||r.version===h.version,"Cannot mix different versions of joi schemas:",r.version,h.version),n;if(typeof n!="object"||!i.legacy)return w.schema(e,n,{appendPath:!0});const t=d.walk(n);return t?t.compile(t.root,n):w.schema(e,n,{appendPath:!0})},d.walk=function(e){if(typeof e!="object")return null;if(Array.isArray(e)){for(const i of e){const r=d.walk(i);if(r)return r}return null}const n=e[h.symbols.any];if(n)return{root:e[n.root],compile:n.compile};a(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const i in e){const r=d.walk(e[i]);if(r)return r}return null},d.simple=function(e){return e===null||["boolean","string","number"].includes(typeof e)},w.when=function(e,n,i){if(i===void 0&&(a(n&&typeof n=="object","Missing options"),i=n,n=p.create(".")),Array.isArray(i)&&(i={switch:i}),h.assertOptions(i,["is","not","then","otherwise","switch","break"]),h.isSchema(n))return a(i.is===void 0,'"is" can not be used with a schema condition'),a(i.not===void 0,'"not" can not be used with a schema condition'),a(i.switch===void 0,'"switch" can not be used with a schema condition'),d.condition(e,{is:n,then:i.then,otherwise:i.otherwise,break:i.break});if(a(p.isRef(n)||typeof n=="string","Invalid condition:",n),a(i.not===void 0||i.is===void 0,'Cannot combine "is" with "not"'),i.switch===void 0){let t=i;i.not!==void 0&&(t={is:i.not,then:i.otherwise,otherwise:i.then,break:i.break});let l=t.is!==void 0?e.$_compile(t.is):e.$_root.invalid(null,!1,0,"").required();return a(t.then!==void 0||t.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(t.break===void 0||t.then===void 0||t.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),i.is===void 0||p.isRef(i.is)||h.isSchema(i.is)||(l=l.required()),d.condition(e,{ref:w.ref(n),is:l,then:t.then,otherwise:t.otherwise,break:t.break})}a(Array.isArray(i.switch),'"switch" must be an array'),a(i.is===void 0,'Cannot combine "switch" with "is"'),a(i.not===void 0,'Cannot combine "switch" with "not"'),a(i.then===void 0,'Cannot combine "switch" with "then"');const r={ref:w.ref(n),switch:[],break:i.break};for(let t=0;t<i.switch.length;++t){const l=i.switch[t],s=t===i.switch.length-1;h.assertOptions(l,s?["is","then","otherwise"]:["is","then"]),a(l.is!==void 0,'Switch statement missing "is"'),a(l.then!==void 0,'Switch statement missing "then"');const o={is:e.$_compile(l.is),then:e.$_compile(l.then)};if(p.isRef(l.is)||h.isSchema(l.is)||(o.is=o.is.required()),s){a(i.otherwise===void 0||l.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const c=i.otherwise!==void 0?i.otherwise:l.otherwise;c!==void 0&&(a(r.break===void 0,"Cannot specify both otherwise and break"),o.otherwise=e.$_compile(c))}r.switch.push(o)}return r},d.condition=function(e,n){for(const i of["then","otherwise"])n[i]===void 0?delete n[i]:n[i]=e.$_compile(n[i]);return n}},6354:($,w,b)=>{const a=b(5688),h=b(8160),p=b(3328);w.Report=class{constructor(d,e,n,i,r,t,l){if(this.code=d,this.flags=i,this.messages=r,this.path=t.path,this.prefs=l,this.state=t,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=w.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const s=this.path[this.path.length-1];typeof s!="object"&&(this.local.key=s)}}_setTemplate(d){if(this.template=d,!this.flags.label&&this.path.length===0){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const d=this.code;if(!this.prefs.errors.render)return this.code;const e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${d}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.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(d,e){return w.template(this.value,d,e||this.code,this.state,this.prefs)}},w.path=function(d){let e="";for(const n of d)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e},w.template=function(d,e,n,i,r){if(!e)return;if(p.isTemplate(e))return n!=="root"?e:null;let t=r.errors.language;if(h.isResolvable(t)&&(t=t.resolve(d,i,r)),t&&e[t]){if(e[t][n]!==void 0)return e[t][n];if(e[t]["*"]!==void 0)return e[t]["*"]}return e[n]?e[n]:e["*"]},w.label=function(d,e,n,i){if(d.label)return d.label;if(!n.errors.label)return"";let r=e.path;return n.errors.label==="key"&&e.path.length>1&&(r=e.path.slice(-1)),w.path(r)||w.template(null,n.messages,"root",e,n)||i&&w.template(null,i,"root",e,n)||"value"},w.process=function(d,e,n){if(!d)return null;const{override:i,message:r,details:t}=w.details(d);if(i)return i;if(n.errors.stack)return new w.ValidationError(r,t,e);const l=Error.stackTraceLimit;Error.stackTraceLimit=0;const s=new w.ValidationError(r,t,e);return Error.stackTraceLimit=l,s},w.details=function(d,e={}){let n=[];const i=[];for(const r of d){if(r instanceof Error){if(e.override!==!1)return{override:r};const l=r.toString();n.push(l),i.push({message:l,type:"override",context:{error:r}});continue}const t=r.toString();n.push(t),i.push({message:t,path:r.path.filter(l=>typeof l!="object"),type:r.code,context:r.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:i}},w.ValidationError=class extends Error{constructor(d,e,n){super(d),this._original=n,this.details=e}static isError(d){return d instanceof w.ValidationError}},w.ValidationError.prototype.isJoi=!0,w.ValidationError.prototype.name="ValidationError",w.ValidationError.prototype.annotate=a.error},8901:($,w,b)=>{const a=b(375),h=b(8571),p=b(8160),d=b(6914),e={};w.type=function(n,i){const r=Object.getPrototypeOf(n),t=h(r),l=n._assign(Object.create(t)),s=Object.assign({},i);delete s.base,t._definition=s;const o=r._definition||{};s.messages=d.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),l.type=s.type,s.flags=Object.assign({},o.flags,s.flags);const c=Object.assign({},o.terms);if(s.terms)for(const v in s.terms){const u=s.terms[v];a(l.$_terms[v]===void 0,"Invalid term override for",s.type,v),l.$_terms[v]=u.init,c[v]=u}s.terms=c,s.args||(s.args=o.args),s.prepare=e.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=e.coerce(s.coerce,o.coerce),s.validate=e.validate(s.validate,o.validate);const f=Object.assign({},o.rules);if(s.rules)for(const v in s.rules){const u=s.rules[v];a(typeof u=="object","Invalid rule definition for",s.type,v);let m=u.method;if(m===void 0&&(m=function(){return this.$_addRule(v)}),m&&(a(!t[v],"Rule conflict in",s.type,v),t[v]=m),a(!f[v],"Rule conflict in",s.type,v),f[v]=u,u.alias){const y=[].concat(u.alias);for(const x of y)t[x]=u.method}u.args&&(u.argsByName=new Map,u.args=u.args.map(y=>(typeof y=="string"&&(y={name:y}),a(!u.argsByName.has(y.name),"Duplicated argument name",y.name),p.isSchema(y.assert)&&(y.assert=y.assert.strict().label(y.name)),u.argsByName.set(y.name,y),y)))}s.rules=f;const g=Object.assign({},o.modifiers);if(s.modifiers)for(const v in s.modifiers){a(!t[v],"Rule conflict in",s.type,v);const u=s.modifiers[v];a(typeof u=="function","Invalid modifier definition for",s.type,v);const m=function(y){return this.rule({[v]:y})};t[v]=m,g[v]=u}if(s.modifiers=g,s.overrides){t._super=r,l.$_super={};for(const v in s.overrides)a(r[v],"Cannot override missing",v),s.overrides[v][p.symbols.parent]=r[v],l.$_super[v]=r[v].bind(l);Object.assign(t,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);const _=Object.assign({},o.manifest,s.manifest);return _.build=e.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=_,s.rebuild=e.rebuild(s.rebuild,o.rebuild),l},e.build=function(n,i){return n&&i?function(r,t){return i(n(r,t),t)}:n||i},e.coerce=function(n,i){return n&&i?{from:n.from&&i.from?[...new Set([...n.from,...i.from])]:null,method(r,t){let l;if((!i.from||i.from.includes(typeof r))&&(l=i.method(r,t),l)){if(l.errors||l.value===void 0)return l;r=l.value}if(!n.from||n.from.includes(typeof r)){const s=n.method(r,t);if(s)return s}return l}}:n||i},e.prepare=function(n,i){return n&&i?function(r,t){const l=n(r,t);if(l){if(l.errors||l.value===void 0)return l;r=l.value}return i(r,t)||l}:n||i},e.rebuild=function(n,i){return n&&i?function(r){i(r),n(r)}:n||i},e.validate=function(n,i){return n&&i?function(r,t){const l=i(r,t);if(l){if(l.errors&&(!Array.isArray(l.errors)||l.errors.length))return l;r=l.value}return n(r,t)||l}:n||i}},5107:($,w,b)=>{const a=b(375),h=b(8571),p=b(8652),d=b(8160),e=b(3292),n=b(6354),i=b(8901),r=b(9708),t=b(6133),l=b(3328),s=b(1152);let o;const c={types:{alternatives:b(4946),any:b(8068),array:b(546),boolean:b(4937),date:b(7500),function:b(390),link:b(8785),number:b(3832),object:b(8966),string:b(7417),symbol:b(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const f={_types:new Set(Object.keys(c.types))};for(const g of f._types)f[g]=function(..._){return a(!_.length||["alternatives","link","object"].includes(g),"The",g,"type does not allow arguments"),c.generate(this,c.types[g],_)};for(const g of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])f[g]=function(..._){return this.any()[g](..._)};Object.assign(f,c.methods);for(const g in c.aliases){const _=c.aliases[g];f[g]=f[_]}return f.x=f.expression,s.setup&&s.setup(f),f}};c.methods={ValidationError:n.ValidationError,version:d.version,cache:p.provider,assert(f,g,..._){c.assert(f,g,!0,_)},attempt:(f,g,..._)=>c.assert(f,g,!1,_),build(f){return a(typeof r.build=="function","Manifest functionality disabled"),r.build(this,f)},checkPreferences(f){d.checkPreferences(f)},compile(f,g){return e.compile(this,f,g)},defaults(f){a(typeof f=="function","modifier must be a function");const g=Object.assign({},this);for(const _ of g._types){const v=f(g[_]());a(d.isSchema(v),"modifier must return a valid schema object"),g[_]=function(...u){return c.generate(this,v,u)}}return g},expression:(...f)=>new l(...f),extend(...f){d.verifyFlat(f,"extend"),o=o||b(3378),a(f.length,"You need to provide at least one extension"),this.assert(f,o.extensions);const g=Object.assign({},this);g._types=new Set(g._types);for(let _ of f){typeof _=="function"&&(_=_(g)),this.assert(_,o.extension);const v=c.expandExtension(_,g);for(const u of v){a(g[u.type]===void 0||g._types.has(u.type),"Cannot override name",u.type);const m=u.base||this.any(),y=i.type(m,u);g._types.add(u.type),g[u.type]=function(...x){return c.generate(this,y,x)}}}return g},isError:n.ValidationError.isError,isExpression:l.isTemplate,isRef:t.isRef,isSchema:d.isSchema,in:(...f)=>t.in(...f),override:d.symbols.override,ref:(...f)=>t.create(...f),types(){const f={};for(const g of this._types)f[g]=this[g]();for(const g in c.aliases)f[g]=this[g]();return f}},c.assert=function(f,g,_,v){const u=v[0]instanceof Error||typeof v[0]=="string"?v[0]:null,m=u!==null?v[1]:v[0],y=g.validate(f,d.preferences({errors:{stack:!0}},m||{}));let x=y.error;if(!x)return y.value;if(u instanceof Error)throw u;const j=_&&typeof x.annotate=="function"?x.annotate():x.message;throw x instanceof n.ValidationError==0&&(x=h(x)),x.message=u?`${u} ${j}`:j,x},c.generate=function(f,g,_){return a(f,"Must be invoked on a Joi instance."),g.$_root=f,g._definition.args&&_.length?g._definition.args(g,..._):g},c.expandExtension=function(f,g){if(typeof f.type=="string")return[f];const _=[];for(const v of g._types)if(f.type.test(v)){const u=Object.assign({},f);u.type=v,u.base=g[v](),_.push(u)}return _},$.exports=c.root()},6914:($,w,b)=>{const a=b(375),h=b(8571),p=b(3328);w.compile=function(d,e){if(typeof d=="string")return a(!e,"Cannot set single message string"),new p(d);if(p.isTemplate(d))return a(!e,"Cannot set single message template"),d;a(typeof d=="object"&&!Array.isArray(d),"Invalid message options"),e=e?h(e):{};for(let n in d){const i=d[n];if(n==="root"||p.isTemplate(i)){e[n]=i;continue}if(typeof i=="string"){e[n]=new p(i);continue}a(typeof i=="object"&&!Array.isArray(i),"Invalid message for",n);const r=n;for(n in e[r]=e[r]||{},i){const t=i[n];n==="root"||p.isTemplate(t)?e[r][n]=t:(a(typeof t=="string","Invalid message for",n,"in",r),e[r][n]=new p(t))}}return e},w.decompile=function(d){const e={};for(let n in d){const i=d[n];if(n==="root"){e.root=i;continue}if(p.isTemplate(i)){e[n]=i.describe({compact:!0});continue}const r=n;for(n in e[r]={},i){const t=i[n];n!=="root"?e[r][n]=t.describe({compact:!0}):e[r].root=t}}return e},w.merge=function(d,e){if(!d)return w.compile(e);if(!e)return d;if(typeof e=="string")return new p(e);if(p.isTemplate(e))return e;const n=h(d);for(let i in e){const r=e[i];if(i==="root"||p.isTemplate(r)){n[i]=r;continue}if(typeof r=="string"){n[i]=new p(r);continue}a(typeof r=="object"&&!Array.isArray(r),"Invalid message for",i);const t=i;for(i in n[t]=n[t]||{},r){const l=r[i];i==="root"||p.isTemplate(l)?n[t][i]=l:(a(typeof l=="string","Invalid message for",i,"in",t),n[t][i]=new p(l))}}return n}},2294:($,w,b)=>{const a=b(375),h=b(8160),p=b(6133),d={};w.Ids=d.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new d.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[n,i]of e._byId.entries())a(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,i);for(const[n,i]of e._byKey.entries())a(!this._byId.has(n),"Schema key conflicts with existing id:",n),this._byKey.set(n,i)}fork(e,n,i){const r=this._collect(e);r.push({schema:i});const t=r.shift();let l={id:t.id,schema:n(t.schema)};a(h.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const s of r)l={id:s.id,schema:d.fork(s.schema,l.id,l.schema)};return l.schema}labels(e,n=[]){const i=e[0],r=this._get(i);if(!r)return[...n,...e].join(".");const t=e.slice(1);return n=[...n,r.schema._flags.label||i],t.length?r.schema._ids.labels(t,n):n.join(".")}reach(e,n=[]){const i=e[0],r=this._get(i);a(r,"Schema does not contain path",[...n,...e].join("."));const t=e.slice(1);return t.length?r.schema._ids.reach(t,[...n,i]):r.schema}register(e,{key:n}={}){if(!e||!h.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const i=e._flags.id;if(i){const r=this._byId.get(i);a(!r||r.schema===e,"Cannot add different schemas with the same id:",i),a(!this._byKey.has(i),"Schema id conflicts with existing key:",i),this._byId.set(i,{schema:e,id:i})}n&&(a(!this._byKey.has(n),"Schema already contains key:",n),a(!this._byId.has(n),"Schema key conflicts with existing id:",n),this._byKey.set(n,{schema:e,id:n}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,n=[],i=[]){const r=e[0],t=this._get(r);a(t,"Schema does not contain path",[...n,...e].join(".")),i=[t,...i];const l=e.slice(1);return l.length?t.schema._ids._collect(l,[...n,r],i):i}_get(e){return this._byId.get(e)||this._byKey.get(e)}},d.fork=function(e,n,i){const r=w.schema(e,{each:(t,{key:l})=>{if(n===(t._flags.id||l))return i},ref:!1});return r?r.$_mutateRebuild():e},w.schema=function(e,n){let i;for(const r in e._flags){if(r[0]==="_")continue;const t=d.scan(e._flags[r],{source:"flags",name:r},n);t!==void 0&&(i=i||e.clone(),i._flags[r]=t)}for(let r=0;r<e._rules.length;++r){const t=e._rules[r],l=d.scan(t.args,{source:"rules",name:t.name},n);if(l!==void 0){i=i||e.clone();const s=Object.assign({},t);s.args=l,i._rules[r]=s,i._singleRules.get(t.name)===t&&i._singleRules.set(t.name,s)}}for(const r in e.$_terms){if(r[0]==="_")continue;const t=d.scan(e.$_terms[r],{source:"terms",name:r},n);t!==void 0&&(i=i||e.clone(),i.$_terms[r]=t)}return i},d.scan=function(e,n,i,r,t){const l=r||[];if(e===null||typeof e!="object")return;let s;if(Array.isArray(e)){for(let o=0;o<e.length;++o){const c=n.source==="terms"&&n.name==="keys"&&e[o].key,f=d.scan(e[o],n,i,[o,...l],c);f!==void 0&&(s=s||e.slice(),s[o]=f)}return s}if(i.schema!==!1&&h.isSchema(e)||i.ref!==!1&&p.isRef(e)){const o=i.each(e,{...n,path:l,key:t});return o===e?void 0:o}for(const o in e){if(o[0]==="_")continue;const c=d.scan(e[o],n,i,[o,...l],t);c!==void 0&&(s=s||Object.assign({},e),s[o]=c)}return s}},6133:($,w,b)=>{const a=b(375),h=b(8571),p=b(9621),d=b(8160);let e;const n={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};w.create=function(i,r={}){a(typeof i=="string","Invalid reference key:",i),d.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const t=Object.assign({},n.defaults,r);delete t.prefix;const l=t.separator,s=n.context(i,l,r.prefix);if(t.type=s.type,i=s.key,t.type==="value")if(s.root&&(a(!l||i[0]!==l,"Cannot specify relative path with root prefix"),t.ancestor="root",i||(i=null)),l&&l===i)i=null,t.ancestor=0;else if(t.ancestor!==void 0)a(!l||!i||i[0]!==l,"Cannot combine prefix with ancestor option");else{const[o,c]=n.ancestor(i,l);c&&(i=i.slice(c))===""&&(i=null),t.ancestor=o}return t.path=l?i===null?[]:i.split(l):[i],new n.Ref(t)},w.in=function(i,r={}){return w.create(i,{...r,in:!0})},w.isRef=function(i){return!!i&&!!i[d.symbols.ref]},n.Ref=class{constructor(i){a(typeof i=="object","Invalid reference construction"),d.assertOptions(i,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(i.separator)||typeof i.separator=="string"&&i.separator.length===1,"Invalid separator"),a(!i.adjust||typeof i.adjust=="function","options.adjust must be a function"),a(!i.map||Array.isArray(i.map),"options.map must be an array"),a(!i.map||!i.adjust,"Cannot set both map and adjust options"),Object.assign(this,n.defaults,i),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(i,r,t,l,s={}){return a(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(t.context,r,s):this.type==="local"?this._resolve(l,r,s):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,s):(a(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,s)):this._resolve(i,r,s)}_resolve(i,r,t){let l;if(this.type==="value"&&r.mainstay.shadow&&t.shadow!==!1&&(l=r.mainstay.shadow.get(this.absolute(r))),l===void 0&&(l=p(i,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(l=this.adjust(l)),this.map){const s=this.map.get(l);s!==void 0&&(l=s)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,l),l}toString(){return this.display}absolute(i){return[...i.path.slice(0,-this.ancestor),...this.path]}clone(){return new n.Ref(this)}describe(){const i={path:this.path};this.type!=="value"&&(i.type=this.type),this.separator!=="."&&(i.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(i.ancestor=this.ancestor),this.map&&(i.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(i[r]=this[r]);return this.in!==!1&&(i.in=!0),{ref:i}}updateDisplay(){const i=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${i}`);if(!this.separator)return void(this.display=`ref:${i}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${i}`);if(this.ancestor==="root")return void(this.display=`ref:root:${i}`);if(this.ancestor===1)return void(this.display=`ref:${i||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${i||""}`}},n.Ref.prototype[d.symbols.ref]=!0,w.build=function(i){return(i=Object.assign({},n.defaults,i)).type==="value"&&i.ancestor===void 0&&(i.ancestor=1),new n.Ref(i)},n.context=function(i,r,t={}){if(i=i.trim(),t){const l=t.global===void 0?"$":t.global;if(l!==r&&i.startsWith(l))return{key:i.slice(l.length),type:"global"};const s=t.local===void 0?"#":t.local;if(s!==r&&i.startsWith(s))return{key:i.slice(s.length),type:"local"};const o=t.root===void 0?"/":t.root;if(o!==r&&i.startsWith(o))return{key:i.slice(o.length),type:"value",root:!0}}return{key:i,type:"value"}},n.ancestor=function(i,r){if(!r)return[1,0];if(i[0]!==r)return[1,0];if(i[1]!==r)return[0,1];let t=2;for(;i[t]===r;)++t;return[t-1,t]},w.toSibling=0,w.toParent=1,w.Manager=class{constructor(){this.refs=[]}register(i,r){if(i)if(r=r===void 0?w.toParent:r,Array.isArray(i))for(const t of i)this.register(t,r);else if(d.isSchema(i))for(const t of i._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else w.isRef(i)&&i.type==="value"&&i.ancestor-r>=0&&this.refs.push({ancestor:i.ancestor-r,root:i.root}),e=e||b(3328),e.isTemplate(i)&&this.register(i.refs(),r)}get length(){return this.refs.length}clone(){const i=new w.Manager;return i.refs=h(this.refs),i}reset(){this.refs=[]}roots(){return this.refs.filter(i=>!i.ancestor).map(i=>i.root)}}},3378:($,w,b)=>{const a=b(5107),h={};h.wrap=a.string().min(1).max(2).allow(!1),w.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:h.wrap,array:h.wrap,string:h.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),h.nameRx=/^[a-zA-Z0-9]\w*$/,h.rule=a.object({alias:a.array().items(a.string().pattern(h.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(h.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),w.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(h.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(h.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(h.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(h.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(h.nameRx,h.rule),terms:a.object().pattern(h.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),w.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),h.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},h.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),h.desc.buffer,h.desc.func,h.desc.ref,h.desc.regex,h.desc.special,h.desc.template,h.desc.value,a.link("/")]),h.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),h.desc.buffer,h.desc.func,h.desc.override,h.desc.ref,h.desc.regex,h.desc.template,h.desc.value),h.desc.messages=a.object().pattern(/.+/,[a.string(),h.desc.template,a.object().pattern(/.+/,[a.string(),h.desc.template])]),w.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:h.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),h.desc.ref],wrap:{label:h.wrap,array:h.wrap}},externals:a.boolean(),messages:h.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:h.desc.values,invalid:h.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),h.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:h.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:($,w,b)=>{const a=b(8571),h=b(9621),p=b(8160),d={value:Symbol("value")};$.exports=d.State=class{constructor(e,n,i){this.path=e,this.ancestors=n,this.mainstay=i.mainstay,this.schemas=i.schemas,this.debug=null}localize(e,n=null,i=null){const r=new d.State(e,n,this);return i&&r.schemas&&(r.schemas=[d.schemas(i),...r.schemas]),r}nest(e,n){const i=new d.State(this.path,this.ancestors,this);return i.schemas=i.schemas&&[d.schemas(e),...i.schemas],i.debug=n,i}shadow(e,n){this.mainstay.shadow=this.mainstay.shadow||new d.Shadow,this.mainstay.shadow.set(this.path,e,n)}snapshot(){this.mainstay.shadow&&(this._snapshot=a(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()}},d.schemas=function(e){return p.isSchema(e)?{schema:e}:e},d.Shadow=class{constructor(){this._values=null}set(e,n,i){if(!e.length||i==="strip"&&typeof e[e.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const l=e[t];let s=r.get(l);s||(s=new Map,r.set(l,s)),r=s}r[d.value]=n}get(e){const n=this.node(e);if(n)return n[d.value]}node(e){if(this._values)return h(this._values,e,{iterables:!0})}override(e,n){if(!this._values)return;const i=e.slice(0,-1),r=e[e.length-1],t=h(this._values,i,{iterables:!0});n?t.set(r,n):t&&t.delete(r)}}},3328:($,w,b)=>{const a=b(375),h=b(8571),p=b(5277),d=b(1447),e=b(8160),n=b(6354),i=b(6133),r={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}};$.exports=r.Template=class{constructor(t,l){if(a(typeof t=="string","Template source must be a string"),a(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,l){const{functions:s,...o}=l;this._settings=Object.keys(o).length?h(o):void 0,this._functions=s,this._functions&&(a(Object.keys(this._functions).every(c=>typeof c=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(c=>typeof c=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const t=r.encode(this.source),l=r.split(t);let s=!1;const o=[],c=l.shift();c&&o.push(c);for(const f of l){const g=f[0]!=="{",_=g?"}":"}}",v=f.indexOf(_);if(v===-1||f[1]==="{"){o.push(`{${r.decode(f)}`);continue}let u=f.slice(g?0:1,v);const m=u[0]===":";m&&(u=u.slice(1));const y=this._ref(r.decode(u),{raw:g,wrapped:m});o.push(y),typeof y!="string"&&(s=!0);const x=f.slice(v+_.length);x&&o.push(r.decode(x))}s?this._template=o:this.rendered=o.join("")}static date(t,l){return r.dateFormat[l.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;const l={template:this.source};return this._settings&&(l.options=this._settings),this._functions&&(l.functions=this._functions),l}static build(t){return new r.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return!!t&&!!t[e.symbols.template]}refs(){if(!this._template)return;const t=[];for(const l of this._template)typeof l!="string"&&t.push(...l.refs);return t}resolve(t,l,s,o){return this._template&&this._template.length===1?this._part(this._template[0],t,l,s,o,{}):this.render(t,l,s,o)}_part(t,...l){return t.ref?t.ref.resolve(...l):t.formula.evaluate(l)}render(t,l,s,o,c={}){if(!this.isDynamic())return this.rendered;const f=[];for(const g of this._template)if(typeof g=="string")f.push(g);else{const _=this._part(g,t,l,s,o,c),v=r.stringify(_,t,l,s,o,c);if(v!==void 0){const u=g.raw||(c.errors&&c.errors.escapeHtml)===!1?v:p(v);f.push(r.wrap(u,g.wrapped&&s.errors.wrap.label))}}return f.join("")}_ref(t,{raw:l,wrapped:s}){const o=[],c=g=>{const _=i.create(g,this._settings);return o.push(_),v=>{const u=_.resolve(...v);return u!==void 0?u:null}};try{const g=this._functions?{...r.functions,...this._functions}:r.functions;var f=new d.Parser(t,{reference:c,functions:g,constants:r.constants})}catch(g){throw g.message=`Invalid template variable "${t}" fails due to: ${g.message}`,g}if(f.single){if(f.single.type==="reference"){const g=o[0];return{ref:g,raw:l,refs:o,wrapped:s||g.type==="local"&&g.key==="label"}}return r.stringify(f.single.value)}return{formula:f,raw:l,refs:o}}toString(){return this.source}},r.Template.prototype[e.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(t){return t.replace(/\\(\{+)/g,(l,s)=>r.opens.slice(0,s.length)).replace(/\\(\}+)/g,(l,s)=>r.closes.slice(0,s.length))},r.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(t){const l=[];let s="";for(let o=0;o<t.length;++o){const c=t[o];if(c==="{"){let f="";for(;o+1<t.length&&t[o+1]==="{";)f+="{",++o;l.push(s),s=f}else s+=c}return l.push(s),l},r.wrap=function(t,l){return l?l.length===1?`${l}${t}${l}`:`${l[0]}${t}${l[1]}`:t},r.stringify=function(t,l,s,o,c,f={}){const g=typeof t,_=o&&o.errors&&o.errors.wrap||{};let v=!1;if(i.isRef(t)&&t.render&&(v=t.in,t=t.resolve(l,s,o,c,{in:t.in,...f})),t===null)return"null";if(g==="string")return r.wrap(t,f.arrayItems&&_.string);if(g==="number"||g==="function"||g==="symbol")return t.toString();if(g!=="object")return JSON.stringify(t);if(t instanceof Date)return r.Template.date(t,o);if(t instanceof Map){const m=[];for(const[y,x]of t.entries())m.push(`${y.toString()} -> ${x.toString()}`);t=m}if(!Array.isArray(t))return t.toString();const u=[];for(const m of t)u.push(r.stringify(m,l,s,o,c,{arrayItems:!0,...f}));return r.wrap(u.join(", "),!v&&_.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(t,l,s)=>t?l:s,length:t=>typeof t=="string"?t.length:t&&typeof t=="object"?Array.isArray(t)?t.length:Object.keys(t).length:null,msg(t){const[l,s,o,c,f]=this,g=f.messages;if(!g)return"";const _=n.template(l,g[0],t,s,o)||n.template(l,g[1],t,s,o);return _?_.render(l,s,o,c,f):""},number:t=>typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}},4946:($,w,b)=>{const a=b(375),h=b(1687),p=b(8068),d=b(8160),e=b(3292),n=b(6354),i=b(6133),r={};$.exports=p.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:i.toSibling}},args:(t,...l)=>l.length===1&&Array.isArray(l[0])?t.try(...l[0]):t.try(...l),validate(t,l){const{schema:s,error:o,state:c,prefs:f}=l;if(s._flags.match){const _=[],v=[];for(let m=0;m<s.$_terms.matches.length;++m){const y=s.$_terms.matches[m],x=c.nest(y.schema,`match.${m}`);x.snapshot();const j=y.schema.$_validate(t,x,f);j.errors?(v.push(j.errors),x.restore()):(_.push(j.value),x.commit())}if(_.length===0)return{errors:o("alternatives.any",{details:v.map(m=>n.details(m,{override:!1}))})};if(s._flags.match==="one")return _.length===1?{value:_[0]}:{errors:o("alternatives.one")};if(_.length!==s.$_terms.matches.length)return{errors:o("alternatives.all",{details:v.map(m=>n.details(m,{override:!1}))})};const u=m=>m.$_terms.matches.some(y=>y.schema.type==="object"||y.schema.type==="alternatives"&&u(y.schema));return u(s)?{value:_.reduce((m,y)=>h(m,y,{mergeArrays:!1}))}:{value:_[_.length-1]}}const g=[];for(let _=0;_<s.$_terms.matches.length;++_){const v=s.$_terms.matches[_];if(v.schema){const y=c.nest(v.schema,`match.${_}`);y.snapshot();const x=v.schema.$_validate(t,y,f);if(!x.errors)return y.commit(),x;y.restore(),g.push({schema:v.schema,reports:x.errors});continue}const u=v.ref?v.ref.resolve(t,c,f):t,m=v.is?[v]:v.switch;for(let y=0;y<m.length;++y){const x=m[y],{is:j,then:S,otherwise:D}=x,C=`match.${_}${v.switch?"."+y:""}`;if(j.$_match(u,c.nest(j,`${C}.is`),f)){if(S)return S.$_validate(t,c.nest(S,`${C}.then`),f)}else if(D)return D.$_validate(t,c.nest(D,`${C}.otherwise`),f)}}return r.errors(g,l)},rules:{conditional:{method(t,l){a(!this._flags._endedSwitch,"Unreachable condition"),a(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),a(l.break===void 0,"Cannot use break option with alternatives conditional");const s=this.clone(),o=e.when(s,t,l),c=o.is?[o]:o.switch;for(const f of c)if(f.then&&f.otherwise){s.$_setFlag("_endedSwitch",!0,{clone:!1});break}return s.$_terms.matches.push(o),s.$_mutateRebuild()}},match:{method(t){if(a(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(const l of this.$_terms.matches)a(l.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){a(t.length,"Missing alternative schemas"),d.verifyFlat(t,"try"),a(!this._flags._endedSwitch,"Unreachable condition");const l=this.clone();for(const s of t)l.$_terms.matches.push({schema:l.$_compile(s)});return l.$_mutateRebuild()}}},overrides:{label(t){return this.$_parent("label",t).$_modify({each:(l,s)=>s.path[0]!=="is"&&typeof l._flags.label!="string"?l.label(t):void 0,ref:!1})}},rebuild(t){t.$_modify({each:l=>{d.isSchema(l)&&l.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(t,l){if(l.matches)for(const s of l.matches){const{schema:o,ref:c,is:f,not:g,then:_,otherwise:v}=s;t=o?t.try(o):c?t.conditional(c,{is:f,then:_,not:g,otherwise:v,switch:s.switch}):t.conditional(f,{then:_,otherwise:v})}return t}},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}}"}}),r.errors=function(t,{error:l,state:s}){if(!t.length)return{errors:l("alternatives.any")};if(t.length===1)return{errors:t[0].reports};const o=new Set,c=[];for(const{reports:f,schema:g}of t){if(f.length>1)return r.unmatched(t,l);const _=f[0];if(_ instanceof n.Report==0)return r.unmatched(t,l);if(_.state.path.length!==s.path.length){c.push({type:g.type,report:_});continue}if(_.code==="any.only"){for(const m of _.local.valids)o.add(m);continue}const[v,u]=_.code.split(".");u==="base"?o.add(v):c.push({type:g.type,report:_})}return c.length?c.length===1?{errors:c[0].report}:r.unmatched(t,l):{errors:l("alternatives.types",{types:[...o]})}},r.unmatched=function(t,l){const s=[];for(const o of t)s.push(...o.reports);return{errors:l("alternatives.match",n.details(s,{override:!1}))}}},8068:($,w,b)=>{const a=b(375),h=b(7629),p=b(8160),d=b(6914);$.exports=h.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,n){return a(typeof e=="function","Method must be a function"),a(n===void 0||n&&typeof n=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:n}})},validate(e,n,{method:i}){try{return i(e,n)}catch(r){return n.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){a(p.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const n=this.clone();return n.$_terms.shared=n.$_terms.shared||[],n.$_terms.shared.push(e),n.$_mutateRegister(e),n}},warning:{method(e,n){return a(e&&typeof e=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:n},warn:!0})},validate:(e,n,{code:i,local:r})=>n.error(i,r),args:["code","local"],multi:!0}},modifiers:{keep(e,n=!0){e.keep=n},message(e,n){e.message=d.compile(n)},warn(e,n=!0){e.warn=n}},manifest:{build(e,n){for(const i in n){const r=n[i];if(["examples","externals","metas","notes","tags"].includes(i))for(const t of r)e=e[i.slice(0,-1)](t);else if(i!=="alterations")if(i!=="whens"){if(i==="shared")for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:l,is:s,not:o,then:c,otherwise:f,concat:g}=t;e=g?e.concat(g):l?e.when(l,{is:s,not:o,then:c,otherwise:f,switch:t.switch,break:t.break}):e.when(s,{then:c,otherwise:f,break:t.break})}else{const t={};for(const{target:l,adjuster:s}of r)t[l]=s;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:($,w,b)=>{const a=b(375),h=b(9474),p=b(9621),d=b(8068),e=b(8160),n=b(3292),i={};$.exports=d.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(r,{schema:t,state:l,prefs:s}){if(!Array.isArray(r))return;const o=t.$_getRule("sort");return o?i.sort(t,r,o.args.options,l,s):void 0}},validate(r,{schema:t,error:l}){if(!Array.isArray(r)){if(t._flags.single){const s=[r];return s[e.symbols.arraySingle]=!0,{value:s}}return{errors:l("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:r}});return t.$_mutateRegister(r),t},validate(r,{state:t,prefs:l,error:s},{schema:o}){const c=[r,...t.ancestors];for(let g=0;g<r.length;++g){const _=t.localize([...t.path,g],c,o);if(o.$_match(r[g],_,l))return r}const f=o._flags.label;return f?s("array.hasKnown",{patternLabel:f}):s("array.hasUnknown",null)},multi:!0},items:{method(...r){e.verifyFlat(r,"items");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});t.$_terms.items.push(s)}return t.$_mutateRebuild()},validate(r,{schema:t,error:l,state:s,prefs:o,errorsArray:c}){const f=t.$_terms._requireds.slice(),g=t.$_terms.ordered.slice(),_=[...t.$_terms._inclusions,...f],v=!r[e.symbols.arraySingle];delete r[e.symbols.arraySingle];const u=c();let m=r.length;for(let y=0;y<m;++y){const x=r[y];let j=!1,S=!1;const D=v?y:new Number(y),C=[...s.path,D];if(!t._flags.sparse&&x===void 0){if(u.push(l("array.sparse",{key:D,path:C,pos:y,value:void 0},s.localize(C))),o.abortEarly)return u;g.shift();continue}const L=[r,...s.ancestors];for(const M of t.$_terms._exclusions)if(M.$_match(x,s.localize(C,L,M),o,{presence:"ignore"})){if(u.push(l("array.excludes",{pos:y,value:x},s.localize(C))),o.abortEarly)return u;j=!0,g.shift();break}if(j)continue;if(t.$_terms.ordered.length){if(g.length){const M=g.shift(),P=M.$_validate(x,s.localize(C,L,M),o);if(P.errors){if(u.push(...P.errors),o.abortEarly)return u}else if(M._flags.result==="strip")i.fastSplice(r,y),--y,--m;else{if(!t._flags.sparse&&P.value===void 0){if(u.push(l("array.sparse",{key:D,path:C,pos:y,value:void 0},s.localize(C))),o.abortEarly)return u;continue}r[y]=P.value}continue}if(!t.$_terms.items.length){if(u.push(l("array.orderedLength",{pos:y,limit:t.$_terms.ordered.length})),o.abortEarly)return u;break}}const T=[];let N=f.length;for(let M=0;M<N;++M){const P=s.localize(C,L,f[M]);P.snapshot();const F=f[M].$_validate(x,P,o);if(T[M]=F,!F.errors){if(P.commit(),r[y]=F.value,S=!0,i.fastSplice(f,M),--M,--N,!t._flags.sparse&&F.value===void 0&&(u.push(l("array.sparse",{key:D,path:C,pos:y,value:void 0},s.localize(C))),o.abortEarly))return u;break}P.restore()}if(S)continue;const q=o.stripUnknown&&!!o.stripUnknown.arrays||!1;N=_.length;for(const M of _){let P;const F=f.indexOf(M);if(F!==-1)P=T[F];else{const W=s.localize(C,L,M);if(W.snapshot(),P=M.$_validate(x,W,o),!P.errors){W.commit(),M._flags.result==="strip"?(i.fastSplice(r,y),--y,--m):t._flags.sparse||P.value!==void 0?r[y]=P.value:(u.push(l("array.sparse",{key:D,path:C,pos:y,value:void 0},s.localize(C))),j=!0),S=!0;break}W.restore()}if(N===1){if(q){i.fastSplice(r,y),--y,--m,S=!0;break}if(u.push(...P.errors),o.abortEarly)return u;j=!0;break}}if(!j&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!S){if(q){i.fastSplice(r,y),--y,--m;continue}if(u.push(l("array.includes",{pos:y,value:x},s.localize(C))),o.abortEarly)return u}}return f.length&&i.fillMissedErrors(t,u,f,r,s,o),g.length&&(i.fillOrderedErrors(t,u,g,r,s,o),u.length||i.fillDefault(g,r,s,o)),u.length?u:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,t,{limit:l},{name:s,operator:o,args:c})=>e.compare(r.length,l,o)?r:t.error("array."+s,{limit:c.limit,value:r}),args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"}]},max:{method(r){return this.$_addRule({name:"max",method:"length",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"length",args:{limit:r},operator:">="})}},ordered:{method(...r){e.verifyFlat(r,"ordered");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});i.validateSingle(s,t),t.$_mutateRegister(s),t.$_terms.ordered.push(s)}return t.$_mutateRebuild()}},single:{method(r){const t=r===void 0||!!r;return a(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(r={}){e.assertOptions(r,["by","order"]);const t={order:r.order||"ascending"};return r.by&&(t.by=n.ref(r.by,{ancestor:0}),a(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(r,{error:t,state:l,prefs:s,schema:o},{options:c}){const{value:f,errors:g}=i.sort(o,r,c,l,s);if(g)return g;for(let _=0;_<r.length;++_)if(r[_]!==f[_])return t("array.sort",{order:c.order,by:c.by?c.by.key:"value"});return r},convert:!0},sparse:{method(r){const t=r===void 0||!!r;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(r,t={}){a(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),e.assertOptions(t,["ignoreUndefined","separator"]);const l={name:"unique",args:{options:t,comparator:r}};if(r)if(typeof r=="string"){const s=e.default(t.separator,".");l.path=s?r.split(s):[r]}else l.comparator=r;return this.$_addRule(l)},validate(r,{state:t,error:l,schema:s},{comparator:o,options:c},{comparator:f,path:g}){const _={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},v=f||h,u=c.ignoreUndefined;for(let m=0;m<r.length;++m){const y=g?p(r[m],g):r[m],x=f?_.custom:_[typeof y];if(a(x,"Failed to find unique map container for type",typeof y),x instanceof Map){const j=x.entries();let S;for(;!(S=j.next()).done;)if(v(S.value[0],y)){const D=t.localize([...t.path,m],[r,...t.ancestors]),C={pos:m,value:r[m],dupePos:S.value[1],dupeValue:r[S.value[1]]};return g&&(C.path=o),l("array.unique",C,D)}x.set(y,m)}else{if((!u||y!==void 0)&&x[y]!==void 0){const j={pos:m,value:r[m],dupePos:x[y],dupeValue:r[x[y]]};return g&&(j.path=o),l("array.unique",j,t.localize([...t.path,m],[r,...t.ancestors]))}x[y]=m}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,t)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const t of r.$_terms.items)i.validateSingle(t,r),t._flags.presence==="required"?r.$_terms._requireds.push(t):t._flags.presence==="forbidden"?r.$_terms._exclusions.push(t):r.$_terms._inclusions.push(t);for(const t of r.$_terms.ordered)i.validateSingle(t,r)},manifest:{build:(r,t)=>(t.items&&(r=r.items(...t.items)),t.ordered&&(r=r.ordered(...t.ordered)),r)},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"}}),i.fillMissedErrors=function(r,t,l,s,o,c){const f=[];let g=0;for(const _ of l){const v=_._flags.label;v?f.push(v):++g}f.length?g?t.push(r.$_createError("array.includesRequiredBoth",s,{knownMisses:f,unknownMisses:g},o,c)):t.push(r.$_createError("array.includesRequiredKnowns",s,{knownMisses:f},o,c)):t.push(r.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:g},o,c))},i.fillOrderedErrors=function(r,t,l,s,o,c){const f=[];for(const g of l)g._flags.presence==="required"&&f.push(g);f.length&&i.fillMissedErrors(r,t,f,s,o,c)},i.fillDefault=function(r,t,l,s){const o=[];let c=!0;for(let f=r.length-1;f>=0;--f){const g=r[f],_=[t,...l.ancestors],v=g.$_validate(void 0,l.localize(l.path,_,g),s).value;if(c){if(v===void 0)continue;c=!1}o.unshift(v)}o.length&&t.push(...o)},i.fastSplice=function(r,t){let l=t;for(;l<r.length;)r[l++]=r[l];--r.length},i.validateSingle=function(r,t){(r.type==="array"||r._flags._arrayItems)&&(a(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},i.sort=function(r,t,l,s,o){const c=l.order==="ascending"?1:-1,f=-1*c,g=c,_=(v,u)=>{let m=i.compare(v,u,f,g);if(m!==null||(l.by&&(v=l.by.resolve(v,s,o),u=l.by.resolve(u,s,o)),m=i.compare(v,u,f,g),m!==null))return m;const y=typeof v;if(y!==typeof u)throw r.$_createError("array.sort.mismatching",t,null,s,o);if(y!=="number"&&y!=="string")throw r.$_createError("array.sort.unsupported",t,{type:y},s,o);return y==="number"?(v-u)*c:v<u?f:g};try{return{value:t.slice().sort(_)}}catch(v){return{errors:v}}},i.compare=function(r,t,l,s){return r===t?0:r===void 0?1:t===void 0?-1:r===null?s:t===null?l:null}},4937:($,w,b)=>{const a=b(375),h=b(8068),p=b(8160),d=b(2036),e={isBool:function(n){return typeof n=="boolean"}};$.exports=h.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(n,{schema:i}){if(typeof n!="boolean"){if(typeof n=="string"){const r=i._flags.sensitive?n:n.toLowerCase();n=r==="true"||r!=="false"&&n}return typeof n!="boolean"&&(n=i.$_terms.truthy&&i.$_terms.truthy.has(n,null,null,!i._flags.sensitive)||(!i.$_terms.falsy||!i.$_terms.falsy.has(n,null,null,!i._flags.sensitive))&&n),{value:n}}},validate(n,{error:i}){if(typeof n!="boolean")return{value:n,errors:i("boolean.base")}},rules:{truthy:{method(...n){p.verifyFlat(n,"truthy");const i=this.clone();i.$_terms.truthy=i.$_terms.truthy||new d;for(let r=0;r<n.length;++r){const t=n[r];a(t!==void 0,"Cannot call truthy with undefined"),i.$_terms.truthy.add(t)}return i}},falsy:{method(...n){p.verifyFlat(n,"falsy");const i=this.clone();i.$_terms.falsy=i.$_terms.falsy||new d;for(let r=0;r<n.length;++r){const t=n[r];a(t!==void 0,"Cannot call falsy with undefined"),i.$_terms.falsy.add(t)}return i}},sensitive:{method(n=!0){return this.$_setFlag("sensitive",n)}}},cast:{number:{from:e.isBool,to:(n,i)=>n?1:0},string:{from:e.isBool,to:(n,i)=>n?"true":"false"}},manifest:{build:(n,i)=>(i.truthy&&(n=n.truthy(...i.truthy)),i.falsy&&(n=n.falsy(...i.falsy)),n)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:($,w,b)=>{const a=b(375),h=b(8068),p=b(8160),d=b(3328),e={isDate:function(n){return n instanceof Date}};$.exports=h.extend({type:"date",coerce:{from:["number","string"],method:(n,{schema:i})=>({value:e.parse(n,i._flags.format)||n})},validate(n,{schema:i,error:r,prefs:t}){if(n instanceof Date&&!isNaN(n.getTime()))return;const l=i._flags.format;return t.convert&&l&&typeof n=="string"?{value:n,errors:r("date.format",{format:l})}:{value:n,errors:r("date.base")}},rules:{compare:{method:!1,validate(n,i,{date:r},{name:t,operator:l,args:s}){const o=r==="now"?Date.now():r.getTime();return p.compare(n.getTime(),o,l)?n:i.error("date."+t,{limit:s.date,value:n})},args:[{name:"date",ref:!0,normalize:n=>n==="now"?n:e.parse(n),assert:n=>n!==null,message:"must have a valid date format"}]},format:{method(n){return a(["iso","javascript","unix"].includes(n),"Unknown date format",n),this.$_setFlag("format",n)}},greater:{method(n){return this.$_addRule({name:"greater",method:"compare",args:{date:n},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(n){return this.$_addRule({name:"less",method:"compare",args:{date:n},operator:"<"})}},max:{method(n){return this.$_addRule({name:"max",method:"compare",args:{date:n},operator:"<="})}},min:{method(n){return this.$_addRule({name:"min",method:"compare",args:{date:n},operator:">="})}},timestamp:{method(n="javascript"){return a(["javascript","unix"].includes(n),'"type" must be one of "javascript, unix"'),this.format(n)}}},cast:{number:{from:e.isDate,to:(n,i)=>n.getTime()},string:{from:e.isDate,to:(n,{prefs:i})=>d.date(n,i)}},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"}}),e.parse=function(n,i){if(n instanceof Date)return n;if(typeof n!="string"&&(isNaN(n)||!isFinite(n))||/^\s*$/.test(n))return null;if(i==="iso")return p.isIsoDate(n)?e.date(n.toString()):null;const r=n;if(typeof n=="string"&&/^[+-]?\d+(\.\d+)?$/.test(n)&&(n=parseFloat(n)),i){if(i==="javascript")return e.date(1*n);if(i==="unix")return e.date(1e3*n);if(typeof r=="string")return null}return e.date(n)},e.date=function(n){const i=new Date(n);return isNaN(i.getTime())?null:i}},390:($,w,b)=>{const a=b(375),h=b(7824);$.exports=h.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(p){return a(Number.isSafeInteger(p)&&p>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:p}})},validate:(p,d,{n:e})=>p.length===e?p:d.error("function.arity",{n:e})},class:{method(){return this.$_addRule("class")},validate:(p,d)=>/^\s*class\s/.test(p.toString())?p:d.error("function.class",{value:p})},minArity:{method(p){return a(Number.isSafeInteger(p)&&p>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:p}})},validate:(p,d,{n:e})=>p.length>=e?p:d.error("function.minArity",{n:e})},maxArity:{method(p){return a(Number.isSafeInteger(p)&&p>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:p}})},validate:(p,d,{n:e})=>p.length<=e?p:d.error("function.maxArity",{n:e})}},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:($,w,b)=>{const a=b(978),h=b(375),p=b(8571),d=b(3652),e=b(8068),n=b(8160),i=b(3292),r=b(6354),t=b(6133),l=b(3328),s={renameDefaults:{alias:!1,multiple:!1,override:!1}};$.exports=e.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(o,c)=>o.keys(c),validate(o,{schema:c,error:f,state:g,prefs:_}){if(!o||typeof o!==c.$_property("typeof")||Array.isArray(o))return{value:o,errors:f("object.base",{type:c.$_property("typeof")})};if(!(c.$_terms.renames||c.$_terms.dependencies||c.$_terms.keys||c.$_terms.patterns||c.$_terms.externals))return;o=s.clone(o,_);const v=[];if(c.$_terms.renames&&!s.rename(c,o,g,_,v))return{value:o,errors:v};if(!c.$_terms.keys&&!c.$_terms.patterns&&!c.$_terms.dependencies)return{value:o,errors:v};const u=new Set(Object.keys(o));if(c.$_terms.keys){const m=[o,...g.ancestors];for(const y of c.$_terms.keys){const x=y.key,j=o[x];u.delete(x);const S=g.localize([...g.path,x],m,y),D=y.schema.$_validate(j,S,_);if(D.errors){if(_.abortEarly)return{value:o,errors:D.errors};D.value!==void 0&&(o[x]=D.value),v.push(...D.errors)}else y.schema._flags.result==="strip"||D.value===void 0&&j!==void 0?delete o[x]:D.value!==void 0&&(o[x]=D.value)}}if(u.size||c._flags._hasPatternMatch){const m=s.unknown(c,o,u,v,g,_);if(m)return m}if(c.$_terms.dependencies)for(const m of c.$_terms.dependencies){if(m.key!==null&&s.isPresent(m.options)(m.key.resolve(o,g,_,null,{shadow:!1}))===!1)continue;const y=s.dependencies[m.rel](c,m,o,g,_);if(y){const x=c.$_createError(y.code,o,y.context,g,_);if(_.abortEarly)return{value:o,errors:x};v.push(x)}}return{value:o,errors:v}},rules:{and:{method(...o){return n.verifyFlat(o,"and"),s.dependency(this,"and",null,o)}},append:{method(o){return o==null||Object.keys(o).length===0?this:this.keys(o)}},assert:{method(o,c,f){l.isTemplate(o)||(o=i.ref(o)),h(f===void 0||typeof f=="string","Message must be a string"),c=this.$_compile(c,{appendPath:!0});const g=this.$_addRule({name:"assert",args:{subject:o,schema:c,message:f}});return g.$_mutateRegister(o),g.$_mutateRegister(c),g},validate(o,{error:c,prefs:f,state:g},{subject:_,schema:v,message:u}){const m=_.resolve(o,g,f),y=t.isRef(_)?_.absolute(g):[];return v.$_match(m,g.localize(y,[o,...g.ancestors],v),f)?o:c("object.assert",{subject:_,message:u})},args:["subject","schema","message"],multi:!0},instance:{method(o,c){return h(typeof o=="function","constructor must be a function"),c=c||o.name,this.$_addRule({name:"instance",args:{constructor:o,name:c}})},validate:(o,c,{constructor:f,name:g})=>o instanceof f?o:c.error("object.instance",{type:g,value:o}),args:["constructor","name"]},keys:{method(o){h(o===void 0||typeof o=="object","Object schema must be a valid object"),h(!n.isSchema(o),"Object schema cannot be a joi schema");const c=this.clone();if(o)if(Object.keys(o).length){c.$_terms.keys=c.$_terms.keys?c.$_terms.keys.filter(f=>!o.hasOwnProperty(f.key)):new s.Keys;for(const f in o)n.tryWithPath(()=>c.$_terms.keys.push({key:f,schema:this.$_compile(o[f])}),f)}else c.$_terms.keys=new s.Keys;else c.$_terms.keys=null;return c.$_mutateRebuild()}},length:{method(o){return this.$_addRule({name:"length",args:{limit:o},operator:"="})},validate:(o,c,{limit:f},{name:g,operator:_,args:v})=>n.compare(Object.keys(o).length,f,_)?o:c.error("object."+g,{limit:v.limit,value:o}),args:[{name:"limit",ref:!0,assert:n.limit,message:"must be a positive integer"}]},max:{method(o){return this.$_addRule({name:"max",method:"length",args:{limit:o},operator:"<="})}},min:{method(o){return this.$_addRule({name:"min",method:"length",args:{limit:o},operator:">="})}},nand:{method(...o){return n.verifyFlat(o,"nand"),s.dependency(this,"nand",null,o)}},or:{method(...o){return n.verifyFlat(o,"or"),s.dependency(this,"or",null,o)}},oxor:{method(...o){return s.dependency(this,"oxor",null,o)}},pattern:{method(o,c,f={}){const g=o instanceof RegExp;g||(o=this.$_compile(o,{appendPath:!0})),h(c!==void 0,"Invalid rule"),n.assertOptions(f,["fallthrough","matches"]),g&&h(!o.flags.includes("g")&&!o.flags.includes("y"),"pattern should not use global or sticky mode"),c=this.$_compile(c,{appendPath:!0});const _=this.clone();_.$_terms.patterns=_.$_terms.patterns||[];const v={[g?"regex":"schema"]:o,rule:c};return f.matches&&(v.matches=this.$_compile(f.matches),v.matches.type!=="array"&&(v.matches=v.matches.$_root.array().items(v.matches)),_.$_mutateRegister(v.matches),_.$_setFlag("_hasPatternMatch",!0,{clone:!1})),f.fallthrough&&(v.fallthrough=!0),_.$_terms.patterns.push(v),_.$_mutateRegister(c),_}},ref:{method(){return this.$_addRule("ref")},validate:(o,c)=>t.isRef(o)?o:c.error("object.refType",{value:o})},regex:{method(){return this.$_addRule("regex")},validate:(o,c)=>o instanceof RegExp?o:c.error("object.regex",{value:o})},rename:{method(o,c,f={}){h(typeof o=="string"||o instanceof RegExp,"Rename missing the from argument"),h(typeof c=="string"||c instanceof l,"Invalid rename to argument"),h(c!==o,"Cannot rename key to same name:",o),n.assertOptions(f,["alias","ignoreUndefined","override","multiple"]);const g=this.clone();g.$_terms.renames=g.$_terms.renames||[];for(const _ of g.$_terms.renames)h(_.from!==o,"Cannot rename the same key multiple times");return c instanceof l&&g.$_mutateRegister(c),g.$_terms.renames.push({from:o,to:c,options:a(s.renameDefaults,f)}),g}},schema:{method(o="any"){return this.$_addRule({name:"schema",args:{type:o}})},validate:(o,c,{type:f})=>!n.isSchema(o)||f!=="any"&&o.type!==f?c.error("object.schema",{type:f}):o},unknown:{method(o){return this.$_setFlag("unknown",o!==!1)}},with:{method(o,c,f={}){return s.dependency(this,"with",o,c,f)}},without:{method(o,c,f={}){return s.dependency(this,"without",o,c,f)}},xor:{method(...o){return n.verifyFlat(o,"xor"),s.dependency(this,"xor",null,o)}}},overrides:{default(o,c){return o===void 0&&(o=n.symbols.deepDefault),this.$_parent("default",o,c)}},rebuild(o){if(o.$_terms.keys){const c=new d.Sorter;for(const f of o.$_terms.keys)n.tryWithPath(()=>c.add(f,{after:f.schema.$_rootReferences(),group:f.key}),f.key);o.$_terms.keys=new s.Keys(...c.nodes)}},manifest:{build(o,c){if(c.keys&&(o=o.keys(c.keys)),c.dependencies)for(const{rel:f,key:g=null,peers:_,options:v}of c.dependencies)o=s.dependency(o,f,g,_,v);if(c.patterns)for(const{regex:f,schema:g,rule:_,fallthrough:v,matches:u}of c.patterns)o=o.pattern(f||g,_,{fallthrough:v,matches:u});if(c.renames)for(const{from:f,to:g,options:_}of c.renames)o=o.rename(f,g,_);return o}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),s.clone=function(o,c){if(typeof o=="object"){if(c.nonEnumerables)return p(o,{shallow:!0});const g=Object.create(Object.getPrototypeOf(o));return Object.assign(g,o),g}const f=function(...g){return o.apply(this,g)};return f.prototype=p(o.prototype),Object.defineProperty(f,"name",{value:o.name,writable:!1}),Object.defineProperty(f,"length",{value:o.length,writable:!1}),Object.assign(f,o),f},s.dependency=function(o,c,f,g,_){h(f===null||typeof f=="string",c,"key must be a strings"),_||(_=g.length>1&&typeof g[g.length-1]=="object"?g.pop():{}),n.assertOptions(_,["separator","isPresent"]),g=[].concat(g);const v=n.default(_.separator,"."),u=[];for(const y of g)h(typeof y=="string",c,"peers must be strings"),u.push(i.ref(y,{separator:v,ancestor:0,prefix:!1}));f!==null&&(f=i.ref(f,{separator:v,ancestor:0,prefix:!1}));const m=o.clone();return m.$_terms.dependencies=m.$_terms.dependencies||[],m.$_terms.dependencies.push(new s.Dependency(c,f,u,g,_)),m},s.dependencies={and(o,c,f,g,_){const v=[],u=[],m=c.peers.length,y=s.isPresent(c.options);for(const x of c.peers)y(x.resolve(f,g,_,null,{shadow:!1}))===!1?v.push(x.key):u.push(x.key);if(v.length!==m&&u.length!==m)return{code:"object.and",context:{present:u,presentWithLabels:s.keysToLabels(o,u),missing:v,missingWithLabels:s.keysToLabels(o,v)}}},nand(o,c,f,g,_){const v=[],u=s.isPresent(c.options);for(const x of c.peers)u(x.resolve(f,g,_,null,{shadow:!1}))&&v.push(x.key);if(v.length!==c.peers.length)return;const m=c.paths[0],y=c.paths.slice(1);return{code:"object.nand",context:{main:m,mainWithLabel:s.keysToLabels(o,m),peers:y,peersWithLabels:s.keysToLabels(o,y)}}},or(o,c,f,g,_){const v=s.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,g,_,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:c.paths,peersWithLabels:s.keysToLabels(o,c.paths)}}},oxor(o,c,f,g,_){const v=[],u=s.isPresent(c.options);for(const y of c.peers)u(y.resolve(f,g,_,null,{shadow:!1}))&&v.push(y.key);if(!v.length||v.length===1)return;const m={peers:c.paths,peersWithLabels:s.keysToLabels(o,c.paths)};return m.present=v,m.presentWithLabels=s.keysToLabels(o,v),{code:"object.oxor",context:m}},with(o,c,f,g,_){const v=s.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,g,_,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:c.key.key,mainWithLabel:s.keysToLabels(o,c.key.key),peer:u.key,peerWithLabel:s.keysToLabels(o,u.key)}}},without(o,c,f,g,_){const v=s.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,g,_,null,{shadow:!1})))return{code:"object.without",context:{main:c.key.key,mainWithLabel:s.keysToLabels(o,c.key.key),peer:u.key,peerWithLabel:s.keysToLabels(o,u.key)}}},xor(o,c,f,g,_){const v=[],u=s.isPresent(c.options);for(const y of c.peers)u(y.resolve(f,g,_,null,{shadow:!1}))&&v.push(y.key);if(v.length===1)return;const m={peers:c.paths,peersWithLabels:s.keysToLabels(o,c.paths)};return v.length===0?{code:"object.missing",context:m}:(m.present=v,m.presentWithLabels=s.keysToLabels(o,v),{code:"object.xor",context:m})}},s.keysToLabels=function(o,c){return Array.isArray(c)?c.map(f=>o.$_mapLabels(f)):o.$_mapLabels(c)},s.isPresent=function(o){return typeof o.isPresent=="function"?o.isPresent:c=>c!==void 0},s.rename=function(o,c,f,g,_){const v={};for(const u of o.$_terms.renames){const m=[],y=typeof u.from!="string";if(y)for(const x in c){if(c[x]===void 0&&u.options.ignoreUndefined||x===u.to)continue;const j=u.from.exec(x);j&&m.push({from:x,to:u.to,match:j})}else!Object.prototype.hasOwnProperty.call(c,u.from)||c[u.from]===void 0&&u.options.ignoreUndefined||m.push(u);for(const x of m){const j=x.from;let S=x.to;if(S instanceof l&&(S=S.render(c,f,g,x.match)),j!==S){if(!u.options.multiple&&v[S]&&(_.push(o.$_createError("object.rename.multiple",c,{from:j,to:S,pattern:y},f,g)),g.abortEarly)||Object.prototype.hasOwnProperty.call(c,S)&&!u.options.override&&!v[S]&&(_.push(o.$_createError("object.rename.override",c,{from:j,to:S,pattern:y},f,g)),g.abortEarly))return!1;c[j]===void 0?delete c[S]:c[S]=c[j],v[S]=!0,u.options.alias||delete c[j]}}}return!0},s.unknown=function(o,c,f,g,_,v){if(o.$_terms.patterns){let u=!1;const m=o.$_terms.patterns.map(x=>{if(x.matches)return u=!0,[]}),y=[c,..._.ancestors];for(const x of f){const j=c[x],S=[..._.path,x];for(let D=0;D<o.$_terms.patterns.length;++D){const C=o.$_terms.patterns[D];if(C.regex){const N=C.regex.test(x);if(_.mainstay.tracer.debug(_,"rule",`pattern.${D}`,N?"pass":"error"),!N)continue}else if(!C.schema.$_match(x,_.nest(C.schema,`pattern.${D}`),v))continue;f.delete(x);const L=_.localize(S,y,{schema:C.rule,key:x}),T=C.rule.$_validate(j,L,v);if(T.errors){if(v.abortEarly)return{value:c,errors:T.errors};g.push(...T.errors)}if(C.matches&&m[D].push(x),c[x]=T.value,!C.fallthrough)break}}if(u)for(let x=0;x<m.length;++x){const j=m[x];if(!j)continue;const S=o.$_terms.patterns[x].matches,D=_.localize(_.path,y,S),C=S.$_validate(j,D,v);if(C.errors){const L=r.details(C.errors,{override:!1});L.matches=j;const T=o.$_createError("object.pattern.match",c,L,_,v);if(v.abortEarly)return{value:c,errors:T};g.push(T)}}}if(f.size&&(o.$_terms.keys||o.$_terms.patterns)){if(v.stripUnknown&&!o._flags.unknown||v.skipFunctions){const u=!(!v.stripUnknown||v.stripUnknown!==!0&&!v.stripUnknown.objects);for(const m of f)u?(delete c[m],f.delete(m)):typeof c[m]=="function"&&f.delete(m)}if(!n.default(o._flags.unknown,v.allowUnknown))for(const u of f){const m=_.localize([..._.path,u],[]),y=o.$_createError("object.unknown",c[u],{child:u},m,v,{flags:!1});if(v.abortEarly)return{value:c,errors:y};g.push(y)}}},s.Dependency=class{constructor(o,c,f,g,_){this.rel=o,this.key=c,this.peers=f,this.paths=g,this.options=_}describe(){const o={rel:this.rel,peers:this.paths};return this.key!==null&&(o.key=this.key.key),this.peers[0].separator!=="."&&(o.options={...o.options,separator:this.peers[0].separator}),this.options.isPresent&&(o.options={...o.options,isPresent:this.options.isPresent}),o}},s.Keys=class extends Array{concat(o){const c=this.slice(),f=new Map;for(let g=0;g<c.length;++g)f.set(c[g].key,g);for(const g of o){const _=g.key,v=f.get(_);v!==void 0?c[v]={key:_,schema:c[v].schema.concat(g.schema)}:c.push(g)}return c}}},8785:($,w,b)=>{const a=b(375),h=b(8068),p=b(8160),d=b(3292),e=b(6354),n={};$.exports=h.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(i,r)=>i.ref(r),validate(i,{schema:r,state:t,prefs:l}){a(r.$_terms.link,"Uninitialized link schema");const s=n.generate(r,i,t,l),o=r.$_terms.link[0].ref;return s.$_validate(i,t.nest(s,`link:${o.display}:${s.type}`),l)},generate:(i,r,t,l)=>n.generate(i,r,t,l),rules:{ref:{method(i){a(!this.$_terms.link,"Cannot reinitialize schema"),i=d.ref(i),a(i.type==="value"||i.type==="local","Invalid reference type:",i.type),a(i.type==="local"||i.ancestor==="root"||i.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:i}],r}},relative:{method(i=!0){return this.$_setFlag("relative",i)}}},overrides:{concat(i){a(this.$_terms.link,"Uninitialized link schema"),a(p.isSchema(i),"Invalid schema object"),a(i.type!=="link","Cannot merge type link with another link");const r=this.clone();return r.$_terms.whens||(r.$_terms.whens=[]),r.$_terms.whens.push({concat:i}),r.$_mutateRebuild()}},manifest:{build:(i,r)=>(a(r.link,"Invalid link description missing link"),i.ref(r.link))}}),n.generate=function(i,r,t,l){let s=t.mainstay.links.get(i);if(s)return s._generate(r,t,l).schema;const o=i.$_terms.link[0].ref,{perspective:c,path:f}=n.perspective(o,t);n.assert(c,"which is outside of schema boundaries",o,i,t,l);try{s=f.length?c.$_reach(f):c}catch{n.assert(!1,"to non-existing schema",o,i,t,l)}return n.assert(s.type!=="link","which is another link",o,i,t,l),i._flags.relative||t.mainstay.links.set(i,s),s._generate(r,t,l).schema},n.perspective=function(i,r){if(i.type==="local"){for(const{schema:t,key:l}of r.schemas){if((t._flags.id||l)===i.path[0])return{perspective:t,path:i.path.slice(1)};if(t.$_terms.shared){for(const s of t.$_terms.shared)if(s._flags.id===i.path[0])return{perspective:s,path:i.path.slice(1)}}}return{perspective:null,path:null}}return i.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:i.path}:{perspective:r.schemas[i.ancestor]&&r.schemas[i.ancestor].schema,path:i.path}},n.assert=function(i,r,t,l,s,o){i||a(!1,`"${e.label(l._flags,s,o)}" contains link reference "${t.display}" ${r}`)}},3832:($,w,b)=>{const a=b(375),h=b(8068),p=b(8160),d={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const n=e.toString(),i=n.indexOf("."),r=n.indexOf("e");return(i<0?0:(r<0?n.length:r)-i-1)+(r<0?0:Math.max(0,-parseInt(n.slice(r+1))))}};$.exports=h.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:n,error:i}){if(!e.match(d.numberRx))return;e=e.trim();const r={value:parseFloat(e)};if(r.value===0&&(r.value=0),!n._flags.unsafe)if(e.match(/e/i)){if(d.extractSignificantDigits(e)!==d.extractSignificantDigits(String(r.value)))return r.errors=i("number.unsafe"),r}else{const t=r.value.toString();if(t.match(/e/i))return r;if(t!==d.normalizeDecimal(e))return r.errors=i("number.unsafe"),r}return r}},validate(e,{schema:n,error:i,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:i("number.infinity")};if(!p.isNumber(e))return{value:e,errors:i("number.base")};const t={value:e};if(r.convert){const l=n.$_getRule("precision");if(l){const s=Math.pow(10,l.args.limit);t.value=Math.round(t.value*s)/s}}return t.value===0&&(t.value=0),!n._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.errors=i("number.unsafe")),t},rules:{compare:{method:!1,validate:(e,n,{limit:i},{name:r,operator:t,args:l})=>p.compare(e,i,t)?e:n.error("number."+r,{limit:l.limit,value:e}),args:[{name:"limit",ref:!0,assert:p.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,n)=>Math.trunc(e)-e==0?e:n.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 n=typeof e=="number"?d.decimalPlaces(e):null,i=Math.pow(10,n);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:n,pfactor:i}})},validate:(e,n,{base:i,baseDecimalPlace:r,pfactor:t},l)=>d.decimalPlaces(e)>r?n.error("number.multiple",{multiple:l.args.base,value:e}):Math.round(t*e)%Math.round(t*i)==0?e:n.error("number.multiple",{multiple:l.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>typeof e=="number"&&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,n)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:n.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return a(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,n,{limit:i}){const r=e.toString().match(d.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=i?e:n.error("number.precision",{limit:i,value:e})},convert:!0},sign:{method(e){return a(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,n,{sign:i})=>i==="negative"&&e<0||i==="positive"&&e>0?e:n.error(`number.${i}`)},unsafe:{method(e=!0){return a(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>typeof e=="number",to:(e,n)=>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"}}),d.extractSignificantDigits=function(e){return e.replace(d.exponentialPartRegex,"").replace(d.dotRegex,"").replace(d.trailingZerosRegex,"").replace(d.leadingSignAndZerosRegex,"")},d.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+$/,"")),e==="-0"?"0":e}},8966:($,w,b)=>{const a=b(7824);$.exports=a.extend({type:"object",cast:{map:{from:h=>h&&typeof h=="object",to:(h,p)=>new Map(Object.entries(h))}}})},7417:($,w,b)=>{const a=b(375),h=b(5380),p=b(1745),d=b(9959),e=b(6064),n=b(9926),i=b(5752),r=b(8068),t=b(8160),l={tlds:n instanceof Set&&{tlds:{allow:n,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:d.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"]};$.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(s,{schema:o,state:c,prefs:f}){const g=o.$_getRule("normalize");g&&(s=s.normalize(g.args.form));const _=o.$_getRule("case");_&&(s=_.args.direction==="upper"?s.toLocaleUpperCase():s.toLocaleLowerCase());const v=o.$_getRule("trim");if(v&&v.args.enabled&&(s=s.trim()),o.$_terms.replacements)for(const m of o.$_terms.replacements)s=s.replace(m.pattern,m.replacement);const u=o.$_getRule("hex");if(u&&u.args.options.byteAligned&&s.length%2!=0&&(s=`0${s}`),o.$_getRule("isoDate")){const m=l.isoDate(s);m&&(s=m)}if(o._flags.truncate){const m=o.$_getRule("max");if(m){let y=m.args.limit;if(t.isResolvable(y)&&(y=y.resolve(s,c,f),!t.limit(y)))return{value:s,errors:o.$_createError("any.ref",y,{ref:m.args.limit,arg:"limit",reason:"must be a positive integer"},c,f)};s=s.slice(0,y)}}return{value:s}}},validate(s,{schema:o,error:c}){if(typeof s!="string")return{value:s,errors:c("string.base")};if(s===""){const f=o.$_getRule("min");return f&&f.args.limit===0?void 0:{value:s,errors:c("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(s,o)=>/^[a-zA-Z0-9]+$/.test(s)?s:o.error("string.alphanum")},base64:{method(s={}){return t.assertOptions(s,["paddingRequired","urlSafe"]),s={urlSafe:!1,paddingRequired:!0,...s},a(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof s.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:s}})},validate:(s,o,{options:c})=>l.base64Regex[c.paddingRequired][c.urlSafe].test(s)?s:o.error("string.base64")},case:{method(s){return a(["lower","upper"].includes(s),"Invalid case:",s),this.$_addRule({name:"case",args:{direction:s}})},validate:(s,o,{direction:c})=>c==="lower"&&s===s.toLocaleLowerCase()||c==="upper"&&s===s.toLocaleUpperCase()?s:o.error(`string.${c}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(s,o){let c=s.length,f=0,g=1;for(;c--;){const _=s.charAt(c)*g;f+=_-9*(_>9),g^=3}return f>0&&f%10==0?s:o.error("string.creditCard")}},dataUri:{method(s={}){return t.assertOptions(s,["paddingRequired"]),s={paddingRequired:!0,...s},a(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:s}})},validate(s,o,{options:c}){const f=s.match(l.dataUriRegex);return f&&(!f[2]||f[2]!=="base64"||l.base64Regex[c.paddingRequired].false.test(f[3]))?s:o.error("string.dataUri")}},domain:{method(s){s&&t.assertOptions(s,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const o=l.addressOptions(s);return this.$_addRule({name:"domain",args:{options:s},address:o})},validate:(s,o,c,{address:f})=>h.isValid(s,f)?s:o.error("string.domain")},email:{method(s={}){t.assertOptions(s,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(s.multiple===void 0||typeof s.multiple=="boolean","multiple option must be an boolean");const o=l.addressOptions(s),c=new RegExp(`\\s*[${s.separator?e(s.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:s},regex:c,address:o})},validate(s,o,{options:c},{regex:f,address:g}){const _=c.multiple?s.split(f):[s],v=[];for(const u of _)p.isValid(u,g)||v.push(u);return v.length?o.error("string.email",{value:s,invalids:v}):s}},guid:{alias:"uuid",method(s={}){t.assertOptions(s,["version","separator"]);let o="";if(s.version){const g=[].concat(s.version);a(g.length>=1,"version must have at least 1 valid version specified");const _=new Set;for(let v=0;v<g.length;++v){const u=g[v];a(typeof u=="string","version at position "+v+" must be a string");const m=l.guidVersions[u.toLowerCase()];a(m,"version at position "+v+" must be one of "+Object.keys(l.guidVersions).join(", ")),a(!_.has(m),"version at position "+v+" must not be a duplicate"),o+=m,_.add(m)}}a(l.guidSeparators.has(s.separator),'separator must be one of true, false, "-", or ":"');const c=s.separator===void 0?"[:-]?":s.separator===!0?"[:-]":s.separator===!1?"[]?":`\\${s.separator}`,f=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${c})[0-9A-F]{4}\\2?[${o||"0-9A-F"}][0-9A-F]{3}\\2?[${o?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:s},regex:f})},validate(s,o,c,{regex:f}){const g=f.exec(s);return g?l.guidBrackets[g[1]]!==g[g.length-1]?o.error("string.guid"):s:o.error("string.guid")}},hex:{method(s={}){return t.assertOptions(s,["byteAligned","prefix"]),s={byteAligned:!1,prefix:!1,...s},a(typeof s.byteAligned=="boolean","byteAligned must be boolean"),a(typeof s.prefix=="boolean"||s.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:s}})},validate:(s,o,{options:c})=>(c.prefix==="optional"?l.hexRegex.withOptionalPrefix:c.prefix===!0?l.hexRegex.withPrefix:l.hexRegex.withoutPrefix).test(s)?c.byteAligned&&s.length%2!=0?o.error("string.hexAlign"):s:o.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(s,o)=>h.isValid(s,{minDomainSegments:1})||l.ipRegex.test(s)?s:o.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(s={}){t.assertOptions(s,["cidr","version"]);const{cidr:o,versions:c,regex:f}=d.regex(s),g=s.version?c:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:o,version:g}},regex:f})},validate:(s,o,{options:c},{regex:f})=>f.test(s)?s:c.version?o.error("string.ipVersion",{value:s,cidr:c.cidr,version:c.version}):o.error("string.ip",{value:s,cidr:c.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(s,{error:o})=>l.isoDate(s)?s:o("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(s,o)=>l.isoDurationRegex.test(s)?s:o.error("string.isoDuration")},length:{method(s,o){return l.length(this,"length",s,"=",o)},validate(s,o,{limit:c,encoding:f},{name:g,operator:_,args:v}){const u=!f&&s.length;return t.compare(u,c,_)?s:o.error("string."+g,{limit:v.limit,value:s,encoding:f})},args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(s,o){return l.length(this,"max",s,"<=",o)},args:["limit","encoding"]},min:{method(s,o){return l.length(this,"min",s,">=",o)},args:["limit","encoding"]},normalize:{method(s="NFC"){return a(l.normalizationForms.includes(s),"normalization form must be one of "+l.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:s}})},validate:(s,{error:o},{form:c})=>s===s.normalize(c)?s:o("string.normalize",{value:s,form:c}),convert:!0},pattern:{alias:"regex",method(s,o={}){a(s instanceof RegExp,"regex must be a RegExp"),a(!s.flags.includes("g")&&!s.flags.includes("y"),"regex should not use global or sticky mode"),typeof o=="string"&&(o={name:o}),t.assertOptions(o,["invert","name"]);const c=["string.pattern",o.invert?".invert":"",o.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:s,options:o},errorCode:c})},validate:(s,o,{regex:c,options:f},{errorCode:g})=>c.test(s)^f.invert?s:o.error(g,{name:f.name,regex:c,value:s}),args:["regex","options"],multi:!0},replace:{method(s,o){typeof s=="string"&&(s=new RegExp(e(s),"g")),a(s instanceof RegExp,"pattern must be a RegExp"),a(typeof o=="string","replacement must be a String");const c=this.clone();return c.$_terms.replacements||(c.$_terms.replacements=[]),c.$_terms.replacements.push({pattern:s,replacement:o}),c}},token:{method(){return this.$_addRule("token")},validate:(s,o)=>/^\w+$/.test(s)?s:o.error("string.token")},trim:{method(s=!0){return a(typeof s=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:s}})},validate:(s,o,{enabled:c})=>c&&s!==s.trim()?o.error("string.trim"):s,convert:!0},truncate:{method(s=!0){return a(typeof s=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",s)}},uppercase:{method(){return this.case("upper")}},uri:{method(s={}){t.assertOptions(s,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),s.domain&&t.assertOptions(s.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:o,scheme:c}=i.regex(s),f=s.domain?l.addressOptions(s.domain):null;return this.$_addRule({name:"uri",args:{options:s},regex:o,domain:f,scheme:c})},validate(s,o,{options:c},{regex:f,domain:g,scheme:_}){if(["http:/","https:/"].includes(s))return o.error("string.uri");const v=f.exec(s);if(v){const u=v[1]||v[2];return!g||c.allowRelative&&!u||h.isValid(u,g)?s:o.error("string.domain",{value:u})}return c.relativeOnly?o.error("string.uriRelativeOnly"):c.scheme?o.error("string.uriCustomScheme",{scheme:_,value:s}):o.error("string.uri")}}},manifest:{build(s,o){if(o.replacements)for(const{pattern:c,replacement:f}of o.replacements)s=s.replace(c,f);return s}},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"}}),l.addressOptions=function(s){if(!s)return l.tlds||s;if(a(s.minDomainSegments===void 0||Number.isSafeInteger(s.minDomainSegments)&&s.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(s.maxDomainSegments===void 0||Number.isSafeInteger(s.maxDomainSegments)&&s.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),s.tlds===!1)return s;if(s.tlds===!0||s.tlds===void 0)return a(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds);a(typeof s.tlds=="object","tlds must be true, false, or an object");const o=s.tlds.deny;if(o)return Array.isArray(o)&&(s=Object.assign({},s,{tlds:{deny:new Set(o)}})),a(s.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!s.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),l.validateTlds(s.tlds.deny,"tlds.deny"),s;const c=s.tlds.allow;return c?c===!0?(a(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds)):(Array.isArray(c)&&(s=Object.assign({},s,{tlds:{allow:new Set(c)}})),a(s.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),l.validateTlds(s.tlds.allow,"tlds.allow"),s):s},l.validateTlds=function(s,o){for(const c of s)a(h.isValid(c,{minDomainSegments:1,maxDomainSegments:1}),`${o} must contain valid top level domain names`)},l.isoDate=function(s){if(!t.isIsoDate(s))return null;/.*T.*[+-]\d\d$/.test(s)&&(s+="00");const o=new Date(s);return isNaN(o.getTime())?null:o.toISOString()},l.length=function(s,o,c,f,g){return a(!g||!1,"Invalid encoding:",g),s.$_addRule({name:o,method:"length",args:{limit:c,encoding:g},operator:f})}},8826:($,w,b)=>{const a=b(375),h=b(8068),p={};p.Map=class extends Map{slice(){return new p.Map(this)}},$.exports=h.extend({type:"symbol",terms:{map:{init:new p.Map}},coerce:{method(d,{schema:e,error:n}){const i=e.$_terms.map.get(d);return i&&(d=i),e._flags.only&&typeof d!="symbol"?{value:d,errors:n("symbol.map",{map:e.$_terms.map})}:{value:d}}},validate(d,{error:e}){if(typeof d!="symbol")return{value:d,errors:e("symbol.base")}},rules:{map:{method(d){d&&!d[Symbol.iterator]&&typeof d=="object"&&(d=Object.entries(d)),a(d&&d[Symbol.iterator],"Iterable must be an iterable or object");const e=this.clone(),n=[];for(const i of d){a(i&&i[Symbol.iterator],"Entry must be an iterable");const[r,t]=i;a(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),a(typeof t=="symbol","Value must be a Symbol"),e.$_terms.map.set(r,t),n.push(t)}return e.valid(...n)}}},manifest:{build:(d,e)=>(e.map&&(d=d.map(e.map)),d)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:($,w,b)=>{const a=b(375),h=b(8571),p=b(738),d=b(9621),e=b(8160),n=b(6354),i=b(493),r={result:Symbol("result")};w.entry=function(t,l,s){let o=e.defaults;s&&(a(s.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(s.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),o=e.preferences(e.defaults,s));const c=r.entry(t,l,o);a(!c.mainstay.externals.length,"Schema with external rules must use validateAsync()");const f={value:c.value};return c.error&&(f.error=c.error),c.mainstay.warnings.length&&(f.warning=n.details(c.mainstay.warnings)),c.mainstay.debug&&(f.debug=c.mainstay.debug),c.mainstay.artifacts&&(f.artifacts=c.mainstay.artifacts),f},w.entryAsync=async function(t,l,s){let o=e.defaults;s&&(o=e.preferences(e.defaults,s));const c=r.entry(t,l,o),f=c.mainstay;if(c.error)throw f.debug&&(c.error.debug=f.debug),c.error;if(f.externals.length){let _=c.value;const v=[];for(const u of f.externals){const m=u.state.path,y=u.schema.type==="link"?f.links.get(u.schema):null;let x,j,S=_;const D=m.length?[_]:[],C=m.length?d(t,m):t;if(m.length){x=m[m.length-1];let L=_;for(const T of m.slice(0,-1))L=L[T],D.unshift(L);j=D[0],S=j[x]}try{const L=(N,q)=>(y||u.schema).$_createError(N,S,q,u.state,o),T=await u.method(S,{schema:u.schema,linked:y,state:u.state,prefs:s,original:C,error:L,errorsArray:r.errorsArray,warn:(N,q)=>f.warnings.push((y||u.schema).$_createError(N,S,q,u.state,o)),message:(N,q)=>(y||u.schema).$_createError("external",S,q,u.state,o,{messages:N})});if(T===void 0||T===S)continue;if(T instanceof n.Report){if(f.tracer.log(u.schema,u.state,"rule","external","error"),v.push(T),o.abortEarly)break;continue}if(Array.isArray(T)&&T[e.symbols.errors]){if(f.tracer.log(u.schema,u.state,"rule","external","error"),v.push(...T),o.abortEarly)break;continue}j?(f.tracer.value(u.state,"rule",S,T,"external"),j[x]=T):(f.tracer.value(u.state,"rule",_,T,"external"),_=T)}catch(L){throw o.errors.label&&(L.message+=` (${u.label})`),L}}if(c.value=_,v.length)throw c.error=n.process(v,t,o),f.debug&&(c.error.debug=f.debug),c.error}if(!o.warnings&&!o.debug&&!o.artifacts)return c.value;const g={value:c.value};return f.warnings.length&&(g.warning=n.details(f.warnings)),f.debug&&(g.debug=f.debug),f.artifacts&&(g.artifacts=f.artifacts),g},r.Mainstay=class{constructor(t,l,s){this.externals=[],this.warnings=[],this.tracer=t,this.debug=l,this.links=s,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}},r.entry=function(t,l,s){const{tracer:o,cleanup:c}=r.tracer(l,s),f=s.debug?[]:null,g=l._ids._schemaChain?new Map:null,_=new r.Mainstay(o,f,g),v=l._ids._schemaChain?[{schema:l}]:null,u=new i([],[],{mainstay:_,schemas:v}),m=w.validate(t,l,u,s);c&&l.$_root.untrace();const y=n.process(m.errors,t,s);return{value:m.value,error:y,mainstay:_}},r.tracer=function(t,l){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:l.debug?(a(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:r.ignore}},w.validate=function(t,l,s,o,c={}){if(l.$_terms.whens&&(l=l._generate(t,s,o).schema),l._preferences&&(o=r.prefs(l,o)),l._cache&&o.cache){const y=l._cache.get(t);if(s.mainstay.tracer.debug(s,"validate","cached",!!y),y)return y}const f=(y,x,j)=>l.$_createError(y,t,x,j||s,o),g={original:t,prefs:o,schema:l,state:s,error:f,errorsArray:r.errorsArray,warn:(y,x,j)=>s.mainstay.warnings.push(f(y,x,j)),message:(y,x)=>l.$_createError("custom",t,x,s,o,{messages:y})};s.mainstay.tracer.entry(l,s);const _=l._definition;if(_.prepare&&t!==void 0&&o.convert){const y=_.prepare(t,g);if(y){if(s.mainstay.tracer.value(s,"prepare",t,y.value),y.errors)return r.finalize(y.value,[].concat(y.errors),g);t=y.value}}if(_.coerce&&t!==void 0&&o.convert&&(!_.coerce.from||_.coerce.from.includes(typeof t))){const y=_.coerce.method(t,g);if(y){if(s.mainstay.tracer.value(s,"coerced",t,y.value),y.errors)return r.finalize(y.value,[].concat(y.errors),g);t=y.value}}const v=l._flags.empty;v&&v.$_match(r.trim(t,l),s.nest(v),e.defaults)&&(s.mainstay.tracer.value(s,"empty",t,void 0),t=void 0);const u=c.presence||l._flags.presence||(l._flags._endedSwitch?null:o.presence);if(t===void 0){if(u==="forbidden")return r.finalize(t,null,g);if(u==="required")return r.finalize(t,[l.$_createError("any.required",t,null,s,o)],g);if(u==="optional"){if(l._flags.default!==e.symbols.deepDefault)return r.finalize(t,null,g);s.mainstay.tracer.value(s,"default",t,{}),t={}}}else if(u==="forbidden")return r.finalize(t,[l.$_createError("any.unknown",t,null,s,o)],g);const m=[];if(l._valids){const y=l._valids.get(t,s,o,l._flags.insensitive);if(y)return o.convert&&(s.mainstay.tracer.value(s,"valids",t,y.value),t=y.value),s.mainstay.tracer.filter(l,s,"valid",y),r.finalize(t,null,g);if(l._flags.only){const x=l.$_createError("any.only",t,{valids:l._valids.values({display:!0})},s,o);if(o.abortEarly)return r.finalize(t,[x],g);m.push(x)}}if(l._invalids){const y=l._invalids.get(t,s,o,l._flags.insensitive);if(y){s.mainstay.tracer.filter(l,s,"invalid",y);const x=l.$_createError("any.invalid",t,{invalids:l._invalids.values({display:!0})},s,o);if(o.abortEarly)return r.finalize(t,[x],g);m.push(x)}}if(_.validate){const y=_.validate(t,g);if(y&&(s.mainstay.tracer.value(s,"base",t,y.value),t=y.value,y.errors)){if(!Array.isArray(y.errors))return m.push(y.errors),r.finalize(t,m,g);if(y.errors.length)return m.push(...y.errors),r.finalize(t,m,g)}}return l._rules.length?r.rules(t,m,g):r.finalize(t,m,g)},r.rules=function(t,l,s){const{schema:o,state:c,prefs:f}=s;for(const g of o._rules){const _=o._definition.rules[g.method];if(_.convert&&f.convert){c.mainstay.tracer.log(o,c,"rule",g.name,"full");continue}let v,u=g.args;if(g._resolve.length){u=Object.assign({},u);for(const y of g._resolve){const x=_.argsByName.get(y),j=u[y].resolve(t,c,f),S=x.normalize?x.normalize(j):j,D=e.validateArg(S,null,x);if(D){v=o.$_createError("any.ref",j,{arg:y,ref:u[y],reason:D},c,f);break}u[y]=S}}v=v||_.validate(t,s,u,g);const m=r.rule(v,g);if(m.errors){if(c.mainstay.tracer.log(o,c,"rule",g.name,"error"),g.warn){c.mainstay.warnings.push(...m.errors);continue}if(f.abortEarly)return r.finalize(t,m.errors,s);l.push(...m.errors)}else c.mainstay.tracer.log(o,c,"rule",g.name,"pass"),c.mainstay.tracer.value(c,"rule",t,m.value,g.name),t=m.value}return r.finalize(t,l,s)},r.rule=function(t,l){return t instanceof n.Report?(r.error(t,l),{errors:[t],value:null}):Array.isArray(t)&&t[e.symbols.errors]?(t.forEach(s=>r.error(s,l)),{errors:t,value:null}):{errors:null,value:t}},r.error=function(t,l){return l.message&&t._setTemplate(l.message),t},r.finalize=function(t,l,s){l=l||[];const{schema:o,state:c,prefs:f}=s;if(l.length){const _=r.default("failover",void 0,l,s);_!==void 0&&(c.mainstay.tracer.value(c,"failover",t,_),t=_,l=[])}if(l.length&&o._flags.error)if(typeof o._flags.error=="function"){l=o._flags.error(l),Array.isArray(l)||(l=[l]);for(const _ of l)a(_ instanceof Error||_ instanceof n.Report,"error() must return an Error object")}else l=[o._flags.error];if(t===void 0){const _=r.default("default",t,l,s);c.mainstay.tracer.value(c,"default",t,_),t=_}if(o._flags.cast&&t!==void 0){const _=o._definition.cast[o._flags.cast];if(_.from(t)){const v=_.to(t,s);c.mainstay.tracer.value(c,"cast",t,v,o._flags.cast),t=v}}if(o.$_terms.externals&&f.externals&&f._externals!==!1)for(const{method:_}of o.$_terms.externals)c.mainstay.externals.push({method:_,schema:o,state:c,label:n.label(o._flags,c,f)});const g={value:t,errors:l.length?l:null};return o._flags.result&&(g.value=o._flags.result==="strip"?void 0:s.original,c.mainstay.tracer.value(c,o._flags.result,t,g.value),c.shadow(t,o._flags.result)),o._cache&&f.cache!==!1&&!o._refs.length&&o._cache.set(s.original,g),t===void 0||g.errors||o._flags.artifact===void 0||(c.mainstay.artifacts=c.mainstay.artifacts||new Map,c.mainstay.artifacts.has(o._flags.artifact)||c.mainstay.artifacts.set(o._flags.artifact,[]),c.mainstay.artifacts.get(o._flags.artifact).push(c.path)),g},r.prefs=function(t,l){const s=l===e.defaults;return s&&t._preferences[e.symbols.prefs]?t._preferences[e.symbols.prefs]:(l=e.preferences(l,t._preferences),s&&(t._preferences[e.symbols.prefs]=l),l)},r.default=function(t,l,s,o){const{schema:c,state:f,prefs:g}=o,_=c._flags[t];if(g.noDefaults||_===void 0)return l;if(f.mainstay.tracer.log(c,f,"rule",t,"full"),!_)return _;if(typeof _=="function"){const v=_.length?[h(f.ancestors[0]),o]:[];try{return _(...v)}catch(u){return void s.push(c.$_createError(`any.${t}`,null,{error:u},f,g))}}return typeof _!="object"?_:_[e.symbols.literal]?_.literal:e.isResolvable(_)?_.resolve(l,f,g):h(_)},r.trim=function(t,l){if(typeof t!="string")return t;const s=l.$_getRule("trim");return s&&s.args.enabled?t.trim():t},r.ignore={active:!1,debug:p,entry:p,filter:p,log:p,resolve:p,value:p},r.errorsArray=function(){const t=[];return t[e.symbols.errors]=!0,t}},2036:($,w,b)=>{const a=b(375),h=b(9474),p=b(8160),d={};$.exports=d.Values=class{constructor(e,n){this._values=new Set(e),this._refs=new Set(n),this._lowercase=d.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,n){p.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),n&&n.register(e)):this.has(e,null,null,!1)||(this._values.add(e),typeof e=="string"&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,n,i){if(e=e||new d.Values,n){if(n._override)return n.clone();for(const r of[...n._values,...n._refs])e.add(r)}if(i)for(const r of[...i._values,...i._refs])e.remove(r);return e.length?e:null}remove(e){p.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),typeof e=="string"&&this._lowercase.delete(e.toLowerCase()))}has(e,n,i,r){return!!this.get(e,n,i,r)}get(e,n,i,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if(typeof e=="string"&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&typeof e!="object")return!1;if(typeof e=="object"){for(const t of this._values)if(h(t,e))return{value:t}}if(n)for(const t of this._refs){const l=t.resolve(e,n,i,null,{in:!0});if(l===void 0)continue;const s=t.in&&typeof l=="object"?Array.isArray(l)?l:Object.keys(l):[l];for(const o of s)if(typeof o==typeof e){if(r&&e&&typeof e=="string"){if(o.toLowerCase()===e.toLowerCase())return{value:o,ref:t}}else if(h(o,e))return{value:o,ref:t}}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const n=[];for(const i of[...this._values,...this._refs])i!==void 0&&n.push(i);return n}return Array.from([...this._values,...this._refs])}clone(){const e=new d.Values(this._values,this._refs);return e._override=this._override,e}concat(e){a(!e._override,"Cannot concat override set of values");const n=new d.Values([...this._values,...e._values],[...this._refs,...e._refs]);return n._override=this._override,n}describe(){const e=[];this._override&&e.push({override:!0});for(const n of this._values.values())e.push(n&&typeof n=="object"?{value:n}:n);for(const n of this._refs.values())e.push(n.describe());return e}},d.Values.prototype[p.symbols.values]=!0,d.Values.prototype.slice=d.Values.prototype.clone,d.lowercases=function(e){const n=new Map;if(e)for(const i of e)typeof i=="string"&&n.set(i.toLowerCase(),i);return n}},978:($,w,b)=>{const a=b(375),h=b(8571),p=b(1687),d=b(9621),e={};$.exports=function(n,i,r={}){if(a(n&&typeof n=="object","Invalid defaults value: must be an object"),a(!i||i===!0||typeof i=="object","Invalid source value: must be true, falsy or an object"),a(typeof r=="object","Invalid options: must be an object"),!i)return null;if(r.shallow)return e.applyToDefaultsWithShallow(n,i,r);const t=h(n);if(i===!0)return t;const l=r.nullOverride!==void 0&&r.nullOverride;return p(t,i,{nullOverride:l,mergeArrays:!1})},e.applyToDefaultsWithShallow=function(n,i,r){const t=r.shallow;a(Array.isArray(t),"Invalid keys");const l=new Map,s=i===!0?null:new Set;for(let f of t){f=Array.isArray(f)?f:f.split(".");const g=d(n,f);g&&typeof g=="object"?l.set(g,s&&d(i,f)||g):s&&s.add(f)}const o=h(n,{},l);if(!s)return o;for(const f of s)e.reachCopy(o,i,f);const c=r.nullOverride!==void 0&&r.nullOverride;return p(o,i,{nullOverride:c,mergeArrays:!1})},e.reachCopy=function(n,i,r){for(const s of r){if(!(s in i))return;const o=i[s];if(typeof o!="object"||o===null)return;i=o}const t=i;let l=n;for(let s=0;s<r.length-1;++s){const o=r[s];typeof l[o]!="object"&&(l[o]={}),l=l[o]}l[r[r.length-1]]=t}},375:($,w,b)=>{const a=b(7916);$.exports=function(h,...p){if(!h)throw p.length===1&&p[0]instanceof Error?p[0]:new a(p)}},8571:($,w,b)=>{const a=b(9621),h=b(4277),p=b(7043),d={needsProtoHack:new Set([h.set,h.map,h.weakSet,h.weakMap])};$.exports=d.clone=function(e,n={},i=null){if(typeof e!="object"||e===null)return e;let r=d.clone,t=i;if(n.shallow){if(n.shallow!==!0)return d.cloneWithShallow(e,n);r=c=>c}else if(t){const c=t.get(e);if(c)return c}else t=new Map;const l=h.getInternalProto(e);if(l===h.buffer)return!1;if(l===h.date)return new Date(e.getTime());if(l===h.regex)return new RegExp(e);const s=d.base(e,l,n);if(s===e)return e;if(t&&t.set(e,s),l===h.set)for(const c of e)s.add(r(c,n,t));else if(l===h.map)for(const[c,f]of e)s.set(c,r(f,n,t));const o=p.keys(e,n);for(const c of o){if(c==="__proto__")continue;if(l===h.array&&c==="length"){s.length=e.length;continue}const f=Object.getOwnPropertyDescriptor(e,c);f?f.get||f.set?Object.defineProperty(s,c,f):f.enumerable?s[c]=r(e[c],n,t):Object.defineProperty(s,c,{enumerable:!1,writable:!0,configurable:!0,value:r(e[c],n,t)}):Object.defineProperty(s,c,{enumerable:!0,writable:!0,configurable:!0,value:r(e[c],n,t)})}return s},d.cloneWithShallow=function(e,n){const i=n.shallow;(n=Object.assign({},n)).shallow=!1;const r=new Map;for(const t of i){const l=a(e,t);typeof l!="object"&&typeof l!="function"||r.set(l,l)}return d.clone(e,n,r)},d.base=function(e,n,i){if(i.prototype===!1)return d.needsProtoHack.has(n)?new n.constructor:n===h.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(n===h.array){const t=[];return r!==n&&Object.setPrototypeOf(t,r),t}if(d.needsProtoHack.has(n)){const t=new r.constructor;return r!==n&&Object.setPrototypeOf(t,r),t}return Object.create(r)}},9474:($,w,b)=>{const a=b(4277),h={mismatched:null};$.exports=function(p,d,e){return e=Object.assign({prototype:!0},e),!!h.isDeepEqual(p,d,e,[])},h.isDeepEqual=function(p,d,e,n){if(p===d)return p!==0||1/p==1/d;const i=typeof p;if(i!==typeof d||p===null||d===null)return!1;if(i==="function"){if(!e.deepFunction||p.toString()!==d.toString())return!1}else if(i!=="object")return p!=p&&d!=d;const r=h.getSharedType(p,d,!!e.prototype);switch(r){case a.buffer:return!1;case a.promise:return p===d;case a.regex:return p.toString()===d.toString();case h.mismatched:return!1}for(let t=n.length-1;t>=0;--t)if(n[t].isSame(p,d))return!0;n.push(new h.SeenEntry(p,d));try{return!!h.isDeepEqualObj(r,p,d,e,n)}finally{n.pop()}},h.getSharedType=function(p,d,e){if(e)return Object.getPrototypeOf(p)!==Object.getPrototypeOf(d)?h.mismatched:a.getInternalProto(p);const n=a.getInternalProto(p);return n!==a.getInternalProto(d)?h.mismatched:n},h.valueOf=function(p){const d=p.valueOf;if(d===void 0)return p;try{return d.call(p)}catch(e){return e}},h.hasOwnEnumerableProperty=function(p,d){return Object.prototype.propertyIsEnumerable.call(p,d)},h.isSetSimpleEqual=function(p,d){for(const e of Set.prototype.values.call(p))if(!Set.prototype.has.call(d,e))return!1;return!0},h.isDeepEqualObj=function(p,d,e,n,i){const{isDeepEqual:r,valueOf:t,hasOwnEnumerableProperty:l}=h,{keys:s,getOwnPropertySymbols:o}=Object;if(p===a.array){if(!n.part){if(d.length!==e.length)return!1;for(let v=0;v<d.length;++v)if(!r(d[v],e[v],n,i))return!1;return!0}for(const v of d)for(const u of e)if(r(v,u,n,i))return!0}else if(p===a.set){if(d.size!==e.size)return!1;if(!h.isSetSimpleEqual(d,e)){const v=new Set(Set.prototype.values.call(e));for(const u of Set.prototype.values.call(d)){if(v.delete(u))continue;let m=!1;for(const y of v)if(r(u,y,n,i)){v.delete(y),m=!0;break}if(!m)return!1}}}else if(p===a.map){if(d.size!==e.size)return!1;for(const[v,u]of Map.prototype.entries.call(d))if(u===void 0&&!Map.prototype.has.call(e,v)||!r(u,Map.prototype.get.call(e,v),n,i))return!1}else if(p===a.error&&(d.name!==e.name||d.message!==e.message))return!1;const c=t(d),f=t(e);if((d!==c||e!==f)&&!r(c,f,n,i))return!1;const g=s(d);if(!n.part&&g.length!==s(e).length&&!n.skip)return!1;let _=0;for(const v of g)if(n.skip&&n.skip.includes(v))e[v]===void 0&&++_;else if(!l(e,v)||!r(d[v],e[v],n,i))return!1;if(!n.part&&g.length-_!==s(e).length)return!1;if(n.symbols!==!1){const v=o(d),u=new Set(o(e));for(const m of v){if(!n.skip||!n.skip.includes(m)){if(l(d,m)){if(!l(e,m)||!r(d[m],e[m],n,i))return!1}else if(l(e,m))return!1}u.delete(m)}for(const m of u)if(l(e,m))return!1}return!0},h.SeenEntry=class{constructor(p,d){this.obj=p,this.ref=d}isSame(p,d){return this.obj===p&&this.ref===d}}},7916:($,w,b)=>{const a=b(8761);$.exports=class extends Error{constructor(h){super(h.filter(p=>p!=="").map(p=>typeof p=="string"?p:p instanceof Error?p.message:a(p)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,w.assert)}}},5277:$=>{const w={};$.exports=function(b){if(!b)return"";let a="";for(let h=0;h<b.length;++h){const p=b.charCodeAt(h);w.isSafe(p)?a+=b[h]:a+=w.escapeHtmlChar(p)}return a},w.escapeHtmlChar=function(b){return w.namedHtml.get(b)||(b>=256?"&#"+b+";":`&#x${b.toString(16).padStart(2,"0")};`)},w.isSafe=function(b){return w.safeCharCodes.has(b)},w.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]),w.safeCharCodes=function(){const b=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&b.add(a);return b}()},6064:$=>{$.exports=function(w){return w.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:$=>{$.exports=function(){}},1687:($,w,b)=>{const a=b(375),h=b(8571),p=b(7043),d={};$.exports=d.merge=function(e,n,i){if(a(e&&typeof e=="object","Invalid target value: must be an object"),a(n==null||typeof n=="object","Invalid source value: must be null, undefined, or an object"),!n)return e;if(i=Object.assign({nullOverride:!0,mergeArrays:!0},i),Array.isArray(n)){a(Array.isArray(e),"Cannot merge array onto an object"),i.mergeArrays||(e.length=0);for(let t=0;t<n.length;++t)e.push(h(n[t],{symbols:i.symbols}));return e}const r=p.keys(n,i);for(let t=0;t<r.length;++t){const l=r[t];if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,l))continue;const s=n[l];if(s&&typeof s=="object"){if(e[l]===s)continue;!e[l]||typeof e[l]!="object"||Array.isArray(e[l])!==Array.isArray(s)||s instanceof Date||s instanceof RegExp?e[l]=h(s,{symbols:i.symbols}):d.merge(e[l],s,i)}else(s!=null||i.nullOverride)&&(e[l]=s)}return e}},9621:($,w,b)=>{const a=b(375),h={};$.exports=function(p,d,e){if(d===!1||d==null)return p;typeof(e=e||{})=="string"&&(e={separator:e});const n=Array.isArray(d);a(!n||!e.separator,"Separator option is not valid for array-based chain");const i=n?d:d.split(e.separator||".");let r=p;for(let t=0;t<i.length;++t){let l=i[t];const s=e.iterables&&h.iterables(r);if(Array.isArray(r)||s==="set"){const o=Number(l);Number.isInteger(o)&&(l=o<0?r.length+o:o)}if(!r||typeof r=="function"&&e.functions===!1||!s&&r[l]===void 0){a(!e.strict||t+1===i.length,"Missing segment",l,"in reach path ",d),a(typeof r=="object"||e.functions===!0||typeof r!="function","Invalid segment",l,"in reach path ",d),r=e.default;break}r=s?s==="set"?[...r][l]:r.get(l):r[l]}return r},h.iterables=function(p){return p instanceof Set?"set":p instanceof Map?"map":void 0}},8761:$=>{$.exports=function(...w){try{return JSON.stringify(...w)}catch(b){return"[Cannot display object: "+b.message+"]"}}},4277:($,w)=>{const b={};w=$.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},b.typeMap=new Map([["[object Error]",w.error],["[object Map]",w.map],["[object Promise]",w.promise],["[object Set]",w.set],["[object WeakMap]",w.weakMap],["[object WeakSet]",w.weakSet]]),w.getInternalProto=function(a){if(Array.isArray(a))return w.array;if(a instanceof Date)return w.date;if(a instanceof RegExp)return w.regex;if(a instanceof Error)return w.error;const h=Object.prototype.toString.call(a);return b.typeMap.get(h)||w.generic}},7043:($,w)=>{w.keys=function(b,a={}){return a.symbols!==!1?Reflect.ownKeys(b):Object.getOwnPropertyNames(b)}},3652:($,w,b)=>{const a=b(375),h={};w.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(p,d){const e=[].concat((d=d||{}).before||[]),n=[].concat(d.after||[]),i=d.group||"?",r=d.sort||0;a(!e.includes(i),`Item cannot come before itself: ${i}`),a(!e.includes("?"),"Item cannot come before unassociated items"),a(!n.includes(i),`Item cannot come after itself: ${i}`),a(!n.includes("?"),"Item cannot come after unassociated items"),Array.isArray(p)||(p=[p]);for(const t of p){const l={seq:this._items.length,sort:r,before:e,after:n,group:i,node:t};this._items.push(l)}if(!d.manual){const t=this._sort();a(t,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(p){Array.isArray(p)||(p=[p]);for(const e of p)if(e)for(const n of e._items)this._items.push(Object.assign({},n));this._items.sort(h.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const d=this._sort();return a(d,"merge created a dependencies error"),this.nodes}sort(){const p=this._sort();return a(p,"sort created a dependencies error"),this.nodes}_sort(){const p={},d=Object.create(null),e=Object.create(null);for(const l of this._items){const s=l.seq,o=l.group;e[o]=e[o]||[],e[o].push(s),p[s]=l.before;for(const c of l.after)d[c]=d[c]||[],d[c].push(s)}for(const l in p){const s=[];for(const o in p[l]){const c=p[l][o];e[c]=e[c]||[],s.push(...e[c])}p[l]=s}for(const l in d)if(e[l])for(const s of e[l])p[s].push(...d[l]);const n={};for(const l in p){const s=p[l];for(const o of s)n[o]=n[o]||[],n[o].push(l)}const i={},r=[];for(let l=0;l<this._items.length;++l){let s=l;if(n[l]){s=null;for(let o=0;o<this._items.length;++o){if(i[o]===!0)continue;n[o]||(n[o]=[]);const c=n[o].length;let f=0;for(let g=0;g<c;++g)i[n[o][g]]&&++f;if(f===c){s=o;break}}}s!==null&&(i[s]=!0,r.push(s))}if(r.length!==this._items.length)return!1;const t={};for(const l of this._items)t[l.seq]=l;this._items=[],this.nodes=[];for(const l of r){const s=t[l];this.nodes.push(s.node),this._items.push(s)}return!0}},h.mergeSort=(p,d)=>p.sort===d.sort?0:p.sort<d.sort?-1:1},5380:($,w,b)=>{const a=b(443),h=b(2178),p={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:a.URL||URL};w.analyze=function(d,e={}){if(!d)return h.code("DOMAIN_NON_EMPTY_STRING");if(typeof d!="string")throw new Error("Invalid input: domain must be a string");if(d.length>256)return h.code("DOMAIN_TOO_LONG");if(p.nonAsciiRx.test(d)){if(e.allowUnicode===!1)return h.code("DOMAIN_INVALID_UNICODE_CHARS");d=d.normalize("NFC")}if(p.domainControlRx.test(d))return h.code("DOMAIN_INVALID_CHARS");d=p.punycode(d),e.allowFullyQualified&&d[d.length-1]==="."&&(d=d.slice(0,-1));const n=e.minDomainSegments||p.minDomainSegments,i=d.split(".");if(i.length<n)return h.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return h.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=e.tlds;if(r){const t=i[i.length-1].toLowerCase();if(r.deny&&r.deny.has(t)||r.allow&&!r.allow.has(t))return h.code("DOMAIN_FORBIDDEN_TLDS")}for(let t=0;t<i.length;++t){const l=i[t];if(!l.length)return h.code("DOMAIN_EMPTY_SEGMENT");if(l.length>63)return h.code("DOMAIN_LONG_SEGMENT");if(t<i.length-1){if(!p.domainSegmentRx.test(l))return h.code("DOMAIN_INVALID_CHARS")}else if(!p.tldSegmentRx.test(l))return h.code("DOMAIN_INVALID_TLDS_CHARS")}return null},w.isValid=function(d,e){return!w.analyze(d,e)},p.punycode=function(d){d.includes("%")&&(d=d.replace(/%/g,"%25"));try{return new p.URL(`http://${d}`).host}catch{return d}}},1745:($,w,b)=>{const a=b(9848),h=b(5380),p=b(2178),d={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};w.analyze=function(e,n){return d.email(e,n)},w.isValid=function(e,n){return!d.email(e,n)},d.email=function(e,n={}){if(typeof e!="string")throw new Error("Invalid input: email must be a string");if(!e)return p.code("EMPTY_STRING");const i=!d.nonAsciiRx.test(e);if(!i){if(n.allowUnicode===!1)return p.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(r.length!==2)return r.length>2?p.code("MULTIPLE_AT_CHAR"):p.code("MISSING_AT_CHAR");const[t,l]=r;if(!t)return p.code("EMPTY_LOCAL");if(!n.ignoreLength){if(e.length>254)return p.code("ADDRESS_TOO_LONG");if(d.encoder.encode(t).length>64)return p.code("LOCAL_TOO_LONG")}return d.local(t,i)||h.analyze(l,n)},d.local=function(e,n){const i=e.split(".");for(const r of i){if(!r.length)return p.code("EMPTY_LOCAL_SEGMENT");if(n){if(!d.atextRx.test(r))return p.code("INVALID_LOCAL_CHARS")}else for(const t of r){if(d.atextRx.test(t))continue;const l=d.binary(t);if(!d.atomRx.test(l))return p.code("INVALID_LOCAL_CHARS")}}},d.binary=function(e){return Array.from(d.encoder.encode(e)).map(n=>String.fromCharCode(n)).join("")},d.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,d.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:($,w)=>{w.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"},w.code=function(b){return{code:b,error:w.codes[b]}}},9959:($,w,b)=>{const a=b(375),h=b(5752);w.regex=function(p={}){a(p.cidr===void 0||typeof p.cidr=="string","options.cidr must be a string");const d=p.cidr?p.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(d),"options.cidr must be one of required, optional, forbidden"),a(p.version===void 0||typeof p.version=="string"||Array.isArray(p.version),"options.version must be a string or an array of string");let e=p.version||["ipv4","ipv6","ipvfuture"];Array.isArray(e)||(e=[e]),a(e.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<e.length;++r)a(typeof e[r]=="string","options.version must only contain strings"),e[r]=e[r].toLowerCase(),a(["ipv4","ipv6","ipvfuture"].includes(e[r]),"options.version contains unknown version "+e[r]+" - must be one of ipv4, ipv6, ipvfuture");e=Array.from(new Set(e));const n=`(?:${e.map(r=>{if(d==="forbidden")return h.ip[r];const t=`\\/${r==="ipv4"?h.ip.v4Cidr:h.ip.v6Cidr}`;return d==="required"?`${h.ip[r]}${t}`:`${h.ip[r]}(?:${t})?`}).join("|")})`,i=new RegExp(`^${n}$`);return{cidr:d,versions:e,regex:i,raw:n}}},5752:($,w,b)=>{const a=b(375),h=b(6064),p={generate:function(){const d={},e="\\dA-Fa-f",n="["+e+"]",i="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",t="%"+e,l=i+t+r+":@",s="["+l+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";d.ipv4address="(?:"+o+"\\.){3}"+o;const c=n+"{1,4}",f="(?:"+c+":"+c+"|"+d.ipv4address+")",g="(?:"+c+":){6}"+f,_="::(?:"+c+":){5}"+f,v="(?:"+c+")?::(?:"+c+":){4}"+f,u="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+f,m="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+f,y="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+f,x="(?:(?:"+c+":){0,4}"+c+")?::"+f,j="(?:(?:"+c+":){0,5}"+c+")?::"+c,S="(?:(?:"+c+":){0,6}"+c+")?::";d.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",d.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",d.ipv6address="(?:"+g+"|"+_+"|"+v+"|"+u+"|"+m+"|"+y+"|"+x+"|"+j+"|"+S+")",d.ipvFuture="v"+n+"+\\.["+i+r+":]+",d.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",d.schemeRegex=new RegExp(d.scheme);const D="["+i+t+r+":]*",C="["+i+t+r+"]{1,255}",L="(?:\\[(?:"+d.ipv6address+"|"+d.ipvFuture+")\\]|"+d.ipv4address+"|"+C+")",T="(?:"+D+"@)?"+L+"(?::\\d*)?",N="(?:"+D+"@)?("+L+")(?::\\d*)?",q=s+"*",M=s+"+",P="(?:\\/"+q+")*",F="\\/(?:"+M+P+")?",W=M+P,V="["+i+t+r+"@]+"+P,Z="(?:\\/\\/\\/"+q+P+")";return d.hierPart="(?:(?:\\/\\/"+T+P+")|"+F+"|"+W+"|"+Z+")",d.hierPartCapture="(?:(?:\\/\\/"+N+P+")|"+F+"|"+W+")",d.relativeRef="(?:(?:\\/\\/"+T+P+")|"+F+"|"+V+"|)",d.relativeRefCapture="(?:(?:\\/\\/"+N+P+")|"+F+"|"+V+"|)",d.query="["+l+"\\/\\?]*(?=#|$)",d.queryWithSquareBrackets="["+l+"\\[\\]\\/\\?]*(?=#|$)",d.fragment="["+l+"\\/\\?]*",d}};p.rfc3986=p.generate(),w.ip={v4Cidr:p.rfc3986.ipv4Cidr,v6Cidr:p.rfc3986.ipv6Cidr,ipv4:p.rfc3986.ipv4address,ipv6:p.rfc3986.ipv6address,ipvfuture:p.rfc3986.ipvFuture},p.createRegex=function(d){const e=p.rfc3986,n="(?:\\?"+(d.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=d.domain?e.relativeRefCapture:e.relativeRef;if(d.relativeOnly)return p.wrap(i+n);let r="";if(d.scheme){a(d.scheme instanceof RegExp||typeof d.scheme=="string"||Array.isArray(d.scheme),"scheme must be a RegExp, String, or Array");const s=[].concat(d.scheme);a(s.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let c=0;c<s.length;++c){const f=s[c];a(f instanceof RegExp||typeof f=="string","scheme at position "+c+" must be a RegExp or String"),f instanceof RegExp?o.push(f.source.toString()):(a(e.schemeRegex.test(f),"scheme at position "+c+" must be a valid scheme"),o.push(h(f)))}r=o.join("|")}const t="(?:"+(r?"(?:"+r+")":e.scheme)+":"+(d.domain?e.hierPartCapture:e.hierPart)+")",l=d.allowRelative?"(?:"+t+"|"+i+")":t;return p.wrap(l+n,r)},p.wrap=function(d,e){return{raw:d=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${d}`,regex:new RegExp(`^${d}$`),scheme:e}},p.uriRegex=p.createRegex({}),w.regex=function(d={}){return d.scheme||d.allowRelative||d.relativeOnly||d.allowQuerySquareBrackets||d.domain?p.createRegex(d):p.uriRegex}},1447:($,w)=>{const b={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};w.Parser=class{constructor(a,h={}){if(!h[b.settings]&&h.constants)for(const p in h.constants){const d=h.constants[p];if(d!==null&&!["boolean","number","string"].includes(typeof d))throw new Error(`Formula constant ${p} contains invalid ${typeof d} value type`)}this.settings=h[b.settings]?h:Object.assign({[b.settings]:!0,constants:{},functions:{}},h),this.single=null,this._parts=null,this._parse(a)}_parse(a){let h=[],p="",d=0,e=!1;const n=r=>{if(d)throw new Error("Formula missing closing parenthesis");const t=h.length?h[h.length-1]:null;if(e||p||r){if(t&&t.type==="reference"&&r===")")return t.type="function",t.value=this._subFormula(p,t.value),void(p="");if(r===")"){const l=new w.Parser(p,this.settings);h.push({type:"segment",value:l})}else if(e){if(e==="]")return h.push({type:"reference",value:p}),void(p="");h.push({type:"literal",value:p})}else if(b.operatorCharacters.includes(p))t&&t.type==="operator"&&b.operators.includes(t.value+p)?t.value+=p:h.push({type:"operator",value:p});else if(p.match(b.numberRx))h.push({type:"constant",value:parseFloat(p)});else if(this.settings.constants[p]!==void 0)h.push({type:"constant",value:this.settings.constants[p]});else{if(!p.match(b.tokenRx))throw new Error(`Formula contains invalid token: ${p}`);h.push({type:"reference",value:p})}p=""}};for(const r of a)e?r===e?(n(),e=!1):p+=r:d?r==="("?(p+=r,++d):r===")"?(--d,d?p+=r:n(r)):p+=r:r in b.literals?e=b.literals[r]:r==="("?(n(),++d):b.operatorCharacters.includes(r)?(n(),p=r,n()):r!==" "?p+=r:n();n(),h=h.map((r,t)=>r.type!=="operator"||r.value!=="-"||t&&h[t-1].type!=="operator"?r:{type:"operator",value:"n"});let i=!1;for(const r of h){if(r.type==="operator"){if(b.operatorsPrefix.includes(r.value))continue;if(!i)throw new Error("Formula contains an operator in invalid position");if(!b.operators.includes(r.value))throw new Error(`Formula contains an unknown operator ${r.value}`)}else if(i)throw new Error("Formula missing expected operator");i=!i}if(!i)throw new Error("Formula contains invalid trailing operator");h.length===1&&["reference","literal","constant"].includes(h[0].type)&&(this.single={type:h[0].type==="reference"?"reference":"value",value:h[0].value}),this._parts=h.map(r=>{if(r.type==="operator")return b.operatorsPrefix.includes(r.value)?r:r.value;if(r.type!=="reference")return r.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(r.value))throw new Error(`Formula contains invalid reference ${r.value}`);return this.settings.reference?this.settings.reference(r.value):b.reference(r.value)})}_subFormula(a,h){const p=this.settings.functions[h];if(typeof p!="function")throw new Error(`Formula contains unknown function ${h}`);let d=[];if(a){let e="",n=0,i=!1;const r=()=>{if(!e)throw new Error(`Formula contains function ${h} with invalid arguments ${a}`);d.push(e),e=""};for(let t=0;t<a.length;++t){const l=a[t];i?(e+=l,l===i&&(i=!1)):l in b.literals&&!n?(e+=l,i=b.literals[l]):l!==","||n?(e+=l,l==="("?++n:l===")"&&--n):r()}r()}return d=d.map(e=>new w.Parser(e,this.settings)),function(e){const n=[];for(const i of d)n.push(i.evaluate(e));return p.call(e,...n)}}evaluate(a){const h=this._parts.slice();for(let p=h.length-2;p>=0;--p){const d=h[p];if(d&&d.type==="operator"){const e=h[p+1];h.splice(p+1,1);const n=b.evaluate(e,a);h[p]=b.single(d.value,n)}}return b.operatorsOrder.forEach(p=>{for(let d=1;d<h.length-1;)if(p.includes(h[d])){const e=h[d],n=b.evaluate(h[d-1],a),i=b.evaluate(h[d+1],a);h.splice(d,2);const r=b.calculate(e,n,i);h[d-1]=r===0?0:r}else d+=2}),b.evaluate(h[0],a)}},w.Parser.prototype[b.symbol]=!0,b.reference=function(a){return function(h){return h&&h[a]!==void 0?h[a]:null}},b.evaluate=function(a,h){return a===null?null:typeof a=="function"?a(h):a[b.symbol]?a.evaluate(h):a},b.single=function(a,h){if(a==="!")return!h;const p=-h;return p===0?0:p},b.calculate=function(a,h,p){if(a==="??")return b.exists(h)?h:p;if(typeof h=="string"||typeof p=="string"){if(a==="+")return(h=b.exists(h)?h:"")+(b.exists(p)?p:"")}else switch(a){case"^":return Math.pow(h,p);case"*":return h*p;case"/":return h/p;case"%":return h%p;case"+":return h+p;case"-":return h-p}switch(a){case"<":return h<p;case"<=":return h<=p;case">":return h>p;case">=":return h>=p;case"==":return h===p;case"!=":return h!==p;case"&&":return h&&p;case"||":return h||p}return null},b.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:$=>{$.exports=JSON.parse('{"version":"17.12.2"}')}},k={},function $(w){var b=k[w];if(b!==void 0)return b.exports;var a=k[w]={exports:{}};return E[w](a,a.exports,$),a.exports}(5107);var E,k})})(Re);var dt=Re.exports;const z=qe(dt),Se={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},Ae={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},ft={"-rm":!0,"--name":!0,"--label":!0,"--network":!0,"--user":!0},mt={"--volume":!0,"--publish":!0},pt=new Set(["--publish","--volume"]),ce=R=>{const[A]=R.split(":");return(A==null?void 0:A.startsWith("/"))||(A==null?void 0:A.startsWith("./"))||(A==null?void 0:A.startsWith("../"))||(A==null?void 0:A.startsWith("~"))||(A==null?void 0:A.startsWith("$BLOCKLET"))};function Oe(R){return R.map(A=>{if(A.key!=="--volume"||A.value.startsWith("$BLOCKLET_APP_DIR/")||A.value.startsWith("$BLOCKLET_DATA_DIR/"))return A;const[E,...k]=A.value.split(":");if(!E||!ce(A.value))return A;const $=E.startsWith("/")?`$BLOCKLET_DATA_DIR${E}`:`$BLOCKLET_DATA_DIR/${E}`;return{...A,value:[$,...k].join(":")}})}function ht(R){let A=!0;return R.find(k=>k.key==="--publish"&&k.type==="web")?R.map(k=>{if(k.key==="--publish"){const $={...k,type:A?"docker":k.type};return A=k.type==="web",$}return k}):R.map(k=>{if(k.key==="--publish"){const $={...k,type:A?"web":"docker"};return A=!1,$}return k})}function gt(R){if(!R)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(R=R.trim(),R.startsWith("$ docker run")&&(R=R.replace("$ docker run","docker run")),!R.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const E=R.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!E)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const k=[],$=[];let w=0,b="",a="";const h=[];for(;w<E.length;){const d=E[w];if(!d){w++;continue}if(d==="docker"||d==="run"){w++;continue}if((d==="-e"||d==="--env")&&w+1<E.length){const e=E[w+1]||"",[n,...i]=e.split("=");if(n){const r=i.join("=").replace(/^['"]|['"]$/g,"");$.push({key:n,value:r})}w+=2;continue}if(d.startsWith("-")&&h.length===0){const e=d.indexOf("=");let n=d,i=null;e!==-1&&(n=d.substring(0,e),i=d.substring(e+1).replace(/^['"]|['"]$/g,""));const r=Se[n];if(!r){w+=2;continue}if(r==="--publish"){let t="";if(i)t=i,k.push({key:r,value:t});else if(w+1<E.length&&!(E[w+1]||"").startsWith("-")){t=(E[w+1]||"").replace(/^['"]|['"]$/g,""),k.push({key:r,value:t}),w+=2;continue}else{k.push({key:r,value:"true"}),w++;continue}w++;continue}if(i!==null){k.push({key:r,value:i}),w++;continue}else if(w+1<E.length&&!(E[w+1]||"").startsWith("-")){const t=(E[w+1]||"").replace(/^['"]|['"]$/g,"");k.push({key:r,value:t}),w+=2;continue}else{k.push({key:r,value:"true"}),w++;continue}}h.push(d),w++}b=h[0]||"",a=h.slice(1).join(" ");const p=[];for(const d of k)d.name="",d.path="",d.prefix="",d.protocol="",d.proxyBehavior="service",d.type="docker",!(pt.has(d.key)&&d.value==="true")&&p.push(d);for(const d of $)d.custom="",d.description="",d.secure=!1,d.shared=!1,d.required=!1;return{dockerArgs:ht(Oe(p)),dockerEnvs:$,dockerImage:b,dockerCommand:a}}function yt({dockerArgs:R,dockerEnvs:A,dockerImage:E,dockerCommand:k}){var b;if(R.length===0&&A.length===0&&!E)return"";const $=["docker run \\"],w=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const a of R){const{key:h,value:p}=a;if(w.has(h))if(p==="true")$.push(` ${h} \\`);else{const d=/[\s"']/g.test(p)?`"${p}"`:p;$.push(` ${h} ${d} \\`)}else if(!$.some(d=>d.startsWith(` ${h}`)))if(p==="true")$.push(` ${h} \\`);else{const d=/[\s"']/g.test(p)?`"${p}"`:p;$.push(` ${h} ${d} \\`)}}for(const a of A){const{key:h,value:p}=a,d=/["']/g.test(p)?p:`"${p}"`;$.push(` -e ${h}=${d} \\`)}return E&&$.push(` ${E} \\`),k&&$.push(` ${k} \\`),(b=$[$.length-1])!=null&&b.endsWith(" \\")&&($[$.length-1]=($[$.length-1]||"").slice(0,-2)),$.join(`
1
+ import{g as qe,r as U}from"./vendor-react-DEoibe3W.js";import{j as O,A as ze,T as H,ab as Y,bx as Fe,O as Ue,ak as We,bJ as $e,H as I,a9 as ie,e as Be,y as G,at as Ve,q as be,aa as B,aq as Ke,bw as ve,bZ as He,af as Ge,ad as Ze}from"./vendor-mui-core-Bq8gXTan.js";import{k as oe,a as ee,ar as Je,B as _e,r as ae,a3 as K,be as Ye}from"./vendor-ux-did-connect-pzpsrvqx.js";import{v as Qe,c as Xe}from"./vendor-arcblock-CwufDgLV.js";import{D as le,ac as et,G as tt}from"./index-D2bUzebR.js";import{f as Q}from"./index-8eXqqyHQ.js";import{d as ke}from"./Launch-DFS3fgjy.js";import{d as rt}from"./Done-ASNftAOL.js";import{A as re}from"./vendor-utils-BfZ4tlod.js";import{d as je}from"./DeleteOutline-BKSMNwfT.js";import{D as st}from"./delete-confirm-BnUaxWhM.js";import{C as nt}from"./confirm-C4bZXKUn.js";import{u as it}from"./session-BGdAM8zS.js";import{g as X}from"./get-safe-url-B0-S5PGZ.js";import{W as ot}from"./did-address-NnOD1W_A.js";import{u as at}from"./vendor-hooks-DqdmWCmo.js";var lt={};const{NODE_MODES:we}=oe,ct=({mode:R,previousMode:A}={})=>R===we.SERVERLESS||A===we.SERVERLESS||lt.ABT_NODE_DEBUG_AS_SERVERLESS==="true";var ut={isInServerlessMode:ct},Re={exports:{}};(function(R,A){(function(E,k){R.exports=k()})(self,()=>{return E={7629:($,w,b)=>{const a=b(375),h=b(8571),p=b(9474),d=b(1687),e=b(8652),n=b(8160),i=b(3292),r=b(6354),t=b(8901),l=b(9708),s=b(6914),o=b(2294),c=b(6133),f=b(1152),g=b(8863),_=b(2036),v={Base:class{constructor(u){this.type=u,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new o.Ids,this._preferences=null,this._refs=new c.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof l.describe=="function","Manifest functionality disabled"),l.describe(this)}allow(...u){return n.verifyFlat(u,"allow"),this._values(u,"_valids")}alter(u){a(u&&typeof u=="object"&&!Array.isArray(u),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const m=this.clone();m.$_terms.alterations=m.$_terms.alterations||[];for(const y in u){const x=u[y];a(typeof x=="function","Alteration adjuster for",y,"must be a function"),m.$_terms.alterations.push({target:y,adjuster:x})}return m.$_temp.ruleset=!1,m}artifact(u){return a(u!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",u)}cast(u){return a(u===!1||typeof u=="string","Invalid to value"),a(u===!1||this._definition.cast[u],"Type",this.type,"does not support casting to",u),this.$_setFlag("cast",u===!1?void 0:u)}default(u,m){return this._default("default",u,m)}description(u){return a(u&&typeof u=="string","Description must be a non-empty string"),this.$_setFlag("description",u)}empty(u){const m=this.clone();return u!==void 0&&(u=m.$_compile(u,{override:!1})),m.$_setFlag("empty",u,{clone:!1})}error(u){return a(u,"Missing error"),a(u instanceof Error||typeof u=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",u)}example(u,m={}){return a(u!==void 0,"Missing example"),n.assertOptions(m,["override"]),this._inner("examples",u,{single:!0,override:m.override})}external(u,m){return typeof u=="object"&&(a(!m,"Cannot combine options with description"),m=u.description,u=u.method),a(typeof u=="function","Method must be a function"),a(m===void 0||m&&typeof m=="string","Description must be a non-empty string"),this._inner("externals",{method:u,description:m},{single:!0})}failover(u,m){return this._default("failover",u,m)}forbidden(){return this.presence("forbidden")}id(u){return u?(a(typeof u=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(u),"id cannot contain period character"),this.$_setFlag("id",u)):this.$_setFlag("id",void 0)}invalid(...u){return this._values(u,"_invalids")}label(u){return a(u&&typeof u=="string","Label name must be a non-empty string"),this.$_setFlag("label",u)}meta(u){return a(u!==void 0,"Meta cannot be undefined"),this._inner("metas",u,{single:!0})}note(...u){a(u.length,"Missing notes");for(const m of u)a(m&&typeof m=="string","Notes must be non-empty strings");return this._inner("notes",u)}only(u=!0){return a(typeof u=="boolean","Invalid mode:",u),this.$_setFlag("only",u)}optional(){return this.presence("optional")}prefs(u){a(u,"Missing preferences"),a(u.context===void 0,"Cannot override context"),a(u.externals===void 0,"Cannot override externals"),a(u.warnings===void 0,"Cannot override warnings"),a(u.debug===void 0,"Cannot override debug"),n.checkPreferences(u);const m=this.clone();return m._preferences=n.preferences(m._preferences,u),m}presence(u){return a(["optional","required","forbidden"].includes(u),"Unknown presence mode",u),this.$_setFlag("presence",u)}raw(u=!0){return this.$_setFlag("result",u?"raw":void 0)}result(u){return a(["raw","strip"].includes(u),"Unknown result mode",u),this.$_setFlag("result",u)}required(){return this.presence("required")}strict(u){const m=this.clone(),y=u!==void 0&&!u;return m._preferences=n.preferences(m._preferences,{convert:y}),m}strip(u=!0){return this.$_setFlag("result",u?"strip":void 0)}tag(...u){a(u.length,"Missing tags");for(const m of u)a(m&&typeof m=="string","Tags must be non-empty strings");return this._inner("tags",u)}unit(u){return a(u&&typeof u=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",u)}valid(...u){n.verifyFlat(u,"valid");const m=this.allow(...u);return m.$_setFlag("only",!!m._valids,{clone:!1}),m}when(u,m){const y=this.clone();y.$_terms.whens||(y.$_terms.whens=[]);const x=i.when(y,u,m);if(!["any","link"].includes(y.type)){const j=x.is?[x]:x.switch;for(const S of j)a(!S.then||S.then.type==="any"||S.then.type===y.type,"Cannot combine",y.type,"with",S.then&&S.then.type),a(!S.otherwise||S.otherwise.type==="any"||S.otherwise.type===y.type,"Cannot combine",y.type,"with",S.otherwise&&S.otherwise.type)}return y.$_terms.whens.push(x),y.$_mutateRebuild()}cache(u){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const m=this.clone();return m._cache=u||e.provider.provision(),m.$_temp.ruleset=!1,m}clone(){const u=Object.create(Object.getPrototypeOf(this));return this._assign(u)}concat(u){a(n.isSchema(u),"Invalid schema object"),a(this.type==="any"||u.type==="any"||u.type===this.type,"Cannot merge type",this.type,"with another type:",u.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!u._inRuleset(),"Cannot concatenate a schema with open ruleset");let m=this.clone();if(this.type==="any"&&u.type!=="any"){const y=u.clone();for(const x of Object.keys(m))x!=="type"&&(y[x]=m[x]);m=y}m._ids.concat(u._ids),m._refs.register(u,c.toSibling),m._preferences=m._preferences?n.preferences(m._preferences,u._preferences):u._preferences,m._valids=_.merge(m._valids,u._valids,u._invalids),m._invalids=_.merge(m._invalids,u._invalids,u._valids);for(const y of u._singleRules.keys())m._singleRules.has(y)&&(m._rules=m._rules.filter(x=>x.keep||x.name!==y),m._singleRules.delete(y));for(const y of u._rules)u._definition.rules[y.method].multi||m._singleRules.set(y.name,y),m._rules.push(y);if(m._flags.empty&&u._flags.empty){m._flags.empty=m._flags.empty.concat(u._flags.empty);const y=Object.assign({},u._flags);delete y.empty,d(m._flags,y)}else if(u._flags.empty){m._flags.empty=u._flags.empty;const y=Object.assign({},u._flags);delete y.empty,d(m._flags,y)}else d(m._flags,u._flags);for(const y in u.$_terms){const x=u.$_terms[y];x?m.$_terms[y]?m.$_terms[y]=m.$_terms[y].concat(x):m.$_terms[y]=x.slice():m.$_terms[y]||(m.$_terms[y]=x)}return this.$_root._tracer&&this.$_root._tracer._combine(m,[this,u]),m.$_mutateRebuild()}extend(u){return a(!u.base,"Cannot extend type with another base"),t.type(this,u)}extract(u){return u=Array.isArray(u)?u:u.split("."),this._ids.reach(u)}fork(u,m){a(!this._inRuleset(),"Cannot fork inside a ruleset");let y=this;for(let x of[].concat(u))x=Array.isArray(x)?x:x.split("."),y=y._ids.fork(x,m,y);return y.$_temp.ruleset=!1,y}rule(u){const m=this._definition;n.assertOptions(u,Object.keys(m.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const y=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(y>=0&&y<this._rules.length,"Cannot apply rules to empty ruleset");const x=this.clone();for(let j=y;j<x._rules.length;++j){const S=x._rules[j],D=h(S);for(const C in u)m.modifiers[C](D,u[C]),a(D.name===S.name,"Cannot change rule name");x._rules[j]=D,x._singleRules.get(D.name)===S&&x._singleRules.set(D.name,D)}return x.$_temp.ruleset=!1,x.$_mutateRebuild()}get ruleset(){a(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const u=this.clone();return u.$_temp.ruleset=u._rules.length,u}get $(){return this.ruleset}tailor(u){u=[].concat(u),a(!this._inRuleset(),"Cannot tailor inside a ruleset");let m=this;if(this.$_terms.alterations)for(const{target:y,adjuster:x}of this.$_terms.alterations)u.includes(y)&&(m=x(m),a(n.isSchema(m),"Alteration adjuster for",y,"failed to return a schema object"));return m=m.$_modify({each:y=>y.tailor(u),ref:!1}),m.$_temp.ruleset=!1,m.$_mutateRebuild()}tracer(){return f.location?f.location(this):this}validate(u,m){return g.entry(u,this,m)}validateAsync(u,m){return g.entryAsync(u,this,m)}$_addRule(u){typeof u=="string"&&(u={name:u}),a(u&&typeof u=="object","Invalid options"),a(u.name&&typeof u.name=="string","Invalid rule name");for(const S in u)a(S[0]!=="_","Cannot set private rule properties");const m=Object.assign({},u);m._resolve=[],m.method=m.method||m.name;const y=this._definition.rules[m.method],x=m.args;a(y,"Unknown rule",m.method);const j=this.clone();if(x){a(Object.keys(x).length===1||Object.keys(x).length===this._definition.rules[m.name].args.length,"Invalid rule definition for",this.type,m.name);for(const S in x){let D=x[S];if(y.argsByName){const C=y.argsByName.get(S);if(C.ref&&n.isResolvable(D))m._resolve.push(S),j.$_mutateRegister(D);else if(C.normalize&&(D=C.normalize(D),x[S]=D),C.assert){const L=n.validateArg(D,S,C);a(!L,L,"or reference")}}D!==void 0?x[S]=D:delete x[S]}}return y.multi||(j._ruleRemove(m.name,{clone:!1}),j._singleRules.set(m.name,m)),j.$_temp.ruleset===!1&&(j.$_temp.ruleset=null),y.priority?j._rules.unshift(m):j._rules.push(m),j}$_compile(u,m){return i.schema(this.$_root,u,m)}$_createError(u,m,y,x,j,S={}){const D=S.flags!==!1?this._flags:{},C=S.messages?s.merge(this._definition.messages,S.messages):this._definition.messages;return new r.Report(u,m,y,D,C,x,j)}$_getFlag(u){return this._flags[u]}$_getRule(u){return this._singleRules.get(u)}$_mapLabels(u){return u=Array.isArray(u)?u:u.split("."),this._ids.labels(u)}$_match(u,m,y,x){(y=Object.assign({},y)).abortEarly=!0,y._externals=!1,m.snapshot();const j=!g.validate(u,this,m,y,x).errors;return m.restore(),j}$_modify(u){return n.assertOptions(u,["each","once","ref","schema"]),o.schema(this,u)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(u,{source:m,name:y,path:x,key:j})=>{const S=this._definition[m][y]&&this._definition[m][y].register;S!==!1&&this.$_mutateRegister(u,{family:S,key:j})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(u,{family:m,key:y}={}){this._refs.register(u,m),this._ids.register(u,{key:y})}$_property(u){return this._definition.properties[u]}$_reach(u){return this._ids.reach(u)}$_rootReferences(){return this._refs.roots()}$_setFlag(u,m,y={}){a(u[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const x=this._definition.flags[u]||{};if(p(m,x.default)&&(m=void 0),p(m,this._flags[u]))return this;const j=y.clone!==!1?this.clone():this;return m!==void 0?(j._flags[u]=m,j.$_mutateRegister(m)):delete j._flags[u],u[0]!=="_"&&(j.$_temp.ruleset=!1),j}$_parent(u,...m){return this[u][n.symbols.parent].call(this,...m)}$_validate(u,m,y){return g.validate(u,this,m,y)}_assign(u){u.type=this.type,u.$_root=this.$_root,u.$_temp=Object.assign({},this.$_temp),u.$_temp.whens={},u._ids=this._ids.clone(),u._preferences=this._preferences,u._valids=this._valids&&this._valids.clone(),u._invalids=this._invalids&&this._invalids.clone(),u._rules=this._rules.slice(),u._singleRules=h(this._singleRules,{shallow:!0}),u._refs=this._refs.clone(),u._flags=Object.assign({},this._flags),u._cache=null,u.$_terms={};for(const m in this.$_terms)u.$_terms[m]=this.$_terms[m]?this.$_terms[m].slice():null;u.$_super={};for(const m in this.$_super)u.$_super[m]=this._super[m].bind(u);return u}_bare(){const u=this.clone();u._reset();const m=u._definition.terms;for(const y in m){const x=m[y];u.$_terms[y]=x.init}return u.$_mutateRebuild()}_default(u,m,y={}){return n.assertOptions(y,"literal"),a(m!==void 0,"Missing",u,"value"),a(typeof m=="function"||!y.literal,"Only function value supports literal option"),typeof m=="function"&&y.literal&&(m={[n.symbols.literal]:!0,literal:m}),this.$_setFlag(u,m)}_generate(u,m,y){if(!this.$_terms.whens)return{schema:this};const x=[],j=[];for(let C=0;C<this.$_terms.whens.length;++C){const L=this.$_terms.whens[C];if(L.concat){x.push(L.concat),j.push(`${C}.concat`);continue}const T=L.ref?L.ref.resolve(u,m,y):u,N=L.is?[L]:L.switch,q=j.length;for(let M=0;M<N.length;++M){const{is:P,then:F,otherwise:W}=N[M],V=`${C}${L.switch?"."+M:""}`;if(P.$_match(T,m.nest(P,`${V}.is`),y)){if(F){const Z=m.localize([...m.path,`${V}.then`],m.ancestors,m.schemas),{schema:ne,id:J}=F._generate(u,Z,y);x.push(ne),j.push(`${V}.then${J?`(${J})`:""}`);break}}else if(W){const Z=m.localize([...m.path,`${V}.otherwise`],m.ancestors,m.schemas),{schema:ne,id:J}=W._generate(u,Z,y);x.push(ne),j.push(`${V}.otherwise${J?`(${J})`:""}`);break}}if(L.break&&j.length>q)break}const S=j.join(", ");if(m.mainstay.tracer.debug(m,"rule","when",S),!S)return{schema:this};if(!m.mainstay.tracer.active&&this.$_temp.whens[S])return{schema:this.$_temp.whens[S],id:S};let D=this;this._definition.generate&&(D=this._definition.generate(this,u,m,y));for(const C of x)D=D.concat(C);return this.$_root._tracer&&this.$_root._tracer._combine(D,[this,...x]),this.$_temp.whens[S]=D,{schema:D,id:S}}_inner(u,m,y={}){a(!this._inRuleset(),`Cannot set ${u} inside a ruleset`);const x=this.clone();return x.$_terms[u]&&!y.override||(x.$_terms[u]=[]),y.single?x.$_terms[u].push(m):x.$_terms[u].push(...m),x.$_temp.ruleset=!1,x}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(u,m={}){if(!this._singleRules.has(u))return this;const y=m.clone!==!1?this.clone():this;y._singleRules.delete(u);const x=[];for(let j=0;j<y._rules.length;++j){const S=y._rules[j];S.name!==u||S.keep?x.push(S):y._inRuleset()&&j<y.$_temp.ruleset&&--y.$_temp.ruleset}return y._rules=x,y}_values(u,m){n.verifyFlat(u,m.slice(1,-1));const y=this.clone(),x=u[0]===n.symbols.override;if(x&&(u=u.slice(1)),!y[m]&&u.length?y[m]=new _:x&&(y[m]=u.length?new _:null,y.$_mutateRebuild()),!y[m])return y;x&&y[m].override();for(const j of u){a(j!==void 0,"Cannot call allow/valid/invalid with undefined"),a(j!==n.symbols.override,"Override must be the first value");const S=m==="_invalids"?"_valids":"_invalids";y[S]&&(y[S].remove(j),y[S].length||(a(m==="_valids"||!y._flags.only,"Setting invalid value",j,"leaves schema rejecting all values due to previous valid rule"),y[S]=null)),y[m].add(j,y._refs)}return y}}};v.Base.prototype[n.symbols.any]={version:n.version,compile:i.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,$.exports=new v.Base},8652:($,w,b)=>{const a=b(375),h=b(8571),p=b(8160),d={max:1e3,supported:new Set(["undefined","boolean","number","string"])};w.provider={provision:e=>new d.Cache(e)},d.Cache=class{constructor(e={}){p.assertOptions(e,["max"]),a(e.max===void 0||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||d.max,this._map=new Map,this._list=new d.List}get length(){return this._map.size}set(e,n){if(e!==null&&!d.supported.has(typeof e))return;let i=this._map.get(e);if(i)return i.value=n,void this._list.first(i);i=this._list.unshift({key:e,value:n}),this._map.set(e,i),this._compact()}get(e){const n=this._map.get(e);if(n)return this._list.first(n),h(n.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},d.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:n,prev:i}=e;return n.prev=i,i&&(i.next=n),e===this.tail&&(this.tail=n),e.prev=null,e.next=null,e}}},8160:($,w,b)=>{const a=b(375),h=b(7916),p=b(5934);let d,e;const n={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)?)?)?)?$/};w.version=p.version,w.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},w.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")},w.assertOptions=function(i,r,t="Options"){a(i&&typeof i=="object"&&!Array.isArray(i),"Options must be of type object");const l=Object.keys(i).filter(s=>!r.includes(s));a(l.length===0,`${t} contain unknown keys: ${l}`)},w.checkPreferences=function(i){e=e||b(3378);const r=e.preferences.validate(i);if(r.error)throw new h([r.error.details[0].message])},w.compare=function(i,r,t){switch(t){case"=":return i===r;case">":return i>r;case"<":return i<r;case">=":return i>=r;case"<=":return i<=r}},w.default=function(i,r){return i===void 0?r:i},w.isIsoDate=function(i){return n.isoDate.test(i)},w.isNumber=function(i){return typeof i=="number"&&!isNaN(i)},w.isResolvable=function(i){return!!i&&(i[w.symbols.ref]||i[w.symbols.template])},w.isSchema=function(i,r={}){const t=i&&i[w.symbols.any];return!!t&&(a(r.legacy||t.version===w.version,"Cannot mix different versions of joi schemas"),!0)},w.isValues=function(i){return i[w.symbols.values]},w.limit=function(i){return Number.isSafeInteger(i)&&i>=0},w.preferences=function(i,r){d=d||b(6914),i=i||{},r=r||{};const t=Object.assign({},i,r);return r.errors&&i.errors&&(t.errors=Object.assign({},i.errors,r.errors),t.errors.wrap=Object.assign({},i.errors.wrap,r.errors.wrap)),r.messages&&(t.messages=d.compile(r.messages,i.messages)),delete t[w.symbols.prefs],t},w.tryWithPath=function(i,r,t={}){try{return i()}catch(l){throw l.path!==void 0?l.path=r+"."+l.path:l.path=r,t.append&&(l.message=`${l.message} (${l.path})`),l}},w.validateArg=function(i,r,{assert:t,message:l}){if(w.isSchema(t)){const s=t.validate(i);return s.error?s.error.message:void 0}if(!t(i))return r?`${r} ${l}`:l},w.verifyFlat=function(i,r){for(const t of i)a(!Array.isArray(t),"Method no longer accepts array arguments:",r)}},3292:($,w,b)=>{const a=b(375),h=b(8160),p=b(6133),d={};w.schema=function(e,n,i={}){h.assertOptions(i,["appendPath","override"]);try{return d.schema(e,n,i)}catch(r){throw i.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},d.schema=function(e,n,i){a(n!==void 0,"Invalid undefined schema"),Array.isArray(n)&&(a(n.length,"Invalid empty array schema"),n.length===1&&(n=n[0]));const r=(t,...l)=>i.override!==!1?t.valid(e.override,...l):t.valid(...l);if(d.simple(n))return r(e,n);if(typeof n=="function")return e.custom(n);if(a(typeof n=="object","Invalid schema content:",typeof n),h.isResolvable(n))return r(e,n);if(h.isSchema(n))return n;if(Array.isArray(n)){for(const t of n)if(!d.simple(t))return e.alternatives().try(...n);return r(e,...n)}return n instanceof RegExp?e.string().regex(n):n instanceof Date?r(e.date(),n):(a(Object.getPrototypeOf(n)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(n))},w.ref=function(e,n){return p.isRef(e)?e:p.create(e,n)},w.compile=function(e,n,i={}){h.assertOptions(i,["legacy"]);const r=n&&n[h.symbols.any];if(r)return a(i.legacy||r.version===h.version,"Cannot mix different versions of joi schemas:",r.version,h.version),n;if(typeof n!="object"||!i.legacy)return w.schema(e,n,{appendPath:!0});const t=d.walk(n);return t?t.compile(t.root,n):w.schema(e,n,{appendPath:!0})},d.walk=function(e){if(typeof e!="object")return null;if(Array.isArray(e)){for(const i of e){const r=d.walk(i);if(r)return r}return null}const n=e[h.symbols.any];if(n)return{root:e[n.root],compile:n.compile};a(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const i in e){const r=d.walk(e[i]);if(r)return r}return null},d.simple=function(e){return e===null||["boolean","string","number"].includes(typeof e)},w.when=function(e,n,i){if(i===void 0&&(a(n&&typeof n=="object","Missing options"),i=n,n=p.create(".")),Array.isArray(i)&&(i={switch:i}),h.assertOptions(i,["is","not","then","otherwise","switch","break"]),h.isSchema(n))return a(i.is===void 0,'"is" can not be used with a schema condition'),a(i.not===void 0,'"not" can not be used with a schema condition'),a(i.switch===void 0,'"switch" can not be used with a schema condition'),d.condition(e,{is:n,then:i.then,otherwise:i.otherwise,break:i.break});if(a(p.isRef(n)||typeof n=="string","Invalid condition:",n),a(i.not===void 0||i.is===void 0,'Cannot combine "is" with "not"'),i.switch===void 0){let t=i;i.not!==void 0&&(t={is:i.not,then:i.otherwise,otherwise:i.then,break:i.break});let l=t.is!==void 0?e.$_compile(t.is):e.$_root.invalid(null,!1,0,"").required();return a(t.then!==void 0||t.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(t.break===void 0||t.then===void 0||t.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),i.is===void 0||p.isRef(i.is)||h.isSchema(i.is)||(l=l.required()),d.condition(e,{ref:w.ref(n),is:l,then:t.then,otherwise:t.otherwise,break:t.break})}a(Array.isArray(i.switch),'"switch" must be an array'),a(i.is===void 0,'Cannot combine "switch" with "is"'),a(i.not===void 0,'Cannot combine "switch" with "not"'),a(i.then===void 0,'Cannot combine "switch" with "then"');const r={ref:w.ref(n),switch:[],break:i.break};for(let t=0;t<i.switch.length;++t){const l=i.switch[t],s=t===i.switch.length-1;h.assertOptions(l,s?["is","then","otherwise"]:["is","then"]),a(l.is!==void 0,'Switch statement missing "is"'),a(l.then!==void 0,'Switch statement missing "then"');const o={is:e.$_compile(l.is),then:e.$_compile(l.then)};if(p.isRef(l.is)||h.isSchema(l.is)||(o.is=o.is.required()),s){a(i.otherwise===void 0||l.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const c=i.otherwise!==void 0?i.otherwise:l.otherwise;c!==void 0&&(a(r.break===void 0,"Cannot specify both otherwise and break"),o.otherwise=e.$_compile(c))}r.switch.push(o)}return r},d.condition=function(e,n){for(const i of["then","otherwise"])n[i]===void 0?delete n[i]:n[i]=e.$_compile(n[i]);return n}},6354:($,w,b)=>{const a=b(5688),h=b(8160),p=b(3328);w.Report=class{constructor(d,e,n,i,r,t,l){if(this.code=d,this.flags=i,this.messages=r,this.path=t.path,this.prefs=l,this.state=t,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=w.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const s=this.path[this.path.length-1];typeof s!="object"&&(this.local.key=s)}}_setTemplate(d){if(this.template=d,!this.flags.label&&this.path.length===0){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const d=this.code;if(!this.prefs.errors.render)return this.code;const e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${d}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.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(d,e){return w.template(this.value,d,e||this.code,this.state,this.prefs)}},w.path=function(d){let e="";for(const n of d)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e},w.template=function(d,e,n,i,r){if(!e)return;if(p.isTemplate(e))return n!=="root"?e:null;let t=r.errors.language;if(h.isResolvable(t)&&(t=t.resolve(d,i,r)),t&&e[t]){if(e[t][n]!==void 0)return e[t][n];if(e[t]["*"]!==void 0)return e[t]["*"]}return e[n]?e[n]:e["*"]},w.label=function(d,e,n,i){if(d.label)return d.label;if(!n.errors.label)return"";let r=e.path;return n.errors.label==="key"&&e.path.length>1&&(r=e.path.slice(-1)),w.path(r)||w.template(null,n.messages,"root",e,n)||i&&w.template(null,i,"root",e,n)||"value"},w.process=function(d,e,n){if(!d)return null;const{override:i,message:r,details:t}=w.details(d);if(i)return i;if(n.errors.stack)return new w.ValidationError(r,t,e);const l=Error.stackTraceLimit;Error.stackTraceLimit=0;const s=new w.ValidationError(r,t,e);return Error.stackTraceLimit=l,s},w.details=function(d,e={}){let n=[];const i=[];for(const r of d){if(r instanceof Error){if(e.override!==!1)return{override:r};const l=r.toString();n.push(l),i.push({message:l,type:"override",context:{error:r}});continue}const t=r.toString();n.push(t),i.push({message:t,path:r.path.filter(l=>typeof l!="object"),type:r.code,context:r.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:i}},w.ValidationError=class extends Error{constructor(d,e,n){super(d),this._original=n,this.details=e}static isError(d){return d instanceof w.ValidationError}},w.ValidationError.prototype.isJoi=!0,w.ValidationError.prototype.name="ValidationError",w.ValidationError.prototype.annotate=a.error},8901:($,w,b)=>{const a=b(375),h=b(8571),p=b(8160),d=b(6914),e={};w.type=function(n,i){const r=Object.getPrototypeOf(n),t=h(r),l=n._assign(Object.create(t)),s=Object.assign({},i);delete s.base,t._definition=s;const o=r._definition||{};s.messages=d.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),l.type=s.type,s.flags=Object.assign({},o.flags,s.flags);const c=Object.assign({},o.terms);if(s.terms)for(const v in s.terms){const u=s.terms[v];a(l.$_terms[v]===void 0,"Invalid term override for",s.type,v),l.$_terms[v]=u.init,c[v]=u}s.terms=c,s.args||(s.args=o.args),s.prepare=e.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=e.coerce(s.coerce,o.coerce),s.validate=e.validate(s.validate,o.validate);const f=Object.assign({},o.rules);if(s.rules)for(const v in s.rules){const u=s.rules[v];a(typeof u=="object","Invalid rule definition for",s.type,v);let m=u.method;if(m===void 0&&(m=function(){return this.$_addRule(v)}),m&&(a(!t[v],"Rule conflict in",s.type,v),t[v]=m),a(!f[v],"Rule conflict in",s.type,v),f[v]=u,u.alias){const y=[].concat(u.alias);for(const x of y)t[x]=u.method}u.args&&(u.argsByName=new Map,u.args=u.args.map(y=>(typeof y=="string"&&(y={name:y}),a(!u.argsByName.has(y.name),"Duplicated argument name",y.name),p.isSchema(y.assert)&&(y.assert=y.assert.strict().label(y.name)),u.argsByName.set(y.name,y),y)))}s.rules=f;const g=Object.assign({},o.modifiers);if(s.modifiers)for(const v in s.modifiers){a(!t[v],"Rule conflict in",s.type,v);const u=s.modifiers[v];a(typeof u=="function","Invalid modifier definition for",s.type,v);const m=function(y){return this.rule({[v]:y})};t[v]=m,g[v]=u}if(s.modifiers=g,s.overrides){t._super=r,l.$_super={};for(const v in s.overrides)a(r[v],"Cannot override missing",v),s.overrides[v][p.symbols.parent]=r[v],l.$_super[v]=r[v].bind(l);Object.assign(t,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);const _=Object.assign({},o.manifest,s.manifest);return _.build=e.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=_,s.rebuild=e.rebuild(s.rebuild,o.rebuild),l},e.build=function(n,i){return n&&i?function(r,t){return i(n(r,t),t)}:n||i},e.coerce=function(n,i){return n&&i?{from:n.from&&i.from?[...new Set([...n.from,...i.from])]:null,method(r,t){let l;if((!i.from||i.from.includes(typeof r))&&(l=i.method(r,t),l)){if(l.errors||l.value===void 0)return l;r=l.value}if(!n.from||n.from.includes(typeof r)){const s=n.method(r,t);if(s)return s}return l}}:n||i},e.prepare=function(n,i){return n&&i?function(r,t){const l=n(r,t);if(l){if(l.errors||l.value===void 0)return l;r=l.value}return i(r,t)||l}:n||i},e.rebuild=function(n,i){return n&&i?function(r){i(r),n(r)}:n||i},e.validate=function(n,i){return n&&i?function(r,t){const l=i(r,t);if(l){if(l.errors&&(!Array.isArray(l.errors)||l.errors.length))return l;r=l.value}return n(r,t)||l}:n||i}},5107:($,w,b)=>{const a=b(375),h=b(8571),p=b(8652),d=b(8160),e=b(3292),n=b(6354),i=b(8901),r=b(9708),t=b(6133),l=b(3328),s=b(1152);let o;const c={types:{alternatives:b(4946),any:b(8068),array:b(546),boolean:b(4937),date:b(7500),function:b(390),link:b(8785),number:b(3832),object:b(8966),string:b(7417),symbol:b(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const f={_types:new Set(Object.keys(c.types))};for(const g of f._types)f[g]=function(..._){return a(!_.length||["alternatives","link","object"].includes(g),"The",g,"type does not allow arguments"),c.generate(this,c.types[g],_)};for(const g of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])f[g]=function(..._){return this.any()[g](..._)};Object.assign(f,c.methods);for(const g in c.aliases){const _=c.aliases[g];f[g]=f[_]}return f.x=f.expression,s.setup&&s.setup(f),f}};c.methods={ValidationError:n.ValidationError,version:d.version,cache:p.provider,assert(f,g,..._){c.assert(f,g,!0,_)},attempt:(f,g,..._)=>c.assert(f,g,!1,_),build(f){return a(typeof r.build=="function","Manifest functionality disabled"),r.build(this,f)},checkPreferences(f){d.checkPreferences(f)},compile(f,g){return e.compile(this,f,g)},defaults(f){a(typeof f=="function","modifier must be a function");const g=Object.assign({},this);for(const _ of g._types){const v=f(g[_]());a(d.isSchema(v),"modifier must return a valid schema object"),g[_]=function(...u){return c.generate(this,v,u)}}return g},expression:(...f)=>new l(...f),extend(...f){d.verifyFlat(f,"extend"),o=o||b(3378),a(f.length,"You need to provide at least one extension"),this.assert(f,o.extensions);const g=Object.assign({},this);g._types=new Set(g._types);for(let _ of f){typeof _=="function"&&(_=_(g)),this.assert(_,o.extension);const v=c.expandExtension(_,g);for(const u of v){a(g[u.type]===void 0||g._types.has(u.type),"Cannot override name",u.type);const m=u.base||this.any(),y=i.type(m,u);g._types.add(u.type),g[u.type]=function(...x){return c.generate(this,y,x)}}}return g},isError:n.ValidationError.isError,isExpression:l.isTemplate,isRef:t.isRef,isSchema:d.isSchema,in:(...f)=>t.in(...f),override:d.symbols.override,ref:(...f)=>t.create(...f),types(){const f={};for(const g of this._types)f[g]=this[g]();for(const g in c.aliases)f[g]=this[g]();return f}},c.assert=function(f,g,_,v){const u=v[0]instanceof Error||typeof v[0]=="string"?v[0]:null,m=u!==null?v[1]:v[0],y=g.validate(f,d.preferences({errors:{stack:!0}},m||{}));let x=y.error;if(!x)return y.value;if(u instanceof Error)throw u;const j=_&&typeof x.annotate=="function"?x.annotate():x.message;throw x instanceof n.ValidationError==0&&(x=h(x)),x.message=u?`${u} ${j}`:j,x},c.generate=function(f,g,_){return a(f,"Must be invoked on a Joi instance."),g.$_root=f,g._definition.args&&_.length?g._definition.args(g,..._):g},c.expandExtension=function(f,g){if(typeof f.type=="string")return[f];const _=[];for(const v of g._types)if(f.type.test(v)){const u=Object.assign({},f);u.type=v,u.base=g[v](),_.push(u)}return _},$.exports=c.root()},6914:($,w,b)=>{const a=b(375),h=b(8571),p=b(3328);w.compile=function(d,e){if(typeof d=="string")return a(!e,"Cannot set single message string"),new p(d);if(p.isTemplate(d))return a(!e,"Cannot set single message template"),d;a(typeof d=="object"&&!Array.isArray(d),"Invalid message options"),e=e?h(e):{};for(let n in d){const i=d[n];if(n==="root"||p.isTemplate(i)){e[n]=i;continue}if(typeof i=="string"){e[n]=new p(i);continue}a(typeof i=="object"&&!Array.isArray(i),"Invalid message for",n);const r=n;for(n in e[r]=e[r]||{},i){const t=i[n];n==="root"||p.isTemplate(t)?e[r][n]=t:(a(typeof t=="string","Invalid message for",n,"in",r),e[r][n]=new p(t))}}return e},w.decompile=function(d){const e={};for(let n in d){const i=d[n];if(n==="root"){e.root=i;continue}if(p.isTemplate(i)){e[n]=i.describe({compact:!0});continue}const r=n;for(n in e[r]={},i){const t=i[n];n!=="root"?e[r][n]=t.describe({compact:!0}):e[r].root=t}}return e},w.merge=function(d,e){if(!d)return w.compile(e);if(!e)return d;if(typeof e=="string")return new p(e);if(p.isTemplate(e))return e;const n=h(d);for(let i in e){const r=e[i];if(i==="root"||p.isTemplate(r)){n[i]=r;continue}if(typeof r=="string"){n[i]=new p(r);continue}a(typeof r=="object"&&!Array.isArray(r),"Invalid message for",i);const t=i;for(i in n[t]=n[t]||{},r){const l=r[i];i==="root"||p.isTemplate(l)?n[t][i]=l:(a(typeof l=="string","Invalid message for",i,"in",t),n[t][i]=new p(l))}}return n}},2294:($,w,b)=>{const a=b(375),h=b(8160),p=b(6133),d={};w.Ids=d.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new d.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[n,i]of e._byId.entries())a(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,i);for(const[n,i]of e._byKey.entries())a(!this._byId.has(n),"Schema key conflicts with existing id:",n),this._byKey.set(n,i)}fork(e,n,i){const r=this._collect(e);r.push({schema:i});const t=r.shift();let l={id:t.id,schema:n(t.schema)};a(h.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const s of r)l={id:s.id,schema:d.fork(s.schema,l.id,l.schema)};return l.schema}labels(e,n=[]){const i=e[0],r=this._get(i);if(!r)return[...n,...e].join(".");const t=e.slice(1);return n=[...n,r.schema._flags.label||i],t.length?r.schema._ids.labels(t,n):n.join(".")}reach(e,n=[]){const i=e[0],r=this._get(i);a(r,"Schema does not contain path",[...n,...e].join("."));const t=e.slice(1);return t.length?r.schema._ids.reach(t,[...n,i]):r.schema}register(e,{key:n}={}){if(!e||!h.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const i=e._flags.id;if(i){const r=this._byId.get(i);a(!r||r.schema===e,"Cannot add different schemas with the same id:",i),a(!this._byKey.has(i),"Schema id conflicts with existing key:",i),this._byId.set(i,{schema:e,id:i})}n&&(a(!this._byKey.has(n),"Schema already contains key:",n),a(!this._byId.has(n),"Schema key conflicts with existing id:",n),this._byKey.set(n,{schema:e,id:n}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,n=[],i=[]){const r=e[0],t=this._get(r);a(t,"Schema does not contain path",[...n,...e].join(".")),i=[t,...i];const l=e.slice(1);return l.length?t.schema._ids._collect(l,[...n,r],i):i}_get(e){return this._byId.get(e)||this._byKey.get(e)}},d.fork=function(e,n,i){const r=w.schema(e,{each:(t,{key:l})=>{if(n===(t._flags.id||l))return i},ref:!1});return r?r.$_mutateRebuild():e},w.schema=function(e,n){let i;for(const r in e._flags){if(r[0]==="_")continue;const t=d.scan(e._flags[r],{source:"flags",name:r},n);t!==void 0&&(i=i||e.clone(),i._flags[r]=t)}for(let r=0;r<e._rules.length;++r){const t=e._rules[r],l=d.scan(t.args,{source:"rules",name:t.name},n);if(l!==void 0){i=i||e.clone();const s=Object.assign({},t);s.args=l,i._rules[r]=s,i._singleRules.get(t.name)===t&&i._singleRules.set(t.name,s)}}for(const r in e.$_terms){if(r[0]==="_")continue;const t=d.scan(e.$_terms[r],{source:"terms",name:r},n);t!==void 0&&(i=i||e.clone(),i.$_terms[r]=t)}return i},d.scan=function(e,n,i,r,t){const l=r||[];if(e===null||typeof e!="object")return;let s;if(Array.isArray(e)){for(let o=0;o<e.length;++o){const c=n.source==="terms"&&n.name==="keys"&&e[o].key,f=d.scan(e[o],n,i,[o,...l],c);f!==void 0&&(s=s||e.slice(),s[o]=f)}return s}if(i.schema!==!1&&h.isSchema(e)||i.ref!==!1&&p.isRef(e)){const o=i.each(e,{...n,path:l,key:t});return o===e?void 0:o}for(const o in e){if(o[0]==="_")continue;const c=d.scan(e[o],n,i,[o,...l],t);c!==void 0&&(s=s||Object.assign({},e),s[o]=c)}return s}},6133:($,w,b)=>{const a=b(375),h=b(8571),p=b(9621),d=b(8160);let e;const n={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};w.create=function(i,r={}){a(typeof i=="string","Invalid reference key:",i),d.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const t=Object.assign({},n.defaults,r);delete t.prefix;const l=t.separator,s=n.context(i,l,r.prefix);if(t.type=s.type,i=s.key,t.type==="value")if(s.root&&(a(!l||i[0]!==l,"Cannot specify relative path with root prefix"),t.ancestor="root",i||(i=null)),l&&l===i)i=null,t.ancestor=0;else if(t.ancestor!==void 0)a(!l||!i||i[0]!==l,"Cannot combine prefix with ancestor option");else{const[o,c]=n.ancestor(i,l);c&&(i=i.slice(c))===""&&(i=null),t.ancestor=o}return t.path=l?i===null?[]:i.split(l):[i],new n.Ref(t)},w.in=function(i,r={}){return w.create(i,{...r,in:!0})},w.isRef=function(i){return!!i&&!!i[d.symbols.ref]},n.Ref=class{constructor(i){a(typeof i=="object","Invalid reference construction"),d.assertOptions(i,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(i.separator)||typeof i.separator=="string"&&i.separator.length===1,"Invalid separator"),a(!i.adjust||typeof i.adjust=="function","options.adjust must be a function"),a(!i.map||Array.isArray(i.map),"options.map must be an array"),a(!i.map||!i.adjust,"Cannot set both map and adjust options"),Object.assign(this,n.defaults,i),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(i,r,t,l,s={}){return a(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(t.context,r,s):this.type==="local"?this._resolve(l,r,s):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,s):(a(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,s)):this._resolve(i,r,s)}_resolve(i,r,t){let l;if(this.type==="value"&&r.mainstay.shadow&&t.shadow!==!1&&(l=r.mainstay.shadow.get(this.absolute(r))),l===void 0&&(l=p(i,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(l=this.adjust(l)),this.map){const s=this.map.get(l);s!==void 0&&(l=s)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,l),l}toString(){return this.display}absolute(i){return[...i.path.slice(0,-this.ancestor),...this.path]}clone(){return new n.Ref(this)}describe(){const i={path:this.path};this.type!=="value"&&(i.type=this.type),this.separator!=="."&&(i.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(i.ancestor=this.ancestor),this.map&&(i.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(i[r]=this[r]);return this.in!==!1&&(i.in=!0),{ref:i}}updateDisplay(){const i=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${i}`);if(!this.separator)return void(this.display=`ref:${i}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${i}`);if(this.ancestor==="root")return void(this.display=`ref:root:${i}`);if(this.ancestor===1)return void(this.display=`ref:${i||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${i||""}`}},n.Ref.prototype[d.symbols.ref]=!0,w.build=function(i){return(i=Object.assign({},n.defaults,i)).type==="value"&&i.ancestor===void 0&&(i.ancestor=1),new n.Ref(i)},n.context=function(i,r,t={}){if(i=i.trim(),t){const l=t.global===void 0?"$":t.global;if(l!==r&&i.startsWith(l))return{key:i.slice(l.length),type:"global"};const s=t.local===void 0?"#":t.local;if(s!==r&&i.startsWith(s))return{key:i.slice(s.length),type:"local"};const o=t.root===void 0?"/":t.root;if(o!==r&&i.startsWith(o))return{key:i.slice(o.length),type:"value",root:!0}}return{key:i,type:"value"}},n.ancestor=function(i,r){if(!r)return[1,0];if(i[0]!==r)return[1,0];if(i[1]!==r)return[0,1];let t=2;for(;i[t]===r;)++t;return[t-1,t]},w.toSibling=0,w.toParent=1,w.Manager=class{constructor(){this.refs=[]}register(i,r){if(i)if(r=r===void 0?w.toParent:r,Array.isArray(i))for(const t of i)this.register(t,r);else if(d.isSchema(i))for(const t of i._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else w.isRef(i)&&i.type==="value"&&i.ancestor-r>=0&&this.refs.push({ancestor:i.ancestor-r,root:i.root}),e=e||b(3328),e.isTemplate(i)&&this.register(i.refs(),r)}get length(){return this.refs.length}clone(){const i=new w.Manager;return i.refs=h(this.refs),i}reset(){this.refs=[]}roots(){return this.refs.filter(i=>!i.ancestor).map(i=>i.root)}}},3378:($,w,b)=>{const a=b(5107),h={};h.wrap=a.string().min(1).max(2).allow(!1),w.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:h.wrap,array:h.wrap,string:h.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),h.nameRx=/^[a-zA-Z0-9]\w*$/,h.rule=a.object({alias:a.array().items(a.string().pattern(h.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(h.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),w.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(h.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(h.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(h.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(h.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(h.nameRx,h.rule),terms:a.object().pattern(h.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),w.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),h.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},h.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),h.desc.buffer,h.desc.func,h.desc.ref,h.desc.regex,h.desc.special,h.desc.template,h.desc.value,a.link("/")]),h.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),h.desc.buffer,h.desc.func,h.desc.override,h.desc.ref,h.desc.regex,h.desc.template,h.desc.value),h.desc.messages=a.object().pattern(/.+/,[a.string(),h.desc.template,a.object().pattern(/.+/,[a.string(),h.desc.template])]),w.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:h.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),h.desc.ref],wrap:{label:h.wrap,array:h.wrap}},externals:a.boolean(),messages:h.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:h.desc.values,invalid:h.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),h.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:h.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:($,w,b)=>{const a=b(8571),h=b(9621),p=b(8160),d={value:Symbol("value")};$.exports=d.State=class{constructor(e,n,i){this.path=e,this.ancestors=n,this.mainstay=i.mainstay,this.schemas=i.schemas,this.debug=null}localize(e,n=null,i=null){const r=new d.State(e,n,this);return i&&r.schemas&&(r.schemas=[d.schemas(i),...r.schemas]),r}nest(e,n){const i=new d.State(this.path,this.ancestors,this);return i.schemas=i.schemas&&[d.schemas(e),...i.schemas],i.debug=n,i}shadow(e,n){this.mainstay.shadow=this.mainstay.shadow||new d.Shadow,this.mainstay.shadow.set(this.path,e,n)}snapshot(){this.mainstay.shadow&&(this._snapshot=a(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()}},d.schemas=function(e){return p.isSchema(e)?{schema:e}:e},d.Shadow=class{constructor(){this._values=null}set(e,n,i){if(!e.length||i==="strip"&&typeof e[e.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const l=e[t];let s=r.get(l);s||(s=new Map,r.set(l,s)),r=s}r[d.value]=n}get(e){const n=this.node(e);if(n)return n[d.value]}node(e){if(this._values)return h(this._values,e,{iterables:!0})}override(e,n){if(!this._values)return;const i=e.slice(0,-1),r=e[e.length-1],t=h(this._values,i,{iterables:!0});n?t.set(r,n):t&&t.delete(r)}}},3328:($,w,b)=>{const a=b(375),h=b(8571),p=b(5277),d=b(1447),e=b(8160),n=b(6354),i=b(6133),r={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}};$.exports=r.Template=class{constructor(t,l){if(a(typeof t=="string","Template source must be a string"),a(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,l){const{functions:s,...o}=l;this._settings=Object.keys(o).length?h(o):void 0,this._functions=s,this._functions&&(a(Object.keys(this._functions).every(c=>typeof c=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(c=>typeof c=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const t=r.encode(this.source),l=r.split(t);let s=!1;const o=[],c=l.shift();c&&o.push(c);for(const f of l){const g=f[0]!=="{",_=g?"}":"}}",v=f.indexOf(_);if(v===-1||f[1]==="{"){o.push(`{${r.decode(f)}`);continue}let u=f.slice(g?0:1,v);const m=u[0]===":";m&&(u=u.slice(1));const y=this._ref(r.decode(u),{raw:g,wrapped:m});o.push(y),typeof y!="string"&&(s=!0);const x=f.slice(v+_.length);x&&o.push(r.decode(x))}s?this._template=o:this.rendered=o.join("")}static date(t,l){return r.dateFormat[l.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;const l={template:this.source};return this._settings&&(l.options=this._settings),this._functions&&(l.functions=this._functions),l}static build(t){return new r.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return!!t&&!!t[e.symbols.template]}refs(){if(!this._template)return;const t=[];for(const l of this._template)typeof l!="string"&&t.push(...l.refs);return t}resolve(t,l,s,o){return this._template&&this._template.length===1?this._part(this._template[0],t,l,s,o,{}):this.render(t,l,s,o)}_part(t,...l){return t.ref?t.ref.resolve(...l):t.formula.evaluate(l)}render(t,l,s,o,c={}){if(!this.isDynamic())return this.rendered;const f=[];for(const g of this._template)if(typeof g=="string")f.push(g);else{const _=this._part(g,t,l,s,o,c),v=r.stringify(_,t,l,s,o,c);if(v!==void 0){const u=g.raw||(c.errors&&c.errors.escapeHtml)===!1?v:p(v);f.push(r.wrap(u,g.wrapped&&s.errors.wrap.label))}}return f.join("")}_ref(t,{raw:l,wrapped:s}){const o=[],c=g=>{const _=i.create(g,this._settings);return o.push(_),v=>{const u=_.resolve(...v);return u!==void 0?u:null}};try{const g=this._functions?{...r.functions,...this._functions}:r.functions;var f=new d.Parser(t,{reference:c,functions:g,constants:r.constants})}catch(g){throw g.message=`Invalid template variable "${t}" fails due to: ${g.message}`,g}if(f.single){if(f.single.type==="reference"){const g=o[0];return{ref:g,raw:l,refs:o,wrapped:s||g.type==="local"&&g.key==="label"}}return r.stringify(f.single.value)}return{formula:f,raw:l,refs:o}}toString(){return this.source}},r.Template.prototype[e.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(t){return t.replace(/\\(\{+)/g,(l,s)=>r.opens.slice(0,s.length)).replace(/\\(\}+)/g,(l,s)=>r.closes.slice(0,s.length))},r.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(t){const l=[];let s="";for(let o=0;o<t.length;++o){const c=t[o];if(c==="{"){let f="";for(;o+1<t.length&&t[o+1]==="{";)f+="{",++o;l.push(s),s=f}else s+=c}return l.push(s),l},r.wrap=function(t,l){return l?l.length===1?`${l}${t}${l}`:`${l[0]}${t}${l[1]}`:t},r.stringify=function(t,l,s,o,c,f={}){const g=typeof t,_=o&&o.errors&&o.errors.wrap||{};let v=!1;if(i.isRef(t)&&t.render&&(v=t.in,t=t.resolve(l,s,o,c,{in:t.in,...f})),t===null)return"null";if(g==="string")return r.wrap(t,f.arrayItems&&_.string);if(g==="number"||g==="function"||g==="symbol")return t.toString();if(g!=="object")return JSON.stringify(t);if(t instanceof Date)return r.Template.date(t,o);if(t instanceof Map){const m=[];for(const[y,x]of t.entries())m.push(`${y.toString()} -> ${x.toString()}`);t=m}if(!Array.isArray(t))return t.toString();const u=[];for(const m of t)u.push(r.stringify(m,l,s,o,c,{arrayItems:!0,...f}));return r.wrap(u.join(", "),!v&&_.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(t,l,s)=>t?l:s,length:t=>typeof t=="string"?t.length:t&&typeof t=="object"?Array.isArray(t)?t.length:Object.keys(t).length:null,msg(t){const[l,s,o,c,f]=this,g=f.messages;if(!g)return"";const _=n.template(l,g[0],t,s,o)||n.template(l,g[1],t,s,o);return _?_.render(l,s,o,c,f):""},number:t=>typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}},4946:($,w,b)=>{const a=b(375),h=b(1687),p=b(8068),d=b(8160),e=b(3292),n=b(6354),i=b(6133),r={};$.exports=p.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:i.toSibling}},args:(t,...l)=>l.length===1&&Array.isArray(l[0])?t.try(...l[0]):t.try(...l),validate(t,l){const{schema:s,error:o,state:c,prefs:f}=l;if(s._flags.match){const _=[],v=[];for(let m=0;m<s.$_terms.matches.length;++m){const y=s.$_terms.matches[m],x=c.nest(y.schema,`match.${m}`);x.snapshot();const j=y.schema.$_validate(t,x,f);j.errors?(v.push(j.errors),x.restore()):(_.push(j.value),x.commit())}if(_.length===0)return{errors:o("alternatives.any",{details:v.map(m=>n.details(m,{override:!1}))})};if(s._flags.match==="one")return _.length===1?{value:_[0]}:{errors:o("alternatives.one")};if(_.length!==s.$_terms.matches.length)return{errors:o("alternatives.all",{details:v.map(m=>n.details(m,{override:!1}))})};const u=m=>m.$_terms.matches.some(y=>y.schema.type==="object"||y.schema.type==="alternatives"&&u(y.schema));return u(s)?{value:_.reduce((m,y)=>h(m,y,{mergeArrays:!1}))}:{value:_[_.length-1]}}const g=[];for(let _=0;_<s.$_terms.matches.length;++_){const v=s.$_terms.matches[_];if(v.schema){const y=c.nest(v.schema,`match.${_}`);y.snapshot();const x=v.schema.$_validate(t,y,f);if(!x.errors)return y.commit(),x;y.restore(),g.push({schema:v.schema,reports:x.errors});continue}const u=v.ref?v.ref.resolve(t,c,f):t,m=v.is?[v]:v.switch;for(let y=0;y<m.length;++y){const x=m[y],{is:j,then:S,otherwise:D}=x,C=`match.${_}${v.switch?"."+y:""}`;if(j.$_match(u,c.nest(j,`${C}.is`),f)){if(S)return S.$_validate(t,c.nest(S,`${C}.then`),f)}else if(D)return D.$_validate(t,c.nest(D,`${C}.otherwise`),f)}}return r.errors(g,l)},rules:{conditional:{method(t,l){a(!this._flags._endedSwitch,"Unreachable condition"),a(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),a(l.break===void 0,"Cannot use break option with alternatives conditional");const s=this.clone(),o=e.when(s,t,l),c=o.is?[o]:o.switch;for(const f of c)if(f.then&&f.otherwise){s.$_setFlag("_endedSwitch",!0,{clone:!1});break}return s.$_terms.matches.push(o),s.$_mutateRebuild()}},match:{method(t){if(a(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(const l of this.$_terms.matches)a(l.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){a(t.length,"Missing alternative schemas"),d.verifyFlat(t,"try"),a(!this._flags._endedSwitch,"Unreachable condition");const l=this.clone();for(const s of t)l.$_terms.matches.push({schema:l.$_compile(s)});return l.$_mutateRebuild()}}},overrides:{label(t){return this.$_parent("label",t).$_modify({each:(l,s)=>s.path[0]!=="is"&&typeof l._flags.label!="string"?l.label(t):void 0,ref:!1})}},rebuild(t){t.$_modify({each:l=>{d.isSchema(l)&&l.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(t,l){if(l.matches)for(const s of l.matches){const{schema:o,ref:c,is:f,not:g,then:_,otherwise:v}=s;t=o?t.try(o):c?t.conditional(c,{is:f,then:_,not:g,otherwise:v,switch:s.switch}):t.conditional(f,{then:_,otherwise:v})}return t}},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}}"}}),r.errors=function(t,{error:l,state:s}){if(!t.length)return{errors:l("alternatives.any")};if(t.length===1)return{errors:t[0].reports};const o=new Set,c=[];for(const{reports:f,schema:g}of t){if(f.length>1)return r.unmatched(t,l);const _=f[0];if(_ instanceof n.Report==0)return r.unmatched(t,l);if(_.state.path.length!==s.path.length){c.push({type:g.type,report:_});continue}if(_.code==="any.only"){for(const m of _.local.valids)o.add(m);continue}const[v,u]=_.code.split(".");u==="base"?o.add(v):c.push({type:g.type,report:_})}return c.length?c.length===1?{errors:c[0].report}:r.unmatched(t,l):{errors:l("alternatives.types",{types:[...o]})}},r.unmatched=function(t,l){const s=[];for(const o of t)s.push(...o.reports);return{errors:l("alternatives.match",n.details(s,{override:!1}))}}},8068:($,w,b)=>{const a=b(375),h=b(7629),p=b(8160),d=b(6914);$.exports=h.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,n){return a(typeof e=="function","Method must be a function"),a(n===void 0||n&&typeof n=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:n}})},validate(e,n,{method:i}){try{return i(e,n)}catch(r){return n.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){a(p.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const n=this.clone();return n.$_terms.shared=n.$_terms.shared||[],n.$_terms.shared.push(e),n.$_mutateRegister(e),n}},warning:{method(e,n){return a(e&&typeof e=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:n},warn:!0})},validate:(e,n,{code:i,local:r})=>n.error(i,r),args:["code","local"],multi:!0}},modifiers:{keep(e,n=!0){e.keep=n},message(e,n){e.message=d.compile(n)},warn(e,n=!0){e.warn=n}},manifest:{build(e,n){for(const i in n){const r=n[i];if(["examples","externals","metas","notes","tags"].includes(i))for(const t of r)e=e[i.slice(0,-1)](t);else if(i!=="alterations")if(i!=="whens"){if(i==="shared")for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:l,is:s,not:o,then:c,otherwise:f,concat:g}=t;e=g?e.concat(g):l?e.when(l,{is:s,not:o,then:c,otherwise:f,switch:t.switch,break:t.break}):e.when(s,{then:c,otherwise:f,break:t.break})}else{const t={};for(const{target:l,adjuster:s}of r)t[l]=s;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:($,w,b)=>{const a=b(375),h=b(9474),p=b(9621),d=b(8068),e=b(8160),n=b(3292),i={};$.exports=d.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(r,{schema:t,state:l,prefs:s}){if(!Array.isArray(r))return;const o=t.$_getRule("sort");return o?i.sort(t,r,o.args.options,l,s):void 0}},validate(r,{schema:t,error:l}){if(!Array.isArray(r)){if(t._flags.single){const s=[r];return s[e.symbols.arraySingle]=!0,{value:s}}return{errors:l("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:r}});return t.$_mutateRegister(r),t},validate(r,{state:t,prefs:l,error:s},{schema:o}){const c=[r,...t.ancestors];for(let g=0;g<r.length;++g){const _=t.localize([...t.path,g],c,o);if(o.$_match(r[g],_,l))return r}const f=o._flags.label;return f?s("array.hasKnown",{patternLabel:f}):s("array.hasUnknown",null)},multi:!0},items:{method(...r){e.verifyFlat(r,"items");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});t.$_terms.items.push(s)}return t.$_mutateRebuild()},validate(r,{schema:t,error:l,state:s,prefs:o,errorsArray:c}){const f=t.$_terms._requireds.slice(),g=t.$_terms.ordered.slice(),_=[...t.$_terms._inclusions,...f],v=!r[e.symbols.arraySingle];delete r[e.symbols.arraySingle];const u=c();let m=r.length;for(let y=0;y<m;++y){const x=r[y];let j=!1,S=!1;const D=v?y:new Number(y),C=[...s.path,D];if(!t._flags.sparse&&x===void 0){if(u.push(l("array.sparse",{key:D,path:C,pos:y,value:void 0},s.localize(C))),o.abortEarly)return u;g.shift();continue}const L=[r,...s.ancestors];for(const M of t.$_terms._exclusions)if(M.$_match(x,s.localize(C,L,M),o,{presence:"ignore"})){if(u.push(l("array.excludes",{pos:y,value:x},s.localize(C))),o.abortEarly)return u;j=!0,g.shift();break}if(j)continue;if(t.$_terms.ordered.length){if(g.length){const M=g.shift(),P=M.$_validate(x,s.localize(C,L,M),o);if(P.errors){if(u.push(...P.errors),o.abortEarly)return u}else if(M._flags.result==="strip")i.fastSplice(r,y),--y,--m;else{if(!t._flags.sparse&&P.value===void 0){if(u.push(l("array.sparse",{key:D,path:C,pos:y,value:void 0},s.localize(C))),o.abortEarly)return u;continue}r[y]=P.value}continue}if(!t.$_terms.items.length){if(u.push(l("array.orderedLength",{pos:y,limit:t.$_terms.ordered.length})),o.abortEarly)return u;break}}const T=[];let N=f.length;for(let M=0;M<N;++M){const P=s.localize(C,L,f[M]);P.snapshot();const F=f[M].$_validate(x,P,o);if(T[M]=F,!F.errors){if(P.commit(),r[y]=F.value,S=!0,i.fastSplice(f,M),--M,--N,!t._flags.sparse&&F.value===void 0&&(u.push(l("array.sparse",{key:D,path:C,pos:y,value:void 0},s.localize(C))),o.abortEarly))return u;break}P.restore()}if(S)continue;const q=o.stripUnknown&&!!o.stripUnknown.arrays||!1;N=_.length;for(const M of _){let P;const F=f.indexOf(M);if(F!==-1)P=T[F];else{const W=s.localize(C,L,M);if(W.snapshot(),P=M.$_validate(x,W,o),!P.errors){W.commit(),M._flags.result==="strip"?(i.fastSplice(r,y),--y,--m):t._flags.sparse||P.value!==void 0?r[y]=P.value:(u.push(l("array.sparse",{key:D,path:C,pos:y,value:void 0},s.localize(C))),j=!0),S=!0;break}W.restore()}if(N===1){if(q){i.fastSplice(r,y),--y,--m,S=!0;break}if(u.push(...P.errors),o.abortEarly)return u;j=!0;break}}if(!j&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!S){if(q){i.fastSplice(r,y),--y,--m;continue}if(u.push(l("array.includes",{pos:y,value:x},s.localize(C))),o.abortEarly)return u}}return f.length&&i.fillMissedErrors(t,u,f,r,s,o),g.length&&(i.fillOrderedErrors(t,u,g,r,s,o),u.length||i.fillDefault(g,r,s,o)),u.length?u:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,t,{limit:l},{name:s,operator:o,args:c})=>e.compare(r.length,l,o)?r:t.error("array."+s,{limit:c.limit,value:r}),args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"}]},max:{method(r){return this.$_addRule({name:"max",method:"length",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"length",args:{limit:r},operator:">="})}},ordered:{method(...r){e.verifyFlat(r,"ordered");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});i.validateSingle(s,t),t.$_mutateRegister(s),t.$_terms.ordered.push(s)}return t.$_mutateRebuild()}},single:{method(r){const t=r===void 0||!!r;return a(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(r={}){e.assertOptions(r,["by","order"]);const t={order:r.order||"ascending"};return r.by&&(t.by=n.ref(r.by,{ancestor:0}),a(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(r,{error:t,state:l,prefs:s,schema:o},{options:c}){const{value:f,errors:g}=i.sort(o,r,c,l,s);if(g)return g;for(let _=0;_<r.length;++_)if(r[_]!==f[_])return t("array.sort",{order:c.order,by:c.by?c.by.key:"value"});return r},convert:!0},sparse:{method(r){const t=r===void 0||!!r;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(r,t={}){a(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),e.assertOptions(t,["ignoreUndefined","separator"]);const l={name:"unique",args:{options:t,comparator:r}};if(r)if(typeof r=="string"){const s=e.default(t.separator,".");l.path=s?r.split(s):[r]}else l.comparator=r;return this.$_addRule(l)},validate(r,{state:t,error:l,schema:s},{comparator:o,options:c},{comparator:f,path:g}){const _={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},v=f||h,u=c.ignoreUndefined;for(let m=0;m<r.length;++m){const y=g?p(r[m],g):r[m],x=f?_.custom:_[typeof y];if(a(x,"Failed to find unique map container for type",typeof y),x instanceof Map){const j=x.entries();let S;for(;!(S=j.next()).done;)if(v(S.value[0],y)){const D=t.localize([...t.path,m],[r,...t.ancestors]),C={pos:m,value:r[m],dupePos:S.value[1],dupeValue:r[S.value[1]]};return g&&(C.path=o),l("array.unique",C,D)}x.set(y,m)}else{if((!u||y!==void 0)&&x[y]!==void 0){const j={pos:m,value:r[m],dupePos:x[y],dupeValue:r[x[y]]};return g&&(j.path=o),l("array.unique",j,t.localize([...t.path,m],[r,...t.ancestors]))}x[y]=m}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,t)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const t of r.$_terms.items)i.validateSingle(t,r),t._flags.presence==="required"?r.$_terms._requireds.push(t):t._flags.presence==="forbidden"?r.$_terms._exclusions.push(t):r.$_terms._inclusions.push(t);for(const t of r.$_terms.ordered)i.validateSingle(t,r)},manifest:{build:(r,t)=>(t.items&&(r=r.items(...t.items)),t.ordered&&(r=r.ordered(...t.ordered)),r)},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"}}),i.fillMissedErrors=function(r,t,l,s,o,c){const f=[];let g=0;for(const _ of l){const v=_._flags.label;v?f.push(v):++g}f.length?g?t.push(r.$_createError("array.includesRequiredBoth",s,{knownMisses:f,unknownMisses:g},o,c)):t.push(r.$_createError("array.includesRequiredKnowns",s,{knownMisses:f},o,c)):t.push(r.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:g},o,c))},i.fillOrderedErrors=function(r,t,l,s,o,c){const f=[];for(const g of l)g._flags.presence==="required"&&f.push(g);f.length&&i.fillMissedErrors(r,t,f,s,o,c)},i.fillDefault=function(r,t,l,s){const o=[];let c=!0;for(let f=r.length-1;f>=0;--f){const g=r[f],_=[t,...l.ancestors],v=g.$_validate(void 0,l.localize(l.path,_,g),s).value;if(c){if(v===void 0)continue;c=!1}o.unshift(v)}o.length&&t.push(...o)},i.fastSplice=function(r,t){let l=t;for(;l<r.length;)r[l++]=r[l];--r.length},i.validateSingle=function(r,t){(r.type==="array"||r._flags._arrayItems)&&(a(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},i.sort=function(r,t,l,s,o){const c=l.order==="ascending"?1:-1,f=-1*c,g=c,_=(v,u)=>{let m=i.compare(v,u,f,g);if(m!==null||(l.by&&(v=l.by.resolve(v,s,o),u=l.by.resolve(u,s,o)),m=i.compare(v,u,f,g),m!==null))return m;const y=typeof v;if(y!==typeof u)throw r.$_createError("array.sort.mismatching",t,null,s,o);if(y!=="number"&&y!=="string")throw r.$_createError("array.sort.unsupported",t,{type:y},s,o);return y==="number"?(v-u)*c:v<u?f:g};try{return{value:t.slice().sort(_)}}catch(v){return{errors:v}}},i.compare=function(r,t,l,s){return r===t?0:r===void 0?1:t===void 0?-1:r===null?s:t===null?l:null}},4937:($,w,b)=>{const a=b(375),h=b(8068),p=b(8160),d=b(2036),e={isBool:function(n){return typeof n=="boolean"}};$.exports=h.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(n,{schema:i}){if(typeof n!="boolean"){if(typeof n=="string"){const r=i._flags.sensitive?n:n.toLowerCase();n=r==="true"||r!=="false"&&n}return typeof n!="boolean"&&(n=i.$_terms.truthy&&i.$_terms.truthy.has(n,null,null,!i._flags.sensitive)||(!i.$_terms.falsy||!i.$_terms.falsy.has(n,null,null,!i._flags.sensitive))&&n),{value:n}}},validate(n,{error:i}){if(typeof n!="boolean")return{value:n,errors:i("boolean.base")}},rules:{truthy:{method(...n){p.verifyFlat(n,"truthy");const i=this.clone();i.$_terms.truthy=i.$_terms.truthy||new d;for(let r=0;r<n.length;++r){const t=n[r];a(t!==void 0,"Cannot call truthy with undefined"),i.$_terms.truthy.add(t)}return i}},falsy:{method(...n){p.verifyFlat(n,"falsy");const i=this.clone();i.$_terms.falsy=i.$_terms.falsy||new d;for(let r=0;r<n.length;++r){const t=n[r];a(t!==void 0,"Cannot call falsy with undefined"),i.$_terms.falsy.add(t)}return i}},sensitive:{method(n=!0){return this.$_setFlag("sensitive",n)}}},cast:{number:{from:e.isBool,to:(n,i)=>n?1:0},string:{from:e.isBool,to:(n,i)=>n?"true":"false"}},manifest:{build:(n,i)=>(i.truthy&&(n=n.truthy(...i.truthy)),i.falsy&&(n=n.falsy(...i.falsy)),n)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:($,w,b)=>{const a=b(375),h=b(8068),p=b(8160),d=b(3328),e={isDate:function(n){return n instanceof Date}};$.exports=h.extend({type:"date",coerce:{from:["number","string"],method:(n,{schema:i})=>({value:e.parse(n,i._flags.format)||n})},validate(n,{schema:i,error:r,prefs:t}){if(n instanceof Date&&!isNaN(n.getTime()))return;const l=i._flags.format;return t.convert&&l&&typeof n=="string"?{value:n,errors:r("date.format",{format:l})}:{value:n,errors:r("date.base")}},rules:{compare:{method:!1,validate(n,i,{date:r},{name:t,operator:l,args:s}){const o=r==="now"?Date.now():r.getTime();return p.compare(n.getTime(),o,l)?n:i.error("date."+t,{limit:s.date,value:n})},args:[{name:"date",ref:!0,normalize:n=>n==="now"?n:e.parse(n),assert:n=>n!==null,message:"must have a valid date format"}]},format:{method(n){return a(["iso","javascript","unix"].includes(n),"Unknown date format",n),this.$_setFlag("format",n)}},greater:{method(n){return this.$_addRule({name:"greater",method:"compare",args:{date:n},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(n){return this.$_addRule({name:"less",method:"compare",args:{date:n},operator:"<"})}},max:{method(n){return this.$_addRule({name:"max",method:"compare",args:{date:n},operator:"<="})}},min:{method(n){return this.$_addRule({name:"min",method:"compare",args:{date:n},operator:">="})}},timestamp:{method(n="javascript"){return a(["javascript","unix"].includes(n),'"type" must be one of "javascript, unix"'),this.format(n)}}},cast:{number:{from:e.isDate,to:(n,i)=>n.getTime()},string:{from:e.isDate,to:(n,{prefs:i})=>d.date(n,i)}},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"}}),e.parse=function(n,i){if(n instanceof Date)return n;if(typeof n!="string"&&(isNaN(n)||!isFinite(n))||/^\s*$/.test(n))return null;if(i==="iso")return p.isIsoDate(n)?e.date(n.toString()):null;const r=n;if(typeof n=="string"&&/^[+-]?\d+(\.\d+)?$/.test(n)&&(n=parseFloat(n)),i){if(i==="javascript")return e.date(1*n);if(i==="unix")return e.date(1e3*n);if(typeof r=="string")return null}return e.date(n)},e.date=function(n){const i=new Date(n);return isNaN(i.getTime())?null:i}},390:($,w,b)=>{const a=b(375),h=b(7824);$.exports=h.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(p){return a(Number.isSafeInteger(p)&&p>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:p}})},validate:(p,d,{n:e})=>p.length===e?p:d.error("function.arity",{n:e})},class:{method(){return this.$_addRule("class")},validate:(p,d)=>/^\s*class\s/.test(p.toString())?p:d.error("function.class",{value:p})},minArity:{method(p){return a(Number.isSafeInteger(p)&&p>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:p}})},validate:(p,d,{n:e})=>p.length>=e?p:d.error("function.minArity",{n:e})},maxArity:{method(p){return a(Number.isSafeInteger(p)&&p>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:p}})},validate:(p,d,{n:e})=>p.length<=e?p:d.error("function.maxArity",{n:e})}},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:($,w,b)=>{const a=b(978),h=b(375),p=b(8571),d=b(3652),e=b(8068),n=b(8160),i=b(3292),r=b(6354),t=b(6133),l=b(3328),s={renameDefaults:{alias:!1,multiple:!1,override:!1}};$.exports=e.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(o,c)=>o.keys(c),validate(o,{schema:c,error:f,state:g,prefs:_}){if(!o||typeof o!==c.$_property("typeof")||Array.isArray(o))return{value:o,errors:f("object.base",{type:c.$_property("typeof")})};if(!(c.$_terms.renames||c.$_terms.dependencies||c.$_terms.keys||c.$_terms.patterns||c.$_terms.externals))return;o=s.clone(o,_);const v=[];if(c.$_terms.renames&&!s.rename(c,o,g,_,v))return{value:o,errors:v};if(!c.$_terms.keys&&!c.$_terms.patterns&&!c.$_terms.dependencies)return{value:o,errors:v};const u=new Set(Object.keys(o));if(c.$_terms.keys){const m=[o,...g.ancestors];for(const y of c.$_terms.keys){const x=y.key,j=o[x];u.delete(x);const S=g.localize([...g.path,x],m,y),D=y.schema.$_validate(j,S,_);if(D.errors){if(_.abortEarly)return{value:o,errors:D.errors};D.value!==void 0&&(o[x]=D.value),v.push(...D.errors)}else y.schema._flags.result==="strip"||D.value===void 0&&j!==void 0?delete o[x]:D.value!==void 0&&(o[x]=D.value)}}if(u.size||c._flags._hasPatternMatch){const m=s.unknown(c,o,u,v,g,_);if(m)return m}if(c.$_terms.dependencies)for(const m of c.$_terms.dependencies){if(m.key!==null&&s.isPresent(m.options)(m.key.resolve(o,g,_,null,{shadow:!1}))===!1)continue;const y=s.dependencies[m.rel](c,m,o,g,_);if(y){const x=c.$_createError(y.code,o,y.context,g,_);if(_.abortEarly)return{value:o,errors:x};v.push(x)}}return{value:o,errors:v}},rules:{and:{method(...o){return n.verifyFlat(o,"and"),s.dependency(this,"and",null,o)}},append:{method(o){return o==null||Object.keys(o).length===0?this:this.keys(o)}},assert:{method(o,c,f){l.isTemplate(o)||(o=i.ref(o)),h(f===void 0||typeof f=="string","Message must be a string"),c=this.$_compile(c,{appendPath:!0});const g=this.$_addRule({name:"assert",args:{subject:o,schema:c,message:f}});return g.$_mutateRegister(o),g.$_mutateRegister(c),g},validate(o,{error:c,prefs:f,state:g},{subject:_,schema:v,message:u}){const m=_.resolve(o,g,f),y=t.isRef(_)?_.absolute(g):[];return v.$_match(m,g.localize(y,[o,...g.ancestors],v),f)?o:c("object.assert",{subject:_,message:u})},args:["subject","schema","message"],multi:!0},instance:{method(o,c){return h(typeof o=="function","constructor must be a function"),c=c||o.name,this.$_addRule({name:"instance",args:{constructor:o,name:c}})},validate:(o,c,{constructor:f,name:g})=>o instanceof f?o:c.error("object.instance",{type:g,value:o}),args:["constructor","name"]},keys:{method(o){h(o===void 0||typeof o=="object","Object schema must be a valid object"),h(!n.isSchema(o),"Object schema cannot be a joi schema");const c=this.clone();if(o)if(Object.keys(o).length){c.$_terms.keys=c.$_terms.keys?c.$_terms.keys.filter(f=>!o.hasOwnProperty(f.key)):new s.Keys;for(const f in o)n.tryWithPath(()=>c.$_terms.keys.push({key:f,schema:this.$_compile(o[f])}),f)}else c.$_terms.keys=new s.Keys;else c.$_terms.keys=null;return c.$_mutateRebuild()}},length:{method(o){return this.$_addRule({name:"length",args:{limit:o},operator:"="})},validate:(o,c,{limit:f},{name:g,operator:_,args:v})=>n.compare(Object.keys(o).length,f,_)?o:c.error("object."+g,{limit:v.limit,value:o}),args:[{name:"limit",ref:!0,assert:n.limit,message:"must be a positive integer"}]},max:{method(o){return this.$_addRule({name:"max",method:"length",args:{limit:o},operator:"<="})}},min:{method(o){return this.$_addRule({name:"min",method:"length",args:{limit:o},operator:">="})}},nand:{method(...o){return n.verifyFlat(o,"nand"),s.dependency(this,"nand",null,o)}},or:{method(...o){return n.verifyFlat(o,"or"),s.dependency(this,"or",null,o)}},oxor:{method(...o){return s.dependency(this,"oxor",null,o)}},pattern:{method(o,c,f={}){const g=o instanceof RegExp;g||(o=this.$_compile(o,{appendPath:!0})),h(c!==void 0,"Invalid rule"),n.assertOptions(f,["fallthrough","matches"]),g&&h(!o.flags.includes("g")&&!o.flags.includes("y"),"pattern should not use global or sticky mode"),c=this.$_compile(c,{appendPath:!0});const _=this.clone();_.$_terms.patterns=_.$_terms.patterns||[];const v={[g?"regex":"schema"]:o,rule:c};return f.matches&&(v.matches=this.$_compile(f.matches),v.matches.type!=="array"&&(v.matches=v.matches.$_root.array().items(v.matches)),_.$_mutateRegister(v.matches),_.$_setFlag("_hasPatternMatch",!0,{clone:!1})),f.fallthrough&&(v.fallthrough=!0),_.$_terms.patterns.push(v),_.$_mutateRegister(c),_}},ref:{method(){return this.$_addRule("ref")},validate:(o,c)=>t.isRef(o)?o:c.error("object.refType",{value:o})},regex:{method(){return this.$_addRule("regex")},validate:(o,c)=>o instanceof RegExp?o:c.error("object.regex",{value:o})},rename:{method(o,c,f={}){h(typeof o=="string"||o instanceof RegExp,"Rename missing the from argument"),h(typeof c=="string"||c instanceof l,"Invalid rename to argument"),h(c!==o,"Cannot rename key to same name:",o),n.assertOptions(f,["alias","ignoreUndefined","override","multiple"]);const g=this.clone();g.$_terms.renames=g.$_terms.renames||[];for(const _ of g.$_terms.renames)h(_.from!==o,"Cannot rename the same key multiple times");return c instanceof l&&g.$_mutateRegister(c),g.$_terms.renames.push({from:o,to:c,options:a(s.renameDefaults,f)}),g}},schema:{method(o="any"){return this.$_addRule({name:"schema",args:{type:o}})},validate:(o,c,{type:f})=>!n.isSchema(o)||f!=="any"&&o.type!==f?c.error("object.schema",{type:f}):o},unknown:{method(o){return this.$_setFlag("unknown",o!==!1)}},with:{method(o,c,f={}){return s.dependency(this,"with",o,c,f)}},without:{method(o,c,f={}){return s.dependency(this,"without",o,c,f)}},xor:{method(...o){return n.verifyFlat(o,"xor"),s.dependency(this,"xor",null,o)}}},overrides:{default(o,c){return o===void 0&&(o=n.symbols.deepDefault),this.$_parent("default",o,c)}},rebuild(o){if(o.$_terms.keys){const c=new d.Sorter;for(const f of o.$_terms.keys)n.tryWithPath(()=>c.add(f,{after:f.schema.$_rootReferences(),group:f.key}),f.key);o.$_terms.keys=new s.Keys(...c.nodes)}},manifest:{build(o,c){if(c.keys&&(o=o.keys(c.keys)),c.dependencies)for(const{rel:f,key:g=null,peers:_,options:v}of c.dependencies)o=s.dependency(o,f,g,_,v);if(c.patterns)for(const{regex:f,schema:g,rule:_,fallthrough:v,matches:u}of c.patterns)o=o.pattern(f||g,_,{fallthrough:v,matches:u});if(c.renames)for(const{from:f,to:g,options:_}of c.renames)o=o.rename(f,g,_);return o}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),s.clone=function(o,c){if(typeof o=="object"){if(c.nonEnumerables)return p(o,{shallow:!0});const g=Object.create(Object.getPrototypeOf(o));return Object.assign(g,o),g}const f=function(...g){return o.apply(this,g)};return f.prototype=p(o.prototype),Object.defineProperty(f,"name",{value:o.name,writable:!1}),Object.defineProperty(f,"length",{value:o.length,writable:!1}),Object.assign(f,o),f},s.dependency=function(o,c,f,g,_){h(f===null||typeof f=="string",c,"key must be a strings"),_||(_=g.length>1&&typeof g[g.length-1]=="object"?g.pop():{}),n.assertOptions(_,["separator","isPresent"]),g=[].concat(g);const v=n.default(_.separator,"."),u=[];for(const y of g)h(typeof y=="string",c,"peers must be strings"),u.push(i.ref(y,{separator:v,ancestor:0,prefix:!1}));f!==null&&(f=i.ref(f,{separator:v,ancestor:0,prefix:!1}));const m=o.clone();return m.$_terms.dependencies=m.$_terms.dependencies||[],m.$_terms.dependencies.push(new s.Dependency(c,f,u,g,_)),m},s.dependencies={and(o,c,f,g,_){const v=[],u=[],m=c.peers.length,y=s.isPresent(c.options);for(const x of c.peers)y(x.resolve(f,g,_,null,{shadow:!1}))===!1?v.push(x.key):u.push(x.key);if(v.length!==m&&u.length!==m)return{code:"object.and",context:{present:u,presentWithLabels:s.keysToLabels(o,u),missing:v,missingWithLabels:s.keysToLabels(o,v)}}},nand(o,c,f,g,_){const v=[],u=s.isPresent(c.options);for(const x of c.peers)u(x.resolve(f,g,_,null,{shadow:!1}))&&v.push(x.key);if(v.length!==c.peers.length)return;const m=c.paths[0],y=c.paths.slice(1);return{code:"object.nand",context:{main:m,mainWithLabel:s.keysToLabels(o,m),peers:y,peersWithLabels:s.keysToLabels(o,y)}}},or(o,c,f,g,_){const v=s.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,g,_,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:c.paths,peersWithLabels:s.keysToLabels(o,c.paths)}}},oxor(o,c,f,g,_){const v=[],u=s.isPresent(c.options);for(const y of c.peers)u(y.resolve(f,g,_,null,{shadow:!1}))&&v.push(y.key);if(!v.length||v.length===1)return;const m={peers:c.paths,peersWithLabels:s.keysToLabels(o,c.paths)};return m.present=v,m.presentWithLabels=s.keysToLabels(o,v),{code:"object.oxor",context:m}},with(o,c,f,g,_){const v=s.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,g,_,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:c.key.key,mainWithLabel:s.keysToLabels(o,c.key.key),peer:u.key,peerWithLabel:s.keysToLabels(o,u.key)}}},without(o,c,f,g,_){const v=s.isPresent(c.options);for(const u of c.peers)if(v(u.resolve(f,g,_,null,{shadow:!1})))return{code:"object.without",context:{main:c.key.key,mainWithLabel:s.keysToLabels(o,c.key.key),peer:u.key,peerWithLabel:s.keysToLabels(o,u.key)}}},xor(o,c,f,g,_){const v=[],u=s.isPresent(c.options);for(const y of c.peers)u(y.resolve(f,g,_,null,{shadow:!1}))&&v.push(y.key);if(v.length===1)return;const m={peers:c.paths,peersWithLabels:s.keysToLabels(o,c.paths)};return v.length===0?{code:"object.missing",context:m}:(m.present=v,m.presentWithLabels=s.keysToLabels(o,v),{code:"object.xor",context:m})}},s.keysToLabels=function(o,c){return Array.isArray(c)?c.map(f=>o.$_mapLabels(f)):o.$_mapLabels(c)},s.isPresent=function(o){return typeof o.isPresent=="function"?o.isPresent:c=>c!==void 0},s.rename=function(o,c,f,g,_){const v={};for(const u of o.$_terms.renames){const m=[],y=typeof u.from!="string";if(y)for(const x in c){if(c[x]===void 0&&u.options.ignoreUndefined||x===u.to)continue;const j=u.from.exec(x);j&&m.push({from:x,to:u.to,match:j})}else!Object.prototype.hasOwnProperty.call(c,u.from)||c[u.from]===void 0&&u.options.ignoreUndefined||m.push(u);for(const x of m){const j=x.from;let S=x.to;if(S instanceof l&&(S=S.render(c,f,g,x.match)),j!==S){if(!u.options.multiple&&v[S]&&(_.push(o.$_createError("object.rename.multiple",c,{from:j,to:S,pattern:y},f,g)),g.abortEarly)||Object.prototype.hasOwnProperty.call(c,S)&&!u.options.override&&!v[S]&&(_.push(o.$_createError("object.rename.override",c,{from:j,to:S,pattern:y},f,g)),g.abortEarly))return!1;c[j]===void 0?delete c[S]:c[S]=c[j],v[S]=!0,u.options.alias||delete c[j]}}}return!0},s.unknown=function(o,c,f,g,_,v){if(o.$_terms.patterns){let u=!1;const m=o.$_terms.patterns.map(x=>{if(x.matches)return u=!0,[]}),y=[c,..._.ancestors];for(const x of f){const j=c[x],S=[..._.path,x];for(let D=0;D<o.$_terms.patterns.length;++D){const C=o.$_terms.patterns[D];if(C.regex){const N=C.regex.test(x);if(_.mainstay.tracer.debug(_,"rule",`pattern.${D}`,N?"pass":"error"),!N)continue}else if(!C.schema.$_match(x,_.nest(C.schema,`pattern.${D}`),v))continue;f.delete(x);const L=_.localize(S,y,{schema:C.rule,key:x}),T=C.rule.$_validate(j,L,v);if(T.errors){if(v.abortEarly)return{value:c,errors:T.errors};g.push(...T.errors)}if(C.matches&&m[D].push(x),c[x]=T.value,!C.fallthrough)break}}if(u)for(let x=0;x<m.length;++x){const j=m[x];if(!j)continue;const S=o.$_terms.patterns[x].matches,D=_.localize(_.path,y,S),C=S.$_validate(j,D,v);if(C.errors){const L=r.details(C.errors,{override:!1});L.matches=j;const T=o.$_createError("object.pattern.match",c,L,_,v);if(v.abortEarly)return{value:c,errors:T};g.push(T)}}}if(f.size&&(o.$_terms.keys||o.$_terms.patterns)){if(v.stripUnknown&&!o._flags.unknown||v.skipFunctions){const u=!(!v.stripUnknown||v.stripUnknown!==!0&&!v.stripUnknown.objects);for(const m of f)u?(delete c[m],f.delete(m)):typeof c[m]=="function"&&f.delete(m)}if(!n.default(o._flags.unknown,v.allowUnknown))for(const u of f){const m=_.localize([..._.path,u],[]),y=o.$_createError("object.unknown",c[u],{child:u},m,v,{flags:!1});if(v.abortEarly)return{value:c,errors:y};g.push(y)}}},s.Dependency=class{constructor(o,c,f,g,_){this.rel=o,this.key=c,this.peers=f,this.paths=g,this.options=_}describe(){const o={rel:this.rel,peers:this.paths};return this.key!==null&&(o.key=this.key.key),this.peers[0].separator!=="."&&(o.options={...o.options,separator:this.peers[0].separator}),this.options.isPresent&&(o.options={...o.options,isPresent:this.options.isPresent}),o}},s.Keys=class extends Array{concat(o){const c=this.slice(),f=new Map;for(let g=0;g<c.length;++g)f.set(c[g].key,g);for(const g of o){const _=g.key,v=f.get(_);v!==void 0?c[v]={key:_,schema:c[v].schema.concat(g.schema)}:c.push(g)}return c}}},8785:($,w,b)=>{const a=b(375),h=b(8068),p=b(8160),d=b(3292),e=b(6354),n={};$.exports=h.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(i,r)=>i.ref(r),validate(i,{schema:r,state:t,prefs:l}){a(r.$_terms.link,"Uninitialized link schema");const s=n.generate(r,i,t,l),o=r.$_terms.link[0].ref;return s.$_validate(i,t.nest(s,`link:${o.display}:${s.type}`),l)},generate:(i,r,t,l)=>n.generate(i,r,t,l),rules:{ref:{method(i){a(!this.$_terms.link,"Cannot reinitialize schema"),i=d.ref(i),a(i.type==="value"||i.type==="local","Invalid reference type:",i.type),a(i.type==="local"||i.ancestor==="root"||i.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:i}],r}},relative:{method(i=!0){return this.$_setFlag("relative",i)}}},overrides:{concat(i){a(this.$_terms.link,"Uninitialized link schema"),a(p.isSchema(i),"Invalid schema object"),a(i.type!=="link","Cannot merge type link with another link");const r=this.clone();return r.$_terms.whens||(r.$_terms.whens=[]),r.$_terms.whens.push({concat:i}),r.$_mutateRebuild()}},manifest:{build:(i,r)=>(a(r.link,"Invalid link description missing link"),i.ref(r.link))}}),n.generate=function(i,r,t,l){let s=t.mainstay.links.get(i);if(s)return s._generate(r,t,l).schema;const o=i.$_terms.link[0].ref,{perspective:c,path:f}=n.perspective(o,t);n.assert(c,"which is outside of schema boundaries",o,i,t,l);try{s=f.length?c.$_reach(f):c}catch{n.assert(!1,"to non-existing schema",o,i,t,l)}return n.assert(s.type!=="link","which is another link",o,i,t,l),i._flags.relative||t.mainstay.links.set(i,s),s._generate(r,t,l).schema},n.perspective=function(i,r){if(i.type==="local"){for(const{schema:t,key:l}of r.schemas){if((t._flags.id||l)===i.path[0])return{perspective:t,path:i.path.slice(1)};if(t.$_terms.shared){for(const s of t.$_terms.shared)if(s._flags.id===i.path[0])return{perspective:s,path:i.path.slice(1)}}}return{perspective:null,path:null}}return i.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:i.path}:{perspective:r.schemas[i.ancestor]&&r.schemas[i.ancestor].schema,path:i.path}},n.assert=function(i,r,t,l,s,o){i||a(!1,`"${e.label(l._flags,s,o)}" contains link reference "${t.display}" ${r}`)}},3832:($,w,b)=>{const a=b(375),h=b(8068),p=b(8160),d={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const n=e.toString(),i=n.indexOf("."),r=n.indexOf("e");return(i<0?0:(r<0?n.length:r)-i-1)+(r<0?0:Math.max(0,-parseInt(n.slice(r+1))))}};$.exports=h.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:n,error:i}){if(!e.match(d.numberRx))return;e=e.trim();const r={value:parseFloat(e)};if(r.value===0&&(r.value=0),!n._flags.unsafe)if(e.match(/e/i)){if(d.extractSignificantDigits(e)!==d.extractSignificantDigits(String(r.value)))return r.errors=i("number.unsafe"),r}else{const t=r.value.toString();if(t.match(/e/i))return r;if(t!==d.normalizeDecimal(e))return r.errors=i("number.unsafe"),r}return r}},validate(e,{schema:n,error:i,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:i("number.infinity")};if(!p.isNumber(e))return{value:e,errors:i("number.base")};const t={value:e};if(r.convert){const l=n.$_getRule("precision");if(l){const s=Math.pow(10,l.args.limit);t.value=Math.round(t.value*s)/s}}return t.value===0&&(t.value=0),!n._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.errors=i("number.unsafe")),t},rules:{compare:{method:!1,validate:(e,n,{limit:i},{name:r,operator:t,args:l})=>p.compare(e,i,t)?e:n.error("number."+r,{limit:l.limit,value:e}),args:[{name:"limit",ref:!0,assert:p.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,n)=>Math.trunc(e)-e==0?e:n.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 n=typeof e=="number"?d.decimalPlaces(e):null,i=Math.pow(10,n);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:n,pfactor:i}})},validate:(e,n,{base:i,baseDecimalPlace:r,pfactor:t},l)=>d.decimalPlaces(e)>r?n.error("number.multiple",{multiple:l.args.base,value:e}):Math.round(t*e)%Math.round(t*i)==0?e:n.error("number.multiple",{multiple:l.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>typeof e=="number"&&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,n)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:n.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return a(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,n,{limit:i}){const r=e.toString().match(d.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=i?e:n.error("number.precision",{limit:i,value:e})},convert:!0},sign:{method(e){return a(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,n,{sign:i})=>i==="negative"&&e<0||i==="positive"&&e>0?e:n.error(`number.${i}`)},unsafe:{method(e=!0){return a(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>typeof e=="number",to:(e,n)=>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"}}),d.extractSignificantDigits=function(e){return e.replace(d.exponentialPartRegex,"").replace(d.dotRegex,"").replace(d.trailingZerosRegex,"").replace(d.leadingSignAndZerosRegex,"")},d.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+$/,"")),e==="-0"?"0":e}},8966:($,w,b)=>{const a=b(7824);$.exports=a.extend({type:"object",cast:{map:{from:h=>h&&typeof h=="object",to:(h,p)=>new Map(Object.entries(h))}}})},7417:($,w,b)=>{const a=b(375),h=b(5380),p=b(1745),d=b(9959),e=b(6064),n=b(9926),i=b(5752),r=b(8068),t=b(8160),l={tlds:n instanceof Set&&{tlds:{allow:n,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:d.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"]};$.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(s,{schema:o,state:c,prefs:f}){const g=o.$_getRule("normalize");g&&(s=s.normalize(g.args.form));const _=o.$_getRule("case");_&&(s=_.args.direction==="upper"?s.toLocaleUpperCase():s.toLocaleLowerCase());const v=o.$_getRule("trim");if(v&&v.args.enabled&&(s=s.trim()),o.$_terms.replacements)for(const m of o.$_terms.replacements)s=s.replace(m.pattern,m.replacement);const u=o.$_getRule("hex");if(u&&u.args.options.byteAligned&&s.length%2!=0&&(s=`0${s}`),o.$_getRule("isoDate")){const m=l.isoDate(s);m&&(s=m)}if(o._flags.truncate){const m=o.$_getRule("max");if(m){let y=m.args.limit;if(t.isResolvable(y)&&(y=y.resolve(s,c,f),!t.limit(y)))return{value:s,errors:o.$_createError("any.ref",y,{ref:m.args.limit,arg:"limit",reason:"must be a positive integer"},c,f)};s=s.slice(0,y)}}return{value:s}}},validate(s,{schema:o,error:c}){if(typeof s!="string")return{value:s,errors:c("string.base")};if(s===""){const f=o.$_getRule("min");return f&&f.args.limit===0?void 0:{value:s,errors:c("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(s,o)=>/^[a-zA-Z0-9]+$/.test(s)?s:o.error("string.alphanum")},base64:{method(s={}){return t.assertOptions(s,["paddingRequired","urlSafe"]),s={urlSafe:!1,paddingRequired:!0,...s},a(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof s.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:s}})},validate:(s,o,{options:c})=>l.base64Regex[c.paddingRequired][c.urlSafe].test(s)?s:o.error("string.base64")},case:{method(s){return a(["lower","upper"].includes(s),"Invalid case:",s),this.$_addRule({name:"case",args:{direction:s}})},validate:(s,o,{direction:c})=>c==="lower"&&s===s.toLocaleLowerCase()||c==="upper"&&s===s.toLocaleUpperCase()?s:o.error(`string.${c}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(s,o){let c=s.length,f=0,g=1;for(;c--;){const _=s.charAt(c)*g;f+=_-9*(_>9),g^=3}return f>0&&f%10==0?s:o.error("string.creditCard")}},dataUri:{method(s={}){return t.assertOptions(s,["paddingRequired"]),s={paddingRequired:!0,...s},a(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:s}})},validate(s,o,{options:c}){const f=s.match(l.dataUriRegex);return f&&(!f[2]||f[2]!=="base64"||l.base64Regex[c.paddingRequired].false.test(f[3]))?s:o.error("string.dataUri")}},domain:{method(s){s&&t.assertOptions(s,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const o=l.addressOptions(s);return this.$_addRule({name:"domain",args:{options:s},address:o})},validate:(s,o,c,{address:f})=>h.isValid(s,f)?s:o.error("string.domain")},email:{method(s={}){t.assertOptions(s,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(s.multiple===void 0||typeof s.multiple=="boolean","multiple option must be an boolean");const o=l.addressOptions(s),c=new RegExp(`\\s*[${s.separator?e(s.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:s},regex:c,address:o})},validate(s,o,{options:c},{regex:f,address:g}){const _=c.multiple?s.split(f):[s],v=[];for(const u of _)p.isValid(u,g)||v.push(u);return v.length?o.error("string.email",{value:s,invalids:v}):s}},guid:{alias:"uuid",method(s={}){t.assertOptions(s,["version","separator"]);let o="";if(s.version){const g=[].concat(s.version);a(g.length>=1,"version must have at least 1 valid version specified");const _=new Set;for(let v=0;v<g.length;++v){const u=g[v];a(typeof u=="string","version at position "+v+" must be a string");const m=l.guidVersions[u.toLowerCase()];a(m,"version at position "+v+" must be one of "+Object.keys(l.guidVersions).join(", ")),a(!_.has(m),"version at position "+v+" must not be a duplicate"),o+=m,_.add(m)}}a(l.guidSeparators.has(s.separator),'separator must be one of true, false, "-", or ":"');const c=s.separator===void 0?"[:-]?":s.separator===!0?"[:-]":s.separator===!1?"[]?":`\\${s.separator}`,f=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${c})[0-9A-F]{4}\\2?[${o||"0-9A-F"}][0-9A-F]{3}\\2?[${o?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:s},regex:f})},validate(s,o,c,{regex:f}){const g=f.exec(s);return g?l.guidBrackets[g[1]]!==g[g.length-1]?o.error("string.guid"):s:o.error("string.guid")}},hex:{method(s={}){return t.assertOptions(s,["byteAligned","prefix"]),s={byteAligned:!1,prefix:!1,...s},a(typeof s.byteAligned=="boolean","byteAligned must be boolean"),a(typeof s.prefix=="boolean"||s.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:s}})},validate:(s,o,{options:c})=>(c.prefix==="optional"?l.hexRegex.withOptionalPrefix:c.prefix===!0?l.hexRegex.withPrefix:l.hexRegex.withoutPrefix).test(s)?c.byteAligned&&s.length%2!=0?o.error("string.hexAlign"):s:o.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(s,o)=>h.isValid(s,{minDomainSegments:1})||l.ipRegex.test(s)?s:o.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(s={}){t.assertOptions(s,["cidr","version"]);const{cidr:o,versions:c,regex:f}=d.regex(s),g=s.version?c:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:o,version:g}},regex:f})},validate:(s,o,{options:c},{regex:f})=>f.test(s)?s:c.version?o.error("string.ipVersion",{value:s,cidr:c.cidr,version:c.version}):o.error("string.ip",{value:s,cidr:c.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(s,{error:o})=>l.isoDate(s)?s:o("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(s,o)=>l.isoDurationRegex.test(s)?s:o.error("string.isoDuration")},length:{method(s,o){return l.length(this,"length",s,"=",o)},validate(s,o,{limit:c,encoding:f},{name:g,operator:_,args:v}){const u=!f&&s.length;return t.compare(u,c,_)?s:o.error("string."+g,{limit:v.limit,value:s,encoding:f})},args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(s,o){return l.length(this,"max",s,"<=",o)},args:["limit","encoding"]},min:{method(s,o){return l.length(this,"min",s,">=",o)},args:["limit","encoding"]},normalize:{method(s="NFC"){return a(l.normalizationForms.includes(s),"normalization form must be one of "+l.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:s}})},validate:(s,{error:o},{form:c})=>s===s.normalize(c)?s:o("string.normalize",{value:s,form:c}),convert:!0},pattern:{alias:"regex",method(s,o={}){a(s instanceof RegExp,"regex must be a RegExp"),a(!s.flags.includes("g")&&!s.flags.includes("y"),"regex should not use global or sticky mode"),typeof o=="string"&&(o={name:o}),t.assertOptions(o,["invert","name"]);const c=["string.pattern",o.invert?".invert":"",o.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:s,options:o},errorCode:c})},validate:(s,o,{regex:c,options:f},{errorCode:g})=>c.test(s)^f.invert?s:o.error(g,{name:f.name,regex:c,value:s}),args:["regex","options"],multi:!0},replace:{method(s,o){typeof s=="string"&&(s=new RegExp(e(s),"g")),a(s instanceof RegExp,"pattern must be a RegExp"),a(typeof o=="string","replacement must be a String");const c=this.clone();return c.$_terms.replacements||(c.$_terms.replacements=[]),c.$_terms.replacements.push({pattern:s,replacement:o}),c}},token:{method(){return this.$_addRule("token")},validate:(s,o)=>/^\w+$/.test(s)?s:o.error("string.token")},trim:{method(s=!0){return a(typeof s=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:s}})},validate:(s,o,{enabled:c})=>c&&s!==s.trim()?o.error("string.trim"):s,convert:!0},truncate:{method(s=!0){return a(typeof s=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",s)}},uppercase:{method(){return this.case("upper")}},uri:{method(s={}){t.assertOptions(s,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),s.domain&&t.assertOptions(s.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:o,scheme:c}=i.regex(s),f=s.domain?l.addressOptions(s.domain):null;return this.$_addRule({name:"uri",args:{options:s},regex:o,domain:f,scheme:c})},validate(s,o,{options:c},{regex:f,domain:g,scheme:_}){if(["http:/","https:/"].includes(s))return o.error("string.uri");const v=f.exec(s);if(v){const u=v[1]||v[2];return!g||c.allowRelative&&!u||h.isValid(u,g)?s:o.error("string.domain",{value:u})}return c.relativeOnly?o.error("string.uriRelativeOnly"):c.scheme?o.error("string.uriCustomScheme",{scheme:_,value:s}):o.error("string.uri")}}},manifest:{build(s,o){if(o.replacements)for(const{pattern:c,replacement:f}of o.replacements)s=s.replace(c,f);return s}},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"}}),l.addressOptions=function(s){if(!s)return l.tlds||s;if(a(s.minDomainSegments===void 0||Number.isSafeInteger(s.minDomainSegments)&&s.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(s.maxDomainSegments===void 0||Number.isSafeInteger(s.maxDomainSegments)&&s.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),s.tlds===!1)return s;if(s.tlds===!0||s.tlds===void 0)return a(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds);a(typeof s.tlds=="object","tlds must be true, false, or an object");const o=s.tlds.deny;if(o)return Array.isArray(o)&&(s=Object.assign({},s,{tlds:{deny:new Set(o)}})),a(s.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!s.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),l.validateTlds(s.tlds.deny,"tlds.deny"),s;const c=s.tlds.allow;return c?c===!0?(a(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds)):(Array.isArray(c)&&(s=Object.assign({},s,{tlds:{allow:new Set(c)}})),a(s.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),l.validateTlds(s.tlds.allow,"tlds.allow"),s):s},l.validateTlds=function(s,o){for(const c of s)a(h.isValid(c,{minDomainSegments:1,maxDomainSegments:1}),`${o} must contain valid top level domain names`)},l.isoDate=function(s){if(!t.isIsoDate(s))return null;/.*T.*[+-]\d\d$/.test(s)&&(s+="00");const o=new Date(s);return isNaN(o.getTime())?null:o.toISOString()},l.length=function(s,o,c,f,g){return a(!g||!1,"Invalid encoding:",g),s.$_addRule({name:o,method:"length",args:{limit:c,encoding:g},operator:f})}},8826:($,w,b)=>{const a=b(375),h=b(8068),p={};p.Map=class extends Map{slice(){return new p.Map(this)}},$.exports=h.extend({type:"symbol",terms:{map:{init:new p.Map}},coerce:{method(d,{schema:e,error:n}){const i=e.$_terms.map.get(d);return i&&(d=i),e._flags.only&&typeof d!="symbol"?{value:d,errors:n("symbol.map",{map:e.$_terms.map})}:{value:d}}},validate(d,{error:e}){if(typeof d!="symbol")return{value:d,errors:e("symbol.base")}},rules:{map:{method(d){d&&!d[Symbol.iterator]&&typeof d=="object"&&(d=Object.entries(d)),a(d&&d[Symbol.iterator],"Iterable must be an iterable or object");const e=this.clone(),n=[];for(const i of d){a(i&&i[Symbol.iterator],"Entry must be an iterable");const[r,t]=i;a(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),a(typeof t=="symbol","Value must be a Symbol"),e.$_terms.map.set(r,t),n.push(t)}return e.valid(...n)}}},manifest:{build:(d,e)=>(e.map&&(d=d.map(e.map)),d)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:($,w,b)=>{const a=b(375),h=b(8571),p=b(738),d=b(9621),e=b(8160),n=b(6354),i=b(493),r={result:Symbol("result")};w.entry=function(t,l,s){let o=e.defaults;s&&(a(s.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(s.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),o=e.preferences(e.defaults,s));const c=r.entry(t,l,o);a(!c.mainstay.externals.length,"Schema with external rules must use validateAsync()");const f={value:c.value};return c.error&&(f.error=c.error),c.mainstay.warnings.length&&(f.warning=n.details(c.mainstay.warnings)),c.mainstay.debug&&(f.debug=c.mainstay.debug),c.mainstay.artifacts&&(f.artifacts=c.mainstay.artifacts),f},w.entryAsync=async function(t,l,s){let o=e.defaults;s&&(o=e.preferences(e.defaults,s));const c=r.entry(t,l,o),f=c.mainstay;if(c.error)throw f.debug&&(c.error.debug=f.debug),c.error;if(f.externals.length){let _=c.value;const v=[];for(const u of f.externals){const m=u.state.path,y=u.schema.type==="link"?f.links.get(u.schema):null;let x,j,S=_;const D=m.length?[_]:[],C=m.length?d(t,m):t;if(m.length){x=m[m.length-1];let L=_;for(const T of m.slice(0,-1))L=L[T],D.unshift(L);j=D[0],S=j[x]}try{const L=(N,q)=>(y||u.schema).$_createError(N,S,q,u.state,o),T=await u.method(S,{schema:u.schema,linked:y,state:u.state,prefs:s,original:C,error:L,errorsArray:r.errorsArray,warn:(N,q)=>f.warnings.push((y||u.schema).$_createError(N,S,q,u.state,o)),message:(N,q)=>(y||u.schema).$_createError("external",S,q,u.state,o,{messages:N})});if(T===void 0||T===S)continue;if(T instanceof n.Report){if(f.tracer.log(u.schema,u.state,"rule","external","error"),v.push(T),o.abortEarly)break;continue}if(Array.isArray(T)&&T[e.symbols.errors]){if(f.tracer.log(u.schema,u.state,"rule","external","error"),v.push(...T),o.abortEarly)break;continue}j?(f.tracer.value(u.state,"rule",S,T,"external"),j[x]=T):(f.tracer.value(u.state,"rule",_,T,"external"),_=T)}catch(L){throw o.errors.label&&(L.message+=` (${u.label})`),L}}if(c.value=_,v.length)throw c.error=n.process(v,t,o),f.debug&&(c.error.debug=f.debug),c.error}if(!o.warnings&&!o.debug&&!o.artifacts)return c.value;const g={value:c.value};return f.warnings.length&&(g.warning=n.details(f.warnings)),f.debug&&(g.debug=f.debug),f.artifacts&&(g.artifacts=f.artifacts),g},r.Mainstay=class{constructor(t,l,s){this.externals=[],this.warnings=[],this.tracer=t,this.debug=l,this.links=s,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}},r.entry=function(t,l,s){const{tracer:o,cleanup:c}=r.tracer(l,s),f=s.debug?[]:null,g=l._ids._schemaChain?new Map:null,_=new r.Mainstay(o,f,g),v=l._ids._schemaChain?[{schema:l}]:null,u=new i([],[],{mainstay:_,schemas:v}),m=w.validate(t,l,u,s);c&&l.$_root.untrace();const y=n.process(m.errors,t,s);return{value:m.value,error:y,mainstay:_}},r.tracer=function(t,l){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:l.debug?(a(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:r.ignore}},w.validate=function(t,l,s,o,c={}){if(l.$_terms.whens&&(l=l._generate(t,s,o).schema),l._preferences&&(o=r.prefs(l,o)),l._cache&&o.cache){const y=l._cache.get(t);if(s.mainstay.tracer.debug(s,"validate","cached",!!y),y)return y}const f=(y,x,j)=>l.$_createError(y,t,x,j||s,o),g={original:t,prefs:o,schema:l,state:s,error:f,errorsArray:r.errorsArray,warn:(y,x,j)=>s.mainstay.warnings.push(f(y,x,j)),message:(y,x)=>l.$_createError("custom",t,x,s,o,{messages:y})};s.mainstay.tracer.entry(l,s);const _=l._definition;if(_.prepare&&t!==void 0&&o.convert){const y=_.prepare(t,g);if(y){if(s.mainstay.tracer.value(s,"prepare",t,y.value),y.errors)return r.finalize(y.value,[].concat(y.errors),g);t=y.value}}if(_.coerce&&t!==void 0&&o.convert&&(!_.coerce.from||_.coerce.from.includes(typeof t))){const y=_.coerce.method(t,g);if(y){if(s.mainstay.tracer.value(s,"coerced",t,y.value),y.errors)return r.finalize(y.value,[].concat(y.errors),g);t=y.value}}const v=l._flags.empty;v&&v.$_match(r.trim(t,l),s.nest(v),e.defaults)&&(s.mainstay.tracer.value(s,"empty",t,void 0),t=void 0);const u=c.presence||l._flags.presence||(l._flags._endedSwitch?null:o.presence);if(t===void 0){if(u==="forbidden")return r.finalize(t,null,g);if(u==="required")return r.finalize(t,[l.$_createError("any.required",t,null,s,o)],g);if(u==="optional"){if(l._flags.default!==e.symbols.deepDefault)return r.finalize(t,null,g);s.mainstay.tracer.value(s,"default",t,{}),t={}}}else if(u==="forbidden")return r.finalize(t,[l.$_createError("any.unknown",t,null,s,o)],g);const m=[];if(l._valids){const y=l._valids.get(t,s,o,l._flags.insensitive);if(y)return o.convert&&(s.mainstay.tracer.value(s,"valids",t,y.value),t=y.value),s.mainstay.tracer.filter(l,s,"valid",y),r.finalize(t,null,g);if(l._flags.only){const x=l.$_createError("any.only",t,{valids:l._valids.values({display:!0})},s,o);if(o.abortEarly)return r.finalize(t,[x],g);m.push(x)}}if(l._invalids){const y=l._invalids.get(t,s,o,l._flags.insensitive);if(y){s.mainstay.tracer.filter(l,s,"invalid",y);const x=l.$_createError("any.invalid",t,{invalids:l._invalids.values({display:!0})},s,o);if(o.abortEarly)return r.finalize(t,[x],g);m.push(x)}}if(_.validate){const y=_.validate(t,g);if(y&&(s.mainstay.tracer.value(s,"base",t,y.value),t=y.value,y.errors)){if(!Array.isArray(y.errors))return m.push(y.errors),r.finalize(t,m,g);if(y.errors.length)return m.push(...y.errors),r.finalize(t,m,g)}}return l._rules.length?r.rules(t,m,g):r.finalize(t,m,g)},r.rules=function(t,l,s){const{schema:o,state:c,prefs:f}=s;for(const g of o._rules){const _=o._definition.rules[g.method];if(_.convert&&f.convert){c.mainstay.tracer.log(o,c,"rule",g.name,"full");continue}let v,u=g.args;if(g._resolve.length){u=Object.assign({},u);for(const y of g._resolve){const x=_.argsByName.get(y),j=u[y].resolve(t,c,f),S=x.normalize?x.normalize(j):j,D=e.validateArg(S,null,x);if(D){v=o.$_createError("any.ref",j,{arg:y,ref:u[y],reason:D},c,f);break}u[y]=S}}v=v||_.validate(t,s,u,g);const m=r.rule(v,g);if(m.errors){if(c.mainstay.tracer.log(o,c,"rule",g.name,"error"),g.warn){c.mainstay.warnings.push(...m.errors);continue}if(f.abortEarly)return r.finalize(t,m.errors,s);l.push(...m.errors)}else c.mainstay.tracer.log(o,c,"rule",g.name,"pass"),c.mainstay.tracer.value(c,"rule",t,m.value,g.name),t=m.value}return r.finalize(t,l,s)},r.rule=function(t,l){return t instanceof n.Report?(r.error(t,l),{errors:[t],value:null}):Array.isArray(t)&&t[e.symbols.errors]?(t.forEach(s=>r.error(s,l)),{errors:t,value:null}):{errors:null,value:t}},r.error=function(t,l){return l.message&&t._setTemplate(l.message),t},r.finalize=function(t,l,s){l=l||[];const{schema:o,state:c,prefs:f}=s;if(l.length){const _=r.default("failover",void 0,l,s);_!==void 0&&(c.mainstay.tracer.value(c,"failover",t,_),t=_,l=[])}if(l.length&&o._flags.error)if(typeof o._flags.error=="function"){l=o._flags.error(l),Array.isArray(l)||(l=[l]);for(const _ of l)a(_ instanceof Error||_ instanceof n.Report,"error() must return an Error object")}else l=[o._flags.error];if(t===void 0){const _=r.default("default",t,l,s);c.mainstay.tracer.value(c,"default",t,_),t=_}if(o._flags.cast&&t!==void 0){const _=o._definition.cast[o._flags.cast];if(_.from(t)){const v=_.to(t,s);c.mainstay.tracer.value(c,"cast",t,v,o._flags.cast),t=v}}if(o.$_terms.externals&&f.externals&&f._externals!==!1)for(const{method:_}of o.$_terms.externals)c.mainstay.externals.push({method:_,schema:o,state:c,label:n.label(o._flags,c,f)});const g={value:t,errors:l.length?l:null};return o._flags.result&&(g.value=o._flags.result==="strip"?void 0:s.original,c.mainstay.tracer.value(c,o._flags.result,t,g.value),c.shadow(t,o._flags.result)),o._cache&&f.cache!==!1&&!o._refs.length&&o._cache.set(s.original,g),t===void 0||g.errors||o._flags.artifact===void 0||(c.mainstay.artifacts=c.mainstay.artifacts||new Map,c.mainstay.artifacts.has(o._flags.artifact)||c.mainstay.artifacts.set(o._flags.artifact,[]),c.mainstay.artifacts.get(o._flags.artifact).push(c.path)),g},r.prefs=function(t,l){const s=l===e.defaults;return s&&t._preferences[e.symbols.prefs]?t._preferences[e.symbols.prefs]:(l=e.preferences(l,t._preferences),s&&(t._preferences[e.symbols.prefs]=l),l)},r.default=function(t,l,s,o){const{schema:c,state:f,prefs:g}=o,_=c._flags[t];if(g.noDefaults||_===void 0)return l;if(f.mainstay.tracer.log(c,f,"rule",t,"full"),!_)return _;if(typeof _=="function"){const v=_.length?[h(f.ancestors[0]),o]:[];try{return _(...v)}catch(u){return void s.push(c.$_createError(`any.${t}`,null,{error:u},f,g))}}return typeof _!="object"?_:_[e.symbols.literal]?_.literal:e.isResolvable(_)?_.resolve(l,f,g):h(_)},r.trim=function(t,l){if(typeof t!="string")return t;const s=l.$_getRule("trim");return s&&s.args.enabled?t.trim():t},r.ignore={active:!1,debug:p,entry:p,filter:p,log:p,resolve:p,value:p},r.errorsArray=function(){const t=[];return t[e.symbols.errors]=!0,t}},2036:($,w,b)=>{const a=b(375),h=b(9474),p=b(8160),d={};$.exports=d.Values=class{constructor(e,n){this._values=new Set(e),this._refs=new Set(n),this._lowercase=d.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,n){p.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),n&&n.register(e)):this.has(e,null,null,!1)||(this._values.add(e),typeof e=="string"&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,n,i){if(e=e||new d.Values,n){if(n._override)return n.clone();for(const r of[...n._values,...n._refs])e.add(r)}if(i)for(const r of[...i._values,...i._refs])e.remove(r);return e.length?e:null}remove(e){p.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),typeof e=="string"&&this._lowercase.delete(e.toLowerCase()))}has(e,n,i,r){return!!this.get(e,n,i,r)}get(e,n,i,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if(typeof e=="string"&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&typeof e!="object")return!1;if(typeof e=="object"){for(const t of this._values)if(h(t,e))return{value:t}}if(n)for(const t of this._refs){const l=t.resolve(e,n,i,null,{in:!0});if(l===void 0)continue;const s=t.in&&typeof l=="object"?Array.isArray(l)?l:Object.keys(l):[l];for(const o of s)if(typeof o==typeof e){if(r&&e&&typeof e=="string"){if(o.toLowerCase()===e.toLowerCase())return{value:o,ref:t}}else if(h(o,e))return{value:o,ref:t}}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const n=[];for(const i of[...this._values,...this._refs])i!==void 0&&n.push(i);return n}return Array.from([...this._values,...this._refs])}clone(){const e=new d.Values(this._values,this._refs);return e._override=this._override,e}concat(e){a(!e._override,"Cannot concat override set of values");const n=new d.Values([...this._values,...e._values],[...this._refs,...e._refs]);return n._override=this._override,n}describe(){const e=[];this._override&&e.push({override:!0});for(const n of this._values.values())e.push(n&&typeof n=="object"?{value:n}:n);for(const n of this._refs.values())e.push(n.describe());return e}},d.Values.prototype[p.symbols.values]=!0,d.Values.prototype.slice=d.Values.prototype.clone,d.lowercases=function(e){const n=new Map;if(e)for(const i of e)typeof i=="string"&&n.set(i.toLowerCase(),i);return n}},978:($,w,b)=>{const a=b(375),h=b(8571),p=b(1687),d=b(9621),e={};$.exports=function(n,i,r={}){if(a(n&&typeof n=="object","Invalid defaults value: must be an object"),a(!i||i===!0||typeof i=="object","Invalid source value: must be true, falsy or an object"),a(typeof r=="object","Invalid options: must be an object"),!i)return null;if(r.shallow)return e.applyToDefaultsWithShallow(n,i,r);const t=h(n);if(i===!0)return t;const l=r.nullOverride!==void 0&&r.nullOverride;return p(t,i,{nullOverride:l,mergeArrays:!1})},e.applyToDefaultsWithShallow=function(n,i,r){const t=r.shallow;a(Array.isArray(t),"Invalid keys");const l=new Map,s=i===!0?null:new Set;for(let f of t){f=Array.isArray(f)?f:f.split(".");const g=d(n,f);g&&typeof g=="object"?l.set(g,s&&d(i,f)||g):s&&s.add(f)}const o=h(n,{},l);if(!s)return o;for(const f of s)e.reachCopy(o,i,f);const c=r.nullOverride!==void 0&&r.nullOverride;return p(o,i,{nullOverride:c,mergeArrays:!1})},e.reachCopy=function(n,i,r){for(const s of r){if(!(s in i))return;const o=i[s];if(typeof o!="object"||o===null)return;i=o}const t=i;let l=n;for(let s=0;s<r.length-1;++s){const o=r[s];typeof l[o]!="object"&&(l[o]={}),l=l[o]}l[r[r.length-1]]=t}},375:($,w,b)=>{const a=b(7916);$.exports=function(h,...p){if(!h)throw p.length===1&&p[0]instanceof Error?p[0]:new a(p)}},8571:($,w,b)=>{const a=b(9621),h=b(4277),p=b(7043),d={needsProtoHack:new Set([h.set,h.map,h.weakSet,h.weakMap])};$.exports=d.clone=function(e,n={},i=null){if(typeof e!="object"||e===null)return e;let r=d.clone,t=i;if(n.shallow){if(n.shallow!==!0)return d.cloneWithShallow(e,n);r=c=>c}else if(t){const c=t.get(e);if(c)return c}else t=new Map;const l=h.getInternalProto(e);if(l===h.buffer)return!1;if(l===h.date)return new Date(e.getTime());if(l===h.regex)return new RegExp(e);const s=d.base(e,l,n);if(s===e)return e;if(t&&t.set(e,s),l===h.set)for(const c of e)s.add(r(c,n,t));else if(l===h.map)for(const[c,f]of e)s.set(c,r(f,n,t));const o=p.keys(e,n);for(const c of o){if(c==="__proto__")continue;if(l===h.array&&c==="length"){s.length=e.length;continue}const f=Object.getOwnPropertyDescriptor(e,c);f?f.get||f.set?Object.defineProperty(s,c,f):f.enumerable?s[c]=r(e[c],n,t):Object.defineProperty(s,c,{enumerable:!1,writable:!0,configurable:!0,value:r(e[c],n,t)}):Object.defineProperty(s,c,{enumerable:!0,writable:!0,configurable:!0,value:r(e[c],n,t)})}return s},d.cloneWithShallow=function(e,n){const i=n.shallow;(n=Object.assign({},n)).shallow=!1;const r=new Map;for(const t of i){const l=a(e,t);typeof l!="object"&&typeof l!="function"||r.set(l,l)}return d.clone(e,n,r)},d.base=function(e,n,i){if(i.prototype===!1)return d.needsProtoHack.has(n)?new n.constructor:n===h.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(n===h.array){const t=[];return r!==n&&Object.setPrototypeOf(t,r),t}if(d.needsProtoHack.has(n)){const t=new r.constructor;return r!==n&&Object.setPrototypeOf(t,r),t}return Object.create(r)}},9474:($,w,b)=>{const a=b(4277),h={mismatched:null};$.exports=function(p,d,e){return e=Object.assign({prototype:!0},e),!!h.isDeepEqual(p,d,e,[])},h.isDeepEqual=function(p,d,e,n){if(p===d)return p!==0||1/p==1/d;const i=typeof p;if(i!==typeof d||p===null||d===null)return!1;if(i==="function"){if(!e.deepFunction||p.toString()!==d.toString())return!1}else if(i!=="object")return p!=p&&d!=d;const r=h.getSharedType(p,d,!!e.prototype);switch(r){case a.buffer:return!1;case a.promise:return p===d;case a.regex:return p.toString()===d.toString();case h.mismatched:return!1}for(let t=n.length-1;t>=0;--t)if(n[t].isSame(p,d))return!0;n.push(new h.SeenEntry(p,d));try{return!!h.isDeepEqualObj(r,p,d,e,n)}finally{n.pop()}},h.getSharedType=function(p,d,e){if(e)return Object.getPrototypeOf(p)!==Object.getPrototypeOf(d)?h.mismatched:a.getInternalProto(p);const n=a.getInternalProto(p);return n!==a.getInternalProto(d)?h.mismatched:n},h.valueOf=function(p){const d=p.valueOf;if(d===void 0)return p;try{return d.call(p)}catch(e){return e}},h.hasOwnEnumerableProperty=function(p,d){return Object.prototype.propertyIsEnumerable.call(p,d)},h.isSetSimpleEqual=function(p,d){for(const e of Set.prototype.values.call(p))if(!Set.prototype.has.call(d,e))return!1;return!0},h.isDeepEqualObj=function(p,d,e,n,i){const{isDeepEqual:r,valueOf:t,hasOwnEnumerableProperty:l}=h,{keys:s,getOwnPropertySymbols:o}=Object;if(p===a.array){if(!n.part){if(d.length!==e.length)return!1;for(let v=0;v<d.length;++v)if(!r(d[v],e[v],n,i))return!1;return!0}for(const v of d)for(const u of e)if(r(v,u,n,i))return!0}else if(p===a.set){if(d.size!==e.size)return!1;if(!h.isSetSimpleEqual(d,e)){const v=new Set(Set.prototype.values.call(e));for(const u of Set.prototype.values.call(d)){if(v.delete(u))continue;let m=!1;for(const y of v)if(r(u,y,n,i)){v.delete(y),m=!0;break}if(!m)return!1}}}else if(p===a.map){if(d.size!==e.size)return!1;for(const[v,u]of Map.prototype.entries.call(d))if(u===void 0&&!Map.prototype.has.call(e,v)||!r(u,Map.prototype.get.call(e,v),n,i))return!1}else if(p===a.error&&(d.name!==e.name||d.message!==e.message))return!1;const c=t(d),f=t(e);if((d!==c||e!==f)&&!r(c,f,n,i))return!1;const g=s(d);if(!n.part&&g.length!==s(e).length&&!n.skip)return!1;let _=0;for(const v of g)if(n.skip&&n.skip.includes(v))e[v]===void 0&&++_;else if(!l(e,v)||!r(d[v],e[v],n,i))return!1;if(!n.part&&g.length-_!==s(e).length)return!1;if(n.symbols!==!1){const v=o(d),u=new Set(o(e));for(const m of v){if(!n.skip||!n.skip.includes(m)){if(l(d,m)){if(!l(e,m)||!r(d[m],e[m],n,i))return!1}else if(l(e,m))return!1}u.delete(m)}for(const m of u)if(l(e,m))return!1}return!0},h.SeenEntry=class{constructor(p,d){this.obj=p,this.ref=d}isSame(p,d){return this.obj===p&&this.ref===d}}},7916:($,w,b)=>{const a=b(8761);$.exports=class extends Error{constructor(h){super(h.filter(p=>p!=="").map(p=>typeof p=="string"?p:p instanceof Error?p.message:a(p)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,w.assert)}}},5277:$=>{const w={};$.exports=function(b){if(!b)return"";let a="";for(let h=0;h<b.length;++h){const p=b.charCodeAt(h);w.isSafe(p)?a+=b[h]:a+=w.escapeHtmlChar(p)}return a},w.escapeHtmlChar=function(b){return w.namedHtml.get(b)||(b>=256?"&#"+b+";":`&#x${b.toString(16).padStart(2,"0")};`)},w.isSafe=function(b){return w.safeCharCodes.has(b)},w.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]),w.safeCharCodes=function(){const b=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&b.add(a);return b}()},6064:$=>{$.exports=function(w){return w.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:$=>{$.exports=function(){}},1687:($,w,b)=>{const a=b(375),h=b(8571),p=b(7043),d={};$.exports=d.merge=function(e,n,i){if(a(e&&typeof e=="object","Invalid target value: must be an object"),a(n==null||typeof n=="object","Invalid source value: must be null, undefined, or an object"),!n)return e;if(i=Object.assign({nullOverride:!0,mergeArrays:!0},i),Array.isArray(n)){a(Array.isArray(e),"Cannot merge array onto an object"),i.mergeArrays||(e.length=0);for(let t=0;t<n.length;++t)e.push(h(n[t],{symbols:i.symbols}));return e}const r=p.keys(n,i);for(let t=0;t<r.length;++t){const l=r[t];if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,l))continue;const s=n[l];if(s&&typeof s=="object"){if(e[l]===s)continue;!e[l]||typeof e[l]!="object"||Array.isArray(e[l])!==Array.isArray(s)||s instanceof Date||s instanceof RegExp?e[l]=h(s,{symbols:i.symbols}):d.merge(e[l],s,i)}else(s!=null||i.nullOverride)&&(e[l]=s)}return e}},9621:($,w,b)=>{const a=b(375),h={};$.exports=function(p,d,e){if(d===!1||d==null)return p;typeof(e=e||{})=="string"&&(e={separator:e});const n=Array.isArray(d);a(!n||!e.separator,"Separator option is not valid for array-based chain");const i=n?d:d.split(e.separator||".");let r=p;for(let t=0;t<i.length;++t){let l=i[t];const s=e.iterables&&h.iterables(r);if(Array.isArray(r)||s==="set"){const o=Number(l);Number.isInteger(o)&&(l=o<0?r.length+o:o)}if(!r||typeof r=="function"&&e.functions===!1||!s&&r[l]===void 0){a(!e.strict||t+1===i.length,"Missing segment",l,"in reach path ",d),a(typeof r=="object"||e.functions===!0||typeof r!="function","Invalid segment",l,"in reach path ",d),r=e.default;break}r=s?s==="set"?[...r][l]:r.get(l):r[l]}return r},h.iterables=function(p){return p instanceof Set?"set":p instanceof Map?"map":void 0}},8761:$=>{$.exports=function(...w){try{return JSON.stringify(...w)}catch(b){return"[Cannot display object: "+b.message+"]"}}},4277:($,w)=>{const b={};w=$.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},b.typeMap=new Map([["[object Error]",w.error],["[object Map]",w.map],["[object Promise]",w.promise],["[object Set]",w.set],["[object WeakMap]",w.weakMap],["[object WeakSet]",w.weakSet]]),w.getInternalProto=function(a){if(Array.isArray(a))return w.array;if(a instanceof Date)return w.date;if(a instanceof RegExp)return w.regex;if(a instanceof Error)return w.error;const h=Object.prototype.toString.call(a);return b.typeMap.get(h)||w.generic}},7043:($,w)=>{w.keys=function(b,a={}){return a.symbols!==!1?Reflect.ownKeys(b):Object.getOwnPropertyNames(b)}},3652:($,w,b)=>{const a=b(375),h={};w.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(p,d){const e=[].concat((d=d||{}).before||[]),n=[].concat(d.after||[]),i=d.group||"?",r=d.sort||0;a(!e.includes(i),`Item cannot come before itself: ${i}`),a(!e.includes("?"),"Item cannot come before unassociated items"),a(!n.includes(i),`Item cannot come after itself: ${i}`),a(!n.includes("?"),"Item cannot come after unassociated items"),Array.isArray(p)||(p=[p]);for(const t of p){const l={seq:this._items.length,sort:r,before:e,after:n,group:i,node:t};this._items.push(l)}if(!d.manual){const t=this._sort();a(t,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(p){Array.isArray(p)||(p=[p]);for(const e of p)if(e)for(const n of e._items)this._items.push(Object.assign({},n));this._items.sort(h.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const d=this._sort();return a(d,"merge created a dependencies error"),this.nodes}sort(){const p=this._sort();return a(p,"sort created a dependencies error"),this.nodes}_sort(){const p={},d=Object.create(null),e=Object.create(null);for(const l of this._items){const s=l.seq,o=l.group;e[o]=e[o]||[],e[o].push(s),p[s]=l.before;for(const c of l.after)d[c]=d[c]||[],d[c].push(s)}for(const l in p){const s=[];for(const o in p[l]){const c=p[l][o];e[c]=e[c]||[],s.push(...e[c])}p[l]=s}for(const l in d)if(e[l])for(const s of e[l])p[s].push(...d[l]);const n={};for(const l in p){const s=p[l];for(const o of s)n[o]=n[o]||[],n[o].push(l)}const i={},r=[];for(let l=0;l<this._items.length;++l){let s=l;if(n[l]){s=null;for(let o=0;o<this._items.length;++o){if(i[o]===!0)continue;n[o]||(n[o]=[]);const c=n[o].length;let f=0;for(let g=0;g<c;++g)i[n[o][g]]&&++f;if(f===c){s=o;break}}}s!==null&&(i[s]=!0,r.push(s))}if(r.length!==this._items.length)return!1;const t={};for(const l of this._items)t[l.seq]=l;this._items=[],this.nodes=[];for(const l of r){const s=t[l];this.nodes.push(s.node),this._items.push(s)}return!0}},h.mergeSort=(p,d)=>p.sort===d.sort?0:p.sort<d.sort?-1:1},5380:($,w,b)=>{const a=b(443),h=b(2178),p={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:a.URL||URL};w.analyze=function(d,e={}){if(!d)return h.code("DOMAIN_NON_EMPTY_STRING");if(typeof d!="string")throw new Error("Invalid input: domain must be a string");if(d.length>256)return h.code("DOMAIN_TOO_LONG");if(p.nonAsciiRx.test(d)){if(e.allowUnicode===!1)return h.code("DOMAIN_INVALID_UNICODE_CHARS");d=d.normalize("NFC")}if(p.domainControlRx.test(d))return h.code("DOMAIN_INVALID_CHARS");d=p.punycode(d),e.allowFullyQualified&&d[d.length-1]==="."&&(d=d.slice(0,-1));const n=e.minDomainSegments||p.minDomainSegments,i=d.split(".");if(i.length<n)return h.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return h.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=e.tlds;if(r){const t=i[i.length-1].toLowerCase();if(r.deny&&r.deny.has(t)||r.allow&&!r.allow.has(t))return h.code("DOMAIN_FORBIDDEN_TLDS")}for(let t=0;t<i.length;++t){const l=i[t];if(!l.length)return h.code("DOMAIN_EMPTY_SEGMENT");if(l.length>63)return h.code("DOMAIN_LONG_SEGMENT");if(t<i.length-1){if(!p.domainSegmentRx.test(l))return h.code("DOMAIN_INVALID_CHARS")}else if(!p.tldSegmentRx.test(l))return h.code("DOMAIN_INVALID_TLDS_CHARS")}return null},w.isValid=function(d,e){return!w.analyze(d,e)},p.punycode=function(d){d.includes("%")&&(d=d.replace(/%/g,"%25"));try{return new p.URL(`http://${d}`).host}catch{return d}}},1745:($,w,b)=>{const a=b(9848),h=b(5380),p=b(2178),d={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};w.analyze=function(e,n){return d.email(e,n)},w.isValid=function(e,n){return!d.email(e,n)},d.email=function(e,n={}){if(typeof e!="string")throw new Error("Invalid input: email must be a string");if(!e)return p.code("EMPTY_STRING");const i=!d.nonAsciiRx.test(e);if(!i){if(n.allowUnicode===!1)return p.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(r.length!==2)return r.length>2?p.code("MULTIPLE_AT_CHAR"):p.code("MISSING_AT_CHAR");const[t,l]=r;if(!t)return p.code("EMPTY_LOCAL");if(!n.ignoreLength){if(e.length>254)return p.code("ADDRESS_TOO_LONG");if(d.encoder.encode(t).length>64)return p.code("LOCAL_TOO_LONG")}return d.local(t,i)||h.analyze(l,n)},d.local=function(e,n){const i=e.split(".");for(const r of i){if(!r.length)return p.code("EMPTY_LOCAL_SEGMENT");if(n){if(!d.atextRx.test(r))return p.code("INVALID_LOCAL_CHARS")}else for(const t of r){if(d.atextRx.test(t))continue;const l=d.binary(t);if(!d.atomRx.test(l))return p.code("INVALID_LOCAL_CHARS")}}},d.binary=function(e){return Array.from(d.encoder.encode(e)).map(n=>String.fromCharCode(n)).join("")},d.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,d.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:($,w)=>{w.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"},w.code=function(b){return{code:b,error:w.codes[b]}}},9959:($,w,b)=>{const a=b(375),h=b(5752);w.regex=function(p={}){a(p.cidr===void 0||typeof p.cidr=="string","options.cidr must be a string");const d=p.cidr?p.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(d),"options.cidr must be one of required, optional, forbidden"),a(p.version===void 0||typeof p.version=="string"||Array.isArray(p.version),"options.version must be a string or an array of string");let e=p.version||["ipv4","ipv6","ipvfuture"];Array.isArray(e)||(e=[e]),a(e.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<e.length;++r)a(typeof e[r]=="string","options.version must only contain strings"),e[r]=e[r].toLowerCase(),a(["ipv4","ipv6","ipvfuture"].includes(e[r]),"options.version contains unknown version "+e[r]+" - must be one of ipv4, ipv6, ipvfuture");e=Array.from(new Set(e));const n=`(?:${e.map(r=>{if(d==="forbidden")return h.ip[r];const t=`\\/${r==="ipv4"?h.ip.v4Cidr:h.ip.v6Cidr}`;return d==="required"?`${h.ip[r]}${t}`:`${h.ip[r]}(?:${t})?`}).join("|")})`,i=new RegExp(`^${n}$`);return{cidr:d,versions:e,regex:i,raw:n}}},5752:($,w,b)=>{const a=b(375),h=b(6064),p={generate:function(){const d={},e="\\dA-Fa-f",n="["+e+"]",i="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",t="%"+e,l=i+t+r+":@",s="["+l+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";d.ipv4address="(?:"+o+"\\.){3}"+o;const c=n+"{1,4}",f="(?:"+c+":"+c+"|"+d.ipv4address+")",g="(?:"+c+":){6}"+f,_="::(?:"+c+":){5}"+f,v="(?:"+c+")?::(?:"+c+":){4}"+f,u="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+f,m="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+f,y="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+f,x="(?:(?:"+c+":){0,4}"+c+")?::"+f,j="(?:(?:"+c+":){0,5}"+c+")?::"+c,S="(?:(?:"+c+":){0,6}"+c+")?::";d.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",d.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",d.ipv6address="(?:"+g+"|"+_+"|"+v+"|"+u+"|"+m+"|"+y+"|"+x+"|"+j+"|"+S+")",d.ipvFuture="v"+n+"+\\.["+i+r+":]+",d.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",d.schemeRegex=new RegExp(d.scheme);const D="["+i+t+r+":]*",C="["+i+t+r+"]{1,255}",L="(?:\\[(?:"+d.ipv6address+"|"+d.ipvFuture+")\\]|"+d.ipv4address+"|"+C+")",T="(?:"+D+"@)?"+L+"(?::\\d*)?",N="(?:"+D+"@)?("+L+")(?::\\d*)?",q=s+"*",M=s+"+",P="(?:\\/"+q+")*",F="\\/(?:"+M+P+")?",W=M+P,V="["+i+t+r+"@]+"+P,Z="(?:\\/\\/\\/"+q+P+")";return d.hierPart="(?:(?:\\/\\/"+T+P+")|"+F+"|"+W+"|"+Z+")",d.hierPartCapture="(?:(?:\\/\\/"+N+P+")|"+F+"|"+W+")",d.relativeRef="(?:(?:\\/\\/"+T+P+")|"+F+"|"+V+"|)",d.relativeRefCapture="(?:(?:\\/\\/"+N+P+")|"+F+"|"+V+"|)",d.query="["+l+"\\/\\?]*(?=#|$)",d.queryWithSquareBrackets="["+l+"\\[\\]\\/\\?]*(?=#|$)",d.fragment="["+l+"\\/\\?]*",d}};p.rfc3986=p.generate(),w.ip={v4Cidr:p.rfc3986.ipv4Cidr,v6Cidr:p.rfc3986.ipv6Cidr,ipv4:p.rfc3986.ipv4address,ipv6:p.rfc3986.ipv6address,ipvfuture:p.rfc3986.ipvFuture},p.createRegex=function(d){const e=p.rfc3986,n="(?:\\?"+(d.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=d.domain?e.relativeRefCapture:e.relativeRef;if(d.relativeOnly)return p.wrap(i+n);let r="";if(d.scheme){a(d.scheme instanceof RegExp||typeof d.scheme=="string"||Array.isArray(d.scheme),"scheme must be a RegExp, String, or Array");const s=[].concat(d.scheme);a(s.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let c=0;c<s.length;++c){const f=s[c];a(f instanceof RegExp||typeof f=="string","scheme at position "+c+" must be a RegExp or String"),f instanceof RegExp?o.push(f.source.toString()):(a(e.schemeRegex.test(f),"scheme at position "+c+" must be a valid scheme"),o.push(h(f)))}r=o.join("|")}const t="(?:"+(r?"(?:"+r+")":e.scheme)+":"+(d.domain?e.hierPartCapture:e.hierPart)+")",l=d.allowRelative?"(?:"+t+"|"+i+")":t;return p.wrap(l+n,r)},p.wrap=function(d,e){return{raw:d=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${d}`,regex:new RegExp(`^${d}$`),scheme:e}},p.uriRegex=p.createRegex({}),w.regex=function(d={}){return d.scheme||d.allowRelative||d.relativeOnly||d.allowQuerySquareBrackets||d.domain?p.createRegex(d):p.uriRegex}},1447:($,w)=>{const b={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};w.Parser=class{constructor(a,h={}){if(!h[b.settings]&&h.constants)for(const p in h.constants){const d=h.constants[p];if(d!==null&&!["boolean","number","string"].includes(typeof d))throw new Error(`Formula constant ${p} contains invalid ${typeof d} value type`)}this.settings=h[b.settings]?h:Object.assign({[b.settings]:!0,constants:{},functions:{}},h),this.single=null,this._parts=null,this._parse(a)}_parse(a){let h=[],p="",d=0,e=!1;const n=r=>{if(d)throw new Error("Formula missing closing parenthesis");const t=h.length?h[h.length-1]:null;if(e||p||r){if(t&&t.type==="reference"&&r===")")return t.type="function",t.value=this._subFormula(p,t.value),void(p="");if(r===")"){const l=new w.Parser(p,this.settings);h.push({type:"segment",value:l})}else if(e){if(e==="]")return h.push({type:"reference",value:p}),void(p="");h.push({type:"literal",value:p})}else if(b.operatorCharacters.includes(p))t&&t.type==="operator"&&b.operators.includes(t.value+p)?t.value+=p:h.push({type:"operator",value:p});else if(p.match(b.numberRx))h.push({type:"constant",value:parseFloat(p)});else if(this.settings.constants[p]!==void 0)h.push({type:"constant",value:this.settings.constants[p]});else{if(!p.match(b.tokenRx))throw new Error(`Formula contains invalid token: ${p}`);h.push({type:"reference",value:p})}p=""}};for(const r of a)e?r===e?(n(),e=!1):p+=r:d?r==="("?(p+=r,++d):r===")"?(--d,d?p+=r:n(r)):p+=r:r in b.literals?e=b.literals[r]:r==="("?(n(),++d):b.operatorCharacters.includes(r)?(n(),p=r,n()):r!==" "?p+=r:n();n(),h=h.map((r,t)=>r.type!=="operator"||r.value!=="-"||t&&h[t-1].type!=="operator"?r:{type:"operator",value:"n"});let i=!1;for(const r of h){if(r.type==="operator"){if(b.operatorsPrefix.includes(r.value))continue;if(!i)throw new Error("Formula contains an operator in invalid position");if(!b.operators.includes(r.value))throw new Error(`Formula contains an unknown operator ${r.value}`)}else if(i)throw new Error("Formula missing expected operator");i=!i}if(!i)throw new Error("Formula contains invalid trailing operator");h.length===1&&["reference","literal","constant"].includes(h[0].type)&&(this.single={type:h[0].type==="reference"?"reference":"value",value:h[0].value}),this._parts=h.map(r=>{if(r.type==="operator")return b.operatorsPrefix.includes(r.value)?r:r.value;if(r.type!=="reference")return r.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(r.value))throw new Error(`Formula contains invalid reference ${r.value}`);return this.settings.reference?this.settings.reference(r.value):b.reference(r.value)})}_subFormula(a,h){const p=this.settings.functions[h];if(typeof p!="function")throw new Error(`Formula contains unknown function ${h}`);let d=[];if(a){let e="",n=0,i=!1;const r=()=>{if(!e)throw new Error(`Formula contains function ${h} with invalid arguments ${a}`);d.push(e),e=""};for(let t=0;t<a.length;++t){const l=a[t];i?(e+=l,l===i&&(i=!1)):l in b.literals&&!n?(e+=l,i=b.literals[l]):l!==","||n?(e+=l,l==="("?++n:l===")"&&--n):r()}r()}return d=d.map(e=>new w.Parser(e,this.settings)),function(e){const n=[];for(const i of d)n.push(i.evaluate(e));return p.call(e,...n)}}evaluate(a){const h=this._parts.slice();for(let p=h.length-2;p>=0;--p){const d=h[p];if(d&&d.type==="operator"){const e=h[p+1];h.splice(p+1,1);const n=b.evaluate(e,a);h[p]=b.single(d.value,n)}}return b.operatorsOrder.forEach(p=>{for(let d=1;d<h.length-1;)if(p.includes(h[d])){const e=h[d],n=b.evaluate(h[d-1],a),i=b.evaluate(h[d+1],a);h.splice(d,2);const r=b.calculate(e,n,i);h[d-1]=r===0?0:r}else d+=2}),b.evaluate(h[0],a)}},w.Parser.prototype[b.symbol]=!0,b.reference=function(a){return function(h){return h&&h[a]!==void 0?h[a]:null}},b.evaluate=function(a,h){return a===null?null:typeof a=="function"?a(h):a[b.symbol]?a.evaluate(h):a},b.single=function(a,h){if(a==="!")return!h;const p=-h;return p===0?0:p},b.calculate=function(a,h,p){if(a==="??")return b.exists(h)?h:p;if(typeof h=="string"||typeof p=="string"){if(a==="+")return(h=b.exists(h)?h:"")+(b.exists(p)?p:"")}else switch(a){case"^":return Math.pow(h,p);case"*":return h*p;case"/":return h/p;case"%":return h%p;case"+":return h+p;case"-":return h-p}switch(a){case"<":return h<p;case"<=":return h<=p;case">":return h>p;case">=":return h>=p;case"==":return h===p;case"!=":return h!==p;case"&&":return h&&p;case"||":return h||p}return null},b.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:$=>{$.exports=JSON.parse('{"version":"17.12.2"}')}},k={},function $(w){var b=k[w];if(b!==void 0)return b.exports;var a=k[w]={exports:{}};return E[w](a,a.exports,$),a.exports}(5107);var E,k})})(Re);var dt=Re.exports;const z=qe(dt),Se={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},Ae={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},ft={"-rm":!0,"--name":!0,"--label":!0,"--network":!0,"--user":!0},mt={"--volume":!0,"--publish":!0},pt=new Set(["--publish","--volume"]),ce=R=>{const[A]=R.split(":");return(A==null?void 0:A.startsWith("/"))||(A==null?void 0:A.startsWith("./"))||(A==null?void 0:A.startsWith("../"))||(A==null?void 0:A.startsWith("~"))||(A==null?void 0:A.startsWith("$BLOCKLET"))};function Oe(R){return R.map(A=>{if(A.key!=="--volume"||A.value.startsWith("$BLOCKLET_APP_DIR/")||A.value.startsWith("$BLOCKLET_DATA_DIR/"))return A;const[E,...k]=A.value.split(":");if(!E||!ce(A.value))return A;const $=E.startsWith("/")?`$BLOCKLET_DATA_DIR${E}`:`$BLOCKLET_DATA_DIR/${E}`;return{...A,value:[$,...k].join(":")}})}function ht(R){let A=!0;return R.find(k=>k.key==="--publish"&&k.type==="web")?R.map(k=>{if(k.key==="--publish"){const $={...k,type:A?"docker":k.type};return A=k.type==="web",$}return k}):R.map(k=>{if(k.key==="--publish"){const $={...k,type:A?"web":"docker"};return A=!1,$}return k})}function gt(R){if(!R)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(R=R.trim(),R.startsWith("$ docker run")&&(R=R.replace("$ docker run","docker run")),!R.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const E=R.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!E)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const k=[],$=[];let w=0,b="",a="";const h=[];for(;w<E.length;){const d=E[w];if(!d){w++;continue}if(d==="docker"||d==="run"){w++;continue}if((d==="-e"||d==="--env")&&w+1<E.length){const e=E[w+1]||"",[n,...i]=e.split("=");if(n){const r=i.join("=").replace(/^['"]|['"]$/g,"");$.push({key:n,value:r})}w+=2;continue}if(d.startsWith("-")&&h.length===0){const e=d.indexOf("=");let n=d,i=null;e!==-1&&(n=d.substring(0,e),i=d.substring(e+1).replace(/^['"]|['"]$/g,""));const r=Se[n];if(!r){w+=2;continue}if(r==="--publish"){let t="";if(i)t=i,k.push({key:r,value:t});else if(w+1<E.length&&!(E[w+1]||"").startsWith("-")){t=(E[w+1]||"").replace(/^['"]|['"]$/g,""),k.push({key:r,value:t}),w+=2;continue}else{k.push({key:r,value:"true"}),w++;continue}w++;continue}if(i!==null){k.push({key:r,value:i}),w++;continue}else if(w+1<E.length&&!(E[w+1]||"").startsWith("-")){const t=(E[w+1]||"").replace(/^['"]|['"]$/g,"");k.push({key:r,value:t}),w+=2;continue}else{k.push({key:r,value:"true"}),w++;continue}}h.push(d),w++}b=h[0]||"",a=h.slice(1).join(" ");const p=[];for(const d of k)d.name="",d.path="",d.prefix="",d.protocol="",d.proxyBehavior="service",d.type="docker",!(pt.has(d.key)&&d.value==="true")&&p.push(d);for(const d of $)d.custom="",d.description="",d.secure=!1,d.shared=!1,d.required=!1;return{dockerArgs:ht(Oe(p)),dockerEnvs:$,dockerImage:b,dockerCommand:a}}function yt({dockerArgs:R,dockerEnvs:A,dockerImage:E,dockerCommand:k}){var b;if(R.length===0&&A.length===0&&!E)return"";const $=["docker run \\"],w=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const a of R){const{key:h,value:p}=a;if(w.has(h))if(p==="true")$.push(` ${h} \\`);else{const d=/[\s"']/g.test(p)?`"${p}"`:p;$.push(` ${h} ${d} \\`)}else if(!$.some(d=>d.startsWith(` ${h}`)))if(p==="true")$.push(` ${h} \\`);else{const d=/[\s"']/g.test(p)?`"${p}"`:p;$.push(` ${h} ${d} \\`)}}for(const a of A){const{key:h,value:p}=a,d=/["']/g.test(p)?p:`"${p}"`;$.push(` -e ${h}=${d} \\`)}return E&&$.push(` ${E} \\`),k&&$.push(` ${k} \\`),(b=$[$.length-1])!=null&&b.endsWith(" \\")&&($[$.length-1]=($[$.length-1]||"").slice(0,-2)),$.join(`
2
2
  `)}const Ee={"--volume":R=>{const[A]=R.split(":");return A?ce(R)&&!R.startsWith("$BLOCKLET_APP_DIR/")&&!R.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":R.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},ue=R=>R.replace(/^[-]+/,"").replace(/-([a-z])/g,(k,$)=>$.toUpperCase()),De=R=>`--${R.replace(/([A-Z])/g,"-$1").toLowerCase()}`,bt=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],vt=["rm ","sudo "];function de(R){if(R==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(R))throw new Error("Docker CMD is invalid");const E=R.toLocaleLowerCase();if(vt.some($=>E.indexOf($)!==-1))throw new Error("Docker CMD is invalid");if(bt.some($=>R.indexOf($)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(R))throw new Error("Docker CMD is invalid")}const _t=Array.from(new Set(Object.keys(Ae).map(ue))),fe=["publish","volume"],Ce=z.object({workdir:z.string().trim().optional(),image:z.string().trim().regex(/^[^\s]+$/).optional(),shell:z.string().trim().optional(),volumes:z.array().items(z.string().trim()).optional(),script:z.string().trim().optional(),installNodeModules:z.boolean().optional(),skipWrapDockerfile:z.boolean().optional(),command:z.string().allow("").default("").optional().custom((R,A)=>{try{return de(R),R}catch(E){return A.error("any.invalid",{message:E.message})}},"Docker CMD validation"),runBaseScript:z.boolean().optional(),..._t.reduce((R,A)=>{const E=Ee[De(A)];return fe.includes(A)?(R[A]=z.array().items(z.string().trim()).optional(),E?R[A]=z.array().items(z.string().trim().custom((k,$)=>{const w=E(k);return w?$.message(w):k})).optional():R[A]=z.array().items(z.string().trim()).optional(),R):(E?R[A]=z.string().trim().custom((k,$)=>{const w=E(k);return w?$.message(w):k}).optional():R[A]=z.string().trim().optional(),R)},{})}).optional(),wt=R=>{const A=/^(?:[a-zA-Z0-9.-]+(?::[0-9]+)?\/)?(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(:[a-zA-Z0-9_.-]+)?$/;return z.string().trim().regex(A).required().validate(R)},xt=(R,A,E)=>{const k={};E.forEach(w=>{const b=ue(w.key);fe.includes(b)?k[b]=[...k[b]||[],w.value]:k[b]=w.value});const{error:$}=wt(R);if($)return{error:$,value:k};try{de(R)}catch(w){return{error:w,value:k}}return k.image=R,k.command=A||"",Ce.validate(k)};function $t(R,A){const E=JSON.parse(JSON.stringify(A)),k=new Map;let $=1;const w=[];return E.forEach(b=>{if(b.key==="--publish"){const h=b.value.split(":");let p="127.0.0.1",d="",e="";h.length===2?[d,e]=h:h.length===3?[p,d,e]=h:h.length===1&&(e=h[0]||"");let n=k.get(d||"");if(n||(n=`$BLOCKLET_PORT_${$++}`,k.set(d||"",n)),!w.find(i=>i.port===d)){const i=b.type||"docker",r=`${R.replace(/\W/g,"-")}-${w.length+1}`;w.push({type:i,proxyBehavior:b.proxyBehavior||"",name:r,path:`/${r}`,port:d||e,containerPort:Number(e)||0,hostIP:p,prefix:i==="docker"?`/${r}`:b.prefix||"*"})}}}),w}function kt(R,A=!1){const E=[];if(!R)return E;for(const k of R){const $={name:k.key,default:k.value===`$${k.key}`?"":k.value,secure:k.secure!==void 0?k.secure:!1,shared:k.shared!==void 0?k.shared:!1,required:k.required!==void 0?k.required:!1,description:k.description||k.key};A||($.custom=k.custom||""),E.push($)}return E}function jt(R,A){const E=JSON.parse(JSON.stringify(R));return A.split(".").map($=>{const w=$.match(/(.+)\[(.+?)\]/);return w?[w[1],w[2]]:$}).flat().filter(Boolean).reduce(($,w)=>{if(!$||!w)return;const b=w==null?void 0:w.match(/(.+?)=(.+)/);if(Array.isArray($)&&b){const[,h,p]=b;return h&&p&&($=$.find(d=>{const e=Object.keys(d).find(n=>n.toLowerCase()===h.toLowerCase());return e&&d[e]===p})),$}const a=Object.keys($).find(h=>h.toLowerCase()===w.toLowerCase());return a?$[a]:void 0},E)}const tr=Object.freeze(Object.defineProperty({__proto__:null,addBlockletPrefixVolume:Oe,allowDockerArgs:Ae,autoSetDockerArgs:ft,dockerArgsToCamelCase:ue,dockerArgsValidator:Ee,dockerBuildCommand:yt,dockerCamelCaseToDash:De,dockerCmdValidator:de,dockerParseCommand:gt,dockerParseEnvironments:kt,dockerParsePublishPorts:$t,dockerSchema:Ce,getObjByPath:jt,isVolumePath:ce,multiValueArgs:fe,notAllowUseCustomDockerArgs:mt,parseDockerArgsToSchema:xt,whiteDockerArgs:Se},Symbol.toStringTag,{value:"Module"})),Rt=$e(R=>({addMenuItemRoot:{marginTop:"8px",justifyContent:"center",color:R.palette.primary.main,lineHeight:"3.2"}}));function Ie({disabled:R,storeList:A,teamDid:E,onAdd:k,scope:$,hiddenChildren:w,open:b,onClose:a}){const{api:h}=le(),[p,d]=U.useState(!1),[e,n]=U.useState(!0),[i,r]=U.useState(!1),[t,l]=U.useState(""),[s,o]=U.useState(""),{t:c}=ee(),f=Rt(),g=async()=>{d(!0);try{const{decoded:v}=et(t,A);await h.addBlockletStore({input:{teamDid:E,url:v,scope:$}}),k(v),r(!1),a()}catch(v){const u=`${c("store.blockletRegistry.addFailed")} ${Q(v)}`;o(u)}finally{d(!1)}},_=()=>{r(!1),a()};return O.jsxs(O.Fragment,{children:[!w&&O.jsxs(ze,{button:!0,disabled:R,className:f.addMenuItemRoot,onClick:()=>{r(!0)},children:[O.jsx(Qe,{font:!0}),O.jsx(H,{variant:"inherit",children:c("store.blockletRegistry.addRegistry")})]}),O.jsxs(Je,{title:c("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:b||i,onClose:_,PaperProps:{style:{minHeight:"auto"}},actions:O.jsxs(O.Fragment,{children:[O.jsx(_e,{onClick:v=>{v.stopPropagation(),_()},color:"inherit",children:c("common.cancel")}),O.jsxs(_e,{onClick:v=>{v.stopPropagation(),g()},color:"primary","data-cy":"install-blocklet-next-step",disabled:p||!t||e,variant:"contained",autoFocus:!0,children:[p&&O.jsx(Y,{size:16}),c("common.confirm")]})]}),children:[O.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:O.jsx(Fe,{component:"div",children:O.jsx(H,{component:"div",children:O.jsx(Ue,{label:c("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"add-blocklet-store-url",fullWidth:!0,value:t,onChange:v=>{o(null);let u=!1;v.target.value.trim()||(u=!0),v.target.value.trim()||o(c("store.blockletRegistry.registryUrlEmpty")),l(v.target.value),n(u)},disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),v.target.value.trim()?g():o(c("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!s&&O.jsx(We,{severity:"error",style:{width:"100%"},children:s})]})]})}Ie.propTypes={teamDid:I.string.isRequired,disabled:I.bool,storeList:I.array,onAdd:I.func,scope:I.string,hiddenChildren:I.bool,open:I.bool,onClose:I.func};Ie.defaultProps={disabled:!1,storeList:[],onAdd:()=>{},scope:"",hiddenChildren:!1,open:!1,onClose:()=>{}};var me={},St=ie;Object.defineProperty(me,"__esModule",{value:!0});var Te=me.default=void 0,At=St(ae()),Ot=O;Te=me.default=(0,At.default)((0,Ot.jsx)("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}),"LinkOutlined");var pe={},Et=ie;Object.defineProperty(pe,"__esModule",{value:!0});var Le=pe.default=void 0,Dt=Et(ae()),Ct=O;Le=pe.default=(0,Dt.default)((0,Ct.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"BackupOutlined");function se({store:R,teamDid:A,onDelete:E,children:k,projectId:$="",scope:w=""}){const{api:b}=le(),{t:a}=ee(),h=tt(),[p,d]=U.useState(!1),[e,n]=U.useState(null),i=Be(),r=()=>{d(!1),n(null)},t=async()=>{var o;try{d(!0),await b.deleteBlockletStore({input:{teamDid:A,url:R.url,projectId:$,scope:w}}),await((o=h==null?void 0:h.actions)==null?void 0:o.refreshBlocklet()),E&&typeof E=="function"&&E()}catch(c){K.error(`Remove Blocklet Store Error: ${Q(c)}`)}finally{d(!1),n(null)}},l={keyName:R.url,title:a("store.blockletRegistry.deleteRegistry"),description:a("store.blockletRegistry.deleteDesc",{name:`<b>${R.url}</b>`,color:i.palette.error.main}),confirmPlaceholder:a("store.blockletRegistry.confirmDesc",{name:R.url}),confirm:a("common.delConfirm"),cancel:a("common.cancel"),onConfirm:t,onCancel:r},s=o=>{R.protected||(o.stopPropagation(),n(l))};return O.jsxs(O.Fragment,{children:[k?O.jsx("span",{onClick:s,children:k}):O.jsx(G,{"data-cy":"store-action-delete",color:"primary",disabled:p,onClick:s,size:"small",children:O.jsx(je,{sx:{zoom:.95}})}),e&&O.jsx(st,{keyName:e.keyName,title:e.title,description:e.description,confirmPlaceholder:e.confirmPlaceholder,confirm:e.confirm,cancel:e.cancel,params:e.params,onConfirm:e.onConfirm,onCancel:e.onCancel})]})}se.propTypes={children:I.node,teamDid:I.string.isRequired,store:I.object.isRequired,onDelete:I.func,projectId:I.string,scope:I.string};se.defaultProps={children:null,projectId:"",scope:"",onDelete:()=>{}};var he={},It=ie;Object.defineProperty(he,"__esModule",{value:!0});var Me=he.default=void 0,Tt=It(ae()),Lt=O;Me=he.default=(0,Tt.default)((0,Lt.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff");const Mt=({store:R,userDid:A})=>{var k;const E=((k=window.blocklet)==null?void 0:k.tenantMode)!==Xe.BLOCKLET_TENANT_MODES.MULTIPLE;return R.protected?!1:R.scope&&R.scope===A?!0:E?R.scope==="studio":!1};function ge({connectedStore:R,onDisconnect:A,onDelete:E,store:k,teamDid:$,projectId:w}){var o;const[b,a]=U.useState(null),h=!!b,{t:p}=ee(),{session:d}=it(),[e,n]=U.useState(!1),i=c=>{c.stopPropagation(),window.open(X(`${re(k.url,"search?menu=my-blocklets")}`,{allowDomains:null}))},r=c=>{a(c.currentTarget)},t=()=>{a(null)},l=()=>{n(!1),A()},s=[{label:p("common.visitStore"),action:i,icon:ke},{label:p("common.disconnect"),action:()=>{t(),n(!0)},icon:Me,hidden:!R}];return O.jsxs(O.Fragment,{children:[O.jsx(G,{ref:b,color:"primary",onClick:r,size:"small",children:O.jsx(Ye,{sx:{zoom:.95}})}),O.jsxs(Ve,{anchorEl:b,open:h,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[s.map(c=>c.hidden?null:O.jsxs(be,{dense:!0,onClick:c.action,disabled:c.disabled,children:[c.icon&&O.jsx(c.icon,{color:"action",sx:{marginRight:1}}),O.jsx(B,{color:"action",children:c.label})]},c.label)),Mt({store:k,userDid:(o=d==null?void 0:d.user)==null?void 0:o.did})&&O.jsx(se,{store:k,onDelete:E,teamDid:$,projectId:w,scope:k.scope||"studio",children:O.jsxs(be,{dense:!0,disabled:k.protected,children:[O.jsx(je,{sx:{color:k.protected?"action":"error.main",marginRight:1}}),O.jsx(B,{color:k.protected?"action":"error.main",children:p("common.delete")})]})})]}),e&&O.jsx(nt,{displayError:!0,title:`${p("common.disconnect")} ${k.name}`,description:p("blocklet.publish.disconnectStoreTip"),confirm:p("common.confirm"),onConfirm:l,onCancel:()=>n(!1)})]})}ge.propTypes={connectedStore:I.object.isRequired,onDisconnect:I.func,onDelete:I.func,store:I.object.isRequired,teamDid:I.string.isRequired,projectId:I.string};ge.defaultProps={projectId:"",onDelete:()=>{},onDisconnect:()=>{}};function Pt({messageType:R,onOpen:A,onClose:E}){const k=U.useRef(null),$=U.useRef(null),w=async a=>{setTimeout(()=>{try{E==null||E()}catch{}},10*1e3),k.current&&(clearInterval($.current),k.current.close());const h=Math.random().toString(36).slice(2);k.current=window.open(`${oe.WELLKNOWN_SERVICE_PATH_PREFIX}/open-window?key=${h}`,"_blank"),A==null||A(k.current),$.current=setInterval(()=>{(!k.current||k.current.closed)&&(k.current=null,clearInterval($.current),setTimeout(()=>{E==null||E()},1100))},200),await Promise.resolve(a(k.current,p=>{if(!k.current){localStorage.setItem(`open-window-url-${h}`,JSON.stringify({url:p,time:Date.now()}));return}k.current.location.href=X(p,{allowDomains:null})}))},b=at(a=>{const{type:h,error:p}=a.data;k.current&&h===R&&p&&(K.error(p),E==null||E())});return U.useEffect(()=>(window.addEventListener("message",b),()=>{window.removeEventListener("message",b)}),[b]),w}function te({connectedStore:R,sx:A,...E}){return O.jsx(Ke,{sx:{width:24,height:24,...A},src:re(R.storeUrl,oe.WELLKNOWN_SERVICE_PATH_PREFIX,`/user/avatar/${R.developerDid}?imageFilter=resize&w=120&h=120`),...E})}te.propTypes={connectedStore:I.object.isRequired,sx:I.object};te.defaultProps={sx:{}};function ye({storeUrl:R,storeName:A,published:E,did:k,version:$}){const{t:w}=ee(),b=()=>{window.open(X(`${re(R,k&&$?`/blocklets/${k}/${$}`:"/search?menu=my-blocklets")}`,{allowDomains:null}))};return O.jsxs(B,{children:[O.jsx(H,{variant:"subtitle2",children:w(E?"blocklet.publish.publishToStoreSuccess":"blocklet.publish.uploadToStoreSuccess",{name:A})}),O.jsx(G,{size:"small",sx:{mt:1},onClick:b,variant:"contained",color:"success",children:w("common.visitTarget",{name:A})})]})}ye.propTypes={storeName:I.string.isRequired,storeUrl:I.string.isRequired,published:I.bool.isRequired,did:I.string,version:I.string};ye.defaultProps={did:"",version:""};const Pe={CONNECT:"connect",SELECT:"select"},Nt=$e(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},box:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:"100%"},menuName:{flexShrink:1,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},actions:{flex:1,display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},title:{fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},url:{fontSize:14,opacity:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},buttonLine:{height:"100%",width:"1px",backgroundColor:"#e0e0e0"}})),xe=He(({className:R,...A})=>O.jsx(Ze,{...A,classes:{popper:R}}))(({theme:R})=>({[`& .${Ge.tooltip}`]:{backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.87)",borderRadius:8,padding:R.spacing(2),fontSize:R.typography.pxToRem(12),border:"1px solid rgba(0,0,0,0.08)",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.05)"}}));function Ne({teamDid:R,projectId:A,releaseId:E,store:k,warningList:$,onDelete:w,kind:b,published:a,connectedStore:h,releaseType:p,onPublish:d,onOpenConnectStore:e,onSelectConnectStore:n,behavior:i,scope:r="",version:t}){const l=Nt(),{t:s}=ee(),{api:o,info:c,inService:f}=le(),[g,_]=U.useState(!1),v=Pt({messageType:"connect-store-message",onOpen:()=>_(!0),onClose:()=>_(!1)}),u=b==="publish",m=!!h,y=T=>{if(T.stopPropagation(),u){window.open(X(re(k.url,"developer/blocklets"),{allowDomains:null}));return}window.open(X(k.url,{allowDomains:null}))},x=()=>{if(i===Pe.SELECT){n(k);return}v(async(T,N)=>{try{const q=await o.connectToStore({input:{did:R,storeUrl:k.url,storeId:k.id,storeName:k.name,projectId:A}});if(!(q!=null&&q.url)){K.error("failed to connect to store");return}N(q.url),await e({did:R,projectId:A,storeId:k.id}),_(!1)}catch(q){const M=Q(q);K.error(M),_(!1)}})},j=async()=>{try{await o.disconnectFromStore({input:{did:R,storeId:k.id,projectId:A,storeScope:r}}),w()}catch(T){K.error(Q(T))}},S=()=>{_(!0),o.publishToStore({input:{did:R,storeId:k.id,storeName:k.name,projectId:A,releaseId:E,type:p}}).then(T=>{K.success(O.jsx(ye,{storeName:h.storeName,storeUrl:h.storeUrl,did:A,version:t,published:T.url==="published"}),{duration:1e4}),d==null||d(null)}).catch(T=>{K.error(Q(T)),d==null||d(T)}).finally(()=>{_(!1)})};U.useEffect(()=>{m&&_(!1)},[m]);const D=U.useMemo(()=>!(f&&ut.isInServerlessMode(c)),[f,c]),C=$.length>0,L=O.jsxs(G,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130,height:"100%"},disabled:C,onClick:S,children:[g?O.jsx(Y,{sx:{marginRight:1},size:16}):O.jsx(Le,{sx:{marginRight:1,fontSize:20}}),s("common.upload")]});return O.jsxs("div",{className:l.box,children:[!u&&g&&O.jsx(Y,{sx:{marginRight:2},size:16}),O.jsxs("div",{className:l.menuName,children:[O.jsx(B,{sx:{display:"flex",flexDirection:"row"},children:O.jsx(H,{component:"span",className:l.title,variant:"subtitle1",children:k.name})}),O.jsx(H,{className:l.url,component:"span",variant:"inherit",children:`${k.url}`})]}),O.jsxs("div",{className:l.actions,children:[h&&O.jsx(xe,{placement:"top",title:O.jsxs(B,{children:[O.jsx(H,{component:"span",variant:"caption",sx:{opacity:.7},children:s("blocklet.publish.developerInfo")}),O.jsxs(B,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1,mt:1},children:[O.jsx(te,{connectedStore:h,sx:{width:42,height:42}}),O.jsxs(B,{sx:{flex:1},children:[O.jsx(H,{component:"span",variant:"subtitle1",children:h.developerName}),O.jsx(ot,{size:14,copyable:!0,compact:!0,responsive:!1,did:h.developerDid})]})]})]}),children:O.jsx("div",{children:O.jsx(te,{connectedStore:h,sx:{marginRight:1,cursor:"help"}})})}),u&&O.jsxs(ve,{disabled:g,variant:"outlined",sx:{height:38},size:"small",children:[!m&&O.jsxs(G,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:x,children:[g?O.jsx(Y,{sx:{marginRight:1},size:16}):O.jsx(Te,{sx:{marginRight:1}}),s("common.connect")]}),m&&a&&O.jsxs(G,{disabled:!0,sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},children:[g?O.jsx(Y,{sx:{marginRight:1},size:16}):O.jsx(rt,{sx:{marginRight:1}}),s("common.uploaded")]}),m&&!a&&(C?O.jsx(xe,{title:O.jsxs(B,{children:[O.jsx(B,{sx:{color:"error.main",mb:.5},children:s("blocklet.publish.storeRule.warning")}),$.map((T,N)=>O.jsxs(B,{sx:{color:"error.main"},children:[N+1,". ",T]},T))]}),children:O.jsx("div",{children:L})}):L),O.jsx(ge,{projectId:A,connectedStore:h,store:k,onDelete:w,teamDid:R,onDisconnect:j})]}),!u&&O.jsxs(ve,{disabled:g,variant:"outlined",sx:{height:36},size:"small",children:[O.jsx(G,{"data-cy":"store-open-url",onClick:y,children:O.jsx(ke,{sx:{zoom:.9}})}),!k.protected&&D&&O.jsx(se,{store:k,onDelete:w,teamDid:R,scope:""})]})]})]})}Ne.propTypes={kind:I.string,teamDid:I.string.isRequired,published:I.bool,connectedStore:I.shape({storeName:I.string,storeId:I.string,storeUrl:I.string,developerDid:I.string,developerName:I.string}),warningList:I.array,projectId:I.string,releaseId:I.string,releaseType:I.string,store:I.shape({id:I.string.isRequired,name:I.string.isRequired,url:I.string.isRequired,protected:I.bool,connected:I.bool}).isRequired,scope:I.string,onDelete:I.func,onPublish:I.func,onOpenConnectStore:I.func,behavior:I.string,onSelectConnectStore:I.func,version:I.string};Ne.defaultProps={kind:"store",published:!1,connectedStore:null,releaseId:"",projectId:"",warningList:[],releaseType:"",version:"",scope:"",behavior:Pe.CONNECT,onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{}};export{Ie as A,Ne as S,ye as U,Me as a,Le as b,Mt as c,tr as d,Te as e,ue as f,Ae as g,Ee as h,gt as i,dt as j,yt as k,de as l,mt as n,ut as s,Pt as u};