@guardian/support-dotcom-components 4.0.0 → 6.0.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.
Files changed (43) hide show
  1. package/dist/dotcom/requests.d.ts +2 -1
  2. package/dist/dotcom/requests.d.ts.map +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/shared/lib/geolocation.d.ts +11 -1
  6. package/dist/shared/lib/geolocation.d.ts.map +1 -1
  7. package/dist/shared/types/abTests/banner.d.ts +26 -8
  8. package/dist/shared/types/abTests/banner.d.ts.map +1 -1
  9. package/dist/shared/types/abTests/epic.d.ts +24 -6
  10. package/dist/shared/types/abTests/epic.d.ts.map +1 -1
  11. package/dist/shared/types/abTests/gutter.d.ts +427 -0
  12. package/dist/shared/types/abTests/gutter.d.ts.map +1 -0
  13. package/dist/shared/types/abTests/header.d.ts +24 -6
  14. package/dist/shared/types/abTests/header.d.ts.map +1 -1
  15. package/dist/shared/types/abTests/index.d.ts +1 -0
  16. package/dist/shared/types/abTests/index.d.ts.map +1 -1
  17. package/dist/shared/types/abTests/shared.d.ts +4 -4
  18. package/dist/shared/types/abTests/shared.d.ts.map +1 -1
  19. package/dist/shared/types/props/banner.d.ts +0 -5
  20. package/dist/shared/types/props/banner.d.ts.map +1 -1
  21. package/dist/shared/types/props/epic.d.ts +0 -5
  22. package/dist/shared/types/props/epic.d.ts.map +1 -1
  23. package/dist/shared/types/props/gutter.d.ts +246 -0
  24. package/dist/shared/types/props/gutter.d.ts.map +1 -0
  25. package/dist/shared/types/props/header.d.ts +0 -5
  26. package/dist/shared/types/props/header.d.ts.map +1 -1
  27. package/dist/shared/types/props/index.d.ts +1 -0
  28. package/dist/shared/types/props/index.d.ts.map +1 -1
  29. package/dist/shared/types/props/shared.d.ts +5 -4
  30. package/dist/shared/types/props/shared.d.ts.map +1 -1
  31. package/dist/shared/types/targeting/banner.d.ts +1 -2
  32. package/dist/shared/types/targeting/banner.d.ts.map +1 -1
  33. package/dist/shared/types/targeting/epic.d.ts +3 -3
  34. package/dist/shared/types/targeting/epic.d.ts.map +1 -1
  35. package/dist/shared/types/targeting/gutter.d.ts +12 -0
  36. package/dist/shared/types/targeting/gutter.d.ts.map +1 -0
  37. package/dist/shared/types/targeting/header.d.ts +1 -2
  38. package/dist/shared/types/targeting/header.d.ts.map +1 -1
  39. package/dist/shared/types/targeting/index.d.ts +1 -0
  40. package/dist/shared/types/targeting/index.d.ts.map +1 -1
  41. package/dist/shared/types/targeting/shared.d.ts +0 -6
  42. package/dist/shared/types/targeting/shared.d.ts.map +1 -1
  43. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { BannerPayload, BannerProps, EpicPayload, EpicProps, HeaderPayload, HeaderProps } from '../shared/types';
1
+ import { BannerPayload, BannerProps, EpicPayload, EpicProps, HeaderPayload, HeaderProps, GutterPayload, GutterProps } from '../shared/types';
2
2
  import { TestTracking } from '../shared/types/abTests/shared';
