/*!TikTok attaches importance to your privacy and safety. We use this script to control webapi usages and make sure they are within our privacy policy.*/ !function(){"use strict";var e,t;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const i of e)t[i]=i;return t},e.getValidEnumValues=t=>{const i=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of i)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 i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t},e.find=(e,t)=>{for(const i of e)if(t(i))return i},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.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}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const i=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),n=e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return Number.isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":return Array.isArray(e)?i.array:null===e?i.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?i.promise:"undefined"!=typeof Map&&e instanceof Map?i.map:"undefined"!=typeof Set&&e instanceof Set?i.set:"undefined"!=typeof Date&&e instanceof Date?i.date:i.object;default:return i.unknown}},r=e.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 a extends Error{get errors(){return this.issues}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}format(e){const t=e||function(e){return e.message},i={_errors:[]},n=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(n);else if("invalid_return_type"===r.code)n(r.returnTypeError);else if("invalid_arguments"===r.code)n(r.argumentsError);else if(0===r.path.length)i._errors.push(t(r));else{let e=i,n=0;for(;ne.message)){const t={},i=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}a.create=e=>new a(e);const s=(t,n)=>{let a;switch(t.code){case r.invalid_type:a=t.received===i.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case r.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case r.unrecognized_keys:a=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case r.invalid_union:a="Invalid input";break;case r.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case r.invalid_enum_value:a=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case r.invalid_arguments:a="Invalid function arguments";break;case r.invalid_return_type:a="Invalid function return type";break;case r.invalid_date:a="Invalid date";break;case r.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):a="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case r.too_small:a="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type||"bigint"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case r.too_big:a="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case r.custom:a="Invalid input";break;case r.invalid_intersection_types:a="Intersection results could not be merged";break;case r.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case r.not_finite:a="Number must be finite";break;default:a=n.defaultError,e.assertNever(t)}return{message:a}};let o=s;function l(e,t){const i=o,n=(e=>{const{data:t,path:i,errorMaps:n,issueData:r}=e,a=[...i,...r.path||[]],s={...r,path:a};if(void 0!==r.message)return{...r,path:a,message:r.message};let o="";const l=n.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(s,{data:t,defaultError:o}).message;return{...r,path:a,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===s?void 0:s].filter((e=>!!e))});e.common.issues.push(n)}class c{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const n of t){if("aborted"===n.status)return d;"dirty"===n.status&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const e of t){const t=await e.key,n=await e.value;i.push({key:t,value:n})}return c.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const n of t){const{key:t,value:r}=n;if("aborted"===t.status)return d;if("aborted"===r.status)return d;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!n.alwaysSet||(i[t.value]=r.value)}return{status:e.value,value:i}}}const d=Object.freeze({status:"aborted"}),u=e=>({status:"dirty",value:e}),h=e=>({status:"valid",value:e}),m=e=>"aborted"===e.status,p=e=>"dirty"===e.status,f=e=>"valid"===e.status,I=e=>"undefined"!=typeof Promise&&e instanceof Promise;var b;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(b||(b={}));class y{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const v=(e,t)=>{if(f(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 a(e.common.issues);return this._error=t,this._error}}};function _(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:n,description:r}=e;if(t&&(i||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:r};return{errorMap:(t,r)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??r.defaultError}:void 0===r.data?{message:a??n??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:a??i??r.defaultError}},description:r}}class w{get description(){return this._def.description}_getType(e){return n(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new c,ctx:{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(I(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 i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){const i={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},r=this._parseSync({data:e,path:i.path,parent:i});return v(i,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return f(i)?{value:i.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>f(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},r=this._parse({data:e,path:i.path,parent:i}),a=await(I(r)?r:Promise.resolve(r));return v(i,a)}refine(e,t){const i=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const a=e(t),s=()=>n.addIssue({code:r.custom,...i(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((i,n)=>!!e(i)||(n.addIssue("function"==typeof t?t(i,n):t),!1)))}_refinement(e){return new be({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ye.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ie.create(this)}promise(){return Ie.create(this,this._def)}or(e){return ae.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new be({..._(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new _e({..._(this._def),innerType:this,defaultValue:t,typeName:Re.ZodDefault})}brand(){return new Je({typeName:Re.ZodBranded,type:this,..._(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new we({..._(this._def),innerType:this,catchValue:t,typeName:Re.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return je.create(this,e)}readonly(){return ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,J=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Z]{26}$/i,g=/^[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,R=/^[a-z0-9_-]{21}$/i,X=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,G=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,x=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let S;const W=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Y=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,O=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,V=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,k=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,C=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,F="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",L=new RegExp(`^${F}$`);function N(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function U(e){let t=`${F}T${N(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,new RegExp(`^${t}$`)}function H(e,t){if(!X.test(e))return!1;try{const[i]=e.split(".");if(!i)return!1;const n=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),r=JSON.parse(atob(n));return"object"==typeof r&&null!==r&&((!("typ"in r)||"JWT"===r?.typ)&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function B(e,t){return!("v4"!==t&&t||!Y.test(e))||!("v6"!==t&&t||!V.test(e))}class M extends w{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==i.string){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:i.string,received:e.parsedType}),d}const n=new c;let a;for(const i of this._def.checks)if("min"===i.kind)t.data.lengthi.value&&(a=this._getOrReturnCtx(t,a),l(a,{code:r.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if("length"===i.kind){const e=t.data.length>i.value,s=t.data.lengthe.test(t)),{validation:t,code:r.invalid_string,...b.errToObj(i)})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...b.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...b.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...b.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.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 isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===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 isNANOID(){return!!this._def.checks.find((e=>"nanoid"===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 isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===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?i:n;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}M.create=e=>new M({checks:[],typeName:Re.ZodString,coerce:e?.coerce??!1,..._(e)});class A extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==i.number){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:i.number,received:e.parsedType}),d}let n;const a=new c;for(const i of this._def.checks)if("int"===i.kind)e.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),l(n,{code:r.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty());else if("min"===i.kind){(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty())}else"multipleOf"===i.kind?0!==z(t.data,i.value)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):"finite"===i.kind?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),l(n,{code:r.not_finite,message:i.message}),a.dirty()):e.assertNever(i);return{status:a.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,i,n){return new A({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:b.toString(n)}]})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.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"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if("finite"===i.kind||"int"===i.kind||"multipleOf"===i.kind)return!0;"min"===i.kind?(null===t||i.value>t)&&(t=i.value):"max"===i.kind&&(null===e||i.valuenew A({checks:[],typeName:Re.ZodNumber,coerce:e?.coerce||!1,..._(e)});class T extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==i.bigint)return this._getInvalidInput(t);let n;const a=new c;for(const i of this._def.checks)if("min"===i.kind){(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty())}else"multipleOf"===i.kind?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),l(n,{code:r.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):e.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.bigint,received:t.parsedType}),d}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,i,n){return new T({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:b.toString(n)}]})}_addCheck(e){return new T({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.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.valuenew T({checks:[],typeName:Re.ZodBigInt,coerce:e?.coerce??!1,..._(e)});class E extends w{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==i.boolean){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.boolean,received:t.parsedType}),d}return h(e.data)}}E.create=e=>new E({typeName:Re.ZodBoolean,coerce:e?.coerce||!1,..._(e)});class P extends w{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==i.date){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:i.date,received:e.parsedType}),d}if(Number.isNaN(t.data.getTime())){return l(this._getOrReturnCtx(t),{code:r.invalid_date}),d}const n=new c;let a;for(const i of this._def.checks)"min"===i.kind?t.data.getTime()i.value&&(a=this._getOrReturnCtx(t,a),l(a,{code:r.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):e.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.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 P({checks:[],coerce:e?.coerce||!1,typeName:Re.ZodDate,..._(e)});class Q extends w{_parse(e){if(this._getType(e)!==i.symbol){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.symbol,received:t.parsedType}),d}return h(e.data)}}Q.create=e=>new Q({typeName:Re.ZodSymbol,..._(e)});class D extends w{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.undefined,received:t.parsedType}),d}return h(e.data)}}D.create=e=>new D({typeName:Re.ZodUndefined,..._(e)});class $ extends w{_parse(e){if(this._getType(e)!==i.null){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.null,received:t.parsedType}),d}return h(e.data)}}$.create=e=>new $({typeName:Re.ZodNull,..._(e)});class q extends w{constructor(){super(...arguments),this._any=!0}_parse(e){return h(e.data)}}q.create=e=>new q({typeName:Re.ZodAny,..._(e)});class K extends w{constructor(){super(...arguments),this._unknown=!0}_parse(e){return h(e.data)}}K.create=e=>new K({typeName:Re.ZodUnknown,..._(e)});class ee extends w{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.never,received:t.parsedType}),d}}ee.create=e=>new ee({typeName:Re.ZodNever,..._(e)});class te extends w{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.void,received:t.parsedType}),d}return h(e.data)}}te.create=e=>new te({typeName:Re.ZodVoid,..._(e)});class ie extends w{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==i.array)return l(t,{code:r.invalid_type,expected:i.array,received:t.parsedType}),d;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,i=t.data.lengtha.maxLength.value&&(l(t,{code:r.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,i)=>a.type._parseAsync(new y(t,e,t.path,i))))).then((e=>c.mergeArray(n,e)));const s=[...t.data].map(((e,i)=>a.type._parseSync(new y(t,e,t.path,i))));return c.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new ie({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new ie({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new ie({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}function ne(e){if(e instanceof re){const t={};for(const i in e.shape){const n=e.shape[i];t[i]=ye.create(ne(n))}return new re({...e._def,shape:()=>t})}return e instanceof ie?new ie({...e._def,type:ne(e.element)}):e instanceof ye?ye.create(ne(e.unwrap())):e instanceof ve?ve.create(ne(e.unwrap())):e instanceof le?le.create(e.items.map((e=>ne(e)))):e}ie.create=(e,t)=>new ie({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,..._(t)});class re extends w{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),i=e.objectKeys(t);return this._cached={shape:t,keys:i},this._cached}_parse(e){if(this._getType(e)!==i.object){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.object,received:t.parsedType}),d}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof ee&&"strip"===this._def.unknownKeys))for(const e in n.data)s.includes(e)||o.push(e);const u=[];for(const e of s){const t=a[e],i=n.data[e];u.push({key:{status:"valid",value:e},value:t._parse(new y(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ee){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)u.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(l(n,{code:r.unrecognized_keys,keys:o}),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 o){const i=n.data[t];u.push({key:{status:"valid",value:t},value:e._parse(new y(n,i,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of u){const i=await t.key,n=await t.value;e.push({key:i,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>c.mergeObjectSync(t,e))):c.mergeObjectSync(t,u)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new re({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{const n=this._def.errorMap?.(t,i).message??i.defaultError;return"unrecognized_keys"===t.code?{message:b.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new re({...this._def,unknownKeys:"strip"})}passthrough(){return new re({...this._def,unknownKeys:"passthrough"})}extend(e){return new re({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new re({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Re.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new re({...this._def,catchall:e})}pick(t){const i={};for(const n of e.objectKeys(t))t[n]&&this.shape[n]&&(i[n]=this.shape[n]);return new re({...this._def,shape:()=>i})}omit(t){const i={};for(const n of e.objectKeys(this.shape))t[n]||(i[n]=this.shape[n]);return new re({...this._def,shape:()=>i})}deepPartial(){return ne(this)}partial(t){const i={};for(const n of e.objectKeys(this.shape)){const e=this.shape[n];t&&!t[n]?i[n]=e:i[n]=e.optional()}return new re({...this._def,shape:()=>i})}required(t){const i={};for(const n of e.objectKeys(this.shape))if(t&&!t[n])i[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ye;)e=e._def.innerType;i[n]=e}return new re({...this._def,shape:()=>i})}keyof(){return me(e.objectKeys(this.shape))}}re.create=(e,t)=>new re({shape:()=>e,unknownKeys:"strip",catchall:ee.create(),typeName:Re.ZodObject,..._(t)}),re.strictCreate=(e,t)=>new re({shape:()=>e,unknownKeys:"strict",catchall:ee.create(),typeName:Re.ZodObject,..._(t)}),re.lazycreate=(e,t)=>new re({shape:e,unknownKeys:"strip",catchall:ee.create(),typeName:Re.ZodObject,..._(t)});class ae extends w{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;if(t.common.async)return Promise.all(i.map((async e=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const i of e)if("dirty"===i.result.status)return t.common.issues.push(...i.ctx.common.issues),i.result;const i=e.map((e=>new a(e.ctx.common.issues)));return l(t,{code:r.invalid_union,unionErrors:i}),d}));{let e;const n=[];for(const r of i){const i={...t,common:{...t.common,issues:[]},parent:null},a=r._parseSync({data:t.data,path:t.path,parent:i});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:i}),i.common.issues.length&&n.push(i.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new a(e)));return l(t,{code:r.invalid_union,unionErrors:s}),d}}get options(){return this._def.options}}function se(t,r){const a=n(t),s=n(r);if(t===r)return{valid:!0,data:t};if(a===i.object&&s===i.object){const i=e.objectKeys(r),n=e.objectKeys(t).filter((e=>-1!==i.indexOf(e))),a={...t,...r};for(const e of n){const i=se(t[e],r[e]);if(!i.valid)return{valid:!1};a[e]=i.data}return{valid:!0,data:a}}if(a===i.array&&s===i.array){if(t.length!==r.length)return{valid:!1};const e=[];for(let i=0;inew ae({options:e,typeName:Re.ZodUnion,..._(t)});class oe extends w{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=(e,n)=>{if(m(e)||m(n))return d;const a=se(e.value,n.value);return a.valid?((p(e)||p(n))&&t.dirty(),{status:t.value,value:a.data}):(l(i,{code:r.invalid_intersection_types}),d)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}oe.create=(e,t,i)=>new oe({left:e,right:t,typeName:Re.ZodIntersection,..._(i)});class le extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.array)return l(n,{code:r.invalid_type,expected:i.array,received:n.parsedType}),d;if(n.data.lengththis._def.items.length&&(l(n,{code:r.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map(((e,t)=>{const i=this._def.items[t]||this._def.rest;return i?i._parse(new y(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(a).then((e=>c.mergeArray(t,e))):c.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new le({...this._def,rest:e})}}le.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new le({items:e,typeName:Re.ZodTuple,rest:null,..._(t)})};class ce extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.map)return l(n,{code:r.invalid_type,expected:i.map,received:n.parsedType}),d;const a=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map((([e,t],i)=>({key:a._parse(new y(n,e,n.path,[i,"key"])),value:s._parse(new y(n,t,n.path,[i,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const i of o){const n=await i.key,r=await i.value;if("aborted"===n.status||"aborted"===r.status)return d;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const i of o){const n=i.key,r=i.value;if("aborted"===n.status||"aborted"===r.status)return d;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}}}ce.create=(e,t,i)=>new ce({valueType:t,keyType:e,typeName:Re.ZodMap,..._(i)});class de extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.set)return l(n,{code:r.invalid_type,expected:i.set,received:n.parsedType}),d;const a=this._def;null!==a.minSize&&n.data.sizea.maxSize.value&&(l(n,{code:r.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(e){const i=new Set;for(const n of e){if("aborted"===n.status)return d;"dirty"===n.status&&t.dirty(),i.add(n.value)}return{status:t.value,value:i}}const c=[...n.data.values()].map(((e,t)=>s._parse(new y(n,e,n.path,t))));return n.common.async?Promise.all(c).then((e=>o(e))):o(c)}min(e,t){return new de({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new de({...this._def,maxSize:{value:e,message:b.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:Re.ZodSet,..._(t)});class ue extends w{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})}}ue.create=(e,t)=>new ue({getter:e,typeName:Re.ZodLazy,..._(t)});class he extends w{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:r.invalid_literal,expected:this._def.value}),d}return{status:"valid",value:e.data}}get value(){return this._def.value}}function me(e,t){return new pe({values:e,typeName:Re.ZodEnum,..._(t)})}he.create=(e,t)=>new he({value:e,typeName:Re.ZodLiteral,..._(t)});class pe extends w{_parse(t){if("string"!=typeof t.data){const i=this._getOrReturnCtx(t),n=this._def.values;return l(i,{expected:e.joinValues(n),received:i.parsedType,code:r.invalid_type}),d}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),i=this._def.values;return l(e,{received:e.data,code:r.invalid_enum_value,options:i}),d}return h(t.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,t=this._def){return pe.create(e,{...this._def,...t})}exclude(e,t=this._def){return pe.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}pe.create=me;class fe extends w{_parse(t){const n=e.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==i.string&&a.parsedType!==i.number){const t=e.objectValues(n);return l(a,{expected:e.joinValues(t),received:a.parsedType,code:r.invalid_type}),d}if(this._cache||(this._cache=new Set(e.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=e.objectValues(n);return l(a,{received:a.data,code:r.invalid_enum_value,options:t}),d}return h(t.data)}get enum(){return this._def.values}}fe.create=(e,t)=>new fe({values:e,typeName:Re.ZodNativeEnum,..._(t)});class Ie extends w{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.promise&&!1===t.common.async)return l(t,{code:r.invalid_type,expected:i.promise,received:t.parsedType}),d;const n=t.parsedType===i.promise?t.data:Promise.resolve(t.data);return h(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ie.create=(e,t)=>new Ie({type:e,typeName:Re.ZodPromise,..._(t)});class be extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:i,ctx:n}=this._processInputParams(t),r=this._def.effect||null,a={addIssue:e=>{l(n,e),e.fatal?i.abort():i.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){const e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===i.value)return d;const t=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===t.status?d:"dirty"===t.status||"dirty"===i.value?u(t.value):t}));{if("aborted"===i.value)return d;const t=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===t.status?d:"dirty"===t.status||"dirty"===i.value?u(t.value):t}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,a);if(n.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===n.common.async){const t=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===t.status?d:("dirty"===t.status&&i.dirty(),e(t.value),{status:i.value,value:t.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((t=>"aborted"===t.status?d:("dirty"===t.status&&i.dirty(),e(t.value).then((()=>({status:i.value,value:t.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!f(e))return d;const t=r.transform(e.value,a);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:t}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>f(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:i.value,value:e}))):d))}e.assertNever(r)}}be.create=(e,t,i)=>new be({schema:e,typeName:Re.ZodEffects,effect:t,..._(i)}),be.createWithPreprocess=(e,t,i)=>new be({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,..._(i)});class ye extends w{_parse(e){return this._getType(e)===i.undefined?h(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:Re.ZodOptional,..._(t)});class ve extends w{_parse(e){return this._getType(e)===i.null?h(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Re.ZodNullable,..._(t)});class _e extends w{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===i.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}_e.create=(e,t)=>new _e({innerType:e,typeName:Re.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,..._(t)});class we extends w{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return I(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new a(i.common.issues)},input:i.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new a(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}we.create=(e,t)=>new we({innerType:e,typeName:Re.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,..._(t)});class Ze extends w{_parse(e){if(this._getType(e)!==i.nan){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:i.nan,received:t.parsedType}),d}return{status:"valid",value:e.data}}}Ze.create=e=>new Ze({typeName:Re.ZodNaN,..._(e)});class Je extends w{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class je extends w{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?d:"dirty"===e.status?(t.dirty(),u(e.value)):this._def.out._parseAsync({data:e.value,path:i.path,parent:i})})()}{const e=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?d:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:i.path,parent:i})}}static create(e,t){return new je({in:e,out:t,typeName:Re.ZodPipeline})}}class ge extends w{_parse(e){const t=this._def.innerType._parse(e),i=e=>(f(e)&&(e.value=Object.freeze(e.value)),e);return I(t)?t.then((e=>i(e))):i(t)}unwrap(){return this._def.innerType}}var Re;ge.create=(e,t)=>new ge({innerType:e,typeName:Re.ZodReadonly,..._(t)}),re.lazycreate,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"}(Re||(Re={}));const Xe=M.create,Ge=A.create,xe=E.create,Se=$.create,We=q.create,Ye=K.create;ee.create;const Oe=ie.create,Ve=re.create;re.strictCreate;const ke=ae.create;oe.create,le.create;const Ce=ue.create,Fe=he.create,Le=pe.create;Ie.create,ye.create,ve.create;var Ne="main_thread",Ue="out_app",He="cookie_set_by_document",Be="cookie_blocked_on_start",Me="general_fetch",ze="request_log",Ae="webapi",Te="storage_use",Ee="sw_incompat",Pe="ready_for_msg",Qe="force_update_sw",De="frequency",$e="cost_time",qe="main_thread_ctx",Ke="network_rule",et="__PNS_RUNTIME_SW_EVENT__",tt="__PNS_RUNTIME_SE_ERROR__",it="__PNS_RUNTIME__";function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i0&&void 0!==arguments[0]?arguments[0]:lt(),t=globalThis[e];return t||(t={pendingEvents:[],pendingConfig:{},pendingListeners:{},errors:[],pushEvent:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ne,r=arguments.length>3?arguments[3]:void 0;ct(t.pendingEvents,{eventName:e,eventDetail:i,source:n,options:r},dt)},pushError:function(e){ct(t.errors,e,20)},pageContextObservers:[]},globalThis[e]=t),t}function ht(){return"undefined"==typeof globalThis}function mt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt();return ht()?null:ut(e)}var pt=function(e){return e&&"function"==typeof e.then},ft=function(e){return function(t){return pt(e)?e.then(t):t(e)}};function It(e,t,i){return function(){for(var n=arguments.length,r=new Array(n),a=0;a0){var r,a=(r=Math).max.apply(r,st(Object.keys(i).map(Number)))+1,s=Array.from(at(function(e){for(var t=1;te.length)&&(t=e.length);for(var i=0,n=new Array(t);ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i0){var h=!1,m=!0,p=!1,f=void 0;try{for(var I,b=n[Symbol.iterator]();!(m=(I=b.next()).done);m=!0){var y=I.value;e.startsWith(y)&&(h=!0)}}catch(e){p=!0,f=e}finally{try{m||null==b.return||b.return()}finally{if(p)throw f}}if(!h)return!0}return!1}var Mt=["127.0.0.1","localhost"],zt=["is_test_only=1","slardar_heatmap"];function At(e,t){var i=ot(t);if(i){var n=i.search;if(n)for(var r=0;r3&&void 0!==arguments[3])||arguments[3],r=encodeURIComponent(t),a="?"===e[0],s=(a?e.slice(1):e).split("&"),o=!1,l=0;l0||e._blocked||!1}function hi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:location,t=e.href,i=e.host,n=e.pathname,r=e.search,a=e.hash;return{url:t,host:i,path:n,search:r,hash:a}}var mi=We(),pi=ke([Xe(),Xe().array()]),fi=ke([Xe(),Ge(),xe(),Se()]),Ii=Ve({$eq:fi.optional(),$ne:fi.optional(),$exists:xe().optional(),$regex:Xe().optional(),$options:Xe().optional(),$text:Xe().optional(),$prefix:Xe().optional(),$sufin:Oe(Xe()).optional(),$sufnin:Oe(Xe()).optional(),$in:Oe(fi).optional(),$nin:Oe(fi).optional()}),bi=ke([Fe("context"),Fe("self")]),yi=ke([Fe("url"),Fe("host"),Fe("path"),Fe("search"),Fe("body"),Fe("header"),Fe("method"),Fe("destination"),Fe("source")]);ke([Fe("block"),Fe("remove"),Fe("empty"),Fe("replace"),Fe("report")]);var vi,_i=Ve({type:Fe("self")}).and(ke([Ve({handler:Fe("report"),value:Ge()}),Ve({handler:Fe("report_stack"),value:Ge()}),Ve({handler:Fe("block")})])),wi=Ve({type:ke([Fe("url"),Fe("host"),Fe("path"),Fe("search"),Fe("body"),Fe("header"),Fe("method"),Fe("destination")]),field:ke([Oe(ke([Xe(),Ge()])),Xe()]).optional()}).and(ke([Ve({handler:Fe("replace"),pattern:Ii.optional(),value:Ye()}),Ve({handler:ke([Fe("remove"),Fe("empty")])})])),Zi=Ve({type:ke([bi,yi]),field:ke([Xe(),Oe(ke([Xe(),Ge()]))]).optional(),pattern:Ii}),Ji=Ve({$or:Oe(Ce((function(){return vi}))).optional(),$and:Oe(Ce((function(){return vi}))).optional(),$not:Ce((function(){return vi})).optional()}),ji=ke([Zi,Ve({pattern:Ji})]),gi=Zi;vi=Ce((function(){return ji}));var Ri=ke([_i,wi]),Xi=Ve({ruleName:Xe(),priority:Ge().optional(),global:xe().optional(),conditions:Oe(ji),handlers:Oe(Ri)}),Gi=Ve({ruleName:Xe(),priority:Ge().optional(),global:xe().optional(),conditions:Oe(gi),handlers:Oe(Ri)}),xi=Ve({type:Xe().optional(),field:pi,pattern:Ve({$eq:fi.optional(),$ne:fi.optional(),$exists:xe().optional(),$regex:Xe().optional(),$options:Xe().optional(),$text:Xe().optional(),$prefix:Xe().optional(),$sufin:Oe(fi).optional(),$sufnin:Oe(fi).optional(),$in:Oe(fi).optional(),$nin:Oe(fi).optional(),$or:Oe(Ve({})).optional(),$and:Oe(Ve({})).optional(),$not:Ve({}).optional()})}),Si=_i;Ve({ruleName:Xe(),priority:Ge().optional(),global:xe().optional(),conditions:Oe(xi),handlers:Oe(Si)});var Wi=Ve({type:Xe(),field:pi.optional(),pattern:Ii}),Yi=Ve({type:Xe(),handler:Xe(),value:mi.optional(),field:pi.optional(),pattern:Ii.optional()}),Oi=Ve({interval:Ge(),size:Ge(),freqInterval:Ge(),freqSize:Ge(),tenant:Xe().optional(),domain:Xe().optional()}),Vi=Ve({enabled:xe().optional(),sampleRate:Ge(),stackSampleRate:Ge().optional(),stackCollectCookies:Oe(Xe()),blockers:Oe(Ve({domains:Oe(Xe()),cookies:Oe(Xe())})),intercept:Oe(Xi).optional()}),ki=Ve({enabled:xe().optional(),sampleRate:Ge(),stackCollectKeys:Oe(Xe()).optional(),valueRate:Ge()}),Ci=Ve({enabled:xe().optional(),apis:Oe(Ve({apiType:Le(["method","attribute_set","attribute_get","constructor"]),sampleRate:Ge(),apiObj:Xe(),apiName:Xe(),block:xe().optional(),blockWithCallbackIdx:Ge().optional(),blockWithCallbackParams:Ve({}).optional(),paramCondition:Ve({}),withStack:xe(),stackRate:Ge(),withRawArguments:Oe(xe()),freqSampleRate:Ge().optional()}))});Le(["OFF","SCHEMA","RAW"]);var Fi=Ve({enabled:xe().optional(),enableGeneralReport:xe(),generalRate:Ge(),methods:Ve({})}),Li=Ve({ruleName:Xe(),freqSampleRate:Ge(),urlPattern:Oe(Xe()),reportList:Oe(Xe())});Ve({ruleName:Xe(),priority:Ge().optional(),addReplaceHeader:xe().optional(),conditions:Oe(Wi).optional(),handlers:Oe(Yi).optional()});var Ni=Ve({enabled:xe().optional(),sampleRate:Ge(),fpBody:Ge().optional(),rawVal:Oe(Ve({endpoint:Oe(Xe()),keyPath:Oe(Xe())})).optional(),respHeaders:Oe(Xe()).optional(),intercept:Oe(Gi),freq:Oe(Li).optional(),withStack:Oe(Ve({urlPattern:Oe(Xe()),endpoint:Oe(Xe()),rate:Ge()})).optional()}),Ui=Ve({listener:Oe(Ve({type:Le(["navigation_navigate","a_click","submit_click"]),sampleRate:Ge()}))});function Hi(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ Hi=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function o(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,i){return e[t]=i}}function l(e,t,i,n){var r=t&&t.prototype instanceof u?t:u,a=Object.create(r.prototype),s=new J(n||[]);return a._invoke=function(e,t,i){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return g()}for(i.method=r,i.arg=a;;){var s=i.delegate;if(s){var o=_(s,i);if(o){if(o===d)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=c(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}(e,i,s),a}function c(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d={};function u(){}function h(){}function m(){}var p={};o(p,r,(function(){return this}));var f=Object.getPrototypeOf,I=f&&f(f(j([])));I&&I!==t&&i.call(I,r)&&(p=I);var b=m.prototype=u.prototype=Object.create(p);function y(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){function n(r,a,s,o){var l=c(e[r],e,a);if("throw"!==l.type){var d=l.arg,u=d.value;return u&&"object"==typeof u&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,s,o)}),(function(e){n("throw",e,s,o)})):t.resolve(u).then((function(e){d.value=e,s(d)}),(function(e){return n("throw",e,s,o)}))}o(l.arg)}var r;this._invoke=function(e,i){function a(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(a,a):a()}}function _(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=c(i,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var r=n.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function Z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function J(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function j(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var o=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(o&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),Z(i),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;Z(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:j(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},e}function Bi(e){return Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(e)}function Mi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zi(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==i.return||i.return()}finally{if(o)throw a}}}}Ve({reporter:Oi,cookie:Vi,storage:ki,webapi:Ci,jsb:Fi.optional(),network:Ni,event:Ui.optional()});var on=function(e){return"function"==typeof e},ln=function(){};var cn=function(){var e=Object.prototype.hasOwnProperty;return function(t,i){return e.call(t,i)}}(),dn=function(e,t,i){cn(e,i)&&(t[i]=e[i])};function un(e,t){if(!e)return[void 0,e];for(var i,n,r=e;r&&!n;)n=Object.getOwnPropertyDescriptor(r,t),i=r,r=Object.getPrototypeOf(r);return[n,i]}function hn(e,t,i){try{var n=tn(un(e,t),2),r=n[0],a=n[1];if(!(null==r?void 0:r.configurable))return!1;var s={},o=r.set,l=r.get,c=i.set,d=i.get;return o&&c&&(s.set=function(e){c(e)||o.call(this,e)}),l&&d&&(s.get=function(){if(!d())return l.call(this)}),Object.defineProperty(a,t,s),!0}catch(e){}return!1}function mn(e,t,i,n){try{var r=tn(un(e,t),2)[1];if("object"===Bi(r)&&r&&on(r[t])){var a=r[t];r[t]=function(){for(var e=arguments.length,t=new Array(e),r=0;rMath.random()}function fn(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=(new Error).stack;return null!==(e=null==i?void 0:i.split("\n").slice(t).map((function(e){return e.trim()})).join("\n"))&&void 0!==e?e:""}function In(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i="";for(var n in t)i+="; ".concat(n),i+="=".concat(t[n].split(";")[0]);document.cookie="".concat(e,"=; expires=").concat(new Date(Date.now()-864e5).toUTCString()).concat(i)}function bn(e){var t=e.split("=").slice(1).join("=");try{'"'===t[0]&&(t=t.slice(1,-1)),t=t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)}catch(e){}return t}function yn(e,t){return function(){if(Math.random()0||t.stackSampleRate&&n.some((function(e){return e.test(o.name)}));o.stack=i?yn(fn,l)():void 0,e(o)}),o._sample_rate)()}return o.name===wn&&Sn().updatePageContext(gn(null!==(a=function(e){var t,i=e.split(";"),n=!1,r=i.shift(),a=r?decodeURIComponent(r.split("=")[1]):void 0,s=sn(i);try{for(s.s();!(t=s.n()).done;){var o=t.value,l=tn(kn.apply(o).split("=")[0],2),c=l[0],d=l[1];if("max-age"===c&&Number(d)<0)return;"expires"===c&&(n=Date.parse(d)1&&s[e]<=2}));return I};function ar(e,t){for(var i in t){var n=t[i];if(e[i]!==n)return!1}return!0}var sr,or=ln,lr=function(e,t){var i,n=t.apis,r=e.webapiHook,a=e.webapiFreqHook,s=rr({webapi:n}),o=sn(n);try{var l=function(){var e=i.value,t=e.sampleRate,n=e.apiType,o=e.apiObj,l=e.block,c=e.blockUrls,d=void 0===c?[]:c,u=e.blockWithCallbackParams,h=e.blockWithCallbackIdx,m=e.apiName,p=e.paramCondition,f=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,n=sn(e.split(".").filter(Boolean));try{for(n.s();!(t=n.n()).done;){if(!(i=i[t.value]))return null}}catch(e){n.e(e)}finally{n.f()}return i}(o);if(!f)return"continue";var I=It((function(){for(var i=arguments.length,n=new Array(i),c=0;c0?e.reportRequestEventDetail=t.body.then((function(e){return Object.assign(Object.assign({},t),{body:e})})):t.body.then((function(e){var i=Object.assign(Object.assign({},t),{body:e});r.report(i)})):(null!==(l=null===(o=Wn().network.respHeaders)||void 0===o?void 0:o.length)&&void 0!==l?l:0)>0?e.reportRequestEventDetail=t:r.report(t),(null!==(d=null===(c=Wn().network.freq)||void 0===c?void 0:c.length)&&void 0!==d?d:0)>0&&a.freq&&(null===(u=r.freq)||void 0===u||u.call(r,t)),m)return m;t._remove_body=-1!==(null!==(h=t._replaced_fields)&&void 0!==h?h:[]).indexOf("method")&&-1!==["GET","HEAD"].indexOf(t.method);var p=function(e,t){if(!t._replaced_fields||0===t._replaced_fields.length)return e;var i=-1!==t._replaced_fields.indexOf("body"),n=function(){var n=Promise.resolve(void 0);return t._remove_body?Promise.resolve(void 0):(i?(t.body=JSON.stringify(t.body),n=Promise.resolve(t.body)):e.headers.get("Content-Type")&&-1===["GET","HEAD"].indexOf(e.method.toUpperCase())&&(n=e.blob()),n)},r=e;if(-1!==t._replaced_fields.indexOf("url")||t._remove_body)r=n().then((function(i){var n,r={method:t.method,headers:new Headers(null!==(n=t.header_map)&&void 0!==n?n:{}),referrer:e.referrer,referrerPolicy:e.referrerPolicy,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,integrity:e.integrity,keepalive:e.keepalive,signal:e.signal,body:i};return new Request(t.request_url,r)}));else{var a,s={};-1!==t._replaced_fields.indexOf("method")&&(s.method=t.method),-1!==t._replaced_fields.indexOf("header")&&(s.headers=new Headers(null!==(a=t.header_map)&&void 0!==a?a:{})),r=i?n().then((function(t){return s.body=t,new Request(e,s)})):new Request(e,s)}return r}(i,t);return p}))}!function(e){e[e.SW_READY=0]="SW_READY"}(sr||(sr={}));var yr={request_url:"",request_host:"",request_path:"",search:"",method:"",source:$t,_request_time:0,_sample_rate:0,_is_json_body:!1,_replaced_fields:[]};function vr(e,t,i){var n=!1,r=function(){n=!0;var r=(i.getAllResponseHeaders()||"").trim().split(/[\r\n]+/).reduce((function(e,t){var i=t.indexOf(":");if(i>-1){var n=t.slice(0,i).trim().toLowerCase(),r=t.slice(i+1).trim();e[n]=r}return e}),{});pr(i.status,t,e,r)};i.addEventListener("load",r),setTimeout((function(){n||(t(e),i.removeEventListener("load",r))}),5e3)}var _r={};function wr(e){var t=e.OriginalXHR,i=e.rule,n=e.switcher;if(0===Object.keys(_r).length)for(var r in t.prototype)_r[r]={enumerable:!0};return function(){var e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pi(e,t)}(s,e);var t,r,a=(t=s,r=Qi(),function(){var e,i=Ei(t);if(r){var n=Ei(this).constructor;e=Reflect.construct(i,arguments,n)}else e=i.apply(this,arguments);return qi(this,e)});function s(){var e;return Mi(this,s),(e=a.call(this)).__pumbaa_status=null,e.__pumbaa_readyState=null,e.__pumbaa_statusText=null,e.__pumbaa_detail=yr,$i(e)instanceof s||Object.setPrototypeOf($i(e),(this instanceof s?this.constructor:void 0).prototype),e.__pumbaa_callbackEnabled=Object.assign({},n.callbackEnabled),e}return Ai(s,[{key:"status",get:function(){return null===this.__pumbaa_status?en(Ei(s.prototype),"status",this):this.__pumbaa_status},set:function(e){this.__pumbaa_status=e}},{key:"statusText",get:function(){return null===this.__pumbaa_statusText?en(Ei(s.prototype),"statusText",this):this.__pumbaa_statusText},set:function(e){this.__pumbaa_statusText=e}},{key:"readyState",get:function(){return null===this.__pumbaa_readyState?en(Ei(s.prototype),"readyState",this):this.__pumbaa_readyState},set:function(e){this.__pumbaa_readyState=e}},{key:"__pumbaa_hookFunc",value:function(e){var t=this;return function(){for(var i,n,r=arguments.length,a=new Array(r),o=0;o0?vr(this.__pumbaa_detail,n.callback.report,this):n.callback.report(this.__pumbaa_detail),(null!==(u=null===(d=Wn().network.freq)||void 0===d?void 0:d.length)&&void 0!==u?u:0)>0&&this.__pumbaa_callbackEnabled.freq&&(null===(m=(h=n.callback).freq)||void 0===m||m.call(h,this.__pumbaa_detail))}if(Ir(this.__pumbaa_detail)){var k="1"===this.__pumbaa_detail["x-pns-block"]?Pt():Qt();return this.__pumbaa_is_aborted||(this.status=k.status,this.readyState=4,this.statusText=k.statusText,this.__pumbaa_res={headers:nn(k.headers).reduce((function(e,t){var i=tn(t,2),n=i[0],r=i[1];return e[n]=r,e}),{})},xt.error("".concat(this.__pumbaa_detail.method," ").concat(this.__pumbaa_detail.request_url," ").concat(this.status," (").concat(this.statusText,")"))),!0}return void 0!==this.__pumbaa_detail._replaced_fields&&-1!==(null===(p=this.__pumbaa_detail._replaced_fields)||void 0===p?void 0:p.indexOf("body"))?(en(Ei(s.prototype),"send",this).call(this,b?JSON.stringify(this.__pumbaa_detail.body):this.__pumbaa_detail.body),!0):(en(Ei(s.prototype),"send",this).call(this,I),!0)}},{key:"__pumbaa_abort",value:function(){this.__pumbaa_is_aborted=!0}}]),s}(t);for(var r in e.prototype)delete _r[r];return Object.defineProperties(e.prototype,_r),e}()}var Zr="PerformanceObserver"in window,Jr=["xmlhttprequest","fetch","beacon"];function jr(e,t){var i=e.switcher.activeInterceptRules.map((function(e){return ii(e)?e:Object.assign(Object.assign({},e),{handlers:e.handlers.filter((function(e){return"report"===e.handler}))})}));t.getEntries().forEach((function(t){if(e.isBufferedEntry||!Jr.includes(t.initiatorType)){var n=function(e){var t=ot(e.name);if(void 0!==t)return{request_url:t.href,request_host:t.host,request_path:t.pathname,method:"UNKNOWN",source:Dt,search:t.search,_request_time:Math.trunc(e.startTime+performance.timeOrigin),initiator_type:e.initiatorType,resp_status:e.responseStatus,_is_json_body:!1,_sample_rate:0}}(t);if(n){n.perf_buf=e.isBufferedEntry;var r=e.switcher.getState(sr.SW_READY);void 0!==r&&(n.sw_ready="".concat(r));var a,s=Object.assign({},n),o=sn(i);try{for(o.s();!(a=o.n()).done;){var l=a.value;s=ii(l)?ri(s,l):dr(s,l)}}catch(e){o.e(e)}finally{o.f()}s=Object.assign(Object.assign(Object.assign({},s),n),{_sample_rate:s._sample_rate}),setTimeout((function(){var i,n,r,a;-1===e.securityPolicyViolationURLs.indexOf(t.name)&&(e.switcher.callback.report(s),(null!==(n=null===(i=Wn().network.freq)||void 0===i?void 0:i.length)&&void 0!==n?n:0)>0&&e.switcher.callbackEnabled.freq&&(null===(a=(r=e.switcher.callback).freq)||void 0===a||a.call(r,s)))}),100)}}})),e.isBufferedEntry=!1}var gr,Rr,Xr,Gr=vn((function(e){var t={isBufferedEntry:!0,securityPolicyViolationURLs:function(){var e=[];return document.addEventListener("securitypolicyviolation",(function(t){var i=ot(t.blockedURI);i&&"report"!==t.disposition&&-1===e.indexOf(i.href)&&(100===e.length&&e.shift(),e.push(i.href))})),e}(),switcher:e},i=Zr?new PerformanceObserver((function(e){return jr(t,e)})):null;try{null==i||i.observe({type:"resource",buffered:!0})}catch(e){jr(t,{getEntries:function(){return performance.getEntriesByType("resource")}}),null==i||i.observe({entryTypes:["resource"]})}})),xr=function(){for(var e=arguments.length,t=new Array(e),i=0;i0){var l=fr(o.request_url,e.rule.withStack);l&&yn((function(){return o.stack=fn(5)}),l.rate)()}var c={params:a,switcher:e,eventDetail:o},d=Sr(c),u=Ir(c.eventDetail),h=!u&&(t=Xr).call.apply(t,[this].concat(nn(d)));return c.eventDetail.beacon_ret=h,(h||ui(c.eventDetail))&&Wr(c),h}}}},{key:"hookFetch",value:function(){var e=this;if(window.fetch){var t=this.callback;null!=gr||(gr=window.fetch),window.fetch=function(){for(var i,n,r=arguments.length,a=new Array(r),s=0;s0){var d=fr(c.request.url,e.rule.withStack);d&&yn((function(){return c.callstack=fn(5)}),d.rate)()}var u=br(c);function h(e){var i,n=vn((function(e){var i,n,r=e.status,a=c.reportRequestEventDetail,s={};return e.headers.forEach((function(e,t){s[t.toLowerCase()]=e})),pr(r,t.reportLogid,a,s),(null!==(n=null===(i=Wn().network.respHeaders)||void 0===i?void 0:i.length)&&void 0!==n?n:0)>0&&pr(r,t.report,a,s),e}));return(i=e instanceof Request?gr(e):Promise.resolve(e)).then(n).catch((function(){return i}))}return pt(u)?u.then(h):h(u)}}}},{key:"hookXHR",value:function(){null!=Rr||(Rr=window.XMLHttpRequest);var e=wr({OriginalXHR:Rr,rule:this.rule,reporter:this.callback,switcher:this});window.XMLHttpRequest=e}},{key:"initPerformance",value:function(){Gr(this)}}],[{key:"getInstance",value:function(){if(null===e._instance){for(var t=arguments.length,i=new Array(t),n=0;n=100&&i.shift(),i.push(e)}}}(),s=a.check,o=a.push,l={report:vn((function(t){var i,n;if(t.source!==Dt||!(null==s?void 0:s(t.request_url)))if(Gt.log("eventDetail: ".concat(JSON.stringify(t))),Gt.log("[Pumbaa Web SDK] general_fetch. isTikTokTenant: ".concat(Yn(),"; logid: ").concat(null===(i=t.resp_header)||void 0===i?void 0:i["x-tt-logid"],"; rule_name: ").concat(t.rule_name,"; isTikTokPixel: ").concat(On(t.request_host),"; isSlardarOrTEARequest: ").concat(Vn(t.request_host,t.request_path))),!Yn()||!(null===(n=t.resp_header)||void 0===n?void 0:n["x-tt-logid"])||t.rule_name||On(t.request_host))if(Yn()&&!t.rule_name&&Vn(t.request_host,t.request_path))Gt.log("[Pumbaa Web SDK] is Slardar or TEA request, general_fetch skip.");else{Gt.log("[Pumbaa Web SDK] general_fetch continue report.");var r=t._sample_rate;yn((function(){return e.pushEvent(Me,{eventName:Me,eventMetrics:{count:1},eventDetail:t},Ne,{sample_rate:r})}),r)()}else Gt.log("[Pumbaa Web SDK] general_fetch skip.")})),reportLogid:vn((function(t){var i,n;if(t.source!==Dt||!(null==s?void 0:s(t.request_url))){var r=null===(i=t.resp_header)||void 0===i?void 0:i["x-tt-traceflag"],a=null===(n=t.resp_header)||void 0===n?void 0:n["x-tt-logid"];r&&"02"==="".concat(r)&&a&&e.pushEvent(ze,{eventName:ze,eventMetrics:{count:1},eventDetail:t},Ne)}})),freq:n.length>0&&er?vn(Nr(n,e)):void 0},c=new Yr(l,t,{freq:n.length>0},Sn().pageContext);if(navigator&&"serviceWorker"in navigator){var d=jn(),u=d.sw,h=d.sw_version,m=!1;navigator.serviceWorker.addEventListener("message",vn((function(t){var i,n,a,s;if(t.data.event===et){var l=t.data.data;if(Cr.indexOf(l.eventName),Me===l.eventName){if((null!==(i=l.eventDetail)&&void 0!==i?i:{}).rule_name){null==o||o(null!==(a=null===(n=l.eventDetail)||void 0===n?void 0:n._old_url)&&void 0!==a?a:l.eventDetail.request_url);var c=null!==(s=l.eventDetail._sample_rate)&&void 0!==s?s:r;yn((function(){e.pushEvent(l.eventName,l,Ne,{sample_rate:c})}),c)()}l.sw_version||Lr()}m||(m=!0,"string"==typeof u&&"string"==typeof h&&-1===h.split(",").indexOf(l.sw_version)&&setTimeout((function(){var e;navigator.serviceWorker.register((e=u).startsWith("http")?e:"".concat(location.origin).concat(e),{updateViaCache:"none"}),Lr()}),0))}else t.data.event===tt&&t.data.error&&e.pushError(t.data.error)}))),navigator.serviceWorker.ready.then((function(e){var i;c.setState(sr.SW_READY,1);var n=null!==(i=null==e?void 0:e.active)&&void 0!==i?i:navigator.serviceWorker.controller;(null==n?void 0:n.postMessage)&&([{eventName:Pe,source:Ne},{eventName:qe,source:Ne,data:Sn().pageContext},{eventName:Ke,source:Ne,data:t.intercept}].forEach((function(e){return n.postMessage(e)})),Xn((function(e){n.postMessage({eventName:qe,source:Ne,data:e})})))}))}else e.pushEvent(Ee)},Hr=function(e,t){!function(e,t){var i,n=t.listener,r=e.eventHook,a=sn(n);try{var s=function(){var e=i.value,t=e.type,n=e.sampleRate;switch(t){case"navigation_navigate":"undefined"!=typeof window&&"navigation"in window&&vn(yn((function(){window.navigation.addEventListener("navigate",(function(t){var i=new URL(t.destination.url,location.href);i.hostname!==location.hostname&&r({eventRule:e,url:i.href})}))}),n),void 0)();break;case"a_click":vn(yn((function(){document.addEventListener("DOMContentLoaded",(function(){document.body.addEventListener("click",(function(t){var i=t.target.closest("a");if(i&&"_self"!==i.target){var n=new URL(i.href,location.href);n.hostname!==location.hostname&&r({eventRule:e,url:n.href})}}),!0)}))}),n),void 0)();break;case"submit_click":vn(yn((function(){document.addEventListener("DOMContentLoaded",(function(){document.body.addEventListener("click",(function(t){var i=t.target;if(("BUTTON"===i.tagName&&"submit"===i.type||"INPUT"===i.tagName&&"submit"===i.type)&&i.form&&"_self"!==i.form.target){var n=new URL(i.formAction||i.form.action,location.href);n.hostname!==location.hostname&&r({eventRule:e,url:n.href})}}),!0)}))}),n),void 0)()}};for(a.s();!(i=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}}({eventHook:vn((function(t){e.pushEvent("event",t)}))},t)};function Br(e){var t=Wn(),i=t.cookie;t.storage;var n=t.webapi,r=t.network,a=t.event,s=void 0===a?{listener:[]}:a;An(e,i),$n(e),function(e,t){lr({webapiHook:vn((function(t){e.pushEvent(Ae,t)})),webapiFreqHook:er?vn((function(t){e.pushEvent(De,t)})):void 0},t)}(e,n),Ur(e,r),Hr(e,s)}var Mr="__PUMBAA_RUN_FLAG__";try{(function(){if(/ByteLocale/g.test(navigator.userAgent))return!1;var e=!0;return window.Garfish&&(e=window.Garfish.getGlobalObject()===window),!(!e||window[Mr]||(window[Mr]=1,0))})()&&function(e,t){return function(){var i=Date.now(),n=e.apply(void 0,arguments);return ut().pushEvent($e,{metrics:{time:Date.now()-i},categories:{version:"1.0.0.933",runtime_env:Ue,module:t}}),n}}((function(){if(window.Symbol){var e=ut();vn(Br)(e);var t=lt(),i=document.createElement("script"),n=document.currentScript,r=n.src,a=n.dataset,s=r.substring(0,r.lastIndexOf("/")),o="".concat(s,"/core.js","?globalName=").concat(t);i.src=o,i.crossOrigin="anonymous",i.async=!0,Object.assign(i.dataset,a),document.head.appendChild(i),document.head.removeChild(i)}}),"loader")()}catch(e){}}();