@vizzly/services 0.11.0 → 0.12.0-dev-2ab7e33d0cfee4465500870d9b623dac4802c30e

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 (97) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/services/src/Services/{CellServices.d.ts → Cell.d.ts} +4 -4
  3. package/dist/services/src/Services/{DashboardServices.d.ts → Dashboard.d.ts} +6 -6
  4. package/dist/services/src/Services/{HeaderServices.d.ts → Header.d.ts} +1 -1
  5. package/dist/services/src/Services/{ComponentLibraryServices.d.ts → Library.d.ts} +8 -8
  6. package/dist/services/src/Services/{RowServices.d.ts → Row.d.ts} +1 -1
  7. package/dist/services/src/Services/View.d.ts +65 -0
  8. package/dist/services/src/VizzlyLoader.d.ts +44 -0
  9. package/dist/services/src/errors/TimeoutWaitingForVizzlyInstance.d.ts +3 -0
  10. package/dist/services/src/errors/VizzlyInstanceNotLoaded.d.ts +3 -0
  11. package/dist/services/src/index.d.ts +124 -31
  12. package/dist/services/src/schemaValidations/dashboard.d.ts +3 -3
  13. package/dist/services/src/schemaValidations/filters.d.ts +1 -1
  14. package/dist/services/src/schemaValidations/library.d.ts +2 -2
  15. package/dist/shared-logic/src/Callbacks/types.d.ts +2 -0
  16. package/dist/shared-logic/src/Component/sharedSchemas.d.ts +1 -1
  17. package/dist/shared-logic/src/Dashboard/fromRaw.d.ts +4 -0
  18. package/dist/shared-logic/src/Dashboard/types.d.ts +8 -0
  19. package/dist/shared-logic/src/DashboardAPI/dataSets.d.ts +2 -5
  20. package/dist/shared-logic/src/GlobalLibrary/GlobalLibrary.d.ts +1 -0
  21. package/dist/shared-logic/src/GlobalLibrary/fromRaw.d.ts +10 -0
  22. package/dist/shared-logic/src/GlobalLibrary/index.d.ts +2 -0
  23. package/dist/shared-logic/src/GlobalLibrary/types.d.ts +16 -0
  24. package/dist/shared-logic/src/QueryEngineConfig/loadQueryEngineConfig.d.ts +2 -2
  25. package/dist/shared-logic/src/QueryEngineConfig/supportedConstants.d.ts +125 -0
  26. package/dist/shared-logic/src/Theme/types.d.ts +1 -0
  27. package/dist/shared-logic/src/Translations/translateQueryEngineConfig.d.ts +3 -0
  28. package/dist/shared-logic/src/Translations/translation.types.d.ts +43 -8
  29. package/dist/shared-logic/src/ViewConfiguration/types.d.ts +4 -0
  30. package/dist/shared-logic/src/errors/InvalidIdentityPropType.d.ts +4 -0
  31. package/dist/shared-logic/src/getVizzly.d.ts +5 -0
  32. package/package.json +13 -4
  33. package/dist/services/src/Services/APIServices.d.ts +0 -155
  34. package/dist/services/src/Services/ViewServices.d.ts +0 -61
  35. package/dist/shared-logic/src/AI/types.d.ts +0 -31
  36. package/dist/shared-logic/src/ApiResource/index.d.ts +0 -7
  37. package/dist/shared-logic/src/DashboardAPI/clientDashboardSchema.d.ts +0 -3
  38. package/dist/shared-logic/src/DashboardAPI/dashboardAPI/creating.d.ts +0 -19
  39. package/dist/shared-logic/src/DashboardAPI/dashboardAPI/updating.d.ts +0 -19
  40. package/dist/shared-logic/src/DashboardAPI/dashboardAPI.d.ts +0 -17
  41. package/dist/shared-logic/src/DashboardAPI/dashboardManager.d.ts +0 -9
  42. package/dist/shared-logic/src/DashboardPermission/index.d.ts +0 -7
  43. package/dist/shared-logic/src/DashboardPermission/types.d.ts +0 -12
  44. package/dist/shared-logic/src/Project/types.d.ts +0 -74
  45. package/dist/shared-logic/src/api/index.d.ts +0 -66
  46. package/dist/shared-logic/src/api/queryEngine/createDashboard.d.ts +0 -20
  47. package/dist/shared-logic/src/api/queryEngine/multiGetDashboards.d.ts +0 -7
  48. package/dist/shared-logic/src/api/queryEngine/updateDashboard.d.ts +0 -13
  49. package/dist/shared-logic/src/api/vizzly/aiActions.d.ts +0 -18
  50. package/dist/shared-logic/src/api/vizzly/aiHelpers/buildAIResponse.d.ts +0 -5
  51. package/dist/shared-logic/src/api/vizzly/aiHelpers/buildDataSets.d.ts +0 -4
  52. package/dist/shared-logic/src/api/vizzly/aiHelpers/checkAiResponseStatus.d.ts +0 -3
  53. package/dist/shared-logic/src/api/vizzly/aiHelpers/types.d.ts +0 -23
  54. package/dist/shared-logic/src/api/vizzly/aiHelpers/validateAndUpcastAIAttributes.d.ts +0 -4
  55. package/dist/shared-logic/src/api/vizzly/aiHelpers/view.d.ts +0 -10
  56. package/dist/shared-logic/src/api/vizzly/askAi.d.ts +0 -6
  57. package/dist/shared-logic/src/api/vizzly/askAiForQuestionSuggestions.d.ts +0 -4
  58. package/dist/shared-logic/src/api/vizzly/createDashboard.d.ts +0 -20
  59. package/dist/shared-logic/src/api/vizzly/createDashboardAccess.d.ts +0 -8
  60. package/dist/shared-logic/src/api/vizzly/createProjectApiKey.d.ts +0 -2
  61. package/dist/shared-logic/src/api/vizzly/createQueryEngineUser.d.ts +0 -2
  62. package/dist/shared-logic/src/api/vizzly/createSelfHostedDynamicQueryEngine.d.ts +0 -3
  63. package/dist/shared-logic/src/api/vizzly/createSelfHostedInBrowserQueryEngineProject.d.ts +0 -3
  64. package/dist/shared-logic/src/api/vizzly/createSelfHostedQueryEngineProject.d.ts +0 -3
  65. package/dist/shared-logic/src/api/vizzly/createVizzlyConfigVersion.d.ts +0 -2
  66. package/dist/shared-logic/src/api/vizzly/getConnection.d.ts +0 -7
  67. package/dist/shared-logic/src/api/vizzly/getManagedQueryEngineKeyPair.d.ts +0 -5
  68. package/dist/shared-logic/src/api/vizzly/getParentDashboards.d.ts +0 -9
  69. package/dist/shared-logic/src/api/vizzly/getProject.d.ts +0 -3
  70. package/dist/shared-logic/src/api/vizzly/getQueryEngineUser.d.ts +0 -3
  71. package/dist/shared-logic/src/api/vizzly/getTeamMembers.d.ts +0 -11
  72. package/dist/shared-logic/src/api/vizzly/getVizzlyConfig.d.ts +0 -4
  73. package/dist/shared-logic/src/api/vizzly/multiGetDashboards.d.ts +0 -7
  74. package/dist/shared-logic/src/api/vizzly/multiGetEncryptedDashboards.d.ts +0 -7
  75. package/dist/shared-logic/src/api/vizzly/saveConnection.d.ts +0 -2
  76. package/dist/shared-logic/src/api/vizzly/saveEncryptedProjectEncryptionSecret.d.ts +0 -2
  77. package/dist/shared-logic/src/api/vizzly/saveScheduledReport.d.ts +0 -6
  78. package/dist/shared-logic/src/api/vizzly/updateDashboard.d.ts +0 -20
  79. package/dist/shared-logic/src/api/vizzly/updateProjectApiKey.d.ts +0 -6
  80. package/dist/shared-logic/src/api/vizzly/updateQueryEngineUser.d.ts +0 -2
  81. package/dist/shared-logic/src/errors/AIAborted.d.ts +0 -4
  82. package/dist/shared-logic/src/errors/AIContainsErrors.d.ts +0 -4
  83. package/dist/shared-logic/src/errors/AIFailedToFetch.d.ts +0 -4
  84. package/dist/shared-logic/src/errors/AIUsageLimitReached.d.ts +0 -4
  85. package/dist/shared-logic/src/errors/DashboardQuotaReached.d.ts +0 -4
  86. package/dist/shared-logic/src/errors/EncryptedProjectSecretAlreadyExists.d.ts +0 -4
  87. package/dist/shared-logic/src/errors/FailedToCreateDashboard.d.ts +0 -4
  88. package/dist/shared-logic/src/errors/FailedToCreateDashboardAccess.d.ts +0 -4
  89. package/dist/shared-logic/src/errors/FailedToGetDashboard.d.ts +0 -4
  90. package/dist/shared-logic/src/errors/FailedToSaveVizzlyConfigVersion.d.ts +0 -3
  91. package/dist/shared-logic/src/errors/FailedToUpdateDashboard.d.ts +0 -4
  92. package/dist/shared-logic/src/errors/ProjectEncryptedSecretAlreadySaved.d.ts +0 -4
  93. package/dist/shared-logic/src/errors/ReadOnlyPermissionNotFound.d.ts +0 -4
  94. package/dist/shared-logic/src/errors/ReadPermissionNotFound.d.ts +0 -4
  95. package/dist/shared-logic/src/errors/VizzlyApiCallErrorFailedToSetupProject.d.ts +0 -4
  96. package/dist/shared-logic/src/errors/WritePermissionNotFound.d.ts +0 -4
  97. package/dist/shared-logic/src/errors/index.d.ts +0 -5
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- var e={579:e=>{var t;self,t=()=>(()=>{var e={514:(e,t,n)=>{const{clone:r}=n(8870),i=n(8160),o={annotations:Symbol("annotations")};t.error=function(e){if(!this._original||"object"!=typeof this._original)return this.details[0].message;const t=e?"":"",n=e?"":"",s=e?"":"",a=r(this._original);for(let e=this.details.length-1;e>=0;--e){const t=e+1,n=this.details[e],r=n.path;let s=a;for(let e=0;;++e){const a=r[e];if(i.isSchema(s)&&(s=s.clone()),!(e+1<r.length&&"string"!=typeof s[a])){const e=s[o.annotations]||{errors:{},missing:{}};s[o.annotations]=e;const r=a||n.context.key;void 0!==s[a]?(e.errors[r]=e.errors[r]||[],e.errors[r].push(t)):e.missing[r]=t;break}s=s[a]}}let l=o.safeStringify(a,2).replace(/_\$key\$_([, \d]+)_\$end\$_"/g,((e,n)=>`" ${t}[${n}]${s}`)).replace(/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,((e,r,i)=>`${n}"${r}"${s}${t} [${i}]: -- missing --${s}`)).replace(/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,((e,n,r)=>`\n${r} ${t}[${n}]${s}`)).replace(/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g,((e,t)=>t));l=`${l}\n${t}`;for(let e=0;e<this.details.length;++e)l=`${l}\n[${e+1}] ${this.details[e].message}`;return l+=s,l},o.safeStringify=function(e,t){return JSON.stringify(e,o.serializer(),t)},o.serializer=function(){const e=[],t=[],n=(n,r)=>t[0]===r?"[Circular ~]":"[Circular ~."+e.slice(0,t.indexOf(r)).join(".")+"]";return function(r,i){if(t.length>0){const o=t.indexOf(this);~o?(t.length=o+1,e.length=o+1,e[o]=r):(t.push(this),e.push(r)),~t.indexOf(i)&&(i=n.call(this,r,i))}else t.push(i);if(i){const e=i[o.annotations];if(e){if(Array.isArray(i)){const t=[];for(let n=0;n<i.length;++n)e.errors[n]&&t.push(`_$idx$_${e.errors[n].sort().join(", ")}_$end$_`),t.push(i[n]);i=t}else{for(const t in e.errors)i[`${t}_$key$_${e.errors[t].sort().join(", ")}_$end$_`]=i[t],i[t]=void 0;for(const t in e.missing)i[`_$miss$_${t}|${e.missing[t]}_$end$_`]="__missing__"}return i}}return i===1/0||i===-1/0||Number.isNaN(i)||"function"==typeof i||"symbol"==typeof i?"["+i.toString()+"]":i}}},7629:(e,t,n)=>{const{assert:r,clone:i,deepEqual:o,merge:s}=n(8870),a=n(8652),l=n(8160),c=n(3292),u=n(6354),d=n(8901),f=n(1123),p=n(6914),h=n(2294),m=n(6133),g=n(2305),y=n(8863),b=n(2036),v={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new h.Ids,this._preferences=null,this._refs=new m.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return r("function"==typeof f.describe,"Manifest functionality disabled"),f.describe(this)}allow(...e){return l.verifyFlat(e,"allow"),this._values(e,"_valids")}alter(e){r(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),r(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const n in e){const i=e[n];r("function"==typeof i,"Alteration adjuster for",n,"must be a function"),t.$_terms.alterations.push({target:n,adjuster:i})}return t.$_temp.ruleset=!1,t}artifact(e){return r(void 0!==e,"Artifact cannot be undefined"),r(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return r(!1===e||"string"==typeof e,"Invalid to value"),r(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return r(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return r(e,"Missing error"),r(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e,t={}){return r(void 0!==e,"Missing example"),l.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(r(!t,"Cannot combine options with description"),t=e.description,e=e.method),r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(r("string"==typeof e,"id must be a non-empty string"),r(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(...e){return this._values(e,"_invalids")}label(e){return r(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return r(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(...e){r(e.length,"Missing notes");for(const t of e)r(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!0){return r("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){r(e,"Missing preferences"),r(void 0===e.context,"Cannot override context"),r(void 0===e.externals,"Cannot override externals"),r(void 0===e.warnings,"Cannot override warnings"),r(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);const t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return r(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(e=!0){return this.$_setFlag("result",e?"raw":void 0)}result(e){return r(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),n=void 0!==e&&!e;return t._preferences=l.preferences(t._preferences,{convert:n}),t}strip(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){r(e.length,"Missing tags");for(const t of e)r(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return r(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){l.verifyFlat(e,"valid");const t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){const n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);const i=c.when(n,e,t);if(!["any","link"].includes(n.type)){const e=i.is?[i]:i.switch;for(const t of e)r(!t.then||"any"===t.then.type||t.then.type===n.type,"Cannot combine",n.type,"with",t.then&&t.then.type),r(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===n.type,"Cannot combine",n.type,"with",t.otherwise&&t.otherwise.type)}return n.$_terms.whens.push(i),n.$_mutateRebuild()}cache(e){r(!this._inRuleset(),"Cannot set caching inside a ruleset"),r(!this._cache,"Cannot override schema cache"),r(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||a.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){r(l.isSchema(e),"Invalid schema object"),r("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),r(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),r(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const n=e.clone();for(const e of Object.keys(t))"type"!==e&&(n[e]=t[e]);t=n}t._ids.concat(e._ids),t._refs.register(e,m.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=b.merge(t._valids,e._valids,e._invalids),t._invalids=b.merge(t._invalids,e._invalids,e._valids);for(const n of e._singleRules.keys())t._singleRules.has(n)&&(t._rules=t._rules.filter((e=>e.keep||e.name!==n)),t._singleRules.delete(n));for(const n of e._rules)e._definition.rules[n.method].multi||t._singleRules.set(n.name,n),t._rules.push(n);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const n=Object.assign({},e._flags);delete n.empty,s(t._flags,n)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const n=Object.assign({},e._flags);delete n.empty,s(t._flags,n)}else s(t._flags,e._flags);for(const n in e.$_terms){const r=e.$_terms[n];r?t.$_terms[n]?t.$_terms[n]=t.$_terms[n].concat(r):t.$_terms[n]=r.slice():t.$_terms[n]||(t.$_terms[n]=r)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return r(!e.base,"Cannot extend type with another base"),d.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){r(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(e))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,t,n);return n.$_temp.ruleset=!1,n}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),r(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const n=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;r(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");const o=this.clone();for(let s=n;s<o._rules.length;++s){const n=o._rules[s],a=i(n);for(const i in e)t.modifiers[i](a,e[i]),r(a.name===n.name,"Cannot change rule name");o._rules[s]=a,o._singleRules.get(a.name)===n&&o._singleRules.set(a.name,a)}return o.$_temp.ruleset=!1,o.$_mutateRebuild()}get ruleset(){r(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),r(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(const{target:n,adjuster:i}of this.$_terms.alterations)e.includes(n)&&(t=i(t),r(l.isSchema(t),"Alteration adjuster for",n,"failed to return a schema object"));return t=t.$_modify({each:t=>t.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),r(e&&"object"==typeof e,"Invalid options"),r(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)r("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const n=this._definition.rules[t.method],i=t.args;r(n,"Unknown rule",t.method);const o=this.clone();if(i){r(1===Object.keys(i).length||Object.keys(i).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in i){let s=i[e];if(n.argsByName){const a=n.argsByName.get(e);if(a.ref&&l.isResolvable(s))t._resolve.push(e),o.$_mutateRegister(s);else if(a.normalize&&(s=a.normalize(s),i[e]=s),a.assert){const t=l.validateArg(s,e,a);r(!t,t,"or reference")}}void 0!==s?i[e]=s:delete i[e]}}return n.multi||(o._ruleRemove(t.name,{clone:!1}),o._singleRules.set(t.name,t)),!1===o.$_temp.ruleset&&(o.$_temp.ruleset=null),n.priority?o._rules.unshift(t):o._rules.push(t),o}$_compile(e,t){return c.schema(this.$_root,e,t)}$_createError(e,t,n,r,i,o={}){const s=!1!==o.flags?this._flags:{},a=o.messages?p.merge(this._definition.messages,o.messages):this._definition.messages;return new u.Report(e,t,n,s,a,r,i)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,n,r){(n=Object.assign({},n)).abortEarly=!0,n._externals=!1,t.snapshot();const i=!y.validate(e,this,t,n,r).errors;return t.restore(),i}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),h.schema(this,e)||this}$_mutateRebuild(){return r(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,{source:t,name:n,path:r,key:i})=>{const o=this._definition[t][n]&&this._definition[t][n].register;!1!==o&&this.$_mutateRegister(e,{family:o,key:i})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:n}={}){this._refs.register(e,t),this._ids.register(e,{key:n})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,n={}){r("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const i=this._definition.flags[e]||{};if(o(t,i.default)&&(t=void 0),o(t,this._flags[e]))return this;const s=!1!==n.clone?this.clone():this;return void 0!==t?(s._flags[e]=t,s.$_mutateRegister(t)):delete s._flags[e],"_"!==e[0]&&(s.$_temp.ruleset=!1),s}$_parent(e,...t){return this[e][l.symbols.parent].call(this,...t)}$_validate(e,t,n){return y.validate(e,this,t,n)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=i(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const n in t){const r=t[n];e.$_terms[n]=r.init}return e.$_mutateRebuild()}_default(e,t,n={}){return l.assertOptions(n,"literal"),r(void 0!==t,"Missing",e,"value"),r("function"==typeof t||!n.literal,"Only function value supports literal option"),"function"==typeof t&&n.literal&&(t={[l.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,n){if(!this.$_terms.whens)return{schema:this};const r=[],i=[];for(let o=0;o<this.$_terms.whens.length;++o){const s=this.$_terms.whens[o];if(s.concat){r.push(s.concat),i.push(`${o}.concat`);continue}const a=s.ref?s.ref.resolve(e,t,n):e,l=s.is?[s]:s.switch,c=i.length;for(let c=0;c<l.length;++c){const{is:u,then:d,otherwise:f}=l[c],p=`${o}${s.switch?"."+c:""}`;if(u.$_match(a,t.nest(u,`${p}.is`),n)){if(d){const o=t.localize([...t.path,`${p}.then`],t.ancestors,t.schemas),{schema:s,id:a}=d._generate(e,o,n);r.push(s),i.push(`${p}.then${a?`(${a})`:""}`);break}}else if(f){const o=t.localize([...t.path,`${p}.otherwise`],t.ancestors,t.schemas),{schema:s,id:a}=f._generate(e,o,n);r.push(s),i.push(`${p}.otherwise${a?`(${a})`:""}`);break}}if(s.break&&i.length>c)break}const o=i.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",o),!o)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[o])return{schema:this.$_temp.whens[o],id:o};let s=this;this._definition.generate&&(s=this._definition.generate(this,e,t,n));for(const e of r)s=s.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(s,[this,...r]),this.$_temp.whens[o]=s,{schema:s,id:o}}_inner(e,t,n={}){r(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const i=this.clone();return i.$_terms[e]&&!n.override||(i.$_terms[e]=[]),n.single?i.$_terms[e].push(t):i.$_terms[e].push(...t),i.$_temp.ruleset=!1,i}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){if(!this._singleRules.has(e))return this;const n=!1!==t.clone?this.clone():this;n._singleRules.delete(e);const r=[];for(let t=0;t<n._rules.length;++t){const i=n._rules[t];i.name!==e||i.keep?r.push(i):n._inRuleset()&&t<n.$_temp.ruleset&&--n.$_temp.ruleset}return n._rules=r,n}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const n=this.clone(),i=e[0]===l.symbols.override;if(i&&(e=e.slice(1)),!n[t]&&e.length?n[t]=new b:i&&(n[t]=e.length?new b:null,n.$_mutateRebuild()),!n[t])return n;i&&n[t].override();for(const i of e){r(void 0!==i,"Cannot call allow/valid/invalid with undefined"),r(i!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";n[e]&&(n[e].remove(i),n[e].length||(r("_valids"===t||!n._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),n[e]=null)),n[t].add(i,n._refs)}return n}}};v.Base.prototype[l.symbols.any]={version:l.version,compile:c.compile,root:"$_root"},v.Base.prototype.isImmutable=!0,v.Base.prototype.deny=v.Base.prototype.invalid,v.Base.prototype.disallow=v.Base.prototype.invalid,v.Base.prototype.equal=v.Base.prototype.valid,v.Base.prototype.exist=v.Base.prototype.required,v.Base.prototype.not=v.Base.prototype.invalid,v.Base.prototype.options=v.Base.prototype.prefs,v.Base.prototype.preferences=v.Base.prototype.prefs,e.exports=new v.Base},8652:(e,t,n)=>{const{assert:r,clone:i}=n(8870),o=n(8160),s={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new s.Cache(e)},s.Cache=class{constructor(e={}){o.assertOptions(e,["max"]),r(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||s.max,this._map=new Map,this._list=new s.List}get length(){return this._map.size}set(e,t){if(null!==e&&!s.supported.has(typeof e))return;let n=this._map.get(e);if(n)return n.value=t,void this._list.first(n);n=this._list.unshift({key:e,value:t}),this._map.set(e,n),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),i(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},s.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:n}=e;return t.prev=n,n&&(n.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},8160:(e,t,n)=>{const{assert:r,AssertError:i}=n(8870),o=n(5934);let s,a;const l={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=o.version,t.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},t.assertOptions=function(e,t,n="Options"){r(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const i=Object.keys(e).filter((e=>!t.includes(e)));r(0===i.length,`${n} contain unknown keys: ${i}`)},t.checkPreferences=function(e){a=a||n(3378);const t=a.preferences.validate(e);if(t.error)throw new i([t.error.details[0].message])},t.compare=function(e,t,n){switch(n){case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}},t.default=function(e,t){return void 0===e?t:e},t.isIsoDate=function(e){return l.isoDate.test(e)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isResolvable=function(e){return!!e&&(e[t.symbols.ref]||e[t.symbols.template])},t.isSchema=function(e,n={}){const i=e&&e[t.symbols.any];return!!i&&(r(n.legacy||i.version===t.version,"Cannot mix different versions of joi schemas"),!0)},t.isValues=function(e){return e[t.symbols.values]},t.limit=function(e){return Number.isSafeInteger(e)&&e>=0},t.preferences=function(e,r){s=s||n(6914),e=e||{},r=r||{};const i=Object.assign({},e,r);return r.errors&&e.errors&&(i.errors=Object.assign({},e.errors,r.errors),i.errors.wrap=Object.assign({},e.errors.wrap,r.errors.wrap)),r.messages&&(i.messages=s.compile(r.messages,e.messages)),delete i[t.symbols.prefs],i},t.tryWithPath=function(e,t,n={}){try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,n.append&&(e.message=`${e.message} (${e.path})`),e}},t.validateArg=function(e,n,{assert:r,message:i}){if(t.isSchema(r)){const t=r.validate(e);if(!t.error)return;return t.error.message}if(!r(e))return n?`${n} ${i}`:i},t.verifyFlat=function(e,t){for(const n of e)r(!Array.isArray(n),"Method no longer accepts array arguments:",t)}},3292:(e,t,n)=>{const{assert:r}=n(8870),i=n(8160),o=n(6133),s={};t.schema=function(e,t,n={}){i.assertOptions(n,["appendPath","override"]);try{return s.schema(e,t,n)}catch(e){throw n.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},s.schema=function(e,t,n){r(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(r(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));const o=(t,...r)=>!1!==n.override?t.valid(e.override,...r):t.valid(...r);if(s.simple(t))return o(e,t);if("function"==typeof t)return e.custom(t);if(r("object"==typeof t,"Invalid schema content:",typeof t),i.isResolvable(t))return o(e,t);if(i.isSchema(t))return t;if(Array.isArray(t)){for(const n of t)if(!s.simple(n))return e.alternatives().try(...t);return o(e,...t)}return t instanceof RegExp?e.string().regex(t):t instanceof Date?o(e.date(),t):(r(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(t))},t.ref=function(e,t){return o.isRef(e)?e:o.create(e,t)},t.compile=function(e,n,o={}){i.assertOptions(o,["legacy"]);const a=n&&n[i.symbols.any];if(a)return r(o.legacy||a.version===i.version,"Cannot mix different versions of joi schemas:",a.version,i.version),n;if("object"!=typeof n||!o.legacy)return t.schema(e,n,{appendPath:!0});const l=s.walk(n);return l?l.compile(l.root,n):t.schema(e,n,{appendPath:!0})},s.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=s.walk(t);if(e)return e}return null}const t=e[i.symbols.any];if(t)return{root:e[t.root],compile:t.compile};r(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const n=s.walk(e[t]);if(n)return n}return null},s.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,n,a){if(void 0===a&&(r(n&&"object"==typeof n,"Missing options"),a=n,n=o.create(".")),Array.isArray(a)&&(a={switch:a}),i.assertOptions(a,["is","not","then","otherwise","switch","break"]),i.isSchema(n))return r(void 0===a.is,'"is" can not be used with a schema condition'),r(void 0===a.not,'"not" can not be used with a schema condition'),r(void 0===a.switch,'"switch" can not be used with a schema condition'),s.condition(e,{is:n,then:a.then,otherwise:a.otherwise,break:a.break});if(r(o.isRef(n)||"string"==typeof n,"Invalid condition:",n),r(void 0===a.not||void 0===a.is,'Cannot combine "is" with "not"'),void 0===a.switch){let l=a;void 0!==a.not&&(l={is:a.not,then:a.otherwise,otherwise:a.then,break:a.break});let c=void 0!==l.is?e.$_compile(l.is):e.$_root.invalid(null,!1,0,"").required();return r(void 0!==l.then||void 0!==l.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),r(void 0===l.break||void 0===l.then||void 0===l.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===a.is||o.isRef(a.is)||i.isSchema(a.is)||(c=c.required()),s.condition(e,{ref:t.ref(n),is:c,then:l.then,otherwise:l.otherwise,break:l.break})}r(Array.isArray(a.switch),'"switch" must be an array'),r(void 0===a.is,'Cannot combine "switch" with "is"'),r(void 0===a.not,'Cannot combine "switch" with "not"'),r(void 0===a.then,'Cannot combine "switch" with "then"');const l={ref:t.ref(n),switch:[],break:a.break};for(let t=0;t<a.switch.length;++t){const n=a.switch[t],s=t===a.switch.length-1;i.assertOptions(n,s?["is","then","otherwise"]:["is","then"]),r(void 0!==n.is,'Switch statement missing "is"'),r(void 0!==n.then,'Switch statement missing "then"');const c={is:e.$_compile(n.is),then:e.$_compile(n.then)};if(o.isRef(n.is)||i.isSchema(n.is)||(c.is=c.is.required()),s){r(void 0===a.otherwise||void 0===n.otherwise,'Cannot specify "otherwise" inside and outside a "switch"');const t=void 0!==a.otherwise?a.otherwise:n.otherwise;void 0!==t&&(r(void 0===l.break,"Cannot specify both otherwise and break"),c.otherwise=e.$_compile(t))}l.switch.push(c)}return l},s.condition=function(e,t){for(const n of["then","otherwise"])void 0===t[n]?delete t[n]:t[n]=e.$_compile(t[n]);return t}},6354:(e,t,n)=>{const r=n(514),i=n(8160),o=n(3328);t.Report=class{constructor(e,n,r,i,o,s,a){if(this.code=e,this.flags=i,this.messages=o,this.path=s.path,this.prefs=a,this.state=s,this.value=n,this.message=null,this.template=null,this.local=r||{},this.local.label=t.label(this.flags,this.state,this.prefs,this.messages),void 0===this.value||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];"object"!=typeof e&&(this.local.key=e)}}_setTemplate(e){if(this.template=e,!this.flags.label&&0===this.path.length){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const e=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return void 0===t?`Error code "${e}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(e,n){return t.template(this.value,e,n||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(const n of e)"object"!=typeof n&&("string"==typeof n?(t&&(t+="."),t+=n):t+=`[${n}]`);return t},t.template=function(e,t,n,r,s){if(!t)return;if(o.isTemplate(t))return"root"!==n?t:null;let a=s.errors.language;if(i.isResolvable(a)&&(a=a.resolve(e,r,s)),a&&t[a]){if(void 0!==t[a][n])return t[a][n];if(void 0!==t[a]["*"])return t[a]["*"]}return t[n]?t[n]:t["*"]},t.label=function(e,n,r,i){if(e.label)return e.label;if(!r.errors.label)return"";let o=n.path;return"key"===r.errors.label&&n.path.length>1&&(o=n.path.slice(-1)),t.path(o)||t.template(null,r.messages,"root",n,r)||i&&t.template(null,i,"root",n,r)||"value"},t.process=function(e,n,r){if(!e)return null;const{override:i,message:o,details:s}=t.details(e);if(i)return i;if(r.errors.stack)return new t.ValidationError(o,s,n);const a=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new t.ValidationError(o,s,n);return Error.stackTraceLimit=a,l},t.details=function(e,t={}){let n=[];const r=[];for(const i of e){if(i instanceof Error){if(!1!==t.override)return{override:i};const e=i.toString();n.push(e),r.push({message:e,type:"override",context:{error:i}});continue}const e=i.toString();n.push(e),r.push({message:e,path:i.path.filter((e=>"object"!=typeof e)),type:i.code,context:i.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}},t.ValidationError=class extends Error{constructor(e,t,n){super(e),this._original=n,this.details=t}static isError(e){return e instanceof t.ValidationError}},t.ValidationError.prototype.isJoi=!0,t.ValidationError.prototype.name="ValidationError",t.ValidationError.prototype.annotate=r.error},8901:(e,t,n)=>{const{assert:r,clone:i}=n(8870),o=n(8160),s=n(6914),a={};t.type=function(e,t){const n=Object.getPrototypeOf(e),l=i(n),c=e._assign(Object.create(l)),u=Object.assign({},t);delete u.base,l._definition=u;const d=n._definition||{};u.messages=s.merge(d.messages,u.messages),u.properties=Object.assign({},d.properties,u.properties),c.type=u.type,u.flags=Object.assign({},d.flags,u.flags);const f=Object.assign({},d.terms);if(u.terms)for(const e in u.terms){const t=u.terms[e];r(void 0===c.$_terms[e],"Invalid term override for",u.type,e),c.$_terms[e]=t.init,f[e]=t}u.terms=f,u.args||(u.args=d.args),u.prepare=a.prepare(u.prepare,d.prepare),u.coerce&&("function"==typeof u.coerce&&(u.coerce={method:u.coerce}),u.coerce.from&&!Array.isArray(u.coerce.from)&&(u.coerce={method:u.coerce.method,from:[].concat(u.coerce.from)})),u.coerce=a.coerce(u.coerce,d.coerce),u.validate=a.validate(u.validate,d.validate);const p=Object.assign({},d.rules);if(u.rules)for(const e in u.rules){const t=u.rules[e];r("object"==typeof t,"Invalid rule definition for",u.type,e);let n=t.method;if(void 0===n&&(n=function(){return this.$_addRule(e)}),n&&(r(!l[e],"Rule conflict in",u.type,e),l[e]=n),r(!p[e],"Rule conflict in",u.type,e),p[e]=t,t.alias){const e=[].concat(t.alias);for(const n of e)l[n]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map((e=>("string"==typeof e&&(e={name:e}),r(!t.argsByName.has(e.name),"Duplicated argument name",e.name),o.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e))))}u.rules=p;const h=Object.assign({},d.modifiers);if(u.modifiers)for(const e in u.modifiers){r(!l[e],"Rule conflict in",u.type,e);const t=u.modifiers[e];r("function"==typeof t,"Invalid modifier definition for",u.type,e);const n=function(t){return this.rule({[e]:t})};l[e]=n,h[e]=t}if(u.modifiers=h,u.overrides){l._super=n,c.$_super={};for(const e in u.overrides)r(n[e],"Cannot override missing",e),u.overrides[e][o.symbols.parent]=n[e],c.$_super[e]=n[e].bind(c);Object.assign(l,u.overrides)}u.cast=Object.assign({},d.cast,u.cast);const m=Object.assign({},d.manifest,u.manifest);return m.build=a.build(u.manifest&&u.manifest.build,d.manifest&&d.manifest.build),u.manifest=m,u.rebuild=a.rebuild(u.rebuild,d.rebuild),c},a.build=function(e,t){return e&&t?function(n,r){return t(e(n,r),r)}:e||t},a.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(n,r){let i;if((!t.from||t.from.includes(typeof n))&&(i=t.method(n,r),i)){if(i.errors||void 0===i.value)return i;n=i.value}if(!e.from||e.from.includes(typeof n)){const t=e.method(n,r);if(t)return t}return i}}:e||t},a.prepare=function(e,t){return e&&t?function(n,r){const i=e(n,r);if(i){if(i.errors||void 0===i.value)return i;n=i.value}return t(n,r)||i}:e||t},a.rebuild=function(e,t){return e&&t?function(n){t(n),e(n)}:e||t},a.validate=function(e,t){return e&&t?function(n,r){const i=t(n,r);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;n=i.value}return e(n,r)||i}:e||t}},5107:(e,t,n)=>{const{assert:r,clone:i}=n(8870),o=n(8652),s=n(8160),a=n(3292),l=n(6354),c=n(8901),u=n(1123),d=n(6133),f=n(3328),p=n(2305);let h;const m={types:{alternatives:n(4946),any:n(8068),array:n(546),boolean:n(4937),date:n(7500),function:n(390),link:n(8785),number:n(3832),object:n(8966),string:n(7417),symbol:n(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const e={_types:new Set(Object.keys(m.types))};for(const t of e._types)e[t]=function(...e){return r(!e.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments"),m.generate(this,m.types[t],e)};for(const t of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])e[t]=function(...e){return this.any()[t](...e)};Object.assign(e,m.methods);for(const t in m.aliases){const n=m.aliases[t];e[t]=e[n]}return e.x=e.expression,p.setup&&p.setup(e),e}};m.methods={ValidationError:l.ValidationError,version:s.version,cache:o.provider,assert(e,t,...n){m.assert(e,t,!0,n)},attempt:(e,t,...n)=>m.assert(e,t,!1,n),build(e){return r("function"==typeof u.build,"Manifest functionality disabled"),u.build(this,e)},checkPreferences(e){s.checkPreferences(e)},compile(e,t){return a.compile(this,e,t)},defaults(e){r("function"==typeof e,"modifier must be a function");const t=Object.assign({},this);for(const n of t._types){const i=e(t[n]());r(s.isSchema(i),"modifier must return a valid schema object"),t[n]=function(...e){return m.generate(this,i,e)}}return t},expression:(...e)=>new f(...e),extend(...e){s.verifyFlat(e,"extend"),h=h||n(3378),r(e.length,"You need to provide at least one extension"),this.assert(e,h.extensions);const t=Object.assign({},this);t._types=new Set(t._types);for(let n of e){"function"==typeof n&&(n=n(t)),this.assert(n,h.extension);const e=m.expandExtension(n,t);for(const n of e){r(void 0===t[n.type]||t._types.has(n.type),"Cannot override name",n.type);const e=n.base||this.any(),i=c.type(e,n);t._types.add(n.type),t[n.type]=function(...e){return m.generate(this,i,e)}}}return t},isError:l.ValidationError.isError,isExpression:f.isTemplate,isRef:d.isRef,isSchema:s.isSchema,in:(...e)=>d.in(...e),override:s.symbols.override,ref:(...e)=>d.create(...e),types(){const e={};for(const t of this._types)e[t]=this[t]();for(const t in m.aliases)e[t]=this[t]();return e}},m.assert=function(e,t,n,r){const o=r[0]instanceof Error||"string"==typeof r[0]?r[0]:null,a=null!==o?r[1]:r[0],c=t.validate(e,s.preferences({errors:{stack:!0}},a||{}));let u=c.error;if(!u)return c.value;if(o instanceof Error)throw o;const d=n&&"function"==typeof u.annotate?u.annotate():u.message;throw u instanceof l.ValidationError==0&&(u=i(u)),u.message=o?`${o} ${d}`:d,u},m.generate=function(e,t,n){return r(e,"Must be invoked on a Joi instance."),t.$_root=e,t._definition.args&&n.length?t._definition.args(t,...n):t},m.expandExtension=function(e,t){if("string"==typeof e.type)return[e];const n=[];for(const r of t._types)if(e.type.test(r)){const i=Object.assign({},e);i.type=r,i.base=t[r](),n.push(i)}return n},e.exports=m.root()},1123:(e,t,n)=>{const{assert:r,clone:i}=n(8870),o=n(8160),s=n(6914),a=n(6133),l=n(3328);let c;const u={};t.describe=function(e){const t=e._definition,n={type:e.type,flags:{},rules:[]};for(const t in e._flags)"_"!==t[0]&&(n.flags[t]=u.describe(e._flags[t]));Object.keys(n.flags).length||delete n.flags,e._preferences&&(n.preferences=i(e._preferences,{shallow:["messages"]}),delete n.preferences[o.symbols.prefs],n.preferences.messages&&(n.preferences.messages=s.decompile(n.preferences.messages))),e._valids&&(n.allow=e._valids.describe()),e._invalids&&(n.invalid=e._invalids.describe());for(const r of e._rules){if(!1===t.rules[r.name].manifest)continue;const e={name:r.name};for(const n in t.modifiers)void 0!==r[n]&&(e[n]=u.describe(r[n]));if(r.args){e.args={};for(const t in r.args){const n=r.args[t];("options"!==t||Object.keys(n).length)&&(e.args[t]=u.describe(n,{assign:t}))}Object.keys(e.args).length||delete e.args}n.rules.push(e)}n.rules.length||delete n.rules;for(const i in e.$_terms){if("_"===i[0])continue;r(!n[i],"Cannot describe schema due to internal name conflict with",i);const s=e.$_terms[i];if(!s)continue;if(s instanceof Map){s.size&&(n[i]=[...s.entries()]);continue}if(o.isValues(s)){n[i]=s.describe();continue}r(t.terms[i],"Term",i,"missing configuration");const a=t.terms[i].manifest,l="object"==typeof a;if(!s.length&&!l)continue;const c=[];for(const e of s)c.push(u.describe(e));if(l){const{from:e,to:t}=a.mapped;n[i]={};for(const r of c)n[i][r[t]]=r[e]}else"single"!==a?n[i]=c:(r(1===c.length,"Term",i,"contains more than one item"),n[i]=c[0])}return u.validate(e.$_root,n),n},u.describe=function(e,t={}){if(Array.isArray(e))return e.map(u.describe);if(e===o.symbols.deepDefault)return{special:"deep"};if("object"!=typeof e||null===e)return e;if("options"===t.assign)return i(e);if(e instanceof Date)return e.toISOString();if(e instanceof Error)return e;if(e instanceof RegExp)return"regex"===t.assign?e.toString():{regex:e.toString()};if(e[o.symbols.literal])return{function:e.literal};if("function"==typeof e.describe)return"ref"===t.assign?e.describe().ref:e.describe();const n={};for(const t in e){const r=e[t];void 0!==r&&(n[t]=u.describe(r,{assign:t}))}return n},t.build=function(e,t){return new u.Builder(e).parse(t)},u.Builder=class{constructor(e){this.joi=e}parse(e){u.validate(this.joi,e);let t=this.joi[e.type]()._bare();const n=t._definition;if(e.flags)for(const i in e.flags){const o=n.flags[i]&&n.flags[i].setter||i;r("function"==typeof t[o],"Invalid flag",i,"for type",e.type),t=t[o](this.build(e.flags[i]))}if(e.preferences&&(t=t.preferences(this.build(e.preferences))),e.allow&&(t=t.allow(...this.build(e.allow))),e.invalid&&(t=t.invalid(...this.build(e.invalid))),e.rules)for(const i of e.rules){r("function"==typeof t[i.name],"Invalid rule",i.name,"for type",e.type);const o=[];if(i.args){const t={};for(const e in i.args)t[e]=this.build(i.args[e],{assign:e});const s=Object.keys(t),a=n.rules[i.name].args;if(a){r(s.length<=a.length,"Invalid number of arguments for",e.type,i.name,"(expected up to",a.length,", found",s.length,")");for(const{name:e}of a)o.push(t[e])}else r(1===s.length,"Invalid number of arguments for",e.type,i.name,"(expected up to 1, found",s.length,")"),o.push(t[s[0]])}t=t[i.name](...o);const s={};for(const e in n.modifiers)void 0!==i[e]&&(s[e]=this.build(i[e]));Object.keys(s).length&&(t=t.rule(s))}const i={};for(const t in e){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(t))continue;r(n.terms[t],"Term",t,"missing configuration");const o=n.terms[t].manifest;if("schema"!==o)if("values"!==o)if("single"!==o)if("object"!=typeof o)i[t]=this.build(e[t]);else{i[t]={};for(const n in e[t]){const r=e[t][n];i[t][n]=this.parse(r)}}else i[t]=this.build(e[t]);else i[t]=e[t].map((e=>this.build(e)));else i[t]=e[t].map((e=>this.parse(e)))}return e.whens&&(i.whens=e.whens.map((e=>this.build(e)))),t=n.manifest.build(t,i),t.$_temp.ruleset=!1,t}build(e,t={}){if(null===e)return null;if(Array.isArray(e))return e.map((e=>this.build(e)));if(e instanceof Error)return e;if("options"===t.assign)return i(e);if("regex"===t.assign)return u.regex(e);if("ref"===t.assign)return a.build(e);if("object"!=typeof e)return e;if(1===Object.keys(e).length){if(e.buffer)return r(!1,"Buffers are not supported"),!1;if(e.function)return{[o.symbols.literal]:!0,literal:e.function};if(e.override)return o.symbols.override;if(e.ref)return a.build(e.ref);if(e.regex)return u.regex(e.regex);if(e.special)return r(["deep"].includes(e.special),"Unknown special value",e.special),o.symbols.deepDefault;if(e.value)return i(e.value)}if(e.type)return this.parse(e);if(e.template)return l.build(e);const n={};for(const t in e)n[t]=this.build(e[t],{assign:t});return n}},u.regex=function(e){const t=e.lastIndexOf("/"),n=e.slice(1,t),r=e.slice(t+1);return new RegExp(n,r)},u.validate=function(e,t){c=c||n(3378),e.assert(t,c.description)}},6914:(e,t,n)=>{const{assert:r,clone:i}=n(8870),o=n(3328);t.compile=function(e,t){if("string"==typeof e)return r(!t,"Cannot set single message string"),new o(e);if(o.isTemplate(e))return r(!t,"Cannot set single message template"),e;r("object"==typeof e&&!Array.isArray(e),"Invalid message options"),t=t?i(t):{};for(let n in e){const i=e[n];if("root"===n||o.isTemplate(i)){t[n]=i;continue}if("string"==typeof i){t[n]=new o(i);continue}r("object"==typeof i&&!Array.isArray(i),"Invalid message for",n);const s=n;for(n in t[s]=t[s]||{},i){const e=i[n];"root"===n||o.isTemplate(e)?t[s][n]=e:(r("string"==typeof e,"Invalid message for",n,"in",s),t[s][n]=new o(e))}}return t},t.decompile=function(e){const t={};for(let n in e){const r=e[n];if("root"===n){t.root=r;continue}if(o.isTemplate(r)){t[n]=r.describe({compact:!0});continue}const i=n;for(n in t[i]={},r){const e=r[n];"root"!==n?t[i][n]=e.describe({compact:!0}):t[i].root=e}}return t},t.merge=function(e,n){if(!e)return t.compile(n);if(!n)return e;if("string"==typeof n)return new o(n);if(o.isTemplate(n))return n;const s=i(e);for(let e in n){const t=n[e];if("root"===e||o.isTemplate(t)){s[e]=t;continue}if("string"==typeof t){s[e]=new o(t);continue}r("object"==typeof t&&!Array.isArray(t),"Invalid message for",e);const i=e;for(e in s[i]=s[i]||{},t){const n=t[e];"root"===e||o.isTemplate(n)?s[i][e]=n:(r("string"==typeof n,"Invalid message for",e,"in",i),s[i][e]=new o(n))}}return s}},2294:(e,t,n)=>{const{assert:r}=n(8870),i=n(8160),o=n(6133),s={};t.Ids=s.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new s.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,n]of e._byId.entries())r(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,n);for(const[t,n]of e._byKey.entries())r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,n)}fork(e,t,n){const o=this._collect(e);o.push({schema:n});const a=o.shift();let l={id:a.id,schema:t(a.schema)};r(i.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of o)l={id:e.id,schema:s.fork(e.schema,l.id,l.schema)};return l.schema}labels(e,t=[]){const n=e[0],r=this._get(n);if(!r)return[...t,...e].join(".");const i=e.slice(1);return t=[...t,r.schema._flags.label||n],i.length?r.schema._ids.labels(i,t):t.join(".")}reach(e,t=[]){const n=e[0],i=this._get(n);r(i,"Schema does not contain path",[...t,...e].join("."));const o=e.slice(1);return o.length?i.schema._ids.reach(o,[...t,n]):i.schema}register(e,{key:t}={}){if(!e||!i.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const n=e._flags.id;if(n){const t=this._byId.get(n);r(!t||t.schema===e,"Cannot add different schemas with the same id:",n),r(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:e,id:n})}t&&(r(!this._byKey.has(t),"Schema already contains key:",t),r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,t=[],n=[]){const i=e[0],o=this._get(i);r(o,"Schema does not contain path",[...t,...e].join(".")),n=[o,...n];const s=e.slice(1);return s.length?o.schema._ids._collect(s,[...t,i],n):n}_get(e){return this._byId.get(e)||this._byKey.get(e)}},s.fork=function(e,n,r){const i=t.schema(e,{each:(e,{key:t})=>{if(n===(e._flags.id||t))return r},ref:!1});return i?i.$_mutateRebuild():e},t.schema=function(e,t){let n;for(const r in e._flags){if("_"===r[0])continue;const i=s.scan(e._flags[r],{source:"flags",name:r},t);void 0!==i&&(n=n||e.clone(),n._flags[r]=i)}for(let r=0;r<e._rules.length;++r){const i=e._rules[r],o=s.scan(i.args,{source:"rules",name:i.name},t);if(void 0!==o){n=n||e.clone();const t=Object.assign({},i);t.args=o,n._rules[r]=t,n._singleRules.get(i.name)===i&&n._singleRules.set(i.name,t)}}for(const r in e.$_terms){if("_"===r[0])continue;const i=s.scan(e.$_terms[r],{source:"terms",name:r},t);void 0!==i&&(n=n||e.clone(),n.$_terms[r]=i)}return n},s.scan=function(e,t,n,r,a){const l=r||[];if(null===e||"object"!=typeof e)return;let c;if(Array.isArray(e)){for(let r=0;r<e.length;++r){const i="terms"===t.source&&"keys"===t.name&&e[r].key,o=s.scan(e[r],t,n,[r,...l],i);void 0!==o&&(c=c||e.slice(),c[r]=o)}return c}if(!1!==n.schema&&i.isSchema(e)||!1!==n.ref&&o.isRef(e)){const r=n.each(e,{...t,path:l,key:a});if(r===e)return;return r}for(const r in e){if("_"===r[0])continue;const i=s.scan(e[r],t,n,[r,...l],a);void 0!==i&&(c=c||Object.assign({},e),c[r]=i)}return c}},6133:(e,t,n)=>{const{assert:r,clone:i,reach:o}=n(8870),s=n(8160);let a;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e,t={}){r("string"==typeof e,"Invalid reference key:",e),s.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),r(!t.prefix||"object"==typeof t.prefix,"options.prefix must be of type object");const n=Object.assign({},l.defaults,t);delete n.prefix;const i=n.separator,o=l.context(e,i,t.prefix);if(n.type=o.type,e=o.key,"value"===n.type)if(o.root&&(r(!i||e[0]!==i,"Cannot specify relative path with root prefix"),n.ancestor="root",e||(e=null)),i&&i===e)e=null,n.ancestor=0;else if(void 0!==n.ancestor)r(!i||!e||e[0]!==i,"Cannot combine prefix with ancestor option");else{const[t,r]=l.ancestor(e,i);r&&""===(e=e.slice(r))&&(e=null),n.ancestor=t}return n.path=i?null===e?[]:e.split(i):[e],new l.Ref(n)},t.in=function(e,n={}){return t.create(e,{...n,in:!0})},t.isRef=function(e){return!!e&&!!e[s.symbols.ref]},l.Ref=class{constructor(e){r("object"==typeof e,"Invalid reference construction"),s.assertOptions(e,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),r([!1,void 0].includes(e.separator)||"string"==typeof e.separator&&1===e.separator.length,"Invalid separator"),r(!e.adjust||"function"==typeof e.adjust,"options.adjust must be a function"),r(!e.map||Array.isArray(e.map),"options.map must be an array"),r(!e.map||!e.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,e),r("value"===this.type||void 0===this.ancestor,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(e,t,n,i,o={}){return r(!this.in||o.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(n.context,t,o):"local"===this.type?this._resolve(i,t,o):this.ancestor?"root"===this.ancestor?this._resolve(t.ancestors[t.ancestors.length-1],t,o):(r(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,o)):this._resolve(e,t,o)}_resolve(e,t,n){let r;if("value"===this.type&&t.mainstay.shadow&&!1!==n.shadow&&(r=t.mainstay.shadow.get(this.absolute(t))),void 0===r&&(r=o(e,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){const e=this.map.get(r);void 0!==e&&(r=e)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,r),r}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const e={path:this.path};"value"!==this.type&&(e.type=this.type),"."!==this.separator&&(e.separator=this.separator),"value"===this.type&&1!==this.ancestor&&(e.ancestor=this.ancestor),this.map&&(e.map=[...this.map]);for(const t of["adjust","iterables","render"])null!==this[t]&&void 0!==this[t]&&(e[t]=this[t]);return!1!==this.in&&(e.in=!0),{ref:e}}updateDisplay(){const e=null!==this.key?this.key:"";if("value"!==this.type)return void(this.display=`ref:${this.type}:${e}`);if(!this.separator)return void(this.display=`ref:${e}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${e}`);if("root"===this.ancestor)return void(this.display=`ref:root:${e}`);if(1===this.ancestor)return void(this.display=`ref:${e||".."}`);const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}},l.Ref.prototype[s.symbols.ref]=!0,t.build=function(e){return"value"===(e=Object.assign({},l.defaults,e)).type&&void 0===e.ancestor&&(e.ancestor=1),new l.Ref(e)},l.context=function(e,t,n={}){if(e=e.trim(),n){const r=void 0===n.global?"$":n.global;if(r!==t&&e.startsWith(r))return{key:e.slice(r.length),type:"global"};const i=void 0===n.local?"#":n.local;if(i!==t&&e.startsWith(i))return{key:e.slice(i.length),type:"local"};const o=void 0===n.root?"/":n.root;if(o!==t&&e.startsWith(o))return{key:e.slice(o.length),type:"value",root:!0}}return{key:e,type:"value"}},l.ancestor=function(e,t){if(!t)return[1,0];if(e[0]!==t)return[1,0];if(e[1]!==t)return[0,1];let n=2;for(;e[n]===t;)++n;return[n-1,n]},t.toSibling=0,t.toParent=1,t.Manager=class{constructor(){this.refs=[]}register(e,r){if(e)if(r=void 0===r?t.toParent:r,Array.isArray(e))for(const t of e)this.register(t,r);else if(s.isSchema(e))for(const t of e._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-r>=0&&this.refs.push({ancestor:e.ancestor-r,root:e.root}),a=a||n(3328),a.isTemplate(e)&&this.register(e.refs(),r)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=i(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter((e=>!e.ancestor)).map((e=>e.root))}}},3378:(e,t,n)=>{const r=n(5107),i={};i.wrap=r.string().min(1).max(2).allow(!1),t.preferences=r.object({allowUnknown:r.boolean(),abortEarly:r.boolean(),artifacts:r.boolean(),cache:r.boolean(),context:r.object(),convert:r.boolean(),dateFormat:r.valid("date","iso","string","time","utc"),debug:r.boolean(),errors:{escapeHtml:r.boolean(),label:r.valid("path","key",!1),language:[r.string(),r.object().ref()],render:r.boolean(),stack:r.boolean(),wrap:{label:i.wrap,array:i.wrap,string:i.wrap}},externals:r.boolean(),messages:r.object(),noDefaults:r.boolean(),nonEnumerables:r.boolean(),presence:r.valid("required","optional","forbidden"),skipFunctions:r.boolean(),stripUnknown:r.object({arrays:r.boolean(),objects:r.boolean()}).or("arrays","objects").allow(!0,!1),warnings:r.boolean()}).strict(),i.nameRx=/^[a-zA-Z0-9]\w*$/,i.rule=r.object({alias:r.array().items(r.string().pattern(i.nameRx)).single(),args:r.array().items(r.string(),r.object({name:r.string().pattern(i.nameRx).required(),ref:r.boolean(),assert:r.alternatives([r.function(),r.object().schema()]).conditional("ref",{is:!0,then:r.required()}),normalize:r.function(),message:r.string().when("assert",{is:r.function(),then:r.required()})})),convert:r.boolean(),manifest:r.boolean(),method:r.function().allow(!1),multi:r.boolean(),validate:r.function()}),t.extension=r.object({type:r.alternatives([r.string(),r.object().regex()]).required(),args:r.function(),cast:r.object().pattern(i.nameRx,r.object({from:r.function().maxArity(1).required(),to:r.function().minArity(1).maxArity(2).required()})),base:r.object().schema().when("type",{is:r.object().regex(),then:r.forbidden()}),coerce:[r.function().maxArity(3),r.object({method:r.function().maxArity(3).required(),from:r.array().items(r.string()).single()})],flags:r.object().pattern(i.nameRx,r.object({setter:r.string(),default:r.any()})),manifest:{build:r.function().arity(2)},messages:[r.object(),r.string()],modifiers:r.object().pattern(i.nameRx,r.function().minArity(1).maxArity(2)),overrides:r.object().pattern(i.nameRx,r.function()),prepare:r.function().maxArity(3),rebuild:r.function().arity(1),rules:r.object().pattern(i.nameRx,i.rule),terms:r.object().pattern(i.nameRx,r.object({init:r.array().allow(null).required(),manifest:r.object().pattern(/.+/,[r.valid("schema","single"),r.object({mapped:r.object({from:r.string().required(),to:r.string().required()}).required()})])})),validate:r.function().maxArity(3)}).strict(),t.extensions=r.array().items(r.object(),r.function().arity(1)).strict(),i.desc={buffer:r.object({buffer:r.string()}),func:r.object({function:r.function().required(),options:{literal:!0}}),override:r.object({override:!0}),ref:r.object({ref:r.object({type:r.valid("value","global","local"),path:r.array().required(),separator:r.string().length(1).allow(!1),ancestor:r.number().min(0).integer().allow("root"),map:r.array().items(r.array().length(2)).min(1),adjust:r.function(),iterables:r.boolean(),in:r.boolean(),render:r.boolean()}).required()}),regex:r.object({regex:r.string().min(3)}),special:r.object({special:r.valid("deep").required()}),template:r.object({template:r.string().required(),options:r.object()}),value:r.object({value:r.alternatives([r.object(),r.array()]).required()})},i.desc.entity=r.alternatives([r.array().items(r.link("...")),r.boolean(),r.function(),r.number(),r.string(),i.desc.buffer,i.desc.func,i.desc.ref,i.desc.regex,i.desc.special,i.desc.template,i.desc.value,r.link("/")]),i.desc.values=r.array().items(null,r.boolean(),r.function(),r.number().allow(1/0,-1/0),r.string().allow(""),r.symbol(),i.desc.buffer,i.desc.func,i.desc.override,i.desc.ref,i.desc.regex,i.desc.template,i.desc.value),i.desc.messages=r.object().pattern(/.+/,[r.string(),i.desc.template,r.object().pattern(/.+/,[r.string(),i.desc.template])]),t.description=r.object({type:r.string().required(),flags:r.object({cast:r.string(),default:r.any(),description:r.string(),empty:r.link("/"),failover:i.desc.entity,id:r.string(),label:r.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:r.boolean(),unit:r.string()}).unknown(),preferences:{allowUnknown:r.boolean(),abortEarly:r.boolean(),artifacts:r.boolean(),cache:r.boolean(),convert:r.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:r.boolean(),label:["path","key"],language:[r.string(),i.desc.ref],wrap:{label:i.wrap,array:i.wrap}},externals:r.boolean(),messages:i.desc.messages,noDefaults:r.boolean(),nonEnumerables:r.boolean(),presence:["required","optional","forbidden"],skipFunctions:r.boolean(),stripUnknown:r.object({arrays:r.boolean(),objects:r.boolean()}).or("arrays","objects").allow(!0,!1),warnings:r.boolean()},allow:i.desc.values,invalid:i.desc.values,rules:r.array().min(1).items({name:r.string().required(),args:r.object().min(1),keep:r.boolean(),message:[r.string(),i.desc.messages],warn:r.boolean()}),keys:r.object().pattern(/.*/,r.link("/")),link:i.desc.ref}).pattern(/^[a-z]\w*$/,r.any())},493:(e,t,n)=>{const{clone:r,reach:i}=n(8870),o=n(8160),s={value:Symbol("value")};e.exports=s.State=class{constructor(e,t,n){this.path=e,this.ancestors=t,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(e,t=null,n=null){const r=new s.State(e,t,this);return n&&r.schemas&&(r.schemas=[s.schemas(n),...r.schemas]),r}nest(e,t){const n=new s.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[s.schemas(e),...n.schemas],n.debug=t,n}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new s.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=r(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()}},s.schemas=function(e){return o.isSchema(e)?{schema:e}:e},s.Shadow=class{constructor(){this._values=null}set(e,t,n){if(!e.length)return;if("strip"===n&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const n=e[t];let i=r.get(n);i||(i=new Map,r.set(n,i)),r=i}r[s.value]=t}get(e){const t=this.node(e);if(t)return t[s.value]}node(e){if(this._values)return i(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;const n=e.slice(0,-1),r=e[e.length-1],o=i(this._values,n,{iterables:!0});t?o.set(r,t):o&&o.delete(r)}}},3328:(e,t,n)=>{const{assert:r,clone:i,escapeHtml:o}=n(8870),s=n(4964),a=n(8160),l=n(6354),c=n(6133),u={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};e.exports=u.Template=class{constructor(e,t){if(r("string"==typeof e,"Template source must be a string"),r(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,t){const{functions:e,...n}=t;this._settings=Object.keys(n).length?i(n):void 0,this._functions=e,this._functions&&(r(Object.keys(this._functions).every((e=>"string"==typeof e)),"Functions keys must be strings"),r(Object.values(this._functions).every((e=>"function"==typeof e)),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const e=u.encode(this.source),t=u.split(e);let n=!1;const r=[],i=t.shift();i&&r.push(i);for(const e of t){const t="{"!==e[0],i=t?"}":"}}",o=e.indexOf(i);if(-1===o||"{"===e[1]){r.push(`{${u.decode(e)}`);continue}let s=e.slice(t?0:1,o);const a=":"===s[0];a&&(s=s.slice(1));const l=this._ref(u.decode(s),{raw:t,wrapped:a});r.push(l),"string"!=typeof l&&(n=!0);const c=e.slice(o+i.length);c&&r.push(u.decode(c))}n?this._template=r:this.rendered=r.join("")}static date(e,t){return u.dateFormat[t.dateFormat].call(e)}describe(e={}){if(!this._settings&&e.compact)return this.source;const t={template:this.source};return this._settings&&(t.options=this._settings),this._functions&&(t.functions=this._functions),t}static build(e){return new u.Template(e.template,e.options||e.functions?{...e.options,functions:e.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[a.symbols.template]}refs(){if(!this._template)return;const e=[];for(const t of this._template)"string"!=typeof t&&e.push(...t.refs);return e}resolve(e,t,n,r){return this._template&&1===this._template.length?this._part(this._template[0],e,t,n,r,{}):this.render(e,t,n,r)}_part(e,...t){return e.ref?e.ref.resolve(...t):e.formula.evaluate(t)}render(e,t,n,r,i={}){if(!this.isDynamic())return this.rendered;const s=[];for(const a of this._template)if("string"==typeof a)s.push(a);else{const l=this._part(a,e,t,n,r,i),c=u.stringify(l,e,t,n,r,i);if(void 0!==c){const e=a.raw||!1===(i.errors&&i.errors.escapeHtml)?c:o(c);s.push(u.wrap(e,a.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(e,{raw:t,wrapped:n}){const r=[],i=e=>{const t=c.create(e,this._settings);return r.push(t),e=>{const n=t.resolve(...e);return void 0!==n?n:null}};try{const t=this._functions?{...u.functions,...this._functions}:u.functions;var o=new s.Parser(e,{reference:i,functions:t,constants:u.constants})}catch(t){throw t.message=`Invalid template variable "${e}" fails due to: ${t.message}`,t}if(o.single){if("reference"===o.single.type){const e=r[0];return{ref:e,raw:t,refs:r,wrapped:n||"local"===e.type&&"label"===e.key}}return u.stringify(o.single.value)}return{formula:o,raw:t,refs:r}}toString(){return this.source}},u.Template.prototype[a.symbols.template]=!0,u.Template.prototype.isImmutable=!0,u.encode=function(e){return e.replace(/\\(\{+)/g,((e,t)=>u.opens.slice(0,t.length))).replace(/\\(\}+)/g,((e,t)=>u.closes.slice(0,t.length)))},u.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},u.split=function(e){const t=[];let n="";for(let r=0;r<e.length;++r){const i=e[r];if("{"===i){let i="";for(;r+1<e.length&&"{"===e[r+1];)i+="{",++r;t.push(n),n=i}else n+=i}return t.push(n),t},u.wrap=function(e,t){return t?1===t.length?`${t}${e}${t}`:`${t[0]}${e}${t[1]}`:e},u.stringify=function(e,t,n,r,i,o={}){const s=typeof e,a=r&&r.errors&&r.errors.wrap||{};let l=!1;if(c.isRef(e)&&e.render&&(l=e.in,e=e.resolve(t,n,r,i,{in:e.in,...o})),null===e)return"null";if("string"===s)return u.wrap(e,o.arrayItems&&a.string);if("number"===s||"function"===s||"symbol"===s)return e.toString();if("object"!==s)return JSON.stringify(e);if(e instanceof Date)return u.Template.date(e,r);if(e instanceof Map){const t=[];for(const[n,r]of e.entries())t.push(`${n.toString()} -> ${r.toString()}`);e=t}if(!Array.isArray(e))return e.toString();const d=[];for(const s of e)d.push(u.stringify(s,t,n,r,i,{arrayItems:!0,...o}));return u.wrap(d.join(", "),!l&&a.array)},u.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},u.functions={if:(e,t,n)=>e?t:n,length:e=>"string"==typeof e?e.length:e&&"object"==typeof e?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){const[t,n,r,i,o]=this,s=o.messages;if(!s)return"";const a=l.template(t,s[0],e,n,r)||l.template(t,s[1],e,n,r);return a?a.render(t,n,r,i,o):""},number:e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e):"boolean"==typeof e?e?1:0:e instanceof Date?e.getTime():null}},2305:(e,t,n)=>{const{deepEqual:r}=n(8870),i=n(7593),o=n(6354),s={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};t.setup=function(e){const t=function(){return e._tracer=e._tracer||new s.Tracer,e._tracer};e.trace=t,e[Symbol.for("@hapi/lab/coverage/initialize")]=t,e.untrace=()=>{e._tracer=null}},t.location=function(e){return e.$_setFlag("_tracerLocation",i.location(2))},s.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(e){const t=this._schemas.get(e);if(t)return t.store;const n=new s.Store(e),{filename:r,line:o}=e._flags._tracerLocation||i.location(5);return this._schemas.set(e,{filename:r,line:o,store:n}),n}_combine(e,t){for(const{store:n}of this._schemas.values())n._combine(e,t)}report(e){const t=[];for(const{filename:n,line:r,store:i}of this._schemas.values()){if(e&&e!==n)continue;const o=[],a=[];for(const[e,t]of i._sources.entries()){if(s.sub(t.paths,a))continue;if(!t.entry){o.push({status:"never reached",paths:[...t.paths]}),a.push(...t.paths);continue}for(const n of["valid","invalid"]){const r=e[`_${n}s`];if(!r)continue;const i=new Set(r._values),s=new Set(r._refs);for(const{value:e,ref:r}of t[n])i.delete(e),s.delete(r);(i.size||s.size)&&o.push({status:[...i,...[...s].map((e=>e.display))],rule:`${n}s`})}const n=e._rules.map((e=>e.name));for(const t of["default","failover"])void 0!==e._flags[t]&&n.push(t);for(const e of n){const n=s.labels[t.rule[e]||0];if(n){const r={rule:e,status:n};t.paths.size&&(r.paths=[...t.paths]),o.push(r)}}}o.length&&t.push({filename:n,line:r,missing:o,severity:"error",message:`Schema missing tests for ${o.map(s.message).join(", ")}`})}return t.length?t:null}},s.Store=class{constructor(e){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(e)}debug(e,t,n,r){e.mainstay.debug&&e.mainstay.debug.push({type:t,name:n,result:r,path:e.path})}entry(e,t){s.debug(t,{type:"entry"}),this._record(e,(e=>{e.entry=!0}))}filter(e,t,n,r){s.debug(t,{type:n,...r}),this._record(e,(e=>{e[n].add(r)}))}log(e,t,n,r,i){s.debug(t,{type:n,name:r,result:"full"===i?"pass":i}),this._record(e,(e=>{e[n][r]=e[n][r]||0,e[n][r]|=s.codes[i]}))}resolve(e,t,n){if(!e.mainstay.debug)return;const r={type:"resolve",ref:t.display,to:n,path:e.path};e.mainstay.debug.push(r)}value(e,t,n,i,o){if(!e.mainstay.debug||r(n,i))return;const s={type:"value",by:t,from:n,to:i,path:e.path};o&&(s.name=o),e.mainstay.debug.push(s)}_record(e,t){const n=this._sources.get(e);if(n)return void t(n);const r=this._combos.get(e);for(const e of r)this._record(e,t)}_scan(e,t){const n=t||[];let r=this._sources.get(e);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(e,r)),n.length&&r.paths.add(n),e.$_modify({each:(e,t)=>{const r=s.id(e,t);this._scan(e,n.concat(r))},ref:!1})}_combine(e,t){this._combos.set(e,t)}},s.message=function(e){return`${e.paths?o.path(e.paths[0])+(e.rule?":":""):""}${e.rule||""} (${e.status})`},s.id=function(e,{source:t,name:n,path:r,key:i}){return e._flags.id?e._flags.id:i||(n=`@${n}`,"terms"===t?[n,r[Math.min(r.length-1,1)]]:n)},s.sub=function(e,t){for(const n of e)for(const e of t)if(r(n.slice(0,e.length),e))return!0;return!1},s.debug=function(e,t){e.mainstay.debug&&(t.path=e.debug?[...e.path,e.debug]:e.path,e.mainstay.debug.push(t))}},4946:(e,t,n)=>{const{assert:r,merge:i}=n(8870),o=n(8068),s=n(8160),a=n(3292),l=n(6354),c=n(6133),u={};e.exports=o.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:c.toSibling}},args:(e,...t)=>1===t.length&&Array.isArray(t[0])?e.try(...t[0]):e.try(...t),validate(e,t){const{schema:n,error:r,state:o,prefs:s}=t;if(n._flags.match){const t=[],a=[];for(let r=0;r<n.$_terms.matches.length;++r){const i=n.$_terms.matches[r],l=o.nest(i.schema,`match.${r}`);l.snapshot();const c=i.schema.$_validate(e,l,s);c.errors?(a.push(c.errors),l.restore()):(t.push(c.value),l.commit())}if(0===t.length)return{errors:r("alternatives.any",{details:a.map((e=>l.details(e,{override:!1})))})};if("one"===n._flags.match)return 1===t.length?{value:t[0]}:{errors:r("alternatives.one")};if(t.length!==n.$_terms.matches.length)return{errors:r("alternatives.all",{details:a.map((e=>l.details(e,{override:!1})))})};const c=e=>e.$_terms.matches.some((e=>"object"===e.schema.type||"alternatives"===e.schema.type&&c(e.schema)));return c(n)?{value:t.reduce(((e,t)=>i(e,t,{mergeArrays:!1})))}:{value:t[t.length-1]}}const a=[];for(let t=0;t<n.$_terms.matches.length;++t){const r=n.$_terms.matches[t];if(r.schema){const n=o.nest(r.schema,`match.${t}`);n.snapshot();const i=r.schema.$_validate(e,n,s);if(!i.errors)return n.commit(),i;n.restore(),a.push({schema:r.schema,reports:i.errors});continue}const i=r.ref?r.ref.resolve(e,o,s):e,l=r.is?[r]:r.switch;for(let n=0;n<l.length;++n){const a=l[n],{is:c,then:u,otherwise:d}=a,f=`match.${t}${r.switch?"."+n:""}`;if(c.$_match(i,o.nest(c,`${f}.is`),s)){if(u)return u.$_validate(e,o.nest(u,`${f}.then`),s)}else if(d)return d.$_validate(e,o.nest(d,`${f}.otherwise`),s)}}return u.errors(a,t)},rules:{conditional:{method(e,t){r(!this._flags._endedSwitch,"Unreachable condition"),r(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),r(void 0===t.break,"Cannot use break option with alternatives conditional");const n=this.clone(),i=a.when(n,e,t),o=i.is?[i]:i.switch;for(const e of o)if(e.then&&e.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(i),n.$_mutateRebuild()}},match:{method(e){if(r(["any","one","all"].includes(e),"Invalid alternatives match mode",e),"any"!==e)for(const t of this.$_terms.matches)r(t.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(...e){r(e.length,"Missing alternative schemas"),s.verifyFlat(e,"try"),r(!this._flags._endedSwitch,"Unreachable condition");const t=this.clone();for(const n of e)t.$_terms.matches.push({schema:t.$_compile(n)});return t.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,n)=>"is"!==n.path[0]?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{s.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const n of t.matches){const{schema:t,ref:r,is:i,not:o,then:s,otherwise:a}=n;e=t?e.try(t):r?e.conditional(r,{is:i,then:s,not:o,otherwise:a,switch:n.switch}):e.conditional(i,{then:s,otherwise:a})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),u.errors=function(e,{error:t,state:n}){if(!e.length)return{errors:t("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const r=new Set,i=[];for(const{reports:o,schema:s}of e){if(o.length>1)return u.unmatched(e,t);const a=o[0];if(a instanceof l.Report==0)return u.unmatched(e,t);if(a.state.path.length!==n.path.length){i.push({type:s.type,report:a});continue}if("any.only"===a.code){for(const e of a.local.valids)r.add(e);continue}const[c,d]=a.code.split(".");"base"===d?r.add(c):i.push({type:s.type,report:a})}return i.length?1===i.length?{errors:i[0].report}:u.unmatched(e,t):{errors:t("alternatives.types",{types:[...r]})}},u.unmatched=function(e,t){const n=[];for(const t of e)n.push(...t.reports);return{errors:t("alternatives.match",l.details(n,{override:!1}))}}},8068:(e,t,n)=>{const{assert:r}=n(8870),i=n(7629),o=n(8160),s=n(6914);e.exports=i.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,{method:n}){try{return n(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){r(o.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return r(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate:(e,t,{code:n,local:r})=>t.error(n,r),args:["code","local"],multi:!0}},modifiers:{keep(e,t=!0){e.keep=t},message(e,t){e.message=s.compile(t)},warn(e,t=!0){e.warn=t}},manifest:{build(e,t){for(const n in t){const r=t[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const t of r)e=e[n.slice(0,-1)](t);else if("alterations"!==n)if("whens"!==n){if("shared"===n)for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:n,is:r,not:i,then:o,otherwise:s,concat:a}=t;e=a?e.concat(a):n?e.when(n,{is:r,not:i,then:o,otherwise:s,switch:t.switch,break:t.break}):e.when(r,{then:o,otherwise:s,break:t.break})}else{const t={};for(const{target:e,adjuster:n}of r)t[e]=n;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(e,t,n)=>{const{assert:r,deepEqual:i,reach:o}=n(8870),s=n(8068),a=n(8160),l=n(3292),c={};e.exports=s.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,{schema:t,state:n,prefs:r}){if(!Array.isArray(e))return;const i=t.$_getRule("sort");return i?c.sort(t,e,i.args.options,n,r):void 0}},validate(e,{schema:t,error:n}){if(!Array.isArray(e)){if(t._flags.single){const t=[e];return t[a.symbols.arraySingle]=!0,{value:t}}return{errors:n("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,{state:t,prefs:n,error:r},{schema:i}){const o=[e,...t.ancestors];for(let r=0;r<e.length;++r){const s=t.localize([...t.path,r],o,i);if(i.$_match(e[r],s,n))return e}const s=i._flags.label;return s?r("array.hasKnown",{patternLabel:s}):r("array.hasUnknown",null)},multi:!0},items:{method(...e){a.verifyFlat(e,"items");const t=this.$_addRule("items");for(let n=0;n<e.length;++n){const r=a.tryWithPath((()=>this.$_compile(e[n])),n,{append:!0});t.$_terms.items.push(r)}return t.$_mutateRebuild()},validate(e,{schema:t,error:n,state:r,prefs:i,errorsArray:o}){const s=t.$_terms._requireds.slice(),l=t.$_terms.ordered.slice(),u=[...t.$_terms._inclusions,...s],d=!e[a.symbols.arraySingle];delete e[a.symbols.arraySingle];const f=o();let p=e.length;for(let o=0;o<p;++o){const a=e[o];let h=!1,m=!1;const g=d?o:new Number(o),y=[...r.path,g];if(!t._flags.sparse&&void 0===a){if(f.push(n("array.sparse",{key:g,path:y,pos:o,value:void 0},r.localize(y))),i.abortEarly)return f;l.shift();continue}const b=[e,...r.ancestors];for(const e of t.$_terms._exclusions)if(e.$_match(a,r.localize(y,b,e),i,{presence:"ignore"})){if(f.push(n("array.excludes",{pos:o,value:a},r.localize(y))),i.abortEarly)return f;h=!0,l.shift();break}if(h)continue;if(t.$_terms.ordered.length){if(l.length){const s=l.shift(),u=s.$_validate(a,r.localize(y,b,s),i);if(u.errors){if(f.push(...u.errors),i.abortEarly)return f}else if("strip"===s._flags.result)c.fastSplice(e,o),--o,--p;else{if(!t._flags.sparse&&void 0===u.value){if(f.push(n("array.sparse",{key:g,path:y,pos:o,value:void 0},r.localize(y))),i.abortEarly)return f;continue}e[o]=u.value}continue}if(!t.$_terms.items.length){if(f.push(n("array.orderedLength",{pos:o,limit:t.$_terms.ordered.length})),i.abortEarly)return f;break}}const v=[];let _=s.length;for(let l=0;l<_;++l){const u=r.localize(y,b,s[l]);u.snapshot();const d=s[l].$_validate(a,u,i);if(v[l]=d,!d.errors){if(u.commit(),e[o]=d.value,m=!0,c.fastSplice(s,l),--l,--_,!t._flags.sparse&&void 0===d.value&&(f.push(n("array.sparse",{key:g,path:y,pos:o,value:void 0},r.localize(y))),i.abortEarly))return f;break}u.restore()}if(m)continue;const w=i.stripUnknown&&!!i.stripUnknown.arrays||!1;_=u.length;for(const l of u){let u;const d=s.indexOf(l);if(-1!==d)u=v[d];else{const s=r.localize(y,b,l);if(s.snapshot(),u=l.$_validate(a,s,i),!u.errors){s.commit(),"strip"===l._flags.result?(c.fastSplice(e,o),--o,--p):t._flags.sparse||void 0!==u.value?e[o]=u.value:(f.push(n("array.sparse",{key:g,path:y,pos:o,value:void 0},r.localize(y))),h=!0),m=!0;break}s.restore()}if(1===_){if(w){c.fastSplice(e,o),--o,--p,m=!0;break}if(f.push(...u.errors),i.abortEarly)return f;h=!0;break}}if(!h&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!m){if(w){c.fastSplice(e,o),--o,--p;continue}if(f.push(n("array.includes",{pos:o,value:a},r.localize(y))),i.abortEarly)return f}}return s.length&&c.fillMissedErrors(t,f,s,e,r,i),l.length&&(c.fillOrderedErrors(t,f,l,e,r,i),f.length||c.fillDefault(l,e,r,i)),f.length?f:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:n},{name:r,operator:i,args:o})=>a.compare(e.length,n,i)?e:t.error("array."+r,{limit:o.limit,value:e}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(...e){a.verifyFlat(e,"ordered");const t=this.$_addRule("items");for(let n=0;n<e.length;++n){const r=a.tryWithPath((()=>this.$_compile(e[n])),n,{append:!0});c.validateSingle(r,t),t.$_mutateRegister(r),t.$_terms.ordered.push(r)}return t.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return r(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(e={}){a.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=l.ref(e.by,{ancestor:0}),r(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,{error:t,state:n,prefs:r,schema:i},{options:o}){const{value:s,errors:a}=c.sort(i,e,o,n,r);if(a)return a;for(let n=0;n<e.length;++n)if(e[n]!==s[n])return t("array.sort",{order:o.order,by:o.by?o.by.key:"value"});return e},convert:!0},sparse:{method(e){const t=void 0===e||!!e;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(e,t={}){r(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),a.assertOptions(t,["ignoreUndefined","separator"]);const n={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const r=a.default(t.separator,".");n.path=r?e.split(r):[e]}else n.comparator=e;return this.$_addRule(n)},validate(e,{state:t,error:n,schema:s},{comparator:a,options:l},{comparator:c,path:u}){const d={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},f=c||i,p=l.ignoreUndefined;for(let i=0;i<e.length;++i){const s=u?o(e[i],u):e[i],l=c?d.custom:d[typeof s];if(r(l,"Failed to find unique map container for type",typeof s),l instanceof Map){const r=l.entries();let o;for(;!(o=r.next()).done;)if(f(o.value[0],s)){const r=t.localize([...t.path,i],[e,...t.ancestors]),s={pos:i,value:e[i],dupePos:o.value[1],dupeValue:e[o.value[1]]};return u&&(s.path=a),n("array.unique",s,r)}l.set(s,i)}else{if((!p||void 0!==s)&&void 0!==l[s]){const r={pos:i,value:e[i],dupePos:l[s],dupeValue:e[l[s]]};return u&&(r.path=a),n("array.unique",r,t.localize([...t.path,i],[e,...t.ancestors]))}l[s]=i}}return e},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(e,t)=>new Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)c.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)c.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),c.fillMissedErrors=function(e,t,n,r,i,o){const s=[];let a=0;for(const e of n){const t=e._flags.label;t?s.push(t):++a}s.length?a?t.push(e.$_createError("array.includesRequiredBoth",r,{knownMisses:s,unknownMisses:a},i,o)):t.push(e.$_createError("array.includesRequiredKnowns",r,{knownMisses:s},i,o)):t.push(e.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},i,o))},c.fillOrderedErrors=function(e,t,n,r,i,o){const s=[];for(const e of n)"required"===e._flags.presence&&s.push(e);s.length&&c.fillMissedErrors(e,t,s,r,i,o)},c.fillDefault=function(e,t,n,r){const i=[];let o=!0;for(let s=e.length-1;s>=0;--s){const a=e[s],l=[t,...n.ancestors],c=a.$_validate(void 0,n.localize(n.path,l,a),r).value;if(o){if(void 0===c)continue;o=!1}i.unshift(c)}i.length&&t.push(...i)},c.fastSplice=function(e,t){let n=t;for(;n<e.length;)e[n++]=e[n];--e.length},c.validateSingle=function(e,t){("array"===e.type||e._flags._arrayItems)&&(r(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},c.sort=function(e,t,n,r,i){const o="ascending"===n.order?1:-1,s=-1*o,a=o,l=(l,u)=>{let d=c.compare(l,u,s,a);if(null!==d)return d;if(n.by&&(l=n.by.resolve(l,r,i),u=n.by.resolve(u,r,i)),d=c.compare(l,u,s,a),null!==d)return d;const f=typeof l;if(f!==typeof u)throw e.$_createError("array.sort.mismatching",t,null,r,i);if("number"!==f&&"string"!==f)throw e.$_createError("array.sort.unsupported",t,{type:f},r,i);return"number"===f?(l-u)*o:l<u?s:a};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}},c.compare=function(e,t,n,r){return e===t?0:void 0===e?1:void 0===t?-1:null===e?r:null===t?n:null}},4937:(e,t,n)=>{const{assert:r}=n(8870),i=n(8068),o=n(8160),s=n(2036),a={isBool:function(e){return"boolean"==typeof e}};e.exports=i.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,{schema:t}){if("boolean"!=typeof e){if("string"==typeof e){const n=t._flags.sensitive?e:e.toLowerCase();e="true"===n||"false"!==n&&e}return"boolean"!=typeof e&&(e=t.$_terms.truthy&&t.$_terms.truthy.has(e,null,null,!t._flags.sensitive)||(!t.$_terms.falsy||!t.$_terms.falsy.has(e,null,null,!t._flags.sensitive))&&e),{value:e}}},validate(e,{error:t}){if("boolean"!=typeof e)return{value:e,errors:t("boolean.base")}},rules:{truthy:{method(...e){o.verifyFlat(e,"truthy");const t=this.clone();t.$_terms.truthy=t.$_terms.truthy||new s;for(let n=0;n<e.length;++n){const i=e[n];r(void 0!==i,"Cannot call truthy with undefined"),t.$_terms.truthy.add(i)}return t}},falsy:{method(...e){o.verifyFlat(e,"falsy");const t=this.clone();t.$_terms.falsy=t.$_terms.falsy||new s;for(let n=0;n<e.length;++n){const i=e[n];r(void 0!==i,"Cannot call falsy with undefined"),t.$_terms.falsy.add(i)}return t}},sensitive:{method(e=!0){return this.$_setFlag("sensitive",e)}}},cast:{number:{from:a.isBool,to:(e,t)=>e?1:0},string:{from:a.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(e,t,n)=>{const{assert:r}=n(8870),i=n(8068),o=n(8160),s=n(3328),a={isDate:function(e){return e instanceof Date}};e.exports=i.extend({type:"date",coerce:{from:["number","string"],method:(e,{schema:t})=>({value:a.parse(e,t._flags.format)||e})},validate(e,{schema:t,error:n,prefs:r}){if(e instanceof Date&&!isNaN(e.getTime()))return;const i=t._flags.format;return r.convert&&i&&"string"==typeof e?{value:e,errors:n("date.format",{format:i})}:{value:e,errors:n("date.base")}},rules:{compare:{method:!1,validate(e,t,{date:n},{name:r,operator:i,args:s}){const a="now"===n?Date.now():n.getTime();return o.compare(e.getTime(),a,i)?e:t.error("date."+r,{limit:s.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:a.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return r(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(e="javascript"){return r(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:a.isDate,to:(e,t)=>e.getTime()},string:{from:a.isDate,to:(e,{prefs:t})=>s.date(e,t)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),a.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return o.isIsoDate(e)?a.date(e.toString()):null;const n=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return a.date(1*e);if("unix"===t)return a.date(1e3*e);if("string"==typeof n)return null}return a.date(e)},a.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},390:(e,t,n)=>{const{assert:r}=n(8870),i=n(7824);e.exports=i.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate:(e,t,{n})=>e.length===n?e:t.error("function.arity",{n})},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return r(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate:(e,t,{n})=>e.length>=n?e:t.error("function.minArity",{n})},maxArity:{method(e){return r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate:(e,t,{n})=>e.length<=n?e:t.error("function.maxArity",{n})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(e,t,n)=>{const{applyToDefaults:r,assert:i,clone:o}=n(8870),s=n(3652),a=n(8068),l=n(8160),c=n(3292),u=n(6354),d=n(6133),f=n(3328),p={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=a.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(e,t)=>e.keys(t),validate(e,{schema:t,error:n,state:r,prefs:i}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e))return{value:e,errors:n("object.base",{type:t.$_property("typeof")})};if(!(t.$_terms.renames||t.$_terms.dependencies||t.$_terms.keys||t.$_terms.patterns||t.$_terms.externals))return;e=p.clone(e,i);const o=[];if(t.$_terms.renames&&!p.rename(t,e,r,i,o))return{value:e,errors:o};if(!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies)return{value:e,errors:o};const s=new Set(Object.keys(e));if(t.$_terms.keys){const n=[e,...r.ancestors];for(const a of t.$_terms.keys){const t=a.key,l=e[t];s.delete(t);const c=r.localize([...r.path,t],n,a),u=a.schema.$_validate(l,c,i);if(u.errors){if(i.abortEarly)return{value:e,errors:u.errors};void 0!==u.value&&(e[t]=u.value),o.push(...u.errors)}else"strip"===a.schema._flags.result||void 0===u.value&&void 0!==l?delete e[t]:void 0!==u.value&&(e[t]=u.value)}}if(s.size||t._flags._hasPatternMatch){const n=p.unknown(t,e,s,o,r,i);if(n)return n}if(t.$_terms.dependencies)for(const n of t.$_terms.dependencies){if(null!==n.key&&!1===p.isPresent(n.options)(n.key.resolve(e,r,i,null,{shadow:!1})))continue;const s=p.dependencies[n.rel](t,n,e,r,i);if(s){const n=t.$_createError(s.code,e,s.context,r,i);if(i.abortEarly)return{value:e,errors:n};o.push(n)}}return{value:e,errors:o}},rules:{and:{method(...e){return l.verifyFlat(e,"and"),p.dependency(this,"and",null,e)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,n){f.isTemplate(e)||(e=c.ref(e)),i(void 0===n||"string"==typeof n,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});const r=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:n}});return r.$_mutateRegister(e),r.$_mutateRegister(t),r},validate(e,{error:t,prefs:n,state:r},{subject:i,schema:o,message:s}){const a=i.resolve(e,r,n),l=d.isRef(i)?i.absolute(r):[];return o.$_match(a,r.localize(l,[e,...r.ancestors],o),n)?e:t("object.assert",{subject:i,message:s})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return i("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate:(e,t,{constructor:n,name:r})=>e instanceof n?e:t.error("object.instance",{type:r,value:e}),args:["constructor","name"]},keys:{method(e){i(void 0===e||"object"==typeof e,"Object schema must be a valid object"),i(!l.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(e)if(Object.keys(e).length){t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter((t=>!e.hasOwnProperty(t.key))):new p.Keys;for(const n in e)l.tryWithPath((()=>t.$_terms.keys.push({key:n,schema:this.$_compile(e[n])})),n)}else t.$_terms.keys=new p.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:n},{name:r,operator:i,args:o})=>l.compare(Object.keys(e).length,n,i)?e:t.error("object."+r,{limit:o.limit,value:e}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(...e){return l.verifyFlat(e,"nand"),p.dependency(this,"nand",null,e)}},or:{method(...e){return l.verifyFlat(e,"or"),p.dependency(this,"or",null,e)}},oxor:{method(...e){return p.dependency(this,"oxor",null,e)}},pattern:{method(e,t,n={}){const r=e instanceof RegExp;r||(e=this.$_compile(e,{appendPath:!0})),i(void 0!==t,"Invalid rule"),l.assertOptions(n,["fallthrough","matches"]),r&&i(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const o=this.clone();o.$_terms.patterns=o.$_terms.patterns||[];const s={[r?"regex":"schema"]:e,rule:t};return n.matches&&(s.matches=this.$_compile(n.matches),"array"!==s.matches.type&&(s.matches=s.matches.$_root.array().items(s.matches)),o.$_mutateRegister(s.matches),o.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(s.fallthrough=!0),o.$_terms.patterns.push(s),o.$_mutateRegister(t),o}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>d.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t,n={}){i("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),i("string"==typeof t||t instanceof f,"Invalid rename to argument"),i(t!==e,"Cannot rename key to same name:",e),l.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);const o=this.clone();o.$_terms.renames=o.$_terms.renames||[];for(const t of o.$_terms.renames)i(t.from!==e,"Cannot rename the same key multiple times");return t instanceof f&&o.$_mutateRegister(t),o.$_terms.renames.push({from:e,to:t,options:r(p.renameDefaults,n)}),o}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate:(e,t,{type:n})=>!l.isSchema(e)||"any"!==n&&e.type!==n?t.error("object.schema",{type:n}):e},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t,n={}){return p.dependency(this,"with",e,t,n)}},without:{method(e,t,n={}){return p.dependency(this,"without",e,t,n)}},xor:{method(...e){return l.verifyFlat(e,"xor"),p.dependency(this,"xor",null,e)}}},overrides:{default(e,t){return void 0===e&&(e=l.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){const t=new s.Sorter;for(const n of e.$_terms.keys)l.tryWithPath((()=>t.add(n,{after:n.schema.$_rootReferences(),group:n.key})),n.key);e.$_terms.keys=new p.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:n,key:r=null,peers:i,options:o}of t.dependencies)e=p.dependency(e,n,r,i,o);if(t.patterns)for(const{regex:n,schema:r,rule:i,fallthrough:o,matches:s}of t.patterns)e=e.pattern(n||r,i,{fallthrough:o,matches:s});if(t.renames)for(const{from:n,to:r,options:i}of t.renames)e=e.rename(n,r,i);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),p.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return o(e,{shallow:!0});const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e),n}const n=function(...t){return e.apply(this,t)};return n.prototype=o(e.prototype),Object.defineProperty(n,"name",{value:e.name,writable:!1}),Object.defineProperty(n,"length",{value:e.length,writable:!1}),Object.assign(n,e),n},p.dependency=function(e,t,n,r,o){i(null===n||"string"==typeof n,t,"key must be a strings"),o||(o=r.length>1&&"object"==typeof r[r.length-1]?r.pop():{}),l.assertOptions(o,["separator","isPresent"]),r=[].concat(r);const s=l.default(o.separator,"."),a=[];for(const e of r)i("string"==typeof e,t,"peers must be strings"),a.push(c.ref(e,{separator:s,ancestor:0,prefix:!1}));null!==n&&(n=c.ref(n,{separator:s,ancestor:0,prefix:!1}));const u=e.clone();return u.$_terms.dependencies=u.$_terms.dependencies||[],u.$_terms.dependencies.push(new p.Dependency(t,n,a,r,o)),u},p.dependencies={and(e,t,n,r,i){const o=[],s=[],a=t.peers.length,l=p.isPresent(t.options);for(const e of t.peers)!1===l(e.resolve(n,r,i,null,{shadow:!1}))?o.push(e.key):s.push(e.key);if(o.length!==a&&s.length!==a)return{code:"object.and",context:{present:s,presentWithLabels:p.keysToLabels(e,s),missing:o,missingWithLabels:p.keysToLabels(e,o)}}},nand(e,t,n,r,i){const o=[],s=p.isPresent(t.options);for(const e of t.peers)s(e.resolve(n,r,i,null,{shadow:!1}))&&o.push(e.key);if(o.length!==t.peers.length)return;const a=t.paths[0],l=t.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:p.keysToLabels(e,a),peers:l,peersWithLabels:p.keysToLabels(e,l)}}},or(e,t,n,r,i){const o=p.isPresent(t.options);for(const e of t.peers)if(o(e.resolve(n,r,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)}}},oxor(e,t,n,r,i){const o=[],s=p.isPresent(t.options);for(const e of t.peers)s(e.resolve(n,r,i,null,{shadow:!1}))&&o.push(e.key);if(!o.length||1===o.length)return;const a={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return a.present=o,a.presentWithLabels=p.keysToLabels(e,o),{code:"object.oxor",context:a}},with(e,t,n,r,i){const o=p.isPresent(t.options);for(const s of t.peers)if(!1===o(s.resolve(n,r,i,null,{shadow:!1})))return{code:"object.with",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:s.key,peerWithLabel:p.keysToLabels(e,s.key)}}},without(e,t,n,r,i){const o=p.isPresent(t.options);for(const s of t.peers)if(o(s.resolve(n,r,i,null,{shadow:!1})))return{code:"object.without",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:s.key,peerWithLabel:p.keysToLabels(e,s.key)}}},xor(e,t,n,r,i){const o=[],s=p.isPresent(t.options);for(const e of t.peers)s(e.resolve(n,r,i,null,{shadow:!1}))&&o.push(e.key);if(1===o.length)return;const a={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return 0===o.length?{code:"object.missing",context:a}:(a.present=o,a.presentWithLabels=p.keysToLabels(e,o),{code:"object.xor",context:a})}},p.keysToLabels=function(e,t){return Array.isArray(t)?t.map((t=>e.$_mapLabels(t))):e.$_mapLabels(t)},p.isPresent=function(e){return"function"==typeof e.isPresent?e.isPresent:e=>void 0!==e},p.rename=function(e,t,n,r,i){const o={};for(const s of e.$_terms.renames){const a=[],l="string"!=typeof s.from;if(l)for(const e in t){if(void 0===t[e]&&s.options.ignoreUndefined)continue;if(e===s.to)continue;const n=s.from.exec(e);n&&a.push({from:e,to:s.to,match:n})}else!Object.prototype.hasOwnProperty.call(t,s.from)||void 0===t[s.from]&&s.options.ignoreUndefined||a.push(s);for(const c of a){const a=c.from;let u=c.to;if(u instanceof f&&(u=u.render(t,n,r,c.match)),a!==u){if(!s.options.multiple&&o[u]&&(i.push(e.$_createError("object.rename.multiple",t,{from:a,to:u,pattern:l},n,r)),r.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,u)&&!s.options.override&&!o[u]&&(i.push(e.$_createError("object.rename.override",t,{from:a,to:u,pattern:l},n,r)),r.abortEarly))return!1;void 0===t[a]?delete t[u]:t[u]=t[a],o[u]=!0,s.options.alias||delete t[a]}}}return!0},p.unknown=function(e,t,n,r,i,o){if(e.$_terms.patterns){let s=!1;const a=e.$_terms.patterns.map((e=>{if(e.matches)return s=!0,[]})),l=[t,...i.ancestors];for(const s of n){const c=t[s],u=[...i.path,s];for(let d=0;d<e.$_terms.patterns.length;++d){const f=e.$_terms.patterns[d];if(f.regex){const e=f.regex.test(s);if(i.mainstay.tracer.debug(i,"rule",`pattern.${d}`,e?"pass":"error"),!e)continue}else if(!f.schema.$_match(s,i.nest(f.schema,`pattern.${d}`),o))continue;n.delete(s);const p=i.localize(u,l,{schema:f.rule,key:s}),h=f.rule.$_validate(c,p,o);if(h.errors){if(o.abortEarly)return{value:t,errors:h.errors};r.push(...h.errors)}if(f.matches&&a[d].push(s),t[s]=h.value,!f.fallthrough)break}}if(s)for(let n=0;n<a.length;++n){const s=a[n];if(!s)continue;const c=e.$_terms.patterns[n].matches,d=i.localize(i.path,l,c),f=c.$_validate(s,d,o);if(f.errors){const n=u.details(f.errors,{override:!1});n.matches=s;const a=e.$_createError("object.pattern.match",t,n,i,o);if(o.abortEarly)return{value:t,errors:a};r.push(a)}}}if(n.size&&(e.$_terms.keys||e.$_terms.patterns)){if(o.stripUnknown&&!e._flags.unknown||o.skipFunctions){const e=!(!o.stripUnknown||!0!==o.stripUnknown&&!o.stripUnknown.objects);for(const r of n)e?(delete t[r],n.delete(r)):"function"==typeof t[r]&&n.delete(r)}if(!l.default(e._flags.unknown,o.allowUnknown))for(const s of n){const n=i.localize([...i.path,s],[]),a=e.$_createError("object.unknown",t[s],{child:s},n,o,{flags:!1});if(o.abortEarly)return{value:t,errors:a};r.push(a)}}},p.Dependency=class{constructor(e,t,n,r,i){this.rel=e,this.key=t,this.peers=n,this.paths=r,this.options=i}describe(){const e={rel:this.rel,peers:this.paths};return null!==this.key&&(e.key=this.key.key),"."!==this.peers[0].separator&&(e.options={...e.options,separator:this.peers[0].separator}),this.options.isPresent&&(e.options={...e.options,isPresent:this.options.isPresent}),e}},p.Keys=class extends Array{concat(e){const t=this.slice(),n=new Map;for(let e=0;e<t.length;++e)n.set(t[e].key,e);for(const r of e){const e=r.key,i=n.get(e);void 0!==i?t[i]={key:e,schema:t[i].schema.concat(r.schema)}:t.push(r)}return t}}},8785:(e,t,n)=>{const{assert:r}=n(8870),i=n(8068),o=n(8160),s=n(3292),a=n(6354),l={};e.exports=i.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,{schema:t,state:n,prefs:i}){r(t.$_terms.link,"Uninitialized link schema");const o=l.generate(t,e,n,i),s=t.$_terms.link[0].ref;return o.$_validate(e,n.nest(o,`link:${s.display}:${o.type}`),i)},generate:(e,t,n,r)=>l.generate(e,t,n,r),rules:{ref:{method(e){r(!this.$_terms.link,"Cannot reinitialize schema"),e=s.ref(e),r("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),r("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(e=!0){return this.$_setFlag("relative",e)}}},overrides:{concat(e){r(this.$_terms.link,"Uninitialized link schema"),r(o.isSchema(e),"Invalid schema object"),r("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(r(t.link,"Invalid link description missing link"),e.ref(t.link))}}),l.generate=function(e,t,n,r){let i=n.mainstay.links.get(e);if(i)return i._generate(t,n,r).schema;const o=e.$_terms.link[0].ref,{perspective:s,path:a}=l.perspective(o,n);l.assert(s,"which is outside of schema boundaries",o,e,n,r);try{i=a.length?s.$_reach(a):s}catch(t){l.assert(!1,"to non-existing schema",o,e,n,r)}return l.assert("link"!==i.type,"which is another link",o,e,n,r),e._flags.relative||n.mainstay.links.set(e,i),i._generate(t,n,r).schema},l.perspective=function(e,t){if("local"===e.type){for(const{schema:n,key:r}of t.schemas){if((n._flags.id||r)===e.path[0])return{perspective:n,path:e.path.slice(1)};if(n.$_terms.shared)for(const t of n.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},l.assert=function(e,t,n,i,o,s){e||r(!1,`"${a.label(i._flags,o,s)}" contains link reference "${n.display}" ${t}`)}},3832:(e,t,n)=>{const{assert:r}=n(8870),i=n(8068),o=n(8160),s={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/};e.exports=i.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:t,error:n}){if(!e.match(s.numberRx))return;e=e.trim();const r={value:parseFloat(e)};if(0===r.value&&(r.value=0),!t._flags.unsafe)if(e.match(/e/i)){if(s.extractSignificantDigits(e)!==s.extractSignificantDigits(String(r.value)))return r.errors=n("number.unsafe"),r}else{const t=r.value.toString();if(t.match(/e/i))return r;if(t!==s.normalizeDecimal(e))return r.errors=n("number.unsafe"),r}return r}},validate(e,{schema:t,error:n,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:n("number.infinity")};if(!o.isNumber(e))return{value:e,errors:n("number.base")};const i={value:e};if(r.convert){const e=t.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);i.value=Math.round(i.value*t)/t}}return 0===i.value&&(i.value=0),!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(i.errors=n("number.unsafe")),i},rules:{compare:{method:!1,validate:(e,t,{limit:n},{name:r,operator:i,args:s})=>o.compare(e,n,i)?e:t.error("number."+r,{limit:s.limit,value:e}),args:[{name:"limit",ref:!0,assert:o.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate:(e,t,{base:n},r)=>e*(1/n)%1==0?e:t.error("number.multiple",{multiple:r.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return r(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,{limit:n}){const r=e.toString().match(s.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?e:t.error("number.precision",{limit:n,value:e})},convert:!0},sign:{method(e){return r(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,t,{sign:n})=>"negative"===n&&e<0||"positive"===n&&e>0?e:t.error(`number.${n}`)},unsafe:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),s.extractSignificantDigits=function(e){return e.replace(s.exponentialPartRegex,"").replace(s.dotRegex,"").replace(s.trailingZerosRegex,"").replace(s.leadingSignAndZerosRegex,"")},s.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},8966:(e,t,n)=>{const r=n(7824);e.exports=r.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},7417:(e,t,n)=>{const{assert:r,escapeRegex:i}=n(8870),{isDomainValid:o,isEmailValid:s,ipRegex:a,uriRegex:l}=n(4958),c=n(6264),u=n(8068),d=n(8160),f={tlds:c.tlds instanceof Set&&{tlds:{allow:c.tlds,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:/^[a-f0-9]+$/i,ipRegex:a({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=u.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:t,state:n,prefs:r}){const i=t.$_getRule("normalize");i&&(e=e.normalize(i.args.form));const o=t.$_getRule("case");o&&(e="upper"===o.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const s=t.$_getRule("trim");if(s&&s.args.enabled&&(e=e.trim()),t.$_terms.replacements)for(const n of t.$_terms.replacements)e=e.replace(n.pattern,n.replacement);const a=t.$_getRule("hex");if(a&&a.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),t.$_getRule("isoDate")){const t=f.isoDate(e);t&&(e=t)}if(t._flags.truncate){const i=t.$_getRule("max");if(i){let o=i.args.limit;if(d.isResolvable(o)&&(o=o.resolve(e,n,r),!d.limit(o)))return{value:e,errors:t.$_createError("any.ref",o,{ref:i.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};e=e.slice(0,o)}}return{value:e}}},validate(e,{schema:t,error:n}){if("string"!=typeof e)return{value:e,errors:n("string.base")};if(""===e){const r=t.$_getRule("min");if(r&&0===r.args.limit)return;return{value:e,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(e={}){return d.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},r("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),r("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,t,{options:n})=>f.base64Regex[n.paddingRequired][n.urlSafe].test(e)?e:t.error("string.base64")},case:{method(e){return r(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,t,{direction:n})=>"lower"===n&&e===e.toLocaleLowerCase()||"upper"===n&&e===e.toLocaleUpperCase()?e:t.error(`string.${n}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let n=e.length,r=0,i=1;for(;n--;){const t=e.charAt(n)*i;r+=t-9*(t>9),i^=3}return r>0&&r%10==0?e:t.error("string.creditCard")}},dataUri:{method(e={}){return d.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},r("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,{options:n}){const r=e.match(f.dataUriRegex);if(r){if(!r[2])return e;if("base64"!==r[2])return e;if(f.base64Regex[n.paddingRequired].false.test(r[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&d.assertOptions(e,["allowFullyQualified","allowUnicode","allowUnderscore","maxDomainSegments","minDomainSegments","tlds"]);const t=f.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate:(e,t,n,{address:r})=>o(e,r)?e:t.error("string.domain")},email:{method(e={}){d.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),r(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=f.addressOptions(e),n=new RegExp(`\\s*[${e.separator?i(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:n,address:t})},validate(e,t,{options:n},{regex:r,address:i}){const o=n.multiple?e.split(r):[e],a=[];for(const e of o)s(e,i)||a.push(e);return a.length?t.error("string.email",{value:e,invalids:a}):e}},guid:{alias:"uuid",method(e={}){d.assertOptions(e,["version","separator"]);let t="";if(e.version){const n=[].concat(e.version);r(n.length>=1,"version must have at least 1 valid version specified");const i=new Set;for(let e=0;e<n.length;++e){const o=n[e];r("string"==typeof o,"version at position "+e+" must be a string");const s=f.guidVersions[o.toLowerCase()];r(s,"version at position "+e+" must be one of "+Object.keys(f.guidVersions).join(", ")),r(!i.has(s),"version at position "+e+" must not be a duplicate"),t+=s,i.add(s)}}r(f.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const n=void 0===e.separator?"[:-]?":!0===e.separator?"[:-]":!1===e.separator?"[]?":`\\${e.separator}`,i=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:i})},validate(e,t,n,{regex:r}){const i=r.exec(e);return i?f.guidBrackets[i[1]]!==i[i.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(e={}){return d.assertOptions(e,["byteAligned"]),e={byteAligned:!1,...e},r("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,t,{options:n})=>f.hexRegex.test(e)?n.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>o(e,{minDomainSegments:1})||f.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){d.assertOptions(e,["cidr","version"]);const{cidr:t,versions:n,regex:r}=a(e),i=e.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:i}},regex:r})},validate:(e,t,{options:n},{regex:r})=>r.test(e)?e:n.version?t.error("string.ipVersion",{value:e,cidr:n.cidr,version:n.version}):t.error("string.ip",{value:e,cidr:n.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:t})=>f.isoDate(e)?e:t("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>f.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return f.length(this,"length",e,"=",t)},validate(e,t,{limit:n,encoding:r},{name:i,operator:o,args:s}){const a=!r&&e.length;return d.compare(a,n,o)?e:t.error("string."+i,{limit:s.limit,value:e,encoding:r})},args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return f.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return f.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){return r(f.normalizationForms.includes(e),"normalization form must be one of "+f.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:t},{form:n})=>e===e.normalize(n)?e:t("string.normalize",{value:e,form:n}),convert:!0},pattern:{alias:"regex",method(e,t={}){r(e instanceof RegExp,"regex must be a RegExp"),r(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),d.assertOptions(t,["invert","name"]);const n=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:n})},validate:(e,t,{regex:n,options:r},{errorCode:i})=>n.test(e)^r.invert?e:t.error(i,{name:r.name,regex:n,value:e}),args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(i(e),"g")),r(e instanceof RegExp,"pattern must be a RegExp"),r("string"==typeof t,"replacement must be a String");const n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:e,replacement:t}),n}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,t,{enabled:n})=>n&&e!==e.trim()?t.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){d.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&d.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:n}=l(e),r=e.domain?f.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:r,scheme:n})},validate(e,t,{options:n},{regex:r,domain:i,scheme:s}){if(["http:/","https:/"].includes(e))return t.error("string.uri");const a=r.exec(e);if(a){const r=a[1]||a[2];return!i||n.allowRelative&&!r||o(r,i)?e:t.error("string.domain",{value:r})}return n.relativeOnly?t.error("string.uriRelativeOnly"):n.scheme?t.error("string.uriCustomScheme",{scheme:s,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:n,replacement:r}of t.replacements)e=e.replace(n,r);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),f.addressOptions=function(e){if(!e)return e;if(r(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),r(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return r(f.tlds,"Built-in TLD list disabled"),Object.assign({},e,f.tlds);r("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),r(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),r(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),f.validateTlds(e.tlds.deny,"tlds.deny"),e;const n=e.tlds.allow;return n?!0===n?(r(f.tlds,"Built-in TLD list disabled"),Object.assign({},e,f.tlds)):(Array.isArray(n)&&(e=Object.assign({},e,{tlds:{allow:new Set(n)}})),r(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),f.validateTlds(e.tlds.allow,"tlds.allow"),e):{...e,tlds:!1}},f.validateTlds=function(e,t){for(const n of e)r(o(n,{minDomainSegments:1,maxDomainSegments:1}),`${t} must contain valid top level domain names`)},f.isoDate=function(e){if(!d.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},f.length=function(e,t,n,i,o){return r(!o||!1,"Invalid encoding:",o),e.$_addRule({name:t,method:"length",args:{limit:n,encoding:o},operator:i})}},8826:(e,t,n)=>{const{assert:r}=n(8870),i=n(8068),o={};o.Map=class extends Map{slice(){return new o.Map(this)}},e.exports=i.extend({type:"symbol",terms:{map:{init:new o.Map}},coerce:{method(e,{schema:t,error:n}){const r=t.$_terms.map.get(e);return r&&(e=r),t._flags.only&&"symbol"!=typeof e?{value:e,errors:n("symbol.map",{map:t.$_terms.map})}:{value:e}}},validate(e,{error:t}){if("symbol"!=typeof e)return{value:e,errors:t("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),r(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),n=[];for(const i of e){r(i&&i[Symbol.iterator],"Entry must be an iterable");const[e,o]=i;r("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),r("symbol"==typeof o,"Value must be a Symbol"),t.$_terms.map.set(e,o),n.push(o)}return t.valid(...n)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(e,t,n)=>{const{assert:r,clone:i,ignore:o,reach:s}=n(8870),a=n(8160),l=n(6354),c=n(493),u={result:Symbol("result")};t.entry=function(e,t,n){let i=a.defaults;n&&(r(void 0===n.warnings,"Cannot override warnings preference in synchronous validation"),r(void 0===n.artifacts,"Cannot override artifacts preference in synchronous validation"),i=a.preferences(a.defaults,n));const o=u.entry(e,t,i);r(!o.mainstay.externals.length,"Schema with external rules must use validateAsync()");const s={value:o.value};return o.error&&(s.error=o.error),o.mainstay.warnings.length&&(s.warning=l.details(o.mainstay.warnings)),o.mainstay.debug&&(s.debug=o.mainstay.debug),o.mainstay.artifacts&&(s.artifacts=o.mainstay.artifacts),s},t.entryAsync=async function(e,t,n){let r=a.defaults;n&&(r=a.preferences(a.defaults,n));const i=u.entry(e,t,r),o=i.mainstay;if(i.error)throw o.debug&&(i.error.debug=o.debug),i.error;if(o.externals.length){let t=i.value;const c=[];for(const i of o.externals){const d=i.state.path,f="link"===i.schema.type?o.links.get(i.schema):null;let p,h,m=t;const g=d.length?[t]:[],y=d.length?s(e,d):e;if(d.length){p=d[d.length-1];let e=t;for(const t of d.slice(0,-1))e=e[t],g.unshift(e);h=g[0],m=h[p]}try{const e=(e,t)=>(f||i.schema).$_createError(e,m,t,i.state,r),s=await i.method(m,{schema:i.schema,linked:f,state:i.state,prefs:n,original:y,error:e,errorsArray:u.errorsArray,warn:(e,t)=>o.warnings.push((f||i.schema).$_createError(e,m,t,i.state,r)),message:(e,t)=>(f||i.schema).$_createError("external",m,t,i.state,r,{messages:e})});if(void 0===s||s===m)continue;if(s instanceof l.Report){if(o.tracer.log(i.schema,i.state,"rule","external","error"),c.push(s),r.abortEarly)break;continue}if(Array.isArray(s)&&s[a.symbols.errors]){if(o.tracer.log(i.schema,i.state,"rule","external","error"),c.push(...s),r.abortEarly)break;continue}h?(o.tracer.value(i.state,"rule",m,s,"external"),h[p]=s):(o.tracer.value(i.state,"rule",t,s,"external"),t=s)}catch(e){throw r.errors.label&&(e.message+=` (${i.label})`),e}}if(i.value=t,c.length)throw i.error=l.process(c,e,r),o.debug&&(i.error.debug=o.debug),i.error}if(!r.warnings&&!r.debug&&!r.artifacts)return i.value;const c={value:i.value};return o.warnings.length&&(c.warning=l.details(o.warnings)),o.debug&&(c.debug=o.debug),o.artifacts&&(c.artifacts=o.artifacts),c},u.Mainstay=class{constructor(e,t,n){this.externals=[],this.warnings=[],this.tracer=e,this.debug=t,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const e=this._snapshots.pop();this.externals=e.externals,this.warnings=e.warnings}commit(){this._snapshots.pop()}},u.entry=function(e,n,r){const{tracer:i,cleanup:o}=u.tracer(n,r),s=r.debug?[]:null,a=n._ids._schemaChain?new Map:null,d=new u.Mainstay(i,s,a),f=n._ids._schemaChain?[{schema:n}]:null,p=new c([],[],{mainstay:d,schemas:f}),h=t.validate(e,n,p,r);o&&n.$_root.untrace();const m=l.process(h.errors,e,r);return{value:h.value,error:m,mainstay:d}},u.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(r(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:u.ignore}},t.validate=function(e,t,n,r,i={}){if(t.$_terms.whens&&(t=t._generate(e,n,r).schema),t._preferences&&(r=u.prefs(t,r)),t._cache&&r.cache){const r=t._cache.get(e);if(n.mainstay.tracer.debug(n,"validate","cached",!!r),r)return r}const o=(i,o,s)=>t.$_createError(i,e,o,s||n,r),s={original:e,prefs:r,schema:t,state:n,error:o,errorsArray:u.errorsArray,warn:(e,t,r)=>n.mainstay.warnings.push(o(e,t,r)),message:(i,o)=>t.$_createError("custom",e,o,n,r,{messages:i})};n.mainstay.tracer.entry(t,n);const l=t._definition;if(l.prepare&&void 0!==e&&r.convert){const t=l.prepare(e,s);if(t){if(n.mainstay.tracer.value(n,"prepare",e,t.value),t.errors)return u.finalize(t.value,[].concat(t.errors),s);e=t.value}}if(l.coerce&&void 0!==e&&r.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){const t=l.coerce.method(e,s);if(t){if(n.mainstay.tracer.value(n,"coerced",e,t.value),t.errors)return u.finalize(t.value,[].concat(t.errors),s);e=t.value}}const c=t._flags.empty;c&&c.$_match(u.trim(e,t),n.nest(c),a.defaults)&&(n.mainstay.tracer.value(n,"empty",e,void 0),e=void 0);const d=i.presence||t._flags.presence||(t._flags._endedSwitch?null:r.presence);if(void 0===e){if("forbidden"===d)return u.finalize(e,null,s);if("required"===d)return u.finalize(e,[t.$_createError("any.required",e,null,n,r)],s);if("optional"===d){if(t._flags.default!==a.symbols.deepDefault)return u.finalize(e,null,s);n.mainstay.tracer.value(n,"default",e,{}),e={}}}else if("forbidden"===d)return u.finalize(e,[t.$_createError("any.unknown",e,null,n,r)],s);const f=[];if(t._valids){const i=t._valids.get(e,n,r,t._flags.insensitive);if(i)return r.convert&&(n.mainstay.tracer.value(n,"valids",e,i.value),e=i.value),n.mainstay.tracer.filter(t,n,"valid",i),u.finalize(e,null,s);if(t._flags.only){const i=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},n,r);if(r.abortEarly)return u.finalize(e,[i],s);f.push(i)}}if(t._invalids){const i=t._invalids.get(e,n,r,t._flags.insensitive);if(i){n.mainstay.tracer.filter(t,n,"invalid",i);const o=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},n,r);if(r.abortEarly)return u.finalize(e,[o],s);f.push(o)}}if(l.validate){const t=l.validate(e,s);if(t&&(n.mainstay.tracer.value(n,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return f.push(t.errors),u.finalize(e,f,s);if(t.errors.length)return f.push(...t.errors),u.finalize(e,f,s)}}return t._rules.length?u.rules(e,f,s):u.finalize(e,f,s)},u.rules=function(e,t,n){const{schema:r,state:i,prefs:o}=n;for(const s of r._rules){const l=r._definition.rules[s.method];if(l.convert&&o.convert){i.mainstay.tracer.log(r,i,"rule",s.name,"full");continue}let c,d=s.args;if(s._resolve.length){d=Object.assign({},d);for(const t of s._resolve){const n=l.argsByName.get(t),s=d[t].resolve(e,i,o),u=n.normalize?n.normalize(s):s,f=a.validateArg(u,null,n);if(f){c=r.$_createError("any.ref",s,{arg:t,ref:d[t],reason:f},i,o);break}d[t]=u}}c=c||l.validate(e,n,d,s);const f=u.rule(c,s);if(f.errors){if(i.mainstay.tracer.log(r,i,"rule",s.name,"error"),s.warn){i.mainstay.warnings.push(...f.errors);continue}if(o.abortEarly)return u.finalize(e,f.errors,n);t.push(...f.errors)}else i.mainstay.tracer.log(r,i,"rule",s.name,"pass"),i.mainstay.tracer.value(i,"rule",e,f.value,s.name),e=f.value}return u.finalize(e,t,n)},u.rule=function(e,t){return e instanceof l.Report?(u.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[a.symbols.errors]?(e.forEach((e=>u.error(e,t))),{errors:e,value:null}):{errors:null,value:e}},u.error=function(e,t){return t.message&&e._setTemplate(t.message),e},u.finalize=function(e,t,n){t=t||[];const{schema:i,state:o,prefs:s}=n;if(t.length){const r=u.default("failover",void 0,t,n);void 0!==r&&(o.mainstay.tracer.value(o,"failover",e,r),e=r,t=[])}if(t.length&&i._flags.error)if("function"==typeof i._flags.error){t=i._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)r(e instanceof Error||e instanceof l.Report,"error() must return an Error object")}else t=[i._flags.error];if(void 0===e){const r=u.default("default",e,t,n);o.mainstay.tracer.value(o,"default",e,r),e=r}if(i._flags.cast&&void 0!==e){const t=i._definition.cast[i._flags.cast];if(t.from(e)){const r=t.to(e,n);o.mainstay.tracer.value(o,"cast",e,r,i._flags.cast),e=r}}if(i.$_terms.externals&&s.externals&&!1!==s._externals)for(const{method:e}of i.$_terms.externals)o.mainstay.externals.push({method:e,schema:i,state:o,label:l.label(i._flags,o,s)});const a={value:e,errors:t.length?t:null};return i._flags.result&&(a.value="strip"===i._flags.result?void 0:n.original,o.mainstay.tracer.value(o,i._flags.result,e,a.value),o.shadow(e,i._flags.result)),i._cache&&!1!==s.cache&&!i._refs.length&&i._cache.set(n.original,a),void 0===e||a.errors||void 0===i._flags.artifact||(o.mainstay.artifacts=o.mainstay.artifacts||new Map,o.mainstay.artifacts.has(i._flags.artifact)||o.mainstay.artifacts.set(i._flags.artifact,[]),o.mainstay.artifacts.get(i._flags.artifact).push(o.path)),a},u.prefs=function(e,t){const n=t===a.defaults;return n&&e._preferences[a.symbols.prefs]?e._preferences[a.symbols.prefs]:(t=a.preferences(t,e._preferences),n&&(e._preferences[a.symbols.prefs]=t),t)},u.default=function(e,t,n,r){const{schema:o,state:s,prefs:l}=r,c=o._flags[e];if(l.noDefaults||void 0===c)return t;if(s.mainstay.tracer.log(o,s,"rule",e,"full"),!c)return c;if("function"==typeof c){const a=c.length?[i(s.ancestors[0]),r]:[];try{return c(...a)}catch(t){return void n.push(o.$_createError(`any.${e}`,null,{error:t},s,l))}}return"object"!=typeof c?c:c[a.symbols.literal]?c.literal:a.isResolvable(c)?c.resolve(t,s,l):i(c)},u.trim=function(e,t){if("string"!=typeof e)return e;const n=t.$_getRule("trim");return n&&n.args.enabled?e.trim():e},u.ignore={active:!1,debug:o,entry:o,filter:o,log:o,resolve:o,value:o},u.errorsArray=function(){const e=[];return e[a.symbols.errors]=!0,e}},2036:(e,t,n)=>{const{assert:r,deepEqual:i}=n(8870),o=n(8160),s={};e.exports=s.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=s.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){o.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,n){if(e=e||new s.Values,t){if(t._override)return t.clone();for(const n of[...t._values,...t._refs])e.add(n)}if(n)for(const t of[...n._values,...n._refs])e.remove(t);return e.length?e:null}remove(e){o.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,n,r){return!!this.get(e,t,n,r)}get(e,t,n,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e)for(const t of this._values)if(i(t,e))return{value:t};if(t)for(const o of this._refs){const s=o.resolve(e,t,n,null,{in:!0});if(void 0===s)continue;const a=o.in&&"object"==typeof s?Array.isArray(s)?s:Object.keys(s):[s];for(const t of a)if(typeof t==typeof e)if(r&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:o}}else if(i(t,e))return{value:t,ref:o}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){const e=new s.Values(this._values,this._refs);return e._override=this._override,e}concat(e){r(!e._override,"Cannot concat override set of values");const t=new s.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){const e=[];this._override&&e.push({override:!0});for(const t of this._values.values())e.push(t&&"object"==typeof t?{value:t}:t);for(const t of this._refs.values())e.push(t.describe());return e}},s.Values.prototype[o.symbols.values]=!0,s.Values.prototype.slice=s.Values.prototype.clone,s.lowercases=function(e){const t=new Map;if(e)for(const n of e)"string"==typeof n&&t.set(n.toLowerCase(),n);return t}},4958:(e,t,n)=>{n.r(t),n.d(t,{analyzeDomain:()=>h,analyzeEmail:()=>_,errorCodes:()=>i,ipRegex:()=>$,isDomainValid:()=>m,isEmailValid:()=>w,uriDecode:()=>L,uriRegex:()=>k,validateDomainOptions:()=>g});var r=n(1275);const i={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"};function o(e){return{code:e,error:i[e]}}const s=2,a=/[^\x00-\x7f]/,l=/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,c=/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,u=/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,d=/^[a-zA-Z0-9_](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,f=r.URL||URL;function p(e){return!!e.allow}function h(e,t={}){if(!e)return o("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return o("DOMAIN_TOO_LONG");if(a.test(e)){if(!1===t.allowUnicode)return o("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(l.test(e))return o("DOMAIN_INVALID_CHARS");e=function(e){e.includes("%")&&(e=e.replace(/%/g,"%25"));try{return new f(`http://${e}`).host}catch(t){return e}}(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));const n=t.minDomainSegments||s,r=e.split(".");if(r.length<n)return o("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&r.length>t.maxDomainSegments)return o("DOMAIN_SEGMENTS_COUNT_MAX");const i=t.tlds;if(i){const e=r[r.length-1].toLowerCase();if(p(i)){if(!i.allow.has(e))return o("DOMAIN_FORBIDDEN_TLDS")}else if(i.deny.has(e))return o("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<r.length;++e){const n=r[e];if(!n.length)return o("DOMAIN_EMPTY_SEGMENT");if(n.length>63)return o("DOMAIN_LONG_SEGMENT");if(e<r.length-1){if(t.allowUnderscore){if(!d.test(n))return o("DOMAIN_INVALID_CHARS")}else if(!u.test(n))return o("DOMAIN_INVALID_CHARS")}else if(!c.test(n))return o("DOMAIN_INVALID_TLDS_CHARS")}return null}function m(e,t){return!h(e,t)}function g(e){if(e){if("object"!=typeof e.tlds)throw new Error("Invalid options: tlds must be a boolean or an object");if(p(e.tlds)){if(e.tlds.allow instanceof Set==0)throw new Error("Invalid options: tlds.allow must be a Set object or true");if(e.tlds.deny)throw new Error("Invalid options: cannot specify both tlds.allow and tlds.deny lists")}else if(e.tlds.deny instanceof Set==0)throw new Error("Invalid options: tlds.deny must be a Set object")}}var y=n(3975);const b=/[^\x00-\x7f]/,v=new(y.TextEncoder||TextEncoder);function _(e,t){return A(e,t)}function w(e,t){return!A(e,t)}function A(e,t={}){if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return o("EMPTY_STRING");const n=!b.test(e);if(!n){if(!1===t.allowUnicode)return o("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(2!==r.length)return r.length>2?o("MULTIPLE_AT_CHAR"):o("MISSING_AT_CHAR");const[i,s]=r;if(!i)return o("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return o("ADDRESS_TOO_LONG");if(v.encode(i).length>64)return o("LOCAL_TOO_LONG")}return function(e,t){const n=e.split(".");for(const e of n){if(!e.length)return o("EMPTY_LOCAL_SEGMENT");if(t){if(!S.test(e))return o("INVALID_LOCAL_CHARS")}else for(const t of e){if(S.test(t))continue;const e=x(t);if(!O.test(e))return o("INVALID_LOCAL_CHARS")}}return null}(i,n)||h(s,t)}function x(e){return Array.from(v.encode(e),(e=>String.fromCharCode(e))).join("")}const S=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,O=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("|"));var E=n(375),C=n.n(E),j=n(6064),T=n.n(j);const I=function(){const e={},t="\\dA-Fa-f",n="["+t+"]",r="\\w-\\.~",i="!\\$&'\\(\\)\\*\\+,;=",o="%"+t,s=r+o+i+":@",a="["+s+"]",l="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+l+"\\.){3}"+l;const c=n+"{1,4}",u="(?:"+c+":"+c+"|"+e.ipv4address+")",d="(?:"+c+":){6}"+u,f="::(?:"+c+":){5}"+u,p="(?:"+c+")?::(?:"+c+":){4}"+u,h="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+u,m="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+u,g="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+u,y="(?:(?:"+c+":){0,4}"+c+")?::"+u,b="(?:(?:"+c+":){0,5}"+c+")?::"+c,v="(?:(?:"+c+":){0,6}"+c+")?::";e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:"+d+"|"+f+"|"+p+"|"+h+"|"+m+"|"+g+"|"+y+"|"+b+"|"+v+")",e.ipvFuture="v"+n+"+\\.["+r+i+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const _="["+r+o+i+":]*",w="["+r+o+i+"]{1,255}",A="(?:\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]|"+e.ipv4address+"|"+w+")",x="(?:"+_+"@)?"+A+"(?::\\d*)?",S="(?:"+_+"@)?("+A+")(?::\\d*)?",O=a+"*",E=a+"+",C="(?:\\/"+O+")*",j="\\/(?:"+E+C+")?",T=E+C,I="["+r+o+i+"@]+"+C,R="(?:\\/\\/\\/"+O+C+")";return e.hierPart="(?:(?:\\/\\/"+x+C+")|"+j+"|"+T+"|"+R+")",e.hierPartCapture="(?:(?:\\/\\/"+S+C+")|"+j+"|"+T+")",e.relativeRef="(?:(?:\\/\\/"+x+C+")|"+j+"|"+I+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+S+C+")|"+j+"|"+I+"|)",e.query="["+s+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+s+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+s+"\\/\\?]*",e}(),R={v4Cidr:I.ipv4Cidr,v6Cidr:I.ipv6Cidr,ipv4:I.ipv4address,ipv6:I.ipv6address,ipvfuture:I.ipvFuture};function D(e){const t=I,n="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",r=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return N(r+n);let i="";if(e.scheme){C()(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const n=[].concat(e.scheme);C()(n.length>=1,"scheme must have at least 1 scheme specified");const r=[];for(let e=0;e<n.length;++e){const i=n[e];C()(i instanceof RegExp||"string"==typeof i,"scheme at position "+e+" must be a RegExp or String"),i instanceof RegExp?r.push(i.source.toString()):(C()(t.schemeRegex.test(i),"scheme at position "+e+" must be a valid scheme"),r.push(T()(i)))}i=r.join("|")}const o="(?:"+(i?"(?:"+i+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")";return N((e.allowRelative?"(?:"+o+"|"+r+")":o)+n,i)}function N(e,t=null){return{raw:e=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${e}`,regex:new RegExp(`^${e}$`),scheme:t}}const F=D({});function k(e={}){return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?D(e):F}function $(e={}){const t=e.cidr||"optional";C()(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),C()(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let n=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),C()(n.length>=1,"options.version must have at least 1 version specified");for(const e of n)C()("string"==typeof e&&e===e.toLowerCase(),"Invalid options.version value"),C()(["ipv4","ipv6","ipvfuture"].includes(e),"options.version contains unknown version "+e+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));const r=`(?:${n.map((e=>{if("forbidden"===t)return R[e];const n=`\\/${"ipv4"===e?R.v4Cidr:R.v6Cidr}`;return"required"===t?`${R[e]}${n}`:`${R[e]}(?:${n})?`})).join("|")})`,i=new RegExp(`^${r}$`);return{cidr:t,versions:n,regex:i,raw:r}}const M={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15},P={accept:12,reject:0,data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7]};function L(e){let t=e.indexOf("%");if(-1===t)return e;let n="",r=0,i=0,o=t,s=P.accept;for(;t>-1&&t<e.length;){const a=B(e[t+1],4)|B(e[t+2],0),l=P.data[a];if(s=P.data[256+s+l],i=i<<6|a&P.data[364+l],s!==P.accept){if(s===P.reject)return null;if(t+=3,t>=e.length||"%"!==e[t])return null}else n+=e.slice(r,o),n+=i<=65535?String.fromCharCode(i):String.fromCharCode(55232+(i>>10),56320+(1023&i)),i=0,r=t+3,t=e.indexOf("%",r),o=t}return n+e.slice(r)}function B(e,t){const n=M[e];return void 0===n?255:n<<t}},4964:(e,t)=>{const n={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e,t={}){if(!t[n.settings]&&t.constants)for(const e in t.constants){const n=t.constants[e];if(null!==n&&!["boolean","number","string"].includes(typeof n))throw new Error(`Formula constant ${e} contains invalid ${typeof n} value type`)}this.settings=t[n.settings]?t:Object.assign({[n.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let r=[],i="",o=0,s=!1;const a=e=>{if(o)throw new Error("Formula missing closing parenthesis");const a=r.length?r[r.length-1]:null;if(s||i||e){if(a&&"reference"===a.type&&")"===e)return a.type="function",a.value=this._subFormula(i,a.value),void(i="");if(")"===e){const e=new t.Parser(i,this.settings);r.push({type:"segment",value:e})}else if(s){if("]"===s)return r.push({type:"reference",value:i}),void(i="");r.push({type:"literal",value:i})}else if(n.operatorCharacters.includes(i))a&&"operator"===a.type&&n.operators.includes(a.value+i)?a.value+=i:r.push({type:"operator",value:i});else if(i.match(n.numberRx))r.push({type:"constant",value:parseFloat(i)});else if(void 0!==this.settings.constants[i])r.push({type:"constant",value:this.settings.constants[i]});else{if(!i.match(n.tokenRx))throw new Error(`Formula contains invalid token: ${i}`);r.push({type:"reference",value:i})}i=""}};for(const t of e)s?t===s?(a(),s=!1):i+=t:o?"("===t?(i+=t,++o):")"===t?(--o,o?i+=t:a(t)):i+=t:t in n.literals?s=n.literals[t]:"("===t?(a(),++o):n.operatorCharacters.includes(t)?(a(),i=t,a()):" "!==t?i+=t:a();a(),r=r.map(((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==r[t-1].type?e:{type:"operator",value:"n"}));let l=!1;for(const e of r){if("operator"===e.type){if(n.operatorsPrefix.includes(e.value))continue;if(!l)throw new Error("Formula contains an operator in invalid position");if(!n.operators.includes(e.value))throw new Error(`Formula contains an unknown operator ${e.value}`)}else if(l)throw new Error("Formula missing expected operator");l=!l}if(!l)throw new Error("Formula contains invalid trailing operator");1===r.length&&["reference","literal","constant"].includes(r[0].type)&&(this.single={type:"reference"===r[0].type?"reference":"value",value:r[0].value}),this._parts=r.map((e=>{if("operator"===e.type)return n.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error(`Formula contains invalid reference ${e.value}`);return this.settings.reference?this.settings.reference(e.value):n.reference(e.value)}))}_subFormula(e,r){const i=this.settings.functions[r];if("function"!=typeof i)throw new Error(`Formula contains unknown function ${r}`);let o=[];if(e){let t="",i=0,s=!1;const a=()=>{if(!t)throw new Error(`Formula contains function ${r} with invalid arguments ${e}`);o.push(t),t=""};for(let r=0;r<e.length;++r){const o=e[r];s?(t+=o,o===s&&(s=!1)):o in n.literals&&!i?(t+=o,s=n.literals[o]):","!==o||i?(t+=o,"("===o?++i:")"===o&&--i):a()}a()}return o=o.map((e=>new t.Parser(e,this.settings))),function(e){const t=[];for(const n of o)t.push(n.evaluate(e));return i.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let r=t.length-2;r>=0;--r){const i=t[r];if(i&&"operator"===i.type){const o=t[r+1];t.splice(r+1,1);const s=n.evaluate(o,e);t[r]=n.single(i.value,s)}}return n.operatorsOrder.forEach((r=>{for(let i=1;i<t.length-1;)if(r.includes(t[i])){const r=t[i],o=n.evaluate(t[i-1],e),s=n.evaluate(t[i+1],e);t.splice(i,2);const a=n.calculate(r,o,s);t[i-1]=0===a?0:a}else i+=2})),n.evaluate(t[0],e)}},t.Parser.prototype[n.symbol]=!0,n.reference=function(e){return function(t){return t&&void 0!==t[e]?t[e]:null}},n.evaluate=function(e,t){return null===e?null:"function"==typeof e?e(t):e[n.symbol]?e.evaluate(t):e},n.single=function(e,t){if("!"===e)return!t;const n=-t;return 0===n?0:n},n.calculate=function(e,t,r){if("??"===e)return n.exists(t)?t:r;if("string"==typeof t||"string"==typeof r){if("+"===e)return(t=n.exists(t)?t:"")+(n.exists(r)?r:"")}else switch(e){case"^":return Math.pow(t,r);case"*":return t*r;case"/":return t/r;case"%":return t%r;case"+":return t+r;case"-":return t-r}switch(e){case"<":return t<r;case"<=":return t<=r;case">":return t>r;case">=":return t>=r;case"==":return t===r;case"!=":return t!==r;case"&&":return t&&r;case"||":return t||r}return null},n.exists=function(e){return null!=e}},978:(e,t,n)=>{const r=n(375),i=n(8571),o=n(1687),s=n(9621),a={};e.exports=function(e,t,n={}){if(r(e&&"object"==typeof e,"Invalid defaults value: must be an object"),r(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),r("object"==typeof n,"Invalid options: must be an object"),!t)return null;if(n.shallow)return a.applyToDefaultsWithShallow(e,t,n);const s=i(e);if(!0===t)return s;const l=void 0!==n.nullOverride&&n.nullOverride;return o(s,t,{nullOverride:l,mergeArrays:!1})},a.applyToDefaultsWithShallow=function(e,t,n){const l=n.shallow;r(Array.isArray(l),"Invalid keys");const c=new Map,u=!0===t?null:new Set;for(let n of l){n=Array.isArray(n)?n:n.split(".");const r=s(e,n);r&&"object"==typeof r?c.set(r,u&&s(t,n)||r):u&&u.add(n)}const d=i(e,{},c);if(!u)return d;for(const e of u)a.reachCopy(d,t,e);const f=void 0!==n.nullOverride&&n.nullOverride;return o(d,t,{nullOverride:f,mergeArrays:!1})},a.reachCopy=function(e,t,n){for(const e of n){if(!(e in t))return;const n=t[e];if("object"!=typeof n||null===n)return;t=n}const r=t;let i=e;for(let e=0;e<n.length-1;++e){const t=n[e];"object"!=typeof i[t]&&(i[t]={}),i=i[t]}i[n[n.length-1]]=r}},375:(e,t,n)=>{const r=n(4213),i=n(8761),o=e.exports=function(e,...t){if(e)return;if(1===t.length&&t[0]instanceof Error)throw t[0];const n=t.filter((e=>""!==e)).map((e=>"string"==typeof e?e:e instanceof Error?e.message:i(e)));throw new r(n.join(" "),o)}},4213:e=>{e.exports=class extends Error{constructor(e,t){var n,r,i,o;super(e||"Unknown error"),n=this,i="AssertError",(r="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r="name"))?o:String(o))in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}}},9367:e=>{const t={};e.exports=t.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=t.Bench.now()}elapsed(){return t.Bench.now()-this.ts}static now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}}},8630:(e,t,n)=>{const r=n(738);e.exports=function(){return new Promise(r)}},8571:(e,t,n)=>{const r=n(9621),i=n(4277),o=n(7043),s={needsProtoHack:new Set([i.set,i.map,i.weakSet,i.weakMap])};e.exports=s.clone=function(e,t={},n=null){if("object"!=typeof e||null===e)return e;let r=s.clone,a=n;if(t.shallow){if(!0!==t.shallow)return s.cloneWithShallow(e,t);r=e=>e}else if(a){const t=a.get(e);if(t)return t}else a=new Map;const l=i.getInternalProto(e);switch(l){case i.buffer:return(!1).from(e);case i.date:return new Date(e.getTime());case i.regex:case i.url:return new l.constructor(e)}const c=s.base(e,l,t);if(c===e)return e;if(a&&a.set(e,c),l===i.set)for(const n of e)c.add(r(n,t,a));else if(l===i.map)for(const[n,i]of e)c.set(n,r(i,t,a));const u=o.keys(e,t);for(const n of u){if("__proto__"===n)continue;if(l===i.array&&"length"===n){c.length=e.length;continue}const o=Object.getOwnPropertyDescriptor(e,n);o?o.get||o.set?Object.defineProperty(c,n,o):o.enumerable?c[n]=r(e[n],t,a):Object.defineProperty(c,n,{enumerable:!1,writable:!0,configurable:!0,value:r(e[n],t,a)}):Object.defineProperty(c,n,{enumerable:!0,writable:!0,configurable:!0,value:r(e[n],t,a)})}return c},s.cloneWithShallow=function(e,t){const n=t.shallow;(t=Object.assign({},t)).shallow=!1;const i=new Map;for(const t of n){const n=r(e,t);"object"!=typeof n&&"function"!=typeof n||i.set(n,n)}return s.clone(e,t,i)},s.base=function(e,t,n){if(!1===n.prototype)return s.needsProtoHack.has(t)?new t.constructor:t===i.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(t===i.array){const e=[];return r!==t&&Object.setPrototypeOf(e,r),e}if(s.needsProtoHack.has(t)){const e=new r.constructor;return r!==t&&Object.setPrototypeOf(e,r),e}return Object.create(r)}},1467:(e,t,n)=>{const r=n(375),i=n(9474),o=n(6064),s=n(7043),a={};e.exports=function(e,t,n={}){return"object"!=typeof t&&(t=[t]),r(!Array.isArray(t)||t.length,"Values array cannot be empty"),"string"==typeof e?a.string(e,t,n):Array.isArray(e)?a.array(e,t,n):(r("object"==typeof e,"Reference must be string or an object"),a.object(e,t,n))},a.array=function(e,t,n){if(Array.isArray(t)||(t=[t]),!e.length)return!1;if(n.only&&n.once&&e.length!==t.length)return!1;let r;const i=new Map;for(const e of t)if(n.deep&&e&&"object"==typeof e){var o;r=null!==(o=r)&&void 0!==o?o:a.compare(n);let t=!1;for(const[n,o]of i.entries())if(r(n,e)){++o.allowed,t=!0;break}t||i.set(e,{allowed:1,hits:0})}else{const t=i.get(e);t?++t.allowed:i.set(e,{allowed:1,hits:0})}let s=0;for(const t of e){let e;if(n.deep&&t&&"object"==typeof t){var l;r=null!==(l=r)&&void 0!==l?l:a.compare(n);for(const[n,o]of i.entries())if(r(n,t)){e=o;break}}else e=i.get(t);if(e&&(++e.hits,++s,n.once&&e.hits>e.allowed))return!1}if(n.only&&s!==e.length)return!1;for(const e of i.values())if(e.hits!==e.allowed&&e.hits<e.allowed&&!n.part)return!1;return!!s},a.object=function(e,t,n){r(void 0===n.once,"Cannot use option once with object");const i=s.keys(e,n);if(!i.length)return!1;if(Array.isArray(t))return a.array(i,t,n);const o=Object.getOwnPropertySymbols(t).filter((e=>t.propertyIsEnumerable(e))),l=[...Object.keys(t),...o],c=a.compare(n),u=new Set(l);for(const r of i)if(u.has(r)){if(!c(t[r],e[r]))return!1;u.delete(r)}else if(n.only)return!1;return!u.size||!!n.part&&u.size<l.length},a.string=function(e,t,n){if(""===e)return 1===t.length&&""===t[0]||!n.once&&!t.some((e=>""!==e));const i=new Map,s=[];for(const e of t)if(r("string"==typeof e,"Cannot compare string reference to non-string value"),e){const t=i.get(e);t?++t.allowed:(i.set(e,{allowed:1,hits:0}),s.push(o(e)))}else if(n.once||n.only)return!1;if(!s.length)return!0;const a=new RegExp(`(${s.join("|")})`,"g"),l=e.replace(a,((e,t)=>(++i.get(t).hits,"")));if(n.only&&l)return!1;let c=!1;for(const e of i.values())if(e.hits&&(c=!0),e.hits!==e.allowed){if(e.hits<e.allowed&&!n.part)return!1;if(n.once)return!1}return!!c},a.compare=function(e){if(!e.deep)return a.shallow;const t=void 0!==e.only,n=void 0!==e.part,r={prototype:t?e.only:!!n&&!e.part,part:t?!e.only:!!n&&e.part};return(e,t)=>i(e,t,r)},a.shallow=function(e,t){return e===t}},9474:(e,t,n)=>{const r=n(4277),i={mismatched:null};e.exports=function(e,t,n){return n=Object.assign({prototype:!0},n),!!i.isDeepEqual(e,t,n,[])},i.isDeepEqual=function(e,t,n,o){if(e===t)return 0!==e||1/e==1/t;const s=typeof e;if(s!==typeof t)return!1;if(null===e||null===t)return!1;if("function"===s){if(!n.deepFunction||e.toString()!==t.toString())return!1}else if("object"!==s)return e!=e&&t!=t;const a=i.getSharedType(e,t,!!n.prototype);switch(a){case r.buffer:return!1;case r.promise:return e===t;case r.regex:case r.url:return e.toString()===t.toString();case i.mismatched:return!1}for(let n=o.length-1;n>=0;--n)if(o[n].isSame(e,t))return!0;o.push(new i.SeenEntry(e,t));try{return!!i.isDeepEqualObj(a,e,t,n,o)}finally{o.pop()}},i.getSharedType=function(e,t,n){if(n)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?i.mismatched:r.getInternalProto(e);const o=r.getInternalProto(e);return o!==r.getInternalProto(t)?i.mismatched:o},i.valueOf=function(e){const t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},i.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},i.isSetSimpleEqual=function(e,t){for(const n of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,n))return!1;return!0},i.isDeepEqualObj=function(e,t,n,o,s){const{isDeepEqual:a,valueOf:l,hasOwnEnumerableProperty:c}=i,{keys:u,getOwnPropertySymbols:d}=Object;if(e===r.array){if(!o.part){if(t.length!==n.length)return!1;for(let e=0;e<t.length;++e)if(!a(t[e],n[e],o,s))return!1;return!0}for(const e of t)for(const t of n)if(a(e,t,o,s))return!0}else if(e===r.set){if(t.size!==n.size)return!1;if(!i.isSetSimpleEqual(t,n)){const e=new Set(Set.prototype.values.call(n));for(const n of Set.prototype.values.call(t)){if(e.delete(n))continue;let t=!1;for(const r of e)if(a(n,r,o,s)){e.delete(r),t=!0;break}if(!t)return!1}}}else if(e===r.map){if(t.size!==n.size)return!1;for(const[e,r]of Map.prototype.entries.call(t)){if(void 0===r&&!Map.prototype.has.call(n,e))return!1;if(!a(r,Map.prototype.get.call(n,e),o,s))return!1}}else if(e===r.error&&(t.name!==n.name||t.message!==n.message))return!1;const f=l(t),p=l(n);if((t!==f||n!==p)&&!a(f,p,o,s))return!1;const h=u(t);if(!o.part&&h.length!==u(n).length&&!o.skip)return!1;let m=0;for(const e of h)if(o.skip&&o.skip.includes(e))void 0===n[e]&&++m;else{if(!c(n,e))return!1;if(!a(t[e],n[e],o,s))return!1}if(!o.part&&h.length-m!==u(n).length)return!1;if(!1!==o.symbols){const e=d(t),r=new Set(d(n));for(const i of e){var g;if(null===(g=o.skip)||void 0===g||!g.includes(i))if(c(t,i)){if(!c(n,i))return!1;if(!a(t[i],n[i],o,s))return!1}else if(c(n,i))return!1;r.delete(i)}for(const e of r)if(c(n,e))return!1}return!0},i.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}},4168:(e,t,n)=>{const r=n(375);e.exports=function(e){return r(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(e),"Bad attribute value ("+e+")"),e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}},5277:e=>{const t={};e.exports=function(e){if(!e)return"";let n="";for(let r=0;r<e.length;++r){const i=e.charCodeAt(r);t.isSafe(i)?n+=e[r]:n+=t.escapeHtmlChar(i)}return n},t.escapeHtmlChar=function(e){return t.namedHtml.get(e)||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)},t.isSafe=function(e){return t.safeCharCodes.has(e)},t.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]),t.safeCharCodes=function(){const e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&e.add(t);return e}()},7973:e=>{const t={};e.exports=function(e){return e?e.replace(/[<>&\u2028\u2029]/g,t.escape):""},t.escape=function(e){return t.replacements.get(e)},t.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])},6064:e=>{e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},655:e=>{const t={};e.exports=t.flatten=function(e,n){const r=n||[];for(const n of e)Array.isArray(n)?t.flatten(n,r):r.push(n);return r}},738:e=>{e.exports=function(){}},8870:(e,t,n)=>{t.applyToDefaults=n(978),t.assert=n(375),t.AssertError=n(4213),t.Bench=n(9367),t.block=n(8630),t.clone=n(8571),t.contain=n(1467),t.deepEqual=n(9474),t.escapeHeaderAttribute=n(4168),t.escapeHtml=n(5277),t.escapeJson=n(7973),t.escapeRegex=n(6064),t.flatten=n(655),t.ignore=n(738),t.intersect=n(5088),t.isPromise=n(7259),t.merge=n(1687),t.once=n(5022),t.reach=n(9621),t.reachTemplate=n(4069),t.stringify=n(8761),t.wait=n(2620)},5088:e=>{const t={};e.exports=function(e,n,r={}){if(!e||!n)return r.first?null:[];const i=[],o=Array.isArray(e)?new Set(e):e,s=new Set;for(const e of n)if(t.has(o,e)&&!s.has(e)){if(r.first)return e;i.push(e),s.add(e)}return r.first?null:i},t.has=function(e,t){return"function"==typeof e.has?e.has(t):void 0!==e[t]}},7259:e=>{e.exports=function(e){return"function"==typeof(null==e?void 0:e.then)}},1687:(e,t,n)=>{const r=n(375),i=n(8571),o=n(7043),s={};e.exports=s.merge=function(e,t,n){if(r(e&&"object"==typeof e,"Invalid target value: must be an object"),r(null==t||"object"==typeof t,"Invalid source value: must be null, undefined, or an object"),!t)return e;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(t)){r(Array.isArray(e),"Cannot merge array onto an object"),n.mergeArrays||(e.length=0);for(let r=0;r<t.length;++r)e.push(i(t[r],{symbols:n.symbols}));return e}const a=o.keys(t,n);for(let r=0;r<a.length;++r){const o=a[r];if("__proto__"===o||!Object.prototype.propertyIsEnumerable.call(t,o))continue;const l=t[o];if(l&&"object"==typeof l){if(e[o]===l)continue;!e[o]||"object"!=typeof e[o]||Array.isArray(e[o])!==Array.isArray(l)||l instanceof Date||l instanceof RegExp?e[o]=i(l,{symbols:n.symbols}):s.merge(e[o],l,n)}else(null!=l||n.nullOverride)&&(e[o]=l)}return e}},5022:e=>{const t=Symbol("wrapped");e.exports=function(e){if(e[t])return e;let n=!1;const r=function(...t){n||(n=!0,e(...t))};return r[t]=!0,r}},9621:(e,t,n)=>{const r=n(375),i={};e.exports=function(e,t,n){if(!1===t||null==t)return e;"string"==typeof(n=n||{})&&(n={separator:n});const o=Array.isArray(t);r(!o||!n.separator,"Separator option is not valid for array-based chain");const s=o?t:t.split(n.separator||".");let a=e;for(let e=0;e<s.length;++e){let o=s[e];const l=n.iterables&&i.iterables(a);if(Array.isArray(a)||"set"===l){const e=Number(o);Number.isInteger(e)&&(o=e<0?a.length+e:e)}if(!a||"function"==typeof a&&!1===n.functions||!l&&void 0===a[o]){r(!n.strict||e+1===s.length,"Missing segment",o,"in reach path ",t),r("object"==typeof a||!0===n.functions||"function"!=typeof a,"Invalid segment",o,"in reach path ",t),a=n.default;break}a=l?"set"===l?[...a][o]:a.get(o):a[o]}return a},i.iterables=function(e){return e instanceof Set?"set":e instanceof Map?"map":void 0}},4069:(e,t,n)=>{const r=n(9621);e.exports=function(e,t,n){return t.replace(/{([^{}]+)}/g,((t,i)=>{const o=r(e,i,n);return null!=o?o:""}))}},8761:e=>{e.exports=function(...e){try{return JSON.stringify(...e)}catch(e){return"[Cannot display object: "+e.message+"]"}}},4277:(e,t)=>{const n={};t=e.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,url:URL.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},n.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object URL]",t.url],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const r=Object.prototype.toString.call(e);return n.typeMap.get(r)||t.generic}},7043:(e,t)=>{t.keys=function(e,t={}){return!1!==t.symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},2620:e=>{e.exports=function(e,t,n){if("bigint"==typeof e&&(e=Number(e)),e>=Number.MAX_SAFE_INTEGER&&(e=1/0),"number"!=typeof e&&void 0!==e)throw new TypeError("Timeout must be a number or bigint");return new Promise((r=>{const i=n?n.setTimeout:setTimeout,o=()=>{const n=Math.min(e,2147483647);e-=n,i((()=>e>0?o():r(t)),n)};e!==1/0&&o()}))}},7593:(e,t)=>{t.location=function(e=0){const t=Error.prepareStackTrace;Error.prepareStackTrace=(e,t)=>t;const n={};Error.captureStackTrace(n,this);const r=n.stack[e+1];return Error.prepareStackTrace=t,{filename:r.getFileName(),line:r.getLineNumber()}}},6264:(e,t,n)=>{n.r(t),n.d(t,{tlds:()=>r});const r=new Set(["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].map((e=>e.toLowerCase())))},3652:(e,t,n)=>{const{assert:r}=n(8870),i={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){var n,i,o,s,a;t=null!==(n=t)&&void 0!==n?n:{};const l=[].concat(null!==(i=t.before)&&void 0!==i?i:[]),c=[].concat(null!==(o=t.after)&&void 0!==o?o:[]),u=null!==(s=t.group)&&void 0!==s?s:"?",d=null!==(a=t.sort)&&void 0!==a?a:0;r(!l.includes(u),`Item cannot come before itself: ${u}`),r(!l.includes("?"),"Item cannot come before unassociated items"),r(!c.includes(u),`Item cannot come after itself: ${u}`),r(!c.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:d,before:l,after:c,group:u,node:t};this._items.push(e)}if(!t.manual){const e=this._sort();r(e,"item","?"!==u?`added into group ${u}`:"","created a dependencies error")}return this.nodes}merge(e){Array.isArray(e)||(e=[e]);for(const t of e)if(t)for(const e of t._items)this._items.push(Object.assign({},e));this._items.sort(i.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const t=this._sort();return r(t,"merge created a dependencies error"),this.nodes}sort(){const e=this._sort();return r(e,"sort created a dependencies error"),this.nodes}_sort(){const e={},t=Object.create(null),n=Object.create(null);for(const o of this._items){var r;const s=o.seq,a=o.group;n[a]=null!==(r=n[a])&&void 0!==r?r:[],n[a].push(s),e[s]=o.before;for(const e of o.after){var i;t[e]=null!==(i=t[e])&&void 0!==i?i:[],t[e].push(s)}}for(const t in e){const r=[];for(const i in e[t]){var o;const s=e[t][i];n[s]=null!==(o=n[s])&&void 0!==o?o:[],r.push(...n[s])}e[t]=r}for(const r in t)if(n[r])for(const i of n[r])e[i].push(...t[r]);const s={};for(const t in e){const n=e[t];for(const e of n){var a;s[e]=null!==(a=s[e])&&void 0!==a?a:[],s[e].push(t)}}const l={},c=[];for(let e=0;e<this._items.length;++e){let t=e;if(s[e]){t=null;for(let e=0;e<this._items.length;++e){if(!0===l[e])continue;s[e]||(s[e]=[]);const n=s[e].length;let r=0;for(let t=0;t<n;++t)l[s[e][t]]&&++r;if(r===n){t=e;break}}}null!==t&&(l[t]=!0,c.push(t))}if(c.length!==this._items.length)return!1;const u={};for(const e of this._items)u[e.seq]=e;this._items=[],this.nodes=[];for(const e of c){const t=u[e];this.nodes.push(t.node),this._items.push(t)}return!0}},i.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1},1275:()=>{},3975:()=>{},5934:e=>{e.exports=JSON.parse('{"version":"17.11.0"}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(5107)})(),e.exports=t()},493:(e,t,n)=>{n(603),e.exports=self.fetch.bind(self)},103:(e,t,n)=>{var r=n(715)(n(942),"DataView");e.exports=r},770:(e,t,n)=>{var r=n(715)(n(942),"Map");e.exports=r},413:(e,t,n)=>{var r=n(715)(n(942),"Promise");e.exports=r},512:(e,t,n)=>{var r=n(715)(n(942),"Set");e.exports=r},650:(e,t,n)=>{var r=n(942).Symbol;e.exports=r},270:(e,t,n)=>{var r=n(715)(n(942),"WeakMap");e.exports=r},379:(e,t,n)=>{var r=n(650),i=n(870),o=n(5),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},27:(e,t,n)=>{var r=n(379),i=n(547);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},624:(e,t,n)=>{var r=n(655),i=n(759),o=n(580),s=n(66),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,f=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?f:a).test(s(e))}},674:(e,t,n)=>{var r=n(379),i=n(387),o=n(547),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},195:(e,t,n)=>{var r=n(882),i=n(121),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},460:e=>{e.exports=function(e){return function(t){return e(t)}}},950:(e,t,n)=>{var r=n(942)["__core-js_shared__"];e.exports=r},967:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},715:(e,t,n)=>{var r=n(624),i=n(155);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},870:(e,t,n)=>{var r=n(650),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},486:(e,t,n)=>{var r=n(103),i=n(770),o=n(413),s=n(512),a=n(270),l=n(379),c=n(66),u="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=c(r),g=c(i),y=c(o),b=c(s),v=c(a),_=l;(r&&_(new r(new ArrayBuffer(1)))!=h||i&&_(new i)!=u||o&&_(o.resolve())!=d||s&&_(new s)!=f||a&&_(new a)!=p)&&(_=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case m:return h;case g:return u;case y:return d;case b:return f;case v:return p}return t}),e.exports=_},155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},759:(e,t,n)=>{var r,i=n(950),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},882:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},121:(e,t,n)=>{var r=n(766)(Object.keys,Object);e.exports=r},306:(e,t,n)=>{e=n.nmd(e);var r=n(967),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},5:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},766:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},942:(e,t,n)=>{var r=n(967),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},66:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},283:(e,t,n)=>{var r=n(27),i=n(547),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},142:e=>{var t=Array.isArray;e.exports=t},529:(e,t,n)=>{var r=n(655),i=n(387);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},853:(e,t,n)=>{e=n.nmd(e);var r=n(942),i=n(772),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},514:(e,t,n)=>{var r=n(195),i=n(486),o=n(283),s=n(142),a=n(529),l=n(853),c=n(882),u=n(666),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(a(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},655:(e,t,n)=>{var r=n(379),i=n(580);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},387:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},547:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},666:(e,t,n)=>{var r=n(674),i=n(460),o=n(306),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},250:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,u=1/0,d=9007199254740991,f=NaN,p=4294967295,h=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",y="[object Boolean]",b="[object Date]",v="[object Error]",_="[object Function]",w="[object GeneratorFunction]",A="[object Map]",x="[object Number]",S="[object Object]",O="[object Promise]",E="[object RegExp]",C="[object Set]",j="[object String]",T="[object Symbol]",I="[object WeakMap]",R="[object ArrayBuffer]",D="[object DataView]",N="[object Float32Array]",F="[object Float64Array]",k="[object Int8Array]",$="[object Int16Array]",M="[object Int32Array]",P="[object Uint8Array]",L="[object Uint8ClampedArray]",B="[object Uint16Array]",q="[object Uint32Array]",U=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,V=RegExp(H.source),W=RegExp(X.source),Y=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Ae="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",je="["+we+"]",Te="["+Ce+"]",Ie="["+Ae+"]",Re="\\d+",De="["+xe+"]",Ne="["+Se+"]",Fe="[^"+we+Ce+Re+xe+Se+Oe+"]",ke="\\ud83c[\\udffb-\\udfff]",$e="[^"+we+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",Pe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Oe+"]",Be="\\u200d",qe="(?:"+Ne+"|"+Fe+")",Ue="(?:"+Le+"|"+Fe+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Ie+"|"+ke+")?",Xe="["+Ee+"]?",Ve=Xe+He+"(?:"+Be+"(?:"+[$e,Me,Pe].join("|")+")"+Xe+He+")*",We="(?:"+[De,Me,Pe].join("|")+")"+Ve,Ye="(?:"+[$e+Ie+"?",Ie,Me,Pe,je].join("|")+")",Ke=RegExp("['’]","g"),Ze=RegExp(Ie,"g"),Je=RegExp(ke+"(?="+ke+")|"+Ye+Ve,"g"),Qe=RegExp([Le+"?"+Ne+"+"+Ge+"(?="+[Te,Le,"$"].join("|")+")",Ue+"+"+ze+"(?="+[Te,Le+qe,"$"].join("|")+")",Le+"?"+qe+"+"+Ge,Le+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,We].join("|"),"g"),et=RegExp("["+Be+we+Ae+Ee+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[N]=it[F]=it[k]=it[$]=it[M]=it[P]=it[L]=it[B]=it[q]=!0,it[m]=it[g]=it[R]=it[y]=it[D]=it[b]=it[v]=it[_]=it[A]=it[x]=it[S]=it[E]=it[C]=it[j]=it[I]=!1;var ot={};ot[m]=ot[g]=ot[R]=ot[D]=ot[y]=ot[b]=ot[N]=ot[F]=ot[k]=ot[$]=ot[M]=ot[A]=ot[x]=ot[S]=ot[E]=ot[C]=ot[j]=ot[T]=ot[P]=ot[L]=ot[B]=ot[q]=!0,ot[v]=ot[_]=ot[I]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ft=t&&!t.nodeType&&t,pt=ft&&e&&!e.nodeType&&e,ht=pt&&pt.exports===ft,mt=ht&&ct.process,gt=function(){try{return pt&&pt.require&&pt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=gt&&gt.isArrayBuffer,bt=gt&&gt.isDate,vt=gt&&gt.isMap,_t=gt&&gt.isRegExp,wt=gt&&gt.isSet,At=gt&&gt.isTypedArray;function xt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function Ot(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Et(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Ct(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function jt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Tt(e,t){return!(null==e||!e.length)&&Lt(e,t,0)>-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Rt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Dt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Nt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Ft(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var $t=Gt("length");function Mt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Pt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Lt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Pt(e,qt,n)}function Bt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function qt(e){return e!=e}function Ut(e,t){var n=null==e?0:e.length;return n?Xt(e,t)/n:f}function Gt(e){return function(t){return null==t?i:t[e]}}function zt(e){return function(t){return null==e?i:e[t]}}function Ht(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Xt(e,t){for(var n,r=-1,o=e.length;++r<o;){var s=t(e[r]);s!==i&&(n=n===i?s:n+s)}return n}function Vt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Wt(e){return e?e.slice(0,fn(e)+1).replace(re,""):e}function Yt(e){return function(t){return e(t)}}function Kt(e,t){return Rt(t,(function(t){return e[t]}))}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&Lt(t,e[n],0)>-1;);return n}function Qt(e,t){for(var n=e.length;n--&&Lt(t,e[n],0)>-1;);return n}var en=zt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=zt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function un(e){return rn(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):$t(e)}function dn(e){return rn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function fn(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var pn=zt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hn=function e(t){var n,r=(t=null==t?dt:hn.defaults(dt.Object(),t,hn.pick(dt,nt))).Array,ie=t.Date,we=t.Error,Ae=t.Function,xe=t.Math,Se=t.Object,Oe=t.RegExp,Ee=t.String,Ce=t.TypeError,je=r.prototype,Te=Ae.prototype,Ie=Se.prototype,Re=t["__core-js_shared__"],De=Te.toString,Ne=Ie.hasOwnProperty,Fe=0,ke=(n=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",$e=Ie.toString,Me=De.call(Se),Pe=dt._,Le=Oe("^"+De.call(Ne).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:i,qe=t.Symbol,Ue=t.Uint8Array,Ge=Be?Be.allocUnsafe:i,ze=sn(Se.getPrototypeOf,Se),He=Se.create,Xe=Ie.propertyIsEnumerable,Ve=je.splice,We=qe?qe.isConcatSpreadable:i,Ye=qe?qe.iterator:i,Je=qe?qe.toStringTag:i,et=function(){try{var e=lo(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==dt.Date.now&&ie.now,ut=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=xe.ceil,pt=xe.floor,mt=Se.getOwnPropertySymbols,gt=Be?Be.isBuffer:i,$t=t.isFinite,zt=je.join,mn=sn(Se.keys,Se),gn=xe.max,yn=xe.min,bn=ie.now,vn=t.parseInt,_n=xe.random,wn=je.reverse,An=lo(t,"DataView"),xn=lo(t,"Map"),Sn=lo(t,"Promise"),On=lo(t,"Set"),En=lo(t,"WeakMap"),Cn=lo(Se,"create"),jn=En&&new En,Tn={},In=Mo(An),Rn=Mo(xn),Dn=Mo(Sn),Nn=Mo(On),Fn=Mo(En),kn=qe?qe.prototype:i,$n=kn?kn.valueOf:i,Mn=kn?kn.toString:i;function Pn(e){if(ea(e)&&!Gs(e)&&!(e instanceof Un)){if(e instanceof qn)return e;if(Ne.call(e,"__wrapped__"))return Po(e)}return new qn(e)}var Ln=function(){function e(){}return function(t){if(!Qs(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Bn(){}function qn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Hn;++t<n;)this.add(e[t])}function Vn(e){var t=this.__data__=new zn(e);this.size=t.size}function Wn(e,t){var n=Gs(e),r=!n&&Us(e),i=!n&&!r&&Vs(e),o=!n&&!r&&!i&&la(e),s=n||r||i||o,a=s?Vt(e.length,Ee):[],l=a.length;for(var c in e)!t&&!Ne.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||go(c,l))||a.push(c);return a}function Yn(e){var t=e.length;return t?e[Hr(0,t-1)]:i}function Kn(e,t){return Do(Ei(e),or(t,0,e.length))}function Zn(e){return Do(Ei(e))}function Jn(e,t,n){(n!==i&&!Ls(e[t],n)||n===i&&!(t in e))&&rr(e,t,n)}function Qn(e,t,n){var r=e[t];Ne.call(e,t)&&Ls(r,n)&&(n!==i||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Ls(e[n][0],t))return n;return-1}function tr(e,t,n,r){return ur(e,(function(e,i,o){t(r,e,n(e),o)})),r}function nr(e,t){return e&&Ci(t,Ia(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ir(e,t){for(var n=-1,o=t.length,s=r(o),a=null==e;++n<o;)s[n]=a?i:Oa(e,t[n]);return s}function or(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!Qs(e))return e;var d=Gs(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ne.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Ei(e,a)}else{var f=fo(e),p=f==_||f==w;if(Vs(e))return _i(e,l);if(f==S||f==m||p&&!o){if(a=c||p?{}:ho(e),!l)return c?function(e,t){return Ci(e,uo(e),t)}(e,function(e,t){return e&&Ci(t,Ra(t),e)}(a,e)):function(e,t){return Ci(e,co(e),t)}(e,nr(a,e))}else{if(!ot[f])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case R:return wi(e);case y:case b:return new i(+e);case D:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case F:case k:case $:case M:case P:case L:case B:case q:return Ai(e,n);case A:return new i;case x:case j:return new i(e);case E:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new i;case T:return r=e,$n?Se($n.call(r)):{}}}(e,f,l)}}s||(s=new Vn);var h=s.get(e);if(h)return h;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var g=d?i:(u?c?to:eo:c?Ra:Ia)(e);return Ot(g||e,(function(r,i){g&&(r=e[i=r]),Qn(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Se(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new Ce(o);return jo((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=Tt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Rt(t,Yt(n))),r?(o=It,s=!1):t.length>=200&&(o=Zt,s=!1,t=new Xn(t));e:for(;++i<a;){var u=e[i],d=null==n?u:n(u);if(u=r||0!==u?u:0,s&&d==d){for(var f=c;f--;)if(t[f]===d)continue e;l.push(u)}else o(t,d,r)||l.push(u)}return l}Pn.templateSettings={escape:Y,evaluate:K,interpolate:Z,variable:"",imports:{_:Pn}},Pn.prototype=Bn.prototype,Pn.prototype.constructor=Pn,qn.prototype=Ln(Bn.prototype),qn.prototype.constructor=qn,Un.prototype=Ln(Bn.prototype),Un.prototype.constructor=Un,Gn.prototype.clear=function(){this.__data__=Cn?Cn(null):{},this.size=0},Gn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Gn.prototype.get=function(e){var t=this.__data__;if(Cn){var n=t[e];return n===s?i:n}return Ne.call(t,e)?t[e]:i},Gn.prototype.has=function(e){var t=this.__data__;return Cn?t[e]!==i:Ne.call(t,e)},Gn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Cn&&t===i?s:t,this},zn.prototype.clear=function(){this.__data__=[],this.size=0},zn.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():Ve.call(t,n,1),--this.size,0))},zn.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?i:t[n][1]},zn.prototype.has=function(e){return er(this.__data__,e)>-1},zn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(xn||zn),string:new Gn}},Hn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Hn.prototype.get=function(e){return so(this,e).get(e)},Hn.prototype.has=function(e){return so(this,e).has(e)},Hn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,s),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.clear=function(){this.__data__=new zn,this.size=0},Vn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Vn.prototype.get=function(e){return this.__data__.get(e)},Vn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof zn){var r=n.__data__;if(!xn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hn(r)}return n.set(e,t),this.size=n.size,this};var ur=Ii(br),dr=Ii(vr,!0);function fr(e,t){var n=!0;return ur(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function pr(e,t,n){for(var r=-1,o=e.length;++r<o;){var s=e[r],a=t(s);if(null!=a&&(l===i?a==a&&!aa(a):n(a,l)))var l=a,c=s}return c}function hr(e,t){var n=[];return ur(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function mr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=mo),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?mr(a,t-1,n,r,i):Dt(i,a):r||(i[i.length]=a)}return i}var gr=Ri(),yr=Ri(!0);function br(e,t){return e&&gr(e,t,Ia)}function vr(e,t){return e&&yr(e,t,Ia)}function _r(e,t){return jt(t,(function(t){return Ks(e[t])}))}function wr(e,t){for(var n=0,r=(t=gi(t,e)).length;null!=e&&n<r;)e=e[$o(t[n++])];return n&&n==r?e:i}function Ar(e,t,n){var r=t(e);return Gs(e)?r:Dt(r,n(e))}function xr(e){return null==e?e===i?"[object Undefined]":"[object Null]":Je&&Je in Se(e)?function(e){var t=Ne.call(e,Je),n=e[Je];try{e[Je]=i;var r=!0}catch(e){}var o=$e.call(e);return r&&(t?e[Je]=n:delete e[Je]),o}(e):function(e){return $e.call(e)}(e)}function Sr(e,t){return e>t}function Or(e,t){return null!=e&&Ne.call(e,t)}function Er(e,t){return null!=e&&t in Se(e)}function Cr(e,t,n){for(var o=n?It:Tt,s=e[0].length,a=e.length,l=a,c=r(a),u=1/0,d=[];l--;){var f=e[l];l&&t&&(f=Rt(f,Yt(t))),u=yn(f.length,u),c[l]=!n&&(t||s>=120&&f.length>=120)?new Xn(l&&f):i}f=e[0];var p=-1,h=c[0];e:for(;++p<s&&d.length<u;){var m=f[p],g=t?t(m):m;if(m=n||0!==m?m:0,!(h?Zt(h,g):o(d,g,n))){for(l=a;--l;){var y=c[l];if(!(y?Zt(y,g):o(e[l],g,n)))continue e}h&&h.push(g),d.push(m)}}return d}function jr(e,t,n){var r=null==(e=Oo(e,t=gi(t,e)))?e:e[$o(Yo(t))];return null==r?i:xt(r,e,n)}function Tr(e){return ea(e)&&xr(e)==m}function Ir(e,t,n,r,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,n,r,o,s){var a=Gs(e),l=Gs(t),c=a?g:fo(e),u=l?g:fo(t),d=(c=c==m?S:c)==S,f=(u=u==m?S:u)==S,p=c==u;if(p&&Vs(e)){if(!Vs(t))return!1;a=!0,d=!1}if(p&&!d)return s||(s=new Vn),a||la(e)?Ji(e,t,n,r,o,s):function(e,t,n,r,i,o,s){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case y:case b:case x:return Ls(+e,+t);case v:return e.name==t.name&&e.message==t.message;case E:case j:return e==t+"";case A:var a=on;case C:var l=1&r;if(a||(a=ln),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=Ji(a(e),a(t),r,i,o,s);return s.delete(e),u;case T:if($n)return $n.call(e)==$n.call(t)}return!1}(e,t,c,n,r,o,s);if(!(1&n)){var h=d&&Ne.call(e,"__wrapped__"),_=f&&Ne.call(t,"__wrapped__");if(h||_){var w=h?e.value():e,O=_?t.value():t;return s||(s=new Vn),o(w,O,n,r,s)}}return!!p&&(s||(s=new Vn),function(e,t,n,r,o,s){var a=1&n,l=eo(e),c=l.length;if(c!=eo(t).length&&!a)return!1;for(var u=c;u--;){var d=l[u];if(!(a?d in t:Ne.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var m=a;++u<c;){var g=e[d=l[u]],y=t[d];if(r)var b=a?r(y,g,d,t,e,s):r(g,y,d,e,t,s);if(!(b===i?g===y||o(g,y,n,r,s):b)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var v=e.constructor,_=t.constructor;v==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _||(h=!1)}return s.delete(e),s.delete(t),h}(e,t,n,r,o,s))}(e,t,n,r,Ir,o))}function Rr(e,t,n,r){var o=n.length,s=o,a=!r;if(null==e)return!s;for(e=Se(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=n[o])[0],u=e[c],d=l[1];if(a&&l[2]){if(u===i&&!(c in e))return!1}else{var f=new Vn;if(r)var p=r(u,d,c,e,t,f);if(!(p===i?Ir(d,u,3,r,f):p))return!1}}return!0}function Dr(e){return!(!Qs(e)||(t=e,ke&&ke in t))&&(Ks(e)?Le:me).test(Mo(e));var t}function Nr(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Gs(e)?Pr(e[0],e[1]):Mr(e):dl(e)}function Fr(e){if(!wo(e))return mn(e);var t=[];for(var n in Se(e))Ne.call(e,n)&&"constructor"!=n&&t.push(n);return t}function kr(e,t){return e<t}function $r(e,t){var n=-1,i=Hs(e)?r(e.length):[];return ur(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Mr(e){var t=ao(e);return 1==t.length&&t[0][2]?xo(t[0][0],t[0][1]):function(n){return n===e||Rr(n,e,t)}}function Pr(e,t){return bo(e)&&Ao(t)?xo($o(e),t):function(n){var r=Oa(n,e);return r===i&&r===t?Ea(n,e):Ir(t,r,3)}}function Lr(e,t,n,r,o){e!==t&&gr(t,(function(s,a){if(o||(o=new Vn),Qs(s))!function(e,t,n,r,o,s,a){var l=Eo(e,n),c=Eo(t,n),u=a.get(c);if(u)Jn(e,n,u);else{var d=s?s(l,c,n+"",e,t,a):i,f=d===i;if(f){var p=Gs(c),h=!p&&Vs(c),m=!p&&!h&&la(c);d=c,p||h||m?Gs(l)?d=l:Xs(l)?d=Ei(l):h?(f=!1,d=_i(c,!0)):m?(f=!1,d=Ai(c,!0)):d=[]:ra(c)||Us(c)?(d=l,Us(l)?d=ga(l):Qs(l)&&!Ks(l)||(d=ho(c))):f=!1}f&&(a.set(c,d),o(d,c,r,s,a),a.delete(c)),Jn(e,n,d)}}(e,t,a,n,Lr,r,o);else{var l=r?r(Eo(e,a),s,a+"",e,t,o):i;l===i&&(l=s),Jn(e,a,l)}}),Ra)}function Br(e,t){var n=e.length;if(n)return go(t+=t<0?n:0,n)?e[t]:i}function qr(e,t,n){t=t.length?Rt(t,(function(e){return Gs(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e})):[nl];var r=-1;t=Rt(t,Yt(oo()));var i=$r(e,(function(e,n,i){var o=Rt(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var r=e.length;for(e.sort((function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=xi(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Ur(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=wr(e,s);n(a,s)&&Kr(o,gi(s,e),a)}return o}function Gr(e,t,n,r){var i=r?Bt:Lt,o=-1,s=t.length,a=e;for(e===t&&(t=Ei(t)),n&&(a=Rt(e,Yt(n)));++o<s;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(a,u,l,r))>-1;)a!==e&&Ve.call(a,l,1),Ve.call(e,l,1);return e}function zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;go(i)?Ve.call(e,i,1):li(e,i)}}return e}function Hr(e,t){return e+pt(_n()*(t-e+1))}function Xr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function Vr(e,t){return To(So(e,t,nl),e+"")}function Wr(e){return Yn(La(e))}function Yr(e,t){var n=La(e);return Do(n,or(t,0,n.length))}function Kr(e,t,n,r){if(!Qs(e))return e;for(var o=-1,s=(t=gi(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=$o(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var d=l[c];(u=r?r(d,c,l):i)===i&&(u=Qs(d)?d:go(t[o+1])?[]:{})}Qn(l,c,u),l=l[c]}return e}var Zr=jn?function(e,t){return jn.set(e,t),e}:nl,Jr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Qa(t),writable:!0})}:nl;function Qr(e){return Do(La(e))}function ei(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var n;return ur(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function ni(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ri(e,t,nl,n)}function ri(e,t,n,r){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,c=aa(t),u=t===i;o<s;){var d=pt((o+s)/2),f=n(e[d]),p=f!==i,h=null===f,m=f==f,g=aa(f);if(a)var y=r||m;else y=u?m&&(r||p):l?m&&p&&(r||!h):c?m&&p&&!h&&(r||!g):!h&&!g&&(r?f<=t:f<t);y?o=d+1:s=d}return yn(s,4294967294)}function ii(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!Ls(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?f:+e}function si(e){if("string"==typeof e)return e;if(Gs(e))return Rt(e,si)+"";if(aa(e))return Mn?Mn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,n){var r=-1,i=Tt,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=It;else if(o>=200){var c=t?null:Xi(e);if(c)return ln(c);s=!1,i=Zt,l=new Xn}else l=t?[]:a;e:for(;++r<o;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,s&&d==d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}function li(e,t){return null==(e=Oo(e,t=gi(t,e)))||delete e[$o(Yo(t))]}function ci(e,t,n,r){return Kr(e,t,n(wr(e,t)),r)}function ui(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ei(e,r?0:o,r?o+1:i):ei(e,r?o+1:0,r?i:o)}function di(e,t){var n=e;return n instanceof Un&&(n=n.value()),Nt(t,(function(e,t){return t.func.apply(t.thisArg,Dt([e],t.args))}),n)}function fi(e,t,n){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=e[o],l=-1;++l<i;)l!=o&&(s[o]=cr(s[o]||a,e[l],t,n));return ai(mr(s,1),t,n)}function pi(e,t,n){for(var r=-1,o=e.length,s=t.length,a={};++r<o;){var l=r<s?t[r]:i;n(a,e[r],l)}return a}function hi(e){return Xs(e)?e:[]}function mi(e){return"function"==typeof e?e:nl}function gi(e,t){return Gs(e)?e:bo(e,t)?[e]:ko(ya(e))}var yi=Vr;function bi(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:ei(e,t,n)}var vi=st||function(e){return dt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Ai(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function xi(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,u=aa(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!u&&e<t||u&&n&&o&&!r&&!s||l&&n&&o||!a&&o||!c)return-1}return 0}function Si(e,t,n,i){for(var o=-1,s=e.length,a=n.length,l=-1,c=t.length,u=gn(s-a,0),d=r(c+u),f=!i;++l<c;)d[l]=t[l];for(;++o<a;)(f||o<s)&&(d[n[o]]=e[o]);for(;u--;)d[l++]=e[o++];return d}function Oi(e,t,n,i){for(var o=-1,s=e.length,a=-1,l=n.length,c=-1,u=t.length,d=gn(s-l,0),f=r(d+u),p=!i;++o<d;)f[o]=e[o];for(var h=o;++c<u;)f[h+c]=t[c];for(;++a<l;)(p||o<s)&&(f[h+n[a]]=e[o++]);return f}function Ei(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Ci(e,t,n,r){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?rr(n,l,c):Qn(n,l,c)}return n}function ji(e,t){return function(n,r){var i=Gs(n)?St:tr,o=t?t():{};return i(n,e,oo(r,2),o)}}function Ti(e){return Vr((function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Se(t);++r<o;){var l=n[r];l&&e(t,l,r,s)}return t}))}function Ii(e,t){return function(n,r){if(null==n)return n;if(!Hs(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Se(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Ri(e){return function(t,n,r){for(var i=-1,o=Se(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function Di(e){return function(t){var n=rn(t=ya(t))?dn(t):i,r=n?n[0]:t.charAt(0),o=n?bi(n,1).join(""):t.slice(1);return r[e]()+o}}function Ni(e){return function(t){return Nt(Ka(Ua(t).replace(Ke,"")),e,"")}}function Fi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Ln(e.prototype),r=e.apply(n,t);return Qs(r)?r:n}}function ki(e){return function(t,n,r){var o=Se(t);if(!Hs(t)){var s=oo(n,3);t=Ia(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[s?t[a]:a]:i}}function $i(e){return Qi((function(t){var n=t.length,r=n,s=qn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ce(o);if(s&&!l&&"wrapper"==ro(a))var l=new qn([],!0)}for(r=l?r:n;++r<n;){var c=ro(a=t[r]),u="wrapper"==c?no(a):i;l=u&&vo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ro(u[0])].apply(l,u[3]):1==a.length&&vo(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Gs(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Mi(e,t,n,o,s,a,l,u,d,f){var p=t&c,h=1&t,m=2&t,g=24&t,y=512&t,b=m?i:Fi(e);return function c(){for(var v=arguments.length,_=r(v),w=v;w--;)_[w]=arguments[w];if(g)var A=io(c),x=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(_,A);if(o&&(_=Si(_,o,s,g)),a&&(_=Oi(_,a,l,g)),v-=x,g&&v<f){var S=an(_,A);return zi(e,t,Mi,c.placeholder,n,_,S,u,d,f-v)}var O=h?n:this,E=m?O[e]:e;return v=_.length,u?_=function(e,t){for(var n=e.length,r=yn(t.length,n),o=Ei(e);r--;){var s=t[r];e[r]=go(s,n)?o[s]:i}return e}(_,u):y&&v>1&&_.reverse(),p&&d<v&&(_.length=d),this&&this!==dt&&this instanceof c&&(E=b||Fi(E)),E.apply(O,_)}}function Pi(e,t){return function(n,r){return function(e,t,n,r){return br(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Li(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=si(n),r=si(r)):(n=oi(n),r=oi(r)),o=e(n,r)}return o}}function Bi(e){return Qi((function(t){return t=Rt(t,Yt(oo())),Vr((function(n){var r=this;return e(t,(function(e){return xt(e,r,n)}))}))}))}function qi(e,t){var n=(t=t===i?" ":si(t)).length;if(n<2)return n?Xr(t,e):t;var r=Xr(t,ft(e/un(t)));return rn(t)?bi(dn(r),0,e).join(""):r.slice(0,e)}function Ui(e){return function(t,n,o){return o&&"number"!=typeof o&&yo(t,n,o)&&(n=o=i),t=fa(t),n===i?(n=t,t=0):n=fa(n),function(e,t,n,i){for(var o=-1,s=gn(ft((t-e)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=e,e+=n;return a}(t,n,o=o===i?t<n?1:-1:fa(o),e)}}function Gi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ma(t),n=ma(n)),e(t,n)}}function zi(e,t,n,r,o,s,a,c,u,d){var f=8&t;t|=f?l:64,4&(t&=~(f?64:l))||(t&=-4);var p=[e,t,o,f?s:i,f?a:i,f?i:s,f?i:a,c,u,d],h=n.apply(i,p);return vo(e)&&Co(h,p),h.placeholder=r,Io(h,e,t)}function Hi(e){var t=xe[e];return function(e,n){if(e=ma(e),(n=null==n?0:yn(pa(n),292))&&$t(e)){var r=(ya(e)+"e").split("e");return+((r=(ya(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Xi=On&&1/ln(new On([,-0]))[1]==u?function(e){return new On(e)}:al;function Vi(e){return function(t){var n=fo(t);return n==A?on(t):n==C?cn(t):function(e,t){return Rt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Wi(e,t,n,s,u,d,f,p){var h=2&t;if(!h&&"function"!=typeof e)throw new Ce(o);var m=s?s.length:0;if(m||(t&=-97,s=u=i),f=f===i?f:gn(pa(f),0),p=p===i?p:pa(p),m-=u?u.length:0,64&t){var g=s,y=u;s=u=i}var b=h?i:no(e),v=[e,t,n,s,u,g,y,d,f,p];if(b&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?Si(u,l,t[4]):l,e[4]=u?an(e[3],a):t[4]}(l=t[5])&&(u=e[5],e[5]=u?Oi(u,l,t[6]):l,e[6]=u?an(e[5],a):t[6]),(l=t[7])&&(e[7]=l),r&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(v,b),e=v[0],t=v[1],n=v[2],s=v[3],u=v[4],!(p=v[9]=v[9]===i?h?0:e.length:gn(v[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,n){var o=Fi(e);return function s(){for(var a=arguments.length,l=r(a),c=a,u=io(s);c--;)l[c]=arguments[c];var d=a<3&&l[0]!==u&&l[a-1]!==u?[]:an(l,u);return(a-=d.length)<n?zi(e,t,Mi,s.placeholder,i,l,d,i,i,n-a):xt(this&&this!==dt&&this instanceof s?o:e,this,l)}}(e,t,p):t!=l&&33!=t||u.length?Mi.apply(i,v):function(e,t,n,i){var o=1&t,s=Fi(e);return function t(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=r(u+l),f=this&&this!==dt&&this instanceof t?s:e;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return xt(f,o?n:this,d)}}(e,t,n,s);else var _=function(e,t,n){var r=1&t,i=Fi(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Io((b?Zr:Co)(_,v),e,t)}function Yi(e,t,n,r){return e===i||Ls(e,Ie[n])&&!Ne.call(r,n)?t:e}function Ki(e,t,n,r,o,s){return Qs(e)&&Qs(t)&&(s.set(t,e),Lr(e,t,i,Ki,s),s.delete(t)),e}function Zi(e){return ra(e)?i:e}function Ji(e,t,n,r,o,s){var a=1&n,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,h=2&n?new Xn:i;for(s.set(e,t),s.set(t,e);++f<l;){var m=e[f],g=t[f];if(r)var y=a?r(g,m,f,t,e,s):r(m,g,f,e,t,s);if(y!==i){if(y)continue;p=!1;break}if(h){if(!kt(t,(function(e,t){if(!Zt(h,t)&&(m===e||o(m,e,n,r,s)))return h.push(t)}))){p=!1;break}}else if(m!==g&&!o(m,g,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function Qi(e){return To(So(e,i,zo),e+"")}function eo(e){return Ar(e,Ia,co)}function to(e){return Ar(e,Ra,uo)}var no=jn?function(e){return jn.get(e)}:al;function ro(e){for(var t=e.name+"",n=Tn[t],r=Ne.call(Tn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(Ne.call(Pn,"placeholder")?Pn:e).placeholder}function oo(){var e=Pn.iteratee||rl;return e=e===rl?Nr:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ia(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ao(i)]}return t}function lo(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Dr(n)?n:i}var co=mt?function(e){return null==e?[]:(e=Se(e),jt(mt(e),(function(t){return Xe.call(e,t)})))}:hl,uo=mt?function(e){for(var t=[];e;)Dt(t,co(e)),e=ze(e);return t}:hl,fo=xr;function po(e,t,n){for(var r=-1,i=(t=gi(t,e)).length,o=!1;++r<i;){var s=$o(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Js(i)&&go(s,i)&&(Gs(e)||Us(e))}function ho(e){return"function"!=typeof e.constructor||wo(e)?{}:Ln(ze(e))}function mo(e){return Gs(e)||Us(e)||!!(We&&e&&e[We])}function go(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,n){if(!Qs(n))return!1;var r=typeof t;return!!("number"==r?Hs(n)&&go(t,n.length):"string"==r&&t in n)&&Ls(n[t],e)}function bo(e,t){if(Gs(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!aa(e))||Q.test(e)||!J.test(e)||null!=t&&e in Se(t)}function vo(e){var t=ro(e),n=Pn[t];if("function"!=typeof n||!(t in Un.prototype))return!1;if(e===n)return!0;var r=no(n);return!!r&&e===r[0]}(An&&fo(new An(new ArrayBuffer(1)))!=D||xn&&fo(new xn)!=A||Sn&&fo(Sn.resolve())!=O||On&&fo(new On)!=C||En&&fo(new En)!=I)&&(fo=function(e){var t=xr(e),n=t==S?e.constructor:i,r=n?Mo(n):"";if(r)switch(r){case In:return D;case Rn:return A;case Dn:return O;case Nn:return C;case Fn:return I}return t});var _o=Re?Ks:ml;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ie)}function Ao(e){return e==e&&!Qs(e)}function xo(e,t){return function(n){return null!=n&&n[e]===t&&(t!==i||e in Se(n))}}function So(e,t,n){return t=gn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=gn(i.length-t,0),a=r(s);++o<s;)a[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(a),xt(e,this,l)}}function Oo(e,t){return t.length<2?e:wr(e,ei(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Co=Ro(Zr),jo=ut||function(e,t){return dt.setTimeout(e,t)},To=Ro(Jr);function Io(e,t,n){var r=t+"";return To(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ot(h,(function(n){var r="_."+n[0];t&n[1]&&!Tt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Ro(e){var t=0,n=0;return function(){var r=bn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Do(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var s=Hr(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var No,Fo,ko=(No=Ns((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,n,r,i){t.push(r?i.replace(ue,"$1"):n||e)})),t}),(function(e){return 500===Fo.size&&Fo.clear(),e})),Fo=No.cache,No);function $o(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Po(e){if(e instanceof Un)return e.clone();var t=new qn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=Vr((function(e,t){return Xs(e)?cr(e,mr(t,1,Xs,!0)):[]})),Bo=Vr((function(e,t){var n=Yo(t);return Xs(n)&&(n=i),Xs(e)?cr(e,mr(t,1,Xs,!0),oo(n,2)):[]})),qo=Vr((function(e,t){var n=Yo(t);return Xs(n)&&(n=i),Xs(e)?cr(e,mr(t,1,Xs,!0),i,n):[]}));function Uo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=gn(r+i,0)),Pt(e,oo(t,3),i)}function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=pa(n),o=n<0?gn(r+o,0):yn(o,r-1)),Pt(e,oo(t,3),o,!0)}function zo(e){return null!=e&&e.length?mr(e,1):[]}function Ho(e){return e&&e.length?e[0]:i}var Xo=Vr((function(e){var t=Rt(e,hi);return t.length&&t[0]===e[0]?Cr(t):[]})),Vo=Vr((function(e){var t=Yo(e),n=Rt(e,hi);return t===Yo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Cr(n,oo(t,2)):[]})),Wo=Vr((function(e){var t=Yo(e),n=Rt(e,hi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Cr(n,i,t):[]}));function Yo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Ko=Vr(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?Gr(e,t):e}var Jo=Qi((function(e,t){var n=null==e?0:e.length,r=ir(e,t);return zr(e,Rt(t,(function(e){return go(e,n)?+e:e})).sort(xi)),r}));function Qo(e){return null==e?e:wn.call(e)}var es=Vr((function(e){return ai(mr(e,1,Xs,!0))})),ts=Vr((function(e){var t=Yo(e);return Xs(t)&&(t=i),ai(mr(e,1,Xs,!0),oo(t,2))})),ns=Vr((function(e){var t=Yo(e);return t="function"==typeof t?t:i,ai(mr(e,1,Xs,!0),i,t)}));function rs(e){if(!e||!e.length)return[];var t=0;return e=jt(e,(function(e){if(Xs(e))return t=gn(e.length,t),!0})),Vt(t,(function(t){return Rt(e,Gt(t))}))}function is(e,t){if(!e||!e.length)return[];var n=rs(e);return null==t?n:Rt(n,(function(e){return xt(t,i,e)}))}var os=Vr((function(e,t){return Xs(e)?cr(e,t):[]})),ss=Vr((function(e){return fi(jt(e,Xs))})),as=Vr((function(e){var t=Yo(e);return Xs(t)&&(t=i),fi(jt(e,Xs),oo(t,2))})),ls=Vr((function(e){var t=Yo(e);return t="function"==typeof t?t:i,fi(jt(e,Xs),i,t)})),cs=Vr(rs),us=Vr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function ds(e){var t=Pn(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var ps=Qi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Un&&go(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:i}),new qn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),hs=ji((function(e,t,n){Ne.call(e,n)?++e[n]:rr(e,n,1)})),ms=ki(Uo),gs=ki(Go);function ys(e,t){return(Gs(e)?Ot:ur)(e,oo(t,3))}function bs(e,t){return(Gs(e)?Et:dr)(e,oo(t,3))}var vs=ji((function(e,t,n){Ne.call(e,n)?e[n].push(t):rr(e,n,[t])})),_s=Vr((function(e,t,n){var i=-1,o="function"==typeof t,s=Hs(e)?r(e.length):[];return ur(e,(function(e){s[++i]=o?xt(t,e,n):jr(e,t,n)})),s})),ws=ji((function(e,t,n){rr(e,n,t)}));function As(e,t){return(Gs(e)?Rt:$r)(e,oo(t,3))}var xs=ji((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Ss=Vr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),qr(e,mr(t,1),[])})),Os=ct||function(){return dt.Date.now()};function Es(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Wi(e,c,i,i,i,i,t)}function Cs(e,t){var n;if("function"!=typeof t)throw new Ce(o);return e=pa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var js=Vr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(js));r|=l}return Wi(e,r,t,n,i)})),Ts=Vr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(Ts));r|=l}return Wi(t,r,e,n,i)}));function Is(e,t,n){var r,s,a,l,c,u,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Ce(o);function m(t){var n=r,o=s;return r=s=i,d=t,l=e.apply(o,n)}function g(e){var n=e-u;return u===i||n>=t||n<0||p&&e-d>=a}function y(){var e=Os();if(g(e))return b(e);c=jo(y,function(e){var n=t-(e-u);return p?yn(n,a-(e-d)):n}(e))}function b(e){return c=i,h&&r?m(e):(r=s=i,l)}function v(){var e=Os(),n=g(e);if(r=arguments,s=this,u=e,n){if(c===i)return function(e){return d=e,c=jo(y,t),f?m(e):l}(u);if(p)return vi(c),c=jo(y,t),m(u)}return c===i&&(c=jo(y,t)),l}return t=ma(t)||0,Qs(n)&&(f=!!n.leading,a=(p="maxWait"in n)?gn(ma(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),v.cancel=function(){c!==i&&vi(c),d=0,r=u=s=c=i},v.flush=function(){return c===i?l:b(Os())},v}var Rs=Vr((function(e,t){return lr(e,1,t)})),Ds=Vr((function(e,t,n){return lr(e,ma(t)||0,n)}));function Ns(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ce(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ns.Cache||Hn),n}function Fs(e){if("function"!=typeof e)throw new Ce(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ns.Cache=Hn;var ks=yi((function(e,t){var n=(t=1==t.length&&Gs(t[0])?Rt(t[0],Yt(oo())):Rt(mr(t,1),Yt(oo()))).length;return Vr((function(r){for(var i=-1,o=yn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return xt(e,this,r)}))})),$s=Vr((function(e,t){var n=an(t,io($s));return Wi(e,l,i,t,n)})),Ms=Vr((function(e,t){var n=an(t,io(Ms));return Wi(e,64,i,t,n)})),Ps=Qi((function(e,t){return Wi(e,256,i,i,i,t)}));function Ls(e,t){return e===t||e!=e&&t!=t}var Bs=Gi(Sr),qs=Gi((function(e,t){return e>=t})),Us=Tr(function(){return arguments}())?Tr:function(e){return ea(e)&&Ne.call(e,"callee")&&!Xe.call(e,"callee")},Gs=r.isArray,zs=yt?Yt(yt):function(e){return ea(e)&&xr(e)==R};function Hs(e){return null!=e&&Js(e.length)&&!Ks(e)}function Xs(e){return ea(e)&&Hs(e)}var Vs=gt||ml,Ws=bt?Yt(bt):function(e){return ea(e)&&xr(e)==b};function Ys(e){if(!ea(e))return!1;var t=xr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Ks(e){if(!Qs(e))return!1;var t=xr(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zs(e){return"number"==typeof e&&e==pa(e)}function Js(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Qs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=vt?Yt(vt):function(e){return ea(e)&&fo(e)==A};function na(e){return"number"==typeof e||ea(e)&&xr(e)==x}function ra(e){if(!ea(e)||xr(e)!=S)return!1;var t=ze(e);if(null===t)return!0;var n=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Me}var ia=_t?Yt(_t):function(e){return ea(e)&&xr(e)==E},oa=wt?Yt(wt):function(e){return ea(e)&&fo(e)==C};function sa(e){return"string"==typeof e||!Gs(e)&&ea(e)&&xr(e)==j}function aa(e){return"symbol"==typeof e||ea(e)&&xr(e)==T}var la=At?Yt(At):function(e){return ea(e)&&Js(e.length)&&!!it[xr(e)]},ca=Gi(kr),ua=Gi((function(e,t){return e<=t}));function da(e){if(!e)return[];if(Hs(e))return sa(e)?dn(e):Ei(e);if(Ye&&e[Ye])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ye]());var t=fo(e);return(t==A?on:t==C?ln:La)(e)}function fa(e){return e?(e=ma(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function pa(e){var t=fa(e),n=t%1;return t==t?n?t-n:t:0}function ha(e){return e?or(pa(e),0,p):0}function ma(e){if("number"==typeof e)return e;if(aa(e))return f;if(Qs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Wt(e);var n=he.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):pe.test(e)?f:+e}function ga(e){return Ci(e,Ra(e))}function ya(e){return null==e?"":si(e)}var ba=Ti((function(e,t){if(wo(t)||Hs(t))Ci(t,Ia(t),e);else for(var n in t)Ne.call(t,n)&&Qn(e,n,t[n])})),va=Ti((function(e,t){Ci(t,Ra(t),e)})),_a=Ti((function(e,t,n,r){Ci(t,Ra(t),e,r)})),wa=Ti((function(e,t,n,r){Ci(t,Ia(t),e,r)})),Aa=Qi(ir),xa=Vr((function(e,t){e=Se(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n<r;)for(var s=t[n],a=Ra(s),l=-1,c=a.length;++l<c;){var u=a[l],d=e[u];(d===i||Ls(d,Ie[u])&&!Ne.call(e,u))&&(e[u]=s[u])}return e})),Sa=Vr((function(e){return e.push(i,Ki),xt(Na,i,e)}));function Oa(e,t,n){var r=null==e?i:wr(e,t);return r===i?n:r}function Ea(e,t){return null!=e&&po(e,t,Er)}var Ca=Pi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=$e.call(t)),e[t]=n}),Qa(nl)),ja=Pi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=$e.call(t)),Ne.call(e,t)?e[t].push(n):e[t]=[n]}),oo),Ta=Vr(jr);function Ia(e){return Hs(e)?Wn(e):Fr(e)}function Ra(e){return Hs(e)?Wn(e,!0):function(e){if(!Qs(e))return function(e){var t=[];if(null!=e)for(var n in Se(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var r in e)("constructor"!=r||!t&&Ne.call(e,r))&&n.push(r);return n}(e)}var Da=Ti((function(e,t,n){Lr(e,t,n)})),Na=Ti((function(e,t,n,r){Lr(e,t,n,r)})),Fa=Qi((function(e,t){var n={};if(null==e)return n;var r=!1;t=Rt(t,(function(t){return t=gi(t,e),r||(r=t.length>1),t})),Ci(e,to(e),n),r&&(n=sr(n,7,Zi));for(var i=t.length;i--;)li(n,t[i]);return n})),ka=Qi((function(e,t){return null==e?{}:function(e,t){return Ur(e,t,(function(t,n){return Ea(e,n)}))}(e,t)}));function $a(e,t){if(null==e)return{};var n=Rt(to(e),(function(e){return[e]}));return t=oo(t),Ur(e,n,(function(e,n){return t(e,n[0])}))}var Ma=Vi(Ia),Pa=Vi(Ra);function La(e){return null==e?[]:Kt(e,Ia(e))}var Ba=Ni((function(e,t,n){return t=t.toLowerCase(),e+(n?qa(t):t)}));function qa(e){return Ya(ya(e).toLowerCase())}function Ua(e){return(e=ya(e))&&e.replace(be,en).replace(Ze,"")}var Ga=Ni((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),za=Ni((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ha=Di("toLowerCase"),Xa=Ni((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Va=Ni((function(e,t,n){return e+(n?" ":"")+Ya(t)})),Wa=Ni((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ya=Di("toUpperCase");function Ka(e,t,n){return e=ya(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Za=Vr((function(e,t){try{return xt(e,i,t)}catch(e){return Ys(e)?e:new we(e)}})),Ja=Qi((function(e,t){return Ot(t,(function(t){t=$o(t),rr(e,t,js(e[t],e))})),e}));function Qa(e){return function(){return e}}var el=$i(),tl=$i(!0);function nl(e){return e}function rl(e){return Nr("function"==typeof e?e:sr(e,1))}var il=Vr((function(e,t){return function(n){return jr(n,e,t)}})),ol=Vr((function(e,t){return function(n){return jr(e,n,t)}}));function sl(e,t,n){var r=Ia(t),i=_r(t,r);null!=n||Qs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=_r(t,Ia(t)));var o=!(Qs(n)&&"chain"in n&&!n.chain),s=Ks(e);return Ot(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ei(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Dt([this.value()],arguments))})})),e}function al(){}var ll=Bi(Rt),cl=Bi(Ct),ul=Bi(kt);function dl(e){return bo(e)?Gt($o(e)):function(e){return function(t){return wr(t,e)}}(e)}var fl=Ui(),pl=Ui(!0);function hl(){return[]}function ml(){return!1}var gl,yl=Li((function(e,t){return e+t}),0),bl=Hi("ceil"),vl=Li((function(e,t){return e/t}),1),_l=Hi("floor"),wl=Li((function(e,t){return e*t}),1),Al=Hi("round"),xl=Li((function(e,t){return e-t}),0);return Pn.after=function(e,t){if("function"!=typeof t)throw new Ce(o);return e=pa(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=Es,Pn.assign=ba,Pn.assignIn=va,Pn.assignInWith=_a,Pn.assignWith=wa,Pn.at=Aa,Pn.before=Cs,Pn.bind=js,Pn.bindAll=Ja,Pn.bindKey=Ts,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Gs(e)?e:[e]},Pn.chain=ds,Pn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:gn(pa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(ft(o/t));s<o;)l[a++]=ei(e,s,s+=t);return l},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Dt(Gs(n)?Ei(n):[n],mr(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,n=oo();return e=t?Rt(e,(function(e){if("function"!=typeof e[1])throw new Ce(o);return[n(e[0]),e[1]]})):[],Vr((function(n){for(var r=-1;++r<t;){var i=e[r];if(xt(i[0],this,n))return xt(i[1],this,n)}}))},Pn.conforms=function(e){return function(e){var t=Ia(e);return function(n){return ar(n,e,t)}}(sr(e,1))},Pn.constant=Qa,Pn.countBy=hs,Pn.create=function(e,t){var n=Ln(e);return null==t?n:nr(n,t)},Pn.curry=function e(t,n,r){var o=Wi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Pn.curryRight=function e(t,n,r){var o=Wi(t,16,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Pn.debounce=Is,Pn.defaults=xa,Pn.defaultsDeep=Sa,Pn.defer=Rs,Pn.delay=Ds,Pn.difference=Lo,Pn.differenceBy=Bo,Pn.differenceWith=qo,Pn.drop=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=n||t===i?1:pa(t))<0?0:t,r):[]},Pn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,0,(t=r-(t=n||t===i?1:pa(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0):[]},Pn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&yo(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=pa(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:pa(r))<0&&(r+=o),r=n>r?0:ha(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Pn.filter=function(e,t){return(Gs(e)?jt:hr)(e,oo(t,3))},Pn.flatMap=function(e,t){return mr(As(e,t),1)},Pn.flatMapDeep=function(e,t){return mr(As(e,t),u)},Pn.flatMapDepth=function(e,t,n){return n=n===i?1:pa(n),mr(As(e,t),n)},Pn.flatten=zo,Pn.flattenDeep=function(e){return null!=e&&e.length?mr(e,u):[]},Pn.flattenDepth=function(e,t){return null!=e&&e.length?mr(e,t=t===i?1:pa(t)):[]},Pn.flip=function(e){return Wi(e,512)},Pn.flow=el,Pn.flowRight=tl,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Pn.functions=function(e){return null==e?[]:_r(e,Ia(e))},Pn.functionsIn=function(e){return null==e?[]:_r(e,Ra(e))},Pn.groupBy=vs,Pn.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Pn.intersection=Xo,Pn.intersectionBy=Vo,Pn.intersectionWith=Wo,Pn.invert=Ca,Pn.invertBy=ja,Pn.invokeMap=_s,Pn.iteratee=rl,Pn.keyBy=ws,Pn.keys=Ia,Pn.keysIn=Ra,Pn.map=As,Pn.mapKeys=function(e,t){var n={};return t=oo(t,3),br(e,(function(e,r,i){rr(n,t(e,r,i),e)})),n},Pn.mapValues=function(e,t){var n={};return t=oo(t,3),br(e,(function(e,r,i){rr(n,r,t(e,r,i))})),n},Pn.matches=function(e){return Mr(sr(e,1))},Pn.matchesProperty=function(e,t){return Pr(e,sr(t,1))},Pn.memoize=Ns,Pn.merge=Da,Pn.mergeWith=Na,Pn.method=il,Pn.methodOf=ol,Pn.mixin=sl,Pn.negate=Fs,Pn.nthArg=function(e){return e=pa(e),Vr((function(t){return Br(t,e)}))},Pn.omit=Fa,Pn.omitBy=function(e,t){return $a(e,Fs(oo(t)))},Pn.once=function(e){return Cs(2,e)},Pn.orderBy=function(e,t,n,r){return null==e?[]:(Gs(t)||(t=null==t?[]:[t]),Gs(n=r?i:n)||(n=null==n?[]:[n]),qr(e,t,n))},Pn.over=ll,Pn.overArgs=ks,Pn.overEvery=cl,Pn.overSome=ul,Pn.partial=$s,Pn.partialRight=Ms,Pn.partition=xs,Pn.pick=ka,Pn.pickBy=$a,Pn.property=dl,Pn.propertyOf=function(e){return function(t){return null==e?i:wr(e,t)}},Pn.pull=Ko,Pn.pullAll=Zo,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Gr(e,t,oo(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Gr(e,t,i,n):e},Pn.pullAt=Jo,Pn.range=fl,Pn.rangeRight=pl,Pn.rearg=Ps,Pn.reject=function(e,t){return(Gs(e)?jt:hr)(e,Fs(oo(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=oo(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return zr(e,i),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new Ce(o);return Vr(e,t=t===i?t:pa(t))},Pn.reverse=Qo,Pn.sampleSize=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),(Gs(e)?Kn:Yr)(e,t)},Pn.set=function(e,t,n){return null==e?e:Kr(e,t,n)},Pn.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:Kr(e,t,n,r)},Pn.shuffle=function(e){return(Gs(e)?Zn:Qr)(e)},Pn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&yo(e,t,n)?(t=0,n=r):(t=null==t?0:pa(t),n=n===i?r:pa(n)),ei(e,t,n)):[]},Pn.sortBy=Ss,Pn.sortedUniq=function(e){return e&&e.length?ii(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&yo(e,t,n)&&(t=n=i),(n=n===i?p:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?bi(dn(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new Ce(o);return t=null==t?0:gn(pa(t),0),Vr((function(n){var r=n[t],i=bi(n,0,t);return r&&Dt(i,r),xt(e,this,i)}))},Pn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:pa(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:pa(t)))<0?0:t,r):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?ui(e,oo(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ce(o);return Qs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Is(e,t,{leading:r,maxWait:t,trailing:i})},Pn.thru=fs,Pn.toArray=da,Pn.toPairs=Ma,Pn.toPairsIn=Pa,Pn.toPath=function(e){return Gs(e)?Rt(e,$o):aa(e)?[e]:Ei(ko(ya(e)))},Pn.toPlainObject=ga,Pn.transform=function(e,t,n){var r=Gs(e),i=r||Vs(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Qs(e)&&Ks(o)?Ln(ze(e)):{}}return(i?Ot:br)(e,(function(e,r,i){return t(n,e,r,i)})),n},Pn.unary=function(e){return Es(e,1)},Pn.union=es,Pn.unionBy=ts,Pn.unionWith=ns,Pn.uniq=function(e){return e&&e.length?ai(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Pn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Pn.unset=function(e,t){return null==e||li(e,t)},Pn.unzip=rs,Pn.unzipWith=is,Pn.update=function(e,t,n){return null==e?e:ci(e,t,mi(n))},Pn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,mi(n),r)},Pn.values=La,Pn.valuesIn=function(e){return null==e?[]:Kt(e,Ra(e))},Pn.without=os,Pn.words=Ka,Pn.wrap=function(e,t){return $s(mi(t),e)},Pn.xor=ss,Pn.xorBy=as,Pn.xorWith=ls,Pn.zip=cs,Pn.zipObject=function(e,t){return pi(e||[],t||[],Qn)},Pn.zipObjectDeep=function(e,t){return pi(e||[],t||[],Kr)},Pn.zipWith=us,Pn.entries=Ma,Pn.entriesIn=Pa,Pn.extend=va,Pn.extendWith=_a,sl(Pn,Pn),Pn.add=yl,Pn.attempt=Za,Pn.camelCase=Ba,Pn.capitalize=qa,Pn.ceil=bl,Pn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ma(n))==n?n:0),t!==i&&(t=(t=ma(t))==t?t:0),or(ma(e),t,n)},Pn.clone=function(e){return sr(e,4)},Pn.cloneDeep=function(e){return sr(e,5)},Pn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Pn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Pn.conformsTo=function(e,t){return null==t||ar(e,t,Ia(t))},Pn.deburr=Ua,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=vl,Pn.endsWith=function(e,t,n){e=ya(e),t=si(t);var r=e.length,o=n=n===i?r:or(pa(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Pn.eq=Ls,Pn.escape=function(e){return(e=ya(e))&&W.test(e)?e.replace(X,tn):e},Pn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Pn.every=function(e,t,n){var r=Gs(e)?Ct:fr;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Pn.find=ms,Pn.findIndex=Uo,Pn.findKey=function(e,t){return Mt(e,oo(t,3),br)},Pn.findLast=gs,Pn.findLastIndex=Go,Pn.findLastKey=function(e,t){return Mt(e,oo(t,3),vr)},Pn.floor=_l,Pn.forEach=ys,Pn.forEachRight=bs,Pn.forIn=function(e,t){return null==e?e:gr(e,oo(t,3),Ra)},Pn.forInRight=function(e,t){return null==e?e:yr(e,oo(t,3),Ra)},Pn.forOwn=function(e,t){return e&&br(e,oo(t,3))},Pn.forOwnRight=function(e,t){return e&&vr(e,oo(t,3))},Pn.get=Oa,Pn.gt=Bs,Pn.gte=qs,Pn.has=function(e,t){return null!=e&&po(e,t,Or)},Pn.hasIn=Ea,Pn.head=Ho,Pn.identity=nl,Pn.includes=function(e,t,n,r){e=Hs(e)?e:La(e),n=n&&!r?pa(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Lt(e,t,n)>-1},Pn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=gn(r+i,0)),Lt(e,t,i)},Pn.inRange=function(e,t,n){return t=fa(t),n===i?(n=t,t=0):n=fa(n),function(e,t,n){return e>=yn(t,n)&&e<gn(t,n)}(e=ma(e),t,n)},Pn.invoke=Ta,Pn.isArguments=Us,Pn.isArray=Gs,Pn.isArrayBuffer=zs,Pn.isArrayLike=Hs,Pn.isArrayLikeObject=Xs,Pn.isBoolean=function(e){return!0===e||!1===e||ea(e)&&xr(e)==y},Pn.isBuffer=Vs,Pn.isDate=Ws,Pn.isElement=function(e){return ea(e)&&1===e.nodeType&&!ra(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Hs(e)&&(Gs(e)||"string"==typeof e||"function"==typeof e.splice||Vs(e)||la(e)||Us(e)))return!e.length;var t=fo(e);if(t==A||t==C)return!e.size;if(wo(e))return!Fr(e).length;for(var n in e)if(Ne.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return Ir(e,t)},Pn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Ir(e,t,i,n):!!r},Pn.isError=Ys,Pn.isFinite=function(e){return"number"==typeof e&&$t(e)},Pn.isFunction=Ks,Pn.isInteger=Zs,Pn.isLength=Js,Pn.isMap=ta,Pn.isMatch=function(e,t){return e===t||Rr(e,t,ao(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Rr(e,t,ao(t),n)},Pn.isNaN=function(e){return na(e)&&e!=+e},Pn.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dr(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=na,Pn.isObject=Qs,Pn.isObjectLike=ea,Pn.isPlainObject=ra,Pn.isRegExp=ia,Pn.isSafeInteger=function(e){return Zs(e)&&e>=-9007199254740991&&e<=d},Pn.isSet=oa,Pn.isString=sa,Pn.isSymbol=aa,Pn.isTypedArray=la,Pn.isUndefined=function(e){return e===i},Pn.isWeakMap=function(e){return ea(e)&&fo(e)==I},Pn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==xr(e)},Pn.join=function(e,t){return null==e?"":zt.call(e,t)},Pn.kebabCase=Ga,Pn.last=Yo,Pn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=pa(n))<0?gn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Pt(e,qt,o,!0)},Pn.lowerCase=za,Pn.lowerFirst=Ha,Pn.lt=ca,Pn.lte=ua,Pn.max=function(e){return e&&e.length?pr(e,nl,Sr):i},Pn.maxBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Sr):i},Pn.mean=function(e){return Ut(e,nl)},Pn.meanBy=function(e,t){return Ut(e,oo(t,2))},Pn.min=function(e){return e&&e.length?pr(e,nl,kr):i},Pn.minBy=function(e,t){return e&&e.length?pr(e,oo(t,2),kr):i},Pn.stubArray=hl,Pn.stubFalse=ml,Pn.stubObject=function(){return{}},Pn.stubString=function(){return""},Pn.stubTrue=function(){return!0},Pn.multiply=wl,Pn.nth=function(e,t){return e&&e.length?Br(e,pa(t)):i},Pn.noConflict=function(){return dt._===this&&(dt._=Pe),this},Pn.noop=al,Pn.now=Os,Pn.pad=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return qi(pt(i),n)+e+qi(ft(i),n)},Pn.padEnd=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?e+qi(t-r,n):e},Pn.padStart=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?qi(t-r,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),vn(ya(e).replace(re,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yo(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fa(e),t===i?(t=e,e=0):t=fa(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=_n();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Hr(e,t)},Pn.reduce=function(e,t,n){var r=Gs(e)?Nt:Ht,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},Pn.reduceRight=function(e,t,n){var r=Gs(e)?Ft:Ht,i=arguments.length<3;return r(e,oo(t,4),n,i,dr)},Pn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),Xr(ya(e),t)},Pn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var r=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++r<o;){var s=null==e?i:e[$o(t[r])];s===i&&(r=o,s=n),e=Ks(s)?s.call(e):s}return e},Pn.round=Al,Pn.runInContext=e,Pn.sample=function(e){return(Gs(e)?Yn:Wr)(e)},Pn.size=function(e){if(null==e)return 0;if(Hs(e))return sa(e)?un(e):e.length;var t=fo(e);return t==A||t==C?e.size:Fr(e).length},Pn.snakeCase=Xa,Pn.some=function(e,t,n){var r=Gs(e)?kt:ti;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Pn.sortedIndex=function(e,t){return ni(e,t)},Pn.sortedIndexBy=function(e,t,n){return ri(e,t,oo(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ni(e,t);if(r<n&&Ls(e[r],t))return r}return-1},Pn.sortedLastIndex=function(e,t){return ni(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return ri(e,t,oo(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ni(e,t,!0)-1;if(Ls(e[n],t))return n}return-1},Pn.startCase=Va,Pn.startsWith=function(e,t,n){return e=ya(e),n=null==n?0:or(pa(n),0,e.length),t=si(t),e.slice(n,n+t.length)==t},Pn.subtract=xl,Pn.sum=function(e){return e&&e.length?Xt(e,nl):0},Pn.sumBy=function(e,t){return e&&e.length?Xt(e,oo(t,2)):0},Pn.template=function(e,t,n){var r=Pn.templateSettings;n&&yo(e,t,n)&&(t=i),e=ya(e),t=_a({},t,r,Yi);var o,s,a=_a({},t.imports,r.imports,Yi),l=Ia(a),c=Kt(a,l),u=0,d=t.interpolate||ve,f="__p += '",p=Oe((t.escape||ve).source+"|"+d.source+"|"+(d===Z?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),h="//# sourceURL="+(Ne.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(p,(function(t,n,r,i,a,l){return r||(r=i),f+=e.slice(u,l).replace(_e,nn),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),a&&(s=!0,f+="';\n"+a+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),f+="';\n";var m=Ne.call(t,"variable")&&t.variable;if(m){if(ce.test(m))throw new we("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(s?f.replace(U,""):f).replace(G,"$1").replace(z,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=Za((function(){return Ae(l,h+"return "+f).apply(i,c)}));if(g.source=f,Ys(g))throw g;return g},Pn.times=function(e,t){if((e=pa(e))<1||e>d)return[];var n=p,r=yn(e,p);t=oo(t),e-=p;for(var i=Vt(r,t);++n<e;)t(n);return i},Pn.toFinite=fa,Pn.toInteger=pa,Pn.toLength=ha,Pn.toLower=function(e){return ya(e).toLowerCase()},Pn.toNumber=ma,Pn.toSafeInteger=function(e){return e?or(pa(e),-9007199254740991,d):0===e?e:0},Pn.toString=ya,Pn.toUpper=function(e){return ya(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=ya(e))&&(n||t===i))return Wt(e);if(!e||!(t=si(t)))return e;var r=dn(e),o=dn(t);return bi(r,Jt(r,o),Qt(r,o)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.slice(0,fn(e)+1);if(!e||!(t=si(t)))return e;var r=dn(e);return bi(r,0,Qt(r,dn(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.replace(re,"");if(!e||!(t=si(t)))return e;var r=dn(e);return bi(r,Jt(r,dn(t))).join("")},Pn.truncate=function(e,t){var n=30,r="...";if(Qs(t)){var o="separator"in t?t.separator:o;n="length"in t?pa(t.length):n,r="omission"in t?si(t.omission):r}var s=(e=ya(e)).length;if(rn(e)){var a=dn(e);s=a.length}if(n>=s)return e;var l=n-un(r);if(l<1)return r;var c=a?bi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Oe(o.source,ya(fe.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var f=u.index;c=c.slice(0,f===i?l:f)}}else if(e.indexOf(si(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Pn.unescape=function(e){return(e=ya(e))&&V.test(e)?e.replace(H,pn):e},Pn.uniqueId=function(e){var t=++Fe;return ya(e)+t},Pn.upperCase=Wa,Pn.upperFirst=Ya,Pn.each=ys,Pn.eachRight=bs,Pn.first=Ho,sl(Pn,(gl={},br(Pn,(function(e,t){Ne.call(Pn.prototype,t)||(gl[t]=e)})),gl),{chain:!1}),Pn.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Pn[e].placeholder=Pn})),Ot(["drop","take"],(function(e,t){Un.prototype[e]=function(n){n=n===i?1:gn(pa(n),0);var r=this.__filtered__&&!t?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,p),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ot(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(nl)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Vr((function(e,t){return"function"==typeof e?new Un(this):this.map((function(n){return jr(n,e,t)}))})),Un.prototype.reject=function(e){return this.filter(Fs(oo(e)))},Un.prototype.slice=function(e,t){e=pa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Un(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=pa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(p)},br(Un.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Pn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Pn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Un,c=a[0],u=l||Gs(t),d=function(e){var t=o.apply(Pn,Dt([e],a));return r&&f?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var f=this.__chain__,p=!!this.__actions__.length,h=s&&!f,m=l&&!p;if(!s&&u){t=m?t:new Un(this);var g=e.apply(t,a);return g.__actions__.push({func:fs,args:[d],thisArg:i}),new qn(g,f)}return h&&m?e.apply(this,a):(g=this.thru(d),h?r?g.value()[0]:g.value():g)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=je[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Pn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Gs(i)?i:[],e)}return this[n]((function(n){return t.apply(Gs(n)?n:[],e)}))}})),br(Un.prototype,(function(e,t){var n=Pn[t];if(n){var r=n.name+"";Ne.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:t,func:n})}})),Tn[Mi(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Gs(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yn(t,e+s);break;case"takeRight":e=gn(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,c=r?a:s-1,u=this.__iteratees__,d=u.length,f=0,p=yn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return di(e,this.__actions__);var h=[];e:for(;l--&&f<p;){for(var m=-1,g=e[c+=t];++m<d;){var y=u[m],b=y.iteratee,v=y.type,_=b(g);if(2==v)g=_;else if(!_){if(1==v)continue e;break e}}h[f++]=g}return h},Pn.prototype.at=ps,Pn.prototype.chain=function(){return ds(this)},Pn.prototype.commit=function(){return new qn(this.value(),this.__chain__)},Pn.prototype.next=function(){this.__values__===i&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof Bn;){var r=Po(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:fs,args:[Qo],thisArg:i}),new qn(t,this.__chain__)}return this.thru(Qo)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,Ye&&(Pn.prototype[Ye]=function(){return this}),Pn}();dt._=hn,(r=function(){return hn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},772:e=>{e.exports=function(){return!1}},603:(e,t,n)=>{n.r(t),n.d(t,{DOMException:()=>w,Headers:()=>u,Request:()=>y,Response:()=>v,fetch:()=>A});var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n.g&&n.g||{},i={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function f(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function p(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i.arrayBuffer&&i.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(i.blob)return this.blob().then(p);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,n,r,i,o=d(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,n=f(t=new FileReader),i=(r=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?r[1]:"utf-8",t.readAsText(e,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=a(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},u.prototype.delete=function(e){delete this.map[a(e)]},u.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},u.prototype.set=function(e,t){this.map[a(e)]=l(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),c(e)},u.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},u.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),c(e)},i.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var g=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function y(e,t){if(!(this instanceof y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,i,o=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(i=(n=t.method||this.method||"GET").toUpperCase(),g.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in r)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;s.test(this.url)?this.url=this.url.replace(s,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function b(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function v(e,t){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},m.call(y.prototype),m.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var _=[301,302,303,307,308];v.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})};var w=r.DOMException;try{new w}catch(e){(w=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),w.prototype.constructor=w}function A(e,t){return new Promise((function(n,o){var s=new y(e,t);if(s.signal&&s.signal.aborted)return o(new w("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}if(c.onload=function(){var e,t,r={statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{t.append(r,i)}catch(e){console.warn("Response "+e.message)}}})),t)};0===s.url.indexOf("file://")&&(c.status<200||c.status>599)?r.status=200:r.status=c.status,r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var i="response"in c?c.response:c.responseText;setTimeout((function(){n(new v(i,r))}),0)},c.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},c.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},c.onabort=function(){setTimeout((function(){o(new w("Aborted","AbortError"))}),0)},c.open(s.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?c.withCredentials=!0:"omit"===s.credentials&&(c.withCredentials=!1),"responseType"in c&&(i.blob?c.responseType="blob":i.arrayBuffer&&(c.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof u||r.Headers&&t.headers instanceof r.Headers)){var f=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){f.push(a(e)),c.setRequestHeader(e,l(t.headers[e]))})),s.headers.forEach((function(e,t){-1===f.indexOf(t)&&c.setRequestHeader(t,e)}))}else s.headers.forEach((function(e,t){c.setRequestHeader(t,e)}));s.signal&&(s.signal.addEventListener("abort",d),c.onreadystatechange=function(){4===c.readyState&&s.signal.removeEventListener("abort",d)}),c.send(void 0===s._bodyInit?null:s._bodyInit)}))}A.polyfill=!0,r.fetch||(r.fetch=A,r.Headers=u,r.Request=y,r.Response=v)},143:function(e){e.exports=function(){for(var e=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e<t?t:e>n?n:e},t=e,n={},r=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];r<i.length;r+=1){var o=i[r];n["[object "+o+"]"]=o.toLowerCase()}var s=function(e){return n[Object.prototype.toString.call(e)]||"object"},a=s,l=s,c=Math.PI,u={clip_rgb:function(e){e._clipped=!1,e._unclipped=e.slice(0);for(var n=0;n<=3;n++)n<3?((e[n]<0||e[n]>255)&&(e._clipped=!0),e[n]=t(e[n],0,255)):3===n&&(e[n]=t(e[n],0,1));return e},limit:e,type:s,unpack:function(e,t){return void 0===t&&(t=null),e.length>=3?Array.prototype.slice.call(e):"object"==a(e[0])&&t?t.split("").filter((function(t){return void 0!==e[0][t]})).map((function(t){return e[0][t]})):e[0]},last:function(e){if(e.length<2)return null;var t=e.length-1;return"string"==l(e[t])?e[t].toLowerCase():null},PI:c,TWOPI:2*c,PITHIRD:c/3,DEG2RAD:c/180,RAD2DEG:180/c},d={format:{},autodetect:[]},f=u.last,p=u.clip_rgb,h=u.type,m=d,g=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=this;if("object"===h(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var r=f(e),i=!1;if(!r){i=!0,m.sorted||(m.autodetect=m.autodetect.sort((function(e,t){return t.p-e.p})),m.sorted=!0);for(var o=0,s=m.autodetect;o<s.length;o+=1){var a=s[o];if(r=a.test.apply(a,e))break}}if(!m.format[r])throw new Error("unknown format: "+e);var l=m.format[r].apply(null,i?e:e.slice(0,-1));n._rgb=p(l),3===n._rgb.length&&n._rgb.push(1)};g.prototype.toString=function(){return"function"==h(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var y=g,b=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(b.Color,[null].concat(e)))};b.Color=y,b.version="2.4.2";var v=b,_=u.unpack,w=Math.max,A=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=_(e,"rgb"),r=n[0],i=n[1],o=n[2],s=1-w(r/=255,w(i/=255,o/=255)),a=s<1?1/(1-s):0;return[(1-r-s)*a,(1-i-s)*a,(1-o-s)*a,s]},x=u.unpack,S=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=x(e,"cmyk"))[0],r=e[1],i=e[2],o=e[3],s=e.length>4?e[4]:1;return 1===o?[0,0,0,s]:[n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),i>=1?0:255*(1-i)*(1-o),s]},O=v,E=y,C=d,j=u.unpack,T=u.type,I=A;E.prototype.cmyk=function(){return I(this._rgb)},O.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(E,[null].concat(e,["cmyk"])))},C.format.cmyk=S,C.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=j(e,"cmyk"),"array"===T(e)&&4===e.length)return"cmyk"}});var R=u.unpack,D=u.last,N=function(e){return Math.round(100*e)/100},F=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=R(e,"hsla"),r=D(e)||"lsa";return n[0]=N(n[0]||0),n[1]=N(100*n[1])+"%",n[2]=N(100*n[2])+"%","hsla"===r||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,r="hsla"):n.length=3,r+"("+n.join(",")+")"},k=u.unpack,$=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=k(e,"rgba"))[0],r=e[1],i=e[2];n/=255,r/=255,i/=255;var o,s,a=Math.min(n,r,i),l=Math.max(n,r,i),c=(l+a)/2;return l===a?(o=0,s=Number.NaN):o=c<.5?(l-a)/(l+a):(l-a)/(2-l-a),n==l?s=(r-i)/(l-a):r==l?s=2+(i-n)/(l-a):i==l&&(s=4+(n-r)/(l-a)),(s*=60)<0&&(s+=360),e.length>3&&void 0!==e[3]?[s,o,c,e[3]]:[s,o,c]},M=u.unpack,P=u.last,L=F,B=$,q=Math.round,U=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=M(e,"rgba"),r=P(e)||"rgb";return"hsl"==r.substr(0,3)?L(B(n),r):(n[0]=q(n[0]),n[1]=q(n[1]),n[2]=q(n[2]),("rgba"===r||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,r="rgba"),r+"("+n.slice(0,"rgb"===r?3:4).join(",")+")")},G=u.unpack,z=Math.round,H=function(){for(var e,t=[],n=arguments.length;n--;)t[n]=arguments[n];var r,i,o,s=(t=G(t,"hsl"))[0],a=t[1],l=t[2];if(0===a)r=i=o=255*l;else{var c=[0,0,0],u=[0,0,0],d=l<.5?l*(1+a):l+a-l*a,f=2*l-d,p=s/360;c[0]=p+1/3,c[1]=p,c[2]=p-1/3;for(var h=0;h<3;h++)c[h]<0&&(c[h]+=1),c[h]>1&&(c[h]-=1),6*c[h]<1?u[h]=f+6*(d-f)*c[h]:2*c[h]<1?u[h]=d:3*c[h]<2?u[h]=f+(d-f)*(2/3-c[h])*6:u[h]=f;r=(e=[z(255*u[0]),z(255*u[1]),z(255*u[2])])[0],i=e[1],o=e[2]}return t.length>3?[r,i,o,t[3]]:[r,i,o,1]},X=H,V=d,W=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,Y=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,K=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Z=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,J=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Q=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ee=Math.round,te=function(e){var t;if(e=e.toLowerCase().trim(),V.format.named)try{return V.format.named(e)}catch(e){}if(t=e.match(W)){for(var n=t.slice(1,4),r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if(t=e.match(Y)){for(var i=t.slice(1,5),o=0;o<4;o++)i[o]=+i[o];return i}if(t=e.match(K)){for(var s=t.slice(1,4),a=0;a<3;a++)s[a]=ee(2.55*s[a]);return s[3]=1,s}if(t=e.match(Z)){for(var l=t.slice(1,5),c=0;c<3;c++)l[c]=ee(2.55*l[c]);return l[3]=+l[3],l}if(t=e.match(J)){var u=t.slice(1,4);u[1]*=.01,u[2]*=.01;var d=X(u);return d[3]=1,d}if(t=e.match(Q)){var f=t.slice(1,4);f[1]*=.01,f[2]*=.01;var p=X(f);return p[3]=+t[4],p}};te.test=function(e){return W.test(e)||Y.test(e)||K.test(e)||Z.test(e)||J.test(e)||Q.test(e)};var ne=v,re=y,ie=d,oe=u.type,se=U,ae=te;re.prototype.css=function(e){return se(this._rgb,e)},ne.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(re,[null].concat(e,["css"])))},ie.format.css=ae,ie.autodetect.push({p:5,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===oe(e)&&ae.test(e))return"css"}});var le=y,ce=v,ue=u.unpack;d.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=ue(e,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},ce.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(le,[null].concat(e,["gl"])))},le.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var de=u.unpack,fe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=de(e,"rgb"),i=r[0],o=r[1],s=r[2],a=Math.min(i,o,s),l=Math.max(i,o,s),c=l-a,u=100*c/255,d=a/(255-c)*100;return 0===c?n=Number.NaN:(i===l&&(n=(o-s)/c),o===l&&(n=2+(s-i)/c),s===l&&(n=4+(i-o)/c),(n*=60)<0&&(n+=360)),[n,u,d]},pe=u.unpack,he=Math.floor,me=function(){for(var e,t,n,r,i,o,s=[],a=arguments.length;a--;)s[a]=arguments[a];var l,c,u,d=(s=pe(s,"hcg"))[0],f=s[1],p=s[2];p*=255;var h=255*f;if(0===f)l=c=u=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var m=he(d/=60),g=d-m,y=p*(1-f),b=y+h*(1-g),v=y+h*g,_=y+h;switch(m){case 0:l=(e=[_,v,y])[0],c=e[1],u=e[2];break;case 1:l=(t=[b,_,y])[0],c=t[1],u=t[2];break;case 2:l=(n=[y,_,v])[0],c=n[1],u=n[2];break;case 3:l=(r=[y,b,_])[0],c=r[1],u=r[2];break;case 4:l=(i=[v,y,_])[0],c=i[1],u=i[2];break;case 5:l=(o=[_,y,b])[0],c=o[1],u=o[2]}}return[l,c,u,s.length>3?s[3]:1]},ge=u.unpack,ye=u.type,be=v,ve=y,_e=d,we=fe;ve.prototype.hcg=function(){return we(this._rgb)},be.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ve,[null].concat(e,["hcg"])))},_e.format.hcg=me,_e.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=ge(e,"hcg"),"array"===ye(e)&&3===e.length)return"hcg"}});var Ae=u.unpack,xe=u.last,Se=Math.round,Oe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Ae(e,"rgba"),r=n[0],i=n[1],o=n[2],s=n[3],a=xe(e)||"auto";void 0===s&&(s=1),"auto"===a&&(a=s<1?"rgba":"rgb");var l="000000"+((r=Se(r))<<16|(i=Se(i))<<8|(o=Se(o))).toString(16);l=l.substr(l.length-6);var c="0"+Se(255*s).toString(16);switch(c=c.substr(c.length-2),a.toLowerCase()){case"rgba":return"#"+l+c;case"argb":return"#"+c+l;default:return"#"+l}},Ee=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ce=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,je=function(e){if(e.match(Ee)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(Ce)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var n=parseInt(e,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw new Error("unknown hex color: "+e)},Te=v,Ie=y,Re=u.type,De=d,Ne=Oe;Ie.prototype.hex=function(e){return Ne(this._rgb,e)},Te.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Ie,[null].concat(e,["hex"])))},De.format.hex=je,De.autodetect.push({p:4,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===Re(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var Fe=u.unpack,ke=u.TWOPI,$e=Math.min,Me=Math.sqrt,Pe=Math.acos,Le=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=Fe(e,"rgb"),i=r[0],o=r[1],s=r[2],a=$e(i/=255,o/=255,s/=255),l=(i+o+s)/3,c=l>0?1-a/l:0;return 0===c?n=NaN:(n=(i-o+(i-s))/2,n/=Me((i-o)*(i-o)+(i-s)*(o-s)),n=Pe(n),s>o&&(n=ke-n),n/=ke),[360*n,c,l]},Be=u.unpack,qe=u.limit,Ue=u.TWOPI,Ge=u.PITHIRD,ze=Math.cos,He=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=Be(e,"hsi"))[0],s=e[1],a=e[2];return isNaN(o)&&(o=0),isNaN(s)&&(s=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?r=1-((i=(1-s)/3)+(n=(1+s*ze(Ue*o)/ze(Ge-Ue*o))/3)):o<2/3?i=1-((n=(1-s)/3)+(r=(1+s*ze(Ue*(o-=1/3))/ze(Ge-Ue*o))/3)):n=1-((r=(1-s)/3)+(i=(1+s*ze(Ue*(o-=2/3))/ze(Ge-Ue*o))/3)),[255*(n=qe(a*n*3)),255*(r=qe(a*r*3)),255*(i=qe(a*i*3)),e.length>3?e[3]:1]},Xe=u.unpack,Ve=u.type,We=v,Ye=y,Ke=d,Ze=Le;Ye.prototype.hsi=function(){return Ze(this._rgb)},We.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Ye,[null].concat(e,["hsi"])))},Ke.format.hsi=He,Ke.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Xe(e,"hsi"),"array"===Ve(e)&&3===e.length)return"hsi"}});var Je=u.unpack,Qe=u.type,et=v,tt=y,nt=d,rt=$;tt.prototype.hsl=function(){return rt(this._rgb)},et.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(tt,[null].concat(e,["hsl"])))},nt.format.hsl=H,nt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Je(e,"hsl"),"array"===Qe(e)&&3===e.length)return"hsl"}});var it=u.unpack,ot=Math.min,st=Math.max,at=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=it(e,"rgb"))[0],s=e[1],a=e[2],l=ot(o,s,a),c=st(o,s,a),u=c-l;return i=c/255,0===c?(n=Number.NaN,r=0):(r=u/c,o===c&&(n=(s-a)/u),s===c&&(n=2+(a-o)/u),a===c&&(n=4+(o-s)/u),(n*=60)<0&&(n+=360)),[n,r,i]},lt=u.unpack,ct=Math.floor,ut=function(){for(var e,t,n,r,i,o,s=[],a=arguments.length;a--;)s[a]=arguments[a];var l,c,u,d=(s=lt(s,"hsv"))[0],f=s[1],p=s[2];if(p*=255,0===f)l=c=u=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var h=ct(d/=60),m=d-h,g=p*(1-f),y=p*(1-f*m),b=p*(1-f*(1-m));switch(h){case 0:l=(e=[p,b,g])[0],c=e[1],u=e[2];break;case 1:l=(t=[y,p,g])[0],c=t[1],u=t[2];break;case 2:l=(n=[g,p,b])[0],c=n[1],u=n[2];break;case 3:l=(r=[g,y,p])[0],c=r[1],u=r[2];break;case 4:l=(i=[b,g,p])[0],c=i[1],u=i[2];break;case 5:l=(o=[p,g,y])[0],c=o[1],u=o[2]}}return[l,c,u,s.length>3?s[3]:1]},dt=u.unpack,ft=u.type,pt=v,ht=y,mt=d,gt=at;ht.prototype.hsv=function(){return gt(this._rgb)},pt.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ht,[null].concat(e,["hsv"])))},mt.format.hsv=ut,mt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=dt(e,"hsv"),"array"===ft(e)&&3===e.length)return"hsv"}});var yt={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},bt=yt,vt=u.unpack,_t=Math.pow,wt=function(e){return(e/=255)<=.04045?e/12.92:_t((e+.055)/1.055,2.4)},At=function(e){return e>bt.t3?_t(e,1/3):e/bt.t2+bt.t0},xt=function(e,t,n){return e=wt(e),t=wt(t),n=wt(n),[At((.4124564*e+.3575761*t+.1804375*n)/bt.Xn),At((.2126729*e+.7151522*t+.072175*n)/bt.Yn),At((.0193339*e+.119192*t+.9503041*n)/bt.Zn)]},St=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=vt(e,"rgb"),r=n[0],i=n[1],o=n[2],s=xt(r,i,o),a=s[0],l=s[1],c=116*l-16;return[c<0?0:c,500*(a-l),200*(l-s[2])]},Ot=yt,Et=u.unpack,Ct=Math.pow,jt=function(e){return 255*(e<=.00304?12.92*e:1.055*Ct(e,1/2.4)-.055)},Tt=function(e){return e>Ot.t1?e*e*e:Ot.t2*(e-Ot.t0)},It=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=Et(e,"lab"))[0],s=e[1],a=e[2];return r=(o+16)/116,n=isNaN(s)?r:r+s/500,i=isNaN(a)?r:r-a/200,r=Ot.Yn*Tt(r),n=Ot.Xn*Tt(n),i=Ot.Zn*Tt(i),[jt(3.2404542*n-1.5371385*r-.4985314*i),jt(-.969266*n+1.8760108*r+.041556*i),jt(.0556434*n-.2040259*r+1.0572252*i),e.length>3?e[3]:1]},Rt=u.unpack,Dt=u.type,Nt=v,Ft=y,kt=d,$t=St;Ft.prototype.lab=function(){return $t(this._rgb)},Nt.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Ft,[null].concat(e,["lab"])))},kt.format.lab=It,kt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Rt(e,"lab"),"array"===Dt(e)&&3===e.length)return"lab"}});var Mt=u.unpack,Pt=u.RAD2DEG,Lt=Math.sqrt,Bt=Math.atan2,qt=Math.round,Ut=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Mt(e,"lab"),r=n[0],i=n[1],o=n[2],s=Lt(i*i+o*o),a=(Bt(o,i)*Pt+360)%360;return 0===qt(1e4*s)&&(a=Number.NaN),[r,s,a]},Gt=u.unpack,zt=St,Ht=Ut,Xt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Gt(e,"rgb"),r=n[0],i=n[1],o=n[2],s=zt(r,i,o),a=s[0],l=s[1],c=s[2];return Ht(a,l,c)},Vt=u.unpack,Wt=u.DEG2RAD,Yt=Math.sin,Kt=Math.cos,Zt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Vt(e,"lch"),r=n[0],i=n[1],o=n[2];return isNaN(o)&&(o=0),[r,Kt(o*=Wt)*i,Yt(o)*i]},Jt=u.unpack,Qt=Zt,en=It,tn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=Jt(e,"lch"))[0],r=e[1],i=e[2],o=Qt(n,r,i),s=o[0],a=o[1],l=o[2],c=en(s,a,l);return[c[0],c[1],c[2],e.length>3?e[3]:1]},nn=u.unpack,rn=tn,on=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=nn(e,"hcl").reverse();return rn.apply(void 0,n)},sn=u.unpack,an=u.type,ln=v,cn=y,un=d,dn=Xt;cn.prototype.lch=function(){return dn(this._rgb)},cn.prototype.hcl=function(){return dn(this._rgb).reverse()},ln.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(cn,[null].concat(e,["lch"])))},ln.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(cn,[null].concat(e,["hcl"])))},un.format.lch=tn,un.format.hcl=on,["lch","hcl"].forEach((function(e){return un.autodetect.push({p:2,test:function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(t=sn(t,e),"array"===an(t)&&3===t.length)return e}})}));var fn={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},pn=d,hn=u.type,mn=fn,gn=je,yn=Oe;y.prototype.name=function(){for(var e=yn(this._rgb,"rgb"),t=0,n=Object.keys(mn);t<n.length;t+=1){var r=n[t];if(mn[r]===e)return r.toLowerCase()}return e},pn.format.named=function(e){if(e=e.toLowerCase(),mn[e])return gn(mn[e]);throw new Error("unknown color name: "+e)},pn.autodetect.push({p:5,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===hn(e)&&mn[e.toLowerCase()])return"named"}});var bn=u.unpack,vn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=bn(e,"rgb");return(n[0]<<16)+(n[1]<<8)+n[2]},_n=u.type,wn=v,An=y,xn=d,Sn=u.type,On=vn;An.prototype.num=function(){return On(this._rgb)},wn.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(An,[null].concat(e,["num"])))},xn.format.num=function(e){if("number"==_n(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},xn.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===Sn(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var En=v,Cn=y,jn=d,Tn=u.unpack,In=u.type,Rn=Math.round;Cn.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Rn)},Cn.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(t,n){return n<3?!1===e?t:Rn(t):t}))},En.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Cn,[null].concat(e,["rgb"])))},jn.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Tn(e,"rgba");return void 0===n[3]&&(n[3]=1),n},jn.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Tn(e,"rgba"),"array"===In(e)&&(3===e.length||4===e.length&&"number"==In(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Dn=Math.log,Nn=function(e){var t,n,r,i=e/100;return i<66?(t=255,n=i<6?0:-155.25485562709179-.44596950469579133*(n=i-2)+104.49216199393888*Dn(n),r=i<20?0:.8274096064007395*(r=i-10)-254.76935184120902+115.67994401066147*Dn(r)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*Dn(t),n=325.4494125711974+.07943456536662342*(n=i-50)-28.0852963507957*Dn(n),r=255),[t,n,r,1]},Fn=Nn,kn=u.unpack,$n=Math.round,Mn=v,Pn=y,Ln=d,Bn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n,r=kn(e,"rgb"),i=r[0],o=r[2],s=1e3,a=4e4;a-s>.4;){var l=Fn(n=.5*(a+s));l[2]/l[0]>=o/i?a=n:s=n}return $n(n)};Pn.prototype.temp=Pn.prototype.kelvin=Pn.prototype.temperature=function(){return Bn(this._rgb)},Mn.temp=Mn.kelvin=Mn.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Pn,[null].concat(e,["temp"])))},Ln.format.temp=Ln.format.kelvin=Ln.format.temperature=Nn;var qn=u.unpack,Un=Math.cbrt,Gn=Math.pow,zn=Math.sign,Hn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=qn(e,"rgb"),r=n[0],i=n[1],o=n[2],s=[Xn(r/255),Xn(i/255),Xn(o/255)],a=s[0],l=s[1],c=s[2],u=Un(.4122214708*a+.5363325363*l+.0514459929*c),d=Un(.2119034982*a+.6806995451*l+.1073969566*c),f=Un(.0883024619*a+.2817188376*l+.6299787005*c);return[.2104542553*u+.793617785*d-.0040720468*f,1.9779984951*u-2.428592205*d+.4505937099*f,.0259040371*u+.7827717662*d-.808675766*f]};function Xn(e){var t=Math.abs(e);return t<.04045?e/12.92:(zn(e)||1)*Gn((t+.055)/1.055,2.4)}var Vn=u.unpack,Wn=Math.pow,Yn=Math.sign,Kn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=Vn(e,"lab"))[0],r=e[1],i=e[2],o=Wn(n+.3963377774*r+.2158037573*i,3),s=Wn(n-.1055613458*r-.0638541728*i,3),a=Wn(n-.0894841775*r-1.291485548*i,3);return[255*Zn(4.0767416621*o-3.3077115913*s+.2309699292*a),255*Zn(-1.2684380046*o+2.6097574011*s-.3413193965*a),255*Zn(-.0041960863*o-.7034186147*s+1.707614701*a),e.length>3?e[3]:1]};function Zn(e){var t=Math.abs(e);return t>.0031308?(Yn(e)||1)*(1.055*Wn(t,1/2.4)-.055):12.92*e}var Jn=u.unpack,Qn=u.type,er=v,tr=y,nr=d,rr=Hn;tr.prototype.oklab=function(){return rr(this._rgb)},er.oklab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(tr,[null].concat(e,["oklab"])))},nr.format.oklab=Kn,nr.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Jn(e,"oklab"),"array"===Qn(e)&&3===e.length)return"oklab"}});var ir=u.unpack,or=Hn,sr=Ut,ar=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=ir(e,"rgb"),r=n[0],i=n[1],o=n[2],s=or(r,i,o),a=s[0],l=s[1],c=s[2];return sr(a,l,c)},lr=u.unpack,cr=Zt,ur=Kn,dr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=lr(e,"lch"))[0],r=e[1],i=e[2],o=cr(n,r,i),s=o[0],a=o[1],l=o[2],c=ur(s,a,l);return[c[0],c[1],c[2],e.length>3?e[3]:1]},fr=u.unpack,pr=u.type,hr=v,mr=y,gr=d,yr=ar;mr.prototype.oklch=function(){return yr(this._rgb)},hr.oklch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(mr,[null].concat(e,["oklch"])))},gr.format.oklch=dr,gr.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=fr(e,"oklch"),"array"===pr(e)&&3===e.length)return"oklch"}});var br=y,vr=u.type;br.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===vr(e)?t?(this._rgb[3]=e,this):new br([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},y.prototype.clipped=function(){return this._rgb._clipped||!1};var _r=y,wr=yt;_r.prototype.darken=function(e){void 0===e&&(e=1);var t=this.lab();return t[0]-=wr.Kn*e,new _r(t,"lab").alpha(this.alpha(),!0)},_r.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},_r.prototype.darker=_r.prototype.darken,_r.prototype.brighter=_r.prototype.brighten,y.prototype.get=function(e){var t=e.split("."),n=t[0],r=t[1],i=this[n]();if(r){var o=n.indexOf(r)-("ok"===n.substr(0,2)?2:0);if(o>-1)return i[o];throw new Error("unknown channel "+r+" in mode "+n)}return i};var Ar=y,xr=u.type,Sr=Math.pow;Ar.prototype.luminance=function(e){if(void 0!==e&&"number"===xr(e)){if(0===e)return new Ar([0,0,0,this._rgb[3]],"rgb");if(1===e)return new Ar([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),n=20,r=function(t,i){var o=t.interpolate(i,.5,"rgb"),s=o.luminance();return Math.abs(e-s)<1e-7||!n--?o:s>e?r(t,o):r(o,i)},i=(t>e?r(new Ar([0,0,0]),this):r(this,new Ar([255,255,255]))).rgb();return new Ar(i.concat([this._rgb[3]]))}return Or.apply(void 0,this._rgb.slice(0,3))};var Or=function(e,t,n){return.2126*(e=Er(e))+.7152*(t=Er(t))+.0722*Er(n)},Er=function(e){return(e/=255)<=.03928?e/12.92:Sr((e+.055)/1.055,2.4)},Cr={},jr=y,Tr=u.type,Ir=Cr,Rr=function(e,t,n){void 0===n&&(n=.5);for(var r=[],i=arguments.length-3;i-- >0;)r[i]=arguments[i+3];var o=r[0]||"lrgb";if(Ir[o]||r.length||(o=Object.keys(Ir)[0]),!Ir[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==Tr(e)&&(e=new jr(e)),"object"!==Tr(t)&&(t=new jr(t)),Ir[o](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))},Dr=y,Nr=Rr;Dr.prototype.mix=Dr.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Nr.apply(void 0,[this,e,t].concat(n))};var Fr=y;Fr.prototype.premultiply=function(e){void 0===e&&(e=!1);var t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new Fr([t[0]*n,t[1]*n,t[2]*n,n],"rgb")};var kr=y,$r=yt;kr.prototype.saturate=function(e){void 0===e&&(e=1);var t=this.lch();return t[1]+=$r.Kn*e,t[1]<0&&(t[1]=0),new kr(t,"lch").alpha(this.alpha(),!0)},kr.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Mr=y,Pr=u.type;Mr.prototype.set=function(e,t,n){void 0===n&&(n=!1);var r=e.split("."),i=r[0],o=r[1],s=this[i]();if(o){var a=i.indexOf(o)-("ok"===i.substr(0,2)?2:0);if(a>-1){if("string"==Pr(t))switch(t.charAt(0)){case"+":case"-":s[a]+=+t;break;case"*":s[a]*=+t.substr(1);break;case"/":s[a]/=+t.substr(1);break;default:s[a]=+t}else{if("number"!==Pr(t))throw new Error("unsupported value for Color.set");s[a]=t}var l=new Mr(s,i);return n?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+o+" in mode "+i)}return s};var Lr=y;Cr.rgb=function(e,t,n){var r=e._rgb,i=t._rgb;return new Lr(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};var Br=y,qr=Math.sqrt,Ur=Math.pow;Cr.lrgb=function(e,t,n){var r=e._rgb,i=r[0],o=r[1],s=r[2],a=t._rgb,l=a[0],c=a[1],u=a[2];return new Br(qr(Ur(i,2)*(1-n)+Ur(l,2)*n),qr(Ur(o,2)*(1-n)+Ur(c,2)*n),qr(Ur(s,2)*(1-n)+Ur(u,2)*n),"rgb")};var Gr=y;Cr.lab=function(e,t,n){var r=e.lab(),i=t.lab();return new Gr(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};var zr=y,Hr=function(e,t,n,r){var i,o,s,a,l,c,u,d,f,p,h,m,g;return"hsl"===r?(s=e.hsl(),a=t.hsl()):"hsv"===r?(s=e.hsv(),a=t.hsv()):"hcg"===r?(s=e.hcg(),a=t.hcg()):"hsi"===r?(s=e.hsi(),a=t.hsi()):"lch"===r||"hcl"===r?(r="hcl",s=e.hcl(),a=t.hcl()):"oklch"===r&&(s=e.oklch().reverse(),a=t.oklch().reverse()),"h"!==r.substr(0,1)&&"oklch"!==r||(l=(i=s)[0],u=i[1],f=i[2],c=(o=a)[0],d=o[1],p=o[2]),isNaN(l)||isNaN(c)?isNaN(l)?isNaN(c)?m=Number.NaN:(m=c,1!=f&&0!=f||"hsv"==r||(h=d)):(m=l,1!=p&&0!=p||"hsv"==r||(h=u)):m=l+n*(c>l&&c-l>180?c-(l+360):c<l&&l-c>180?c+360-l:c-l),void 0===h&&(h=u+n*(d-u)),g=f+n*(p-f),new zr("oklch"===r?[g,h,m]:[m,h,g],r)},Xr=Hr,Vr=function(e,t,n){return Xr(e,t,n,"lch")};Cr.lch=Vr,Cr.hcl=Vr;var Wr=y;Cr.num=function(e,t,n){var r=e.num(),i=t.num();return new Wr(r+n*(i-r),"num")};var Yr=Hr;Cr.hcg=function(e,t,n){return Yr(e,t,n,"hcg")};var Kr=Hr;Cr.hsi=function(e,t,n){return Kr(e,t,n,"hsi")};var Zr=Hr;Cr.hsl=function(e,t,n){return Zr(e,t,n,"hsl")};var Jr=Hr;Cr.hsv=function(e,t,n){return Jr(e,t,n,"hsv")};var Qr=y;Cr.oklab=function(e,t,n){var r=e.oklab(),i=t.oklab();return new Qr(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"oklab")};var ei=Hr;Cr.oklch=function(e,t,n){return ei(e,t,n,"oklch")};var ti=y,ni=u.clip_rgb,ri=Math.pow,ii=Math.sqrt,oi=Math.PI,si=Math.cos,ai=Math.sin,li=Math.atan2,ci=function(e,t){for(var n=e.length,r=[0,0,0,0],i=0;i<e.length;i++){var o=e[i],s=t[i]/n,a=o._rgb;r[0]+=ri(a[0],2)*s,r[1]+=ri(a[1],2)*s,r[2]+=ri(a[2],2)*s,r[3]+=a[3]*s}return r[0]=ii(r[0]),r[1]=ii(r[1]),r[2]=ii(r[2]),r[3]>.9999999&&(r[3]=1),new ti(ni(r))},ui=v,di=u.type,fi=Math.pow,pi=function(e){var t="rgb",n=ui("#ccc"),r=0,i=[0,1],o=[],s=[0,0],a=!1,l=[],c=!1,u=0,d=1,f=!1,p={},h=!0,m=1,g=function(e){if((e=e||["#fff","#000"])&&"string"===di(e)&&ui.brewer&&ui.brewer[e.toLowerCase()]&&(e=ui.brewer[e.toLowerCase()]),"array"===di(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var t=0;t<e.length;t++)e[t]=ui(e[t]);o.length=0;for(var n=0;n<e.length;n++)o.push(n/(e.length-1))}return _(),l=e},y=function(e){return e},b=function(e){return e},v=function(e,r){var i,c;if(null==r&&(r=!1),isNaN(e)||null===e)return n;c=r?e:a&&a.length>2?function(e){if(null!=a){for(var t=a.length-1,n=0;n<t&&e>=a[n];)n++;return n-1}return 0}(e)/(a.length-2):d!==u?(e-u)/(d-u):1,c=b(c),r||(c=y(c)),1!==m&&(c=fi(c,m)),c=s[0]+c*(1-s[0]-s[1]),c=Math.min(1,Math.max(0,c));var f=Math.floor(1e4*c);if(h&&p[f])i=p[f];else{if("array"===di(l))for(var g=0;g<o.length;g++){var v=o[g];if(c<=v){i=l[g];break}if(c>=v&&g===o.length-1){i=l[g];break}if(c>v&&c<o[g+1]){c=(c-v)/(o[g+1]-v),i=ui.interpolate(l[g],l[g+1],c,t);break}}else"function"===di(l)&&(i=l(c));h&&(p[f]=i)}return i},_=function(){return p={}};g(e);var w=function(e){var t=ui(v(e));return c&&t[c]?t[c]():t};return w.classes=function(e){if(null!=e){if("array"===di(e))a=e,i=[e[0],e[e.length-1]];else{var t=ui.analyze(i);a=0===e?[t.min,t.max]:ui.limits(t,"e",e)}return w}return a},w.domain=function(e){if(!arguments.length)return i;u=e[0],d=e[e.length-1],o=[];var t=l.length;if(e.length===t&&u!==d)for(var n=0,r=Array.from(e);n<r.length;n+=1){var s=r[n];o.push((s-u)/(d-u))}else{for(var a=0;a<t;a++)o.push(a/(t-1));if(e.length>2){var c=e.map((function(t,n){return n/(e.length-1)})),f=e.map((function(e){return(e-u)/(d-u)}));f.every((function(e,t){return c[t]===e}))||(b=function(e){if(e<=0||e>=1)return e;for(var t=0;e>=f[t+1];)t++;var n=(e-f[t])/(f[t+1]-f[t]);return c[t]+n*(c[t+1]-c[t])})}}return i=[u,d],w},w.mode=function(e){return arguments.length?(t=e,_(),w):t},w.range=function(e,t){return g(e),w},w.out=function(e){return c=e,w},w.spread=function(e){return arguments.length?(r=e,w):r},w.correctLightness=function(e){return null==e&&(e=!0),f=e,_(),y=f?function(e){for(var t=v(0,!0).lab()[0],n=v(1,!0).lab()[0],r=t>n,i=v(e,!0).lab()[0],o=t+(n-t)*e,s=i-o,a=0,l=1,c=20;Math.abs(s)>.01&&c-- >0;)r&&(s*=-1),s<0?(a=e,e+=.5*(l-e)):(l=e,e+=.5*(a-e)),s=(i=v(e,!0).lab()[0])-o;return e}:function(e){return e},w},w.padding=function(e){return null!=e?("number"===di(e)&&(e=[e,e]),s=e,w):s},w.colors=function(t,n){arguments.length<2&&(n="hex");var r=[];if(0===arguments.length)r=l.slice(0);else if(1===t)r=[w(.5)];else if(t>1){var o=i[0],s=i[1]-o;r=function(e,t,n){for(var r=[],i=e<t,o=n?i?t+1:t-1:t,s=e;i?s<o:s>o;i?s++:s--)r.push(s);return r}(0,t,!1).map((function(e){return w(o+e/(t-1)*s)}))}else{e=[];var c=[];if(a&&a.length>2)for(var u=1,d=a.length,f=1<=d;f?u<d:u>d;f?u++:u--)c.push(.5*(a[u-1]+a[u]));else c=i;r=c.map((function(e){return w(e)}))}return ui[n]&&(r=r.map((function(e){return e[n]()}))),r},w.cache=function(e){return null!=e?(h=e,w):h},w.gamma=function(e){return null!=e?(m=e,w):m},w.nodata=function(e){return null!=e?(n=ui(e),w):n},w};var hi=y,mi=pi,gi=v,yi=function(e,t,n){if(!yi[n])throw new Error("unknown blend mode "+n);return yi[n](e,t)},bi=function(e){return function(t,n){var r=gi(n).rgb(),i=gi(t).rgb();return gi.rgb(e(r,i))}},vi=function(e){return function(t,n){var r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r}};yi.normal=bi(vi((function(e){return e}))),yi.multiply=bi(vi((function(e,t){return e*t/255}))),yi.screen=bi(vi((function(e,t){return 255*(1-(1-e/255)*(1-t/255))}))),yi.overlay=bi(vi((function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))}))),yi.darken=bi(vi((function(e,t){return e>t?t:e}))),yi.lighten=bi(vi((function(e,t){return e>t?e:t}))),yi.dodge=bi(vi((function(e,t){return 255===e||(e=t/255*255/(1-e/255))>255?255:e}))),yi.burn=bi(vi((function(e,t){return 255*(1-(1-t/255)/(e/255))})));for(var _i=yi,wi=u.type,Ai=u.clip_rgb,xi=u.TWOPI,Si=Math.pow,Oi=Math.sin,Ei=Math.cos,Ci=v,ji=y,Ti=Math.floor,Ii=Math.random,Ri=s,Di=Math.log,Ni=Math.pow,Fi=Math.floor,ki=Math.abs,$i=function(e,t){void 0===t&&(t=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===Ri(e)&&(e=Object.values(e)),e.forEach((function(e){t&&"object"===Ri(e)&&(e=e[t]),null==e||isNaN(e)||(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)})),n.domain=[n.min,n.max],n.limits=function(e,t){return Mi(n,e,t)},n},Mi=function(e,t,n){void 0===t&&(t="equal"),void 0===n&&(n=7),"array"==Ri(e)&&(e=$i(e));var r=e.min,i=e.max,o=e.values.sort((function(e,t){return e-t}));if(1===n)return[r,i];var s=[];if("c"===t.substr(0,1)&&(s.push(r),s.push(i)),"e"===t.substr(0,1)){s.push(r);for(var a=1;a<n;a++)s.push(r+a/n*(i-r));s.push(i)}else if("l"===t.substr(0,1)){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");var l=Math.LOG10E*Di(r),c=Math.LOG10E*Di(i);s.push(r);for(var u=1;u<n;u++)s.push(Ni(10,l+u/n*(c-l)));s.push(i)}else if("q"===t.substr(0,1)){s.push(r);for(var d=1;d<n;d++){var f=(o.length-1)*d/n,p=Fi(f);if(p===f)s.push(o[p]);else{var h=f-p;s.push(o[p]*(1-h)+o[p+1]*h)}}s.push(i)}else if("k"===t.substr(0,1)){var m,g=o.length,y=new Array(g),b=new Array(n),v=!0,_=0,w=null;(w=[]).push(r);for(var A=1;A<n;A++)w.push(r+A/n*(i-r));for(w.push(i);v;){for(var x=0;x<n;x++)b[x]=0;for(var S=0;S<g;S++)for(var O=o[S],E=Number.MAX_VALUE,C=void 0,j=0;j<n;j++){var T=ki(w[j]-O);T<E&&(E=T,C=j),b[C]++,y[S]=C}for(var I=new Array(n),R=0;R<n;R++)I[R]=null;for(var D=0;D<g;D++)null===I[m=y[D]]?I[m]=o[D]:I[m]+=o[D];for(var N=0;N<n;N++)I[N]*=1/b[N];v=!1;for(var F=0;F<n;F++)if(I[F]!==w[F]){v=!0;break}w=I,++_>200&&(v=!1)}for(var k={},$=0;$<n;$++)k[$]=[];for(var M=0;M<g;M++)k[m=y[M]].push(o[M]);for(var P=[],L=0;L<n;L++)P.push(k[L][0]),P.push(k[L][k[L].length-1]);P=P.sort((function(e,t){return e-t})),s.push(P[0]);for(var B=1;B<P.length;B+=2){var q=P[B];isNaN(q)||-1!==s.indexOf(q)||s.push(q)}}return s},Pi={analyze:$i,limits:Mi},Li=y,Bi=y,qi=Math.sqrt,Ui=Math.pow,Gi=Math.min,zi=Math.max,Hi=Math.atan2,Xi=Math.abs,Vi=Math.cos,Wi=Math.sin,Yi=Math.exp,Ki=Math.PI,Zi=y,Ji=y,Qi=v,eo=pi,to={cool:function(){return eo([Qi.hsl(180,1,.9),Qi.hsl(250,.7,.4)])},hot:function(){return eo(["#000","#f00","#ff0","#fff"]).mode("rgb")}},no={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},ro=0,io=Object.keys(no);ro<io.length;ro+=1){var oo=io[ro];no[oo.toLowerCase()]=no[oo]}var so=no,ao=v;return ao.average=function(e,t,n){void 0===t&&(t="lrgb"),void 0===n&&(n=null);var r=e.length;n||(n=Array.from(new Array(r)).map((function(){return 1})));var i=r/n.reduce((function(e,t){return e+t}));if(n.forEach((function(e,t){n[t]*=i})),e=e.map((function(e){return new ti(e)})),"lrgb"===t)return ci(e,n);for(var o=e.shift(),s=o.get(t),a=[],l=0,c=0,u=0;u<s.length;u++)if(s[u]=(s[u]||0)*n[0],a.push(isNaN(s[u])?0:n[0]),"h"===t.charAt(u)&&!isNaN(s[u])){var d=s[u]/180*oi;l+=si(d)*n[0],c+=ai(d)*n[0]}var f=o.alpha()*n[0];e.forEach((function(e,r){var i=e.get(t);f+=e.alpha()*n[r+1];for(var o=0;o<s.length;o++)if(!isNaN(i[o]))if(a[o]+=n[r+1],"h"===t.charAt(o)){var u=i[o]/180*oi;l+=si(u)*n[r+1],c+=ai(u)*n[r+1]}else s[o]+=i[o]*n[r+1]}));for(var p=0;p<s.length;p++)if("h"===t.charAt(p)){for(var h=li(c/a[p],l/a[p])/oi*180;h<0;)h+=360;for(;h>=360;)h-=360;s[p]=h}else s[p]=s[p]/a[p];return f/=r,new ti(s,t).alpha(f>.99999?1:f,!0)},ao.bezier=function(e){var t=function(e){var t,n,r,i,o,s,a;if(2===(e=e.map((function(e){return new hi(e)}))).length)t=e.map((function(e){return e.lab()})),o=t[0],s=t[1],i=function(e){var t=[0,1,2].map((function(t){return o[t]+e*(s[t]-o[t])}));return new hi(t,"lab")};else if(3===e.length)n=e.map((function(e){return e.lab()})),o=n[0],s=n[1],a=n[2],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*o[t]+2*(1-e)*e*s[t]+e*e*a[t]}));return new hi(t,"lab")};else if(4===e.length){var l;r=e.map((function(e){return e.lab()})),o=r[0],s=r[1],a=r[2],l=r[3],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*(1-e)*o[t]+3*(1-e)*(1-e)*e*s[t]+3*(1-e)*e*e*a[t]+e*e*e*l[t]}));return new hi(t,"lab")}}else{if(!(e.length>=5))throw new RangeError("No point in running bezier with only one color.");var c,u,d;c=e.map((function(e){return e.lab()})),d=e.length-1,u=function(e){for(var t=[1,1],n=1;n<e;n++){for(var r=[1],i=1;i<=t.length;i++)r[i]=(t[i]||0)+t[i-1];t=r}return t}(d),i=function(e){var t=1-e,n=[0,1,2].map((function(n){return c.reduce((function(r,i,o){return r+u[o]*Math.pow(t,d-o)*Math.pow(e,o)*i[n]}),0)}));return new hi(n,"lab")}}return i}(e);return t.scale=function(){return mi(t)},t},ao.blend=_i,ao.cubehelix=function(e,t,n,r,i){void 0===e&&(e=300),void 0===t&&(t=-1.5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=[0,1]);var o,s=0;"array"===wi(i)?o=i[1]-i[0]:(o=0,i=[i,i]);var a=function(a){var l=xi*((e+120)/360+t*a),c=Si(i[0]+o*a,r),u=(0!==s?n[0]+a*s:n)*c*(1-c)/2,d=Ei(l),f=Oi(l);return Ci(Ai([255*(c+u*(-.14861*d+1.78277*f)),255*(c+u*(-.29227*d-.90649*f)),255*(c+u*(1.97294*d)),1]))};return a.start=function(t){return null==t?e:(e=t,a)},a.rotations=function(e){return null==e?t:(t=e,a)},a.gamma=function(e){return null==e?r:(r=e,a)},a.hue=function(e){return null==e?n:("array"===wi(n=e)?0==(s=n[1]-n[0])&&(n=n[1]):s=0,a)},a.lightness=function(e){return null==e?i:("array"===wi(e)?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),a)},a.scale=function(){return Ci.scale(a)},a.hue(n),a},ao.mix=ao.interpolate=Rr,ao.random=function(){for(var e="#",t=0;t<6;t++)e+="0123456789abcdef".charAt(Ti(16*Ii()));return new ji(e,"hex")},ao.scale=pi,ao.analyze=Pi.analyze,ao.contrast=function(e,t){e=new Li(e),t=new Li(t);var n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},ao.deltaE=function(e,t,n,r,i){void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=1);var o=function(e){return 360*e/(2*Ki)},s=function(e){return 2*Ki*e/360};e=new Bi(e),t=new Bi(t);var a=Array.from(e.lab()),l=a[0],c=a[1],u=a[2],d=Array.from(t.lab()),f=d[0],p=d[1],h=d[2],m=(l+f)/2,g=(qi(Ui(c,2)+Ui(u,2))+qi(Ui(p,2)+Ui(h,2)))/2,y=.5*(1-qi(Ui(g,7)/(Ui(g,7)+Ui(25,7)))),b=c*(1+y),v=p*(1+y),_=qi(Ui(b,2)+Ui(u,2)),w=qi(Ui(v,2)+Ui(h,2)),A=(_+w)/2,x=o(Hi(u,b)),S=o(Hi(h,v)),O=x>=0?x:x+360,E=S>=0?S:S+360,C=Xi(O-E)>180?(O+E+360)/2:(O+E)/2,j=1-.17*Vi(s(C-30))+.24*Vi(s(2*C))+.32*Vi(s(3*C+6))-.2*Vi(s(4*C-63)),T=E-O;T=Xi(T)<=180?T:E<=O?T+360:T-360,T=2*qi(_*w)*Wi(s(T)/2);var I=f-l,R=w-_,D=1+.015*Ui(m-50,2)/qi(20+Ui(m-50,2)),N=1+.045*A,F=1+.015*A*j,k=30*Yi(-Ui((C-275)/25,2)),$=-2*qi(Ui(A,7)/(Ui(A,7)+Ui(25,7)))*Wi(2*s(k)),M=qi(Ui(I/(n*D),2)+Ui(R/(r*N),2)+Ui(T/(i*F),2)+$*(R/(r*N))*(T/(i*F)));return zi(0,Gi(100,M))},ao.distance=function(e,t,n){void 0===n&&(n="lab"),e=new Zi(e),t=new Zi(t);var r=e.get(n),i=t.get(n),o=0;for(var s in r){var a=(r[s]||0)-(i[s]||0);o+=a*a}return Math.sqrt(o)},ao.limits=Pi.limits,ao.valid=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(Ji,[null].concat(e))),!0}catch(e){return!1}},ao.scales=to,ao.colors=fn,ao.brewer=so,ao}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{n.d(r,{B:()=>io});var e=n(250);const t=(n,r)=>(0,e.mergeWith)({},n,r,((n,r)=>(0,e.isArray)(r)?r:(0,e.isObject)(n)&&(0,e.isObject)(r)?t(n,r):r)),i={month:{publicName:"Monthly",dateFormat:"MMMM YYYY"},year:{publicName:"Yearly",dateFormat:"YYYY"},quarter:{publicName:"Per quarter",dateFormat:"quarter"},week:{publicName:"Weekly",dateFormat:"week"},day:{publicName:"Daily",dateFormat:"DD-MM-YYYY"},second:{publicName:"Per second",dateFormat:"hh:mm:ss"},hour:{publicName:"Hourly",dateFormat:"hh:mm"},minute:{publicName:"Per minute",dateFormat:"hh:mm"}},o=t=>{const n=(0,e.cloneDeep)(i);if(!t)return n;let r={};return t.forEach((e=>{if(!i[e])throw`Time trunc function ${e} not managed by Vizzly`;r[e]=i[e]})),r},s=(e,t)=>{let n=[...Object.keys(t.supportedOperators)];return n=n.filter((t=>a[t].validDataTypes.includes(e.dataType))),n},a={">":{publicName:"Greater than",validDataTypes:["number","date_time"]},"<":{publicName:"Less than",validDataTypes:["number","date_time"]},"<=":{publicName:"Less than or equal to",validDataTypes:["number","date_time"]},">=":{publicName:"Greater than or equal to",validDataTypes:["number","date_time"]},"!=":{publicName:"Not equal to",validDataTypes:["number","date_time","boolean","string"]},is_one_of:{publicName:"Is one of",validDataTypes:["number","date_time","boolean","string"]},"=":{publicName:"Equal to",validDataTypes:["number","date_time","boolean","string"]},is_not_one_of:{publicName:"Is not one of",validDataTypes:["number","date_time","boolean","string"]},starts_with:{publicName:"Starts with",validDataTypes:["string"]},ends_with:{publicName:"Ends with",validDataTypes:["string"]},contains_substring:{publicName:"Contains text",validDataTypes:["string"]},does_not_contain_substring:{publicName:"Does not contain text",validDataTypes:["string"]},array_contains:{publicName:"Contains",validDataTypes:["string[]"]}},l=t=>{const n=(0,e.cloneDeep)(a);if(!t)return n;let r={};return t.forEach((e=>{if(!a[e])throw`Operator ${e} not managed by Vizzly`;r[e]=a[e]})),r},c=t=>t.map((t=>t.map((t=>"is_one_of"!=t.op&&"is_not_one_of"!=t.op||(0,e.isArray)(t.value)?t:Object.assign(Object.assign({},t),{value:[t.value]}))))),u=(e,t)=>e.map((e=>{let n=Object.assign(Object.assign({},e),{aggregate:void 0,function:e.function||e.aggregate});return delete n.aggregate,t&&n.field==t.field&&"none"==n.function&&(n.function=t.truncate),n})),d=e=>e.map((e=>{let t=Object.assign(Object.assign({},e),{aggregate:void 0,function:e.function||e.aggregate});return delete t.aggregate,t})),f=e=>"auto"===e||0===e||2===e?e:"auto",p=t=>{if(!t)return{};let n={};return t.measure&&Object.entries(t.measure).forEach((([e,t])=>{n&&(n[e]=d(t))})),{measure:(0,e.isEmpty)(n)?void 0:n,group:t.group}},h={mean:{publicName:"Mean",validDataTypes:["number"]},sum:{publicName:"Sum",validDataTypes:["number"]},min:{publicName:"Min",validDataTypes:["number"]},max:{publicName:"Max",validDataTypes:["number"]},count:{publicName:"Count",validDataTypes:["string","number","boolean","date_time","string[]"]},countDistinct:{publicName:"Unique",validDataTypes:["string","number","boolean","date_time"]},median:{publicName:"Median",validDataTypes:["number"]}},m=t=>{const n=(0,e.cloneDeep)(h);if(!t)return n;let r={};return t.forEach((e=>{if(!h[e])throw`Aggregate ${e} not managed by Vizzly`;r[e]=h[e]})),r},g=(t,n,r)=>{const i=(0,e.replace)(t,n,r);return i.indexOf(n)>=0?g(i,n,r):i},y=["debug","info","warning","error","properties"];const b=e=>y.findIndex((e=>"error"==e))<=y.findIndex((t=>e==t)),v=t=>t instanceof Error?t:(0,e.isObject)(t)||(0,e.isArray)(t)?JSON.stringify(t):t,_=(...e)=>{b("debug")&&console.info("[VIZZLY DEBUG]",...e.map(v))},w=(...e)=>{b("warning")&&console.warn("[VIZZLY WARNING]",...e.map(v))},A=(...e)=>{b("error")&&console.error("[VIZZLY ERROR]",...e.map(v))},x=(Object.keys(m()),e=>{return(t=g(e,"_"," ")).charAt(0).toUpperCase()+t.slice(1);var t}),S=(e,t)=>{const n=e.split("_"),r=n.pop();return[void 0,...Object.keys(t.supportedAggregates||{}),...Object.keys(t.supportedTimeTruncFunctions||{}),...Object.keys(t.supportedTransformationFunctions||{})].includes(r)?{field:n.join("_"),function:null!=r?r:""}:{field:e,function:"none"}},O=e=>e.map((e=>"string"==typeof e?{field:e,function:"none"}:e)),E={round_to_0_dp:{publicName:"Round to 0dp",validDataTypes:["number"]},round_to_2_dp:{publicName:"Round to 2dp",validDataTypes:["number"]}},C=t=>{const n=(0,e.cloneDeep)(E);if(!t)return n;let r={};return t.forEach((e=>{if(!E[e])throw`Transformation function ${e} is not managed by Vizzly`;r[e]=E[e]})),r},j=(e,t,n)=>{const r=e.supportedAggregates,i=Object.keys(r).filter((e=>r[e].validDataTypes.includes(t)));null==n||n.forEach((e=>{r.hasOwnProperty(e)||w(`Unsupported aggregate option: ${e} on ${t}`)}));let o=n&&n.length>0?n.filter((e=>i.includes(e))):i;return n&&n.length>0&&0===o.length&&(o=i),o},T=e=>(null==e?void 0:e.function)&&"none"!=(null==e?void 0:e.function)?`${e.field}_${e.function}`:null==e?void 0:e.field,I=S,R=(e,t,n)=>{if("measure"in e&&e.measure){const r=function(e,t){return Object.keys(e).map((e=>{const n=I(e,t);return(null==n?void 0:n.function)?n:null})).find((e=>null!==e))}(e.measure,n);if((null==r?void 0:r.function)&&r.field===t){const t=T(r);delete e.measure[t]}e.measure=D(e.measure,t)}if("group"in e&&e.group){const i=function(e,t){return Object.keys(e).map((e=>{const n=((e,t)=>{const n=e.split("_"),r=n.pop();return r&&(i=t,o=r,![...Object.keys(i),"none"].includes(o))?null:{field:n.join("_"),truncate:null!=r?r:""};var i,o})(e,t.supportedTimeTruncFunctions);return(null==n?void 0:n.truncate)?n:null})).find((e=>null!==e))}(e.group,n);if((null==i?void 0:i.truncate)&&i.field===t){const t=(null==(r=i)?void 0:r.truncate)&&"none"!=(null==r?void 0:r.truncate)?`${r.field}_${r.truncate}`:null==r?void 0:r.field;delete e.group[t]}else e.group.hasOwnProperty(t)&&delete e.group[t];e.group=D(e.group,t)}var r;return e};function D(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=i.filter((e=>(null==e?void 0:e.field)!==t));return n}const N=(t,n)=>{let r=(0,e.remove)(t.order,(t=>(0,e.some)(n,(e=>{const n=e.function==t.function,r=e.field==t.field;return n&&r}))));return Object.assign(Object.assign({},t),{order:r})},F=(t,n,r)=>{var i,o,s;let a=Object.assign({},t);if("measure"in a&&(0,e.remove)(a.measure,(e=>e.field==n)),"barMeasure"in a&&(0,e.remove)(a.barMeasure,(e=>e.field==n)),"lineMeasure"in a&&(0,e.remove)(a.lineMeasure,(e=>e.field==n)),"xMeasure"in a&&(null===(i=a.yMeasure)||void 0===i?void 0:i.field)==n&&(a.xMeasure=null),"yMeasure"in a&&(null===(o=a.yMeasure)||void 0===o?void 0:o.field)==n&&(a.yMeasure=null),"order"in a&&(0,e.remove)(a.order,(e=>e.field==n)),"dimension"in a&&(0,e.remove)(a.dimension,(e=>e.field==n)),"barDimension"in a&&(0,e.remove)(a.barDimension,(e=>e.field==n)),"lineDimension"in a&&(0,e.remove)(a.lineDimension,(e=>e.field==n)),"filter"in a&&a.filter.forEach((t=>{(0,e.remove)(t,(e=>e.field==n))})),"parameters"in a&&a.parameters&&r){const e=R(a.parameters,n,r);a.parameters=e}return"timeDimension"in a&&(null===(s=a.timeDimension)||void 0===s?void 0:s.field)==n&&(a.timeDimension=null),a},k=e=>{let t=[...e.measure];return e.dimension.forEach((e=>{t.push({field:e.field,function:e.function})})),e.timeDimension&&t.push({field:e.timeDimension.field,function:e.timeDimension.truncate}),N(e,t)},$=(e,n,r)=>{let i=t(e,n);const{value:o,error:s}=r.validate(i);if(s)throw s;return o};var M=n(579),P=n.n(M);const L=e=>P().object({filters:P().array().items(P().array().items(H(e)).required().max(1)).required().max(1),ruleValue:P().string().allow("").required(),ruleValueEnd:P().string().allow(""),ruleType:P().valid("backgroundColor","fontColor","lineColor","areaColor").required()}).description("A rule used to conditionally format a view."),B=P().object({field:P().string().required().description("ID of the field in the data set to add a prefix too."),prefix:P().string().required().description("The prefix to be applied.")}),q=(e,t)=>{const n=(e,t)=>P().object({field:e.required(),function:t.required().description("Which if any, aggregate function should be applied to the field?")});return(null==t?void 0:t.restrictFields)?P().alternatives(...t.restrictFields.filter((e=>e.canBeMeasure)).map((t=>{const r=((e,t)=>Object.keys(t).filter((n=>t[n].validDataTypes.includes(e.dataType))))(t,e);return n(P().string().valid(t.id).description(`${t.publicName}, ${t.description||""}.`),P().string().valid(...r,"none"))}))):n(P().string().description("The ID of the field from the data set to reference."),P().valid(...Object.keys(e),"none"))},U=e=>P().object({field:P().string().required().description("The ID of the field from the data set to reference."),direction:P().string().valid("asc","desc").required().description("In which direction should the results be ordered?"),function:P().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none").description("Which if any, function should be applied to the field?")}),G=e=>P().object({field:P().string().required().description("The ID of the field from the data set to reference."),truncate:P().valid(...Object.keys(e),"none"),bucketFill:P().boolean()}),z=(e,t)=>{const n=(t,n)=>P().object({field:t.required(),pivot:P().string().valid("x","y").optional(),function:n?P().valid(...Object.keys(e),"none").required():P().valid("none").required()});return(null==t?void 0:t.restrictFields)?P().array().items(P().alternatives(...t.restrictFields.filter((e=>e.canBeDimension)).map((e=>n(P().string().valid(e.id).description(`${e.publicName}, ${e.description||""}.`),"date_time"===e.dataType))))).description("Fields to group the data by"):P().array().items(n(P().string().description("The ID of the field from the data set to reference."),!0)).description("Fields to group the data by")},H=e=>P().object({field:P().string().required().description("The ID of the field from the data set to reference."),op:P().string().valid(...Object.keys(e.supportedOperators)).required(),value:P().alternatives(P().string().allow(null),P().number(),P().boolean(),P().array().items(P().string(),P().number())).required(),function:P().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none").description("Which function should be applied to the field?")}),X=e=>P().array().items(P().array().items(H(e))),V=()=>P().number().description("Limit the number of results returned after the query has been ran."),W=e=>{const t=(null==e?void 0:e.restrictDataSetIds)?P().string().valid(...e.restrictDataSetIds):P().string();return{viewId:P().string().allow("").optional().description("__vizzly_hide_from_docs"),displayTitle:P().string().allow("").description("A title that explains what is being displayed."),displaySubject:P().string().allow("").description("A chance to add a more detailed description of what is being shown."),dataSetId:t.description("The ID of the data set that is being used by the view."),protectedByOrganisation:P().boolean().optional().description("Has the view been created by your organisation, and therefore cannot be modified by your users?")}},Y=P().valid("auto",2,0).description("Determine how many axis labels should be shown on the axis"),K=(e,t)=>({measure:P().array().items(q(e.supportedAggregates,t)).required().description("A list of metrics that are to be shown. For example the `count` of a specific field in your data set."),dimension:z(e.supportedTimeTruncFunctions,t).required(),drilldown:P().alternatives(z(e.supportedTimeTruncFunctions,t).required(),P().string()),order:P().array().items(U(e)),timeDimension:P().alternatives(G(e.supportedTimeTruncFunctions),P().valid(null)).required(),limit:V(),offset:P().number().min(0).description("Paginate results by using this property with limit."),filter:P().array().items(P().array().items(H(e))),xAxisPrefix:P().string().allow("").description("Add a prefix to the X Axis"),yAxisPrefix:P().string().allow("").description("Add a prefix to the Y Axis"),xAxisPostfix:P().string().allow("").description("Add a postfix to the X Axis"),yAxisPostfix:P().string().allow("").description("Add a postfix to the Y Axis"),yAxisFormat:P().alternatives(P().string(),P().valid(null)).description("ID of the formatting function to apply to the Y Axis values"),xAxisFormat:P().alternatives(P().string(),P().valid(null)).description("ID of the formatting function to apply to the X Axis values"),approxYAxisLabelCount:Y,approxXAxisLabelCount:Y}),Z=P().string().valid("natural","straight","step","stepBefore","stepAfter"),J=e=>P().array().items(P().object({function:P().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none"),field:P().string().required().description("The ID of the field from the data set to reference.")})),Q=e=>P().array().items(P().object({function:P().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none"),truncate:P().string(),field:P().string().required().description("The ID of the field from the data set to reference."),bucketFill:P().boolean().optional(),pivot:P().string().valid("x","y").optional()})),ee=(e,t)=>P().object().pattern(P().string(),P().alternatives().try(P().array().items(G(e.supportedTimeTruncFunctions)).min(1),z(e.supportedTimeTruncFunctions,t))).unknown(!0),te=(e,t)=>P().object().pattern(P().string(),P().array().items(q(e.supportedAggregates,t)).min(1)).unknown(!0),ne=(e,t)=>P().object({measure:te(e,t),group:ee(e,t)}),re=()=>P().array().items(P().object({color:P().string().required(),value:P().number().required(),strokeWidth:P().number().required(),strokeStyle:P().string().valid("dashed","solid").required(),label:P().boolean().optional()})),ie=()=>P().object({func:P().string().valid("mean","sum","current").allow(null).optional()}),oe=()=>P().object({x:P().string().allow(""),y:P().string().allow("")}),se=P().object().pattern(P().string(),P().object({width:P().number().min(0),height:P().number().min(0)})),ae=e=>P().array().items(L(e)).description("Apply formatting based on a set of defined rules."),le=e=>P().object(Object.assign(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),K(e.queryEngineConfig,e.attributesSchemaOptions)),{stacked:P().valid(!0,!1,"100%"),legend:P().valid(!0,!1),type:P().valid("barChart","horizontalBarChart").required(),conditionalFormattingRules:ae(e.queryEngineConfig),protectedFields:P().object({dimension:Q(e.queryEngineConfig),measure:J(e.queryEngineConfig)}).unknown(!0),parameters:ne(e.queryEngineConfig,e.attributesSchemaOptions),goalLines:re(),axisTitles:oe(),headline:ie()})),ce=e=>(t,n)=>{let r=$(t,n,le(e));return r=k(r),r};class ue extends Error{constructor(e){super(e),this.name="ValidationError"}}const de=ue;class fe extends de{constructor(e){super(`Corrupt view. ${e.message}.\n\n ${JSON.stringify(e)}\n `),this.name="CorruptedView"}}n(514);const pe=e=>"leftFieldId"in e&&"operator"in e&&"rightFieldId"in e,he=e=>"roundToDecimalPlaces"in e,me=e=>"leftFieldId"in e&&"leftFunction"in e&&"operator"in e&&"rightFieldId"in e&&"rightFunction"in e,ge=e=>"denominatorFieldId"in e||"numeratorFieldId"in e,ye=e=>"rules"in e,be=e=>{var t,n;if("leftAggregate"in e||"rightAggregate"in e){let t=Object.assign(Object.assign({},e),{rightFunction:e.rightFunction||e.rightAggregate,leftFunction:e.leftFunction||e.leftAggregate,leftNested:e.leftNested?Object.assign(Object.assign({},e.leftNested),{aggregate:void 0,function:e.leftNested.function||e.leftNested.aggregate}):void 0,rightNested:e.rightNested?Object.assign(Object.assign({},e.rightNested),{aggregate:void 0,function:e.rightNested.function||e.rightNested.aggregate}):void 0});return delete t.leftAggregate,delete t.rightAggregate,t.rightNested&&delete t.rightNested.aggregate,t.leftNested&&delete t.leftNested.aggregate,t}if("numeratorFieldId"in e&&!("version"in e)){const r=[...(null===(t=e.numeratorFilter)||void 0===t?void 0:t[0])||[],...(null===(n=e.denominatorFilter)||void 0===n?void 0:n[0])||[]];return Object.assign(Object.assign({},e),{version:2,denominatorScope:e.denominatorScope||"all",denominatorFilter:(null==e?void 0:e.denominatorFilter)||[],numeratorFilter:r.length>0?[r]:[]})}return e},ve=e=>P().alternatives((e=>P().object({type:P().valid("function").required(),value:P().link("#Measure"),function:P().valid("none",...Object.keys(e.supportedAggregates))}))(e),P().object({type:P().valid("null").required()}),P().object({type:P().valid("string").required(),value:P().string().allow("")}),P().object({type:P().valid("maths").required(),left:P().link("#Measure"),right:P().link("#Measure").required(),op:P().string().valid("+","*","/","-").required()}),P().object({type:P().valid("subquery").required(),value:P().object({measure:P().array().items(P().link("#Measure")),filter:P().array().items(P().array().items(P().link("#Filter")))})}),(e=>P().object({type:P().valid("field").required(),value:P().string().required(),function:P().valid("none",...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),...Object.keys(e.supportedTransformationFunctions)).required()}))(e),P().object({type:"number",value:P().number()}),P().object({type:P().valid("switchField").required(),value:P().object({cases:P().array().items(P().object({returns:P().link("#Measure"),filter:P().array().items(P().array().items(P().link("#Filter")))}))})})).id("Measure"),_e=P().object({index:P().number().required()}),we=P().object({index:P().number().required(),direction:P().string().valid("asc","desc").required()}),Ae=(e,t)=>{let n=[P().valid(null)];return t.forEach((e=>{"boolean"==e&&(n=[...n,P().boolean()]),"string"!=e&&"string[]"!=e||(n=[...n,P().string()]),"number"==e&&(n=[...n,P().number()]),"date_time"==e&&(n=[...n,P().date().iso()])})),"is_one_of"==e||"is_not_one_of"==e?P().array().items(P().alternatives(n)):P().alternatives(n)},xe=e=>P().object({field:ve(e),op:P().string().valid(...Object.keys(e.supportedOperators)),value:P().alternatives().conditional("op",Object.keys(e.supportedOperators).map((t=>({is:t,then:Ae(t,e.supportedOperators[t].validDataTypes)}))))}).id("Filter"),Se=e=>{const t=xe(e);return P().alternatives(P().object({type:P().valid("preparedQuery").required(),preparedQueryType:P().valid("uniqueArrayValues").required(),dataSetId:P().string().required(),fieldId:P().string().required(),filter:P().array().items(P().array().items(t))}),P().object({type:P().valid("preparedQuery").required(),preparedQueryType:P().valid("preAggregated").required(),dataSetId:P().string().required(),filter:P().object().pattern(P().string(),P().array().items(P().array().items(t)))}))},Oe=e=>{const t=xe(e),n=ve(e);return P().alternatives().conditional(".type",{is:"query",then:P().object({type:P().valid("query"),dataSetId:P().string().required(),measure:P().array().items(n).min(1).required(),group:P().array().items(_e).required(),filter:P().array().items(P().array().items(t)).required(),order:P().array().items(we).required(),limit:V(),offset:P().number().optional()}).shared(t).shared(n)}).conditional(".type",{is:"preparedQuery",then:Se(e)})};Oe({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:m(["sum","mean","min","max","count","countDistinct"]),supportedOperators:l([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains"]),supportedTransformationFunctions:C(["round_to_0_dp","round_to_2_dp"])}),Oe({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:m(["sum","mean","min","max","count","countDistinct"]),supportedOperators:l([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:C(["round_to_0_dp","round_to_2_dp"])}),Oe({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","switchField","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:o(["month","year","day","hour","minute","second"]),supportedAggregates:m(["sum","mean","min","max","count","countDistinct"]),supportedOperators:l([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:C(["round_to_0_dp","round_to_2_dp"])}),Oe({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:o(["month","year","day","hour","minute","second"]),supportedAggregates:m(["sum","mean","min","max","count","countDistinct"]),supportedOperators:l([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:C(["round_to_0_dp","round_to_2_dp"])}),Oe({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:m(["sum","mean","min","max","count","countDistinct"]),supportedOperators:l([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains"]),supportedTransformationFunctions:C(["round_to_0_dp","round_to_2_dp"])}),Oe({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:m(["sum","mean","min","max","count","countDistinct"]),supportedOperators:l([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains"]),supportedTransformationFunctions:C(["round_to_0_dp","round_to_2_dp"])});class Ee extends de{constructor(e,t){super(`\n An expected field is missing from a dataSet.\n\n Missing '${t}'. Got;\n ${JSON.stringify(e)}\n `),this.name="FieldNotFoundInDataSet",this.missingFieldId=t}getMissingFieldId(){return this.missingFieldId}}function Ce(t,n){let r=[...t];return(null==n?void 0:n.onlyFieldTypes)&&!(0,e.isEmpty)(n.onlyFieldTypes)&&(r=[...r].filter((e=>{var t;return null===(t=null==n?void 0:n.onlyFieldTypes)||void 0===t?void 0:t.includes(e.dataType)}))),(null==n?void 0:n.forComponent)&&(r=((e,t)=>{const n=bn(t);return[...e].filter((e=>{let t=!0;return ge(e)&&!n.supportedCustomFields.percentages&&(t=!1),pe(e)&&!n.supportedCustomFields.simpleMaths&&(t=!1),ye(e)&&!n.supportedCustomFields.rules&&(t=!1),he(e)&&!n.supportedCustomFields.roundedNumbers&&(t=!1),t}))})(r,n.forComponent)),(null==n?void 0:n.removePercentage)&&(r=r.filter((e=>!ge(e)))),(null==n?void 0:n.removeRuleGrouping)&&(r=r.filter((e=>!ye(e)))),(null==n?void 0:n.removeSimpleMaths)&&(r=r.filter((e=>!pe(e)))),(null==n?void 0:n.removeAggregateMaths)&&(r=r.filter((e=>!me(e)))),(null==n?void 0:n.onlyDimensions)&&(r=r.filter((e=>e.canBeDimension))),(null==n?void 0:n.onlyMeasures)&&(r=r.filter((e=>e.canBeMeasure))),r}const je=(e,t)=>e.find((e=>e.id==t))||null,Te=(e,t)=>e.find((e=>e.name==t))||null,Ie=(e,t)=>{let n=[...e.fields].find((e=>e.id==t));if(n)return n;throw new Ee(e,t)},Re=(e,t)=>{let n=[...e.fields].find((e=>e.publicName==t));if(n)return n;throw`Failed to find field by name in data set. Looking for ${t}`},De=(e,t)=>[...Ce(e.fields,{onlyFieldTypes:["number","string","boolean"],onlyMeasures:!0,forComponent:t})],Ne=e=>Object.assign(Object.assign({},e),{fields:[...e.fields].filter((e=>!(e=>ge(e)||pe(e)||me(e)||ye(e)||he(e))(e)))}),Fe=(e,t,n)=>{const r="horizontalBarChart"===n?void 0:"x",i=(e=>[...Ce(e.fields,{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0})])(e)[0],o=[...De(e,n)].map((e=>{const n=((e,t)=>((e,t)=>{var n;let r=null!==(n=e.supportedAggregateOptions)&&void 0!==n?n:[],i=r.filter((n=>Object.keys(t).includes(n)&&t[n].validDataTypes.includes(e.dataType)));return 0===i.length?i=Object.keys(t).filter((n=>t[n].validDataTypes.includes(e.dataType))):i.sort(((e,t)=>r.indexOf(e)-r.indexOf(t))),i})(e,t)[0])(e,t.supportedAggregates);return{field:e.id,function:n}}));return{dataSetId:e.id,measure:o,order:[],timeDimension:null,filter:[],dimension:i?[{field:i.id,function:"none",pivot:r}]:[]}},ke=(e,t)=>t?(e=e.map(Ne),[...[...e].map((e=>{const n=(t[e.id]||[]).map(be);return Object.assign(Object.assign({},e),{fields:[...e.fields,...n]})}))]):e;class $e extends de{constructor(e,t){super(`\n An expected data set is missing from the dashboard.\n\n Missing '${t}'. Got;\n ${JSON.stringify([...e].map((e=>e.id)))}\n `),this.name="DataSetNotFound"}}const Me={allowUnknown:!0,stripUnknown:!0},Pe=(e,t,n)=>{const{error:r}=bn(e.type,{queryEngineConfig:n}).schema.validate(e,Me);if(r)return[new fe(r)];const i=je(t,e.dataSetId);if(!i)return[new $e(t,e.dataSetId)];const o=(e=>{let t=[];return(e=>{let t=[];return"measure"in e&&e.measure&&(t=[...t,...e.measure]),"xMeasure"in e&&e.xMeasure&&(t=[...t,e.xMeasure]),"yMeasure"in e&&e.yMeasure&&(t=[...t,e.yMeasure]),t})(e).forEach((e=>{t=[...t,e.field]})),(e=>{let t=[];return"dimension"in e&&e.dimension&&(t=[...t,...e.dimension]),"lineDimension"in e&&e.lineDimension&&(t=[...t,...e.lineDimension]),"barDimension"in e&&e.barDimension&&(t=[...t,...e.barDimension]),t})(e).forEach((e=>{t=[...t,e.field]})),"order"in e&&e.order&&(t=[...t,...[...e.order].map((e=>e.field))]),"timeDimension"in e&&e.timeDimension&&(t=[...t,e.timeDimension.field]),t})(e);try{o.forEach((e=>{Ie(i,e)}))}catch(e){if(e instanceof Ee)return[e];throw e}return[]},Le=e=>{return!!(e=>{var t;return"comboChart"===e.type?!!e.timeDimension||!!(e.barDimension.length>0&&e.lineDimension.length>0):"barChart"!==e.type&&"lineChart"!==e.type&&"areaChart"!==e.type&&"horizontalBarChart"!==e.type&&"scatterChart"!==e.type&&"pieChart"!==e.type||!!e.timeDimension||!(null==e?void 0:e.dimension)||0!==(null===(t=null==e?void 0:e.dimension)||void 0===t?void 0:t.length)})(e)||("barChart"===(t=e).type?"The Column Chart needs to have a grouping or a time to display correctly.":"lineChart"===t.type?"The Line Chart needs to have a grouping or a time to display correctly.":"areaChart"===t.type?"The Area Chart needs to have a grouping or a time to display correctly.":"horizontalBarChart"===t.type?"The Horizontal Bar Chart needs to have a grouping or a time to display correctly.":"comboChart"===t.type?"The Combo Chart needs to have a grouping (Bar and Line), or have time set to display correctly.":"scatterChart"===t.type?"The Scatter Chart needs to have a grouping to display correctly.":"pieChart"===t.type?"The Pie Chart needs to have a grouping to display correctly.":null);var t},Be={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let qe;const Ue=new Uint8Array(16);function Ge(){if(!qe&&(qe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qe(Ue)}const ze=[];for(let e=0;e<256;++e)ze.push((e+256).toString(16).slice(1));const He=function(e,t,n){if(Be.randomUUID&&!t&&!e)return Be.randomUUID();const r=(e=e||{}).random||(e.rng||Ge)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return ze[e[t+0]]+ze[e[t+1]]+ze[e[t+2]]+ze[e[t+3]]+"-"+ze[e[t+4]]+ze[e[t+5]]+"-"+ze[e[t+6]]+ze[e[t+7]]+"-"+ze[e[t+8]]+ze[e[t+9]]+"-"+ze[e[t+10]]+ze[e[t+11]]+ze[e[t+12]]+ze[e[t+13]]+ze[e[t+14]]+ze[e[t+15]]}(r)};const Xe=e=>e||`view_${He()}`;function Ve(e){const t=e,{parentDimension:n}=t;return function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["parentDimension"])}const We=(t,n,r)=>{let i=(0,e.cloneDeep)(Ce(n.fields,{onlyFieldTypes:["boolean","string"]})),o=(0,e.cloneDeep)(Ce(n.fields,{onlyFieldTypes:["date_time"]})),s=(0,e.cloneDeep)(Ce(n.fields,{onlyFieldTypes:["number"]})),a=null;return o[0]&&(a={field:o[0].id,truncate:"none"}),r(t,{protectedByOrganisation:!0,dimension:i.map((e=>({field:e.id,function:"none"}))),measure:[...s].map((e=>({function:"none",field:e.id}))),order:[],timeDimension:a})},Ye=(t,n)=>{let r=null,i=(0,e.cloneDeep)(t);return i.forEach((e=>{const t=Ie(n,e.field);"date_time"==t.dataType&&(r={field:t.id,truncate:e.function})})),i=i.filter((e=>"date_time"!=Ie(n,e.field).dataType)),{timeDimension:r,dimension:i}},Ke=e=>{let t=[...e.dimension];return"timeDimension"in e&&e.timeDimension&&(t=[{field:e.timeDimension.field,function:e.timeDimension.truncate},...t]),t},Ze=t=>{if(!t)return;let n=(0,e.cloneDeep)(t);return n.measure=d(t.measure||[]),n},Je=(t,n)=>{let r=[];return(0,e.isEmpty)(n)||void 0===n?[]:(null==n||n.map((e=>{if((null==e?void 0:e.ruleType)&&(null==e?void 0:e.ruleValue)){let n=[];const i="field"in e&&"string"==typeof e.field&&"operator"in e&&"string"==typeof e.operator&&"value"in e;if(null==e?void 0:e.filters){const r=e.filters.map((e=>e.map((e=>Qe(e,t)))));n.push(...r)}else i&&n.push([Qe({field:e.field,op:e.operator,value:e.value},t)]);r.push({filters:n,ruleValueEnd:null==e?void 0:e.ruleValueEnd,ruleValue:e.ruleValue,ruleType:e.ruleType})}})),r)},Qe=(e,t)=>{var n;const r=S(e.field,t),i="none"!==r.function?r.function:null!==(n=e.function)&&void 0!==n?n:"none";return{field:r.field,op:e.op,value:e.value,function:i}},et={title:"Column chart",description:"Uses bars to compare different sets of data.",namespace:"bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}};function tt(e,t){return(t=>t in e.format_panel)(t)?Object.assign(Object.assign({},e.format_panel[t]),{namespace:t}):Object.assign(Object.assign({},e.data_panel[t]),{namespace:t})}function nt(e,t){var n;return null===(n=e.format_panel.axis_labels)||void 0===n?void 0:n.subSectionDefinition[t]}function rt(e){return Object.assign(Object.assign({},tt(e,"heading")),{subSection:[e.format_panel.heading.subSectionDefinition.title,e.format_panel.heading.subSectionDefinition.subject]})}function it(e){return Object.assign(Object.assign({},tt(e,"axis_labels")),{y:Object.assign(Object.assign({},nt(e,"y")),{prefix:nt(e,"y.prefix"),postfix:nt(e,"y.postfix"),format:nt(e,"y.format"),count:nt(e,"y.count"),axisTitle:nt(e,"y.axis_title")}),x:Object.assign(Object.assign({},nt(e,"x")),{prefix:nt(e,"x.prefix"),postfix:nt(e,"x.postfix"),format:nt(e,"x.format"),count:nt(e,"x.count"),axisTitle:nt(e,"x.axis_title")})})}function ot(e,t,n){var r,i,o,s,a;return t?Object.assign(Object.assign({},tt(e,"chart_styles")),{subSection:[null===(r=e.format_panel.chart_styles)||void 0===r?void 0:r.subSectionDefinition.curve,null===(i=e.format_panel.chart_styles)||void 0===i?void 0:i.subSectionDefinition.legend]}):n?Object.assign(Object.assign({},tt(e,"chart_styles")),{subSection:[null===(o=e.format_panel.chart_styles)||void 0===o?void 0:o.subSectionDefinition.stacked,null===(s=e.format_panel.chart_styles)||void 0===s?void 0:s.subSectionDefinition.legend]}):Object.assign(Object.assign({},tt(e,"chart_styles")),{subSection:[null===(a=e.format_panel.chart_styles)||void 0===a?void 0:a.subSectionDefinition.legend]})}function st(e,t){var n;return Object.assign(Object.assign({},null===(n=e.format_panel.stats_labels)||void 0===n?void 0:n.subSectionDefinition[t]),{namespace:t})}const at=(e,t)=>{if("current"===(null==e?void 0:e.func)&&t)return e},lt=e=>({title:et.title,description:et.description,servicesClass:"BarChart",namespace:et.namespace,dump:e=>e,load:t=>Object.assign(Object.assign({},t),{measure:d(t.measure),order:u(t.order,t.timeDimension),filter:c(t.filter),protectedFields:Ze(t.protectedFields),viewId:Xe(t.viewId),dimension:O(t.dimension),approxXAxisLabelCount:f(t.approxXAxisLabelCount),approxYAxisLabelCount:f(t.approxYAxisLabelCount),parameters:p(t.parameters),conditionalFormattingRules:Je(e.queryEngineConfig,t.conditionalFormattingRules),headline:at(t.headline,t.timeDimension)}),setAttributes:ce(e),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"barChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:Xe(null==t?void 0:t.viewId),filter:[],order:[],stacked:void 0,dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0,headline:void 0},t),createFeedback:Le,schema:le(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:n,dimension:r}=Fe(t,e.queryEngineConfig,"barChart");return this.init(t.id,{measure:[n[0]],dimension:r})},dataPanelConfig:()=>[tt(et,"data_set"),tt(et,"views"),Object.assign(Object.assign({},tt(et,"field_y_axis")),{fieldFilterOptions:{forComponent:"barChart",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),tt(et,"drilldown"),Object.assign(Object.assign({},tt(et,"field_x_axis")),{fieldFilterOptions:{forComponent:"barChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t)=>Ye(e,t),getValues:e=>Ke(e),maxAllowed:2,testId:"add-dimension"}),tt(et,"sort"),tt(et,"filter"),tt(et,"custom_metrics"),tt(et,"limit")],formatPanelConfig:()=>[rt(et),ot(et,!1,!0),it(et),Object.assign(Object.assign({},tt(et,"conditional_formatting")),{ruleType:"backgroundColor"}),tt(et,"goal_line"),tt(et,"headline")],supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return We(e,t,this.setAttributes)}}),ct=e=>P().object(Object.assign(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),K(e.queryEngineConfig,e.attributesSchemaOptions)),{stacked:P().valid(!0,!1,"100%"),legend:P().valid(!0,!1),type:P().valid("lineChart").required(),parameters:ne(e.queryEngineConfig,e.attributesSchemaOptions),lineCurve:Z,conditionalFormattingRules:ae(e.queryEngineConfig),goalLines:re(),axisTitles:oe(),headline:ie()})),ut=e=>(t,n)=>{let r=$(t,n,ct(e));return r=k(r),r},dt={title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",namespace:"line_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this line chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this line chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this line chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this line chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Curve",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},ft=e=>({title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",servicesClass:"LineChart",namespace:"line_chart",dump:e=>e,load:t=>({type:t.type,measure:d(t.measure),order:u(t.order,t.timeDimension),dimension:O(t.dimension),timeDimension:t.timeDimension,displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,viewId:Xe(t.viewId),filter:c(t.filter),dataSetId:t.dataSetId,limit:t.limit,xAxisPostfix:t.xAxisPostfix,xAxisPrefix:t.xAxisPrefix,yAxisPostfix:t.yAxisPostfix,yAxisPrefix:t.yAxisPrefix,yAxisFormat:t.yAxisFormat,xAxisFormat:t.xAxisFormat,lineCurve:t.lineCurve,conditionalFormattingRules:Je(e.queryEngineConfig,t.conditionalFormattingRules),drilldown:t.drilldown,legend:t.legend,goalLines:t.goalLines,headline:at(t.headline,t.timeDimension),parameters:p(t.parameters),approxXAxisLabelCount:f(t.approxXAxisLabelCount),approxYAxisLabelCount:f(t.approxYAxisLabelCount),axisTitles:t.axisTitles}),setAttributes:ut(e),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"lineChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:Xe(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0},t),createFeedback:Le,schema:ct(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:n,dimension:r}=Fe(t,e.queryEngineConfig,"lineChart");return this.init(t.id,{measure:[n[0]],dimension:r})},dataPanelConfig:()=>[tt(dt,"data_set"),tt(dt,"views"),Object.assign(Object.assign({},tt(dt,"field_y_axis")),{fieldFilterOptions:{forComponent:"lineChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),Object.assign(Object.assign({},tt(dt,"field_x_axis")),{fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t)=>Ye(e,t),getValues:e=>Ke(e),maxAllowed:2,testId:"add-dimension"}),tt(dt,"sort"),tt(dt,"filter"),tt(dt,"custom_metrics"),tt(dt,"limit")],formatPanelConfig:()=>[rt(dt),ot(dt,!0,!1),it(dt),Object.assign(Object.assign({},tt(dt,"conditional_formatting")),{ruleType:"lineColor"}),tt(dt,"goal_line"),tt(dt,"headline")],supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return We(e,t,this.setAttributes)}}),pt=e=>P().object(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),{measure:P().array().items(q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),dimension:z(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions),filter:X(e.queryEngineConfig),timeDimension:P().valid(null),order:P().array().items(U(e.queryEngineConfig)),type:P().valid("pieChart").required(),legend:P().valid(!0,!1),limit:V(),labelsAsPercentage:P().boolean(),conditionalFormattingRules:ae(e.queryEngineConfig),labelFormat:P().alternatives(P().string(),P().valid(null)),parameters:ne(e.queryEngineConfig,e.attributesSchemaOptions)})),ht={title:"Pie chart",description:"Represents data in a circular pie-like format, useful for showing proportions.",namespace:"pie_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this pie chart?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want each segment to measure?",callToAction:"Add metric"},field_grouping:{type:"fieldCollector",title:"Grouping",description:"How do you want to split each section of the pie chart?",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Choose the order of segments in the pie chart"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this pie chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of segments shown on this pie chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Format",description:"",namespace:"number_format"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},mt=e=>({title:ht.title,description:ht.description,servicesClass:"PieChart",namespace:ht.namespace,dump:e=>e,load:t=>({type:t.type,measure:d(t.measure),order:u(t.order,t.timeDimension),dimension:O(t.dimension),viewId:Xe(t.viewId),timeDimension:t.timeDimension,displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,filter:c(t.filter),dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:Je(e.queryEngineConfig,t.conditionalFormattingRules),labelsAsPercentage:t.labelsAsPercentage,legend:t.legend,labelFormat:t.labelFormat,parameters:p(t.parameters)}),setAttributes:(t,n)=>$(t,n,pt(e)),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"pieChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:Xe(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],labelsAsPercentage:!1,legend:!0,labelFormat:null,parameters:{}},t),createFeedback:Le,schema:pt(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:n,dimension:r}=Fe(t,e.queryEngineConfig,"pieChart");return this.init(t.id,{measure:[n[0]],dimension:r})},dataPanelConfig:()=>[tt(ht,"data_set"),tt(ht,"views"),Object.assign(Object.assign({},tt(ht,"field_metrics")),{fieldFilterOptions:{forComponent:"pieChart"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),Object.assign(Object.assign({},tt(ht,"field_grouping")),{fieldFilterOptions:{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"}),tt(ht,"sort"),tt(ht,"filter"),tt(ht,"custom_metrics"),tt(ht,"limit")],formatPanelConfig:()=>{var e,t;return[rt(ht),Object.assign(Object.assign({},tt(ht,"conditional_formatting")),{ruleType:"backgroundColor"}),Object.assign(Object.assign({},tt(ht,"chart_styles")),{subSection:[null===(e=ht.format_panel.chart_styles)||void 0===e?void 0:e.subSectionDefinition.legend,null===(t=ht.format_panel.chart_styles)||void 0===t?void 0:t.subSectionDefinition.number_format]})]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),gt=e=>P().object(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),{xMeasure:q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions).allow(null),yMeasure:q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions).allow(null),dimension:z(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions),order:P().array().items(U(e.queryEngineConfig)),limit:V(),legend:P().valid(!0,!1),offset:P().number().min(0),filter:X(e.queryEngineConfig),type:P().valid("scatterChart").required(),timeDimension:P().valid(null),xAxisPrefix:P().string().allow(""),yAxisPrefix:P().string().allow(""),xAxisPostfix:P().string().allow(""),yAxisPostfix:P().string().allow(""),yAxisFormat:P().alternatives(P().string(),P().valid(null)),xAxisFormat:P().alternatives(P().string(),P().valid(null)),approxYAxisLabelCount:Y,approxXAxisLabelCount:Y,goalLines:re(),axisTitles:oe()})),yt=e=>(t,n)=>{let r=$(t,n,gt(e)),i=[];return r.xMeasure&&i.push(r.xMeasure),r.yMeasure&&i.push(r.yMeasure),r.dimension.forEach((e=>{i.push({field:e.field,function:e.function})})),r=N(r,i),r},bt={title:"Scatter chart",description:"Displays data points on a Cartesian plane, perfect for showing correlations.",namespace:"scatter_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this scatter chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"",subSectionDefinition:{xAxis:{type:"metrics",title:"X axis",namespace:"metrics.xAxis"},yAxis:{type:"metrics",title:"Y axis",namespace:"metrics.yAxis"}}},field_grouping:{type:"fieldCollector",title:"Grouping",description:"What do you want each dot to represent?",callToAction:"Add comparison"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of data points shown on this scatter chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},vt=e=>({title:bt.title,description:bt.description,servicesClass:"ScatterChart",namespace:bt.namespace,dump:e=>e,load:e=>({type:e.type,xMeasure:d(e.xMeasure?[e.xMeasure]:[])[0]||null,yMeasure:d(e.yMeasure?[e.yMeasure]:[])[0]||null,dimension:O(e.dimension),viewId:Xe(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:c(e.filter),order:u(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,legend:e.legend,xAxisFormat:e.xAxisFormat,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,approxXAxisLabelCount:f(e.approxXAxisLabelCount),approxYAxisLabelCount:f(e.approxYAxisLabelCount),goalLines:e.goalLines,axisTitles:e.axisTitles}),setAttributes:yt(e),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"scatterChart",xMeasure:null,yMeasure:null,dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:Xe(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,legend:!0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,axisTitles:void 0},t),createFeedback:Le,schema:gt(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>!!e.xMeasure&&!!e.yMeasure&&e.dimension.length>0,autoGenerate(t){const{measure:n,dimension:r}=Fe(t,e.queryEngineConfig,"scatterChart");return this.init(t.id,{xMeasure:n[0],yMeasure:n[1],dimension:r})},dataPanelConfig:()=>{var e,t;return[tt(bt,"data_set"),tt(bt,"views"),Object.assign(Object.assign({},tt(bt,"labelled_metrics")),{subSection:[Object.assign(Object.assign({},null===(e=bt.data_panel.labelled_metrics)||void 0===e?void 0:e.subSectionDefinition.xAxis),{propKey:"xMeasure",allowsMultiple:!1}),Object.assign(Object.assign({},null===(t=bt.data_panel.labelled_metrics)||void 0===t?void 0:t.subSectionDefinition.yAxis),{propKey:"yMeasure",allowsMultiple:!1})]}),Object.assign(Object.assign({},tt(bt,"field_grouping")),{fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["boolean","number","string"],removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"}),tt(bt,"filter"),tt(bt,"custom_metrics"),tt(bt,"limit")]},formatPanelConfig:()=>{var e;return[rt(bt),Object.assign(Object.assign({},tt(bt,"chart_styles")),{subSection:[null===(e=bt.format_panel.chart_styles)||void 0===e?void 0:e.subSectionDefinition.legend]}),it(bt),tt(bt,"goal_line")]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),_t=e=>P().object(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),{stacked:P().valid(!0,!1,"100%"),legend:P().valid(!0,!1),barMeasure:P().array().items(q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),lineMeasure:P().array().items(q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),barDimension:z(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions),lineDimension:z(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions),order:P().array().items(U(e.queryEngineConfig)),timeDimension:P().alternatives(G(e.queryEngineConfig.supportedTimeTruncFunctions),P().valid(null)),limit:V(),offset:P().number().min(0),filter:X(e.queryEngineConfig),type:P().valid("comboChart").required(),xAxisPrefix:P().string().allow(""),yAxisPrefix:P().string().allow(""),xAxisPostfix:P().string().allow(""),yAxisPostfix:P().string().allow(""),yAxisFormat:P().alternatives(P().string(),P().valid(null)),xAxisFormat:P().alternatives(P().string(),P().valid(null)),approxYAxisLabelCount:Y,approxXAxisLabelCount:Y,goalLines:re(),conditionalFormattingRules:P().object({bar:P().array().items(L(e.queryEngineConfig)),line:P().array().items(L(e.queryEngineConfig))}),axisTitles:oe()})),wt=e=>(t,n)=>{let r=$(t,n,_t(e)),i=[...r.lineMeasure,...r.barMeasure];return[...r.lineDimension,...r.barDimension].forEach((e=>{i.push({field:e.field,function:e.function})})),r.timeDimension&&i.push({field:r.timeDimension.field,function:r.timeDimension.truncate}),r=N(r,i),r},At={title:"Combo chart",description:"A versatile component that combines different chart types.",namespace:"combo_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this combo chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"What do you want each line and bar to measure?",subSectionDefinition:{line:{type:"metrics",title:"Line",namespace:"metrics.line"},bar:{type:"metrics",title:"Bar",namespace:"metrics.bar"}}},combo_chart_dimension:{type:"comboChartDimension",title:"Grouping - X Axis",description:""},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this combo chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:"",subSectionDefinition:{bar:{title:"Bar",namespace:"bar"},line:{title:"Line",namespace:"line"}}}}},xt=e=>({title:At.title,description:At.description,servicesClass:"ComboChart",namespace:At.namespace,dump:e=>e,load:t=>{return n=t,r=e.queryEngineConfig,Object.assign(Object.assign({},n),{lineMeasure:d(n.lineMeasure),barMeasure:d(n.barMeasure),order:u(n.order,n.timeDimension||null),filter:c(n.filter),lineDimension:O(n.lineDimension||n.dimension||[]),barDimension:O(n.barDimension||n.dimension||[]),viewId:Xe(n.viewId),approxXAxisLabelCount:f(n.approxXAxisLabelCount),approxYAxisLabelCount:f(n.approxYAxisLabelCount),conditionalFormattingRules:{bar:Je(r,null===(i=n.conditionalFormattingRules)||void 0===i?void 0:i.bar),line:Je(r,null===(o=n.conditionalFormattingRules)||void 0===o?void 0:o.line)}});var n,r,i,o},setAttributes:wt(e),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"comboChart",barMeasure:[],lineMeasure:[],lineDimension:[],barDimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:Xe(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",protectedByOrganisation:void 0,xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,conditionalFormattingRules:void 0,axisTitles:void 0},t),createFeedback:Le,schema:_t(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>e.lineMeasure.length>0||e.barMeasure.length>0,autoGenerate(t){const{measure:n,dimension:r}=Fe(t,e.queryEngineConfig,"comboChart");return this.init(t.id,{barMeasure:[n[0]],lineMeasure:[n[1]||n[0]],barDimension:r,lineDimension:r})},dataPanelConfig:()=>{var e,t;return[tt(At,"data_set"),tt(At,"views"),Object.assign(Object.assign({},tt(At,"labelled_metrics")),{subSection:[Object.assign(Object.assign({},null===(e=At.data_panel.labelled_metrics)||void 0===e?void 0:e.subSectionDefinition.line),{propKey:"lineMeasure",allowsMultiple:!0}),Object.assign(Object.assign({},null===(t=At.data_panel.labelled_metrics)||void 0===t?void 0:t.subSectionDefinition.bar),{propKey:"barMeasure",allowsMultiple:!0})]}),tt(At,"combo_chart_dimension"),tt(At,"sort"),tt(At,"filter"),tt(At,"custom_metrics"),tt(At,"limit")]},formatPanelConfig:()=>{var e,t,n,r,i,o,s,a,l,c;return[rt(At),ot(At,!1,!0),it(At),Object.assign(Object.assign({},tt(At,"conditional_formatting")),{ruleType:"backgroundColor",subSection:[{title:null!==(n=null===(t=null===(e=At.format_panel.conditional_formatting)||void 0===e?void 0:e.subSectionDefinition)||void 0===t?void 0:t.bar.title)&&void 0!==n?n:"",namespace:null===(i=null===(r=At.format_panel.conditional_formatting)||void 0===r?void 0:r.subSectionDefinition)||void 0===i?void 0:i.bar.namespace,propKey:"bar"},{title:null!==(a=null===(s=null===(o=At.format_panel.conditional_formatting)||void 0===o?void 0:o.subSectionDefinition)||void 0===s?void 0:s.line.title)&&void 0!==a?a:"",namespace:null===(c=null===(l=At.format_panel.conditional_formatting)||void 0===l?void 0:l.subSectionDefinition)||void 0===c?void 0:c.line.namespace,propKey:"line"}]}),tt(At,"goal_line")]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),St=e=>P().object(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),{type:P().valid("dataTable").required(),measure:P().array().items(q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)).required(),dimension:z(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions).required(),order:P().array().items(U(e.queryEngineConfig)),timeDimension:P().alternatives(G(e.queryEngineConfig.supportedTimeTruncFunctions),P().valid(null)),limit:V().required(),offset:P().number().min(0),filter:X(e.queryEngineConfig),prefixes:P().array().items(B),exportNames:P().object(),numberFormat:P().object(),conditionalFormattingRules:ae(e.queryEngineConfig),dateTimeFormat:P().string(),protectedFields:P().object({dimension:Q(e.queryEngineConfig),measure:J(e.queryEngineConfig)}).unknown(!0),sizing:se,tableDrilldown:P().array().items(P().object({subsetDimension:P().string().required().description("The ID of the field in the data set to drill down by.")})).description("Drilldown configuration for a pivot table.")})),Ot=e=>(t,n)=>{let r=$(t,n,St(e));return r=k(r),r},Et={title:"Pivot table",description:"Transforms data into a table with dynamic rows and columns.",namespace:"pivot_table",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this data table?"},views:{type:"views",title:"View",description:""},field_columns:{type:"fieldCollector",title:"Group columns",callToAction:"Add group column",description:""},field_rows:{type:"fieldCollector",title:"Group rows",description:"Which field do you want to group each row by? An example might be an employee ID or geographical location",callToAction:"Add group row"},drilldown:{type:"drilldown",title:"Drilldown",description:"Drilldowns in a pivot table reveals underlying data contributing to summarized figures upon clicking."},field_metrics:{type:"fieldCollector",title:"Metrics",description:"Select the columns to show in the data table",callToAction:"Add metric"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this data table."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},pagination:{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},format:{type:"format",title:"Format",description:"",subSectionDefinition:{time:{type:"time",title:"Time",description:"",namespace:"time"}}},prefixes:{type:"prefixes",title:"Prefixes",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Ct=[3,5,10,20,50,100,200],jt=(e,t)=>e.filter((e=>e.pivot==t)),Tt=e=>({title:Et.title,description:Et.description,servicesClass:"PivotTable",namespace:Et.namespace,dump:e=>e,load:t=>{return{type:t.type,measure:d(t.measure),order:u(t.order,t.timeDimension||null),displayTitle:t.displayTitle,dimension:(r=Ke({timeDimension:t.timeDimension,dimension:O(t.dimension)}),r.map((e=>Object.assign(Object.assign({},e),{pivot:e.pivot?e.pivot:"x"})))),displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,protectedFields:Ze(t.protectedFields),viewId:Xe(t.viewId),filter:c(t.filter),dataSetId:t.dataSetId,limit:t.limit,offset:t.offset,conditionalFormattingRules:Je(e.queryEngineConfig,t.conditionalFormattingRules),dateTimeFormat:t.dateTimeFormat,prefixes:t.prefixes,exportNames:t.exportNames,numberFormat:t.numberFormat,sizing:t.sizing,tableDrilldown:(n=t.tableDrilldown,n&&n.length>0?n.map(Ve):n||[])};var n,r},setAttributes:Ot(e),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"dataTable",measure:[],displayTitle:"",dimension:[],protectedByOrganisation:void 0,displaySubject:"",viewId:Xe(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:50,offset:0,conditionalFormattingRules:[],protectedFields:void 0,prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{},tableDrilldown:[]},t),schema:St(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:n,dimension:r}=Fe(t,e.queryEngineConfig,"dataTable");return this.init(t.id,{measure:n.slice(0,5),dimension:r})},dataPanelConfig:()=>[tt(Et,"data_set"),tt(Et,"views"),Object.assign(Object.assign({},tt(Et,"field_columns")),{fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t,n)=>({dimension:[...e.map((e=>Object.assign(Object.assign({},e),{pivot:"y"}))),...jt(n.dimension,"x")]}),getValues:e=>jt(e.dimension,"y"),testId:"add-pivot-dimension"}),Object.assign(Object.assign({},tt(Et,"field_rows")),{fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t,n)=>({dimension:[...e.map((e=>Object.assign(Object.assign({},e),{pivot:"x"}))),...jt(n.dimension,"y")]}),getValues:e=>jt(e.dimension,"x"),testId:"add-dimension"}),tt(Et,"drilldown"),Object.assign(Object.assign({},tt(Et,"field_metrics")),{fieldFilterOptions:{forComponent:"dataTable"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),tt(Et,"sort"),Object.assign(Object.assign({},tt(Et,"pagination")),{options:Ct}),tt(Et,"filter"),tt(Et,"custom_metrics")],formatPanelConfig:()=>{var e;return[rt(Et),Object.assign(Object.assign({},tt(Et,"format")),{subSection:[null===(e=Et.format_panel.format)||void 0===e?void 0:e.subSectionDefinition.time]}),tt(Et,"prefixes"),Object.assign(Object.assign({},tt(Et,"conditional_formatting")),{ruleType:"backgroundColor"})]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!0}}),It=P().object({field:P().string().required(),function:P().valid("none").required()}),Rt=e=>P().object(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),{type:P().valid("basicTable").required(),measure:P().array().items(It).required(),dimension:P().array().max(0),order:P().array().items(U(e.queryEngineConfig)),timeDimension:P().valid(null),limit:V().required(),offset:P().number().min(0),filter:X(e.queryEngineConfig),prefixes:P().array().items(B),exportNames:P().object(),numberFormat:P().object(),conditionalFormattingRules:ae(e.queryEngineConfig),dateTimeFormat:P().string(),protectedFields:P().object({measure:J(e.queryEngineConfig)}).unknown(!0),sizing:se})),Dt=e=>(t,n)=>{let r=$(t,n,Rt(e));return r=N(r,[...r.measure]),r},Nt={title:"Basic table",description:"Displays data in a simple, straightforward table format.",namespace:"basic_table",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this basic table?"},views:{type:"views",title:"View",description:""},fields:{type:"fields",title:"Columns",description:"Select which values you want to see in this table"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this basic table."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},pagination:{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{type:"subject",title:"Subject",description:"",namespace:"subject"}}},format:{type:"format",title:"Format",description:"",subSectionDefinition:{time:{type:"time",title:"Time",description:"",namespace:"time"}}},prefixes:{type:"prefixes",title:"Prefixes",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Ft=e=>({title:Nt.title,description:Nt.description,servicesClass:"BasicTable",namespace:Nt.namespace,dump:e=>({type:e.type,measure:e.measure,displayTitle:e.displayTitle,dimension:e.dimension,timeDimension:e.timeDimension,displaySubject:e.displaySubject,protectedFields:e.protectedFields,filter:e.filter,order:e.order,dataSetId:e.dataSetId,viewId:null==e?void 0:e.viewId,limit:e.limit,offset:e.offset,conditionalFormattingRules:e.conditionalFormattingRules,protectedByOrganisation:e.protectedByOrganisation,dateTimeFormat:e.dateTimeFormat,prefixes:e.prefixes,exportNames:e.exportNames,numberFormat:e.numberFormat,sizing:e.sizing}),load:t=>Object.assign(Object.assign({},t),{measure:d(t.measure),order:u(t.order,t.timeDimension),filter:c(t.filter),dimension:O(t.dimension),viewId:Xe(t.viewId),protectedFields:Ze(t.protectedFields),conditionalFormattingRules:Je(e.queryEngineConfig,t.conditionalFormattingRules)}),setAttributes:Dt(e),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:function(t,n){const r={type:"basicTable",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",filter:[],order:[],dataSetId:t,viewId:Xe(null==n?void 0:n.viewId),protectedFields:void 0,limit:50,offset:0,conditionalFormattingRules:[],prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{}};return Dt(e)(r,n||{})},schema:Rt(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),setFields:function(t,n){const r=[...n].map((e=>({field:e,function:"none"})));return Dt(e)(t,{measure:r})},setDateTimeFormat:function(e,t){return this.setAttributes(e,{dateTimeFormat:t})},isRunnable:e=>e.measure.length>0,autoGenerate(e){const t=[...Ce(e.fields,{forComponent:"basicTable",onlyMeasures:!0,removeAggregateMaths:!0,removePercentage:!0})].map((e=>({field:e.id,function:"none"})));return this.init(e.id,{measure:t.slice(0,5)})},dataPanelConfig:()=>[tt(Nt,"data_set"),tt(Nt,"views"),tt(Nt,"fields"),tt(Nt,"sort"),Object.assign(Object.assign({},tt(Nt,"pagination")),{options:Ct}),tt(Nt,"filter"),tt(Nt,"custom_metrics")],formatPanelConfig:()=>{var e;return[rt(Nt),Object.assign(Object.assign({},tt(Nt,"format")),{subSection:[null===(e=Nt.format_panel.format)||void 0===e?void 0:e.subSectionDefinition.time]}),tt(Nt,"prefixes"),Object.assign(Object.assign({},tt(Nt,"conditional_formatting")),{ruleType:"backgroundColor"})]},supportedCustomFields:{percentages:!1,simpleMaths:!0,rules:!0,aggregateMaths:!1,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!0}}),kt=e=>(t,n)=>{let r=$(t,n,le(e));return r=k(r),r},$t={title:"Horizontal bar chart",description:"Similar to a BarChart but with horizontal bars.",namespace:"horizontal_bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Mt=e=>({title:$t.title,description:$t.description,servicesClass:"HorizontalBarChart",namespace:$t.namespace,dump:e=>e,load:e=>Object.assign(Object.assign({},e),{measure:d(e.measure),order:u(e.order,e.timeDimension),dimension:O(e.dimension),viewId:Xe(e.viewId),filter:c(e.filter),approxXAxisLabelCount:f(e.approxXAxisLabelCount),approxYAxisLabelCount:f(e.approxYAxisLabelCount),protectedFields:Ze(e.protectedFields)}),setAttributes:kt(e),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"horizontalBarChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:Xe(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,drilldown:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",axisTitles:void 0},t),createFeedback:Le,schema:le(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:n,dimension:r}=Fe(t,e.queryEngineConfig,"horizontalBarChart");return this.init(t.id,{measure:[n[0]],dimension:r})},dataPanelConfig:()=>[tt($t,"data_set"),tt($t,"views"),Object.assign(Object.assign({},tt($t,"field_y_axis")),{fieldFilterOptions:{forComponent:"horizontalBarChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),tt($t,"drilldown"),Object.assign(Object.assign({},tt($t,"field_x_axis")),{fieldFilterOptions:{forComponent:"horizontalBarChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t)=>Ye(e,t),getValues:e=>Ke(e),maxAllowed:2,testId:"add-dimension"}),tt($t,"sort"),tt($t,"filter"),tt($t,"custom_metrics"),tt($t,"limit")],formatPanelConfig:()=>[rt($t),ot($t,!1,!0),it($t),Object.assign(Object.assign({},tt($t,"conditional_formatting")),{ruleType:"backgroundColor"}),tt($t,"headline")],supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return We(e,t,this.setAttributes)}}),Pt=e=>P().object(Object.assign(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),K(e.queryEngineConfig,e.attributesSchemaOptions)),{stacked:P().valid(!0,!1,"100%"),legend:P().valid(!0,!1),type:P().valid("areaChart").required(),lineCurve:Z,conditionalFormattingRules:ae(e.queryEngineConfig),parameters:ne(e.queryEngineConfig,e.attributesSchemaOptions),goalLines:re(),axisTitles:oe(),headline:ie()})),Lt=e=>(t,n)=>{let r=$(t,n,Pt(e));return r=k(r),r},Bt={title:"Area chart",description:"Displays data as areas on a chart, useful for showing trends over time.",namespace:"area_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this area chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each area to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each area to represent? An example might be an employee ID to represent each employee.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this area chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this area chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},curve:{type:"curve",title:"Line Curve",description:"",namespace:"curve"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},qt=e=>({title:Bt.title,description:Bt.description,servicesClass:"AreaChart",namespace:Bt.namespace,dump:e=>e,load:t=>({type:t.type,measure:d(t.measure),displayTitle:t.displayTitle,dimension:O(t.dimension),timeDimension:t.timeDimension,displaySubject:t.displaySubject,viewId:Xe(t.viewId),filter:c(t.filter),order:u(t.order,t.timeDimension),dataSetId:t.dataSetId,limit:t.limit,offset:t.offset,xAxisPostfix:t.xAxisPostfix,xAxisPrefix:t.xAxisPrefix,yAxisPostfix:t.yAxisPostfix,yAxisPrefix:t.yAxisPrefix,lineCurve:t.lineCurve,conditionalFormattingRules:Je(e.queryEngineConfig,t.conditionalFormattingRules),protectedByOrganisation:t.protectedByOrganisation,stacked:t.stacked,drilldown:t.drilldown,legend:t.legend,yAxisFormat:t.yAxisFormat,xAxisFormat:t.xAxisFormat,goalLines:t.goalLines,parameters:p(t.parameters),approxXAxisLabelCount:f(t.approxXAxisLabelCount),approxYAxisLabelCount:f(t.approxYAxisLabelCount),headline:at(t.headline,t.timeDimension)}),setAttributes:Lt(e),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"areaChart",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",viewId:Xe(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,offset:0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0,headline:void 0},t),createFeedback:Le,schema:Pt(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:n,dimension:r}=Fe(t,e.queryEngineConfig,"areaChart");return this.init(t.id,{measure:[n[0]],dimension:r})},dataPanelConfig:()=>[tt(Bt,"data_set"),tt(Bt,"views"),Object.assign(Object.assign({},tt(Bt,"field_y_axis")),{fieldFilterOptions:{forComponent:"areaChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),Object.assign(Object.assign({},tt(Bt,"field_x_axis")),{fieldFilterOptions:{forComponent:"areaChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t)=>Ye(e,t),getValues:e=>Ke(e),maxAllowed:2,testId:"add-dimension"}),tt(Bt,"sort"),tt(Bt,"filter"),tt(Bt,"custom_metrics"),tt(Bt,"limit")],formatPanelConfig:()=>{var e,t,n;return[rt(Bt),Object.assign(Object.assign({},tt(Bt,"chart_styles")),{subSection:[null===(e=Bt.format_panel.chart_styles)||void 0===e?void 0:e.subSectionDefinition.stacked,null===(t=Bt.format_panel.chart_styles)||void 0===t?void 0:t.subSectionDefinition.legend,null===(n=Bt.format_panel.chart_styles)||void 0===n?void 0:n.subSectionDefinition.curve]}),it(Bt),Object.assign(Object.assign({},tt(Bt,"conditional_formatting")),{ruleType:"areaColor"}),tt(Bt,"goal_line"),tt(Bt,"headline")]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),Ut=e=>P().object(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),{fontSize:P().string().allow(""),formatter:P().object(),measure:P().array().items(q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),filter:X(e.queryEngineConfig),prefixes:P().object(),postfixes:P().object(),type:P().valid("singleStat").required(),limit:V(),conditionalFormattingRules:ae(e.queryEngineConfig),deltaTimeDimension:P().alternatives(G(e.queryEngineConfig.supportedTimeTruncFunctions),P().valid(null)),parameters:ne(e.queryEngineConfig,e.attributesSchemaOptions)})),Gt=e=>{if("singleMeasure"in e){let t={},n={},r=[],i={};return e.singleMeasure&&(r=[e.singleMeasure],t[T(e.singleMeasure)]=e.prefix,n[T(e.singleMeasure)]=e.postfix,i[T(e.singleMeasure)]=e.formatter),{type:"singleStat",prefixes:t,postfixes:n,measure:r,formatter:i,fontSize:e.fontSize,displayTitle:e.displayTitle,displaySubject:e.displaySubject,filter:c(e.filter),dataSetId:e.dataSetId,limit:e.limit,conditionalFormattingRules:e.conditionalFormattingRules,deltaTimeDimension:e.deltaTimeDimension,parameters:p(e.parameters)}}return Object.assign(Object.assign({},e),{filter:c(e.filter)})},zt={title:"Single stat",description:"Shows a single statistical value, ideal for key data point representation.",namespace:"single_stat",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this single stat?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metrics",description:"What do you want to show?",callToAction:"Add metric"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},comparison:{type:"comparison",title:"Comparison",description:""}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},stats_labels:{type:"statsLabels",title:"Labels",description:"",subSectionDefinition:{prefix:{title:"Prefix",description:"",namespace:"prefix"},postfix:{title:"Postfix",description:"",namespace:"postfix"},format:{title:"Format",description:"",namespace:"format"},count:{title:"Label count",description:"",namespace:"count"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},format:{type:"format",title:"Format",description:"",subSectionDefinition:{font_size:{title:"Font Size",type:"fontSize",description:"",namespace:"font_size"}}}}},Ht=t=>({title:zt.title,description:zt.description,servicesClass:"SingleStat",namespace:zt.namespace,dump:e=>e,load:e=>{const t=Gt(e);return{type:"singleStat",prefixes:t.prefixes,postfixes:t.postfixes,formatter:t.formatter,fontSize:t.fontSize,measure:d(t.measure),displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:Xe(e.viewId),filter:t.filter,dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:t.conditionalFormattingRules,deltaTimeDimension:t.deltaTimeDimension,parameters:p(t.parameters)}},setAttributes:(e,n)=>$(e,n,Ut(t)),validate:(e,n)=>Pe(e,n,t.queryEngineConfig),init:(e,t)=>Object.assign({type:"singleStat",measure:[],displayTitle:"",postfixes:{},prefixes:{},formatter:{},fontSize:"2rem",protectedByOrganisation:void 0,displaySubject:"",viewId:Xe(null==t?void 0:t.viewId),filter:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],deltaTimeDimension:null,parameters:{}},t),schema:Ut(t),removeField:(e,n)=>F(e,n,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:n}=Fe(e,t.queryEngineConfig,"singleStat");return this.init(e.id,{measure:[n[0]]})},dataPanelConfig:()=>[tt(zt,"data_set"),tt(zt,"views"),Object.assign(Object.assign({},tt(zt,"field_metrics")),{fieldFilterOptions:{forComponent:"singleStat"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),tt(zt,"filter"),tt(zt,"custom_metrics"),tt(zt,"comparison")],formatPanelConfig:()=>{var e;return[rt(zt),Object.assign(Object.assign({},tt(zt,"stats_labels")),{prefix:st(zt,"prefix"),postfix:st(zt,"postfix"),format:st(zt,"format"),count:st(zt,"count")}),Object.assign(Object.assign({},tt(zt,"format")),{subSection:[null===(e=zt.format_panel.format)||void 0===e?void 0:e.subSectionDefinition.font_size]}),Object.assign(Object.assign({},tt(zt,"conditional_formatting")),{ruleType:"fontColor"})]},supportedCustomFields:{percentages:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(t,n){let r=(0,e.cloneDeep)(Ce(n.fields,{onlyFieldTypes:["number"]}));return Object.assign(Object.assign({},t),{type:"singleStat",protectedByOrganisation:!0,measure:[...r].map((e=>({function:"none",field:e.id})))})}}),Xt={title:"Custom",servicesClass:"",namespace:"custom",description:"",dump:e=>e,load:e=>e,setAttributes:(e,t)=>{throw"Not implemented."},validate:()=>[],init:(e,t)=>({type:"custom",id:t&&t.id||"",dataSetId:e,displaySubject:"",displayTitle:"",protectedByOrganisation:void 0}),schema:P().object(),removeField:(e,t)=>e,isRunnable:()=>!0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[],formatPanelConfig:()=>[],supportedCustomFields:{percentages:!1,simpleMaths:!0,rules:!1,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{colorGradient:!1,parameters:!1}},Vt=e=>P().object(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),{type:P().valid("mercatorMap").required(),measure:P().array().items(q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),filter:X(e.queryEngineConfig),limit:V(),dimension:z({},e.attributesSchemaOptions),labelFormat:P().alternatives(P().string(),P().valid(null)),noDataColor:P().string().required(),backgroundColor:P().string().required(),maxValueColor:P().string().required(),minValueColor:P().string().required(),position:P().object({scale:P().number(),centerX:P().number(),centerY:P().number()})})),Wt=e=>(t,n)=>$(t,n,Vt(e)),Yt={title:"Country map",description:"A map component based on the Mercator projection, suitable for geographical data visualization.",namespace:"mercator_map",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use for this map?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want to show?",callToAction:"Add metric"},field_country:{type:"fieldCollector",title:"Country",description:"Which field contains the country code required to group results on?",callToAction:"Set country"},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use on this map."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this map."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Map Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Value format",description:"",namespace:"number_format"}}},map_colors:{type:"mapColors",title:"Map colors",description:""}}},Kt=e=>({title:Yt.title,description:Yt.description,servicesClass:"MercatorMap",namespace:Yt.namespace,dump:e=>e,load:e=>({dataSetId:e.dataSetId,displaySubject:e.displaySubject,displayTitle:e.displayTitle,protectedByOrganisation:e.protectedByOrganisation,viewId:Xe(e.viewId),type:"mercatorMap",dimension:e.dimension,limit:e.limit,measure:d(e.measure),labelFormat:e.labelFormat,position:e.position,filter:c(e.filter),noDataColor:e.noDataColor||"#ffffff",backgroundColor:e.backgroundColor||"#EFF5F6",maxValueColor:e.maxValueColor||"#000000",minValueColor:e.minValueColor||"#e0e0e0"}),setAttributes:Wt(e),validate:()=>[],init:(e,t)=>Object.assign({type:"mercatorMap",dataSetId:e,dimension:[],measure:[],displaySubject:"",displayTitle:"",limit:5e3,filter:[],viewId:Xe(null==t?void 0:t.viewId),labelFormat:null,noDataColor:"#ffffff",backgroundColor:"#EFF5F6",maxValueColor:"#000000",minValueColor:"#e0e0e0"},t),schema:Vt(e),removeField:(e,t)=>e,isRunnable:e=>!!(e.dimension&&e.dimension[0]&&e.measure&&e.measure[0]),autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[tt(Yt,"data_set"),tt(Yt,"views"),Object.assign(Object.assign({},tt(Yt,"field_metrics")),{type:"fieldCollector",fieldFilterOptions:{forComponent:"mercatorMap"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),Object.assign(Object.assign({},tt(Yt,"field_country")),{fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["string"],removeRuleGrouping:!1,removeSimpleMaths:!0,removePercentage:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"}),tt(Yt,"filter"),tt(Yt,"custom_metrics"),tt(Yt,"limit")],formatPanelConfig:()=>{var e;return[rt(Yt),Object.assign(Object.assign({},tt(Yt,"chart_styles")),{subSection:[null===(e=Yt.format_panel.chart_styles)||void 0===e?void 0:e.subSectionDefinition.number_format]}),tt(Yt,"map_colors")]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}});var Zt;!function(e){e.Linear="linear",e.Circular="circular"}(Zt||(Zt={}));const Jt=e=>P().object(Object.assign(Object.assign({},W(e.attributesSchemaOptions)),{measure:P().array().items(q(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),filter:X(e.queryEngineConfig),type:P().valid("progress").required(),limit:V(),conditionalFormattingRules:ae(e.queryEngineConfig),parameters:ne(e.queryEngineConfig,e.attributesSchemaOptions),goals:P().array().items(P().object({field:P().string().required().description("ID of the field in the data set to which the goal applies too"),value:P().number().required().description("Value of which the goal is set")})).description("Set the target value that progression is shown towards."),progressType:P().array().items(P().object({field:P().string().required().description("ID of the field to set the progress type of"),value:P().valid(Zt.Linear,Zt.Circular).required()})).description("Set the display type of the progress view"),formatter:P().object().pattern(P().string(),P().string()),prefixes:P().object().pattern(P().string(),P().string()),postfixes:P().object().pattern(P().string(),P().string())})),Qt={title:"Progress",description:"Used to show progress towards goals, completion of tasks, or as indicators of performance metrics.",namespace:"progress",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this progress?"},views:{type:"views",title:"View",description:""},progress_goals:{type:"progressGoals",title:"Metric",description:"What do you want to show in each progress bar?"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this progress chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},stats_labels:{type:"statsLabels",title:"Labels",description:"",subSectionDefinition:{prefix:{title:"Prefix",description:"",namespace:"prefix"},postfix:{title:"Postfix",description:"",namespace:"postfix"},format:{title:"Format",description:"",namespace:"format"},count:{title:"Label count",description:"",namespace:"count"}}},progress_type:{type:"progressType",title:"Type",description:""}}},en=e=>({title:Qt.title,description:Qt.description,dump:e=>e,namespace:Qt.namespace,servicesClass:"Progress",load:e=>{const t=Gt(e);return{type:"progress",measure:d(t.measure),displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,viewId:Xe(t.viewId),filter:t.filter,dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:t.conditionalFormattingRules,parameters:t.parameters,prefixes:t.prefixes,postfixes:t.postfixes,formatter:t.formatter,goals:t.goals,progressType:t.progressType}},setAttributes:(t,n)=>$(t,n,Jt(e)),validate:(t,n)=>Pe(t,n,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"progress",measure:[],displayTitle:"",protectedByOrganisation:void 0,displaySubject:"",viewId:Xe(null==t?void 0:t.viewId),filter:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],parameters:{},formatter:{},progressType:[],goals:[],postfixes:{},prefixes:{}},t),schema:Jt(e),removeField:(t,n)=>F(t,n,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[tt(Qt,"data_set"),tt(Qt,"views"),tt(Qt,"progress_goals"),tt(Qt,"filter"),tt(Qt,"custom_metrics")],formatPanelConfig:()=>[rt(Qt),tt(Qt,"progress_type"),Object.assign(Object.assign({},tt(Qt,"stats_labels")),{prefix:st(Qt,"prefix"),postfix:st(Qt,"postfix"),format:st(Qt,"format"),count:st(Qt,"count")})],supportedCustomFields:{percentages:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),tn=["title","description","data_panel","format_panel"],nn=["title","description","callToAction"],rn="call_to_action",on=P().alternatives().try(P().string(),P().object({sentence:P().string().custom(((e,t)=>{const n=/\{\{(\w+)\}\}/g;let r;for(;null!==(r=n.exec(e));){const e=r[1];if(!t.state.ancestors[0][`${e}_singular`]||!t.state.ancestors[0][`${e}_plural`]){const n=`"textOverride": "${e}" found in sentence but corresponding "${e}_singular" and "${e}_plural" fields are missing`;return t.error("any.invalid",{message:n})}}return e}))}).pattern(/.+_(singular|plural)$/,P().string())).messages({"any.custom":"{{#message}}"}),sn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,an=/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,ln=/on[a-z]+\s*=\s*["'][^"']*["']/gi,cn=/javascript:[^\s"']+/gi,un=new RegExp(`^(?:${/<(b|strong)>(?:(?!<\/(b|strong)>).)*<\/(b|strong)>/.source}|${/<(i|em)>(?:(?!<\/(i|em)>).)*<\/(i|em)>/.source}|[^*_<>])*$`,"m"),dn=e=>{if(sn.test(e)||an.test(e)||ln.test(e)||cn.test(e))throw new Error("Invalid content: potentially malicious elements detected.");return un.test(e)},fn=(e,t,n,r,i)=>{if(i)return`[key: ${e}]`;const o=r?function(e,t){const n=e[t],r=on.validate(n);return r.error&&r.error.details.forEach((e=>{var t;A(null===(t=e.context)||void 0===t?void 0:t.message)})),(()=>{if("string"==typeof n)return dn(n);if("object"==typeof n)return dn(n.sentence);if(void 0===n)return!0;throw new Error("Invalid translation type")})()?n:void 0}(r,e):void 0;let s;return s="object"==typeof o&&null!==o?o.sentence:"string"==typeof o?o:t,s=function(e,t){if(!t)return e;return e.replace(/\[\[([^\]]+)\]\]/g,((e,n)=>{const r=n.split("|");for(const e of r){const n=t[e];if("string"==typeof n&&""!==n)return n;if("number"==typeof n)return n.toString()}return""}))}(s,n),n&&(s=function(e,t,n){return Object.entries(t).forEach((([t,r])=>{if(r&&"object"==typeof r&&"count"in r){const i=r,o=1===i.count?n&&n[`${t}_singular`]||i.singular:n&&n[`${t}_plural`]||i.plural;e=e.replace(new RegExp(`{{${t}}}`,"g"),o)}})),e}(s,n,o)),function(e,t){if(!t)return e;for(const[n,r]of Object.entries(t))if("string"==typeof r||"number"==typeof r){const t=new RegExp(`\\[\\[${n}\\]\\]`,"g");e=e.replace(t,String(r))}return e}(s,n)},pn=(e,t)=>{const n=null!=t?t:fn;let r=e;const i=e.namespace;return tn.forEach((t=>{if("title"===t||"description"===t){const o=n(`${i}.${t}`,e[t]);r=Object.assign(Object.assign({},r),{[t]:o})}if("data_panel"===t){const o=`${i}.${t}`,s=[];e.dataPanelConfig().forEach((e=>{e.subSection&&(e.subSection=mn(e,n,o)),gn(e).forEach((t=>{const r=n(`${o}.${t.key}`,t.defaultValue);e[t.property]=r})),s.push(e)})),r=Object.assign(Object.assign({},r),{dataPanelConfig:()=>s})}if("format_panel"===t){const o=`${i}.${t}`,s=[];e.formatPanelConfig().forEach((e=>{e.subSection&&(e.subSection=mn(e,n,o)),function(e,t,n){function r(n,r){n&&gn(n).forEach((i=>{const o=e(`${t}.${r}.${i.key}`,i.defaultValue);n[i.property]=o}))}function i(e,t,n){t.forEach((t=>{const i=e[t];i&&r(i,n)}))}n.x&&(i(n.x,hn,"axis_labels"),r(n.x,"axis_labels")),n.y&&(i(n.y,hn,"axis_labels"),r(n.y,"axis_labels")),function(e){return"prefix"in e}(n)&&i(n,hn,"stats_labels")}(n,o,e),gn(e).forEach((t=>{const r=n(`${o}.${t.key}`,t.defaultValue);e[t.property]=r})),s.push(e)})),r=Object.assign(Object.assign({},r),{formatPanelConfig:()=>s})}})),r},hn=["count","axisTitle","format","postfix","prefix"];function mn(e,t,n){var r;return null===(r=e.subSection)||void 0===r?void 0:r.map((r=>(gn(r).forEach((i=>{const o=t(`${n}.${e.namespace}.${i.key}`,i.defaultValue);r[i.property]=o})),r)))}function gn(e){const t=e.namespace||e.type;if(!t)return[];const n=[];return nn.forEach((r=>{if(e[r]){let i=r;"callToAction"===r&&(i=rn),n.push({key:`${t}.${i}`,defaultValue:e[r],property:r})}})),n}const yn={queryEngineConfig:{supportedFeatures:[],supportedAggregates:{},supportedTimeTruncFunctions:{},supportedOperators:{},supportedTransformationFunctions:{}}},bn=function(e,t){if("custom"==e)return Xt;if("barChart"==e)return pn(lt(t||yn),null==t?void 0:t.textOverride);if("areaChart"==e)return pn(qt(t||yn),null==t?void 0:t.textOverride);if("lineChart"==e)return pn(ft(t||yn),null==t?void 0:t.textOverride);if("pieChart"==e)return pn(mt(t||yn),null==t?void 0:t.textOverride);if("scatterChart"==e)return pn(vt(t||yn),null==t?void 0:t.textOverride);if("comboChart"==e)return pn(xt(t||yn),null==t?void 0:t.textOverride);if("dataTable"==e)return pn(Tt(t||yn),null==t?void 0:t.textOverride);if("basicTable"==e)return pn(Ft(t||yn),null==t?void 0:t.textOverride);if("singleStat"==e)return pn(Ht(t||yn),null==t?void 0:t.textOverride);if("progress"==e)return pn(en(t||yn),null==t?void 0:t.textOverride);if("mercatorMap"==e)return pn(Kt(t||yn),null==t?void 0:t.textOverride);if("horizontalBarChart"==e)return pn(Mt(t||yn),null==t?void 0:t.textOverride);throw`Cannot get interface for ${e}. Please implement it.`};class vn{constructor(e,t,n){this.componentType=e,this.dataSet=null;const{init:r}=bn(this.componentType,{queryEngineConfig:io.queryEngineConfig});this.attributes=r(t.id,n)}updateAttributes(e){const{setAttributes:t}=bn(this.componentType,{queryEngineConfig:io.queryEngineConfig});if(!this.attributes)throw new Error("Attributes have not been initialized yet");this.attributes=t(this.attributes,e)}}class _n extends Error{constructor(e){super(e),this.name="FailedToLoadQueryEngineConfig"}}const wn=_n;class An extends Error{constructor(e){super(`The queryEngineEndpoint value '${e}' is not valid.`),this.name="InvalidQueryEngineEndpoint",this.invalidEndpoint=e}}const xn=An;class Sn extends Error{constructor(){super("The queryEngineEndpoint value is not of the correct type. It must be a string or a function."),this.name="InvalidQueryEngineEndpointType"}}const On=Sn;var En=n(493),Cn=n.n(En);const jn=e=>e.startsWith("/")?jn(e.slice(1)):e.endsWith("/")?jn(e.slice(0,-1)):e;const Tn=e=>(t,n,r)=>{return i=void 0,o=void 0,a=function*(){let i={};n&&(i.auth=`Bearer ${n}`);let o="";r&&(o=`filter=${r.join(",")}`);const{status:s,body:a}=yield e({path:`/api/v2/auth/project/${t}/access_token?${o}`,method:"get",headers:i});if(200==s)return a.token.token},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a};var In=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const Rn=e=>t=>In(void 0,void 0,void 0,(function*(){var n;try{const n=yield((e,t)=>In(void 0,void 0,void 0,(function*(){if(e.dashboardAccessToken)return _("Using dashboard access token for auth header"),{auth:`Bearer ${e.dashboardAccessToken}`};if(e.projectAccessToken)return _("Using project access token for auth header"),{auth:`Bearer ${e.projectAccessToken}`};if(e.apiKey)return _("Using API Key for auth header"),{auth:`Api-Key ${e.apiKey}`};if(t.preFetchProjectAccessTokens&&(e.useCookieAuth||e.appSessionAuthToken)){_("Fetching project access token from the Vizzly API",t.preFetchProjectAccessTokens.projectId,"Filtering by",t.preFetchProjectAccessTokens.resourceFilters);const n=yield Tn(Rn(e))(t.preFetchProjectAccessTokens.projectId,e.appSessionAuthToken,t.preFetchProjectAccessTokens.resourceFilters);if(n)return _("Project access token received."),{auth:`Bearer ${n}`};_("Failed to receive project access token.")}else _("Not pre-fetching project access token.");return{}})))(e,t),r=t.headers||{},i=((e,t)=>{const n=jn(e),r=jn(t),i=(o=e).startsWith("https://")||o.startsWith("http://")||o.startsWith(".")?"":"/";var o;return""==n&&""==r?"/":""==r?`${i}${n}`:""!=n&&""!=r?`${i}${n}/${r}`:`${i}${r}`})(e.host,t.path),o=yield Cn()(i,{method:t.method,headers:Object.assign(Object.assign({"Content-Type":"application/json",Accept:"application/json"},n),r),redirect:"follow",referrerPolicy:"no-referrer",body:t.body?JSON.stringify(t.body):null,signal:t.abortSignal,mode:t.mode||void 0});let s=yield o.json();return _("HTTP Client Response",{host:e.host,path:t.path,status:o.status,responseId:o.headers.get("X-Request-Id")}),{body:s,status:o.status,headers:o.headers}}catch(e){if(null===(n=t.abortSignal)||void 0===n?void 0:n.aborted)return console.log("Aborted a request."),{status:500,body:{reason:"Aborted"},headers:null};throw e}}));const Dn=e=>"string"==typeof e?{}:e.customHeaders?e.customHeaders():{},Nn=e=>t=>{return n=void 0,r=void 0,o=function*(){const n={host:$n(e)},r=Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({},t.headers),Dn(e))});return Rn(n)(r)},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const Fn=e=>{return t=void 0,n=void 0,i=function*(){const t=Nn(e),n=yield t({method:"post",mode:"cors",path:"/api/v1/support",body:{}});return 200==n.status?"supportedFeatures"in(r=n.body)?r:Object.assign(Object.assign({},r),{supportedFeatures:["subquery"]}):null;var r},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i},kn={origin:"in-browser",supportedFeatures:["simpleMaths","aggregateMaths","subquery","encryptedDashboards","switchField","roundedNumbers","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:m(["sum","mean","min","max","count","countDistinct","median"]),supportedOperators:l([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:C(["round_to_0_dp","round_to_2_dp"])};const $n=e=>"string"==typeof e?e:e.endpoint;n(143);const Mn=350,Pn={colors:["#feae4a","#5fbaff","#e15e9d"],detail:"minimal",fontFamily:"Inter, sans-serif",rowLimit:6,fontSize:"0.65rem"},Ln=e=>"displayTitle"in e,Bn=(["barChart","horizontalBarChart","areaChart","lineChart","scatterChart","pieChart","singleStat","dataTable","basicTable","comboChart","mercatorMap","progress","custom"].filter((e=>"custom"!=e)),"dateFilter"),qn="dateAndTimeFilter",Un="singleSelectFilter",Gn="multiSelectFilter",zn="numericFilter",Hn=e=>"fields"in e?(e=>{if("globalSelectFilter"==e.type)return{type:"singleSelectFilter",title:e.title,value:null,requiresValue:!1,managedByConfiguration:!1,appliesToFields:e.fields.map((e=>({fieldId:e.field,dataSetId:e.dataSetId})))};if("globalDateTimeFilter"==e.type)return{type:"dateFilter",value:null,requiresValue:!1,managedByConfiguration:!1,title:e.title,appliesToFields:e.fields.map((e=>({fieldId:e.field,dataSetId:e.dataSetId})))};throw`Unrecognised global filter. ${JSON.stringify(e)}`})(e):Object.assign(Object.assign({},e),{type:Xn(e.type)}),Xn=e=>"dateTimeFilter"===e?Bn:e,Vn=P().object({fieldId:P().string().required(),dataSetId:P().string().required()}),Wn=e=>P().object().pattern(P().string(),P().array().items(H(e)).optional()),Yn=e=>({title:P().string().allow(""),managedByConfiguration:P().boolean().optional(),requiresValue:P().boolean().optional(),optionsFilters:Wn(e).optional(),appliesToFields:P().array().items(Vn).required(),optionsPulledFrom:P().array().items(Vn).optional(),hidden:P().boolean(),options:P().array().items(P().object({value:P().allow(P().number(),P().string()),label:P().string()})).optional()}),Kn=(e,t)=>P().object(Object.assign(Object.assign({},Yn(e)),{type:P().valid(Un).required(),value:P().alternatives(P().string(),P().number(),P().boolean(),P().valid(...t?[]:[null]))})),Zn=(e,t)=>P().object(Object.assign(Object.assign({},Yn(e)),{type:P().valid(Gn).required(),value:P().alternatives(P().array().items(P().string(),P().number()).single(),P().valid(...t?[]:[null]))})),Jn=(e,t,n)=>P().object(Object.assign(Object.assign({},Yn(e)),{type:P().valid(n).required(),value:P().alternatives(P().valid(...t?[]:[null]),P().object({type:P().valid("fixedRange"),before:P().alternatives(P().date()).required(),after:P().alternatives(P().date()).required()}),P().object({type:P().valid("relative"),value:P().string()}))})),Qn=(e,t)=>P().object(Object.assign(Object.assign({},Yn(e)),{type:P().valid(zn).required(),value:P().alternatives(P().object({op:P().allow("=","<",">","<=",">="),value:P().number().allow(null,0)}),P().valid(...t?[]:[null]))})),er=(e,t)=>P().alternatives().conditional(".type",{is:Un,then:Kn(e,t)}).conditional(".type",{is:Bn,then:Jn(e,t,Bn)}).conditional(".type",{is:qn,then:Jn(e,t,qn)}).conditional(".type",{is:Gn,then:Zn(e,t)}).conditional(".type",{is:zn,then:Qn(e,t)});function tr(e){return P().array().items(P().custom(((t,n)=>{if(!e)return n.error("any.invalid");const r=er(e,!!t.requiresValue),{error:i}=r.validate(t);return i?n.error("any.invalid",{message:i.message}):t}))).required()}const nr=(t,n)=>{if("isEmpty"in t||Ln(t))return t;const{load:r}=bn(t.attributes.type,n),i=r(t.attributes);let o=[];return(0,e.isArray)(t.localFilters)&&(o=[...t.localFilters?t.localFilters:[]].map((e=>Hn(e)))),"addOns"in t.attributes&&(0,e.isEmpty)(o)&&t.attributes.addOns.forEach((e=>{o=[...o,{type:"dateFilter"==e.type?"dateFilter":"singleSelectFilter",value:null,requiresValue:!1,managedByConfiguration:!1,appliesToFields:[{fieldId:e.field,dataSetId:i.dataSetId}]}]})),delete t.addOns,delete i.addOns,Object.assign(Object.assign({},t),{localFilters:o,attributes:i,results:[]})},rr=e=>P().alternatives().conditional(".type",{is:"barChart",then:lt(e).schema}).conditional(".type",{is:"mercatorMap",then:Kt(e).schema}).conditional(".type",{is:"horizontalBarChart",then:Mt(e).schema}).conditional(".type",{is:"lineChart",then:ft(e).schema}).conditional(".type",{is:"comboChart",then:xt(e).schema}).conditional(".type",{is:"areaChart",then:qt(e).schema}).conditional(".type",{is:"pieChart",then:mt(e).schema}).conditional(".type",{is:"scatterChart",then:vt(e).schema}).conditional(".type",{is:"singleStat",then:Ht(e).schema}).conditional(".type",{is:"dataTable",then:Tt(e).schema}).conditional(".type",{is:"basicTable",then:Ft(e).schema}).conditional(".type",{is:"progress",then:en(e).schema}),ir=e=>({colSpan:e,isEmpty:!0}),or=t=>{const n=[...t],r=(0,e.sumBy)(n,(e=>e.colSpan));return 12==r||(n[n.length-1].colSpan=n[n.length-1].colSpan+12-r),n},sr=(t,n)=>t.map((t=>((t,n)=>{const r=(e=>"components"in e?e:{components:e,height:Mn})(t),i=(0,e.sumBy)(r.components,(e=>null==e?1:0)),o=12-(0,e.sumBy)(r.components,(e=>null==e?0:e.colSpan)),s=Math.floor(o/i),a=[...r.components].map((e=>null===e?{isEmpty:!0,colSpan:s}:"isEmpty"in e||Ln(e)?e:nr(Object.assign(Object.assign({},e),{colSpan:e.colSpan}),n)));return{components:or(a),height:r.height||Mn}})(t,n)));function ar(e,t){if(!t)throw new Error("Query engine config is required to validate filters");const n=((e,t)=>{const n=[];return e.forEach((e=>{const r=er(t,!!e.requiresValue),{error:i,value:o}=r.validate(e);if(i)throw A(`Invalid global filter configuration: ${i.message}`),i;n.push(o)})),n})(e,t);return n}const lr=P().object({displayTitle:P().string().min(1).required(),colSpan:P().number().valid(12).required()}),cr=P().number().min(1).max(12).required().messages({"number.base":'"colSpan" must be a number',"number.min":'"colSpan" must be at least {#limit}',"number.max":'"colSpan" must be less than or equal to {#limit}',"any.required":'"colSpan" is a required field'}),ur=P().object({isEmpty:P().valid(!0).required(),colSpan:cr}),dr=e=>P().object({attributes:rr({queryEngineConfig:e}),colSpan:cr}),fr=e=>P().object({id:P().string(),display:pr(e),componentLibrary:P().array().required().items(rr({queryEngineConfig:e})),globalFilters:tr(e),customFields:P().object().required()});function pr(e){return P().array().required().items(P().object({height:P().number().required(),components:P().array().required().min(1).items(P().alternatives(ur,dr(e),lr))}))}class hr extends Error{}class mr extends de{constructor(e,t){super(`'Issue with Services in ${t}: '${e}'`),this.name="ServicesValidation"}}class gr{constructor(e){var t,n;if(this.component=void 0,this.localFilters=void 0,this.isEmpty=void 0,null==e?void 0:e.component)this.component=null==e?void 0:e.component,this.colSpan=null!==(t=null==e?void 0:e.colSpan)&&void 0!==t?t:12;else{const t=ir(null!==(n=null==e?void 0:e.colSpan)&&void 0!==n?n:12);this.colSpan=t.colSpan,this.isEmpty=t.isEmpty}(null==e?void 0:e.localFilters)&&(this.localFilters=ar(e.localFilters,io.queryEngineConfig))}set(e){var t;this.component=e.component,this.colSpan=null!==(t=e.colSpan)&&void 0!==t?t:12,this.isEmpty=!e.component||void 0,(null==e?void 0:e.localFilters)&&(this.localFilters=ar(e.localFilters,io.queryEngineConfig))}setColSpan(e){try{!function(e){const{error:t,value:n}=cr.validate(e);if(t)throw new hr(t.message)}(e),this.colSpan=e}catch(e){throw new mr(e,"Cell.setColSpan")}}setComponent(e){this.component=e,this.isEmpty=void 0}emptyCell(e){const t=ir(null!=e?e:12);this.colSpan=t.colSpan,this.isEmpty=t.isEmpty,this.component=void 0}}class yr{constructor(e,t){this.components=[],this.height=Mn,this.components=null!=e?e:[],this.height=null!=t?t:Mn,this.validateTotalColSpan()}addCell(e,t){void 0===t?this.components.push(e):this.components.splice(t,0,e),this.validateTotalColSpan()}setHeight(e){this.height=e}setRow(e){this.components=e,this.validateTotalColSpan()}set(e,t){this.components=e,this.height=null!=t?t:Mn,this.validateTotalColSpan()}validateTotalColSpan(){if(this.components.reduce(((e,t)=>e+t.colSpan),0)>12)throw new Error("Total column span of cells exceeds the allowed limit of 12.")}}const br=(e,t)=>{const n=t?{queryEngineConfig:t}:void 0;if("string"==typeof e.definition)throw new Error("Dashboard is an encrypted string, use the query engine to fetch the dashboard. Please use the queryEngineConfig prop to pass the query engine configuration.");return{id:e.id,parentDashboardId:e.parent_dashboard_id,isPlayground:!1,globalFilters:[...e.definition.globalFilters||[]].map((e=>Hn(e))),componentLibrary:[...e.definition.componentLibrary||[]].map((e=>nr(Object.assign(Object.assign({},e),{colSpan:(null==e?void 0:e.colSpan)||1}),n))),theme:Object.assign(Object.assign({},Pn),e.theme),display:sr(e.definition.display,n),webhookId:e.webhook_id||null,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),metadata:e.metadata||{}}},vr=(e,t,n)=>Object.assign(Object.assign({},e),{dataSets:ke(t,n)}),_r=(e,t)=>e.find((e=>e.id==t))||null;class wr{constructor(e){this.component=void 0;let t={displayTitle:"New Header",colSpan:12};e&&(t=Object.assign(Object.assign({},t),{displayTitle:e}));const n={components:[t],height:null!=52?52:Mn};this.component=[n]}setTitle(e){if(!this.component)throw new Error("Header is undefined");Ln(this.component[0].components[0])&&(this.component[0].components[0].displayTitle=e)}}class Ar{constructor(e,t){this.dashboard=void 0;let n={id:e};(null==t?void 0:t.display)&&(n=Object.assign(Object.assign({},n),{display:xr(null==t?void 0:t.display)})),(null==t?void 0:t.customFields)&&(n=Object.assign(Object.assign({},n),{customFields:t.customFields})),(null==t?void 0:t.library)&&(n=Object.assign(Object.assign({},n),{componentLibrary:Sr(null==t?void 0:t.library)})),this.dashboard=(e=>Object.assign({isPlayground:!1,display:[{components:[ir(8),ir(4)],height:Mn},{components:[ir(4),ir(4),ir(4)],height:Mn}],componentLibrary:[],globalFilters:[],customFields:{}},e))(n)}setDisplay(e){let t=xr(e);if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.display=t}setCustomFields(e){if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.customFields=e}setLibrary(e){if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.componentLibrary=Sr(e)}build(){var e,t;if(!this.dashboard)throw new Error("Dashboard is undefined");return Object.assign(Object.assign({},this.dashboard),{display:null===(e=this.dashboard)||void 0===e?void 0:e.display,componentLibrary:null===(t=this.dashboard)||void 0===t?void 0:t.componentLibrary})}}function xr(e){let t=[];return e.forEach((e=>{var n,r;if(e instanceof yr){const r=null==e?void 0:e.components.map((e=>{var t;return e.component&&!e.isEmpty?{attributes:e.component.attributes,localFilters:null!==(t=e.localFilters)&&void 0!==t?t:[],updatesFromParameters:{},results:[],colSpan:e.colSpan,reports:[]}:(e.isEmpty,{colSpan:e.colSpan,isEmpty:!0})}));t.push({height:null!==(n=e.height)&&void 0!==n?n:Mn,components:r})}e instanceof wr&&(null===(r=e.component)||void 0===r||r.forEach((e=>{t.push({height:e.height,components:e.components})})))})),t}const Sr=e=>{var t;let n=[],r=new Set;return null===(t=null==e?void 0:e.library)||void 0===t||t.forEach((e=>{var t;if(e.component&&e.component.attributes){const{viewId:i}=e.component.attributes;if(r.has(null!=i?i:""))throw new Error(`Duplicate viewId found: ${i}`);r.add(null!=i?i:""),n.push({attributes:e.component.attributes,localFilters:null!==(t=e.localFilters)&&void 0!==t?t:[],updatesFromParameters:{},results:[],colSpan:1,reports:[]})}})),n};function Or(e){const t=P().object({component:P().object().required(),uniqueViewId:P().string().min(1).required().messages({"string.base":"\"uniqueViewId\" should be a type of 'text'","string.empty":'"uniqueViewId" cannot be an empty field',"string.min":'"uniqueViewId" should have a minimum length of {#limit}',"any.required":'"uniqueViewId" maybe undefined or null'})}),{error:n}=t.validate(e);if(n)throw new hr(n.message)}class Er{constructor(e){this.library=void 0,this.library=[],(null==e?void 0:e.components)&&this.addComponents(null==e?void 0:e.components)}addComponent(e,t,n){var r,i;try{Or({component:e,uniqueViewId:t});const o=new gr({component:Cr(e,t),colSpan:1,localFilters:null==n?void 0:n.localFilters});void 0===(null==n?void 0:n.position)?null===(r=this.library)||void 0===r||r.push(o):null===(i=this.library)||void 0===i||i.splice(n.position,0,o)}catch(e){throw new mr(e,"Library.addComponent")}}addComponents(e){try{if(void 0===e)throw new mr("Components are undefined","Library.addComponents");e.forEach((e=>{var t;Or(e);const n=new gr({component:Cr(e.component,e.uniqueViewId),colSpan:1});null===(t=this.library)||void 0===t||t.push(n)}))}catch(e){throw new mr(e,"Library.addComponents")}}}const Cr=(e,t)=>Object.assign(Object.assign({},e),{attributes:Object.assign(Object.assign({},e.attributes),{viewId:t})});const jr=e=>()=>{return t=void 0,n=void 0,i=function*(){const{status:t,body:n}=yield e({path:"/api/v2/parent-dashboards",method:"get"});if(200==t)return n.dashboards.map((e=>({id:e.id,created_at:e.created_at,updated_at:e.updated_at,webhook_id:e.webhook_id})))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i};const Tr=e=>t=>{return n=void 0,r=void 0,o=function*(){const{status:n}=yield e({path:"/api/scheduled-report",method:"post",body:{cronSchedule:t.cronSchedule,dashboardAccessToken:t.dashboardAccessToken,scheduledReportId:t.scheduledReportId}});return 200==n},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};class Ir extends Error{constructor(e){super(e),this.name="FailedToCreateDashboardAccess"}}const Rr=Ir;const Dr=e=>(t,n,r)=>{return i=void 0,o=void 0,a=function*(){const{body:i,status:o}=yield e({path:"/api/v2/auth/dashboards/access",method:"post",body:{dashboardAccessToken:t,dashboardAdminOverrideToken:n},abortSignal:r});if(200==o)return{permissions:i.permissions.map((e=>({dashboardId:e.dashboard_id,scope:e.scope,token:e.token,userReference:e.user_reference})))};throw new Rr("Failed to fetch dashboard access")},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a};class Nr extends Error{constructor(e){super(e),this.name="FailedToGetDashboard"}}const Fr=Nr;const kr=e=>(t,n)=>{return r=void 0,i=void 0,s=function*(){const{body:r,status:i}=yield e({path:"/api/v2/multi-get-dashboard",method:"post",body:{dashboardAccessTokens:t},abortSignal:n});if(200==i)return r;throw new Fr("Failed to get dashboard from POST /api/v2/multi-get-dashboard.")},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s};const $r=e=>t=>{return n=void 0,r=void 0,o=function*(){const{body:n,status:r}=yield e({path:"/api/v2/multi-get-dashboard",method:"post",body:{dashboardAccessTokens:t}});if(200==r)return n;throw new Fr("Failed to get potentially encrypted dashboard from POST /api/v2/multi-get-dashboard.")},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};class Mr extends Error{constructor(e){super(e),this.name="FailedToCreateDashboard"}}const Pr=Mr;class Lr extends Error{constructor(e){super(e),this.name="DashboardQuotaReached"}}const Br=Lr;const qr=e=>t=>{return n=void 0,r=void 0,o=function*(){const{body:n,status:r}=yield e({path:"/api/v2/dashboard",method:"post",body:{dashboardAccessToken:t.dashboardAccessToken,definition:t.definition,meta:t.metadata||t.meta||{},parentDashboardId:t.parentDashboardId,permissions:t.permissions}});if(200==r)return{dashboard:n.dashboard,permissions:n.permissions};if(422==r)throw new Br(`Dashboard quota reached; ${JSON.stringify(n)}`);throw new Pr("Failed to update the dashboard from POST /api/v2/dashboard")},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};class Ur extends Error{constructor(e){super(e),this.name="FailedToUpdateDashboard"}}const Gr=Ur;const zr=e=>t=>{return n=void 0,r=void 0,o=function*(){let n=t.metadata||t.meta||{};const{body:r,status:i}=yield e({path:"/api/v2/dashboard",method:"put",body:Object.assign(Object.assign({},t),{meta:n})});if(200==i)return r;throw new Gr("Failed to update dashboard from PUT /api/v2/dashboard.")},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},Hr=e=>e.map((e=>({name:e.name,description:e.description||"",fields:e.fields.map((e=>{let t=[],n=["none"];return"date_time"==e.dataType?n=[...n,...e.allowedGranularities||[]]:t=[...t,...e.supportedAggregateOptions||[]],{name:e.publicName,description:e.description||"",canBeDimension:e.canBeDimension,canBeMeasure:e.canBeMeasure,availableFunctionsInSelect:t,availableFunctionsInGrouping:n}}))})));class Xr extends Error{constructor(){super("There has been an error with the AI. Please try again."),this.name="AIContainsErrors",Object.setPrototypeOf(this,Xr.prototype)}}const Vr=Xr,Wr=(t,n,r,i)=>{var o,s,a,l;let c=(0,e.cloneDeep)(n);const u=Te(t,r.dataSetName);if(!u)throw"Failed to find data set by name";return"title"in r&&(c.displayTitle=r.title||c.displayTitle),"limit"in c&&"limit"in r&&(c.limit=r.limit),"filter"in c&&"filter"in r&&(c.filter=null===(s=(null===(o=r.filter)||void 0===o?void 0:o.orWhereClauses)||[])||void 0===s?void 0:s.map((({andWhereClauses:e})=>e.map((e=>({field:Re(u,e.field).id,function:e.function,op:e.op,value:e.value})))))),"subtitle"in r&&(c.displaySubject=r.subtitle||c.displaySubject),"measure"in c&&"select"in r&&(c.measure=(r.select||[]).map((e=>({field:Re(u,e.field).id,function:e.function})))),"dimension"in c&&"group"in r&&(c.dimension=(r.group||[]).map((e=>({field:Re(u,e.field).id,function:e.function})))),"goalLines"in c&&"goalLines"in r&&(c.goalLines=null===(a=r.goalLines)||void 0===a?void 0:a.map((e=>({strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,color:e.color,value:e.value})))),"order"in c&&"order"in r&&(c.order=(r.order||[]).map((e=>({field:Re(u,e.field).id,function:e.function,direction:e.direction})))),"conditionalFormattingRules"in c&&"conditionalFormatting"in r&&(c.conditionalFormattingRules=null===(l=r.conditionalFormatting)||void 0===l?void 0:l.map((e=>{const t=Re(u,e.field);return{ruleType:"backgroundColor",ruleValue:e.color,filters:[[{field:t.id,function:e.function,op:e.op,value:e.value}]]}}))),r.type&&n.type!=r.type&&(c=bn(r.type,{queryEngineConfig:i}).init(u.id,Object.assign(Object.assign({},c),{type:r.type}))),((e,t)=>{const n=bn(e.type,{queryEngineConfig:t}),{error:r,value:i}=n.schema.validate(e,{stripUnknown:{arrays:!0,objects:!0},allowUnknown:!1,abortEarly:!1});return r&&w("AI attribute errors",r),i})(c,i)};class Yr extends Error{constructor(e="AI usage limit reached"){super(e),this.name="AIUsageLimitReached",Object.setPrototypeOf(this,Yr.prototype)}}const Kr=Yr;class Zr extends Error{constructor(){super("Something went wrong while fetching data from the AI."),this.name="AIFailedToFetch",Object.setPrototypeOf(this,Zr.prototype)}}const Jr=Zr;class Qr extends Error{constructor(){super("User aborted AI request."),this.name="AIAborted",Object.setPrototypeOf(this,Qr.prototype)}}const ei=Qr,ti=function(e,t){if(200!=e){if(422==e||429==e)throw _("askAi","AI usage limit reached",t),new Kr(`${t.quota} queries per hour allowed.`);if(500===e&&t&&"reason"in t&&"Aborted"===t.reason)throw new ei;throw new Jr}};const ni=t=>(n,r,i,o,s,a,l)=>{return c=void 0,u=void 0,f=function*(){const c=((t,n)=>{var r,i,o;let s=(0,e.cloneDeep)(n);if("custom"===s.type)throw"Custom views are not supported by Vizzly AI.";let a=[],l=[],c=[],u={orWhereClauses:[]},d=[],f=[],p=s.displayTitle,h=s.displaySubject,m=s.limit;return"goalLines"in s&&(d=null===(r=s.goalLines)||void 0===r?void 0:r.map((e=>({value:e.value,color:e.color,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth})))),"conditionalFormattingRules"in s&&Array.isArray(s.conditionalFormattingRules)&&(f=null===(i=s.conditionalFormattingRules)||void 0===i?void 0:i.map((e=>({color:e.ruleValue,field:e.filters[0][0].field,function:e.filters[0][0].function,op:e.filters[0][0].op,value:e.filters[0][0].value})))),"measure"in s&&(a=s.measure.map((e=>({field:Ie(t,e.field).publicName,function:e.function})))),"dimension"in s&&(l=s.dimension.map((e=>({field:Ie(t,e.field).publicName,function:e.function})))),"order"in s&&(c=s.order.map((e=>({field:Ie(t,e.field).publicName,function:e.function,direction:e.direction})))),"filter"in s&&(u={orWhereClauses:null===(o=s.filter||[])||void 0===o?void 0:o.map((e=>({andWhereClauses:e.map((e=>({field:Ie(t,e.field).publicName,function:e.function,op:e.op,value:e.value})))})))}),{title:p,subtitle:h,type:s.type,dataSetName:t.name,select:a,group:l,order:c,goalLines:d,conditionalFormatting:f,filter:u,limit:m}})(je(s,r.dataSetId),r),{body:u,status:d}=yield t({path:"/api/ai",method:"post",body:{question:i,conversationId:n,currentAttributes:c,dataSets:Hr(s),dashboardAccessToken:o},abortSignal:l});ti(d,u);const f=((e,t,n,r)=>{if(!Te(r,e.ai_view.dataSetName))throw w("The AI returned an invalid data set ID. This is likely due to a bug in the AI. Please contact support."),new Vr;return{conversationId:e.conversation_id,attributes:Wr(r,t,e.ai_view,n),messageHistory:e.conversation_content.messages.map((e=>({id:e.id,content:e.content,reaction:e.reaction,sender_type:e.sender_type,sent_at:new Date(e.sent_at),status:e.status})))}})(u,r,a,s);return f},new((d=void 0)||(d=Promise))((function(e,t){function n(e){try{i(f.next(e))}catch(e){t(e)}}function r(e){try{i(f.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof d?i:new d((function(e){e(i)}))).then(n,r)}i((f=f.apply(c,u||[])).next())}));var c,u,d,f};class ri extends Error{constructor(e){super(`Failed to save Vizzly config. Received status code ${e}.`),this.name="FailedToSaveVizzlyConfigVersion"}}var ii;!function(e){e.ConfigStore="cnf_",e.Project="prj_",e.KeyPair="kyp_",e.Dashboard="dsh_",e.ProjectApiKey="vizzly_project_api_key_"}(ii||(ii={}));const oi=e=>(t,n)=>{return r=void 0,i=void 0,s=function*(){const{status:r}=yield e({path:`/api/v3/project/${t}/config`,method:"post",body:{projectId:t,encryptedConfig:n},preFetchProjectAccessTokens:t?{projectId:t,resourceFilters:[ii.Project,ii.ConfigStore]}:void 0});if(200!=r)throw new ri(r);return 200==r},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s};class si extends Error{constructor(e){super(`Failed to setup project by saving an encrypted connection and config on the Vizzly API. Received status code ${e}.`),this.name="VizzlyApiCallErrorFailedToSetupProject",this.statusCode=e}}const ai=e=>(t,n,r)=>{return i=void 0,o=void 0,a=function*(){const{status:i}=yield e({path:"/api/v3/project/connection",method:"post",body:{projectId:t,encryptedConfig:r,encryptedConnection:n},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project]}});if(200!=i)throw new si(i);return 200==i},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a};const li=e=>t=>{return n=void 0,r=void 0,o=function*(){const n=`/api/v3/project/${t}/config`,{status:r,body:i}=yield e({path:n,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.ConfigStore]}});if(200==r)return{encryptedConfig:i.encrypted_config};_("HTTP request to fetch Config returned non-200.",n,r,i)},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const ci=e=>t=>{return n=void 0,r=void 0,o=function*(){const{status:n,body:r}=yield e({path:`/api/v2/project/${t}/connection`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project]}});return 200==n?{status:n,encryptedCredentials:r.encrypted_credentials}:{status:n}},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const ui=e=>t=>{return n=void 0,r=void 0,o=function*(){const{body:n}=yield e({path:`/api/v3/project/${t}/api-key`,method:"post",body:{},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project]}});return n.api_key},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const di=e=>(t,n,r)=>{return i=void 0,o=void 0,a=function*(){const{body:i}=yield e({path:`/api/v3/project/${t}/api-key/${n}`,method:"put",body:Object.assign({},r),preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project,ii.ProjectApiKey]}});return i.api_key},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a};const fi=e=>(t,n)=>{return r=void 0,i=void 0,s=function*(){const{body:r,status:i}=yield e({path:"/api/ai/question-suggestions",method:"post",body:{dataSets:Hr(n),dashboardAccessToken:t}});if(ti(i,r),200==i)return{suggestions:r.suggestions};throw"Failed to fetch question suggestions from AI."},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s};const pi=e=>t=>{return n=void 0,r=void 0,o=function*(){const{status:n,body:r}=yield e({path:`/api/v3/project/${t}`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project]}});return 200==n?r.project:null},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const hi=e=>(t,n,r)=>{return i=void 0,o=void 0,a=function*(){const{status:i,body:o}=yield e({path:`/api/v3/project/${t}/query-engine-user`,method:"post",body:{email:n,password:r},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project]}});return 200==i},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a};const mi=e=>(t,n,r)=>{return i=void 0,o=void 0,a=function*(){const{status:i}=yield e({path:`/api/v3/project/${t}/query-engine-user`,method:"put",body:{query_engine_user_id:n,password:r},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project]}});return 200==i},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a};const gi=e=>(t,n)=>{return r=void 0,i=void 0,s=function*(){const{status:r,body:i}=yield e({path:`/api/v3/project/${t}/query-engine-user?email=${encodeURIComponent(n)}`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project]}});if(200==r)return i.query_engine_user},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s};const yi=e=>t=>{return n=void 0,r=void 0,o=function*(){const{status:n,body:r}=yield e({path:`/api/v3/project/${t}/organisation-team-members`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:["prj_"]}});if(200==n)return r.team_members},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const bi=e=>t=>{return n=void 0,r=void 0,o=function*(){let n={};t&&(n={auth:`Bearer ${t}`});const{body:r,status:i}=yield e({path:"/api/v2/project/self-hosted-query-engine",method:"post",body:{},headers:n});return 200==i?r.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const vi=e=>t=>{return n=void 0,r=void 0,o=function*(){let n={};t&&(n={auth:`Bearer ${t}`});const{body:r,status:i}=yield e({path:"/api/v2/project/self-hosted-dynamic-query-engine",method:"post",body:{},headers:n});return 200==i?r.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const _i=e=>t=>{return n=void 0,r=void 0,o=function*(){let n={};t&&(n={auth:`Bearer ${t}`});const{body:r,status:i}=yield e({path:"/api/v2/project/self-hosted-in-browser",method:"post",body:{},headers:n});return 200==i?r.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o};const wi=e=>(t,n,r)=>{return i=void 0,o=void 0,a=function*(){let i={};r&&(i={auth:`Bearer ${r}`});const{status:o,body:s}=yield e({path:`/api/v2/project/managed-query-engine/${t}/key-pairs/${n}`,method:"get",headers:i});if(200==o)return{privateKey:s.keys.private_key,publicKey:s.keys.public_key}},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a};class Ai extends de{constructor(e){super(`Failed to save an encrypted secret for ${e}`),this.name="FailedToSaveProjectEncryptedEncryptionSecret"}}class xi extends de{constructor(e){super(`An encrypted secret has already been saved for ${e}`),this.name="ProjectEncryptedSecretAlreadySaved"}}const Si=e=>(t,n,r=!1)=>{return i=void 0,o=void 0,a=function*(){const{status:i}=yield e({path:`/api/v3/project/${t}/encrypted-encryption-secret`,method:"post",body:{projectId:t,encryptedEncryptionSecret:n,allowRotation:r},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[ii.Project]}});if(400==i&&r)throw new Ai(t);if(400==i&&!r)throw new xi(t);return 200==i},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a};const Oi=e=>(t,n,r,i)=>{return o=void 0,s=void 0,l=function*(){const o=yield e({path:`/api/ai/conversation/${t}/message/${n}`,method:"post",body:{reaction:i.reaction,dashboardAccessToken:r}});return Ei(o)},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}i((l=l.apply(o,s||[])).next())}));var o,s,a,l},Ei=e=>{if(200===e.status)return{success:!0};throw new Error("AI Action failed")};Error;class Ci extends Error{constructor(e){super(e),this.name="ReadPermissionNotFound"}}const ji=Ci;class Ti extends Error{constructor(e){super(e),this.name="WritePermissionNotFound"}}const Ii=Ti,Ri=(e,t)=>{const n=t.find((t=>t.dashboardId==e&&"read_write"==t.scope));if(!n)throw new Ii(`Cannot find write permission for dashboard ${e}`);return n};function Di(e,t,n,r){return i=this,o=void 0,a=function*(){let i;const o=Object.assign(Object.assign({},e),{dashboardAccessToken:t.dashboardAccess.signature});if("vizzlyApi"===n.strategy)i=yield r.createDashboard(o);else{if("queryEngine"!==n.strategy)throw`Unsupported strategy for creating dashboard ${JSON.stringify(n)}`;{const e=(s=n.endpoint,e=>{return t=void 0,n=void 0,i=function*(){let t=Nn(s);const{body:n,status:r}=yield t({path:"/api/v1/dashboard",method:"post",body:{dashboardAccessToken:e.dashboardAccessToken,definition:e.definition,meta:e.metadata||e.meta||{},parentDashboardId:e.parentDashboardId,permissions:e.permissions}});if(200==r)return{dashboard:n.dashboard,permissions:n.permissions};if(422==r)throw new Br(`Dashboard quota reached; ${JSON.stringify(n)}`);throw new Pr("Failed to update the dashboard from POST /api/v2/dashboard")},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i});i=yield e(o)}}var s;return i},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a}function Ni(e,t,n){return r=this,i=void 0,s=function*(){let r;if("vizzlyApi"===e.strategy)r=yield t.updateDashboard(n);else{if("queryEngine"!==e.strategy)throw`Unsupported strategy for updating dashboard ${JSON.stringify(e)}`;{const t=(i=e.endpoint,e=>{return t=void 0,n=void 0,o=function*(){let t=Nn(i);const{body:n,status:r}=yield t({path:"/api/v1/dashboard",method:"put",body:Object.assign({},e)});if(200==r)return n;throw new Gr("Failed to update dashboard from PUT /api/v1/dashboard.")},new((r=void 0)||(r=Promise))((function(e,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,r,o});r=yield t(n)}}var i;return r},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s}function Fi(e,t,n,r,i){const o=br(e.dashboard,i),s=vr(o,t,e.dashboard.definition.customFields||{});return{newDashboards:[...n].flatMap((e=>e.id==s.id?r.deleted?[]:[s]:[e])),updatedDashboard:s}}function ki(e,t,n,r){return i=this,o=void 0,a=function*(){let i;if("vizzlyApi"==e.strategy)i=yield t.multiGetDashboards(n,r.signal);else{if("queryEngine"!==e.strategy)throw`Unsupported strategy for fetching dashboards ${JSON.stringify(e)}`;{const t=(o=e.endpoint,(e,t)=>{return n=void 0,r=void 0,s=function*(){let n=Nn(o);const{body:r,status:i}=yield n({path:"/api/v1/get-dashboards",method:"post",body:{dashboardAccessTokens:e},abortSignal:t});if(200==i)return r;throw new Fr("Failed to get dashboard from POST /api/v1/get-dashboards")},new((i=void 0)||(i=Promise))((function(e,t){function o(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}l((s=s.apply(n,r||[])).next())}));var n,r,i,s});i=yield t(n,r.signal)}}var o;return i},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a}const $i={strategy:"vizzlyApi"};function Mi(t){return function(e,t){return[...e].map((e=>((e,t)=>{const n=t.find((t=>t.dashboardId==e));if(!n)throw new ji(`Cannot find read permission for dashboard ${e}`);return n})(e,t).token))}((t=>{let n=[...t].map((e=>e.dashboardId));return(0,e.uniq)(n)})(t),t)}function Pi(e){return P().object({id:P().string().required(),display:e?pr(e):P().object().required(),parentDashboardId:P().string().required().allow(null),metadata:P().object(),componentLibrary:P().array().required(),globalFilters:tr(e),createdAt:P().date().required(),updatedAt:P().date().required()})}const Li={convert:!1,stripUnknown:!1,allowUnknown:!0};function Bi(e,t){try{if(!Array.isArray(e))throw new Error("dashboards must be an array");const n=[];for(const r of e){const e=Pi(t).validate(r,Li);e.error?A(`There is an error with Dashboard ${r.id}. It has been removed from the array.`,e.error.message):n.push({id:r.id,parentDashboardId:r.parentDashboardId,globalFilters:r.globalFilters,display:r.display,componentLibrary:r.componentLibrary,createdAt:r.createdAt,updatedAt:r.updatedAt,metadata:r.metadata})}return n}catch(e){throw A(`Error building client-facing dashboards: ${e}`),e}}const qi=(t,n)=>{const r=(0,e.cloneDeep)(n).filter((e=>e.parentDashboardId==t));return(0,e.sortBy)(r,(e=>e.updatedAt)).reverse()};class Ui extends Error{constructor(e){super(e),this.name="FailedToLoadIdentity"}}const Gi=Ui;class zi extends Error{constructor(e){super(e),this.name="InvalidIdentityReturn"}}const Hi=zi,Xi=e=>{const t=(e=>{var t;const n=null===(t=e.split("."))||void 0===t?void 0:t[1];return JSON.parse((r=n,"object"==typeof window&&window&&window.atob?window.atob(r):Buffer.from(r,"base64").toString()).toString());var r})(e);return Object.assign(Object.assign({},t),{signature:e})};const Vi=e=>{return t=void 0,n=void 0,i=function*(){let t=yield e();if(t=(e=>{if(!e)throw new Hi("Failed to load identity.");const{error:t}=P().object({dashboardAccessToken:P().string().required(),dataAccessToken:P().string(),queryEngineAccessToken:P().string(),projectAccessToken:P().string().optional()}).validate(e);if(t)throw new Hi(t.message);return e})(t),!t)throw new Gi("Failed to fetch identity config.");const n=Wi()&&((r=window.location.href).split("#vizzly_")[1]||new URLSearchParams(new URL(r).search).get("_vizzlyDashboardAdmin"))||null;var r;return{identityConfig:((e,t,n,r)=>{let i=Xi(e);"scope"in i||(i.scope="read_write");const o={dashboardAccess:i,dataAccess:t?Xi(t):void 0,queryEngineAccessConfig:n?Xi(n):void 0,dashboardAdminOverride:r?Xi(r):void 0};return(e=>{const t=new Date,n=new Date(e.dashboardAccess.expires),r=!!e.dataAccess&&new Date(e.dataAccess.expires);!1!==r&&r<t&&console.warn("Vizzly data access token expired at;",r),n<t&&console.warn("Vizzly dashboard access token expired at;",n)})(o),o})(t.dashboardAccessToken,t.dataAccessToken,t.queryEngineAccessToken,n),tokens:t}},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i},Wi=()=>"undefined"!=typeof window;class Yi extends Error{constructor(e){super(e),this.name="FailedToResolveDataSets"}}const Ki=Yi;class Zi extends Error{constructor(){super("dataSets property is not valid"),this.name="InvalidDataSetsPropType"}}const Ji=Zi;var Qi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};P().function();const eo=e=>t=>Qi(void 0,void 0,void 0,(function*(){var n,r,i,o,s,a,l;return yield(r=e,i=null===(n=t.dataAccess)||void 0===n?void 0:n.signature,o=void 0,s=void 0,a=void 0,l=function*(){const e=Nn(r),t=yield e({method:"post",body:{dynamicConfig:"object"==typeof r?r.dynamicConfig:void 0,integritySignature:i},mode:"cors",path:"/api/v1/resolve-data-sets",abortSignal:void 0});if(200==t.status)return t.body.dataSets;throw new Ki(`Failed to resolve data sets from ${JSON.stringify(r)}. Received status ${t.status}`)},new(a||(a=Promise))((function(e,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}i((l=l.apply(o,s||[])).next())})))})),to=(e,t)=>(n,r)=>Qi(void 0,void 0,void 0,(function*(){try{let i=((e,t)=>{if(e)return e;if(t)return eo(t);throw new Ji})(e,t);if("function"!=typeof i)throw new Ji;let o=yield i(n,r);if(!o)throw new Ki("Failed to fetch data sets from the query engine endpoint");return o.map((e=>((e,t)=>Object.assign(Object.assign({},e),{fields:[...e.fields].map((e=>((e,t,n)=>{const r=x(e.id);return{id:e.id,dataType:e.dataType,publicName:e.publicName||r,dashboardRequiredFilterGroups:e.dashboardRequiredFilterGroups||[],description:e.description||void 0,canBeDimension:void 0===e.canBeDimension||e.canBeDimension,canBeMeasure:void 0===e.canBeMeasure||e.canBeMeasure,allowedOperators:void 0===e.allowedOperators?s(e,t):e.allowedOperators,allowedGranularities:void 0===e.allowedGranularities?Object.keys(t.supportedTimeTruncFunctions):e.allowedGranularities,supportedAggregateOptions:j(t,e.dataType,e.supportedAggregateOptions)}})(e,t)))}))(e,r)))}catch(e){if(e instanceof Ji)throw e;throw new Ki("Failed to fetch data sets.")}}));var no=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ro{constructor(e,t){var n,r;this.abortController=new AbortController,this.identityTokens=null,this.permissions=null,this.identityConfig=null,this.dashboardStorageStrategy=$i,this.loadDataSetsCallback=void 0,this.dashboards=void 0,this.parentDashboardId=void 0,this.loading=!1,this.parentDashboardId=null==t?void 0:t.parentDashboardId,this.identity=e,this.permissions=[],this.loadDataSetsCallback=to(null==t?void 0:t.dataSets,io.queryEngineEndpoint),this.dashboardStorageStrategy=(n=io.queryEngineEndpoint,r=io.queryEngineConfig,"function"!=typeof n&&n&&r&&r.supportedFeatures.includes("encryptedDashboards")&&"in-browser"!==n?{strategy:"queryEngine",endpoint:n}:$i),this.vizzlyAPI=(e=>{const t=Rn(e);return{config:e,getParentDashboards:jr(t),saveScheduledReport:Tr(t),createDashboardAccess:Dr(t),multiGetDashboards:kr(t),multiGetEncryptedDashboards:$r(t),createDashboard:qr(t),updateDashboard:zr(t),askAi:ni(t),aiActions:Oi(t),askAiForQuestionSuggestions:fi(t),createVizzlyConfigVersion:oi(t),getVizzlyConfig:li(t),saveConnection:ai(t),getConnection:ci(t),createProjectApiKey:ui(t),updateProjectApiKey:di(t),getProjectAccessToken:Tn(t),getProject:pi(t),createQueryEngineUser:hi(t),updateQueryEngineUser:mi(t),getQueryEngineUser:gi(t),getProjectTeamMembers:yi(t),createSelfHostedQueryEngineProject:bi(t),createSelfHostedDynamicQueryEngineProject:vi(t),createSelfHostedInBrowserQueryEngineProject:_i(t),getManagedQueryEngineKeyPair:wi(t),saveEncryptedProjectEncryptionSecret:Si(t)}})((null==t?void 0:t.vizzlyAPIConfig)||{host:"https://api.vizzly.co"})}getDashboards(){var e;return no(this,void 0,void 0,(function*(){this.loading=!0;try{this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),null!==this.permissions&&0!==this.permissions.length||(yield this.setPermissions());const i=Mi(null!==(e=this.permissions)&&void 0!==e?e:[]),o=(t=yield ki(this.dashboardStorageStrategy,this.vizzlyAPI,i,this.abortController),n=[],r=io.queryEngineConfig,(Array.isArray(t.found)?t.found:[]).map((e=>{var t;const i=br(e,r);return vr(i,n,(null===(t=e.definition)||void 0===t?void 0:t.customFields)||{})})));return this.dashboards=o,this.loading=!1,qi(this.getDefaultParentDashboardIdBase(),Bi(o,io.queryEngineConfig))}catch(e){this.loading=!1,A(e)}var t,n,r}))}getAllChildDashboards(){return no(this,void 0,void 0,(function*(){this.loading=!0;try{return yield this.checkPermissionsAndIdentityDefined(),this.loading=!1,t=Bi(this.dashboards,io.queryEngineConfig),(0,e.cloneDeep)(t).filter((e=>null!=e.parentDashboardId))}catch(e){throw this.loading=!1,A(e),e}var t}))}getDataSets(){return no(this,void 0,void 0,(function*(){try{if(yield this.checkPermissionsAndIdentityDefined(),null!==this.identityConfig&&io.queryEngineConfig&&this.loadDataSetsCallback)return yield this.loadDataSetsCallback(this.identityConfig,io.queryEngineConfig)}catch(e){A(e,"Failed to load data sets.")}}))}getParentDashboards(){return no(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkPermissionsAndIdentityDefined();const n=(t=Bi(this.dashboards,io.queryEngineConfig),(0,e.cloneDeep)(t).filter((e=>null==e.parentDashboardId)));return this.loading=!1,n}catch(e){this.loading=!1,A(e)}var t}))}getChildDashboards(e){return no(this,void 0,void 0,(function*(){this.loading=!0;try{return yield this.checkPermissionsAndIdentityDefined(),this.loading=!1,qi(e,Bi(this.dashboards,io.queryEngineConfig))}catch(e){this.loading=!1,A(e)}}))}createDashboard(e){var t,n;return no(this,void 0,void 0,(function*(){((e,t)=>{const n=P().object({definition:t?fr(t):P().object().required(),parentDashboardId:P().string().optional(),metadata:P().object()}).validate(e,Li);if(n.error)throw new hr(n.error.message)})(e,io.queryEngineConfig),this.loading=!0;try{yield this.checkPermissionsAndIdentityDefined();const r=null!==(t=e.parentDashboardId)&&void 0!==t?t:this.parentDashboardId;if(!r)throw"Cannot create a child dashboard from an undefined parent dashboard which does not exist.";const i=_r(this.dashboards||[],r);if(!i)throw"Cannot create a child dashboard from a parent dashboard which does not exist.";if(null!==this.identityConfig){const t=Object.assign(Object.assign({},function(e,t){return{definition:{display:e.definition.display,componentLibrary:e.definition.componentLibrary,isPlayground:!1,globalFilters:[],customFields:{}},meta:e.meta,metadata:e.metadata,parentDashboardId:t.id,permissions:[{scope:"read_write"}]}}(e,i)),{dashboardAccessToken:this.identityConfig.dashboardAccess.signature}),r=yield Di(t,this.identityConfig,this.dashboardStorageStrategy,this.vizzlyAPI);if(r){const{createdDashboard:e,formattedPermissions:t}=function(e,t,n){const r=br(e.dashboard,n);return{createdDashboard:vr(r,[],e.dashboard.definition.customFields||{}),formattedPermissions:e.permissions.map((e=>({dashboardId:e.dashboard_id,scope:e.scope,token:e.token,userReference:e.user_reference})))}}(r,0,io.queryEngineConfig);return null===(n=this.dashboards)||void 0===n||n.push(e),this.permissions=null===this.permissions?[...t]:[...this.permissions,...t],this.loading=!1,e}}}catch(e){this.loading=!1,A(e)}}))}updateDashboard(e,t){return no(this,void 0,void 0,(function*(){(e=>{const t=P().object({metadata:P().object()}).validate(e,Li);if(t.error)throw new hr(t.error.message)})(t),this.loading=!0;try{yield this.checkPermissionsAndIdentityDefined();const n=function(e){return{meta:e.metadata,metadata:e.metadata}}(t),r=Ri(e,this.permissions),i=Object.assign(Object.assign({},n),{dashboardSessionToken:r.token}),o=yield Ni(this.dashboardStorageStrategy,this.vizzlyAPI,i),{newDashboards:s,updatedDashboard:a}=Fi(o,[],this.dashboards||[],n,io.queryEngineConfig);return this.dashboards=s,this.loading=!1,a}catch(e){this.loading=!1,A(e)}}))}deleteDashboard(e){return no(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkPermissionsAndIdentityDefined();const t={},n=Ri(e,this.permissions),r=yield Ni(this.dashboardStorageStrategy,this.vizzlyAPI,{deleted:!0,dashboardSessionToken:n.token}),{newDashboards:i,updatedDashboard:o}=Fi(r,[],this.dashboards||[],t,io.queryEngineConfig);return this.dashboards=i.filter((t=>t.id!==e)),this.loading=!1,o}catch(e){this.loading=!1,A(e)}}))}isAdmin(){var e,t;return no(this,void 0,void 0,(function*(){return this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),(null===(e=this.identityConfig)||void 0===e?void 0:e.dashboardAdminOverride)?"admin":null===(t=this.identityConfig)||void 0===t?void 0:t.dashboardAccess.accessType}))}getDefaultParentDashboardId(){return no(this,void 0,void 0,(function*(){return yield this.checkPermissionsAndIdentityDefined(),this.getDefaultParentDashboardIdBase()}))}checkPermissionsAndIdentityDefined(){return no(this,void 0,void 0,(function*(){io.queryEngineConfig||w("Vizzly.queryEngineConfig has not been loaded. Please call correctly initialize the Vizzly SDK; https://docs.vizzly.co/services/initializing"),this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),null!==this.permissions&&0!==this.permissions.length||(yield this.setPermissions()),void 0===this.dashboards&&(yield this.getDashboards())}))}fetchIdentityConfig(){return no(this,void 0,void 0,(function*(){const{identityConfig:e,tokens:t}=yield Vi(this.identity);return this.identityConfig=e,this.identityTokens=t,{identityConfig:e,tokens:t}}))}setPermissions(){var e,t;return no(this,void 0,void 0,(function*(){try{if(null!==this.identityConfig){const n=yield this.vizzlyAPI.createDashboardAccess(this.identityConfig.dashboardAccess.signature,null===(t=null===(e=this.identityConfig)||void 0===e?void 0:e.dashboardAdminOverride)||void 0===t?void 0:t.signature,this.abortController.signal);return this.permissions=n.permissions,n.permissions}}catch(e){A(e)}}))}getDefaultParentDashboardIdBase(){if(this.identityConfig&&Array.isArray(this.dashboards))return((e,t,n)=>{if(e){const t=_r(n,e);if(null==t?void 0:t.parentDashboardId)throw"[Vizzly] `parentDashboardId` value must specify an ID for a parent dashboard.";return e}const r=(e=>[...e].filter((e=>null==e.parentDashboardId)))(n);return(e=>{const t=e.filter((e=>e.isProgrammatic));if(0!==t.length){if(t.length>1)throw new Error("There should only be one programmatic dashboard");return t[0].id}})(r)||t||(e=>{if(0==e.length)throw"Cannot get first created dashboard from empty list of dashboards.";return[...e].sort(((e,t)=>{var n=new Date(e.createdAt),r=new Date(t.createdAt);return n.getTime()-r.getTime()}))[0]})(r).id})(this.parentDashboardId,this.identityConfig.dashboardAccess.dashboardId,this.dashboards);throw"Cannot get default parent dashboard id without identity config."}getDashboardStorageStrategy(){return this.dashboardStorageStrategy}}class io{static load(e){return t=this,n=void 0,i=function*(){try{return this.queryEngineEndpoint=e,this.queryEngineConfig=yield(t=e,n=void 0,r=void 0,o=function*(){try{if("in-browser"===t)return kn;if("string"==typeof t||"object"==typeof t&&"endpoint"in t){if(!(e=>{let t="string"==typeof e?e:e.endpoint;return!!t.startsWith("http://")||!!t.startsWith("https://")||!!t.startsWith("/")})(t))throw new xn(t);const e=yield Fn(t);if(!e)throw new wn("Failed to load query engine config.");return e}if("function"==typeof t){let e=yield t();if(!e)throw new wn("Failed to load query engine config.");return Object.assign({},e)}throw new On}catch(e){if(e instanceof xn)throw e;if(e instanceof On)throw e;throw new wn("Failed to load query engine config.")}},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}))),this.queryEngineConfig}catch(e){return console.error("Error loading vizzly configuration:",e),null}var t,n,r,i,o},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}static get Dashboard(){return Ar}static get Library(){return Er}static get Cell(){return gr}static get Row(){return yr}static get Header(){return wr}static get API(){return ro}}io.queryEngineConfig=void 0,io.queryEngineEndpoint=void 0,io.AreaChart=class extends vn{constructor(e,t){super("areaChart",e,t)}},io.LineChart=class extends vn{constructor(e,t){super("lineChart",e,t)}},io.BarChart=class extends vn{constructor(e,t){super("barChart",e,t)}},io.PieChart=class extends vn{constructor(e,t){super("pieChart",e,t)}},io.ScatterChart=class extends vn{constructor(e,t){super("scatterChart",e,t)}},io.ComboChart=class extends vn{constructor(e,t){super("comboChart",e,t)}},io.PivotTable=class extends vn{constructor(e,t){super("dataTable",e,t)}},io.BasicTable=class extends vn{constructor(e,t){super("basicTable",e,t)}},io.HorizontalBarChart=class extends vn{constructor(e,t){super("horizontalBarChart",e,t)}},io.MercatorMap=class extends vn{constructor(e,t){super("mercatorMap",e,t)}},io.SingleStat=class extends vn{constructor(e,t){super("singleStat",e,t)}},io.Progress=class extends vn{constructor(e,t){super("progress",e,t)}}})();var i=r.B;export{i as Vizzly};
2
+ var e={4579:e=>{var t;self,t=()=>(()=>{var e={514:(e,t,r)=>{const{clone:n}=r(8870),i=r(8160),o={annotations:Symbol("annotations")};t.error=function(e){if(!this._original||"object"!=typeof this._original)return this.details[0].message;const t=e?"":"",r=e?"":"",s=e?"":"",a=n(this._original);for(let e=this.details.length-1;e>=0;--e){const t=e+1,r=this.details[e],n=r.path;let s=a;for(let e=0;;++e){const a=n[e];if(i.isSchema(s)&&(s=s.clone()),!(e+1<n.length&&"string"!=typeof s[a])){const e=s[o.annotations]||{errors:{},missing:{}};s[o.annotations]=e;const n=a||r.context.key;void 0!==s[a]?(e.errors[n]=e.errors[n]||[],e.errors[n].push(t)):e.missing[n]=t;break}s=s[a]}}let l=o.safeStringify(a,2).replace(/_\$key\$_([, \d]+)_\$end\$_"/g,((e,r)=>`" ${t}[${r}]${s}`)).replace(/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,((e,n,i)=>`${r}"${n}"${s}${t} [${i}]: -- missing --${s}`)).replace(/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,((e,r,n)=>`\n${n} ${t}[${r}]${s}`)).replace(/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g,((e,t)=>t));l=`${l}\n${t}`;for(let e=0;e<this.details.length;++e)l=`${l}\n[${e+1}] ${this.details[e].message}`;return l+=s,l},o.safeStringify=function(e,t){return JSON.stringify(e,o.serializer(),t)},o.serializer=function(){const e=[],t=[],r=(r,n)=>t[0]===n?"[Circular ~]":"[Circular ~."+e.slice(0,t.indexOf(n)).join(".")+"]";return function(n,i){if(t.length>0){const o=t.indexOf(this);~o?(t.length=o+1,e.length=o+1,e[o]=n):(t.push(this),e.push(n)),~t.indexOf(i)&&(i=r.call(this,n,i))}else t.push(i);if(i){const e=i[o.annotations];if(e){if(Array.isArray(i)){const t=[];for(let r=0;r<i.length;++r)e.errors[r]&&t.push(`_$idx$_${e.errors[r].sort().join(", ")}_$end$_`),t.push(i[r]);i=t}else{for(const t in e.errors)i[`${t}_$key$_${e.errors[t].sort().join(", ")}_$end$_`]=i[t],i[t]=void 0;for(const t in e.missing)i[`_$miss$_${t}|${e.missing[t]}_$end$_`]="__missing__"}return i}}return i===1/0||i===-1/0||Number.isNaN(i)||"function"==typeof i||"symbol"==typeof i?"["+i.toString()+"]":i}}},7629:(e,t,r)=>{const{assert:n,clone:i,deepEqual:o,merge:s}=r(8870),a=r(8652),l=r(8160),u=r(3292),c=r(6354),d=r(8901),f=r(1123),p=r(6914),h=r(2294),m=r(6133),g=r(2305),b=r(8863),y=r(2036),v={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new h.Ids,this._preferences=null,this._refs=new m.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return n("function"==typeof f.describe,"Manifest functionality disabled"),f.describe(this)}allow(...e){return l.verifyFlat(e,"allow"),this._values(e,"_valids")}alter(e){n(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),n(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const r in e){const i=e[r];n("function"==typeof i,"Alteration adjuster for",r,"must be a function"),t.$_terms.alterations.push({target:r,adjuster:i})}return t.$_temp.ruleset=!1,t}artifact(e){return n(void 0!==e,"Artifact cannot be undefined"),n(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return n(!1===e||"string"==typeof e,"Invalid to value"),n(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return n(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return n(e,"Missing error"),n(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e,t={}){return n(void 0!==e,"Missing example"),l.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(n(!t,"Cannot combine options with description"),t=e.description,e=e.method),n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(n("string"==typeof e,"id must be a non-empty string"),n(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(...e){return this._values(e,"_invalids")}label(e){return n(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return n(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(...e){n(e.length,"Missing notes");for(const t of e)n(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!0){return n("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){n(e,"Missing preferences"),n(void 0===e.context,"Cannot override context"),n(void 0===e.externals,"Cannot override externals"),n(void 0===e.warnings,"Cannot override warnings"),n(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);const t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return n(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(e=!0){return this.$_setFlag("result",e?"raw":void 0)}result(e){return n(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),r=void 0!==e&&!e;return t._preferences=l.preferences(t._preferences,{convert:r}),t}strip(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){n(e.length,"Missing tags");for(const t of e)n(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return n(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){l.verifyFlat(e,"valid");const t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){const r=this.clone();r.$_terms.whens||(r.$_terms.whens=[]);const i=u.when(r,e,t);if(!["any","link"].includes(r.type)){const e=i.is?[i]:i.switch;for(const t of e)n(!t.then||"any"===t.then.type||t.then.type===r.type,"Cannot combine",r.type,"with",t.then&&t.then.type),n(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===r.type,"Cannot combine",r.type,"with",t.otherwise&&t.otherwise.type)}return r.$_terms.whens.push(i),r.$_mutateRebuild()}cache(e){n(!this._inRuleset(),"Cannot set caching inside a ruleset"),n(!this._cache,"Cannot override schema cache"),n(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||a.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){n(l.isSchema(e),"Invalid schema object"),n("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),n(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),n(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const r=e.clone();for(const e of Object.keys(t))"type"!==e&&(r[e]=t[e]);t=r}t._ids.concat(e._ids),t._refs.register(e,m.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=y.merge(t._valids,e._valids,e._invalids),t._invalids=y.merge(t._invalids,e._invalids,e._valids);for(const r of e._singleRules.keys())t._singleRules.has(r)&&(t._rules=t._rules.filter((e=>e.keep||e.name!==r)),t._singleRules.delete(r));for(const r of e._rules)e._definition.rules[r.method].multi||t._singleRules.set(r.name,r),t._rules.push(r);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const r=Object.assign({},e._flags);delete r.empty,s(t._flags,r)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const r=Object.assign({},e._flags);delete r.empty,s(t._flags,r)}else s(t._flags,e._flags);for(const r in e.$_terms){const n=e.$_terms[r];n?t.$_terms[r]?t.$_terms[r]=t.$_terms[r].concat(n):t.$_terms[r]=n.slice():t.$_terms[r]||(t.$_terms[r]=n)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return n(!e.base,"Cannot extend type with another base"),d.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){n(!this._inRuleset(),"Cannot fork inside a ruleset");let r=this;for(let n of[].concat(e))n=Array.isArray(n)?n:n.split("."),r=r._ids.fork(n,t,r);return r.$_temp.ruleset=!1,r}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),n(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const r=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;n(r>=0&&r<this._rules.length,"Cannot apply rules to empty ruleset");const o=this.clone();for(let s=r;s<o._rules.length;++s){const r=o._rules[s],a=i(r);for(const i in e)t.modifiers[i](a,e[i]),n(a.name===r.name,"Cannot change rule name");o._rules[s]=a,o._singleRules.get(a.name)===r&&o._singleRules.set(a.name,a)}return o.$_temp.ruleset=!1,o.$_mutateRebuild()}get ruleset(){n(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),n(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(const{target:r,adjuster:i}of this.$_terms.alterations)e.includes(r)&&(t=i(t),n(l.isSchema(t),"Alteration adjuster for",r,"failed to return a schema object"));return t=t.$_modify({each:t=>t.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(e,t){return b.entry(e,this,t)}validateAsync(e,t){return b.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),n(e&&"object"==typeof e,"Invalid options"),n(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)n("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const r=this._definition.rules[t.method],i=t.args;n(r,"Unknown rule",t.method);const o=this.clone();if(i){n(1===Object.keys(i).length||Object.keys(i).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in i){let s=i[e];if(r.argsByName){const a=r.argsByName.get(e);if(a.ref&&l.isResolvable(s))t._resolve.push(e),o.$_mutateRegister(s);else if(a.normalize&&(s=a.normalize(s),i[e]=s),a.assert){const t=l.validateArg(s,e,a);n(!t,t,"or reference")}}void 0!==s?i[e]=s:delete i[e]}}return r.multi||(o._ruleRemove(t.name,{clone:!1}),o._singleRules.set(t.name,t)),!1===o.$_temp.ruleset&&(o.$_temp.ruleset=null),r.priority?o._rules.unshift(t):o._rules.push(t),o}$_compile(e,t){return u.schema(this.$_root,e,t)}$_createError(e,t,r,n,i,o={}){const s=!1!==o.flags?this._flags:{},a=o.messages?p.merge(this._definition.messages,o.messages):this._definition.messages;return new c.Report(e,t,r,s,a,n,i)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,r,n){(r=Object.assign({},r)).abortEarly=!0,r._externals=!1,t.snapshot();const i=!b.validate(e,this,t,r,n).errors;return t.restore(),i}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),h.schema(this,e)||this}$_mutateRebuild(){return n(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,{source:t,name:r,path:n,key:i})=>{const o=this._definition[t][r]&&this._definition[t][r].register;!1!==o&&this.$_mutateRegister(e,{family:o,key:i})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:r}={}){this._refs.register(e,t),this._ids.register(e,{key:r})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,r={}){n("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const i=this._definition.flags[e]||{};if(o(t,i.default)&&(t=void 0),o(t,this._flags[e]))return this;const s=!1!==r.clone?this.clone():this;return void 0!==t?(s._flags[e]=t,s.$_mutateRegister(t)):delete s._flags[e],"_"!==e[0]&&(s.$_temp.ruleset=!1),s}$_parent(e,...t){return this[e][l.symbols.parent].call(this,...t)}$_validate(e,t,r){return b.validate(e,this,t,r)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=i(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const r in t){const n=t[r];e.$_terms[r]=n.init}return e.$_mutateRebuild()}_default(e,t,r={}){return l.assertOptions(r,"literal"),n(void 0!==t,"Missing",e,"value"),n("function"==typeof t||!r.literal,"Only function value supports literal option"),"function"==typeof t&&r.literal&&(t={[l.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,r){if(!this.$_terms.whens)return{schema:this};const n=[],i=[];for(let o=0;o<this.$_terms.whens.length;++o){const s=this.$_terms.whens[o];if(s.concat){n.push(s.concat),i.push(`${o}.concat`);continue}const a=s.ref?s.ref.resolve(e,t,r):e,l=s.is?[s]:s.switch,u=i.length;for(let u=0;u<l.length;++u){const{is:c,then:d,otherwise:f}=l[u],p=`${o}${s.switch?"."+u:""}`;if(c.$_match(a,t.nest(c,`${p}.is`),r)){if(d){const o=t.localize([...t.path,`${p}.then`],t.ancestors,t.schemas),{schema:s,id:a}=d._generate(e,o,r);n.push(s),i.push(`${p}.then${a?`(${a})`:""}`);break}}else if(f){const o=t.localize([...t.path,`${p}.otherwise`],t.ancestors,t.schemas),{schema:s,id:a}=f._generate(e,o,r);n.push(s),i.push(`${p}.otherwise${a?`(${a})`:""}`);break}}if(s.break&&i.length>u)break}const o=i.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",o),!o)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[o])return{schema:this.$_temp.whens[o],id:o};let s=this;this._definition.generate&&(s=this._definition.generate(this,e,t,r));for(const e of n)s=s.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(s,[this,...n]),this.$_temp.whens[o]=s,{schema:s,id:o}}_inner(e,t,r={}){n(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const i=this.clone();return i.$_terms[e]&&!r.override||(i.$_terms[e]=[]),r.single?i.$_terms[e].push(t):i.$_terms[e].push(...t),i.$_temp.ruleset=!1,i}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){if(!this._singleRules.has(e))return this;const r=!1!==t.clone?this.clone():this;r._singleRules.delete(e);const n=[];for(let t=0;t<r._rules.length;++t){const i=r._rules[t];i.name!==e||i.keep?n.push(i):r._inRuleset()&&t<r.$_temp.ruleset&&--r.$_temp.ruleset}return r._rules=n,r}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const r=this.clone(),i=e[0]===l.symbols.override;if(i&&(e=e.slice(1)),!r[t]&&e.length?r[t]=new y:i&&(r[t]=e.length?new y:null,r.$_mutateRebuild()),!r[t])return r;i&&r[t].override();for(const i of e){n(void 0!==i,"Cannot call allow/valid/invalid with undefined"),n(i!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";r[e]&&(r[e].remove(i),r[e].length||(n("_valids"===t||!r._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),r[e]=null)),r[t].add(i,r._refs)}return r}}};v.Base.prototype[l.symbols.any]={version:l.version,compile:u.compile,root:"$_root"},v.Base.prototype.isImmutable=!0,v.Base.prototype.deny=v.Base.prototype.invalid,v.Base.prototype.disallow=v.Base.prototype.invalid,v.Base.prototype.equal=v.Base.prototype.valid,v.Base.prototype.exist=v.Base.prototype.required,v.Base.prototype.not=v.Base.prototype.invalid,v.Base.prototype.options=v.Base.prototype.prefs,v.Base.prototype.preferences=v.Base.prototype.prefs,e.exports=new v.Base},8652:(e,t,r)=>{const{assert:n,clone:i}=r(8870),o=r(8160),s={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new s.Cache(e)},s.Cache=class{constructor(e={}){o.assertOptions(e,["max"]),n(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||s.max,this._map=new Map,this._list=new s.List}get length(){return this._map.size}set(e,t){if(null!==e&&!s.supported.has(typeof e))return;let r=this._map.get(e);if(r)return r.value=t,void this._list.first(r);r=this._list.unshift({key:e,value:t}),this._map.set(e,r),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),i(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},s.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:r}=e;return t.prev=r,r&&(r.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},8160:(e,t,r)=>{const{assert:n,AssertError:i}=r(8870),o=r(5934);let s,a;const l={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=o.version,t.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},t.assertOptions=function(e,t,r="Options"){n(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const i=Object.keys(e).filter((e=>!t.includes(e)));n(0===i.length,`${r} contain unknown keys: ${i}`)},t.checkPreferences=function(e){a=a||r(3378);const t=a.preferences.validate(e);if(t.error)throw new i([t.error.details[0].message])},t.compare=function(e,t,r){switch(r){case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}},t.default=function(e,t){return void 0===e?t:e},t.isIsoDate=function(e){return l.isoDate.test(e)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isResolvable=function(e){return!!e&&(e[t.symbols.ref]||e[t.symbols.template])},t.isSchema=function(e,r={}){const i=e&&e[t.symbols.any];return!!i&&(n(r.legacy||i.version===t.version,"Cannot mix different versions of joi schemas"),!0)},t.isValues=function(e){return e[t.symbols.values]},t.limit=function(e){return Number.isSafeInteger(e)&&e>=0},t.preferences=function(e,n){s=s||r(6914),e=e||{},n=n||{};const i=Object.assign({},e,n);return n.errors&&e.errors&&(i.errors=Object.assign({},e.errors,n.errors),i.errors.wrap=Object.assign({},e.errors.wrap,n.errors.wrap)),n.messages&&(i.messages=s.compile(n.messages,e.messages)),delete i[t.symbols.prefs],i},t.tryWithPath=function(e,t,r={}){try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,r.append&&(e.message=`${e.message} (${e.path})`),e}},t.validateArg=function(e,r,{assert:n,message:i}){if(t.isSchema(n)){const t=n.validate(e);if(!t.error)return;return t.error.message}if(!n(e))return r?`${r} ${i}`:i},t.verifyFlat=function(e,t){for(const r of e)n(!Array.isArray(r),"Method no longer accepts array arguments:",t)}},3292:(e,t,r)=>{const{assert:n}=r(8870),i=r(8160),o=r(6133),s={};t.schema=function(e,t,r={}){i.assertOptions(r,["appendPath","override"]);try{return s.schema(e,t,r)}catch(e){throw r.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},s.schema=function(e,t,r){n(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(n(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));const o=(t,...n)=>!1!==r.override?t.valid(e.override,...n):t.valid(...n);if(s.simple(t))return o(e,t);if("function"==typeof t)return e.custom(t);if(n("object"==typeof t,"Invalid schema content:",typeof t),i.isResolvable(t))return o(e,t);if(i.isSchema(t))return t;if(Array.isArray(t)){for(const r of t)if(!s.simple(r))return e.alternatives().try(...t);return o(e,...t)}return t instanceof RegExp?e.string().regex(t):t instanceof Date?o(e.date(),t):(n(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(t))},t.ref=function(e,t){return o.isRef(e)?e:o.create(e,t)},t.compile=function(e,r,o={}){i.assertOptions(o,["legacy"]);const a=r&&r[i.symbols.any];if(a)return n(o.legacy||a.version===i.version,"Cannot mix different versions of joi schemas:",a.version,i.version),r;if("object"!=typeof r||!o.legacy)return t.schema(e,r,{appendPath:!0});const l=s.walk(r);return l?l.compile(l.root,r):t.schema(e,r,{appendPath:!0})},s.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=s.walk(t);if(e)return e}return null}const t=e[i.symbols.any];if(t)return{root:e[t.root],compile:t.compile};n(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const r=s.walk(e[t]);if(r)return r}return null},s.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,r,a){if(void 0===a&&(n(r&&"object"==typeof r,"Missing options"),a=r,r=o.create(".")),Array.isArray(a)&&(a={switch:a}),i.assertOptions(a,["is","not","then","otherwise","switch","break"]),i.isSchema(r))return n(void 0===a.is,'"is" can not be used with a schema condition'),n(void 0===a.not,'"not" can not be used with a schema condition'),n(void 0===a.switch,'"switch" can not be used with a schema condition'),s.condition(e,{is:r,then:a.then,otherwise:a.otherwise,break:a.break});if(n(o.isRef(r)||"string"==typeof r,"Invalid condition:",r),n(void 0===a.not||void 0===a.is,'Cannot combine "is" with "not"'),void 0===a.switch){let l=a;void 0!==a.not&&(l={is:a.not,then:a.otherwise,otherwise:a.then,break:a.break});let u=void 0!==l.is?e.$_compile(l.is):e.$_root.invalid(null,!1,0,"").required();return n(void 0!==l.then||void 0!==l.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),n(void 0===l.break||void 0===l.then||void 0===l.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===a.is||o.isRef(a.is)||i.isSchema(a.is)||(u=u.required()),s.condition(e,{ref:t.ref(r),is:u,then:l.then,otherwise:l.otherwise,break:l.break})}n(Array.isArray(a.switch),'"switch" must be an array'),n(void 0===a.is,'Cannot combine "switch" with "is"'),n(void 0===a.not,'Cannot combine "switch" with "not"'),n(void 0===a.then,'Cannot combine "switch" with "then"');const l={ref:t.ref(r),switch:[],break:a.break};for(let t=0;t<a.switch.length;++t){const r=a.switch[t],s=t===a.switch.length-1;i.assertOptions(r,s?["is","then","otherwise"]:["is","then"]),n(void 0!==r.is,'Switch statement missing "is"'),n(void 0!==r.then,'Switch statement missing "then"');const u={is:e.$_compile(r.is),then:e.$_compile(r.then)};if(o.isRef(r.is)||i.isSchema(r.is)||(u.is=u.is.required()),s){n(void 0===a.otherwise||void 0===r.otherwise,'Cannot specify "otherwise" inside and outside a "switch"');const t=void 0!==a.otherwise?a.otherwise:r.otherwise;void 0!==t&&(n(void 0===l.break,"Cannot specify both otherwise and break"),u.otherwise=e.$_compile(t))}l.switch.push(u)}return l},s.condition=function(e,t){for(const r of["then","otherwise"])void 0===t[r]?delete t[r]:t[r]=e.$_compile(t[r]);return t}},6354:(e,t,r)=>{const n=r(514),i=r(8160),o=r(3328);t.Report=class{constructor(e,r,n,i,o,s,a){if(this.code=e,this.flags=i,this.messages=o,this.path=s.path,this.prefs=a,this.state=s,this.value=r,this.message=null,this.template=null,this.local=n||{},this.local.label=t.label(this.flags,this.state,this.prefs,this.messages),void 0===this.value||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];"object"!=typeof e&&(this.local.key=e)}}_setTemplate(e){if(this.template=e,!this.flags.label&&0===this.path.length){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const e=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return void 0===t?`Error code "${e}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(e,r){return t.template(this.value,e,r||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(const r of e)"object"!=typeof r&&("string"==typeof r?(t&&(t+="."),t+=r):t+=`[${r}]`);return t},t.template=function(e,t,r,n,s){if(!t)return;if(o.isTemplate(t))return"root"!==r?t:null;let a=s.errors.language;if(i.isResolvable(a)&&(a=a.resolve(e,n,s)),a&&t[a]){if(void 0!==t[a][r])return t[a][r];if(void 0!==t[a]["*"])return t[a]["*"]}return t[r]?t[r]:t["*"]},t.label=function(e,r,n,i){if(e.label)return e.label;if(!n.errors.label)return"";let o=r.path;return"key"===n.errors.label&&r.path.length>1&&(o=r.path.slice(-1)),t.path(o)||t.template(null,n.messages,"root",r,n)||i&&t.template(null,i,"root",r,n)||"value"},t.process=function(e,r,n){if(!e)return null;const{override:i,message:o,details:s}=t.details(e);if(i)return i;if(n.errors.stack)return new t.ValidationError(o,s,r);const a=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new t.ValidationError(o,s,r);return Error.stackTraceLimit=a,l},t.details=function(e,t={}){let r=[];const n=[];for(const i of e){if(i instanceof Error){if(!1!==t.override)return{override:i};const e=i.toString();r.push(e),n.push({message:e,type:"override",context:{error:i}});continue}const e=i.toString();r.push(e),n.push({message:e,path:i.path.filter((e=>"object"!=typeof e)),type:i.code,context:i.local})}return r.length>1&&(r=[...new Set(r)]),{message:r.join(". "),details:n}},t.ValidationError=class extends Error{constructor(e,t,r){super(e),this._original=r,this.details=t}static isError(e){return e instanceof t.ValidationError}},t.ValidationError.prototype.isJoi=!0,t.ValidationError.prototype.name="ValidationError",t.ValidationError.prototype.annotate=n.error},8901:(e,t,r)=>{const{assert:n,clone:i}=r(8870),o=r(8160),s=r(6914),a={};t.type=function(e,t){const r=Object.getPrototypeOf(e),l=i(r),u=e._assign(Object.create(l)),c=Object.assign({},t);delete c.base,l._definition=c;const d=r._definition||{};c.messages=s.merge(d.messages,c.messages),c.properties=Object.assign({},d.properties,c.properties),u.type=c.type,c.flags=Object.assign({},d.flags,c.flags);const f=Object.assign({},d.terms);if(c.terms)for(const e in c.terms){const t=c.terms[e];n(void 0===u.$_terms[e],"Invalid term override for",c.type,e),u.$_terms[e]=t.init,f[e]=t}c.terms=f,c.args||(c.args=d.args),c.prepare=a.prepare(c.prepare,d.prepare),c.coerce&&("function"==typeof c.coerce&&(c.coerce={method:c.coerce}),c.coerce.from&&!Array.isArray(c.coerce.from)&&(c.coerce={method:c.coerce.method,from:[].concat(c.coerce.from)})),c.coerce=a.coerce(c.coerce,d.coerce),c.validate=a.validate(c.validate,d.validate);const p=Object.assign({},d.rules);if(c.rules)for(const e in c.rules){const t=c.rules[e];n("object"==typeof t,"Invalid rule definition for",c.type,e);let r=t.method;if(void 0===r&&(r=function(){return this.$_addRule(e)}),r&&(n(!l[e],"Rule conflict in",c.type,e),l[e]=r),n(!p[e],"Rule conflict in",c.type,e),p[e]=t,t.alias){const e=[].concat(t.alias);for(const r of e)l[r]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map((e=>("string"==typeof e&&(e={name:e}),n(!t.argsByName.has(e.name),"Duplicated argument name",e.name),o.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e))))}c.rules=p;const h=Object.assign({},d.modifiers);if(c.modifiers)for(const e in c.modifiers){n(!l[e],"Rule conflict in",c.type,e);const t=c.modifiers[e];n("function"==typeof t,"Invalid modifier definition for",c.type,e);const r=function(t){return this.rule({[e]:t})};l[e]=r,h[e]=t}if(c.modifiers=h,c.overrides){l._super=r,u.$_super={};for(const e in c.overrides)n(r[e],"Cannot override missing",e),c.overrides[e][o.symbols.parent]=r[e],u.$_super[e]=r[e].bind(u);Object.assign(l,c.overrides)}c.cast=Object.assign({},d.cast,c.cast);const m=Object.assign({},d.manifest,c.manifest);return m.build=a.build(c.manifest&&c.manifest.build,d.manifest&&d.manifest.build),c.manifest=m,c.rebuild=a.rebuild(c.rebuild,d.rebuild),u},a.build=function(e,t){return e&&t?function(r,n){return t(e(r,n),n)}:e||t},a.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(r,n){let i;if((!t.from||t.from.includes(typeof r))&&(i=t.method(r,n),i)){if(i.errors||void 0===i.value)return i;r=i.value}if(!e.from||e.from.includes(typeof r)){const t=e.method(r,n);if(t)return t}return i}}:e||t},a.prepare=function(e,t){return e&&t?function(r,n){const i=e(r,n);if(i){if(i.errors||void 0===i.value)return i;r=i.value}return t(r,n)||i}:e||t},a.rebuild=function(e,t){return e&&t?function(r){t(r),e(r)}:e||t},a.validate=function(e,t){return e&&t?function(r,n){const i=t(r,n);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;r=i.value}return e(r,n)||i}:e||t}},5107:(e,t,r)=>{const{assert:n,clone:i}=r(8870),o=r(8652),s=r(8160),a=r(3292),l=r(6354),u=r(8901),c=r(1123),d=r(6133),f=r(3328),p=r(2305);let h;const m={types:{alternatives:r(4946),any:r(8068),array:r(546),boolean:r(4937),date:r(7500),function:r(390),link:r(8785),number:r(3832),object:r(8966),string:r(7417),symbol:r(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const e={_types:new Set(Object.keys(m.types))};for(const t of e._types)e[t]=function(...e){return n(!e.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments"),m.generate(this,m.types[t],e)};for(const t of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])e[t]=function(...e){return this.any()[t](...e)};Object.assign(e,m.methods);for(const t in m.aliases){const r=m.aliases[t];e[t]=e[r]}return e.x=e.expression,p.setup&&p.setup(e),e}};m.methods={ValidationError:l.ValidationError,version:s.version,cache:o.provider,assert(e,t,...r){m.assert(e,t,!0,r)},attempt:(e,t,...r)=>m.assert(e,t,!1,r),build(e){return n("function"==typeof c.build,"Manifest functionality disabled"),c.build(this,e)},checkPreferences(e){s.checkPreferences(e)},compile(e,t){return a.compile(this,e,t)},defaults(e){n("function"==typeof e,"modifier must be a function");const t=Object.assign({},this);for(const r of t._types){const i=e(t[r]());n(s.isSchema(i),"modifier must return a valid schema object"),t[r]=function(...e){return m.generate(this,i,e)}}return t},expression:(...e)=>new f(...e),extend(...e){s.verifyFlat(e,"extend"),h=h||r(3378),n(e.length,"You need to provide at least one extension"),this.assert(e,h.extensions);const t=Object.assign({},this);t._types=new Set(t._types);for(let r of e){"function"==typeof r&&(r=r(t)),this.assert(r,h.extension);const e=m.expandExtension(r,t);for(const r of e){n(void 0===t[r.type]||t._types.has(r.type),"Cannot override name",r.type);const e=r.base||this.any(),i=u.type(e,r);t._types.add(r.type),t[r.type]=function(...e){return m.generate(this,i,e)}}}return t},isError:l.ValidationError.isError,isExpression:f.isTemplate,isRef:d.isRef,isSchema:s.isSchema,in:(...e)=>d.in(...e),override:s.symbols.override,ref:(...e)=>d.create(...e),types(){const e={};for(const t of this._types)e[t]=this[t]();for(const t in m.aliases)e[t]=this[t]();return e}},m.assert=function(e,t,r,n){const o=n[0]instanceof Error||"string"==typeof n[0]?n[0]:null,a=null!==o?n[1]:n[0],u=t.validate(e,s.preferences({errors:{stack:!0}},a||{}));let c=u.error;if(!c)return u.value;if(o instanceof Error)throw o;const d=r&&"function"==typeof c.annotate?c.annotate():c.message;throw c instanceof l.ValidationError==0&&(c=i(c)),c.message=o?`${o} ${d}`:d,c},m.generate=function(e,t,r){return n(e,"Must be invoked on a Joi instance."),t.$_root=e,t._definition.args&&r.length?t._definition.args(t,...r):t},m.expandExtension=function(e,t){if("string"==typeof e.type)return[e];const r=[];for(const n of t._types)if(e.type.test(n)){const i=Object.assign({},e);i.type=n,i.base=t[n](),r.push(i)}return r},e.exports=m.root()},1123:(e,t,r)=>{const{assert:n,clone:i}=r(8870),o=r(8160),s=r(6914),a=r(6133),l=r(3328);let u;const c={};t.describe=function(e){const t=e._definition,r={type:e.type,flags:{},rules:[]};for(const t in e._flags)"_"!==t[0]&&(r.flags[t]=c.describe(e._flags[t]));Object.keys(r.flags).length||delete r.flags,e._preferences&&(r.preferences=i(e._preferences,{shallow:["messages"]}),delete r.preferences[o.symbols.prefs],r.preferences.messages&&(r.preferences.messages=s.decompile(r.preferences.messages))),e._valids&&(r.allow=e._valids.describe()),e._invalids&&(r.invalid=e._invalids.describe());for(const n of e._rules){if(!1===t.rules[n.name].manifest)continue;const e={name:n.name};for(const r in t.modifiers)void 0!==n[r]&&(e[r]=c.describe(n[r]));if(n.args){e.args={};for(const t in n.args){const r=n.args[t];("options"!==t||Object.keys(r).length)&&(e.args[t]=c.describe(r,{assign:t}))}Object.keys(e.args).length||delete e.args}r.rules.push(e)}r.rules.length||delete r.rules;for(const i in e.$_terms){if("_"===i[0])continue;n(!r[i],"Cannot describe schema due to internal name conflict with",i);const s=e.$_terms[i];if(!s)continue;if(s instanceof Map){s.size&&(r[i]=[...s.entries()]);continue}if(o.isValues(s)){r[i]=s.describe();continue}n(t.terms[i],"Term",i,"missing configuration");const a=t.terms[i].manifest,l="object"==typeof a;if(!s.length&&!l)continue;const u=[];for(const e of s)u.push(c.describe(e));if(l){const{from:e,to:t}=a.mapped;r[i]={};for(const n of u)r[i][n[t]]=n[e]}else"single"!==a?r[i]=u:(n(1===u.length,"Term",i,"contains more than one item"),r[i]=u[0])}return c.validate(e.$_root,r),r},c.describe=function(e,t={}){if(Array.isArray(e))return e.map(c.describe);if(e===o.symbols.deepDefault)return{special:"deep"};if("object"!=typeof e||null===e)return e;if("options"===t.assign)return i(e);if(e instanceof Date)return e.toISOString();if(e instanceof Error)return e;if(e instanceof RegExp)return"regex"===t.assign?e.toString():{regex:e.toString()};if(e[o.symbols.literal])return{function:e.literal};if("function"==typeof e.describe)return"ref"===t.assign?e.describe().ref:e.describe();const r={};for(const t in e){const n=e[t];void 0!==n&&(r[t]=c.describe(n,{assign:t}))}return r},t.build=function(e,t){return new c.Builder(e).parse(t)},c.Builder=class{constructor(e){this.joi=e}parse(e){c.validate(this.joi,e);let t=this.joi[e.type]()._bare();const r=t._definition;if(e.flags)for(const i in e.flags){const o=r.flags[i]&&r.flags[i].setter||i;n("function"==typeof t[o],"Invalid flag",i,"for type",e.type),t=t[o](this.build(e.flags[i]))}if(e.preferences&&(t=t.preferences(this.build(e.preferences))),e.allow&&(t=t.allow(...this.build(e.allow))),e.invalid&&(t=t.invalid(...this.build(e.invalid))),e.rules)for(const i of e.rules){n("function"==typeof t[i.name],"Invalid rule",i.name,"for type",e.type);const o=[];if(i.args){const t={};for(const e in i.args)t[e]=this.build(i.args[e],{assign:e});const s=Object.keys(t),a=r.rules[i.name].args;if(a){n(s.length<=a.length,"Invalid number of arguments for",e.type,i.name,"(expected up to",a.length,", found",s.length,")");for(const{name:e}of a)o.push(t[e])}else n(1===s.length,"Invalid number of arguments for",e.type,i.name,"(expected up to 1, found",s.length,")"),o.push(t[s[0]])}t=t[i.name](...o);const s={};for(const e in r.modifiers)void 0!==i[e]&&(s[e]=this.build(i[e]));Object.keys(s).length&&(t=t.rule(s))}const i={};for(const t in e){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(t))continue;n(r.terms[t],"Term",t,"missing configuration");const o=r.terms[t].manifest;if("schema"!==o)if("values"!==o)if("single"!==o)if("object"!=typeof o)i[t]=this.build(e[t]);else{i[t]={};for(const r in e[t]){const n=e[t][r];i[t][r]=this.parse(n)}}else i[t]=this.build(e[t]);else i[t]=e[t].map((e=>this.build(e)));else i[t]=e[t].map((e=>this.parse(e)))}return e.whens&&(i.whens=e.whens.map((e=>this.build(e)))),t=r.manifest.build(t,i),t.$_temp.ruleset=!1,t}build(e,t={}){if(null===e)return null;if(Array.isArray(e))return e.map((e=>this.build(e)));if(e instanceof Error)return e;if("options"===t.assign)return i(e);if("regex"===t.assign)return c.regex(e);if("ref"===t.assign)return a.build(e);if("object"!=typeof e)return e;if(1===Object.keys(e).length){if(e.buffer)return n(!1,"Buffers are not supported"),!1;if(e.function)return{[o.symbols.literal]:!0,literal:e.function};if(e.override)return o.symbols.override;if(e.ref)return a.build(e.ref);if(e.regex)return c.regex(e.regex);if(e.special)return n(["deep"].includes(e.special),"Unknown special value",e.special),o.symbols.deepDefault;if(e.value)return i(e.value)}if(e.type)return this.parse(e);if(e.template)return l.build(e);const r={};for(const t in e)r[t]=this.build(e[t],{assign:t});return r}},c.regex=function(e){const t=e.lastIndexOf("/"),r=e.slice(1,t),n=e.slice(t+1);return new RegExp(r,n)},c.validate=function(e,t){u=u||r(3378),e.assert(t,u.description)}},6914:(e,t,r)=>{const{assert:n,clone:i}=r(8870),o=r(3328);t.compile=function(e,t){if("string"==typeof e)return n(!t,"Cannot set single message string"),new o(e);if(o.isTemplate(e))return n(!t,"Cannot set single message template"),e;n("object"==typeof e&&!Array.isArray(e),"Invalid message options"),t=t?i(t):{};for(let r in e){const i=e[r];if("root"===r||o.isTemplate(i)){t[r]=i;continue}if("string"==typeof i){t[r]=new o(i);continue}n("object"==typeof i&&!Array.isArray(i),"Invalid message for",r);const s=r;for(r in t[s]=t[s]||{},i){const e=i[r];"root"===r||o.isTemplate(e)?t[s][r]=e:(n("string"==typeof e,"Invalid message for",r,"in",s),t[s][r]=new o(e))}}return t},t.decompile=function(e){const t={};for(let r in e){const n=e[r];if("root"===r){t.root=n;continue}if(o.isTemplate(n)){t[r]=n.describe({compact:!0});continue}const i=r;for(r in t[i]={},n){const e=n[r];"root"!==r?t[i][r]=e.describe({compact:!0}):t[i].root=e}}return t},t.merge=function(e,r){if(!e)return t.compile(r);if(!r)return e;if("string"==typeof r)return new o(r);if(o.isTemplate(r))return r;const s=i(e);for(let e in r){const t=r[e];if("root"===e||o.isTemplate(t)){s[e]=t;continue}if("string"==typeof t){s[e]=new o(t);continue}n("object"==typeof t&&!Array.isArray(t),"Invalid message for",e);const i=e;for(e in s[i]=s[i]||{},t){const r=t[e];"root"===e||o.isTemplate(r)?s[i][e]=r:(n("string"==typeof r,"Invalid message for",e,"in",i),s[i][e]=new o(r))}}return s}},2294:(e,t,r)=>{const{assert:n}=r(8870),i=r(8160),o=r(6133),s={};t.Ids=s.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new s.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,r]of e._byId.entries())n(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,r);for(const[t,r]of e._byKey.entries())n(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,r)}fork(e,t,r){const o=this._collect(e);o.push({schema:r});const a=o.shift();let l={id:a.id,schema:t(a.schema)};n(i.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of o)l={id:e.id,schema:s.fork(e.schema,l.id,l.schema)};return l.schema}labels(e,t=[]){const r=e[0],n=this._get(r);if(!n)return[...t,...e].join(".");const i=e.slice(1);return t=[...t,n.schema._flags.label||r],i.length?n.schema._ids.labels(i,t):t.join(".")}reach(e,t=[]){const r=e[0],i=this._get(r);n(i,"Schema does not contain path",[...t,...e].join("."));const o=e.slice(1);return o.length?i.schema._ids.reach(o,[...t,r]):i.schema}register(e,{key:t}={}){if(!e||!i.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const r=e._flags.id;if(r){const t=this._byId.get(r);n(!t||t.schema===e,"Cannot add different schemas with the same id:",r),n(!this._byKey.has(r),"Schema id conflicts with existing key:",r),this._byId.set(r,{schema:e,id:r})}t&&(n(!this._byKey.has(t),"Schema already contains key:",t),n(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,t=[],r=[]){const i=e[0],o=this._get(i);n(o,"Schema does not contain path",[...t,...e].join(".")),r=[o,...r];const s=e.slice(1);return s.length?o.schema._ids._collect(s,[...t,i],r):r}_get(e){return this._byId.get(e)||this._byKey.get(e)}},s.fork=function(e,r,n){const i=t.schema(e,{each:(e,{key:t})=>{if(r===(e._flags.id||t))return n},ref:!1});return i?i.$_mutateRebuild():e},t.schema=function(e,t){let r;for(const n in e._flags){if("_"===n[0])continue;const i=s.scan(e._flags[n],{source:"flags",name:n},t);void 0!==i&&(r=r||e.clone(),r._flags[n]=i)}for(let n=0;n<e._rules.length;++n){const i=e._rules[n],o=s.scan(i.args,{source:"rules",name:i.name},t);if(void 0!==o){r=r||e.clone();const t=Object.assign({},i);t.args=o,r._rules[n]=t,r._singleRules.get(i.name)===i&&r._singleRules.set(i.name,t)}}for(const n in e.$_terms){if("_"===n[0])continue;const i=s.scan(e.$_terms[n],{source:"terms",name:n},t);void 0!==i&&(r=r||e.clone(),r.$_terms[n]=i)}return r},s.scan=function(e,t,r,n,a){const l=n||[];if(null===e||"object"!=typeof e)return;let u;if(Array.isArray(e)){for(let n=0;n<e.length;++n){const i="terms"===t.source&&"keys"===t.name&&e[n].key,o=s.scan(e[n],t,r,[n,...l],i);void 0!==o&&(u=u||e.slice(),u[n]=o)}return u}if(!1!==r.schema&&i.isSchema(e)||!1!==r.ref&&o.isRef(e)){const n=r.each(e,{...t,path:l,key:a});if(n===e)return;return n}for(const n in e){if("_"===n[0])continue;const i=s.scan(e[n],t,r,[n,...l],a);void 0!==i&&(u=u||Object.assign({},e),u[n]=i)}return u}},6133:(e,t,r)=>{const{assert:n,clone:i,reach:o}=r(8870),s=r(8160);let a;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e,t={}){n("string"==typeof e,"Invalid reference key:",e),s.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),n(!t.prefix||"object"==typeof t.prefix,"options.prefix must be of type object");const r=Object.assign({},l.defaults,t);delete r.prefix;const i=r.separator,o=l.context(e,i,t.prefix);if(r.type=o.type,e=o.key,"value"===r.type)if(o.root&&(n(!i||e[0]!==i,"Cannot specify relative path with root prefix"),r.ancestor="root",e||(e=null)),i&&i===e)e=null,r.ancestor=0;else if(void 0!==r.ancestor)n(!i||!e||e[0]!==i,"Cannot combine prefix with ancestor option");else{const[t,n]=l.ancestor(e,i);n&&""===(e=e.slice(n))&&(e=null),r.ancestor=t}return r.path=i?null===e?[]:e.split(i):[e],new l.Ref(r)},t.in=function(e,r={}){return t.create(e,{...r,in:!0})},t.isRef=function(e){return!!e&&!!e[s.symbols.ref]},l.Ref=class{constructor(e){n("object"==typeof e,"Invalid reference construction"),s.assertOptions(e,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),n([!1,void 0].includes(e.separator)||"string"==typeof e.separator&&1===e.separator.length,"Invalid separator"),n(!e.adjust||"function"==typeof e.adjust,"options.adjust must be a function"),n(!e.map||Array.isArray(e.map),"options.map must be an array"),n(!e.map||!e.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,e),n("value"===this.type||void 0===this.ancestor,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(e,t,r,i,o={}){return n(!this.in||o.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(r.context,t,o):"local"===this.type?this._resolve(i,t,o):this.ancestor?"root"===this.ancestor?this._resolve(t.ancestors[t.ancestors.length-1],t,o):(n(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,o)):this._resolve(e,t,o)}_resolve(e,t,r){let n;if("value"===this.type&&t.mainstay.shadow&&!1!==r.shadow&&(n=t.mainstay.shadow.get(this.absolute(t))),void 0===n&&(n=o(e,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(n=this.adjust(n)),this.map){const e=this.map.get(n);void 0!==e&&(n=e)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,n),n}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const e={path:this.path};"value"!==this.type&&(e.type=this.type),"."!==this.separator&&(e.separator=this.separator),"value"===this.type&&1!==this.ancestor&&(e.ancestor=this.ancestor),this.map&&(e.map=[...this.map]);for(const t of["adjust","iterables","render"])null!==this[t]&&void 0!==this[t]&&(e[t]=this[t]);return!1!==this.in&&(e.in=!0),{ref:e}}updateDisplay(){const e=null!==this.key?this.key:"";if("value"!==this.type)return void(this.display=`ref:${this.type}:${e}`);if(!this.separator)return void(this.display=`ref:${e}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${e}`);if("root"===this.ancestor)return void(this.display=`ref:root:${e}`);if(1===this.ancestor)return void(this.display=`ref:${e||".."}`);const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}},l.Ref.prototype[s.symbols.ref]=!0,t.build=function(e){return"value"===(e=Object.assign({},l.defaults,e)).type&&void 0===e.ancestor&&(e.ancestor=1),new l.Ref(e)},l.context=function(e,t,r={}){if(e=e.trim(),r){const n=void 0===r.global?"$":r.global;if(n!==t&&e.startsWith(n))return{key:e.slice(n.length),type:"global"};const i=void 0===r.local?"#":r.local;if(i!==t&&e.startsWith(i))return{key:e.slice(i.length),type:"local"};const o=void 0===r.root?"/":r.root;if(o!==t&&e.startsWith(o))return{key:e.slice(o.length),type:"value",root:!0}}return{key:e,type:"value"}},l.ancestor=function(e,t){if(!t)return[1,0];if(e[0]!==t)return[1,0];if(e[1]!==t)return[0,1];let r=2;for(;e[r]===t;)++r;return[r-1,r]},t.toSibling=0,t.toParent=1,t.Manager=class{constructor(){this.refs=[]}register(e,n){if(e)if(n=void 0===n?t.toParent:n,Array.isArray(e))for(const t of e)this.register(t,n);else if(s.isSchema(e))for(const t of e._refs.refs)t.ancestor-n>=0&&this.refs.push({ancestor:t.ancestor-n,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-n>=0&&this.refs.push({ancestor:e.ancestor-n,root:e.root}),a=a||r(3328),a.isTemplate(e)&&this.register(e.refs(),n)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=i(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter((e=>!e.ancestor)).map((e=>e.root))}}},3378:(e,t,r)=>{const n=r(5107),i={};i.wrap=n.string().min(1).max(2).allow(!1),t.preferences=n.object({allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),context:n.object(),convert:n.boolean(),dateFormat:n.valid("date","iso","string","time","utc"),debug:n.boolean(),errors:{escapeHtml:n.boolean(),label:n.valid("path","key",!1),language:[n.string(),n.object().ref()],render:n.boolean(),stack:n.boolean(),wrap:{label:i.wrap,array:i.wrap,string:i.wrap}},externals:n.boolean(),messages:n.object(),noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:n.valid("required","optional","forbidden"),skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()}).strict(),i.nameRx=/^[a-zA-Z0-9]\w*$/,i.rule=n.object({alias:n.array().items(n.string().pattern(i.nameRx)).single(),args:n.array().items(n.string(),n.object({name:n.string().pattern(i.nameRx).required(),ref:n.boolean(),assert:n.alternatives([n.function(),n.object().schema()]).conditional("ref",{is:!0,then:n.required()}),normalize:n.function(),message:n.string().when("assert",{is:n.function(),then:n.required()})})),convert:n.boolean(),manifest:n.boolean(),method:n.function().allow(!1),multi:n.boolean(),validate:n.function()}),t.extension=n.object({type:n.alternatives([n.string(),n.object().regex()]).required(),args:n.function(),cast:n.object().pattern(i.nameRx,n.object({from:n.function().maxArity(1).required(),to:n.function().minArity(1).maxArity(2).required()})),base:n.object().schema().when("type",{is:n.object().regex(),then:n.forbidden()}),coerce:[n.function().maxArity(3),n.object({method:n.function().maxArity(3).required(),from:n.array().items(n.string()).single()})],flags:n.object().pattern(i.nameRx,n.object({setter:n.string(),default:n.any()})),manifest:{build:n.function().arity(2)},messages:[n.object(),n.string()],modifiers:n.object().pattern(i.nameRx,n.function().minArity(1).maxArity(2)),overrides:n.object().pattern(i.nameRx,n.function()),prepare:n.function().maxArity(3),rebuild:n.function().arity(1),rules:n.object().pattern(i.nameRx,i.rule),terms:n.object().pattern(i.nameRx,n.object({init:n.array().allow(null).required(),manifest:n.object().pattern(/.+/,[n.valid("schema","single"),n.object({mapped:n.object({from:n.string().required(),to:n.string().required()}).required()})])})),validate:n.function().maxArity(3)}).strict(),t.extensions=n.array().items(n.object(),n.function().arity(1)).strict(),i.desc={buffer:n.object({buffer:n.string()}),func:n.object({function:n.function().required(),options:{literal:!0}}),override:n.object({override:!0}),ref:n.object({ref:n.object({type:n.valid("value","global","local"),path:n.array().required(),separator:n.string().length(1).allow(!1),ancestor:n.number().min(0).integer().allow("root"),map:n.array().items(n.array().length(2)).min(1),adjust:n.function(),iterables:n.boolean(),in:n.boolean(),render:n.boolean()}).required()}),regex:n.object({regex:n.string().min(3)}),special:n.object({special:n.valid("deep").required()}),template:n.object({template:n.string().required(),options:n.object()}),value:n.object({value:n.alternatives([n.object(),n.array()]).required()})},i.desc.entity=n.alternatives([n.array().items(n.link("...")),n.boolean(),n.function(),n.number(),n.string(),i.desc.buffer,i.desc.func,i.desc.ref,i.desc.regex,i.desc.special,i.desc.template,i.desc.value,n.link("/")]),i.desc.values=n.array().items(null,n.boolean(),n.function(),n.number().allow(1/0,-1/0),n.string().allow(""),n.symbol(),i.desc.buffer,i.desc.func,i.desc.override,i.desc.ref,i.desc.regex,i.desc.template,i.desc.value),i.desc.messages=n.object().pattern(/.+/,[n.string(),i.desc.template,n.object().pattern(/.+/,[n.string(),i.desc.template])]),t.description=n.object({type:n.string().required(),flags:n.object({cast:n.string(),default:n.any(),description:n.string(),empty:n.link("/"),failover:i.desc.entity,id:n.string(),label:n.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:n.boolean(),unit:n.string()}).unknown(),preferences:{allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),convert:n.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:n.boolean(),label:["path","key"],language:[n.string(),i.desc.ref],wrap:{label:i.wrap,array:i.wrap}},externals:n.boolean(),messages:i.desc.messages,noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:["required","optional","forbidden"],skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()},allow:i.desc.values,invalid:i.desc.values,rules:n.array().min(1).items({name:n.string().required(),args:n.object().min(1),keep:n.boolean(),message:[n.string(),i.desc.messages],warn:n.boolean()}),keys:n.object().pattern(/.*/,n.link("/")),link:i.desc.ref}).pattern(/^[a-z]\w*$/,n.any())},493:(e,t,r)=>{const{clone:n,reach:i}=r(8870),o=r(8160),s={value:Symbol("value")};e.exports=s.State=class{constructor(e,t,r){this.path=e,this.ancestors=t,this.mainstay=r.mainstay,this.schemas=r.schemas,this.debug=null}localize(e,t=null,r=null){const n=new s.State(e,t,this);return r&&n.schemas&&(n.schemas=[s.schemas(r),...n.schemas]),n}nest(e,t){const r=new s.State(this.path,this.ancestors,this);return r.schemas=r.schemas&&[s.schemas(e),...r.schemas],r.debug=t,r}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new s.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=n(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},s.schemas=function(e){return o.isSchema(e)?{schema:e}:e},s.Shadow=class{constructor(){this._values=null}set(e,t,r){if(!e.length)return;if("strip"===r&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let n=this._values;for(let t=0;t<e.length;++t){const r=e[t];let i=n.get(r);i||(i=new Map,n.set(r,i)),n=i}n[s.value]=t}get(e){const t=this.node(e);if(t)return t[s.value]}node(e){if(this._values)return i(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;const r=e.slice(0,-1),n=e[e.length-1],o=i(this._values,r,{iterables:!0});t?o.set(n,t):o&&o.delete(n)}}},3328:(e,t,r)=>{const{assert:n,clone:i,escapeHtml:o}=r(8870),s=r(4964),a=r(8160),l=r(6354),u=r(6133),c={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};e.exports=c.Template=class{constructor(e,t){if(n("string"==typeof e,"Template source must be a string"),n(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,t){const{functions:e,...r}=t;this._settings=Object.keys(r).length?i(r):void 0,this._functions=e,this._functions&&(n(Object.keys(this._functions).every((e=>"string"==typeof e)),"Functions keys must be strings"),n(Object.values(this._functions).every((e=>"function"==typeof e)),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const e=c.encode(this.source),t=c.split(e);let r=!1;const n=[],i=t.shift();i&&n.push(i);for(const e of t){const t="{"!==e[0],i=t?"}":"}}",o=e.indexOf(i);if(-1===o||"{"===e[1]){n.push(`{${c.decode(e)}`);continue}let s=e.slice(t?0:1,o);const a=":"===s[0];a&&(s=s.slice(1));const l=this._ref(c.decode(s),{raw:t,wrapped:a});n.push(l),"string"!=typeof l&&(r=!0);const u=e.slice(o+i.length);u&&n.push(c.decode(u))}r?this._template=n:this.rendered=n.join("")}static date(e,t){return c.dateFormat[t.dateFormat].call(e)}describe(e={}){if(!this._settings&&e.compact)return this.source;const t={template:this.source};return this._settings&&(t.options=this._settings),this._functions&&(t.functions=this._functions),t}static build(e){return new c.Template(e.template,e.options||e.functions?{...e.options,functions:e.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[a.symbols.template]}refs(){if(!this._template)return;const e=[];for(const t of this._template)"string"!=typeof t&&e.push(...t.refs);return e}resolve(e,t,r,n){return this._template&&1===this._template.length?this._part(this._template[0],e,t,r,n,{}):this.render(e,t,r,n)}_part(e,...t){return e.ref?e.ref.resolve(...t):e.formula.evaluate(t)}render(e,t,r,n,i={}){if(!this.isDynamic())return this.rendered;const s=[];for(const a of this._template)if("string"==typeof a)s.push(a);else{const l=this._part(a,e,t,r,n,i),u=c.stringify(l,e,t,r,n,i);if(void 0!==u){const e=a.raw||!1===(i.errors&&i.errors.escapeHtml)?u:o(u);s.push(c.wrap(e,a.wrapped&&r.errors.wrap.label))}}return s.join("")}_ref(e,{raw:t,wrapped:r}){const n=[],i=e=>{const t=u.create(e,this._settings);return n.push(t),e=>{const r=t.resolve(...e);return void 0!==r?r:null}};try{const t=this._functions?{...c.functions,...this._functions}:c.functions;var o=new s.Parser(e,{reference:i,functions:t,constants:c.constants})}catch(t){throw t.message=`Invalid template variable "${e}" fails due to: ${t.message}`,t}if(o.single){if("reference"===o.single.type){const e=n[0];return{ref:e,raw:t,refs:n,wrapped:r||"local"===e.type&&"label"===e.key}}return c.stringify(o.single.value)}return{formula:o,raw:t,refs:n}}toString(){return this.source}},c.Template.prototype[a.symbols.template]=!0,c.Template.prototype.isImmutable=!0,c.encode=function(e){return e.replace(/\\(\{+)/g,((e,t)=>c.opens.slice(0,t.length))).replace(/\\(\}+)/g,((e,t)=>c.closes.slice(0,t.length)))},c.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},c.split=function(e){const t=[];let r="";for(let n=0;n<e.length;++n){const i=e[n];if("{"===i){let i="";for(;n+1<e.length&&"{"===e[n+1];)i+="{",++n;t.push(r),r=i}else r+=i}return t.push(r),t},c.wrap=function(e,t){return t?1===t.length?`${t}${e}${t}`:`${t[0]}${e}${t[1]}`:e},c.stringify=function(e,t,r,n,i,o={}){const s=typeof e,a=n&&n.errors&&n.errors.wrap||{};let l=!1;if(u.isRef(e)&&e.render&&(l=e.in,e=e.resolve(t,r,n,i,{in:e.in,...o})),null===e)return"null";if("string"===s)return c.wrap(e,o.arrayItems&&a.string);if("number"===s||"function"===s||"symbol"===s)return e.toString();if("object"!==s)return JSON.stringify(e);if(e instanceof Date)return c.Template.date(e,n);if(e instanceof Map){const t=[];for(const[r,n]of e.entries())t.push(`${r.toString()} -> ${n.toString()}`);e=t}if(!Array.isArray(e))return e.toString();const d=[];for(const s of e)d.push(c.stringify(s,t,r,n,i,{arrayItems:!0,...o}));return c.wrap(d.join(", "),!l&&a.array)},c.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},c.functions={if:(e,t,r)=>e?t:r,length:e=>"string"==typeof e?e.length:e&&"object"==typeof e?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){const[t,r,n,i,o]=this,s=o.messages;if(!s)return"";const a=l.template(t,s[0],e,r,n)||l.template(t,s[1],e,r,n);return a?a.render(t,r,n,i,o):""},number:e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e):"boolean"==typeof e?e?1:0:e instanceof Date?e.getTime():null}},2305:(e,t,r)=>{const{deepEqual:n}=r(8870),i=r(7593),o=r(6354),s={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};t.setup=function(e){const t=function(){return e._tracer=e._tracer||new s.Tracer,e._tracer};e.trace=t,e[Symbol.for("@hapi/lab/coverage/initialize")]=t,e.untrace=()=>{e._tracer=null}},t.location=function(e){return e.$_setFlag("_tracerLocation",i.location(2))},s.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(e){const t=this._schemas.get(e);if(t)return t.store;const r=new s.Store(e),{filename:n,line:o}=e._flags._tracerLocation||i.location(5);return this._schemas.set(e,{filename:n,line:o,store:r}),r}_combine(e,t){for(const{store:r}of this._schemas.values())r._combine(e,t)}report(e){const t=[];for(const{filename:r,line:n,store:i}of this._schemas.values()){if(e&&e!==r)continue;const o=[],a=[];for(const[e,t]of i._sources.entries()){if(s.sub(t.paths,a))continue;if(!t.entry){o.push({status:"never reached",paths:[...t.paths]}),a.push(...t.paths);continue}for(const r of["valid","invalid"]){const n=e[`_${r}s`];if(!n)continue;const i=new Set(n._values),s=new Set(n._refs);for(const{value:e,ref:n}of t[r])i.delete(e),s.delete(n);(i.size||s.size)&&o.push({status:[...i,...[...s].map((e=>e.display))],rule:`${r}s`})}const r=e._rules.map((e=>e.name));for(const t of["default","failover"])void 0!==e._flags[t]&&r.push(t);for(const e of r){const r=s.labels[t.rule[e]||0];if(r){const n={rule:e,status:r};t.paths.size&&(n.paths=[...t.paths]),o.push(n)}}}o.length&&t.push({filename:r,line:n,missing:o,severity:"error",message:`Schema missing tests for ${o.map(s.message).join(", ")}`})}return t.length?t:null}},s.Store=class{constructor(e){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(e)}debug(e,t,r,n){e.mainstay.debug&&e.mainstay.debug.push({type:t,name:r,result:n,path:e.path})}entry(e,t){s.debug(t,{type:"entry"}),this._record(e,(e=>{e.entry=!0}))}filter(e,t,r,n){s.debug(t,{type:r,...n}),this._record(e,(e=>{e[r].add(n)}))}log(e,t,r,n,i){s.debug(t,{type:r,name:n,result:"full"===i?"pass":i}),this._record(e,(e=>{e[r][n]=e[r][n]||0,e[r][n]|=s.codes[i]}))}resolve(e,t,r){if(!e.mainstay.debug)return;const n={type:"resolve",ref:t.display,to:r,path:e.path};e.mainstay.debug.push(n)}value(e,t,r,i,o){if(!e.mainstay.debug||n(r,i))return;const s={type:"value",by:t,from:r,to:i,path:e.path};o&&(s.name=o),e.mainstay.debug.push(s)}_record(e,t){const r=this._sources.get(e);if(r)return void t(r);const n=this._combos.get(e);for(const e of n)this._record(e,t)}_scan(e,t){const r=t||[];let n=this._sources.get(e);n||(n={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(e,n)),r.length&&n.paths.add(r),e.$_modify({each:(e,t)=>{const n=s.id(e,t);this._scan(e,r.concat(n))},ref:!1})}_combine(e,t){this._combos.set(e,t)}},s.message=function(e){return`${e.paths?o.path(e.paths[0])+(e.rule?":":""):""}${e.rule||""} (${e.status})`},s.id=function(e,{source:t,name:r,path:n,key:i}){return e._flags.id?e._flags.id:i||(r=`@${r}`,"terms"===t?[r,n[Math.min(n.length-1,1)]]:r)},s.sub=function(e,t){for(const r of e)for(const e of t)if(n(r.slice(0,e.length),e))return!0;return!1},s.debug=function(e,t){e.mainstay.debug&&(t.path=e.debug?[...e.path,e.debug]:e.path,e.mainstay.debug.push(t))}},4946:(e,t,r)=>{const{assert:n,merge:i}=r(8870),o=r(8068),s=r(8160),a=r(3292),l=r(6354),u=r(6133),c={};e.exports=o.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:u.toSibling}},args:(e,...t)=>1===t.length&&Array.isArray(t[0])?e.try(...t[0]):e.try(...t),validate(e,t){const{schema:r,error:n,state:o,prefs:s}=t;if(r._flags.match){const t=[],a=[];for(let n=0;n<r.$_terms.matches.length;++n){const i=r.$_terms.matches[n],l=o.nest(i.schema,`match.${n}`);l.snapshot();const u=i.schema.$_validate(e,l,s);u.errors?(a.push(u.errors),l.restore()):(t.push(u.value),l.commit())}if(0===t.length)return{errors:n("alternatives.any",{details:a.map((e=>l.details(e,{override:!1})))})};if("one"===r._flags.match)return 1===t.length?{value:t[0]}:{errors:n("alternatives.one")};if(t.length!==r.$_terms.matches.length)return{errors:n("alternatives.all",{details:a.map((e=>l.details(e,{override:!1})))})};const u=e=>e.$_terms.matches.some((e=>"object"===e.schema.type||"alternatives"===e.schema.type&&u(e.schema)));return u(r)?{value:t.reduce(((e,t)=>i(e,t,{mergeArrays:!1})))}:{value:t[t.length-1]}}const a=[];for(let t=0;t<r.$_terms.matches.length;++t){const n=r.$_terms.matches[t];if(n.schema){const r=o.nest(n.schema,`match.${t}`);r.snapshot();const i=n.schema.$_validate(e,r,s);if(!i.errors)return r.commit(),i;r.restore(),a.push({schema:n.schema,reports:i.errors});continue}const i=n.ref?n.ref.resolve(e,o,s):e,l=n.is?[n]:n.switch;for(let r=0;r<l.length;++r){const a=l[r],{is:u,then:c,otherwise:d}=a,f=`match.${t}${n.switch?"."+r:""}`;if(u.$_match(i,o.nest(u,`${f}.is`),s)){if(c)return c.$_validate(e,o.nest(c,`${f}.then`),s)}else if(d)return d.$_validate(e,o.nest(d,`${f}.otherwise`),s)}}return c.errors(a,t)},rules:{conditional:{method(e,t){n(!this._flags._endedSwitch,"Unreachable condition"),n(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),n(void 0===t.break,"Cannot use break option with alternatives conditional");const r=this.clone(),i=a.when(r,e,t),o=i.is?[i]:i.switch;for(const e of o)if(e.then&&e.otherwise){r.$_setFlag("_endedSwitch",!0,{clone:!1});break}return r.$_terms.matches.push(i),r.$_mutateRebuild()}},match:{method(e){if(n(["any","one","all"].includes(e),"Invalid alternatives match mode",e),"any"!==e)for(const t of this.$_terms.matches)n(t.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(...e){n(e.length,"Missing alternative schemas"),s.verifyFlat(e,"try"),n(!this._flags._endedSwitch,"Unreachable condition");const t=this.clone();for(const r of e)t.$_terms.matches.push({schema:t.$_compile(r)});return t.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,r)=>"is"!==r.path[0]?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{s.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const r of t.matches){const{schema:t,ref:n,is:i,not:o,then:s,otherwise:a}=r;e=t?e.try(t):n?e.conditional(n,{is:i,then:s,not:o,otherwise:a,switch:r.switch}):e.conditional(i,{then:s,otherwise:a})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),c.errors=function(e,{error:t,state:r}){if(!e.length)return{errors:t("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const n=new Set,i=[];for(const{reports:o,schema:s}of e){if(o.length>1)return c.unmatched(e,t);const a=o[0];if(a instanceof l.Report==0)return c.unmatched(e,t);if(a.state.path.length!==r.path.length){i.push({type:s.type,report:a});continue}if("any.only"===a.code){for(const e of a.local.valids)n.add(e);continue}const[u,d]=a.code.split(".");"base"===d?n.add(u):i.push({type:s.type,report:a})}return i.length?1===i.length?{errors:i[0].report}:c.unmatched(e,t):{errors:t("alternatives.types",{types:[...n]})}},c.unmatched=function(e,t){const r=[];for(const t of e)r.push(...t.reports);return{errors:t("alternatives.match",l.details(r,{override:!1}))}}},8068:(e,t,r)=>{const{assert:n}=r(8870),i=r(7629),o=r(8160),s=r(6914);e.exports=i.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,{method:r}){try{return r(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){n(o.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return n(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate:(e,t,{code:r,local:n})=>t.error(r,n),args:["code","local"],multi:!0}},modifiers:{keep(e,t=!0){e.keep=t},message(e,t){e.message=s.compile(t)},warn(e,t=!0){e.warn=t}},manifest:{build(e,t){for(const r in t){const n=t[r];if(["examples","externals","metas","notes","tags"].includes(r))for(const t of n)e=e[r.slice(0,-1)](t);else if("alterations"!==r)if("whens"!==r){if("shared"===r)for(const t of n)e=e.shared(t)}else for(const t of n){const{ref:r,is:n,not:i,then:o,otherwise:s,concat:a}=t;e=a?e.concat(a):r?e.when(r,{is:n,not:i,then:o,otherwise:s,switch:t.switch,break:t.break}):e.when(n,{then:o,otherwise:s,break:t.break})}else{const t={};for(const{target:e,adjuster:r}of n)t[e]=r;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(e,t,r)=>{const{assert:n,deepEqual:i,reach:o}=r(8870),s=r(8068),a=r(8160),l=r(3292),u={};e.exports=s.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,{schema:t,state:r,prefs:n}){if(!Array.isArray(e))return;const i=t.$_getRule("sort");return i?u.sort(t,e,i.args.options,r,n):void 0}},validate(e,{schema:t,error:r}){if(!Array.isArray(e)){if(t._flags.single){const t=[e];return t[a.symbols.arraySingle]=!0,{value:t}}return{errors:r("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,{state:t,prefs:r,error:n},{schema:i}){const o=[e,...t.ancestors];for(let n=0;n<e.length;++n){const s=t.localize([...t.path,n],o,i);if(i.$_match(e[n],s,r))return e}const s=i._flags.label;return s?n("array.hasKnown",{patternLabel:s}):n("array.hasUnknown",null)},multi:!0},items:{method(...e){a.verifyFlat(e,"items");const t=this.$_addRule("items");for(let r=0;r<e.length;++r){const n=a.tryWithPath((()=>this.$_compile(e[r])),r,{append:!0});t.$_terms.items.push(n)}return t.$_mutateRebuild()},validate(e,{schema:t,error:r,state:n,prefs:i,errorsArray:o}){const s=t.$_terms._requireds.slice(),l=t.$_terms.ordered.slice(),c=[...t.$_terms._inclusions,...s],d=!e[a.symbols.arraySingle];delete e[a.symbols.arraySingle];const f=o();let p=e.length;for(let o=0;o<p;++o){const a=e[o];let h=!1,m=!1;const g=d?o:new Number(o),b=[...n.path,g];if(!t._flags.sparse&&void 0===a){if(f.push(r("array.sparse",{key:g,path:b,pos:o,value:void 0},n.localize(b))),i.abortEarly)return f;l.shift();continue}const y=[e,...n.ancestors];for(const e of t.$_terms._exclusions)if(e.$_match(a,n.localize(b,y,e),i,{presence:"ignore"})){if(f.push(r("array.excludes",{pos:o,value:a},n.localize(b))),i.abortEarly)return f;h=!0,l.shift();break}if(h)continue;if(t.$_terms.ordered.length){if(l.length){const s=l.shift(),c=s.$_validate(a,n.localize(b,y,s),i);if(c.errors){if(f.push(...c.errors),i.abortEarly)return f}else if("strip"===s._flags.result)u.fastSplice(e,o),--o,--p;else{if(!t._flags.sparse&&void 0===c.value){if(f.push(r("array.sparse",{key:g,path:b,pos:o,value:void 0},n.localize(b))),i.abortEarly)return f;continue}e[o]=c.value}continue}if(!t.$_terms.items.length){if(f.push(r("array.orderedLength",{pos:o,limit:t.$_terms.ordered.length})),i.abortEarly)return f;break}}const v=[];let _=s.length;for(let l=0;l<_;++l){const c=n.localize(b,y,s[l]);c.snapshot();const d=s[l].$_validate(a,c,i);if(v[l]=d,!d.errors){if(c.commit(),e[o]=d.value,m=!0,u.fastSplice(s,l),--l,--_,!t._flags.sparse&&void 0===d.value&&(f.push(r("array.sparse",{key:g,path:b,pos:o,value:void 0},n.localize(b))),i.abortEarly))return f;break}c.restore()}if(m)continue;const w=i.stripUnknown&&!!i.stripUnknown.arrays||!1;_=c.length;for(const l of c){let c;const d=s.indexOf(l);if(-1!==d)c=v[d];else{const s=n.localize(b,y,l);if(s.snapshot(),c=l.$_validate(a,s,i),!c.errors){s.commit(),"strip"===l._flags.result?(u.fastSplice(e,o),--o,--p):t._flags.sparse||void 0!==c.value?e[o]=c.value:(f.push(r("array.sparse",{key:g,path:b,pos:o,value:void 0},n.localize(b))),h=!0),m=!0;break}s.restore()}if(1===_){if(w){u.fastSplice(e,o),--o,--p,m=!0;break}if(f.push(...c.errors),i.abortEarly)return f;h=!0;break}}if(!h&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!m){if(w){u.fastSplice(e,o),--o,--p;continue}if(f.push(r("array.includes",{pos:o,value:a},n.localize(b))),i.abortEarly)return f}}return s.length&&u.fillMissedErrors(t,f,s,e,n,i),l.length&&(u.fillOrderedErrors(t,f,l,e,n,i),f.length||u.fillDefault(l,e,n,i)),f.length?f:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:n,operator:i,args:o})=>a.compare(e.length,r,i)?e:t.error("array."+n,{limit:o.limit,value:e}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(...e){a.verifyFlat(e,"ordered");const t=this.$_addRule("items");for(let r=0;r<e.length;++r){const n=a.tryWithPath((()=>this.$_compile(e[r])),r,{append:!0});u.validateSingle(n,t),t.$_mutateRegister(n),t.$_terms.ordered.push(n)}return t.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return n(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(e={}){a.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=l.ref(e.by,{ancestor:0}),n(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,{error:t,state:r,prefs:n,schema:i},{options:o}){const{value:s,errors:a}=u.sort(i,e,o,r,n);if(a)return a;for(let r=0;r<e.length;++r)if(e[r]!==s[r])return t("array.sort",{order:o.order,by:o.by?o.by.key:"value"});return e},convert:!0},sparse:{method(e){const t=void 0===e||!!e;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(e,t={}){n(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),a.assertOptions(t,["ignoreUndefined","separator"]);const r={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const n=a.default(t.separator,".");r.path=n?e.split(n):[e]}else r.comparator=e;return this.$_addRule(r)},validate(e,{state:t,error:r,schema:s},{comparator:a,options:l},{comparator:u,path:c}){const d={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},f=u||i,p=l.ignoreUndefined;for(let i=0;i<e.length;++i){const s=c?o(e[i],c):e[i],l=u?d.custom:d[typeof s];if(n(l,"Failed to find unique map container for type",typeof s),l instanceof Map){const n=l.entries();let o;for(;!(o=n.next()).done;)if(f(o.value[0],s)){const n=t.localize([...t.path,i],[e,...t.ancestors]),s={pos:i,value:e[i],dupePos:o.value[1],dupeValue:e[o.value[1]]};return c&&(s.path=a),r("array.unique",s,n)}l.set(s,i)}else{if((!p||void 0!==s)&&void 0!==l[s]){const n={pos:i,value:e[i],dupePos:l[s],dupeValue:e[l[s]]};return c&&(n.path=a),r("array.unique",n,t.localize([...t.path,i],[e,...t.ancestors]))}l[s]=i}}return e},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(e,t)=>new Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)u.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)u.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),u.fillMissedErrors=function(e,t,r,n,i,o){const s=[];let a=0;for(const e of r){const t=e._flags.label;t?s.push(t):++a}s.length?a?t.push(e.$_createError("array.includesRequiredBoth",n,{knownMisses:s,unknownMisses:a},i,o)):t.push(e.$_createError("array.includesRequiredKnowns",n,{knownMisses:s},i,o)):t.push(e.$_createError("array.includesRequiredUnknowns",n,{unknownMisses:a},i,o))},u.fillOrderedErrors=function(e,t,r,n,i,o){const s=[];for(const e of r)"required"===e._flags.presence&&s.push(e);s.length&&u.fillMissedErrors(e,t,s,n,i,o)},u.fillDefault=function(e,t,r,n){const i=[];let o=!0;for(let s=e.length-1;s>=0;--s){const a=e[s],l=[t,...r.ancestors],u=a.$_validate(void 0,r.localize(r.path,l,a),n).value;if(o){if(void 0===u)continue;o=!1}i.unshift(u)}i.length&&t.push(...i)},u.fastSplice=function(e,t){let r=t;for(;r<e.length;)e[r++]=e[r];--e.length},u.validateSingle=function(e,t){("array"===e.type||e._flags._arrayItems)&&(n(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},u.sort=function(e,t,r,n,i){const o="ascending"===r.order?1:-1,s=-1*o,a=o,l=(l,c)=>{let d=u.compare(l,c,s,a);if(null!==d)return d;if(r.by&&(l=r.by.resolve(l,n,i),c=r.by.resolve(c,n,i)),d=u.compare(l,c,s,a),null!==d)return d;const f=typeof l;if(f!==typeof c)throw e.$_createError("array.sort.mismatching",t,null,n,i);if("number"!==f&&"string"!==f)throw e.$_createError("array.sort.unsupported",t,{type:f},n,i);return"number"===f?(l-c)*o:l<c?s:a};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}},u.compare=function(e,t,r,n){return e===t?0:void 0===e?1:void 0===t?-1:null===e?n:null===t?r:null}},4937:(e,t,r)=>{const{assert:n}=r(8870),i=r(8068),o=r(8160),s=r(2036),a={isBool:function(e){return"boolean"==typeof e}};e.exports=i.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,{schema:t}){if("boolean"!=typeof e){if("string"==typeof e){const r=t._flags.sensitive?e:e.toLowerCase();e="true"===r||"false"!==r&&e}return"boolean"!=typeof e&&(e=t.$_terms.truthy&&t.$_terms.truthy.has(e,null,null,!t._flags.sensitive)||(!t.$_terms.falsy||!t.$_terms.falsy.has(e,null,null,!t._flags.sensitive))&&e),{value:e}}},validate(e,{error:t}){if("boolean"!=typeof e)return{value:e,errors:t("boolean.base")}},rules:{truthy:{method(...e){o.verifyFlat(e,"truthy");const t=this.clone();t.$_terms.truthy=t.$_terms.truthy||new s;for(let r=0;r<e.length;++r){const i=e[r];n(void 0!==i,"Cannot call truthy with undefined"),t.$_terms.truthy.add(i)}return t}},falsy:{method(...e){o.verifyFlat(e,"falsy");const t=this.clone();t.$_terms.falsy=t.$_terms.falsy||new s;for(let r=0;r<e.length;++r){const i=e[r];n(void 0!==i,"Cannot call falsy with undefined"),t.$_terms.falsy.add(i)}return t}},sensitive:{method(e=!0){return this.$_setFlag("sensitive",e)}}},cast:{number:{from:a.isBool,to:(e,t)=>e?1:0},string:{from:a.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(e,t,r)=>{const{assert:n}=r(8870),i=r(8068),o=r(8160),s=r(3328),a={isDate:function(e){return e instanceof Date}};e.exports=i.extend({type:"date",coerce:{from:["number","string"],method:(e,{schema:t})=>({value:a.parse(e,t._flags.format)||e})},validate(e,{schema:t,error:r,prefs:n}){if(e instanceof Date&&!isNaN(e.getTime()))return;const i=t._flags.format;return n.convert&&i&&"string"==typeof e?{value:e,errors:r("date.format",{format:i})}:{value:e,errors:r("date.base")}},rules:{compare:{method:!1,validate(e,t,{date:r},{name:n,operator:i,args:s}){const a="now"===r?Date.now():r.getTime();return o.compare(e.getTime(),a,i)?e:t.error("date."+n,{limit:s.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:a.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return n(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(e="javascript"){return n(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:a.isDate,to:(e,t)=>e.getTime()},string:{from:a.isDate,to:(e,{prefs:t})=>s.date(e,t)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),a.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return o.isIsoDate(e)?a.date(e.toString()):null;const r=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return a.date(1*e);if("unix"===t)return a.date(1e3*e);if("string"==typeof r)return null}return a.date(e)},a.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},390:(e,t,r)=>{const{assert:n}=r(8870),i=r(7824);e.exports=i.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate:(e,t,{n:r})=>e.length===r?e:t.error("function.arity",{n:r})},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return n(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate:(e,t,{n:r})=>e.length>=r?e:t.error("function.minArity",{n:r})},maxArity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate:(e,t,{n:r})=>e.length<=r?e:t.error("function.maxArity",{n:r})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(e,t,r)=>{const{applyToDefaults:n,assert:i,clone:o}=r(8870),s=r(3652),a=r(8068),l=r(8160),u=r(3292),c=r(6354),d=r(6133),f=r(3328),p={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=a.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(e,t)=>e.keys(t),validate(e,{schema:t,error:r,state:n,prefs:i}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e))return{value:e,errors:r("object.base",{type:t.$_property("typeof")})};if(!(t.$_terms.renames||t.$_terms.dependencies||t.$_terms.keys||t.$_terms.patterns||t.$_terms.externals))return;e=p.clone(e,i);const o=[];if(t.$_terms.renames&&!p.rename(t,e,n,i,o))return{value:e,errors:o};if(!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies)return{value:e,errors:o};const s=new Set(Object.keys(e));if(t.$_terms.keys){const r=[e,...n.ancestors];for(const a of t.$_terms.keys){const t=a.key,l=e[t];s.delete(t);const u=n.localize([...n.path,t],r,a),c=a.schema.$_validate(l,u,i);if(c.errors){if(i.abortEarly)return{value:e,errors:c.errors};void 0!==c.value&&(e[t]=c.value),o.push(...c.errors)}else"strip"===a.schema._flags.result||void 0===c.value&&void 0!==l?delete e[t]:void 0!==c.value&&(e[t]=c.value)}}if(s.size||t._flags._hasPatternMatch){const r=p.unknown(t,e,s,o,n,i);if(r)return r}if(t.$_terms.dependencies)for(const r of t.$_terms.dependencies){if(null!==r.key&&!1===p.isPresent(r.options)(r.key.resolve(e,n,i,null,{shadow:!1})))continue;const s=p.dependencies[r.rel](t,r,e,n,i);if(s){const r=t.$_createError(s.code,e,s.context,n,i);if(i.abortEarly)return{value:e,errors:r};o.push(r)}}return{value:e,errors:o}},rules:{and:{method(...e){return l.verifyFlat(e,"and"),p.dependency(this,"and",null,e)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,r){f.isTemplate(e)||(e=u.ref(e)),i(void 0===r||"string"==typeof r,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});const n=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:r}});return n.$_mutateRegister(e),n.$_mutateRegister(t),n},validate(e,{error:t,prefs:r,state:n},{subject:i,schema:o,message:s}){const a=i.resolve(e,n,r),l=d.isRef(i)?i.absolute(n):[];return o.$_match(a,n.localize(l,[e,...n.ancestors],o),r)?e:t("object.assert",{subject:i,message:s})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return i("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate:(e,t,{constructor:r,name:n})=>e instanceof r?e:t.error("object.instance",{type:n,value:e}),args:["constructor","name"]},keys:{method(e){i(void 0===e||"object"==typeof e,"Object schema must be a valid object"),i(!l.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(e)if(Object.keys(e).length){t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter((t=>!e.hasOwnProperty(t.key))):new p.Keys;for(const r in e)l.tryWithPath((()=>t.$_terms.keys.push({key:r,schema:this.$_compile(e[r])})),r)}else t.$_terms.keys=new p.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:n,operator:i,args:o})=>l.compare(Object.keys(e).length,r,i)?e:t.error("object."+n,{limit:o.limit,value:e}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(...e){return l.verifyFlat(e,"nand"),p.dependency(this,"nand",null,e)}},or:{method(...e){return l.verifyFlat(e,"or"),p.dependency(this,"or",null,e)}},oxor:{method(...e){return p.dependency(this,"oxor",null,e)}},pattern:{method(e,t,r={}){const n=e instanceof RegExp;n||(e=this.$_compile(e,{appendPath:!0})),i(void 0!==t,"Invalid rule"),l.assertOptions(r,["fallthrough","matches"]),n&&i(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const o=this.clone();o.$_terms.patterns=o.$_terms.patterns||[];const s={[n?"regex":"schema"]:e,rule:t};return r.matches&&(s.matches=this.$_compile(r.matches),"array"!==s.matches.type&&(s.matches=s.matches.$_root.array().items(s.matches)),o.$_mutateRegister(s.matches),o.$_setFlag("_hasPatternMatch",!0,{clone:!1})),r.fallthrough&&(s.fallthrough=!0),o.$_terms.patterns.push(s),o.$_mutateRegister(t),o}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>d.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t,r={}){i("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),i("string"==typeof t||t instanceof f,"Invalid rename to argument"),i(t!==e,"Cannot rename key to same name:",e),l.assertOptions(r,["alias","ignoreUndefined","override","multiple"]);const o=this.clone();o.$_terms.renames=o.$_terms.renames||[];for(const t of o.$_terms.renames)i(t.from!==e,"Cannot rename the same key multiple times");return t instanceof f&&o.$_mutateRegister(t),o.$_terms.renames.push({from:e,to:t,options:n(p.renameDefaults,r)}),o}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate:(e,t,{type:r})=>!l.isSchema(e)||"any"!==r&&e.type!==r?t.error("object.schema",{type:r}):e},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t,r={}){return p.dependency(this,"with",e,t,r)}},without:{method(e,t,r={}){return p.dependency(this,"without",e,t,r)}},xor:{method(...e){return l.verifyFlat(e,"xor"),p.dependency(this,"xor",null,e)}}},overrides:{default(e,t){return void 0===e&&(e=l.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){const t=new s.Sorter;for(const r of e.$_terms.keys)l.tryWithPath((()=>t.add(r,{after:r.schema.$_rootReferences(),group:r.key})),r.key);e.$_terms.keys=new p.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:r,key:n=null,peers:i,options:o}of t.dependencies)e=p.dependency(e,r,n,i,o);if(t.patterns)for(const{regex:r,schema:n,rule:i,fallthrough:o,matches:s}of t.patterns)e=e.pattern(r||n,i,{fallthrough:o,matches:s});if(t.renames)for(const{from:r,to:n,options:i}of t.renames)e=e.rename(r,n,i);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),p.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return o(e,{shallow:!0});const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e),r}const r=function(...t){return e.apply(this,t)};return r.prototype=o(e.prototype),Object.defineProperty(r,"name",{value:e.name,writable:!1}),Object.defineProperty(r,"length",{value:e.length,writable:!1}),Object.assign(r,e),r},p.dependency=function(e,t,r,n,o){i(null===r||"string"==typeof r,t,"key must be a strings"),o||(o=n.length>1&&"object"==typeof n[n.length-1]?n.pop():{}),l.assertOptions(o,["separator","isPresent"]),n=[].concat(n);const s=l.default(o.separator,"."),a=[];for(const e of n)i("string"==typeof e,t,"peers must be strings"),a.push(u.ref(e,{separator:s,ancestor:0,prefix:!1}));null!==r&&(r=u.ref(r,{separator:s,ancestor:0,prefix:!1}));const c=e.clone();return c.$_terms.dependencies=c.$_terms.dependencies||[],c.$_terms.dependencies.push(new p.Dependency(t,r,a,n,o)),c},p.dependencies={and(e,t,r,n,i){const o=[],s=[],a=t.peers.length,l=p.isPresent(t.options);for(const e of t.peers)!1===l(e.resolve(r,n,i,null,{shadow:!1}))?o.push(e.key):s.push(e.key);if(o.length!==a&&s.length!==a)return{code:"object.and",context:{present:s,presentWithLabels:p.keysToLabels(e,s),missing:o,missingWithLabels:p.keysToLabels(e,o)}}},nand(e,t,r,n,i){const o=[],s=p.isPresent(t.options);for(const e of t.peers)s(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(o.length!==t.peers.length)return;const a=t.paths[0],l=t.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:p.keysToLabels(e,a),peers:l,peersWithLabels:p.keysToLabels(e,l)}}},or(e,t,r,n,i){const o=p.isPresent(t.options);for(const e of t.peers)if(o(e.resolve(r,n,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)}}},oxor(e,t,r,n,i){const o=[],s=p.isPresent(t.options);for(const e of t.peers)s(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(!o.length||1===o.length)return;const a={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return a.present=o,a.presentWithLabels=p.keysToLabels(e,o),{code:"object.oxor",context:a}},with(e,t,r,n,i){const o=p.isPresent(t.options);for(const s of t.peers)if(!1===o(s.resolve(r,n,i,null,{shadow:!1})))return{code:"object.with",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:s.key,peerWithLabel:p.keysToLabels(e,s.key)}}},without(e,t,r,n,i){const o=p.isPresent(t.options);for(const s of t.peers)if(o(s.resolve(r,n,i,null,{shadow:!1})))return{code:"object.without",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:s.key,peerWithLabel:p.keysToLabels(e,s.key)}}},xor(e,t,r,n,i){const o=[],s=p.isPresent(t.options);for(const e of t.peers)s(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(1===o.length)return;const a={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return 0===o.length?{code:"object.missing",context:a}:(a.present=o,a.presentWithLabels=p.keysToLabels(e,o),{code:"object.xor",context:a})}},p.keysToLabels=function(e,t){return Array.isArray(t)?t.map((t=>e.$_mapLabels(t))):e.$_mapLabels(t)},p.isPresent=function(e){return"function"==typeof e.isPresent?e.isPresent:e=>void 0!==e},p.rename=function(e,t,r,n,i){const o={};for(const s of e.$_terms.renames){const a=[],l="string"!=typeof s.from;if(l)for(const e in t){if(void 0===t[e]&&s.options.ignoreUndefined)continue;if(e===s.to)continue;const r=s.from.exec(e);r&&a.push({from:e,to:s.to,match:r})}else!Object.prototype.hasOwnProperty.call(t,s.from)||void 0===t[s.from]&&s.options.ignoreUndefined||a.push(s);for(const u of a){const a=u.from;let c=u.to;if(c instanceof f&&(c=c.render(t,r,n,u.match)),a!==c){if(!s.options.multiple&&o[c]&&(i.push(e.$_createError("object.rename.multiple",t,{from:a,to:c,pattern:l},r,n)),n.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,c)&&!s.options.override&&!o[c]&&(i.push(e.$_createError("object.rename.override",t,{from:a,to:c,pattern:l},r,n)),n.abortEarly))return!1;void 0===t[a]?delete t[c]:t[c]=t[a],o[c]=!0,s.options.alias||delete t[a]}}}return!0},p.unknown=function(e,t,r,n,i,o){if(e.$_terms.patterns){let s=!1;const a=e.$_terms.patterns.map((e=>{if(e.matches)return s=!0,[]})),l=[t,...i.ancestors];for(const s of r){const u=t[s],c=[...i.path,s];for(let d=0;d<e.$_terms.patterns.length;++d){const f=e.$_terms.patterns[d];if(f.regex){const e=f.regex.test(s);if(i.mainstay.tracer.debug(i,"rule",`pattern.${d}`,e?"pass":"error"),!e)continue}else if(!f.schema.$_match(s,i.nest(f.schema,`pattern.${d}`),o))continue;r.delete(s);const p=i.localize(c,l,{schema:f.rule,key:s}),h=f.rule.$_validate(u,p,o);if(h.errors){if(o.abortEarly)return{value:t,errors:h.errors};n.push(...h.errors)}if(f.matches&&a[d].push(s),t[s]=h.value,!f.fallthrough)break}}if(s)for(let r=0;r<a.length;++r){const s=a[r];if(!s)continue;const u=e.$_terms.patterns[r].matches,d=i.localize(i.path,l,u),f=u.$_validate(s,d,o);if(f.errors){const r=c.details(f.errors,{override:!1});r.matches=s;const a=e.$_createError("object.pattern.match",t,r,i,o);if(o.abortEarly)return{value:t,errors:a};n.push(a)}}}if(r.size&&(e.$_terms.keys||e.$_terms.patterns)){if(o.stripUnknown&&!e._flags.unknown||o.skipFunctions){const e=!(!o.stripUnknown||!0!==o.stripUnknown&&!o.stripUnknown.objects);for(const n of r)e?(delete t[n],r.delete(n)):"function"==typeof t[n]&&r.delete(n)}if(!l.default(e._flags.unknown,o.allowUnknown))for(const s of r){const r=i.localize([...i.path,s],[]),a=e.$_createError("object.unknown",t[s],{child:s},r,o,{flags:!1});if(o.abortEarly)return{value:t,errors:a};n.push(a)}}},p.Dependency=class{constructor(e,t,r,n,i){this.rel=e,this.key=t,this.peers=r,this.paths=n,this.options=i}describe(){const e={rel:this.rel,peers:this.paths};return null!==this.key&&(e.key=this.key.key),"."!==this.peers[0].separator&&(e.options={...e.options,separator:this.peers[0].separator}),this.options.isPresent&&(e.options={...e.options,isPresent:this.options.isPresent}),e}},p.Keys=class extends Array{concat(e){const t=this.slice(),r=new Map;for(let e=0;e<t.length;++e)r.set(t[e].key,e);for(const n of e){const e=n.key,i=r.get(e);void 0!==i?t[i]={key:e,schema:t[i].schema.concat(n.schema)}:t.push(n)}return t}}},8785:(e,t,r)=>{const{assert:n}=r(8870),i=r(8068),o=r(8160),s=r(3292),a=r(6354),l={};e.exports=i.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,{schema:t,state:r,prefs:i}){n(t.$_terms.link,"Uninitialized link schema");const o=l.generate(t,e,r,i),s=t.$_terms.link[0].ref;return o.$_validate(e,r.nest(o,`link:${s.display}:${o.type}`),i)},generate:(e,t,r,n)=>l.generate(e,t,r,n),rules:{ref:{method(e){n(!this.$_terms.link,"Cannot reinitialize schema"),e=s.ref(e),n("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),n("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(e=!0){return this.$_setFlag("relative",e)}}},overrides:{concat(e){n(this.$_terms.link,"Uninitialized link schema"),n(o.isSchema(e),"Invalid schema object"),n("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(n(t.link,"Invalid link description missing link"),e.ref(t.link))}}),l.generate=function(e,t,r,n){let i=r.mainstay.links.get(e);if(i)return i._generate(t,r,n).schema;const o=e.$_terms.link[0].ref,{perspective:s,path:a}=l.perspective(o,r);l.assert(s,"which is outside of schema boundaries",o,e,r,n);try{i=a.length?s.$_reach(a):s}catch(t){l.assert(!1,"to non-existing schema",o,e,r,n)}return l.assert("link"!==i.type,"which is another link",o,e,r,n),e._flags.relative||r.mainstay.links.set(e,i),i._generate(t,r,n).schema},l.perspective=function(e,t){if("local"===e.type){for(const{schema:r,key:n}of t.schemas){if((r._flags.id||n)===e.path[0])return{perspective:r,path:e.path.slice(1)};if(r.$_terms.shared)for(const t of r.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},l.assert=function(e,t,r,i,o,s){e||n(!1,`"${a.label(i._flags,o,s)}" contains link reference "${r.display}" ${t}`)}},3832:(e,t,r)=>{const{assert:n}=r(8870),i=r(8068),o=r(8160),s={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/};e.exports=i.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:t,error:r}){if(!e.match(s.numberRx))return;e=e.trim();const n={value:parseFloat(e)};if(0===n.value&&(n.value=0),!t._flags.unsafe)if(e.match(/e/i)){if(s.extractSignificantDigits(e)!==s.extractSignificantDigits(String(n.value)))return n.errors=r("number.unsafe"),n}else{const t=n.value.toString();if(t.match(/e/i))return n;if(t!==s.normalizeDecimal(e))return n.errors=r("number.unsafe"),n}return n}},validate(e,{schema:t,error:r,prefs:n}){if(e===1/0||e===-1/0)return{value:e,errors:r("number.infinity")};if(!o.isNumber(e))return{value:e,errors:r("number.base")};const i={value:e};if(n.convert){const e=t.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);i.value=Math.round(i.value*t)/t}}return 0===i.value&&(i.value=0),!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(i.errors=r("number.unsafe")),i},rules:{compare:{method:!1,validate:(e,t,{limit:r},{name:n,operator:i,args:s})=>o.compare(e,r,i)?e:t.error("number."+n,{limit:s.limit,value:e}),args:[{name:"limit",ref:!0,assert:o.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate:(e,t,{base:r},n)=>e*(1/r)%1==0?e:t.error("number.multiple",{multiple:n.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return n(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,{limit:r}){const n=e.toString().match(s.precisionRx);return Math.max((n[1]?n[1].length:0)-(n[2]?parseInt(n[2],10):0),0)<=r?e:t.error("number.precision",{limit:r,value:e})},convert:!0},sign:{method(e){return n(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,t,{sign:r})=>"negative"===r&&e<0||"positive"===r&&e>0?e:t.error(`number.${r}`)},unsafe:{method(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),s.extractSignificantDigits=function(e){return e.replace(s.exponentialPartRegex,"").replace(s.dotRegex,"").replace(s.trailingZerosRegex,"").replace(s.leadingSignAndZerosRegex,"")},s.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},8966:(e,t,r)=>{const n=r(7824);e.exports=n.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},7417:(e,t,r)=>{const{assert:n,escapeRegex:i}=r(8870),{isDomainValid:o,isEmailValid:s,ipRegex:a,uriRegex:l}=r(4958),u=r(6264),c=r(8068),d=r(8160),f={tlds:u.tlds instanceof Set&&{tlds:{allow:u.tlds,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:/^[a-f0-9]+$/i,ipRegex:a({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=c.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:t,state:r,prefs:n}){const i=t.$_getRule("normalize");i&&(e=e.normalize(i.args.form));const o=t.$_getRule("case");o&&(e="upper"===o.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const s=t.$_getRule("trim");if(s&&s.args.enabled&&(e=e.trim()),t.$_terms.replacements)for(const r of t.$_terms.replacements)e=e.replace(r.pattern,r.replacement);const a=t.$_getRule("hex");if(a&&a.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),t.$_getRule("isoDate")){const t=f.isoDate(e);t&&(e=t)}if(t._flags.truncate){const i=t.$_getRule("max");if(i){let o=i.args.limit;if(d.isResolvable(o)&&(o=o.resolve(e,r,n),!d.limit(o)))return{value:e,errors:t.$_createError("any.ref",o,{ref:i.args.limit,arg:"limit",reason:"must be a positive integer"},r,n)};e=e.slice(0,o)}}return{value:e}}},validate(e,{schema:t,error:r}){if("string"!=typeof e)return{value:e,errors:r("string.base")};if(""===e){const n=t.$_getRule("min");if(n&&0===n.args.limit)return;return{value:e,errors:r("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(e={}){return d.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},n("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),n("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,t,{options:r})=>f.base64Regex[r.paddingRequired][r.urlSafe].test(e)?e:t.error("string.base64")},case:{method(e){return n(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,t,{direction:r})=>"lower"===r&&e===e.toLocaleLowerCase()||"upper"===r&&e===e.toLocaleUpperCase()?e:t.error(`string.${r}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let r=e.length,n=0,i=1;for(;r--;){const t=e.charAt(r)*i;n+=t-9*(t>9),i^=3}return n>0&&n%10==0?e:t.error("string.creditCard")}},dataUri:{method(e={}){return d.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},n("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,{options:r}){const n=e.match(f.dataUriRegex);if(n){if(!n[2])return e;if("base64"!==n[2])return e;if(f.base64Regex[r.paddingRequired].false.test(n[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&d.assertOptions(e,["allowFullyQualified","allowUnicode","allowUnderscore","maxDomainSegments","minDomainSegments","tlds"]);const t=f.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate:(e,t,r,{address:n})=>o(e,n)?e:t.error("string.domain")},email:{method(e={}){d.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),n(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=f.addressOptions(e),r=new RegExp(`\\s*[${e.separator?i(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:r,address:t})},validate(e,t,{options:r},{regex:n,address:i}){const o=r.multiple?e.split(n):[e],a=[];for(const e of o)s(e,i)||a.push(e);return a.length?t.error("string.email",{value:e,invalids:a}):e}},guid:{alias:"uuid",method(e={}){d.assertOptions(e,["version","separator"]);let t="";if(e.version){const r=[].concat(e.version);n(r.length>=1,"version must have at least 1 valid version specified");const i=new Set;for(let e=0;e<r.length;++e){const o=r[e];n("string"==typeof o,"version at position "+e+" must be a string");const s=f.guidVersions[o.toLowerCase()];n(s,"version at position "+e+" must be one of "+Object.keys(f.guidVersions).join(", ")),n(!i.has(s),"version at position "+e+" must not be a duplicate"),t+=s,i.add(s)}}n(f.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const r=void 0===e.separator?"[:-]?":!0===e.separator?"[:-]":!1===e.separator?"[]?":`\\${e.separator}`,i=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${r})[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:i})},validate(e,t,r,{regex:n}){const i=n.exec(e);return i?f.guidBrackets[i[1]]!==i[i.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(e={}){return d.assertOptions(e,["byteAligned"]),e={byteAligned:!1,...e},n("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,t,{options:r})=>f.hexRegex.test(e)?r.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>o(e,{minDomainSegments:1})||f.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){d.assertOptions(e,["cidr","version"]);const{cidr:t,versions:r,regex:n}=a(e),i=e.version?r:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:i}},regex:n})},validate:(e,t,{options:r},{regex:n})=>n.test(e)?e:r.version?t.error("string.ipVersion",{value:e,cidr:r.cidr,version:r.version}):t.error("string.ip",{value:e,cidr:r.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:t})=>f.isoDate(e)?e:t("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>f.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return f.length(this,"length",e,"=",t)},validate(e,t,{limit:r,encoding:n},{name:i,operator:o,args:s}){const a=!n&&e.length;return d.compare(a,r,o)?e:t.error("string."+i,{limit:s.limit,value:e,encoding:n})},args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return f.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return f.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){return n(f.normalizationForms.includes(e),"normalization form must be one of "+f.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:t},{form:r})=>e===e.normalize(r)?e:t("string.normalize",{value:e,form:r}),convert:!0},pattern:{alias:"regex",method(e,t={}){n(e instanceof RegExp,"regex must be a RegExp"),n(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),d.assertOptions(t,["invert","name"]);const r=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:r})},validate:(e,t,{regex:r,options:n},{errorCode:i})=>r.test(e)^n.invert?e:t.error(i,{name:n.name,regex:r,value:e}),args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(i(e),"g")),n(e instanceof RegExp,"pattern must be a RegExp"),n("string"==typeof t,"replacement must be a String");const r=this.clone();return r.$_terms.replacements||(r.$_terms.replacements=[]),r.$_terms.replacements.push({pattern:e,replacement:t}),r}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,t,{enabled:r})=>r&&e!==e.trim()?t.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){d.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&d.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:r}=l(e),n=e.domain?f.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:n,scheme:r})},validate(e,t,{options:r},{regex:n,domain:i,scheme:s}){if(["http:/","https:/"].includes(e))return t.error("string.uri");const a=n.exec(e);if(a){const n=a[1]||a[2];return!i||r.allowRelative&&!n||o(n,i)?e:t.error("string.domain",{value:n})}return r.relativeOnly?t.error("string.uriRelativeOnly"):r.scheme?t.error("string.uriCustomScheme",{scheme:s,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:r,replacement:n}of t.replacements)e=e.replace(r,n);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),f.addressOptions=function(e){if(!e)return e;if(n(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),n(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return n(f.tlds,"Built-in TLD list disabled"),Object.assign({},e,f.tlds);n("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),n(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),n(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),f.validateTlds(e.tlds.deny,"tlds.deny"),e;const r=e.tlds.allow;return r?!0===r?(n(f.tlds,"Built-in TLD list disabled"),Object.assign({},e,f.tlds)):(Array.isArray(r)&&(e=Object.assign({},e,{tlds:{allow:new Set(r)}})),n(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),f.validateTlds(e.tlds.allow,"tlds.allow"),e):{...e,tlds:!1}},f.validateTlds=function(e,t){for(const r of e)n(o(r,{minDomainSegments:1,maxDomainSegments:1}),`${t} must contain valid top level domain names`)},f.isoDate=function(e){if(!d.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},f.length=function(e,t,r,i,o){return n(!o||!1,"Invalid encoding:",o),e.$_addRule({name:t,method:"length",args:{limit:r,encoding:o},operator:i})}},8826:(e,t,r)=>{const{assert:n}=r(8870),i=r(8068),o={};o.Map=class extends Map{slice(){return new o.Map(this)}},e.exports=i.extend({type:"symbol",terms:{map:{init:new o.Map}},coerce:{method(e,{schema:t,error:r}){const n=t.$_terms.map.get(e);return n&&(e=n),t._flags.only&&"symbol"!=typeof e?{value:e,errors:r("symbol.map",{map:t.$_terms.map})}:{value:e}}},validate(e,{error:t}){if("symbol"!=typeof e)return{value:e,errors:t("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),n(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),r=[];for(const i of e){n(i&&i[Symbol.iterator],"Entry must be an iterable");const[e,o]=i;n("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),n("symbol"==typeof o,"Value must be a Symbol"),t.$_terms.map.set(e,o),r.push(o)}return t.valid(...r)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(e,t,r)=>{const{assert:n,clone:i,ignore:o,reach:s}=r(8870),a=r(8160),l=r(6354),u=r(493),c={result:Symbol("result")};t.entry=function(e,t,r){let i=a.defaults;r&&(n(void 0===r.warnings,"Cannot override warnings preference in synchronous validation"),n(void 0===r.artifacts,"Cannot override artifacts preference in synchronous validation"),i=a.preferences(a.defaults,r));const o=c.entry(e,t,i);n(!o.mainstay.externals.length,"Schema with external rules must use validateAsync()");const s={value:o.value};return o.error&&(s.error=o.error),o.mainstay.warnings.length&&(s.warning=l.details(o.mainstay.warnings)),o.mainstay.debug&&(s.debug=o.mainstay.debug),o.mainstay.artifacts&&(s.artifacts=o.mainstay.artifacts),s},t.entryAsync=async function(e,t,r){let n=a.defaults;r&&(n=a.preferences(a.defaults,r));const i=c.entry(e,t,n),o=i.mainstay;if(i.error)throw o.debug&&(i.error.debug=o.debug),i.error;if(o.externals.length){let t=i.value;const u=[];for(const i of o.externals){const d=i.state.path,f="link"===i.schema.type?o.links.get(i.schema):null;let p,h,m=t;const g=d.length?[t]:[],b=d.length?s(e,d):e;if(d.length){p=d[d.length-1];let e=t;for(const t of d.slice(0,-1))e=e[t],g.unshift(e);h=g[0],m=h[p]}try{const e=(e,t)=>(f||i.schema).$_createError(e,m,t,i.state,n),s=await i.method(m,{schema:i.schema,linked:f,state:i.state,prefs:r,original:b,error:e,errorsArray:c.errorsArray,warn:(e,t)=>o.warnings.push((f||i.schema).$_createError(e,m,t,i.state,n)),message:(e,t)=>(f||i.schema).$_createError("external",m,t,i.state,n,{messages:e})});if(void 0===s||s===m)continue;if(s instanceof l.Report){if(o.tracer.log(i.schema,i.state,"rule","external","error"),u.push(s),n.abortEarly)break;continue}if(Array.isArray(s)&&s[a.symbols.errors]){if(o.tracer.log(i.schema,i.state,"rule","external","error"),u.push(...s),n.abortEarly)break;continue}h?(o.tracer.value(i.state,"rule",m,s,"external"),h[p]=s):(o.tracer.value(i.state,"rule",t,s,"external"),t=s)}catch(e){throw n.errors.label&&(e.message+=` (${i.label})`),e}}if(i.value=t,u.length)throw i.error=l.process(u,e,n),o.debug&&(i.error.debug=o.debug),i.error}if(!n.warnings&&!n.debug&&!n.artifacts)return i.value;const u={value:i.value};return o.warnings.length&&(u.warning=l.details(o.warnings)),o.debug&&(u.debug=o.debug),o.artifacts&&(u.artifacts=o.artifacts),u},c.Mainstay=class{constructor(e,t,r){this.externals=[],this.warnings=[],this.tracer=e,this.debug=t,this.links=r,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const e=this._snapshots.pop();this.externals=e.externals,this.warnings=e.warnings}commit(){this._snapshots.pop()}},c.entry=function(e,r,n){const{tracer:i,cleanup:o}=c.tracer(r,n),s=n.debug?[]:null,a=r._ids._schemaChain?new Map:null,d=new c.Mainstay(i,s,a),f=r._ids._schemaChain?[{schema:r}]:null,p=new u([],[],{mainstay:d,schemas:f}),h=t.validate(e,r,p,n);o&&r.$_root.untrace();const m=l.process(h.errors,e,n);return{value:h.value,error:m,mainstay:d}},c.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(n(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:c.ignore}},t.validate=function(e,t,r,n,i={}){if(t.$_terms.whens&&(t=t._generate(e,r,n).schema),t._preferences&&(n=c.prefs(t,n)),t._cache&&n.cache){const n=t._cache.get(e);if(r.mainstay.tracer.debug(r,"validate","cached",!!n),n)return n}const o=(i,o,s)=>t.$_createError(i,e,o,s||r,n),s={original:e,prefs:n,schema:t,state:r,error:o,errorsArray:c.errorsArray,warn:(e,t,n)=>r.mainstay.warnings.push(o(e,t,n)),message:(i,o)=>t.$_createError("custom",e,o,r,n,{messages:i})};r.mainstay.tracer.entry(t,r);const l=t._definition;if(l.prepare&&void 0!==e&&n.convert){const t=l.prepare(e,s);if(t){if(r.mainstay.tracer.value(r,"prepare",e,t.value),t.errors)return c.finalize(t.value,[].concat(t.errors),s);e=t.value}}if(l.coerce&&void 0!==e&&n.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){const t=l.coerce.method(e,s);if(t){if(r.mainstay.tracer.value(r,"coerced",e,t.value),t.errors)return c.finalize(t.value,[].concat(t.errors),s);e=t.value}}const u=t._flags.empty;u&&u.$_match(c.trim(e,t),r.nest(u),a.defaults)&&(r.mainstay.tracer.value(r,"empty",e,void 0),e=void 0);const d=i.presence||t._flags.presence||(t._flags._endedSwitch?null:n.presence);if(void 0===e){if("forbidden"===d)return c.finalize(e,null,s);if("required"===d)return c.finalize(e,[t.$_createError("any.required",e,null,r,n)],s);if("optional"===d){if(t._flags.default!==a.symbols.deepDefault)return c.finalize(e,null,s);r.mainstay.tracer.value(r,"default",e,{}),e={}}}else if("forbidden"===d)return c.finalize(e,[t.$_createError("any.unknown",e,null,r,n)],s);const f=[];if(t._valids){const i=t._valids.get(e,r,n,t._flags.insensitive);if(i)return n.convert&&(r.mainstay.tracer.value(r,"valids",e,i.value),e=i.value),r.mainstay.tracer.filter(t,r,"valid",i),c.finalize(e,null,s);if(t._flags.only){const i=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},r,n);if(n.abortEarly)return c.finalize(e,[i],s);f.push(i)}}if(t._invalids){const i=t._invalids.get(e,r,n,t._flags.insensitive);if(i){r.mainstay.tracer.filter(t,r,"invalid",i);const o=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},r,n);if(n.abortEarly)return c.finalize(e,[o],s);f.push(o)}}if(l.validate){const t=l.validate(e,s);if(t&&(r.mainstay.tracer.value(r,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return f.push(t.errors),c.finalize(e,f,s);if(t.errors.length)return f.push(...t.errors),c.finalize(e,f,s)}}return t._rules.length?c.rules(e,f,s):c.finalize(e,f,s)},c.rules=function(e,t,r){const{schema:n,state:i,prefs:o}=r;for(const s of n._rules){const l=n._definition.rules[s.method];if(l.convert&&o.convert){i.mainstay.tracer.log(n,i,"rule",s.name,"full");continue}let u,d=s.args;if(s._resolve.length){d=Object.assign({},d);for(const t of s._resolve){const r=l.argsByName.get(t),s=d[t].resolve(e,i,o),c=r.normalize?r.normalize(s):s,f=a.validateArg(c,null,r);if(f){u=n.$_createError("any.ref",s,{arg:t,ref:d[t],reason:f},i,o);break}d[t]=c}}u=u||l.validate(e,r,d,s);const f=c.rule(u,s);if(f.errors){if(i.mainstay.tracer.log(n,i,"rule",s.name,"error"),s.warn){i.mainstay.warnings.push(...f.errors);continue}if(o.abortEarly)return c.finalize(e,f.errors,r);t.push(...f.errors)}else i.mainstay.tracer.log(n,i,"rule",s.name,"pass"),i.mainstay.tracer.value(i,"rule",e,f.value,s.name),e=f.value}return c.finalize(e,t,r)},c.rule=function(e,t){return e instanceof l.Report?(c.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[a.symbols.errors]?(e.forEach((e=>c.error(e,t))),{errors:e,value:null}):{errors:null,value:e}},c.error=function(e,t){return t.message&&e._setTemplate(t.message),e},c.finalize=function(e,t,r){t=t||[];const{schema:i,state:o,prefs:s}=r;if(t.length){const n=c.default("failover",void 0,t,r);void 0!==n&&(o.mainstay.tracer.value(o,"failover",e,n),e=n,t=[])}if(t.length&&i._flags.error)if("function"==typeof i._flags.error){t=i._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)n(e instanceof Error||e instanceof l.Report,"error() must return an Error object")}else t=[i._flags.error];if(void 0===e){const n=c.default("default",e,t,r);o.mainstay.tracer.value(o,"default",e,n),e=n}if(i._flags.cast&&void 0!==e){const t=i._definition.cast[i._flags.cast];if(t.from(e)){const n=t.to(e,r);o.mainstay.tracer.value(o,"cast",e,n,i._flags.cast),e=n}}if(i.$_terms.externals&&s.externals&&!1!==s._externals)for(const{method:e}of i.$_terms.externals)o.mainstay.externals.push({method:e,schema:i,state:o,label:l.label(i._flags,o,s)});const a={value:e,errors:t.length?t:null};return i._flags.result&&(a.value="strip"===i._flags.result?void 0:r.original,o.mainstay.tracer.value(o,i._flags.result,e,a.value),o.shadow(e,i._flags.result)),i._cache&&!1!==s.cache&&!i._refs.length&&i._cache.set(r.original,a),void 0===e||a.errors||void 0===i._flags.artifact||(o.mainstay.artifacts=o.mainstay.artifacts||new Map,o.mainstay.artifacts.has(i._flags.artifact)||o.mainstay.artifacts.set(i._flags.artifact,[]),o.mainstay.artifacts.get(i._flags.artifact).push(o.path)),a},c.prefs=function(e,t){const r=t===a.defaults;return r&&e._preferences[a.symbols.prefs]?e._preferences[a.symbols.prefs]:(t=a.preferences(t,e._preferences),r&&(e._preferences[a.symbols.prefs]=t),t)},c.default=function(e,t,r,n){const{schema:o,state:s,prefs:l}=n,u=o._flags[e];if(l.noDefaults||void 0===u)return t;if(s.mainstay.tracer.log(o,s,"rule",e,"full"),!u)return u;if("function"==typeof u){const a=u.length?[i(s.ancestors[0]),n]:[];try{return u(...a)}catch(t){return void r.push(o.$_createError(`any.${e}`,null,{error:t},s,l))}}return"object"!=typeof u?u:u[a.symbols.literal]?u.literal:a.isResolvable(u)?u.resolve(t,s,l):i(u)},c.trim=function(e,t){if("string"!=typeof e)return e;const r=t.$_getRule("trim");return r&&r.args.enabled?e.trim():e},c.ignore={active:!1,debug:o,entry:o,filter:o,log:o,resolve:o,value:o},c.errorsArray=function(){const e=[];return e[a.symbols.errors]=!0,e}},2036:(e,t,r)=>{const{assert:n,deepEqual:i}=r(8870),o=r(8160),s={};e.exports=s.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=s.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){o.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,r){if(e=e||new s.Values,t){if(t._override)return t.clone();for(const r of[...t._values,...t._refs])e.add(r)}if(r)for(const t of[...r._values,...r._refs])e.remove(t);return e.length?e:null}remove(e){o.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,r,n){return!!this.get(e,t,r,n)}get(e,t,r,n){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&n){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e)for(const t of this._values)if(i(t,e))return{value:t};if(t)for(const o of this._refs){const s=o.resolve(e,t,r,null,{in:!0});if(void 0===s)continue;const a=o.in&&"object"==typeof s?Array.isArray(s)?s:Object.keys(s):[s];for(const t of a)if(typeof t==typeof e)if(n&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:o}}else if(i(t,e))return{value:t,ref:o}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){const e=new s.Values(this._values,this._refs);return e._override=this._override,e}concat(e){n(!e._override,"Cannot concat override set of values");const t=new s.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){const e=[];this._override&&e.push({override:!0});for(const t of this._values.values())e.push(t&&"object"==typeof t?{value:t}:t);for(const t of this._refs.values())e.push(t.describe());return e}},s.Values.prototype[o.symbols.values]=!0,s.Values.prototype.slice=s.Values.prototype.clone,s.lowercases=function(e){const t=new Map;if(e)for(const r of e)"string"==typeof r&&t.set(r.toLowerCase(),r);return t}},4958:(e,t,r)=>{r.r(t),r.d(t,{analyzeDomain:()=>h,analyzeEmail:()=>_,errorCodes:()=>i,ipRegex:()=>N,isDomainValid:()=>m,isEmailValid:()=>w,uriDecode:()=>$,uriRegex:()=>k,validateDomainOptions:()=>g});var n=r(1275);const i={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"};function o(e){return{code:e,error:i[e]}}const s=2,a=/[^\x00-\x7f]/,l=/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,u=/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,c=/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,d=/^[a-zA-Z0-9_](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,f=n.URL||URL;function p(e){return!!e.allow}function h(e,t={}){if(!e)return o("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return o("DOMAIN_TOO_LONG");if(a.test(e)){if(!1===t.allowUnicode)return o("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(l.test(e))return o("DOMAIN_INVALID_CHARS");e=function(e){e.includes("%")&&(e=e.replace(/%/g,"%25"));try{return new f(`http://${e}`).host}catch(t){return e}}(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));const r=t.minDomainSegments||s,n=e.split(".");if(n.length<r)return o("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&n.length>t.maxDomainSegments)return o("DOMAIN_SEGMENTS_COUNT_MAX");const i=t.tlds;if(i){const e=n[n.length-1].toLowerCase();if(p(i)){if(!i.allow.has(e))return o("DOMAIN_FORBIDDEN_TLDS")}else if(i.deny.has(e))return o("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<n.length;++e){const r=n[e];if(!r.length)return o("DOMAIN_EMPTY_SEGMENT");if(r.length>63)return o("DOMAIN_LONG_SEGMENT");if(e<n.length-1){if(t.allowUnderscore){if(!d.test(r))return o("DOMAIN_INVALID_CHARS")}else if(!c.test(r))return o("DOMAIN_INVALID_CHARS")}else if(!u.test(r))return o("DOMAIN_INVALID_TLDS_CHARS")}return null}function m(e,t){return!h(e,t)}function g(e){if(e){if("object"!=typeof e.tlds)throw new Error("Invalid options: tlds must be a boolean or an object");if(p(e.tlds)){if(e.tlds.allow instanceof Set==0)throw new Error("Invalid options: tlds.allow must be a Set object or true");if(e.tlds.deny)throw new Error("Invalid options: cannot specify both tlds.allow and tlds.deny lists")}else if(e.tlds.deny instanceof Set==0)throw new Error("Invalid options: tlds.deny must be a Set object")}}var b=r(3975);const y=/[^\x00-\x7f]/,v=new(b.TextEncoder||TextEncoder);function _(e,t){return A(e,t)}function w(e,t){return!A(e,t)}function A(e,t={}){if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return o("EMPTY_STRING");const r=!y.test(e);if(!r){if(!1===t.allowUnicode)return o("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const n=e.split("@");if(2!==n.length)return n.length>2?o("MULTIPLE_AT_CHAR"):o("MISSING_AT_CHAR");const[i,s]=n;if(!i)return o("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return o("ADDRESS_TOO_LONG");if(v.encode(i).length>64)return o("LOCAL_TOO_LONG")}return function(e,t){const r=e.split(".");for(const e of r){if(!e.length)return o("EMPTY_LOCAL_SEGMENT");if(t){if(!S.test(e))return o("INVALID_LOCAL_CHARS")}else for(const t of e){if(S.test(t))continue;const e=x(t);if(!O.test(e))return o("INVALID_LOCAL_CHARS")}}return null}(i,r)||h(s,t)}function x(e){return Array.from(v.encode(e),(e=>String.fromCharCode(e))).join("")}const S=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,O=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("|"));var E=r(375),j=r.n(E),T=r(6064),C=r.n(T);const R=function(){const e={},t="\\dA-Fa-f",r="["+t+"]",n="\\w-\\.~",i="!\\$&'\\(\\)\\*\\+,;=",o="%"+t,s=n+o+i+":@",a="["+s+"]",l="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+l+"\\.){3}"+l;const u=r+"{1,4}",c="(?:"+u+":"+u+"|"+e.ipv4address+")",d="(?:"+u+":){6}"+c,f="::(?:"+u+":){5}"+c,p="(?:"+u+")?::(?:"+u+":){4}"+c,h="(?:(?:"+u+":){0,1}"+u+")?::(?:"+u+":){3}"+c,m="(?:(?:"+u+":){0,2}"+u+")?::(?:"+u+":){2}"+c,g="(?:(?:"+u+":){0,3}"+u+")?::"+u+":"+c,b="(?:(?:"+u+":){0,4}"+u+")?::"+c,y="(?:(?:"+u+":){0,5}"+u+")?::"+u,v="(?:(?:"+u+":){0,6}"+u+")?::";e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:"+d+"|"+f+"|"+p+"|"+h+"|"+m+"|"+g+"|"+b+"|"+y+"|"+v+")",e.ipvFuture="v"+r+"+\\.["+n+i+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const _="["+n+o+i+":]*",w="["+n+o+i+"]{1,255}",A="(?:\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]|"+e.ipv4address+"|"+w+")",x="(?:"+_+"@)?"+A+"(?::\\d*)?",S="(?:"+_+"@)?("+A+")(?::\\d*)?",O=a+"*",E=a+"+",j="(?:\\/"+O+")*",T="\\/(?:"+E+j+")?",C=E+j,R="["+n+o+i+"@]+"+j,I="(?:\\/\\/\\/"+O+j+")";return e.hierPart="(?:(?:\\/\\/"+x+j+")|"+T+"|"+C+"|"+I+")",e.hierPartCapture="(?:(?:\\/\\/"+S+j+")|"+T+"|"+C+")",e.relativeRef="(?:(?:\\/\\/"+x+j+")|"+T+"|"+R+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+S+j+")|"+T+"|"+R+"|)",e.query="["+s+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+s+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+s+"\\/\\?]*",e}(),I={v4Cidr:R.ipv4Cidr,v6Cidr:R.ipv6Cidr,ipv4:R.ipv4address,ipv6:R.ipv6address,ipvfuture:R.ipvFuture};function D(e){const t=R,r="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",n=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return F(n+r);let i="";if(e.scheme){j()(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const r=[].concat(e.scheme);j()(r.length>=1,"scheme must have at least 1 scheme specified");const n=[];for(let e=0;e<r.length;++e){const i=r[e];j()(i instanceof RegExp||"string"==typeof i,"scheme at position "+e+" must be a RegExp or String"),i instanceof RegExp?n.push(i.source.toString()):(j()(t.schemeRegex.test(i),"scheme at position "+e+" must be a valid scheme"),n.push(C()(i)))}i=n.join("|")}const o="(?:"+(i?"(?:"+i+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")";return F((e.allowRelative?"(?:"+o+"|"+n+")":o)+r,i)}function F(e,t=null){return{raw:e=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${e}`,regex:new RegExp(`^${e}$`),scheme:t}}const P=D({});function k(e={}){return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?D(e):P}function N(e={}){const t=e.cidr||"optional";j()(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),j()(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let r=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(r)||(r=[r]),j()(r.length>=1,"options.version must have at least 1 version specified");for(const e of r)j()("string"==typeof e&&e===e.toLowerCase(),"Invalid options.version value"),j()(["ipv4","ipv6","ipvfuture"].includes(e),"options.version contains unknown version "+e+" - must be one of ipv4, ipv6, ipvfuture");r=Array.from(new Set(r));const n=`(?:${r.map((e=>{if("forbidden"===t)return I[e];const r=`\\/${"ipv4"===e?I.v4Cidr:I.v6Cidr}`;return"required"===t?`${I[e]}${r}`:`${I[e]}(?:${r})?`})).join("|")})`,i=new RegExp(`^${n}$`);return{cidr:t,versions:r,regex:i,raw:n}}const M={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15},L={accept:12,reject:0,data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7]};function $(e){let t=e.indexOf("%");if(-1===t)return e;let r="",n=0,i=0,o=t,s=L.accept;for(;t>-1&&t<e.length;){const a=q(e[t+1],4)|q(e[t+2],0),l=L.data[a];if(s=L.data[256+s+l],i=i<<6|a&L.data[364+l],s!==L.accept){if(s===L.reject)return null;if(t+=3,t>=e.length||"%"!==e[t])return null}else r+=e.slice(n,o),r+=i<=65535?String.fromCharCode(i):String.fromCharCode(55232+(i>>10),56320+(1023&i)),i=0,n=t+3,t=e.indexOf("%",n),o=t}return r+e.slice(n)}function q(e,t){const r=M[e];return void 0===r?255:r<<t}},4964:(e,t)=>{const r={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e,t={}){if(!t[r.settings]&&t.constants)for(const e in t.constants){const r=t.constants[e];if(null!==r&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${e} contains invalid ${typeof r} value type`)}this.settings=t[r.settings]?t:Object.assign({[r.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let n=[],i="",o=0,s=!1;const a=e=>{if(o)throw new Error("Formula missing closing parenthesis");const a=n.length?n[n.length-1]:null;if(s||i||e){if(a&&"reference"===a.type&&")"===e)return a.type="function",a.value=this._subFormula(i,a.value),void(i="");if(")"===e){const e=new t.Parser(i,this.settings);n.push({type:"segment",value:e})}else if(s){if("]"===s)return n.push({type:"reference",value:i}),void(i="");n.push({type:"literal",value:i})}else if(r.operatorCharacters.includes(i))a&&"operator"===a.type&&r.operators.includes(a.value+i)?a.value+=i:n.push({type:"operator",value:i});else if(i.match(r.numberRx))n.push({type:"constant",value:parseFloat(i)});else if(void 0!==this.settings.constants[i])n.push({type:"constant",value:this.settings.constants[i]});else{if(!i.match(r.tokenRx))throw new Error(`Formula contains invalid token: ${i}`);n.push({type:"reference",value:i})}i=""}};for(const t of e)s?t===s?(a(),s=!1):i+=t:o?"("===t?(i+=t,++o):")"===t?(--o,o?i+=t:a(t)):i+=t:t in r.literals?s=r.literals[t]:"("===t?(a(),++o):r.operatorCharacters.includes(t)?(a(),i=t,a()):" "!==t?i+=t:a();a(),n=n.map(((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==n[t-1].type?e:{type:"operator",value:"n"}));let l=!1;for(const e of n){if("operator"===e.type){if(r.operatorsPrefix.includes(e.value))continue;if(!l)throw new Error("Formula contains an operator in invalid position");if(!r.operators.includes(e.value))throw new Error(`Formula contains an unknown operator ${e.value}`)}else if(l)throw new Error("Formula missing expected operator");l=!l}if(!l)throw new Error("Formula contains invalid trailing operator");1===n.length&&["reference","literal","constant"].includes(n[0].type)&&(this.single={type:"reference"===n[0].type?"reference":"value",value:n[0].value}),this._parts=n.map((e=>{if("operator"===e.type)return r.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error(`Formula contains invalid reference ${e.value}`);return this.settings.reference?this.settings.reference(e.value):r.reference(e.value)}))}_subFormula(e,n){const i=this.settings.functions[n];if("function"!=typeof i)throw new Error(`Formula contains unknown function ${n}`);let o=[];if(e){let t="",i=0,s=!1;const a=()=>{if(!t)throw new Error(`Formula contains function ${n} with invalid arguments ${e}`);o.push(t),t=""};for(let n=0;n<e.length;++n){const o=e[n];s?(t+=o,o===s&&(s=!1)):o in r.literals&&!i?(t+=o,s=r.literals[o]):","!==o||i?(t+=o,"("===o?++i:")"===o&&--i):a()}a()}return o=o.map((e=>new t.Parser(e,this.settings))),function(e){const t=[];for(const r of o)t.push(r.evaluate(e));return i.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let n=t.length-2;n>=0;--n){const i=t[n];if(i&&"operator"===i.type){const o=t[n+1];t.splice(n+1,1);const s=r.evaluate(o,e);t[n]=r.single(i.value,s)}}return r.operatorsOrder.forEach((n=>{for(let i=1;i<t.length-1;)if(n.includes(t[i])){const n=t[i],o=r.evaluate(t[i-1],e),s=r.evaluate(t[i+1],e);t.splice(i,2);const a=r.calculate(n,o,s);t[i-1]=0===a?0:a}else i+=2})),r.evaluate(t[0],e)}},t.Parser.prototype[r.symbol]=!0,r.reference=function(e){return function(t){return t&&void 0!==t[e]?t[e]:null}},r.evaluate=function(e,t){return null===e?null:"function"==typeof e?e(t):e[r.symbol]?e.evaluate(t):e},r.single=function(e,t){if("!"===e)return!t;const r=-t;return 0===r?0:r},r.calculate=function(e,t,n){if("??"===e)return r.exists(t)?t:n;if("string"==typeof t||"string"==typeof n){if("+"===e)return(t=r.exists(t)?t:"")+(r.exists(n)?n:"")}else switch(e){case"^":return Math.pow(t,n);case"*":return t*n;case"/":return t/n;case"%":return t%n;case"+":return t+n;case"-":return t-n}switch(e){case"<":return t<n;case"<=":return t<=n;case">":return t>n;case">=":return t>=n;case"==":return t===n;case"!=":return t!==n;case"&&":return t&&n;case"||":return t||n}return null},r.exists=function(e){return null!=e}},978:(e,t,r)=>{const n=r(375),i=r(8571),o=r(1687),s=r(9621),a={};e.exports=function(e,t,r={}){if(n(e&&"object"==typeof e,"Invalid defaults value: must be an object"),n(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),n("object"==typeof r,"Invalid options: must be an object"),!t)return null;if(r.shallow)return a.applyToDefaultsWithShallow(e,t,r);const s=i(e);if(!0===t)return s;const l=void 0!==r.nullOverride&&r.nullOverride;return o(s,t,{nullOverride:l,mergeArrays:!1})},a.applyToDefaultsWithShallow=function(e,t,r){const l=r.shallow;n(Array.isArray(l),"Invalid keys");const u=new Map,c=!0===t?null:new Set;for(let r of l){r=Array.isArray(r)?r:r.split(".");const n=s(e,r);n&&"object"==typeof n?u.set(n,c&&s(t,r)||n):c&&c.add(r)}const d=i(e,{},u);if(!c)return d;for(const e of c)a.reachCopy(d,t,e);const f=void 0!==r.nullOverride&&r.nullOverride;return o(d,t,{nullOverride:f,mergeArrays:!1})},a.reachCopy=function(e,t,r){for(const e of r){if(!(e in t))return;const r=t[e];if("object"!=typeof r||null===r)return;t=r}const n=t;let i=e;for(let e=0;e<r.length-1;++e){const t=r[e];"object"!=typeof i[t]&&(i[t]={}),i=i[t]}i[r[r.length-1]]=n}},375:(e,t,r)=>{const n=r(4213),i=r(8761),o=e.exports=function(e,...t){if(e)return;if(1===t.length&&t[0]instanceof Error)throw t[0];const r=t.filter((e=>""!==e)).map((e=>"string"==typeof e?e:e instanceof Error?e.message:i(e)));throw new n(r.join(" "),o)}},4213:e=>{e.exports=class extends Error{constructor(e,t){var r,n,i,o;super(e||"Unknown error"),r=this,i="AssertError",(n="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n="name"))?o:String(o))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}}},9367:e=>{const t={};e.exports=t.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=t.Bench.now()}elapsed(){return t.Bench.now()-this.ts}static now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}}},8630:(e,t,r)=>{const n=r(738);e.exports=function(){return new Promise(n)}},8571:(e,t,r)=>{const n=r(9621),i=r(4277),o=r(7043),s={needsProtoHack:new Set([i.set,i.map,i.weakSet,i.weakMap])};e.exports=s.clone=function(e,t={},r=null){if("object"!=typeof e||null===e)return e;let n=s.clone,a=r;if(t.shallow){if(!0!==t.shallow)return s.cloneWithShallow(e,t);n=e=>e}else if(a){const t=a.get(e);if(t)return t}else a=new Map;const l=i.getInternalProto(e);switch(l){case i.buffer:return(!1).from(e);case i.date:return new Date(e.getTime());case i.regex:case i.url:return new l.constructor(e)}const u=s.base(e,l,t);if(u===e)return e;if(a&&a.set(e,u),l===i.set)for(const r of e)u.add(n(r,t,a));else if(l===i.map)for(const[r,i]of e)u.set(r,n(i,t,a));const c=o.keys(e,t);for(const r of c){if("__proto__"===r)continue;if(l===i.array&&"length"===r){u.length=e.length;continue}const o=Object.getOwnPropertyDescriptor(e,r);o?o.get||o.set?Object.defineProperty(u,r,o):o.enumerable?u[r]=n(e[r],t,a):Object.defineProperty(u,r,{enumerable:!1,writable:!0,configurable:!0,value:n(e[r],t,a)}):Object.defineProperty(u,r,{enumerable:!0,writable:!0,configurable:!0,value:n(e[r],t,a)})}return u},s.cloneWithShallow=function(e,t){const r=t.shallow;(t=Object.assign({},t)).shallow=!1;const i=new Map;for(const t of r){const r=n(e,t);"object"!=typeof r&&"function"!=typeof r||i.set(r,r)}return s.clone(e,t,i)},s.base=function(e,t,r){if(!1===r.prototype)return s.needsProtoHack.has(t)?new t.constructor:t===i.array?[]:{};const n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===i.array){const e=[];return n!==t&&Object.setPrototypeOf(e,n),e}if(s.needsProtoHack.has(t)){const e=new n.constructor;return n!==t&&Object.setPrototypeOf(e,n),e}return Object.create(n)}},1467:(e,t,r)=>{const n=r(375),i=r(9474),o=r(6064),s=r(7043),a={};e.exports=function(e,t,r={}){return"object"!=typeof t&&(t=[t]),n(!Array.isArray(t)||t.length,"Values array cannot be empty"),"string"==typeof e?a.string(e,t,r):Array.isArray(e)?a.array(e,t,r):(n("object"==typeof e,"Reference must be string or an object"),a.object(e,t,r))},a.array=function(e,t,r){if(Array.isArray(t)||(t=[t]),!e.length)return!1;if(r.only&&r.once&&e.length!==t.length)return!1;let n;const i=new Map;for(const e of t)if(r.deep&&e&&"object"==typeof e){var o;n=null!==(o=n)&&void 0!==o?o:a.compare(r);let t=!1;for(const[r,o]of i.entries())if(n(r,e)){++o.allowed,t=!0;break}t||i.set(e,{allowed:1,hits:0})}else{const t=i.get(e);t?++t.allowed:i.set(e,{allowed:1,hits:0})}let s=0;for(const t of e){let e;if(r.deep&&t&&"object"==typeof t){var l;n=null!==(l=n)&&void 0!==l?l:a.compare(r);for(const[r,o]of i.entries())if(n(r,t)){e=o;break}}else e=i.get(t);if(e&&(++e.hits,++s,r.once&&e.hits>e.allowed))return!1}if(r.only&&s!==e.length)return!1;for(const e of i.values())if(e.hits!==e.allowed&&e.hits<e.allowed&&!r.part)return!1;return!!s},a.object=function(e,t,r){n(void 0===r.once,"Cannot use option once with object");const i=s.keys(e,r);if(!i.length)return!1;if(Array.isArray(t))return a.array(i,t,r);const o=Object.getOwnPropertySymbols(t).filter((e=>t.propertyIsEnumerable(e))),l=[...Object.keys(t),...o],u=a.compare(r),c=new Set(l);for(const n of i)if(c.has(n)){if(!u(t[n],e[n]))return!1;c.delete(n)}else if(r.only)return!1;return!c.size||!!r.part&&c.size<l.length},a.string=function(e,t,r){if(""===e)return 1===t.length&&""===t[0]||!r.once&&!t.some((e=>""!==e));const i=new Map,s=[];for(const e of t)if(n("string"==typeof e,"Cannot compare string reference to non-string value"),e){const t=i.get(e);t?++t.allowed:(i.set(e,{allowed:1,hits:0}),s.push(o(e)))}else if(r.once||r.only)return!1;if(!s.length)return!0;const a=new RegExp(`(${s.join("|")})`,"g"),l=e.replace(a,((e,t)=>(++i.get(t).hits,"")));if(r.only&&l)return!1;let u=!1;for(const e of i.values())if(e.hits&&(u=!0),e.hits!==e.allowed){if(e.hits<e.allowed&&!r.part)return!1;if(r.once)return!1}return!!u},a.compare=function(e){if(!e.deep)return a.shallow;const t=void 0!==e.only,r=void 0!==e.part,n={prototype:t?e.only:!!r&&!e.part,part:t?!e.only:!!r&&e.part};return(e,t)=>i(e,t,n)},a.shallow=function(e,t){return e===t}},9474:(e,t,r)=>{const n=r(4277),i={mismatched:null};e.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!i.isDeepEqual(e,t,r,[])},i.isDeepEqual=function(e,t,r,o){if(e===t)return 0!==e||1/e==1/t;const s=typeof e;if(s!==typeof t)return!1;if(null===e||null===t)return!1;if("function"===s){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if("object"!==s)return e!=e&&t!=t;const a=i.getSharedType(e,t,!!r.prototype);switch(a){case n.buffer:return!1;case n.promise:return e===t;case n.regex:case n.url:return e.toString()===t.toString();case i.mismatched:return!1}for(let r=o.length-1;r>=0;--r)if(o[r].isSame(e,t))return!0;o.push(new i.SeenEntry(e,t));try{return!!i.isDeepEqualObj(a,e,t,r,o)}finally{o.pop()}},i.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?i.mismatched:n.getInternalProto(e);const o=n.getInternalProto(e);return o!==n.getInternalProto(t)?i.mismatched:o},i.valueOf=function(e){const t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},i.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},i.isSetSimpleEqual=function(e,t){for(const r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0},i.isDeepEqualObj=function(e,t,r,o,s){const{isDeepEqual:a,valueOf:l,hasOwnEnumerableProperty:u}=i,{keys:c,getOwnPropertySymbols:d}=Object;if(e===n.array){if(!o.part){if(t.length!==r.length)return!1;for(let e=0;e<t.length;++e)if(!a(t[e],r[e],o,s))return!1;return!0}for(const e of t)for(const t of r)if(a(e,t,o,s))return!0}else if(e===n.set){if(t.size!==r.size)return!1;if(!i.isSetSimpleEqual(t,r)){const e=new Set(Set.prototype.values.call(r));for(const r of Set.prototype.values.call(t)){if(e.delete(r))continue;let t=!1;for(const n of e)if(a(r,n,o,s)){e.delete(n),t=!0;break}if(!t)return!1}}}else if(e===n.map){if(t.size!==r.size)return!1;for(const[e,n]of Map.prototype.entries.call(t)){if(void 0===n&&!Map.prototype.has.call(r,e))return!1;if(!a(n,Map.prototype.get.call(r,e),o,s))return!1}}else if(e===n.error&&(t.name!==r.name||t.message!==r.message))return!1;const f=l(t),p=l(r);if((t!==f||r!==p)&&!a(f,p,o,s))return!1;const h=c(t);if(!o.part&&h.length!==c(r).length&&!o.skip)return!1;let m=0;for(const e of h)if(o.skip&&o.skip.includes(e))void 0===r[e]&&++m;else{if(!u(r,e))return!1;if(!a(t[e],r[e],o,s))return!1}if(!o.part&&h.length-m!==c(r).length)return!1;if(!1!==o.symbols){const e=d(t),n=new Set(d(r));for(const i of e){var g;if(null===(g=o.skip)||void 0===g||!g.includes(i))if(u(t,i)){if(!u(r,i))return!1;if(!a(t[i],r[i],o,s))return!1}else if(u(r,i))return!1;n.delete(i)}for(const e of n)if(u(r,e))return!1}return!0},i.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}},4168:(e,t,r)=>{const n=r(375);e.exports=function(e){return n(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(e),"Bad attribute value ("+e+")"),e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}},5277:e=>{const t={};e.exports=function(e){if(!e)return"";let r="";for(let n=0;n<e.length;++n){const i=e.charCodeAt(n);t.isSafe(i)?r+=e[n]:r+=t.escapeHtmlChar(i)}return r},t.escapeHtmlChar=function(e){return t.namedHtml.get(e)||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)},t.isSafe=function(e){return t.safeCharCodes.has(e)},t.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]),t.safeCharCodes=function(){const e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&e.add(t);return e}()},7973:e=>{const t={};e.exports=function(e){return e?e.replace(/[<>&\u2028\u2029]/g,t.escape):""},t.escape=function(e){return t.replacements.get(e)},t.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])},6064:e=>{e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},655:e=>{const t={};e.exports=t.flatten=function(e,r){const n=r||[];for(const r of e)Array.isArray(r)?t.flatten(r,n):n.push(r);return n}},738:e=>{e.exports=function(){}},8870:(e,t,r)=>{t.applyToDefaults=r(978),t.assert=r(375),t.AssertError=r(4213),t.Bench=r(9367),t.block=r(8630),t.clone=r(8571),t.contain=r(1467),t.deepEqual=r(9474),t.escapeHeaderAttribute=r(4168),t.escapeHtml=r(5277),t.escapeJson=r(7973),t.escapeRegex=r(6064),t.flatten=r(655),t.ignore=r(738),t.intersect=r(5088),t.isPromise=r(7259),t.merge=r(1687),t.once=r(5022),t.reach=r(9621),t.reachTemplate=r(4069),t.stringify=r(8761),t.wait=r(2620)},5088:e=>{const t={};e.exports=function(e,r,n={}){if(!e||!r)return n.first?null:[];const i=[],o=Array.isArray(e)?new Set(e):e,s=new Set;for(const e of r)if(t.has(o,e)&&!s.has(e)){if(n.first)return e;i.push(e),s.add(e)}return n.first?null:i},t.has=function(e,t){return"function"==typeof e.has?e.has(t):void 0!==e[t]}},7259:e=>{e.exports=function(e){return"function"==typeof(null==e?void 0:e.then)}},1687:(e,t,r)=>{const n=r(375),i=r(8571),o=r(7043),s={};e.exports=s.merge=function(e,t,r){if(n(e&&"object"==typeof e,"Invalid target value: must be an object"),n(null==t||"object"==typeof t,"Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){n(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let n=0;n<t.length;++n)e.push(i(t[n],{symbols:r.symbols}));return e}const a=o.keys(t,r);for(let n=0;n<a.length;++n){const o=a[n];if("__proto__"===o||!Object.prototype.propertyIsEnumerable.call(t,o))continue;const l=t[o];if(l&&"object"==typeof l){if(e[o]===l)continue;!e[o]||"object"!=typeof e[o]||Array.isArray(e[o])!==Array.isArray(l)||l instanceof Date||l instanceof RegExp?e[o]=i(l,{symbols:r.symbols}):s.merge(e[o],l,r)}else(null!=l||r.nullOverride)&&(e[o]=l)}return e}},5022:e=>{const t=Symbol("wrapped");e.exports=function(e){if(e[t])return e;let r=!1;const n=function(...t){r||(r=!0,e(...t))};return n[t]=!0,n}},9621:(e,t,r)=>{const n=r(375),i={};e.exports=function(e,t,r){if(!1===t||null==t)return e;"string"==typeof(r=r||{})&&(r={separator:r});const o=Array.isArray(t);n(!o||!r.separator,"Separator option is not valid for array-based chain");const s=o?t:t.split(r.separator||".");let a=e;for(let e=0;e<s.length;++e){let o=s[e];const l=r.iterables&&i.iterables(a);if(Array.isArray(a)||"set"===l){const e=Number(o);Number.isInteger(e)&&(o=e<0?a.length+e:e)}if(!a||"function"==typeof a&&!1===r.functions||!l&&void 0===a[o]){n(!r.strict||e+1===s.length,"Missing segment",o,"in reach path ",t),n("object"==typeof a||!0===r.functions||"function"!=typeof a,"Invalid segment",o,"in reach path ",t),a=r.default;break}a=l?"set"===l?[...a][o]:a.get(o):a[o]}return a},i.iterables=function(e){return e instanceof Set?"set":e instanceof Map?"map":void 0}},4069:(e,t,r)=>{const n=r(9621);e.exports=function(e,t,r){return t.replace(/{([^{}]+)}/g,((t,i)=>{const o=n(e,i,r);return null!=o?o:""}))}},8761:e=>{e.exports=function(...e){try{return JSON.stringify(...e)}catch(e){return"[Cannot display object: "+e.message+"]"}}},4277:(e,t)=>{const r={};t=e.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,url:URL.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},r.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object URL]",t.url],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const n=Object.prototype.toString.call(e);return r.typeMap.get(n)||t.generic}},7043:(e,t)=>{t.keys=function(e,t={}){return!1!==t.symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},2620:e=>{e.exports=function(e,t,r){if("bigint"==typeof e&&(e=Number(e)),e>=Number.MAX_SAFE_INTEGER&&(e=1/0),"number"!=typeof e&&void 0!==e)throw new TypeError("Timeout must be a number or bigint");return new Promise((n=>{const i=r?r.setTimeout:setTimeout,o=()=>{const r=Math.min(e,2147483647);e-=r,i((()=>e>0?o():n(t)),r)};e!==1/0&&o()}))}},7593:(e,t)=>{t.location=function(e=0){const t=Error.prepareStackTrace;Error.prepareStackTrace=(e,t)=>t;const r={};Error.captureStackTrace(r,this);const n=r.stack[e+1];return Error.prepareStackTrace=t,{filename:n.getFileName(),line:n.getLineNumber()}}},6264:(e,t,r)=>{r.r(t),r.d(t,{tlds:()=>n});const n=new Set(["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].map((e=>e.toLowerCase())))},3652:(e,t,r)=>{const{assert:n}=r(8870),i={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){var r,i,o,s,a;t=null!==(r=t)&&void 0!==r?r:{};const l=[].concat(null!==(i=t.before)&&void 0!==i?i:[]),u=[].concat(null!==(o=t.after)&&void 0!==o?o:[]),c=null!==(s=t.group)&&void 0!==s?s:"?",d=null!==(a=t.sort)&&void 0!==a?a:0;n(!l.includes(c),`Item cannot come before itself: ${c}`),n(!l.includes("?"),"Item cannot come before unassociated items"),n(!u.includes(c),`Item cannot come after itself: ${c}`),n(!u.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:d,before:l,after:u,group:c,node:t};this._items.push(e)}if(!t.manual){const e=this._sort();n(e,"item","?"!==c?`added into group ${c}`:"","created a dependencies error")}return this.nodes}merge(e){Array.isArray(e)||(e=[e]);for(const t of e)if(t)for(const e of t._items)this._items.push(Object.assign({},e));this._items.sort(i.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const t=this._sort();return n(t,"merge created a dependencies error"),this.nodes}sort(){const e=this._sort();return n(e,"sort created a dependencies error"),this.nodes}_sort(){const e={},t=Object.create(null),r=Object.create(null);for(const o of this._items){var n;const s=o.seq,a=o.group;r[a]=null!==(n=r[a])&&void 0!==n?n:[],r[a].push(s),e[s]=o.before;for(const e of o.after){var i;t[e]=null!==(i=t[e])&&void 0!==i?i:[],t[e].push(s)}}for(const t in e){const n=[];for(const i in e[t]){var o;const s=e[t][i];r[s]=null!==(o=r[s])&&void 0!==o?o:[],n.push(...r[s])}e[t]=n}for(const n in t)if(r[n])for(const i of r[n])e[i].push(...t[n]);const s={};for(const t in e){const r=e[t];for(const e of r){var a;s[e]=null!==(a=s[e])&&void 0!==a?a:[],s[e].push(t)}}const l={},u=[];for(let e=0;e<this._items.length;++e){let t=e;if(s[e]){t=null;for(let e=0;e<this._items.length;++e){if(!0===l[e])continue;s[e]||(s[e]=[]);const r=s[e].length;let n=0;for(let t=0;t<r;++t)l[s[e][t]]&&++n;if(n===r){t=e;break}}}null!==t&&(l[t]=!0,u.push(t))}if(u.length!==this._items.length)return!1;const c={};for(const e of this._items)c[e.seq]=e;this._items=[],this.nodes=[];for(const e of u){const t=c[e];this.nodes.push(t.node),this._items.push(t)}return!0}},i.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1},1275:()=>{},3975:()=>{},5934:e=>{e.exports=JSON.parse('{"version":"17.11.0"}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(5107)})(),e.exports=t()},3493:(e,t,r)=>{r(6603),e.exports=self.fetch.bind(self)},3103:(e,t,r)=>{var n=r(4715)(r(8942),"DataView");e.exports=n},9770:(e,t,r)=>{var n=r(4715)(r(8942),"Map");e.exports=n},9413:(e,t,r)=>{var n=r(4715)(r(8942),"Promise");e.exports=n},4512:(e,t,r)=>{var n=r(4715)(r(8942),"Set");e.exports=n},5650:(e,t,r)=>{var n=r(8942).Symbol;e.exports=n},9270:(e,t,r)=>{var n=r(4715)(r(8942),"WeakMap");e.exports=n},7379:(e,t,r)=>{var n=r(5650),i=r(8870),o=r(9005),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},6027:(e,t,r)=>{var n=r(7379),i=r(547);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},9624:(e,t,r)=>{var n=r(3655),i=r(4759),o=r(1580),s=r(4066),a=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?f:a).test(s(e))}},674:(e,t,r)=>{var n=r(7379),i=r(5387),o=r(547),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[n(e)]}},195:(e,t,r)=>{var n=r(4882),i=r(8121),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},9460:e=>{e.exports=function(e){return function(t){return e(t)}}},1950:(e,t,r)=>{var n=r(8942)["__core-js_shared__"];e.exports=n},4967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},4715:(e,t,r)=>{var n=r(9624),i=r(155);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},8870:(e,t,r)=>{var n=r(5650),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[a]=r:delete e[a]),i}},8486:(e,t,r)=>{var n=r(3103),i=r(9770),o=r(9413),s=r(4512),a=r(9270),l=r(7379),u=r(4066),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=u(n),g=u(i),b=u(o),y=u(s),v=u(a),_=l;(n&&_(new n(new ArrayBuffer(1)))!=h||i&&_(new i)!=c||o&&_(o.resolve())!=d||s&&_(new s)!=f||a&&_(new a)!=p)&&(_=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case m:return h;case g:return c;case b:return d;case y:return f;case v:return p}return t}),e.exports=_},155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},4759:(e,t,r)=>{var n,i=r(1950),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},4882:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},8121:(e,t,r)=>{var n=r(3766)(Object.keys,Object);e.exports=n},2306:(e,t,r)=>{e=r.nmd(e);var n=r(4967),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},3766:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},8942:(e,t,r)=>{var n=r(4967),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},4066:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},3283:(e,t,r)=>{var n=r(6027),i=r(547),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},3142:e=>{var t=Array.isArray;e.exports=t},6529:(e,t,r)=>{var n=r(3655),i=r(5387);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},5853:(e,t,r)=>{e=r.nmd(e);var n=r(8942),i=r(4772),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?n.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},3514:(e,t,r)=>{var n=r(195),i=r(8486),o=r(3283),s=r(3142),a=r(6529),l=r(5853),u=r(4882),c=r(8666),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(a(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!n(e).length;for(var r in e)if(d.call(e,r))return!1;return!0}},3655:(e,t,r)=>{var n=r(7379),i=r(1580);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},5387:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},1580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},547:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8666:(e,t,r)=>{var n=r(674),i=r(9460),o=r(2306),s=o&&o.isTypedArray,a=s?i(s):n;e.exports=a},5250:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,u=128,c=1/0,d=9007199254740991,f=NaN,p=4294967295,h=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",b="[object Boolean]",y="[object Date]",v="[object Error]",_="[object Function]",w="[object GeneratorFunction]",A="[object Map]",x="[object Number]",S="[object Object]",O="[object Promise]",E="[object RegExp]",j="[object Set]",T="[object String]",C="[object Symbol]",R="[object WeakMap]",I="[object ArrayBuffer]",D="[object DataView]",F="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",M="[object Int32Array]",L="[object Uint8Array]",$="[object Uint8ClampedArray]",q="[object Uint16Array]",B="[object Uint32Array]",G=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,X=RegExp(V.source),W=RegExp(H.source),Y=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Ae="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",je="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Te="["+we+"]",Ce="["+je+"]",Re="["+Ae+"]",Ie="\\d+",De="["+xe+"]",Fe="["+Se+"]",Pe="[^"+we+je+Ie+xe+Se+Oe+"]",ke="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",$e="["+Oe+"]",qe="\\u200d",Be="(?:"+Fe+"|"+Pe+")",Ge="(?:"+$e+"|"+Pe+")",ze="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ve="(?:"+Re+"|"+ke+")?",He="["+Ee+"]?",Xe=He+Ve+"(?:"+qe+"(?:"+[Ne,Me,Le].join("|")+")"+He+Ve+")*",We="(?:"+[De,Me,Le].join("|")+")"+Xe,Ye="(?:"+[Ne+Re+"?",Re,Me,Le,Te].join("|")+")",Ke=RegExp("['’]","g"),Qe=RegExp(Re,"g"),Ze=RegExp(ke+"(?="+ke+")|"+Ye+Xe,"g"),Je=RegExp([$e+"?"+Fe+"+"+ze+"(?="+[Ce,$e,"$"].join("|")+")",Ge+"+"+Ue+"(?="+[Ce,$e+Be,"$"].join("|")+")",$e+"?"+Be+"+"+ze,$e+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ie,We].join("|"),"g"),et=RegExp("["+qe+we+Ae+Ee+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[F]=it[P]=it[k]=it[N]=it[M]=it[L]=it[$]=it[q]=it[B]=!0,it[m]=it[g]=it[I]=it[b]=it[D]=it[y]=it[v]=it[_]=it[A]=it[x]=it[S]=it[E]=it[j]=it[T]=it[R]=!1;var ot={};ot[m]=ot[g]=ot[I]=ot[D]=ot[b]=ot[y]=ot[F]=ot[P]=ot[k]=ot[N]=ot[M]=ot[A]=ot[x]=ot[S]=ot[E]=ot[j]=ot[T]=ot[C]=ot[L]=ot[$]=ot[q]=ot[B]=!0,ot[v]=ot[_]=ot[R]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ut="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ct="object"==typeof self&&self&&self.Object===Object&&self,dt=ut||ct||Function("return this")(),ft=t&&!t.nodeType&&t,pt=ft&&e&&!e.nodeType&&e,ht=pt&&pt.exports===ft,mt=ht&&ut.process,gt=function(){try{return pt&&pt.require&&pt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),bt=gt&&gt.isArrayBuffer,yt=gt&&gt.isDate,vt=gt&&gt.isMap,_t=gt&&gt.isRegExp,wt=gt&&gt.isSet,At=gt&&gt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function St(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function Ot(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Et(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function jt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Tt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Ct(e,t){return!(null==e||!e.length)&&$t(e,t,0)>-1}function Rt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function It(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Dt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Ft(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Pt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Nt=zt("length");function Mt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Lt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function $t(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Lt(e,Bt,r)}function qt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Bt(e){return e!=e}function Gt(e,t){var r=null==e?0:e.length;return r?Ht(e,t)/r:f}function zt(e){return function(t){return null==t?i:t[e]}}function Ut(e){return function(t){return null==e?i:e[t]}}function Vt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Ht(e,t){for(var r,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==i&&(r=r===i?s:r+s)}return r}function Xt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Wt(e){return e?e.slice(0,dr(e)+1).replace(ne,""):e}function Yt(e){return function(t){return e(t)}}function Kt(e,t){return It(t,(function(t){return e[t]}))}function Qt(e,t){return e.has(t)}function Zt(e,t){for(var r=-1,n=e.length;++r<n&&$t(t,e[r],0)>-1;);return r}function Jt(e,t){for(var r=e.length;r--&&$t(t,e[r],0)>-1;);return r}var er=Ut({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tr=Ut({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(e){return"\\"+st[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function ur(e){return nr(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):Nt(e)}function cr(e){return nr(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function dr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var fr=Ut({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pr=function e(t){var r,n=(t=null==t?dt:pr.defaults(dt.Object(),t,pr.pick(dt,rt))).Array,ie=t.Date,we=t.Error,Ae=t.Function,xe=t.Math,Se=t.Object,Oe=t.RegExp,Ee=t.String,je=t.TypeError,Te=n.prototype,Ce=Ae.prototype,Re=Se.prototype,Ie=t["__core-js_shared__"],De=Ce.toString,Fe=Re.hasOwnProperty,Pe=0,ke=(r=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Ne=Re.toString,Me=De.call(Se),Le=dt._,$e=Oe("^"+De.call(Fe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=ht?t.Buffer:i,Be=t.Symbol,Ge=t.Uint8Array,ze=qe?qe.allocUnsafe:i,Ue=or(Se.getPrototypeOf,Se),Ve=Se.create,He=Re.propertyIsEnumerable,Xe=Te.splice,We=Be?Be.isConcatSpreadable:i,Ye=Be?Be.iterator:i,Ze=Be?Be.toStringTag:i,et=function(){try{var e=lo(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=ie&&ie.now!==dt.Date.now&&ie.now,ct=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=xe.ceil,pt=xe.floor,mt=Se.getOwnPropertySymbols,gt=qe?qe.isBuffer:i,Nt=t.isFinite,Ut=Te.join,hr=or(Se.keys,Se),mr=xe.max,gr=xe.min,br=ie.now,yr=t.parseInt,vr=xe.random,_r=Te.reverse,wr=lo(t,"DataView"),Ar=lo(t,"Map"),xr=lo(t,"Promise"),Sr=lo(t,"Set"),Or=lo(t,"WeakMap"),Er=lo(Se,"create"),jr=Or&&new Or,Tr={},Cr=Mo(wr),Rr=Mo(Ar),Ir=Mo(xr),Dr=Mo(Sr),Fr=Mo(Or),Pr=Be?Be.prototype:i,kr=Pr?Pr.valueOf:i,Nr=Pr?Pr.toString:i;function Mr(e){if(ea(e)&&!zs(e)&&!(e instanceof Br)){if(e instanceof qr)return e;if(Fe.call(e,"__wrapped__"))return Lo(e)}return new qr(e)}var Lr=function(){function e(){}return function(t){if(!Js(t))return{};if(Ve)return Ve(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function $r(){}function qr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Br(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Gr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ur(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Ur;++t<r;)this.add(e[t])}function Hr(e){var t=this.__data__=new zr(e);this.size=t.size}function Xr(e,t){var r=zs(e),n=!r&&Gs(e),i=!r&&!n&&Xs(e),o=!r&&!n&&!i&&la(e),s=r||n||i||o,a=s?Xt(e.length,Ee):[],l=a.length;for(var u in e)!t&&!Fe.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||go(u,l))||a.push(u);return a}function Wr(e){var t=e.length;return t?e[Vn(0,t-1)]:i}function Yr(e,t){return Do(Ei(e),on(t,0,e.length))}function Kr(e){return Do(Ei(e))}function Qr(e,t,r){(r!==i&&!$s(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Zr(e,t,r){var n=e[t];Fe.call(e,t)&&$s(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Jr(e,t){for(var r=e.length;r--;)if($s(e[r][0],t))return r;return-1}function en(e,t,r,n){return cn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&ji(t,Ra(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,s=n(o),a=null==e;++r<o;)s[r]=a?i:Oa(e,t[r]);return s}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function sn(e,t,r,n,o,s){var a,l=1&t,u=2&t,c=4&t;if(r&&(a=o?r(e,n,o,s):r(e)),a!==i)return a;if(!Js(e))return e;var d=zs(e);if(d){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Fe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Ei(e,a)}else{var f=fo(e),p=f==_||f==w;if(Xs(e))return _i(e,l);if(f==S||f==m||p&&!o){if(a=u||p?{}:ho(e),!l)return u?function(e,t){return ji(e,co(e),t)}(e,function(e,t){return e&&ji(t,Ia(t),e)}(a,e)):function(e,t){return ji(e,uo(e),t)}(e,tn(a,e))}else{if(!ot[f])return o?e:{};a=function(e,t,r){var n,i=e.constructor;switch(t){case I:return wi(e);case b:case y:return new i(+e);case D:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case F:case P:case k:case N:case M:case L:case $:case q:case B:return Ai(e,r);case A:return new i;case x:case T:return new i(e);case E:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case j:return new i;case C:return n=e,kr?Se(kr.call(n)):{}}}(e,f,l)}}s||(s=new Hr);var h=s.get(e);if(h)return h;s.set(e,a),oa(e)?e.forEach((function(n){a.add(sn(n,t,r,n,e,s))})):ta(e)&&e.forEach((function(n,i){a.set(i,sn(n,t,r,i,e,s))}));var g=d?i:(c?u?to:eo:u?Ia:Ra)(e);return Ot(g||e,(function(n,i){g&&(n=e[i=n]),Zr(a,i,sn(n,t,r,i,e,s))})),a}function an(e,t,r){var n=r.length;if(null==e)return!n;for(e=Se(e);n--;){var o=r[n],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function ln(e,t,r){if("function"!=typeof e)throw new je(o);return To((function(){e.apply(i,r)}),t)}function un(e,t,r,n){var i=-1,o=Ct,s=!0,a=e.length,l=[],u=t.length;if(!a)return l;r&&(t=It(t,Yt(r))),n?(o=Rt,s=!1):t.length>=200&&(o=Qt,s=!1,t=new Vr(t));e:for(;++i<a;){var c=e[i],d=null==r?c:r(c);if(c=n||0!==c?c:0,s&&d==d){for(var f=u;f--;)if(t[f]===d)continue e;l.push(c)}else o(t,d,n)||l.push(c)}return l}Mr.templateSettings={escape:Y,evaluate:K,interpolate:Q,variable:"",imports:{_:Mr}},Mr.prototype=$r.prototype,Mr.prototype.constructor=Mr,qr.prototype=Lr($r.prototype),qr.prototype.constructor=qr,Br.prototype=Lr($r.prototype),Br.prototype.constructor=Br,Gr.prototype.clear=function(){this.__data__=Er?Er(null):{},this.size=0},Gr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Gr.prototype.get=function(e){var t=this.__data__;if(Er){var r=t[e];return r===s?i:r}return Fe.call(t,e)?t[e]:i},Gr.prototype.has=function(e){var t=this.__data__;return Er?t[e]!==i:Fe.call(t,e)},Gr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Er&&t===i?s:t,this},zr.prototype.clear=function(){this.__data__=[],this.size=0},zr.prototype.delete=function(e){var t=this.__data__,r=Jr(t,e);return!(r<0||(r==t.length-1?t.pop():Xe.call(t,r,1),--this.size,0))},zr.prototype.get=function(e){var t=this.__data__,r=Jr(t,e);return r<0?i:t[r][1]},zr.prototype.has=function(e){return Jr(this.__data__,e)>-1},zr.prototype.set=function(e,t){var r=this.__data__,n=Jr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Ur.prototype.clear=function(){this.size=0,this.__data__={hash:new Gr,map:new(Ar||zr),string:new Gr}},Ur.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Ur.prototype.get=function(e){return so(this,e).get(e)},Ur.prototype.has=function(e){return so(this,e).has(e)},Ur.prototype.set=function(e,t){var r=so(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Vr.prototype.add=Vr.prototype.push=function(e){return this.__data__.set(e,s),this},Vr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new zr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof zr){var n=r.__data__;if(!Ar||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ur(n)}return r.set(e,t),this.size=r.size,this};var cn=Ri(yn),dn=Ri(vn,!0);function fn(e,t){var r=!0;return cn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function pn(e,t,r){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(l===i?a==a&&!aa(a):r(a,l)))var l=a,u=s}return u}function hn(e,t){var r=[];return cn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function mn(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=mo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?mn(a,t-1,r,n,i):Dt(i,a):n||(i[i.length]=a)}return i}var gn=Ii(),bn=Ii(!0);function yn(e,t){return e&&gn(e,t,Ra)}function vn(e,t){return e&&bn(e,t,Ra)}function _n(e,t){return Tt(t,(function(t){return Ks(e[t])}))}function wn(e,t){for(var r=0,n=(t=gi(t,e)).length;null!=e&&r<n;)e=e[No(t[r++])];return r&&r==n?e:i}function An(e,t,r){var n=t(e);return zs(e)?n:Dt(n,r(e))}function xn(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ze&&Ze in Se(e)?function(e){var t=Fe.call(e,Ze),r=e[Ze];try{e[Ze]=i;var n=!0}catch(e){}var o=Ne.call(e);return n&&(t?e[Ze]=r:delete e[Ze]),o}(e):function(e){return Ne.call(e)}(e)}function Sn(e,t){return e>t}function On(e,t){return null!=e&&Fe.call(e,t)}function En(e,t){return null!=e&&t in Se(e)}function jn(e,t,r){for(var o=r?Rt:Ct,s=e[0].length,a=e.length,l=a,u=n(a),c=1/0,d=[];l--;){var f=e[l];l&&t&&(f=It(f,Yt(t))),c=gr(f.length,c),u[l]=!r&&(t||s>=120&&f.length>=120)?new Vr(l&&f):i}f=e[0];var p=-1,h=u[0];e:for(;++p<s&&d.length<c;){var m=f[p],g=t?t(m):m;if(m=r||0!==m?m:0,!(h?Qt(h,g):o(d,g,r))){for(l=a;--l;){var b=u[l];if(!(b?Qt(b,g):o(e[l],g,r)))continue e}h&&h.push(g),d.push(m)}}return d}function Tn(e,t,r){var n=null==(e=Oo(e,t=gi(t,e)))?e:e[No(Yo(t))];return null==n?i:xt(n,e,r)}function Cn(e){return ea(e)&&xn(e)==m}function Rn(e,t,r,n,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,r,n,o,s){var a=zs(e),l=zs(t),u=a?g:fo(e),c=l?g:fo(t),d=(u=u==m?S:u)==S,f=(c=c==m?S:c)==S,p=u==c;if(p&&Xs(e)){if(!Xs(t))return!1;a=!0,d=!1}if(p&&!d)return s||(s=new Hr),a||la(e)?Zi(e,t,r,n,o,s):function(e,t,r,n,i,o,s){switch(r){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case I:return!(e.byteLength!=t.byteLength||!o(new Ge(e),new Ge(t)));case b:case y:case x:return $s(+e,+t);case v:return e.name==t.name&&e.message==t.message;case E:case T:return e==t+"";case A:var a=ir;case j:var l=1&n;if(a||(a=ar),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;n|=2,s.set(e,t);var c=Zi(a(e),a(t),n,i,o,s);return s.delete(e),c;case C:if(kr)return kr.call(e)==kr.call(t)}return!1}(e,t,u,r,n,o,s);if(!(1&r)){var h=d&&Fe.call(e,"__wrapped__"),_=f&&Fe.call(t,"__wrapped__");if(h||_){var w=h?e.value():e,O=_?t.value():t;return s||(s=new Hr),o(w,O,r,n,s)}}return!!p&&(s||(s=new Hr),function(e,t,r,n,o,s){var a=1&r,l=eo(e),u=l.length;if(u!=eo(t).length&&!a)return!1;for(var c=u;c--;){var d=l[c];if(!(a?d in t:Fe.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var m=a;++c<u;){var g=e[d=l[c]],b=t[d];if(n)var y=a?n(b,g,d,t,e,s):n(g,b,d,e,t,s);if(!(y===i?g===b||o(g,b,r,n,s):y)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var v=e.constructor,_=t.constructor;v==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _||(h=!1)}return s.delete(e),s.delete(t),h}(e,t,r,n,o,s))}(e,t,r,n,Rn,o))}function In(e,t,r,n){var o=r.length,s=o,a=!n;if(null==e)return!s;for(e=Se(e);o--;){var l=r[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var u=(l=r[o])[0],c=e[u],d=l[1];if(a&&l[2]){if(c===i&&!(u in e))return!1}else{var f=new Hr;if(n)var p=n(c,d,u,e,t,f);if(!(p===i?Rn(d,c,3,n,f):p))return!1}}return!0}function Dn(e){return!(!Js(e)||(t=e,ke&&ke in t))&&(Ks(e)?$e:me).test(Mo(e));var t}function Fn(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?zs(e)?Ln(e[0],e[1]):Mn(e):dl(e)}function Pn(e){if(!wo(e))return hr(e);var t=[];for(var r in Se(e))Fe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function kn(e,t){return e<t}function Nn(e,t){var r=-1,i=Vs(e)?n(e.length):[];return cn(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Mn(e){var t=ao(e);return 1==t.length&&t[0][2]?xo(t[0][0],t[0][1]):function(r){return r===e||In(r,e,t)}}function Ln(e,t){return yo(e)&&Ao(t)?xo(No(e),t):function(r){var n=Oa(r,e);return n===i&&n===t?Ea(r,e):Rn(t,n,3)}}function $n(e,t,r,n,o){e!==t&&gn(t,(function(s,a){if(o||(o=new Hr),Js(s))!function(e,t,r,n,o,s,a){var l=Eo(e,r),u=Eo(t,r),c=a.get(u);if(c)Qr(e,r,c);else{var d=s?s(l,u,r+"",e,t,a):i,f=d===i;if(f){var p=zs(u),h=!p&&Xs(u),m=!p&&!h&&la(u);d=u,p||h||m?zs(l)?d=l:Hs(l)?d=Ei(l):h?(f=!1,d=_i(u,!0)):m?(f=!1,d=Ai(u,!0)):d=[]:na(u)||Gs(u)?(d=l,Gs(l)?d=ga(l):Js(l)&&!Ks(l)||(d=ho(u))):f=!1}f&&(a.set(u,d),o(d,u,n,s,a),a.delete(u)),Qr(e,r,d)}}(e,t,a,r,$n,n,o);else{var l=n?n(Eo(e,a),s,a+"",e,t,o):i;l===i&&(l=s),Qr(e,a,l)}}),Ia)}function qn(e,t){var r=e.length;if(r)return go(t+=t<0?r:0,r)?e[t]:i}function Bn(e,t,r){t=t.length?It(t,(function(e){return zs(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[rl];var n=-1;t=It(t,Yt(oo()));var i=Nn(e,(function(e,r,i){var o=It(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var l=xi(i[n],o[n]);if(l)return n>=a?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Gn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=wn(e,s);r(a,s)&&Kn(o,gi(s,e),a)}return o}function zn(e,t,r,n){var i=n?qt:$t,o=-1,s=t.length,a=e;for(e===t&&(t=Ei(t)),r&&(a=It(e,Yt(r)));++o<s;)for(var l=0,u=t[o],c=r?r(u):u;(l=i(a,c,l,n))>-1;)a!==e&&Xe.call(a,l,1),Xe.call(e,l,1);return e}function Un(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;go(i)?Xe.call(e,i,1):li(e,i)}}return e}function Vn(e,t){return e+pt(vr()*(t-e+1))}function Hn(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=pt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Co(So(e,t,rl),e+"")}function Wn(e){return Wr($a(e))}function Yn(e,t){var r=$a(e);return Do(r,on(t,0,r.length))}function Kn(e,t,r,n){if(!Js(e))return e;for(var o=-1,s=(t=gi(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var u=No(t[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var d=l[u];(c=n?n(d,u,l):i)===i&&(c=Js(d)?d:go(t[o+1])?[]:{})}Zr(l,u,c),l=l[u]}return e}var Qn=jr?function(e,t){return jr.set(e,t),e}:rl,Zn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Ja(t),writable:!0})}:rl;function Jn(e){return Do($a(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var r;return cn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!aa(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ni(e,t,rl,r)}function ni(e,t,r,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,l=null===t,u=aa(t),c=t===i;o<s;){var d=pt((o+s)/2),f=r(e[d]),p=f!==i,h=null===f,m=f==f,g=aa(f);if(a)var b=n||m;else b=c?m&&(n||p):l?m&&p&&(n||!h):u?m&&p&&!h&&(n||!g):!h&&!g&&(n?f<=t:f<t);b?o=d+1:s=d}return gr(s,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!$s(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?f:+e}function si(e){if("string"==typeof e)return e;if(zs(e))return It(e,si)+"";if(aa(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Ct,o=e.length,s=!0,a=[],l=a;if(r)s=!1,i=Rt;else if(o>=200){var u=t?null:Hi(e);if(u)return ar(u);s=!1,i=Qt,l=new Vr}else l=t?[]:a;e:for(;++n<o;){var c=e[n],d=t?t(c):c;if(c=r||0!==c?c:0,s&&d==d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),a.push(c)}else i(l,d,r)||(l!==a&&l.push(d),a.push(c))}return a}function li(e,t){return null==(e=Oo(e,t=gi(t,e)))||delete e[No(Yo(t))]}function ui(e,t,r,n){return Kn(e,t,r(wn(e,t)),n)}function ci(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function di(e,t){var r=e;return r instanceof Br&&(r=r.value()),Ft(t,(function(e,t){return t.func.apply(t.thisArg,Dt([e],t.args))}),r)}function fi(e,t,r){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=n(i);++o<i;)for(var a=e[o],l=-1;++l<i;)l!=o&&(s[o]=un(s[o]||a,e[l],t,r));return ai(mn(s,1),t,r)}function pi(e,t,r){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var l=n<s?t[n]:i;r(a,e[n],l)}return a}function hi(e){return Hs(e)?e:[]}function mi(e){return"function"==typeof e?e:rl}function gi(e,t){return zs(e)?e:yo(e,t)?[e]:ko(ba(e))}var bi=Xn;function yi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var vi=st||function(e){return dt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=ze?ze(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Ai(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function xi(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,u=t==t,c=aa(t);if(!l&&!c&&!s&&e>t||s&&a&&u&&!l&&!c||n&&a&&u||!r&&u||!o)return 1;if(!n&&!s&&!c&&e<t||c&&r&&o&&!n&&!s||l&&r&&o||!a&&o||!u)return-1}return 0}function Si(e,t,r,i){for(var o=-1,s=e.length,a=r.length,l=-1,u=t.length,c=mr(s-a,0),d=n(u+c),f=!i;++l<u;)d[l]=t[l];for(;++o<a;)(f||o<s)&&(d[r[o]]=e[o]);for(;c--;)d[l++]=e[o++];return d}function Oi(e,t,r,i){for(var o=-1,s=e.length,a=-1,l=r.length,u=-1,c=t.length,d=mr(s-l,0),f=n(d+c),p=!i;++o<d;)f[o]=e[o];for(var h=o;++u<c;)f[h+u]=t[u];for(;++a<l;)(p||o<s)&&(f[h+r[a]]=e[o++]);return f}function Ei(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function ji(e,t,r,n){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var l=t[s],u=n?n(r[l],e[l],l,r,e):i;u===i&&(u=e[l]),o?rn(r,l,u):Zr(r,l,u)}return r}function Ti(e,t){return function(r,n){var i=zs(r)?St:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Ci(e){return Xn((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:i,a=o>2?r[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&bo(r[0],r[1],a)&&(s=o<3?i:s,o=1),t=Se(t);++n<o;){var l=r[n];l&&e(t,l,n,s)}return t}))}function Ri(e,t){return function(r,n){if(null==r)return r;if(!Vs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Se(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function Ii(e){return function(t,r,n){for(var i=-1,o=Se(t),s=n(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===r(o[l],l,o))break}return t}}function Di(e){return function(t){var r=nr(t=ba(t))?cr(t):i,n=r?r[0]:t.charAt(0),o=r?yi(r,1).join(""):t.slice(1);return n[e]()+o}}function Fi(e){return function(t){return Ft(Ka(Ga(t).replace(Ke,"")),e,"")}}function Pi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Lr(e.prototype),n=e.apply(r,t);return Js(n)?n:r}}function ki(e){return function(t,r,n){var o=Se(t);if(!Vs(t)){var s=oo(r,3);t=Ra(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[s?t[a]:a]:i}}function Ni(e){return Ji((function(t){var r=t.length,n=r,s=qr.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new je(o);if(s&&!l&&"wrapper"==no(a))var l=new qr([],!0)}for(n=l?n:r;++n<r;){var u=no(a=t[n]),c="wrapper"==u?ro(a):i;l=c&&vo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[no(c[0])].apply(l,c[3]):1==a.length&&vo(a)?l[u]():l.thru(a)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&zs(n))return l.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Mi(e,t,r,o,s,a,l,c,d,f){var p=t&u,h=1&t,m=2&t,g=24&t,b=512&t,y=m?i:Pi(e);return function u(){for(var v=arguments.length,_=n(v),w=v;w--;)_[w]=arguments[w];if(g)var A=io(u),x=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(_,A);if(o&&(_=Si(_,o,s,g)),a&&(_=Oi(_,a,l,g)),v-=x,g&&v<f){var S=sr(_,A);return Ui(e,t,Mi,u.placeholder,r,_,S,c,d,f-v)}var O=h?r:this,E=m?O[e]:e;return v=_.length,c?_=function(e,t){for(var r=e.length,n=gr(t.length,r),o=Ei(e);n--;){var s=t[n];e[n]=go(s,r)?o[s]:i}return e}(_,c):b&&v>1&&_.reverse(),p&&d<v&&(_.length=d),this&&this!==dt&&this instanceof u&&(E=y||Pi(E)),E.apply(O,_)}}function Li(e,t){return function(r,n){return function(e,t,r,n){return yn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function $i(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=si(r),n=si(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function qi(e){return Ji((function(t){return t=It(t,Yt(oo())),Xn((function(r){var n=this;return e(t,(function(e){return xt(e,n,r)}))}))}))}function Bi(e,t){var r=(t=t===i?" ":si(t)).length;if(r<2)return r?Hn(t,e):t;var n=Hn(t,ft(e/ur(t)));return nr(t)?yi(cr(n),0,e).join(""):n.slice(0,e)}function Gi(e){return function(t,r,o){return o&&"number"!=typeof o&&bo(t,r,o)&&(r=o=i),t=fa(t),r===i?(r=t,t=0):r=fa(r),function(e,t,r,i){for(var o=-1,s=mr(ft((t-e)/(r||1)),0),a=n(s);s--;)a[i?s:++o]=e,e+=r;return a}(t,r,o=o===i?t<r?1:-1:fa(o),e)}}function zi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ma(t),r=ma(r)),e(t,r)}}function Ui(e,t,r,n,o,s,a,u,c,d){var f=8&t;t|=f?l:64,4&(t&=~(f?64:l))||(t&=-4);var p=[e,t,o,f?s:i,f?a:i,f?i:s,f?i:a,u,c,d],h=r.apply(i,p);return vo(e)&&jo(h,p),h.placeholder=n,Ro(h,e,t)}function Vi(e){var t=xe[e];return function(e,r){if(e=ma(e),(r=null==r?0:gr(pa(r),292))&&Nt(e)){var n=(ba(e)+"e").split("e");return+((n=(ba(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Hi=Sr&&1/ar(new Sr([,-0]))[1]==c?function(e){return new Sr(e)}:al;function Xi(e){return function(t){var r=fo(t);return r==A?ir(t):r==j?lr(t):function(e,t){return It(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Wi(e,t,r,s,c,d,f,p){var h=2&t;if(!h&&"function"!=typeof e)throw new je(o);var m=s?s.length:0;if(m||(t&=-97,s=c=i),f=f===i?f:mr(pa(f),0),p=p===i?p:pa(p),m-=c?c.length:0,64&t){var g=s,b=c;s=c=i}var y=h?i:ro(e),v=[e,t,r,s,c,g,b,d,f,p];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=n==u&&8==r||n==u&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var l=t[3];if(l){var c=e[3];e[3]=c?Si(c,l,t[4]):l,e[4]=c?sr(e[3],a):t[4]}(l=t[5])&&(c=e[5],e[5]=c?Oi(c,l,t[6]):l,e[6]=c?sr(e[5],a):t[6]),(l=t[7])&&(e[7]=l),n&u&&(e[8]=null==e[8]?t[8]:gr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(v,y),e=v[0],t=v[1],r=v[2],s=v[3],c=v[4],!(p=v[9]=v[9]===i?h?0:e.length:mr(v[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,r){var o=Pi(e);return function s(){for(var a=arguments.length,l=n(a),u=a,c=io(s);u--;)l[u]=arguments[u];var d=a<3&&l[0]!==c&&l[a-1]!==c?[]:sr(l,c);return(a-=d.length)<r?Ui(e,t,Mi,s.placeholder,i,l,d,i,i,r-a):xt(this&&this!==dt&&this instanceof s?o:e,this,l)}}(e,t,p):t!=l&&33!=t||c.length?Mi.apply(i,v):function(e,t,r,i){var o=1&t,s=Pi(e);return function t(){for(var a=-1,l=arguments.length,u=-1,c=i.length,d=n(c+l),f=this&&this!==dt&&this instanceof t?s:e;++u<c;)d[u]=i[u];for(;l--;)d[u++]=arguments[++a];return xt(f,o?r:this,d)}}(e,t,r,s);else var _=function(e,t,r){var n=1&t,i=Pi(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Ro((y?Qn:jo)(_,v),e,t)}function Yi(e,t,r,n){return e===i||$s(e,Re[r])&&!Fe.call(n,r)?t:e}function Ki(e,t,r,n,o,s){return Js(e)&&Js(t)&&(s.set(t,e),$n(e,t,i,Ki,s),s.delete(t)),e}function Qi(e){return na(e)?i:e}function Zi(e,t,r,n,o,s){var a=1&r,l=e.length,u=t.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var f=-1,p=!0,h=2&r?new Vr:i;for(s.set(e,t),s.set(t,e);++f<l;){var m=e[f],g=t[f];if(n)var b=a?n(g,m,f,t,e,s):n(m,g,f,e,t,s);if(b!==i){if(b)continue;p=!1;break}if(h){if(!kt(t,(function(e,t){if(!Qt(h,t)&&(m===e||o(m,e,r,n,s)))return h.push(t)}))){p=!1;break}}else if(m!==g&&!o(m,g,r,n,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function Ji(e){return Co(So(e,i,Uo),e+"")}function eo(e){return An(e,Ra,uo)}function to(e){return An(e,Ia,co)}var ro=jr?function(e){return jr.get(e)}:al;function no(e){for(var t=e.name+"",r=Tr[t],n=Fe.call(Tr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(Fe.call(Mr,"placeholder")?Mr:e).placeholder}function oo(){var e=Mr.iteratee||nl;return e=e===nl?Fn:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ra(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ao(i)]}return t}function lo(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return Dn(r)?r:i}var uo=mt?function(e){return null==e?[]:(e=Se(e),Tt(mt(e),(function(t){return He.call(e,t)})))}:hl,co=mt?function(e){for(var t=[];e;)Dt(t,uo(e)),e=Ue(e);return t}:hl,fo=xn;function po(e,t,r){for(var n=-1,i=(t=gi(t,e)).length,o=!1;++n<i;){var s=No(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Zs(i)&&go(s,i)&&(zs(e)||Gs(e))}function ho(e){return"function"!=typeof e.constructor||wo(e)?{}:Lr(Ue(e))}function mo(e){return zs(e)||Gs(e)||!!(We&&e&&e[We])}function go(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&be.test(e))&&e>-1&&e%1==0&&e<t}function bo(e,t,r){if(!Js(r))return!1;var n=typeof t;return!!("number"==n?Vs(r)&&go(t,r.length):"string"==n&&t in r)&&$s(r[t],e)}function yo(e,t){if(zs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!aa(e))||J.test(e)||!Z.test(e)||null!=t&&e in Se(t)}function vo(e){var t=no(e),r=Mr[t];if("function"!=typeof r||!(t in Br.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=D||Ar&&fo(new Ar)!=A||xr&&fo(xr.resolve())!=O||Sr&&fo(new Sr)!=j||Or&&fo(new Or)!=R)&&(fo=function(e){var t=xn(e),r=t==S?e.constructor:i,n=r?Mo(r):"";if(n)switch(n){case Cr:return D;case Rr:return A;case Ir:return O;case Dr:return j;case Fr:return R}return t});var _o=Ie?Ks:ml;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Re)}function Ao(e){return e==e&&!Js(e)}function xo(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in Se(r))}}function So(e,t,r){return t=mr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=mr(i.length-t,0),a=n(s);++o<s;)a[o]=i[t+o];o=-1;for(var l=n(t+1);++o<t;)l[o]=i[o];return l[t]=r(a),xt(e,this,l)}}function Oo(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var jo=Io(Qn),To=ct||function(e,t){return dt.setTimeout(e,t)},Co=Io(Zn);function Ro(e,t,r){var n=t+"";return Co(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ot(h,(function(r){var n="_."+r[0];t&r[1]&&!Ct(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(n),r)))}function Io(e){var t=0,r=0;return function(){var n=br(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Do(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var s=Vn(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var Fo,Po,ko=(Fo=Fs((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(ce,"$1"):r||e)})),t}),(function(e){return 500===Po.size&&Po.clear(),e})),Po=Fo.cache,Fo);function No(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Lo(e){if(e instanceof Br)return e.clone();var t=new qr(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var $o=Xn((function(e,t){return Hs(e)?un(e,mn(t,1,Hs,!0)):[]})),qo=Xn((function(e,t){var r=Yo(t);return Hs(r)&&(r=i),Hs(e)?un(e,mn(t,1,Hs,!0),oo(r,2)):[]})),Bo=Xn((function(e,t){var r=Yo(t);return Hs(r)&&(r=i),Hs(e)?un(e,mn(t,1,Hs,!0),i,r):[]}));function Go(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:pa(r);return i<0&&(i=mr(n+i,0)),Lt(e,oo(t,3),i)}function zo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=pa(r),o=r<0?mr(n+o,0):gr(o,n-1)),Lt(e,oo(t,3),o,!0)}function Uo(e){return null!=e&&e.length?mn(e,1):[]}function Vo(e){return e&&e.length?e[0]:i}var Ho=Xn((function(e){var t=It(e,hi);return t.length&&t[0]===e[0]?jn(t):[]})),Xo=Xn((function(e){var t=Yo(e),r=It(e,hi);return t===Yo(r)?t=i:r.pop(),r.length&&r[0]===e[0]?jn(r,oo(t,2)):[]})),Wo=Xn((function(e){var t=Yo(e),r=It(e,hi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?jn(r,i,t):[]}));function Yo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Ko=Xn(Qo);function Qo(e,t){return e&&e.length&&t&&t.length?zn(e,t):e}var Zo=Ji((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return Un(e,It(t,(function(e){return go(e,r)?+e:e})).sort(xi)),n}));function Jo(e){return null==e?e:_r.call(e)}var es=Xn((function(e){return ai(mn(e,1,Hs,!0))})),ts=Xn((function(e){var t=Yo(e);return Hs(t)&&(t=i),ai(mn(e,1,Hs,!0),oo(t,2))})),rs=Xn((function(e){var t=Yo(e);return t="function"==typeof t?t:i,ai(mn(e,1,Hs,!0),i,t)}));function ns(e){if(!e||!e.length)return[];var t=0;return e=Tt(e,(function(e){if(Hs(e))return t=mr(e.length,t),!0})),Xt(t,(function(t){return It(e,zt(t))}))}function is(e,t){if(!e||!e.length)return[];var r=ns(e);return null==t?r:It(r,(function(e){return xt(t,i,e)}))}var os=Xn((function(e,t){return Hs(e)?un(e,t):[]})),ss=Xn((function(e){return fi(Tt(e,Hs))})),as=Xn((function(e){var t=Yo(e);return Hs(t)&&(t=i),fi(Tt(e,Hs),oo(t,2))})),ls=Xn((function(e){var t=Yo(e);return t="function"==typeof t?t:i,fi(Tt(e,Hs),i,t)})),us=Xn(ns),cs=Xn((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,is(e,r)}));function ds(e){var t=Mr(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var ps=Ji((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Br&&go(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:i}),new qr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),hs=Ti((function(e,t,r){Fe.call(e,r)?++e[r]:rn(e,r,1)})),ms=ki(Go),gs=ki(zo);function bs(e,t){return(zs(e)?Ot:cn)(e,oo(t,3))}function ys(e,t){return(zs(e)?Et:dn)(e,oo(t,3))}var vs=Ti((function(e,t,r){Fe.call(e,r)?e[r].push(t):rn(e,r,[t])})),_s=Xn((function(e,t,r){var i=-1,o="function"==typeof t,s=Vs(e)?n(e.length):[];return cn(e,(function(e){s[++i]=o?xt(t,e,r):Tn(e,t,r)})),s})),ws=Ti((function(e,t,r){rn(e,r,t)}));function As(e,t){return(zs(e)?It:Nn)(e,oo(t,3))}var xs=Ti((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ss=Xn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&bo(e,t[0],t[1])?t=[]:r>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Bn(e,mn(t,1),[])})),Os=ut||function(){return dt.Date.now()};function Es(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Wi(e,u,i,i,i,i,t)}function js(e,t){var r;if("function"!=typeof t)throw new je(o);return e=pa(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Ts=Xn((function(e,t,r){var n=1;if(r.length){var i=sr(r,io(Ts));n|=l}return Wi(e,n,t,r,i)})),Cs=Xn((function(e,t,r){var n=3;if(r.length){var i=sr(r,io(Cs));n|=l}return Wi(t,n,e,r,i)}));function Rs(e,t,r){var n,s,a,l,u,c,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new je(o);function m(t){var r=n,o=s;return n=s=i,d=t,l=e.apply(o,r)}function g(e){var r=e-c;return c===i||r>=t||r<0||p&&e-d>=a}function b(){var e=Os();if(g(e))return y(e);u=To(b,function(e){var r=t-(e-c);return p?gr(r,a-(e-d)):r}(e))}function y(e){return u=i,h&&n?m(e):(n=s=i,l)}function v(){var e=Os(),r=g(e);if(n=arguments,s=this,c=e,r){if(u===i)return function(e){return d=e,u=To(b,t),f?m(e):l}(c);if(p)return vi(u),u=To(b,t),m(c)}return u===i&&(u=To(b,t)),l}return t=ma(t)||0,Js(r)&&(f=!!r.leading,a=(p="maxWait"in r)?mr(ma(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h),v.cancel=function(){u!==i&&vi(u),d=0,n=c=s=u=i},v.flush=function(){return u===i?l:y(Os())},v}var Is=Xn((function(e,t){return ln(e,1,t)})),Ds=Xn((function(e,t,r){return ln(e,ma(t)||0,r)}));function Fs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new je(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Fs.Cache||Ur),r}function Ps(e){if("function"!=typeof e)throw new je(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fs.Cache=Ur;var ks=bi((function(e,t){var r=(t=1==t.length&&zs(t[0])?It(t[0],Yt(oo())):It(mn(t,1),Yt(oo()))).length;return Xn((function(n){for(var i=-1,o=gr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return xt(e,this,n)}))})),Ns=Xn((function(e,t){var r=sr(t,io(Ns));return Wi(e,l,i,t,r)})),Ms=Xn((function(e,t){var r=sr(t,io(Ms));return Wi(e,64,i,t,r)})),Ls=Ji((function(e,t){return Wi(e,256,i,i,i,t)}));function $s(e,t){return e===t||e!=e&&t!=t}var qs=zi(Sn),Bs=zi((function(e,t){return e>=t})),Gs=Cn(function(){return arguments}())?Cn:function(e){return ea(e)&&Fe.call(e,"callee")&&!He.call(e,"callee")},zs=n.isArray,Us=bt?Yt(bt):function(e){return ea(e)&&xn(e)==I};function Vs(e){return null!=e&&Zs(e.length)&&!Ks(e)}function Hs(e){return ea(e)&&Vs(e)}var Xs=gt||ml,Ws=yt?Yt(yt):function(e){return ea(e)&&xn(e)==y};function Ys(e){if(!ea(e))return!1;var t=xn(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!na(e)}function Ks(e){if(!Js(e))return!1;var t=xn(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qs(e){return"number"==typeof e&&e==pa(e)}function Zs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Js(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=vt?Yt(vt):function(e){return ea(e)&&fo(e)==A};function ra(e){return"number"==typeof e||ea(e)&&xn(e)==x}function na(e){if(!ea(e)||xn(e)!=S)return!1;var t=Ue(e);if(null===t)return!0;var r=Fe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&De.call(r)==Me}var ia=_t?Yt(_t):function(e){return ea(e)&&xn(e)==E},oa=wt?Yt(wt):function(e){return ea(e)&&fo(e)==j};function sa(e){return"string"==typeof e||!zs(e)&&ea(e)&&xn(e)==T}function aa(e){return"symbol"==typeof e||ea(e)&&xn(e)==C}var la=At?Yt(At):function(e){return ea(e)&&Zs(e.length)&&!!it[xn(e)]},ua=zi(kn),ca=zi((function(e,t){return e<=t}));function da(e){if(!e)return[];if(Vs(e))return sa(e)?cr(e):Ei(e);if(Ye&&e[Ye])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ye]());var t=fo(e);return(t==A?ir:t==j?ar:$a)(e)}function fa(e){return e?(e=ma(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function pa(e){var t=fa(e),r=t%1;return t==t?r?t-r:t:0}function ha(e){return e?on(pa(e),0,p):0}function ma(e){if("number"==typeof e)return e;if(aa(e))return f;if(Js(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Js(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Wt(e);var r=he.test(e);return r||ge.test(e)?lt(e.slice(2),r?2:8):pe.test(e)?f:+e}function ga(e){return ji(e,Ia(e))}function ba(e){return null==e?"":si(e)}var ya=Ci((function(e,t){if(wo(t)||Vs(t))ji(t,Ra(t),e);else for(var r in t)Fe.call(t,r)&&Zr(e,r,t[r])})),va=Ci((function(e,t){ji(t,Ia(t),e)})),_a=Ci((function(e,t,r,n){ji(t,Ia(t),e,n)})),wa=Ci((function(e,t,r,n){ji(t,Ra(t),e,n)})),Aa=Ji(nn),xa=Xn((function(e,t){e=Se(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&bo(t[0],t[1],o)&&(n=1);++r<n;)for(var s=t[r],a=Ia(s),l=-1,u=a.length;++l<u;){var c=a[l],d=e[c];(d===i||$s(d,Re[c])&&!Fe.call(e,c))&&(e[c]=s[c])}return e})),Sa=Xn((function(e){return e.push(i,Ki),xt(Fa,i,e)}));function Oa(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function Ea(e,t){return null!=e&&po(e,t,En)}var ja=Li((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=r}),Ja(rl)),Ta=Li((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),Fe.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Ca=Xn(Tn);function Ra(e){return Vs(e)?Xr(e):Pn(e)}function Ia(e){return Vs(e)?Xr(e,!0):function(e){if(!Js(e))return function(e){var t=[];if(null!=e)for(var r in Se(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&Fe.call(e,n))&&r.push(n);return r}(e)}var Da=Ci((function(e,t,r){$n(e,t,r)})),Fa=Ci((function(e,t,r,n){$n(e,t,r,n)})),Pa=Ji((function(e,t){var r={};if(null==e)return r;var n=!1;t=It(t,(function(t){return t=gi(t,e),n||(n=t.length>1),t})),ji(e,to(e),r),n&&(r=sn(r,7,Qi));for(var i=t.length;i--;)li(r,t[i]);return r})),ka=Ji((function(e,t){return null==e?{}:function(e,t){return Gn(e,t,(function(t,r){return Ea(e,r)}))}(e,t)}));function Na(e,t){if(null==e)return{};var r=It(to(e),(function(e){return[e]}));return t=oo(t),Gn(e,r,(function(e,r){return t(e,r[0])}))}var Ma=Xi(Ra),La=Xi(Ia);function $a(e){return null==e?[]:Kt(e,Ra(e))}var qa=Fi((function(e,t,r){return t=t.toLowerCase(),e+(r?Ba(t):t)}));function Ba(e){return Ya(ba(e).toLowerCase())}function Ga(e){return(e=ba(e))&&e.replace(ye,er).replace(Qe,"")}var za=Fi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ua=Fi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Va=Di("toLowerCase"),Ha=Fi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Xa=Fi((function(e,t,r){return e+(r?" ":"")+Ya(t)})),Wa=Fi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ya=Di("toUpperCase");function Ka(e,t,r){return e=ba(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Qa=Xn((function(e,t){try{return xt(e,i,t)}catch(e){return Ys(e)?e:new we(e)}})),Za=Ji((function(e,t){return Ot(t,(function(t){t=No(t),rn(e,t,Ts(e[t],e))})),e}));function Ja(e){return function(){return e}}var el=Ni(),tl=Ni(!0);function rl(e){return e}function nl(e){return Fn("function"==typeof e?e:sn(e,1))}var il=Xn((function(e,t){return function(r){return Tn(r,e,t)}})),ol=Xn((function(e,t){return function(r){return Tn(e,r,t)}}));function sl(e,t,r){var n=Ra(t),i=_n(t,n);null!=r||Js(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Ra(t)));var o=!(Js(r)&&"chain"in r&&!r.chain),s=Ks(e);return Ot(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ei(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Dt([this.value()],arguments))})})),e}function al(){}var ll=qi(It),ul=qi(jt),cl=qi(kt);function dl(e){return yo(e)?zt(No(e)):function(e){return function(t){return wn(t,e)}}(e)}var fl=Gi(),pl=Gi(!0);function hl(){return[]}function ml(){return!1}var gl,bl=$i((function(e,t){return e+t}),0),yl=Vi("ceil"),vl=$i((function(e,t){return e/t}),1),_l=Vi("floor"),wl=$i((function(e,t){return e*t}),1),Al=Vi("round"),xl=$i((function(e,t){return e-t}),0);return Mr.after=function(e,t){if("function"!=typeof t)throw new je(o);return e=pa(e),function(){if(--e<1)return t.apply(this,arguments)}},Mr.ary=Es,Mr.assign=ya,Mr.assignIn=va,Mr.assignInWith=_a,Mr.assignWith=wa,Mr.at=Aa,Mr.before=js,Mr.bind=Ts,Mr.bindAll=Za,Mr.bindKey=Cs,Mr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zs(e)?e:[e]},Mr.chain=ds,Mr.chunk=function(e,t,r){t=(r?bo(e,t,r):t===i)?1:mr(pa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=n(ft(o/t));s<o;)l[a++]=ei(e,s,s+=t);return l},Mr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Mr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Dt(zs(r)?Ei(r):[r],mn(t,1))},Mr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?It(e,(function(e){if("function"!=typeof e[1])throw new je(o);return[r(e[0]),e[1]]})):[],Xn((function(r){for(var n=-1;++n<t;){var i=e[n];if(xt(i[0],this,r))return xt(i[1],this,r)}}))},Mr.conforms=function(e){return function(e){var t=Ra(e);return function(r){return an(r,e,t)}}(sn(e,1))},Mr.constant=Ja,Mr.countBy=hs,Mr.create=function(e,t){var r=Lr(e);return null==t?r:tn(r,t)},Mr.curry=function e(t,r,n){var o=Wi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.curryRight=function e(t,r,n){var o=Wi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.debounce=Rs,Mr.defaults=xa,Mr.defaultsDeep=Sa,Mr.defer=Is,Mr.delay=Ds,Mr.difference=$o,Mr.differenceBy=qo,Mr.differenceWith=Bo,Mr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:pa(t))<0?0:t,n):[]},Mr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:pa(t)))<0?0:t):[]},Mr.dropRightWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!0,!0):[]},Mr.dropWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!0):[]},Mr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&bo(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=pa(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:pa(n))<0&&(n+=o),n=r>n?0:ha(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Mr.filter=function(e,t){return(zs(e)?Tt:hn)(e,oo(t,3))},Mr.flatMap=function(e,t){return mn(As(e,t),1)},Mr.flatMapDeep=function(e,t){return mn(As(e,t),c)},Mr.flatMapDepth=function(e,t,r){return r=r===i?1:pa(r),mn(As(e,t),r)},Mr.flatten=Uo,Mr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Mr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===i?1:pa(t)):[]},Mr.flip=function(e){return Wi(e,512)},Mr.flow=el,Mr.flowRight=tl,Mr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Mr.functions=function(e){return null==e?[]:_n(e,Ra(e))},Mr.functionsIn=function(e){return null==e?[]:_n(e,Ia(e))},Mr.groupBy=vs,Mr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Mr.intersection=Ho,Mr.intersectionBy=Xo,Mr.intersectionWith=Wo,Mr.invert=ja,Mr.invertBy=Ta,Mr.invokeMap=_s,Mr.iteratee=nl,Mr.keyBy=ws,Mr.keys=Ra,Mr.keysIn=Ia,Mr.map=As,Mr.mapKeys=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Mr.mapValues=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Mr.matches=function(e){return Mn(sn(e,1))},Mr.matchesProperty=function(e,t){return Ln(e,sn(t,1))},Mr.memoize=Fs,Mr.merge=Da,Mr.mergeWith=Fa,Mr.method=il,Mr.methodOf=ol,Mr.mixin=sl,Mr.negate=Ps,Mr.nthArg=function(e){return e=pa(e),Xn((function(t){return qn(t,e)}))},Mr.omit=Pa,Mr.omitBy=function(e,t){return Na(e,Ps(oo(t)))},Mr.once=function(e){return js(2,e)},Mr.orderBy=function(e,t,r,n){return null==e?[]:(zs(t)||(t=null==t?[]:[t]),zs(r=n?i:r)||(r=null==r?[]:[r]),Bn(e,t,r))},Mr.over=ll,Mr.overArgs=ks,Mr.overEvery=ul,Mr.overSome=cl,Mr.partial=Ns,Mr.partialRight=Ms,Mr.partition=xs,Mr.pick=ka,Mr.pickBy=Na,Mr.property=dl,Mr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Mr.pull=Ko,Mr.pullAll=Qo,Mr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?zn(e,t,oo(r,2)):e},Mr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?zn(e,t,i,r):e},Mr.pullAt=Zo,Mr.range=fl,Mr.rangeRight=pl,Mr.rearg=Ls,Mr.reject=function(e,t){return(zs(e)?Tt:hn)(e,Ps(oo(t,3)))},Mr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return Un(e,i),r},Mr.rest=function(e,t){if("function"!=typeof e)throw new je(o);return Xn(e,t=t===i?t:pa(t))},Mr.reverse=Jo,Mr.sampleSize=function(e,t,r){return t=(r?bo(e,t,r):t===i)?1:pa(t),(zs(e)?Yr:Yn)(e,t)},Mr.set=function(e,t,r){return null==e?e:Kn(e,t,r)},Mr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Kn(e,t,r,n)},Mr.shuffle=function(e){return(zs(e)?Kr:Jn)(e)},Mr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&bo(e,t,r)?(t=0,r=n):(t=null==t?0:pa(t),r=r===i?n:pa(r)),ei(e,t,r)):[]},Mr.sortBy=Ss,Mr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Mr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Mr.split=function(e,t,r){return r&&"number"!=typeof r&&bo(e,t,r)&&(t=r=i),(r=r===i?p:r>>>0)?(e=ba(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&nr(e)?yi(cr(e),0,r):e.split(t,r):[]},Mr.spread=function(e,t){if("function"!=typeof e)throw new je(o);return t=null==t?0:mr(pa(t),0),Xn((function(r){var n=r[t],i=yi(r,0,t);return n&&Dt(i,n),xt(e,this,i)}))},Mr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Mr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:pa(t))<0?0:t):[]},Mr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:pa(t)))<0?0:t,n):[]},Mr.takeRightWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!1,!0):[]},Mr.takeWhile=function(e,t){return e&&e.length?ci(e,oo(t,3)):[]},Mr.tap=function(e,t){return t(e),e},Mr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new je(o);return Js(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Rs(e,t,{leading:n,maxWait:t,trailing:i})},Mr.thru=fs,Mr.toArray=da,Mr.toPairs=Ma,Mr.toPairsIn=La,Mr.toPath=function(e){return zs(e)?It(e,No):aa(e)?[e]:Ei(ko(ba(e)))},Mr.toPlainObject=ga,Mr.transform=function(e,t,r){var n=zs(e),i=n||Xs(e)||la(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Js(e)&&Ks(o)?Lr(Ue(e)):{}}return(i?Ot:yn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Mr.unary=function(e){return Es(e,1)},Mr.union=es,Mr.unionBy=ts,Mr.unionWith=rs,Mr.uniq=function(e){return e&&e.length?ai(e):[]},Mr.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Mr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Mr.unset=function(e,t){return null==e||li(e,t)},Mr.unzip=ns,Mr.unzipWith=is,Mr.update=function(e,t,r){return null==e?e:ui(e,t,mi(r))},Mr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ui(e,t,mi(r),n)},Mr.values=$a,Mr.valuesIn=function(e){return null==e?[]:Kt(e,Ia(e))},Mr.without=os,Mr.words=Ka,Mr.wrap=function(e,t){return Ns(mi(t),e)},Mr.xor=ss,Mr.xorBy=as,Mr.xorWith=ls,Mr.zip=us,Mr.zipObject=function(e,t){return pi(e||[],t||[],Zr)},Mr.zipObjectDeep=function(e,t){return pi(e||[],t||[],Kn)},Mr.zipWith=cs,Mr.entries=Ma,Mr.entriesIn=La,Mr.extend=va,Mr.extendWith=_a,sl(Mr,Mr),Mr.add=bl,Mr.attempt=Qa,Mr.camelCase=qa,Mr.capitalize=Ba,Mr.ceil=yl,Mr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=ma(r))==r?r:0),t!==i&&(t=(t=ma(t))==t?t:0),on(ma(e),t,r)},Mr.clone=function(e){return sn(e,4)},Mr.cloneDeep=function(e){return sn(e,5)},Mr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:i)},Mr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:i)},Mr.conformsTo=function(e,t){return null==t||an(e,t,Ra(t))},Mr.deburr=Ga,Mr.defaultTo=function(e,t){return null==e||e!=e?t:e},Mr.divide=vl,Mr.endsWith=function(e,t,r){e=ba(e),t=si(t);var n=e.length,o=r=r===i?n:on(pa(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Mr.eq=$s,Mr.escape=function(e){return(e=ba(e))&&W.test(e)?e.replace(H,tr):e},Mr.escapeRegExp=function(e){return(e=ba(e))&&re.test(e)?e.replace(te,"\\$&"):e},Mr.every=function(e,t,r){var n=zs(e)?jt:fn;return r&&bo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.find=ms,Mr.findIndex=Go,Mr.findKey=function(e,t){return Mt(e,oo(t,3),yn)},Mr.findLast=gs,Mr.findLastIndex=zo,Mr.findLastKey=function(e,t){return Mt(e,oo(t,3),vn)},Mr.floor=_l,Mr.forEach=bs,Mr.forEachRight=ys,Mr.forIn=function(e,t){return null==e?e:gn(e,oo(t,3),Ia)},Mr.forInRight=function(e,t){return null==e?e:bn(e,oo(t,3),Ia)},Mr.forOwn=function(e,t){return e&&yn(e,oo(t,3))},Mr.forOwnRight=function(e,t){return e&&vn(e,oo(t,3))},Mr.get=Oa,Mr.gt=qs,Mr.gte=Bs,Mr.has=function(e,t){return null!=e&&po(e,t,On)},Mr.hasIn=Ea,Mr.head=Vo,Mr.identity=rl,Mr.includes=function(e,t,r,n){e=Vs(e)?e:$a(e),r=r&&!n?pa(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),sa(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&$t(e,t,r)>-1},Mr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:pa(r);return i<0&&(i=mr(n+i,0)),$t(e,t,i)},Mr.inRange=function(e,t,r){return t=fa(t),r===i?(r=t,t=0):r=fa(r),function(e,t,r){return e>=gr(t,r)&&e<mr(t,r)}(e=ma(e),t,r)},Mr.invoke=Ca,Mr.isArguments=Gs,Mr.isArray=zs,Mr.isArrayBuffer=Us,Mr.isArrayLike=Vs,Mr.isArrayLikeObject=Hs,Mr.isBoolean=function(e){return!0===e||!1===e||ea(e)&&xn(e)==b},Mr.isBuffer=Xs,Mr.isDate=Ws,Mr.isElement=function(e){return ea(e)&&1===e.nodeType&&!na(e)},Mr.isEmpty=function(e){if(null==e)return!0;if(Vs(e)&&(zs(e)||"string"==typeof e||"function"==typeof e.splice||Xs(e)||la(e)||Gs(e)))return!e.length;var t=fo(e);if(t==A||t==j)return!e.size;if(wo(e))return!Pn(e).length;for(var r in e)if(Fe.call(e,r))return!1;return!0},Mr.isEqual=function(e,t){return Rn(e,t)},Mr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Rn(e,t,i,r):!!n},Mr.isError=Ys,Mr.isFinite=function(e){return"number"==typeof e&&Nt(e)},Mr.isFunction=Ks,Mr.isInteger=Qs,Mr.isLength=Zs,Mr.isMap=ta,Mr.isMatch=function(e,t){return e===t||In(e,t,ao(t))},Mr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,In(e,t,ao(t),r)},Mr.isNaN=function(e){return ra(e)&&e!=+e},Mr.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dn(e)},Mr.isNil=function(e){return null==e},Mr.isNull=function(e){return null===e},Mr.isNumber=ra,Mr.isObject=Js,Mr.isObjectLike=ea,Mr.isPlainObject=na,Mr.isRegExp=ia,Mr.isSafeInteger=function(e){return Qs(e)&&e>=-9007199254740991&&e<=d},Mr.isSet=oa,Mr.isString=sa,Mr.isSymbol=aa,Mr.isTypedArray=la,Mr.isUndefined=function(e){return e===i},Mr.isWeakMap=function(e){return ea(e)&&fo(e)==R},Mr.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==xn(e)},Mr.join=function(e,t){return null==e?"":Ut.call(e,t)},Mr.kebabCase=za,Mr.last=Yo,Mr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=pa(r))<0?mr(n+o,0):gr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Lt(e,Bt,o,!0)},Mr.lowerCase=Ua,Mr.lowerFirst=Va,Mr.lt=ua,Mr.lte=ca,Mr.max=function(e){return e&&e.length?pn(e,rl,Sn):i},Mr.maxBy=function(e,t){return e&&e.length?pn(e,oo(t,2),Sn):i},Mr.mean=function(e){return Gt(e,rl)},Mr.meanBy=function(e,t){return Gt(e,oo(t,2))},Mr.min=function(e){return e&&e.length?pn(e,rl,kn):i},Mr.minBy=function(e,t){return e&&e.length?pn(e,oo(t,2),kn):i},Mr.stubArray=hl,Mr.stubFalse=ml,Mr.stubObject=function(){return{}},Mr.stubString=function(){return""},Mr.stubTrue=function(){return!0},Mr.multiply=wl,Mr.nth=function(e,t){return e&&e.length?qn(e,pa(t)):i},Mr.noConflict=function(){return dt._===this&&(dt._=Le),this},Mr.noop=al,Mr.now=Os,Mr.pad=function(e,t,r){e=ba(e);var n=(t=pa(t))?ur(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Bi(pt(i),r)+e+Bi(ft(i),r)},Mr.padEnd=function(e,t,r){e=ba(e);var n=(t=pa(t))?ur(e):0;return t&&n<t?e+Bi(t-n,r):e},Mr.padStart=function(e,t,r){e=ba(e);var n=(t=pa(t))?ur(e):0;return t&&n<t?Bi(t-n,r)+e:e},Mr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),yr(ba(e).replace(ne,""),t||0)},Mr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&bo(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fa(e),t===i?(t=e,e=0):t=fa(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=vr();return gr(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Vn(e,t)},Mr.reduce=function(e,t,r){var n=zs(e)?Ft:Vt,i=arguments.length<3;return n(e,oo(t,4),r,i,cn)},Mr.reduceRight=function(e,t,r){var n=zs(e)?Pt:Vt,i=arguments.length<3;return n(e,oo(t,4),r,i,dn)},Mr.repeat=function(e,t,r){return t=(r?bo(e,t,r):t===i)?1:pa(t),Hn(ba(e),t)},Mr.replace=function(){var e=arguments,t=ba(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Mr.result=function(e,t,r){var n=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++n<o;){var s=null==e?i:e[No(t[n])];s===i&&(n=o,s=r),e=Ks(s)?s.call(e):s}return e},Mr.round=Al,Mr.runInContext=e,Mr.sample=function(e){return(zs(e)?Wr:Wn)(e)},Mr.size=function(e){if(null==e)return 0;if(Vs(e))return sa(e)?ur(e):e.length;var t=fo(e);return t==A||t==j?e.size:Pn(e).length},Mr.snakeCase=Ha,Mr.some=function(e,t,r){var n=zs(e)?kt:ti;return r&&bo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.sortedIndex=function(e,t){return ri(e,t)},Mr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Mr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&$s(e[n],t))return n}return-1},Mr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Mr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Mr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if($s(e[r],t))return r}return-1},Mr.startCase=Xa,Mr.startsWith=function(e,t,r){return e=ba(e),r=null==r?0:on(pa(r),0,e.length),t=si(t),e.slice(r,r+t.length)==t},Mr.subtract=xl,Mr.sum=function(e){return e&&e.length?Ht(e,rl):0},Mr.sumBy=function(e,t){return e&&e.length?Ht(e,oo(t,2)):0},Mr.template=function(e,t,r){var n=Mr.templateSettings;r&&bo(e,t,r)&&(t=i),e=ba(e),t=_a({},t,n,Yi);var o,s,a=_a({},t.imports,n.imports,Yi),l=Ra(a),u=Kt(a,l),c=0,d=t.interpolate||ve,f="__p += '",p=Oe((t.escape||ve).source+"|"+d.source+"|"+(d===Q?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),h="//# sourceURL="+(Fe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(p,(function(t,r,n,i,a,l){return n||(n=i),f+=e.slice(c,l).replace(_e,rr),r&&(o=!0,f+="' +\n__e("+r+") +\n'"),a&&(s=!0,f+="';\n"+a+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=l+t.length,t})),f+="';\n";var m=Fe.call(t,"variable")&&t.variable;if(m){if(ue.test(m))throw new we("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(s?f.replace(G,""):f).replace(z,"$1").replace(U,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=Qa((function(){return Ae(l,h+"return "+f).apply(i,u)}));if(g.source=f,Ys(g))throw g;return g},Mr.times=function(e,t){if((e=pa(e))<1||e>d)return[];var r=p,n=gr(e,p);t=oo(t),e-=p;for(var i=Xt(n,t);++r<e;)t(r);return i},Mr.toFinite=fa,Mr.toInteger=pa,Mr.toLength=ha,Mr.toLower=function(e){return ba(e).toLowerCase()},Mr.toNumber=ma,Mr.toSafeInteger=function(e){return e?on(pa(e),-9007199254740991,d):0===e?e:0},Mr.toString=ba,Mr.toUpper=function(e){return ba(e).toUpperCase()},Mr.trim=function(e,t,r){if((e=ba(e))&&(r||t===i))return Wt(e);if(!e||!(t=si(t)))return e;var n=cr(e),o=cr(t);return yi(n,Zt(n,o),Jt(n,o)+1).join("")},Mr.trimEnd=function(e,t,r){if((e=ba(e))&&(r||t===i))return e.slice(0,dr(e)+1);if(!e||!(t=si(t)))return e;var n=cr(e);return yi(n,0,Jt(n,cr(t))+1).join("")},Mr.trimStart=function(e,t,r){if((e=ba(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=si(t)))return e;var n=cr(e);return yi(n,Zt(n,cr(t))).join("")},Mr.truncate=function(e,t){var r=30,n="...";if(Js(t)){var o="separator"in t?t.separator:o;r="length"in t?pa(t.length):r,n="omission"in t?si(t.omission):n}var s=(e=ba(e)).length;if(nr(e)){var a=cr(e);s=a.length}if(r>=s)return e;var l=r-ur(n);if(l<1)return n;var u=a?yi(a,0,l).join(""):e.slice(0,l);if(o===i)return u+n;if(a&&(l+=u.length-l),ia(o)){if(e.slice(l).search(o)){var c,d=u;for(o.global||(o=Oe(o.source,ba(fe.exec(o))+"g")),o.lastIndex=0;c=o.exec(d);)var f=c.index;u=u.slice(0,f===i?l:f)}}else if(e.indexOf(si(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+n},Mr.unescape=function(e){return(e=ba(e))&&X.test(e)?e.replace(V,fr):e},Mr.uniqueId=function(e){var t=++Pe;return ba(e)+t},Mr.upperCase=Wa,Mr.upperFirst=Ya,Mr.each=bs,Mr.eachRight=ys,Mr.first=Vo,sl(Mr,(gl={},yn(Mr,(function(e,t){Fe.call(Mr.prototype,t)||(gl[t]=e)})),gl),{chain:!1}),Mr.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Mr[e].placeholder=Mr})),Ot(["drop","take"],(function(e,t){Br.prototype[e]=function(r){r=r===i?1:mr(pa(r),0);var n=this.__filtered__&&!t?new Br(this):this.clone();return n.__filtered__?n.__takeCount__=gr(r,n.__takeCount__):n.__views__.push({size:gr(r,p),type:e+(n.__dir__<0?"Right":"")}),n},Br.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Br.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ot(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Br.prototype[e]=function(){return this[r](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Br.prototype[e]=function(){return this.__filtered__?new Br(this):this[r](1)}})),Br.prototype.compact=function(){return this.filter(rl)},Br.prototype.find=function(e){return this.filter(e).head()},Br.prototype.findLast=function(e){return this.reverse().find(e)},Br.prototype.invokeMap=Xn((function(e,t){return"function"==typeof e?new Br(this):this.map((function(r){return Tn(r,e,t)}))})),Br.prototype.reject=function(e){return this.filter(Ps(oo(e)))},Br.prototype.slice=function(e,t){e=pa(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Br(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=pa(t))<0?r.dropRight(-t):r.take(t-e)),r)},Br.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Br.prototype.toArray=function(){return this.take(p)},yn(Br.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Mr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Mr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,l=t instanceof Br,u=a[0],c=l||zs(t),d=function(e){var t=o.apply(Mr,Dt([e],a));return n&&f?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var f=this.__chain__,p=!!this.__actions__.length,h=s&&!f,m=l&&!p;if(!s&&c){t=m?t:new Br(this);var g=e.apply(t,a);return g.__actions__.push({func:fs,args:[d],thisArg:i}),new qr(g,f)}return h&&m?e.apply(this,a):(g=this.thru(d),h?n?g.value()[0]:g.value():g)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Mr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(zs(i)?i:[],e)}return this[r]((function(r){return t.apply(zs(r)?r:[],e)}))}})),yn(Br.prototype,(function(e,t){var r=Mr[t];if(r){var n=r.name+"";Fe.call(Tr,n)||(Tr[n]=[]),Tr[n].push({name:t,func:r})}})),Tr[Mi(i,2).name]=[{name:"wrapper",func:i}],Br.prototype.clone=function(){var e=new Br(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Br.prototype.reverse=function(){if(this.__filtered__){var e=new Br(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Br.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=zs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=gr(t,e+s);break;case"takeRight":e=mr(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,u=n?a:s-1,c=this.__iteratees__,d=c.length,f=0,p=gr(l,this.__takeCount__);if(!r||!n&&i==l&&p==l)return di(e,this.__actions__);var h=[];e:for(;l--&&f<p;){for(var m=-1,g=e[u+=t];++m<d;){var b=c[m],y=b.iteratee,v=b.type,_=y(g);if(2==v)g=_;else if(!_){if(1==v)continue e;break e}}h[f++]=g}return h},Mr.prototype.at=ps,Mr.prototype.chain=function(){return ds(this)},Mr.prototype.commit=function(){return new qr(this.value(),this.__chain__)},Mr.prototype.next=function(){this.__values__===i&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Mr.prototype.plant=function(e){for(var t,r=this;r instanceof $r;){var n=Lo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Mr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Br){var t=e;return this.__actions__.length&&(t=new Br(this)),(t=t.reverse()).__actions__.push({func:fs,args:[Jo],thisArg:i}),new qr(t,this.__chain__)}return this.thru(Jo)},Mr.prototype.toJSON=Mr.prototype.valueOf=Mr.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Mr.prototype.first=Mr.prototype.head,Ye&&(Mr.prototype[Ye]=function(){return this}),Mr}();dt._=pr,(n=function(){return pr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},4772:e=>{e.exports=function(){return!1}},6603:(e,t,r)=>{r.r(t),r.d(t,{DOMException:()=>w,Headers:()=>c,Request:()=>b,Response:()=>v,fetch:()=>A});var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function p(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i.arrayBuffer&&i.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(i.blob)return this.blob().then(p);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,i,o=d(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),i=(n=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?n[1]:"utf-8",t.readAsText(e,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=a(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},c.prototype.delete=function(e){delete this.map[a(e)]},c.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},c.prototype.set=function(e,t){this.map[a(e)]=l(t)},c.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},c.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),u(e)},c.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),u(e)},c.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),u(e)},i.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var g=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,i,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(i=(r=t.method||this.method||"GET").toUpperCase(),g.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;s.test(this.url)?this.url=this.url.replace(s,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function v(e,t){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var _=[301,302,303,307,308];v.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})};var w=n.DOMException;try{new w}catch(e){(w=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),w.prototype.constructor=w}function A(e,t){return new Promise((function(r,o){var s=new b(e,t);if(s.signal&&s.signal.aborted)return o(new w("Aborted","AbortError"));var u=new XMLHttpRequest;function d(){u.abort()}if(u.onload=function(){var e,t,n={statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();try{t.append(n,i)}catch(e){console.warn("Response "+e.message)}}})),t)};0===s.url.indexOf("file://")&&(u.status<200||u.status>599)?n.status=200:n.status=u.status,n.url="responseURL"in u?u.responseURL:n.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;setTimeout((function(){r(new v(i,n))}),0)},u.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},u.onabort=function(){setTimeout((function(){o(new w("Aborted","AbortError"))}),0)},u.open(s.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?u.withCredentials=!0:"omit"===s.credentials&&(u.withCredentials=!1),"responseType"in u&&(i.blob?u.responseType="blob":i.arrayBuffer&&(u.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof c||n.Headers&&t.headers instanceof n.Headers)){var f=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){f.push(a(e)),u.setRequestHeader(e,l(t.headers[e]))})),s.headers.forEach((function(e,t){-1===f.indexOf(t)&&u.setRequestHeader(t,e)}))}else s.headers.forEach((function(e,t){u.setRequestHeader(t,e)}));s.signal&&(s.signal.addEventListener("abort",d),u.onreadystatechange=function(){4===u.readyState&&s.signal.removeEventListener("abort",d)}),u.send(void 0===s._bodyInit?null:s._bodyInit)}))}A.polyfill=!0,n.fetch||(n.fetch=A,n.Headers=c,n.Request=b,n.Response=v)},7262:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionDoesNotExistOnProject=void 0;class r extends Error{constructor(e){super(e),this.name="ConnectionDoesNotExistOnProject"}}t.ConnectionDoesNotExistOnProject=r},6537:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DashboardQuotaReached=void 0;class r extends Error{constructor(e){super(e),this.name="DashboardQuotaReached"}}t.DashboardQuotaReached=r},2315:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToCreateDashboard=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToCreateDashboard"}}t.FailedToCreateDashboard=r},4365:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToCreateGlobalLibrary=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToCreateGlobalLibrary"}}t.FailedToCreateGlobalLibrary=r},3482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToCreateQueryEngineUser=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToCreateQueryEngineUser"}}t.FailedToCreateQueryEngineUser=r},8912:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToDecryptDashboardBeforeClient=void 0;class r extends Error{constructor(){super("Vizzly offers dashboard encryption to keep your dashboard configurations secure.\nPlease ensure your Vizzly Query Engine is still setup to manage encrypted dashboards."),this.name="FailedToDecryptDashboardBeforeClient"}}t.FailedToDecryptDashboardBeforeClient=r},9235:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchConnection=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchConnection"}}t.FailedToFetchConnection=r},4979:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchDashboardAccessTokens=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchDashboardAccessTokens"}}t.FailedToFetchDashboardAccessTokens=r},5186:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchDashboards=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchDashboards"}}t.FailedToFetchDashboards=r},3749:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchGlobalLibraryAccessTokens=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchGlobalLibraryAccessTokens"}}t.FailedToFetchGlobalLibraryAccessTokens=r},2994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchProject=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchProject"}}t.FailedToFetchProject=r},6689:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchProjects=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchProjects"}}t.FailedToFetchProjects=r},5654:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchQueryEngineUser=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchQueryEngineUser"}}t.FailedToFetchQueryEngineUser=r},3551:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchTeamMembers=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchTeamMembers"}}t.FailedToFetchTeamMembers=r},4455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToFetchVizzlyConfig=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToFetchVizzlyConfig"}}t.FailedToFetchVizzlyConfig=r},3394:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToResolveDataSets=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToResolveDataSets"}}t.FailedToResolveDataSets=r},8108:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToSaveProjectEncryptedEncryptionSecret=void 0;class r extends Error{constructor(e){super(`Failed to save project encrypted encryption secret for ${e}`),this.name="FailedToSaveProjectEncryptedEncryptionSecret"}}t.FailedToSaveProjectEncryptedEncryptionSecret=r},2309:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToSetupProject=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToSetupProject"}}t.FailedToSetupProject=r},2680:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToUpdateDashboard=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToUpdateDashboard"}}t.FailedToUpdateDashboard=r},2258:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToUpdateGlobalLibrary=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToUpdateGlobalLibrary"}}t.FailedToUpdateGlobalLibrary=r},2325:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FailedToUpdateQueryEngineUser=void 0;class r extends Error{constructor(e){super(e),this.name="FailedToUpdateQueryEngineUser"}}t.FailedToUpdateQueryEngineUser=r},7634:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingAuthParameter=void 0;class r extends Error{constructor(e){super(`Missing required auth parameter ${e}`)}}t.MissingAuthParameter=r},642:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRequiredVizzlyQueryEngineApi=void 0;class r extends Error{}t.MissingRequiredVizzlyQueryEngineApi=r},9635:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProjectEncryptedSecretAlreadySaved=void 0;class r extends Error{constructor(e){super(`Project encrypted encryption secret already exists for ${e}`),this.name="ProjectEncryptedSecretAlreadySaved"}}t.ProjectEncryptedSecretAlreadySaved=r},6081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SQLPreviewError=void 0;const n=r(9040);class i extends n.ValidationError{constructor(e){super(e),this.name="SQLPreviewError"}}t.SQLPreviewError=i},9040:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationError=void 0;class r extends Error{constructor(e){super(e),this.name="ValidationError"}}t.ValidationError=r},9979:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6537),t),i(r(2315),t),i(r(4979),t),i(r(5186),t),i(r(7634),t),i(r(642),t),i(r(9040),t),i(r(6081),t),i(r(2309),t),i(r(3394),t),i(r(4365),t),i(r(8912),t),i(r(2680),t),i(r(4455),t),i(r(7262),t),i(r(9235),t),i(r(2994),t),i(r(6689),t),i(r(3551),t),i(r(3482),t),i(r(5654),t),i(r(9635),t),i(r(8108),t)},4843:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Errors=void 0,o(r(2890),t),o(r(5512),t),o(r(7855),t),o(r(4640),t),o(r(9800),t),o(r(1171),t),o(r(7783),t),o(r(2474),t),t.Errors=s(r(9979))},3806:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Api=void 0;const o=i(r(3493)),s=r(3052),a=r(7783);t.Api=class{constructor(e,t,r=(()=>({}))){this.host=t,this.extraHeaders=r,this.auth=e}execute(e){return n(this,void 0,void 0,(function*(){var t;const r=this.auth.buildAuthHeaders(e.acceptedAuthParams),n=Object.assign(Object.assign({},e.headers||{}),this.extraHeaders()||{}),i=`${this.host}${e.path}`,l=s.Monitor.timeRequest(e.method,i,o.default),u=yield l(i,{method:e.method,headers:Object.assign(Object.assign({"Content-Type":"application/json",Accept:"application/json"},r),n),redirect:"follow",referrerPolicy:"no-referrer",body:e.body?JSON.stringify(e.body):null,signal:e.abortSignal});let c=(null===(t=u.headers.get("content-type"))||void 0===t?void 0:t.includes("json"))?yield u.json():u.text();const d=u.headers.get("vizzly-query-engine-request-id")||"-",f=u.headers.get("x-request-id")||"-";return 500===u.status&&console.log(`[TRACING] QE; ${d} - API; ${f}`,r),a.VizzlyApiClientLogger.debug(`[TRACING] QE; ${d} - API; ${f}`),{body:c,status:u.status,headers:u.headers}}))}getAuth(){return this.auth}}},9800:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Authentication=void 0;const n=r(5250),i=r(7634);t.Authentication=class{constructor(e){this.authParams=e}updateAuthParams(e){this.authParams=Object.assign(Object.assign({},this.authParams),e)}clearAuthParams(){this.authParams={}}getQueryEngineAccessToken(){if(!this.authParams.queryEngineAccessToken)throw new i.MissingAuthParameter("queryEngineAccessToken");return this.authParams.queryEngineAccessToken}getProjectAdminOverrideToken(){return this.authParams.projectAdminOverrideToken}getDashboardAccessToken(){if(!this.authParams.dashboardAccessToken)throw new i.MissingAuthParameter("dashboardAccessToken");return this.authParams.dashboardAccessToken}getAppSessionToken(){return this.authParams.appSessionToken}getDataAccessToken(){if(!this.authParams.dataAccessToken)throw new i.MissingAuthParameter("dataAccessToken");return this.authParams.dataAccessToken}getProjectApiKey(){if(!this.authParams.projectApiKey)throw new i.MissingAuthParameter("projectApiKey");return this.authParams.projectApiKey}getProjectAccessToken(){if(!this.authParams.projectAccessToken)throw new i.MissingAuthParameter("projectAccessToken");return this.authParams.projectAccessToken}buildAuthHeaders(e){let t=e?(0,n.pick)(this.authParams,e):this.authParams;return t.dashboardAccessToken?{auth:`Bearer ${t.dashboardAccessToken}`}:t.projectAccessToken?{auth:`Bearer ${t.projectAccessToken}`}:t.projectApiKey?{auth:`Api-Key ${t.projectApiKey}`}:t.appSessionToken?{auth:`Bearer ${t.appSessionToken}`}:{}}}},8607:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DashboardManager=void 0;const i=r(5250),o=r(4968);class s{constructor(e){this.vizzly=e}create(e){return n(this,void 0,void 0,(function*(){const t=this.vizzly.getDashboardRepository();return yield t.createDashboard(e)}))}update(e){return n(this,void 0,void 0,(function*(){var t,r,s;const a=this.vizzly.getDashboardRepository(),l=this.vizzly.getGlobalLibraryRepository(),[{global_libraries:u,permissions:c},{dashboards:d,permissions:f}]=yield Promise.all([l.fetchGlobalLibraries(e),a.fetchDashboards(e)]),p=d.find((t=>t.id===e.dashboardId));if(!p)throw new Error("Cannot find dashboard to update.");const{parentGlobalLibraries:h,childGlobalLibraries:m}=o.GlobalLibraryRepository.splitParentAndChildGlobalLibraries(u),g=f.find((t=>"read_write"===t.scope&&t.dashboardId===e.dashboardId));if(!g)throw new Error("Failed to find update token for dashboard.");const b=yield a.updateDashboard(Object.assign(Object.assign({},e),{dashboardPermission:g}));let y=[];(null===(t=e.definition)||void 0===t?void 0:t.componentLibrary)&&(y=(0,i.cloneDeep)(e.definition.componentLibrary||[]).filter((e=>!(null!==p.parent_dashboard_id&&e.attributes.protectedByOrganisation))));const v=null===p.parent_dashboard_id?h:m,_=null===p.parent_dashboard_id,w=y.length>0||!!(null===(r=e.definition)||void 0===r?void 0:r.customFields),A=u.find((e=>null===e.parent_global_library_id));!_&&A&&w&&0===v.length&&(yield l.createGlobalLibrary({library:{views:y,customFields:(null===(s=e.definition)||void 0===s?void 0:s.customFields)||{}},parentGlobalLibraryId:A.id,permissions:[{scope:"read_write"}]}));const x=v.map((t=>n(this,void 0,void 0,(function*(){var r;const n=c.find((e=>e.globalLibraryId===t.id&&"read_write"===e.scope));n||console.log("No write permission"),n&&(yield l.updateGlobalLibrary({globalLibrarySessionToken:n.token,library:{views:y,customFields:(null===(r=e.definition)||void 0===r?void 0:r.customFields)||{}}}))}))));return yield Promise.all(x),b}))}getDashboards(e){return n(this,void 0,void 0,(function*(){const t=this.vizzly.getDashboardRepository(),r=this.vizzly.getGlobalLibraryRepository(),[{dashboards:n},{global_libraries:i}]=yield Promise.all([t.fetchDashboards(e),r.fetchGlobalLibraries(e)]);return s.mergeDashboardsAndGlobalLibraries(n,i)}))}static mergeDashboardsAndGlobalLibraries(e,t){return(0,i.cloneDeep)(e).map((r=>{let n=(0,i.cloneDeep)(r.definition.componentLibrary),a=null===r.parent_dashboard_id?[]:e.find((e=>e.id===r.parent_dashboard_id)).definition.componentLibrary,{parentGlobalLibraries:l,childGlobalLibraries:u}=o.GlobalLibraryRepository.splitParentAndChildGlobalLibraries(t);u=null===r.parent_dashboard_id?[]:u;let c=(0,i.uniqBy)([...s.markViewsAsProtected(l.flatMap((e=>e.library.views||[]))),...u.flatMap((e=>e.library.views||[])),...s.markViewsAsProtected(a),...null===r.parent_dashboard_id?s.markViewsAsProtected(n):n||[]],(e=>e.attributes.viewId));return r.definition.componentLibrary=c,r.definition.customFields=s.mergeCustomFields(r,e,l,u),r}))}static mergeCustomFields(e,t,r,n){var o;const s=null===e.parent_dashboard_id?{}:(null===(o=t.find((t=>t.id===e.parent_dashboard_id)))||void 0===o?void 0:o.definition.customFields)||{};return((...e)=>e.reduce(((e,t)=>(Object.keys(e||{}).forEach((r=>{t[r]||(t[r]=[]),t[r]=(0,i.uniqBy)([...t[r],...(null==e?void 0:e[r])||[]],(e=>e.id))})),t)),{}))((0,i.cloneDeep)(e.definition.customFields)||{},(0,i.cloneDeep)(s)||{},...(0,i.cloneDeep)(n).map((e=>e.library.customFields||{})),...(0,i.cloneDeep)(r).map((e=>e.library.customFields||{})))}static markViewsAsProtected(e){return(e||[]).map((e=>Object.assign(Object.assign({},e),{attributes:Object.assign(Object.assign({},e.attributes),{protectedByOrganisation:!0})})))}}t.DashboardManager=s},178:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DashboardRepository=void 0;const i=r(6537),o=r(2315),s=r(8912),a=r(4979),l=r(2680),u=r(2975),c=r(8328);class d{constructor(e){this.vizzly=e,this.repo=new c.Repository("id")}createDashboard(e){return n(this,void 0,void 0,(function*(){let t;if(this.vizzly.implementationStrategy.shouldPersistViaQueryEngine()){const r=this.vizzly.getVizzlyQueryEngineAPI();t=yield r.execute(r.buildCreateDashboardRequest(e))}else{const r=this.vizzly.getVizzlyAPI();t=yield r.execute(r.buildCreateDashboardRequest(e))}if(200===t.status){const e=t.body.permissions.map(u.Permission.formatDashboardPermission),r=d.embellishDashboardFromAPI(t.body.dashboard,e);return this.repo.addItem(r,e),{dashboard:r,permissions:e}}if(422===t.status)throw new i.DashboardQuotaReached(`Dashboard quota reached; ${JSON.stringify(t.body)}`);if(200!=t.status)throw console.log(),new o.FailedToCreateDashboard(`Failed to create the dashboard from POST /api/v2/dashboard. Got ${t.status}`);throw new o.FailedToCreateDashboard(`Unknown failure. Got status ${t.status}`)}))}updateDashboard(e){return n(this,void 0,void 0,(function*(){let t;if(this.vizzly.implementationStrategy.shouldPersistViaQueryEngine()){const r=this.vizzly.getVizzlyQueryEngineAPI();t=yield r.execute(r.buildUpdateDashboardRequest(e))}else{const r=this.vizzly.getVizzlyAPI();t=yield r.execute(r.buildUpdateDashboardRequest(e))}if(200===t.status){const r=d.embellishDashboardFromAPI(t.body.dashboard,[e.dashboardPermission]);return this.repo.updateItem(r),r}throw new l.FailedToUpdateDashboard(`Failed to update dashboard, got status ${t.status}`)}))}fetchDashboards(e){return n(this,void 0,void 0,(function*(){return yield this.fetchDashboardAccessTokens(e)}))}static embellishDashboardFromAPI(e,t){return Object.assign(Object.assign({},e),{permission:d.takeHighestPermission(e.id,t)})}static takeHighestPermission(e,t){const r=d.takePermissionsOfScope(e,t,"read");return d.takePermissionsOfScope(e,t,"read_write")[0]||r[0]}static takePermissionsOfScope(e,t,r){return t.filter((t=>t.dashboardId===e&&t.scope===r))}fetchDashboardAccessTokens(e){return n(this,void 0,void 0,(function*(){let t;if(!this.repo.isPopulated()){if(this.vizzly.implementationStrategy.shouldPersistViaQueryEngine()){const r=this.vizzly.getVizzlyQueryEngineAPI();t=yield r.execute(r.buildFetchDashboardAccessTokensRequest(e))}else{const r=this.vizzly.getVizzlyAPI();t=yield r.execute(r.buildFetchDashboardAccessTokensRequest(e))}if(200!==t.status)throw new a.FailedToFetchDashboardAccessTokens("Failed to fetch dashboard access tokens.");{const e=t.body.permissions.map(u.Permission.formatDashboardPermission),r=t.body.dashboards.map((t=>{if("string"==typeof t.definition)throw new s.FailedToDecryptDashboardBeforeClient;return d.embellishDashboardFromAPI(t,e)}));this.repo.initRepo(r,e)}}return{dashboards:this.repo.getRepo().storedItems,permissions:this.repo.getRepo().permissions}}))}clearRepo(){this.repo.clear()}}t.DashboardRepository=d},5465:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalLibraryManager=void 0,t.GlobalLibraryManager=class{constructor(e){this.vizzly=e}create(e){return r(this,void 0,void 0,(function*(){const t=this.vizzly.getGlobalLibraryRepository();return yield t.createGlobalLibrary(e)}))}update(e){return r(this,void 0,void 0,(function*(){const t=this.vizzly.getGlobalLibraryRepository(),{global_libraries:r,permissions:n}=yield t.fetchGlobalLibraries(e);if(!r.find((t=>t.id===e.globalLibraryId)))throw new Error("Global library not found");const i=n.find((t=>t.globalLibraryId===e.globalLibraryId&&"read_write"===t.scope));if(!i)throw new Error("No write permission for this library");return yield t.updateGlobalLibrary({globalLibrarySessionToken:i.token,library:e.library})}))}getGlobalLibraries(e){return r(this,void 0,void 0,(function*(){const t=this.vizzly.getGlobalLibraryRepository();return yield t.fetchGlobalLibraries(e)}))}}},4968:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalLibraryRepository=void 0;const i=r(5250),o=r(2975),s=r(3749),a=r(8328),l=r(2258);class u{constructor(e){this.vizzly=e,this.repo=new a.Repository("id")}createGlobalLibrary(e){return n(this,void 0,void 0,(function*(){const t=this.vizzly.getVizzlyAPI();let r;if(this.vizzly.implementationStrategy.shouldPersistViaQueryEngine()){const t=this.vizzly.getVizzlyQueryEngineAPI();r=yield t.createGlobalLibrary(e)}else r=yield t.createGlobalLibrary(e);return r.global_library=u.upcast(r.global_library),this.repo.addItem(r.global_library,r.permissions),r}))}fetchGlobalLibraries(e){return n(this,void 0,void 0,(function*(){return yield this.fetchGlobalLibraryAccessTokens(e)}))}fetchGlobalLibraryAccessTokens(e){return n(this,void 0,void 0,(function*(){const t=this.vizzly.getVizzlyAPI();let r;if(!this.repo.isPopulated()){if(this.vizzly.implementationStrategy.shouldPersistViaQueryEngine()){const t=this.vizzly.getVizzlyQueryEngineAPI();r=yield t.fetchGlobalLibraryAccessTokens(e)}else r=yield t.fetchGlobalLibraryAccessTokens(e);if(200!==r.status)throw new s.FailedToFetchGlobalLibraryAccessTokens("Failed to load access tokens for the global library.");{const e=r.body.permissions.map(o.Permission.formatGlobalLibraryPermission);this.repo.initRepo(r.body.global_libraries.map(u.upcast),e)}}return{global_libraries:this.repo.getRepo().storedItems,permissions:this.repo.getRepo().permissions}}))}updateGlobalLibrary(e){return n(this,void 0,void 0,(function*(){let t;const r=this.vizzly.getVizzlyAPI();if(this.vizzly.implementationStrategy.shouldPersistViaQueryEngine()){const r=this.vizzly.getVizzlyQueryEngineAPI();t=yield r.updateGlobalLibrary(e)}else t=yield r.updateGlobalLibrary(e);if(200!=t.status)throw new l.FailedToUpdateGlobalLibrary(`Failed to update the global library ${t.status}`);const n=u.upcast(t.body.global_library);return this.repo.updateItem(n),n}))}getChildGlobalLibrariesByParentGlobalLibraryId(e){return n(this,void 0,void 0,(function*(){const{global_libraries:t}=yield this.fetchGlobalLibraries();return u.mapParentToChildGlobalLibraries(t)[e]||[]}))}static splitParentAndChildGlobalLibraries(e){let t=[],r=[];return e.forEach((e=>{null===e.parent_global_library_id?r=[...r,e]:t=[...t,e]})),{childGlobalLibraries:t,parentGlobalLibraries:r}}static mapParentToChildGlobalLibraries(e){let t={};return(0,i.cloneDeep)(e).forEach((e=>{null!==e.parent_global_library_id&&(t[e.parent_global_library_id]||(t[e.parent_global_library_id]=[]),t[e.parent_global_library_id]=[...t[e.parent_global_library_id],e])})),t}static upcast(e){return Object.assign(Object.assign({},e),{library:Object.assign({views:[],customFields:{}},e.library||{})})}}t.GlobalLibraryRepository=u},1171:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PersistDirectToVizzlyApi=t.PersistViaQueryEngine=t.ImplementationStrategy=void 0;class r{}t.ImplementationStrategy=r,t.PersistViaQueryEngine=class extends r{shouldPersistViaQueryEngine(){return!0}},t.PersistDirectToVizzlyApi=class extends r{shouldPersistViaQueryEngine(){return!1}}},3052:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Monitor=void 0;const i=r(7783);t.Monitor=class{static timeRequest(e,t,r){return function(...o){return n(this,void 0,void 0,(function*(){const n=performance.now(),s=yield r(...o),a=performance.now()-n;return i.VizzlyApiClientLogger.debug(`[@vizzly/api-client timing] ${e.toUpperCase()} ${t} - ${a.toFixed(2)}ms`),s}))}}}},2975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Permission=void 0,t.Permission=class{static formatDashboardPermission(e){return{userReference:e.user_reference,scope:e.scope,token:e.token,dashboardId:e.dashboard_id}}static formatGlobalLibraryPermission(e){return{userReference:e.user_reference,scope:e.scope,token:e.token,globalLibraryId:e.global_library_id}}static validateJwtExpiry(e,t=10){try{const[r,n,i]=e.split("."),o=Buffer.from(n,"base64").toString("utf-8"),s=JSON.parse(o).exp;return!(s<Math.floor(Date.now()/1e3)+t)}catch(e){return!1}}}},8328:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Repository=void 0;const n=r(5250),i=r(2975);t.Repository=class{constructor(e){this.itemKey=e,this.storedItems=[],this.permissions=[]}getRepo(){return{storedItems:this.storedItems,permissions:this.permissions}}initRepo(e,t){this.storedItems=e,this.permissions=t}addItem(e,t){this.isPopulated()&&(this.storedItems=[...this.storedItems,e],this.permissions=[...this.permissions,...t])}updateItem(e){this.storedItems=this.storedItems.map((t=>t[this.itemKey]==e[this.itemKey]?e:t))}isPopulated(){return(this.storedItems.length>0||this.permissions.length>0)&&this.permissionsAreFresh()}permissionsAreFresh(){return(0,n.every)(this.permissions,(e=>i.Permission.validateJwtExpiry(e.token)))}clear(){this.storedItems=[],this.permissions=[]}}},2890:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Vizzly=void 0;const n=r(642),i=r(178),o=r(4968),s=r(8607),a=r(5465);t.Vizzly=class{constructor(e,t){this.APIs=e,this.implementationStrategy=t,this.dashboardManager=new s.DashboardManager(this),this.dashboardRepository=new i.DashboardRepository(this),this.globalLibraryRepository=new o.GlobalLibraryRepository(this),this.globalLibraryManager=new a.GlobalLibraryManager(this)}getAPIs(){if(this.implementationStrategy.shouldPersistViaQueryEngine()&&!this.APIs.vizzlyQueryEngineApi)throw new n.MissingRequiredVizzlyQueryEngineApi("Strategy is to persist via a query engine. However no query engine API was provided.");return this.APIs}getVizzlyAppApi(){return this.getAPIs().vizzlyAppApi}getVizzlyQueryEngineAPI(){return this.getAPIs().vizzlyQueryEngineApi}getVizzlyAPI(){return this.getAPIs().vizzlyApi}getDashboardRepository(){return this.dashboardRepository}getGlobalLibraryRepository(){return this.globalLibraryRepository}getDashboardManager(){return this.dashboardManager}getGlobalLibraryManager(){return this.globalLibraryManager}}},5512:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VizzlyApi=void 0;const i=r(3806),o=r(9979),s=r(4455),a=r(7262),l=r(9235),u=r(2994),c=r(2325),d=r(8108),f=r(9635);class p extends i.Api{constructor(e,t="https://api.vizzly.co"){super(e,t)}buildFetchDashboardAccessTokensRequest(e){return{path:"/api/v2/auth/dashboards/access",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),projectAdminOverrideToken:this.auth.getProjectAdminOverrideToken()},abortSignal:null==e?void 0:e.abortSignal}}fetchGlobalLibraries(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildFetchGlobalLibrariesRequest(e))}))}buildFetchGlobalLibrariesRequest(e){return{path:"/api/v2/multi-get-global-library",method:"post",body:{globalLibraryAccessTokens:e.globalLibraryAccessTokens},abortSignal:e.abortSignal}}fetchGlobalLibraryAccessTokens(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildFetchGlobalLibraryAccessTokensRequest(e))}))}buildFetchGlobalLibraryAccessTokensRequest(e){return{path:"/api/v2/auth/global-library/access",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),projectAdminOverrideToken:this.auth.getProjectAdminOverrideToken()},abortSignal:null==e?void 0:e.abortSignal}}buildCreateDashboardRequest(e){return{path:"/api/v2/dashboard",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),definition:e.definition,meta:e.metadata||{},parentDashboardId:e.parentDashboardId,permissions:e.permissions},abortSignal:e.abortSignal}}buildFetchDashboardsRequest(e){return{path:"/api/v2/multi-get-dashboard",method:"post",body:{dashboardAccessTokens:e.dashboardSessionAccessTokens},abortSignal:e.abortSignal}}createParentDashboard(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateParentDashboardRequest(e))}))}buildCreateParentDashboardRequest(e){return{path:"/api/v2/parent-dashboard",method:"post",body:{projectId:e.projectId,definition:e.definition},abortSignal:e.abortSignal}}createParentGlobalLibrary(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateParentGlobalLibraryRequest(e))}))}buildCreateParentGlobalLibraryRequest(e){return{path:"/api/v2/parent-global-library",method:"post",body:{projectId:e.projectId,library:e.library},abortSignal:e.abortSignal}}createGlobalLibrary(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildCreateGlobalLibraryRequest(e));if(200===t.status)return t.body;throw new o.FailedToCreateGlobalLibrary("Failed to create global library")}))}buildCreateGlobalLibraryRequest(e){return{path:"/api/v2/global-library",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),parentGlobalLibraryId:e.parentGlobalLibraryId,library:e.library,permissions:e.permissions},abortSignal:e.abortSignal}}getProjects(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildGetProjectsRequest(e));if(200===t.status)return{projects:t.body.projects};throw new o.FailedToFetchProjects(`Failed to fetch projects. Got status ${t.status}`)}))}buildGetProjectsRequest(e){return{path:"/api/v2/projects",method:"get",abortSignal:null==e?void 0:e.abortSignal}}createProjectApiKey(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateProjectApiKeyRequest(e))}))}buildCreateProjectApiKeyRequest(e){return{path:`/api/v3/project/${e.projectId}/api-key`,method:"post",body:{},abortSignal:e.abortSignal}}createQueryEngineUser(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildCreateQueryEngineUserRequest(e));if(200===t.status)return t.body.query_engine_user;throw new o.FailedToCreateQueryEngineUser(`Failed to create query engine user. Got status ${t.status}`)}))}buildCreateQueryEngineUserRequest(e){return{path:`/api/v3/project/${e.projectId}/query-engine-user`,method:"post",body:{email:e.email,password:e.password},abortSignal:e.abortSignal}}buildCreateSelfHostedDynamicQueryEngineProjectRequest(e){return{path:"/api/v2/project/self-hosted-dynamic-query-engine",method:"post",body:{},abortSignal:null==e?void 0:e.abortSignal}}buildCreateSelfHostedInBrowserProjectRequest(e){return{path:"/api/v2/project/self-hosted-in-browser",method:"post",body:{},abortSignal:null==e?void 0:e.abortSignal}}buildCreateSelfHostedProjectRequest(e){return{path:"/api/v2/project/self-hosted-query-engine",method:"post",body:{},abortSignal:null==e?void 0:e.abortSignal}}createManagedQueryEngineProject(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateManagedQueryEngineProjectRequest(e))}))}buildCreateManagedQueryEngineProjectRequest(e){return{path:"/api/v2/project/managed-query-engine",method:"post",body:{parent_dashboard_definition:{}},abortSignal:null==e?void 0:e.abortSignal}}createVizzlyConfigVersion(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateVizzlyConfigVersionRequest(e))}))}buildCreateVizzlyConfigVersionRequest(e){return{path:`/api/v3/project/${e.projectId}/config`,method:"post",body:{projectId:e.projectId,encryptedConfig:e.encryptedConfig},abortSignal:e.abortSignal}}duplicateParentDashboard(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildDuplicateParentDashboardRequest(e))}))}buildDuplicateParentDashboardRequest(e){return{path:"/api/v2/duplicate-parent-dashboard",method:"post",body:{dashboardId:e.dashboardId},abortSignal:e.abortSignal}}getConnection(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildGetConnectionRequest(e));if(200===t.status)return{encryptedCredentials:t.body.encrypted_credentials};if(404==t.status)throw new a.ConnectionDoesNotExistOnProject("An active connection does not exist on the project");throw new l.FailedToFetchConnection(`Failed to fetch connection for the project. Got status ${t.status}`)}))}buildGetConnectionRequest(e){return{path:`/api/v2/project/${e.projectId}/connection`,method:"get",abortSignal:e.abortSignal}}getManagedQueryEngineKeyPair(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildGetManagedQueryEngineKeyPairRequest(e))}))}buildGetManagedQueryEngineKeyPairRequest(e){return{path:`/api/v2/project/managed-query-engine/${e.managedProjectId}/key-pairs/${e.keyPairId}`,method:"get",abortSignal:e.abortSignal}}getProject(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildGetProjectRequest(e));if(200===t.status)return t.body;throw new u.FailedToFetchProject(`Failed to fetch project. Got status ${t.status}`)}))}buildGetProjectRequest(e){return{path:`/api/v3/project/${e.projectId}`,method:"get",abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}getProjectAccessToken(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildGetProjectAccessTokenRequest(e))}))}buildGetProjectAccessTokenRequest(e){let t="";return e.resourceFilters&&(t=`filter=${e.resourceFilters.join(",")}`),{path:`/api/v2/auth/project/${e.projectId}/access_token?${t}`,method:"get",abortSignal:e.abortSignal}}getQueryEngineUser(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildGetQueryEngineUserRequest(e));if(200===t.status)return t.body.query_engine_user;throw new o.FailedToFetchQueryEngineUser(`Failed to fetch query engine user. Got status ${t.status}`)}))}buildGetQueryEngineUserRequest(e){return{path:`/api/v3/project/${e.projectId}/query-engine-user?email=${encodeURIComponent(e.email)}`,method:"get",abortSignal:e.abortSignal}}getTeamMembers(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildGetTeamMembersRequest(e));if(200===t.status)return t.body;throw new o.FailedToFetchTeamMembers(`Failed to fetch team members. Got status ${t.status}`)}))}buildGetTeamMembersRequest(e){return{path:`/api/v3/project/${e.projectId}/organisation-team-members`,method:"get",abortSignal:e.abortSignal}}getVizzlyConfig(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildGetVizzlyConfigRequest(e));if(200===t.status)return{encryptedConfig:t.body.encrypted_config};throw new s.FailedToFetchVizzlyConfig(`Failed to fetch the config containing data sets from the Vizzly API. Got status ${t.status}`)}))}buildGetVizzlyConfigRequest(e){return{path:`/api/v3/project/${e.projectId}/config`,method:"get",abortSignal:e.abortSignal}}saveConnection(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildSaveConnectionRequest(e))}))}buildSaveConnectionRequest(e){return{path:"/api/v3/project/connection",method:"post",body:{projectId:e.projectId,encryptedConfig:e.encryptedConfig,encryptedConnection:e.encryptedConnection},abortSignal:e.abortSignal}}saveEncryptedProjectEncryptionSecret(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildSaveEncryptedProjectEncryptionSecretRequest(e));if(200===t.status)return!0;if(400==t.status&&!e.allowRotation)throw new f.ProjectEncryptedSecretAlreadySaved(e.projectId);throw new d.FailedToSaveProjectEncryptedEncryptionSecret(e.projectId)}))}buildSaveEncryptedProjectEncryptionSecretRequest(e){return{path:`/api/v3/project/${e.projectId}/encrypted-encryption-secret`,method:"post",body:{projectId:e.projectId,encryptedEncryptionSecret:e.encryptedProjectEncryptionSecret,allowRotation:e.allowRotation},abortSignal:e.abortSignal}}saveScheduledReport(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildSaveScheduledReportRequest(e))}))}buildSaveScheduledReportRequest(e){return{path:"/api/scheduled-report",method:"post",body:{cronSchedule:e.cronSchedule,dashboardAccessToken:this.auth.getDashboardAccessToken(),scheduledReportId:e.scheduledReportId},abortSignal:e.abortSignal}}updateDashboard(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateDashboardRequest(e))}))}buildUpdateDashboardRequest(e){return{path:"/api/v2/dashboard",method:"put",body:{dashboardSessionToken:e.dashboardPermission.token,definition:e.definition,meta:e.metadata||e.meta||{},deleted:e.deleted},abortSignal:e.abortSignal}}updateParentGlobalLibrary(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateParentGlobalLibraryRequest(e))}))}buildUpdateParentGlobalLibraryRequest(e){return{path:"/api/v2/parent-global-library",method:"put",body:{globalLibraryId:e.globalLibraryId,deleted:e.deleted,name:e.name},abortSignal:e.abortSignal}}updateGlobalLibrary(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateGlobalLibraryRequest(e))}))}buildUpdateGlobalLibraryRequest(e){return{path:"/api/v2/global-library",method:"put",body:{globalLibrarySessionToken:e.globalLibrarySessionToken,deleted:e.deleted,library:e.library},abortSignal:e.abortSignal}}updateProjectApiKey(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateProjectApiKeyRequest(e))}))}buildUpdateProjectApiKeyRequest(e){return{path:`/api/v3/project/${e.projectId}/api-key/${e.projectApiKeyId}`,method:"put",body:{disabled:e.disabled},abortSignal:e.abortSignal}}updateQueryEngineUser(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildUpdateQueryEngineUserRequest(e));if(200===t.status)return!0;throw new c.FailedToUpdateQueryEngineUser(`Failed to update query engine user. Got status ${t.status}`)}))}buildUpdateQueryEngineUserRequest(e){return{path:`/api/v3/project/${e.projectId}/query-engine-user`,method:"put",body:{query_engine_user_id:e.queryEngineUserId,password:e.password},abortSignal:e.abortSignal}}}t.VizzlyApi=p},7783:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VizzlyApiClientLogger=void 0;class r{static setBackend(e){this.backend=e}static debug(...e){r.backend&&r.backend.debug(...e)}static info(...e){r.backend&&r.backend.info(...e)}static warning(...e){r.backend&&r.backend.warning(...e)}static error(...e){r.backend&&r.backend.error(...e)}}t.VizzlyApiClientLogger=r},7855:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VizzlyAppApi=void 0;const i=r(3806);class o extends i.Api{constructor(e,t="https://app.vizzly.co"){super(e,t)}createCliAuthToken(){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateCliAuthTokenRequest())}))}buildCreateCliAuthTokenRequest(){return{path:"/api/create-cli-auth-token",method:"post",body:{}}}createInstantDashboard(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateInstantDashboardRequest(e))}))}buildCreateInstantDashboardRequest(e){return{path:"/api/v2/instant-dashboard",method:"post",body:{parent_dashboard_definition:e.definition}}}createProjectAdminOverrideAccessToken(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateProjectAdminOverrideAccessTokenRequest(e))}))}buildCreateProjectAdminOverrideAccessTokenRequest(e){return{path:`/api/v2/project/${e.projectId}/admin-override`,method:"post",body:{}}}startEmailChange(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildStartEmailChangeRequest(e))}))}buildStartEmailChangeRequest(e){return{path:"/api/self/start-email-change",method:"post",body:{email:e.email}}}completeEmailChange(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCompleteEmailChangeRequest(e))}))}buildCompleteEmailChangeRequest(e){return{path:"/api/self/complete-email-change",method:"post",body:{token:e.token}}}getManagedQueryEngineAccessTokens(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildGetManagedQueryEngineAccessTokensRequest(e))}))}buildGetManagedQueryEngineAccessTokensRequest(e){return{path:`/api/v2/managed-query-engine/${e.managedQueryEngineId}/identity`,method:"get"}}getParentDashboardMeta(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildGetParentDashboardMetaRequest(e))}))}buildGetParentDashboardMetaRequest(e){return{path:`/api/v2/parent-dashboard/${e.dashboardId}/stats`,method:"get"}}updateParentDashboard(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateParentDashboardRequest(e))}))}buildUpdateParentDashboardRequest(e){return{path:`/api/v2/parent-dashboard/${e.dashboardId}/stats`,method:"put",body:{name:e.name,definition:e.definition,meta:e.meta,deleted:e.deleted,webhookId:e.webhookId}}}getProjectMeta(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildGetProjectMetaRequest(e))}))}buildGetProjectMetaRequest(e){return{path:`/api/v2/project/${e.projectId}/meta`,method:"get"}}getSelf(){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildGetSelfRequest())}))}buildGetSelfRequest(){return{path:"/api/self",method:"get"}}getTeam(){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildGetTeamRequest())}))}buildGetTeamRequest(){return{path:"/api/team",method:"get"}}getWebhooks(){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildGetWebhooksRequest())}))}buildGetWebhooksRequest(){return{path:"/api/organisation/webhooks",method:"get"}}inviteTeamMember(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildInviteTeamMemberRequest(e))}))}buildInviteTeamMemberRequest(e){return{path:"/api/invite",method:"post",body:{email:e.email,first_name:e.firstName,last_name:e.lastName,department:e.department}}}inAppAcceptTeamMemberInvite(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildInAppAcceptTeamMemberInviteRequest(e))}))}buildInAppAcceptTeamMemberInviteRequest(e){return{path:"/api/invite/in-app-accept",method:"post",body:{team_member_id:e.teamMemberId}}}acceptTeamMemberInvite(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildAcceptTeamMemberInviteRequest(e))}))}buildAcceptTeamMemberInviteRequest(e){return{path:"/api/invite/accept",method:"post",body:{token:e.inviteToken}}}resendTeamMemberInvite(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildResendTeamMemberInviteRequest(e))}))}buildResendTeamMemberInviteRequest(e){return{path:"/api/invite/resend",method:"post",body:{team_member_id:e.teamMemberId}}}removeTeamMember(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildRemoveTeamMemberRequest(e))}))}buildRemoveTeamMemberRequest(e){return{path:"/api/invite/remove",method:"post",body:{team_member_id:e.teamMemberId}}}startSignIn(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildStartSignInRequest(e))}))}buildStartSignInRequest(e){return{path:"/api/start-sign-in",method:"post",body:{email:e.email}}}completeSignIn(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCompleteSignInRequest(e))}))}buildCompleteSignInRequest(e){return{path:"/api/complete-sign-in",method:"post",body:{token:e.token}}}signUp(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildSignUpRequest(e))}))}buildSignUpRequest(e){return{path:"/api/complete-sign-in",method:"post",body:{email:e.email,organisation_title:e.organisationTitle,first_name:e.firstName,last_name:e.lastName,department:e.department}}}switchOrganisation(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildSwitchOrganisationRequest(e))}))}buildSwitchOrganisationRequest(e){return{path:"/api/team/switch",method:"post",body:{organisation_id:e.organisationId}}}toggleKeyPairDisabled(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildToggleKeyPairDisabledRequest(e))}))}buildToggleKeyPairDisabledRequest(e){return{path:"/api/organisation/key-pairs/toggle-disabled",method:"post",body:{key_pair_id:e.keyPairId,disabled:e.disabled}}}updateProject(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateProjectRequest(e))}))}buildUpdateProjectRequest(e){return{path:"/api/v2/project",method:"put",body:{project_id:e.projectId,deleted:e.deleted,name:e.name}}}uploadPublicKey(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUploadPublicKeyRequest(e))}))}buildUploadPublicKeyRequest(e){return{path:"/api/v2/project/key-pair",method:"post",body:{public_key:e.publicKey,project_id:e.projectId}}}}t.VizzlyAppApi=o},4640:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VizzlyQueryEngineApi=void 0;const i=r(3806),o=r(6081),s=r(3394),a=r(2309),l=r(9979);class u extends i.Api{constructor(e,t,r){super(e,t,r)}buildCreateDashboardRequest(e){return{path:"/api/v1/dashboard",method:"post",abortSignal:e.abortSignal,body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),definition:e.definition,meta:e.metadata,parentDashboardId:e.parentDashboardId,permissions:e.permissions}}}buildFetchDashboardAccessTokensRequest(e){return{path:"/api/v1/dashboard/access",method:"post",abortSignal:null==e?void 0:e.abortSignal,body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),projectAdminOverrideToken:this.auth.getProjectAdminOverrideToken()}}}fetchGlobalLibraryAccessTokens(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildFetchGlobalLibraryAccessTokensRequest(e))}))}buildFetchGlobalLibraryAccessTokensRequest(e){return{path:"/api/v1/global-library/access",method:"post",abortSignal:null==e?void 0:e.abortSignal,body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),projectAdminOverrideToken:this.auth.getProjectAdminOverrideToken()}}}buildFetchDashboardsRequest(e){return{path:"/api/v1/get-dashboards",method:"post",abortSignal:e.abortSignal,body:{dashboardAccessTokens:e.dashboardSessionAccessTokens}}}createConfigFromUpload(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateConfigFromUploadRequest(e))}))}buildCreateConfigFromUploadRequest(e){return{path:"/api/v1/create-config-from-upload",method:"post",abortSignal:e.abortSignal,body:{queryEngineAccessToken:this.auth.getQueryEngineAccessToken(),table:e.table,fieldPublicNames:e.fieldPublicNames}}}createResults(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateResultsRequest(e))}))}buildCreateResultsRequest(e){return{path:"/api/v1/create-results",method:"post",abortSignal:e.abortSignal,body:{queries:e.queries,virtualFields:{},identityConfigIntegritySignature:this.auth.getDataAccessToken()}}}createSqlPreview(e){return n(this,void 0,void 0,(function*(){var t;const r=yield this.execute(this.buildCreateSqlPreviewRequest(e));if(200===r.status)return r;throw new o.SQLPreviewError((null===(t=null==r?void 0:r.body)||void 0===t?void 0:t.message)||"Unknown SQL error")}))}buildCreateSqlPreviewRequest(e){return{path:"/api/v1/create-sql-preview",method:"post",abortSignal:e.abortSignal,body:{sql:e.sql,parameters:e.parameters,limit:e.limit}}}createQueryEngineUser(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildCreateQueryEngineUserRequest(e))}))}buildCreateQueryEngineUserRequest(e){return{path:"/api/v1/query-engine-user",method:"post",abortSignal:e.abortSignal,body:{email:e.email,password:e.password}}}fetchDataSets(e){return n(this,void 0,void 0,(function*(){const t=this.buildFetchDataSetsRequest(e),r=yield this.execute(t);if(200===r.status)return r;throw new s.FailedToResolveDataSets(`Failed to resolve data sets from ${t.path}. Received status ${r.status}`)}))}buildFetchDataSetsRequest(e){return{path:"/api/v1/resolve-data-sets",method:"post",abortSignal:null==e?void 0:e.abortSignal,body:{integritySignature:this.auth.getDataAccessToken()}}}fetchSelfHostedQueryEngineConfig(e){return n(this,void 0,void 0,(function*(){return this.execute(this.buildFetchSelfHostedQueryEngineConfigRequest(e))}))}buildFetchSelfHostedQueryEngineConfigRequest(e){return{path:"/api/v1/support",method:"post",abortSignal:null==e?void 0:e.abortSignal,body:{}}}fetchProject(e){return n(this,void 0,void 0,(function*(){return this.execute(this.buildFetchProjectRequest(e))}))}buildFetchProjectRequest(e){return{path:"/api/v1/project",method:"get",abortSignal:null==e?void 0:e.abortSignal,body:{}}}getStarted(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildGetStartedRequest(e));if(200!=t.status)throw new a.FailedToSetupProject("object"==typeof t.body&&t.body.reason&&"reason"in t.body?t.body.reason:"Failed to create the first user.");return t}))}buildGetStartedRequest(e){return{path:"/api/v2/get-started",method:"post",abortSignal:e.abortSignal,body:{email:e.email,password:e.password}}}getTeamMembers(e){return n(this,void 0,void 0,(function*(){return this.execute(this.buildGetTeamMembersRequest(e))}))}buildGetTeamMembersRequest(e){return{path:"/api/v1/team-members",method:"get",abortSignal:null==e?void 0:e.abortSignal}}isVizzly(e){return n(this,void 0,void 0,(function*(){return this.execute(this.buildIsVizzlyRequest(e))}))}buildIsVizzlyRequest(e){return{path:"/api/is-vizzly",method:"get",abortSignal:null==e?void 0:e.abortSignal}}saveConfig(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildSaveConfigRequest(e))}))}buildSaveConfigRequest(e){return{path:"/api/v1/save-config",method:"post",abortSignal:e.abortSignal,body:{config:e.config}}}saveConnection(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildSaveConnectionRequest(e))}))}buildSaveConnectionRequest(e){return{path:"/api/v1/save-connection",method:"post",abortSignal:e.abortSignal,body:{connection:e.connection,client:e.client}}}signInWithQueryEngineAccessToken(e){return n(this,void 0,void 0,(function*(){return this.execute(this.buildSignInWithQueryEngineAccessTokenRequest(e))}))}buildSignInWithQueryEngineAccessTokenRequest(e){return{path:"/api/v1/sign-in",method:"post",abortSignal:null==e?void 0:e.abortSignal,body:{}}}signInWithEmailAndPassword(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildSignInWithEmailAndPasswordRequest(e))}))}buildSignInWithEmailAndPasswordRequest(e){return{path:"/api/v1/sign-in",method:"post",abortSignal:e.abortSignal,body:{email:e.email,password:e.password}}}status(e){return n(this,void 0,void 0,(function*(){return this.execute(this.buildStatusRequest(e))}))}buildStatusRequest(e){return{path:"/api/status",method:"post",abortSignal:null==e?void 0:e.abortSignal,body:{}}}createGlobalLibrary(e){return n(this,void 0,void 0,(function*(){const t=yield this.execute(this.buildCreateGlobalLibraryRequest(e));if(200===t.status)return t.body;throw new l.FailedToCreateGlobalLibrary(`Failed to create a global library. Got status ${t.status}`)}))}buildCreateGlobalLibraryRequest(e){return{path:"/api/v1/global-library",method:"post",abortSignal:e.abortSignal,body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),parentGlobalLibraryId:e.parentGlobalLibraryId,library:e.library,permissions:e.permissions}}}fetchGlobalLibraries(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildFetchGlobalLibrariesRequest(e))}))}buildFetchGlobalLibrariesRequest(e){return{path:"/api/v1/get-global-libraries",method:"post",abortSignal:e.abortSignal,body:{globalLibraryAccessTokens:e.globalLibraryAccessTokens}}}updateGlobalLibrary(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateGlobalLibraryRequest(e))}))}buildUpdateGlobalLibraryRequest(e){return{path:"/api/v1/global-library",method:"put",abortSignal:e.abortSignal,body:{globalLibrarySessionToken:e.globalLibrarySessionToken,deleted:e.deleted,library:e.library}}}updateDashboard(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateDashboardRequest(e))}))}buildUpdateDashboardRequest(e){return{path:"/api/v1/dashboard",method:"put",abortSignal:e.abortSignal,body:{dashboardSessionToken:e.dashboardPermission.token,definition:e.definition,meta:e.metadata||e.meta||{},deleted:e.deleted}}}updateQueryEngineUser(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUpdateQueryEngineUserRequest(e))}))}buildUpdateQueryEngineUserRequest(e){return{path:"/api/v1/query-engine-user",method:"put",abortSignal:e.abortSignal,body:{queryEngineUserId:e.queryEngineUserId,password:e.password}}}uploadDataToVizzlyCloud(e){return n(this,void 0,void 0,(function*(){return yield this.execute(this.buildUploadDataToVizzlyCloudRequest(e))}))}buildUploadDataToVizzlyCloudRequest(e){return{path:"/api/v1/ingest",method:"post",abortSignal:e.abortSignal,body:{queryEngineAccessToken:this.auth.getQueryEngineAccessToken(),ingest:e.ingest}}}}t.VizzlyQueryEngineApi=u},2474:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1741),t),i(r(2016),t),i(r(1048),t),i(r(9774),t)},1741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2016:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1048:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9774:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8143:function(e){e.exports=function(){for(var e=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e<t?t:e>r?r:e},t=e,r={},n=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];n<i.length;n+=1){var o=i[n];r["[object "+o+"]"]=o.toLowerCase()}var s=function(e){return r[Object.prototype.toString.call(e)]||"object"},a=s,l=s,u=Math.PI,c={clip_rgb:function(e){e._clipped=!1,e._unclipped=e.slice(0);for(var r=0;r<=3;r++)r<3?((e[r]<0||e[r]>255)&&(e._clipped=!0),e[r]=t(e[r],0,255)):3===r&&(e[r]=t(e[r],0,1));return e},limit:e,type:s,unpack:function(e,t){return void 0===t&&(t=null),e.length>=3?Array.prototype.slice.call(e):"object"==a(e[0])&&t?t.split("").filter((function(t){return void 0!==e[0][t]})).map((function(t){return e[0][t]})):e[0]},last:function(e){if(e.length<2)return null;var t=e.length-1;return"string"==l(e[t])?e[t].toLowerCase():null},PI:u,TWOPI:2*u,PITHIRD:u/3,DEG2RAD:u/180,RAD2DEG:180/u},d={format:{},autodetect:[]},f=c.last,p=c.clip_rgb,h=c.type,m=d,g=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=this;if("object"===h(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var n=f(e),i=!1;if(!n){i=!0,m.sorted||(m.autodetect=m.autodetect.sort((function(e,t){return t.p-e.p})),m.sorted=!0);for(var o=0,s=m.autodetect;o<s.length;o+=1){var a=s[o];if(n=a.test.apply(a,e))break}}if(!m.format[n])throw new Error("unknown format: "+e);var l=m.format[n].apply(null,i?e:e.slice(0,-1));r._rgb=p(l),3===r._rgb.length&&r._rgb.push(1)};g.prototype.toString=function(){return"function"==h(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var b=g,y=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(y.Color,[null].concat(e)))};y.Color=b,y.version="2.4.2";var v=y,_=c.unpack,w=Math.max,A=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=_(e,"rgb"),n=r[0],i=r[1],o=r[2],s=1-w(n/=255,w(i/=255,o/=255)),a=s<1?1/(1-s):0;return[(1-n-s)*a,(1-i-s)*a,(1-o-s)*a,s]},x=c.unpack,S=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=x(e,"cmyk"))[0],n=e[1],i=e[2],o=e[3],s=e.length>4?e[4]:1;return 1===o?[0,0,0,s]:[r>=1?0:255*(1-r)*(1-o),n>=1?0:255*(1-n)*(1-o),i>=1?0:255*(1-i)*(1-o),s]},O=v,E=b,j=d,T=c.unpack,C=c.type,R=A;E.prototype.cmyk=function(){return R(this._rgb)},O.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(E,[null].concat(e,["cmyk"])))},j.format.cmyk=S,j.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=T(e,"cmyk"),"array"===C(e)&&4===e.length)return"cmyk"}});var I=c.unpack,D=c.last,F=function(e){return Math.round(100*e)/100},P=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=I(e,"hsla"),n=D(e)||"lsa";return r[0]=F(r[0]||0),r[1]=F(100*r[1])+"%",r[2]=F(100*r[2])+"%","hsla"===n||r.length>3&&r[3]<1?(r[3]=r.length>3?r[3]:1,n="hsla"):r.length=3,n+"("+r.join(",")+")"},k=c.unpack,N=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=k(e,"rgba"))[0],n=e[1],i=e[2];r/=255,n/=255,i/=255;var o,s,a=Math.min(r,n,i),l=Math.max(r,n,i),u=(l+a)/2;return l===a?(o=0,s=Number.NaN):o=u<.5?(l-a)/(l+a):(l-a)/(2-l-a),r==l?s=(n-i)/(l-a):n==l?s=2+(i-r)/(l-a):i==l&&(s=4+(r-n)/(l-a)),(s*=60)<0&&(s+=360),e.length>3&&void 0!==e[3]?[s,o,u,e[3]]:[s,o,u]},M=c.unpack,L=c.last,$=P,q=N,B=Math.round,G=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=M(e,"rgba"),n=L(e)||"rgb";return"hsl"==n.substr(0,3)?$(q(r),n):(r[0]=B(r[0]),r[1]=B(r[1]),r[2]=B(r[2]),("rgba"===n||r.length>3&&r[3]<1)&&(r[3]=r.length>3?r[3]:1,n="rgba"),n+"("+r.slice(0,"rgb"===n?3:4).join(",")+")")},z=c.unpack,U=Math.round,V=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];var n,i,o,s=(t=z(t,"hsl"))[0],a=t[1],l=t[2];if(0===a)n=i=o=255*l;else{var u=[0,0,0],c=[0,0,0],d=l<.5?l*(1+a):l+a-l*a,f=2*l-d,p=s/360;u[0]=p+1/3,u[1]=p,u[2]=p-1/3;for(var h=0;h<3;h++)u[h]<0&&(u[h]+=1),u[h]>1&&(u[h]-=1),6*u[h]<1?c[h]=f+6*(d-f)*u[h]:2*u[h]<1?c[h]=d:3*u[h]<2?c[h]=f+(d-f)*(2/3-u[h])*6:c[h]=f;n=(e=[U(255*c[0]),U(255*c[1]),U(255*c[2])])[0],i=e[1],o=e[2]}return t.length>3?[n,i,o,t[3]]:[n,i,o,1]},H=V,X=d,W=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,Y=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,K=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Q=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Z=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,J=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ee=Math.round,te=function(e){var t;if(e=e.toLowerCase().trim(),X.format.named)try{return X.format.named(e)}catch(e){}if(t=e.match(W)){for(var r=t.slice(1,4),n=0;n<3;n++)r[n]=+r[n];return r[3]=1,r}if(t=e.match(Y)){for(var i=t.slice(1,5),o=0;o<4;o++)i[o]=+i[o];return i}if(t=e.match(K)){for(var s=t.slice(1,4),a=0;a<3;a++)s[a]=ee(2.55*s[a]);return s[3]=1,s}if(t=e.match(Q)){for(var l=t.slice(1,5),u=0;u<3;u++)l[u]=ee(2.55*l[u]);return l[3]=+l[3],l}if(t=e.match(Z)){var c=t.slice(1,4);c[1]*=.01,c[2]*=.01;var d=H(c);return d[3]=1,d}if(t=e.match(J)){var f=t.slice(1,4);f[1]*=.01,f[2]*=.01;var p=H(f);return p[3]=+t[4],p}};te.test=function(e){return W.test(e)||Y.test(e)||K.test(e)||Q.test(e)||Z.test(e)||J.test(e)};var re=v,ne=b,ie=d,oe=c.type,se=G,ae=te;ne.prototype.css=function(e){return se(this._rgb,e)},re.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ne,[null].concat(e,["css"])))},ie.format.css=ae,ie.autodetect.push({p:5,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===oe(e)&&ae.test(e))return"css"}});var le=b,ue=v,ce=c.unpack;d.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=ce(e,"rgba");return r[0]*=255,r[1]*=255,r[2]*=255,r},ue.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(le,[null].concat(e,["gl"])))},le.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var de=c.unpack,fe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n=de(e,"rgb"),i=n[0],o=n[1],s=n[2],a=Math.min(i,o,s),l=Math.max(i,o,s),u=l-a,c=100*u/255,d=a/(255-u)*100;return 0===u?r=Number.NaN:(i===l&&(r=(o-s)/u),o===l&&(r=2+(s-i)/u),s===l&&(r=4+(i-o)/u),(r*=60)<0&&(r+=360)),[r,c,d]},pe=c.unpack,he=Math.floor,me=function(){for(var e,t,r,n,i,o,s=[],a=arguments.length;a--;)s[a]=arguments[a];var l,u,c,d=(s=pe(s,"hcg"))[0],f=s[1],p=s[2];p*=255;var h=255*f;if(0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var m=he(d/=60),g=d-m,b=p*(1-f),y=b+h*(1-g),v=b+h*g,_=b+h;switch(m){case 0:l=(e=[_,v,b])[0],u=e[1],c=e[2];break;case 1:l=(t=[y,_,b])[0],u=t[1],c=t[2];break;case 2:l=(r=[b,_,v])[0],u=r[1],c=r[2];break;case 3:l=(n=[b,y,_])[0],u=n[1],c=n[2];break;case 4:l=(i=[v,b,_])[0],u=i[1],c=i[2];break;case 5:l=(o=[_,b,y])[0],u=o[1],c=o[2]}}return[l,u,c,s.length>3?s[3]:1]},ge=c.unpack,be=c.type,ye=v,ve=b,_e=d,we=fe;ve.prototype.hcg=function(){return we(this._rgb)},ye.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ve,[null].concat(e,["hcg"])))},_e.format.hcg=me,_e.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=ge(e,"hcg"),"array"===be(e)&&3===e.length)return"hcg"}});var Ae=c.unpack,xe=c.last,Se=Math.round,Oe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Ae(e,"rgba"),n=r[0],i=r[1],o=r[2],s=r[3],a=xe(e)||"auto";void 0===s&&(s=1),"auto"===a&&(a=s<1?"rgba":"rgb");var l="000000"+((n=Se(n))<<16|(i=Se(i))<<8|(o=Se(o))).toString(16);l=l.substr(l.length-6);var u="0"+Se(255*s).toString(16);switch(u=u.substr(u.length-2),a.toLowerCase()){case"rgba":return"#"+l+u;case"argb":return"#"+u+l;default:return"#"+l}},Ee=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,je=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Te=function(e){if(e.match(Ee)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(je)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var r=parseInt(e,16);return[r>>24&255,r>>16&255,r>>8&255,Math.round((255&r)/255*100)/100]}throw new Error("unknown hex color: "+e)},Ce=v,Re=b,Ie=c.type,De=d,Fe=Oe;Re.prototype.hex=function(e){return Fe(this._rgb,e)},Ce.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Re,[null].concat(e,["hex"])))},De.format.hex=Te,De.autodetect.push({p:4,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===Ie(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var Pe=c.unpack,ke=c.TWOPI,Ne=Math.min,Me=Math.sqrt,Le=Math.acos,$e=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n=Pe(e,"rgb"),i=n[0],o=n[1],s=n[2],a=Ne(i/=255,o/=255,s/=255),l=(i+o+s)/3,u=l>0?1-a/l:0;return 0===u?r=NaN:(r=(i-o+(i-s))/2,r/=Me((i-o)*(i-o)+(i-s)*(o-s)),r=Le(r),s>o&&(r=ke-r),r/=ke),[360*r,u,l]},qe=c.unpack,Be=c.limit,Ge=c.TWOPI,ze=c.PITHIRD,Ue=Math.cos,Ve=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=qe(e,"hsi"))[0],s=e[1],a=e[2];return isNaN(o)&&(o=0),isNaN(s)&&(s=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?n=1-((i=(1-s)/3)+(r=(1+s*Ue(Ge*o)/Ue(ze-Ge*o))/3)):o<2/3?i=1-((r=(1-s)/3)+(n=(1+s*Ue(Ge*(o-=1/3))/Ue(ze-Ge*o))/3)):r=1-((n=(1-s)/3)+(i=(1+s*Ue(Ge*(o-=2/3))/Ue(ze-Ge*o))/3)),[255*(r=Be(a*r*3)),255*(n=Be(a*n*3)),255*(i=Be(a*i*3)),e.length>3?e[3]:1]},He=c.unpack,Xe=c.type,We=v,Ye=b,Ke=d,Qe=$e;Ye.prototype.hsi=function(){return Qe(this._rgb)},We.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Ye,[null].concat(e,["hsi"])))},Ke.format.hsi=Ve,Ke.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=He(e,"hsi"),"array"===Xe(e)&&3===e.length)return"hsi"}});var Ze=c.unpack,Je=c.type,et=v,tt=b,rt=d,nt=N;tt.prototype.hsl=function(){return nt(this._rgb)},et.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(tt,[null].concat(e,["hsl"])))},rt.format.hsl=V,rt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ze(e,"hsl"),"array"===Je(e)&&3===e.length)return"hsl"}});var it=c.unpack,ot=Math.min,st=Math.max,at=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=it(e,"rgb"))[0],s=e[1],a=e[2],l=ot(o,s,a),u=st(o,s,a),c=u-l;return i=u/255,0===u?(r=Number.NaN,n=0):(n=c/u,o===u&&(r=(s-a)/c),s===u&&(r=2+(a-o)/c),a===u&&(r=4+(o-s)/c),(r*=60)<0&&(r+=360)),[r,n,i]},lt=c.unpack,ut=Math.floor,ct=function(){for(var e,t,r,n,i,o,s=[],a=arguments.length;a--;)s[a]=arguments[a];var l,u,c,d=(s=lt(s,"hsv"))[0],f=s[1],p=s[2];if(p*=255,0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var h=ut(d/=60),m=d-h,g=p*(1-f),b=p*(1-f*m),y=p*(1-f*(1-m));switch(h){case 0:l=(e=[p,y,g])[0],u=e[1],c=e[2];break;case 1:l=(t=[b,p,g])[0],u=t[1],c=t[2];break;case 2:l=(r=[g,p,y])[0],u=r[1],c=r[2];break;case 3:l=(n=[g,b,p])[0],u=n[1],c=n[2];break;case 4:l=(i=[y,g,p])[0],u=i[1],c=i[2];break;case 5:l=(o=[p,g,b])[0],u=o[1],c=o[2]}}return[l,u,c,s.length>3?s[3]:1]},dt=c.unpack,ft=c.type,pt=v,ht=b,mt=d,gt=at;ht.prototype.hsv=function(){return gt(this._rgb)},pt.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ht,[null].concat(e,["hsv"])))},mt.format.hsv=ct,mt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=dt(e,"hsv"),"array"===ft(e)&&3===e.length)return"hsv"}});var bt={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},yt=bt,vt=c.unpack,_t=Math.pow,wt=function(e){return(e/=255)<=.04045?e/12.92:_t((e+.055)/1.055,2.4)},At=function(e){return e>yt.t3?_t(e,1/3):e/yt.t2+yt.t0},xt=function(e,t,r){return e=wt(e),t=wt(t),r=wt(r),[At((.4124564*e+.3575761*t+.1804375*r)/yt.Xn),At((.2126729*e+.7151522*t+.072175*r)/yt.Yn),At((.0193339*e+.119192*t+.9503041*r)/yt.Zn)]},St=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=vt(e,"rgb"),n=r[0],i=r[1],o=r[2],s=xt(n,i,o),a=s[0],l=s[1],u=116*l-16;return[u<0?0:u,500*(a-l),200*(l-s[2])]},Ot=bt,Et=c.unpack,jt=Math.pow,Tt=function(e){return 255*(e<=.00304?12.92*e:1.055*jt(e,1/2.4)-.055)},Ct=function(e){return e>Ot.t1?e*e*e:Ot.t2*(e-Ot.t0)},Rt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=Et(e,"lab"))[0],s=e[1],a=e[2];return n=(o+16)/116,r=isNaN(s)?n:n+s/500,i=isNaN(a)?n:n-a/200,n=Ot.Yn*Ct(n),r=Ot.Xn*Ct(r),i=Ot.Zn*Ct(i),[Tt(3.2404542*r-1.5371385*n-.4985314*i),Tt(-.969266*r+1.8760108*n+.041556*i),Tt(.0556434*r-.2040259*n+1.0572252*i),e.length>3?e[3]:1]},It=c.unpack,Dt=c.type,Ft=v,Pt=b,kt=d,Nt=St;Pt.prototype.lab=function(){return Nt(this._rgb)},Ft.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Pt,[null].concat(e,["lab"])))},kt.format.lab=Rt,kt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=It(e,"lab"),"array"===Dt(e)&&3===e.length)return"lab"}});var Mt=c.unpack,Lt=c.RAD2DEG,$t=Math.sqrt,qt=Math.atan2,Bt=Math.round,Gt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Mt(e,"lab"),n=r[0],i=r[1],o=r[2],s=$t(i*i+o*o),a=(qt(o,i)*Lt+360)%360;return 0===Bt(1e4*s)&&(a=Number.NaN),[n,s,a]},zt=c.unpack,Ut=St,Vt=Gt,Ht=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=zt(e,"rgb"),n=r[0],i=r[1],o=r[2],s=Ut(n,i,o),a=s[0],l=s[1],u=s[2];return Vt(a,l,u)},Xt=c.unpack,Wt=c.DEG2RAD,Yt=Math.sin,Kt=Math.cos,Qt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Xt(e,"lch"),n=r[0],i=r[1],o=r[2];return isNaN(o)&&(o=0),[n,Kt(o*=Wt)*i,Yt(o)*i]},Zt=c.unpack,Jt=Qt,er=Rt,tr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Zt(e,"lch"))[0],n=e[1],i=e[2],o=Jt(r,n,i),s=o[0],a=o[1],l=o[2],u=er(s,a,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},rr=c.unpack,nr=tr,ir=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=rr(e,"hcl").reverse();return nr.apply(void 0,r)},or=c.unpack,sr=c.type,ar=v,lr=b,ur=d,cr=Ht;lr.prototype.lch=function(){return cr(this._rgb)},lr.prototype.hcl=function(){return cr(this._rgb).reverse()},ar.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(lr,[null].concat(e,["lch"])))},ar.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(lr,[null].concat(e,["hcl"])))},ur.format.lch=tr,ur.format.hcl=ir,["lch","hcl"].forEach((function(e){return ur.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=or(t,e),"array"===sr(t)&&3===t.length)return e}})}));var dr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},fr=d,pr=c.type,hr=dr,mr=Te,gr=Oe;b.prototype.name=function(){for(var e=gr(this._rgb,"rgb"),t=0,r=Object.keys(hr);t<r.length;t+=1){var n=r[t];if(hr[n]===e)return n.toLowerCase()}return e},fr.format.named=function(e){if(e=e.toLowerCase(),hr[e])return mr(hr[e]);throw new Error("unknown color name: "+e)},fr.autodetect.push({p:5,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===pr(e)&&hr[e.toLowerCase()])return"named"}});var br=c.unpack,yr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=br(e,"rgb");return(r[0]<<16)+(r[1]<<8)+r[2]},vr=c.type,_r=v,wr=b,Ar=d,xr=c.type,Sr=yr;wr.prototype.num=function(){return Sr(this._rgb)},_r.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(wr,[null].concat(e,["num"])))},Ar.format.num=function(e){if("number"==vr(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},Ar.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===xr(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var Or=v,Er=b,jr=d,Tr=c.unpack,Cr=c.type,Rr=Math.round;Er.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Rr)},Er.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(t,r){return r<3?!1===e?t:Rr(t):t}))},Or.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Er,[null].concat(e,["rgb"])))},jr.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Tr(e,"rgba");return void 0===r[3]&&(r[3]=1),r},jr.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Tr(e,"rgba"),"array"===Cr(e)&&(3===e.length||4===e.length&&"number"==Cr(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Ir=Math.log,Dr=function(e){var t,r,n,i=e/100;return i<66?(t=255,r=i<6?0:-155.25485562709179-.44596950469579133*(r=i-2)+104.49216199393888*Ir(r),n=i<20?0:.8274096064007395*(n=i-10)-254.76935184120902+115.67994401066147*Ir(n)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*Ir(t),r=325.4494125711974+.07943456536662342*(r=i-50)-28.0852963507957*Ir(r),n=255),[t,r,n,1]},Fr=Dr,Pr=c.unpack,kr=Math.round,Nr=v,Mr=b,Lr=d,$r=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r,n=Pr(e,"rgb"),i=n[0],o=n[2],s=1e3,a=4e4;a-s>.4;){var l=Fr(r=.5*(a+s));l[2]/l[0]>=o/i?a=r:s=r}return kr(r)};Mr.prototype.temp=Mr.prototype.kelvin=Mr.prototype.temperature=function(){return $r(this._rgb)},Nr.temp=Nr.kelvin=Nr.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Mr,[null].concat(e,["temp"])))},Lr.format.temp=Lr.format.kelvin=Lr.format.temperature=Dr;var qr=c.unpack,Br=Math.cbrt,Gr=Math.pow,zr=Math.sign,Ur=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=qr(e,"rgb"),n=r[0],i=r[1],o=r[2],s=[Vr(n/255),Vr(i/255),Vr(o/255)],a=s[0],l=s[1],u=s[2],c=Br(.4122214708*a+.5363325363*l+.0514459929*u),d=Br(.2119034982*a+.6806995451*l+.1073969566*u),f=Br(.0883024619*a+.2817188376*l+.6299787005*u);return[.2104542553*c+.793617785*d-.0040720468*f,1.9779984951*c-2.428592205*d+.4505937099*f,.0259040371*c+.7827717662*d-.808675766*f]};function Vr(e){var t=Math.abs(e);return t<.04045?e/12.92:(zr(e)||1)*Gr((t+.055)/1.055,2.4)}var Hr=c.unpack,Xr=Math.pow,Wr=Math.sign,Yr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Hr(e,"lab"))[0],n=e[1],i=e[2],o=Xr(r+.3963377774*n+.2158037573*i,3),s=Xr(r-.1055613458*n-.0638541728*i,3),a=Xr(r-.0894841775*n-1.291485548*i,3);return[255*Kr(4.0767416621*o-3.3077115913*s+.2309699292*a),255*Kr(-1.2684380046*o+2.6097574011*s-.3413193965*a),255*Kr(-.0041960863*o-.7034186147*s+1.707614701*a),e.length>3?e[3]:1]};function Kr(e){var t=Math.abs(e);return t>.0031308?(Wr(e)||1)*(1.055*Xr(t,1/2.4)-.055):12.92*e}var Qr=c.unpack,Zr=c.type,Jr=v,en=b,tn=d,rn=Ur;en.prototype.oklab=function(){return rn(this._rgb)},Jr.oklab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(en,[null].concat(e,["oklab"])))},tn.format.oklab=Yr,tn.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Qr(e,"oklab"),"array"===Zr(e)&&3===e.length)return"oklab"}});var nn=c.unpack,on=Ur,sn=Gt,an=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=nn(e,"rgb"),n=r[0],i=r[1],o=r[2],s=on(n,i,o),a=s[0],l=s[1],u=s[2];return sn(a,l,u)},ln=c.unpack,un=Qt,cn=Yr,dn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=ln(e,"lch"))[0],n=e[1],i=e[2],o=un(r,n,i),s=o[0],a=o[1],l=o[2],u=cn(s,a,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},fn=c.unpack,pn=c.type,hn=v,mn=b,gn=d,bn=an;mn.prototype.oklch=function(){return bn(this._rgb)},hn.oklch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(mn,[null].concat(e,["oklch"])))},gn.format.oklch=dn,gn.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=fn(e,"oklch"),"array"===pn(e)&&3===e.length)return"oklch"}});var yn=b,vn=c.type;yn.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===vn(e)?t?(this._rgb[3]=e,this):new yn([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},b.prototype.clipped=function(){return this._rgb._clipped||!1};var _n=b,wn=bt;_n.prototype.darken=function(e){void 0===e&&(e=1);var t=this.lab();return t[0]-=wn.Kn*e,new _n(t,"lab").alpha(this.alpha(),!0)},_n.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},_n.prototype.darker=_n.prototype.darken,_n.prototype.brighter=_n.prototype.brighten,b.prototype.get=function(e){var t=e.split("."),r=t[0],n=t[1],i=this[r]();if(n){var o=r.indexOf(n)-("ok"===r.substr(0,2)?2:0);if(o>-1)return i[o];throw new Error("unknown channel "+n+" in mode "+r)}return i};var An=b,xn=c.type,Sn=Math.pow;An.prototype.luminance=function(e){if(void 0!==e&&"number"===xn(e)){if(0===e)return new An([0,0,0,this._rgb[3]],"rgb");if(1===e)return new An([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),r=20,n=function(t,i){var o=t.interpolate(i,.5,"rgb"),s=o.luminance();return Math.abs(e-s)<1e-7||!r--?o:s>e?n(t,o):n(o,i)},i=(t>e?n(new An([0,0,0]),this):n(this,new An([255,255,255]))).rgb();return new An(i.concat([this._rgb[3]]))}return On.apply(void 0,this._rgb.slice(0,3))};var On=function(e,t,r){return.2126*(e=En(e))+.7152*(t=En(t))+.0722*En(r)},En=function(e){return(e/=255)<=.03928?e/12.92:Sn((e+.055)/1.055,2.4)},jn={},Tn=b,Cn=c.type,Rn=jn,In=function(e,t,r){void 0===r&&(r=.5);for(var n=[],i=arguments.length-3;i-- >0;)n[i]=arguments[i+3];var o=n[0]||"lrgb";if(Rn[o]||n.length||(o=Object.keys(Rn)[0]),!Rn[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==Cn(e)&&(e=new Tn(e)),"object"!==Cn(t)&&(t=new Tn(t)),Rn[o](e,t,r).alpha(e.alpha()+r*(t.alpha()-e.alpha()))},Dn=b,Fn=In;Dn.prototype.mix=Dn.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Fn.apply(void 0,[this,e,t].concat(r))};var Pn=b;Pn.prototype.premultiply=function(e){void 0===e&&(e=!1);var t=this._rgb,r=t[3];return e?(this._rgb=[t[0]*r,t[1]*r,t[2]*r,r],this):new Pn([t[0]*r,t[1]*r,t[2]*r,r],"rgb")};var kn=b,Nn=bt;kn.prototype.saturate=function(e){void 0===e&&(e=1);var t=this.lch();return t[1]+=Nn.Kn*e,t[1]<0&&(t[1]=0),new kn(t,"lch").alpha(this.alpha(),!0)},kn.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Mn=b,Ln=c.type;Mn.prototype.set=function(e,t,r){void 0===r&&(r=!1);var n=e.split("."),i=n[0],o=n[1],s=this[i]();if(o){var a=i.indexOf(o)-("ok"===i.substr(0,2)?2:0);if(a>-1){if("string"==Ln(t))switch(t.charAt(0)){case"+":case"-":s[a]+=+t;break;case"*":s[a]*=+t.substr(1);break;case"/":s[a]/=+t.substr(1);break;default:s[a]=+t}else{if("number"!==Ln(t))throw new Error("unsupported value for Color.set");s[a]=t}var l=new Mn(s,i);return r?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+o+" in mode "+i)}return s};var $n=b;jn.rgb=function(e,t,r){var n=e._rgb,i=t._rgb;return new $n(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"rgb")};var qn=b,Bn=Math.sqrt,Gn=Math.pow;jn.lrgb=function(e,t,r){var n=e._rgb,i=n[0],o=n[1],s=n[2],a=t._rgb,l=a[0],u=a[1],c=a[2];return new qn(Bn(Gn(i,2)*(1-r)+Gn(l,2)*r),Bn(Gn(o,2)*(1-r)+Gn(u,2)*r),Bn(Gn(s,2)*(1-r)+Gn(c,2)*r),"rgb")};var zn=b;jn.lab=function(e,t,r){var n=e.lab(),i=t.lab();return new zn(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"lab")};var Un=b,Vn=function(e,t,r,n){var i,o,s,a,l,u,c,d,f,p,h,m,g;return"hsl"===n?(s=e.hsl(),a=t.hsl()):"hsv"===n?(s=e.hsv(),a=t.hsv()):"hcg"===n?(s=e.hcg(),a=t.hcg()):"hsi"===n?(s=e.hsi(),a=t.hsi()):"lch"===n||"hcl"===n?(n="hcl",s=e.hcl(),a=t.hcl()):"oklch"===n&&(s=e.oklch().reverse(),a=t.oklch().reverse()),"h"!==n.substr(0,1)&&"oklch"!==n||(l=(i=s)[0],c=i[1],f=i[2],u=(o=a)[0],d=o[1],p=o[2]),isNaN(l)||isNaN(u)?isNaN(l)?isNaN(u)?m=Number.NaN:(m=u,1!=f&&0!=f||"hsv"==n||(h=d)):(m=l,1!=p&&0!=p||"hsv"==n||(h=c)):m=l+r*(u>l&&u-l>180?u-(l+360):u<l&&l-u>180?u+360-l:u-l),void 0===h&&(h=c+r*(d-c)),g=f+r*(p-f),new Un("oklch"===n?[g,h,m]:[m,h,g],n)},Hn=Vn,Xn=function(e,t,r){return Hn(e,t,r,"lch")};jn.lch=Xn,jn.hcl=Xn;var Wn=b;jn.num=function(e,t,r){var n=e.num(),i=t.num();return new Wn(n+r*(i-n),"num")};var Yn=Vn;jn.hcg=function(e,t,r){return Yn(e,t,r,"hcg")};var Kn=Vn;jn.hsi=function(e,t,r){return Kn(e,t,r,"hsi")};var Qn=Vn;jn.hsl=function(e,t,r){return Qn(e,t,r,"hsl")};var Zn=Vn;jn.hsv=function(e,t,r){return Zn(e,t,r,"hsv")};var Jn=b;jn.oklab=function(e,t,r){var n=e.oklab(),i=t.oklab();return new Jn(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"oklab")};var ei=Vn;jn.oklch=function(e,t,r){return ei(e,t,r,"oklch")};var ti=b,ri=c.clip_rgb,ni=Math.pow,ii=Math.sqrt,oi=Math.PI,si=Math.cos,ai=Math.sin,li=Math.atan2,ui=function(e,t){for(var r=e.length,n=[0,0,0,0],i=0;i<e.length;i++){var o=e[i],s=t[i]/r,a=o._rgb;n[0]+=ni(a[0],2)*s,n[1]+=ni(a[1],2)*s,n[2]+=ni(a[2],2)*s,n[3]+=a[3]*s}return n[0]=ii(n[0]),n[1]=ii(n[1]),n[2]=ii(n[2]),n[3]>.9999999&&(n[3]=1),new ti(ri(n))},ci=v,di=c.type,fi=Math.pow,pi=function(e){var t="rgb",r=ci("#ccc"),n=0,i=[0,1],o=[],s=[0,0],a=!1,l=[],u=!1,c=0,d=1,f=!1,p={},h=!0,m=1,g=function(e){if((e=e||["#fff","#000"])&&"string"===di(e)&&ci.brewer&&ci.brewer[e.toLowerCase()]&&(e=ci.brewer[e.toLowerCase()]),"array"===di(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var t=0;t<e.length;t++)e[t]=ci(e[t]);o.length=0;for(var r=0;r<e.length;r++)o.push(r/(e.length-1))}return _(),l=e},b=function(e){return e},y=function(e){return e},v=function(e,n){var i,u;if(null==n&&(n=!1),isNaN(e)||null===e)return r;u=n?e:a&&a.length>2?function(e){if(null!=a){for(var t=a.length-1,r=0;r<t&&e>=a[r];)r++;return r-1}return 0}(e)/(a.length-2):d!==c?(e-c)/(d-c):1,u=y(u),n||(u=b(u)),1!==m&&(u=fi(u,m)),u=s[0]+u*(1-s[0]-s[1]),u=Math.min(1,Math.max(0,u));var f=Math.floor(1e4*u);if(h&&p[f])i=p[f];else{if("array"===di(l))for(var g=0;g<o.length;g++){var v=o[g];if(u<=v){i=l[g];break}if(u>=v&&g===o.length-1){i=l[g];break}if(u>v&&u<o[g+1]){u=(u-v)/(o[g+1]-v),i=ci.interpolate(l[g],l[g+1],u,t);break}}else"function"===di(l)&&(i=l(u));h&&(p[f]=i)}return i},_=function(){return p={}};g(e);var w=function(e){var t=ci(v(e));return u&&t[u]?t[u]():t};return w.classes=function(e){if(null!=e){if("array"===di(e))a=e,i=[e[0],e[e.length-1]];else{var t=ci.analyze(i);a=0===e?[t.min,t.max]:ci.limits(t,"e",e)}return w}return a},w.domain=function(e){if(!arguments.length)return i;c=e[0],d=e[e.length-1],o=[];var t=l.length;if(e.length===t&&c!==d)for(var r=0,n=Array.from(e);r<n.length;r+=1){var s=n[r];o.push((s-c)/(d-c))}else{for(var a=0;a<t;a++)o.push(a/(t-1));if(e.length>2){var u=e.map((function(t,r){return r/(e.length-1)})),f=e.map((function(e){return(e-c)/(d-c)}));f.every((function(e,t){return u[t]===e}))||(y=function(e){if(e<=0||e>=1)return e;for(var t=0;e>=f[t+1];)t++;var r=(e-f[t])/(f[t+1]-f[t]);return u[t]+r*(u[t+1]-u[t])})}}return i=[c,d],w},w.mode=function(e){return arguments.length?(t=e,_(),w):t},w.range=function(e,t){return g(e),w},w.out=function(e){return u=e,w},w.spread=function(e){return arguments.length?(n=e,w):n},w.correctLightness=function(e){return null==e&&(e=!0),f=e,_(),b=f?function(e){for(var t=v(0,!0).lab()[0],r=v(1,!0).lab()[0],n=t>r,i=v(e,!0).lab()[0],o=t+(r-t)*e,s=i-o,a=0,l=1,u=20;Math.abs(s)>.01&&u-- >0;)n&&(s*=-1),s<0?(a=e,e+=.5*(l-e)):(l=e,e+=.5*(a-e)),s=(i=v(e,!0).lab()[0])-o;return e}:function(e){return e},w},w.padding=function(e){return null!=e?("number"===di(e)&&(e=[e,e]),s=e,w):s},w.colors=function(t,r){arguments.length<2&&(r="hex");var n=[];if(0===arguments.length)n=l.slice(0);else if(1===t)n=[w(.5)];else if(t>1){var o=i[0],s=i[1]-o;n=function(e,t,r){for(var n=[],i=e<t,o=r?i?t+1:t-1:t,s=e;i?s<o:s>o;i?s++:s--)n.push(s);return n}(0,t,!1).map((function(e){return w(o+e/(t-1)*s)}))}else{e=[];var u=[];if(a&&a.length>2)for(var c=1,d=a.length,f=1<=d;f?c<d:c>d;f?c++:c--)u.push(.5*(a[c-1]+a[c]));else u=i;n=u.map((function(e){return w(e)}))}return ci[r]&&(n=n.map((function(e){return e[r]()}))),n},w.cache=function(e){return null!=e?(h=e,w):h},w.gamma=function(e){return null!=e?(m=e,w):m},w.nodata=function(e){return null!=e?(r=ci(e),w):r},w};var hi=b,mi=pi,gi=v,bi=function(e,t,r){if(!bi[r])throw new Error("unknown blend mode "+r);return bi[r](e,t)},yi=function(e){return function(t,r){var n=gi(r).rgb(),i=gi(t).rgb();return gi.rgb(e(n,i))}},vi=function(e){return function(t,r){var n=[];return n[0]=e(t[0],r[0]),n[1]=e(t[1],r[1]),n[2]=e(t[2],r[2]),n}};bi.normal=yi(vi((function(e){return e}))),bi.multiply=yi(vi((function(e,t){return e*t/255}))),bi.screen=yi(vi((function(e,t){return 255*(1-(1-e/255)*(1-t/255))}))),bi.overlay=yi(vi((function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))}))),bi.darken=yi(vi((function(e,t){return e>t?t:e}))),bi.lighten=yi(vi((function(e,t){return e>t?e:t}))),bi.dodge=yi(vi((function(e,t){return 255===e||(e=t/255*255/(1-e/255))>255?255:e}))),bi.burn=yi(vi((function(e,t){return 255*(1-(1-t/255)/(e/255))})));for(var _i=bi,wi=c.type,Ai=c.clip_rgb,xi=c.TWOPI,Si=Math.pow,Oi=Math.sin,Ei=Math.cos,ji=v,Ti=b,Ci=Math.floor,Ri=Math.random,Ii=s,Di=Math.log,Fi=Math.pow,Pi=Math.floor,ki=Math.abs,Ni=function(e,t){void 0===t&&(t=null);var r={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===Ii(e)&&(e=Object.values(e)),e.forEach((function(e){t&&"object"===Ii(e)&&(e=e[t]),null==e||isNaN(e)||(r.values.push(e),r.sum+=e,e<r.min&&(r.min=e),e>r.max&&(r.max=e),r.count+=1)})),r.domain=[r.min,r.max],r.limits=function(e,t){return Mi(r,e,t)},r},Mi=function(e,t,r){void 0===t&&(t="equal"),void 0===r&&(r=7),"array"==Ii(e)&&(e=Ni(e));var n=e.min,i=e.max,o=e.values.sort((function(e,t){return e-t}));if(1===r)return[n,i];var s=[];if("c"===t.substr(0,1)&&(s.push(n),s.push(i)),"e"===t.substr(0,1)){s.push(n);for(var a=1;a<r;a++)s.push(n+a/r*(i-n));s.push(i)}else if("l"===t.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var l=Math.LOG10E*Di(n),u=Math.LOG10E*Di(i);s.push(n);for(var c=1;c<r;c++)s.push(Fi(10,l+c/r*(u-l)));s.push(i)}else if("q"===t.substr(0,1)){s.push(n);for(var d=1;d<r;d++){var f=(o.length-1)*d/r,p=Pi(f);if(p===f)s.push(o[p]);else{var h=f-p;s.push(o[p]*(1-h)+o[p+1]*h)}}s.push(i)}else if("k"===t.substr(0,1)){var m,g=o.length,b=new Array(g),y=new Array(r),v=!0,_=0,w=null;(w=[]).push(n);for(var A=1;A<r;A++)w.push(n+A/r*(i-n));for(w.push(i);v;){for(var x=0;x<r;x++)y[x]=0;for(var S=0;S<g;S++)for(var O=o[S],E=Number.MAX_VALUE,j=void 0,T=0;T<r;T++){var C=ki(w[T]-O);C<E&&(E=C,j=T),y[j]++,b[S]=j}for(var R=new Array(r),I=0;I<r;I++)R[I]=null;for(var D=0;D<g;D++)null===R[m=b[D]]?R[m]=o[D]:R[m]+=o[D];for(var F=0;F<r;F++)R[F]*=1/y[F];v=!1;for(var P=0;P<r;P++)if(R[P]!==w[P]){v=!0;break}w=R,++_>200&&(v=!1)}for(var k={},N=0;N<r;N++)k[N]=[];for(var M=0;M<g;M++)k[m=b[M]].push(o[M]);for(var L=[],$=0;$<r;$++)L.push(k[$][0]),L.push(k[$][k[$].length-1]);L=L.sort((function(e,t){return e-t})),s.push(L[0]);for(var q=1;q<L.length;q+=2){var B=L[q];isNaN(B)||-1!==s.indexOf(B)||s.push(B)}}return s},Li={analyze:Ni,limits:Mi},$i=b,qi=b,Bi=Math.sqrt,Gi=Math.pow,zi=Math.min,Ui=Math.max,Vi=Math.atan2,Hi=Math.abs,Xi=Math.cos,Wi=Math.sin,Yi=Math.exp,Ki=Math.PI,Qi=b,Zi=b,Ji=v,eo=pi,to={cool:function(){return eo([Ji.hsl(180,1,.9),Ji.hsl(250,.7,.4)])},hot:function(){return eo(["#000","#f00","#ff0","#fff"]).mode("rgb")}},ro={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},no=0,io=Object.keys(ro);no<io.length;no+=1){var oo=io[no];ro[oo.toLowerCase()]=ro[oo]}var so=ro,ao=v;return ao.average=function(e,t,r){void 0===t&&(t="lrgb"),void 0===r&&(r=null);var n=e.length;r||(r=Array.from(new Array(n)).map((function(){return 1})));var i=n/r.reduce((function(e,t){return e+t}));if(r.forEach((function(e,t){r[t]*=i})),e=e.map((function(e){return new ti(e)})),"lrgb"===t)return ui(e,r);for(var o=e.shift(),s=o.get(t),a=[],l=0,u=0,c=0;c<s.length;c++)if(s[c]=(s[c]||0)*r[0],a.push(isNaN(s[c])?0:r[0]),"h"===t.charAt(c)&&!isNaN(s[c])){var d=s[c]/180*oi;l+=si(d)*r[0],u+=ai(d)*r[0]}var f=o.alpha()*r[0];e.forEach((function(e,n){var i=e.get(t);f+=e.alpha()*r[n+1];for(var o=0;o<s.length;o++)if(!isNaN(i[o]))if(a[o]+=r[n+1],"h"===t.charAt(o)){var c=i[o]/180*oi;l+=si(c)*r[n+1],u+=ai(c)*r[n+1]}else s[o]+=i[o]*r[n+1]}));for(var p=0;p<s.length;p++)if("h"===t.charAt(p)){for(var h=li(u/a[p],l/a[p])/oi*180;h<0;)h+=360;for(;h>=360;)h-=360;s[p]=h}else s[p]=s[p]/a[p];return f/=n,new ti(s,t).alpha(f>.99999?1:f,!0)},ao.bezier=function(e){var t=function(e){var t,r,n,i,o,s,a;if(2===(e=e.map((function(e){return new hi(e)}))).length)t=e.map((function(e){return e.lab()})),o=t[0],s=t[1],i=function(e){var t=[0,1,2].map((function(t){return o[t]+e*(s[t]-o[t])}));return new hi(t,"lab")};else if(3===e.length)r=e.map((function(e){return e.lab()})),o=r[0],s=r[1],a=r[2],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*o[t]+2*(1-e)*e*s[t]+e*e*a[t]}));return new hi(t,"lab")};else if(4===e.length){var l;n=e.map((function(e){return e.lab()})),o=n[0],s=n[1],a=n[2],l=n[3],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*(1-e)*o[t]+3*(1-e)*(1-e)*e*s[t]+3*(1-e)*e*e*a[t]+e*e*e*l[t]}));return new hi(t,"lab")}}else{if(!(e.length>=5))throw new RangeError("No point in running bezier with only one color.");var u,c,d;u=e.map((function(e){return e.lab()})),d=e.length-1,c=function(e){for(var t=[1,1],r=1;r<e;r++){for(var n=[1],i=1;i<=t.length;i++)n[i]=(t[i]||0)+t[i-1];t=n}return t}(d),i=function(e){var t=1-e,r=[0,1,2].map((function(r){return u.reduce((function(n,i,o){return n+c[o]*Math.pow(t,d-o)*Math.pow(e,o)*i[r]}),0)}));return new hi(r,"lab")}}return i}(e);return t.scale=function(){return mi(t)},t},ao.blend=_i,ao.cubehelix=function(e,t,r,n,i){void 0===e&&(e=300),void 0===t&&(t=-1.5),void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=[0,1]);var o,s=0;"array"===wi(i)?o=i[1]-i[0]:(o=0,i=[i,i]);var a=function(a){var l=xi*((e+120)/360+t*a),u=Si(i[0]+o*a,n),c=(0!==s?r[0]+a*s:r)*u*(1-u)/2,d=Ei(l),f=Oi(l);return ji(Ai([255*(u+c*(-.14861*d+1.78277*f)),255*(u+c*(-.29227*d-.90649*f)),255*(u+c*(1.97294*d)),1]))};return a.start=function(t){return null==t?e:(e=t,a)},a.rotations=function(e){return null==e?t:(t=e,a)},a.gamma=function(e){return null==e?n:(n=e,a)},a.hue=function(e){return null==e?r:("array"===wi(r=e)?0==(s=r[1]-r[0])&&(r=r[1]):s=0,a)},a.lightness=function(e){return null==e?i:("array"===wi(e)?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),a)},a.scale=function(){return ji.scale(a)},a.hue(r),a},ao.mix=ao.interpolate=In,ao.random=function(){for(var e="#",t=0;t<6;t++)e+="0123456789abcdef".charAt(Ci(16*Ri()));return new Ti(e,"hex")},ao.scale=pi,ao.analyze=Li.analyze,ao.contrast=function(e,t){e=new $i(e),t=new $i(t);var r=e.luminance(),n=t.luminance();return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)},ao.deltaE=function(e,t,r,n,i){void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=1);var o=function(e){return 360*e/(2*Ki)},s=function(e){return 2*Ki*e/360};e=new qi(e),t=new qi(t);var a=Array.from(e.lab()),l=a[0],u=a[1],c=a[2],d=Array.from(t.lab()),f=d[0],p=d[1],h=d[2],m=(l+f)/2,g=(Bi(Gi(u,2)+Gi(c,2))+Bi(Gi(p,2)+Gi(h,2)))/2,b=.5*(1-Bi(Gi(g,7)/(Gi(g,7)+Gi(25,7)))),y=u*(1+b),v=p*(1+b),_=Bi(Gi(y,2)+Gi(c,2)),w=Bi(Gi(v,2)+Gi(h,2)),A=(_+w)/2,x=o(Vi(c,y)),S=o(Vi(h,v)),O=x>=0?x:x+360,E=S>=0?S:S+360,j=Hi(O-E)>180?(O+E+360)/2:(O+E)/2,T=1-.17*Xi(s(j-30))+.24*Xi(s(2*j))+.32*Xi(s(3*j+6))-.2*Xi(s(4*j-63)),C=E-O;C=Hi(C)<=180?C:E<=O?C+360:C-360,C=2*Bi(_*w)*Wi(s(C)/2);var R=f-l,I=w-_,D=1+.015*Gi(m-50,2)/Bi(20+Gi(m-50,2)),F=1+.045*A,P=1+.015*A*T,k=30*Yi(-Gi((j-275)/25,2)),N=-2*Bi(Gi(A,7)/(Gi(A,7)+Gi(25,7)))*Wi(2*s(k)),M=Bi(Gi(R/(r*D),2)+Gi(I/(n*F),2)+Gi(C/(i*P),2)+N*(I/(n*F))*(C/(i*P)));return Ui(0,zi(100,M))},ao.distance=function(e,t,r){void 0===r&&(r="lab"),e=new Qi(e),t=new Qi(t);var n=e.get(r),i=t.get(r),o=0;for(var s in n){var a=(n[s]||0)-(i[s]||0);o+=a*a}return Math.sqrt(o)},ao.limits=Li.limits,ao.valid=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(Zi,[null].concat(e))),!0}catch(e){return!1}},ao.scales=to,ao.colors=dr,ao.brewer=so,ao}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{r.d(n,{B:()=>oi,Q:()=>Zn});var e=r(4843),t=r(5250);const i=(e,r)=>(0,t.mergeWith)({},e,r,((e,r)=>(0,t.isArray)(r)?r:(0,t.isObject)(e)&&(0,t.isObject)(r)?i(e,r):r)),o={month:{publicName:"Monthly",dateFormat:"MMMM YYYY"},year:{publicName:"Yearly",dateFormat:"YYYY"},quarter:{publicName:"Per quarter",dateFormat:"quarter"},week:{publicName:"Weekly",dateFormat:"week"},day:{publicName:"Daily",dateFormat:"DD-MM-YYYY"},second:{publicName:"Per second",dateFormat:"hh:mm:ss"},hour:{publicName:"Hourly",dateFormat:"hh:mm"},minute:{publicName:"Per minute",dateFormat:"hh:mm"}},s=o,a=e=>{const r=(0,t.cloneDeep)(s);if(!e)return r;let n={};return e.forEach((e=>{if(!s[e])throw`Time trunc function ${e} not managed by Vizzly`;n[e]=s[e]})),n},l={">":{publicName:"Greater than",validDataTypes:["number","date_time"]},"<":{publicName:"Less than",validDataTypes:["number","date_time"]},"<=":{publicName:"Less than or equal to",validDataTypes:["number","date_time"]},">=":{publicName:"Greater than or equal to",validDataTypes:["number","date_time"]},"!=":{publicName:"Not equal to",validDataTypes:["number","date_time","boolean","string"]},is_one_of:{publicName:"Is one of",validDataTypes:["number","date_time","boolean","string"]},"=":{publicName:"Equal to",validDataTypes:["number","date_time","boolean","string"]},is_not_one_of:{publicName:"Is not one of",validDataTypes:["number","date_time","boolean","string"]},starts_with:{publicName:"Starts with",validDataTypes:["string"]},ends_with:{publicName:"Ends with",validDataTypes:["string"]},contains_substring:{publicName:"Contains text",validDataTypes:["string"]},does_not_contain_substring:{publicName:"Does not contain text",validDataTypes:["string"]},array_contains:{publicName:"Contains",validDataTypes:["string[]"]}},u=(e,t)=>{let r=[...Object.keys(t.supportedOperators)];return r=r.filter((t=>c[t].validDataTypes.includes(e.dataType))),r},c=l,d=e=>{const r=(0,t.cloneDeep)(c);if(!e)return r;let n={};return e.forEach((e=>{if(!c[e])throw`Operator ${e} not managed by Vizzly`;n[e]=c[e]})),n},f=e=>e.map((e=>e.map((e=>"is_one_of"!=e.op&&"is_not_one_of"!=e.op||(0,t.isArray)(e.value)?e:Object.assign(Object.assign({},e),{value:[e.value]}))))),p=(e,t)=>e.map((e=>{let r=Object.assign(Object.assign({},e),{aggregate:void 0,function:e.function||e.aggregate});return delete r.aggregate,t&&r.field==t.field&&"none"==r.function&&(r.function=t.truncate),r})),h=e=>e.map((e=>{let t=Object.assign(Object.assign({},e),{aggregate:void 0,function:e.function||e.aggregate});return delete t.aggregate,t})),m=e=>"auto"===e||0===e||2===e?e:"auto",g=e=>{if(!e)return{};let r={};return e.measure&&Object.entries(e.measure).forEach((([e,t])=>{r&&(r[e]=h(t))})),{measure:(0,t.isEmpty)(r)?void 0:r,group:e.group}},b={mean:{publicName:"Mean",validDataTypes:["number"]},sum:{publicName:"Sum",validDataTypes:["number"]},min:{publicName:"Min",validDataTypes:["number"]},max:{publicName:"Max",validDataTypes:["number"]},count:{publicName:"Count",validDataTypes:["string","number","boolean","date_time","string[]"]},countDistinct:{publicName:"Unique",validDataTypes:["string","number","boolean","date_time"]},median:{publicName:"Median",validDataTypes:["number"]}},y=b,v=e=>{const r=(0,t.cloneDeep)(y);if(!e)return r;let n={};return e.forEach((e=>{if(!y[e])throw`Aggregate ${e} not managed by Vizzly`;n[e]=y[e]})),n},_=(e,r,n)=>{const i=(0,t.replace)(e,r,n);return i.indexOf(r)>=0?_(i,r,n):i},w=["debug","info","warning","error","properties"];const A=e=>w.findIndex((e=>"error"==e))<=w.findIndex((t=>e==t)),x=e=>e instanceof Error?e:(0,t.isObject)(e)||(0,t.isArray)(e)?JSON.stringify(e):e,S=(...e)=>{A("debug")&&console.info("[VIZZLY DEBUG]",...e.map(x))},O=(...e)=>{A("error")&&console.error("[VIZZLY ERROR]",...e.map(x))},E=(Object.keys(v()),e=>{return(t=_(e,"_"," ")).charAt(0).toUpperCase()+t.slice(1);var t}),j=(e,t)=>{const r=e.split("_"),n=r.pop();return[void 0,...Object.keys(t.supportedAggregates||{}),...Object.keys(t.supportedTimeTruncFunctions||{}),...Object.keys(t.supportedTransformationFunctions||{})].includes(n)?{field:r.join("_"),function:null!=n?n:""}:{field:e,function:"none"}},T=e=>e.map((e=>"string"==typeof e?{field:e,function:"none"}:e)),C={round_to_0_dp:{publicName:"Round to 0dp",validDataTypes:["number"]},round_to_2_dp:{publicName:"Round to 2dp",validDataTypes:["number"]}},R=e=>{const r=(0,t.cloneDeep)(C);if(!e)return r;let n={};return e.forEach((e=>{if(!C[e])throw`Transformation function ${e} is not managed by Vizzly`;n[e]=C[e]})),n},I=(e,t,r)=>{const n=e.supportedAggregates,i=Object.keys(n).filter((e=>n[e].validDataTypes.includes(t)));null==r||r.forEach((e=>{n.hasOwnProperty(e)||((...e)=>{A("warning")&&console.warn("[VIZZLY WARNING]",...e.map(x))})(`Unsupported aggregate option: ${e} on ${t}`)}));let o=r&&r.length>0?r.filter((e=>i.includes(e))):i;return r&&r.length>0&&0===o.length&&(o=i),o},D=e=>(null==e?void 0:e.function)&&"none"!=(null==e?void 0:e.function)?`${e.field}_${e.function}`:null==e?void 0:e.field,F=j,P=(e,t,r)=>{if("measure"in e&&e.measure){const n=function(e,t){return Object.keys(e).map((e=>{const r=F(e,t);return(null==r?void 0:r.function)?r:null})).find((e=>null!==e))}(e.measure,r);if((null==n?void 0:n.function)&&n.field===t){const t=D(n);delete e.measure[t]}e.measure=k(e.measure,t)}if("group"in e&&e.group){const i=function(e,t){return Object.keys(e).map((e=>{const r=((e,t)=>{const r=e.split("_"),n=r.pop();return n&&(i=t,o=n,![...Object.keys(i),"none"].includes(o))?null:{field:r.join("_"),truncate:null!=n?n:""};var i,o})(e,t.supportedTimeTruncFunctions);return(null==r?void 0:r.truncate)?r:null})).find((e=>null!==e))}(e.group,r);if((null==i?void 0:i.truncate)&&i.field===t){const t=(null==(n=i)?void 0:n.truncate)&&"none"!=(null==n?void 0:n.truncate)?`${n.field}_${n.truncate}`:null==n?void 0:n.field;delete e.group[t]}else e.group.hasOwnProperty(t)&&delete e.group[t];e.group=k(e.group,t)}var n;return e};function k(e,t){const r={};for(const[n,i]of Object.entries(e))r[n]=i.filter((e=>(null==e?void 0:e.field)!==t));return r}const N=(e,r)=>{let n=(0,t.remove)(e.order,(e=>(0,t.some)(r,(t=>{const r=t.function==e.function,n=t.field==e.field;return r&&n}))));return Object.assign(Object.assign({},e),{order:n})},M=(e,r,n)=>{var i,o,s;let a=Object.assign({},e);if("measure"in a&&(0,t.remove)(a.measure,(e=>e.field==r)),"barMeasure"in a&&(0,t.remove)(a.barMeasure,(e=>e.field==r)),"lineMeasure"in a&&(0,t.remove)(a.lineMeasure,(e=>e.field==r)),"xMeasure"in a&&(null===(i=a.yMeasure)||void 0===i?void 0:i.field)==r&&(a.xMeasure=null),"yMeasure"in a&&(null===(o=a.yMeasure)||void 0===o?void 0:o.field)==r&&(a.yMeasure=null),"order"in a&&(0,t.remove)(a.order,(e=>e.field==r)),"dimension"in a&&(0,t.remove)(a.dimension,(e=>e.field==r)),"barDimension"in a&&(0,t.remove)(a.barDimension,(e=>e.field==r)),"lineDimension"in a&&(0,t.remove)(a.lineDimension,(e=>e.field==r)),"filter"in a&&a.filter.forEach((e=>{(0,t.remove)(e,(e=>e.field==r))})),"parameters"in a&&a.parameters&&n){const e=P(a.parameters,r,n);a.parameters=e}return"timeDimension"in a&&(null===(s=a.timeDimension)||void 0===s?void 0:s.field)==r&&(a.timeDimension=null),a},L=e=>{let t=[...e.measure];return e.dimension.forEach((e=>{t.push({field:e.field,function:e.function})})),e.timeDimension&&t.push({field:e.timeDimension.field,function:e.timeDimension.truncate}),N(e,t)},$=(e,t,r)=>{let n=i(e,t);const{value:o,error:s}=r.validate(n);if(s)throw s;return o};var q=r(4579),B=r.n(q);const G=e=>B().object({filters:B().array().items(B().array().items(W(e)).required().max(1)).required().max(1),ruleValue:B().string().allow("").required(),ruleValueEnd:B().string().allow(""),ruleType:B().valid("backgroundColor","fontColor","lineColor","areaColor").required()}).description("A rule used to conditionally format a view."),z=B().object({field:B().string().required().description("ID of the field in the data set to add a prefix too."),prefix:B().string().required().description("The prefix to be applied.")}),U=(e,t)=>{const r=(e,t)=>B().object({field:e.required(),function:t.required().description("Which if any, aggregate function should be applied to the field?")});return(null==t?void 0:t.restrictFields)?B().alternatives(...t.restrictFields.filter((e=>e.canBeMeasure)).map((t=>{const n=((e,t)=>Object.keys(t).filter((r=>t[r].validDataTypes.includes(e.dataType))))(t,e);return r(B().string().valid(t.id).description(`${t.publicName}, ${t.description||""}.`),B().string().valid(...n,"none"))}))):r(B().string().description("The ID of the field from the data set to reference."),B().valid(...Object.keys(e),"none"))},V=e=>B().object({field:B().string().required().description("The ID of the field from the data set to reference."),direction:B().string().valid("asc","desc").required().description("In which direction should the results be ordered?"),function:B().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none").description("Which if any, function should be applied to the field?")}),H=e=>B().object({field:B().string().required().description("The ID of the field from the data set to reference."),truncate:B().valid(...Object.keys(e),"none"),bucketFill:B().boolean()}),X=(e,t)=>{const r=(t,r)=>B().object({field:t.required(),pivot:B().string().valid("x","y").optional(),function:r?B().valid(...Object.keys(e),"none").required():B().valid("none").required()});return(null==t?void 0:t.restrictFields)?B().array().items(B().alternatives(...t.restrictFields.filter((e=>e.canBeDimension)).map((e=>r(B().string().valid(e.id).description(`${e.publicName}, ${e.description||""}.`),"date_time"===e.dataType))))).description("Fields to group the data by"):B().array().items(r(B().string().description("The ID of the field from the data set to reference."),!0)).description("Fields to group the data by")},W=e=>B().object({field:B().string().required().description("The ID of the field from the data set to reference."),op:B().string().valid(...Object.keys(e.supportedOperators)).required(),value:B().alternatives(B().string().allow(null),B().number(),B().boolean(),B().array().items(B().string(),B().number())).required(),function:B().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none").description("Which function should be applied to the field?")}),Y=e=>B().array().items(B().array().items(W(e))),K=()=>B().number().description("Limit the number of results returned after the query has been ran."),Q=e=>{const t=(null==e?void 0:e.restrictDataSetIds)?B().string().valid(...e.restrictDataSetIds):B().string();return{viewId:B().string().allow("").optional().description("__vizzly_hide_from_docs"),displayTitle:B().string().allow("").description("A title that explains what is being displayed."),displaySubject:B().string().allow("").description("A chance to add a more detailed description of what is being shown."),dataSetId:t.description("The ID of the data set that is being used by the view."),protectedByOrganisation:B().boolean().optional().description("Has the view been created by your organisation, and therefore cannot be modified by your users?")}},Z=B().valid("auto",2,0).description("Determine how many axis labels should be shown on the axis"),J=(e,t)=>({measure:B().array().items(U(e.supportedAggregates,t)).required().description("A list of metrics that are to be shown. For example the `count` of a specific field in your data set."),dimension:X(e.supportedTimeTruncFunctions,t).required(),drilldown:B().alternatives(X(e.supportedTimeTruncFunctions,t).required(),B().string()),order:B().array().items(V(e)),timeDimension:B().alternatives(H(e.supportedTimeTruncFunctions),B().valid(null)).required(),limit:K(),offset:B().number().min(0).description("Paginate results by using this property with limit."),filter:B().array().items(B().array().items(W(e))),xAxisPrefix:B().string().allow("").description("Add a prefix to the X Axis"),yAxisPrefix:B().string().allow("").description("Add a prefix to the Y Axis"),xAxisPostfix:B().string().allow("").description("Add a postfix to the X Axis"),yAxisPostfix:B().string().allow("").description("Add a postfix to the Y Axis"),yAxisFormat:B().alternatives(B().string(),B().valid(null)).description("ID of the formatting function to apply to the Y Axis values"),xAxisFormat:B().alternatives(B().string(),B().valid(null)).description("ID of the formatting function to apply to the X Axis values"),approxYAxisLabelCount:Z,approxXAxisLabelCount:Z}),ee=B().string().valid("natural","straight","step","stepBefore","stepAfter"),te=e=>B().array().items(B().object({function:B().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none"),field:B().string().required().description("The ID of the field from the data set to reference.")})),re=e=>B().array().items(B().object({function:B().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none"),truncate:B().string(),field:B().string().required().description("The ID of the field from the data set to reference."),bucketFill:B().boolean().optional(),pivot:B().string().valid("x","y").optional()})),ne=(e,t)=>B().object().pattern(B().string(),B().alternatives().try(B().array().items(H(e.supportedTimeTruncFunctions)).min(1),X(e.supportedTimeTruncFunctions,t))).unknown(!0),ie=(e,t)=>B().object().pattern(B().string(),B().array().items(U(e.supportedAggregates,t)).min(1)).unknown(!0),oe=(e,t)=>B().object({measure:ie(e,t),group:ne(e,t)}),se=()=>B().array().items(B().object({color:B().string().required(),value:B().number().required(),strokeWidth:B().number().required(),strokeStyle:B().string().valid("dashed","solid").required(),label:B().boolean().optional()})),ae=()=>B().object({func:B().string().valid("mean","sum","current").allow(null).optional()}),le=()=>B().object({x:B().string().allow(""),y:B().string().allow("")}),ue=B().object().pattern(B().string(),B().object({width:B().number().min(0),height:B().number().min(0)})),ce=e=>B().array().items(G(e)).description("Apply formatting based on a set of defined rules."),de=e=>B().object(Object.assign(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),J(e.queryEngineConfig,e.attributesSchemaOptions)),{stacked:B().valid(!0,!1,"100%"),legend:B().valid(!0,!1),type:B().valid("barChart","horizontalBarChart").required(),conditionalFormattingRules:ce(e.queryEngineConfig),protectedFields:B().object({dimension:re(e.queryEngineConfig),measure:te(e.queryEngineConfig)}).unknown(!0),parameters:oe(e.queryEngineConfig,e.attributesSchemaOptions),goalLines:se(),axisTitles:le(),headline:ae()})),fe=e=>(t,r)=>{let n=$(t,r,de(e));return n=L(n),n};class pe extends Error{constructor(e){super(e),this.name="ValidationError"}}const he=pe;class me extends he{constructor(e){super(`Corrupt view. ${e.message}.\n\n ${JSON.stringify(e)}\n `),this.name="CorruptedView"}}r(3514);const ge=e=>"leftFieldId"in e&&"operator"in e&&"rightFieldId"in e,be=e=>"roundToDecimalPlaces"in e,ye=e=>"leftFieldId"in e&&"leftFunction"in e&&"operator"in e&&"rightFieldId"in e&&"rightFunction"in e,ve=e=>"denominatorFieldId"in e||"numeratorFieldId"in e,_e=e=>"rules"in e,we=e=>{var t,r;if("leftAggregate"in e||"rightAggregate"in e){let t=Object.assign(Object.assign({},e),{rightFunction:e.rightFunction||e.rightAggregate,leftFunction:e.leftFunction||e.leftAggregate,leftNested:e.leftNested?Object.assign(Object.assign({},e.leftNested),{aggregate:void 0,function:e.leftNested.function||e.leftNested.aggregate}):void 0,rightNested:e.rightNested?Object.assign(Object.assign({},e.rightNested),{aggregate:void 0,function:e.rightNested.function||e.rightNested.aggregate}):void 0});return delete t.leftAggregate,delete t.rightAggregate,t.rightNested&&delete t.rightNested.aggregate,t.leftNested&&delete t.leftNested.aggregate,t}if("numeratorFieldId"in e&&!("version"in e)){const n=[...(null===(t=e.numeratorFilter)||void 0===t?void 0:t[0])||[],...(null===(r=e.denominatorFilter)||void 0===r?void 0:r[0])||[]];return Object.assign(Object.assign({},e),{version:2,denominatorScope:e.denominatorScope||"all",denominatorFilter:(null==e?void 0:e.denominatorFilter)||[],numeratorFilter:n.length>0?[n]:[]})}return e},Ae=e=>B().alternatives((e=>B().object({type:B().valid("function").required(),value:B().link("#Measure"),function:B().valid("none",...Object.keys(e.supportedAggregates))}))(e),B().object({type:B().valid("null").required()}),B().object({type:B().valid("string").required(),value:B().string().allow("")}),B().object({type:B().valid("maths").required(),left:B().link("#Measure"),right:B().link("#Measure").required(),op:B().string().valid("+","*","/","-").required()}),B().object({type:B().valid("subquery").required(),value:B().object({measure:B().array().items(B().link("#Measure")),filter:B().array().items(B().array().items(B().link("#Filter")))})}),(e=>B().object({type:B().valid("field").required(),value:B().string().required(),function:B().valid("none",...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),...Object.keys(e.supportedTransformationFunctions)).required()}))(e),B().object({type:"number",value:B().number()}),B().object({type:B().valid("switchField").required(),value:B().object({cases:B().array().items(B().object({returns:B().link("#Measure"),filter:B().array().items(B().array().items(B().link("#Filter")))}))})})).id("Measure"),xe=B().object({index:B().number().required()}),Se=B().object({index:B().number().required(),direction:B().string().valid("asc","desc").required()}),Oe=(e,t)=>{let r=[B().valid(null)];return t.forEach((e=>{"boolean"==e&&(r=[...r,B().boolean()]),"string"!=e&&"string[]"!=e||(r=[...r,B().string()]),"number"==e&&(r=[...r,B().number()]),"date_time"==e&&(r=[...r,B().date().iso()])})),"is_one_of"==e||"is_not_one_of"==e?B().array().items(B().alternatives(r)):B().alternatives(r)},Ee=e=>B().object({field:Ae(e),op:B().string().valid(...Object.keys(e.supportedOperators)),value:B().alternatives().conditional("op",Object.keys(e.supportedOperators).map((t=>({is:t,then:Oe(t,e.supportedOperators[t].validDataTypes)}))))}).id("Filter"),je=e=>{const t=Ee(e);return B().alternatives(B().object({type:B().valid("preparedQuery").required(),preparedQueryType:B().valid("uniqueArrayValues").required(),dataSetId:B().string().required(),fieldId:B().string().required(),filter:B().array().items(B().array().items(t))}),B().object({type:B().valid("preparedQuery").required(),preparedQueryType:B().valid("preAggregated").required(),dataSetId:B().string().required(),filter:B().object().pattern(B().string(),B().array().items(B().array().items(t)))}))},Te=e=>{const t=Ee(e),r=Ae(e);return B().alternatives().conditional(".type",{is:"query",then:B().object({type:B().valid("query"),dataSetId:B().string().required(),measure:B().array().items(r).min(1).required(),group:B().array().items(xe).required(),filter:B().array().items(B().array().items(t)).required(),order:B().array().items(Se).required(),limit:K(),offset:B().number().optional()}).shared(t).shared(r)}).conditional(".type",{is:"preparedQuery",then:je(e)})};Te({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:a(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:v(["sum","mean","min","max","count","countDistinct"]),supportedOperators:d([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains"]),supportedTransformationFunctions:R(["round_to_0_dp","round_to_2_dp"])}),Te({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:a(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:v(["sum","mean","min","max","count","countDistinct"]),supportedOperators:d([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:R(["round_to_0_dp","round_to_2_dp"])}),Te({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","switchField","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:a(["month","year","day","hour","minute","second"]),supportedAggregates:v(["sum","mean","min","max","count","countDistinct"]),supportedOperators:d([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:R(["round_to_0_dp","round_to_2_dp"])}),Te({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:a(["month","year","day","hour","minute","second"]),supportedAggregates:v(["sum","mean","min","max","count","countDistinct"]),supportedOperators:d([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:R(["round_to_0_dp","round_to_2_dp"])}),Te({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:a(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:v(["sum","mean","min","max","count","countDistinct"]),supportedOperators:d([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains"]),supportedTransformationFunctions:R(["round_to_0_dp","round_to_2_dp"])}),Te({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews"],supportedTimeTruncFunctions:a(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:v(["sum","mean","min","max","count","countDistinct"]),supportedOperators:d([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains"]),supportedTransformationFunctions:R(["round_to_0_dp","round_to_2_dp"])});class Ce extends he{constructor(e,t){super(`\n An expected field is missing from a dataSet.\n\n Missing '${t}'. Got;\n ${JSON.stringify(e)}\n `),this.name="FieldNotFoundInDataSet",this.missingFieldId=t}getMissingFieldId(){return this.missingFieldId}}function Re(e,r){let n=[...e];return(null==r?void 0:r.onlyFieldTypes)&&!(0,t.isEmpty)(r.onlyFieldTypes)&&(n=[...n].filter((e=>{var t;return null===(t=null==r?void 0:r.onlyFieldTypes)||void 0===t?void 0:t.includes(e.dataType)}))),(null==r?void 0:r.forComponent)&&(n=((e,t)=>{const r=br(t);return[...e].filter((e=>{let t=!0;return ve(e)&&!r.supportedCustomFields.percentages&&(t=!1),ge(e)&&!r.supportedCustomFields.simpleMaths&&(t=!1),_e(e)&&!r.supportedCustomFields.rules&&(t=!1),be(e)&&!r.supportedCustomFields.roundedNumbers&&(t=!1),t}))})(n,r.forComponent)),(null==r?void 0:r.removePercentage)&&(n=n.filter((e=>!ve(e)))),(null==r?void 0:r.removeRuleGrouping)&&(n=n.filter((e=>!_e(e)))),(null==r?void 0:r.removeSimpleMaths)&&(n=n.filter((e=>!ge(e)))),(null==r?void 0:r.removeAggregateMaths)&&(n=n.filter((e=>!ye(e)))),(null==r?void 0:r.onlyDimensions)&&(n=n.filter((e=>e.canBeDimension))),(null==r?void 0:r.onlyMeasures)&&(n=n.filter((e=>e.canBeMeasure))),n}const Ie=(e,t)=>{let r=[...e.fields].find((e=>e.id==t));if(r)return r;throw new Ce(e,t)},De=(e,t)=>[...Re(e.fields,{onlyFieldTypes:["number","string","boolean"],onlyMeasures:!0,forComponent:t})],Fe=e=>Object.assign(Object.assign({},e),{fields:[...e.fields].filter((e=>!(e=>ve(e)||ge(e)||ye(e)||_e(e)||be(e))(e)))}),Pe=(e,t,r)=>{const n="horizontalBarChart"===r?void 0:"x",i=(e=>[...Re(e.fields,{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0})])(e)[0],o=[...De(e,r)].map((e=>{const r=((e,t)=>((e,t)=>{var r;let n=null!==(r=e.supportedAggregateOptions)&&void 0!==r?r:[],i=n.filter((r=>Object.keys(t).includes(r)&&t[r].validDataTypes.includes(e.dataType)));return 0===i.length?i=Object.keys(t).filter((r=>t[r].validDataTypes.includes(e.dataType))):i.sort(((e,t)=>n.indexOf(e)-n.indexOf(t))),i})(e,t)[0])(e,t.supportedAggregates);return{field:e.id,function:r}}));return{dataSetId:e.id,measure:o,order:[],timeDimension:null,filter:[],dimension:i?[{field:i.id,function:"none",pivot:n}]:[]}},ke=(e,t)=>t?(e=e.map(Fe),[...[...e].map((e=>{const r=(t[e.id]||[]).map(we);return Object.assign(Object.assign({},e),{fields:[...e.fields,...r]})}))]):e;class Ne extends he{constructor(e,t){super(`\n An expected data set is missing from the dashboard.\n\n Missing '${t}'. Got;\n ${JSON.stringify([...e].map((e=>e.id)))}\n `),this.name="DataSetNotFound"}}const Me={allowUnknown:!0,stripUnknown:!0},Le=(e,t,r)=>{const{error:n}=br(e.type,{queryEngineConfig:r}).schema.validate(e,Me);if(n)return[new me(n)];const i=((e,t)=>e.find((e=>e.id==t))||null)(t,e.dataSetId);if(!i)return[new Ne(t,e.dataSetId)];const o=(e=>{let t=[];return(e=>{let t=[];return"measure"in e&&e.measure&&(t=[...t,...e.measure]),"xMeasure"in e&&e.xMeasure&&(t=[...t,e.xMeasure]),"yMeasure"in e&&e.yMeasure&&(t=[...t,e.yMeasure]),t})(e).forEach((e=>{t=[...t,e.field]})),(e=>{let t=[];return"dimension"in e&&e.dimension&&(t=[...t,...e.dimension]),"lineDimension"in e&&e.lineDimension&&(t=[...t,...e.lineDimension]),"barDimension"in e&&e.barDimension&&(t=[...t,...e.barDimension]),t})(e).forEach((e=>{t=[...t,e.field]})),"order"in e&&e.order&&(t=[...t,...[...e.order].map((e=>e.field))]),"timeDimension"in e&&e.timeDimension&&(t=[...t,e.timeDimension.field]),t})(e);try{o.forEach((e=>{Ie(i,e)}))}catch(e){if(e instanceof Ce)return[e];throw e}return[]},$e=e=>{return!!(e=>{var t;return"comboChart"===e.type?!!e.timeDimension||!!(e.barDimension.length>0&&e.lineDimension.length>0):"barChart"!==e.type&&"lineChart"!==e.type&&"areaChart"!==e.type&&"horizontalBarChart"!==e.type&&"scatterChart"!==e.type&&"pieChart"!==e.type||!!e.timeDimension||!(null==e?void 0:e.dimension)||0!==(null===(t=null==e?void 0:e.dimension)||void 0===t?void 0:t.length)})(e)||("barChart"===(t=e).type?"The Column Chart needs to have a grouping or a time to display correctly.":"lineChart"===t.type?"The Line Chart needs to have a grouping or a time to display correctly.":"areaChart"===t.type?"The Area Chart needs to have a grouping or a time to display correctly.":"horizontalBarChart"===t.type?"The Horizontal Bar Chart needs to have a grouping or a time to display correctly.":"comboChart"===t.type?"The Combo Chart needs to have a grouping (Bar and Line), or have time set to display correctly.":"scatterChart"===t.type?"The Scatter Chart needs to have a grouping to display correctly.":"pieChart"===t.type?"The Pie Chart needs to have a grouping to display correctly.":null);var t},qe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Be;const Ge=new Uint8Array(16);function ze(){if(!Be&&(Be="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Be))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Be(Ge)}const Ue=[];for(let e=0;e<256;++e)Ue.push((e+256).toString(16).slice(1));const Ve=function(e,t,r){if(qe.randomUUID&&!t&&!e)return qe.randomUUID();const n=(e=e||{}).random||(e.rng||ze)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return Ue[e[t+0]]+Ue[e[t+1]]+Ue[e[t+2]]+Ue[e[t+3]]+"-"+Ue[e[t+4]]+Ue[e[t+5]]+"-"+Ue[e[t+6]]+Ue[e[t+7]]+"-"+Ue[e[t+8]]+Ue[e[t+9]]+"-"+Ue[e[t+10]]+Ue[e[t+11]]+Ue[e[t+12]]+Ue[e[t+13]]+Ue[e[t+14]]+Ue[e[t+15]]}(n)};const He=e=>e||`view_${Ve()}`;function Xe(e){const t=e,{parentDimension:r}=t;return function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(t,["parentDimension"])}const We=(e,r,n)=>{let i=(0,t.cloneDeep)(Re(r.fields,{onlyFieldTypes:["boolean","string"]})),o=(0,t.cloneDeep)(Re(r.fields,{onlyFieldTypes:["date_time"]})),s=(0,t.cloneDeep)(Re(r.fields,{onlyFieldTypes:["number"]})),a=null;return o[0]&&(a={field:o[0].id,truncate:"none"}),n(e,{protectedByOrganisation:!0,dimension:i.map((e=>({field:e.id,function:"none"}))),measure:[...s].map((e=>({function:"none",field:e.id}))),order:[],timeDimension:a})},Ye=(e,r)=>{let n=null,i=(0,t.cloneDeep)(e);return i.forEach((e=>{const t=Ie(r,e.field);"date_time"==t.dataType&&(n={field:t.id,truncate:e.function})})),i=i.filter((e=>"date_time"!=Ie(r,e.field).dataType)),{timeDimension:n,dimension:i}},Ke=e=>{let t=[...e.dimension];return"timeDimension"in e&&e.timeDimension&&(t=[{field:e.timeDimension.field,function:e.timeDimension.truncate},...t]),t},Qe=e=>{if(!e)return;let r=(0,t.cloneDeep)(e);return r.measure=h(e.measure||[]),r},Ze=(e,r)=>{let n=[];return(0,t.isEmpty)(r)||void 0===r?[]:(null==r||r.map((t=>{if((null==t?void 0:t.ruleType)&&(null==t?void 0:t.ruleValue)){let r=[];const i="field"in t&&"string"==typeof t.field&&"operator"in t&&"string"==typeof t.operator&&"value"in t;if(null==t?void 0:t.filters){const n=t.filters.map((t=>t.map((t=>Je(t,e)))));r.push(...n)}else i&&r.push([Je({field:t.field,op:t.operator,value:t.value},e)]);n.push({filters:r,ruleValueEnd:null==t?void 0:t.ruleValueEnd,ruleValue:t.ruleValue,ruleType:t.ruleType})}})),n)},Je=(e,t)=>{var r;const n=j(e.field,t),i="none"!==n.function?n.function:null!==(r=e.function)&&void 0!==r?r:"none";return{field:n.field,op:e.op,value:e.value,function:i}},et={title:"Column chart",description:"Uses bars to compare different sets of data.",namespace:"bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}};function tt(e,t){return(t=>t in e.format_panel)(t)?Object.assign(Object.assign({},e.format_panel[t]),{namespace:t}):Object.assign(Object.assign({},e.data_panel[t]),{namespace:t})}function rt(e,t){var r;return null===(r=e.format_panel.axis_labels)||void 0===r?void 0:r.subSectionDefinition[t]}function nt(e){return Object.assign(Object.assign({},tt(e,"heading")),{subSection:[e.format_panel.heading.subSectionDefinition.title,e.format_panel.heading.subSectionDefinition.subject]})}function it(e){return Object.assign(Object.assign({},tt(e,"axis_labels")),{y:Object.assign(Object.assign({},rt(e,"y")),{prefix:rt(e,"y.prefix"),postfix:rt(e,"y.postfix"),format:rt(e,"y.format"),count:rt(e,"y.count"),axisTitle:rt(e,"y.axis_title")}),x:Object.assign(Object.assign({},rt(e,"x")),{prefix:rt(e,"x.prefix"),postfix:rt(e,"x.postfix"),format:rt(e,"x.format"),count:rt(e,"x.count"),axisTitle:rt(e,"x.axis_title")})})}function ot(e,t,r){var n,i,o,s,a;return t?Object.assign(Object.assign({},tt(e,"chart_styles")),{subSection:[null===(n=e.format_panel.chart_styles)||void 0===n?void 0:n.subSectionDefinition.curve,null===(i=e.format_panel.chart_styles)||void 0===i?void 0:i.subSectionDefinition.legend]}):r?Object.assign(Object.assign({},tt(e,"chart_styles")),{subSection:[null===(o=e.format_panel.chart_styles)||void 0===o?void 0:o.subSectionDefinition.stacked,null===(s=e.format_panel.chart_styles)||void 0===s?void 0:s.subSectionDefinition.legend]}):Object.assign(Object.assign({},tt(e,"chart_styles")),{subSection:[null===(a=e.format_panel.chart_styles)||void 0===a?void 0:a.subSectionDefinition.legend]})}function st(e,t){var r;return Object.assign(Object.assign({},null===(r=e.format_panel.stats_labels)||void 0===r?void 0:r.subSectionDefinition[t]),{namespace:t})}const at=(e,t)=>{if("current"===(null==e?void 0:e.func)&&t)return e},lt=e=>({title:et.title,description:et.description,servicesClass:"BarChart",namespace:et.namespace,dump:e=>e,load:t=>Object.assign(Object.assign({},t),{measure:h(t.measure),order:p(t.order,t.timeDimension),filter:f(t.filter),protectedFields:Qe(t.protectedFields),viewId:He(t.viewId),dimension:T(t.dimension),approxXAxisLabelCount:m(t.approxXAxisLabelCount),approxYAxisLabelCount:m(t.approxYAxisLabelCount),parameters:g(t.parameters),conditionalFormattingRules:Ze(e.queryEngineConfig,t.conditionalFormattingRules),headline:at(t.headline,t.timeDimension)}),setAttributes:fe(e),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"barChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:He(null==t?void 0:t.viewId),filter:[],order:[],stacked:void 0,dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0,headline:void 0},t),createFeedback:$e,schema:de(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Pe(t,e.queryEngineConfig,"barChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[tt(et,"data_set"),tt(et,"views"),Object.assign(Object.assign({},tt(et,"field_y_axis")),{fieldFilterOptions:{forComponent:"barChart",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),tt(et,"drilldown"),Object.assign(Object.assign({},tt(et,"field_x_axis")),{fieldFilterOptions:{forComponent:"barChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t)=>Ye(e,t),getValues:e=>Ke(e),maxAllowed:2,testId:"add-dimension"}),tt(et,"sort"),tt(et,"filter"),tt(et,"custom_metrics"),tt(et,"limit")],formatPanelConfig:()=>[nt(et),ot(et,!1,!0),it(et),Object.assign(Object.assign({},tt(et,"conditional_formatting")),{ruleType:"backgroundColor"}),tt(et,"goal_line"),tt(et,"headline")],supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return We(e,t,this.setAttributes)}}),ut=e=>B().object(Object.assign(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),J(e.queryEngineConfig,e.attributesSchemaOptions)),{stacked:B().valid(!0,!1,"100%"),legend:B().valid(!0,!1),type:B().valid("lineChart").required(),parameters:oe(e.queryEngineConfig,e.attributesSchemaOptions),lineCurve:ee,conditionalFormattingRules:ce(e.queryEngineConfig),goalLines:se(),axisTitles:le(),headline:ae()})),ct=e=>(t,r)=>{let n=$(t,r,ut(e));return n=L(n),n},dt={title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",namespace:"line_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this line chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this line chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this line chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this line chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Curve",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},ft=e=>({title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",servicesClass:"LineChart",namespace:"line_chart",dump:e=>e,load:t=>({type:t.type,measure:h(t.measure),order:p(t.order,t.timeDimension),dimension:T(t.dimension),timeDimension:t.timeDimension,displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,viewId:He(t.viewId),filter:f(t.filter),dataSetId:t.dataSetId,limit:t.limit,xAxisPostfix:t.xAxisPostfix,xAxisPrefix:t.xAxisPrefix,yAxisPostfix:t.yAxisPostfix,yAxisPrefix:t.yAxisPrefix,yAxisFormat:t.yAxisFormat,xAxisFormat:t.xAxisFormat,lineCurve:t.lineCurve,conditionalFormattingRules:Ze(e.queryEngineConfig,t.conditionalFormattingRules),drilldown:t.drilldown,legend:t.legend,goalLines:t.goalLines,headline:at(t.headline,t.timeDimension),parameters:g(t.parameters),approxXAxisLabelCount:m(t.approxXAxisLabelCount),approxYAxisLabelCount:m(t.approxYAxisLabelCount),axisTitles:t.axisTitles}),setAttributes:ct(e),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"lineChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:He(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0},t),createFeedback:$e,schema:ut(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Pe(t,e.queryEngineConfig,"lineChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[tt(dt,"data_set"),tt(dt,"views"),Object.assign(Object.assign({},tt(dt,"field_y_axis")),{fieldFilterOptions:{forComponent:"lineChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),Object.assign(Object.assign({},tt(dt,"field_x_axis")),{fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t)=>Ye(e,t),getValues:e=>Ke(e),maxAllowed:2,testId:"add-dimension"}),tt(dt,"sort"),tt(dt,"filter"),tt(dt,"custom_metrics"),tt(dt,"limit")],formatPanelConfig:()=>[nt(dt),ot(dt,!0,!1),it(dt),Object.assign(Object.assign({},tt(dt,"conditional_formatting")),{ruleType:"lineColor"}),tt(dt,"goal_line"),tt(dt,"headline")],supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return We(e,t,this.setAttributes)}}),pt=e=>B().object(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),{measure:B().array().items(U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),dimension:X(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions),filter:Y(e.queryEngineConfig),timeDimension:B().valid(null),order:B().array().items(V(e.queryEngineConfig)),type:B().valid("pieChart").required(),legend:B().valid(!0,!1),limit:K(),labelsAsPercentage:B().boolean(),conditionalFormattingRules:ce(e.queryEngineConfig),labelFormat:B().alternatives(B().string(),B().valid(null)),parameters:oe(e.queryEngineConfig,e.attributesSchemaOptions)})),ht={title:"Pie chart",description:"Represents data in a circular pie-like format, useful for showing proportions.",namespace:"pie_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this pie chart?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want each segment to measure?",callToAction:"Add metric"},field_grouping:{type:"fieldCollector",title:"Grouping",description:"How do you want to split each section of the pie chart?",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Choose the order of segments in the pie chart"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this pie chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of segments shown on this pie chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Format",description:"",namespace:"number_format"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},mt=e=>({title:ht.title,description:ht.description,servicesClass:"PieChart",namespace:ht.namespace,dump:e=>e,load:t=>({type:t.type,measure:h(t.measure),order:p(t.order,t.timeDimension),dimension:T(t.dimension),viewId:He(t.viewId),timeDimension:t.timeDimension,displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,filter:f(t.filter),dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:Ze(e.queryEngineConfig,t.conditionalFormattingRules),labelsAsPercentage:t.labelsAsPercentage,legend:t.legend,labelFormat:t.labelFormat,parameters:g(t.parameters)}),setAttributes:(t,r)=>$(t,r,pt(e)),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"pieChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:He(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],labelsAsPercentage:!1,legend:!0,labelFormat:null,parameters:{}},t),createFeedback:$e,schema:pt(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Pe(t,e.queryEngineConfig,"pieChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[tt(ht,"data_set"),tt(ht,"views"),Object.assign(Object.assign({},tt(ht,"field_metrics")),{fieldFilterOptions:{forComponent:"pieChart"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),Object.assign(Object.assign({},tt(ht,"field_grouping")),{fieldFilterOptions:{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"}),tt(ht,"sort"),tt(ht,"filter"),tt(ht,"custom_metrics"),tt(ht,"limit")],formatPanelConfig:()=>{var e,t;return[nt(ht),Object.assign(Object.assign({},tt(ht,"conditional_formatting")),{ruleType:"backgroundColor"}),Object.assign(Object.assign({},tt(ht,"chart_styles")),{subSection:[null===(e=ht.format_panel.chart_styles)||void 0===e?void 0:e.subSectionDefinition.legend,null===(t=ht.format_panel.chart_styles)||void 0===t?void 0:t.subSectionDefinition.number_format]})]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),gt=e=>B().object(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),{xMeasure:U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions).allow(null),yMeasure:U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions).allow(null),dimension:X(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions),order:B().array().items(V(e.queryEngineConfig)),limit:K(),legend:B().valid(!0,!1),offset:B().number().min(0),filter:Y(e.queryEngineConfig),type:B().valid("scatterChart").required(),timeDimension:B().valid(null),xAxisPrefix:B().string().allow(""),yAxisPrefix:B().string().allow(""),xAxisPostfix:B().string().allow(""),yAxisPostfix:B().string().allow(""),yAxisFormat:B().alternatives(B().string(),B().valid(null)),xAxisFormat:B().alternatives(B().string(),B().valid(null)),approxYAxisLabelCount:Z,approxXAxisLabelCount:Z,goalLines:se(),axisTitles:le()})),bt=e=>(t,r)=>{let n=$(t,r,gt(e)),i=[];return n.xMeasure&&i.push(n.xMeasure),n.yMeasure&&i.push(n.yMeasure),n.dimension.forEach((e=>{i.push({field:e.field,function:e.function})})),n=N(n,i),n},yt={title:"Scatter chart",description:"Displays data points on a Cartesian plane, perfect for showing correlations.",namespace:"scatter_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this scatter chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"",subSectionDefinition:{xAxis:{type:"metrics",title:"X axis",namespace:"metrics.xAxis"},yAxis:{type:"metrics",title:"Y axis",namespace:"metrics.yAxis"}}},field_grouping:{type:"fieldCollector",title:"Grouping",description:"What do you want each dot to represent?",callToAction:"Add comparison"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of data points shown on this scatter chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},vt=e=>({title:yt.title,description:yt.description,servicesClass:"ScatterChart",namespace:yt.namespace,dump:e=>e,load:e=>({type:e.type,xMeasure:h(e.xMeasure?[e.xMeasure]:[])[0]||null,yMeasure:h(e.yMeasure?[e.yMeasure]:[])[0]||null,dimension:T(e.dimension),viewId:He(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:f(e.filter),order:p(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,legend:e.legend,xAxisFormat:e.xAxisFormat,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,approxXAxisLabelCount:m(e.approxXAxisLabelCount),approxYAxisLabelCount:m(e.approxYAxisLabelCount),goalLines:e.goalLines,axisTitles:e.axisTitles}),setAttributes:bt(e),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"scatterChart",xMeasure:null,yMeasure:null,dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:He(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,legend:!0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,axisTitles:void 0},t),createFeedback:$e,schema:gt(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>!!e.xMeasure&&!!e.yMeasure&&e.dimension.length>0,autoGenerate(t){const{measure:r,dimension:n}=Pe(t,e.queryEngineConfig,"scatterChart");return this.init(t.id,{xMeasure:r[0],yMeasure:r[1],dimension:n})},dataPanelConfig:()=>{var e,t;return[tt(yt,"data_set"),tt(yt,"views"),Object.assign(Object.assign({},tt(yt,"labelled_metrics")),{subSection:[Object.assign(Object.assign({},null===(e=yt.data_panel.labelled_metrics)||void 0===e?void 0:e.subSectionDefinition.xAxis),{propKey:"xMeasure",allowsMultiple:!1}),Object.assign(Object.assign({},null===(t=yt.data_panel.labelled_metrics)||void 0===t?void 0:t.subSectionDefinition.yAxis),{propKey:"yMeasure",allowsMultiple:!1})]}),Object.assign(Object.assign({},tt(yt,"field_grouping")),{fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["boolean","number","string"],removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"}),tt(yt,"filter"),tt(yt,"custom_metrics"),tt(yt,"limit")]},formatPanelConfig:()=>{var e;return[nt(yt),Object.assign(Object.assign({},tt(yt,"chart_styles")),{subSection:[null===(e=yt.format_panel.chart_styles)||void 0===e?void 0:e.subSectionDefinition.legend]}),it(yt),tt(yt,"goal_line")]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),_t=e=>B().object(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),{stacked:B().valid(!0,!1,"100%"),legend:B().valid(!0,!1),barMeasure:B().array().items(U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),lineMeasure:B().array().items(U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),barDimension:X(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions),lineDimension:X(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions),order:B().array().items(V(e.queryEngineConfig)),timeDimension:B().alternatives(H(e.queryEngineConfig.supportedTimeTruncFunctions),B().valid(null)),limit:K(),offset:B().number().min(0),filter:Y(e.queryEngineConfig),type:B().valid("comboChart").required(),xAxisPrefix:B().string().allow(""),yAxisPrefix:B().string().allow(""),xAxisPostfix:B().string().allow(""),yAxisPostfix:B().string().allow(""),yAxisFormat:B().alternatives(B().string(),B().valid(null)),xAxisFormat:B().alternatives(B().string(),B().valid(null)),approxYAxisLabelCount:Z,approxXAxisLabelCount:Z,goalLines:se(),conditionalFormattingRules:B().object({bar:B().array().items(G(e.queryEngineConfig)),line:B().array().items(G(e.queryEngineConfig))}),axisTitles:le()})),wt=e=>(t,r)=>{let n=$(t,r,_t(e)),i=[...n.lineMeasure,...n.barMeasure];return[...n.lineDimension,...n.barDimension].forEach((e=>{i.push({field:e.field,function:e.function})})),n.timeDimension&&i.push({field:n.timeDimension.field,function:n.timeDimension.truncate}),n=N(n,i),n},At={title:"Combo chart",description:"A versatile component that combines different chart types.",namespace:"combo_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this combo chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"What do you want each line and bar to measure?",subSectionDefinition:{line:{type:"metrics",title:"Line",namespace:"metrics.line"},bar:{type:"metrics",title:"Bar",namespace:"metrics.bar"}}},combo_chart_dimension:{type:"comboChartDimension",title:"Grouping - X Axis",description:""},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this combo chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:"",subSectionDefinition:{bar:{title:"Bar",namespace:"bar"},line:{title:"Line",namespace:"line"}}}}},xt=e=>({title:At.title,description:At.description,servicesClass:"ComboChart",namespace:At.namespace,dump:e=>e,load:t=>{return r=t,n=e.queryEngineConfig,Object.assign(Object.assign({},r),{lineMeasure:h(r.lineMeasure),barMeasure:h(r.barMeasure),order:p(r.order,r.timeDimension||null),filter:f(r.filter),lineDimension:T(r.lineDimension||r.dimension||[]),barDimension:T(r.barDimension||r.dimension||[]),viewId:He(r.viewId),approxXAxisLabelCount:m(r.approxXAxisLabelCount),approxYAxisLabelCount:m(r.approxYAxisLabelCount),conditionalFormattingRules:{bar:Ze(n,null===(i=r.conditionalFormattingRules)||void 0===i?void 0:i.bar),line:Ze(n,null===(o=r.conditionalFormattingRules)||void 0===o?void 0:o.line)}});var r,n,i,o},setAttributes:wt(e),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"comboChart",barMeasure:[],lineMeasure:[],lineDimension:[],barDimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:He(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",protectedByOrganisation:void 0,xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,conditionalFormattingRules:void 0,axisTitles:void 0},t),createFeedback:$e,schema:_t(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.lineMeasure.length>0||e.barMeasure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Pe(t,e.queryEngineConfig,"comboChart");return this.init(t.id,{barMeasure:[r[0]],lineMeasure:[r[1]||r[0]],barDimension:n,lineDimension:n})},dataPanelConfig:()=>{var e,t;return[tt(At,"data_set"),tt(At,"views"),Object.assign(Object.assign({},tt(At,"labelled_metrics")),{subSection:[Object.assign(Object.assign({},null===(e=At.data_panel.labelled_metrics)||void 0===e?void 0:e.subSectionDefinition.line),{propKey:"lineMeasure",allowsMultiple:!0}),Object.assign(Object.assign({},null===(t=At.data_panel.labelled_metrics)||void 0===t?void 0:t.subSectionDefinition.bar),{propKey:"barMeasure",allowsMultiple:!0})]}),tt(At,"combo_chart_dimension"),tt(At,"sort"),tt(At,"filter"),tt(At,"custom_metrics"),tt(At,"limit")]},formatPanelConfig:()=>{var e,t,r,n,i,o,s,a,l,u;return[nt(At),ot(At,!1,!0),it(At),Object.assign(Object.assign({},tt(At,"conditional_formatting")),{ruleType:"backgroundColor",subSection:[{title:null!==(r=null===(t=null===(e=At.format_panel.conditional_formatting)||void 0===e?void 0:e.subSectionDefinition)||void 0===t?void 0:t.bar.title)&&void 0!==r?r:"",namespace:null===(i=null===(n=At.format_panel.conditional_formatting)||void 0===n?void 0:n.subSectionDefinition)||void 0===i?void 0:i.bar.namespace,propKey:"bar"},{title:null!==(a=null===(s=null===(o=At.format_panel.conditional_formatting)||void 0===o?void 0:o.subSectionDefinition)||void 0===s?void 0:s.line.title)&&void 0!==a?a:"",namespace:null===(u=null===(l=At.format_panel.conditional_formatting)||void 0===l?void 0:l.subSectionDefinition)||void 0===u?void 0:u.line.namespace,propKey:"line"}]}),tt(At,"goal_line")]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),St=e=>B().object(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),{type:B().valid("dataTable").required(),measure:B().array().items(U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)).required(),dimension:X(e.queryEngineConfig.supportedTimeTruncFunctions,e.attributesSchemaOptions).required(),order:B().array().items(V(e.queryEngineConfig)),timeDimension:B().alternatives(H(e.queryEngineConfig.supportedTimeTruncFunctions),B().valid(null)),limit:K().required(),offset:B().number().min(0),filter:Y(e.queryEngineConfig),prefixes:B().array().items(z),exportNames:B().object(),numberFormat:B().object(),conditionalFormattingRules:ce(e.queryEngineConfig),dateTimeFormat:B().string(),protectedFields:B().object({dimension:re(e.queryEngineConfig),measure:te(e.queryEngineConfig)}).unknown(!0),sizing:ue,tableDrilldown:B().array().items(B().object({subsetDimension:B().string().required().description("The ID of the field in the data set to drill down by.")})).description("Drilldown configuration for a pivot table.")})),Ot=e=>(t,r)=>{let n=$(t,r,St(e));return n=L(n),n},Et={title:"Pivot table",description:"Transforms data into a table with dynamic rows and columns.",namespace:"pivot_table",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this data table?"},views:{type:"views",title:"View",description:""},field_columns:{type:"fieldCollector",title:"Group columns",callToAction:"Add group column",description:""},field_rows:{type:"fieldCollector",title:"Group rows",description:"Which field do you want to group each row by? An example might be an employee ID or geographical location",callToAction:"Add group row"},drilldown:{type:"drilldown",title:"Drilldown",description:"Drilldowns in a pivot table reveals underlying data contributing to summarized figures upon clicking."},field_metrics:{type:"fieldCollector",title:"Metrics",description:"Select the columns to show in the data table",callToAction:"Add metric"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this data table."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},pagination:{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},format:{type:"format",title:"Format",description:"",subSectionDefinition:{time:{type:"time",title:"Time",description:"",namespace:"time"}}},prefixes:{type:"prefixes",title:"Prefixes",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},jt=[3,5,10,20,50,100,200],Tt=(e,t)=>e.filter((e=>e.pivot==t)),Ct=e=>({title:Et.title,description:Et.description,servicesClass:"PivotTable",namespace:Et.namespace,dump:e=>e,load:t=>{return{type:t.type,measure:h(t.measure),order:p(t.order,t.timeDimension||null),displayTitle:t.displayTitle,dimension:(n=Ke({timeDimension:t.timeDimension,dimension:T(t.dimension)}),n.map((e=>Object.assign(Object.assign({},e),{pivot:e.pivot?e.pivot:"x"})))),displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,protectedFields:Qe(t.protectedFields),viewId:He(t.viewId),filter:f(t.filter),dataSetId:t.dataSetId,limit:t.limit,offset:t.offset,conditionalFormattingRules:Ze(e.queryEngineConfig,t.conditionalFormattingRules),dateTimeFormat:t.dateTimeFormat,prefixes:t.prefixes,exportNames:t.exportNames,numberFormat:t.numberFormat,sizing:t.sizing,tableDrilldown:(r=t.tableDrilldown,r&&r.length>0?r.map(Xe):r||[])};var r,n},setAttributes:Ot(e),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"dataTable",measure:[],displayTitle:"",dimension:[],protectedByOrganisation:void 0,displaySubject:"",viewId:He(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:50,offset:0,conditionalFormattingRules:[],protectedFields:void 0,prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{},tableDrilldown:[]},t),schema:St(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Pe(t,e.queryEngineConfig,"dataTable");return this.init(t.id,{measure:r.slice(0,5),dimension:n})},dataPanelConfig:()=>[tt(Et,"data_set"),tt(Et,"views"),Object.assign(Object.assign({},tt(Et,"field_columns")),{fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t,r)=>({dimension:[...e.map((e=>Object.assign(Object.assign({},e),{pivot:"y"}))),...Tt(r.dimension,"x")]}),getValues:e=>Tt(e.dimension,"y"),testId:"add-pivot-dimension"}),Object.assign(Object.assign({},tt(Et,"field_rows")),{fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t,r)=>({dimension:[...e.map((e=>Object.assign(Object.assign({},e),{pivot:"x"}))),...Tt(r.dimension,"y")]}),getValues:e=>Tt(e.dimension,"x"),testId:"add-dimension"}),tt(Et,"drilldown"),Object.assign(Object.assign({},tt(Et,"field_metrics")),{fieldFilterOptions:{forComponent:"dataTable"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),tt(Et,"sort"),Object.assign(Object.assign({},tt(Et,"pagination")),{options:jt}),tt(Et,"filter"),tt(Et,"custom_metrics")],formatPanelConfig:()=>{var e;return[nt(Et),Object.assign(Object.assign({},tt(Et,"format")),{subSection:[null===(e=Et.format_panel.format)||void 0===e?void 0:e.subSectionDefinition.time]}),tt(Et,"prefixes"),Object.assign(Object.assign({},tt(Et,"conditional_formatting")),{ruleType:"backgroundColor"})]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!0}}),Rt=B().object({field:B().string().required(),function:B().valid("none").required()}),It=e=>B().object(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),{type:B().valid("basicTable").required(),measure:B().array().items(Rt).required(),dimension:B().array().max(0),order:B().array().items(V(e.queryEngineConfig)),timeDimension:B().valid(null),limit:K().required(),offset:B().number().min(0),filter:Y(e.queryEngineConfig),prefixes:B().array().items(z),exportNames:B().object(),numberFormat:B().object(),conditionalFormattingRules:ce(e.queryEngineConfig),dateTimeFormat:B().string(),protectedFields:B().object({measure:te(e.queryEngineConfig)}).unknown(!0),sizing:ue})),Dt=e=>(t,r)=>{let n=$(t,r,It(e));return n=N(n,[...n.measure]),n},Ft={title:"Basic table",description:"Displays data in a simple, straightforward table format.",namespace:"basic_table",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this basic table?"},views:{type:"views",title:"View",description:""},fields:{type:"fields",title:"Columns",description:"Select which values you want to see in this table"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this basic table."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},pagination:{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{type:"subject",title:"Subject",description:"",namespace:"subject"}}},format:{type:"format",title:"Format",description:"",subSectionDefinition:{time:{type:"time",title:"Time",description:"",namespace:"time"}}},prefixes:{type:"prefixes",title:"Prefixes",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Pt=e=>({title:Ft.title,description:Ft.description,servicesClass:"BasicTable",namespace:Ft.namespace,dump:e=>({type:e.type,measure:e.measure,displayTitle:e.displayTitle,dimension:e.dimension,timeDimension:e.timeDimension,displaySubject:e.displaySubject,protectedFields:e.protectedFields,filter:e.filter,order:e.order,dataSetId:e.dataSetId,viewId:null==e?void 0:e.viewId,limit:e.limit,offset:e.offset,conditionalFormattingRules:e.conditionalFormattingRules,protectedByOrganisation:e.protectedByOrganisation,dateTimeFormat:e.dateTimeFormat,prefixes:e.prefixes,exportNames:e.exportNames,numberFormat:e.numberFormat,sizing:e.sizing}),load:t=>Object.assign(Object.assign({},t),{measure:h(t.measure),order:p(t.order,t.timeDimension),filter:f(t.filter),dimension:T(t.dimension),viewId:He(t.viewId),protectedFields:Qe(t.protectedFields),conditionalFormattingRules:Ze(e.queryEngineConfig,t.conditionalFormattingRules)}),setAttributes:Dt(e),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:function(t,r){const n={type:"basicTable",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",filter:[],order:[],dataSetId:t,viewId:He(null==r?void 0:r.viewId),protectedFields:void 0,limit:50,offset:0,conditionalFormattingRules:[],prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{}};return Dt(e)(n,r||{})},schema:It(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),setFields:function(t,r){const n=[...r].map((e=>({field:e,function:"none"})));return Dt(e)(t,{measure:n})},setDateTimeFormat:function(e,t){return this.setAttributes(e,{dateTimeFormat:t})},isRunnable:e=>e.measure.length>0,autoGenerate(e){const t=[...Re(e.fields,{forComponent:"basicTable",onlyMeasures:!0,removeAggregateMaths:!0,removePercentage:!0})].map((e=>({field:e.id,function:"none"})));return this.init(e.id,{measure:t.slice(0,5)})},dataPanelConfig:()=>[tt(Ft,"data_set"),tt(Ft,"views"),tt(Ft,"fields"),tt(Ft,"sort"),Object.assign(Object.assign({},tt(Ft,"pagination")),{options:jt}),tt(Ft,"filter"),tt(Ft,"custom_metrics")],formatPanelConfig:()=>{var e;return[nt(Ft),Object.assign(Object.assign({},tt(Ft,"format")),{subSection:[null===(e=Ft.format_panel.format)||void 0===e?void 0:e.subSectionDefinition.time]}),tt(Ft,"prefixes"),Object.assign(Object.assign({},tt(Ft,"conditional_formatting")),{ruleType:"backgroundColor"})]},supportedCustomFields:{percentages:!1,simpleMaths:!0,rules:!0,aggregateMaths:!1,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!0}}),kt=e=>(t,r)=>{let n=$(t,r,de(e));return n=L(n),n},Nt={title:"Horizontal bar chart",description:"Similar to a BarChart but with horizontal bars.",namespace:"horizontal_bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Mt=e=>({title:Nt.title,description:Nt.description,servicesClass:"HorizontalBarChart",namespace:Nt.namespace,dump:e=>e,load:e=>Object.assign(Object.assign({},e),{measure:h(e.measure),order:p(e.order,e.timeDimension),dimension:T(e.dimension),viewId:He(e.viewId),filter:f(e.filter),approxXAxisLabelCount:m(e.approxXAxisLabelCount),approxYAxisLabelCount:m(e.approxYAxisLabelCount),protectedFields:Qe(e.protectedFields)}),setAttributes:kt(e),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"horizontalBarChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:He(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,drilldown:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",axisTitles:void 0},t),createFeedback:$e,schema:de(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Pe(t,e.queryEngineConfig,"horizontalBarChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[tt(Nt,"data_set"),tt(Nt,"views"),Object.assign(Object.assign({},tt(Nt,"field_y_axis")),{fieldFilterOptions:{forComponent:"horizontalBarChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),tt(Nt,"drilldown"),Object.assign(Object.assign({},tt(Nt,"field_x_axis")),{fieldFilterOptions:{forComponent:"horizontalBarChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t)=>Ye(e,t),getValues:e=>Ke(e),maxAllowed:2,testId:"add-dimension"}),tt(Nt,"sort"),tt(Nt,"filter"),tt(Nt,"custom_metrics"),tt(Nt,"limit")],formatPanelConfig:()=>[nt(Nt),ot(Nt,!1,!0),it(Nt),Object.assign(Object.assign({},tt(Nt,"conditional_formatting")),{ruleType:"backgroundColor"}),tt(Nt,"headline")],supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return We(e,t,this.setAttributes)}}),Lt=e=>B().object(Object.assign(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),J(e.queryEngineConfig,e.attributesSchemaOptions)),{stacked:B().valid(!0,!1,"100%"),legend:B().valid(!0,!1),type:B().valid("areaChart").required(),lineCurve:ee,conditionalFormattingRules:ce(e.queryEngineConfig),parameters:oe(e.queryEngineConfig,e.attributesSchemaOptions),goalLines:se(),axisTitles:le(),headline:ae()})),$t=e=>(t,r)=>{let n=$(t,r,Lt(e));return n=L(n),n},qt={title:"Area chart",description:"Displays data as areas on a chart, useful for showing trends over time.",namespace:"area_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this area chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each area to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each area to represent? An example might be an employee ID to represent each employee.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this area chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this area chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},curve:{type:"curve",title:"Line Curve",description:"",namespace:"curve"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},Bt=e=>({title:qt.title,description:qt.description,servicesClass:"AreaChart",namespace:qt.namespace,dump:e=>e,load:t=>({type:t.type,measure:h(t.measure),displayTitle:t.displayTitle,dimension:T(t.dimension),timeDimension:t.timeDimension,displaySubject:t.displaySubject,viewId:He(t.viewId),filter:f(t.filter),order:p(t.order,t.timeDimension),dataSetId:t.dataSetId,limit:t.limit,offset:t.offset,xAxisPostfix:t.xAxisPostfix,xAxisPrefix:t.xAxisPrefix,yAxisPostfix:t.yAxisPostfix,yAxisPrefix:t.yAxisPrefix,lineCurve:t.lineCurve,conditionalFormattingRules:Ze(e.queryEngineConfig,t.conditionalFormattingRules),protectedByOrganisation:t.protectedByOrganisation,stacked:t.stacked,drilldown:t.drilldown,legend:t.legend,yAxisFormat:t.yAxisFormat,xAxisFormat:t.xAxisFormat,goalLines:t.goalLines,parameters:g(t.parameters),approxXAxisLabelCount:m(t.approxXAxisLabelCount),approxYAxisLabelCount:m(t.approxYAxisLabelCount),headline:at(t.headline,t.timeDimension)}),setAttributes:$t(e),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"areaChart",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",viewId:He(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,offset:0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0,headline:void 0},t),createFeedback:$e,schema:Lt(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Pe(t,e.queryEngineConfig,"areaChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[tt(qt,"data_set"),tt(qt,"views"),Object.assign(Object.assign({},tt(qt,"field_y_axis")),{fieldFilterOptions:{forComponent:"areaChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),Object.assign(Object.assign({},tt(qt,"field_x_axis")),{fieldFilterOptions:{forComponent:"areaChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,t)=>Ye(e,t),getValues:e=>Ke(e),maxAllowed:2,testId:"add-dimension"}),tt(qt,"sort"),tt(qt,"filter"),tt(qt,"custom_metrics"),tt(qt,"limit")],formatPanelConfig:()=>{var e,t,r;return[nt(qt),Object.assign(Object.assign({},tt(qt,"chart_styles")),{subSection:[null===(e=qt.format_panel.chart_styles)||void 0===e?void 0:e.subSectionDefinition.stacked,null===(t=qt.format_panel.chart_styles)||void 0===t?void 0:t.subSectionDefinition.legend,null===(r=qt.format_panel.chart_styles)||void 0===r?void 0:r.subSectionDefinition.curve]}),it(qt),Object.assign(Object.assign({},tt(qt,"conditional_formatting")),{ruleType:"areaColor"}),tt(qt,"goal_line"),tt(qt,"headline")]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),Gt=e=>B().object(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),{fontSize:B().string().allow(""),formatter:B().object(),measure:B().array().items(U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),filter:Y(e.queryEngineConfig),prefixes:B().object(),postfixes:B().object(),type:B().valid("singleStat").required(),limit:K(),conditionalFormattingRules:ce(e.queryEngineConfig),deltaTimeDimension:B().alternatives(H(e.queryEngineConfig.supportedTimeTruncFunctions),B().valid(null)),parameters:oe(e.queryEngineConfig,e.attributesSchemaOptions)})),zt=e=>{if("singleMeasure"in e){let t={},r={},n=[],i={};return e.singleMeasure&&(n=[e.singleMeasure],t[D(e.singleMeasure)]=e.prefix,r[D(e.singleMeasure)]=e.postfix,i[D(e.singleMeasure)]=e.formatter),{type:"singleStat",prefixes:t,postfixes:r,measure:n,formatter:i,fontSize:e.fontSize,displayTitle:e.displayTitle,displaySubject:e.displaySubject,filter:f(e.filter),dataSetId:e.dataSetId,limit:e.limit,conditionalFormattingRules:e.conditionalFormattingRules,deltaTimeDimension:e.deltaTimeDimension,parameters:g(e.parameters)}}return Object.assign(Object.assign({},e),{filter:f(e.filter)})},Ut={title:"Single stat",description:"Shows a single statistical value, ideal for key data point representation.",namespace:"single_stat",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this single stat?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metrics",description:"What do you want to show?",callToAction:"Add metric"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},comparison:{type:"comparison",title:"Comparison",description:""}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},stats_labels:{type:"statsLabels",title:"Labels",description:"",subSectionDefinition:{prefix:{title:"Prefix",description:"",namespace:"prefix"},postfix:{title:"Postfix",description:"",namespace:"postfix"},format:{title:"Format",description:"",namespace:"format"},count:{title:"Label count",description:"",namespace:"count"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},format:{type:"format",title:"Format",description:"",subSectionDefinition:{font_size:{title:"Font Size",type:"fontSize",description:"",namespace:"font_size"}}}}},Vt=e=>({title:Ut.title,description:Ut.description,servicesClass:"SingleStat",namespace:Ut.namespace,dump:e=>e,load:e=>{const t=zt(e);return{type:"singleStat",prefixes:t.prefixes,postfixes:t.postfixes,formatter:t.formatter,fontSize:t.fontSize,measure:h(t.measure),displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:He(e.viewId),filter:t.filter,dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:t.conditionalFormattingRules,deltaTimeDimension:t.deltaTimeDimension,parameters:g(t.parameters)}},setAttributes:(t,r)=>$(t,r,Gt(e)),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"singleStat",measure:[],displayTitle:"",postfixes:{},prefixes:{},formatter:{},fontSize:"2rem",protectedByOrganisation:void 0,displaySubject:"",viewId:He(null==t?void 0:t.viewId),filter:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],deltaTimeDimension:null,parameters:{}},t),schema:Gt(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r}=Pe(t,e.queryEngineConfig,"singleStat");return this.init(t.id,{measure:[r[0]]})},dataPanelConfig:()=>[tt(Ut,"data_set"),tt(Ut,"views"),Object.assign(Object.assign({},tt(Ut,"field_metrics")),{fieldFilterOptions:{forComponent:"singleStat"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),tt(Ut,"filter"),tt(Ut,"custom_metrics"),tt(Ut,"comparison")],formatPanelConfig:()=>{var e;return[nt(Ut),Object.assign(Object.assign({},tt(Ut,"stats_labels")),{prefix:st(Ut,"prefix"),postfix:st(Ut,"postfix"),format:st(Ut,"format"),count:st(Ut,"count")}),Object.assign(Object.assign({},tt(Ut,"format")),{subSection:[null===(e=Ut.format_panel.format)||void 0===e?void 0:e.subSectionDefinition.font_size]}),Object.assign(Object.assign({},tt(Ut,"conditional_formatting")),{ruleType:"fontColor"})]},supportedCustomFields:{percentages:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,r){let n=(0,t.cloneDeep)(Re(r.fields,{onlyFieldTypes:["number"]}));return Object.assign(Object.assign({},e),{type:"singleStat",protectedByOrganisation:!0,measure:[...n].map((e=>({function:"none",field:e.id})))})}}),Ht={title:"Custom",servicesClass:"",namespace:"custom",description:"",dump:e=>e,load:e=>e,setAttributes:(e,t)=>{throw"Not implemented."},validate:()=>[],init:(e,t)=>({type:"custom",id:t&&t.id||"",dataSetId:e,displaySubject:"",displayTitle:"",protectedByOrganisation:void 0}),schema:B().object(),removeField:(e,t)=>e,isRunnable:()=>!0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[],formatPanelConfig:()=>[],supportedCustomFields:{percentages:!1,simpleMaths:!0,rules:!1,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{colorGradient:!1,parameters:!1}},Xt=e=>B().object(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),{type:B().valid("mercatorMap").required(),measure:B().array().items(U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),filter:Y(e.queryEngineConfig),limit:K(),dimension:X({},e.attributesSchemaOptions),labelFormat:B().alternatives(B().string(),B().valid(null)),noDataColor:B().string().required(),backgroundColor:B().string().required(),maxValueColor:B().string().required(),minValueColor:B().string().required(),position:B().object({scale:B().number(),centerX:B().number(),centerY:B().number()})})),Wt=e=>(t,r)=>$(t,r,Xt(e)),Yt={title:"Country map",description:"A map component based on the Mercator projection, suitable for geographical data visualization.",namespace:"mercator_map",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use for this map?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want to show?",callToAction:"Add metric"},field_country:{type:"fieldCollector",title:"Country",description:"Which field contains the country code required to group results on?",callToAction:"Set country"},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use on this map."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this map."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Map Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Value format",description:"",namespace:"number_format"}}},map_colors:{type:"mapColors",title:"Map colors",description:""}}},Kt=e=>({title:Yt.title,description:Yt.description,servicesClass:"MercatorMap",namespace:Yt.namespace,dump:e=>e,load:e=>({dataSetId:e.dataSetId,displaySubject:e.displaySubject,displayTitle:e.displayTitle,protectedByOrganisation:e.protectedByOrganisation,viewId:He(e.viewId),type:"mercatorMap",dimension:e.dimension,limit:e.limit,measure:h(e.measure),labelFormat:e.labelFormat,position:e.position,filter:f(e.filter),noDataColor:e.noDataColor||"#ffffff",backgroundColor:e.backgroundColor||"#EFF5F6",maxValueColor:e.maxValueColor||"#000000",minValueColor:e.minValueColor||"#e0e0e0"}),setAttributes:Wt(e),validate:()=>[],init:(e,t)=>Object.assign({type:"mercatorMap",dataSetId:e,dimension:[],measure:[],displaySubject:"",displayTitle:"",limit:5e3,filter:[],viewId:He(null==t?void 0:t.viewId),labelFormat:null,noDataColor:"#ffffff",backgroundColor:"#EFF5F6",maxValueColor:"#000000",minValueColor:"#e0e0e0"},t),schema:Xt(e),removeField:(e,t)=>e,isRunnable:e=>!!(e.dimension&&e.dimension[0]&&e.measure&&e.measure[0]),autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[tt(Yt,"data_set"),tt(Yt,"views"),Object.assign(Object.assign({},tt(Yt,"field_metrics")),{type:"fieldCollector",fieldFilterOptions:{forComponent:"mercatorMap"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"}),Object.assign(Object.assign({},tt(Yt,"field_country")),{fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["string"],removeRuleGrouping:!1,removeSimpleMaths:!0,removePercentage:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"}),tt(Yt,"filter"),tt(Yt,"custom_metrics"),tt(Yt,"limit")],formatPanelConfig:()=>{var e;return[nt(Yt),Object.assign(Object.assign({},tt(Yt,"chart_styles")),{subSection:[null===(e=Yt.format_panel.chart_styles)||void 0===e?void 0:e.subSectionDefinition.number_format]}),tt(Yt,"map_colors")]},supportedCustomFields:{percentages:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}});var Qt;!function(e){e.Linear="linear",e.Circular="circular"}(Qt||(Qt={}));const Zt=e=>B().object(Object.assign(Object.assign({},Q(e.attributesSchemaOptions)),{measure:B().array().items(U(e.queryEngineConfig.supportedAggregates,e.attributesSchemaOptions)),filter:Y(e.queryEngineConfig),type:B().valid("progress").required(),limit:K(),conditionalFormattingRules:ce(e.queryEngineConfig),parameters:oe(e.queryEngineConfig,e.attributesSchemaOptions),goals:B().array().items(B().object({field:B().string().required().description("ID of the field in the data set to which the goal applies too"),value:B().number().required().description("Value of which the goal is set")})).description("Set the target value that progression is shown towards."),progressType:B().array().items(B().object({field:B().string().required().description("ID of the field to set the progress type of"),value:B().valid(Qt.Linear,Qt.Circular).required()})).description("Set the display type of the progress view"),formatter:B().object().pattern(B().string(),B().string()),prefixes:B().object().pattern(B().string(),B().string()),postfixes:B().object().pattern(B().string(),B().string())})),Jt={title:"Progress",description:"Used to show progress towards goals, completion of tasks, or as indicators of performance metrics.",namespace:"progress",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this progress?"},views:{type:"views",title:"View",description:""},progress_goals:{type:"progressGoals",title:"Metric",description:"What do you want to show in each progress bar?"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this progress chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},stats_labels:{type:"statsLabels",title:"Labels",description:"",subSectionDefinition:{prefix:{title:"Prefix",description:"",namespace:"prefix"},postfix:{title:"Postfix",description:"",namespace:"postfix"},format:{title:"Format",description:"",namespace:"format"},count:{title:"Label count",description:"",namespace:"count"}}},progress_type:{type:"progressType",title:"Type",description:""}}},er=e=>({title:Jt.title,description:Jt.description,dump:e=>e,namespace:Jt.namespace,servicesClass:"Progress",load:e=>{const t=zt(e);return{type:"progress",measure:h(t.measure),displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,viewId:He(t.viewId),filter:t.filter,dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:t.conditionalFormattingRules,parameters:t.parameters,prefixes:t.prefixes,postfixes:t.postfixes,formatter:t.formatter,goals:t.goals,progressType:t.progressType}},setAttributes:(t,r)=>$(t,r,Zt(e)),validate:(t,r)=>Le(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"progress",measure:[],displayTitle:"",protectedByOrganisation:void 0,displaySubject:"",viewId:He(null==t?void 0:t.viewId),filter:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],parameters:{},formatter:{},progressType:[],goals:[],postfixes:{},prefixes:{}},t),schema:Zt(e),removeField:(t,r)=>M(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[tt(Jt,"data_set"),tt(Jt,"views"),tt(Jt,"progress_goals"),tt(Jt,"filter"),tt(Jt,"custom_metrics")],formatPanelConfig:()=>[nt(Jt),tt(Jt,"progress_type"),Object.assign(Object.assign({},tt(Jt,"stats_labels")),{prefix:st(Jt,"prefix"),postfix:st(Jt,"postfix"),format:st(Jt,"format"),count:st(Jt,"count")})],supportedCustomFields:{percentages:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),tr=["title","description","data_panel","format_panel"],rr=["title","description","callToAction"],nr="call_to_action",ir=B().alternatives().try(B().string(),B().object({sentence:B().string().custom(((e,t)=>{const r=/\{\{(\w+)\}\}/g;let n;for(;null!==(n=r.exec(e));){const e=n[1];if(!t.state.ancestors[0][`${e}_singular`]||!t.state.ancestors[0][`${e}_plural`]){const r=`"textOverride": "${e}" found in sentence but corresponding "${e}_singular" and "${e}_plural" fields are missing`;return t.error("any.invalid",{message:r})}}return e}))}).pattern(/.+_(singular|plural)$/,B().string())).messages({"any.custom":"{{#message}}"}),or=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,sr=/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,ar=/on[a-z]+\s*=\s*["'][^"']*["']/gi,lr=/javascript:[^\s"']+/gi,ur=new RegExp(`^(?:${/<(b|strong)>(?:(?!<\/(b|strong)>).)*<\/(b|strong)>/.source}|${/<(i|em)>(?:(?!<\/(i|em)>).)*<\/(i|em)>/.source}|[^*_<>])*$`,"m"),cr=e=>{if(or.test(e)||sr.test(e)||ar.test(e)||lr.test(e))throw new Error("Invalid content: potentially malicious elements detected.");return ur.test(e)},dr=(e,t,r,n,i)=>{if(i)return`[key: ${e}]`;const o=n?function(e,t){const r=e[t],n=ir.validate(r);return n.error&&n.error.details.forEach((e=>{var t;O(null===(t=e.context)||void 0===t?void 0:t.message)})),(()=>{if("string"==typeof r)return cr(r);if("object"==typeof r)return cr(r.sentence);if(void 0===r)return!0;throw new Error("Invalid translation type")})()?r:void 0}(n,e):void 0;let s;return s="object"==typeof o&&null!==o?o.sentence:"string"==typeof o?o:t,s=function(e,t){if(!t)return e;return e.replace(/\[\[([^\]]+)\]\]/g,((e,r)=>{const n=r.split("|");for(const e of n){const r=t[e];if("string"==typeof r&&""!==r)return r;if("number"==typeof r)return r.toString()}return""}))}(s,r),r&&(s=function(e,t,r){return Object.entries(t).forEach((([t,n])=>{if(n&&"object"==typeof n&&"count"in n){const i=n,o=1===i.count?r&&r[`${t}_singular`]||i.singular:r&&r[`${t}_plural`]||i.plural;e=e.replace(new RegExp(`{{${t}}}`,"g"),o)}})),e}(s,r,o)),function(e,t){if(!t)return e;for(const[r,n]of Object.entries(t))if("string"==typeof n||"number"==typeof n){const t=new RegExp(`\\[\\[${r}\\]\\]`,"g");e=e.replace(t,String(n))}return e}(s,r)},fr=(e,t)=>{const r=null!=t?t:dr;let n=e;const i=e.namespace;return tr.forEach((t=>{if("title"===t||"description"===t){const o=r(`${i}.${t}`,e[t]);n=Object.assign(Object.assign({},n),{[t]:o})}if("data_panel"===t){const o=`${i}.${t}`,s=[];e.dataPanelConfig().forEach((e=>{e.subSection&&(e.subSection=hr(e,r,o)),mr(e).forEach((t=>{const n=r(`${o}.${t.key}`,t.defaultValue);e[t.property]=n})),s.push(e)})),n=Object.assign(Object.assign({},n),{dataPanelConfig:()=>s})}if("format_panel"===t){const o=`${i}.${t}`,s=[];e.formatPanelConfig().forEach((e=>{e.subSection&&(e.subSection=hr(e,r,o)),function(e,t,r){function n(r,n){r&&mr(r).forEach((i=>{const o=e(`${t}.${n}.${i.key}`,i.defaultValue);r[i.property]=o}))}function i(e,t,r){t.forEach((t=>{const i=e[t];i&&n(i,r)}))}r.x&&(i(r.x,pr,"axis_labels"),n(r.x,"axis_labels")),r.y&&(i(r.y,pr,"axis_labels"),n(r.y,"axis_labels")),function(e){return"prefix"in e}(r)&&i(r,pr,"stats_labels")}(r,o,e),mr(e).forEach((t=>{const n=r(`${o}.${t.key}`,t.defaultValue);e[t.property]=n})),s.push(e)})),n=Object.assign(Object.assign({},n),{formatPanelConfig:()=>s})}})),n},pr=["count","axisTitle","format","postfix","prefix"];function hr(e,t,r){var n;return null===(n=e.subSection)||void 0===n?void 0:n.map((n=>(mr(n).forEach((i=>{const o=t(`${r}.${e.namespace}.${i.key}`,i.defaultValue);n[i.property]=o})),n)))}function mr(e){const t=e.namespace||e.type;if(!t)return[];const r=[];return rr.forEach((n=>{if(e[n]){let i=n;"callToAction"===n&&(i=nr),r.push({key:`${t}.${i}`,defaultValue:e[n],property:n})}})),r}const gr={queryEngineConfig:{supportedFeatures:[],supportedAggregates:{},supportedTimeTruncFunctions:{},supportedOperators:{},supportedTransformationFunctions:{}}},br=function(e,t){if("custom"==e)return Ht;if("barChart"==e)return fr(lt(t||gr),null==t?void 0:t.textOverride);if("areaChart"==e)return fr(Bt(t||gr),null==t?void 0:t.textOverride);if("lineChart"==e)return fr(ft(t||gr),null==t?void 0:t.textOverride);if("pieChart"==e)return fr(mt(t||gr),null==t?void 0:t.textOverride);if("scatterChart"==e)return fr(vt(t||gr),null==t?void 0:t.textOverride);if("comboChart"==e)return fr(xt(t||gr),null==t?void 0:t.textOverride);if("dataTable"==e)return fr(Ct(t||gr),null==t?void 0:t.textOverride);if("basicTable"==e)return fr(Pt(t||gr),null==t?void 0:t.textOverride);if("singleStat"==e)return fr(Vt(t||gr),null==t?void 0:t.textOverride);if("progress"==e)return fr(er(t||gr),null==t?void 0:t.textOverride);if("mercatorMap"==e)return fr(Kt(t||gr),null==t?void 0:t.textOverride);if("horizontalBarChart"==e)return fr(Mt(t||gr),null==t?void 0:t.textOverride);throw`Cannot get interface for ${e}. Please implement it.`},yr=(["barChart","horizontalBarChart","areaChart","lineChart","scatterChart","pieChart","singleStat","dataTable","basicTable","comboChart","mercatorMap","progress","custom"].filter((e=>"custom"!=e)),"dateFilter"),vr="dateAndTimeFilter",_r="singleSelectFilter",wr="multiSelectFilter",Ar="numericFilter",xr=e=>"fields"in e?(e=>{if("globalSelectFilter"==e.type)return{type:"singleSelectFilter",title:e.title,value:null,requiresValue:!1,managedByConfiguration:!1,appliesToFields:e.fields.map((e=>({fieldId:e.field,dataSetId:e.dataSetId})))};if("globalDateTimeFilter"==e.type)return{type:"dateFilter",value:null,requiresValue:!1,managedByConfiguration:!1,title:e.title,appliesToFields:e.fields.map((e=>({fieldId:e.field,dataSetId:e.dataSetId})))};throw`Unrecognised global filter. ${JSON.stringify(e)}`})(e):Object.assign(Object.assign({},e),{type:Sr(e.type)}),Sr=e=>"dateTimeFilter"===e?yr:e,Or=B().object({fieldId:B().string().required(),dataSetId:B().string().required()}),Er=e=>B().object().pattern(B().string(),B().array().items(W(e)).optional()),jr=e=>({title:B().string().allow(""),managedByConfiguration:B().boolean().optional(),requiresValue:B().boolean().optional(),optionsFilters:Er(e).optional(),appliesToFields:B().array().items(Or).required(),optionsPulledFrom:B().array().items(Or).optional(),hidden:B().boolean(),options:B().array().items(B().object({value:B().allow(B().number(),B().string()),label:B().string()})).optional()}),Tr=(e,t)=>B().object(Object.assign(Object.assign({},jr(e)),{type:B().valid(_r).required(),value:B().alternatives(B().string(),B().number(),B().boolean(),B().valid(...t?[]:[null]))})),Cr=(e,t)=>B().object(Object.assign(Object.assign({},jr(e)),{type:B().valid(wr).required(),value:B().alternatives(B().array().items(B().string(),B().number()).single(),B().valid(...t?[]:[null]))})),Rr=(e,t,r)=>B().object(Object.assign(Object.assign({},jr(e)),{type:B().valid(r).required(),value:B().alternatives(B().valid(...t?[]:[null]),B().object({type:B().valid("fixedRange"),before:B().alternatives(B().date()).required(),after:B().alternatives(B().date()).required()}),B().object({type:B().valid("relative"),value:B().string()}))})),Ir=(e,t)=>B().object(Object.assign(Object.assign({},jr(e)),{type:B().valid(Ar).required(),value:B().alternatives(B().object({op:B().allow("=","<",">","<=",">="),value:B().number().allow(null,0)}),B().valid(...t?[]:[null]))})),Dr=(e,t)=>B().alternatives().conditional(".type",{is:_r,then:Tr(e,t)}).conditional(".type",{is:yr,then:Rr(e,t,yr)}).conditional(".type",{is:vr,then:Rr(e,t,vr)}).conditional(".type",{is:wr,then:Cr(e,t)}).conditional(".type",{is:Ar,then:Ir(e,t)});function Fr(e){return B().array().items(B().custom(((t,r)=>{if(!e)return r.error("any.invalid");const n=Dr(e,!!t.requiresValue),{error:i}=n.validate(t);return i?r.error("any.invalid",{message:i.message}):t}))).required()}r(8143);const Pr=350,kr={colors:["#feae4a","#5fbaff","#e15e9d"],detail:"minimal",fontFamily:"Inter, sans-serif",rowLimit:6,fontSize:"0.65rem"},Nr=e=>"displayTitle"in e,Mr=e=>({colSpan:e,isEmpty:!0}),Lr=e=>"isEmpty"in e,$r=e=>{const r=[...e],n=(0,t.sumBy)(r,(e=>e.colSpan));return 12==n||(r[r.length-1].colSpan+=12-n),r},qr=e=>!(e&&Lr(e)&&e.colSpan<=0),Br=(e,r)=>e.map((e=>((e,r)=>{const n=(e=>"components"in e?e:{components:e,height:Pr})(e),i=n.components.filter(qr).map((e=>e&&e.colSpan<=0?Object.assign(Object.assign({},e),{colSpan:1}):e)),o=(0,t.sumBy)(i,(e=>null==e?1:0)),s=12-(0,t.sumBy)(i,(e=>null==e?0:e.colSpan)),a=Math.floor(s/o),l=[...i].map((e=>null===e?{isEmpty:!0,colSpan:a}:Lr(e)||Nr(e)?e:Gr(Object.assign(Object.assign({},e),{colSpan:e.colSpan}),r)));return{components:$r(l),height:n.height||Pr}})(e,r))),Gr=(e,r)=>{if("isEmpty"in e||Nr(e))return e;const{load:n}=br(e.attributes.type,r),i=n(e.attributes);let o=[];return(0,t.isArray)(e.localFilters)&&(o=[...e.localFilters?e.localFilters:[]].map((e=>xr(e)))),"addOns"in e.attributes&&(0,t.isEmpty)(o)&&e.attributes.addOns.forEach((e=>{o=[...o,{type:"dateFilter"==e.type?"dateFilter":"singleSelectFilter",value:null,requiresValue:!1,managedByConfiguration:!1,appliesToFields:[{fieldId:e.field,dataSetId:i.dataSetId}]}]})),delete e.addOns,delete i.addOns,Object.assign(Object.assign({},e),{localFilters:o,attributes:i,results:[]})},zr=e=>B().alternatives().conditional(".type",{is:"barChart",then:lt(e).schema}).conditional(".type",{is:"mercatorMap",then:Kt(e).schema}).conditional(".type",{is:"horizontalBarChart",then:Mt(e).schema}).conditional(".type",{is:"lineChart",then:ft(e).schema}).conditional(".type",{is:"comboChart",then:xt(e).schema}).conditional(".type",{is:"areaChart",then:Bt(e).schema}).conditional(".type",{is:"pieChart",then:mt(e).schema}).conditional(".type",{is:"scatterChart",then:vt(e).schema}).conditional(".type",{is:"singleStat",then:Vt(e).schema}).conditional(".type",{is:"dataTable",then:Ct(e).schema}).conditional(".type",{is:"basicTable",then:Pt(e).schema}).conditional(".type",{is:"progress",then:er(e).schema}),Ur=B().object({displayTitle:B().string().min(1).required(),colSpan:B().number().valid(12).required()}),Vr=B().number().min(1).max(12).required().messages({"number.base":'"colSpan" must be a number',"number.min":'"colSpan" must be at least {#limit}',"number.max":'"colSpan" must be less than or equal to {#limit}',"any.required":'"colSpan" is a required field'}),Hr=B().object({isEmpty:B().valid(!0).required(),colSpan:Vr}),Xr=e=>B().object({attributes:zr({queryEngineConfig:e}),colSpan:Vr}),Wr=e=>B().object({id:B().string(),display:Yr(e),componentLibrary:B().array().required().items(B().object({attributes:zr({queryEngineConfig:e})})),globalFilters:Fr(e),customFields:B().object().required()});function Yr(e){return B().array().required().items(B().object({height:B().number().required(),components:B().array().required().min(1).items(B().alternatives(Hr,Xr(e),Ur))}))}const Kr=(e,t)=>{const r=t?{queryEngineConfig:t}:void 0;if("string"==typeof e.definition)throw new Error("Dashboard is an encrypted string, use the query engine to fetch the dashboard. Please use the queryEngineConfig prop to pass the query engine configuration.");return{id:e.id,parentDashboardId:e.parent_dashboard_id,isPlayground:!1,permission:e.permission,globalFilters:[...e.definition.globalFilters||[]].map((e=>xr(e))),componentLibrary:[...e.definition.componentLibrary||[]].map((e=>Gr(Object.assign(Object.assign({},e),{colSpan:(null==e?void 0:e.colSpan)||1}),r))),theme:Object.assign(Object.assign({},kr),e.theme),display:Br(e.definition.display,r),webhookId:e.webhook_id||null,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),metadata:e.metadata||{}}},Qr=(e,t,r)=>Object.assign(Object.assign({},e),{dataSets:ke(t,r)}),Zr=(e,t)=>{const r=new Map;return e.forEach((e=>{const t=e.attributes.viewId;r.set(null!=t?t:"",e)})),t.forEach((e=>{const t=e.attributes.viewId;r.has(null!=t?t:"")||r.set(null!=t?t:"",e)})),Array.from(r.values())},Jr=e=>{var t,r;return{views:[...null!==(t=e.views)&&void 0!==t?t:[]].map((e=>Object.assign(Object.assign({},e),{results:[]}))),customFields:null!==(r=e.customFields)&&void 0!==r?r:{}}};class en extends Error{constructor(e){super(e),this.name="FailedToLoadQueryEngineConfig"}}const tn=en;class rn extends Error{constructor(e){super(`The queryEngineEndpoint value '${e}' is not valid.`),this.name="InvalidQueryEngineEndpoint",this.invalidEndpoint=e}}const nn=rn;class on extends Error{constructor(){super("The queryEngineEndpoint value is not of the correct type. It must be a string or a function."),this.name="InvalidQueryEngineEndpointType"}}const sn=on;var an=r(3493),ln=r.n(an);const un=e=>e.startsWith("/")?un(e.slice(1)):e.endsWith("/")?un(e.slice(0,-1)):e;var cn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};const dn=(e,t)=>cn(void 0,void 0,void 0,(function*(){if(e.dashboardAccessToken)return S("Using dashboard access token for auth header"),{auth:`Bearer ${e.dashboardAccessToken}`};if(e.projectAccessToken)return S("Using project access token for auth header"),{auth:`Bearer ${e.projectAccessToken}`};if(e.apiKey)return S("Using API Key for auth header"),{auth:`Api-Key ${e.apiKey}`};if(t.preFetchProjectAccessTokens&&(e.useCookieAuth||e.appSessionAuthToken)){S("Fetching project access token from the Vizzly API",t.preFetchProjectAccessTokens.projectId,"Filtering by",t.preFetchProjectAccessTokens.resourceFilters);const r=yield(e=>(t,r,n)=>{return i=void 0,o=void 0,a=function*(){let i={};r&&(i.auth=`Bearer ${r}`);let o="";n&&(o=`filter=${n.join(",")}`);const{status:s,body:a}=yield e({path:`/api/v2/auth/project/${t}/access_token?${o}`,method:"get",headers:i});if(200==s)return a.token.token},new((s=void 0)||(s=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function n(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(r,n)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a})(fn(e))(t.preFetchProjectAccessTokens.projectId,e.appSessionAuthToken,t.preFetchProjectAccessTokens.resourceFilters);if(r)return S("Project access token received."),{auth:`Bearer ${r}`};S("Failed to receive project access token.")}else S("Not pre-fetching project access token.");return{}})),fn=e=>t=>cn(void 0,void 0,void 0,(function*(){var r;try{const r=yield dn(e,t),n=t.headers||{},i=((e,t)=>{const r=un(e),n=un(t),i=(o=e).startsWith("https://")||o.startsWith("http://")||o.startsWith(".")?"":"/";var o;return""==r&&""==n?"/":""==n?`${i}${r}`:""!=r&&""!=n?`${i}${r}/${n}`:`${i}${n}`})(e.host,t.path),o=yield ln()(i,{method:t.method,headers:Object.assign(Object.assign({"Content-Type":"application/json",Accept:"application/json"},r),n),redirect:"follow",referrerPolicy:"no-referrer",body:t.body?JSON.stringify(t.body):null,signal:t.abortSignal,mode:t.mode||void 0});let s=yield o.json();return S("HTTP Client Response",{host:e.host,path:t.path,status:o.status,responseId:o.headers.get("X-Request-Id")}),{body:s,status:o.status,headers:o.headers}}catch(e){if(null===(r=t.abortSignal)||void 0===r?void 0:r.aborted)return console.log("Aborted a request."),{status:500,body:{reason:"Aborted"},headers:null};throw e}})),pn=e=>"string"==typeof e?e:e.endpoint;const hn=e=>"string"==typeof e?{}:e.customHeaders?e.customHeaders():{},mn=e=>t=>{return r=void 0,n=void 0,o=function*(){const r={host:pn(e)},n=Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({},t.headers),hn(e))});return fn(r)(n)},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(s,a)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const gn=e=>{return t=void 0,r=void 0,i=function*(){const t=mn(e),r=yield t({method:"post",mode:"cors",path:"/api/v1/support",body:{}});return 200==r.status?"supportedFeatures"in(n=r.body)?n:Object.assign(Object.assign({},n),{supportedFeatures:["subquery"]}):null;var n},new((n=void 0)||(n=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i},bn={origin:"in-browser",supportedFeatures:["simpleMaths","aggregateMaths","subquery","encryptedDashboards","switchField","roundedNumbers","encryptedDashboards"],supportedTimeTruncFunctions:a(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:v(["sum","mean","min","max","count","countDistinct","median"]),supportedOperators:d([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:R(["round_to_0_dp","round_to_2_dp"])};const yn=e=>{let t="string"==typeof e?e:e.endpoint;return!!t.startsWith("http://")||!!t.startsWith("https://")||!!t.startsWith("/")};class vn extends Error{constructor(e){super(e),this.name="FailedToLoadIdentity"}}const _n=vn;class wn extends Error{constructor(e){super(e),this.name="InvalidIdentityReturn"}}const An=wn,xn=e=>{const t=(e=>{var t;const r=null===(t=e.split("."))||void 0===t?void 0:t[1];return JSON.parse((n=r,"object"==typeof window&&window&&window.atob?window.atob(n):Buffer.from(n,"base64").toString()).toString());var n})(e);return Object.assign(Object.assign({},t),{signature:e})};const Sn=e=>{return t=void 0,r=void 0,i=function*(){let t=yield e();if(t=(e=>{if(!e)throw new An("Failed to load identity.");const{error:t}=B().object({dashboardAccessToken:B().string().required(),dataAccessToken:B().string(),queryEngineAccessToken:B().string(),projectAccessToken:B().string().optional()}).validate(e);if(t)throw new An(t.message);return e})(t),!t)throw new _n("Failed to fetch identity config.");const r=On()&&((n=window.location.href).split("#vizzly_")[1]||new URLSearchParams(new URL(n).search).get("_vizzlyDashboardAdmin"))||null;var n;return{identityConfig:((e,t,r,n)=>{let i=xn(e);"scope"in i||(i.scope="read_write");const o={dashboardAccess:i,dataAccess:t?xn(t):void 0,queryEngineAccessConfig:r?xn(r):void 0,dashboardAdminOverride:n?xn(n):void 0};return(e=>{const t=new Date,r=new Date(e.dashboardAccess.expires),n=!!e.dataAccess&&new Date(e.dataAccess.expires);!1!==n&&n<t&&console.warn("Vizzly data access token expired at;",n),r<t&&console.warn("Vizzly dashboard access token expired at;",r)})(o),o})(t.dashboardAccessToken,t.dataAccessToken,t.queryEngineAccessToken,r),tokens:t}},new((n=void 0)||(n=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i},On=()=>"undefined"!=typeof window,En=[{namespace:"config.supported_operator",constants:l},{namespace:"config.supported_aggregate",constants:b},{namespace:"config.supported_time",constants:o}],jn=(e,t,r)=>{const n={};return Object.entries(e).forEach((([e,i])=>{n[e]=Object.assign(Object.assign({},i),{publicName:t(`${r}.${e}`,i.publicName)})})),n};class Tn extends Error{constructor(){super("Identity prop type is invalid."),this.name="InvalidIdentityPropType"}}const Cn=Tn;class Rn extends Error{constructor(e){super(e),this.name="FailedToResolveDataSets"}}const In=Rn;class Dn extends Error{constructor(){super("dataSets property is not valid"),this.name="InvalidDataSetsPropType"}}const Fn=Dn;var Pn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};B().function();const kn=e=>t=>Pn(void 0,void 0,void 0,(function*(){var r,n,i,o,s,a,l;return yield(n=e,i=null===(r=t.dataAccess)||void 0===r?void 0:r.signature,o=void 0,s=void 0,a=void 0,l=function*(){const e=mn(n),t=yield e({method:"post",body:{dynamicConfig:"object"==typeof n?n.dynamicConfig:void 0,integritySignature:i},mode:"cors",path:"/api/v1/resolve-data-sets",abortSignal:void 0});if(200==t.status)return t.body.dataSets;throw new In(`Failed to resolve data sets from ${JSON.stringify(n)}. Received status ${t.status}`)},new(a||(a=Promise))((function(e,t){function r(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}i((l=l.apply(o,s||[])).next())})))})),Nn=(t,r)=>(n,i)=>Pn(void 0,void 0,void 0,(function*(){try{let e=((e,t)=>{if(e)return e;if("function"==typeof t){if(!e)throw"dataSets function is required when loading a custom query engine config.";return e}if(t)return kn(t);throw new Fn})(t,r);if("function"!=typeof e)throw new Fn;let o=yield e(n,i);if(!o)throw new In("Failed to fetch data sets from the query engine endpoint");return o.map((e=>((e,t)=>Object.assign(Object.assign({},e),{fields:[...e.fields].map((e=>((e,t,r)=>{const n=E(e.id);return{id:e.id,dataType:e.dataType,publicName:e.publicName||n,dashboardRequiredFilterGroups:e.dashboardRequiredFilterGroups||[],description:e.description||void 0,canBeDimension:void 0===e.canBeDimension||e.canBeDimension,canBeMeasure:void 0===e.canBeMeasure||e.canBeMeasure,allowedOperators:void 0===e.allowedOperators?u(e,t):e.allowedOperators,allowedGranularities:void 0===e.allowedGranularities?Object.keys(t.supportedTimeTruncFunctions):e.allowedGranularities,supportedAggregateOptions:I(t,e.dataType,e.supportedAggregateOptions)}})(e,t)))}))(e,i)))}catch(t){if(O(t),t instanceof Fn)throw t;if(t instanceof e.Errors.FailedToResolveDataSets)throw new In(t.message);throw new In("Failed to fetch data sets.")}}));var Mn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};const Ln={apiHost:"https://api.vizzly.co"},$n="in-browser";class qn{constructor(e,t,r,n=Ln){this.queryEngineConfig=void 0,this.dataSets=void 0,this.queryEngine=e||$n,this.loadAccessTokens=t,this.loadDataSetsCallback=r,this.options=Object.assign(Object.assign({},Ln),n)}getQueryEngineConfig(){return Mn(this,void 0,void 0,(function*(){return this.queryEngineConfig||(this.queryEngineConfig=yield(e=this.queryEngine,t=this.loadDataSetsCallback,r=void 0,n=void 0,o=function*(){try{if("in-browser"===e)return bn;if("function"==typeof e){let t=yield e();if(!t)throw new tn("Failed to load query engine config.");return Object.assign({},t)}if(t){if(!yn(e))throw new nn(e);return bn}if("string"==typeof e||"object"==typeof e&&"endpoint"in e){if(!yn(e))throw new nn(e);const t=yield gn(e);if(!t)throw new tn("Failed to load query engine config.");return t}throw new sn}catch(e){if(O(e),e instanceof nn)throw e;if(e instanceof sn)throw e;throw new tn("Failed to load query engine config.")}},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(s,a)}l((o=o.apply(r,n||[])).next())}))),this.queryEngineConfig=((e,t)=>{const r=Object.assign({},e);return r.supportedAggregates&&(r.supportedAggregates=jn(r.supportedAggregates,t,En[1].namespace)),r.supportedTimeTruncFunctions&&(r.supportedTimeTruncFunctions=jn(r.supportedTimeTruncFunctions,t,En[2].namespace)),r.supportedOperators&&(r.supportedOperators=jn(r.supportedOperators,t,En[0].namespace)),r})(this.queryEngineConfig,((e,t,r)=>dr(e,t,r,this.options.textOverrides,this.options.developerMode)))),this.queryEngineConfig;var e,t,r,n,i,o}))}getIdentity(){return Mn(this,void 0,void 0,(function*(){if("function"!=typeof this.loadAccessTokens)throw new Cn;const{tokens:e,identityConfig:t}=yield Sn(this.loadAccessTokens);return{accessTokens:e,identityConfig:t}}))}getDataSets(){return Mn(this,void 0,void 0,(function*(){const{identityConfig:e}=yield this.getIdentity(),t=yield this.getQueryEngineConfig(),r=Nn(this.loadDataSetsCallback,this.queryEngine);return this.dataSets=yield r(e,t),this.dataSets}))}load(){return Mn(this,void 0,void 0,(function*(){const[{identityConfig:e},t,r]=yield Promise.all([this.getIdentity(),this.getQueryEngineConfig(),this.getDataSets()]);return{queryEngineConfig:t,dataSets:r,identityConfig:e,dashboardStorageStrategy:this.getDashboardStorageStrategy(t)}}))}getDashboardStorageStrategy(e){return"function"==typeof this.queryEngine?{strategy:"vizzlyApi"}:e.supportedFeatures.includes("encryptedDashboards")&&this.queryEngine!==$n?{strategy:"queryEngine",endpoint:this.queryEngine}:{strategy:"vizzlyApi"}}}class Bn{constructor(e,t){this.components=[],this.height=Pr,this.components=null!=e?e:[],this.height=null!=t?t:Pr,this.validateTotalColSpan()}addCell(e,t){void 0===t?this.components.push(e):this.components.splice(t,0,e),this.validateTotalColSpan()}setHeight(e){this.height=e}setRow(e){this.components=e,this.validateTotalColSpan()}set(e,t){this.components=e,this.height=null!=t?t:Pr,this.validateTotalColSpan()}validateTotalColSpan(){if(this.components.reduce(((e,t)=>e+t.colSpan),0)>12)throw new Error("Total column span of cells exceeds the allowed limit of 12.")}}function Gn(e,t){if(!t)throw new Error("Query engine config is required to validate filters");const r=((e,t)=>{const r=[];return e.forEach((e=>{const n=Dr(t,!!e.requiresValue),{error:i,value:o}=n.validate(e);if(i)throw O(`Invalid global filter configuration: ${i.message}`),i;r.push(o)})),r})(e,t);return r}class zn extends Error{}class Un extends he{constructor(e,t){super(`'Issue with Services in ${t}: '${e}'`),this.name="ServicesValidation"}}class Vn{constructor(e){var t,r;if(this.component=void 0,this.localFilters=void 0,this.isEmpty=void 0,null==e?void 0:e.component)this.component=null==e?void 0:e.component,this.colSpan=null!==(t=null==e?void 0:e.colSpan)&&void 0!==t?t:12;else{const t=Mr(null!==(r=null==e?void 0:e.colSpan)&&void 0!==r?r:12);this.colSpan=t.colSpan,this.isEmpty=t.isEmpty}(null==e?void 0:e.localFilters)&&(this.localFilters=Gn(e.localFilters,oi.use().getViewConfiguration().queryEngineConfig))}set(e){var t;this.component=e.component,this.colSpan=null!==(t=e.colSpan)&&void 0!==t?t:12,this.isEmpty=!e.component||void 0,(null==e?void 0:e.localFilters)&&(this.localFilters=Gn(e.localFilters,oi.use().getViewConfiguration().queryEngineConfig))}setColSpan(e){try{!function(e){const{error:t,value:r}=Vr.validate(e);if(t)throw new zn(t.message)}(e),this.colSpan=e}catch(e){throw new Un(e,"Cell.setColSpan")}}setComponent(e){this.component=e,this.isEmpty=void 0}emptyCell(e){const t=Mr(null!=e?e:12);this.colSpan=t.colSpan,this.isEmpty=t.isEmpty,this.component=void 0}}class Hn{constructor(e){this.component=void 0;let t={displayTitle:"New Header",colSpan:12};e&&(t=Object.assign(Object.assign({},t),{displayTitle:e}));const r={components:[t],height:null!=52?52:Pr};this.component=[r]}setTitle(e){if(!this.component)throw new Error("Header is undefined");Nr(this.component[0].components[0])&&(this.component[0].components[0].displayTitle=e)}}function Xn(e){let t=[];return e.forEach((e=>{var r,n;if(e instanceof Bn){const n=null==e?void 0:e.components.map((e=>{var t;return e.component&&!e.isEmpty?{attributes:e.component.attributes,localFilters:null!==(t=e.localFilters)&&void 0!==t?t:[],updatesFromParameters:{},results:[],colSpan:e.colSpan,reports:[]}:(e.isEmpty,{colSpan:e.colSpan,isEmpty:!0})}));t.push({height:null!==(r=e.height)&&void 0!==r?r:Pr,components:n})}e instanceof Hn&&(null===(n=e.component)||void 0===n||n.forEach((e=>{t.push({height:e.height,components:e.components})})))})),t}const Wn=e=>{var t;let r=[],n=new Set;return null===(t=null==e?void 0:e.library)||void 0===t||t.forEach((e=>{var t;if(e.component&&e.component.attributes){const{viewId:i}=e.component.attributes;if(n.has(null!=i?i:""))throw new Error(`Duplicate viewId found: ${i}`);n.add(null!=i?i:""),r.push({attributes:e.component.attributes,localFilters:null!==(t=e.localFilters)&&void 0!==t?t:[],updatesFromParameters:{},results:[],colSpan:1,reports:[]})}})),r};function Yn(e){const t=B().object({component:B().object().required(),uniqueViewId:B().string().min(1).required().messages({"string.base":"\"uniqueViewId\" should be a type of 'text'","string.empty":'"uniqueViewId" cannot be an empty field',"string.min":'"uniqueViewId" should have a minimum length of {#limit}',"any.required":'"uniqueViewId" maybe undefined or null'})}),{error:r}=t.validate(e);if(r)throw new zn(r.message)}const Kn=(e,t)=>Object.assign(Object.assign({},e),{attributes:Object.assign(Object.assign({},e.attributes),{viewId:t})});class Qn{constructor(e){this.vizzly=oi.use();const{init:t}=br(e.type,{queryEngineConfig:this.vizzly.getViewConfiguration().queryEngineConfig});this.attributes=t(null==e?void 0:e.dataSetId,e)}updateAttributes(e){const{setAttributes:t}=br(this.attributes.type,{queryEngineConfig:this.vizzly.getViewConfiguration().queryEngineConfig});if(!this.attributes)throw new Error("Attributes have not been initialized yet");this.attributes=t(this.attributes,e)}}class Zn extends Error{constructor(e){super(`Vizzly has not yet been loaded. Please see the instantiation docs;\nhttps://docs.vizzly.co/services/initializing\n\nThis might be expected behavior if you have set it up correctly. If so, you will need\nto handle this error and retry once Vizzly has finished loading.\n\n${e!=oi.DEFAULT_INSTANCE_ID&&`Instance Id; ${e}`}`),this.name="VizzlyInstanceNotLoaded"}}class Jn extends Error{constructor(e,t){super(`Timeout waiting for Vizzly to load. Please see the instantiation docs;\nhttps://docs.vizzly.co/services/initializing\n\nThis might be expected behavior if you have set it up correctly. If so, you will need\nto bump the timeout which was set to ${t}ms.\n\n${e!=oi.DEFAULT_INSTANCE_ID&&`Instance Id; ${e}`}`),this.name="TimeoutWaitingForVizzlyInstance"}}const ei={convert:!1,stripUnknown:!1,allowUnknown:!0};var ti=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};const ri="default",ni=Object.assign({},{apiHost:"https://api.vizzly.co"});class ii{constructor(t,r,n,i,o,s){this.programmaticDashboard=o,this.dataSets=n,this.queryEngineConfig=r,this.identityConfig=t,this.vizzlyAPIClient=((t,r,n)=>{var i,o,s;const a=new e.Authentication({dashboardAccessToken:null==t?void 0:t.dashboardAccess.signature,dataAccessToken:null===(i=null==t?void 0:t.dataAccess)||void 0===i?void 0:i.signature,projectAdminOverrideToken:null===(o=null==t?void 0:t.dashboardAdminOverride)||void 0===o?void 0:o.signature,queryEngineAccessToken:null===(s=null==t?void 0:t.queryEngineAccessConfig)||void 0===s?void 0:s.signature});let l=()=>({});"queryEngine"===r.strategy&&"string"!=typeof r.endpoint&&(l=r.endpoint.customHeaders||l);const u="queryEngine"===r.strategy?new e.VizzlyQueryEngineApi(a,"string"==typeof r.endpoint?r.endpoint:r.endpoint.endpoint,l):void 0,c=new e.VizzlyApi(a,n.host),d=new e.VizzlyAppApi(a,"https://app.vizzly.co");return new e.Vizzly({vizzlyApi:c,vizzlyAppApi:d,vizzlyQueryEngineApi:u},"queryEngine"===r.strategy?new e.PersistViaQueryEngine:new e.PersistDirectToVizzlyApi)})(t,i,s)}static load(e,t=ni){return ti(this,void 0,void 0,(function*(){S("Starting load process for the services package.");const{queryEngine:r,dataSets:n,identity:i,programmaticDashboard:o}=e,s=new qn(r,i,n,t),{queryEngineConfig:a,dataSets:l,identityConfig:u,dashboardStorageStrategy:c}=yield s.load(),d=new oi(u,a,l,c,o,{host:t.apiHost});return oi._instanceStore[ri]=d,S("Loaded services package and added it to the instance store."),d}))}static use(e=ri){const t=oi._instanceStore[e];if(!t)throw new Zn(e);return t}static waitToUse(e=ri,t=1e4){return ti(this,void 0,void 0,(function*(){const r=ii._instanceStore,n=e;return new Promise(((i,o)=>{if(r.hasOwnProperty(n))return void i(r[n]);const s=setTimeout((()=>{clearTimeout(s),o(new Jn(e,t))}),t),a=setInterval((()=>{r.hasOwnProperty(n)&&(clearTimeout(s),clearInterval(a),i(r[n]))}),10)}))}))}static clearInstances(){oi._instanceStore={}}createDashboard(e){var t;return ti(this,void 0,void 0,(function*(){((e,t)=>{const r=B().object({definition:t?Wr(t):B().object().required(),parentDashboardId:B().string().required(),metadata:B().object()}).validate(e,ei);if(r.error)throw new zn(r.error.message)})(e,this.queryEngineConfig);const r=this.vizzlyAPIClient.getDashboardManager(),{dashboard:n}=yield r.create({metadata:e.metadata||e.meta,definition:e.definition,parentDashboardId:e.parentDashboardId,permissions:[{scope:"read_write"}]}),i=Kr(n,this.queryEngineConfig);return Qr(i,this.dataSets,(null===(t=n.definition)||void 0===t?void 0:t.customFields)||{})}))}updateDashboard(e){var t;return ti(this,void 0,void 0,(function*(){((e,t)=>{const r=B().object({dashboardId:B().string().required(),definition:t?Wr(t):B().object().required(),metadata:B().object().optional(),deleted:B().boolean().optional()}).validate(e,ei);if(r.error)throw new zn(r.error.message)})(e,this.queryEngineConfig);const r=this.vizzlyAPIClient.getDashboardManager(),n=yield r.update({dashboardId:e.dashboardId,metadata:e.metadata||e.meta,definition:e.definition,deleted:e.deleted,abortSignal:e.abortSignal}),i=Kr(n,this.queryEngineConfig);return Qr(i,this.dataSets,(null===(t=n.definition)||void 0===t?void 0:t.customFields)||{})}))}getDashboards(e){return ti(this,void 0,void 0,(function*(){const t=this.vizzlyAPIClient.getDashboardManager(),r=(yield t.getDashboards((null==e?void 0:e.abortController)?{abortSignal:null==e?void 0:e.abortController.signal}:{})).flatMap((e=>ii.upcastDashboard(e,this.dataSets,this.queryEngineConfig)));return this.programmaticDashboard?function(e,t){const r=new Map(t.map((e=>[e.id,e])));return e.map((e=>{const t=r.get(e.id);if(null!==e.parentDashboardId){const t=r.get(e.parentDashboardId);if((null==t?void 0:t.id)===e.parentDashboardId)return Object.assign(Object.assign({},e),{componentLibrary:Zr(null==t?void 0:t.componentLibrary,e.componentLibrary)})}return null!=t?t:e}))}(r,((e,t)=>{let r=[];return e.map((e=>{var n;if(void 0===e.id)throw new Error("Dashboard id is undefined");const i=Qr(e,t,e.customFields||{});r.push({id:i.id,dataSets:i.dataSets,display:null!==(n=i.display)&&void 0!==n?n:[],globalFilters:[],componentLibrary:i.componentLibrary||[],parentDashboardId:null,metadata:{},theme:{},webhookId:"",isPlayground:!1,createdAt:new Date,updatedAt:new Date,isProgrammatic:!0})})),r})(yield this.programmaticDashboard(this.dataSets),this.dataSets)):r}))}getGlobalLibraries(e){return ti(this,void 0,void 0,(function*(){const t=(yield this.vizzlyAPIClient).getGlobalLibraryManager();return(yield t.getGlobalLibraries((null==e?void 0:e.abortController)?{abortSignal:null==e?void 0:e.abortController.signal}:{})).global_libraries.map((e=>{return{id:(t=e).id,name:t.name,library:Jr(t.library),createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),parentGlobalLibraryId:t.parent_global_library_id};var t}))}))}getViewConfiguration(){return{queryEngineConfig:this.queryEngineConfig}}getIdentityConfig(){return this.identityConfig}static upcastDashboard(e,t,r){var n;try{const i=Kr(e,r);return[Qr(i,t,(null===(n=e.definition)||void 0===n?void 0:n.customFields)||{})]}catch(t){return O(`Failed to upcast dashboard ${e.id}. This dashboard will not be available for use.`,t),[]}}static filterDashboards(e,r){let n=(0,t.cloneDeep)(e);return r.onlyParentDashboards&&(n=n.filter((e=>null===e.parentDashboardId))),r.onlyChildDashboards&&(n=n.filter((e=>null!==e.parentDashboardId))),r.onlyChildDashboardsForParent&&(n=n.filter((e=>e.parentDashboardId===r.onlyChildDashboardsForParent))),r.onlyAllowScope&&(n=n.filter((e=>{var t;return(null===(t=e.permission)||void 0===t?void 0:t.scope)===r.onlyAllowScope}))),r.onlyDashboardsIncludingMetadata&&(n=n.filter((e=>{const n=Object.keys(r.onlyDashboardsIncludingMetadata||{});return(0,t.every)(n,(t=>{var n;return e.metadata[t]===(null===(n=null==r?void 0:r.onlyDashboardsIncludingMetadata)||void 0===n?void 0:n[t])}))}))),n}static validateDashboard(e){B()}}ii._instanceStore={},ii.DEFAULT_INSTANCE_ID=ri,ii.Row=Bn,ii.Cell=Vn,ii.Dashboard=class{constructor(e,t){this.dashboard=void 0;let r={id:e};(null==t?void 0:t.display)&&(r=Object.assign(Object.assign({},r),{display:Xn(null==t?void 0:t.display)})),(null==t?void 0:t.customFields)&&(r=Object.assign(Object.assign({},r),{customFields:t.customFields})),(null==t?void 0:t.library)&&(r=Object.assign(Object.assign({},r),{componentLibrary:Wn(null==t?void 0:t.library)})),this.dashboard=(e=>Object.assign({isPlayground:!1,display:[{components:[Mr(8),Mr(4)],height:Pr},{components:[Mr(4),Mr(4),Mr(4)],height:Pr}],componentLibrary:[],globalFilters:[],customFields:{}},e))(r)}setDisplay(e){let t=Xn(e);if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.display=t}setCustomFields(e){if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.customFields=e}setLibrary(e){if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.componentLibrary=Wn(e)}build(){var e,t;if(!this.dashboard)throw new Error("Dashboard is undefined");return Object.assign(Object.assign({},this.dashboard),{display:null===(e=this.dashboard)||void 0===e?void 0:e.display,componentLibrary:null===(t=this.dashboard)||void 0===t?void 0:t.componentLibrary})}},ii.Header=Hn,ii.Library=class{constructor(e){this.library=void 0,this.library=[],(null==e?void 0:e.components)&&this.addComponents(null==e?void 0:e.components)}addComponent(e,t,r){var n,i;try{Yn({component:e,uniqueViewId:t});const o=new Vn({component:Kn(e,t),colSpan:1,localFilters:null==r?void 0:r.localFilters});void 0===(null==r?void 0:r.position)?null===(n=this.library)||void 0===n||n.push(o):null===(i=this.library)||void 0===i||i.splice(r.position,0,o)}catch(e){throw new Un(e,"Library.addComponent")}}addComponents(e){try{if(void 0===e)throw new Un("Components are undefined","Library.addComponents");e.forEach((e=>{var t;Yn(e);const r=new Vn({component:Kn(e.component,e.uniqueViewId),colSpan:1});null===(t=this.library)||void 0===t||t.push(r)}))}catch(e){throw new Un(e,"Library.addComponents")}}},ii.AreaChart=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"areaChart"}))}static type(){return"areaChart"}},ii.LineChart=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"lineChart"}))}static type(){return"lineChart"}},ii.BarChart=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"barChart"}))}static type(){return"barChart"}},ii.PieChart=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"pieChart"}))}static type(){return"pieChart"}},ii.ScatterChart=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"scatterChart"}))}static type(){return"scatterChart"}},ii.ComboChart=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"comboChart"}))}static type(){return"comboChart"}},ii.PivotTable=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"dataTable"}))}static type(){return"dataTable"}},ii.BasicTable=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"basicTable"}))}static type(){return"basicTable"}},ii.HorizontalBarChart=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"horizontalBarChart"}))}static type(){return"horizontalBarChart"}},ii.MercatorMap=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"mercatorMap"}))}static type(){return"mercatorMap"}},ii.SingleStat=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"singleStat"}))}static type(){return"singleStat"}},ii.Progress=class extends Qn{constructor(e){super(Object.assign(Object.assign({},e),{type:"progress"}))}static type(){return"progress"}},"undefined"==typeof window||window.Vizzly||(window.Vizzly=ii);const oi="undefined"!=typeof window&&window.Vizzly||ii})();var i=n.B,o=n.Q;export{i as Vizzly,o as VizzlyInstanceNotLoaded};