From c4150204a30cb65e6f44e5fdd95d6bb9abec2bde Mon Sep 17 00:00:00 2001 From: golles Date: Sun, 29 Sep 2024 10:56:16 +0000 Subject: [PATCH] Update JS deps --- www/swipe-navigation.js | 2 +- www/vertical-stack-in-card.js | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/www/swipe-navigation.js b/www/swipe-navigation.js index c2bec36..dab01d6 100644 --- a/www/swipe-navigation.js +++ b/www/swipe-navigation.js @@ -1 +1 @@ -function e(e,t,s,n){return new(s||(s=Promise))((function(a,i){function r(e){try{d(n.next(e))}catch(e){i(e)}}function o(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,o)}d((n=n.apply(e,t||[])).next())}))}function t(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function s(e,t,s,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,s):a?a.value=s:t.set(e,s),s}var n;"function"==typeof SuppressedError&&SuppressedError,function(e){e[e._ALL=0]="_ALL",e[e.VERBOSE=1]="VERBOSE",e[e.DEBUG=2]="DEBUG",e[e.INFO=3]="INFO",e[e.WARN=4]="WARN",e[e.ERROR=5]="ERROR"}(n||(n={}));class a{constructor(){}static getInstance(){return a.instance||(a.instance=new a),a.instance}static setLoggerLevel(e){a.loggerLevel=e}static getLoggerLevel(){return a.loggerLevel}static logv(e,t){a.log(e,t,n.VERBOSE)}static logd(e,t){a.log(e,t,n.DEBUG)}static logi(e,t){a.log(e,t,n.INFO)}static logw(e,t){a.log(e,t,n.WARN)}static loge(e,t){a.log(e,t,n.ERROR)}static log(e,t,s){if(s>=this.loggerLevel){let a;switch(s){case n.VERBOSE:a="[V]";break;case n.DEBUG:a="[D]";break;case n.INFO:a="[I]";break;case n.WARN:a="[W]";break;case n.ERROR:a="[E]";break;default:throw new Error(`Unhandled case: ${s}`)}const i=e+" "+a+" "+t;se,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const s of e)t[s]=s;return t},e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of s)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},e.find=(e,t)=>{for(const s of e)if(t(s))return s},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r||(r={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(o||(o={}));const d=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),l=e=>{switch(typeof e){case"undefined":return d.undefined;case"string":return d.string;case"number":return isNaN(e)?d.nan:d.number;case"boolean":return d.boolean;case"function":return d.function;case"bigint":return d.bigint;case"symbol":return d.symbol;case"object":return Array.isArray(e)?d.array:null===e?d.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?d.promise:"undefined"!=typeof Map&&e instanceof Map?d.map:"undefined"!=typeof Set&&e instanceof Set?d.set:"undefined"!=typeof Date&&e instanceof Date?d.date:d.object;default:return d.unknown}},c=r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class u extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},s={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)s._errors.push(t(a));else{let e=s,n=0;for(;ne.message)){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}u.create=e=>new u(e);const h=(e,t)=>{let s;switch(e.code){case c.invalid_type:s=e.received===d.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:s=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case c.invalid_union:s="Invalid input";break;case c.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case c.invalid_enum_value:s=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:s="Invalid function arguments";break;case c.invalid_return_type:s="Invalid function return type";break;case c.invalid_date:s="Invalid date";break;case c.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case c.too_small:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case c.too_big:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case c.custom:s="Invalid input";break;case c.invalid_intersection_types:s="Intersection results could not be merged";break;case c.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:s="Number must be finite";break;default:s=t.defaultError,r.assertNever(e)}return{message:s}};let p=h;function m(){return p}const f=e=>{const{data:t,path:s,errorMaps:n,issueData:a}=e,i=[...s,...a.path||[]],r={...a,path:i};let o="";const d=n.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(r,{data:t,defaultError:o}).message;return{...a,path:i,message:a.message||o}};function g(e,t){const s=f({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,m(),h].filter((e=>!!e))});e.common.issues.push(s)}class v{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if("aborted"===n.status)return y;"dirty"===n.status&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const e of t)s.push({key:await e.key,value:await e.value});return v.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return y;if("aborted"===a.status)return y;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(s[t.value]=a.value)}return{status:e.value,value:s}}}const y=Object.freeze({status:"aborted"}),_=e=>({status:"dirty",value:e}),b=e=>({status:"valid",value:e}),w=e=>"aborted"===e.status,k=e=>"dirty"===e.status,x=e=>"valid"===e.status,N=e=>"undefined"!=typeof Promise&&e instanceof Promise;var C;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(C||(C={}));class T{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Z=(e,t)=>{if(x(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new u(e.common.issues);return this._error=t,this._error}}};function E(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:n,description:a}=e;if(t&&(s||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=s?s:t.defaultError},description:a}}class O{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return l(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(N(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:null!==(s=null==t?void 0:t.async)&&void 0!==s&&s,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Z(n,a)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(N(n)?n:Promise.resolve(n));return Z(s,a)}refine(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const a=e(t),i=()=>n.addIssue({code:c.custom,...s(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(i(),!1))):!!a||(i(),!1)}))}refinement(e,t){return this._refinement(((s,n)=>!!e(s)||(n.addIssue("function"==typeof t?t(s,n):t),!1)))}_refinement(e){return new ge({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ve.create(this,this._def)}nullable(){return ye.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Y.create(this,this._def)}promise(){return fe.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new ge({...E(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new _e({...E(this._def),innerType:this,defaultValue:t,typeName:Ee.ZodDefault})}brand(){return new xe({typeName:Ee.ZodBranded,type:this,...E(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new be({...E(this._def),innerType:this,catchValue:t,typeName:Ee.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ne.create(this,e)}readonly(){return Ce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S=/^c[^\s-]{8,}$/i,P=/^[a-z][a-z0-9]*$/,R=/^[0-9A-HJKMNP-TV-Z]{26}$/,A=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,I=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let j;const L=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,M=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class D extends O{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==d.string){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.string,received:t.parsedType}),y}const t=new v;let s;for(const o of this._def.checks)if("min"===o.kind)e.data.lengtho.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if("length"===o.kind){const n=e.data.length>o.value,a=e.data.lengthe.test(t)),{validation:t,code:c.invalid_string,...C.errToObj(s)})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...C.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...C.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...C.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...C.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...C.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...C.errToObj(t)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?s:n;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}D.create=e=>{var t;return new D({checks:[],typeName:Ee.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class V extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==d.number){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.number,received:t.parsedType}),y}let t;const s=new v;for(const n of this._def.checks)if("int"===n.kind)r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),g(t,{code:c.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty());else if("min"===n.kind){(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:c.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty())}else"multipleOf"===n.kind?0!==$(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),g(t,{code:c.not_finite,message:n.message}),s.dirty()):r.assertNever(n);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,C.toString(t))}gt(e,t){return this.setLimit("min",e,!1,C.toString(t))}lte(e,t){return this.setLimit("max",e,!0,C.toString(t))}lt(e,t){return this.setLimit("max",e,!1,C.toString(t))}setLimit(e,t,s,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:C.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.valuenew V({checks:[],typeName:Ee.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class U extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==d.bigint){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.bigint,received:t.parsedType}),y}let t;const s=new v;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:c.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),g(t,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):r.assertNever(n);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,C.toString(t))}gt(e,t){return this.setLimit("min",e,!1,C.toString(t))}lte(e,t){return this.setLimit("max",e,!0,C.toString(t))}lt(e,t){return this.setLimit("max",e,!1,C.toString(t))}setLimit(e,t,s,n){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:C.toString(n)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new U({checks:[],typeName:Ee.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class z extends O{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==d.boolean){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.boolean,received:t.parsedType}),y}return b(e.data)}}z.create=e=>new z({typeName:Ee.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class F extends O{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==d.date){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.date,received:t.parsedType}),y}if(isNaN(e.data.getTime())){return g(this._getOrReturnCtx(e),{code:c.invalid_date}),y}const t=new v;let s;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):r.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew F({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ee.ZodDate,...E(e)});class B extends O{_parse(e){if(this._getType(e)!==d.symbol){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.symbol,received:t.parsedType}),y}return b(e.data)}}B.create=e=>new B({typeName:Ee.ZodSymbol,...E(e)});class K extends O{_parse(e){if(this._getType(e)!==d.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.undefined,received:t.parsedType}),y}return b(e.data)}}K.create=e=>new K({typeName:Ee.ZodUndefined,...E(e)});class W extends O{_parse(e){if(this._getType(e)!==d.null){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.null,received:t.parsedType}),y}return b(e.data)}}W.create=e=>new W({typeName:Ee.ZodNull,...E(e)});class q extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}q.create=e=>new q({typeName:Ee.ZodAny,...E(e)});class H extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}H.create=e=>new H({typeName:Ee.ZodUnknown,...E(e)});class G extends O{_parse(e){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.never,received:t.parsedType}),y}}G.create=e=>new G({typeName:Ee.ZodNever,...E(e)});class J extends O{_parse(e){if(this._getType(e)!==d.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.void,received:t.parsedType}),y}return b(e.data)}}J.create=e=>new J({typeName:Ee.ZodVoid,...E(e)});class Y extends O{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==d.array)return g(t,{code:c.invalid_type,expected:d.array,received:t.parsedType}),y;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.lengthn.maxLength.value&&(g(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map(((e,s)=>n.type._parseAsync(new T(t,e,t.path,s))))).then((e=>v.mergeArray(s,e)));const a=[...t.data].map(((e,s)=>n.type._parseSync(new T(t,e,t.path,s))));return v.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new Y({...this._def,minLength:{value:e,message:C.toString(t)}})}max(e,t){return new Y({...this._def,maxLength:{value:e,message:C.toString(t)}})}length(e,t){return new Y({...this._def,exactLength:{value:e,message:C.toString(t)}})}nonempty(e){return this.min(1,e)}}function X(e){if(e instanceof Q){const t={};for(const s in e.shape){const n=e.shape[s];t[s]=ve.create(X(n))}return new Q({...e._def,shape:()=>t})}return e instanceof Y?new Y({...e._def,type:X(e.element)}):e instanceof ve?ve.create(X(e.unwrap())):e instanceof ye?ye.create(X(e.unwrap())):e instanceof ie?ie.create(e.items.map((e=>X(e)))):e}Y.create=(e,t)=>new Y({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ee.ZodArray,...E(t)});class Q extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==d.object){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.object,received:t.parsedType}),y}const{status:t,ctx:s}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof G&&"strip"===this._def.unknownKeys))for(const e in s.data)a.includes(e)||i.push(e);const r=[];for(const e of a){const t=n[e],a=s.data[e];r.push({key:{status:"valid",value:e},value:t._parse(new T(s,a,s.path,e)),alwaysSet:e in s.data})}if(this._def.catchall instanceof G){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)r.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)i.length>0&&(g(s,{code:c.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const n=s.data[t];r.push({key:{status:"valid",value:t},value:e._parse(new T(s,n,s.path,t)),alwaysSet:t in s.data})}}return s.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of r){const s=await t.key;e.push({key:s,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>v.mergeObjectSync(t,e))):v.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new Q({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{var n,a,i,r;const o=null!==(i=null===(a=(n=this._def).errorMap)||void 0===a?void 0:a.call(n,t,s).message)&&void 0!==i?i:s.defaultError;return"unrecognized_keys"===t.code?{message:null!==(r=C.errToObj(e).message)&&void 0!==r?r:o}:{message:o}}}:{}})}strip(){return new Q({...this._def,unknownKeys:"strip"})}passthrough(){return new Q({...this._def,unknownKeys:"passthrough"})}extend(e){return new Q({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Q({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ee.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Q({...this._def,catchall:e})}pick(e){const t={};return r.objectKeys(e).forEach((s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])})),new Q({...this._def,shape:()=>t})}omit(e){const t={};return r.objectKeys(this.shape).forEach((s=>{e[s]||(t[s]=this.shape[s])})),new Q({...this._def,shape:()=>t})}deepPartial(){return X(this)}partial(e){const t={};return r.objectKeys(this.shape).forEach((s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()})),new Q({...this._def,shape:()=>t})}required(e){const t={};return r.objectKeys(this.shape).forEach((s=>{if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof ve;)e=e._def.innerType;t[s]=e}})),new Q({...this._def,shape:()=>t})}keyof(){return he(r.objectKeys(this.shape))}}Q.create=(e,t)=>new Q({shape:()=>e,unknownKeys:"strip",catchall:G.create(),typeName:Ee.ZodObject,...E(t)}),Q.strictCreate=(e,t)=>new Q({shape:()=>e,unknownKeys:"strict",catchall:G.create(),typeName:Ee.ZodObject,...E(t)}),Q.lazycreate=(e,t)=>new Q({shape:e,unknownKeys:"strip",catchall:G.create(),typeName:Ee.ZodObject,...E(t)});class ee extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map((async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const s=e.map((e=>new u(e.ctx.common.issues)));return g(t,{code:c.invalid_union,unionErrors:s}),y}));{let e;const n=[];for(const a of s){const s={...t,common:{...t.common,issues:[]},parent:null},i=a._parseSync({data:t.data,path:t.path,parent:s});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:s}),s.common.issues.length&&n.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=n.map((e=>new u(e)));return g(t,{code:c.invalid_union,unionErrors:a}),y}}get options(){return this._def.options}}ee.create=(e,t)=>new ee({options:e,typeName:Ee.ZodUnion,...E(t)});const te=e=>e instanceof ce?te(e.schema):e instanceof ge?te(e.innerType()):e instanceof ue?[e.value]:e instanceof pe?e.options:e instanceof me?Object.keys(e.enum):e instanceof _e?te(e._def.innerType):e instanceof K?[void 0]:e instanceof W?[null]:null;class se extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.object)return g(t,{code:c.invalid_type,expected:d.object,received:t.parsedType}),y;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(g(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const s of t){const t=te(s.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new se({typeName:Ee.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...E(s)})}}function ne(e,t){const s=l(e),n=l(t);if(e===t)return{valid:!0,data:e};if(s===d.object&&n===d.object){const s=r.objectKeys(t),n=r.objectKeys(e).filter((e=>-1!==s.indexOf(e))),a={...e,...t};for(const s of n){const n=ne(e[s],t[s]);if(!n.valid)return{valid:!1};a[s]=n.data}return{valid:!0,data:a}}if(s===d.array&&n===d.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let n=0;n{if(w(e)||w(n))return y;const a=ne(e.value,n.value);return a.valid?((k(e)||k(n))&&t.dirty(),{status:t.value,value:a.data}):(g(s,{code:c.invalid_intersection_types}),y)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ae.create=(e,t,s)=>new ae({left:e,right:t,typeName:Ee.ZodIntersection,...E(s)});class ie extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==d.array)return g(s,{code:c.invalid_type,expected:d.array,received:s.parsedType}),y;if(s.data.lengththis._def.items.length&&(g(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...s.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new T(s,e,s.path,t)):null})).filter((e=>!!e));return s.common.async?Promise.all(n).then((e=>v.mergeArray(t,e))):v.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ie({...this._def,rest:e})}}ie.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ie({items:e,typeName:Ee.ZodTuple,rest:null,...E(t)})};class re extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==d.object)return g(s,{code:c.invalid_type,expected:d.object,received:s.parsedType}),y;const n=[],a=this._def.keyType,i=this._def.valueType;for(const e in s.data)n.push({key:a._parse(new T(s,e,s.path,e)),value:i._parse(new T(s,s.data[e],s.path,e))});return s.common.async?v.mergeObjectAsync(t,n):v.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return new re(t instanceof O?{keyType:e,valueType:t,typeName:Ee.ZodRecord,...E(s)}:{keyType:D.create(),valueType:e,typeName:Ee.ZodRecord,...E(t)})}}class oe extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==d.map)return g(s,{code:c.invalid_type,expected:d.map,received:s.parsedType}),y;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map((([e,t],i)=>({key:n._parse(new T(s,e,s.path,[i,"key"])),value:a._parse(new T(s,t,s.path,[i,"value"]))})));if(s.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const s of i){const n=await s.key,a=await s.value;if("aborted"===n.status||"aborted"===a.status)return y;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const s of i){const n=s.key,a=s.value;if("aborted"===n.status||"aborted"===a.status)return y;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}oe.create=(e,t,s)=>new oe({valueType:t,keyType:e,typeName:Ee.ZodMap,...E(s)});class de extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==d.set)return g(s,{code:c.invalid_type,expected:d.set,received:s.parsedType}),y;const n=this._def;null!==n.minSize&&s.data.sizen.maxSize.value&&(g(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(e){const s=new Set;for(const n of e){if("aborted"===n.status)return y;"dirty"===n.status&&t.dirty(),s.add(n.value)}return{status:t.value,value:s}}const r=[...s.data.values()].map(((e,t)=>a._parse(new T(s,e,s.path,t))));return s.common.async?Promise.all(r).then((e=>i(e))):i(r)}min(e,t){return new de({...this._def,minSize:{value:e,message:C.toString(t)}})}max(e,t){return new de({...this._def,maxSize:{value:e,message:C.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}de.create=(e,t)=>new de({valueType:e,minSize:null,maxSize:null,typeName:Ee.ZodSet,...E(t)});class le extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.function)return g(t,{code:c.invalid_type,expected:d.function,received:t.parsedType}),y;function s(e,s){return f({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),h].filter((e=>!!e)),issueData:{code:c.invalid_arguments,argumentsError:s}})}function n(e,s){return f({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),h].filter((e=>!!e)),issueData:{code:c.invalid_return_type,returnTypeError:s}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof fe){const e=this;return b((async function(...t){const r=new u([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw r.addIssue(s(t,e)),r})),d=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(d,a).catch((e=>{throw r.addIssue(n(d,e)),r}))}))}{const e=this;return b((function(...t){const r=e._def.args.safeParse(t,a);if(!r.success)throw new u([s(t,r.error)]);const o=Reflect.apply(i,this,r.data),d=e._def.returns.safeParse(o,a);if(!d.success)throw new u([n(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new le({...this._def,args:ie.create(e).rest(H.create())})}returns(e){return new le({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new le({args:e||ie.create([]).rest(H.create()),returns:t||H.create(),typeName:Ee.ZodFunction,...E(s)})}}class ce extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ce.create=(e,t)=>new ce({getter:e,typeName:Ee.ZodLazy,...E(t)});class ue extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}function he(e,t){return new pe({values:e,typeName:Ee.ZodEnum,...E(t)})}ue.create=(e,t)=>new ue({value:e,typeName:Ee.ZodLiteral,...E(t)});class pe extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),s=this._def.values;return g(t,{expected:r.joinValues(s),received:t.parsedType,code:c.invalid_type}),y}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return g(t,{received:t.data,code:c.invalid_enum_value,options:s}),y}return b(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return pe.create(e)}exclude(e){return pe.create(this.options.filter((t=>!e.includes(t))))}}pe.create=he;class me extends O{_parse(e){const t=r.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==d.string&&s.parsedType!==d.number){const e=r.objectValues(t);return g(s,{expected:r.joinValues(e),received:s.parsedType,code:c.invalid_type}),y}if(-1===t.indexOf(e.data)){const e=r.objectValues(t);return g(s,{received:s.data,code:c.invalid_enum_value,options:e}),y}return b(e.data)}get enum(){return this._def.values}}me.create=(e,t)=>new me({values:e,typeName:Ee.ZodNativeEnum,...E(t)});class fe extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.promise&&!1===t.common.async)return g(t,{code:c.invalid_type,expected:d.promise,received:t.parsedType}),y;const s=t.parsedType===d.promise?t.data:Promise.resolve(t.data);return b(s.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}fe.create=(e,t)=>new fe({type:e,typeName:Ee.ZodPromise,...E(t)});class ge extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:e=>{g(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===n.type){const e=n.transform(s.data,a);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:s.path,parent:s}))):this._def.schema._parseSync({data:e,path:s.path,parent:s})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,a);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const n=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===n.status?y:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((s=>"aborted"===s.status?y:("dirty"===s.status&&t.dirty(),e(s.value).then((()=>({status:t.value,value:s.value}))))))}if("transform"===n.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!x(e))return e;const i=n.transform(e.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>x(e)?Promise.resolve(n.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}r.assertNever(n)}}ge.create=(e,t,s)=>new ge({schema:e,typeName:Ee.ZodEffects,effect:t,...E(s)}),ge.createWithPreprocess=(e,t,s)=>new ge({schema:t,effect:{type:"preprocess",transform:e},typeName:Ee.ZodEffects,...E(s)});class ve extends O{_parse(e){return this._getType(e)===d.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Ee.ZodOptional,...E(t)});class ye extends O{_parse(e){return this._getType(e)===d.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:Ee.ZodNullable,...E(t)});class _e extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===d.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}_e.create=(e,t)=>new _e({innerType:e,typeName:Ee.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...E(t)});class be extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return N(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new u(s.common.issues)},input:s.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new u(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}be.create=(e,t)=>new be({innerType:e,typeName:Ee.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...E(t)});class we extends O{_parse(e){if(this._getType(e)!==d.nan){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.nan,received:t.parsedType}),y}return{status:"valid",value:e.data}}}we.create=e=>new we({typeName:Ee.ZodNaN,...E(e)});const ke=Symbol("zod_brand");class xe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ne extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),_(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})()}{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new Ne({in:e,out:t,typeName:Ee.ZodPipeline})}}class Ce extends O{_parse(e){const t=this._def.innerType._parse(e);return x(t)&&(t.value=Object.freeze(t.value)),t}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:Ee.ZodReadonly,...E(t)});const Te=(e,t={},s)=>e?q.create().superRefine(((n,a)=>{var i,r;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(r=null!==(i=e.fatal)&&void 0!==i?i:s)||void 0===r||r,d="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...d,fatal:o})}})):q.create(),Ze={object:Q.lazycreate};var Ee;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ee||(Ee={}));const Oe=D.create,Se=V.create,Pe=we.create,Re=U.create,Ae=z.create,Ie=F.create,je=B.create,Le=K.create,Me=W.create,De=q.create,$e=H.create,Ve=G.create,Ue=J.create,ze=Y.create,Fe=Q.create,Be=Q.strictCreate,Ke=ee.create,We=se.create,qe=ae.create,He=ie.create,Ge=re.create,Je=oe.create,Ye=de.create,Xe=le.create,Qe=ce.create,et=ue.create,tt=pe.create,st=me.create,nt=fe.create,at=ge.create,it=ve.create,rt=ye.create,ot=ge.createWithPreprocess,dt=Ne.create,lt={string:e=>D.create({...e,coerce:!0}),number:e=>V.create({...e,coerce:!0}),boolean:e=>z.create({...e,coerce:!0}),bigint:e=>U.create({...e,coerce:!0}),date:e=>F.create({...e,coerce:!0})},ct=y;var ut=Object.freeze({__proto__:null,defaultErrorMap:h,setErrorMap:function(e){p=e},getErrorMap:m,makeIssue:f,EMPTY_PATH:[],addIssueToContext:g,ParseStatus:v,INVALID:y,DIRTY:_,OK:b,isAborted:w,isDirty:k,isValid:x,isAsync:N,get util(){return r},get objectUtil(){return o},ZodParsedType:d,getParsedType:l,ZodType:O,ZodString:D,ZodNumber:V,ZodBigInt:U,ZodBoolean:z,ZodDate:F,ZodSymbol:B,ZodUndefined:K,ZodNull:W,ZodAny:q,ZodUnknown:H,ZodNever:G,ZodVoid:J,ZodArray:Y,ZodObject:Q,ZodUnion:ee,ZodDiscriminatedUnion:se,ZodIntersection:ae,ZodTuple:ie,ZodRecord:re,ZodMap:oe,ZodSet:de,ZodFunction:le,ZodLazy:ce,ZodLiteral:ue,ZodEnum:pe,ZodNativeEnum:me,ZodPromise:fe,ZodEffects:ge,ZodTransformer:ge,ZodOptional:ve,ZodNullable:ye,ZodDefault:_e,ZodCatch:be,ZodNaN:we,BRAND:ke,ZodBranded:xe,ZodPipeline:Ne,ZodReadonly:Ce,custom:Te,Schema:O,ZodSchema:O,late:Ze,get ZodFirstPartyTypeKind(){return Ee},coerce:lt,any:De,array:ze,bigint:Re,boolean:Ae,date:Ie,discriminatedUnion:We,effect:at,enum:tt,function:Xe,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Te((t=>t instanceof e),t),intersection:qe,lazy:Qe,literal:et,map:Je,nan:Pe,nativeEnum:st,never:Ve,null:Me,nullable:rt,number:Se,object:Fe,oboolean:()=>Ae().optional(),onumber:()=>Se().optional(),optional:it,ostring:()=>Oe().optional(),pipeline:dt,preprocess:ot,promise:nt,record:Ge,set:Ye,strictObject:Be,string:Oe,symbol:je,transformer:at,tuple:He,undefined:Le,union:Ke,unknown:$e,void:Ue,NEVER:ct,ZodIssueCode:c,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:u});class ht{constructor(){this.animate="none",this.animate_duration=200,this.enable=!0,this.enable_mouse_swipe=!1,this.logger_level=n.WARN,this.prevent_default=!1,this.skip_hidden=!0,this.skip_subviews=!0,this.skip_tabs=[],this.swipe_amount=.15,this.wrap=!0}getAnimate(){return this.animate}getAnimateDuration(){return this.animate_duration}getEnable(){return this.enable}getEnableMouseSwipe(){return this.enable_mouse_swipe}getLoggerLevel(){return this.logger_level}getPreventDefault(){return this.prevent_default}getSkipHidden(){return this.skip_hidden}getSkipSubviews(){return this.skip_subviews}getSkipTabs(){return this.skip_tabs}getSwipeAmount(){return this.swipe_amount}getWrap(){return this.wrap}static parseConfig(e){if(t=e,!pt.safeParse(t).success)return a.loge(i,"Found invalid configuration."),null;var t;const s=new ht;switch(null!=e.animate&&(s.animate=e.animate),null!=e.animate_duration&&(s.animate_duration=e.animate_duration),null!=e.enable&&(s.enable=e.enable),null!=e.enable_mouse_swipe&&(s.enable_mouse_swipe=e.enable_mouse_swipe),e.logger_level){case"verbose":s.logger_level=n.VERBOSE;break;case"debug":s.logger_level=n.DEBUG;break;case"info":s.logger_level=n.INFO;break;case"warn":s.logger_level=n.WARN;break;case"error":s.logger_level=n.ERROR;break;case null:case void 0:break;default:{const t=e.logger_level;throw new Error(`Unhandled case: ${t}`)}}return null!=e.prevent_default&&(s.prevent_default=e.prevent_default),null!=e.skip_hidden&&(s.skip_hidden=e.skip_hidden),null!=e.skip_subviews&&(s.skip_subviews=e.skip_subviews),null!=e.skip_tabs&&(s.skip_tabs=String(e.skip_tabs).replace(/\s+/g,"").split(",").map((e=>parseInt(e)))),null!=e.swipe_amount&&(s.swipe_amount=e.swipe_amount/100),null!=e.wrap&&(s.wrap=e.wrap),s}}const pt=ut.object({animate:ut.union([ut.literal("none"),ut.literal("swipe"),ut.literal("fade"),ut.literal("flip")]).optional(),animate_duration:ut.number().optional(),enable:ut.boolean().optional(),enable_mouse_swipe:ut.boolean().optional(),logger_level:ut.union([ut.literal("verbose"),ut.literal("debug"),ut.literal("info"),ut.literal("warn"),ut.literal("error")]).optional(),prevent_default:ut.boolean().optional(),skip_hidden:ut.boolean().optional(),skip_subviews:ut.boolean().optional(),skip_tabs:ut.coerce.string().optional(),swipe_amount:ut.number().optional(),wrap:ut.boolean().optional()});class mt{constructor(e){this.domNodes=[],this.observers=[],this.domNodeAddedCallbacks=[],this.domNodeRemovedCallbacks=[],this.selectorPaths=e,this.domNodes=new Array(this.selectorPaths.length),this.observers=new Array(this.selectorPaths.length)}addDomNodeAddedCallback(e){a.logv(i,'Adding callback to PageObject: "'+this.selectorPaths[this.selectorPaths.length-1]+'".'),0==this.domNodeAddedCallbacks.length&&0==this.domNodeRemovedCallbacks.length&&this.createNodeObserversFrom(0),this.domNodeAddedCallbacks.push(e)}toString(){return this.selectorPaths.join("→")}getDomNode(){const e=this.domNodes.length-1;return a.logv(i,"Getting DOM node "+this.toString()+"."),this.getDomNodeAt(e)}getSelectorPaths(){return this.selectorPaths.slice()}getDomNodeAt(e){var t;const s=this.domNodes[e];if(1==(null==s?void 0:s.isConnected))return s;a.logv(i,"Recursively Getting DOM node "+e+" "+this.selectorPaths[e]+" in "+this.toString()+".");const n=0==e?document:this.getDomNodeAt(e-1);return"$"==this.selectorPaths[e]?this.domNodes[e]=n instanceof HTMLElement&&n.shadowRoot?n.shadowRoot:null:this.domNodes[e]=null!==(t=null==n?void 0:n.querySelector(this.selectorPaths[e]))&&void 0!==t?t:null,this.domNodes[e]}createNodeObserversFrom(e){var t;a.logv(i,"Creating observer for "+e+" "+this.selectorPaths[e]+" in "+this.toString()+".");const s=0==e?document:this.getDomNodeAt(e-1);if(null!=s)if(this.observers[e]=new MutationObserver((t=>{for(const s of t){for(const t of s.addedNodes)t instanceof HTMLElement&&("$"==this.selectorPaths[e]||t.matches(this.selectorPaths[e]))&&(a.logd(i,'DOM node added: "'+t.nodeName.toLowerCase()+'".'),this.domNodes[e]=t,e==this.selectorPaths.length-1?this.invokeDomNodeAddedCallbacks(t):this.createNodeObserversFrom(e+1));for(const t of s.removedNodes)t instanceof HTMLElement&&("$"==this.selectorPaths[e]||t.matches(this.selectorPaths[e]))&&(a.logd(i,'DOM node removed: "'+t.nodeName.toLowerCase()+'".'),this.domNodes[e]=null,ea)return!0;if(t{gt.readConfig()})),yield gt.readConfig()}))}static registerConfigObserver(e){gt.configObservers.push(e)}static unregisterConfigObserver(e){const t=gt.configObservers.indexOf(e);t>-1?gt.configObservers.splice(t,1):a.loge(i,"Internal error while unregistering a configObserver: not found.")}static readConfig(){var t,s,n,r,o,d,l,c;return e(this,void 0,void 0,(function*(){a.logd(i,"Attempting to read config...");const e=ft.haPanelLovelace.getDomNode(),u=null!==(n=null===(s=null===(t=null==e?void 0:e.lovelace)||void 0===t?void 0:t.config)||void 0===s?void 0:s.swipe_nav)&&void 0!==n?n:{};JSON.stringify(u)!=JSON.stringify(gt.rawConfig)&>.saveConfig(u);const h=null===(r=null==e?void 0:e.route)||void 0===r?void 0:r.prefix;null!=h&&(gt.panel=h.replace("/",""));const p=null===(d=null===(o=null==e?void 0:e.lovelace)||void 0===o?void 0:o.config)||void 0===d?void 0:d.views;null!=p&&(gt.views=p);const m=null===(c=null===(l=null==e?void 0:e.hass)||void 0===l?void 0:l.user)||void 0===c?void 0:c.id;null!=m&&(gt.currentUserId=m)}))}static saveConfig(e){gt.rawConfig=e;const t=ht.parseConfig(e);null!=t&&(JSON.stringify(t)!=JSON.stringify(gt.currentConfig)?(gt.currentConfig=t,gt.configObservers.forEach((e=>{e.callback()}))):a.logd(i,"Config is equivalent."))}}gt.currentConfig=new ht,gt.panel=null,gt.views=null,gt.currentUserId=null,gt.rawConfig=null,gt.configObservers=[];class vt{constructor(e){this.callback=e}}const yt=["ha-tabs","paper-tabs","hui-badge-edit-mode","hui-card-edit-mode",".section-actions .handle","hui-map-card",".ha-scrollbar","ha-sidebar","ha-slider","input[type=range]","#slider","better-thermostat-ui-card","big-slider-card","floor3d-card","gallery-card","#graph-wrapper svg.apexcharts-svg","history-explorer-card",".horizontal-buttons-stack-container","my-slider","my-slider-v2","mwc-tab-bar","#plotly g.draglayer",".range-slider",".bubble-button-card","round-slider","sankey-chart","slider-button-card","swipe-card",".swiper","toucharea","xiaomi-vacuum-map-card","mushroom-slider","ha-bar-slider"].join(",");var _t,bt,wt,kt,xt,Nt,Ct,Tt,Zt,Et;class Ot{static init(){var e;null===(e=t(this,_t,"f",Nt))||void 0===e||e.abort(),s(this,_t,new AbortController,"f",Nt);const n=ft.haAppLayout.getDomNode();null!=n&&(a.logd(i,"Initializing SwipeManger..."),n.addEventListener("touchstart",(e=>{t(this,_t,"m",Ct).call(this,e)}),{signal:t(this,_t,"f",Nt).signal,passive:!0}),n.addEventListener("touchmove",(e=>{t(this,_t,"m",Tt).call(this,e)}),{signal:t(this,_t,"f",Nt).signal,passive:!1}),n.addEventListener("touchend",(()=>{t(this,_t,"m",Zt).call(this)}),{signal:t(this,_t,"f",Nt).signal,passive:!0}),n.addEventListener("mousedown",(e=>{t(this,_t,"m",Ct).call(this,e)}),{signal:t(this,_t,"f",Nt).signal,passive:!0}),gt.getCurrentConfig().getEnableMouseSwipe()&&(n.addEventListener("mousemove",(e=>{t(this,_t,"m",Tt).call(this,e)}),{signal:t(this,_t,"f",Nt).signal,passive:!1}),n.addEventListener("mouseup",(()=>{t(this,_t,"m",Zt).call(this)}),{signal:t(this,_t,"f",Nt).signal,passive:!0})))}static animatedNavigateTo(e,t){const s=ft.haAppLayoutView.getDomNode();if(null==s)a.loge(i,"view is null when attempting to change tab.");else{const n=gt.getCurrentConfig().getAnimate();if("none"==n)_t.navigateTo(e);else{const a=gt.getCurrentConfig().getAnimateDuration();if(s.style.transition=`transform ${a}ms ease-in, opacity ${a}ms ease-in`,"swipe"==n){const n=ft.haAppLayout.getDomNode();null!=n&&(n.style.overflow="hidden");const i=t?screen.width/2+"px":`-${screen.width/2}px`,r=t?`-${screen.width/2}px`:screen.width/2+"px";s.style.opacity="0",s.style.transform=`translate(${i}, 0)`,setTimeout((function(){s.style.transition="",s.style.transform=`translate(${r}, 0)`,_t.navigateTo(e)}),a+10)}else if("fade"==n)s.style.opacity="0",setTimeout((function(){s.style.transition="",_t.navigateTo(e),s.style.opacity="0"}),a+10);else{if("flip"!=n){throw new Error(`Unhandled case: ${n}`)}s.style.transform="rotatey(90deg)",s.style.opacity="0.25",setTimeout((function(){s.style.transition="",_t.navigateTo(e)}),a+10)}setTimeout((function(){s.style.transition=`transform ${a}ms ease-out, opacity ${a}ms ease-out`,s.style.opacity="1",s.style.transform=""}),a+50),"swipe"==n&&setTimeout((function(){const e=ft.haAppLayout.getDomNode();null!=e&&(e.style.overflow="")}),2*a+100)}}}static navigateTo(e){const t=gt.getPanel();window.history.pushState(null,"","/"+t+"/"+e),window.dispatchEvent(new CustomEvent("location-changed"))}}_t=Ot,Ct=function(e){let t;if(null!=window.TouchEvent&&e instanceof TouchEvent)t="touch";else{if(!(e instanceof MouseEvent)){throw new Error(`Unhandled case: ${e}`)}t="click"}if(0!=gt.getCurrentConfig().getEnable()){if(null!=window.TouchEvent&&e instanceof TouchEvent&&e.touches.length>1)return s(this,_t,null,"f",bt),s(this,_t,null,"f",wt),void a.logd(i,"Ignoring "+t+": multiple touchpoints detected.");if(e instanceof MouseEvent&&!gt.getCurrentConfig().getEnableMouseSwipe())return s(this,_t,null,"f",bt),s(this,_t,null,"f",wt),void a.logd(i,"Ignoring "+t+": swiping via mouse is disabled.");if("object"==typeof e.composedPath())for(const s of e.composedPath())if(s instanceof Element){if("HUI-VIEW"==s.nodeName)break;if(s.matches&&s.matches(yt))return void a.logd(i,"Ignoring "+t+' on "'+(null!=s.nodeName?s.nodeName.toLowerCase():"unknown")+'".')}if(null!=window.TouchEvent&&e instanceof TouchEvent)s(this,_t,e.touches[0].clientX,"f",bt),s(this,_t,e.touches[0].clientY,"f",wt);else{if(!(e instanceof MouseEvent)){throw new Error(`Unhandled case: ${e}`)}s(this,_t,e.clientX,"f",bt),s(this,_t,e.clientY,"f",wt)}}else a.logd(i,"Ignoring "+t+": Swipe navigation is disabled in the config.")},Tt=function(e){if(t(this,_t,"f",bt)&&t(this,_t,"f",wt)){if(null!=window.TouchEvent&&e instanceof TouchEvent)s(this,_t,t(this,_t,"f",bt)-e.touches[0].clientX,"f",kt),s(this,_t,t(this,_t,"f",wt)-e.touches[0].clientY,"f",xt);else{if(!(e instanceof MouseEvent)){throw new Error(`Unhandled case: ${e}`)}s(this,_t,t(this,_t,"f",bt)-e.clientX,"f",kt),s(this,_t,t(this,_t,"f",wt)-e.clientY,"f",xt)}Math.abs(t(this,_t,"f",kt))>Math.abs(t(this,_t,"f",xt))&>.getCurrentConfig().getPreventDefault()&&e.preventDefault()}},Zt=function(){var e;if(null!=t(this,_t,"f",kt)&&null!=t(this,_t,"f",xt))if(Math.abs(t(this,_t,"f",kt)){a.setLoggerLevel(gt.getCurrentConfig().getLoggerLevel()),a.logi(i,"New configuration loaded.")}))),yield gt.readAndMonitorConfig(),ft.haAppLayout.addDomNodeAddedCallback((()=>{Ot.init()})),Ot.init()}))}(); +function e(e,t,s,n){return new(s||(s=Promise))((function(a,i){function r(e){try{d(n.next(e))}catch(e){i(e)}}function o(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,o)}d((n=n.apply(e,t||[])).next())}))}function t(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function s(e,t,s,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,s):a?a.value=s:t.set(e,s),s}var n;"function"==typeof SuppressedError&&SuppressedError,function(e){e[e._ALL=0]="_ALL",e[e.VERBOSE=1]="VERBOSE",e[e.DEBUG=2]="DEBUG",e[e.INFO=3]="INFO",e[e.WARN=4]="WARN",e[e.ERROR=5]="ERROR"}(n||(n={}));class a{constructor(){}static getInstance(){return a.instance||(a.instance=new a),a.instance}static setLoggerLevel(e){a.loggerLevel=e}static getLoggerLevel(){return a.loggerLevel}static logv(e,t){a.log(e,t,n.VERBOSE)}static logd(e,t){a.log(e,t,n.DEBUG)}static logi(e,t){a.log(e,t,n.INFO)}static logw(e,t){a.log(e,t,n.WARN)}static loge(e,t){a.log(e,t,n.ERROR)}static log(e,t,s){if(s>=this.loggerLevel){let a;switch(s){case n.VERBOSE:a="[V]";break;case n.DEBUG:a="[D]";break;case n.INFO:a="[I]";break;case n.WARN:a="[W]";break;case n.ERROR:a="[E]";break;default:throw new Error(`Unhandled case: ${s}`)}const i=e+" "+a+" "+t;se,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const s of e)t[s]=s;return t},e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of s)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},e.find=(e,t)=>{for(const s of e)if(t(s))return s},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r||(r={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(o||(o={}));const d=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),l=e=>{switch(typeof e){case"undefined":return d.undefined;case"string":return d.string;case"number":return isNaN(e)?d.nan:d.number;case"boolean":return d.boolean;case"function":return d.function;case"bigint":return d.bigint;case"symbol":return d.symbol;case"object":return Array.isArray(e)?d.array:null===e?d.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?d.promise:"undefined"!=typeof Map&&e instanceof Map?d.map:"undefined"!=typeof Set&&e instanceof Set?d.set:"undefined"!=typeof Date&&e instanceof Date?d.date:d.object;default:return d.unknown}},c=r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class u extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},s={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)s._errors.push(t(a));else{let e=s,n=0;for(;ne.message)){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}u.create=e=>new u(e);const h=(e,t)=>{let s;switch(e.code){case c.invalid_type:s=e.received===d.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:s=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case c.invalid_union:s="Invalid input";break;case c.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case c.invalid_enum_value:s=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:s="Invalid function arguments";break;case c.invalid_return_type:s="Invalid function return type";break;case c.invalid_date:s="Invalid date";break;case c.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case c.too_small:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case c.too_big:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case c.custom:s="Invalid input";break;case c.invalid_intersection_types:s="Intersection results could not be merged";break;case c.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:s="Number must be finite";break;default:s=t.defaultError,r.assertNever(e)}return{message:s}};let p=h;function m(){return p}const f=e=>{const{data:t,path:s,errorMaps:n,issueData:a}=e,i=[...s,...a.path||[]],r={...a,path:i};let o="";const d=n.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(r,{data:t,defaultError:o}).message;return{...a,path:i,message:a.message||o}};function g(e,t){const s=f({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,m(),h].filter((e=>!!e))});e.common.issues.push(s)}class v{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if("aborted"===n.status)return y;"dirty"===n.status&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const e of t)s.push({key:await e.key,value:await e.value});return v.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return y;if("aborted"===a.status)return y;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(s[t.value]=a.value)}return{status:e.value,value:s}}}const y=Object.freeze({status:"aborted"}),_=e=>({status:"dirty",value:e}),b=e=>({status:"valid",value:e}),w=e=>"aborted"===e.status,k=e=>"dirty"===e.status,x=e=>"valid"===e.status,N=e=>"undefined"!=typeof Promise&&e instanceof Promise;var C;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(C||(C={}));class T{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Z=(e,t)=>{if(x(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new u(e.common.issues);return this._error=t,this._error}}};function E(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:n,description:a}=e;if(t&&(s||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=s?s:t.defaultError},description:a}}class O{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return l(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(N(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:null!==(s=null==t?void 0:t.async)&&void 0!==s&&s,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Z(n,a)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(N(n)?n:Promise.resolve(n));return Z(s,a)}refine(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const a=e(t),i=()=>n.addIssue({code:c.custom,...s(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(i(),!1))):!!a||(i(),!1)}))}refinement(e,t){return this._refinement(((s,n)=>!!e(s)||(n.addIssue("function"==typeof t?t(s,n):t),!1)))}_refinement(e){return new ge({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ve.create(this,this._def)}nullable(){return ye.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Y.create(this,this._def)}promise(){return fe.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new ge({...E(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new _e({...E(this._def),innerType:this,defaultValue:t,typeName:Ee.ZodDefault})}brand(){return new xe({typeName:Ee.ZodBranded,type:this,...E(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new be({...E(this._def),innerType:this,catchValue:t,typeName:Ee.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ne.create(this,e)}readonly(){return Ce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S=/^c[^\s-]{8,}$/i,P=/^[a-z][a-z0-9]*$/,R=/^[0-9A-HJKMNP-TV-Z]{26}$/,A=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,I=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let j;const L=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,D=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class M extends O{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==d.string){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.string,received:t.parsedType}),y}const t=new v;let s;for(const o of this._def.checks)if("min"===o.kind)e.data.lengtho.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if("length"===o.kind){const n=e.data.length>o.value,a=e.data.lengthe.test(t)),{validation:t,code:c.invalid_string,...C.errToObj(s)})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...C.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...C.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...C.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...C.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...C.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...C.errToObj(t)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new M({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?s:n;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}M.create=e=>{var t;return new M({checks:[],typeName:Ee.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class V extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==d.number){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.number,received:t.parsedType}),y}let t;const s=new v;for(const n of this._def.checks)if("int"===n.kind)r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),g(t,{code:c.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty());else if("min"===n.kind){(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:c.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty())}else"multipleOf"===n.kind?0!==$(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),g(t,{code:c.not_finite,message:n.message}),s.dirty()):r.assertNever(n);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,C.toString(t))}gt(e,t){return this.setLimit("min",e,!1,C.toString(t))}lte(e,t){return this.setLimit("max",e,!0,C.toString(t))}lt(e,t){return this.setLimit("max",e,!1,C.toString(t))}setLimit(e,t,s,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:C.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.valuenew V({checks:[],typeName:Ee.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class U extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==d.bigint){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.bigint,received:t.parsedType}),y}let t;const s=new v;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:c.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),g(t,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):r.assertNever(n);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,C.toString(t))}gt(e,t){return this.setLimit("min",e,!1,C.toString(t))}lte(e,t){return this.setLimit("max",e,!0,C.toString(t))}lt(e,t){return this.setLimit("max",e,!1,C.toString(t))}setLimit(e,t,s,n){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:C.toString(n)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new U({checks:[],typeName:Ee.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class z extends O{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==d.boolean){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.boolean,received:t.parsedType}),y}return b(e.data)}}z.create=e=>new z({typeName:Ee.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class F extends O{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==d.date){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.date,received:t.parsedType}),y}if(isNaN(e.data.getTime())){return g(this._getOrReturnCtx(e),{code:c.invalid_date}),y}const t=new v;let s;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):r.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew F({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ee.ZodDate,...E(e)});class B extends O{_parse(e){if(this._getType(e)!==d.symbol){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.symbol,received:t.parsedType}),y}return b(e.data)}}B.create=e=>new B({typeName:Ee.ZodSymbol,...E(e)});class K extends O{_parse(e){if(this._getType(e)!==d.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.undefined,received:t.parsedType}),y}return b(e.data)}}K.create=e=>new K({typeName:Ee.ZodUndefined,...E(e)});class W extends O{_parse(e){if(this._getType(e)!==d.null){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.null,received:t.parsedType}),y}return b(e.data)}}W.create=e=>new W({typeName:Ee.ZodNull,...E(e)});class q extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}q.create=e=>new q({typeName:Ee.ZodAny,...E(e)});class H extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}H.create=e=>new H({typeName:Ee.ZodUnknown,...E(e)});class G extends O{_parse(e){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.never,received:t.parsedType}),y}}G.create=e=>new G({typeName:Ee.ZodNever,...E(e)});class J extends O{_parse(e){if(this._getType(e)!==d.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.void,received:t.parsedType}),y}return b(e.data)}}J.create=e=>new J({typeName:Ee.ZodVoid,...E(e)});class Y extends O{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==d.array)return g(t,{code:c.invalid_type,expected:d.array,received:t.parsedType}),y;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.lengthn.maxLength.value&&(g(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map(((e,s)=>n.type._parseAsync(new T(t,e,t.path,s))))).then((e=>v.mergeArray(s,e)));const a=[...t.data].map(((e,s)=>n.type._parseSync(new T(t,e,t.path,s))));return v.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new Y({...this._def,minLength:{value:e,message:C.toString(t)}})}max(e,t){return new Y({...this._def,maxLength:{value:e,message:C.toString(t)}})}length(e,t){return new Y({...this._def,exactLength:{value:e,message:C.toString(t)}})}nonempty(e){return this.min(1,e)}}function X(e){if(e instanceof Q){const t={};for(const s in e.shape){const n=e.shape[s];t[s]=ve.create(X(n))}return new Q({...e._def,shape:()=>t})}return e instanceof Y?new Y({...e._def,type:X(e.element)}):e instanceof ve?ve.create(X(e.unwrap())):e instanceof ye?ye.create(X(e.unwrap())):e instanceof ie?ie.create(e.items.map((e=>X(e)))):e}Y.create=(e,t)=>new Y({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ee.ZodArray,...E(t)});class Q extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==d.object){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.object,received:t.parsedType}),y}const{status:t,ctx:s}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof G&&"strip"===this._def.unknownKeys))for(const e in s.data)a.includes(e)||i.push(e);const r=[];for(const e of a){const t=n[e],a=s.data[e];r.push({key:{status:"valid",value:e},value:t._parse(new T(s,a,s.path,e)),alwaysSet:e in s.data})}if(this._def.catchall instanceof G){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)r.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)i.length>0&&(g(s,{code:c.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const n=s.data[t];r.push({key:{status:"valid",value:t},value:e._parse(new T(s,n,s.path,t)),alwaysSet:t in s.data})}}return s.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of r){const s=await t.key;e.push({key:s,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>v.mergeObjectSync(t,e))):v.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new Q({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{var n,a,i,r;const o=null!==(i=null===(a=(n=this._def).errorMap)||void 0===a?void 0:a.call(n,t,s).message)&&void 0!==i?i:s.defaultError;return"unrecognized_keys"===t.code?{message:null!==(r=C.errToObj(e).message)&&void 0!==r?r:o}:{message:o}}}:{}})}strip(){return new Q({...this._def,unknownKeys:"strip"})}passthrough(){return new Q({...this._def,unknownKeys:"passthrough"})}extend(e){return new Q({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Q({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ee.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Q({...this._def,catchall:e})}pick(e){const t={};return r.objectKeys(e).forEach((s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])})),new Q({...this._def,shape:()=>t})}omit(e){const t={};return r.objectKeys(this.shape).forEach((s=>{e[s]||(t[s]=this.shape[s])})),new Q({...this._def,shape:()=>t})}deepPartial(){return X(this)}partial(e){const t={};return r.objectKeys(this.shape).forEach((s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()})),new Q({...this._def,shape:()=>t})}required(e){const t={};return r.objectKeys(this.shape).forEach((s=>{if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof ve;)e=e._def.innerType;t[s]=e}})),new Q({...this._def,shape:()=>t})}keyof(){return he(r.objectKeys(this.shape))}}Q.create=(e,t)=>new Q({shape:()=>e,unknownKeys:"strip",catchall:G.create(),typeName:Ee.ZodObject,...E(t)}),Q.strictCreate=(e,t)=>new Q({shape:()=>e,unknownKeys:"strict",catchall:G.create(),typeName:Ee.ZodObject,...E(t)}),Q.lazycreate=(e,t)=>new Q({shape:e,unknownKeys:"strip",catchall:G.create(),typeName:Ee.ZodObject,...E(t)});class ee extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map((async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const s=e.map((e=>new u(e.ctx.common.issues)));return g(t,{code:c.invalid_union,unionErrors:s}),y}));{let e;const n=[];for(const a of s){const s={...t,common:{...t.common,issues:[]},parent:null},i=a._parseSync({data:t.data,path:t.path,parent:s});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:s}),s.common.issues.length&&n.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=n.map((e=>new u(e)));return g(t,{code:c.invalid_union,unionErrors:a}),y}}get options(){return this._def.options}}ee.create=(e,t)=>new ee({options:e,typeName:Ee.ZodUnion,...E(t)});const te=e=>e instanceof ce?te(e.schema):e instanceof ge?te(e.innerType()):e instanceof ue?[e.value]:e instanceof pe?e.options:e instanceof me?Object.keys(e.enum):e instanceof _e?te(e._def.innerType):e instanceof K?[void 0]:e instanceof W?[null]:null;class se extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.object)return g(t,{code:c.invalid_type,expected:d.object,received:t.parsedType}),y;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(g(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const s of t){const t=te(s.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new se({typeName:Ee.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...E(s)})}}function ne(e,t){const s=l(e),n=l(t);if(e===t)return{valid:!0,data:e};if(s===d.object&&n===d.object){const s=r.objectKeys(t),n=r.objectKeys(e).filter((e=>-1!==s.indexOf(e))),a={...e,...t};for(const s of n){const n=ne(e[s],t[s]);if(!n.valid)return{valid:!1};a[s]=n.data}return{valid:!0,data:a}}if(s===d.array&&n===d.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let n=0;n{if(w(e)||w(n))return y;const a=ne(e.value,n.value);return a.valid?((k(e)||k(n))&&t.dirty(),{status:t.value,value:a.data}):(g(s,{code:c.invalid_intersection_types}),y)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ae.create=(e,t,s)=>new ae({left:e,right:t,typeName:Ee.ZodIntersection,...E(s)});class ie extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==d.array)return g(s,{code:c.invalid_type,expected:d.array,received:s.parsedType}),y;if(s.data.lengththis._def.items.length&&(g(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...s.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new T(s,e,s.path,t)):null})).filter((e=>!!e));return s.common.async?Promise.all(n).then((e=>v.mergeArray(t,e))):v.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ie({...this._def,rest:e})}}ie.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ie({items:e,typeName:Ee.ZodTuple,rest:null,...E(t)})};class re extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==d.object)return g(s,{code:c.invalid_type,expected:d.object,received:s.parsedType}),y;const n=[],a=this._def.keyType,i=this._def.valueType;for(const e in s.data)n.push({key:a._parse(new T(s,e,s.path,e)),value:i._parse(new T(s,s.data[e],s.path,e))});return s.common.async?v.mergeObjectAsync(t,n):v.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return new re(t instanceof O?{keyType:e,valueType:t,typeName:Ee.ZodRecord,...E(s)}:{keyType:M.create(),valueType:e,typeName:Ee.ZodRecord,...E(t)})}}class oe extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==d.map)return g(s,{code:c.invalid_type,expected:d.map,received:s.parsedType}),y;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map((([e,t],i)=>({key:n._parse(new T(s,e,s.path,[i,"key"])),value:a._parse(new T(s,t,s.path,[i,"value"]))})));if(s.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const s of i){const n=await s.key,a=await s.value;if("aborted"===n.status||"aborted"===a.status)return y;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const s of i){const n=s.key,a=s.value;if("aborted"===n.status||"aborted"===a.status)return y;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}oe.create=(e,t,s)=>new oe({valueType:t,keyType:e,typeName:Ee.ZodMap,...E(s)});class de extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==d.set)return g(s,{code:c.invalid_type,expected:d.set,received:s.parsedType}),y;const n=this._def;null!==n.minSize&&s.data.sizen.maxSize.value&&(g(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(e){const s=new Set;for(const n of e){if("aborted"===n.status)return y;"dirty"===n.status&&t.dirty(),s.add(n.value)}return{status:t.value,value:s}}const r=[...s.data.values()].map(((e,t)=>a._parse(new T(s,e,s.path,t))));return s.common.async?Promise.all(r).then((e=>i(e))):i(r)}min(e,t){return new de({...this._def,minSize:{value:e,message:C.toString(t)}})}max(e,t){return new de({...this._def,maxSize:{value:e,message:C.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}de.create=(e,t)=>new de({valueType:e,minSize:null,maxSize:null,typeName:Ee.ZodSet,...E(t)});class le extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.function)return g(t,{code:c.invalid_type,expected:d.function,received:t.parsedType}),y;function s(e,s){return f({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),h].filter((e=>!!e)),issueData:{code:c.invalid_arguments,argumentsError:s}})}function n(e,s){return f({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),h].filter((e=>!!e)),issueData:{code:c.invalid_return_type,returnTypeError:s}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof fe){const e=this;return b((async function(...t){const r=new u([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw r.addIssue(s(t,e)),r})),d=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(d,a).catch((e=>{throw r.addIssue(n(d,e)),r}))}))}{const e=this;return b((function(...t){const r=e._def.args.safeParse(t,a);if(!r.success)throw new u([s(t,r.error)]);const o=Reflect.apply(i,this,r.data),d=e._def.returns.safeParse(o,a);if(!d.success)throw new u([n(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new le({...this._def,args:ie.create(e).rest(H.create())})}returns(e){return new le({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new le({args:e||ie.create([]).rest(H.create()),returns:t||H.create(),typeName:Ee.ZodFunction,...E(s)})}}class ce extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ce.create=(e,t)=>new ce({getter:e,typeName:Ee.ZodLazy,...E(t)});class ue extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}function he(e,t){return new pe({values:e,typeName:Ee.ZodEnum,...E(t)})}ue.create=(e,t)=>new ue({value:e,typeName:Ee.ZodLiteral,...E(t)});class pe extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),s=this._def.values;return g(t,{expected:r.joinValues(s),received:t.parsedType,code:c.invalid_type}),y}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return g(t,{received:t.data,code:c.invalid_enum_value,options:s}),y}return b(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return pe.create(e)}exclude(e){return pe.create(this.options.filter((t=>!e.includes(t))))}}pe.create=he;class me extends O{_parse(e){const t=r.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==d.string&&s.parsedType!==d.number){const e=r.objectValues(t);return g(s,{expected:r.joinValues(e),received:s.parsedType,code:c.invalid_type}),y}if(-1===t.indexOf(e.data)){const e=r.objectValues(t);return g(s,{received:s.data,code:c.invalid_enum_value,options:e}),y}return b(e.data)}get enum(){return this._def.values}}me.create=(e,t)=>new me({values:e,typeName:Ee.ZodNativeEnum,...E(t)});class fe extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.promise&&!1===t.common.async)return g(t,{code:c.invalid_type,expected:d.promise,received:t.parsedType}),y;const s=t.parsedType===d.promise?t.data:Promise.resolve(t.data);return b(s.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}fe.create=(e,t)=>new fe({type:e,typeName:Ee.ZodPromise,...E(t)});class ge extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:e=>{g(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===n.type){const e=n.transform(s.data,a);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:s.path,parent:s}))):this._def.schema._parseSync({data:e,path:s.path,parent:s})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,a);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const n=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===n.status?y:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((s=>"aborted"===s.status?y:("dirty"===s.status&&t.dirty(),e(s.value).then((()=>({status:t.value,value:s.value}))))))}if("transform"===n.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!x(e))return e;const i=n.transform(e.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>x(e)?Promise.resolve(n.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}r.assertNever(n)}}ge.create=(e,t,s)=>new ge({schema:e,typeName:Ee.ZodEffects,effect:t,...E(s)}),ge.createWithPreprocess=(e,t,s)=>new ge({schema:t,effect:{type:"preprocess",transform:e},typeName:Ee.ZodEffects,...E(s)});class ve extends O{_parse(e){return this._getType(e)===d.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Ee.ZodOptional,...E(t)});class ye extends O{_parse(e){return this._getType(e)===d.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:Ee.ZodNullable,...E(t)});class _e extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===d.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}_e.create=(e,t)=>new _e({innerType:e,typeName:Ee.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...E(t)});class be extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return N(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new u(s.common.issues)},input:s.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new u(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}be.create=(e,t)=>new be({innerType:e,typeName:Ee.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...E(t)});class we extends O{_parse(e){if(this._getType(e)!==d.nan){const t=this._getOrReturnCtx(e);return g(t,{code:c.invalid_type,expected:d.nan,received:t.parsedType}),y}return{status:"valid",value:e.data}}}we.create=e=>new we({typeName:Ee.ZodNaN,...E(e)});const ke=Symbol("zod_brand");class xe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ne extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),_(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})()}{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new Ne({in:e,out:t,typeName:Ee.ZodPipeline})}}class Ce extends O{_parse(e){const t=this._def.innerType._parse(e);return x(t)&&(t.value=Object.freeze(t.value)),t}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:Ee.ZodReadonly,...E(t)});const Te=(e,t={},s)=>e?q.create().superRefine(((n,a)=>{var i,r;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(r=null!==(i=e.fatal)&&void 0!==i?i:s)||void 0===r||r,d="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...d,fatal:o})}})):q.create(),Ze={object:Q.lazycreate};var Ee;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ee||(Ee={}));const Oe=M.create,Se=V.create,Pe=we.create,Re=U.create,Ae=z.create,Ie=F.create,je=B.create,Le=K.create,De=W.create,Me=q.create,$e=H.create,Ve=G.create,Ue=J.create,ze=Y.create,Fe=Q.create,Be=Q.strictCreate,Ke=ee.create,We=se.create,qe=ae.create,He=ie.create,Ge=re.create,Je=oe.create,Ye=de.create,Xe=le.create,Qe=ce.create,et=ue.create,tt=pe.create,st=me.create,nt=fe.create,at=ge.create,it=ve.create,rt=ye.create,ot=ge.createWithPreprocess,dt=Ne.create,lt={string:e=>M.create({...e,coerce:!0}),number:e=>V.create({...e,coerce:!0}),boolean:e=>z.create({...e,coerce:!0}),bigint:e=>U.create({...e,coerce:!0}),date:e=>F.create({...e,coerce:!0})},ct=y;var ut=Object.freeze({__proto__:null,defaultErrorMap:h,setErrorMap:function(e){p=e},getErrorMap:m,makeIssue:f,EMPTY_PATH:[],addIssueToContext:g,ParseStatus:v,INVALID:y,DIRTY:_,OK:b,isAborted:w,isDirty:k,isValid:x,isAsync:N,get util(){return r},get objectUtil(){return o},ZodParsedType:d,getParsedType:l,ZodType:O,ZodString:M,ZodNumber:V,ZodBigInt:U,ZodBoolean:z,ZodDate:F,ZodSymbol:B,ZodUndefined:K,ZodNull:W,ZodAny:q,ZodUnknown:H,ZodNever:G,ZodVoid:J,ZodArray:Y,ZodObject:Q,ZodUnion:ee,ZodDiscriminatedUnion:se,ZodIntersection:ae,ZodTuple:ie,ZodRecord:re,ZodMap:oe,ZodSet:de,ZodFunction:le,ZodLazy:ce,ZodLiteral:ue,ZodEnum:pe,ZodNativeEnum:me,ZodPromise:fe,ZodEffects:ge,ZodTransformer:ge,ZodOptional:ve,ZodNullable:ye,ZodDefault:_e,ZodCatch:be,ZodNaN:we,BRAND:ke,ZodBranded:xe,ZodPipeline:Ne,ZodReadonly:Ce,custom:Te,Schema:O,ZodSchema:O,late:Ze,get ZodFirstPartyTypeKind(){return Ee},coerce:lt,any:Me,array:ze,bigint:Re,boolean:Ae,date:Ie,discriminatedUnion:We,effect:at,enum:tt,function:Xe,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Te((t=>t instanceof e),t),intersection:qe,lazy:Qe,literal:et,map:Je,nan:Pe,nativeEnum:st,never:Ve,null:De,nullable:rt,number:Se,object:Fe,oboolean:()=>Ae().optional(),onumber:()=>Se().optional(),optional:it,ostring:()=>Oe().optional(),pipeline:dt,preprocess:ot,promise:nt,record:Ge,set:Ye,strictObject:Be,string:Oe,symbol:je,transformer:at,tuple:He,undefined:Le,union:Ke,unknown:$e,void:Ue,NEVER:ct,ZodIssueCode:c,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:u});class ht{constructor(){this.animate="none",this.animate_duration=200,this.enable=!0,this.enable_mouse_swipe=!1,this.logger_level=n.WARN,this.prevent_default=!1,this.skip_hidden=!0,this.skip_subviews=!0,this.skip_tabs=[],this.swipe_amount=.15,this.wrap=!0}getAnimate(){return this.animate}getAnimateDuration(){return this.animate_duration}getEnable(){return this.enable}getEnableMouseSwipe(){return this.enable_mouse_swipe}getLoggerLevel(){return this.logger_level}getPreventDefault(){return this.prevent_default}getSkipHidden(){return this.skip_hidden}getSkipSubviews(){return this.skip_subviews}getSkipTabs(){return this.skip_tabs}getSwipeAmount(){return this.swipe_amount}getWrap(){return this.wrap}static parseConfig(e){if(t=e,!pt.safeParse(t).success)return a.loge(i,"Found invalid configuration."),null;var t;const s=new ht;switch(null!=e.animate&&(s.animate=e.animate),null!=e.animate_duration&&(s.animate_duration=e.animate_duration),null!=e.enable&&(s.enable=e.enable),null!=e.enable_mouse_swipe&&(s.enable_mouse_swipe=e.enable_mouse_swipe),e.logger_level){case"verbose":s.logger_level=n.VERBOSE;break;case"debug":s.logger_level=n.DEBUG;break;case"info":s.logger_level=n.INFO;break;case"warn":s.logger_level=n.WARN;break;case"error":s.logger_level=n.ERROR;break;case null:case void 0:break;default:{const t=e.logger_level;throw new Error(`Unhandled case: ${t}`)}}return null!=e.prevent_default&&(s.prevent_default=e.prevent_default),null!=e.skip_hidden&&(s.skip_hidden=e.skip_hidden),null!=e.skip_subviews&&(s.skip_subviews=e.skip_subviews),null!=e.skip_tabs&&(s.skip_tabs=String(e.skip_tabs).replace(/\s+/g,"").split(",").map((e=>parseInt(e)))),null!=e.swipe_amount&&(s.swipe_amount=e.swipe_amount/100),null!=e.wrap&&(s.wrap=e.wrap),s}}const pt=ut.object({animate:ut.union([ut.literal("none"),ut.literal("swipe"),ut.literal("fade"),ut.literal("flip")]).optional(),animate_duration:ut.number().optional(),enable:ut.boolean().optional(),enable_mouse_swipe:ut.boolean().optional(),logger_level:ut.union([ut.literal("verbose"),ut.literal("debug"),ut.literal("info"),ut.literal("warn"),ut.literal("error")]).optional(),prevent_default:ut.boolean().optional(),skip_hidden:ut.boolean().optional(),skip_subviews:ut.boolean().optional(),skip_tabs:ut.coerce.string().optional(),swipe_amount:ut.number().optional(),wrap:ut.boolean().optional()});class mt{constructor(e){this.domNodes=[],this.observers=[],this.domNodeAddedCallbacks=[],this.domNodeRemovedCallbacks=[],this.selectorPaths=e,this.domNodes=new Array(this.selectorPaths.length),this.observers=new Array(this.selectorPaths.length)}addDomNodeAddedCallback(e){a.logv(i,'Adding callback to PageObject: "'+this.selectorPaths[this.selectorPaths.length-1]+'".'),0==this.domNodeAddedCallbacks.length&&0==this.domNodeRemovedCallbacks.length&&this.createNodeObserversFrom(0),this.domNodeAddedCallbacks.push(e)}toString(){return this.selectorPaths.join("→")}getDomNode(){const e=this.domNodes.length-1;return a.logv(i,"Getting DOM node "+this.toString()+"."),this.getDomNodeAt(e)}getSelectorPaths(){return this.selectorPaths.slice()}getDomNodeAt(e){var t;const s=this.domNodes[e];if(1==(null==s?void 0:s.isConnected))return s;a.logv(i,"Recursively Getting DOM node "+e+" "+this.selectorPaths[e]+" in "+this.toString()+".");const n=0==e?document:this.getDomNodeAt(e-1);return"$"==this.selectorPaths[e]?this.domNodes[e]=n instanceof HTMLElement&&n.shadowRoot?n.shadowRoot:null:this.domNodes[e]=null!==(t=null==n?void 0:n.querySelector(this.selectorPaths[e]))&&void 0!==t?t:null,this.domNodes[e]}createNodeObserversFrom(e){var t;a.logv(i,"Creating observer for "+e+" "+this.selectorPaths[e]+" in "+this.toString()+".");const s=0==e?document:this.getDomNodeAt(e-1);if(null!=s)if(this.observers[e]=new MutationObserver((t=>{for(const s of t){for(const t of s.addedNodes)t instanceof HTMLElement&&("$"==this.selectorPaths[e]||t.matches(this.selectorPaths[e]))&&(a.logd(i,'DOM node added: "'+t.nodeName.toLowerCase()+'".'),this.domNodes[e]=t,e==this.selectorPaths.length-1?this.invokeDomNodeAddedCallbacks(t):this.createNodeObserversFrom(e+1));for(const t of s.removedNodes)t instanceof HTMLElement&&("$"==this.selectorPaths[e]||t.matches(this.selectorPaths[e]))&&(a.logd(i,'DOM node removed: "'+t.nodeName.toLowerCase()+'".'),this.domNodes[e]=null,ea)return!0;if(t{gt.readConfig()})),yield gt.readConfig()}))}static registerConfigObserver(e){gt.configObservers.push(e)}static unregisterConfigObserver(e){const t=gt.configObservers.indexOf(e);t>-1?gt.configObservers.splice(t,1):a.loge(i,"Internal error while unregistering a configObserver: not found.")}static readConfig(){var t,s,n,r,o,d,l,c;return e(this,void 0,void 0,(function*(){a.logd(i,"Attempting to read config...");const e=ft.haPanelLovelace.getDomNode(),u=null!==(n=null===(s=null===(t=null==e?void 0:e.lovelace)||void 0===t?void 0:t.config)||void 0===s?void 0:s.swipe_nav)&&void 0!==n?n:{};JSON.stringify(u)!=JSON.stringify(gt.rawConfig)&>.saveConfig(u);const h=null===(r=null==e?void 0:e.route)||void 0===r?void 0:r.prefix;null!=h&&(gt.panel=h.replace("/",""));const p=null===(d=null===(o=null==e?void 0:e.lovelace)||void 0===o?void 0:o.config)||void 0===d?void 0:d.views;null!=p&&(gt.views=p);const m=null===(c=null===(l=null==e?void 0:e.hass)||void 0===l?void 0:l.user)||void 0===c?void 0:c.id;null!=m&&(gt.currentUserId=m)}))}static saveConfig(e){gt.rawConfig=e;const t=ht.parseConfig(e);null!=t&&(JSON.stringify(t)!=JSON.stringify(gt.currentConfig)?(gt.currentConfig=t,gt.configObservers.forEach((e=>{e.callback()}))):a.logd(i,"Config is equivalent."))}}gt.currentConfig=new ht,gt.panel=null,gt.views=null,gt.currentUserId=null,gt.rawConfig=null,gt.configObservers=[];class vt{constructor(e){this.callback=e}}const yt=["ha-tabs","paper-tabs","hui-badge-edit-mode","hui-card-edit-mode",".section-actions .handle","hui-map-card",".ha-scrollbar","ha-sidebar","ha-slider","input[type=range]","#slider","better-thermostat-ui-card","big-slider-card","floor3d-card","gallery-card","#graph-wrapper svg.apexcharts-svg","history-explorer-card",".horizontal-buttons-stack-container","my-slider","my-slider-v2","mwc-tab-bar","#plotly g.draglayer",".range-slider",".bubble-button-card","round-slider","sankey-chart","slider-button-card","swipe-card",".swiper","toucharea","xiaomi-vacuum-map-card","mushroom-slider","ha-bar-slider"].join(",");var _t,bt,wt,kt,xt,Nt,Ct,Tt,Zt,Et;class Ot{static init(){var e;null===(e=t(this,_t,"f",Nt))||void 0===e||e.abort(),s(this,_t,new AbortController,"f",Nt);const n=ft.haAppLayout.getDomNode();null!=n&&(a.logd(i,"Initializing SwipeManger..."),n.addEventListener("touchstart",(e=>{t(this,_t,"m",Ct).call(this,e)}),{signal:t(this,_t,"f",Nt).signal,passive:!0}),n.addEventListener("touchmove",(e=>{t(this,_t,"m",Tt).call(this,e)}),{signal:t(this,_t,"f",Nt).signal,passive:!1}),n.addEventListener("touchend",(()=>{t(this,_t,"m",Zt).call(this)}),{signal:t(this,_t,"f",Nt).signal,passive:!0}),n.addEventListener("mousedown",(e=>{t(this,_t,"m",Ct).call(this,e)}),{signal:t(this,_t,"f",Nt).signal,passive:!0}),gt.getCurrentConfig().getEnableMouseSwipe()&&(n.addEventListener("mousemove",(e=>{t(this,_t,"m",Tt).call(this,e)}),{signal:t(this,_t,"f",Nt).signal,passive:!1}),n.addEventListener("mouseup",(()=>{t(this,_t,"m",Zt).call(this)}),{signal:t(this,_t,"f",Nt).signal,passive:!0})))}static animatedNavigateTo(e,t){const s=ft.haAppLayoutView.getDomNode();if(null==s)a.loge(i,"view is null when attempting to change tab.");else{const n=gt.getCurrentConfig().getAnimate();if("none"==n)_t.navigateTo(e);else{const a=gt.getCurrentConfig().getAnimateDuration();if(s.style.transition=`transform ${a}ms ease-in, opacity ${a}ms ease-in`,"swipe"==n){const n=ft.haAppLayout.getDomNode();null!=n&&(n.style.overflow="hidden");const i=t?screen.width/2+"px":`-${screen.width/2}px`,r=t?`-${screen.width/2}px`:screen.width/2+"px";s.style.opacity="0",s.style.transform=`translate(${i}, 0)`,setTimeout((function(){s.style.transition="",s.style.transform=`translate(${r}, 0)`,_t.navigateTo(e)}),a+10)}else if("fade"==n)s.style.opacity="0",setTimeout((function(){s.style.transition="",_t.navigateTo(e),s.style.opacity="0"}),a+10);else{if("flip"!=n){throw new Error(`Unhandled case: ${n}`)}s.style.transform="rotatey(90deg)",s.style.opacity="0.25",setTimeout((function(){s.style.transition="",_t.navigateTo(e)}),a+10)}setTimeout((function(){s.style.transition=`transform ${a}ms ease-out, opacity ${a}ms ease-out`,s.style.opacity="1",s.style.transform=""}),a+50),"swipe"==n&&setTimeout((function(){const e=ft.haAppLayout.getDomNode();null!=e&&(e.style.overflow="")}),2*a+100)}}}static navigateTo(e){const t=gt.getPanel();window.history.pushState(null,"","/"+t+"/"+e),window.dispatchEvent(new CustomEvent("location-changed"))}}_t=Ot,Ct=function(e){let t;if(null!=window.TouchEvent&&e instanceof TouchEvent)t="touch";else{if(!(e instanceof MouseEvent)){throw new Error(`Unhandled case: ${e}`)}t="click"}if(0!=gt.getCurrentConfig().getEnable()){if(null!=window.TouchEvent&&e instanceof TouchEvent&&e.touches.length>1)return s(this,_t,null,"f",bt),s(this,_t,null,"f",wt),void a.logd(i,"Ignoring "+t+": multiple touchpoints detected.");if(e instanceof MouseEvent&&!gt.getCurrentConfig().getEnableMouseSwipe())return s(this,_t,null,"f",bt),s(this,_t,null,"f",wt),void a.logd(i,"Ignoring "+t+": swiping via mouse is disabled.");if("object"==typeof e.composedPath())for(const s of e.composedPath())if(s instanceof Element){if("HUI-VIEW"==s.nodeName)break;if(s.matches&&s.matches(yt))return void a.logd(i,"Ignoring "+t+' on "'+(null!=s.nodeName?s.nodeName.toLowerCase():"unknown")+'".')}if(null!=window.TouchEvent&&e instanceof TouchEvent)s(this,_t,e.touches[0].clientX,"f",bt),s(this,_t,e.touches[0].clientY,"f",wt);else{if(!(e instanceof MouseEvent)){throw new Error(`Unhandled case: ${e}`)}s(this,_t,e.clientX,"f",bt),s(this,_t,e.clientY,"f",wt)}}else a.logd(i,"Ignoring "+t+": Swipe navigation is disabled in the config.")},Tt=function(e){if(t(this,_t,"f",bt)&&t(this,_t,"f",wt)){if(null!=window.TouchEvent&&e instanceof TouchEvent)s(this,_t,t(this,_t,"f",bt)-e.touches[0].clientX,"f",kt),s(this,_t,t(this,_t,"f",wt)-e.touches[0].clientY,"f",xt);else{if(!(e instanceof MouseEvent)){throw new Error(`Unhandled case: ${e}`)}s(this,_t,t(this,_t,"f",bt)-e.clientX,"f",kt),s(this,_t,t(this,_t,"f",wt)-e.clientY,"f",xt)}Math.abs(t(this,_t,"f",kt))>Math.abs(t(this,_t,"f",xt))&>.getCurrentConfig().getPreventDefault()&&e.preventDefault()}},Zt=function(){var e;if(null!=t(this,_t,"f",kt)&&null!=t(this,_t,"f",xt))if(Math.abs(t(this,_t,"f",kt)){a.setLoggerLevel(gt.getCurrentConfig().getLoggerLevel()),a.logi(i,"New configuration loaded.")}))),yield gt.readAndMonitorConfig(),ft.haAppLayout.addDomNodeAddedCallback((()=>{Ot.init()})),Ot.init()}))}(); diff --git a/www/vertical-stack-in-card.js b/www/vertical-stack-in-card.js index 8349132..d809197 100644 --- a/www/vertical-stack-in-card.js +++ b/www/vertical-stack-in-card.js @@ -180,10 +180,23 @@ class VerticalStackInCard extends HTMLElement { const sizes = await Promise.all(this._refCards.map(this._computeCardSize)); return sizes.reduce((a, b) => a + b, 0); } -} -customElements.define('vertical-stack-in-card', VerticalStackInCard); + static getConfigElement() { + return customElements.get('hui-vertical-stack-card').getConfigElement(); + } -window.customElements.get('vertical-stack-in-card').getConfigElement = function() { - return document.createElement('hui-stack-card-editor'); + static getStubConfig() { + return { + cards: [], + }; + } } + +customElements.define('vertical-stack-in-card', VerticalStackInCard); +window.customCards = window.customCards || []; +window.customCards.push({ + type: 'vertical-stack-in-card', + name: 'Vertical Stack In Card', + description: 'Group multiple cards into a single sleek card.', + preview: false, +}); \ No newline at end of file