@economist/web-apple-pay 2.0.0-beta.3 → 2.0.0-beta.5

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.
@@ -0,0 +1,212 @@
1
+ // src/data/price-zones.json
2
+ var price_zones_default = {
3
+ "AS-AS": [
4
+ "BD",
5
+ "BT",
6
+ "CK",
7
+ "FJ",
8
+ "ID",
9
+ "KH",
10
+ "KI",
11
+ "LA",
12
+ "LK",
13
+ "MH",
14
+ "MM",
15
+ "MN",
16
+ "MV",
17
+ "NC",
18
+ "NF",
19
+ "NP",
20
+ "NR",
21
+ "PF",
22
+ "PG",
23
+ "PK",
24
+ "PW",
25
+ "SB",
26
+ "TH",
27
+ "TL",
28
+ "TO",
29
+ "TV",
30
+ "VN",
31
+ "VU",
32
+ "WS"
33
+ ],
34
+ "AS-AU": ["AU"],
35
+ "AS-CN": ["CN"],
36
+ "AS-HK": ["HK", "MO"],
37
+ "AS-IN": ["IN"],
38
+ "AS-JP": ["JP"],
39
+ "AS-KR": ["KR"],
40
+ "AS-MY": ["MY"],
41
+ "AS-NZ": ["NZ"],
42
+ "AS-PH": ["PH"],
43
+ "AS-SG": ["BN", "SG"],
44
+ "AS-TW": ["TW"],
45
+ "CE-AF": [
46
+ "DZ",
47
+ "AO",
48
+ "BJ",
49
+ "BW",
50
+ "BF",
51
+ "BI",
52
+ "CM",
53
+ "CV",
54
+ "CF",
55
+ "TD",
56
+ "CG",
57
+ "CD",
58
+ "CI",
59
+ "DJ",
60
+ "EG",
61
+ "GQ",
62
+ "ER",
63
+ "ET",
64
+ "GA",
65
+ "GM",
66
+ "GH",
67
+ "GN",
68
+ "GW",
69
+ "IL",
70
+ "JO",
71
+ "KE",
72
+ "LB",
73
+ "LS",
74
+ "LR",
75
+ "LY",
76
+ "MG",
77
+ "MW",
78
+ "ML",
79
+ "MR",
80
+ "MU",
81
+ "MA",
82
+ "MZ",
83
+ "NA",
84
+ "NE",
85
+ "NG",
86
+ "PS",
87
+ "RE",
88
+ "RW",
89
+ "ST",
90
+ "SN",
91
+ "SC",
92
+ "SL",
93
+ "ZA",
94
+ "SZ",
95
+ "TZ",
96
+ "TG",
97
+ "TN",
98
+ "UG",
99
+ "ZM",
100
+ "ZW"
101
+ ],
102
+ "CE-CH": ["LI", "CH"],
103
+ "CE-DK": ["FO", "GL", "DK"],
104
+ "CE-EU": [
105
+ "AL",
106
+ "AD",
107
+ "AM",
108
+ "AT",
109
+ "AZ",
110
+ "BY",
111
+ "BE",
112
+ "BA",
113
+ "BG",
114
+ "HR",
115
+ "CY",
116
+ "CZ",
117
+ "EE",
118
+ "FI",
119
+ "FR",
120
+ "GE",
121
+ "DE",
122
+ "GI",
123
+ "GR",
124
+ "HU",
125
+ "IS",
126
+ "IE",
127
+ "IT",
128
+ "KZ",
129
+ "XK",
130
+ "KG",
131
+ "LV",
132
+ "LT",
133
+ "LU",
134
+ "MT",
135
+ "MD",
136
+ "MC",
137
+ "ME",
138
+ "NL",
139
+ "PL",
140
+ "PT",
141
+ "MK",
142
+ "RO",
143
+ "RS",
144
+ "SK",
145
+ "SI",
146
+ "ES",
147
+ "TJ",
148
+ "TR",
149
+ "TM",
150
+ "UA",
151
+ "UZ"
152
+ ],
153
+ "CE-ME": ["AE", "BH", "KW", "OM", "QA", "SA"],
154
+ "CE-NO": ["NO"],
155
+ "CE-SE": ["SE"],
156
+ "LA-LA": [
157
+ "AI",
158
+ "AG",
159
+ "AR",
160
+ "AW",
161
+ "BS",
162
+ "BB",
163
+ "BZ",
164
+ "BM",
165
+ "BO",
166
+ "BR",
167
+ "KY",
168
+ "CL",
169
+ "CO",
170
+ "CR",
171
+ "DM",
172
+ "DO",
173
+ "EC",
174
+ "SV",
175
+ "FK",
176
+ "GF",
177
+ "GD",
178
+ "GT",
179
+ "GY",
180
+ "HT",
181
+ "HN",
182
+ "JM",
183
+ "MQ",
184
+ "MX",
185
+ "MS",
186
+ "NI",
187
+ "MP",
188
+ "PA",
189
+ "PY",
190
+ "PE",
191
+ "KN",
192
+ "LC",
193
+ "VC",
194
+ "SR",
195
+ "TT",
196
+ "TC",
197
+ "UY",
198
+ "VG",
199
+ "VI"
200
+ ],
201
+ "NA-CA": ["CA"],
202
+ "NA-US": ["AS", "GU", "FM", "PR", "US"],
203
+ "UK-UK": ["GB"]
204
+ };
205
+
206
+ // src/utils/price-zones.ts
207
+ var priceZones = price_zones_default;
208
+ var getZoneByCountry = (country) => Object.keys(priceZones).find((key) => priceZones[key].includes(country)) ?? null;
209
+ export {
210
+ getZoneByCountry,
211
+ priceZones
212
+ };
@@ -0,0 +1,5 @@
1
+ import type { ProductVariant } from '../types/offer.types';
2
+ /** Variants whose purchase needs a delivery address (collected from the Apple Pay sheet). */
3
+ export declare const PRINT_VARIANTS: readonly ProductVariant[];
4
+ /** Whether a product variant is a print variant. Single source for the button and the billing countries. */
5
+ export declare const isPrintVariant: (variant: string | undefined) => boolean;
@@ -0,0 +1,10 @@
1
+ // src/utils/print-variants.ts
2
+ var PRINT_VARIANTS = [
3
+ "bundle",
4
+ "insider_print"
5
+ ];
6
+ var isPrintVariant = (variant) => PRINT_VARIANTS.includes(variant ?? "");
7
+ export {
8
+ PRINT_VARIANTS,
9
+ isPrintVariant
10
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@economist/web-apple-pay",
3
3
  "description": "Web component package for Apple Pay checkout UI",
4
- "version": "2.0.0-beta.3",
4
+ "version": "2.0.0-beta.5",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",