@guardian/support-dotcom-components 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/src/lib/tracking.d.ts +2 -1
- package/dist/shared/src/lib/tracking.d.ts.map +1 -1
- package/dist/shared/src/types/abTests/banner.d.ts +5 -2
- package/dist/shared/src/types/abTests/banner.d.ts.map +1 -1
- package/dist/shared/src/types/abTests/epic.d.ts +8 -2
- package/dist/shared/src/types/abTests/epic.d.ts.map +1 -1
- package/dist/shared/src/types/abTests/header.d.ts +5 -2
- package/dist/shared/src/types/abTests/header.d.ts.map +1 -1
- package/dist/shared/src/types/abTests/shared.d.ts +7 -0
- package/dist/shared/src/types/abTests/shared.d.ts.map +1 -1
- package/dist/shared/src/types/props/banner.d.ts +14 -14
- package/dist/shared/src/types/props/design.d.ts +12 -12
- package/dist/shared/src/types/props/design.d.ts.map +1 -1
- package/dist/shared/src/types/targeting/banner.d.ts +1 -0
- package/dist/shared/src/types/targeting/banner.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="gu.contributions.views",t=t=>t.get(e)||void 0,a=t=>{const a=localStorage.getItem(e),n=a?JSON.parse(a).value:[];n.push({date:(new Date).getTime(),testId:t});const s={value:n.slice(-50)};localStorage.setItem(e,JSON.stringify(s))},n="gu.history.weeklyArticleCount",s="gu.history.articleCountsThisWeek",i=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},r=e=>e.get(n)||void 0,o=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business"]),d=(e,t={})=>(e.forEach((e=>{o.has(e)&&(t[e]=(t[e]??0)+1)})),t),u=(e,t,a)=>{const r=((e,t)=>{const a=i(new Date),n=e.get(s);if(n&&n.week===a){const i=n.articles[t]||0;return e.set(s,{week:a,articles:{...n.articles,[t]:i+1}}),i>0}return e.set(s,{week:a,articles:{[t]:1}}),!1})(e,t);if(!r){const t=i(new Date),s=e.get(n)||[],r=s[0];if(r&&r.week&&r.week===t)r.count+=1,r.tags=d(a,r.tags),e.set(n,s);else{s.unshift({week:t,count:1,tags:d(a,{})});const i=t-365,r=s.filter((e=>e.week>=i));e.set(n,r)}}};var c,l;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of a)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 a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},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}(c||(c={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(l||(l={}));const h=c.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),p=e=>{switch(typeof e){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(e)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(e)?h.array:null===e?h.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?h.promise:"undefined"!=typeof Map&&e instanceof Map?h.map:"undefined"!=typeof Set&&e instanceof Set?h.set:"undefined"!=typeof Date&&e instanceof Date?h.date:h.object;default:return h.unknown}},m=c.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 f 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},a={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)a._errors.push(t(s));else{let e=a,n=0;for(;n<s.path.length;){const a=s.path[n];n===s.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(s))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,c.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},a=[];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))):a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}f.create=e=>new f(e);const g=(e,t)=>{let a;switch(e.code){case m.invalid_type:a=e.received===h.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,c.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:a=`Unrecognized key(s) in object: ${c.joinValues(e.keys,", ")}`;break;case m.invalid_union:a="Invalid input";break;case m.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${c.joinValues(e.options)}`;break;case m.invalid_enum_value:a=`Invalid enum value. Expected ${c.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:a="Invalid function arguments";break;case m.invalid_return_type:a="Invalid function return type";break;case m.invalid_date:a="Invalid date";break;case m.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:c.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case m.too_small:a="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 m.too_big:a="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 m.custom:a="Invalid input";break;case m.invalid_intersection_types:a="Intersection results could not be merged";break;case m.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:a="Number must be finite";break;default:a=t.defaultError,c.assertNever(e)}return{message:a}};let y=g;function v(){return y}const _=e=>{const{data:t,path:a,errorMaps:n,issueData:s}=e,i=[...a,...s.path||[]],r={...s,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{...s,path:i,message:s.message||o}};function b(e,t){const a=_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,v(),g].filter((e=>!!e))});e.common.issues.push(a)}class k{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if("aborted"===n.status)return x;"dirty"===n.status&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t)a.push({key:await e.key,value:await e.value});return k.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:t,value:s}=n;if("aborted"===t.status)return x;if("aborted"===s.status)return x;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!n.alwaysSet||(a[t.value]=s.value)}return{status:e.value,value:a}}}const x=Object.freeze({status:"aborted"}),C=e=>({status:"valid",value:e}),S=e=>"aborted"===e.status,w=e=>"dirty"===e.status,T=e=>"valid"===e.status,N=e=>"undefined"!=typeof Promise&&e instanceof Promise;var I;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(I||(I={}));class A{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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 E=(e,t)=>{if(T(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 f(e.common.issues);return this._error=t,this._error}}};function O(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:s}=e;if(t&&(a||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:s};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=a?a:t.defaultError},description:s}}class R{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 p(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:p(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:p(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 a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const n={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)},s=this._parseSync({data:e,path:n.path,parent:n});return E(n,s)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={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:p(e)},n=this._parse({data:e,path:a.path,parent:a}),s=await(N(n)?n:Promise.resolve(n));return E(a,s)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),i=()=>n.addIssue({code:m.custom,...a(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((a,n)=>!!e(a)||(n.addIssue("function"==typeof t?t(a,n):t),!1)))}_refinement(e){return new ye({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ve.create(this,this._def)}nullable(){return _e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ee.create(this,this._def)}promise(){return ge.create(this,this._def)}or(e){return ne.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new ye({...O(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new be({...O(this._def),innerType:this,defaultValue:t,typeName:Te.ZodDefault})}brand(){return new Ce({typeName:Te.ZodBranded,type:this,...O(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ke({...O(this._def),innerType:this,catchValue:t,typeName:Te.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Se.create(this,e)}readonly(){return we.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,M=/^[a-z][a-z0-9]*$/,P=/^[0-9A-HJKMNP-TV-Z]{26}$/,L=/^[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,U=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let D;const B=/^(((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}))$/,G=/^(([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 j extends R{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==h.string){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.string,received:t.parsedType}),x}const t=new k;let a;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:m.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:m.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const n=e.data.length>r.value,s=e.data.length<r.value;(n||s)&&(a=this._getOrReturnCtx(e,a),n?b(a,{code:m.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&b(a,{code:m.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)U.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"email",code:m.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)D||(D=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),D.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"emoji",code:m.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)L.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"uuid",code:m.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)Z.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"cuid",code:m.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)M.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"cuid2",code:m.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)P.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"ulid",code:m.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(n){a=this._getOrReturnCtx(e,a),b(a,{validation:"url",code:m.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"regex",code:m.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(a=this._getOrReturnCtx(e,a),b(a,{code:m.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(a=this._getOrReturnCtx(e,a),b(a,{code:m.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(a=this._getOrReturnCtx(e,a),b(a,{code:m.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){((i=r).precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):0===i.precision?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{code:m.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else"ip"===r.kind?(n=e.data,("v4"!==(s=r.version)&&s||!B.test(n))&&("v6"!==s&&s||!G.test(n))&&(a=this._getOrReturnCtx(e,a),b(a,{validation:"ip",code:m.invalid_string,message:r.message}),t.dirty())):c.assertNever(r);var n,s,i;return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement((t=>e.test(t)),{validation:t,code:m.invalid_string,...I.errToObj(a)})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.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,...I.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...I.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...I.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...I.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...I.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...I.errToObj(t)})}nonempty(e){return this.min(1,I.errToObj(e))}trim(){return new j({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j({...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.value<e)&&(e=t.value);return e}}function $(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=a>n?a:n;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}j.create=e=>{var t;return new j({checks:[],typeName:Te.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class K extends R{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)!==h.number){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.number,received:t.parsedType}),x}let t;const a=new k;for(const n of this._def.checks)if("int"===n.kind)c.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),b(t,{code:m.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else"multipleOf"===n.kind?0!==$(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_finite,message:n.message}),a.dirty()):c.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,I.toString(t))}gt(e,t){return this.setLimit("min",e,!1,I.toString(t))}lte(e,t){return this.setLimit("max",e,!0,I.toString(t))}lt(e,t){return this.setLimit("max",e,!1,I.toString(t))}setLimit(e,t,a,n){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:I.toString(n)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.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<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&c.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}K.create=e=>new K({checks:[],typeName:Te.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class V extends R{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)!==h.bigint){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.bigint,received:t.parsedType}),x}let t;const a=new k;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):c.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,I.toString(t))}gt(e,t){return this.setLimit("min",e,!1,I.toString(t))}lte(e,t){return this.setLimit("max",e,!0,I.toString(t))}lt(e,t){return this.setLimit("max",e,!1,I.toString(t))}setLimit(e,t,a,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:I.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:I.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<e)&&(e=t.value);return e}}V.create=e=>{var t;return new V({checks:[],typeName:Te.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class F extends R{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==h.boolean){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.boolean,received:t.parsedType}),x}return C(e.data)}}F.create=e=>new F({typeName:Te.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class W extends R{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==h.date){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.date,received:t.parsedType}),x}if(isNaN(e.data.getTime())){return b(this._getOrReturnCtx(e),{code:m.invalid_date}),x}const t=new k;let a;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:m.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:m.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):c.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:I.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.value<e)&&(e=t.value);return null!=e?new Date(e):null}}W.create=e=>new W({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Te.ZodDate,...O(e)});class Y extends R{_parse(e){if(this._getType(e)!==h.symbol){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.symbol,received:t.parsedType}),x}return C(e.data)}}Y.create=e=>new Y({typeName:Te.ZodSymbol,...O(e)});class H extends R{_parse(e){if(this._getType(e)!==h.undefined){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.undefined,received:t.parsedType}),x}return C(e.data)}}H.create=e=>new H({typeName:Te.ZodUndefined,...O(e)});class z extends R{_parse(e){if(this._getType(e)!==h.null){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.null,received:t.parsedType}),x}return C(e.data)}}z.create=e=>new z({typeName:Te.ZodNull,...O(e)});class J extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return C(e.data)}}J.create=e=>new J({typeName:Te.ZodAny,...O(e)});class q extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return C(e.data)}}q.create=e=>new q({typeName:Te.ZodUnknown,...O(e)});class Q extends R{_parse(e){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.never,received:t.parsedType}),x}}Q.create=e=>new Q({typeName:Te.ZodNever,...O(e)});class X extends R{_parse(e){if(this._getType(e)!==h.undefined){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.void,received:t.parsedType}),x}return C(e.data)}}X.create=e=>new X({typeName:Te.ZodVoid,...O(e)});class ee extends R{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==h.array)return b(t,{code:m.invalid_type,expected:h.array,received:t.parsedType}),x;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(b(t,{code:e?m.too_big:m.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(b(t,{code:m.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(b(t,{code:m.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>n.type._parseAsync(new A(t,e,t.path,a))))).then((e=>k.mergeArray(a,e)));const s=[...t.data].map(((e,a)=>n.type._parseSync(new A(t,e,t.path,a))));return k.mergeArray(a,s)}get element(){return this._def.type}min(e,t){return new ee({...this._def,minLength:{value:e,message:I.toString(t)}})}max(e,t){return new ee({...this._def,maxLength:{value:e,message:I.toString(t)}})}length(e,t){return new ee({...this._def,exactLength:{value:e,message:I.toString(t)}})}nonempty(e){return this.min(1,e)}}function te(e){if(e instanceof ae){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=ve.create(te(n))}return new ae({...e._def,shape:()=>t})}return e instanceof ee?new ee({...e._def,type:te(e.element)}):e instanceof ve?ve.create(te(e.unwrap())):e instanceof _e?_e.create(te(e.unwrap())):e instanceof de?de.create(e.items.map((e=>te(e)))):e}ee.create=(e,t)=>new ee({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...O(t)});class ae extends R{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=c.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.object){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.object,received:t.parsedType}),x}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof Q&&"strip"===this._def.unknownKeys))for(const e in a.data)s.includes(e)||i.push(e);const r=[];for(const e of s){const t=n[e],s=a.data[e];r.push({key:{status:"valid",value:e},value:t._parse(new A(a,s,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof Q){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)r.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)i.length>0&&(b(a,{code:m.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=a.data[t];r.push({key:{status:"valid",value:t},value:e._parse(new A(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of r){const a=await t.key;e.push({key:a,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>k.mergeObjectSync(t,e))):k.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new ae({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var n,s,i,r;const o=null!==(i=null===(s=(n=this._def).errorMap)||void 0===s?void 0:s.call(n,t,a).message)&&void 0!==i?i:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(r=I.errToObj(e).message)&&void 0!==r?r:o}:{message:o}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Te.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const t={};return c.objectKeys(e).forEach((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new ae({...this._def,shape:()=>t})}omit(e){const t={};return c.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new ae({...this._def,shape:()=>t})}deepPartial(){return te(this)}partial(e){const t={};return c.objectKeys(this.shape).forEach((a=>{const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()})),new ae({...this._def,shape:()=>t})}required(e){const t={};return c.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof ve;)e=e._def.innerType;t[a]=e}})),new ae({...this._def,shape:()=>t})}keyof(){return pe(c.objectKeys(this.shape))}}ae.create=(e,t)=>new ae({shape:()=>e,unknownKeys:"strip",catchall:Q.create(),typeName:Te.ZodObject,...O(t)}),ae.strictCreate=(e,t)=>new ae({shape:()=>e,unknownKeys:"strict",catchall:Q.create(),typeName:Te.ZodObject,...O(t)}),ae.lazycreate=(e,t)=>new ae({shape:e,unknownKeys:"strip",catchall:Q.create(),typeName:Te.ZodObject,...O(t)});class ne extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new f(e.ctx.common.issues)));return b(t,{code:m.invalid_union,unionErrors:a}),x}));{let e;const n=[];for(const s of a){const a={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:a});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new f(e)));return b(t,{code:m.invalid_union,unionErrors:s}),x}}get options(){return this._def.options}}ne.create=(e,t)=>new ne({options:e,typeName:Te.ZodUnion,...O(t)});const se=e=>e instanceof le?se(e.schema):e instanceof ye?se(e.innerType()):e instanceof he?[e.value]:e instanceof me?e.options:e instanceof fe?Object.keys(e.enum):e instanceof be?se(e._def.innerType):e instanceof H?[void 0]:e instanceof z?[null]:null;class ie extends R{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return b(t,{code:m.invalid_type,expected:h.object,received:t.parsedType}),x;const a=this.discriminator,n=t.data[a],s=this.optionsMap.get(n);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(b(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const n=new Map;for(const a of t){const t=se(a.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,a)}}return new ie({typeName:Te.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...O(a)})}}function re(e,t){const a=p(e),n=p(t);if(e===t)return{valid:!0,data:e};if(a===h.object&&n===h.object){const a=c.objectKeys(t),n=c.objectKeys(e).filter((e=>-1!==a.indexOf(e))),s={...e,...t};for(const a of n){const n=re(e[a],t[a]);if(!n.valid)return{valid:!1};s[a]=n.data}return{valid:!0,data:s}}if(a===h.array&&n===h.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const s=re(e[n],t[n]);if(!s.valid)return{valid:!1};a.push(s.data)}return{valid:!0,data:a}}return a===h.date&&n===h.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class oe extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(S(e)||S(n))return x;const s=re(e.value,n.value);return s.valid?((w(e)||w(n))&&t.dirty(),{status:t.value,value:s.data}):(b(a,{code:m.invalid_intersection_types}),x)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}oe.create=(e,t,a)=>new oe({left:e,right:t,typeName:Te.ZodIntersection,...O(a)});class de extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.array)return b(a,{code:m.invalid_type,expected:h.array,received:a.parsedType}),x;if(a.data.length<this._def.items.length)return b(a,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&a.data.length>this._def.items.length&&(b(a,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new A(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(n).then((e=>k.mergeArray(t,e))):k.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new de({...this._def,rest:e})}}de.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new de({items:e,typeName:Te.ZodTuple,rest:null,...O(t)})};class ue extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.map)return b(a,{code:m.invalid_type,expected:h.map,received:a.parsedType}),x;const n=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map((([e,t],i)=>({key:n._parse(new A(a,e,a.path,[i,"key"])),value:s._parse(new A(a,t,a.path,[i,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of i){const n=await a.key,s=await a.value;if("aborted"===n.status||"aborted"===s.status)return x;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of i){const n=a.key,s=a.value;if("aborted"===n.status||"aborted"===s.status)return x;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}ue.create=(e,t,a)=>new ue({valueType:t,keyType:e,typeName:Te.ZodMap,...O(a)});class ce extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.set)return b(a,{code:m.invalid_type,expected:h.set,received:a.parsedType}),x;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(b(a,{code:m.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&a.data.size>n.maxSize.value&&(b(a,{code:m.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function i(e){const a=new Set;for(const n of e){if("aborted"===n.status)return x;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const r=[...a.data.values()].map(((e,t)=>s._parse(new A(a,e,a.path,t))));return a.common.async?Promise.all(r).then((e=>i(e))):i(r)}min(e,t){return new ce({...this._def,minSize:{value:e,message:I.toString(t)}})}max(e,t){return new ce({...this._def,maxSize:{value:e,message:I.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ce.create=(e,t)=>new ce({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet,...O(t)});class le extends R{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})}}le.create=(e,t)=>new le({getter:e,typeName:Te.ZodLazy,...O(t)});class he extends R{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return b(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}function pe(e,t){return new me({values:e,typeName:Te.ZodEnum,...O(t)})}he.create=(e,t)=>new he({value:e,typeName:Te.ZodLiteral,...O(t)});class me extends R{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return b(t,{expected:c.joinValues(a),received:t.parsedType,code:m.invalid_type}),x}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return b(t,{received:t.data,code:m.invalid_enum_value,options:a}),x}return C(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 me.create(e)}exclude(e){return me.create(this.options.filter((t=>!e.includes(t))))}}me.create=pe;class fe extends R{_parse(e){const t=c.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==h.string&&a.parsedType!==h.number){const e=c.objectValues(t);return b(a,{expected:c.joinValues(e),received:a.parsedType,code:m.invalid_type}),x}if(-1===t.indexOf(e.data)){const e=c.objectValues(t);return b(a,{received:a.data,code:m.invalid_enum_value,options:e}),x}return C(e.data)}get enum(){return this._def.values}}fe.create=(e,t)=>new fe({values:e,typeName:Te.ZodNativeEnum,...O(t)});class ge extends R{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&!1===t.common.async)return b(t,{code:m.invalid_type,expected:h.promise,received:t.parsedType}),x;const a=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return C(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ge.create=(e,t)=>new ge({type:e,typeName:Te.ZodPromise,...O(t)});class ye extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{b(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){const e=n.transform(a.data,s);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:a.path,parent:a}))):this._def.schema._parseSync({data:e,path:a.path,parent:a})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,s);if(a.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===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?x:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?x:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===n.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!T(e))return e;const i=n.transform(e.value,s);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:a.data,path:a.path,parent:a}).then((e=>T(e)?Promise.resolve(n.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}c.assertNever(n)}}ye.create=(e,t,a)=>new ye({schema:e,typeName:Te.ZodEffects,effect:t,...O(a)}),ye.createWithPreprocess=(e,t,a)=>new ye({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects,...O(a)});class ve extends R{_parse(e){return this._getType(e)===h.undefined?C(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Te.ZodOptional,...O(t)});class _e extends R{_parse(e){return this._getType(e)===h.null?C(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_e.create=(e,t)=>new _e({innerType:e,typeName:Te.ZodNullable,...O(t)});class be extends R{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===h.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}be.create=(e,t)=>new be({innerType:e,typeName:Te.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...O(t)});class ke extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return N(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new f(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new f(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ke.create=(e,t)=>new ke({innerType:e,typeName:Te.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...O(t)});class xe extends R{_parse(e){if(this._getType(e)!==h.nan){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.nan,received:t.parsedType}),x}return{status:"valid",value:e.data}}}xe.create=e=>new xe({typeName:Te.ZodNaN,...O(e)});class Ce extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Se extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new Se({in:e,out:t,typeName:Te.ZodPipeline})}}class we extends R{_parse(e){const t=this._def.innerType._parse(e);return T(t)&&(t.value=Object.freeze(t.value)),t}}var Te;we.create=(e,t)=>new we({innerType:e,typeName:Te.ZodReadonly,...O(t)}),ae.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"}(Te||(Te={}));const Ne=j.create,Ie=K.create;xe.create,V.create;const Ae=F.create;W.create,Y.create,H.create,z.create;const Ee=J.create;q.create,Q.create,X.create;const Oe=ee.create,Re=ae.create;ae.strictCreate,ne.create;const Ze=ie.create;oe.create,de.create,ue.create,ce.create,le.create;const Me=he.create,Pe=me.create,Le=fe.create;ge.create,ye.create,ve.create,_e.create,ye.createWithPreprocess,Se.create;const Ue=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],De=Pe(Ue),Be={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},Ge={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},je={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},$e=e=>Object.keys(Be).find((t=>Be[t].countries.includes(e??"")))||"International",Ke=(e,t=[])=>0===t.length||!!e&&t.includes($e(e.toUpperCase())),Ve=e=>{if(e){const t=$e(e);return je[t]}return"£"},Fe=e=>{if(e)return Ge[e]},We=(e,t)=>{if(t){const a=(e=>Be[$e(e)]?.supportRegionId)(t);if(a)return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,t,n)=>`${t}/${a.toLowerCase()}/${n}`))}return e},Ye=(e,t,a,n)=>{if(n){const s=n[$e(a)];if(s){return`${Ve(a)}${s[e][t].price}`}}},He={CURRENCY_SYMBOL:({countryCode:e})=>Ve(e),COUNTRY_NAME:({countryCode:e})=>Fe(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>Ye("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>Ye("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>Ye("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>Ye("GuardianWeekly","Annual",e,t),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},ze=(e,t,a)=>e?e.replace(Je,(e=>{const n=e.substring(2,e.length-2),s=He[n];if(s){const e=s({countryCode:t,prices:a});if(e)return e}return e})):"",Je=/%%.*?%%/g,qe=e=>{const t=e.match(Je)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},Qe=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},Xe=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),a=(t.getMonth()+1).toString().padStart(2,"0"),n=t.toLocaleString("default",{month:"long"}),s=t.getFullYear();return{reminderCta:`Remind me in ${n}`,reminderPeriod:`${s}-${a}-01`,reminderLabel:`${n} ${s}`}},et=new Date("2023-12-31"),tt=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<Qe(e.getFullYear()),at=(e,t=new Date)=>{return"US"===e&&tt(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${a=t.getFullYear()}-${(Qe(a).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${a}`}:"US"===e&&(e=>e>=Qe(e.getFullYear())&&e<et)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):Xe(t);var a},nt=Re({text:Ne(),baseUrl:Ne()});let st=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});Le(st);const it=Ze("type",[Re({type:Me(st.Custom),cta:nt}),Re({type:Me(st.ContributionsReminder)})]);let rt=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const ot=Le(rt);let dt=function(e){return e.money="money",e}({});const ut=Le(dt),ct=Re({countLabel:Ne(),goalReachedPrimary:Ne(),goalReachedSecondary:Ne()}),lt=Re({total:Ie(),goal:Ie()}),ht=Pe(["US","AU"]),pt=Re({endType:ot,countType:ut,currencySymbol:Ne(),copy:ct,name:ht,tickerData:lt.optional()}),mt=Pe(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),ft=Pe(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),gt=Re({abTestName:Ne(),abTestVariant:Ne(),campaignCode:Ne(),componentType:ft,products:Oe(mt).nullish(),labels:Oe(Ne()).nullish(),ophanPageId:Ne(),platformId:Ne(),referrerUrl:Ne(),clientName:Ne()}),yt=Re({mainUrl:Ne(),mobileUrl:Ne().optional(),tabletUrl:Ne().optional(),desktopUrl:Ne().optional(),leftColUrl:Ne().optional(),wideUrl:Ne().optional(),altText:Ne()}),vt=Re({name:Ne(),description:Ne().optional(),headshot:yt.optional()}),_t=Pe(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),bt=Pe(["new","guest","current"]),kt=Pe(["Live","Draft","Archived"]),xt=Pe(["Mobile","Desktop","All","iOS","Android"]),Ct=Pe(["SignedIn","SignedOut","All"]),St=Re({name:Ne(),status:kt,priority:Ie(),controlProportionSettings:Re({proportion:Ie(),offset:Ie()}).optional(),deviceType:xt.optional(),signedInStatus:Ct.optional()}),wt=Pe(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Tt=Re({minViews:Ie(),maxViews:Ie().optional(),periodInWeeks:Ie(),tagId:Ne().optional()});Re({userType:Oe(bt),product:Oe(_t)}),Re({tagIds:Oe(Ne()),sectionIds:Oe(Ne()),excludedTagIds:Oe(Ne()),excludedSectionIds:Oe(Ne())});const Nt=Pe(["for52Weeks","forTargetedWeeks"]),It=Re({for52Weeks:Ie(),forTargetedWeeks:Ie()}),At=Re({maxViewsCount:Ie(),maxViewsDays:Ie(),minDaysBetweenViews:Ie()}),Et=Re({type:Me("above"),copy:Ne().optional(),countType:Nt.optional()}),Ot=Re({reminderCta:Ne(),reminderLabel:Ne(),reminderPeriod:Ne()}),Rt=Pe(["ONE_OFF","MONTHLY","ANNUAL"]),Zt=Re({testName:Ne(),variantName:Ne(),defaultContributionType:Rt,displayContributionType:Rt.array(),amountsCardData:Re({ONE_OFF:Re({amounts:Oe(Ie()),defaultAmount:Ie(),hideChooseYourAmount:Ae().optional()}),MONTHLY:Re({amounts:Oe(Ie()),defaultAmount:Ie(),hideChooseYourAmount:Ae().optional()}),ANNUAL:Re({amounts:Oe(Ie()),defaultAmount:Ie(),hideChooseYourAmount:Ae().optional()})})}),Mt=Re({url:Ne()}),Pt=Re({name:Ne(),heading:Ne().optional(),paragraphs:Oe(Ne()),highlightedText:Ne().optional(),tickerSettings:pt.optional(),cta:nt.optional(),secondaryCta:it.optional(),newsletterSignup:Mt.optional(),image:yt.optional(),showReminderFields:Ot.optional(),separateArticleCount:Et.optional(),maxViews:At.optional(),showSignInLink:Ae().optional(),bylineWithImage:vt.optional(),showChoiceCards:Ae().optional(),choiceCardAmounts:Zt.optional(),defaultChoiceCardFrequency:Rt.optional()}),Lt=Re({variant:Pt,tracking:gt,countryCode:Ne().nullish(),articleCounts:It,onReminderOpen:Ee().nullish(),fetchEmail:Ee().nullish(),submitComponentEvent:Ee().nullish(),openCmp:Ee().nullish(),hasConsentForArticleCount:Ae().nullish(),stage:Ne().nullish()}),Ut=/^[0-9A-F]{2}$/,Dt=Ne().refine((e=>Ut.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),Bt=Re({r:Dt,g:Dt,b:Dt,kind:Me("hex")}),Gt=Re({mobileUrl:Ne(),tabletDesktopUrl:Ne(),wideUrl:Ne(),altText:Ne(),kind:Me("Image")}),jt=Re({buttonColour:Bt.nullish(),buttonTextColour:Bt.nullish(),buttonBorderColour:Bt.nullish(),buttonSelectColour:Bt.nullish(),buttonSelectTextColour:Bt.nullish(),buttonSelectBorderColour:Bt.nullish(),kind:Me("ChoiceCards")}),$t=Re({visual:Ze("kind",[Gt,jt]).nullish(),colours:Re({basic:Re({background:Bt,bodyText:Bt})})}),Kt=Pe(["contributions","subscriptions","signIn"]),Vt=Re({heading:Ne().optional(),messageText:Ne().optional(),paragraphs:Oe(Ne()).optional(),mobileMessageText:Ne().optional(),highlightedText:Ne().optional(),cta:nt.optional(),secondaryCta:it.optional()});Re({tracking:gt,bannerChannel:Kt,content:Vt.nullish(),mobileContent:Vt.nullish(),countryCode:Ne().nullish(),isSupporter:Ae().nullish(),tickerSettings:pt.nullish(),submitComponentEvent:Ee(),numArticles:Ie().nullish(),hasOptedOutOfArticleCount:Ae().nullish(),fetchEmail:Ee().nullish(),separateArticleCount:Ae().nullish(),design:$t.nullish()});const Ft=Re({heading:Ne(),subheading:Ne(),primaryCta:nt.optional(),secondaryCta:nt.optional(),benefits:Oe(Ne()).optional()});Re({content:Ft,tracking:gt,mobileContent:Ft.optional(),countryCode:Ne().optional(),submitComponentEvent:Ee(),numArticles:Ie().optional()});const Wt=Re({maxViewsCount:Ie(),maxViewsDays:Ie(),minDaysBetweenViews:Ie()}),Yt=["ONE_OFF","MONTHLY","ANNUAL"];St.extend({name:Ne(),status:kt,locations:Oe(De),tagIds:Oe(Ne()),sections:Oe(Ne()),excludedTagIds:Oe(Ne()),excludedSections:Oe(Ne()),alwaysAsk:Ae(),maxViews:Wt.optional(),userCohort:wt,hasCountryName:Ae(),highPriority:Ae(),useLocalViewLog:Ae(),articlesViewedSettings:Tt.optional(),priority:Ie(),variants:Pt.array()});const Ht=(e,t,a)=>{const n=(e=>{if(URLSearchParams){const t=new URLSearchParams(window.location.search).get(`force-${e}`);if(t)return t}return null})(e);return fetch(`${t}/${e}${n?`?force=${n}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then((t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t})).then((e=>e.json()))},zt=(e,t)=>Ht("epic",e,t),Jt=(e,t)=>Ht("liveblog-epic",e,t),qt=(e,t)=>Ht("banner",e,t),Qt=(e,t)=>Ht("header",e,t);export{Ue as CountryGroupId,st as SecondaryCtaType,dt as TickerCountType,rt as TickerEndType,We as addRegionIdToSupportUrl,Xe as buildReminderFields,qe as containsNonArticleCountPlaceholder,Yt as contributionTabFrequencies,$e as countryCodeToCountryGroupId,De as countryGroupIdSchema,Lt as epicPropsSchema,qt as getBanner,Fe as getCountryName,zt as getEpic,t as getEpicViewLog,Qt as getHeader,Jt as getLiveblogEpic,Ve as getLocalCurrencySymbol,at as getReminderFields,r as getWeeklyArticleHistory,Ke as inCountryGroups,u as incrementWeeklyArticleCount,a as logEpicView,ze as replaceNonArticleCountPlaceholders};
|
|
1
|
+
const e="gu.contributions.views",t=t=>t.get(e)||void 0,a=t=>{const a=localStorage.getItem(e),n=a?JSON.parse(a).value:[];n.push({date:(new Date).getTime(),testId:t});const s={value:n.slice(-50)};localStorage.setItem(e,JSON.stringify(s))},n="gu.history.weeklyArticleCount",s="gu.history.articleCountsThisWeek",i=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},r=e=>e.get(n)||void 0,o=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business"]),d=(e,t={})=>(e.forEach((e=>{o.has(e)&&(t[e]=(t[e]??0)+1)})),t),u=(e,t,a)=>{const r=((e,t)=>{const a=i(new Date),n=e.get(s);if(n&&n.week===a){const i=n.articles[t]||0;return e.set(s,{week:a,articles:{...n.articles,[t]:i+1}}),i>0}return e.set(s,{week:a,articles:{[t]:1}}),!1})(e,t);if(!r){const t=i(new Date),s=e.get(n)||[],r=s[0];if(r&&r.week&&r.week===t)r.count+=1,r.tags=d(a,r.tags),e.set(n,s);else{s.unshift({week:t,count:1,tags:d(a,{})});const i=t-365,r=s.filter((e=>e.week>=i));e.set(n,r)}}};var c,l;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of a)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 a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},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}(c||(c={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(l||(l={}));const h=c.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),p=e=>{switch(typeof e){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(e)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(e)?h.array:null===e?h.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?h.promise:"undefined"!=typeof Map&&e instanceof Map?h.map:"undefined"!=typeof Set&&e instanceof Set?h.set:"undefined"!=typeof Date&&e instanceof Date?h.date:h.object;default:return h.unknown}},m=c.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 f 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},a={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)a._errors.push(t(s));else{let e=a,n=0;for(;n<s.path.length;){const a=s.path[n];n===s.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(s))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,c.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},a=[];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))):a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}f.create=e=>new f(e);const g=(e,t)=>{let a;switch(e.code){case m.invalid_type:a=e.received===h.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,c.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:a=`Unrecognized key(s) in object: ${c.joinValues(e.keys,", ")}`;break;case m.invalid_union:a="Invalid input";break;case m.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${c.joinValues(e.options)}`;break;case m.invalid_enum_value:a=`Invalid enum value. Expected ${c.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:a="Invalid function arguments";break;case m.invalid_return_type:a="Invalid function return type";break;case m.invalid_date:a="Invalid date";break;case m.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:c.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case m.too_small:a="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 m.too_big:a="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 m.custom:a="Invalid input";break;case m.invalid_intersection_types:a="Intersection results could not be merged";break;case m.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:a="Number must be finite";break;default:a=t.defaultError,c.assertNever(e)}return{message:a}};let y=g;function v(){return y}const _=e=>{const{data:t,path:a,errorMaps:n,issueData:s}=e,i=[...a,...s.path||[]],r={...s,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{...s,path:i,message:s.message||o}};function b(e,t){const a=_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,v(),g].filter((e=>!!e))});e.common.issues.push(a)}class k{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if("aborted"===n.status)return x;"dirty"===n.status&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t)a.push({key:await e.key,value:await e.value});return k.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:t,value:s}=n;if("aborted"===t.status)return x;if("aborted"===s.status)return x;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!n.alwaysSet||(a[t.value]=s.value)}return{status:e.value,value:a}}}const x=Object.freeze({status:"aborted"}),C=e=>({status:"valid",value:e}),S=e=>"aborted"===e.status,w=e=>"dirty"===e.status,T=e=>"valid"===e.status,N=e=>"undefined"!=typeof Promise&&e instanceof Promise;var I;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(I||(I={}));class A{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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 E=(e,t)=>{if(T(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 f(e.common.issues);return this._error=t,this._error}}};function O(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:s}=e;if(t&&(a||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:s};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=a?a:t.defaultError},description:s}}class R{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 p(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:p(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:p(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 a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const n={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)},s=this._parseSync({data:e,path:n.path,parent:n});return E(n,s)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={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:p(e)},n=this._parse({data:e,path:a.path,parent:a}),s=await(N(n)?n:Promise.resolve(n));return E(a,s)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),i=()=>n.addIssue({code:m.custom,...a(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((a,n)=>!!e(a)||(n.addIssue("function"==typeof t?t(a,n):t),!1)))}_refinement(e){return new ye({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ve.create(this,this._def)}nullable(){return _e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ee.create(this,this._def)}promise(){return ge.create(this,this._def)}or(e){return ne.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new ye({...O(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new be({...O(this._def),innerType:this,defaultValue:t,typeName:Te.ZodDefault})}brand(){return new Ce({typeName:Te.ZodBranded,type:this,...O(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ke({...O(this._def),innerType:this,catchValue:t,typeName:Te.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Se.create(this,e)}readonly(){return we.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,M=/^[a-z][a-z0-9]*$/,P=/^[0-9A-HJKMNP-TV-Z]{26}$/,L=/^[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,U=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let D;const B=/^(((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}))$/,G=/^(([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 j extends R{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==h.string){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.string,received:t.parsedType}),x}const t=new k;let a;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:m.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:m.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const n=e.data.length>r.value,s=e.data.length<r.value;(n||s)&&(a=this._getOrReturnCtx(e,a),n?b(a,{code:m.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&b(a,{code:m.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)U.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"email",code:m.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)D||(D=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),D.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"emoji",code:m.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)L.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"uuid",code:m.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)Z.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"cuid",code:m.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)M.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"cuid2",code:m.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)P.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"ulid",code:m.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(n){a=this._getOrReturnCtx(e,a),b(a,{validation:"url",code:m.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"regex",code:m.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(a=this._getOrReturnCtx(e,a),b(a,{code:m.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(a=this._getOrReturnCtx(e,a),b(a,{code:m.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(a=this._getOrReturnCtx(e,a),b(a,{code:m.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){((i=r).precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):0===i.precision?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{code:m.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else"ip"===r.kind?(n=e.data,("v4"!==(s=r.version)&&s||!B.test(n))&&("v6"!==s&&s||!G.test(n))&&(a=this._getOrReturnCtx(e,a),b(a,{validation:"ip",code:m.invalid_string,message:r.message}),t.dirty())):c.assertNever(r);var n,s,i;return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement((t=>e.test(t)),{validation:t,code:m.invalid_string,...I.errToObj(a)})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.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,...I.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...I.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...I.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...I.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...I.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...I.errToObj(t)})}nonempty(e){return this.min(1,I.errToObj(e))}trim(){return new j({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j({...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.value<e)&&(e=t.value);return e}}function $(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=a>n?a:n;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}j.create=e=>{var t;return new j({checks:[],typeName:Te.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class K extends R{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)!==h.number){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.number,received:t.parsedType}),x}let t;const a=new k;for(const n of this._def.checks)if("int"===n.kind)c.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),b(t,{code:m.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else"multipleOf"===n.kind?0!==$(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_finite,message:n.message}),a.dirty()):c.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,I.toString(t))}gt(e,t){return this.setLimit("min",e,!1,I.toString(t))}lte(e,t){return this.setLimit("max",e,!0,I.toString(t))}lt(e,t){return this.setLimit("max",e,!1,I.toString(t))}setLimit(e,t,a,n){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:I.toString(n)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.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<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&c.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}K.create=e=>new K({checks:[],typeName:Te.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class V extends R{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)!==h.bigint){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.bigint,received:t.parsedType}),x}let t;const a=new k;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):c.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,I.toString(t))}gt(e,t){return this.setLimit("min",e,!1,I.toString(t))}lte(e,t){return this.setLimit("max",e,!0,I.toString(t))}lt(e,t){return this.setLimit("max",e,!1,I.toString(t))}setLimit(e,t,a,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:I.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:I.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<e)&&(e=t.value);return e}}V.create=e=>{var t;return new V({checks:[],typeName:Te.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class F extends R{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==h.boolean){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.boolean,received:t.parsedType}),x}return C(e.data)}}F.create=e=>new F({typeName:Te.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class W extends R{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==h.date){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.date,received:t.parsedType}),x}if(isNaN(e.data.getTime())){return b(this._getOrReturnCtx(e),{code:m.invalid_date}),x}const t=new k;let a;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:m.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:m.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):c.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:I.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.value<e)&&(e=t.value);return null!=e?new Date(e):null}}W.create=e=>new W({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Te.ZodDate,...O(e)});class H extends R{_parse(e){if(this._getType(e)!==h.symbol){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.symbol,received:t.parsedType}),x}return C(e.data)}}H.create=e=>new H({typeName:Te.ZodSymbol,...O(e)});class Y extends R{_parse(e){if(this._getType(e)!==h.undefined){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.undefined,received:t.parsedType}),x}return C(e.data)}}Y.create=e=>new Y({typeName:Te.ZodUndefined,...O(e)});class z extends R{_parse(e){if(this._getType(e)!==h.null){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.null,received:t.parsedType}),x}return C(e.data)}}z.create=e=>new z({typeName:Te.ZodNull,...O(e)});class J extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return C(e.data)}}J.create=e=>new J({typeName:Te.ZodAny,...O(e)});class q extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return C(e.data)}}q.create=e=>new q({typeName:Te.ZodUnknown,...O(e)});class Q extends R{_parse(e){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.never,received:t.parsedType}),x}}Q.create=e=>new Q({typeName:Te.ZodNever,...O(e)});class X extends R{_parse(e){if(this._getType(e)!==h.undefined){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.void,received:t.parsedType}),x}return C(e.data)}}X.create=e=>new X({typeName:Te.ZodVoid,...O(e)});class ee extends R{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==h.array)return b(t,{code:m.invalid_type,expected:h.array,received:t.parsedType}),x;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(b(t,{code:e?m.too_big:m.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(b(t,{code:m.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(b(t,{code:m.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>n.type._parseAsync(new A(t,e,t.path,a))))).then((e=>k.mergeArray(a,e)));const s=[...t.data].map(((e,a)=>n.type._parseSync(new A(t,e,t.path,a))));return k.mergeArray(a,s)}get element(){return this._def.type}min(e,t){return new ee({...this._def,minLength:{value:e,message:I.toString(t)}})}max(e,t){return new ee({...this._def,maxLength:{value:e,message:I.toString(t)}})}length(e,t){return new ee({...this._def,exactLength:{value:e,message:I.toString(t)}})}nonempty(e){return this.min(1,e)}}function te(e){if(e instanceof ae){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=ve.create(te(n))}return new ae({...e._def,shape:()=>t})}return e instanceof ee?new ee({...e._def,type:te(e.element)}):e instanceof ve?ve.create(te(e.unwrap())):e instanceof _e?_e.create(te(e.unwrap())):e instanceof de?de.create(e.items.map((e=>te(e)))):e}ee.create=(e,t)=>new ee({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...O(t)});class ae extends R{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=c.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.object){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.object,received:t.parsedType}),x}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof Q&&"strip"===this._def.unknownKeys))for(const e in a.data)s.includes(e)||i.push(e);const r=[];for(const e of s){const t=n[e],s=a.data[e];r.push({key:{status:"valid",value:e},value:t._parse(new A(a,s,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof Q){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)r.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)i.length>0&&(b(a,{code:m.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=a.data[t];r.push({key:{status:"valid",value:t},value:e._parse(new A(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of r){const a=await t.key;e.push({key:a,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>k.mergeObjectSync(t,e))):k.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new ae({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var n,s,i,r;const o=null!==(i=null===(s=(n=this._def).errorMap)||void 0===s?void 0:s.call(n,t,a).message)&&void 0!==i?i:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(r=I.errToObj(e).message)&&void 0!==r?r:o}:{message:o}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Te.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const t={};return c.objectKeys(e).forEach((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new ae({...this._def,shape:()=>t})}omit(e){const t={};return c.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new ae({...this._def,shape:()=>t})}deepPartial(){return te(this)}partial(e){const t={};return c.objectKeys(this.shape).forEach((a=>{const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()})),new ae({...this._def,shape:()=>t})}required(e){const t={};return c.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof ve;)e=e._def.innerType;t[a]=e}})),new ae({...this._def,shape:()=>t})}keyof(){return pe(c.objectKeys(this.shape))}}ae.create=(e,t)=>new ae({shape:()=>e,unknownKeys:"strip",catchall:Q.create(),typeName:Te.ZodObject,...O(t)}),ae.strictCreate=(e,t)=>new ae({shape:()=>e,unknownKeys:"strict",catchall:Q.create(),typeName:Te.ZodObject,...O(t)}),ae.lazycreate=(e,t)=>new ae({shape:e,unknownKeys:"strip",catchall:Q.create(),typeName:Te.ZodObject,...O(t)});class ne extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new f(e.ctx.common.issues)));return b(t,{code:m.invalid_union,unionErrors:a}),x}));{let e;const n=[];for(const s of a){const a={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:a});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new f(e)));return b(t,{code:m.invalid_union,unionErrors:s}),x}}get options(){return this._def.options}}ne.create=(e,t)=>new ne({options:e,typeName:Te.ZodUnion,...O(t)});const se=e=>e instanceof le?se(e.schema):e instanceof ye?se(e.innerType()):e instanceof he?[e.value]:e instanceof me?e.options:e instanceof fe?Object.keys(e.enum):e instanceof be?se(e._def.innerType):e instanceof Y?[void 0]:e instanceof z?[null]:null;class ie extends R{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return b(t,{code:m.invalid_type,expected:h.object,received:t.parsedType}),x;const a=this.discriminator,n=t.data[a],s=this.optionsMap.get(n);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(b(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const n=new Map;for(const a of t){const t=se(a.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,a)}}return new ie({typeName:Te.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...O(a)})}}function re(e,t){const a=p(e),n=p(t);if(e===t)return{valid:!0,data:e};if(a===h.object&&n===h.object){const a=c.objectKeys(t),n=c.objectKeys(e).filter((e=>-1!==a.indexOf(e))),s={...e,...t};for(const a of n){const n=re(e[a],t[a]);if(!n.valid)return{valid:!1};s[a]=n.data}return{valid:!0,data:s}}if(a===h.array&&n===h.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const s=re(e[n],t[n]);if(!s.valid)return{valid:!1};a.push(s.data)}return{valid:!0,data:a}}return a===h.date&&n===h.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class oe extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(S(e)||S(n))return x;const s=re(e.value,n.value);return s.valid?((w(e)||w(n))&&t.dirty(),{status:t.value,value:s.data}):(b(a,{code:m.invalid_intersection_types}),x)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}oe.create=(e,t,a)=>new oe({left:e,right:t,typeName:Te.ZodIntersection,...O(a)});class de extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.array)return b(a,{code:m.invalid_type,expected:h.array,received:a.parsedType}),x;if(a.data.length<this._def.items.length)return b(a,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&a.data.length>this._def.items.length&&(b(a,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new A(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(n).then((e=>k.mergeArray(t,e))):k.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new de({...this._def,rest:e})}}de.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new de({items:e,typeName:Te.ZodTuple,rest:null,...O(t)})};class ue extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.map)return b(a,{code:m.invalid_type,expected:h.map,received:a.parsedType}),x;const n=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map((([e,t],i)=>({key:n._parse(new A(a,e,a.path,[i,"key"])),value:s._parse(new A(a,t,a.path,[i,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of i){const n=await a.key,s=await a.value;if("aborted"===n.status||"aborted"===s.status)return x;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of i){const n=a.key,s=a.value;if("aborted"===n.status||"aborted"===s.status)return x;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}ue.create=(e,t,a)=>new ue({valueType:t,keyType:e,typeName:Te.ZodMap,...O(a)});class ce extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==h.set)return b(a,{code:m.invalid_type,expected:h.set,received:a.parsedType}),x;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(b(a,{code:m.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&a.data.size>n.maxSize.value&&(b(a,{code:m.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function i(e){const a=new Set;for(const n of e){if("aborted"===n.status)return x;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const r=[...a.data.values()].map(((e,t)=>s._parse(new A(a,e,a.path,t))));return a.common.async?Promise.all(r).then((e=>i(e))):i(r)}min(e,t){return new ce({...this._def,minSize:{value:e,message:I.toString(t)}})}max(e,t){return new ce({...this._def,maxSize:{value:e,message:I.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ce.create=(e,t)=>new ce({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet,...O(t)});class le extends R{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})}}le.create=(e,t)=>new le({getter:e,typeName:Te.ZodLazy,...O(t)});class he extends R{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return b(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}function pe(e,t){return new me({values:e,typeName:Te.ZodEnum,...O(t)})}he.create=(e,t)=>new he({value:e,typeName:Te.ZodLiteral,...O(t)});class me extends R{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return b(t,{expected:c.joinValues(a),received:t.parsedType,code:m.invalid_type}),x}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return b(t,{received:t.data,code:m.invalid_enum_value,options:a}),x}return C(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 me.create(e)}exclude(e){return me.create(this.options.filter((t=>!e.includes(t))))}}me.create=pe;class fe extends R{_parse(e){const t=c.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==h.string&&a.parsedType!==h.number){const e=c.objectValues(t);return b(a,{expected:c.joinValues(e),received:a.parsedType,code:m.invalid_type}),x}if(-1===t.indexOf(e.data)){const e=c.objectValues(t);return b(a,{received:a.data,code:m.invalid_enum_value,options:e}),x}return C(e.data)}get enum(){return this._def.values}}fe.create=(e,t)=>new fe({values:e,typeName:Te.ZodNativeEnum,...O(t)});class ge extends R{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&!1===t.common.async)return b(t,{code:m.invalid_type,expected:h.promise,received:t.parsedType}),x;const a=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return C(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ge.create=(e,t)=>new ge({type:e,typeName:Te.ZodPromise,...O(t)});class ye extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{b(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){const e=n.transform(a.data,s);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:a.path,parent:a}))):this._def.schema._parseSync({data:e,path:a.path,parent:a})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,s);if(a.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===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?x:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?x:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===n.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!T(e))return e;const i=n.transform(e.value,s);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:a.data,path:a.path,parent:a}).then((e=>T(e)?Promise.resolve(n.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}c.assertNever(n)}}ye.create=(e,t,a)=>new ye({schema:e,typeName:Te.ZodEffects,effect:t,...O(a)}),ye.createWithPreprocess=(e,t,a)=>new ye({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects,...O(a)});class ve extends R{_parse(e){return this._getType(e)===h.undefined?C(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Te.ZodOptional,...O(t)});class _e extends R{_parse(e){return this._getType(e)===h.null?C(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_e.create=(e,t)=>new _e({innerType:e,typeName:Te.ZodNullable,...O(t)});class be extends R{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===h.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}be.create=(e,t)=>new be({innerType:e,typeName:Te.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...O(t)});class ke extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return N(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new f(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new f(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ke.create=(e,t)=>new ke({innerType:e,typeName:Te.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...O(t)});class xe extends R{_parse(e){if(this._getType(e)!==h.nan){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.nan,received:t.parsedType}),x}return{status:"valid",value:e.data}}}xe.create=e=>new xe({typeName:Te.ZodNaN,...O(e)});class Ce extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Se extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new Se({in:e,out:t,typeName:Te.ZodPipeline})}}class we extends R{_parse(e){const t=this._def.innerType._parse(e);return T(t)&&(t.value=Object.freeze(t.value)),t}}var Te;we.create=(e,t)=>new we({innerType:e,typeName:Te.ZodReadonly,...O(t)}),ae.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"}(Te||(Te={}));const Ne=j.create,Ie=K.create;xe.create,V.create;const Ae=F.create;W.create,H.create,Y.create,z.create;const Ee=J.create;q.create,Q.create,X.create;const Oe=ee.create,Re=ae.create;ae.strictCreate,ne.create;const Ze=ie.create;oe.create,de.create,ue.create,ce.create,le.create;const Me=he.create,Pe=me.create,Le=fe.create;ge.create,ye.create,ve.create,_e.create,ye.createWithPreprocess,Se.create;const Ue=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],De=Pe(Ue),Be={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},Ge={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},je={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},$e=e=>Object.keys(Be).find((t=>Be[t].countries.includes(e??"")))||"International",Ke=(e,t=[])=>0===t.length||!!e&&t.includes($e(e.toUpperCase())),Ve=e=>{if(e){const t=$e(e);return je[t]}return"£"},Fe=e=>{if(e)return Ge[e]},We=(e,t)=>{if(t){const a=(e=>Be[$e(e)]?.supportRegionId)(t);if(a)return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,t,n)=>`${t}/${a.toLowerCase()}/${n}`))}return e},He=(e,t,a,n)=>{if(n){const s=n[$e(a)];if(s){return`${Ve(a)}${s[e][t].price}`}}},Ye={CURRENCY_SYMBOL:({countryCode:e})=>Ve(e),COUNTRY_NAME:({countryCode:e})=>Fe(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>He("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>He("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>He("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>He("GuardianWeekly","Annual",e,t),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},ze=(e,t,a)=>e?e.replace(Je,(e=>{const n=e.substring(2,e.length-2),s=Ye[n];if(s){const e=s({countryCode:t,prices:a});if(e)return e}return e})):"",Je=/%%.*?%%/g,qe=e=>{const t=e.match(Je)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},Qe=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},Xe=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),a=(t.getMonth()+1).toString().padStart(2,"0"),n=t.toLocaleString("default",{month:"long"}),s=t.getFullYear();return{reminderCta:`Remind me in ${n}`,reminderPeriod:`${s}-${a}-01`,reminderLabel:`${n} ${s}`}},et=new Date("2023-12-31"),tt=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<Qe(e.getFullYear()),at=(e,t=new Date)=>{return"US"===e&&tt(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${a=t.getFullYear()}-${(Qe(a).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${a}`}:"US"===e&&(e=>e>=Qe(e.getFullYear())&&e<et)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):Xe(t);var a},nt=Re({text:Ne(),baseUrl:Ne()});let st=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});Le(st);const it=Ze("type",[Re({type:Me(st.Custom),cta:nt}),Re({type:Me(st.ContributionsReminder)})]);let rt=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const ot=Le(rt);let dt=function(e){return e.money="money",e}({});const ut=Le(dt),ct=Re({countLabel:Ne(),goalReachedPrimary:Ne(),goalReachedSecondary:Ne()}),lt=Re({total:Ie(),goal:Ie()}),ht=Pe(["US","AU"]),pt=Re({endType:ot,countType:ut,currencySymbol:Ne(),copy:ct,name:ht,tickerData:lt.optional()}),mt=Pe(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),ft=Pe(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),gt=Re({abTestName:Ne(),abTestVariant:Ne(),campaignCode:Ne(),componentType:ft,products:Oe(mt).nullish(),labels:Oe(Ne()).nullish(),ophanPageId:Ne(),platformId:Ne(),referrerUrl:Ne(),clientName:Ne()}),yt=Re({mainUrl:Ne(),mobileUrl:Ne().optional(),tabletUrl:Ne().optional(),desktopUrl:Ne().optional(),leftColUrl:Ne().optional(),wideUrl:Ne().optional(),altText:Ne()}),vt=Re({name:Ne(),description:Ne().optional(),headshot:yt.optional()}),_t=Pe(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),bt=Pe(["new","guest","current"]),kt=Pe(["Live","Draft","Archived"]),xt=Pe(["Mobile","Desktop","All","iOS","Android"]),Ct=Pe(["SignedIn","SignedOut","All"]),St=Pe(["HasConsented","HasNotConsented","Everyone"]),wt=Re({name:Ne(),status:kt,priority:Ie(),controlProportionSettings:Re({proportion:Ie(),offset:Ie()}).optional(),deviceType:xt.optional(),signedInStatus:Ct.optional(),consentStatus:St.optional()}),Tt=Pe(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Nt=Re({minViews:Ie(),maxViews:Ie().optional(),periodInWeeks:Ie(),tagId:Ne().optional()});Re({userType:Oe(bt),product:Oe(_t)}),Re({tagIds:Oe(Ne()),sectionIds:Oe(Ne()),excludedTagIds:Oe(Ne()),excludedSectionIds:Oe(Ne())});const It=Pe(["for52Weeks","forTargetedWeeks"]),At=Re({for52Weeks:Ie(),forTargetedWeeks:Ie()}),Et=Re({maxViewsCount:Ie(),maxViewsDays:Ie(),minDaysBetweenViews:Ie()}),Ot=Re({type:Me("above"),copy:Ne().optional(),countType:It.optional()}),Rt=Re({reminderCta:Ne(),reminderLabel:Ne(),reminderPeriod:Ne()}),Zt=Pe(["ONE_OFF","MONTHLY","ANNUAL"]),Mt=Re({testName:Ne(),variantName:Ne(),defaultContributionType:Zt,displayContributionType:Zt.array(),amountsCardData:Re({ONE_OFF:Re({amounts:Oe(Ie()),defaultAmount:Ie(),hideChooseYourAmount:Ae().optional()}),MONTHLY:Re({amounts:Oe(Ie()),defaultAmount:Ie(),hideChooseYourAmount:Ae().optional()}),ANNUAL:Re({amounts:Oe(Ie()),defaultAmount:Ie(),hideChooseYourAmount:Ae().optional()})})}),Pt=Re({url:Ne()}),Lt=Re({name:Ne(),heading:Ne().optional(),paragraphs:Oe(Ne()),highlightedText:Ne().optional(),tickerSettings:pt.optional(),cta:nt.optional(),secondaryCta:it.optional(),newsletterSignup:Pt.optional(),image:yt.optional(),showReminderFields:Rt.optional(),separateArticleCount:Ot.optional(),maxViews:Et.optional(),showSignInLink:Ae().optional(),bylineWithImage:vt.optional(),showChoiceCards:Ae().optional(),choiceCardAmounts:Mt.optional(),defaultChoiceCardFrequency:Zt.optional()}),Ut=Re({variant:Lt,tracking:gt,countryCode:Ne().nullish(),articleCounts:At,onReminderOpen:Ee().nullish(),fetchEmail:Ee().nullish(),submitComponentEvent:Ee().nullish(),openCmp:Ee().nullish(),hasConsentForArticleCount:Ae().nullish(),stage:Ne().nullish()}),Dt=/^[0-9A-F]{2}$/,Bt=Ne().refine((e=>Dt.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),Gt=Re({r:Bt,g:Bt,b:Bt,kind:Me("hex")}),jt=Re({mobileUrl:Ne(),tabletUrl:Ne(),desktopUrl:Ne(),altText:Ne(),kind:Me("Image")}),$t=Re({buttonColour:Gt.nullish(),buttonTextColour:Gt.nullish(),buttonBorderColour:Gt.nullish(),buttonSelectColour:Gt.nullish(),buttonSelectTextColour:Gt.nullish(),buttonSelectBorderColour:Gt.nullish(),kind:Me("ChoiceCards")}),Kt=Re({visual:Ze("kind",[jt,$t]).nullish(),colours:Re({basic:Re({background:Gt,bodyText:Gt})})}),Vt=Pe(["contributions","subscriptions","signIn"]),Ft=Re({heading:Ne().optional(),messageText:Ne().optional(),paragraphs:Oe(Ne()).optional(),mobileMessageText:Ne().optional(),highlightedText:Ne().optional(),cta:nt.optional(),secondaryCta:it.optional()});Re({tracking:gt,bannerChannel:Vt,content:Ft.nullish(),mobileContent:Ft.nullish(),countryCode:Ne().nullish(),isSupporter:Ae().nullish(),tickerSettings:pt.nullish(),submitComponentEvent:Ee(),numArticles:Ie().nullish(),hasOptedOutOfArticleCount:Ae().nullish(),fetchEmail:Ee().nullish(),separateArticleCount:Ae().nullish(),design:Kt.nullish()});const Wt=Re({heading:Ne(),subheading:Ne(),primaryCta:nt.optional(),secondaryCta:nt.optional(),benefits:Oe(Ne()).optional()});Re({content:Wt,tracking:gt,mobileContent:Wt.optional(),countryCode:Ne().optional(),submitComponentEvent:Ee(),numArticles:Ie().optional()});const Ht=Re({maxViewsCount:Ie(),maxViewsDays:Ie(),minDaysBetweenViews:Ie()}),Yt=["ONE_OFF","MONTHLY","ANNUAL"];wt.extend({name:Ne(),status:kt,locations:Oe(De),tagIds:Oe(Ne()),sections:Oe(Ne()),excludedTagIds:Oe(Ne()),excludedSections:Oe(Ne()),alwaysAsk:Ae(),maxViews:Ht.optional(),userCohort:Tt,hasCountryName:Ae(),highPriority:Ae(),useLocalViewLog:Ae(),articlesViewedSettings:Nt.optional(),priority:Ie(),variants:Lt.array(),isBanditTest:Ae().optional()});const zt=(e,t,a)=>{const n=(e=>{if(URLSearchParams){const t=new URLSearchParams(window.location.search).get(`force-${e}`);if(t)return t}return null})(e);return fetch(`${t}/${e}${n?`?force=${n}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then((t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t})).then((e=>e.json()))},Jt=(e,t)=>zt("epic",e,t),qt=(e,t)=>zt("liveblog-epic",e,t),Qt=(e,t)=>zt("banner",e,t),Xt=(e,t)=>zt("header",e,t);export{Ue as CountryGroupId,st as SecondaryCtaType,dt as TickerCountType,rt as TickerEndType,We as addRegionIdToSupportUrl,Xe as buildReminderFields,qe as containsNonArticleCountPlaceholder,Yt as contributionTabFrequencies,$e as countryCodeToCountryGroupId,De as countryGroupIdSchema,Ut as epicPropsSchema,Qt as getBanner,Fe as getCountryName,Jt as getEpic,t as getEpicViewLog,Xt as getHeader,qt as getLiveblogEpic,Ve as getLocalCurrencySymbol,at as getReminderFields,r as getWeeklyArticleHistory,Ke as inCountryGroups,u as incrementWeeklyArticleCount,a as logEpicView,ze as replaceNonArticleCountPlaceholders};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="gu.contributions.views",t="gu.history.weeklyArticleCount",a="gu.history.articleCountsThisWeek",n=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},s=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business"]),i=(e,t={})=>(e.forEach((e=>{s.has(e)&&(t[e]=(t[e]??0)+1)})),t);var r,o;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of a)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 a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},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"]),u=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 l 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},a={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)a._errors.push(t(s));else{let e=a,n=0;for(;n<s.path.length;){const a=s.path[n];n===s.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(s))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},a=[];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))):a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}l.create=e=>new l(e);const h=(e,t)=>{let a;switch(e.code){case c.invalid_type:a=e.received===d.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:a=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case c.invalid_union:a="Invalid input";break;case c.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case c.invalid_enum_value:a=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:a="Invalid function arguments";break;case c.invalid_return_type:a="Invalid function return type";break;case c.invalid_date:a="Invalid date";break;case c.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case c.too_small:a="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:a="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:a="Invalid input";break;case c.invalid_intersection_types:a="Intersection results could not be merged";break;case c.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:a="Number must be finite";break;default:a=t.defaultError,r.assertNever(e)}return{message:a}};let p=h;function m(){return p}const f=e=>{const{data:t,path:a,errorMaps:n,issueData:s}=e,i=[...a,...s.path||[]],r={...s,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{...s,path:i,message:s.message||o}};function y(e,t){const a=f({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,m(),h].filter((e=>!!e))});e.common.issues.push(a)}class g{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if("aborted"===n.status)return v;"dirty"===n.status&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t)a.push({key:await e.key,value:await e.value});return g.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:t,value:s}=n;if("aborted"===t.status)return v;if("aborted"===s.status)return v;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!n.alwaysSet||(a[t.value]=s.value)}return{status:e.value,value:a}}}const v=Object.freeze({status:"aborted"}),_=e=>({status:"valid",value:e}),b=e=>"aborted"===e.status,x=e=>"dirty"===e.status,k=e=>"valid"===e.status,C=e=>"undefined"!=typeof Promise&&e instanceof Promise;var S;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(S||(S={}));class T{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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 w=(e,t)=>{if(k(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 l(e.common.issues);return this._error=t,this._error}}};function N(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:s}=e;if(t&&(a||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:s};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=a?a:t.defaultError},description:s}}class I{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 u(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:u(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new g,ctx:{common:e.parent.common,data:e.data,parsedType:u(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(C(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 a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const n={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:u(e)},s=this._parseSync({data:e,path:n.path,parent:n});return w(n,s)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={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:u(e)},n=this._parse({data:e,path:a.path,parent:a}),s=await(C(n)?n:Promise.resolve(n));return w(a,s)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),i=()=>n.addIssue({code:c.custom,...a(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((a,n)=>!!e(a)||(n.addIssue("function"==typeof t?t(a,n):t),!1)))}_refinement(e){return new pe({schema:this,typeName:ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return me.create(this,this._def)}nullable(){return fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return J.create(this,this._def)}promise(){return he.create(this,this._def)}or(e){return X.create([this,e],this._def)}and(e){return ne.create(this,e,this._def)}transform(e){return new pe({...N(this._def),schema:this,typeName:ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ye({...N(this._def),innerType:this,defaultValue:t,typeName:ke.ZodDefault})}brand(){return new _e({typeName:ke.ZodBranded,type:this,...N(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ge({...N(this._def),innerType:this,catchValue:t,typeName:ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return be.create(this,e)}readonly(){return xe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const A=/^c[^\s-]{8,}$/i,E=/^[a-z][a-z0-9]*$/,O=/^[0-9A-HJKMNP-TV-Z]{26}$/,R=/^[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,Z=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const P=/^(((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}))$/,L=/^(([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 U extends I{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==d.string){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.string,received:t.parsedType}),v}const t=new g;let a;for(const o of this._def.checks)if("min"===o.kind)e.data.length<o.value&&(a=this._getOrReturnCtx(e,a),y(a,{code:c.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if("max"===o.kind)e.data.length>o.value&&(a=this._getOrReturnCtx(e,a),y(a,{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,s=e.data.length<o.value;(n||s)&&(a=this._getOrReturnCtx(e,a),n?y(a,{code:c.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&y(a,{code:c.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),t.dirty())}else if("email"===o.kind)Z.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"email",code:c.invalid_string,message:o.message}),t.dirty());else if("emoji"===o.kind)M||(M=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),M.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"emoji",code:c.invalid_string,message:o.message}),t.dirty());else if("uuid"===o.kind)R.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"uuid",code:c.invalid_string,message:o.message}),t.dirty());else if("cuid"===o.kind)A.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"cuid",code:c.invalid_string,message:o.message}),t.dirty());else if("cuid2"===o.kind)E.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"cuid2",code:c.invalid_string,message:o.message}),t.dirty());else if("ulid"===o.kind)O.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"ulid",code:c.invalid_string,message:o.message}),t.dirty());else if("url"===o.kind)try{new URL(e.data)}catch(n){a=this._getOrReturnCtx(e,a),y(a,{validation:"url",code:c.invalid_string,message:o.message}),t.dirty()}else if("regex"===o.kind){o.regex.lastIndex=0;o.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"regex",code:c.invalid_string,message:o.message}),t.dirty())}else if("trim"===o.kind)e.data=e.data.trim();else if("includes"===o.kind)e.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(e,a),y(a,{code:c.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),t.dirty());else if("toLowerCase"===o.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===o.kind)e.data=e.data.toUpperCase();else if("startsWith"===o.kind)e.data.startsWith(o.value)||(a=this._getOrReturnCtx(e,a),y(a,{code:c.invalid_string,validation:{startsWith:o.value},message:o.message}),t.dirty());else if("endsWith"===o.kind)e.data.endsWith(o.value)||(a=this._getOrReturnCtx(e,a),y(a,{code:c.invalid_string,validation:{endsWith:o.value},message:o.message}),t.dirty());else if("datetime"===o.kind){((i=o).precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):0===i.precision?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{code:c.invalid_string,validation:"datetime",message:o.message}),t.dirty())}else"ip"===o.kind?(n=e.data,("v4"!==(s=o.version)&&s||!P.test(n))&&("v6"!==s&&s||!L.test(n))&&(a=this._getOrReturnCtx(e,a),y(a,{validation:"ip",code:c.invalid_string,message:o.message}),t.dirty())):r.assertNever(o);var n,s,i;return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement((t=>e.test(t)),{validation:t,code:c.invalid_string,...S.errToObj(a)})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.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,...S.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...S.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new U({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new U({...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.value<e)&&(e=t.value);return e}}function D(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=a>n?a:n;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}U.create=e=>{var t;return new U({checks:[],typeName:ke.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...N(e)})};class B extends I{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 y(t,{code:c.invalid_type,expected:d.number,received:t.parsedType}),v}let t;const a=new g;for(const n of this._def.checks)if("int"===n.kind)r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:c.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else"multipleOf"===n.kind?0!==D(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_finite,message:n.message}),a.dirty()):r.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,a,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:S.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.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<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}B.create=e=>new B({checks:[],typeName:ke.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...N(e)});class G extends I{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 y(t,{code:c.invalid_type,expected:d.bigint,received:t.parsedType}),v}let t;const a=new g;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):r.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,a,n){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:S.toString(n)}]})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.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<e)&&(e=t.value);return e}}G.create=e=>{var t;return new G({checks:[],typeName:ke.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...N(e)})};class j extends I{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==d.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.boolean,received:t.parsedType}),v}return _(e.data)}}j.create=e=>new j({typeName:ke.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...N(e)});class $ extends I{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==d.date){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.date,received:t.parsedType}),v}if(isNaN(e.data.getTime())){return y(this._getOrReturnCtx(e),{code:c.invalid_date}),v}const t=new g;let a;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),y(a,{code:c.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),y(a,{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 $({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.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.value<e)&&(e=t.value);return null!=e?new Date(e):null}}$.create=e=>new $({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ke.ZodDate,...N(e)});class K extends I{_parse(e){if(this._getType(e)!==d.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.symbol,received:t.parsedType}),v}return _(e.data)}}K.create=e=>new K({typeName:ke.ZodSymbol,...N(e)});class V extends I{_parse(e){if(this._getType(e)!==d.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.undefined,received:t.parsedType}),v}return _(e.data)}}V.create=e=>new V({typeName:ke.ZodUndefined,...N(e)});class F extends I{_parse(e){if(this._getType(e)!==d.null){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.null,received:t.parsedType}),v}return _(e.data)}}F.create=e=>new F({typeName:ke.ZodNull,...N(e)});class W extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return _(e.data)}}W.create=e=>new W({typeName:ke.ZodAny,...N(e)});class H extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _(e.data)}}H.create=e=>new H({typeName:ke.ZodUnknown,...N(e)});class Y extends I{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.never,received:t.parsedType}),v}}Y.create=e=>new Y({typeName:ke.ZodNever,...N(e)});class z extends I{_parse(e){if(this._getType(e)!==d.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.void,received:t.parsedType}),v}return _(e.data)}}z.create=e=>new z({typeName:ke.ZodVoid,...N(e)});class J extends I{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==d.array)return y(t,{code:c.invalid_type,expected:d.array,received:t.parsedType}),v;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(y(t,{code:e?c.too_big:c.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(y(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(y(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>n.type._parseAsync(new T(t,e,t.path,a))))).then((e=>g.mergeArray(a,e)));const s=[...t.data].map(((e,a)=>n.type._parseSync(new T(t,e,t.path,a))));return g.mergeArray(a,s)}get element(){return this._def.type}min(e,t){return new J({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new J({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new J({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}function q(e){if(e instanceof Q){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=me.create(q(n))}return new Q({...e._def,shape:()=>t})}return e instanceof J?new J({...e._def,type:q(e.element)}):e instanceof me?me.create(q(e.unwrap())):e instanceof fe?fe.create(q(e.unwrap())):e instanceof se?se.create(e.items.map((e=>q(e)))):e}J.create=(e,t)=>new J({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ke.ZodArray,...N(t)});class Q extends I{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 y(t,{code:c.invalid_type,expected:d.object,received:t.parsedType}),v}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof Y&&"strip"===this._def.unknownKeys))for(const e in a.data)s.includes(e)||i.push(e);const r=[];for(const e of s){const t=n[e],s=a.data[e];r.push({key:{status:"valid",value:e},value:t._parse(new T(a,s,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof Y){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)r.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)i.length>0&&(y(a,{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=a.data[t];r.push({key:{status:"valid",value:t},value:e._parse(new T(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of r){const a=await t.key;e.push({key:a,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>g.mergeObjectSync(t,e))):g.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new Q({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var n,s,i,r;const o=null!==(i=null===(s=(n=this._def).errorMap)||void 0===s?void 0:s.call(n,t,a).message)&&void 0!==i?i:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(r=S.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:ke.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((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new Q({...this._def,shape:()=>t})}omit(e){const t={};return r.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new Q({...this._def,shape:()=>t})}deepPartial(){return q(this)}partial(e){const t={};return r.objectKeys(this.shape).forEach((a=>{const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()})),new Q({...this._def,shape:()=>t})}required(e){const t={};return r.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof me;)e=e._def.innerType;t[a]=e}})),new Q({...this._def,shape:()=>t})}keyof(){return ue(r.objectKeys(this.shape))}}Q.create=(e,t)=>new Q({shape:()=>e,unknownKeys:"strip",catchall:Y.create(),typeName:ke.ZodObject,...N(t)}),Q.strictCreate=(e,t)=>new Q({shape:()=>e,unknownKeys:"strict",catchall:Y.create(),typeName:ke.ZodObject,...N(t)}),Q.lazycreate=(e,t)=>new Q({shape:e,unknownKeys:"strip",catchall:Y.create(),typeName:ke.ZodObject,...N(t)});class X extends I{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new l(e.ctx.common.issues)));return y(t,{code:c.invalid_union,unionErrors:a}),v}));{let e;const n=[];for(const s of a){const a={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:a});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new l(e)));return y(t,{code:c.invalid_union,unionErrors:s}),v}}get options(){return this._def.options}}X.create=(e,t)=>new X({options:e,typeName:ke.ZodUnion,...N(t)});const ee=e=>e instanceof oe?ee(e.schema):e instanceof pe?ee(e.innerType()):e instanceof de?[e.value]:e instanceof ce?e.options:e instanceof le?Object.keys(e.enum):e instanceof ye?ee(e._def.innerType):e instanceof V?[void 0]:e instanceof F?[null]:null;class te extends I{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.object)return y(t,{code:c.invalid_type,expected:d.object,received:t.parsedType}),v;const a=this.discriminator,n=t.data[a],s=this.optionsMap.get(n);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),v)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const n=new Map;for(const a of t){const t=ee(a.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,a)}}return new te({typeName:ke.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...N(a)})}}function ae(e,t){const a=u(e),n=u(t);if(e===t)return{valid:!0,data:e};if(a===d.object&&n===d.object){const a=r.objectKeys(t),n=r.objectKeys(e).filter((e=>-1!==a.indexOf(e))),s={...e,...t};for(const a of n){const n=ae(e[a],t[a]);if(!n.valid)return{valid:!1};s[a]=n.data}return{valid:!0,data:s}}if(a===d.array&&n===d.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const s=ae(e[n],t[n]);if(!s.valid)return{valid:!1};a.push(s.data)}return{valid:!0,data:a}}return a===d.date&&n===d.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ne extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(b(e)||b(n))return v;const s=ae(e.value,n.value);return s.valid?((x(e)||x(n))&&t.dirty(),{status:t.value,value:s.data}):(y(a,{code:c.invalid_intersection_types}),v)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}ne.create=(e,t,a)=>new ne({left:e,right:t,typeName:ke.ZodIntersection,...N(a)});class se extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==d.array)return y(a,{code:c.invalid_type,expected:d.array,received:a.parsedType}),v;if(a.data.length<this._def.items.length)return y(a,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;!this._def.rest&&a.data.length>this._def.items.length&&(y(a,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new T(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(n).then((e=>g.mergeArray(t,e))):g.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new se({...this._def,rest:e})}}se.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new se({items:e,typeName:ke.ZodTuple,rest:null,...N(t)})};class ie extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==d.map)return y(a,{code:c.invalid_type,expected:d.map,received:a.parsedType}),v;const n=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map((([e,t],i)=>({key:n._parse(new T(a,e,a.path,[i,"key"])),value:s._parse(new T(a,t,a.path,[i,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of i){const n=await a.key,s=await a.value;if("aborted"===n.status||"aborted"===s.status)return v;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of i){const n=a.key,s=a.value;if("aborted"===n.status||"aborted"===s.status)return v;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}ie.create=(e,t,a)=>new ie({valueType:t,keyType:e,typeName:ke.ZodMap,...N(a)});class re extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==d.set)return y(a,{code:c.invalid_type,expected:d.set,received:a.parsedType}),v;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(y(a,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&a.data.size>n.maxSize.value&&(y(a,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function i(e){const a=new Set;for(const n of e){if("aborted"===n.status)return v;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const r=[...a.data.values()].map(((e,t)=>s._parse(new T(a,e,a.path,t))));return a.common.async?Promise.all(r).then((e=>i(e))):i(r)}min(e,t){return new re({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new re({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}re.create=(e,t)=>new re({valueType:e,minSize:null,maxSize:null,typeName:ke.ZodSet,...N(t)});class oe extends I{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})}}oe.create=(e,t)=>new oe({getter:e,typeName:ke.ZodLazy,...N(t)});class de extends I{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),v}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ue(e,t){return new ce({values:e,typeName:ke.ZodEnum,...N(t)})}de.create=(e,t)=>new de({value:e,typeName:ke.ZodLiteral,...N(t)});class ce extends I{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return y(t,{expected:r.joinValues(a),received:t.parsedType,code:c.invalid_type}),v}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return y(t,{received:t.data,code:c.invalid_enum_value,options:a}),v}return _(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 ce.create(e)}exclude(e){return ce.create(this.options.filter((t=>!e.includes(t))))}}ce.create=ue;class le extends I{_parse(e){const t=r.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==d.string&&a.parsedType!==d.number){const e=r.objectValues(t);return y(a,{expected:r.joinValues(e),received:a.parsedType,code:c.invalid_type}),v}if(-1===t.indexOf(e.data)){const e=r.objectValues(t);return y(a,{received:a.data,code:c.invalid_enum_value,options:e}),v}return _(e.data)}get enum(){return this._def.values}}le.create=(e,t)=>new le({values:e,typeName:ke.ZodNativeEnum,...N(t)});class he extends I{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.promise&&!1===t.common.async)return y(t,{code:c.invalid_type,expected:d.promise,received:t.parsedType}),v;const a=t.parsedType===d.promise?t.data:Promise.resolve(t.data);return _(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}he.create=(e,t)=>new he({type:e,typeName:ke.ZodPromise,...N(t)});class pe extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{y(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){const e=n.transform(a.data,s);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:a.path,parent:a}))):this._def.schema._parseSync({data:e,path:a.path,parent:a})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,s);if(a.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===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?v:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?v:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===n.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!k(e))return e;const i=n.transform(e.value,s);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:a.data,path:a.path,parent:a}).then((e=>k(e)?Promise.resolve(n.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}r.assertNever(n)}}pe.create=(e,t,a)=>new pe({schema:e,typeName:ke.ZodEffects,effect:t,...N(a)}),pe.createWithPreprocess=(e,t,a)=>new pe({schema:t,effect:{type:"preprocess",transform:e},typeName:ke.ZodEffects,...N(a)});class me extends I{_parse(e){return this._getType(e)===d.undefined?_(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}me.create=(e,t)=>new me({innerType:e,typeName:ke.ZodOptional,...N(t)});class fe extends I{_parse(e){return this._getType(e)===d.null?_(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(e,t)=>new fe({innerType:e,typeName:ke.ZodNullable,...N(t)});class ye extends I{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===d.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...N(t)});class ge extends I{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return C(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new l(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ge.create=(e,t)=>new ge({innerType:e,typeName:ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...N(t)});class ve extends I{_parse(e){if(this._getType(e)!==d.nan){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.nan,received:t.parsedType}),v}return{status:"valid",value:e.data}}}ve.create=e=>new ve({typeName:ke.ZodNaN,...N(e)});class _e extends I{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class be extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new be({in:e,out:t,typeName:ke.ZodPipeline})}}class xe extends I{_parse(e){const t=this._def.innerType._parse(e);return k(t)&&(t.value=Object.freeze(t.value)),t}}var ke;xe.create=(e,t)=>new xe({innerType:e,typeName:ke.ZodReadonly,...N(t)}),Q.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"}(ke||(ke={}));const Ce=U.create,Se=B.create;ve.create,G.create;const Te=j.create;$.create,K.create,V.create,F.create;const we=W.create;H.create,Y.create,z.create;const Ne=J.create,Ie=Q.create;Q.strictCreate,X.create;const Ae=te.create;ne.create,se.create,ie.create,re.create,oe.create;const Ee=de.create,Oe=ce.create,Re=le.create;he.create,pe.create,me.create,fe.create,pe.createWithPreprocess,be.create;const Ze=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],Me=Oe(Ze),Pe={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},Le={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},Ue={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},De=e=>Object.keys(Pe).find((t=>Pe[t].countries.includes(e??"")))||"International",Be=e=>{if(e){const t=De(e);return Ue[t]}return"£"},Ge=e=>{if(e)return Le[e]},je=(e,t,a,n)=>{if(n){const s=n[De(a)];if(s){return`${Be(a)}${s[e][t].price}`}}},$e={CURRENCY_SYMBOL:({countryCode:e})=>Be(e),COUNTRY_NAME:({countryCode:e})=>Ge(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>je("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>je("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>je("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>je("GuardianWeekly","Annual",e,t),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},Ke=/%%.*?%%/g,Ve=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},Fe=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),a=(t.getMonth()+1).toString().padStart(2,"0"),n=t.toLocaleString("default",{month:"long"}),s=t.getFullYear();return{reminderCta:`Remind me in ${n}`,reminderPeriod:`${s}-${a}-01`,reminderLabel:`${n} ${s}`}},We=new Date("2023-12-31"),He=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<Ve(e.getFullYear()),Ye=Ie({text:Ce(),baseUrl:Ce()});let ze=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});Re(ze);const Je=Ae("type",[Ie({type:Ee(ze.Custom),cta:Ye}),Ie({type:Ee(ze.ContributionsReminder)})]);let qe=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const Qe=Re(qe);let Xe=function(e){return e.money="money",e}({});const et=Re(Xe),tt=Ie({countLabel:Ce(),goalReachedPrimary:Ce(),goalReachedSecondary:Ce()}),at=Ie({total:Se(),goal:Se()}),nt=Oe(["US","AU"]),st=Ie({endType:Qe,countType:et,currencySymbol:Ce(),copy:tt,name:nt,tickerData:at.optional()}),it=Oe(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),rt=Oe(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),ot=Ie({abTestName:Ce(),abTestVariant:Ce(),campaignCode:Ce(),componentType:rt,products:Ne(it).nullish(),labels:Ne(Ce()).nullish(),ophanPageId:Ce(),platformId:Ce(),referrerUrl:Ce(),clientName:Ce()}),dt=Ie({mainUrl:Ce(),mobileUrl:Ce().optional(),tabletUrl:Ce().optional(),desktopUrl:Ce().optional(),leftColUrl:Ce().optional(),wideUrl:Ce().optional(),altText:Ce()}),ut=Ie({name:Ce(),description:Ce().optional(),headshot:dt.optional()}),ct=Oe(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),lt=Oe(["new","guest","current"]),ht=Oe(["Live","Draft","Archived"]),pt=Oe(["Mobile","Desktop","All","iOS","Android"]),mt=Oe(["SignedIn","SignedOut","All"]),ft=Ie({name:Ce(),status:ht,priority:Se(),controlProportionSettings:Ie({proportion:Se(),offset:Se()}).optional(),deviceType:pt.optional(),signedInStatus:mt.optional()}),yt=Oe(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),gt=Ie({minViews:Se(),maxViews:Se().optional(),periodInWeeks:Se(),tagId:Ce().optional()});Ie({userType:Ne(lt),product:Ne(ct)}),Ie({tagIds:Ne(Ce()),sectionIds:Ne(Ce()),excludedTagIds:Ne(Ce()),excludedSectionIds:Ne(Ce())});const vt=Oe(["for52Weeks","forTargetedWeeks"]),_t=Ie({for52Weeks:Se(),forTargetedWeeks:Se()}),bt=Ie({maxViewsCount:Se(),maxViewsDays:Se(),minDaysBetweenViews:Se()}),xt=Ie({type:Ee("above"),copy:Ce().optional(),countType:vt.optional()}),kt=Ie({reminderCta:Ce(),reminderLabel:Ce(),reminderPeriod:Ce()}),Ct=Oe(["ONE_OFF","MONTHLY","ANNUAL"]),St=Ie({testName:Ce(),variantName:Ce(),defaultContributionType:Ct,displayContributionType:Ct.array(),amountsCardData:Ie({ONE_OFF:Ie({amounts:Ne(Se()),defaultAmount:Se(),hideChooseYourAmount:Te().optional()}),MONTHLY:Ie({amounts:Ne(Se()),defaultAmount:Se(),hideChooseYourAmount:Te().optional()}),ANNUAL:Ie({amounts:Ne(Se()),defaultAmount:Se(),hideChooseYourAmount:Te().optional()})})}),Tt=Ie({url:Ce()}),wt=Ie({name:Ce(),heading:Ce().optional(),paragraphs:Ne(Ce()),highlightedText:Ce().optional(),tickerSettings:st.optional(),cta:Ye.optional(),secondaryCta:Je.optional(),newsletterSignup:Tt.optional(),image:dt.optional(),showReminderFields:kt.optional(),separateArticleCount:xt.optional(),maxViews:bt.optional(),showSignInLink:Te().optional(),bylineWithImage:ut.optional(),showChoiceCards:Te().optional(),choiceCardAmounts:St.optional(),defaultChoiceCardFrequency:Ct.optional()}),Nt=Ie({variant:wt,tracking:ot,countryCode:Ce().nullish(),articleCounts:_t,onReminderOpen:we().nullish(),fetchEmail:we().nullish(),submitComponentEvent:we().nullish(),openCmp:we().nullish(),hasConsentForArticleCount:Te().nullish(),stage:Ce().nullish()}),It=/^[0-9A-F]{2}$/,At=Ce().refine((e=>It.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),Et=Ie({r:At,g:At,b:At,kind:Ee("hex")}),Ot=Ie({mobileUrl:Ce(),tabletDesktopUrl:Ce(),wideUrl:Ce(),altText:Ce(),kind:Ee("Image")}),Rt=Ie({buttonColour:Et.nullish(),buttonTextColour:Et.nullish(),buttonBorderColour:Et.nullish(),buttonSelectColour:Et.nullish(),buttonSelectTextColour:Et.nullish(),buttonSelectBorderColour:Et.nullish(),kind:Ee("ChoiceCards")}),Zt=Ie({visual:Ae("kind",[Ot,Rt]).nullish(),colours:Ie({basic:Ie({background:Et,bodyText:Et})})}),Mt=Oe(["contributions","subscriptions","signIn"]),Pt=Ie({heading:Ce().optional(),messageText:Ce().optional(),paragraphs:Ne(Ce()).optional(),mobileMessageText:Ce().optional(),highlightedText:Ce().optional(),cta:Ye.optional(),secondaryCta:Je.optional()});Ie({tracking:ot,bannerChannel:Mt,content:Pt.nullish(),mobileContent:Pt.nullish(),countryCode:Ce().nullish(),isSupporter:Te().nullish(),tickerSettings:st.nullish(),submitComponentEvent:we(),numArticles:Se().nullish(),hasOptedOutOfArticleCount:Te().nullish(),fetchEmail:we().nullish(),separateArticleCount:Te().nullish(),design:Zt.nullish()});const Lt=Ie({heading:Ce(),subheading:Ce(),primaryCta:Ye.optional(),secondaryCta:Ye.optional(),benefits:Ne(Ce()).optional()});Ie({content:Lt,tracking:ot,mobileContent:Lt.optional(),countryCode:Ce().optional(),submitComponentEvent:we(),numArticles:Se().optional()});const Ut=Ie({maxViewsCount:Se(),maxViewsDays:Se(),minDaysBetweenViews:Se()});ft.extend({name:Ce(),status:ht,locations:Ne(Me),tagIds:Ne(Ce()),sections:Ne(Ce()),excludedTagIds:Ne(Ce()),excludedSections:Ne(Ce()),alwaysAsk:Te(),maxViews:Ut.optional(),userCohort:yt,hasCountryName:Te(),highPriority:Te(),useLocalViewLog:Te(),articlesViewedSettings:gt.optional(),priority:Se(),variants:wt.array()});const Dt=(e,t,a)=>{const n=(e=>{if(URLSearchParams){const t=new URLSearchParams(window.location.search).get(`force-${e}`);if(t)return t}return null})(e);return fetch(`${t}/${e}${n?`?force=${n}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then((t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t})).then((e=>e.json()))};exports.CountryGroupId=Ze,exports.SecondaryCtaType=ze,exports.TickerCountType=Xe,exports.TickerEndType=qe,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const a=(e=>Pe[De(e)]?.supportRegionId)(t);if(a)return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,t,n)=>`${t}/${a.toLowerCase()}/${n}`))}return e},exports.buildReminderFields=Fe,exports.containsNonArticleCountPlaceholder=e=>{const t=e.match(Ke)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=De,exports.countryGroupIdSchema=Me,exports.epicPropsSchema=Nt,exports.getBanner=(e,t)=>Dt("banner",e,t),exports.getCountryName=Ge,exports.getEpic=(e,t)=>Dt("epic",e,t),exports.getEpicViewLog=t=>t.get(e)||void 0,exports.getHeader=(e,t)=>Dt("header",e,t),exports.getLiveblogEpic=(e,t)=>Dt("liveblog-epic",e,t),exports.getLocalCurrencySymbol=Be,exports.getReminderFields=(e,t=new Date)=>{return"US"===e&&He(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${a=t.getFullYear()}-${(Ve(a).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${a}`}:"US"===e&&(e=>e>=Ve(e.getFullYear())&&e<We)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):Fe(t);var a},exports.getWeeklyArticleHistory=e=>e.get(t)||void 0,exports.inCountryGroups=(e,t=[])=>0===t.length||!!e&&t.includes(De(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,s,r)=>{const o=((e,t)=>{const s=n(new Date),i=e.get(a);if(i&&i.week===s){const n=i.articles[t]||0;return e.set(a,{week:s,articles:{...i.articles,[t]:n+1}}),n>0}return e.set(a,{week:s,articles:{[t]:1}}),!1})(e,s);if(!o){const a=n(new Date),s=e.get(t)||[],o=s[0];if(o&&o.week&&o.week===a)o.count+=1,o.tags=i(r,o.tags),e.set(t,s);else{s.unshift({week:a,count:1,tags:i(r,{})});const n=a-365,o=s.filter((e=>e.week>=n));e.set(t,o)}}},exports.logEpicView=t=>{const a=localStorage.getItem(e),n=a?JSON.parse(a).value:[];n.push({date:(new Date).getTime(),testId:t});const s={value:n.slice(-50)};localStorage.setItem(e,JSON.stringify(s))},exports.replaceNonArticleCountPlaceholders=(e,t,a)=>e?e.replace(Ke,(e=>{const n=e.substring(2,e.length-2),s=$e[n];if(s){const e=s({countryCode:t,prices:a});if(e)return e}return e})):"";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="gu.contributions.views",t="gu.history.weeklyArticleCount",a="gu.history.articleCountsThisWeek",n=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},s=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business"]),i=(e,t={})=>(e.forEach((e=>{s.has(e)&&(t[e]=(t[e]??0)+1)})),t);var r,o;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of a)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 a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},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"]),u=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 l 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},a={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)a._errors.push(t(s));else{let e=a,n=0;for(;n<s.path.length;){const a=s.path[n];n===s.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(s))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},a=[];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))):a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}l.create=e=>new l(e);const h=(e,t)=>{let a;switch(e.code){case c.invalid_type:a=e.received===d.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:a=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case c.invalid_union:a="Invalid input";break;case c.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case c.invalid_enum_value:a=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:a="Invalid function arguments";break;case c.invalid_return_type:a="Invalid function return type";break;case c.invalid_date:a="Invalid date";break;case c.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case c.too_small:a="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:a="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:a="Invalid input";break;case c.invalid_intersection_types:a="Intersection results could not be merged";break;case c.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:a="Number must be finite";break;default:a=t.defaultError,r.assertNever(e)}return{message:a}};let p=h;function m(){return p}const f=e=>{const{data:t,path:a,errorMaps:n,issueData:s}=e,i=[...a,...s.path||[]],r={...s,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{...s,path:i,message:s.message||o}};function y(e,t){const a=f({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,m(),h].filter((e=>!!e))});e.common.issues.push(a)}class g{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if("aborted"===n.status)return v;"dirty"===n.status&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t)a.push({key:await e.key,value:await e.value});return g.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:t,value:s}=n;if("aborted"===t.status)return v;if("aborted"===s.status)return v;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!n.alwaysSet||(a[t.value]=s.value)}return{status:e.value,value:a}}}const v=Object.freeze({status:"aborted"}),_=e=>({status:"valid",value:e}),b=e=>"aborted"===e.status,x=e=>"dirty"===e.status,k=e=>"valid"===e.status,C=e=>"undefined"!=typeof Promise&&e instanceof Promise;var S;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(S||(S={}));class T{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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 w=(e,t)=>{if(k(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 l(e.common.issues);return this._error=t,this._error}}};function N(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:s}=e;if(t&&(a||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:s};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=a?a:t.defaultError},description:s}}class I{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 u(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:u(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new g,ctx:{common:e.parent.common,data:e.data,parsedType:u(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(C(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 a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const n={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:u(e)},s=this._parseSync({data:e,path:n.path,parent:n});return w(n,s)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={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:u(e)},n=this._parse({data:e,path:a.path,parent:a}),s=await(C(n)?n:Promise.resolve(n));return w(a,s)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),i=()=>n.addIssue({code:c.custom,...a(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((a,n)=>!!e(a)||(n.addIssue("function"==typeof t?t(a,n):t),!1)))}_refinement(e){return new pe({schema:this,typeName:ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return me.create(this,this._def)}nullable(){return fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return J.create(this,this._def)}promise(){return he.create(this,this._def)}or(e){return X.create([this,e],this._def)}and(e){return ne.create(this,e,this._def)}transform(e){return new pe({...N(this._def),schema:this,typeName:ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ye({...N(this._def),innerType:this,defaultValue:t,typeName:ke.ZodDefault})}brand(){return new _e({typeName:ke.ZodBranded,type:this,...N(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ge({...N(this._def),innerType:this,catchValue:t,typeName:ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return be.create(this,e)}readonly(){return xe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const A=/^c[^\s-]{8,}$/i,E=/^[a-z][a-z0-9]*$/,O=/^[0-9A-HJKMNP-TV-Z]{26}$/,R=/^[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,Z=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const P=/^(((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}))$/,L=/^(([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 U extends I{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==d.string){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.string,received:t.parsedType}),v}const t=new g;let a;for(const o of this._def.checks)if("min"===o.kind)e.data.length<o.value&&(a=this._getOrReturnCtx(e,a),y(a,{code:c.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if("max"===o.kind)e.data.length>o.value&&(a=this._getOrReturnCtx(e,a),y(a,{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,s=e.data.length<o.value;(n||s)&&(a=this._getOrReturnCtx(e,a),n?y(a,{code:c.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&y(a,{code:c.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),t.dirty())}else if("email"===o.kind)Z.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"email",code:c.invalid_string,message:o.message}),t.dirty());else if("emoji"===o.kind)M||(M=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),M.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"emoji",code:c.invalid_string,message:o.message}),t.dirty());else if("uuid"===o.kind)R.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"uuid",code:c.invalid_string,message:o.message}),t.dirty());else if("cuid"===o.kind)A.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"cuid",code:c.invalid_string,message:o.message}),t.dirty());else if("cuid2"===o.kind)E.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"cuid2",code:c.invalid_string,message:o.message}),t.dirty());else if("ulid"===o.kind)O.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"ulid",code:c.invalid_string,message:o.message}),t.dirty());else if("url"===o.kind)try{new URL(e.data)}catch(n){a=this._getOrReturnCtx(e,a),y(a,{validation:"url",code:c.invalid_string,message:o.message}),t.dirty()}else if("regex"===o.kind){o.regex.lastIndex=0;o.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{validation:"regex",code:c.invalid_string,message:o.message}),t.dirty())}else if("trim"===o.kind)e.data=e.data.trim();else if("includes"===o.kind)e.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(e,a),y(a,{code:c.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),t.dirty());else if("toLowerCase"===o.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===o.kind)e.data=e.data.toUpperCase();else if("startsWith"===o.kind)e.data.startsWith(o.value)||(a=this._getOrReturnCtx(e,a),y(a,{code:c.invalid_string,validation:{startsWith:o.value},message:o.message}),t.dirty());else if("endsWith"===o.kind)e.data.endsWith(o.value)||(a=this._getOrReturnCtx(e,a),y(a,{code:c.invalid_string,validation:{endsWith:o.value},message:o.message}),t.dirty());else if("datetime"===o.kind){((i=o).precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):0===i.precision?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(a=this._getOrReturnCtx(e,a),y(a,{code:c.invalid_string,validation:"datetime",message:o.message}),t.dirty())}else"ip"===o.kind?(n=e.data,("v4"!==(s=o.version)&&s||!P.test(n))&&("v6"!==s&&s||!L.test(n))&&(a=this._getOrReturnCtx(e,a),y(a,{validation:"ip",code:c.invalid_string,message:o.message}),t.dirty())):r.assertNever(o);var n,s,i;return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement((t=>e.test(t)),{validation:t,code:c.invalid_string,...S.errToObj(a)})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.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,...S.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...S.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new U({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new U({...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.value<e)&&(e=t.value);return e}}function B(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=a>n?a:n;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}U.create=e=>{var t;return new U({checks:[],typeName:ke.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...N(e)})};class D extends I{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 y(t,{code:c.invalid_type,expected:d.number,received:t.parsedType}),v}let t;const a=new g;for(const n of this._def.checks)if("int"===n.kind)r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:c.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else"multipleOf"===n.kind?0!==B(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_finite,message:n.message}),a.dirty()):r.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,a,n){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:S.toString(n)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.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<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}D.create=e=>new D({checks:[],typeName:ke.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...N(e)});class G extends I{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 y(t,{code:c.invalid_type,expected:d.bigint,received:t.parsedType}),v}let t;const a=new g;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):r.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,a,n){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:S.toString(n)}]})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.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<e)&&(e=t.value);return e}}G.create=e=>{var t;return new G({checks:[],typeName:ke.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...N(e)})};class j extends I{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==d.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.boolean,received:t.parsedType}),v}return _(e.data)}}j.create=e=>new j({typeName:ke.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...N(e)});class $ extends I{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==d.date){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.date,received:t.parsedType}),v}if(isNaN(e.data.getTime())){return y(this._getOrReturnCtx(e),{code:c.invalid_date}),v}const t=new g;let a;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),y(a,{code:c.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),y(a,{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 $({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.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.value<e)&&(e=t.value);return null!=e?new Date(e):null}}$.create=e=>new $({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ke.ZodDate,...N(e)});class K extends I{_parse(e){if(this._getType(e)!==d.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.symbol,received:t.parsedType}),v}return _(e.data)}}K.create=e=>new K({typeName:ke.ZodSymbol,...N(e)});class V extends I{_parse(e){if(this._getType(e)!==d.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.undefined,received:t.parsedType}),v}return _(e.data)}}V.create=e=>new V({typeName:ke.ZodUndefined,...N(e)});class F extends I{_parse(e){if(this._getType(e)!==d.null){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.null,received:t.parsedType}),v}return _(e.data)}}F.create=e=>new F({typeName:ke.ZodNull,...N(e)});class W extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return _(e.data)}}W.create=e=>new W({typeName:ke.ZodAny,...N(e)});class H extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _(e.data)}}H.create=e=>new H({typeName:ke.ZodUnknown,...N(e)});class Y extends I{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.never,received:t.parsedType}),v}}Y.create=e=>new Y({typeName:ke.ZodNever,...N(e)});class z extends I{_parse(e){if(this._getType(e)!==d.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.void,received:t.parsedType}),v}return _(e.data)}}z.create=e=>new z({typeName:ke.ZodVoid,...N(e)});class J extends I{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==d.array)return y(t,{code:c.invalid_type,expected:d.array,received:t.parsedType}),v;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(y(t,{code:e?c.too_big:c.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(y(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(y(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>n.type._parseAsync(new T(t,e,t.path,a))))).then((e=>g.mergeArray(a,e)));const s=[...t.data].map(((e,a)=>n.type._parseSync(new T(t,e,t.path,a))));return g.mergeArray(a,s)}get element(){return this._def.type}min(e,t){return new J({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new J({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new J({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}function q(e){if(e instanceof Q){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=me.create(q(n))}return new Q({...e._def,shape:()=>t})}return e instanceof J?new J({...e._def,type:q(e.element)}):e instanceof me?me.create(q(e.unwrap())):e instanceof fe?fe.create(q(e.unwrap())):e instanceof se?se.create(e.items.map((e=>q(e)))):e}J.create=(e,t)=>new J({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ke.ZodArray,...N(t)});class Q extends I{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 y(t,{code:c.invalid_type,expected:d.object,received:t.parsedType}),v}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof Y&&"strip"===this._def.unknownKeys))for(const e in a.data)s.includes(e)||i.push(e);const r=[];for(const e of s){const t=n[e],s=a.data[e];r.push({key:{status:"valid",value:e},value:t._parse(new T(a,s,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof Y){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)r.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)i.length>0&&(y(a,{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=a.data[t];r.push({key:{status:"valid",value:t},value:e._parse(new T(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of r){const a=await t.key;e.push({key:a,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>g.mergeObjectSync(t,e))):g.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new Q({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var n,s,i,r;const o=null!==(i=null===(s=(n=this._def).errorMap)||void 0===s?void 0:s.call(n,t,a).message)&&void 0!==i?i:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(r=S.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:ke.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((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new Q({...this._def,shape:()=>t})}omit(e){const t={};return r.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new Q({...this._def,shape:()=>t})}deepPartial(){return q(this)}partial(e){const t={};return r.objectKeys(this.shape).forEach((a=>{const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()})),new Q({...this._def,shape:()=>t})}required(e){const t={};return r.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof me;)e=e._def.innerType;t[a]=e}})),new Q({...this._def,shape:()=>t})}keyof(){return ue(r.objectKeys(this.shape))}}Q.create=(e,t)=>new Q({shape:()=>e,unknownKeys:"strip",catchall:Y.create(),typeName:ke.ZodObject,...N(t)}),Q.strictCreate=(e,t)=>new Q({shape:()=>e,unknownKeys:"strict",catchall:Y.create(),typeName:ke.ZodObject,...N(t)}),Q.lazycreate=(e,t)=>new Q({shape:e,unknownKeys:"strip",catchall:Y.create(),typeName:ke.ZodObject,...N(t)});class X extends I{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new l(e.ctx.common.issues)));return y(t,{code:c.invalid_union,unionErrors:a}),v}));{let e;const n=[];for(const s of a){const a={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:a});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new l(e)));return y(t,{code:c.invalid_union,unionErrors:s}),v}}get options(){return this._def.options}}X.create=(e,t)=>new X({options:e,typeName:ke.ZodUnion,...N(t)});const ee=e=>e instanceof oe?ee(e.schema):e instanceof pe?ee(e.innerType()):e instanceof de?[e.value]:e instanceof ce?e.options:e instanceof le?Object.keys(e.enum):e instanceof ye?ee(e._def.innerType):e instanceof V?[void 0]:e instanceof F?[null]:null;class te extends I{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.object)return y(t,{code:c.invalid_type,expected:d.object,received:t.parsedType}),v;const a=this.discriminator,n=t.data[a],s=this.optionsMap.get(n);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),v)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const n=new Map;for(const a of t){const t=ee(a.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,a)}}return new te({typeName:ke.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...N(a)})}}function ae(e,t){const a=u(e),n=u(t);if(e===t)return{valid:!0,data:e};if(a===d.object&&n===d.object){const a=r.objectKeys(t),n=r.objectKeys(e).filter((e=>-1!==a.indexOf(e))),s={...e,...t};for(const a of n){const n=ae(e[a],t[a]);if(!n.valid)return{valid:!1};s[a]=n.data}return{valid:!0,data:s}}if(a===d.array&&n===d.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const s=ae(e[n],t[n]);if(!s.valid)return{valid:!1};a.push(s.data)}return{valid:!0,data:a}}return a===d.date&&n===d.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ne extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(b(e)||b(n))return v;const s=ae(e.value,n.value);return s.valid?((x(e)||x(n))&&t.dirty(),{status:t.value,value:s.data}):(y(a,{code:c.invalid_intersection_types}),v)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}ne.create=(e,t,a)=>new ne({left:e,right:t,typeName:ke.ZodIntersection,...N(a)});class se extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==d.array)return y(a,{code:c.invalid_type,expected:d.array,received:a.parsedType}),v;if(a.data.length<this._def.items.length)return y(a,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;!this._def.rest&&a.data.length>this._def.items.length&&(y(a,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new T(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(n).then((e=>g.mergeArray(t,e))):g.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new se({...this._def,rest:e})}}se.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new se({items:e,typeName:ke.ZodTuple,rest:null,...N(t)})};class ie extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==d.map)return y(a,{code:c.invalid_type,expected:d.map,received:a.parsedType}),v;const n=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map((([e,t],i)=>({key:n._parse(new T(a,e,a.path,[i,"key"])),value:s._parse(new T(a,t,a.path,[i,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of i){const n=await a.key,s=await a.value;if("aborted"===n.status||"aborted"===s.status)return v;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of i){const n=a.key,s=a.value;if("aborted"===n.status||"aborted"===s.status)return v;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}ie.create=(e,t,a)=>new ie({valueType:t,keyType:e,typeName:ke.ZodMap,...N(a)});class re extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==d.set)return y(a,{code:c.invalid_type,expected:d.set,received:a.parsedType}),v;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(y(a,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&a.data.size>n.maxSize.value&&(y(a,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function i(e){const a=new Set;for(const n of e){if("aborted"===n.status)return v;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const r=[...a.data.values()].map(((e,t)=>s._parse(new T(a,e,a.path,t))));return a.common.async?Promise.all(r).then((e=>i(e))):i(r)}min(e,t){return new re({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new re({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}re.create=(e,t)=>new re({valueType:e,minSize:null,maxSize:null,typeName:ke.ZodSet,...N(t)});class oe extends I{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})}}oe.create=(e,t)=>new oe({getter:e,typeName:ke.ZodLazy,...N(t)});class de extends I{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),v}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ue(e,t){return new ce({values:e,typeName:ke.ZodEnum,...N(t)})}de.create=(e,t)=>new de({value:e,typeName:ke.ZodLiteral,...N(t)});class ce extends I{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return y(t,{expected:r.joinValues(a),received:t.parsedType,code:c.invalid_type}),v}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return y(t,{received:t.data,code:c.invalid_enum_value,options:a}),v}return _(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 ce.create(e)}exclude(e){return ce.create(this.options.filter((t=>!e.includes(t))))}}ce.create=ue;class le extends I{_parse(e){const t=r.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==d.string&&a.parsedType!==d.number){const e=r.objectValues(t);return y(a,{expected:r.joinValues(e),received:a.parsedType,code:c.invalid_type}),v}if(-1===t.indexOf(e.data)){const e=r.objectValues(t);return y(a,{received:a.data,code:c.invalid_enum_value,options:e}),v}return _(e.data)}get enum(){return this._def.values}}le.create=(e,t)=>new le({values:e,typeName:ke.ZodNativeEnum,...N(t)});class he extends I{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==d.promise&&!1===t.common.async)return y(t,{code:c.invalid_type,expected:d.promise,received:t.parsedType}),v;const a=t.parsedType===d.promise?t.data:Promise.resolve(t.data);return _(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}he.create=(e,t)=>new he({type:e,typeName:ke.ZodPromise,...N(t)});class pe extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{y(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){const e=n.transform(a.data,s);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:a.path,parent:a}))):this._def.schema._parseSync({data:e,path:a.path,parent:a})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,s);if(a.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===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?v:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?v:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===n.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!k(e))return e;const i=n.transform(e.value,s);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:a.data,path:a.path,parent:a}).then((e=>k(e)?Promise.resolve(n.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}r.assertNever(n)}}pe.create=(e,t,a)=>new pe({schema:e,typeName:ke.ZodEffects,effect:t,...N(a)}),pe.createWithPreprocess=(e,t,a)=>new pe({schema:t,effect:{type:"preprocess",transform:e},typeName:ke.ZodEffects,...N(a)});class me extends I{_parse(e){return this._getType(e)===d.undefined?_(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}me.create=(e,t)=>new me({innerType:e,typeName:ke.ZodOptional,...N(t)});class fe extends I{_parse(e){return this._getType(e)===d.null?_(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(e,t)=>new fe({innerType:e,typeName:ke.ZodNullable,...N(t)});class ye extends I{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===d.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...N(t)});class ge extends I{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return C(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new l(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ge.create=(e,t)=>new ge({innerType:e,typeName:ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...N(t)});class ve extends I{_parse(e){if(this._getType(e)!==d.nan){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:d.nan,received:t.parsedType}),v}return{status:"valid",value:e.data}}}ve.create=e=>new ve({typeName:ke.ZodNaN,...N(e)});class _e extends I{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class be extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new be({in:e,out:t,typeName:ke.ZodPipeline})}}class xe extends I{_parse(e){const t=this._def.innerType._parse(e);return k(t)&&(t.value=Object.freeze(t.value)),t}}var ke;xe.create=(e,t)=>new xe({innerType:e,typeName:ke.ZodReadonly,...N(t)}),Q.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"}(ke||(ke={}));const Ce=U.create,Se=D.create;ve.create,G.create;const Te=j.create;$.create,K.create,V.create,F.create;const we=W.create;H.create,Y.create,z.create;const Ne=J.create,Ie=Q.create;Q.strictCreate,X.create;const Ae=te.create;ne.create,se.create,ie.create,re.create,oe.create;const Ee=de.create,Oe=ce.create,Re=le.create;he.create,pe.create,me.create,fe.create,pe.createWithPreprocess,be.create;const Ze=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],Me=Oe(Ze),Pe={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},Le={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},Ue={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},Be=e=>Object.keys(Pe).find((t=>Pe[t].countries.includes(e??"")))||"International",De=e=>{if(e){const t=Be(e);return Ue[t]}return"£"},Ge=e=>{if(e)return Le[e]},je=(e,t,a,n)=>{if(n){const s=n[Be(a)];if(s){return`${De(a)}${s[e][t].price}`}}},$e={CURRENCY_SYMBOL:({countryCode:e})=>De(e),COUNTRY_NAME:({countryCode:e})=>Ge(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>je("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>je("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>je("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>je("GuardianWeekly","Annual",e,t),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},Ke=/%%.*?%%/g,Ve=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},Fe=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),a=(t.getMonth()+1).toString().padStart(2,"0"),n=t.toLocaleString("default",{month:"long"}),s=t.getFullYear();return{reminderCta:`Remind me in ${n}`,reminderPeriod:`${s}-${a}-01`,reminderLabel:`${n} ${s}`}},We=new Date("2023-12-31"),He=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<Ve(e.getFullYear()),Ye=Ie({text:Ce(),baseUrl:Ce()});let ze=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});Re(ze);const Je=Ae("type",[Ie({type:Ee(ze.Custom),cta:Ye}),Ie({type:Ee(ze.ContributionsReminder)})]);let qe=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const Qe=Re(qe);let Xe=function(e){return e.money="money",e}({});const et=Re(Xe),tt=Ie({countLabel:Ce(),goalReachedPrimary:Ce(),goalReachedSecondary:Ce()}),at=Ie({total:Se(),goal:Se()}),nt=Oe(["US","AU"]),st=Ie({endType:Qe,countType:et,currencySymbol:Ce(),copy:tt,name:nt,tickerData:at.optional()}),it=Oe(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),rt=Oe(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),ot=Ie({abTestName:Ce(),abTestVariant:Ce(),campaignCode:Ce(),componentType:rt,products:Ne(it).nullish(),labels:Ne(Ce()).nullish(),ophanPageId:Ce(),platformId:Ce(),referrerUrl:Ce(),clientName:Ce()}),dt=Ie({mainUrl:Ce(),mobileUrl:Ce().optional(),tabletUrl:Ce().optional(),desktopUrl:Ce().optional(),leftColUrl:Ce().optional(),wideUrl:Ce().optional(),altText:Ce()}),ut=Ie({name:Ce(),description:Ce().optional(),headshot:dt.optional()}),ct=Oe(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),lt=Oe(["new","guest","current"]),ht=Oe(["Live","Draft","Archived"]),pt=Oe(["Mobile","Desktop","All","iOS","Android"]),mt=Oe(["SignedIn","SignedOut","All"]),ft=Oe(["HasConsented","HasNotConsented","Everyone"]),yt=Ie({name:Ce(),status:ht,priority:Se(),controlProportionSettings:Ie({proportion:Se(),offset:Se()}).optional(),deviceType:pt.optional(),signedInStatus:mt.optional(),consentStatus:ft.optional()}),gt=Oe(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),vt=Ie({minViews:Se(),maxViews:Se().optional(),periodInWeeks:Se(),tagId:Ce().optional()});Ie({userType:Ne(lt),product:Ne(ct)}),Ie({tagIds:Ne(Ce()),sectionIds:Ne(Ce()),excludedTagIds:Ne(Ce()),excludedSectionIds:Ne(Ce())});const _t=Oe(["for52Weeks","forTargetedWeeks"]),bt=Ie({for52Weeks:Se(),forTargetedWeeks:Se()}),xt=Ie({maxViewsCount:Se(),maxViewsDays:Se(),minDaysBetweenViews:Se()}),kt=Ie({type:Ee("above"),copy:Ce().optional(),countType:_t.optional()}),Ct=Ie({reminderCta:Ce(),reminderLabel:Ce(),reminderPeriod:Ce()}),St=Oe(["ONE_OFF","MONTHLY","ANNUAL"]),Tt=Ie({testName:Ce(),variantName:Ce(),defaultContributionType:St,displayContributionType:St.array(),amountsCardData:Ie({ONE_OFF:Ie({amounts:Ne(Se()),defaultAmount:Se(),hideChooseYourAmount:Te().optional()}),MONTHLY:Ie({amounts:Ne(Se()),defaultAmount:Se(),hideChooseYourAmount:Te().optional()}),ANNUAL:Ie({amounts:Ne(Se()),defaultAmount:Se(),hideChooseYourAmount:Te().optional()})})}),wt=Ie({url:Ce()}),Nt=Ie({name:Ce(),heading:Ce().optional(),paragraphs:Ne(Ce()),highlightedText:Ce().optional(),tickerSettings:st.optional(),cta:Ye.optional(),secondaryCta:Je.optional(),newsletterSignup:wt.optional(),image:dt.optional(),showReminderFields:Ct.optional(),separateArticleCount:kt.optional(),maxViews:xt.optional(),showSignInLink:Te().optional(),bylineWithImage:ut.optional(),showChoiceCards:Te().optional(),choiceCardAmounts:Tt.optional(),defaultChoiceCardFrequency:St.optional()}),It=Ie({variant:Nt,tracking:ot,countryCode:Ce().nullish(),articleCounts:bt,onReminderOpen:we().nullish(),fetchEmail:we().nullish(),submitComponentEvent:we().nullish(),openCmp:we().nullish(),hasConsentForArticleCount:Te().nullish(),stage:Ce().nullish()}),At=/^[0-9A-F]{2}$/,Et=Ce().refine((e=>At.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),Ot=Ie({r:Et,g:Et,b:Et,kind:Ee("hex")}),Rt=Ie({mobileUrl:Ce(),tabletUrl:Ce(),desktopUrl:Ce(),altText:Ce(),kind:Ee("Image")}),Zt=Ie({buttonColour:Ot.nullish(),buttonTextColour:Ot.nullish(),buttonBorderColour:Ot.nullish(),buttonSelectColour:Ot.nullish(),buttonSelectTextColour:Ot.nullish(),buttonSelectBorderColour:Ot.nullish(),kind:Ee("ChoiceCards")}),Mt=Ie({visual:Ae("kind",[Rt,Zt]).nullish(),colours:Ie({basic:Ie({background:Ot,bodyText:Ot})})}),Pt=Oe(["contributions","subscriptions","signIn"]),Lt=Ie({heading:Ce().optional(),messageText:Ce().optional(),paragraphs:Ne(Ce()).optional(),mobileMessageText:Ce().optional(),highlightedText:Ce().optional(),cta:Ye.optional(),secondaryCta:Je.optional()});Ie({tracking:ot,bannerChannel:Pt,content:Lt.nullish(),mobileContent:Lt.nullish(),countryCode:Ce().nullish(),isSupporter:Te().nullish(),tickerSettings:st.nullish(),submitComponentEvent:we(),numArticles:Se().nullish(),hasOptedOutOfArticleCount:Te().nullish(),fetchEmail:we().nullish(),separateArticleCount:Te().nullish(),design:Mt.nullish()});const Ut=Ie({heading:Ce(),subheading:Ce(),primaryCta:Ye.optional(),secondaryCta:Ye.optional(),benefits:Ne(Ce()).optional()});Ie({content:Ut,tracking:ot,mobileContent:Ut.optional(),countryCode:Ce().optional(),submitComponentEvent:we(),numArticles:Se().optional()});const Bt=Ie({maxViewsCount:Se(),maxViewsDays:Se(),minDaysBetweenViews:Se()});yt.extend({name:Ce(),status:ht,locations:Ne(Me),tagIds:Ne(Ce()),sections:Ne(Ce()),excludedTagIds:Ne(Ce()),excludedSections:Ne(Ce()),alwaysAsk:Te(),maxViews:Bt.optional(),userCohort:gt,hasCountryName:Te(),highPriority:Te(),useLocalViewLog:Te(),articlesViewedSettings:vt.optional(),priority:Se(),variants:Nt.array(),isBanditTest:Te().optional()});const Dt=(e,t,a)=>{const n=(e=>{if(URLSearchParams){const t=new URLSearchParams(window.location.search).get(`force-${e}`);if(t)return t}return null})(e);return fetch(`${t}/${e}${n?`?force=${n}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then((t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t})).then((e=>e.json()))};exports.CountryGroupId=Ze,exports.SecondaryCtaType=ze,exports.TickerCountType=Xe,exports.TickerEndType=qe,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const a=(e=>Pe[Be(e)]?.supportRegionId)(t);if(a)return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,t,n)=>`${t}/${a.toLowerCase()}/${n}`))}return e},exports.buildReminderFields=Fe,exports.containsNonArticleCountPlaceholder=e=>{const t=e.match(Ke)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=Be,exports.countryGroupIdSchema=Me,exports.epicPropsSchema=It,exports.getBanner=(e,t)=>Dt("banner",e,t),exports.getCountryName=Ge,exports.getEpic=(e,t)=>Dt("epic",e,t),exports.getEpicViewLog=t=>t.get(e)||void 0,exports.getHeader=(e,t)=>Dt("header",e,t),exports.getLiveblogEpic=(e,t)=>Dt("liveblog-epic",e,t),exports.getLocalCurrencySymbol=De,exports.getReminderFields=(e,t=new Date)=>{return"US"===e&&He(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${a=t.getFullYear()}-${(Ve(a).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${a}`}:"US"===e&&(e=>e>=Ve(e.getFullYear())&&e<We)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):Fe(t);var a},exports.getWeeklyArticleHistory=e=>e.get(t)||void 0,exports.inCountryGroups=(e,t=[])=>0===t.length||!!e&&t.includes(Be(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,s,r)=>{const o=((e,t)=>{const s=n(new Date),i=e.get(a);if(i&&i.week===s){const n=i.articles[t]||0;return e.set(a,{week:s,articles:{...i.articles,[t]:n+1}}),n>0}return e.set(a,{week:s,articles:{[t]:1}}),!1})(e,s);if(!o){const a=n(new Date),s=e.get(t)||[],o=s[0];if(o&&o.week&&o.week===a)o.count+=1,o.tags=i(r,o.tags),e.set(t,s);else{s.unshift({week:a,count:1,tags:i(r,{})});const n=a-365,o=s.filter((e=>e.week>=n));e.set(t,o)}}},exports.logEpicView=t=>{const a=localStorage.getItem(e),n=a?JSON.parse(a).value:[];n.push({date:(new Date).getTime(),testId:t});const s={value:n.slice(-50)};localStorage.setItem(e,JSON.stringify(s))},exports.replaceNonArticleCountPlaceholders=(e,t,a)=>e?e.replace(Ke,(e=>{const n=e.substring(2,e.length-2),s=$e[n];if(s){const e=s({countryCode:t,prices:a});if(e)return e}return e})):"";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { OphanComponentEvent } from '../types/ophan';
|
|
2
|
-
import { Tracking, BannerTest, BannerVariant, EpicTest, EpicVariant } from '../types';
|
|
2
|
+
import { Tracking, BannerTest, BannerVariant, EpicTest, EpicVariant, ContributionFrequency } from '../types';
|
|
3
3
|
export declare const addTrackingParams: (baseUrl: string, params: Tracking, numArticles?: number, amountsAbTestName?: string, amountsAbTestVariant?: string) => string;
|
|
4
4
|
export declare const isSupportUrl: (baseUrl: string) => boolean;
|
|
5
5
|
export declare const addRegionIdAndTrackingParamsToSupportUrl: (baseUrl: string, tracking: Tracking, numArticles?: number, countryCode?: string, amountsAbTestName?: string, amountsAbTestVariant?: string) => string;
|
|
6
6
|
export declare const addTrackingParamsToBodyLinks: (text: string, tracking: Tracking, numArticles?: number, countryCode?: string) => string;
|
|
7
7
|
export declare const addProfileTrackingParams: (baseUrl: string, params: Tracking) => string;
|
|
8
|
+
export declare const addChoiceCardsParams: (url: string, frequency: ContributionFrequency, amount: number | 'other') => string;
|
|
8
9
|
export declare const isProfileUrl: (baseUrl: string) => boolean;
|
|
9
10
|
export declare const addTrackingParamsToProfileUrl: (baseUrl: string, tracking: Tracking) => string;
|
|
10
11
|
export declare const buildCampaignCode: (test: EpicTest, variant: EpicVariant) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../../../../shared/src/lib/tracking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EACH,QAAQ,EACR,UAAU,EACV,aAAa,EAEb,QAAQ,EACR,WAAW,
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../../../../shared/src/lib/tracking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EACH,QAAQ,EACR,UAAU,EACV,aAAa,EAEb,QAAQ,EACR,WAAW,EACX,qBAAqB,EACxB,MAAM,UAAU,CAAC;AAgFlB,eAAO,MAAM,iBAAiB,YACjB,MAAM,UACP,QAAQ,gBACF,MAAM,sBACA,MAAM,yBACH,MAAM,KAC9B,MAYF,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,MAAM,KAAG,OAAsC,CAAC;AAEtF,eAAO,MAAM,wCAAwC,YACxC,MAAM,YACL,QAAQ,gBACJ,MAAM,gBACN,MAAM,sBACA,MAAM,yBACH,MAAM,KAC9B,MAaF,CAAC;AAGF,eAAO,MAAM,4BAA4B,SAC/B,MAAM,YACF,QAAQ,gBACJ,MAAM,gBACN,MAAM,KACrB,MAYF,CAAC;AAUF,eAAO,MAAM,wBAAwB,YAAa,MAAM,UAAU,QAAQ,KAAG,MAgC5E,CAAC;AAEF,eAAO,MAAM,oBAAoB,QACxB,MAAM,aACA,qBAAqB,UACxB,MAAM,GAAG,OAAO,KACzB,MAIF,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,MAAM,KAAG,OAAsC,CAAC;AACtF,eAAO,MAAM,6BAA6B,YAAa,MAAM,YAAY,QAAQ,KAAG,MAEnF,CAAC;AAKF,eAAO,MAAM,iBAAiB,SAAU,QAAQ,WAAW,WAAW,KAAG,MACF,CAAC;AAExE,eAAO,MAAM,uBAAuB,SAAU,UAAU,WAAW,aAAa,KAAG,MACjD,CAAC;AAEnC,eAAO,MAAM,wBAAwB,aAAc,MAAM,eAAe,MAAM,KAAG,MAC3C,CAAC;AA0CvC,eAAO,MAAM,kBAAkB,aAAc,QAAQ,SAAS,MAAM,KAAG,QAYtE,CAAC;AAEF,eAAO,MAAM,4BAA4B,aArDnB,QAAQ,eAAe,MAAM,KAAG,mBAqDsB,CAAC;AAE7E,eAAO,MAAM,2BAA2B,aAvDlB,QAAQ,eAAe,MAAM,KAAG,mBAuDoB,CAAC;AAE3E,eAAO,MAAM,6BAA6B,aAzDpB,QAAQ,eAAe,MAAM,KAAG,mBAyDwB,CAAC"}
|
|
@@ -421,6 +421,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
421
421
|
}>>;
|
|
422
422
|
deviceType: z.ZodOptional<z.ZodEnum<["Mobile", "Desktop", "All", "iOS", "Android"]>>;
|
|
423
423
|
signedInStatus: z.ZodOptional<z.ZodEnum<["SignedIn", "SignedOut", "All"]>>;
|
|
424
|
+
consentStatus: z.ZodOptional<z.ZodEnum<["HasConsented", "HasNotConsented", "Everyone"]>>;
|
|
424
425
|
userCohort: z.ZodEnum<["AllExistingSupporters", "AllNonSupporters", "Everyone", "PostAskPauseSingleContributors"]>;
|
|
425
426
|
locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
|
|
426
427
|
contextTargeting: z.ZodObject<{
|
|
@@ -826,7 +827,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
826
827
|
name: string;
|
|
827
828
|
status: "Live" | "Draft" | "Archived";
|
|
828
829
|
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
829
|
-
userCohort: "
|
|
830
|
+
userCohort: "Everyone" | "AllExistingSupporters" | "AllNonSupporters" | "PostAskPauseSingleContributors";
|
|
830
831
|
variants: {
|
|
831
832
|
name: string;
|
|
832
833
|
template: (BannerTemplate | {
|
|
@@ -903,6 +904,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
903
904
|
} | undefined;
|
|
904
905
|
deviceType?: "Mobile" | "Desktop" | "All" | "iOS" | "Android" | undefined;
|
|
905
906
|
signedInStatus?: "All" | "SignedIn" | "SignedOut" | undefined;
|
|
907
|
+
consentStatus?: "HasConsented" | "HasNotConsented" | "Everyone" | undefined;
|
|
906
908
|
articlesViewedSettings?: {
|
|
907
909
|
minViews: number;
|
|
908
910
|
periodInWeeks: number;
|
|
@@ -914,7 +916,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
914
916
|
name: string;
|
|
915
917
|
status: "Live" | "Draft" | "Archived";
|
|
916
918
|
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
917
|
-
userCohort: "
|
|
919
|
+
userCohort: "Everyone" | "AllExistingSupporters" | "AllNonSupporters" | "PostAskPauseSingleContributors";
|
|
918
920
|
variants: {
|
|
919
921
|
name: string;
|
|
920
922
|
template: (BannerTemplate | {
|
|
@@ -991,6 +993,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
991
993
|
} | undefined;
|
|
992
994
|
deviceType?: "Mobile" | "Desktop" | "All" | "iOS" | "Android" | undefined;
|
|
993
995
|
signedInStatus?: "All" | "SignedIn" | "SignedOut" | undefined;
|
|
996
|
+
consentStatus?: "HasConsented" | "HasNotConsented" | "Everyone" | undefined;
|
|
994
997
|
articlesViewedSettings?: {
|
|
995
998
|
minViews: number;
|
|
996
999
|
periodInWeeks: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAEb,kBAAkB,EAErB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGH,eAAe,EAGlB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,oBAAY,cAAc;IACtB,mBAAmB,wBAAwB;IAC3C,6BAA6B,kCAAkC;IAC/D,iBAAiB,sBAAsB;IACvC,kBAAkB,uBAAuB;IACzC,0BAA0B,+BAA+B;IACzD,+BAA+B,oCAAoC;CACtE;AAED,MAAM,WAAW,gBAAgB;IAC7B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,QAAQ,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAElD,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG,EAAE,IAAI,gBAAgB,CAE/D;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IACxD,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC7B;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,KAAK,OAAO,CAAC;AAEzF,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AAG9D,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC;AAED,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IAClD,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAEb,kBAAkB,EAErB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGH,eAAe,EAGlB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,oBAAY,cAAc;IACtB,mBAAmB,wBAAwB;IAC3C,6BAA6B,kCAAkC;IAC/D,iBAAiB,sBAAsB;IACvC,kBAAkB,uBAAuB;IACzC,0BAA0B,+BAA+B;IACzD,+BAA+B,oCAAoC;CACtE;AAED,MAAM,WAAW,gBAAgB;IAC7B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,QAAQ,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAElD,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG,EAAE,IAAI,gBAAgB,CAE/D;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IACxD,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC7B;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,KAAK,OAAO,CAAC;AAEzF,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AAG9D,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC;AAED,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IAClD,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAAC"}
|
|
@@ -82,6 +82,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
82
82
|
}>>;
|
|
83
83
|
deviceType: z.ZodOptional<z.ZodEnum<["Mobile", "Desktop", "All", "iOS", "Android"]>>;
|
|
84
84
|
signedInStatus: z.ZodOptional<z.ZodEnum<["SignedIn", "SignedOut", "All"]>>;
|
|
85
|
+
consentStatus: z.ZodOptional<z.ZodEnum<["HasConsented", "HasNotConsented", "Everyone"]>>;
|
|
85
86
|
name: z.ZodString;
|
|
86
87
|
status: z.ZodEnum<["Live", "Draft", "Archived"]>;
|
|
87
88
|
locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
|
|
@@ -676,6 +677,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
676
677
|
} | undefined;
|
|
677
678
|
defaultChoiceCardFrequency?: "ONE_OFF" | "MONTHLY" | "ANNUAL" | undefined;
|
|
678
679
|
}>, "many">;
|
|
680
|
+
isBanditTest: z.ZodOptional<z.ZodBoolean>;
|
|
679
681
|
}, "strip", z.ZodTypeAny, {
|
|
680
682
|
priority: number;
|
|
681
683
|
name: string;
|
|
@@ -686,7 +688,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
686
688
|
sections: string[];
|
|
687
689
|
excludedSections: string[];
|
|
688
690
|
alwaysAsk: boolean;
|
|
689
|
-
userCohort: "
|
|
691
|
+
userCohort: "Everyone" | "AllExistingSupporters" | "AllNonSupporters" | "PostAskPauseSingleContributors";
|
|
690
692
|
hasCountryName: boolean;
|
|
691
693
|
highPriority: boolean;
|
|
692
694
|
useLocalViewLog: boolean;
|
|
@@ -796,6 +798,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
796
798
|
} | undefined;
|
|
797
799
|
deviceType?: "Mobile" | "Desktop" | "All" | "iOS" | "Android" | undefined;
|
|
798
800
|
signedInStatus?: "All" | "SignedIn" | "SignedOut" | undefined;
|
|
801
|
+
consentStatus?: "HasConsented" | "HasNotConsented" | "Everyone" | undefined;
|
|
799
802
|
maxViews?: {
|
|
800
803
|
maxViewsCount: number;
|
|
801
804
|
maxViewsDays: number;
|
|
@@ -807,6 +810,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
807
810
|
maxViews?: number | undefined;
|
|
808
811
|
tagId?: string | undefined;
|
|
809
812
|
} | undefined;
|
|
813
|
+
isBanditTest?: boolean | undefined;
|
|
810
814
|
}, {
|
|
811
815
|
priority: number;
|
|
812
816
|
name: string;
|
|
@@ -817,7 +821,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
817
821
|
sections: string[];
|
|
818
822
|
excludedSections: string[];
|
|
819
823
|
alwaysAsk: boolean;
|
|
820
|
-
userCohort: "
|
|
824
|
+
userCohort: "Everyone" | "AllExistingSupporters" | "AllNonSupporters" | "PostAskPauseSingleContributors";
|
|
821
825
|
hasCountryName: boolean;
|
|
822
826
|
highPriority: boolean;
|
|
823
827
|
useLocalViewLog: boolean;
|
|
@@ -927,6 +931,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
927
931
|
} | undefined;
|
|
928
932
|
deviceType?: "Mobile" | "Desktop" | "All" | "iOS" | "Android" | undefined;
|
|
929
933
|
signedInStatus?: "All" | "SignedIn" | "SignedOut" | undefined;
|
|
934
|
+
consentStatus?: "HasConsented" | "HasNotConsented" | "Everyone" | undefined;
|
|
930
935
|
maxViews?: {
|
|
931
936
|
maxViewsCount: number;
|
|
932
937
|
maxViewsDays: number;
|
|
@@ -938,6 +943,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
938
943
|
maxViews?: number | undefined;
|
|
939
944
|
tagId?: string | undefined;
|
|
940
945
|
} | undefined;
|
|
946
|
+
isBanditTest?: boolean | undefined;
|
|
941
947
|
}>;
|
|
942
948
|
export type EpicVariant = z.infer<typeof variantSchema>;
|
|
943
949
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,WAAW,CAAC;AAOjE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9C,eAAO,MAAM,cAAc;;;;;;;;;;;;EAIzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE,eAAO,MAAM,0BAA0B,EAAE,qBAAqB,EAAqC,CAAC;AAEpG,UAAU,oBAAoB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,gBAAgB,GAAG;KAC1B,GAAG,IAAI,qBAAqB,GAAG,oBAAoB;CACvD,CAAC;AA4BF,UAAU,kBAAkB;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG;KACzB,GAAG,IAAI,qBAAqB,GAAG,kBAAkB;CACrD,CAAC;AAEF,MAAM,WAAW,cAAc;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,uBAAuB,EAAE,qBAAqB,EAAE,CAAC;IACjD,eAAe,EAAE,eAAe,CAAC;CACpC;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC1D,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,oBAAoB,GAC1B;IAAE,aAAa,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GACnD;IAAE,aAAa,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAExD,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,EAAE,CAAC;AAGzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,MAAM,WAAW,QAAS,SAAQ,gBAAgB;IAC9C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,OAAO,CAAC;IAGhD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,WAAW,CAAC;AAOjE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9C,eAAO,MAAM,cAAc;;;;;;;;;;;;EAIzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE,eAAO,MAAM,0BAA0B,EAAE,qBAAqB,EAAqC,CAAC;AAEpG,UAAU,oBAAoB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,gBAAgB,GAAG;KAC1B,GAAG,IAAI,qBAAqB,GAAG,oBAAoB;CACvD,CAAC;AA4BF,UAAU,kBAAkB;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG;KACzB,GAAG,IAAI,qBAAqB,GAAG,kBAAkB;CACrD,CAAC;AAEF,MAAM,WAAW,cAAc;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,uBAAuB,EAAE,qBAAqB,EAAE,CAAC;IACjD,eAAe,EAAE,eAAe,CAAC;CACpC;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC1D,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,oBAAoB,GAC1B;IAAE,aAAa,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GACnD;IAAE,aAAa,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAExD,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,EAAE,CAAC;AAGzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,MAAM,WAAW,QAAS,SAAQ,gBAAgB;IAC9C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,OAAO,CAAC;IAGhD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBjC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -176,6 +176,7 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
176
176
|
}>>;
|
|
177
177
|
deviceType: z.ZodOptional<z.ZodEnum<["Mobile", "Desktop", "All", "iOS", "Android"]>>;
|
|
178
178
|
signedInStatus: z.ZodOptional<z.ZodEnum<["SignedIn", "SignedOut", "All"]>>;
|
|
179
|
+
consentStatus: z.ZodOptional<z.ZodEnum<["HasConsented", "HasNotConsented", "Everyone"]>>;
|
|
179
180
|
locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
|
|
180
181
|
userCohort: z.ZodEnum<["AllExistingSupporters", "AllNonSupporters", "Everyone", "PostAskPauseSingleContributors"]>;
|
|
181
182
|
purchaseInfo: z.ZodOptional<z.ZodObject<{
|
|
@@ -350,7 +351,7 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
350
351
|
name: string;
|
|
351
352
|
status: "Live" | "Draft" | "Archived";
|
|
352
353
|
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
353
|
-
userCohort: "
|
|
354
|
+
userCohort: "Everyone" | "AllExistingSupporters" | "AllNonSupporters" | "PostAskPauseSingleContributors";
|
|
354
355
|
variants: {
|
|
355
356
|
name: string;
|
|
356
357
|
content: {
|
|
@@ -386,6 +387,7 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
386
387
|
} | undefined;
|
|
387
388
|
deviceType?: "Mobile" | "Desktop" | "All" | "iOS" | "Android" | undefined;
|
|
388
389
|
signedInStatus?: "All" | "SignedIn" | "SignedOut" | undefined;
|
|
390
|
+
consentStatus?: "HasConsented" | "HasNotConsented" | "Everyone" | undefined;
|
|
389
391
|
purchaseInfo?: {
|
|
390
392
|
product: ("Contribution" | "SupporterPlus" | "GuardianWeekly" | "Paper")[];
|
|
391
393
|
userType: ("new" | "guest" | "current")[];
|
|
@@ -395,7 +397,7 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
395
397
|
name: string;
|
|
396
398
|
status: "Live" | "Draft" | "Archived";
|
|
397
399
|
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
398
|
-
userCohort: "
|
|
400
|
+
userCohort: "Everyone" | "AllExistingSupporters" | "AllNonSupporters" | "PostAskPauseSingleContributors";
|
|
399
401
|
variants: {
|
|
400
402
|
name: string;
|
|
401
403
|
content: {
|
|
@@ -431,6 +433,7 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
431
433
|
} | undefined;
|
|
432
434
|
deviceType?: "Mobile" | "Desktop" | "All" | "iOS" | "Android" | undefined;
|
|
433
435
|
signedInStatus?: "All" | "SignedIn" | "SignedOut" | undefined;
|
|
436
|
+
consentStatus?: "HasConsented" | "HasNotConsented" | "Everyone" | undefined;
|
|
434
437
|
purchaseInfo?: {
|
|
435
438
|
product: ("Contribution" | "SupporterPlus" | "GuardianWeekly" | "Paper")[];
|
|
436
439
|
userType: ("new" | "guest" | "current")[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/header.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI/B,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/header.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI/B,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IACxD,iBAAiB,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IAClD,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,UAAU,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -11,6 +11,9 @@ export declare const deviceTypeSchema: z.ZodEnum<["Mobile", "Desktop", "All", "i
|
|
|
11
11
|
declare const SignedInStatus: readonly ["SignedIn", "SignedOut", "All"];
|
|
12
12
|
export type SignedInStatus = (typeof SignedInStatus)[number];
|
|
13
13
|
export declare const signedInStatusSchema: z.ZodEnum<["SignedIn", "SignedOut", "All"]>;
|
|
14
|
+
declare const ConsentStatus: readonly ["HasConsented", "HasNotConsented", "Everyone"];
|
|
15
|
+
export type ConsentStatus = (typeof ConsentStatus)[number];
|
|
16
|
+
export declare const ConsentStatusSchema: z.ZodEnum<["HasConsented", "HasNotConsented", "Everyone"]>;
|
|
14
17
|
export interface Variant {
|
|
15
18
|
name: string;
|
|
16
19
|
}
|
|
@@ -22,6 +25,7 @@ export interface Test<V extends Variant> {
|
|
|
22
25
|
controlProportionSettings?: ControlProportionSettings;
|
|
23
26
|
deviceType?: DeviceType;
|
|
24
27
|
signedInStatus?: SignedInStatus;
|
|
28
|
+
consentStatus?: ConsentStatus;
|
|
25
29
|
}
|
|
26
30
|
export declare const testSchema: z.ZodObject<{
|
|
27
31
|
name: z.ZodString;
|
|
@@ -39,6 +43,7 @@ export declare const testSchema: z.ZodObject<{
|
|
|
39
43
|
}>>;
|
|
40
44
|
deviceType: z.ZodOptional<z.ZodEnum<["Mobile", "Desktop", "All", "iOS", "Android"]>>;
|
|
41
45
|
signedInStatus: z.ZodOptional<z.ZodEnum<["SignedIn", "SignedOut", "All"]>>;
|
|
46
|
+
consentStatus: z.ZodOptional<z.ZodEnum<["HasConsented", "HasNotConsented", "Everyone"]>>;
|
|
42
47
|
}, "strip", z.ZodTypeAny, {
|
|
43
48
|
priority: number;
|
|
44
49
|
name: string;
|
|
@@ -49,6 +54,7 @@ export declare const testSchema: z.ZodObject<{
|
|
|
49
54
|
} | undefined;
|
|
50
55
|
deviceType?: "Mobile" | "Desktop" | "All" | "iOS" | "Android" | undefined;
|
|
51
56
|
signedInStatus?: "All" | "SignedIn" | "SignedOut" | undefined;
|
|
57
|
+
consentStatus?: "HasConsented" | "HasNotConsented" | "Everyone" | undefined;
|
|
52
58
|
}, {
|
|
53
59
|
priority: number;
|
|
54
60
|
name: string;
|
|
@@ -59,6 +65,7 @@ export declare const testSchema: z.ZodObject<{
|
|
|
59
65
|
} | undefined;
|
|
60
66
|
deviceType?: "Mobile" | "Desktop" | "All" | "iOS" | "Android" | undefined;
|
|
61
67
|
signedInStatus?: "All" | "SignedIn" | "SignedOut" | undefined;
|
|
68
|
+
consentStatus?: "HasConsented" | "HasNotConsented" | "Everyone" | undefined;
|
|
62
69
|
}>;
|
|
63
70
|
export interface ControlProportionSettings {
|
|
64
71
|
proportion: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EACH,mBAAmB,EAEnB,gBAAgB,EAEnB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,UAAU,wCAAyC,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,gBAAgB,0CAAqB,CAAC;AAEnD,QAAA,MAAM,UAAU,yDAA0D,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,EAAE,QAAQ,GAAG,KAAK,CAAC,CAAC;AAEnE,eAAO,MAAM,gBAAgB,2DAAqB,CAAC;AAEnD,QAAA,MAAM,cAAc,2CAA4C,CAAC;AACjE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,oBAAoB,6CAAyB,CAAC;AAE3D,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,OAAO;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EACH,mBAAmB,EAEnB,gBAAgB,EAEnB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,UAAU,wCAAyC,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,gBAAgB,0CAAqB,CAAC;AAEnD,QAAA,MAAM,UAAU,yDAA0D,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,EAAE,QAAQ,GAAG,KAAK,CAAC,CAAC;AAEnE,eAAO,MAAM,gBAAgB,2DAAqB,CAAC;AAEnD,QAAA,MAAM,cAAc,2CAA4C,CAAC;AACjE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,oBAAoB,6CAAyB,CAAC;AAE3D,QAAA,MAAM,aAAa,0DAA2D,CAAC;AAC/E,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3D,eAAO,MAAM,mBAAmB,4DAAwB,CAAC;AAEzD,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,OAAO;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAC;CACjC;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarB,CAAC;AAEH,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,UAAU,GAChB,uBAAuB,GACvB,kBAAkB,GAClB,UAAU,GACV,gCAAgC,CAAC;AAEvC,eAAO,MAAM,gBAAgB,wGAK3B,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAKvC,CAAC;AAEH,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAKrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -394,22 +394,22 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
394
394
|
design: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
395
395
|
visual: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
396
396
|
mobileUrl: z.ZodString;
|
|
397
|
-
|
|
398
|
-
|
|
397
|
+
tabletUrl: z.ZodString;
|
|
398
|
+
desktopUrl: z.ZodString;
|
|
399
399
|
altText: z.ZodString;
|
|
400
400
|
kind: z.ZodLiteral<"Image">;
|
|
401
401
|
}, "strip", z.ZodTypeAny, {
|
|
402
402
|
kind: "Image";
|
|
403
403
|
mobileUrl: string;
|
|
404
|
-
|
|
404
|
+
tabletUrl: string;
|
|
405
|
+
desktopUrl: string;
|
|
405
406
|
altText: string;
|
|
406
|
-
tabletDesktopUrl: string;
|
|
407
407
|
}, {
|
|
408
408
|
kind: "Image";
|
|
409
409
|
mobileUrl: string;
|
|
410
|
-
|
|
410
|
+
tabletUrl: string;
|
|
411
|
+
desktopUrl: string;
|
|
411
412
|
altText: string;
|
|
412
|
-
tabletDesktopUrl: string;
|
|
413
413
|
}>, z.ZodObject<{
|
|
414
414
|
buttonColour: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
415
415
|
r: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -697,9 +697,9 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
697
697
|
visual?: {
|
|
698
698
|
kind: "Image";
|
|
699
699
|
mobileUrl: string;
|
|
700
|
-
|
|
700
|
+
tabletUrl: string;
|
|
701
|
+
desktopUrl: string;
|
|
701
702
|
altText: string;
|
|
702
|
-
tabletDesktopUrl: string;
|
|
703
703
|
} | {
|
|
704
704
|
kind: "ChoiceCards";
|
|
705
705
|
buttonColour?: {
|
|
@@ -759,9 +759,9 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
759
759
|
visual?: {
|
|
760
760
|
kind: "Image";
|
|
761
761
|
mobileUrl: string;
|
|
762
|
-
|
|
762
|
+
tabletUrl: string;
|
|
763
|
+
desktopUrl: string;
|
|
763
764
|
altText: string;
|
|
764
|
-
tabletDesktopUrl: string;
|
|
765
765
|
} | {
|
|
766
766
|
kind: "ChoiceCards";
|
|
767
767
|
buttonColour?: {
|
|
@@ -898,9 +898,9 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
898
898
|
visual?: {
|
|
899
899
|
kind: "Image";
|
|
900
900
|
mobileUrl: string;
|
|
901
|
-
|
|
901
|
+
tabletUrl: string;
|
|
902
|
+
desktopUrl: string;
|
|
902
903
|
altText: string;
|
|
903
|
-
tabletDesktopUrl: string;
|
|
904
904
|
} | {
|
|
905
905
|
kind: "ChoiceCards";
|
|
906
906
|
buttonColour?: {
|
|
@@ -1037,9 +1037,9 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
1037
1037
|
visual?: {
|
|
1038
1038
|
kind: "Image";
|
|
1039
1039
|
mobileUrl: string;
|
|
1040
|
-
|
|
1040
|
+
tabletUrl: string;
|
|
1041
|
+
desktopUrl: string;
|
|
1041
1042
|
altText: string;
|
|
1042
|
-
tabletDesktopUrl: string;
|
|
1043
1043
|
} | {
|
|
1044
1044
|
kind: "ChoiceCards";
|
|
1045
1045
|
buttonColour?: {
|
|
@@ -18,22 +18,22 @@ export declare const hexColourSchema: z.ZodObject<{
|
|
|
18
18
|
export declare const configurableDesignSchema: z.ZodObject<{
|
|
19
19
|
visual: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
20
20
|
mobileUrl: z.ZodString;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
tabletUrl: z.ZodString;
|
|
22
|
+
desktopUrl: z.ZodString;
|
|
23
23
|
altText: z.ZodString;
|
|
24
24
|
kind: z.ZodLiteral<"Image">;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
26
|
kind: "Image";
|
|
27
27
|
mobileUrl: string;
|
|
28
|
-
|
|
28
|
+
tabletUrl: string;
|
|
29
|
+
desktopUrl: string;
|
|
29
30
|
altText: string;
|
|
30
|
-
tabletDesktopUrl: string;
|
|
31
31
|
}, {
|
|
32
32
|
kind: "Image";
|
|
33
33
|
mobileUrl: string;
|
|
34
|
-
|
|
34
|
+
tabletUrl: string;
|
|
35
|
+
desktopUrl: string;
|
|
35
36
|
altText: string;
|
|
36
|
-
tabletDesktopUrl: string;
|
|
37
37
|
}>, z.ZodObject<{
|
|
38
38
|
buttonColour: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
39
39
|
r: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -321,9 +321,9 @@ export declare const configurableDesignSchema: z.ZodObject<{
|
|
|
321
321
|
visual?: {
|
|
322
322
|
kind: "Image";
|
|
323
323
|
mobileUrl: string;
|
|
324
|
-
|
|
324
|
+
tabletUrl: string;
|
|
325
|
+
desktopUrl: string;
|
|
325
326
|
altText: string;
|
|
326
|
-
tabletDesktopUrl: string;
|
|
327
327
|
} | {
|
|
328
328
|
kind: "ChoiceCards";
|
|
329
329
|
buttonColour?: {
|
|
@@ -383,9 +383,9 @@ export declare const configurableDesignSchema: z.ZodObject<{
|
|
|
383
383
|
visual?: {
|
|
384
384
|
kind: "Image";
|
|
385
385
|
mobileUrl: string;
|
|
386
|
-
|
|
386
|
+
tabletUrl: string;
|
|
387
|
+
desktopUrl: string;
|
|
387
388
|
altText: string;
|
|
388
|
-
tabletDesktopUrl: string;
|
|
389
389
|
} | {
|
|
390
390
|
kind: "ChoiceCards";
|
|
391
391
|
buttonColour?: {
|
|
@@ -452,8 +452,8 @@ interface TickerDesign {
|
|
|
452
452
|
}
|
|
453
453
|
export interface BannerDesignHeaderImage {
|
|
454
454
|
mobileUrl: string;
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
tabletUrl: string;
|
|
456
|
+
desktopUrl: string;
|
|
457
457
|
altText: string;
|
|
458
458
|
}
|
|
459
459
|
export interface BannerDesignImage extends BannerDesignHeaderImage {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/design.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAazB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;AAsBH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AAEH,KAAK,OAAO,GACN,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAEV,KAAK,QAAQ,GAAG,GAAG,OAAO,GAAG,OAAO,EAAE,CAAC;AAEvC,MAAM,WAAW,SAAS;IACtB,CAAC,EAAE,QAAQ,CAAC;IACZ,CAAC,EAAE,QAAQ,CAAC;IACZ,CAAC,EAAE,QAAQ,CAAC;IACZ,IAAI,EAAE,KAAK,CAAC;CACf;AAED,eAAO,MAAM,iBAAiB,MAAO,SAAS,KAAG,MAA+B,CAAC;AAEjF,UAAU,cAAc;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC;CACtB;AACD,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,cAAc,CAAC;CACzB;AAED,UAAU,YAAY;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,cAAc,EAAE,SAAS,CAAC;IAC1B,qBAAqB,EAAE,SAAS,CAAC;IACjC,UAAU,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/design.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAazB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;AAsBH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AAEH,KAAK,OAAO,GACN,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAEV,KAAK,QAAQ,GAAG,GAAG,OAAO,GAAG,OAAO,EAAE,CAAC;AAEvC,MAAM,WAAW,SAAS;IACtB,CAAC,EAAE,QAAQ,CAAC;IACZ,CAAC,EAAE,QAAQ,CAAC;IACZ,CAAC,EAAE,QAAQ,CAAC;IACZ,IAAI,EAAE,KAAK,CAAC;CACf;AAED,eAAO,MAAM,iBAAiB,MAAO,SAAS,KAAG,MAA+B,CAAC;AAEjF,UAAU,cAAc;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC;CACtB;AACD,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,cAAc,CAAC;CACzB;AAED,UAAU,YAAY;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,cAAc,EAAE,SAAS,CAAC;IAC1B,qBAAqB,EAAE,SAAS,CAAC;IACjC,UAAU,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;IAC9D,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,iBAAiB;IACvB,IAAI,EAAE,aAAa,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC,wBAAwB,CAAC,EAAE,SAAS,CAAC;CACxC;AACD,KAAK,MAAM,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,OAAO,EAAE;QACL,KAAK,EAAE;YACH,UAAU,EAAE,SAAS,CAAC;YACtB,QAAQ,EAAE,SAAS,CAAC;YACpB,UAAU,EAAE,SAAS,CAAC;YACtB,gBAAgB,EAAE,SAAS,CAAC;YAC5B,IAAI,EAAE,SAAS,CAAC;SACnB,CAAC;QACF,eAAe,EAAE;YACb,IAAI,EAAE,SAAS,CAAC;YAChB,SAAS,EAAE,SAAS,CAAC;SACxB,CAAC;QACF,UAAU,EAAE,SAAS,CAAC;QACtB,YAAY,EAAE,SAAS,CAAC;QACxB,WAAW,EAAE,SAAS,CAAC;QACvB,MAAM,EAAE,YAAY,CAAC;KACxB,CAAC;CACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/targeting/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE5E,MAAM,MAAM,eAAe,GAAG;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,0BAA0B,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/targeting/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE5E,MAAM,MAAM,eAAe,GAAG;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,YAAY,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,eAAe,CAAC;CAC9B,CAAC"}
|