@economist/web-apple-pay 2.0.0-beta.2 → 2.0.0-beta.4
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/README.md +20 -12
- package/dist/index.js +681 -361
- package/dist/src/apple-pay-button.d.ts +18 -16
- package/dist/src/apple-pay-button.js +670 -352
- package/dist/src/apple-pay-button.stories.js +667 -351
- package/dist/src/apple-pay-modal.js +44 -39
- package/dist/src/apple-pay-modal.stories.js +667 -351
- package/dist/src/clients/payment-checkout/apple-session.d.ts +14 -1
- package/dist/src/clients/payment-checkout/apple-session.js +66 -17
- package/dist/src/clients/payment-checkout/billing-contact-details.js +43 -0
- package/dist/src/clients/payment-checkout/delivery-contact-details.d.ts +16 -0
- package/dist/src/clients/payment-checkout/delivery-contact-details.js +397 -0
- package/dist/src/clients/payment-checkout/detects.d.ts +5 -0
- package/dist/src/clients/payment-checkout/detects.js +18 -14
- package/dist/src/clients/payment-checkout/messages.d.ts +6 -0
- package/dist/src/clients/payment-checkout/messages.js +7 -1
- package/dist/src/clients/payment-checkout/payment-handler.d.ts +10 -1
- package/dist/src/clients/payment-checkout/payment-handler.js +414 -36
- package/dist/src/clients/payment-checkout/session.js +13 -1
- package/dist/src/clients/payment-checkout/types.d.ts +11 -0
- package/dist/src/constants.d.ts +7 -28
- package/dist/src/constants.js +3 -7
- package/dist/src/index.d.ts +2 -4
- package/dist/src/index.js +681 -361
- package/dist/src/types/offer.types.d.ts +1 -1
- package/dist/src/utils/address-rules.d.ts +29 -0
- package/dist/src/utils/address-rules.js +260 -0
- package/dist/src/utils/addressParityFlag.d.ts +13 -0
- package/dist/src/utils/addressParityFlag.js +5 -0
- package/dist/src/utils/applePayExpressEligibility.d.ts +5 -6
- package/dist/src/utils/applePayExpressEligibility.js +2 -2
- package/dist/src/utils/billing-countries.js +46 -37
- package/dist/src/utils/buttonCopyFlag.d.ts +22 -0
- package/dist/src/utils/buttonCopyFlag.js +12 -0
- package/dist/src/utils/delivery-countries.d.ts +9 -0
- package/dist/src/utils/delivery-countries.js +255 -0
- package/dist/src/utils/expressCheckoutRedirect.d.ts +20 -2
- package/dist/src/utils/expressCheckoutRedirect.js +13 -1
- package/dist/src/utils/expressCheckoutTracking.d.ts +13 -20
- package/dist/src/utils/expressCheckoutTracking.js +22 -37
- package/dist/src/utils/latin-characters.d.ts +3 -0
- package/dist/src/utils/latin-characters.js +10 -0
- package/dist/src/utils/price-zones.d.ts +7 -0
- package/dist/src/utils/price-zones.js +212 -0
- package/dist/src/utils/print-variants.d.ts +5 -0
- package/dist/src/utils/print-variants.js +10 -0
- package/dist/src/utils/printOffersFlag.d.ts +11 -0
- package/dist/src/utils/printOffersFlag.js +5 -0
- package/dist/src/utils/recaptcha.d.ts +3 -2
- package/dist/src/utils/recaptcha.js +17 -8
- package/package.json +1 -1
- package/dist/src/apple-pay-logo.d.ts +0 -1
- package/dist/src/apple-pay-logo.js +0 -14
- package/dist/src/types/experiment-integration.d.js +0 -0
- package/dist/src/utils/getExperimentKeyFromNextData.d.ts +0 -8
- package/dist/src/utils/getExperimentKeyFromNextData.js +0 -9
|
@@ -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,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature flag for Apple Pay on print offers (`bundle`, `insider_print`).
|
|
3
|
+
*
|
|
4
|
+
* `false` (default): print offers are excluded on every entry point, exactly as before this feature existed, so
|
|
5
|
+
* releasing the package and bumping it on any surface changes nothing.
|
|
6
|
+
* `true`: entry points that opt in (`allowsPrintOffers` in `ENTRY_POINT_CONFIG`, currently only SUBSCRIBE)
|
|
7
|
+
* offer Apple Pay for print, collecting the delivery address from the Apple Pay sheet.
|
|
8
|
+
*
|
|
9
|
+
* Flip this constant in a release to turn the feature on. Deploy the wallet-payments-api delivery change first.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PRINT_OFFERS_ENABLED = true;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* reCAPTCHA v3 token acquisition.
|
|
3
3
|
*
|
|
4
|
-
* Dynamically injects the Google reCAPTCHA script loader
|
|
5
|
-
*
|
|
4
|
+
* Dynamically injects the Google reCAPTCHA script loader for this package's
|
|
5
|
+
* site key. Another reCAPTCHA script on the page (e.g. the host's own key) is
|
|
6
|
+
* not reused, because it does not register our key.
|
|
6
7
|
*
|
|
7
8
|
* The site key is provided at runtime via configureApplePay({ recaptchaSiteKey }).
|
|
8
9
|
*/
|
|
@@ -3,15 +3,21 @@ var runtimeConfig = null;
|
|
|
3
3
|
var getApplePayConfig = () => runtimeConfig;
|
|
4
4
|
|
|
5
5
|
// src/utils/recaptcha.ts
|
|
6
|
+
var findScriptForKey = (siteKey) => Array.from(
|
|
7
|
+
document.querySelectorAll(
|
|
8
|
+
'script[src*="recaptcha/api.js"]'
|
|
9
|
+
)
|
|
10
|
+
).find((script) => script.src.includes(`render=${siteKey}`));
|
|
11
|
+
var pendingLoads = /* @__PURE__ */ new Map();
|
|
6
12
|
var loadRecaptchaScript = (siteKey) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const pending = pendingLoads.get(siteKey);
|
|
14
|
+
if (pending) return pending;
|
|
15
|
+
const ownScript = findScriptForKey(siteKey);
|
|
16
|
+
if (ownScript && typeof grecaptcha !== "undefined") return Promise.resolve();
|
|
17
|
+
const load = new Promise((resolve, reject) => {
|
|
18
|
+
if (ownScript) {
|
|
19
|
+
ownScript.addEventListener("load", () => resolve());
|
|
20
|
+
ownScript.addEventListener("error", () => {
|
|
15
21
|
reject(new Error("Failed to load existing reCAPTCHA script"));
|
|
16
22
|
});
|
|
17
23
|
return;
|
|
@@ -26,6 +32,9 @@ var loadRecaptchaScript = (siteKey) => {
|
|
|
26
32
|
};
|
|
27
33
|
document.head.appendChild(script);
|
|
28
34
|
});
|
|
35
|
+
pendingLoads.set(siteKey, load);
|
|
36
|
+
load.catch(() => pendingLoads.delete(siteKey));
|
|
37
|
+
return load;
|
|
29
38
|
};
|
|
30
39
|
var getRecaptchaToken = async (action) => {
|
|
31
40
|
const siteKey = getApplePayConfig()?.recaptchaSiteKey;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ensureApplePayLogoSymbol(): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/apple-pay-logo.ts
|
|
2
|
-
var LOGO_DEFS_ID = "apple-pay-logo-defs";
|
|
3
|
-
var LOGO_PATH = "M10.2651 4.21143C10.4299 4.21143 10.7106 4.23763 11.1074 4.29004C11.5042 4.34245 11.9385 4.49219 12.4102 4.73926C12.8893 4.97884 13.3236 5.37939 13.7129 5.94092C13.6904 5.96338 13.5819 6.04574 13.3872 6.18799C13.1925 6.32275 12.9754 6.5249 12.7358 6.79443C12.4963 7.05648 12.2866 7.39339 12.1069 7.80518C11.9272 8.20947 11.8374 8.69238 11.8374 9.25391C11.8374 9.89779 11.9497 10.4443 12.1743 10.8936C12.4064 11.3428 12.6722 11.7059 12.9717 11.9829C13.2786 12.2524 13.5482 12.4508 13.7803 12.5781C14.0199 12.7054 14.1471 12.7728 14.1621 12.7803C14.1546 12.8102 14.0573 13.076 13.8701 13.5776C13.6904 14.0793 13.391 14.637 12.9717 15.251C12.6048 15.7826 12.208 16.2729 11.7812 16.7222C11.362 17.1714 10.8566 17.396 10.2651 17.396C9.86833 17.396 9.54264 17.3398 9.28809 17.2275C9.03353 17.1077 8.77148 16.9917 8.50195 16.8794C8.23242 16.7596 7.8693 16.6997 7.4126 16.6997C6.97087 16.6997 6.60026 16.7596 6.30078 16.8794C6.00879 16.9992 5.72803 17.119 5.4585 17.2388C5.19645 17.3586 4.88574 17.4185 4.52637 17.4185C3.97982 17.4185 3.50065 17.2013 3.08887 16.7671C2.67708 16.3328 2.25407 15.8125 1.81982 15.2061C1.3182 14.4873 0.887695 13.6113 0.52832 12.5781C0.176432 11.5374 0.000488281 10.4893 0.000488281 9.43359C0.000488281 8.30306 0.213867 7.35596 0.640625 6.59229C1.06738 5.82113 1.61393 5.24089 2.28027 4.85156C2.9541 4.45475 3.65039 4.25635 4.36914 4.25635C4.75098 4.25635 5.11035 4.31999 5.44727 4.44727C5.78418 4.56706 6.09863 4.69059 6.39062 4.81787C6.6901 4.94515 6.95964 5.00879 7.19922 5.00879C7.43132 5.00879 7.70085 4.94141 8.00781 4.80664C8.31478 4.67188 8.65918 4.54085 9.04102 4.41357C9.42285 4.27881 9.83089 4.21143 10.2651 4.21143ZM9.64746 2.78516C9.35547 3.13704 8.98861 3.43278 8.54688 3.67236C8.10514 3.90446 7.68587 4.02051 7.28906 4.02051C7.20671 4.02051 7.12809 4.01302 7.05322 3.99805C7.04574 3.97559 7.03825 3.93441 7.03076 3.87451C7.02327 3.81462 7.01953 3.75098 7.01953 3.68359C7.01953 3.23438 7.11686 2.80013 7.31152 2.38086C7.50618 1.9541 7.72705 1.60221 7.97412 1.3252C8.28857 0.950846 8.68538 0.640137 9.16455 0.393066C9.64372 0.145996 10.1004 0.014974 10.5347 0C10.5571 0.0973307 10.5684 0.213379 10.5684 0.348145C10.5684 0.797363 10.4823 1.23535 10.3101 1.66211C10.1379 2.08138 9.91699 2.45573 9.64746 2.78516ZM17.6885 11.5112V9.71436H22.0459C23.2064 9.71436 24.1048 9.41488 24.7412 8.81592C25.3776 8.20947 25.6958 7.37467 25.6958 6.31152V6.28906C25.6958 5.21842 25.3776 4.38363 24.7412 3.78467C24.1048 3.18571 23.2064 2.88623 22.0459 2.88623H17.6885V1.08936H22.5625C23.5807 1.08936 24.4792 1.30648 25.2578 1.74072C26.0365 2.17497 26.6466 2.78141 27.0884 3.56006C27.5376 4.3387 27.7622 5.24089 27.7622 6.2666V6.28906C27.7622 7.31478 27.5376 8.2207 27.0884 9.00684C26.6466 9.79297 26.0365 10.4069 25.2578 10.8486C24.4792 11.2904 23.5807 11.5112 22.5625 11.5112H17.6885ZM16.6777 17.2949V1.08936H18.6992V17.2949H16.6777ZM32.6699 17.5195C31.9062 17.5195 31.2249 17.3735 30.626 17.0815C30.0345 16.7896 29.5703 16.3778 29.2334 15.8462C28.904 15.3071 28.7393 14.682 28.7393 13.9707V13.9482C28.7393 13.2594 28.9077 12.668 29.2446 12.1738C29.5815 11.6797 30.0682 11.2904 30.7046 11.0059C31.3485 10.7139 32.1234 10.5417 33.0293 10.4893L37.3979 10.2422V11.7695L33.2539 12.0278C32.4303 12.0728 31.8052 12.2599 31.3784 12.5894C30.9517 12.9188 30.7383 13.3643 30.7383 13.9258V13.9482C30.7383 14.5322 30.9554 14.9927 31.3896 15.3296C31.8239 15.659 32.3929 15.8237 33.0967 15.8237C33.7331 15.8237 34.2983 15.6927 34.7925 15.4307C35.2941 15.1686 35.6909 14.813 35.9829 14.3638C36.2749 13.9071 36.4209 13.3979 36.4209 12.8364V9.27637C36.4209 8.55762 36.1963 7.99609 35.7471 7.5918C35.2979 7.1875 34.6502 6.98535 33.8042 6.98535C33.063 6.98535 32.4603 7.13883 31.9961 7.4458C31.5394 7.74528 31.2474 8.14958 31.1201 8.65869L31.0977 8.7373H29.1885L29.1997 8.625C29.2746 7.98861 29.5067 7.41585 29.896 6.90674C30.2928 6.39762 30.8244 5.99707 31.4907 5.70508C32.1646 5.4056 32.9469 5.25586 33.8379 5.25586C34.7812 5.25586 35.5898 5.41683 36.2637 5.73877C36.945 6.05322 37.4653 6.50244 37.8247 7.08643C38.1916 7.66292 38.375 8.35173 38.375 9.15283V17.2949H36.4209V15.4307H36.3311C36.0915 15.8574 35.7845 16.228 35.4102 16.5425C35.0433 16.8569 34.6278 17.1003 34.1636 17.2725C33.6994 17.4372 33.2015 17.5195 32.6699 17.5195ZM42.1484 21.3267C41.9837 21.3267 41.8115 21.3192 41.6318 21.3042C41.4521 21.2892 41.2987 21.2705 41.1714 21.248V19.6421C41.2612 19.6646 41.366 19.6795 41.4858 19.687C41.6056 19.702 41.7292 19.7095 41.8564 19.7095C42.4554 19.7095 42.9383 19.5897 43.3052 19.3501C43.672 19.1105 43.9678 18.6576 44.1924 17.9912L44.4282 17.3062L40.0371 5.48047H42.126L45.6187 15.981L45.0796 15.2734H45.7759L45.248 15.981L48.7407 5.48047H50.7959L46.1802 18.0249C45.8807 18.826 45.555 19.4661 45.2031 19.9453C44.8512 20.432 44.432 20.7839 43.9453 21.001C43.4587 21.2181 42.8597 21.3267 42.1484 21.3267Z";
|
|
4
|
-
function ensureApplePayLogoSymbol() {
|
|
5
|
-
if (document.getElementById(LOGO_DEFS_ID)) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
const tmp = document.createElement("div");
|
|
9
|
-
tmp.innerHTML = `<svg aria-hidden="true" style="display:none" id="${LOGO_DEFS_ID}"><defs><symbol id="apple-pay-logo" viewBox="0 0 51 22"><path d="${LOGO_PATH}" fill="currentColor"/></symbol></defs></svg>`;
|
|
10
|
-
document.body.prepend(tmp.firstElementChild);
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
ensureApplePayLogoSymbol
|
|
14
|
-
};
|
|
File without changes
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reads Amplitude experiment run key from Engagement SSR page props.
|
|
3
|
-
*
|
|
4
|
-
* Engagement already stores full fetchVariants entries on
|
|
5
|
-
* `window.__NEXT_DATA__.props.pageProps.experiments` (including
|
|
6
|
-
* `metadata.experimentKey`). Avoids extending the CDN bridge API.
|
|
7
|
-
*/
|
|
8
|
-
export declare const getExperimentKeyFromNextData: (flagKey: string) => string | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/utils/getExperimentKeyFromNextData.ts
|
|
2
|
-
var getExperimentKeyFromNextData = (flagKey) => {
|
|
3
|
-
const experiments = window.__NEXT_DATA__?.props?.pageProps?.experiments;
|
|
4
|
-
const experimentKey = experiments?.[flagKey]?.metadata?.experimentKey;
|
|
5
|
-
return typeof experimentKey === "string" ? experimentKey : void 0;
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
getExperimentKeyFromNextData
|
|
9
|
-
};
|