3
3
  export interface ModuleData<PROPS> {
4
4
  name: string;
@@ -13,5 +13,6 @@ export interface ModuleDataResponse<PROPS> {
13
13
  export declare const getEpic: (baseUrl: string, payload: EpicPayload) => Promise<ModuleDataResponse<EpicProps>>;
14
14
  export declare const getLiveblogEpic: (baseUrl: string, payload: EpicPayload) => Promise<ModuleDataResponse<EpicProps>>;
15
15
  export declare const getBanner: (baseUrl: string, payload: BannerPayload) => Promise<ModuleDataResponse<BannerProps>>;
16
+ export declare const getGutterLiveblog: (baseUrl: string, payload: GutterPayload) => Promise<ModuleDataResponse<GutterProps>>;
16
17
  export declare const getHeader: (baseUrl: string, payload: HeaderPayload) => Promise<ModuleDataResponse<HeaderProps>>;
17
18
  //# sourceMappingURL=requests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/dotcom/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb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4CD,eAAO,MAAM,OAAO,YACP,MAAM,WACN,WAAW,KACrB,QAAQ,mBAAmB,SAAS,CAAC,CAA4C,CAAC;AAErF,eAAO,MAAM,eAAe,YACf,MAAM,WACN,WAAW,KACrB,QAAQ,mBAAmB,SAAS,CAAC,CAAqD,CAAC;AAE9F,eAAO,MAAM,SAAS,YACT,MAAM,WACN,aAAa,KACvB,QAAQ,mBAAmB,WAAW,CAAC,CAA8C,CAAC;AAEzF,eAAO,MAAM,iBAAiB,YACjB,MAAM,WACN,aAAa,KACvB,QAAQ,mBAAmB,WAAW,CAAC,CAAuD,CAAC;AAElG,eAAO,MAAM,SAAS,YACT,MAAM,WACN,aAAa,KACvB,QAAQ,mBAAmB,WAAW,CAAC,CAA8C,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{z as e}from"zod";const n="gu.contributions.views",t=e=>e.get(n)||void 0,a=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const i={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(i))},i="gu.history.weeklyArticleCount",o="gu.history.articleCountsThisWeek",r=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},s=e=>e.get(i)||void 0,l=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","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),u=(e,n={})=>(e.forEach((e=>{l.has(e)&&(n[e]=(n[e]??0)+1)})),n),c=(e,n,t)=>{const a=((e,n)=>{const t=r(new Date),a=e.get(o);if(a&&a.week===t){const i=a.articles[n]||0;return e.set(o,{week:t,articles:{...a.articles,[n]:i+1}}),i>0}return e.set(o,{week:t,articles:{[n]:1}}),!1})(e,n);if(!a){const n=r(new Date),a=e.get(i)||[],o=a[0];if(o&&o.week&&o.week===n)o.count+=1,o.tags=u(t,o.tags),e.set(i,a);else{a.unshift({week:n,count:1,tags:u(t,{})});const o=n-365,r=a.filter((e=>e.week>=o));e.set(i,r)}}},d=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],g=e.enum(d),m={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"}},p={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"},b={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},C=e=>Object.keys(m).find((n=>m[n].countries.includes(e??"")))||"International",S=(e,n=[])=>0===n.length||!!e&&n.includes(C(e.toUpperCase())),h=e=>{if(e){const n=C(e);return b[n]}return"£"},y=e=>{if(e)return p[e]},A=e=>/subscribe\/weekly\/checkout/.test(e),T=(e,n)=>{if(n){const t=(e=>m[C(e)]?.supportRegionId)(n);if(t&&!A(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},I=(e,n,t,a)=>{if(a){const i=a[C(t)];if(i){return`${h(t)}${i[e][n].price}`}}},N={CURRENCY_SYMBOL:({countryCode:e})=>h(e),COUNTRY_NAME:({countryCode:e})=>y(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>I("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>I("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>I("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>I("GuardianWeekly","Annual",e,n),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"}))()},M=(e,n,t)=>e?e.replace(E,(e=>{const a=e.substring(2,e.length-2),i=N[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",E=/%%.*?%%/g,G=e=>{const n=e.match(E)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},U=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},R=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),i=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${i}-${t}-01`,reminderLabel:`${a} ${i}`}},B=new Date("2023-12-31"),P=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<U(e.getFullYear()),L=(e,n=new Date)=>{return"US"===e&&P(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(U(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=U(e.getFullYear())&&e<B)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):R(n);var t},D=e.object({text:e.string(),baseUrl:e.string()});let w=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(w);const O=e.object({type:e.literal(w.Custom),cta:D}),k=e.object({type:e.literal(w.ContributionsReminder)}),f=e.discriminatedUnion("type",[O,k]);let K=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const F=e.nativeEnum(K);let v=function(e){return e.money="money",e}({});const j=e.nativeEnum(v),H=e.object({countLabel:e.string(),goalReachedPrimary:e.string().optional(),goalReachedSecondary:e.string().optional()}),Y=e.object({total:e.number(),goal:e.number()}),V=e.enum(["US","AU"]),W=e.object({endType:F,countType:j,currencySymbol:e.string(),copy:H,name:V,tickerData:Y.optional()}),Z=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),$=e.enum(["for52Weeks","forTargetedWeeks"]),x=e.object({type:e.literal("above"),copy:e.string().optional(),countType:$.optional()}),_=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),J=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),Q=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:J,products:e.array(_).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string(),clientName:e.string()}),z=e.object({mainUrl:e.string(),mobileUrl:e.string().optional(),tabletUrl:e.string().optional(),desktopUrl:e.string().optional(),leftColUrl:e.string().optional(),wideUrl:e.string().optional(),altText:e.string()}),q=e.object({name:e.string(),description:e.string().optional(),headshot:z.optional()}),X=/^[0-9A-F]{2}$/,ee=e.string().refine((e=>X.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),ne=e.object({r:ee,g:ee,b:ee,kind:e.literal("hex")}),te=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ae=e.object({buttonColour:ne.nullish(),buttonTextColour:ne.nullish(),buttonBorderColour:ne.nullish(),buttonSelectColour:ne.nullish(),buttonSelectTextColour:ne.nullish(),buttonSelectBorderColour:ne.nullish(),kind:e.literal("ChoiceCards")}),ie=e.discriminatedUnion("kind",[te,ae]),oe=e.object({visual:ie.nullish(),colours:e.object({basic:e.object({background:ne,bodyText:ne})})}),re=e=>`#${e.r}${e.g}${e.b}`,se=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),le=e.enum(["new","guest","current"]),ue=e.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header"]),ce=e.enum(["Live","Draft","Archived"]),de=e.enum(["Mobile","Desktop","All","iOS","Android"]),ge=e.enum(["SignedIn","SignedOut","All"]),me=e.enum(["HasConsented","HasNotConsented","All"]),pe=e.object({name:e.literal("ABTest")}),be=e.object({name:e.literal("EpsilonGreedyBandit"),epsilon:e.number(),sampleCount:e.number().optional()}),Ce=e.object({name:e.literal("Roulette"),sampleCount:e.number().optional()}),Se=e.intersection(e.discriminatedUnion("name",[pe,be,Ce]),e.object({testName:e.string().optional()})),he=e.object({channel:ue,name:e.string(),status:ce,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:de.optional(),signedInStatus:ge.optional(),consentStatus:me.optional(),methodologies:Se.array().optional()}),ye=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Ae=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(le),product:e.array(se)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const Te=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Ie=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),Ne=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),Me=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:Ne,displayContributionType:Ne.array(),amountsCardData:e.object({ONE_OFF:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),MONTHLY:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),ANNUAL:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()})})}),Ee=e.object({newsletterId:e.string(),successDescription:e.string()}),Ge=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:W.optional(),cta:D.optional(),secondaryCta:f.optional(),newsletterSignup:Ee.optional(),image:z.optional(),showReminderFields:Ie.optional(),separateArticleCount:x.optional(),maxViews:Te.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:q.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:Me.optional(),defaultChoiceCardFrequency:Ne.optional()}),Ue=e.object({variant:Ge,tracking:Q,countryCode:e.string().nullish(),articleCounts:Z,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),Re=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Be=e.object({heading:e.string().optional(),messageText:e.string().optional(),paragraphs:e.array(e.string()).optional(),mobileMessageText:e.string().optional(),highlightedText:e.string().optional(),cta:D.optional(),secondaryCta:f.optional()}),Pe=e.object({tracking:Q,bannerChannel:Re,content:Be.nullish(),mobileContent:Be.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:W.nullish(),submitComponentEvent:e.any(),articleCounts:Z,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:oe.nullish()}),Le=e.object({heading:e.string(),subheading:e.string(),primaryCta:D.optional(),secondaryCta:D.optional(),benefits:e.array(e.string()).optional()}),De=e.object({content:Le,tracking:Q,mobileContent:Le.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),we=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Oe=["ONE_OFF","MONTHLY","ANNUAL"];he.extend({name:e.string(),status:ce,locations:e.array(g),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:we.optional(),userCohort:ye,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Ae.optional(),priority:e.number(),variants:Ge.array()});const ke=e.object({amount:e.union([e.number(),e.literal("other")]),billingPeriod:e.union([e.literal("ONE_OFF"),e.literal("MONTHLY"),e.literal("ANNUAL")]),product:e.union([e.literal("Contribution"),e.literal("SupporterPlus"),e.literal("PremiumTier"),e.literal("DailyEdition"),e.literal("GuardianWeekly"),e.literal("Paper"),e.literal("PaperAndDigital")]),region:e.union([e.literal("uk"),e.literal("us"),e.literal("au"),e.literal("eu"),e.literal("int"),e.literal("nz"),e.literal("ca")])}),fe=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))},Ke=(e,n)=>fe("epic",e,n),Fe=(e,n)=>fe("liveblog-epic",e,n),ve=(e,n)=>fe("banner",e,n),je=(e,n)=>fe("header",e,n);export{d as CountryGroupId,w as SecondaryCtaType,v as TickerCountType,K as TickerEndType,ke as abandonedBasketSchema,T as addRegionIdToSupportUrl,Pe as bannerSchema,R as buildReminderFields,G as containsNonArticleCountPlaceholder,Oe as contributionTabFrequencies,C as countryCodeToCountryGroupId,g as countryGroupIdSchema,Ue as epicPropsSchema,ve as getBanner,y as getCountryName,Ke as getEpic,t as getEpicViewLog,je as getHeader,Fe as getLiveblogEpic,h as getLocalCurrencySymbol,L as getReminderFields,s as getWeeklyArticleHistory,De as headerPropsSchema,re as hexColourToString,S as inCountryGroups,c as incrementWeeklyArticleCount,A as isGWCheckoutUrl,a as logEpicView,M as replaceNonArticleCountPlaceholders};
1
+ import{z as e}from"zod";const n="gu.contributions.views",t=e=>e.get(n)||void 0,a=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const i={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(i))},i="gu.history.weeklyArticleCount",o="gu.history.articleCountsThisWeek",r=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},s=e=>e.get(i)||void 0,l=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","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),u=(e,n={})=>(e.forEach((e=>{l.has(e)&&(n[e]=(n[e]??0)+1)})),n),c=(e,n,t)=>{const a=((e,n)=>{const t=r(new Date),a=e.get(o);if(a&&a.week===t){const i=a.articles[n]||0;return e.set(o,{week:t,articles:{...a.articles,[n]:i+1}}),i>0}return e.set(o,{week:t,articles:{[n]:1}}),!1})(e,n);if(!a){const n=r(new Date),a=e.get(i)||[],o=a[0];if(o&&o.week&&o.week===n)o.count+=1,o.tags=u(t,o.tags),e.set(i,a);else{a.unshift({week:n,count:1,tags:u(t,{})});const o=n-365,r=a.filter((e=>e.week>=o));e.set(i,r)}}},d=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],g=e.enum(d),m=e.object({targetedCountryGroups:e.array(g),targetedCountryCodes:e.array(e.string()).optional()}).optional(),p={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"}},b={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"},C={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},S=e=>Object.keys(p).find((n=>p[n].countries.includes(e??"")))||"International",h=(e,n=[],t=[])=>0===n.length&&0===t.length||!!e&&(!!n.includes(S(e.toUpperCase()))||t.includes(e.toUpperCase())),y=e=>{if(e){const n=S(e);return C[n]}return"£"},A=e=>{if(e)return b[e]},T=e=>/subscribe\/weekly\/checkout/.test(e),I=(e,n)=>{if(n){const t=(e=>p[S(e)]?.supportRegionId)(n);if(t&&!T(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},N=(e,n,t,a)=>{if(a){const i=a[S(t)];if(i){return`${y(t)}${i[e][n].price}`}}},M={CURRENCY_SYMBOL:({countryCode:e})=>y(e),COUNTRY_NAME:({countryCode:e})=>A(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>N("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>N("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>N("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>N("GuardianWeekly","Annual",e,n),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"}))()},E=(e,n,t)=>e?e.replace(G,(e=>{const a=e.substring(2,e.length-2),i=M[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",G=/%%.*?%%/g,U=e=>{const n=e.match(G)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},R=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},B=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),i=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${i}-${t}-01`,reminderLabel:`${a} ${i}`}},P=new Date("2023-12-31"),L=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<R(e.getFullYear()),D=(e,n=new Date)=>{return"US"===e&&L(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(R(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=R(e.getFullYear())&&e<P)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):B(n);var t},w=e.object({text:e.string(),baseUrl:e.string()});let O=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(O);const k=e.object({type:e.literal(O.Custom),cta:w}),f=e.object({type:e.literal(O.ContributionsReminder)}),K=e.discriminatedUnion("type",[k,f]);let v=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const F=e.nativeEnum(v);let j=function(e){return e.money="money",e}({});const H=e.nativeEnum(j),Y=e.object({countLabel:e.string(),goalReachedPrimary:e.string().optional(),goalReachedSecondary:e.string().optional()}),V=e.object({total:e.number(),goal:e.number()}),W=e.enum(["US","AU"]),Z=e.object({endType:F,countType:H,currencySymbol:e.string(),copy:Y,name:W,tickerData:V.optional()}),$=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),x=e.enum(["for52Weeks","forTargetedWeeks"]),_=e.object({type:e.literal("above"),copy:e.string().optional(),countType:x.optional()}),J=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),Q=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),z=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:Q,products:e.array(J).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string()}),q=e.object({mainUrl:e.string(),mobileUrl:e.string().optional(),tabletUrl:e.string().optional(),desktopUrl:e.string().optional(),leftColUrl:e.string().optional(),wideUrl:e.string().optional(),altText:e.string()}),X=e.object({name:e.string(),description:e.string().optional(),headshot:q.optional()}),ee=/^[0-9A-F]{2}$/,ne=e.string().refine((e=>ee.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),te=e.object({r:ne,g:ne,b:ne,kind:e.literal("hex")}),ae=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ie=e.object({buttonColour:te.nullish(),buttonTextColour:te.nullish(),buttonBorderColour:te.nullish(),buttonSelectColour:te.nullish(),buttonSelectTextColour:te.nullish(),buttonSelectBorderColour:te.nullish(),kind:e.literal("ChoiceCards")}),oe=e.discriminatedUnion("kind",[ae,ie]),re=e.object({visual:oe.nullish(),colours:e.object({basic:e.object({background:te,bodyText:te})})}),se=e=>`#${e.r}${e.g}${e.b}`,le=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),ue=e.enum(["new","guest","current"]),ce=e.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),de=e.enum(["Live","Draft","Archived"]),ge=e.enum(["Mobile","Desktop","All","iOS","Android"]),me=e.enum(["SignedIn","SignedOut","All"]),pe=e.enum(["HasConsented","HasNotConsented","All"]),be=e.object({name:e.literal("ABTest")}),Ce=e.object({name:e.literal("EpsilonGreedyBandit"),epsilon:e.number(),sampleCount:e.number().optional()}),Se=e.object({name:e.literal("Roulette"),sampleCount:e.number().optional()}),he=e.intersection(e.discriminatedUnion("name",[be,Ce,Se]),e.object({testName:e.string().optional()})),ye=e.object({channel:ce,name:e.string(),status:de,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:ge.optional(),signedInStatus:me.optional(),consentStatus:pe.optional(),methodologies:he.array().optional()}),Ae=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Te=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(ue),product:e.array(le)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const Ie=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Ne=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),Me=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),Ee=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:Me,displayContributionType:Me.array(),amountsCardData:e.object({ONE_OFF:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),MONTHLY:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),ANNUAL:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()})})}),Ge=e.object({newsletterId:e.string(),successDescription:e.string()}),Ue=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:Z.optional(),cta:w.optional(),secondaryCta:K.optional(),newsletterSignup:Ge.optional(),image:q.optional(),showReminderFields:Ne.optional(),separateArticleCount:_.optional(),maxViews:Ie.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:X.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:Ee.optional(),defaultChoiceCardFrequency:Me.optional()}),Re=e.object({variant:Ue,tracking:z,countryCode:e.string().nullish(),articleCounts:$,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),Be=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Pe=e.object({heading:e.string().optional(),messageText:e.string().optional(),paragraphs:e.array(e.string()).optional(),mobileMessageText:e.string().optional(),highlightedText:e.string().optional(),cta:w.optional(),secondaryCta:K.optional()}),Le=e.object({tracking:z,bannerChannel:Be,content:Pe.nullish(),mobileContent:Pe.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:Z.nullish(),submitComponentEvent:e.any(),articleCounts:$,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:re.nullish()}),De=e.object({heading:e.string(),subheading:e.string(),primaryCta:w.optional(),secondaryCta:w.optional(),benefits:e.array(e.string()).optional()}),we=e.object({content:De,tracking:z,mobileContent:De.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),Oe=e.object({image:q,bodyCopy:e.array(e.string()),cta:w.optional()});e.object({content:Oe,tracking:z,countryCode:e.string().optional(),submitComponentEvent:e.any()});const ke=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),fe=["ONE_OFF","MONTHLY","ANNUAL"];ye.extend({name:e.string(),status:de,locations:e.array(g).optional(),regionTargeting:m.optional(),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:ke.optional(),userCohort:Ae,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Te.optional(),priority:e.number(),variants:Ue.array()});const Ke=e.object({amount:e.union([e.number(),e.literal("other")]),billingPeriod:e.union([e.literal("ONE_OFF"),e.literal("MONTHLY"),e.literal("ANNUAL")]),product:e.union([e.literal("Contribution"),e.literal("SupporterPlus"),e.literal("PremiumTier"),e.literal("DailyEdition"),e.literal("GuardianWeekly"),e.literal("Paper"),e.literal("PaperAndDigital")]),region:e.union([e.literal("uk"),e.literal("us"),e.literal("au"),e.literal("eu"),e.literal("int"),e.literal("nz"),e.literal("ca")])}),ve=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))},Fe=(e,n)=>ve("epic",e,n),je=(e,n)=>ve("liveblog-epic",e,n),He=(e,n)=>ve("banner",e,n),Ye=(e,n)=>ve("gutter-liveblog",e,n),Ve=(e,n)=>ve("header",e,n);export{d as CountryGroupId,O as SecondaryCtaType,j as TickerCountType,v as TickerEndType,Ke as abandonedBasketSchema,I as addRegionIdToSupportUrl,Le as bannerSchema,B as buildReminderFields,U as containsNonArticleCountPlaceholder,fe as contributionTabFrequencies,S as countryCodeToCountryGroupId,g as countryGroupIdSchema,Re as epicPropsSchema,He as getBanner,A as getCountryName,Fe as getEpic,t as getEpicViewLog,Ye as getGutterLiveblog,Ve as getHeader,je as getLiveblogEpic,y as getLocalCurrencySymbol,D as getReminderFields,s as getWeeklyArticleHistory,we as headerPropsSchema,se as hexColourToString,h as inTargetedCountry,c as incrementWeeklyArticleCount,T as isGWCheckoutUrl,a as logEpicView,E as replaceNonArticleCountPlaceholders,m as targetedRegionsSchema};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const n="gu.contributions.views",t="gu.history.weeklyArticleCount",a="gu.history.articleCountsThisWeek",o=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},r=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","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),i=(e,n={})=>(e.forEach((e=>{r.has(e)&&(n[e]=(n[e]??0)+1)})),n),s=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],l=e.z.enum(s),u={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"}},c={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"},d={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},p=e=>Object.keys(u).find((n=>u[n].countries.includes(e??"")))||"International",g=e=>{if(e){const n=p(e);return d[n]}return"£"},z=e=>{if(e)return c[e]},m=e=>/subscribe\/weekly\/checkout/.test(e),C=(e,n,t,a)=>{if(a){const o=a[p(t)];if(o){return`${g(t)}${o[e][n].price}`}}},b={CURRENCY_SYMBOL:({countryCode:e})=>g(e),COUNTRY_NAME:({countryCode:e})=>z(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>C("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>C("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>C("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>C("GuardianWeekly","Annual",e,n),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"}))()},S=/%%.*?%%/g,h=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},y=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),o=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${o}-${t}-01`,reminderLabel:`${a} ${o}`}},A=new Date("2023-12-31"),T=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<h(e.getFullYear()),I=e.z.object({text:e.z.string(),baseUrl:e.z.string()});let N=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.z.nativeEnum(N);const M=e.z.object({type:e.z.literal(N.Custom),cta:I}),E=e.z.object({type:e.z.literal(N.ContributionsReminder)}),G=e.z.discriminatedUnion("type",[M,E]);let U=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const R=e.z.nativeEnum(U);let B=function(e){return e.money="money",e}({});const P=e.z.nativeEnum(B),L=e.z.object({countLabel:e.z.string(),goalReachedPrimary:e.z.string().optional(),goalReachedSecondary:e.z.string().optional()}),D=e.z.object({total:e.z.number(),goal:e.z.number()}),w=e.z.enum(["US","AU"]),O=e.z.object({endType:R,countType:P,currencySymbol:e.z.string(),copy:L,name:w,tickerData:D.optional()}),k=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),x=e.z.enum(["for52Weeks","forTargetedWeeks"]),f=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:x.optional()}),F=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),K=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),v=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:K,products:e.z.array(F).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string(),clientName:e.z.string()}),j=e.z.object({mainUrl:e.z.string(),mobileUrl:e.z.string().optional(),tabletUrl:e.z.string().optional(),desktopUrl:e.z.string().optional(),leftColUrl:e.z.string().optional(),wideUrl:e.z.string().optional(),altText:e.z.string()}),H=e.z.object({name:e.z.string(),description:e.z.string().optional(),headshot:j.optional()}),V=/^[0-9A-F]{2}$/,Y=e.z.string().refine((e=>V.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),W=e.z.object({r:Y,g:Y,b:Y,kind:e.z.literal("hex")}),Z=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),$=e.z.object({buttonColour:W.nullish(),buttonTextColour:W.nullish(),buttonBorderColour:W.nullish(),buttonSelectColour:W.nullish(),buttonSelectTextColour:W.nullish(),buttonSelectBorderColour:W.nullish(),kind:e.z.literal("ChoiceCards")}),_=e.z.discriminatedUnion("kind",[Z,$]),J=e.z.object({visual:_.nullish(),colours:e.z.object({basic:e.z.object({background:W,bodyText:W})})}),Q=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),q=e.z.enum(["new","guest","current"]),X=e.z.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header"]),ee=e.z.enum(["Live","Draft","Archived"]),ne=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),te=e.z.enum(["SignedIn","SignedOut","All"]),ae=e.z.enum(["HasConsented","HasNotConsented","All"]),oe=e.z.object({name:e.z.literal("ABTest")}),re=e.z.object({name:e.z.literal("EpsilonGreedyBandit"),epsilon:e.z.number(),sampleCount:e.z.number().optional()}),ie=e.z.object({name:e.z.literal("Roulette"),sampleCount:e.z.number().optional()}),se=e.z.intersection(e.z.discriminatedUnion("name",[oe,re,ie]),e.z.object({testName:e.z.string().optional()})),le=e.z.object({channel:X,name:e.z.string(),status:ee,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:ne.optional(),signedInStatus:te.optional(),consentStatus:ae.optional(),methodologies:se.array().optional()}),ue=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),ce=e.z.object({minViews:e.z.number(),maxViews:e.z.number().optional(),periodInWeeks:e.z.number(),tagIds:e.z.array(e.z.string()).optional()});e.z.object({userType:e.z.array(q),product:e.z.array(Q)}),e.z.object({tagIds:e.z.array(e.z.string()),sectionIds:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSectionIds:e.z.array(e.z.string())});const de=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),pe=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),ge=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),ze=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:ge,displayContributionType:ge.array(),amountsCardData:e.z.object({ONE_OFF:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),MONTHLY:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),ANNUAL:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()})})}),me=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),Ce=e.z.object({name:e.z.string(),heading:e.z.string().optional(),paragraphs:e.z.array(e.z.string()),highlightedText:e.z.string().optional(),tickerSettings:O.optional(),cta:I.optional(),secondaryCta:G.optional(),newsletterSignup:me.optional(),image:j.optional(),showReminderFields:pe.optional(),separateArticleCount:f.optional(),maxViews:de.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:H.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardAmounts:ze.optional(),defaultChoiceCardFrequency:ge.optional()}),be=e.z.object({variant:Ce,tracking:v,countryCode:e.z.string().nullish(),articleCounts:k,onReminderOpen:e.z.any().nullish(),fetchEmail:e.z.any().nullish(),submitComponentEvent:e.z.any().nullish(),openCmp:e.z.any().nullish(),hasConsentForArticleCount:e.z.boolean().nullish(),stage:e.z.string().nullish()}),Se=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),he=e.z.object({heading:e.z.string().optional(),messageText:e.z.string().optional(),paragraphs:e.z.array(e.z.string()).optional(),mobileMessageText:e.z.string().optional(),highlightedText:e.z.string().optional(),cta:I.optional(),secondaryCta:G.optional()}),ye=e.z.object({tracking:v,bannerChannel:Se,content:he.nullish(),mobileContent:he.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:O.nullish(),submitComponentEvent:e.z.any(),articleCounts:k,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:J.nullish()}),Ae=e.z.object({heading:e.z.string(),subheading:e.z.string(),primaryCta:I.optional(),secondaryCta:I.optional(),benefits:e.z.array(e.z.string()).optional()}),Te=e.z.object({content:Ae,tracking:v,mobileContent:Ae.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional()}),Ie=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});le.extend({name:e.z.string(),status:ee,locations:e.z.array(l),tagIds:e.z.array(e.z.string()),sections:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSections:e.z.array(e.z.string()),alwaysAsk:e.z.boolean(),maxViews:Ie.optional(),userCohort:ue,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:ce.optional(),priority:e.z.number(),variants:Ce.array()});const Ne=e.z.object({amount:e.z.union([e.z.number(),e.z.literal("other")]),billingPeriod:e.z.union([e.z.literal("ONE_OFF"),e.z.literal("MONTHLY"),e.z.literal("ANNUAL")]),product:e.z.union([e.z.literal("Contribution"),e.z.literal("SupporterPlus"),e.z.literal("PremiumTier"),e.z.literal("DailyEdition"),e.z.literal("GuardianWeekly"),e.z.literal("Paper"),e.z.literal("PaperAndDigital")]),region:e.z.union([e.z.literal("uk"),e.z.literal("us"),e.z.literal("au"),e.z.literal("eu"),e.z.literal("int"),e.z.literal("nz"),e.z.literal("ca")])}),Me=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))};exports.CountryGroupId=s,exports.SecondaryCtaType=N,exports.TickerCountType=B,exports.TickerEndType=U,exports.abandonedBasketSchema=Ne,exports.addRegionIdToSupportUrl=(e,n)=>{if(n){const t=(e=>u[p(e)]?.supportRegionId)(n);if(t&&!m(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},exports.bannerSchema=ye,exports.buildReminderFields=y,exports.containsNonArticleCountPlaceholder=e=>{const n=e.match(S)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=p,exports.countryGroupIdSchema=l,exports.epicPropsSchema=be,exports.getBanner=(e,n)=>Me("banner",e,n),exports.getCountryName=z,exports.getEpic=(e,n)=>Me("epic",e,n),exports.getEpicViewLog=e=>e.get(n)||void 0,exports.getHeader=(e,n)=>Me("header",e,n),exports.getLiveblogEpic=(e,n)=>Me("liveblog-epic",e,n),exports.getLocalCurrencySymbol=g,exports.getReminderFields=(e,n=new Date)=>{return"US"===e&&T(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(h(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=h(e.getFullYear())&&e<A)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):y(n);var t},exports.getWeeklyArticleHistory=e=>e.get(t)||void 0,exports.headerPropsSchema=Te,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inCountryGroups=(e,n=[])=>0===n.length||!!e&&n.includes(p(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,n,r)=>{const s=((e,n)=>{const t=o(new Date),r=e.get(a);if(r&&r.week===t){const o=r.articles[n]||0;return e.set(a,{week:t,articles:{...r.articles,[n]:o+1}}),o>0}return e.set(a,{week:t,articles:{[n]:1}}),!1})(e,n);if(!s){const n=o(new Date),a=e.get(t)||[],s=a[0];if(s&&s.week&&s.week===n)s.count+=1,s.tags=i(r,s.tags),e.set(t,a);else{a.unshift({week:n,count:1,tags:i(r,{})});const o=n-365,s=a.filter((e=>e.week>=o));e.set(t,s)}}},exports.isGWCheckoutUrl=m,exports.logEpicView=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const o={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(o))},exports.replaceNonArticleCountPlaceholders=(e,n,t)=>e?e.replace(S,(e=>{const a=e.substring(2,e.length-2),o=b[a];if(o){const e=o({countryCode:n,prices:t});if(e)return e}return e})):"";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const t="gu.contributions.views",n="gu.history.weeklyArticleCount",a="gu.history.articleCountsThisWeek",o=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},r=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","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),i=(e,t={})=>(e.forEach((e=>{r.has(e)&&(t[e]=(t[e]??0)+1)})),t),s=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],l=e.z.enum(s),u=e.z.object({targetedCountryGroups:e.z.array(l),targetedCountryCodes:e.z.array(e.z.string()).optional()}).optional(),c={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"}},d={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"},p={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},g=e=>Object.keys(c).find((t=>c[t].countries.includes(e??"")))||"International",z=e=>{if(e){const t=g(e);return p[t]}return"£"},m=e=>{if(e)return d[e]},C=e=>/subscribe\/weekly\/checkout/.test(e),b=(e,t,n,a)=>{if(a){const o=a[g(n)];if(o){return`${z(n)}${o[e][t].price}`}}},S={CURRENCY_SYMBOL:({countryCode:e})=>z(e),COUNTRY_NAME:({countryCode:e})=>m(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>b("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>b("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>b("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>b("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"}))()},h=/%%.*?%%/g,y=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},A=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),n=(t.getMonth()+1).toString().padStart(2,"0"),a=t.toLocaleString("default",{month:"long"}),o=t.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${o}-${n}-01`,reminderLabel:`${a} ${o}`}},T=new Date("2023-12-31"),I=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<y(e.getFullYear()),N=e.z.object({text:e.z.string(),baseUrl:e.z.string()});let M=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.z.nativeEnum(M);const E=e.z.object({type:e.z.literal(M.Custom),cta:N}),G=e.z.object({type:e.z.literal(M.ContributionsReminder)}),U=e.z.discriminatedUnion("type",[E,G]);let R=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const B=e.z.nativeEnum(R);let P=function(e){return e.money="money",e}({});const L=e.z.nativeEnum(P),D=e.z.object({countLabel:e.z.string(),goalReachedPrimary:e.z.string().optional(),goalReachedSecondary:e.z.string().optional()}),w=e.z.object({total:e.z.number(),goal:e.z.number()}),k=e.z.enum(["US","AU"]),O=e.z.object({endType:B,countType:L,currencySymbol:e.z.string(),copy:D,name:k,tickerData:w.optional()}),x=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),f=e.z.enum(["for52Weeks","forTargetedWeeks"]),v=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:f.optional()}),F=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),K=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),j=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:K,products:e.z.array(F).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string()}),H=e.z.object({mainUrl:e.z.string(),mobileUrl:e.z.string().optional(),tabletUrl:e.z.string().optional(),desktopUrl:e.z.string().optional(),leftColUrl:e.z.string().optional(),wideUrl:e.z.string().optional(),altText:e.z.string()}),V=e.z.object({name:e.z.string(),description:e.z.string().optional(),headshot:H.optional()}),Y=/^[0-9A-F]{2}$/,W=e.z.string().refine((e=>Y.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),Z=e.z.object({r:W,g:W,b:W,kind:e.z.literal("hex")}),$=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),_=e.z.object({buttonColour:Z.nullish(),buttonTextColour:Z.nullish(),buttonBorderColour:Z.nullish(),buttonSelectColour:Z.nullish(),buttonSelectTextColour:Z.nullish(),buttonSelectBorderColour:Z.nullish(),kind:e.z.literal("ChoiceCards")}),J=e.z.discriminatedUnion("kind",[$,_]),Q=e.z.object({visual:J.nullish(),colours:e.z.object({basic:e.z.object({background:Z,bodyText:Z})})}),q=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),X=e.z.enum(["new","guest","current"]),ee=e.z.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),te=e.z.enum(["Live","Draft","Archived"]),ne=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),ae=e.z.enum(["SignedIn","SignedOut","All"]),oe=e.z.enum(["HasConsented","HasNotConsented","All"]),re=e.z.object({name:e.z.literal("ABTest")}),ie=e.z.object({name:e.z.literal("EpsilonGreedyBandit"),epsilon:e.z.number(),sampleCount:e.z.number().optional()}),se=e.z.object({name:e.z.literal("Roulette"),sampleCount:e.z.number().optional()}),le=e.z.intersection(e.z.discriminatedUnion("name",[re,ie,se]),e.z.object({testName:e.z.string().optional()})),ue=e.z.object({channel:ee,name:e.z.string(),status:te,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:ne.optional(),signedInStatus:ae.optional(),consentStatus:oe.optional(),methodologies:le.array().optional()}),ce=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),de=e.z.object({minViews:e.z.number(),maxViews:e.z.number().optional(),periodInWeeks:e.z.number(),tagIds:e.z.array(e.z.string()).optional()});e.z.object({userType:e.z.array(X),product:e.z.array(q)}),e.z.object({tagIds:e.z.array(e.z.string()),sectionIds:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSectionIds:e.z.array(e.z.string())});const pe=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),ge=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),ze=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),me=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:ze,displayContributionType:ze.array(),amountsCardData:e.z.object({ONE_OFF:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),MONTHLY:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),ANNUAL:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()})})}),Ce=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),be=e.z.object({name:e.z.string(),heading:e.z.string().optional(),paragraphs:e.z.array(e.z.string()),highlightedText:e.z.string().optional(),tickerSettings:O.optional(),cta:N.optional(),secondaryCta:U.optional(),newsletterSignup:Ce.optional(),image:H.optional(),showReminderFields:ge.optional(),separateArticleCount:v.optional(),maxViews:pe.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:V.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardAmounts:me.optional(),defaultChoiceCardFrequency:ze.optional()}),Se=e.z.object({variant:be,tracking:j,countryCode:e.z.string().nullish(),articleCounts:x,onReminderOpen:e.z.any().nullish(),fetchEmail:e.z.any().nullish(),submitComponentEvent:e.z.any().nullish(),openCmp:e.z.any().nullish(),hasConsentForArticleCount:e.z.boolean().nullish(),stage:e.z.string().nullish()}),he=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ye=e.z.object({heading:e.z.string().optional(),messageText:e.z.string().optional(),paragraphs:e.z.array(e.z.string()).optional(),mobileMessageText:e.z.string().optional(),highlightedText:e.z.string().optional(),cta:N.optional(),secondaryCta:U.optional()}),Ae=e.z.object({tracking:j,bannerChannel:he,content:ye.nullish(),mobileContent:ye.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:O.nullish(),submitComponentEvent:e.z.any(),articleCounts:x,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:Q.nullish()}),Te=e.z.object({heading:e.z.string(),subheading:e.z.string(),primaryCta:N.optional(),secondaryCta:N.optional(),benefits:e.z.array(e.z.string()).optional()}),Ie=e.z.object({content:Te,tracking:j,mobileContent:Te.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional()}),Ne=e.z.object({image:H,bodyCopy:e.z.array(e.z.string()),cta:N.optional()});e.z.object({content:Ne,tracking:j,countryCode:e.z.string().optional(),submitComponentEvent:e.z.any()});const Me=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});ue.extend({name:e.z.string(),status:te,locations:e.z.array(l).optional(),regionTargeting:u.optional(),tagIds:e.z.array(e.z.string()),sections:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSections:e.z.array(e.z.string()),alwaysAsk:e.z.boolean(),maxViews:Me.optional(),userCohort:ce,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:de.optional(),priority:e.z.number(),variants:be.array()});const Ee=e.z.object({amount:e.z.union([e.z.number(),e.z.literal("other")]),billingPeriod:e.z.union([e.z.literal("ONE_OFF"),e.z.literal("MONTHLY"),e.z.literal("ANNUAL")]),product:e.z.union([e.z.literal("Contribution"),e.z.literal("SupporterPlus"),e.z.literal("PremiumTier"),e.z.literal("DailyEdition"),e.z.literal("GuardianWeekly"),e.z.literal("Paper"),e.z.literal("PaperAndDigital")]),region:e.z.union([e.z.literal("uk"),e.z.literal("us"),e.z.literal("au"),e.z.literal("eu"),e.z.literal("int"),e.z.literal("nz"),e.z.literal("ca")])}),Ge=(e,t,n)=>{const a=(e=>{if(URLSearchParams){const t=new URLSearchParams(window.location.search).get(`force-${e}`);if(t)return t}return null})(e);return fetch(`${t}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).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=s,exports.SecondaryCtaType=M,exports.TickerCountType=P,exports.TickerEndType=R,exports.abandonedBasketSchema=Ee,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>c[g(e)]?.supportRegionId)(t);if(n&&!C(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,t,a)=>`${t}/${n.toLowerCase()}/${a}`))}return e},exports.bannerSchema=Ae,exports.buildReminderFields=A,exports.containsNonArticleCountPlaceholder=e=>{const t=e.match(h)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=g,exports.countryGroupIdSchema=l,exports.epicPropsSchema=Se,exports.getBanner=(e,t)=>Ge("banner",e,t),exports.getCountryName=m,exports.getEpic=(e,t)=>Ge("epic",e,t),exports.getEpicViewLog=e=>e.get(t)||void 0,exports.getGutterLiveblog=(e,t)=>Ge("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Ge("header",e,t),exports.getLiveblogEpic=(e,t)=>Ge("liveblog-epic",e,t),exports.getLocalCurrencySymbol=z,exports.getReminderFields=(e,t=new Date)=>{return"US"===e&&I(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${n=t.getFullYear()}-${(y(n).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${n}`}:"US"===e&&(e=>e>=y(e.getFullYear())&&e<T)(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()):A(t);var n},exports.getWeeklyArticleHistory=e=>e.get(n)||void 0,exports.headerPropsSchema=Ie,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inTargetedCountry=(e,t=[],n=[])=>0===t.length&&0===n.length||!!e&&(!!t.includes(g(e.toUpperCase()))||n.includes(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,t,r)=>{const s=((e,t)=>{const n=o(new Date),r=e.get(a);if(r&&r.week===n){const o=r.articles[t]||0;return e.set(a,{week:n,articles:{...r.articles,[t]:o+1}}),o>0}return e.set(a,{week:n,articles:{[t]:1}}),!1})(e,t);if(!s){const t=o(new Date),a=e.get(n)||[],s=a[0];if(s&&s.week&&s.week===t)s.count+=1,s.tags=i(r,s.tags),e.set(n,a);else{a.unshift({week:t,count:1,tags:i(r,{})});const o=t-365,s=a.filter((e=>e.week>=o));e.set(n,s)}}},exports.isGWCheckoutUrl=C,exports.logEpicView=e=>{const n=localStorage.getItem(t),a=n?JSON.parse(n).value:[];a.push({date:(new Date).getTime(),testId:e});const o={value:a.slice(-50)};localStorage.setItem(t,JSON.stringify(o))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(h,(e=>{const a=e.substring(2,e.length-2),o=S[a];if(o){const e=o({countryCode:t,prices:n});if(e)return e}return e})):"",exports.targetedRegionsSchema=u;
@@ -2,6 +2,16 @@ import { z } from 'zod';
2
2
  export declare const CountryGroupId: readonly ["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"];
3
3
  export type CountryGroupId = (typeof CountryGroupId)[number];
4
4
  export declare const countryGroupIdSchema: z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>;
5
+ export declare const targetedRegionsSchema: z.ZodOptional<z.ZodObject<{
6
+ targetedCountryGroups: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
7
+ targetedCountryCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
10
+ targetedCountryCodes?: string[] | undefined;
11
+ }, {
12
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
13
+ targetedCountryCodes?: string[] | undefined;
14
+ }>>;
5
15
  export type SupportRegionId = 'UK' | 'US' | 'AU' | 'EU' | 'INT' | 'NZ' | 'CA';
6
16
  type IsoCurrency = 'GBP' | 'USD' | 'AUD' | 'EUR' | 'NZD' | 'CAD';
7
17
  type CountryGroup = {
@@ -14,7 +24,7 @@ type CountryGroups = Record<CountryGroupId, CountryGroup>;
14
24
  declare const countryGroups: CountryGroups;
15
25
  export type Region = keyof typeof countryGroups;
16
26
  export declare const countryCodeToCountryGroupId: (countryCode?: string) => CountryGroupId;
17
- export declare const inCountryGroups: (countryCode?: string, countryGroups?: CountryGroupId[]) => boolean;
27
+ export declare const inTargetedCountry: (countryCodeFromPayload?: string, countryGroups?: CountryGroupId[], countryCodes?: string[]) => boolean;
18
28
  export declare const getLocalCurrencySymbol: (geolocation?: string) => string;
19
29
  export declare const getCountryName: (geolocation?: string) => string | undefined;
20
30
  export declare const isGWCheckoutUrl: (baseUrl: string) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../src/shared/lib/geolocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,sHAQjB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,oBAAoB,wHAAyB,CAAC;AAG3D,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9E,KAAK,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEjE,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,eAAe,CAAC;CACpC,CAAC;AAEF,KAAK,aAAa,GAAG,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE1D,QAAA,MAAM,aAAa,EAAE,aAsRpB,CAAC;AAEF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D,QAAA,MAAM,aAAa,EAAE,aAsRpB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,aAAa,CAAC;AAsPhD,eAAO,MAAM,2BAA2B,iBAAkB,MAAM,KAAG,cAOlE,CAAC;AAEF,eAAO,MAAM,iBAAiB,4BACD,MAAM,kBAChB,cAAc,EAAE,iBACjB,MAAM,EAAE,KACvB,OAiBF,CAAC;AAQF,eAAO,MAAM,sBAAsB,iBAAkB,MAAM,KAAG,MAO7D,CAAC;AAEF,eAAO,MAAM,cAAc,iBAAkB,MAAM,KAAG,MAAM,GAAG,SAM9D,CAAC;AAKF,eAAO,MAAM,eAAe,YAAa,MAAM,KAAG,OACH,CAAC;AAEhD,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,gBAAgB,MAAM,KAAG,MAYnF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { BannerChannel, ConfigurableDesign } from '../props';
2
2
  import { TargetingAbTest } from './shared';
3
- import { BannerTargeting, PageTracking } from '../targeting';
3
+ import { BannerTargeting } from '../targeting';
4
4
  import { PurchaseInfoTest } from './shared';
5
5
  import { z } from 'zod';
6
6
  import { OphanComponentType, OphanProduct } from '@guardian/libs';
@@ -416,7 +416,7 @@ export interface BannerVariant extends BannerVariantFromTool {
416
416
  componentType: OphanComponentType;
417
417
  products?: OphanProduct[];
418
418
  }
419
- export type CanRun = (targeting: BannerTargeting, pageTracking: PageTracking) => boolean;
419
+ export type CanRun = (targeting: BannerTargeting) => boolean;
420
420
  export type BannerTestGenerator = () => Promise<BannerTest[]>;
421
421
  export interface BannerTestSelection {
422
422
  test: BannerTest;
@@ -432,7 +432,7 @@ export interface BannerTest extends BannerTestFromTool {
432
432
  variants: BannerVariant[];
433
433
  }
434
434
  export declare const bannerTestFromToolSchema: z.ZodObject<{
435
- channel: z.ZodEnum<["Epic", "EpicAMP", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header"]>;
435
+ channel: z.ZodEnum<["Epic", "EpicAMP", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header", "GutterLiveblog"]>;
436
436
  priority: z.ZodNumber;
437
437
  name: z.ZodString;
438
438
  status: z.ZodEnum<["Live", "Draft", "Archived"]>;
@@ -484,7 +484,17 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
484
484
  testName?: string | undefined;
485
485
  }>>, "many">>;
486
486
  userCohort: z.ZodEnum<["AllExistingSupporters", "AllNonSupporters", "Everyone", "PostAskPauseSingleContributors"]>;
487
- locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
487
+ locations: z.ZodOptional<z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">>;
488
+ regionTargeting: z.ZodOptional<z.ZodOptional<z.ZodObject<{
489
+ targetedCountryGroups: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
490
+ targetedCountryCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
493
+ targetedCountryCodes?: string[] | undefined;
494
+ }, {
495
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
496
+ targetedCountryCodes?: string[] | undefined;
497
+ }>>>;
488
498
  contextTargeting: z.ZodObject<{
489
499
  tagIds: z.ZodArray<z.ZodString, "many">;
490
500
  sectionIds: z.ZodArray<z.ZodString, "many">;
@@ -914,11 +924,10 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
914
924
  daysBetween: number;
915
925
  }>>;
916
926
  }, "strip", z.ZodTypeAny, {
917
- channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header";
927
+ channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
918
928
  priority: number;
919
929
  name: string;
920
930
  status: "Live" | "Draft" | "Archived";
921
- locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
922
931
  userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
923
932
  variants: {
924
933
  name: string;
@@ -1014,6 +1023,11 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
1014
1023
  }) & {
1015
1024
  testName?: string | undefined;
1016
1025
  })[] | undefined;
1026
+ locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
1027
+ regionTargeting?: {
1028
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
1029
+ targetedCountryCodes?: string[] | undefined;
1030
+ } | undefined;
1017
1031
  articlesViewedSettings?: {
1018
1032
  minViews: number;
1019
1033
  periodInWeeks: number;
@@ -1024,11 +1038,10 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
1024
1038
  daysBetween: number;
1025
1039
  } | undefined;
1026
1040
  }, {
1027
- channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header";
1041
+ channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
1028
1042
  priority: number;
1029
1043
  name: string;
1030
1044
  status: "Live" | "Draft" | "Archived";
1031
- locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
1032
1045
  userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
1033
1046
  variants: {
1034
1047
  name: string;
@@ -1124,6 +1137,11 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
1124
1137
  }) & {
1125
1138
  testName?: string | undefined;
1126
1139
  })[] | undefined;
1140
+ locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
1141
+ regionTargeting?: {
1142
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
1143
+ targetedCountryCodes?: string[] | undefined;
1144
+ } | undefined;
1127
1145
  articlesViewedSettings?: {
1128
1146
  minViews: number;
1129
1147
  periodInWeeks: number;
@@ -1 +1 @@
1
- {"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAEb,kBAAkB,EAGrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGH,eAAe,EAGlB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;;GASG;AAEH,oBAAY,cAAc;IACtB,kBAAkB,uBAAuB;CAC5C;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYnC,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"}
@@ -70,7 +70,7 @@ export interface EpicTest extends EpicTestFromTool {
70
70
  expiry?: string;
71
71
  }
72
72
  export declare const epicTestFromToolSchema: z.ZodObject<{
73
- channel: z.ZodEnum<["Epic", "EpicAMP", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header"]>;
73
+ channel: z.ZodEnum<["Epic", "EpicAMP", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header", "GutterLiveblog"]>;
74
74
  controlProportionSettings: z.ZodOptional<z.ZodObject<{
75
75
  proportion: z.ZodNumber;
76
76
  offset: z.ZodNumber;
@@ -120,7 +120,17 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
120
120
  }>>, "many">>;
121
121
  name: z.ZodString;
122
122
  status: z.ZodEnum<["Live", "Draft", "Archived"]>;
123
- locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
123
+ locations: z.ZodOptional<z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">>;
124
+ regionTargeting: z.ZodOptional<z.ZodOptional<z.ZodObject<{
125
+ targetedCountryGroups: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
126
+ targetedCountryCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
129
+ targetedCountryCodes?: string[] | undefined;
130
+ }, {
131
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
132
+ targetedCountryCodes?: string[] | undefined;
133
+ }>>>;
124
134
  tagIds: z.ZodArray<z.ZodString, "many">;
125
135
  sections: z.ZodArray<z.ZodString, "many">;
126
136
  excludedTagIds: z.ZodArray<z.ZodString, "many">;
@@ -718,13 +728,12 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
718
728
  defaultChoiceCardFrequency?: "ONE_OFF" | "MONTHLY" | "ANNUAL" | undefined;
719
729
  }>, "many">;
720
730
  }, "strip", z.ZodTypeAny, {
721
- channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header";
731
+ channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
722
732
  priority: number;
723
733
  name: string;
724
734
  status: "Live" | "Draft" | "Archived";
725
735
  tagIds: string[];
726
736
  excludedTagIds: string[];
727
- locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
728
737
  sections: string[];
729
738
  excludedSections: string[];
730
739
  alwaysAsk: boolean;
@@ -852,6 +861,11 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
852
861
  }) & {
853
862
  testName?: string | undefined;
854
863
  })[] | undefined;
864
+ locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
865
+ regionTargeting?: {
866
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
867
+ targetedCountryCodes?: string[] | undefined;
868
+ } | undefined;
855
869
  maxViews?: {
856
870
  maxViewsCount: number;
857
871
  maxViewsDays: number;
@@ -864,13 +878,12 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
864
878
  tagIds?: string[] | undefined;
865
879
  } | undefined;
866
880
  }, {
867
- channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header";
881
+ channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
868
882
  priority: number;
869
883
  name: string;
870
884
  status: "Live" | "Draft" | "Archived";
871
885
  tagIds: string[];
872
886
  excludedTagIds: string[];
873
- locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
874
887
  sections: string[];
875
888
  excludedSections: string[];
876
889
  alwaysAsk: boolean;
@@ -998,6 +1011,11 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
998
1011
  }) & {
999
1012
  testName?: string | undefined;
1000
1013
  })[] | undefined;
1014
+ locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
1015
+ regionTargeting?: {
1016
+ targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
1017
+ targetedCountryCodes?: string[] | undefined;
1018
+ } | undefined;
1001
1019
  maxViews?: {
1002
1020
  maxViewsCount: number;
1003
1021
  maxViewsDays: number;
@@ -1 +1 @@
1
- {"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/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,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,QAAQ,G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