@guardian/support-dotcom-components 6.2.0 → 7.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.
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server/api/auxiaProxyRouter.d.ts.map +1 -1
- package/dist/server/factories/epicVariant.d.ts +1 -0
- package/dist/server/factories/epicVariant.d.ts.map +1 -1
- package/dist/server/factories/index.d.ts +1 -0
- package/dist/server/factories/index.d.ts.map +1 -1
- package/dist/server/selection/epsilonGreedySelection.d.ts.map +1 -1
- package/dist/server/signin-gate/lib.d.ts +1 -0
- package/dist/server/signin-gate/lib.d.ts.map +1 -1
- package/dist/server/tests/amp/ampEpicModels.d.ts +9 -0
- package/dist/server/tests/amp/ampEpicModels.d.ts.map +1 -1
- package/dist/shared/types/abTests/banner.d.ts +16 -0
- package/dist/shared/types/abTests/banner.d.ts.map +1 -1
- package/dist/shared/types/abTests/epic.d.ts +9 -0
- package/dist/shared/types/abTests/epic.d.ts.map +1 -1
- package/dist/shared/types/props/banner.d.ts +9 -2
- package/dist/shared/types/props/banner.d.ts.map +1 -1
- package/dist/shared/types/props/epic.d.ts +18 -2
- package/dist/shared/types/props/epic.d.ts.map +1 -1
- package/dist/shared/types/props/gutter.d.ts +2 -2
- package/dist/shared/types/props/gutter.d.ts.map +1 -1
- package/dist/shared/types/props/header.d.ts +2 -2
- package/dist/shared/types/props/header.d.ts.map +1 -1
- package/dist/shared/types/props/shared.d.ts +9 -0
- package/dist/shared/types/props/shared.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";const n="gu.history.weeklyArticleCount",t="gu.history.articleCountsThisWeek",a=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},i=e=>e.get(n)||void 0,o=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),r=(e,n={})=>(e.forEach((e=>{o.has(e)&&(n[e]=(n[e]??0)+1)})),n),s=(e,i,o)=>{const s=((e,n)=>{const i=a(new Date),o=e.get(t);if(o&&o.week===i){const a=o.articles[n]||0;return e.set(t,{week:i,articles:{...o.articles,[n]:a+1}}),a>0}return e.set(t,{week:i,articles:{[n]:1}}),!1})(e,i);if(!s){const t=a(new Date),i=e.get(n)||[],s=i[0];if(s?.week&&s.week===t)s.count+=1,s.tags=r(o,s.tags),e.set(n,i);else{i.unshift({week:t,count:1,tags:r(o,{})});const a=t-365,s=i.filter((e=>e.week>=a));e.set(n,s)}}},l=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],u=e.enum(l),c=e.object({targetedCountryGroups:e.array(u),targetedCountryCodes:e.array(e.string()).optional()}).optional(),d={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"}},g={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"},m={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},p=e=>Object.keys(d).find((n=>d[n].countries.includes(e??"")))||"International",b=(e,n=[],t=[])=>0===n.length&&0===t.length||!!e&&(!!n.includes(p(e.toUpperCase()))||t.includes(e.toUpperCase())),C=e=>{if(e){const n=p(e);return m[n]}return"£"},S=e=>{if(e)return g[e]},h=e=>e.includes("subscribe/weekly/checkout"),y=(e,n)=>{if(n){const t=(e=>d[p(e)].supportRegionId)(n);if(t&&!h(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},A=(e,n,t,a)=>{if(a){const i=a[p(t)];if(i){return`${C(t)}${i[e][n].price}`}}},I={CURRENCY_SYMBOL:({countryCode:e})=>C(e),COUNTRY_NAME:({countryCode:e})=>S(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>A("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>A("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>A("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>A("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"}))()},T=(e,n,t)=>e?e.replace(N,(e=>{const a=e.substring(2,e.length-2),i=I[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",N=/%%.*?%%/g,M=e=>{const n=e.match(N)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},E="gu.contributions.views",G=e=>e.get(E)||void 0,U=e=>{const n=localStorage.getItem(E),t=n?JSON.parse(n).value:[];t.push({date:(new Date).getTime(),testId:e});const a={value:t.slice(-50)};localStorage.setItem(E,JSON.stringify(a))},B=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}`}},L=new Date("2023-12-31"),P=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<B(e.getFullYear()),D=(e,n=new Date)=>{return"US"===e&&P(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(B(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=B(e.getFullYear())&&e<L)(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},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]),F=e.object({countLabel:e.string()}),j=e.object({total:e.number(),goal:e.number()}),v=e.enum(["US","AU","global"]),H=e.object({currencySymbol:e.string(),copy:F,name:v,tickerData:j.optional()}),Y=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),V=e.enum(["for52Weeks","forTargetedWeeks"]),W=e.object({type:e.literal("above"),copy:e.string().optional(),countType:V.optional()}),Z=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),$=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),x=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:$,products:e.array(Z).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string()}),_=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()}),J=e.object({name:e.string(),description:e.string().optional(),headshot:_.optional()}),Q=/^[0-9A-F]{2}$/,z=e.string().refine((e=>Q.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),q=e.object({r:z,g:z,b:z,kind:e.literal("hex")}),X=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ee=e.object({buttonColour:q.nullish(),buttonTextColour:q.nullish(),buttonBorderColour:q.nullish(),buttonSelectColour:q.nullish(),buttonSelectTextColour:q.nullish(),buttonSelectBorderColour:q.nullish(),kind:e.literal("ChoiceCards")}),ne=e.discriminatedUnion("kind",[X,ee]),te=e.object({visual:ne.nullish(),colours:e.object({basic:e.object({background:q,bodyText:q})})}),ae=e=>`#${e.r}${e.g}${e.b}`,ie=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),oe=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),re=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),se=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:re,displayContributionType:re.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()})})}),le=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:H.optional(),cta:w.optional(),secondaryCta:K.optional(),newsletterSignup:le.optional(),image:_.optional(),showReminderFields:oe.optional(),separateArticleCount:W.optional(),maxViews:ie.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:J.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:se.optional(),defaultChoiceCardFrequency:re.optional()}),ce=e.object({variant:ue,tracking:x,countryCode:e.string().nullish(),articleCounts:Y,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),de=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ge=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()}),me=e.object({tracking:x,bannerChannel:de,content:ge.nullish(),mobileContent:ge.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:H.nullish(),submitComponentEvent:e.any(),articleCounts:Y,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:te.nullish()}),pe=e.object({heading:e.string(),subheading:e.string(),primaryCta:w.optional(),secondaryCta:w.optional(),benefits:e.array(e.string()).optional()}),be=e.object({content:pe,tracking:x,mobileContent:pe.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),Ce=e.object({image:_,bodyCopy:e.array(e.string()),cta:w.optional()});e.object({content:Ce,tracking:x,countryCode:e.string().optional(),submitComponentEvent:e.any()});const Se=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),he=e.enum(["new","guest","current"]),ye=e.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),Ae=e.enum(["Live","Draft","Archived"]),Ie=e.enum(["Mobile","Desktop","All","iOS","Android"]),Te=e.enum(["SignedIn","SignedOut","All"]),Ne=e.enum(["HasConsented","HasNotConsented","All"]),Me=e.object({name:e.literal("ABTest")}),Ee=e.object({name:e.literal("EpsilonGreedyBandit"),epsilon:e.number(),sampleCount:e.number().optional()}),Ge=e.object({name:e.literal("Roulette"),sampleCount:e.number().optional()}),Ue=e.intersection(e.discriminatedUnion("name",[Me,Ee,Ge]),e.object({testName:e.string().optional()})),Be=e.object({channel:ye,name:e.string(),status:Ae,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:Ie.optional(),signedInStatus:Te.optional(),consentStatus:Ne.optional(),methodologies:Ue.array().optional()}),Re=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Le=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(he),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 Pe=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),De=["ONE_OFF","MONTHLY","ANNUAL"];Be.extend({name:e.string(),status:Ae,locations:e.array(u).optional(),regionTargeting:c.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:Pe.optional(),userCohort:Re,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Le.optional(),priority:e.number(),variants:ue.array()});const we=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")])}),Oe=(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)=>Oe("epic",e,n),fe=(e,n)=>Oe("liveblog-epic",e,n),Ke=(e,n)=>Oe("banner",e,n),Fe=(e,n)=>Oe("gutter-liveblog",e,n),je=(e,n)=>Oe("header",e,n);export{l as CountryGroupId,O as SecondaryCtaType,we as abandonedBasketSchema,y as addRegionIdToSupportUrl,me as bannerSchema,R as buildReminderFields,M as containsNonArticleCountPlaceholder,De as contributionTabFrequencies,p as countryCodeToCountryGroupId,u as countryGroupIdSchema,ce as epicPropsSchema,Ke as getBanner,S as getCountryName,ke as getEpic,G as getEpicViewLog,Fe as getGutterLiveblog,je as getHeader,fe as getLiveblogEpic,C as getLocalCurrencySymbol,D as getReminderFields,i as getWeeklyArticleHistory,be as headerPropsSchema,ae as hexColourToString,b as inTargetedCountry,s as incrementWeeklyArticleCount,h as isGWCheckoutUrl,U as logEpicView,T as replaceNonArticleCountPlaceholders,c as targetedRegionsSchema};
|
|
1
|
+
import{z as e}from"zod";const n="gu.history.weeklyArticleCount",t="gu.history.articleCountsThisWeek",a=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},i=e=>e.get(n)||void 0,o=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),r=(e,n={})=>(e.forEach((e=>{o.has(e)&&(n[e]=(n[e]??0)+1)})),n),s=(e,i,o)=>{const s=((e,n)=>{const i=a(new Date),o=e.get(t);if(o&&o.week===i){const a=o.articles[n]||0;return e.set(t,{week:i,articles:{...o.articles,[n]:a+1}}),a>0}return e.set(t,{week:i,articles:{[n]:1}}),!1})(e,i);if(!s){const t=a(new Date),i=e.get(n)||[],s=i[0];if(s?.week&&s.week===t)s.count+=1,s.tags=r(o,s.tags),e.set(n,i);else{i.unshift({week:t,count:1,tags:r(o,{})});const a=t-365,s=i.filter((e=>e.week>=a));e.set(n,s)}}},l=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],u=e.enum(l),c=e.object({targetedCountryGroups:e.array(u),targetedCountryCodes:e.array(e.string()).optional()}).optional(),d={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"}},g={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"},m={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},p=e=>Object.keys(d).find((n=>d[n].countries.includes(e??"")))||"International",b=(e,n=[],t=[])=>0===n.length&&0===t.length||!!e&&(!!n.includes(p(e.toUpperCase()))||t.includes(e.toUpperCase())),C=e=>{if(e){const n=p(e);return m[n]}return"£"},S=e=>{if(e)return g[e]},h=e=>e.includes("subscribe/weekly/checkout"),y=(e,n)=>{if(n){const t=(e=>d[p(e)].supportRegionId)(n);if(t&&!h(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},A=(e,n,t,a)=>{if(a){const i=a[p(t)];if(i){return`${C(t)}${i[e][n].price}`}}},I={CURRENCY_SYMBOL:({countryCode:e})=>C(e),COUNTRY_NAME:({countryCode:e})=>S(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>A("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>A("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>A("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>A("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"}))()},T=(e,n,t)=>e?e.replace(N,(e=>{const a=e.substring(2,e.length-2),i=I[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",N=/%%.*?%%/g,M=e=>{const n=e.match(N)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},E="gu.contributions.views",G=e=>e.get(E)||void 0,U=e=>{const n=localStorage.getItem(E),t=n?JSON.parse(n).value:[];t.push({date:(new Date).getTime(),testId:e});const a={value:t.slice(-50)};localStorage.setItem(E,JSON.stringify(a))},B=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}`}},L=new Date("2023-12-31"),P=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<B(e.getFullYear()),D=(e,n=new Date)=>{return"US"===e&&P(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(B(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=B(e.getFullYear())&&e<L)(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},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]),F=e.object({countLabel:e.string(),goalCopy:e.string().optional()}),j=e.object({total:e.number(),goal:e.number()}),v=e.enum(["US","AU","global"]),H=e.object({currencySymbol:e.string(),copy:F,name:v,tickerData:j.optional()}),Y=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),V=e.enum(["for52Weeks","forTargetedWeeks"]),W=e.object({type:e.literal("above"),copy:e.string().optional(),countType:V.optional()}),Z=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),$=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),x=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:$,products:e.array(Z).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string()}),_=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()}),J=e.object({name:e.string(),description:e.string().optional(),headshot:_.optional()}),Q=/^[0-9A-F]{2}$/,z=e.string().refine((e=>Q.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),q=e.object({r:z,g:z,b:z,kind:e.literal("hex")}),X=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ee=e.object({buttonColour:q.nullish(),buttonTextColour:q.nullish(),buttonBorderColour:q.nullish(),buttonSelectColour:q.nullish(),buttonSelectTextColour:q.nullish(),buttonSelectBorderColour:q.nullish(),kind:e.literal("ChoiceCards")}),ne=e.discriminatedUnion("kind",[X,ee]),te=e.object({visual:ne.nullish(),colours:e.object({basic:e.object({background:q,bodyText:q})})}),ae=e=>`#${e.r}${e.g}${e.b}`,ie=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),oe=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),re=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),se=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:re,displayContributionType:re.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()})})}),le=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:H.optional(),cta:w.optional(),secondaryCta:K.optional(),newsletterSignup:le.optional(),image:_.optional(),showReminderFields:oe.optional(),separateArticleCount:W.optional(),maxViews:ie.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:J.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:se.optional(),defaultChoiceCardFrequency:re.optional()}),ce=e.object({variant:ue,tracking:x,countryCode:e.string().nullish(),articleCounts:Y,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),de=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ge=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()}),me=e.object({tracking:x,bannerChannel:de,content:ge.nullish(),mobileContent:ge.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:H.nullish(),submitComponentEvent:e.any(),articleCounts:Y,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:te.nullish()}),pe=e.object({heading:e.string(),subheading:e.string(),primaryCta:w.optional(),secondaryCta:w.optional(),benefits:e.array(e.string()).optional()}),be=e.object({content:pe,tracking:x,mobileContent:pe.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),Ce=e.object({image:_,bodyCopy:e.array(e.string()),cta:w.optional()});e.object({content:Ce,tracking:x,countryCode:e.string().optional(),submitComponentEvent:e.any()});const Se=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),he=e.enum(["new","guest","current"]),ye=e.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),Ae=e.enum(["Live","Draft","Archived"]),Ie=e.enum(["Mobile","Desktop","All","iOS","Android"]),Te=e.enum(["SignedIn","SignedOut","All"]),Ne=e.enum(["HasConsented","HasNotConsented","All"]),Me=e.object({name:e.literal("ABTest")}),Ee=e.object({name:e.literal("EpsilonGreedyBandit"),epsilon:e.number(),sampleCount:e.number().optional()}),Ge=e.object({name:e.literal("Roulette"),sampleCount:e.number().optional()}),Ue=e.intersection(e.discriminatedUnion("name",[Me,Ee,Ge]),e.object({testName:e.string().optional()})),Be=e.object({channel:ye,name:e.string(),status:Ae,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:Ie.optional(),signedInStatus:Te.optional(),consentStatus:Ne.optional(),methodologies:Ue.array().optional()}),Re=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Le=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(he),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 Pe=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),De=["ONE_OFF","MONTHLY","ANNUAL"];Be.extend({name:e.string(),status:Ae,locations:e.array(u).optional(),regionTargeting:c.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:Pe.optional(),userCohort:Re,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Le.optional(),priority:e.number(),variants:ue.array()});const we=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")])}),Oe=(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)=>Oe("epic",e,n),fe=(e,n)=>Oe("liveblog-epic",e,n),Ke=(e,n)=>Oe("banner",e,n),Fe=(e,n)=>Oe("gutter-liveblog",e,n),je=(e,n)=>Oe("header",e,n);export{l as CountryGroupId,O as SecondaryCtaType,we as abandonedBasketSchema,y as addRegionIdToSupportUrl,me as bannerSchema,R as buildReminderFields,M as containsNonArticleCountPlaceholder,De as contributionTabFrequencies,p as countryCodeToCountryGroupId,u as countryGroupIdSchema,ce as epicPropsSchema,Ke as getBanner,S as getCountryName,ke as getEpic,G as getEpicViewLog,Fe as getGutterLiveblog,je as getHeader,fe as getLiveblogEpic,C as getLocalCurrencySymbol,D as getReminderFields,i as getWeeklyArticleHistory,be as headerPropsSchema,ae as hexColourToString,b as inTargetedCountry,s as incrementWeeklyArticleCount,h as isGWCheckoutUrl,U as logEpicView,T as replaceNonArticleCountPlaceholders,c as targetedRegionsSchema};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const t="gu.history.weeklyArticleCount",n="gu.history.articleCountsThisWeek",a=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},o=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),r=(e,t={})=>(e.forEach((e=>{o.has(e)&&(t[e]=(t[e]??0)+1)})),t),i=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],s=e.z.enum(i),l=e.z.object({targetedCountryGroups:e.z.array(s),targetedCountryCodes:e.z.array(e.z.string()).optional()}).optional(),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:"$"},g=e=>Object.keys(u).find((t=>u[t].countries.includes(e??"")))||"International",p=e=>{if(e){const t=g(e);return d[t]}return"£"},z=e=>{if(e)return c[e]},m=e=>e.includes("subscribe/weekly/checkout"),C=(e,t,n,a)=>{if(a){const o=a[g(n)];if(o){return`${p(n)}${o[e][t].price}`}}},b={CURRENCY_SYMBOL:({countryCode:e})=>p(e),COUNTRY_NAME:({countryCode:e})=>z(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>C("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>C("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>C("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>C("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"}))()},S=/%%.*?%%/g,h="gu.contributions.views",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]),R=e.z.object({countLabel:e.z.string()}),B=e.z.object({total:e.z.number(),goal:e.z.number()}),P=e.z.enum(["US","AU","global"]),L=e.z.object({currencySymbol:e.z.string(),copy:R,name:P,tickerData:B.optional()}),D=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),w=e.z.enum(["for52Weeks","forTargetedWeeks"]),O=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:w.optional()}),k=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),x=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),F=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:x,products:e.z.array(k).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string()}),f=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:f.optional()}),K=/^[0-9A-F]{2}$/,j=e.z.string().refine((e=>K.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),H=e.z.object({r:j,g:j,b:j,kind:e.z.literal("hex")}),V=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),Y=e.z.object({buttonColour:H.nullish(),buttonTextColour:H.nullish(),buttonBorderColour:H.nullish(),buttonSelectColour:H.nullish(),buttonSelectTextColour:H.nullish(),buttonSelectBorderColour:H.nullish(),kind:e.z.literal("ChoiceCards")}),W=e.z.discriminatedUnion("kind",[V,Y]),Z=e.z.object({visual:W.nullish(),colours:e.z.object({basic:e.z.object({background:H,bodyText:H})})}),$=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),_=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),J=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),Q=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:J,displayContributionType:J.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()})})}),q=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),X=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:L.optional(),cta:N.optional(),secondaryCta:U.optional(),newsletterSignup:q.optional(),image:f.optional(),showReminderFields:_.optional(),separateArticleCount:O.optional(),maxViews:$.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:v.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardAmounts:Q.optional(),defaultChoiceCardFrequency:J.optional()}),ee=e.z.object({variant:X,tracking:F,countryCode:e.z.string().nullish(),articleCounts:D,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()}),te=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ne=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:F,bannerChannel:te,content:ne.nullish(),mobileContent:ne.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:L.nullish(),submitComponentEvent:e.z.any(),articleCounts:D,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:Z.nullish()}),oe=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()}),re=e.z.object({content:oe,tracking:F,mobileContent:oe.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional()}),ie=e.z.object({image:f,bodyCopy:e.z.array(e.z.string()),cta:N.optional()});e.z.object({content:ie,tracking:F,countryCode:e.z.string().optional(),submitComponentEvent:e.z.any()});const se=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),le=e.z.enum(["new","guest","current"]),ue=e.z.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),ce=e.z.enum(["Live","Draft","Archived"]),de=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),ge=e.z.enum(["SignedIn","SignedOut","All"]),pe=e.z.enum(["HasConsented","HasNotConsented","All"]),ze=e.z.object({name:e.z.literal("ABTest")}),me=e.z.object({name:e.z.literal("EpsilonGreedyBandit"),epsilon:e.z.number(),sampleCount:e.z.number().optional()}),Ce=e.z.object({name:e.z.literal("Roulette"),sampleCount:e.z.number().optional()}),be=e.z.intersection(e.z.discriminatedUnion("name",[ze,me,Ce]),e.z.object({testName:e.z.string().optional()})),Se=e.z.object({channel:ue,name:e.z.string(),status:ce,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:de.optional(),signedInStatus:ge.optional(),consentStatus:pe.optional(),methodologies:be.array().optional()}),he=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),ye=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(le),product:e.z.array(se)}),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 Ae=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});Se.extend({name:e.z.string(),status:ce,locations:e.z.array(s).optional(),regionTargeting:l.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:Ae.optional(),userCohort:he,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:ye.optional(),priority:e.z.number(),variants:X.array()});const Te=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")])}),Ie=(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=i,exports.SecondaryCtaType=M,exports.abandonedBasketSchema=Te,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>u[g(e)].supportRegionId)(t);if(n&&!m(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(S)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=g,exports.countryGroupIdSchema=s,exports.epicPropsSchema=ee,exports.getBanner=(e,t)=>Ie("banner",e,t),exports.getCountryName=z,exports.getEpic=(e,t)=>Ie("epic",e,t),exports.getEpicViewLog=e=>e.get(h)||void 0,exports.getGutterLiveblog=(e,t)=>Ie("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Ie("header",e,t),exports.getLiveblogEpic=(e,t)=>Ie("liveblog-epic",e,t),exports.getLocalCurrencySymbol=p,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(t)||void 0,exports.headerPropsSchema=re,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,o,i)=>{const s=((e,t)=>{const o=a(new Date),r=e.get(n);if(r&&r.week===o){const a=r.articles[t]||0;return e.set(n,{week:o,articles:{...r.articles,[t]:a+1}}),a>0}return e.set(n,{week:o,articles:{[t]:1}}),!1})(e,o);if(!s){const n=a(new Date),o=e.get(t)||[],s=o[0];if(s?.week&&s.week===n)s.count+=1,s.tags=r(i,s.tags),e.set(t,o);else{o.unshift({week:n,count:1,tags:r(i,{})});const a=n-365,s=o.filter((e=>e.week>=a));e.set(t,s)}}},exports.isGWCheckoutUrl=m,exports.logEpicView=e=>{const t=localStorage.getItem(h),n=t?JSON.parse(t).value:[];n.push({date:(new Date).getTime(),testId:e});const a={value:n.slice(-50)};localStorage.setItem(h,JSON.stringify(a))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(S,(e=>{const a=e.substring(2,e.length-2),o=b[a];if(o){const e=o({countryCode:t,prices:n});if(e)return e}return e})):"",exports.targetedRegionsSchema=l;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const t="gu.history.weeklyArticleCount",n="gu.history.articleCountsThisWeek",a=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},o=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),r=(e,t={})=>(e.forEach((e=>{o.has(e)&&(t[e]=(t[e]??0)+1)})),t),i=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],s=e.z.enum(i),l=e.z.object({targetedCountryGroups:e.z.array(s),targetedCountryCodes:e.z.array(e.z.string()).optional()}).optional(),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:"$"},g=e=>Object.keys(u).find((t=>u[t].countries.includes(e??"")))||"International",p=e=>{if(e){const t=g(e);return d[t]}return"£"},z=e=>{if(e)return c[e]},m=e=>e.includes("subscribe/weekly/checkout"),C=(e,t,n,a)=>{if(a){const o=a[g(n)];if(o){return`${p(n)}${o[e][t].price}`}}},b={CURRENCY_SYMBOL:({countryCode:e})=>p(e),COUNTRY_NAME:({countryCode:e})=>z(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>C("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>C("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>C("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>C("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"}))()},S=/%%.*?%%/g,h="gu.contributions.views",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]),R=e.z.object({countLabel:e.z.string(),goalCopy:e.z.string().optional()}),B=e.z.object({total:e.z.number(),goal:e.z.number()}),P=e.z.enum(["US","AU","global"]),L=e.z.object({currencySymbol:e.z.string(),copy:R,name:P,tickerData:B.optional()}),D=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),w=e.z.enum(["for52Weeks","forTargetedWeeks"]),O=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:w.optional()}),k=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),x=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),F=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:x,products:e.z.array(k).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string()}),f=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:f.optional()}),K=/^[0-9A-F]{2}$/,j=e.z.string().refine((e=>K.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),H=e.z.object({r:j,g:j,b:j,kind:e.z.literal("hex")}),V=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),Y=e.z.object({buttonColour:H.nullish(),buttonTextColour:H.nullish(),buttonBorderColour:H.nullish(),buttonSelectColour:H.nullish(),buttonSelectTextColour:H.nullish(),buttonSelectBorderColour:H.nullish(),kind:e.z.literal("ChoiceCards")}),W=e.z.discriminatedUnion("kind",[V,Y]),Z=e.z.object({visual:W.nullish(),colours:e.z.object({basic:e.z.object({background:H,bodyText:H})})}),$=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),_=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),J=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),Q=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:J,displayContributionType:J.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()})})}),q=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),X=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:L.optional(),cta:N.optional(),secondaryCta:U.optional(),newsletterSignup:q.optional(),image:f.optional(),showReminderFields:_.optional(),separateArticleCount:O.optional(),maxViews:$.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:v.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardAmounts:Q.optional(),defaultChoiceCardFrequency:J.optional()}),ee=e.z.object({variant:X,tracking:F,countryCode:e.z.string().nullish(),articleCounts:D,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()}),te=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ne=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:F,bannerChannel:te,content:ne.nullish(),mobileContent:ne.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:L.nullish(),submitComponentEvent:e.z.any(),articleCounts:D,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:Z.nullish()}),oe=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()}),re=e.z.object({content:oe,tracking:F,mobileContent:oe.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional()}),ie=e.z.object({image:f,bodyCopy:e.z.array(e.z.string()),cta:N.optional()});e.z.object({content:ie,tracking:F,countryCode:e.z.string().optional(),submitComponentEvent:e.z.any()});const se=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),le=e.z.enum(["new","guest","current"]),ue=e.z.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),ce=e.z.enum(["Live","Draft","Archived"]),de=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),ge=e.z.enum(["SignedIn","SignedOut","All"]),pe=e.z.enum(["HasConsented","HasNotConsented","All"]),ze=e.z.object({name:e.z.literal("ABTest")}),me=e.z.object({name:e.z.literal("EpsilonGreedyBandit"),epsilon:e.z.number(),sampleCount:e.z.number().optional()}),Ce=e.z.object({name:e.z.literal("Roulette"),sampleCount:e.z.number().optional()}),be=e.z.intersection(e.z.discriminatedUnion("name",[ze,me,Ce]),e.z.object({testName:e.z.string().optional()})),Se=e.z.object({channel:ue,name:e.z.string(),status:ce,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:de.optional(),signedInStatus:ge.optional(),consentStatus:pe.optional(),methodologies:be.array().optional()}),he=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),ye=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(le),product:e.z.array(se)}),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 Ae=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});Se.extend({name:e.z.string(),status:ce,locations:e.z.array(s).optional(),regionTargeting:l.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:Ae.optional(),userCohort:he,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:ye.optional(),priority:e.z.number(),variants:X.array()});const Te=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")])}),Ie=(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=i,exports.SecondaryCtaType=M,exports.abandonedBasketSchema=Te,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>u[g(e)].supportRegionId)(t);if(n&&!m(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(S)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=g,exports.countryGroupIdSchema=s,exports.epicPropsSchema=ee,exports.getBanner=(e,t)=>Ie("banner",e,t),exports.getCountryName=z,exports.getEpic=(e,t)=>Ie("epic",e,t),exports.getEpicViewLog=e=>e.get(h)||void 0,exports.getGutterLiveblog=(e,t)=>Ie("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Ie("header",e,t),exports.getLiveblogEpic=(e,t)=>Ie("liveblog-epic",e,t),exports.getLocalCurrencySymbol=p,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(t)||void 0,exports.headerPropsSchema=re,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,o,i)=>{const s=((e,t)=>{const o=a(new Date),r=e.get(n);if(r&&r.week===o){const a=r.articles[t]||0;return e.set(n,{week:o,articles:{...r.articles,[t]:a+1}}),a>0}return e.set(n,{week:o,articles:{[t]:1}}),!1})(e,o);if(!s){const n=a(new Date),o=e.get(t)||[],s=o[0];if(s?.week&&s.week===n)s.count+=1,s.tags=r(i,s.tags),e.set(t,o);else{o.unshift({week:n,count:1,tags:r(i,{})});const a=n-365,s=o.filter((e=>e.week>=a));e.set(t,s)}}},exports.isGWCheckoutUrl=m,exports.logEpicView=e=>{const t=localStorage.getItem(h),n=t?JSON.parse(t).value:[];n.push({date:(new Date).getTime(),testId:e});const a={value:n.slice(-50)};localStorage.setItem(h,JSON.stringify(a))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(S,(e=>{const a=e.substring(2,e.length-2),o=b[a];if(o){const e=o({countryCode:t,prices:n});if(e)return e}return e})):"",exports.targetedRegionsSchema=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auxiaProxyRouter.d.ts","sourceRoot":"","sources":["../../../src/server/api/auxiaProxyRouter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"auxiaProxyRouter.d.ts","sourceRoot":"","sources":["../../../src/server/api/auxiaProxyRouter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAgBjC,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB,QAAa,OAAO,CAAC,iBAAiB,CAiBtE,CAAC;AAwIF,eAAO,MAAM,qBAAqB,WAAY,iBAAiB,KAAG,MA2GjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epicVariant.d.ts","sourceRoot":"","sources":["../../../src/server/factories/epicVariant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"epicVariant.d.ts","sourceRoot":"","sources":["../../../src/server/factories/epicVariant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGlC,wBAoBI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/factories/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/factories/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epsilonGreedySelection.d.ts","sourceRoot":"","sources":["../../../src/server/selection/epsilonGreedySelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C;;;GAGG;AAEH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAC7E,cAAc,EAAE,UAAU,EAC1B,IAAI,EAAE,CAAC,GACR,CAAC,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"epsilonGreedySelection.d.ts","sourceRoot":"","sources":["../../../src/server/selection/epsilonGreedySelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C;;;GAGG;AAEH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAC7E,cAAc,EAAE,UAAU,EAC1B,IAAI,EAAE,CAAC,GACR,CAAC,GAAG,SAAS,CAqBf;AAED,wBAAgB,+BAA+B,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAChF,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,UAAU,GAC5B,CAAC,GAAG,SAAS,CAsBf"}
|
|
@@ -58,5 +58,6 @@ export declare const isValidSection: (sectionId: string) => boolean;
|
|
|
58
58
|
export declare const isValidTagIdCollection: (tagIds: string[]) => boolean;
|
|
59
59
|
export declare const buildAuxiaProxyGetTreatmentsResponseData: (auxiaData: AuxiaAPIGetTreatmentsResponseData) => AuxiaProxyGetTreatmentsResponseData | undefined;
|
|
60
60
|
export declare const buildLogTreatmentInteractionRequestPayload: (projectId: string, browserId: string, treatmentTrackingId: string, treatmentId: string, surface: string, interactionType: string, interactionTimeMicros: number, actionName: string) => AuxiaAPILogTreatmentInteractionRequestPayload;
|
|
61
|
+
export declare const articleIdentifierIsAllowed: (articleIdentifier: string) => boolean;
|
|
61
62
|
export {};
|
|
62
63
|
//# sourceMappingURL=lib.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../src/server/signin-gate/lib.ts"],"names":[],"mappings":"AAAA,UAAU,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AAM,sCAAsC,wBAC1B,MAAM,oBACT,MAAM,KACzB,iCA+BF,CAAC;AAEF,eAAO,MAAM,kBAAkB,gBAAiB,MAAM,KAAG,OAGxD,CAAC;AAEF,eAAO,MAAM,cAAc,cAAe,MAAM,KAAG,OAUlD,CAAC;AAEF,eAAO,MAAM,sBAAsB,WAAY,MAAM,EAAE,KAAG,OAIzD,CAAC;AAEF,eAAO,MAAM,wCAAwC,cACtC,iCAAiC,KAC7C,mCAAmC,GAAG,SASxC,CAAC;AAEF,eAAO,MAAM,0CAA0C,cACxC,MAAM,aACN,MAAM,uBACI,MAAM,eACd,MAAM,WACV,MAAM,mBACE,MAAM,yBACA,MAAM,cACjB,MAAM,KACnB,6CAWF,CAAC;AAEF,eAAO,MAAM,0BAA0B,sBAAuB,MAAM,KAAG,OAgBtE,CAAC"}
|
|
@@ -136,10 +136,13 @@ export declare const ampEpicTestSchema: z.ZodObject<{
|
|
|
136
136
|
currencySymbol: z.ZodString;
|
|
137
137
|
copy: z.ZodObject<{
|
|
138
138
|
countLabel: z.ZodString;
|
|
139
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
139
140
|
}, "strip", z.ZodTypeAny, {
|
|
140
141
|
countLabel: string;
|
|
142
|
+
goalCopy?: string | undefined;
|
|
141
143
|
}, {
|
|
142
144
|
countLabel: string;
|
|
145
|
+
goalCopy?: string | undefined;
|
|
143
146
|
}>;
|
|
144
147
|
name: z.ZodEnum<["US", "AU", "global"]>;
|
|
145
148
|
tickerData: z.ZodOptional<z.ZodObject<{
|
|
@@ -156,6 +159,7 @@ export declare const ampEpicTestSchema: z.ZodObject<{
|
|
|
156
159
|
name: "global" | "US" | "AU";
|
|
157
160
|
copy: {
|
|
158
161
|
countLabel: string;
|
|
162
|
+
goalCopy?: string | undefined;
|
|
159
163
|
};
|
|
160
164
|
currencySymbol: string;
|
|
161
165
|
tickerData?: {
|
|
@@ -166,6 +170,7 @@ export declare const ampEpicTestSchema: z.ZodObject<{
|
|
|
166
170
|
name: "global" | "US" | "AU";
|
|
167
171
|
copy: {
|
|
168
172
|
countLabel: string;
|
|
173
|
+
goalCopy?: string | undefined;
|
|
169
174
|
};
|
|
170
175
|
currencySymbol: string;
|
|
171
176
|
tickerData?: {
|
|
@@ -197,6 +202,7 @@ export declare const ampEpicTestSchema: z.ZodObject<{
|
|
|
197
202
|
name: "global" | "US" | "AU";
|
|
198
203
|
copy: {
|
|
199
204
|
countLabel: string;
|
|
205
|
+
goalCopy?: string | undefined;
|
|
200
206
|
};
|
|
201
207
|
currencySymbol: string;
|
|
202
208
|
tickerData?: {
|
|
@@ -228,6 +234,7 @@ export declare const ampEpicTestSchema: z.ZodObject<{
|
|
|
228
234
|
name: "global" | "US" | "AU";
|
|
229
235
|
copy: {
|
|
230
236
|
countLabel: string;
|
|
237
|
+
goalCopy?: string | undefined;
|
|
231
238
|
};
|
|
232
239
|
currencySymbol: string;
|
|
233
240
|
tickerData?: {
|
|
@@ -265,6 +272,7 @@ export declare const ampEpicTestSchema: z.ZodObject<{
|
|
|
265
272
|
name: "global" | "US" | "AU";
|
|
266
273
|
copy: {
|
|
267
274
|
countLabel: string;
|
|
275
|
+
goalCopy?: string | undefined;
|
|
268
276
|
};
|
|
269
277
|
currencySymbol: string;
|
|
270
278
|
tickerData?: {
|
|
@@ -327,6 +335,7 @@ export declare const ampEpicTestSchema: z.ZodObject<{
|
|
|
327
335
|
name: "global" | "US" | "AU";
|
|
328
336
|
copy: {
|
|
329
337
|
countLabel: string;
|
|
338
|
+
goalCopy?: string | undefined;
|
|
330
339
|
};
|
|
331
340
|
currencySymbol: string;
|
|
332
341
|
tickerData?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ampEpicModels.d.ts","sourceRoot":"","sources":["../../../../src/server/tests/amp/ampEpicModels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,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,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0BAA0B,CAAC,EAAE,qBAAqB,CAAC;CACtD;AAiBD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -28,10 +28,13 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
|
|
|
28
28
|
currencySymbol: z.ZodString;
|
|
29
29
|
copy: z.ZodObject<{
|
|
30
30
|
countLabel: z.ZodString;
|
|
31
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
31
32
|
}, "strip", z.ZodTypeAny, {
|
|
32
33
|
countLabel: string;
|
|
34
|
+
goalCopy?: string | undefined;
|
|
33
35
|
}, {
|
|
34
36
|
countLabel: string;
|
|
37
|
+
goalCopy?: string | undefined;
|
|
35
38
|
}>;
|
|
36
39
|
name: z.ZodEnum<["US", "AU", "global"]>;
|
|
37
40
|
tickerData: z.ZodOptional<z.ZodObject<{
|
|
@@ -48,6 +51,7 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
|
|
|
48
51
|
name: "global" | "US" | "AU";
|
|
49
52
|
copy: {
|
|
50
53
|
countLabel: string;
|
|
54
|
+
goalCopy?: string | undefined;
|
|
51
55
|
};
|
|
52
56
|
currencySymbol: string;
|
|
53
57
|
tickerData?: {
|
|
@@ -58,6 +62,7 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
|
|
|
58
62
|
name: "global" | "US" | "AU";
|
|
59
63
|
copy: {
|
|
60
64
|
countLabel: string;
|
|
65
|
+
goalCopy?: string | undefined;
|
|
61
66
|
};
|
|
62
67
|
currencySymbol: string;
|
|
63
68
|
tickerData?: {
|
|
@@ -269,6 +274,7 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
|
|
|
269
274
|
name: "global" | "US" | "AU";
|
|
270
275
|
copy: {
|
|
271
276
|
countLabel: string;
|
|
277
|
+
goalCopy?: string | undefined;
|
|
272
278
|
};
|
|
273
279
|
currencySymbol: string;
|
|
274
280
|
tickerData?: {
|
|
@@ -333,6 +339,7 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
|
|
|
333
339
|
name: "global" | "US" | "AU";
|
|
334
340
|
copy: {
|
|
335
341
|
countLabel: string;
|
|
342
|
+
goalCopy?: string | undefined;
|
|
336
343
|
};
|
|
337
344
|
currencySymbol: string;
|
|
338
345
|
tickerData?: {
|
|
@@ -493,10 +500,13 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
493
500
|
currencySymbol: z.ZodString;
|
|
494
501
|
copy: z.ZodObject<{
|
|
495
502
|
countLabel: z.ZodString;
|
|
503
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
496
504
|
}, "strip", z.ZodTypeAny, {
|
|
497
505
|
countLabel: string;
|
|
506
|
+
goalCopy?: string | undefined;
|
|
498
507
|
}, {
|
|
499
508
|
countLabel: string;
|
|
509
|
+
goalCopy?: string | undefined;
|
|
500
510
|
}>;
|
|
501
511
|
name: z.ZodEnum<["US", "AU", "global"]>;
|
|
502
512
|
tickerData: z.ZodOptional<z.ZodObject<{
|
|
@@ -513,6 +523,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
513
523
|
name: "global" | "US" | "AU";
|
|
514
524
|
copy: {
|
|
515
525
|
countLabel: string;
|
|
526
|
+
goalCopy?: string | undefined;
|
|
516
527
|
};
|
|
517
528
|
currencySymbol: string;
|
|
518
529
|
tickerData?: {
|
|
@@ -523,6 +534,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
523
534
|
name: "global" | "US" | "AU";
|
|
524
535
|
copy: {
|
|
525
536
|
countLabel: string;
|
|
537
|
+
goalCopy?: string | undefined;
|
|
526
538
|
};
|
|
527
539
|
currencySymbol: string;
|
|
528
540
|
tickerData?: {
|
|
@@ -734,6 +746,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
734
746
|
name: "global" | "US" | "AU";
|
|
735
747
|
copy: {
|
|
736
748
|
countLabel: string;
|
|
749
|
+
goalCopy?: string | undefined;
|
|
737
750
|
};
|
|
738
751
|
currencySymbol: string;
|
|
739
752
|
tickerData?: {
|
|
@@ -798,6 +811,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
798
811
|
name: "global" | "US" | "AU";
|
|
799
812
|
copy: {
|
|
800
813
|
countLabel: string;
|
|
814
|
+
goalCopy?: string | undefined;
|
|
801
815
|
};
|
|
802
816
|
currencySymbol: string;
|
|
803
817
|
tickerData?: {
|
|
@@ -892,6 +906,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
892
906
|
name: "global" | "US" | "AU";
|
|
893
907
|
copy: {
|
|
894
908
|
countLabel: string;
|
|
909
|
+
goalCopy?: string | undefined;
|
|
895
910
|
};
|
|
896
911
|
currencySymbol: string;
|
|
897
912
|
tickerData?: {
|
|
@@ -1002,6 +1017,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
1002
1017
|
name: "global" | "US" | "AU";
|
|
1003
1018
|
copy: {
|
|
1004
1019
|
countLabel: string;
|
|
1020
|
+
goalCopy?: string | undefined;
|
|
1005
1021
|
};
|
|
1006
1022
|
currencySymbol: string;
|
|
1007
1023
|
tickerData?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAOpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;;;;;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
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc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YnC,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"}
|
|
@@ -175,10 +175,13 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
175
175
|
currencySymbol: z.ZodString;
|
|
176
176
|
copy: z.ZodObject<{
|
|
177
177
|
countLabel: z.ZodString;
|
|
178
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
178
179
|
}, "strip", z.ZodTypeAny, {
|
|
179
180
|
countLabel: string;
|
|
181
|
+
goalCopy?: string | undefined;
|
|
180
182
|
}, {
|
|
181
183
|
countLabel: string;
|
|
184
|
+
goalCopy?: string | undefined;
|
|
182
185
|
}>;
|
|
183
186
|
name: z.ZodEnum<["US", "AU", "global"]>;
|
|
184
187
|
tickerData: z.ZodOptional<z.ZodObject<{
|
|
@@ -195,6 +198,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
195
198
|
name: "global" | "US" | "AU";
|
|
196
199
|
copy: {
|
|
197
200
|
countLabel: string;
|
|
201
|
+
goalCopy?: string | undefined;
|
|
198
202
|
};
|
|
199
203
|
currencySymbol: string;
|
|
200
204
|
tickerData?: {
|
|
@@ -205,6 +209,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
205
209
|
name: "global" | "US" | "AU";
|
|
206
210
|
copy: {
|
|
207
211
|
countLabel: string;
|
|
212
|
+
goalCopy?: string | undefined;
|
|
208
213
|
};
|
|
209
214
|
currencySymbol: string;
|
|
210
215
|
tickerData?: {
|
|
@@ -515,6 +520,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
515
520
|
name: "global" | "US" | "AU";
|
|
516
521
|
copy: {
|
|
517
522
|
countLabel: string;
|
|
523
|
+
goalCopy?: string | undefined;
|
|
518
524
|
};
|
|
519
525
|
currencySymbol: string;
|
|
520
526
|
tickerData?: {
|
|
@@ -611,6 +617,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
611
617
|
name: "global" | "US" | "AU";
|
|
612
618
|
copy: {
|
|
613
619
|
countLabel: string;
|
|
620
|
+
goalCopy?: string | undefined;
|
|
614
621
|
};
|
|
615
622
|
currencySymbol: string;
|
|
616
623
|
tickerData?: {
|
|
@@ -722,6 +729,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
722
729
|
name: "global" | "US" | "AU";
|
|
723
730
|
copy: {
|
|
724
731
|
countLabel: string;
|
|
732
|
+
goalCopy?: string | undefined;
|
|
725
733
|
};
|
|
726
734
|
currencySymbol: string;
|
|
727
735
|
tickerData?: {
|
|
@@ -868,6 +876,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
868
876
|
name: "global" | "US" | "AU";
|
|
869
877
|
copy: {
|
|
870
878
|
countLabel: string;
|
|
879
|
+
goalCopy?: string | undefined;
|
|
871
880
|
};
|
|
872
881
|
currencySymbol: string;
|
|
873
882
|
tickerData?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQlD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9C,eAAO,MAAM,cAAc;;;;;;;;;;;;EAIzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,SAA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C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentEvent } from '@guardian/ophan-tracker-js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { SelectedAmountsVariant } from '../abTests';
|
|
4
4
|
import type { Prices } from '../prices';
|
|
@@ -110,7 +110,7 @@ export interface BannerProps {
|
|
|
110
110
|
countryCode?: string;
|
|
111
111
|
isSupporter?: boolean;
|
|
112
112
|
tickerSettings?: TickerSettings;
|
|
113
|
-
submitComponentEvent?: (componentEvent:
|
|
113
|
+
submitComponentEvent?: (componentEvent: ComponentEvent) => void;
|
|
114
114
|
articleCounts: ArticleCounts;
|
|
115
115
|
hasOptedOutOfArticleCount?: boolean;
|
|
116
116
|
fetchEmail?: () => Promise<string | null>;
|
|
@@ -332,10 +332,13 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
332
332
|
currencySymbol: z.ZodString;
|
|
333
333
|
copy: z.ZodObject<{
|
|
334
334
|
countLabel: z.ZodString;
|
|
335
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
335
336
|
}, "strip", z.ZodTypeAny, {
|
|
336
337
|
countLabel: string;
|
|
338
|
+
goalCopy?: string | undefined;
|
|
337
339
|
}, {
|
|
338
340
|
countLabel: string;
|
|
341
|
+
goalCopy?: string | undefined;
|
|
339
342
|
}>;
|
|
340
343
|
name: z.ZodEnum<["US", "AU", "global"]>;
|
|
341
344
|
tickerData: z.ZodOptional<z.ZodObject<{
|
|
@@ -352,6 +355,7 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
352
355
|
name: "global" | "US" | "AU";
|
|
353
356
|
copy: {
|
|
354
357
|
countLabel: string;
|
|
358
|
+
goalCopy?: string | undefined;
|
|
355
359
|
};
|
|
356
360
|
currencySymbol: string;
|
|
357
361
|
tickerData?: {
|
|
@@ -362,6 +366,7 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
362
366
|
name: "global" | "US" | "AU";
|
|
363
367
|
copy: {
|
|
364
368
|
countLabel: string;
|
|
369
|
+
goalCopy?: string | undefined;
|
|
365
370
|
};
|
|
366
371
|
currencySymbol: string;
|
|
367
372
|
tickerData?: {
|
|
@@ -857,6 +862,7 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
857
862
|
name: "global" | "US" | "AU";
|
|
858
863
|
copy: {
|
|
859
864
|
countLabel: string;
|
|
865
|
+
goalCopy?: string | undefined;
|
|
860
866
|
};
|
|
861
867
|
currencySymbol: string;
|
|
862
868
|
tickerData?: {
|
|
@@ -994,6 +1000,7 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
994
1000
|
name: "global" | "US" | "AU";
|
|
995
1001
|
copy: {
|
|
996
1002
|
countLabel: string;
|
|
1003
|
+
goalCopy?: string | undefined;
|
|
997
1004
|
};
|
|
998
1005
|
currencySymbol: string;
|
|
999
1006
|
tickerData?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,KAAK,EACR,aAAa,EACb,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACX,MAAM,UAAU,CAAC;AASlB,eAAO,MAAM,mBAAm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
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentEvent } from '@guardian/ophan-tracker-js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { EpicVariant } from '../abTests';
|
|
4
4
|
import type { ArticleCounts, Stage, Tracking } from './shared';
|
|
@@ -9,7 +9,7 @@ export interface EpicProps {
|
|
|
9
9
|
articleCounts: ArticleCounts;
|
|
10
10
|
onReminderOpen?: () => void;
|
|
11
11
|
fetchEmail?: () => Promise<string | null>;
|
|
12
|
-
submitComponentEvent?: (componentEvent:
|
|
12
|
+
submitComponentEvent?: (componentEvent: ComponentEvent) => void;
|
|
13
13
|
openCmp?: () => void;
|
|
14
14
|
hasConsentForArticleCount?: boolean;
|
|
15
15
|
stage?: Stage;
|
|
@@ -24,10 +24,13 @@ export declare const variantSchema: z.ZodObject<{
|
|
|
24
24
|
currencySymbol: z.ZodString;
|
|
25
25
|
copy: z.ZodObject<{
|
|
26
26
|
countLabel: z.ZodString;
|
|
27
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
27
28
|
}, "strip", z.ZodTypeAny, {
|
|
28
29
|
countLabel: string;
|
|
30
|
+
goalCopy?: string | undefined;
|
|
29
31
|
}, {
|
|
30
32
|
countLabel: string;
|
|
33
|
+
goalCopy?: string | undefined;
|
|
31
34
|
}>;
|
|
32
35
|
name: z.ZodEnum<["US", "AU", "global"]>;
|
|
33
36
|
tickerData: z.ZodOptional<z.ZodObject<{
|
|
@@ -44,6 +47,7 @@ export declare const variantSchema: z.ZodObject<{
|
|
|
44
47
|
name: "global" | "US" | "AU";
|
|
45
48
|
copy: {
|
|
46
49
|
countLabel: string;
|
|
50
|
+
goalCopy?: string | undefined;
|
|
47
51
|
};
|
|
48
52
|
currencySymbol: string;
|
|
49
53
|
tickerData?: {
|
|
@@ -54,6 +58,7 @@ export declare const variantSchema: z.ZodObject<{
|
|
|
54
58
|
name: "global" | "US" | "AU";
|
|
55
59
|
copy: {
|
|
56
60
|
countLabel: string;
|
|
61
|
+
goalCopy?: string | undefined;
|
|
57
62
|
};
|
|
58
63
|
currencySymbol: string;
|
|
59
64
|
tickerData?: {
|
|
@@ -364,6 +369,7 @@ export declare const variantSchema: z.ZodObject<{
|
|
|
364
369
|
name: "global" | "US" | "AU";
|
|
365
370
|
copy: {
|
|
366
371
|
countLabel: string;
|
|
372
|
+
goalCopy?: string | undefined;
|
|
367
373
|
};
|
|
368
374
|
currencySymbol: string;
|
|
369
375
|
tickerData?: {
|
|
@@ -460,6 +466,7 @@ export declare const variantSchema: z.ZodObject<{
|
|
|
460
466
|
name: "global" | "US" | "AU";
|
|
461
467
|
copy: {
|
|
462
468
|
countLabel: string;
|
|
469
|
+
goalCopy?: string | undefined;
|
|
463
470
|
};
|
|
464
471
|
currencySymbol: string;
|
|
465
472
|
tickerData?: {
|
|
@@ -558,10 +565,13 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
558
565
|
currencySymbol: z.ZodString;
|
|
559
566
|
copy: z.ZodObject<{
|
|
560
567
|
countLabel: z.ZodString;
|
|
568
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
561
569
|
}, "strip", z.ZodTypeAny, {
|
|
562
570
|
countLabel: string;
|
|
571
|
+
goalCopy?: string | undefined;
|
|
563
572
|
}, {
|
|
564
573
|
countLabel: string;
|
|
574
|
+
goalCopy?: string | undefined;
|
|
565
575
|
}>;
|
|
566
576
|
name: z.ZodEnum<["US", "AU", "global"]>;
|
|
567
577
|
tickerData: z.ZodOptional<z.ZodObject<{
|
|
@@ -578,6 +588,7 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
578
588
|
name: "global" | "US" | "AU";
|
|
579
589
|
copy: {
|
|
580
590
|
countLabel: string;
|
|
591
|
+
goalCopy?: string | undefined;
|
|
581
592
|
};
|
|
582
593
|
currencySymbol: string;
|
|
583
594
|
tickerData?: {
|
|
@@ -588,6 +599,7 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
588
599
|
name: "global" | "US" | "AU";
|
|
589
600
|
copy: {
|
|
590
601
|
countLabel: string;
|
|
602
|
+
goalCopy?: string | undefined;
|
|
591
603
|
};
|
|
592
604
|
currencySymbol: string;
|
|
593
605
|
tickerData?: {
|
|
@@ -898,6 +910,7 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
898
910
|
name: "global" | "US" | "AU";
|
|
899
911
|
copy: {
|
|
900
912
|
countLabel: string;
|
|
913
|
+
goalCopy?: string | undefined;
|
|
901
914
|
};
|
|
902
915
|
currencySymbol: string;
|
|
903
916
|
tickerData?: {
|
|
@@ -994,6 +1007,7 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
994
1007
|
name: "global" | "US" | "AU";
|
|
995
1008
|
copy: {
|
|
996
1009
|
countLabel: string;
|
|
1010
|
+
goalCopy?: string | undefined;
|
|
997
1011
|
};
|
|
998
1012
|
currencySymbol: string;
|
|
999
1013
|
tickerData?: {
|
|
@@ -1140,6 +1154,7 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
1140
1154
|
name: "global" | "US" | "AU";
|
|
1141
1155
|
copy: {
|
|
1142
1156
|
countLabel: string;
|
|
1157
|
+
goalCopy?: string | undefined;
|
|
1143
1158
|
};
|
|
1144
1159
|
currencySymbol: string;
|
|
1145
1160
|
tickerData?: {
|
|
@@ -1260,6 +1275,7 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
1260
1275
|
name: "global" | "US" | "AU";
|
|
1261
1276
|
copy: {
|
|
1262
1277
|
countLabel: string;
|
|
1278
|
+
goalCopy?: string | undefined;
|
|
1263
1279
|
};
|
|
1264
1280
|
currencySymbol: string;
|
|
1265
1281
|
tickerData?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/epic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/epic.ts"],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;;;;EAW1B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentEvent } from '@guardian/ophan-tracker-js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { Cta, Image, Tracking } from './shared';
|
|
4
4
|
export interface GutterContent {
|
|
@@ -78,7 +78,7 @@ export interface GutterProps {
|
|
|
78
78
|
content: GutterContent;
|
|
79
79
|
tracking: Tracking;
|
|
80
80
|
countryCode?: string;
|
|
81
|
-
submitComponentEvent?: (componentEvent:
|
|
81
|
+
submitComponentEvent?: (componentEvent: ComponentEvent) => void;
|
|
82
82
|
}
|
|
83
83
|
export declare const gutterPropsSchema: z.ZodObject<{
|
|
84
84
|
content: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gutter.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/gutter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"gutter.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/gutter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGrD,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC;CACb;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC;AAEH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,CAAC;CACnE;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentEvent } from '@guardian/ophan-tracker-js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { Cta, Tracking } from './shared';
|
|
4
4
|
export interface HeaderContent {
|
|
@@ -62,7 +62,7 @@ export interface HeaderProps {
|
|
|
62
62
|
tracking: Tracking;
|
|
63
63
|
mobileContent?: HeaderContent;
|
|
64
64
|
countryCode?: string;
|
|
65
|
-
submitComponentEvent?: (componentEvent:
|
|
65
|
+
submitComponentEvent?: (componentEvent: ComponentEvent) => void;
|
|
66
66
|
numArticles?: number;
|
|
67
67
|
}
|
|
68
68
|
export declare const headerPropsSchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,CAAC;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO5B,CAAC"}
|
|
@@ -93,13 +93,17 @@ export declare const secondaryCtaSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
93
93
|
}>]>;
|
|
94
94
|
interface TickerCopy {
|
|
95
95
|
countLabel: string;
|
|
96
|
+
goalCopy?: string;
|
|
96
97
|
}
|
|
97
98
|
export declare const tickerCopySchema: z.ZodObject<{
|
|
98
99
|
countLabel: z.ZodString;
|
|
100
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
99
101
|
}, "strip", z.ZodTypeAny, {
|
|
100
102
|
countLabel: string;
|
|
103
|
+
goalCopy?: string | undefined;
|
|
101
104
|
}, {
|
|
102
105
|
countLabel: string;
|
|
106
|
+
goalCopy?: string | undefined;
|
|
103
107
|
}>;
|
|
104
108
|
export interface TickerData {
|
|
105
109
|
total: number;
|
|
@@ -126,10 +130,13 @@ export declare const tickerSettingsSchema: z.ZodObject<{
|
|
|
126
130
|
currencySymbol: z.ZodString;
|
|
127
131
|
copy: z.ZodObject<{
|
|
128
132
|
countLabel: z.ZodString;
|
|
133
|
+
goalCopy: z.ZodOptional<z.ZodString>;
|
|
129
134
|
}, "strip", z.ZodTypeAny, {
|
|
130
135
|
countLabel: string;
|
|
136
|
+
goalCopy?: string | undefined;
|
|
131
137
|
}, {
|
|
132
138
|
countLabel: string;
|
|
139
|
+
goalCopy?: string | undefined;
|
|
133
140
|
}>;
|
|
134
141
|
name: z.ZodEnum<["US", "AU", "global"]>;
|
|
135
142
|
tickerData: z.ZodOptional<z.ZodObject<{
|
|
@@ -146,6 +153,7 @@ export declare const tickerSettingsSchema: z.ZodObject<{
|
|
|
146
153
|
name: "global" | "US" | "AU";
|
|
147
154
|
copy: {
|
|
148
155
|
countLabel: string;
|
|
156
|
+
goalCopy?: string | undefined;
|
|
149
157
|
};
|
|
150
158
|
currencySymbol: string;
|
|
151
159
|
tickerData?: {
|
|
@@ -156,6 +164,7 @@ export declare const tickerSettingsSchema: z.ZodObject<{
|
|
|
156
164
|
name: "global" | "US" | "AU";
|
|
157
165
|
copy: {
|
|
158
166
|
countLabel: string;
|
|
167
|
+
goalCopy?: string | undefined;
|
|
159
168
|
};
|
|
160
169
|
currencySymbol: string;
|
|
161
170
|
tickerData?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE5C,MAAM,WA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,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,mGAK7B,CAAC;AAEH,eAAO,MAAM,wBAAwB,sJAMnC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC;AAEnD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWzB,CAAC;AAEH,MAAM,WAAW,KAAK;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAQtB,CAAC;AAEH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/support-dotcom-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Service to serve Reader Revenue components to dotcom",
|
|
5
5
|
"repository": "github:guardian/support-dotcom-components",
|
|
6
6
|
"author": "The Guardian",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@changesets/cli": "^2.26.2",
|
|
18
18
|
"@guardian/eslint-config": "^11.0.0",
|
|
19
19
|
"@guardian/node-riffraff-artifact": "^0.3.2",
|
|
20
|
-
"@guardian/prettier": "^
|
|
20
|
+
"@guardian/prettier": "^8.0.1",
|
|
21
21
|
"@rollup/plugin-alias": "^3.1.1",
|
|
22
22
|
"@rollup/plugin-babel": "^5.1.0",
|
|
23
23
|
"@rollup/plugin-commonjs": "^14.0.0",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@guardian/libs": "22.0.1",
|
|
63
|
+
"@guardian/ophan-tracker-js": "2.2.10",
|
|
63
64
|
"aws-sdk": "^2.862.0",
|
|
64
65
|
"compression": "1.7.4",
|
|
65
66
|
"cors": "^2.8.5",
|