@paystack/inline-js 2.27.0-dev.3 → 2.27.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/inline.js CHANGED
@@ -1,2674 +1 @@
1
- var PaystackPop = (function () {
2
- 'use strict';
3
-
4
- function _arrayLikeToArray(r, a) {
5
- (null == a || a > r.length) && (a = r.length);
6
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
7
- return n;
8
- }
9
- function _arrayWithHoles(r) {
10
- if (Array.isArray(r)) return r;
11
- }
12
- function _arrayWithoutHoles(r) {
13
- if (Array.isArray(r)) return _arrayLikeToArray(r);
14
- }
15
- function _classCallCheck(a, n) {
16
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
17
- }
18
- function _defineProperties(e, r) {
19
- for (var t = 0; t < r.length; t++) {
20
- var o = r[t];
21
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
22
- }
23
- }
24
- function _createClass(e, r, t) {
25
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
26
- writable: !1
27
- }), e;
28
- }
29
- function _defineProperty(e, r, t) {
30
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
31
- value: t,
32
- enumerable: !0,
33
- configurable: !0,
34
- writable: !0
35
- }) : e[r] = t, e;
36
- }
37
- function _iterableToArray(r) {
38
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
39
- }
40
- function _iterableToArrayLimit(r, l) {
41
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
42
- if (null != t) {
43
- var e,
44
- n,
45
- i,
46
- u,
47
- a = [],
48
- f = !0,
49
- o = !1;
50
- try {
51
- if (i = (t = t.call(r)).next, 0 === l) {
52
- if (Object(t) !== t) return;
53
- f = !1;
54
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
55
- } catch (r) {
56
- o = !0, n = r;
57
- } finally {
58
- try {
59
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
60
- } finally {
61
- if (o) throw n;
62
- }
63
- }
64
- return a;
65
- }
66
- }
67
- function _nonIterableRest() {
68
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
69
- }
70
- function _nonIterableSpread() {
71
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
72
- }
73
- function ownKeys(e, r) {
74
- var t = Object.keys(e);
75
- if (Object.getOwnPropertySymbols) {
76
- var o = Object.getOwnPropertySymbols(e);
77
- r && (o = o.filter(function (r) {
78
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
79
- })), t.push.apply(t, o);
80
- }
81
- return t;
82
- }
83
- function _objectSpread2(e) {
84
- for (var r = 1; r < arguments.length; r++) {
85
- var t = null != arguments[r] ? arguments[r] : {};
86
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
87
- _defineProperty(e, r, t[r]);
88
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
89
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
90
- });
91
- }
92
- return e;
93
- }
94
- function _objectWithoutProperties(e, t) {
95
- if (null == e) return {};
96
- var o,
97
- r,
98
- i = _objectWithoutPropertiesLoose(e, t);
99
- if (Object.getOwnPropertySymbols) {
100
- var n = Object.getOwnPropertySymbols(e);
101
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
102
- }
103
- return i;
104
- }
105
- function _objectWithoutPropertiesLoose(r, e) {
106
- if (null == r) return {};
107
- var t = {};
108
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
109
- if (-1 !== e.indexOf(n)) continue;
110
- t[n] = r[n];
111
- }
112
- return t;
113
- }
114
- function _slicedToArray(r, e) {
115
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
116
- }
117
- function _toConsumableArray(r) {
118
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
119
- }
120
- function _toPrimitive(t, r) {
121
- if ("object" != typeof t || !t) return t;
122
- var e = t[Symbol.toPrimitive];
123
- if (void 0 !== e) {
124
- var i = e.call(t, r || "default");
125
- if ("object" != typeof i) return i;
126
- throw new TypeError("@@toPrimitive must return a primitive value.");
127
- }
128
- return ("string" === r ? String : Number)(t);
129
- }
130
- function _toPropertyKey(t) {
131
- var i = _toPrimitive(t, "string");
132
- return "symbol" == typeof i ? i : i + "";
133
- }
134
- function _typeof(o) {
135
- "@babel/helpers - typeof";
136
-
137
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
138
- return typeof o;
139
- } : function (o) {
140
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
141
- }, _typeof(o);
142
- }
143
- function _unsupportedIterableToArray(r, a) {
144
- if (r) {
145
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
146
- var t = {}.toString.call(r).slice(8, -1);
147
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
148
- }
149
- }
150
-
151
- var baseConfig = {
152
- cookieTestUrl: 'https://legacy-staging.paystack.co/test-iframe/start.html',
153
- publishableKey: 'uFmz/uE/SDT6GupOrSEXIZXGByjQ0zFkPyc9LqKHFqnTI0WPN3JS5kQPo/j9or0TOXlqMQj2lzHn/UGsQT4XeQ==',
154
- publicKey: '-----BEGIN PUBLIC KEY-----' + '\r\n' + 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALhZs/7hP0g0+hrqTq0hFyGVxgco0NMx' + '\r\n' + 'ZD8nPS6ihxap0yNFjzdyUuZED6P4/aK9Ezl5ajEI9pcx5/1BrEE+F3kCAwEAAQ==' + '\r\n' + '-----END PUBLIC KEY-----',
155
- applePayVersion: 6,
156
- applePayValidateSessionPath: 'applepay/validate-session/',
157
- applePayChargePath: 'applepay/charge',
158
- googlePayChargePath: 'googlepay/charge'
159
- };
160
- var devConfig = _objectSpread2(_objectSpread2({}, baseConfig), {}, {
161
- environment: 'dev',
162
- checkoutUrl: 'http://localhost:8081/',
163
- paymentBaseUrl: 'https://legacy-staging.paystack.co/',
164
- paystackApiUrl: 'https://studio-api.paystack.co/',
165
- siteUrl: 'https://paystack.com',
166
- pusherKey: '1c7b262ee18455815893',
167
- pusherUrl: 'http://localhost:8081/static/vendor/pusher.min.js'
168
- });
169
- var stagingConfig = _objectSpread2(_objectSpread2({}, baseConfig), {}, {
170
- environment: 'staging',
171
- checkoutUrl: 'https://checkout-studio.paystack.com/',
172
- paymentBaseUrl: 'https://legacy-staging.paystack.co/',
173
- paystackApiUrl: 'https://studio-api.paystack.co/',
174
- siteUrl: 'https://beta.paystack.com',
175
- pusherKey: '1c7b262ee18455815893',
176
- pusherUrl: 'https://checkout-studio.paystack.com/static/vendor/pusher.min.js'
177
- });
178
- var productionConfig = _objectSpread2(_objectSpread2({}, baseConfig), {}, {
179
- environment: 'production',
180
- checkoutUrl: 'https://checkout.paystack.com/',
181
- paymentBaseUrl: 'https://standard.paystack.co/',
182
- paystackApiUrl: 'https://api.paystack.co/',
183
- siteUrl: 'https://paystack.com',
184
- pusherKey: '8e4b9b7ca3418bd5cdc8',
185
- pusherUrl: 'https://checkout.paystack.com/static/vendor/pusher.min.js'
186
- });
187
- var configurations = {
188
- dev: devConfig,
189
- staging: stagingConfig,
190
- production: productionConfig
191
- };
192
-
193
- /* eslint-disable */
194
- var config = configurations['staging'] || stagingConfig;
195
-
196
- function randomId() {
197
- var text = '';
198
- var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
199
- for (var i = 0; i < 5; i += 1) {
200
- text += possible.charAt(Math.floor(Math.random() * possible.length));
201
- }
202
- return text;
203
- }
204
-
205
- function serialize(obj, prefix) {
206
- var queryString = [];
207
- Object.keys(obj).forEach(function (key) {
208
- var updatedKey = prefix ? "".concat(prefix, "[").concat(key, "]") : key;
209
- var value = obj[updatedKey];
210
- queryString.push(value !== null && (typeof v === "undefined" ? "undefined" : _typeof(v)) === 'object' ? serialize(value, updatedKey) : "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value)));
211
- });
212
- return queryString.join('&');
213
- }
214
-
215
- function parseResponse(message) {
216
- var action = message && typeof message === 'string' ? message.split(' ')[0] : null;
217
- var data = action ? message.split(' ').slice(2).join(' ') : null;
218
- return {
219
- action: action,
220
- data: data
221
- };
222
- }
223
-
224
- function similarObjects(o1, o2) {
225
- var equalKeys = Object.keys(o1).sort().join('') === Object.keys(o2).sort().join('');
226
- var equalValues = Object.values(o1).sort().join('') === Object.values(o2).sort().join('');
227
- return equalKeys && equalValues;
228
- }
229
-
230
- var APPLE_PAY_SDK_SOURCE = 'https://applepay.cdn-apple.com/jsapi/v1.3.8/apple-pay-sdk.js';
231
- var APPLE_PAY_SDK_INTEGRITY_HASH = 'sha384-u/9mOkmShCO0v+dqCAZFhiutJuORfzvuyM5i+676iy7mLSWS6rlllHrIt15f/mqH';
232
- var APPLE_PAY_TIMEOUT_MS = 10000;
233
- var GOOGLE_PAY_SDK_SOURCE = 'https://pay.google.com/gp/p/js/pay.js';
234
- var PAYMENT_REQUEST_BUTTON_HEIGHT = '50px';
235
- var GOOGLE_PAY_BUTTON_RADIUS = 3;
236
- var PAYMENT_REQUEST_BUTTON_ORIENTATION = {
237
- HORIZONTAL: 'horizontal',
238
- VERTICAL: 'vertical'
239
- };
240
- var PAYMENT_REQUEST_BUTTON_THEME = {
241
- LIGHT: 'light',
242
- DARK: 'dark'
243
- };
244
- var CHANNELS = {
245
- APPLE_PAY: 'apple_pay',
246
- GOOGLE_PAY: 'google_pay',
247
- CARD: 'card'
248
- };
249
- var TRANSACTION_STATUS = {
250
- SUCCESS: 'success',
251
- FAILED: 'failed',
252
- AUTH: 'auth'
253
- };
254
- var TRANSACTION_DOMAIN = {
255
- TEST: 'test',
256
- LIVE: 'live'
257
- };
258
- var ENVIRONMENT = {
259
- DEV: 'dev',
260
- STAGING: 'staging',
261
- PRODUCTION: 'production'
262
- };
263
- var GOOGLE_PAY_STATUS_CODE = {
264
- CANCELED: 'CANCELED',
265
- DEVELOPER_ERROR: 'DEVELOPER_ERROR',
266
- MERCHANT_ACCOUNT_ERROR: 'MERCHANT_ACCOUNT_ERROR'
267
- };
268
- var GOOGLE_PAY_TIMEOUT_MS = 10000;
269
- var COUNTRYCODE = {
270
- COTE_D_IVOIRE: 'CI',
271
- GHANA: 'GH',
272
- KENYA: 'KE',
273
- NIGERIA: 'NG',
274
- SOUTH_AFRICA: 'ZA',
275
- EGYPT: 'EG'
276
- };
277
- var CURRENCY_COUNTRYCODE_MAPPING = {
278
- XOF: COUNTRYCODE.COTE_D_IVOIRE,
279
- GHS: COUNTRYCODE.GHANA,
280
- KES: COUNTRYCODE.KENYA,
281
- NGN: COUNTRYCODE.NIGERIA,
282
- ZAR: COUNTRYCODE.SOUTH_AFRICA,
283
- EGP: COUNTRYCODE.EGYPT
284
- };
285
-
286
- var withCardForGooglePay = function withCardForGooglePay(channels) {
287
- var needsCard = Array.isArray(channels) && channels.includes(CHANNELS.GOOGLE_PAY) && !channels.includes(CHANNELS.CARD);
288
- return needsCard ? [].concat(_toConsumableArray(channels), [CHANNELS.CARD]) : channels;
289
- };
290
-
291
- /* eslint-env browser */
292
- function getLastScript() {
293
- var scripts = document.getElementsByTagName('script');
294
- return scripts[scripts.length - 1];
295
- }
296
- function getSourceScript() {
297
- return document.currentScript || getLastScript();
298
- }
299
- function getDataAttributes() {
300
- var dataAttributes = [];
301
- var sourceScript = getSourceScript();
302
- if (sourceScript) {
303
- var attributes = Array.prototype.slice.call(sourceScript.attributes);
304
- dataAttributes = Object.keys(attributes).filter(function (key) {
305
- var element = attributes[key].nodeName;
306
- return element && element.indexOf('data') > -1;
307
- }).map(function (index) {
308
- return attributes[index].nodeName;
309
- });
310
- }
311
- return dataAttributes;
312
- }
313
- function scriptCanUseDataAttributes() {
314
- var hasDataAttributes = getDataAttributes().length > 0;
315
- var hasParentForm = getSourceScript() && getSourceScript().parentElement.tagName === 'FORM';
316
- return hasDataAttributes && hasParentForm;
317
- }
318
- function getDataAttributesAsParameters() {
319
- function convertToCamelCase(value) {
320
- return value.replace(/-([a-z])/g, function (g) {
321
- return g[1].toUpperCase();
322
- });
323
- }
324
- function validateLazyParameters(parameters) {
325
- if (parameters.buttonId && !document.getElementById(parameters.buttonId)) {
326
- throw new Error('Please make sure the buttonId is an element available in the DOM');
327
- }
328
- var updatedParameters = _objectSpread2({}, parameters);
329
- updatedParameters.buttonText = parameters.buttonText || 'Pay';
330
- updatedParameters.buttonVariant = 'normal';
331
- updatedParameters.buttonWordmarkVariant = 'normal';
332
- var allowedVariants = ['normal', 'light'];
333
- if (parameters.buttonVariant && allowedVariants.indexOf(parameters.buttonVariant) > -1) {
334
- updatedParameters.buttonVariant = parameters.buttonVariant;
335
- }
336
- if (parameters.buttonWordmarkVariant && allowedVariants.indexOf(parameters.buttonWordmarkVariant) > -1) {
337
- updatedParameters.buttonWordmarkVariant = parameters.buttonWordmarkVariant;
338
- }
339
- return updatedParameters;
340
- }
341
- var parameters = {};
342
- var sourceScript = getSourceScript();
343
- var dataAttributes = getDataAttributes();
344
- dataAttributes.forEach(function (attribute) {
345
- var attributeValue = sourceScript.getAttribute(attribute);
346
- var attributeSplit = attribute.split('data-');
347
- var attributeName = convertToCamelCase(attributeSplit[1]);
348
- parameters[attributeName] = attributeValue;
349
- });
350
- return validateLazyParameters(parameters);
351
- }
352
-
353
- var secureByPaystack = "\n <svg id=\"inline-button-wordmark\" width=\"137\" height=\"13\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M.037 5.095l1.075-.135c-.011-.774-.025-1.944-.013-2.149C1.19 1.364 2.38.134 3.81.013 3.9.006 3.99.002 4.077 0a2.947 2.947 0 0 1 2.046.76c.574.509.95 1.26 1.008 2.007.015.192.01 1.491.01 2.257l1.096.163L8.2 11.44 4.093 12 0 11.346l.037-6.251zm4.106-.514l1.724.256c-.007-.933-.05-2.295-.26-2.654-.319-.545-.846-.867-1.443-.88h-.063c-.607.008-1.138.322-1.458.864-.222.378-.266 1.66-.265 2.637l1.765-.223zM18.228 10.108c-.576 0-1.064-.072-1.464-.216a2.864 2.864 0 0 1-.972-.6 2.552 2.552 0 0 1-.588-.864 4.067 4.067 0 0 1-.252-1.044h1.008c.032.256.088.5.168.732.08.224.204.424.372.6.168.168.388.304.66.408.28.096.636.144 1.068.144.28 0 .536-.036.768-.108.24-.08.448-.192.624-.336.176-.144.312-.316.408-.516.104-.2.156-.42.156-.66 0-.24-.032-.448-.096-.624a1.02 1.02 0 0 0-.336-.468 1.885 1.885 0 0 0-.636-.324 6.4 6.4 0 0 0-1.008-.228 8.79 8.79 0 0 1-1.212-.276 3.246 3.246 0 0 1-.9-.432 1.982 1.982 0 0 1-.564-.672c-.128-.272-.192-.6-.192-.984 0-.328.068-.632.204-.912.136-.288.324-.536.564-.744.248-.208.54-.372.876-.492.336-.12.708-.18 1.116-.18.864 0 1.548.204 2.052.612.512.4.812.984.9 1.752h-.936c-.104-.544-.316-.932-.636-1.164-.32-.24-.78-.36-1.38-.36-.592 0-1.04.132-1.344.396a1.255 1.255 0 0 0-.444.996c0 .208.024.396.072.564.056.16.156.3.3.42.152.12.36.228.624.324a6.72 6.72 0 0 0 1.068.228c.48.072.9.168 1.26.288.36.12.664.276.912.468s.432.428.552.708c.128.28.192.624.192 1.032 0 .36-.076.696-.228 1.008a2.472 2.472 0 0 1-.612.804c-.264.224-.58.4-.948.528-.36.128-.752.192-1.176.192zM25.355 10.108c-.44 0-.848-.076-1.224-.228a2.916 2.916 0 0 1-.96-.636 2.966 2.966 0 0 1-.636-1.008 3.77 3.77 0 0 1-.216-1.308v-.096c0-.472.072-.904.216-1.296.144-.4.344-.74.6-1.02.264-.288.576-.508.936-.66.36-.16.756-.24 1.188-.24.36 0 .708.06 1.044.18.344.112.648.292.912.54.264.248.472.572.624.972.16.392.24.868.24 1.428v.324h-4.728c.024.72.204 1.272.54 1.656.336.376.828.564 1.476.564.984 0 1.54-.364 1.668-1.092h.996c-.112.632-.408 1.112-.888 1.44-.48.32-1.076.48-1.788.48zm1.704-3.852c-.048-.648-.232-1.112-.552-1.392-.312-.28-.728-.42-1.248-.42-.512 0-.932.164-1.26.492-.32.32-.524.76-.612 1.32h3.672zM32.091 10.108c-.44 0-.848-.072-1.224-.216a3.054 3.054 0 0 1-.972-.636 3.12 3.12 0 0 1-.648-1.008 3.626 3.626 0 0 1-.228-1.32v-.096c0-.48.08-.916.24-1.308.16-.4.376-.74.648-1.02.28-.28.604-.496.972-.648.376-.16.772-.24 1.188-.24.328 0 .644.04.948.12.312.08.588.208.828.384.248.168.456.392.624.672.168.28.276.62.324 1.02h-.984c-.08-.496-.284-.848-.612-1.056-.32-.208-.696-.312-1.128-.312a1.93 1.93 0 0 0-.804.168c-.24.112-.452.272-.636.48a2.23 2.23 0 0 0-.42.744 2.991 2.991 0 0 0-.156.996v.096c0 .776.188 1.364.564 1.764.384.392.88.588 1.488.588.224 0 .436-.032.636-.096a1.651 1.651 0 0 0 .96-.768c.112-.192.18-.416.204-.672h.924a2.595 2.595 0 0 1-.276.948 2.386 2.386 0 0 1-.576.744c-.24.208-.52.372-.84.492-.32.12-.668.18-1.044.18zM38.335 10.108a2.83 2.83 0 0 1-.876-.132 1.724 1.724 0 0 1-.684-.42 2.145 2.145 0 0 1-.456-.756c-.112-.304-.168-.672-.168-1.104V3.724h.996v3.924c0 .552.116.956.348 1.212.24.256.608.384 1.104.384.224 0 .44-.036.648-.108.208-.072.392-.18.552-.324.16-.144.288-.324.384-.54.096-.216.144-.464.144-.744V3.724h.996V10h-.996v-.996c-.144.296-.388.556-.732.78-.336.216-.756.324-1.26.324zM43.216 3.724h.996v1.128c.2-.352.452-.64.756-.864.312-.232.748-.356 1.308-.372v.936a4.461 4.461 0 0 0-.852.12 1.647 1.647 0 0 0-.66.324 1.472 1.472 0 0 0-.408.612c-.096.248-.144.564-.144.948V10h-.996V3.724zM50 10.108c-.44 0-.848-.076-1.224-.228a2.916 2.916 0 0 1-.96-.636 2.966 2.966 0 0 1-.636-1.008 3.77 3.77 0 0 1-.216-1.308v-.096c0-.472.072-.904.216-1.296.144-.4.344-.74.6-1.02.264-.288.576-.508.936-.66.36-.16.756-.24 1.188-.24.36 0 .708.06 1.044.18.344.112.648.292.912.54.264.248.472.572.624.972.16.392.24.868.24 1.428v.324h-4.728c.024.72.204 1.272.54 1.656.336.376.828.564 1.476.564.984 0 1.54-.364 1.668-1.092h.996c-.112.632-.408 1.112-.888 1.44-.48.32-1.076.48-1.788.48zm1.704-3.852c-.048-.648-.232-1.112-.552-1.392-.312-.28-.728-.42-1.248-.42-.512 0-.932.164-1.26.492-.32.32-.524.76-.612 1.32h3.672zM56.496 10.108c-.408 0-.788-.068-1.14-.204a2.683 2.683 0 0 1-.9-.612 3.01 3.01 0 0 1-.588-.984 4.01 4.01 0 0 1-.204-1.32v-.096c0-.48.072-.92.216-1.32.144-.4.344-.744.6-1.032.256-.296.564-.524.924-.684.36-.16.756-.24 1.188-.24.528 0 .956.112 1.284.336.328.216.584.476.768.78V.724h.996V10h-.996V8.92c-.088.152-.208.3-.36.444a2.792 2.792 0 0 1-.516.384 2.874 2.874 0 0 1-.6.252c-.216.072-.44.108-.672.108zm.108-.828c.288 0 .56-.048.816-.144.256-.096.476-.24.66-.432.184-.2.328-.448.432-.744.112-.304.168-.656.168-1.056v-.096c0-.808-.18-1.404-.54-1.788-.352-.384-.836-.576-1.452-.576-.624 0-1.112.208-1.464.624-.352.416-.528 1.008-.528 1.776v.096c0 .392.048.736.144 1.032.104.296.24.54.408.732.176.192.38.336.612.432.232.096.48.144.744.144zM67.712 10.108c-.512 0-.948-.112-1.308-.336a2.38 2.38 0 0 1-.816-.804V10h-.996V.724h.996V4.78a1.92 1.92 0 0 1 .348-.432c.152-.144.32-.268.504-.372.192-.112.396-.2.612-.264.216-.064.436-.096.66-.096.408 0 .788.072 1.14.216.352.144.652.352.9.624.256.272.456.604.6.996.144.392.216.832.216 1.32v.096c0 .48-.068.92-.204 1.32a3.103 3.103 0 0 1-.576 1.02 2.583 2.583 0 0 1-.9.672 2.937 2.937 0 0 1-1.176.228zm-.096-.828c.624 0 1.1-.2 1.428-.6.328-.408.492-.996.492-1.764V6.82c0-.4-.052-.748-.156-1.044a2.095 2.095 0 0 0-.42-.732 1.53 1.53 0 0 0-.612-.444 1.798 1.798 0 0 0-.744-.156c-.288 0-.56.048-.816.144a1.71 1.71 0 0 0-.648.444c-.184.192-.328.44-.432.744a3.152 3.152 0 0 0-.156 1.044v.096c0 .8.192 1.396.576 1.788.384.384.88.576 1.488.576zM73.63 9.352l-2.46-5.628h1.068l1.92 4.5 1.74-4.5h1.02l-3.468 8.46h-1.008l1.188-2.832zM87.127 3.669A3.138 3.138 0 0 0 86.1 2.95a3.09 3.09 0 0 0-1.228-.25c-.448 0-.848.086-1.187.26a2.199 2.199 0 0 0-.662.497v-.191a.387.387 0 0 0-.214-.348.323.323 0 0 0-.14-.03h-1.315a.314.314 0 0 0-.254.116.377.377 0 0 0-.1.262v8.97c0 .1.034.188.1.258a.34.34 0 0 0 .254.103h1.341a.342.342 0 0 0 .244-.103.336.336 0 0 0 .11-.259v-3.06c.178.202.417.357.702.464.35.134.72.203 1.093.203.43 0 .848-.082 1.242-.248a3.124 3.124 0 0 0 1.04-.724c.305-.326.545-.709.707-1.128a3.93 3.93 0 0 0 .263-1.477c0-.54-.086-1.037-.263-1.477a3.387 3.387 0 0 0-.706-1.12zm-1.204 3.24c-.073.19-.18.362-.315.51a1.415 1.415 0 0 1-1.065.466c-.2.001-.4-.04-.584-.12a1.484 1.484 0 0 1-.49-.346 1.593 1.593 0 0 1-.32-.51 1.738 1.738 0 0 1-.115-.63c0-.224.04-.435.115-.631a1.532 1.532 0 0 1 .804-.846c.185-.086.386-.13.59-.129.215 0 .414.044.593.13.177.083.338.199.474.341a1.622 1.622 0 0 1 .425 1.135c0 .225-.037.436-.112.63zM95.298 2.89h-1.33a.339.339 0 0 0-.246.11.384.384 0 0 0-.108.266v.166a1.856 1.856 0 0 0-.602-.472 2.525 2.525 0 0 0-1.166-.258 3.227 3.227 0 0 0-2.284.964 3.554 3.554 0 0 0-.734 1.123 3.827 3.827 0 0 0-.275 1.477c0 .54.092 1.037.275 1.477.184.434.427.817.728 1.128a3.146 3.146 0 0 0 2.277.973c.437 0 .834-.088 1.173-.259.25-.13.456-.287.608-.471v.177a.34.34 0 0 0 .11.259.341.341 0 0 0 .244.104h1.33a.324.324 0 0 0 .25-.105.349.349 0 0 0 .102-.258V3.267a.377.377 0 0 0-.1-.262.325.325 0 0 0-.252-.115zM93.502 6.9a1.55 1.55 0 0 1-.312.511c-.136.143-.296.26-.473.344-.178.085-.38.129-.596.129-.207 0-.407-.044-.59-.13a1.501 1.501 0 0 1-.791-.855 1.766 1.766 0 0 1-.112-.62c0-.225.038-.436.112-.632.075-.193.181-.364.314-.504.137-.143.3-.26.478-.342.182-.085.382-.129.59-.129.215 0 .417.044.595.13.178.085.338.2.473.341a1.623 1.623 0 0 1 .424 1.135c0 .215-.037.424-.112.622zM108.567 6.094a2.265 2.265 0 0 0-.654-.402c-.247-.101-.509-.181-.785-.235l-1.014-.204c-.26-.05-.441-.117-.543-.203a.328.328 0 0 1-.136-.264c0-.11.063-.2.189-.282.137-.086.329-.13.566-.13.26 0 .518.053.757.157.243.106.471.226.67.36.295.187.546.162.727-.053l.487-.57a.543.543 0 0 0 .152-.357c0-.128-.064-.245-.185-.351-.207-.184-.533-.378-.971-.568-.437-.192-.987-.29-1.637-.29-.427 0-.82.058-1.168.172-.35.116-.65.276-.893.474-.245.204-.438.44-.57.713a2 2 0 0 0-.198.875c0 .56.167 1.017.496 1.358.328.333.766.56 1.304.67l1.054.232c.3.062.528.132.675.21.129.067.19.163.19.297 0 .12-.061.227-.188.324-.133.104-.342.155-.622.155a1.83 1.83 0 0 1-.831-.19 3.056 3.056 0 0 1-.678-.458.995.995 0 0 0-.307-.17c-.126-.037-.268.003-.431.13l-.583.461c-.169.145-.24.32-.209.522.029.194.19.394.491.62.269.193.614.368 1.029.518.415.151.901.229 1.453.229.444 0 .854-.058 1.215-.172.362-.119.681-.278.941-.48a2.056 2.056 0 0 0 .819-1.663c0-.319-.053-.6-.165-.836a1.843 1.843 0 0 0-.447-.6zM114.383 7.73a.363.363 0 0 0-.295-.192.55.55 0 0 0-.343.113c-.095.062-.198.11-.306.141a.75.75 0 0 1-.426.013.43.43 0 0 1-.181-.093.554.554 0 0 1-.143-.204.92.92 0 0 1-.059-.362v-2.46h1.731c.099 0 .188-.04.266-.117a.368.368 0 0 0 .112-.26V3.268a.369.369 0 0 0-.115-.268.38.38 0 0 0-.263-.109h-1.732V1.216a.354.354 0 0 0-.108-.27.347.347 0 0 0-.243-.104h-1.344a.36.36 0 0 0-.34.226.371.371 0 0 0-.027.148V2.89h-.767a.324.324 0 0 0-.255.115.385.385 0 0 0-.098.262V4.31a.4.4 0 0 0 .212.346c.044.021.092.032.14.03h.768v2.925c0 .39.069.726.2 1.003.132.274.305.504.514.676.217.178.465.31.731.388.27.084.551.126.833.126.385 0 .75-.061 1.094-.18a2.13 2.13 0 0 0 .861-.552c.152-.181.17-.381.046-.581l-.463-.76zM121.672 2.89h-1.329a.339.339 0 0 0-.244.11.39.39 0 0 0-.08.122.394.394 0 0 0-.027.144v.166a1.906 1.906 0 0 0-.605-.472c-.335-.173-.726-.258-1.168-.258-.42 0-.834.083-1.226.249a3.24 3.24 0 0 0-1.055.715 3.528 3.528 0 0 0-.734 1.123 3.79 3.79 0 0 0-.276 1.477c0 .54.092 1.037.275 1.477.184.434.428.817.729 1.128a3.138 3.138 0 0 0 2.273.973 2.59 2.59 0 0 0 1.175-.259c.255-.13.457-.287.612-.471v.177a.34.34 0 0 0 .108.259.343.343 0 0 0 .243.104h1.329a.335.335 0 0 0 .252-.105.364.364 0 0 0 .102-.258V3.267a.38.38 0 0 0-.1-.262.332.332 0 0 0-.115-.087.311.311 0 0 0-.139-.028zM119.876 6.9a1.534 1.534 0 0 1-.786.855 1.362 1.362 0 0 1-.594.129c-.207 0-.405-.044-.588-.13a1.516 1.516 0 0 1-.792-.855 1.757 1.757 0 0 1-.113-.62c0-.225.037-.436.112-.632.073-.187.179-.358.314-.504.138-.143.3-.26.479-.342.184-.086.385-.13.588-.129.217 0 .415.044.594.13.181.085.34.2.472.341.134.143.24.313.314.504a1.73 1.73 0 0 1 0 1.253zM128.978 7.64l-.763-.593c-.146-.118-.284-.15-.404-.1a.742.742 0 0 0-.279.205 2.527 2.527 0 0 1-.583.535c-.192.122-.444.183-.742.183-.219 0-.42-.04-.6-.122a1.423 1.423 0 0 1-.469-.342 1.575 1.575 0 0 1-.308-.51 1.751 1.751 0 0 1-.106-.617c0-.228.034-.438.106-.632.07-.192.173-.363.308-.503.135-.144.295-.26.472-.342.187-.088.391-.132.597-.13.298 0 .547.064.742.187.198.126.396.306.584.534.078.092.17.16.278.206.122.048.259.016.401-.101l.762-.594a.53.53 0 0 0 .201-.269.437.437 0 0 0-.034-.365 3.329 3.329 0 0 0-1.18-1.127c-.504-.291-1.108-.441-1.784-.441a3.519 3.519 0 0 0-2.51 1.033c-.322.322-.576.71-.747 1.137a3.68 3.68 0 0 0-.273 1.407c0 .495.093.968.273 1.402.173.424.427.808.747 1.128a3.527 3.527 0 0 0 2.51 1.034c.676 0 1.28-.149 1.784-.444a3.286 3.286 0 0 0 1.182-1.13.411.411 0 0 0 .055-.173.415.415 0 0 0-.023-.182.624.624 0 0 0-.197-.273zM136.06 9.045l-2.104-3.143 1.801-2.415c.094-.139.119-.272.075-.397-.031-.09-.116-.2-.334-.2h-1.425a.52.52 0 0 0-.234.058.482.482 0 0 0-.209.205L132.191 5.2h-.349V.363a.37.37 0 0 0-.099-.26.352.352 0 0 0-.253-.103h-1.332a.37.37 0 0 0-.337.22.346.346 0 0 0-.027.143V9.29c0 .103.038.193.11.259a.353.353 0 0 0 .254.104h1.333a.328.328 0 0 0 .251-.105.346.346 0 0 0 .075-.119.333.333 0 0 0 .024-.14V6.927h.386l1.571 2.446c.112.187.267.281.46.281h1.491c.226 0 .32-.11.358-.202.054-.13.038-.262-.047-.406zM102.863 2.89h-1.489a.389.389 0 0 0-.298.122.544.544 0 0 0-.13.249l-1.099 4.167h-.268l-1.182-4.167a.66.66 0 0 0-.113-.247.329.329 0 0 0-.264-.124h-1.544c-.199 0-.325.066-.372.193a.588.588 0 0 0-.002.37l1.887 5.865c.03.093.08.17.145.232a.388.388 0 0 0 .281.104h.798l-.066.19-.19.547a.872.872 0 0 1-.29.426.7.7 0 0 1-.442.148.956.956 0 0 1-.4-.09 1.842 1.842 0 0 1-.35-.209.62.62 0 0 0-.335-.115h-.016c-.13 0-.243.074-.334.216l-.474.708c-.193.304-.086.504.039.615.234.224.528.399.875.524.344.125.723.186 1.126.186.682 0 1.252-.187 1.689-.565.435-.376.756-.887.952-1.524l2.188-7.258c.05-.155.05-.284.005-.389-.037-.08-.125-.174-.327-.174z\" fill=\"#011B33\"/>\n </svg>";
354
- var secureByPaystackWhite = "\n <svg id=\"inline-button-wordmark--white\" width=\"137\" height=\"13\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M.037 5.095l1.075-.135c-.011-.774-.025-1.944-.013-2.149C1.19 1.364 2.38.134 3.81.013 3.9.006 3.99.002 4.077 0a2.947 2.947 0 0 1 2.046.76c.574.509.95 1.26 1.008 2.007.015.192.01 1.491.01 2.257l1.096.163L8.2 11.44 4.093 12 0 11.346l.037-6.251zm4.106-.514l1.724.256c-.007-.933-.05-2.295-.26-2.654-.319-.545-.846-.867-1.443-.88h-.063c-.607.008-1.138.322-1.458.864-.222.378-.266 1.66-.265 2.637l1.765-.223zM18.228 10.108c-.576 0-1.064-.072-1.464-.216a2.864 2.864 0 0 1-.972-.6 2.552 2.552 0 0 1-.588-.864 4.067 4.067 0 0 1-.252-1.044h1.008c.032.256.088.5.168.732.08.224.204.424.372.6.168.168.388.304.66.408.28.096.636.144 1.068.144.28 0 .536-.036.768-.108.24-.08.448-.192.624-.336.176-.144.312-.316.408-.516.104-.2.156-.42.156-.66 0-.24-.032-.448-.096-.624a1.02 1.02 0 0 0-.336-.468 1.885 1.885 0 0 0-.636-.324 6.4 6.4 0 0 0-1.008-.228 8.79 8.79 0 0 1-1.212-.276 3.246 3.246 0 0 1-.9-.432 1.982 1.982 0 0 1-.564-.672c-.128-.272-.192-.6-.192-.984 0-.328.068-.632.204-.912.136-.288.324-.536.564-.744.248-.208.54-.372.876-.492.336-.12.708-.18 1.116-.18.864 0 1.548.204 2.052.612.512.4.812.984.9 1.752h-.936c-.104-.544-.316-.932-.636-1.164-.32-.24-.78-.36-1.38-.36-.592 0-1.04.132-1.344.396a1.255 1.255 0 0 0-.444.996c0 .208.024.396.072.564.056.16.156.3.3.42.152.12.36.228.624.324a6.72 6.72 0 0 0 1.068.228c.48.072.9.168 1.26.288.36.12.664.276.912.468s.432.428.552.708c.128.28.192.624.192 1.032 0 .36-.076.696-.228 1.008a2.472 2.472 0 0 1-.612.804c-.264.224-.58.4-.948.528-.36.128-.752.192-1.176.192zM25.355 10.108c-.44 0-.848-.076-1.224-.228a2.916 2.916 0 0 1-.96-.636 2.966 2.966 0 0 1-.636-1.008 3.77 3.77 0 0 1-.216-1.308v-.096c0-.472.072-.904.216-1.296.144-.4.344-.74.6-1.02.264-.288.576-.508.936-.66.36-.16.756-.24 1.188-.24.36 0 .708.06 1.044.18.344.112.648.292.912.54.264.248.472.572.624.972.16.392.24.868.24 1.428v.324h-4.728c.024.72.204 1.272.54 1.656.336.376.828.564 1.476.564.984 0 1.54-.364 1.668-1.092h.996c-.112.632-.408 1.112-.888 1.44-.48.32-1.076.48-1.788.48zm1.704-3.852c-.048-.648-.232-1.112-.552-1.392-.312-.28-.728-.42-1.248-.42-.512 0-.932.164-1.26.492-.32.32-.524.76-.612 1.32h3.672zM32.091 10.108c-.44 0-.848-.072-1.224-.216a3.054 3.054 0 0 1-.972-.636 3.12 3.12 0 0 1-.648-1.008 3.626 3.626 0 0 1-.228-1.32v-.096c0-.48.08-.916.24-1.308.16-.4.376-.74.648-1.02.28-.28.604-.496.972-.648.376-.16.772-.24 1.188-.24.328 0 .644.04.948.12.312.08.588.208.828.384.248.168.456.392.624.672.168.28.276.62.324 1.02h-.984c-.08-.496-.284-.848-.612-1.056-.32-.208-.696-.312-1.128-.312a1.93 1.93 0 0 0-.804.168c-.24.112-.452.272-.636.48a2.23 2.23 0 0 0-.42.744 2.991 2.991 0 0 0-.156.996v.096c0 .776.188 1.364.564 1.764.384.392.88.588 1.488.588.224 0 .436-.032.636-.096a1.651 1.651 0 0 0 .96-.768c.112-.192.18-.416.204-.672h.924a2.595 2.595 0 0 1-.276.948 2.386 2.386 0 0 1-.576.744c-.24.208-.52.372-.84.492-.32.12-.668.18-1.044.18zM38.335 10.108a2.83 2.83 0 0 1-.876-.132 1.724 1.724 0 0 1-.684-.42 2.145 2.145 0 0 1-.456-.756c-.112-.304-.168-.672-.168-1.104V3.724h.996v3.924c0 .552.116.956.348 1.212.24.256.608.384 1.104.384.224 0 .44-.036.648-.108.208-.072.392-.18.552-.324.16-.144.288-.324.384-.54.096-.216.144-.464.144-.744V3.724h.996V10h-.996v-.996c-.144.296-.388.556-.732.78-.336.216-.756.324-1.26.324zM43.216 3.724h.996v1.128c.2-.352.452-.64.756-.864.312-.232.748-.356 1.308-.372v.936a4.461 4.461 0 0 0-.852.12 1.647 1.647 0 0 0-.66.324 1.472 1.472 0 0 0-.408.612c-.096.248-.144.564-.144.948V10h-.996V3.724zM50 10.108c-.44 0-.848-.076-1.224-.228a2.916 2.916 0 0 1-.96-.636 2.966 2.966 0 0 1-.636-1.008 3.77 3.77 0 0 1-.216-1.308v-.096c0-.472.072-.904.216-1.296.144-.4.344-.74.6-1.02.264-.288.576-.508.936-.66.36-.16.756-.24 1.188-.24.36 0 .708.06 1.044.18.344.112.648.292.912.54.264.248.472.572.624.972.16.392.24.868.24 1.428v.324h-4.728c.024.72.204 1.272.54 1.656.336.376.828.564 1.476.564.984 0 1.54-.364 1.668-1.092h.996c-.112.632-.408 1.112-.888 1.44-.48.32-1.076.48-1.788.48zm1.704-3.852c-.048-.648-.232-1.112-.552-1.392-.312-.28-.728-.42-1.248-.42-.512 0-.932.164-1.26.492-.32.32-.524.76-.612 1.32h3.672zM56.496 10.108c-.408 0-.788-.068-1.14-.204a2.683 2.683 0 0 1-.9-.612 3.01 3.01 0 0 1-.588-.984 4.01 4.01 0 0 1-.204-1.32v-.096c0-.48.072-.92.216-1.32.144-.4.344-.744.6-1.032.256-.296.564-.524.924-.684.36-.16.756-.24 1.188-.24.528 0 .956.112 1.284.336.328.216.584.476.768.78V.724h.996V10h-.996V8.92c-.088.152-.208.3-.36.444a2.792 2.792 0 0 1-.516.384 2.874 2.874 0 0 1-.6.252c-.216.072-.44.108-.672.108zm.108-.828c.288 0 .56-.048.816-.144.256-.096.476-.24.66-.432.184-.2.328-.448.432-.744.112-.304.168-.656.168-1.056v-.096c0-.808-.18-1.404-.54-1.788-.352-.384-.836-.576-1.452-.576-.624 0-1.112.208-1.464.624-.352.416-.528 1.008-.528 1.776v.096c0 .392.048.736.144 1.032.104.296.24.54.408.732.176.192.38.336.612.432.232.096.48.144.744.144zM67.712 10.108c-.512 0-.948-.112-1.308-.336a2.38 2.38 0 0 1-.816-.804V10h-.996V.724h.996V4.78a1.92 1.92 0 0 1 .348-.432c.152-.144.32-.268.504-.372.192-.112.396-.2.612-.264.216-.064.436-.096.66-.096.408 0 .788.072 1.14.216.352.144.652.352.9.624.256.272.456.604.6.996.144.392.216.832.216 1.32v.096c0 .48-.068.92-.204 1.32a3.103 3.103 0 0 1-.576 1.02 2.583 2.583 0 0 1-.9.672 2.937 2.937 0 0 1-1.176.228zm-.096-.828c.624 0 1.1-.2 1.428-.6.328-.408.492-.996.492-1.764V6.82c0-.4-.052-.748-.156-1.044a2.095 2.095 0 0 0-.42-.732 1.53 1.53 0 0 0-.612-.444 1.798 1.798 0 0 0-.744-.156c-.288 0-.56.048-.816.144a1.71 1.71 0 0 0-.648.444c-.184.192-.328.44-.432.744a3.152 3.152 0 0 0-.156 1.044v.096c0 .8.192 1.396.576 1.788.384.384.88.576 1.488.576zM73.63 9.352l-2.46-5.628h1.068l1.92 4.5 1.74-4.5h1.02l-3.468 8.46h-1.008l1.188-2.832zM87.127 3.669A3.138 3.138 0 0 0 86.1 2.95a3.09 3.09 0 0 0-1.228-.25c-.448 0-.848.086-1.187.26a2.199 2.199 0 0 0-.662.497v-.191a.387.387 0 0 0-.214-.348.323.323 0 0 0-.14-.03h-1.315a.314.314 0 0 0-.254.116.377.377 0 0 0-.1.262v8.97c0 .1.034.188.1.258a.34.34 0 0 0 .254.103h1.341a.342.342 0 0 0 .244-.103.336.336 0 0 0 .11-.259v-3.06c.178.202.417.357.702.464.35.134.72.203 1.093.203.43 0 .848-.082 1.242-.248a3.124 3.124 0 0 0 1.04-.724c.305-.326.545-.709.707-1.128a3.93 3.93 0 0 0 .263-1.477c0-.54-.086-1.037-.263-1.477a3.387 3.387 0 0 0-.706-1.12zm-1.204 3.24c-.073.19-.18.362-.315.51a1.415 1.415 0 0 1-1.065.466c-.2.001-.4-.04-.584-.12a1.484 1.484 0 0 1-.49-.346 1.593 1.593 0 0 1-.32-.51 1.738 1.738 0 0 1-.115-.63c0-.224.04-.435.115-.631a1.532 1.532 0 0 1 .804-.846c.185-.086.386-.13.59-.129.215 0 .414.044.593.13.177.083.338.199.474.341a1.622 1.622 0 0 1 .425 1.135c0 .225-.037.436-.112.63zM95.298 2.89h-1.33a.339.339 0 0 0-.246.11.384.384 0 0 0-.108.266v.166a1.856 1.856 0 0 0-.602-.472 2.525 2.525 0 0 0-1.166-.258 3.227 3.227 0 0 0-2.284.964 3.554 3.554 0 0 0-.734 1.123 3.827 3.827 0 0 0-.275 1.477c0 .54.092 1.037.275 1.477.184.434.427.817.728 1.128a3.146 3.146 0 0 0 2.277.973c.437 0 .834-.088 1.173-.259.25-.13.456-.287.608-.471v.177a.34.34 0 0 0 .11.259.341.341 0 0 0 .244.104h1.33a.324.324 0 0 0 .25-.105.349.349 0 0 0 .102-.258V3.267a.377.377 0 0 0-.1-.262.325.325 0 0 0-.252-.115zM93.502 6.9a1.55 1.55 0 0 1-.312.511c-.136.143-.296.26-.473.344-.178.085-.38.129-.596.129-.207 0-.407-.044-.59-.13a1.501 1.501 0 0 1-.791-.855 1.766 1.766 0 0 1-.112-.62c0-.225.038-.436.112-.632.075-.193.181-.364.314-.504.137-.143.3-.26.478-.342.182-.085.382-.129.59-.129.215 0 .417.044.595.13.178.085.338.2.473.341a1.623 1.623 0 0 1 .424 1.135c0 .215-.037.424-.112.622zM108.567 6.094a2.265 2.265 0 0 0-.654-.402c-.247-.101-.509-.181-.785-.235l-1.014-.204c-.26-.05-.441-.117-.543-.203a.328.328 0 0 1-.136-.264c0-.11.063-.2.189-.282.137-.086.329-.13.566-.13.26 0 .518.053.757.157.243.106.471.226.67.36.295.187.546.162.727-.053l.487-.57a.543.543 0 0 0 .152-.357c0-.128-.064-.245-.185-.351-.207-.184-.533-.378-.971-.568-.437-.192-.987-.29-1.637-.29-.427 0-.82.058-1.168.172-.35.116-.65.276-.893.474-.245.204-.438.44-.57.713a2 2 0 0 0-.198.875c0 .56.167 1.017.496 1.358.328.333.766.56 1.304.67l1.054.232c.3.062.528.132.675.21.129.067.19.163.19.297 0 .12-.061.227-.188.324-.133.104-.342.155-.622.155a1.83 1.83 0 0 1-.831-.19 3.056 3.056 0 0 1-.678-.458.995.995 0 0 0-.307-.17c-.126-.037-.268.003-.431.13l-.583.461c-.169.145-.24.32-.209.522.029.194.19.394.491.62.269.193.614.368 1.029.518.415.151.901.229 1.453.229.444 0 .854-.058 1.215-.172.362-.119.681-.278.941-.48a2.056 2.056 0 0 0 .819-1.663c0-.319-.053-.6-.165-.836a1.843 1.843 0 0 0-.447-.6zM114.383 7.73a.363.363 0 0 0-.295-.192.55.55 0 0 0-.343.113c-.095.062-.198.11-.306.141a.75.75 0 0 1-.426.013.43.43 0 0 1-.181-.093.554.554 0 0 1-.143-.204.92.92 0 0 1-.059-.362v-2.46h1.731c.099 0 .188-.04.266-.117a.368.368 0 0 0 .112-.26V3.268a.369.369 0 0 0-.115-.268.38.38 0 0 0-.263-.109h-1.732V1.216a.354.354 0 0 0-.108-.27.347.347 0 0 0-.243-.104h-1.344a.36.36 0 0 0-.34.226.371.371 0 0 0-.027.148V2.89h-.767a.324.324 0 0 0-.255.115.385.385 0 0 0-.098.262V4.31a.4.4 0 0 0 .212.346c.044.021.092.032.14.03h.768v2.925c0 .39.069.726.2 1.003.132.274.305.504.514.676.217.178.465.31.731.388.27.084.551.126.833.126.385 0 .75-.061 1.094-.18a2.13 2.13 0 0 0 .861-.552c.152-.181.17-.381.046-.581l-.463-.76zM121.672 2.89h-1.329a.339.339 0 0 0-.244.11.39.39 0 0 0-.08.122.394.394 0 0 0-.027.144v.166a1.906 1.906 0 0 0-.605-.472c-.335-.173-.726-.258-1.168-.258-.42 0-.834.083-1.226.249a3.24 3.24 0 0 0-1.055.715 3.528 3.528 0 0 0-.734 1.123 3.79 3.79 0 0 0-.276 1.477c0 .54.092 1.037.275 1.477.184.434.428.817.729 1.128a3.138 3.138 0 0 0 2.273.973 2.59 2.59 0 0 0 1.175-.259c.255-.13.457-.287.612-.471v.177a.34.34 0 0 0 .108.259.343.343 0 0 0 .243.104h1.329a.335.335 0 0 0 .252-.105.364.364 0 0 0 .102-.258V3.267a.38.38 0 0 0-.1-.262.332.332 0 0 0-.115-.087.311.311 0 0 0-.139-.028zM119.876 6.9a1.534 1.534 0 0 1-.786.855 1.362 1.362 0 0 1-.594.129c-.207 0-.405-.044-.588-.13a1.516 1.516 0 0 1-.792-.855 1.757 1.757 0 0 1-.113-.62c0-.225.037-.436.112-.632.073-.187.179-.358.314-.504.138-.143.3-.26.479-.342.184-.086.385-.13.588-.129.217 0 .415.044.594.13.181.085.34.2.472.341.134.143.24.313.314.504a1.73 1.73 0 0 1 0 1.253zM128.978 7.64l-.763-.593c-.146-.118-.284-.15-.404-.1a.742.742 0 0 0-.279.205 2.527 2.527 0 0 1-.583.535c-.192.122-.444.183-.742.183-.219 0-.42-.04-.6-.122a1.423 1.423 0 0 1-.469-.342 1.575 1.575 0 0 1-.308-.51 1.751 1.751 0 0 1-.106-.617c0-.228.034-.438.106-.632.07-.192.173-.363.308-.503.135-.144.295-.26.472-.342.187-.088.391-.132.597-.13.298 0 .547.064.742.187.198.126.396.306.584.534.078.092.17.16.278.206.122.048.259.016.401-.101l.762-.594a.53.53 0 0 0 .201-.269.437.437 0 0 0-.034-.365 3.329 3.329 0 0 0-1.18-1.127c-.504-.291-1.108-.441-1.784-.441a3.519 3.519 0 0 0-2.51 1.033c-.322.322-.576.71-.747 1.137a3.68 3.68 0 0 0-.273 1.407c0 .495.093.968.273 1.402.173.424.427.808.747 1.128a3.527 3.527 0 0 0 2.51 1.034c.676 0 1.28-.149 1.784-.444a3.286 3.286 0 0 0 1.182-1.13.411.411 0 0 0 .055-.173.415.415 0 0 0-.023-.182.624.624 0 0 0-.197-.273zM136.06 9.045l-2.104-3.143 1.801-2.415c.094-.139.119-.272.075-.397-.031-.09-.116-.2-.334-.2h-1.425a.52.52 0 0 0-.234.058.482.482 0 0 0-.209.205L132.191 5.2h-.349V.363a.37.37 0 0 0-.099-.26.352.352 0 0 0-.253-.103h-1.332a.37.37 0 0 0-.337.22.346.346 0 0 0-.027.143V9.29c0 .103.038.193.11.259a.353.353 0 0 0 .254.104h1.333a.328.328 0 0 0 .251-.105.346.346 0 0 0 .075-.119.333.333 0 0 0 .024-.14V6.927h.386l1.571 2.446c.112.187.267.281.46.281h1.491c.226 0 .32-.11.358-.202.054-.13.038-.262-.047-.406zM102.863 2.89h-1.489a.389.389 0 0 0-.298.122.544.544 0 0 0-.13.249l-1.099 4.167h-.268l-1.182-4.167a.66.66 0 0 0-.113-.247.329.329 0 0 0-.264-.124h-1.544c-.199 0-.325.066-.372.193a.588.588 0 0 0-.002.37l1.887 5.865c.03.093.08.17.145.232a.388.388 0 0 0 .281.104h.798l-.066.19-.19.547a.872.872 0 0 1-.29.426.7.7 0 0 1-.442.148.956.956 0 0 1-.4-.09 1.842 1.842 0 0 1-.35-.209.62.62 0 0 0-.335-.115h-.016c-.13 0-.243.074-.334.216l-.474.708c-.193.304-.086.504.039.615.234.224.528.399.875.524.344.125.723.186 1.126.186.682 0 1.252-.187 1.689-.565.435-.376.756-.887.952-1.524l2.188-7.258c.05-.155.05-.284.005-.389-.037-.08-.125-.174-.327-.174z\" fill=\"#ffffff\"/>\n </svg>\n";
355
-
356
- var loaderHTML = "\n <!DOCTYPE html>\n <html lang=\"en\">\n\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>Paystack Popup Loader</title>\n <style>\n .app-loader {\n margin: 200px 0;\n text-align: center;\n color: white;\n }\n @keyframes app-loader__spinner {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n @-webkit-keyframes app-loader__spinner {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n .app-loader__spinner {\n position: relative;\n display: inline-block;\n }\n .app-loader__spinner div {\n left: 95px;\n top: 35px;\n position: absolute;\n -webkit-animation: app-loader__spinner linear 1s infinite;\n animation: app-loader__spinner linear 1s infinite;\n background: white;\n width: 10px;\n height: 30px;\n border-radius: 40%;\n -webkit-transform-origin: 5px 65px;\n transform-origin: 5px 65px;\n }\n .app-loader__spinner div:nth-child(1) {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n -webkit-animation-delay: -0.916666666666667s;\n animation-delay: -0.916666666666667s;\n }\n .app-loader__spinner div:nth-child(2) {\n -webkit-transform: rotate(30deg);\n transform: rotate(30deg);\n -webkit-animation-delay: -0.833333333333333s;\n animation-delay: -0.833333333333333s;\n }\n .app-loader__spinner div:nth-child(3) {\n -webkit-transform: rotate(60deg);\n transform: rotate(60deg);\n -webkit-animation-delay: -0.75s;\n animation-delay: -0.75s;\n }\n .app-loader__spinner div:nth-child(4) {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n -webkit-animation-delay: -0.666666666666667s;\n animation-delay: -0.666666666666667s;\n }\n .app-loader__spinner div:nth-child(5) {\n -webkit-transform: rotate(120deg);\n transform: rotate(120deg);\n -webkit-animation-delay: -0.583333333333333s;\n animation-delay: -0.583333333333333s;\n }\n .app-loader__spinner div:nth-child(6) {\n -webkit-transform: rotate(150deg);\n transform: rotate(150deg);\n -webkit-animation-delay: -0.5s;\n animation-delay: -0.5s;\n }\n .app-loader__spinner div:nth-child(7) {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n -webkit-animation-delay: -0.416666666666667s;\n animation-delay: -0.416666666666667s;\n }\n .app-loader__spinner div:nth-child(8) {\n -webkit-transform: rotate(210deg);\n transform: rotate(210deg);\n -webkit-animation-delay: -0.333333333333333s;\n animation-delay: -0.333333333333333s;\n }\n .app-loader__spinner div:nth-child(9) {\n -webkit-transform: rotate(240deg);\n transform: rotate(240deg);\n -webkit-animation-delay: -0.25s;\n animation-delay: -0.25s;\n }\n .app-loader__spinner div:nth-child(10) {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n -webkit-animation-delay: -0.166666666666667s;\n animation-delay: -0.166666666666667s;\n }\n .app-loader__spinner div:nth-child(11) {\n -webkit-transform: rotate(300deg);\n transform: rotate(300deg);\n -webkit-animation-delay: -0.083333333333333s;\n animation-delay: -0.083333333333333s;\n }\n .app-loader__spinner div:nth-child(12) {\n -webkit-transform: rotate(330deg);\n transform: rotate(330deg);\n -webkit-animation-delay: 0s;\n animation-delay: 0s;\n }\n .app-loader__spinner {\n width: 40px;\n height: 40px;\n -webkit-transform: translate(-20px, -20px) scale(0.2) translate(20px, 20px);\n transform: translate(-20px, -20px) scale(0.2) translate(20px, 20px);\n }\n </style>\n </head>\n\n <body>\n <div id=\"app-loader\" class=\"app-loader\">\n <div id=\"spinner\" class=\"app-loader__spinner\">\n <div></div><div></div><div></div><div></div><div></div><div></div><div>\n </div><div></div><div></div><div></div><div></div><div></div>\n </div>\n </div>\n </body>\n\n </html>\n";
357
- var backgroundCSS = "\n z-index: 999999999999999;\n background: transparent;\n background: rgba(0, 0, 0, 0.75);\n border: 0px none transparent;\n overflow-x: hidden;\n overflow-y: hidden;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.3s;\n -webkit-transition: opacity 0.3s;\n visibility: hidden;\n display: none;\n";
358
- var checkoutCSS = "\n z-index: 999999999999999;\n background: transparent;\n border: 0px none transparent;\n overflow-x: hidden;\n overflow-y: hidden;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n visibility: hidden;\n display: none;\n height: 100%;\n";
359
- var embedCSS = "\n background: transparent;\n background: rgba(0,0,0,0);\n border: 0px none transparent;\n overflow-x: hidden;\n overflow-y: hidden;\n nmargin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n visibility: hidden;\n display: none;\n";
360
- function generateInlineButtonCSS(variant) {
361
- var baseCSS = "\n box-sizing: border-box;\n display: inline-block;\n line-height: 1;\n white-space: nowrap;\n margin: 0 0 10px;\n text-align: center;\n -webkit-appearance: none;\n outline: none;\n font-size: 14px;\n font-weight: 600;\n border-radius: 6px;\n cursor: pointer;\n padding: 16px 24px;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15);\n transition: all .3s ease;\n border: none;\n min-width: 190px;\n ";
362
- var greenCSS = "\n background: linear-gradient(180deg,#44b669 0,#40ad57);\n text-shadow: 1px 1px 1px rgba(0,0,0,.1);\n color: #ffffff;\n ";
363
- var whiteCSS = "\n background: white;\n text-shadow: none;\n color: #011b33;\n ";
364
- var colorVariants = {
365
- normal: greenCSS,
366
- light: whiteCSS
367
- };
368
- return "".concat(baseCSS).concat(colorVariants[variant]);
369
- }
370
- function generateInlineButtonHTML(options) {
371
- var wordmarkVariants = {
372
- normal: secureByPaystack,
373
- light: secureByPaystackWhite
374
- };
375
- var buttonHTML = "\n <style>\n #inline-button-".concat(options.inlineId, " {\n position: relative;\n text-align: center;\n display: inline-block;\n }\n #inline-button-").concat(options.inlineId, "__trigger {\n ").concat(generateInlineButtonCSS(options.variant || 'normal'), "\n }\n #inline-button-").concat(options.inlineId, "__trigger:hover {\n box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);\n }\n #inline-button-").concat(options.inlineId, "__trigger:active {\n transform: translateY(3px);\n }\n </style>\n <button id=\"inline-button-").concat(options.inlineId, "__trigger\" data-inline-id=\"").concat(options.inlineId, "\">").concat(options.text || 'Pay', " ").concat(options.currency || 'NGN', " ").concat(options.amount, "</button>\n <div id=\"inline-button-").concat(options.inlineId, "__wordmark\">\n ").concat(wordmarkVariants[options.wordmarkVariant || 'normal'], "\n </div>\n ");
376
- return buttonHTML;
377
- }
378
- var defaultCustomApplePayStyles = {
379
- height: PAYMENT_REQUEST_BUTTON_HEIGHT,
380
- width: 'auto',
381
- borderRadius: '3px',
382
- padding: '10px',
383
- locale: 'en',
384
- type: 'pay'
385
- };
386
- var parseApplePayCustomStyles = function parseApplePayCustomStyles(styles) {
387
- if (!(styles && _typeof(styles) === 'object')) {
388
- return defaultCustomApplePayStyles;
389
- }
390
- var customStyles = Object.keys(defaultCustomApplePayStyles).reduce(function (newDefaultStyles, key) {
391
- return _objectSpread2(_objectSpread2({}, newDefaultStyles), {}, _defineProperty({}, key, styles[key] || defaultCustomApplePayStyles[key]));
392
- }, {});
393
- return customStyles;
394
- };
395
- var generateApplePayCSS = function generateApplePayCSS(_ref) {
396
- var height = _ref.height,
397
- width = _ref.width,
398
- borderRadius = _ref.borderRadius,
399
- padding = _ref.padding;
400
- return "\n apple-pay-button {\n --apple-pay-button-width: ".concat(width, ";\n --apple-pay-button-height: ").concat(height, ";\n --apple-pay-button-border-radius: ").concat(borderRadius, ";\n --apple-pay-button-padding: ").concat(padding, ";\n --apple-pay-button-box-sizing: border-box;\n width: ").concat(width, ";\n }\n");
401
- };
402
- var generateApplePayFallbackCSS = function generateApplePayFallbackCSS(_ref2) {
403
- var height = _ref2.height,
404
- width = _ref2.width,
405
- borderRadius = _ref2.borderRadius,
406
- padding = _ref2.padding,
407
- type = _ref2.type,
408
- locale = _ref2.locale;
409
- return "\n @supports (-webkit-appearance: -apple-pay-button) {\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n width: ".concat(width, ";\n height: ").concat(height, ";\n border-radius: ").concat(borderRadius, ";\n padding: ").concat(padding, ";\n -apple-pay-button-type: ").concat(type, ";\n -webkit-locale: ").concat(locale, ";\n }\n .apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n .apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n .apple-pay-button-white-with-line {\n -apple-pay-button-style: white-outline;\n }\n }\n\n @supports not (-webkit-appearance: -apple-pay-button) {\n .apple-pay-button {\n display: inline-block;\n background-size: 100% 60%;\n background-repeat: no-repeat;\n background-position: 50% 50%;\n border-radius: 5px;\n padding: 0px;\n box-sizing: border-box;\n min-width: 200px;\n min-height: 32px;\n max-height: 64px;\n }\n .apple-pay-button-black {\n background-image: -webkit-named-image(apple-pay-logo-white);\n background-color: black;\n }\n .apple-pay-button-white {\n background-image: -webkit-named-image(apple-pay-logo-black);\n background-color: white;\n }\n .apple-pay-button-white-with-line {\n background-image: -webkit-named-image(apple-pay-logo-black);\n background-color: white;\n border: .5px solid black;\n }\n }\n");
410
- };
411
- var generatePaymentRequestInnerWrapperCSS = function generatePaymentRequestInnerWrapperCSS(orientation) {
412
- var isVertical = orientation === PAYMENT_REQUEST_BUTTON_ORIENTATION.VERTICAL;
413
- return "\n #paystack-payment-request-inner-wrapper {\n display: flex;\n flex-direction: ".concat(isVertical ? 'column' : 'row', ";\n gap: 8px;\n width: 100%;\n max-width: 100%;\n }\n\n #paystack-payment-request-inner-wrapper > * {\n min-width: 0;\n ").concat(isVertical ? '' : 'flex: 1 1 0;', "\n }\n\n #paystack-payment-request-inner-wrapper > apple-pay-button,\n #paystack-payment-request-inner-wrapper > #apple-pay-button {\n order: 1;\n }\n #paystack-payment-request-inner-wrapper > #google-pay-button-container {\n order: 2;\n }\n");
414
- };
415
- var generateGooglePayCSS = function generateGooglePayCSS() {
416
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
417
- height = _ref3.height,
418
- width = _ref3.width;
419
- return "\n #google-pay-button-container {\n width: ".concat(width || 'auto', ";\n height: ").concat(height || PAYMENT_REQUEST_BUTTON_HEIGHT, ";\n overflow: hidden;\n }\n #google-pay-button-container:empty {\n display: none;\n }\n #google-pay-button-container > div,\n #google-pay-button-container button,\n #google-pay-button-container iframe {\n width: 100%;\n max-width: 100%;\n height: 100%;\n min-width: 100%;\n }\n #google-pay-button-container button {\n outline: none !important;\n }\n");
420
- };
421
- var generateGooglePayLoadingCSS = function generateGooglePayLoadingCSS() {
422
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
423
- borderRadius = _ref4.borderRadius,
424
- buttonColor = _ref4.buttonColor;
425
- var isWhite = buttonColor === 'white';
426
- return "\n #google-pay-loading-button {\n width: 100%;\n height: 100%;\n border: ".concat(isWhite ? '1px solid #3C4043' : 'none', ";\n border-radius: ").concat(borderRadius === undefined ? GOOGLE_PAY_BUTTON_RADIUS : borderRadius, "px;\n background: ").concat(isWhite ? '#ffffff' : '#000000', ";\n cursor: default;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n #google-pay-loading-button__spinner {\n width: 18px;\n height: 18px;\n border: 2px solid ").concat(isWhite ? 'rgba(60, 64, 67, 0.25)' : 'rgba(255, 255, 255, 0.35)', ";\n border-top-color: ").concat(isWhite ? '#3c4043' : '#ffffff', ";\n border-radius: 50%;\n animation: google-pay-spin 0.8s linear infinite;\n }\n @keyframes google-pay-spin {\n to { transform: rotate(360deg); }\n }\n");
427
- };
428
- function appendCSS(container, css) {
429
- var style = document.createElement('style');
430
- style.type = 'text/css';
431
- style.textContent = css;
432
- container.appendChild(style);
433
- }
434
-
435
- var amountSubunitToBase = function amountSubunitToBase() {
436
- var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
437
- return Number(parseFloat(amount / 100).toFixed(2));
438
- };
439
-
440
- /* eslint-disable prefer-promise-reject-errors */
441
- /* eslint-env browser */
442
-
443
- var loadScript = function loadScript(url) {
444
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
445
- container = _ref.container,
446
- integrity = _ref.integrity;
447
- return new Promise(function (resolve, reject) {
448
- if (!url) {
449
- reject('No script url');
450
- return;
451
- }
452
- var script = document.createElement('script');
453
- script.src = url;
454
- if (integrity) {
455
- script.crossOrigin = 'anonymous';
456
- script.integrity = integrity;
457
- }
458
- script.addEventListener('load', function () {
459
- resolve(true);
460
- });
461
- script.addEventListener('error', function () {
462
- script.remove();
463
- reject(false);
464
- });
465
- if (container) {
466
- container.appendChild(script);
467
- } else {
468
- document.head.appendChild(script);
469
- }
470
- });
471
- };
472
-
473
- var withTimeoutDelay = function withTimeoutDelay(work, delayInMilliseconds) {
474
- var onTimeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {
475
- return null;
476
- };
477
- var timeout;
478
- var delay = new Promise(function (resolve) {
479
- timeout = setTimeout(function () {
480
- try {
481
- resolve(onTimeout());
482
- } catch (error) {
483
- resolve(null);
484
- }
485
- }, delayInMilliseconds);
486
- });
487
- return Promise.race([work, delay]).finally(function () {
488
- return clearTimeout(timeout);
489
- });
490
- };
491
-
492
- /* eslint-env browser */
493
-
494
- var iOSDevices = ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'];
495
-
496
- /**
497
- * navigator.platform is deprecated and will eventually be removed
498
- * but the recommended alternative `navigator.userAgentData` has limited browser support
499
- * so it is used as a fallback here.
500
- */
501
- var DEVICE_PLATFORM = window && window.navigator && (window.navigator.platform || window.navigator.userAgentData && window.navigator.userAgentData.platform);
502
- var getDeviceInfo = function getDeviceInfo() {
503
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
504
- platform = _ref.platform,
505
- _ref$userAgent = _ref.userAgent,
506
- userAgent = _ref$userAgent === void 0 ? window && window.navigator && window.navigator.userAgent : _ref$userAgent;
507
- return {
508
- devicePlatform: platform || DEVICE_PLATFORM,
509
- deviceUserAgent: userAgent
510
- };
511
- };
512
- var isIOS = function isIOS() {
513
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
514
- var _getDeviceInfo = getDeviceInfo(options),
515
- devicePlatform = _getDeviceInfo.devicePlatform,
516
- deviceUserAgent = _getDeviceInfo.deviceUserAgent;
517
- return iOSDevices.includes(devicePlatform) ||
518
- // iPAD os safari detection. iPad OS uses the same version of safari as Mac OS
519
- deviceUserAgent.includes('Mac') && 'ontouchend' in document;
520
- };
521
- var isSafari = function isSafari() {
522
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
523
- var _getDeviceInfo2 = getDeviceInfo(options),
524
- deviceUserAgent = _getDeviceInfo2.deviceUserAgent;
525
- return Boolean(deviceUserAgent && !/Android/.test(deviceUserAgent) && /Version\/[\d.]+.*Safari/.test(deviceUserAgent));
526
- };
527
-
528
- // Safari and third-party iOS browsers both send a `Safari/` token; an embedded WKWebView sends none.
529
- var isIOSWebView = function isIOSWebView() {
530
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
531
- var _getDeviceInfo3 = getDeviceInfo(options),
532
- deviceUserAgent = _getDeviceInfo3.deviceUserAgent;
533
- return Boolean(deviceUserAgent) && isIOS(options) && !/Safari\//.test(deviceUserAgent);
534
- };
535
- var isAppleOS = function isAppleOS() {
536
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
537
- var _getDeviceInfo4 = getDeviceInfo(options),
538
- devicePlatform = _getDeviceInfo4.devicePlatform;
539
- return isIOS(options) || Boolean(devicePlatform && /Mac/i.test(devicePlatform));
540
- };
541
-
542
- var APPLE_PAY_UNSUPPORTED = 'applePayUnsupported';
543
- var hasNativeSupportCache = null;
544
- var sdkLoad = null;
545
- var requestConfig = {
546
- headers: {
547
- accept: 'application/json, text/plain, */*',
548
- 'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
549
- 'content-type': 'application/x-www-form-urlencoded',
550
- 'sec-ch-ua-mobile': '?0',
551
- 'sec-fetch-dest': 'empty',
552
- 'sec-fetch-mode': 'cors',
553
- 'sec-fetch-site': 'cross-site'
554
- },
555
- referrerPolicy: 'no-referrer-when-downgrade',
556
- method: 'POST',
557
- mode: 'cors',
558
- credentials: 'omit'
559
- };
560
- function createFormBody(params) {
561
- var formBody = Object.keys(params).reduce(function (formBodyArray, key) {
562
- var encodedKey = encodeURIComponent(key);
563
- var encodedValue = encodeURIComponent(params[key]);
564
- var encodedFormBody = "".concat(encodedKey, "=").concat(encodedValue);
565
- return [].concat(_toConsumableArray(formBodyArray), [encodedFormBody]);
566
- }, []);
567
- return formBody.join('&');
568
- }
569
- var formatIntervalString = function formatIntervalString(interval) {
570
- var plans = {
571
- biannually: 'BIANNUAL PLAN',
572
- annually: 'ANNUAL PLAN'
573
- };
574
- return plans[interval] || "".concat(interval.toUpperCase(), " PLAN");
575
- };
576
- var generateApplePaymentRequestObject = function generateApplePaymentRequestObject(_ref) {
577
- var currency = _ref.currency,
578
- amount = _ref.amount,
579
- merchantName = _ref.merchantName,
580
- interval = _ref.interval;
581
- return _objectSpread2({
582
- countryCode: CURRENCY_COUNTRYCODE_MAPPING[currency] || COUNTRYCODE.NIGERIA,
583
- currencyCode: currency,
584
- merchantCapabilities: ['supports3DS', 'supportsCredit', 'supportsDebit'],
585
- supportedNetworks: ['visa', 'masterCard'],
586
- requiredBillingContactFields: ['postalAddress', 'name', 'phone', 'email'],
587
- total: {
588
- label: "".concat(merchantName, " - Paystack"),
589
- type: 'final',
590
- amount: String(amountSubunitToBase(amount))
591
- }
592
- }, typeof interval === 'string' && interval.trim() !== '' && {
593
- lineItems: [{
594
- label: formatIntervalString(interval),
595
- amount: String(amountSubunitToBase(amount))
596
- }]
597
- });
598
- };
599
- var validateApplePaySession = function validateApplePaySession(_ref2) {
600
- var transactionId = _ref2.transactionId,
601
- accessCode = _ref2.accessCode,
602
- publicKey = _ref2.publicKey,
603
- validationURL = _ref2.validationURL,
604
- merchantName = _ref2.merchantName,
605
- _ref2$domainName = _ref2.domainName,
606
- domainName = _ref2$domainName === void 0 ? window && window.location && window.location.hostname : _ref2$domainName;
607
- var validateSessionUrl = "".concat(config.paymentBaseUrl).concat(config.applePayValidateSessionPath);
608
-
609
- // createFormBody would send a missing value as the text "undefined"
610
- var params = _objectSpread2(_objectSpread2(_objectSpread2({
611
- transaction: transactionId
612
- }, accessCode && {
613
- accessCode: accessCode
614
- }), publicKey && {
615
- publicKey: publicKey
616
- }), {}, {
617
- sessionUrl: validationURL,
618
- displayName: merchantName,
619
- domainName: domainName
620
- });
621
- var formBody = createFormBody(params);
622
- var validateSession = fetch(validateSessionUrl, _objectSpread2(_objectSpread2({}, requestConfig), {}, {
623
- body: formBody
624
- })).then(function (response) {
625
- return response.json();
626
- });
627
- return validateSession;
628
- };
629
- var chargeApplePay = function chargeApplePay(_ref3) {
630
- var transactionId = _ref3.transactionId,
631
- accessCode = _ref3.accessCode,
632
- payment = _ref3.payment;
633
- var chargeApplePayUrl = "".concat(config.paymentBaseUrl).concat(config.applePayChargePath);
634
-
635
- // createFormBody would send a missing access code as the text "undefined"
636
- var params = _objectSpread2(_objectSpread2({
637
- transaction: transactionId
638
- }, accessCode && {
639
- accessCode: accessCode
640
- }), {}, {
641
- paymentObject: JSON.stringify(payment)
642
- });
643
- var formBody = createFormBody(params);
644
- var charge = fetch(chargeApplePayUrl, _objectSpread2(_objectSpread2({}, requestConfig), {}, {
645
- body: formBody
646
- })).then(function (response) {
647
- return response.json();
648
- });
649
- return charge;
650
- };
651
- var deviceSupportsApplePay = function deviceSupportsApplePay() {
652
- try {
653
- return Boolean(isAppleOS() && (isSafari() || isIOSWebView()) && window.isSecureContext && window.ApplePaySession && !window.ApplePaySession.isNotWebkit && window.ApplePaySession.supportsVersion(config.applePayVersion));
654
- } catch (error) {
655
- return false;
656
- }
657
- };
658
-
659
- /**
660
- * Off WebKit the SDK installs its own `window.ApplePaySession` whose
661
- * `supportsVersion()` always returns true, so native support is only
662
- * trustworthy when read before the SDK loads.
663
- */
664
- var getNativeSupport = function getNativeSupport() {
665
- if (hasNativeSupportCache === null) {
666
- hasNativeSupportCache = deviceSupportsApplePay();
667
- }
668
- return hasNativeSupportCache;
669
- };
670
-
671
- /**
672
- * Off WebKit the SDK assigns `window.onbeforeunload` to close its QR-code
673
- * window, replacing any handler the merchant page set, such as an
674
- * unsaved-changes guard. Run both, and return the merchant's result because
675
- * that is what triggers the browser's "Leave site?" prompt.
676
- */
677
- var combineSdkAndMerchantBeforeUnload = function combineSdkAndMerchantBeforeUnload(merchantHandler) {
678
- var sdkHandler = window.onbeforeunload;
679
- if (sdkHandler === merchantHandler || typeof merchantHandler !== 'function' || typeof sdkHandler !== 'function') {
680
- return;
681
- }
682
- window.onbeforeunload = function combinedBeforeUnload(event) {
683
- var sdkResult = sdkHandler.call(window, event);
684
- var merchantResult = merchantHandler.call(window, event);
685
- return merchantResult !== undefined ? merchantResult : sdkResult;
686
- };
687
- };
688
- var loadApplePaySDK = function loadApplePaySDK() {
689
- if (!sdkLoad) {
690
- var merchantBeforeUnload = window.onbeforeunload;
691
- sdkLoad = loadScript(APPLE_PAY_SDK_SOURCE, {
692
- integrity: APPLE_PAY_SDK_INTEGRITY_HASH
693
- }).then(function () {
694
- combineSdkAndMerchantBeforeUnload(merchantBeforeUnload);
695
- return true;
696
- }).catch(function () {
697
- sdkLoad = null;
698
- return false;
699
- });
700
- }
701
- return sdkLoad;
702
- };
703
- var probeApplePayCapabilities = function probeApplePayCapabilities(merchantId) {
704
- return Promise.resolve().then(function () {
705
- if (typeof window.ApplePaySession.applePayCapabilities !== 'function') {
706
- return null;
707
- }
708
- return window.ApplePaySession.applePayCapabilities(merchantId);
709
- }).then(function (capabilities) {
710
- return (capabilities || {}).paymentCredentialStatus || null;
711
- }).catch(function () {
712
- return null;
713
- });
714
- };
715
- var loadThenProbe = function loadThenProbe(merchantId) {
716
- return loadApplePaySDK().then(function (sdkLoaded) {
717
- return (sdkLoaded ? probeApplePayCapabilities(merchantId) : Promise.resolve(null)).then(function (status) {
718
- return {
719
- status: status,
720
- sdkLoaded: sdkLoaded
721
- };
722
- });
723
- });
724
- };
725
- var normaliseRegisteredDomain = function normaliseRegisteredDomain(domain) {
726
- return String(domain).toLowerCase().replace(/\/+$/, '');
727
- };
728
- var isPageDomainRegisteredWithApple = function isPageDomainRegisteredWithApple(registeredDomains) {
729
- var hostname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.hostname;
730
- return Array.isArray(registeredDomains) && registeredDomains.some(function (domain) {
731
- return normaliseRegisteredDomain(domain) === hostname.toLowerCase();
732
- });
733
- };
734
- var shouldProbe = function shouldProbe(response, merchantId, hasNativeSupport) {
735
- var channels = response.channels || [];
736
- var applePaySettings = response.channel_settings && response.channel_settings.apple_pay || {};
737
- return channels.includes(CHANNELS.APPLE_PAY) && Boolean(merchantId) && (isPageDomainRegisteredWithApple(applePaySettings.domains) || hasNativeSupport);
738
- };
739
- var resolveApplePayStatus = function resolveApplePayStatus(response) {
740
- try {
741
- var safeResponse = response || {};
742
- var hasNativeSupport = getNativeSupport();
743
- var merchantId = safeResponse.channel_settings && safeResponse.channel_settings.apple_pay && safeResponse.channel_settings.apple_pay.merchant_identifier;
744
- if (!shouldProbe(safeResponse, merchantId, hasNativeSupport)) {
745
- return Promise.resolve({
746
- status: null,
747
- hasNativeSupport: hasNativeSupport,
748
- sdkLoaded: false
749
- });
750
- }
751
- return withTimeoutDelay(loadThenProbe(merchantId), APPLE_PAY_TIMEOUT_MS).catch(function () {
752
- return null;
753
- }).then(function (result) {
754
- return {
755
- status: result && result.status || null,
756
- hasNativeSupport: hasNativeSupport,
757
- sdkLoaded: Boolean(result && result.sdkLoaded)
758
- };
759
- });
760
- } catch (error) {
761
- return Promise.resolve({
762
- status: null,
763
- hasNativeSupport: false,
764
- sdkLoaded: false
765
- });
766
- }
767
- };
768
- var canUseApplePay = function canUseApplePay() {
769
- var channels = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
770
- var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
771
- status = _ref4.status,
772
- hasNativeSupport = _ref4.hasNativeSupport;
773
- if (!channels.includes(CHANNELS.APPLE_PAY)) {
774
- return false;
775
- }
776
- if (status && status !== APPLE_PAY_UNSUPPORTED) {
777
- return true;
778
- }
779
- return hasNativeSupport === true;
780
- };
781
-
782
- var getChannelAmount = function getChannelAmount(response, channel) {
783
- var channelFees = (response && response.channel_fees_and_amount || {})[channel];
784
- var amount = channelFees && channelFees.amount;
785
- return amount == null ? response && response.amount : amount;
786
- };
787
-
788
- // eslint-disable-next-line no-console
789
- var logWarning = console ? console.warn || console.log : function () {};
790
- function printDeprecationNotice(oldName, newName, extraMessage) {
791
- logWarning("\"".concat(oldName, "\" has been deprecated, please use \"").concat(newName, "\". ").concat(extraMessage || ''));
792
- }
793
-
794
- /**
795
- * Never advertised here: a `PAN_ONLY` charge comes back needing a 3DS step-up,
796
- * and inline-js can't handle it
797
- */
798
- var UNSUPPORTED_AUTH_METHODS = ['PAN_ONLY'];
799
- var paymentsClient = null;
800
- var paymentsClientEnvironment = null;
801
- var getGooglePayConfig = function getGooglePayConfig(transaction) {
802
- var response = transaction && transaction.response;
803
- var channelSettings = response && response.channel_settings;
804
- return channelSettings && channelSettings[CHANNELS.GOOGLE_PAY] || null;
805
- };
806
- var getSupportedAuthMethods = function getSupportedAuthMethods(googlePayConfig) {
807
- return (googlePayConfig && googlePayConfig.allowed_card_auth_methods || []).filter(function (authMethod) {
808
- return !UNSUPPORTED_AUTH_METHODS.includes(authMethod);
809
- });
810
- };
811
- var resolveGooglePayEnvironment = function resolveGooglePayEnvironment(response) {
812
- var isTest = !!response && response.domain === TRANSACTION_DOMAIN.TEST;
813
- return config.environment === ENVIRONMENT.PRODUCTION && !isTest ? 'PRODUCTION' : 'TEST';
814
- };
815
- var getGooglePayClient = function getGooglePayClient(environment) {
816
- if (!paymentsClient || paymentsClientEnvironment !== environment) {
817
- paymentsClient = new window.google.payments.api.PaymentsClient({
818
- environment: environment
819
- });
820
- paymentsClientEnvironment = environment;
821
- }
822
- return paymentsClient;
823
- };
824
- var hasGooglePaySDKLoaded = function hasGooglePaySDKLoaded() {
825
- return !!(window.google && window.google.payments && window.google.payments.api && window.google.payments.api.PaymentsClient);
826
- };
827
- var buildBaseRequest = function buildBaseRequest(googlePayConfig) {
828
- return {
829
- apiVersion: googlePayConfig.api_version.major,
830
- apiVersionMinor: googlePayConfig.api_version.minor
831
- };
832
- };
833
- var buildCardPaymentMethod = function buildCardPaymentMethod(googlePayConfig, authMethods) {
834
- return {
835
- type: 'CARD',
836
- parameters: {
837
- allowedAuthMethods: authMethods,
838
- allowedCardNetworks: googlePayConfig.allowed_card_networks,
839
- billingAddressRequired: true,
840
- billingAddressParameters: googlePayConfig.billing_address_parameters,
841
- assuranceDetailsRequired: true
842
- }
843
- };
844
- };
845
- var buildMerchantInfo = function buildMerchantInfo(googlePayConfig) {
846
- var merchantInfo = googlePayConfig.merchant_info || {};
847
- return {
848
- merchantId: merchantInfo.merchantId,
849
- merchantName: merchantInfo.merchantName,
850
- merchantOrigin: merchantInfo.merchantOrigin
851
- };
852
- };
853
- var warnOnOriginMismatch = function warnOnOriginMismatch(googlePayConfig) {
854
- var registeredOrigin = googlePayConfig.merchant_info && googlePayConfig.merchant_info.merchantOrigin;
855
- var hostname = window.location.hostname;
856
- if (registeredOrigin && registeredOrigin !== hostname) {
857
- logWarning("Google Pay: the registered merchantOrigin (\"".concat(registeredOrigin, "\") does not match this page (\"").concat(hostname, "\"). Google may reject the payment sheet. Update the domain in Dashboard > Developers > Google Pay."));
858
- }
859
- };
860
- var buildPaymentDataRequest = function buildPaymentDataRequest(transaction) {
861
- var googlePayConfig = getGooglePayConfig(transaction);
862
- var response = transaction.response;
863
- var authMethods = getSupportedAuthMethods(googlePayConfig);
864
- return _objectSpread2(_objectSpread2({}, buildBaseRequest(googlePayConfig)), {}, {
865
- allowedPaymentMethods: [_objectSpread2(_objectSpread2({}, buildCardPaymentMethod(googlePayConfig, authMethods)), {}, {
866
- tokenizationSpecification: googlePayConfig.tokenization_specification
867
- })],
868
- transactionInfo: {
869
- totalPriceStatus: 'FINAL',
870
- checkoutOption: 'COMPLETE_IMMEDIATE_PURCHASE',
871
- totalPrice: amountSubunitToBase(getChannelAmount(response, CHANNELS.GOOGLE_PAY)).toFixed(2),
872
- currencyCode: response.currency,
873
- countryCode: CURRENCY_COUNTRYCODE_MAPPING[response.currency] || COUNTRYCODE.NIGERIA
874
- },
875
- merchantInfo: buildMerchantInfo(googlePayConfig),
876
- emailRequired: true
877
- });
878
- };
879
- var chargeGooglePay = function chargeGooglePay(_ref) {
880
- var transactionId = _ref.transactionId,
881
- paymentData = _ref.paymentData;
882
- var chargeUrl = "".concat(config.paymentBaseUrl).concat(config.googlePayChargePath);
883
- return fetch(chargeUrl, {
884
- headers: {
885
- 'content-type': 'application/x-www-form-urlencoded'
886
- },
887
- method: 'POST',
888
- mode: 'cors',
889
- credentials: 'omit',
890
- body: createFormBody({
891
- transaction: transactionId,
892
- paymentObject: JSON.stringify(paymentData)
893
- })
894
- }).then(function (response) {
895
- return response.json();
896
- });
897
- };
898
- var canUseGooglePay = function canUseGooglePay(transaction) {
899
- var googlePayConfig = getGooglePayConfig(transaction);
900
- if (!googlePayConfig) {
901
- return Promise.resolve(null);
902
- }
903
- var authMethods = getSupportedAuthMethods(googlePayConfig);
904
- if (!authMethods.length || !googlePayConfig.tokenization_specification || !hasGooglePaySDKLoaded()) {
905
- return Promise.resolve(null);
906
- }
907
- warnOnOriginMismatch(googlePayConfig);
908
- var readiness = Promise.resolve().then(function () {
909
- var client = getGooglePayClient(resolveGooglePayEnvironment(transaction.response));
910
- return client.isReadyToPay(_objectSpread2(_objectSpread2({}, buildBaseRequest(googlePayConfig)), {}, {
911
- allowedPaymentMethods: [buildCardPaymentMethod(googlePayConfig, authMethods)],
912
- existingPaymentMethodRequired: true
913
- }));
914
- }).then(function (_ref2) {
915
- var result = _ref2.result;
916
- return !!result;
917
- }).catch(function () {
918
- return null;
919
- });
920
- return readiness;
921
- };
922
- var loadGooglePay = function loadGooglePay(transaction) {
923
- var response = transaction && transaction.response || {};
924
- var channels = response.channels || [];
925
- if (!channels.includes(CHANNELS.GOOGLE_PAY)) {
926
- return Promise.resolve(null);
927
- }
928
- var loadSdk = hasGooglePaySDKLoaded() ? Promise.resolve(true) : loadScript(GOOGLE_PAY_SDK_SOURCE).then(function () {
929
- return hasGooglePaySDKLoaded();
930
- });
931
- return withTimeoutDelay(loadSdk.catch(function () {
932
- return false;
933
- }).then(function (loaded) {
934
- if (!loaded) {
935
- return null;
936
- }
937
- return canUseGooglePay(transaction);
938
- }), GOOGLE_PAY_TIMEOUT_MS);
939
- };
940
-
941
- var _excluded$2 = ["height", "width", "borderRadius", "buttonRadius"];
942
- function createIframe(id) {
943
- var iframe = document.createElement('iframe');
944
- iframe.setAttribute('frameBorder', '0');
945
- iframe.setAttribute('allowtransparency', 'true');
946
- iframe.id = id;
947
- iframe.style.display = 'none';
948
- return iframe;
949
- }
950
- function mountCheckoutIframe(id) {
951
- var iframe = createIframe("inline-checkout-".concat(id));
952
- // `precheckout=true` tells checkout to render the precheckout view itself;
953
- // without it, checkout assumes an older inline-js that renders its own modal.
954
- iframe.src = "".concat(config.checkoutUrl, "popup?precheckout=true");
955
- iframe.style.cssText = checkoutCSS;
956
- iframe.style.colorScheme = 'light';
957
- iframe.setAttribute('allowpaymentrequest', 'true');
958
- iframe.setAttribute('allow', 'payment; clipboard-read; clipboard-write');
959
- document.body.appendChild(iframe);
960
- return iframe;
961
- }
962
- function mountBackgroundIframe(id) {
963
- var iframe = createIframe("inline-background-".concat(id));
964
- iframe.style.cssText = backgroundCSS;
965
- iframe.style.colorScheme = 'light';
966
- document.body.appendChild(iframe);
967
- var bgWindow = iframe.contentWindow.document;
968
- bgWindow.open();
969
- bgWindow.write(loaderHTML);
970
- bgWindow.close();
971
- return iframe;
972
- }
973
- function mountEmbedCheckoutIframe(id, src) {
974
- var iframe = createIframe("embed-checkout-".concat(id));
975
- iframe.style.cssText = embedCSS;
976
- iframe.src = src;
977
- iframe.id = id;
978
- iframe.name = id;
979
- iframe.setAttribute('allowpaymentrequest', 'true');
980
- iframe.setAttribute('allow', 'payment; clipboard-read; clipboard-write');
981
- return iframe;
982
- }
983
- function getApplePayButton(container) {
984
- return container.querySelector('apple-pay-button') || container.querySelector('#apple-pay-button');
985
- }
986
- function appendIframeToContainer(containerId, iframe) {
987
- var container = document.getElementById(containerId);
988
- container.innerHTML = '';
989
- container.removeAttribute('style');
990
- container.className = 'paystack-embed-container';
991
- container.style.position = 'relative';
992
- container.style.width = '100%';
993
- container.appendChild(iframe);
994
- }
995
- function hideLoader(iframe) {
996
- var bgWindow = iframe.contentWindow.document;
997
- if (bgWindow) {
998
- bgWindow.getElementById('app-loader').style.display = 'none';
999
- }
1000
- }
1001
- function animateCheckoutIn(domElements) {
1002
- return new Promise(function (resolve, reject) {
1003
- if (!domElements) {
1004
- reject('No dom element provided');
1005
- }
1006
- var checkoutIframe = domElements.checkoutIframe,
1007
- backgroundIframe = domElements.backgroundIframe;
1008
- if (!checkoutIframe || !backgroundIframe) {
1009
- reject('No dom element provided');
1010
- }
1011
- checkoutIframe.style.display = '';
1012
- checkoutIframe.style.visibility = 'visible';
1013
- backgroundIframe.style.display = '';
1014
- backgroundIframe.style.visibility = 'visible';
1015
- resolve();
1016
- });
1017
- }
1018
- function animateCheckoutOut(domElements) {
1019
- return new Promise(function (resolve, reject) {
1020
- if (!domElements) {
1021
- reject('No dom element provided');
1022
- }
1023
- var checkoutIframe = domElements.checkoutIframe,
1024
- backgroundIframe = domElements.backgroundIframe;
1025
- if (!checkoutIframe || !backgroundIframe) {
1026
- reject('No dom element provided');
1027
- }
1028
- backgroundIframe.style.opacity = 0;
1029
- checkoutIframe.style.display = 'none';
1030
- checkoutIframe.style.visibility = 'hidden';
1031
- setTimeout(function () {
1032
- backgroundIframe.style.display = 'none';
1033
- backgroundIframe.style.visibility = 'hidden';
1034
- backgroundIframe.style.opacity = 1;
1035
- resolve();
1036
- }, 300);
1037
- });
1038
- }
1039
- function mountLazyInlineButton(options) {
1040
- var inlineButton;
1041
- if (options.id) {
1042
- inlineButton = document.getElementById(options.id);
1043
- inlineButton.setAttribute('data-inline-id', options.id);
1044
- } else {
1045
- var inlineDiv = document.createElement('div');
1046
- inlineDiv.id = "inline-button-".concat(options.inlineId);
1047
- inlineDiv.innerHTML = generateInlineButtonHTML(options);
1048
- options.parent.parentNode.insertBefore(inlineDiv, options.parent.nextSibling);
1049
- var _inlineDiv$getElement = inlineDiv.getElementsByTagName('button');
1050
- var _inlineDiv$getElement2 = _slicedToArray(_inlineDiv$getElement, 1);
1051
- inlineButton = _inlineDiv$getElement2[0];
1052
- }
1053
- return inlineButton;
1054
- }
1055
- function animateEmbedCheckoutIn(checkoutIframe) {
1056
- return new Promise(function (resolve, reject) {
1057
- if (!checkoutIframe) {
1058
- reject('No dom element provided');
1059
- }
1060
- // eslint-disable-next-line no-param-reassign
1061
- checkoutIframe.style.display = '';
1062
- // eslint-disable-next-line no-param-reassign
1063
- checkoutIframe.style.visibility = 'visible';
1064
- resolve();
1065
- });
1066
- }
1067
- function mountInput(options) {
1068
- var type = options.type,
1069
- value = options.value,
1070
- name = options.name,
1071
- parent = options.parent;
1072
- var input = document.createElement('input');
1073
- input.type = type;
1074
- input.value = value;
1075
- input.name = name;
1076
- parent.appendChild(input);
1077
- }
1078
- function mountApplePayButton(container, _ref) {
1079
- var styles = _ref.styles,
1080
- theme = _ref.theme,
1081
- onClick = _ref.onClick;
1082
- appendCSS(container, generateApplePayCSS(styles));
1083
- var button = document.createElement('apple-pay-button');
1084
- button.setAttribute('buttonstyle', theme === PAYMENT_REQUEST_BUTTON_THEME.LIGHT ? 'white' : 'black');
1085
- button.setAttribute('type', styles.type);
1086
- button.setAttribute('locale', styles.locale);
1087
- if (onClick) {
1088
- button.onclick = onClick;
1089
- }
1090
- container.appendChild(button);
1091
- return button;
1092
- }
1093
- function mountApplePayFallbackButton(container, _ref2) {
1094
- var styles = _ref2.styles,
1095
- theme = _ref2.theme,
1096
- onClick = _ref2.onClick;
1097
- appendCSS(container, generateApplePayFallbackCSS(styles));
1098
- var button = document.createElement('button');
1099
- button.classList.add('apple-pay-button', theme === PAYMENT_REQUEST_BUTTON_THEME.LIGHT ? 'apple-pay-button-white' : 'apple-pay-button-black');
1100
- button.id = 'apple-pay-button';
1101
- var applePayLogo = document.createElement('span');
1102
- applePayLogo.classList.add('logo');
1103
- button.appendChild(applePayLogo);
1104
- if (onClick) {
1105
- button.onclick = onClick;
1106
- }
1107
- container.appendChild(button);
1108
- return button;
1109
- }
1110
- function getPaymentRequestContainer(container) {
1111
- return document.querySelector("#".concat(container));
1112
- }
1113
- function removeAllChildNodes(parent) {
1114
- while (parent.firstChild) {
1115
- parent.removeChild(parent.firstChild);
1116
- }
1117
- }
1118
- function getGooglePayButton(container) {
1119
- return container.querySelector('#google-pay-button-container');
1120
- }
1121
- function toggleGooglePayLoadingState(container, isLoading) {
1122
- if (!container) {
1123
- return;
1124
- }
1125
- var button = container.querySelector('#google-pay-button');
1126
- var loadingButton = container.querySelector('#google-pay-loading-button');
1127
- if (!button || !loadingButton) {
1128
- return;
1129
- }
1130
- button.style.display = isLoading ? 'none' : '';
1131
- loadingButton.style.display = isLoading ? 'flex' : 'none';
1132
- }
1133
- var resolveGooglePayButtonRadius = function resolveGooglePayButtonRadius(borderRadius, buttonRadius) {
1134
- var parsed = parseFloat(borderRadius !== undefined ? borderRadius : buttonRadius);
1135
- return parsed >= 0 ? parsed : GOOGLE_PAY_BUTTON_RADIUS;
1136
- };
1137
- function mountGooglePayButton(container, _ref3) {
1138
- var transaction = _ref3.transaction,
1139
- _ref3$styles = _ref3.styles,
1140
- styles = _ref3$styles === void 0 ? {} : _ref3$styles,
1141
- onClick = _ref3.onClick;
1142
- var _ref4 = styles.googlePay || {},
1143
- height = _ref4.height,
1144
- width = _ref4.width,
1145
- borderRadius = _ref4.borderRadius,
1146
- buttonRadius = _ref4.buttonRadius,
1147
- googlePayStyles = _objectWithoutProperties(_ref4, _excluded$2);
1148
- var googlePayConfig = getGooglePayConfig(transaction);
1149
- var radius = resolveGooglePayButtonRadius(borderRadius, buttonRadius);
1150
- appendCSS(container, generateGooglePayCSS({
1151
- height: height,
1152
- width: width
1153
- }));
1154
- var buttonColor = googlePayStyles.buttonColor || (styles.theme === PAYMENT_REQUEST_BUTTON_THEME.LIGHT ? 'white' : 'black');
1155
- appendCSS(container, generateGooglePayLoadingCSS({
1156
- borderRadius: radius,
1157
- buttonColor: buttonColor
1158
- }));
1159
- var buttonContainer = document.createElement('div');
1160
- buttonContainer.id = 'google-pay-button-container';
1161
- var client = getGooglePayClient(resolveGooglePayEnvironment(transaction.response));
1162
- var button = client.createButton(_objectSpread2(_objectSpread2({
1163
- buttonColor: buttonColor,
1164
- buttonType: 'pay',
1165
- buttonRadius: radius,
1166
- buttonSizeMode: 'fill'
1167
- }, googlePayStyles), {}, {
1168
- onClick: onClick,
1169
- allowedPaymentMethods: [buildCardPaymentMethod(googlePayConfig, getSupportedAuthMethods(googlePayConfig))]
1170
- }));
1171
- container.appendChild(buttonContainer);
1172
- var buttonWrapper = document.createElement('div');
1173
- buttonWrapper.id = 'google-pay-button';
1174
- buttonWrapper.appendChild(button);
1175
- buttonContainer.appendChild(buttonWrapper);
1176
- var loadingButton = document.createElement('button');
1177
- loadingButton.id = 'google-pay-loading-button';
1178
- loadingButton.type = 'button';
1179
- loadingButton.disabled = true;
1180
- loadingButton.setAttribute('aria-busy', 'true');
1181
- loadingButton.style.display = 'none';
1182
- var spinner = document.createElement('span');
1183
- spinner.id = 'google-pay-loading-button__spinner';
1184
- loadingButton.appendChild(spinner);
1185
- buttonContainer.appendChild(loadingButton);
1186
- return buttonContainer;
1187
- }
1188
- function getMountedPaymentRequestButtons(container) {
1189
- if (!container) {
1190
- return [];
1191
- }
1192
- return [getApplePayButton(container), getGooglePayButton(container)].filter(Boolean);
1193
- }
1194
- function mountUsableApplePayButton(container, _ref5, options) {
1195
- var sdkLoaded = _ref5.sdkLoaded,
1196
- hasNativeSupport = _ref5.hasNativeSupport;
1197
- if (sdkLoaded) {
1198
- return mountApplePayButton(container, options);
1199
- }
1200
- if (hasNativeSupport) {
1201
- return mountApplePayFallbackButton(container, options);
1202
- }
1203
- logWarning('Apple Pay: the Apple Pay SDK did not load, so no Apple Pay button is shown.');
1204
- return null;
1205
- }
1206
- function mountPaymentRequestButtons(container, _ref6) {
1207
- var transaction = _ref6.transaction,
1208
- _ref6$styles = _ref6.styles,
1209
- styles = _ref6$styles === void 0 ? {} : _ref6$styles,
1210
- onClickApplePayButton = _ref6.onClickApplePayButton,
1211
- onClickGooglePayButton = _ref6.onClickGooglePayButton;
1212
- if (!container) {
1213
- return Promise.reject('Container to mount elements was not provided');
1214
- }
1215
- removeAllChildNodes(container);
1216
- appendCSS(container, generatePaymentRequestInnerWrapperCSS(styles.orientation));
1217
- var innerWrapper = document.createElement('div');
1218
- innerWrapper.id = 'paystack-payment-request-inner-wrapper';
1219
- innerWrapper.style.display = 'none';
1220
- container.appendChild(innerWrapper);
1221
- var applePayOptions = {
1222
- styles: parseApplePayCustomStyles(styles.applePay),
1223
- theme: styles.theme,
1224
- onClick: onClickApplePayButton
1225
- };
1226
- var channels = transaction.response && transaction.response.channels || [];
1227
- var applePayButton = resolveApplePayStatus(transaction.response).then(function (applePay) {
1228
- if (canUseApplePay(channels, applePay)) {
1229
- return mountUsableApplePayButton(innerWrapper, applePay, applePayOptions);
1230
- }
1231
- if (channels.includes(CHANNELS.APPLE_PAY)) {
1232
- logWarning('Apple Pay: this device, browser or page cannot pay with Apple Pay here.');
1233
- }
1234
- return null;
1235
- }).catch(function () {
1236
- return null;
1237
- });
1238
- var googlePayButton = loadGooglePay(transaction).then(function (isReadyToPay) {
1239
- if (!isReadyToPay) {
1240
- return null;
1241
- }
1242
- return mountGooglePayButton(innerWrapper, {
1243
- transaction: transaction,
1244
- styles: styles,
1245
- onClick: onClickGooglePayButton
1246
- });
1247
- }).catch(function () {
1248
- return null;
1249
- });
1250
- return Promise.all([applePayButton, googlePayButton]).then(function (_ref7) {
1251
- var _ref8 = _slicedToArray(_ref7, 2),
1252
- applePay = _ref8[0],
1253
- googlePay = _ref8[1];
1254
- if (!applePay && !googlePay) {
1255
- return null;
1256
- }
1257
- innerWrapper.style.display = '';
1258
- return {
1259
- applePay: !!applePay,
1260
- googlePay: !!googlePay
1261
- };
1262
- });
1263
- }
1264
-
1265
- var allParameters = [{
1266
- value: 'key',
1267
- required: true,
1268
- types: ['string']
1269
- }, {
1270
- value: 'amount',
1271
- required: true,
1272
- or: ['plan', 'planCode'],
1273
- types: ['string', 'number']
1274
- }, {
1275
- value: 'currency',
1276
- required: false,
1277
- types: ['string']
1278
- }, {
1279
- value: 'email',
1280
- required: true,
1281
- or: ['customerCode'],
1282
- types: ['string']
1283
- }, {
1284
- value: 'label',
1285
- required: false,
1286
- types: ['string']
1287
- }, {
1288
- value: 'firstName',
1289
- required: false,
1290
- types: ['string']
1291
- }, {
1292
- value: 'lastName',
1293
- required: false,
1294
- types: ['string']
1295
- }, {
1296
- value: 'reference',
1297
- required: false,
1298
- types: ['string']
1299
- }, {
1300
- value: 'phone',
1301
- required: false,
1302
- types: ['string']
1303
- }, {
1304
- value: 'customerCode',
1305
- required: false,
1306
- override: 'email',
1307
- types: ['string']
1308
- }, {
1309
- value: 'channels',
1310
- required: false,
1311
- types: ['array']
1312
- }, {
1313
- value: 'paymentRequest',
1314
- required: false,
1315
- types: ['string', 'number']
1316
- }, {
1317
- value: 'paymentPage',
1318
- required: false,
1319
- types: ['string']
1320
- }, {
1321
- value: 'hash',
1322
- required: false,
1323
- types: ['string']
1324
- }, {
1325
- value: 'container',
1326
- required: false,
1327
- types: ['string']
1328
- }, {
1329
- value: 'metadata',
1330
- required: false,
1331
- types: ['object']
1332
- }, {
1333
- value: 'subaccountCode',
1334
- required: false,
1335
- types: ['string']
1336
- }, {
1337
- value: 'bearer',
1338
- required: false,
1339
- types: ['string']
1340
- }, {
1341
- value: 'transactionCharge',
1342
- required: false,
1343
- types: ['string', 'number']
1344
- }, {
1345
- value: 'planCode',
1346
- required: false,
1347
- override: 'amount',
1348
- types: ['string']
1349
- }, {
1350
- value: 'subscriptionCount',
1351
- required: false,
1352
- types: ['number']
1353
- }, {
1354
- value: 'planInterval',
1355
- required: false,
1356
- types: ['string']
1357
- }, {
1358
- value: 'subscriptionLimit',
1359
- required: false,
1360
- types: ['number']
1361
- }, {
1362
- value: 'subscriptionStartDate',
1363
- required: false,
1364
- types: ['string']
1365
- }, {
1366
- value: 'accessCode',
1367
- required: false,
1368
- types: ['string']
1369
- }, {
1370
- value: 'onError',
1371
- required: false,
1372
- types: ['function']
1373
- }, {
1374
- value: 'onLoad',
1375
- required: false,
1376
- types: ['function']
1377
- }, {
1378
- value: 'onSuccess',
1379
- required: false,
1380
- types: ['function']
1381
- }, {
1382
- value: 'onCancel',
1383
- required: false,
1384
- types: ['function']
1385
- }, {
1386
- value: 'callback',
1387
- required: false,
1388
- types: ['function']
1389
- }, {
1390
- value: 'onClose',
1391
- required: false,
1392
- types: ['function']
1393
- }, {
1394
- value: 'onBankTransferConfirmationPending',
1395
- required: false,
1396
- types: ['function']
1397
- }, {
1398
- value: 'firstname',
1399
- required: false,
1400
- types: ['string']
1401
- }, {
1402
- value: 'lastname',
1403
- required: false,
1404
- types: ['string']
1405
- }, {
1406
- value: 'customer_code',
1407
- required: false,
1408
- types: ['string']
1409
- }, {
1410
- value: 'payment_request',
1411
- required: false,
1412
- types: ['string', 'number']
1413
- }, {
1414
- value: 'subaccount',
1415
- required: false,
1416
- types: ['string']
1417
- }, {
1418
- value: 'transaction_charge',
1419
- required: false,
1420
- types: ['number', 'string']
1421
- }, {
1422
- value: 'plan',
1423
- required: false,
1424
- types: ['string']
1425
- }, {
1426
- value: 'quantity',
1427
- required: false,
1428
- types: ['number']
1429
- }, {
1430
- value: 'interval',
1431
- required: false,
1432
- types: ['string']
1433
- }, {
1434
- value: 'invoice_limit',
1435
- required: false,
1436
- types: ['number', 'string']
1437
- }, {
1438
- value: 'start_date',
1439
- required: false,
1440
- types: ['string']
1441
- }, {
1442
- value: 'payment_page',
1443
- required: false,
1444
- types: ['number', 'string']
1445
- }, {
1446
- value: 'order_id',
1447
- required: false,
1448
- types: ['number']
1449
- }, {
1450
- value: 'ref',
1451
- required: false,
1452
- types: ['string']
1453
- }, {
1454
- value: 'card',
1455
- required: false,
1456
- types: ['string']
1457
- }, {
1458
- value: 'bank',
1459
- required: false,
1460
- types: ['string']
1461
- }, {
1462
- value: 'split',
1463
- required: false,
1464
- types: ['object']
1465
- }, {
1466
- value: 'split_code',
1467
- required: false,
1468
- types: ['string']
1469
- }, {
1470
- value: 'transaction_type',
1471
- required: false,
1472
- types: ['string']
1473
- }, {
1474
- value: 'subscription',
1475
- required: false,
1476
- types: ['number']
1477
- }, {
1478
- value: 'language',
1479
- required: false,
1480
- types: ['string']
1481
- }, {
1482
- value: 'connect_account',
1483
- required: false,
1484
- types: ['string']
1485
- }, {
1486
- value: 'connect_split',
1487
- required: false,
1488
- types: ['array']
1489
- }];
1490
- function validate(args) {
1491
- function ValidationError(message, issues) {
1492
- this.message = message;
1493
- this.issues = issues || [];
1494
- }
1495
- if (!args || _typeof(args) !== 'object') {
1496
- throw new ValidationError('Transaction parameters should be a non-empty object');
1497
- }
1498
- var transactionParameters = args;
1499
-
1500
- // If it's a transaction resumption, move on
1501
- if ('accessCode' in transactionParameters) {
1502
- var accessCode = transactionParameters.accessCode;
1503
- return {
1504
- accessCode: accessCode
1505
- };
1506
- }
1507
-
1508
- // Filter unneeded parameters
1509
- Object.keys(transactionParameters).forEach(function (key) {
1510
- var usedParameter = allParameters.find(function (parameter) {
1511
- return parameter.value === key;
1512
- }) !== undefined;
1513
- if (!usedParameter) {
1514
- delete transactionParameters[key];
1515
- }
1516
- });
1517
- var transactionKeys = Object.keys(transactionParameters);
1518
- var validationErrors = [];
1519
-
1520
- // Check for required parameters
1521
- var requiredParameters = allParameters.filter(function (param) {
1522
- return param.required;
1523
- });
1524
- requiredParameters.forEach(function (key) {
1525
- var parameterIsMissing = !transactionParameters[key.value];
1526
- var parameterHasAlternative = key.or ? key.or.some(function (option) {
1527
- return transactionParameters[option];
1528
- }) : null;
1529
- if (parameterIsMissing && !parameterHasAlternative) {
1530
- validationErrors.push({
1531
- message: "Required parameter missing: ".concat(key.value)
1532
- });
1533
- }
1534
- });
1535
-
1536
- // Check for validity
1537
- transactionKeys.forEach(function (key) {
1538
- var parameterValue = transactionParameters[key];
1539
- var parameterObject = allParameters.find(function (parameter) {
1540
- return parameter.value === key;
1541
- });
1542
- var providedType = _typeof(parameterValue);
1543
- if (providedType === 'object' && Array.isArray(parameterValue)) {
1544
- providedType = 'array';
1545
- }
1546
- var invalidType = parameterObject.types.indexOf(providedType) <= -1;
1547
- if (invalidType) {
1548
- validationErrors.push({
1549
- message: "Invalid parameter type: ".concat(key),
1550
- validTypes: parameterObject.types
1551
- });
1552
- }
1553
- });
1554
-
1555
- // Override keys where necessary
1556
- transactionKeys.forEach(function (key) {
1557
- var parameterObject = allParameters.find(function (parameter) {
1558
- return parameter.value === key;
1559
- });
1560
- if (parameterObject.override) {
1561
- delete transactionParameters[parameterObject.override];
1562
- }
1563
- });
1564
- if (validationErrors.length) {
1565
- throw new ValidationError('Invalid transaction parameters', validationErrors);
1566
- }
1567
- return transactionParameters;
1568
- }
1569
-
1570
- /* eslint-env browser */
1571
- function splitURL(url) {
1572
- if ((url === null || url === void 0 ? void 0 : url.length) > 500) {
1573
- return url.split('?')[0];
1574
- }
1575
- return url;
1576
- }
1577
- function getReferrer() {
1578
- var _window$location = window.location,
1579
- _window$location$href = _window$location.href,
1580
- href = _window$location$href === void 0 ? '' : _window$location$href,
1581
- _window$location$ance = _window$location.ancestorOrigins,
1582
- ancestorOrigins = _window$location$ance === void 0 ? [] : _window$location$ance;
1583
- return [href].concat(_toConsumableArray(ancestorOrigins)).map(splitURL).join(',');
1584
- }
1585
-
1586
- function buildQuery(parameters) {
1587
- var formattedParameters = _objectSpread2({}, parameters);
1588
- formattedParameters.metadata = parameters.metadata || {};
1589
- formattedParameters.metadata.referrer = getReferrer();
1590
- formattedParameters.metadata = JSON.stringify(formattedParameters.metadata);
1591
- formattedParameters.mode = 'popup';
1592
- if (parameters.split && typeof parameters.split !== 'string') {
1593
- formattedParameters.split = JSON.stringify(formattedParameters.split);
1594
- }
1595
- var parametersToChange = [{
1596
- to: 'firstname',
1597
- from: 'firstName'
1598
- }, {
1599
- to: 'lastname',
1600
- from: 'lastName'
1601
- }, {
1602
- to: 'customer_code',
1603
- from: 'customerCode'
1604
- }, {
1605
- to: 'payment_request',
1606
- from: 'paymentRequest'
1607
- }, {
1608
- to: 'subaccount',
1609
- from: 'subaccountCode'
1610
- }, {
1611
- to: 'transaction_charge',
1612
- from: 'transactionCharge'
1613
- }, {
1614
- to: 'plan',
1615
- from: 'planCode'
1616
- }, {
1617
- to: 'quantity',
1618
- from: 'subscriptionCount'
1619
- }, {
1620
- to: 'interval',
1621
- from: 'planInterval'
1622
- }, {
1623
- to: 'invoice_limit',
1624
- from: 'subscriptionLimit'
1625
- }, {
1626
- to: 'start_date',
1627
- from: 'subscriptionStartDate'
1628
- }, {
1629
- to: 'ref',
1630
- from: 'reference'
1631
- }];
1632
-
1633
- // handle very old case of people disabling channels by sending card/bank params
1634
-
1635
- if (formattedParameters.card !== undefined && ['false', false].indexOf(formattedParameters.card) > -1) {
1636
- formattedParameters.channels = ['bank'];
1637
- delete formattedParameters.card;
1638
- }
1639
- if (formattedParameters.bank !== undefined && ['false', false].indexOf(formattedParameters.bank) > -1) {
1640
- formattedParameters.channels = ['card'];
1641
- delete formattedParameters.bank;
1642
- }
1643
- parametersToChange.forEach(function (key) {
1644
- var hasValue = formattedParameters[key.from];
1645
- if (hasValue) {
1646
- formattedParameters[key.to] = formattedParameters[key.from];
1647
- delete formattedParameters[key.from];
1648
- }
1649
- });
1650
- Object.values(parameters).forEach(function (value, index) {
1651
- if (typeof value === 'function') {
1652
- var key = Object.keys(parameters)[index];
1653
- delete formattedParameters[key];
1654
- }
1655
- });
1656
- return formattedParameters;
1657
- }
1658
-
1659
- /* eslint-env browser */
1660
- var AnalyticsAPI = {
1661
- saveLog: function saveLog(transactionId, merchantPublicKey, log) {
1662
- var url = "".concat(config.paystackApiUrl, "transaction/update_log/").concat(transactionId);
1663
- var headers = {
1664
- Authorization: "Bearer ".concat(merchantPublicKey)
1665
- };
1666
- return fetch(url, {
1667
- method: 'POST',
1668
- body: JSON.stringify({
1669
- payload: JSON.stringify(log)
1670
- }),
1671
- headers: headers
1672
- });
1673
- },
1674
- saveIp: function saveIp(transactionId, merchantPublicKey) {
1675
- var url = "".concat(config.paystackApiUrl, "transaction/set_ip/").concat(transactionId);
1676
- var headers = {
1677
- Authorization: "Bearer ".concat(merchantPublicKey)
1678
- };
1679
- return fetch(url, {
1680
- method: 'POST',
1681
- headers: headers
1682
- });
1683
- }
1684
- };
1685
-
1686
- var AnalyticsFunctions = {
1687
- initializeLog: function initializeLog(log) {
1688
- var _ref = log || {},
1689
- attempts = _ref.attempts,
1690
- authentication = _ref.authentication,
1691
- errors = _ref.errors,
1692
- history = _ref.history;
1693
- this.log = {
1694
- start_time: Math.round(Date.now() / 1000),
1695
- time_spent: 0,
1696
- attempts: attempts || 0,
1697
- authentication: authentication,
1698
- errors: errors || 0,
1699
- success: false,
1700
- mobile: isIOS(),
1701
- input: [],
1702
- history: history || []
1703
- };
1704
- },
1705
- getTimeSpent: function getTimeSpent() {
1706
- var currentTimeInSeconds = Math.round(Date.now() / 1000);
1707
- this.log.time_spent = currentTimeInSeconds - this.log.start_time;
1708
- return this.log.time_spent;
1709
- },
1710
- logAPIResponse: function logAPIResponse(response, channel) {
1711
- switch (response.status) {
1712
- case TRANSACTION_STATUS.SUCCESS:
1713
- return this.logApiSuccess(channel);
1714
- case TRANSACTION_STATUS.FAILED:
1715
- return this.logApiError(response.message);
1716
- default:
1717
- return false;
1718
- }
1719
- },
1720
- logValidationResponse: function logValidationResponse(message) {
1721
- this.log.history.push({
1722
- type: 'action',
1723
- message: message,
1724
- time: this.getTimeSpent()
1725
- });
1726
- return this.saveLog();
1727
- },
1728
- logAttempt: function logAttempt(channel) {
1729
- var message = 'Attempted to pay';
1730
- if (channel) {
1731
- message += " with ".concat(channel);
1732
- }
1733
- this.log.attempts += 1;
1734
- this.log.history.push({
1735
- type: 'action',
1736
- message: message,
1737
- time: this.getTimeSpent()
1738
- });
1739
- return this.saveLog();
1740
- },
1741
- logApiError: function logApiError(error) {
1742
- var message = 'Error';
1743
- if (error) {
1744
- message += ": ".concat(error);
1745
- }
1746
- this.log.errors += 1;
1747
- this.log.history.push({
1748
- type: 'error',
1749
- message: message,
1750
- time: this.getTimeSpent()
1751
- });
1752
- return this.saveLog();
1753
- },
1754
- logApiSuccess: function logApiSuccess(channel) {
1755
- var message = 'Successfully paid';
1756
- if (channel) {
1757
- message += " with ".concat(channel);
1758
- }
1759
- this.log.success = true;
1760
- this.log.history.push({
1761
- type: 'success',
1762
- message: message,
1763
- time: this.getTimeSpent()
1764
- });
1765
- return this.saveLog();
1766
- },
1767
- saveLog: function saveLog() {
1768
- try {
1769
- if (this.response) {
1770
- return AnalyticsAPI.saveLog(this.id, this.response.merchant_key, this.log);
1771
- }
1772
- } catch (error) {
1773
- // we don't need to do anything since this should not affect the transaction
1774
- }
1775
- return undefined;
1776
- },
1777
- saveIpAddress: function saveIpAddress() {
1778
- try {
1779
- if (this.response) {
1780
- return AnalyticsAPI.saveIp(this.id, this.response.merchant_key);
1781
- }
1782
- } catch (error) {
1783
- // we don't need to do anything since this should not affect the transaction
1784
- }
1785
- return undefined;
1786
- }
1787
- };
1788
-
1789
- var _excluded$1 = ["language", "connect_account"];
1790
- var TransactionApi = {
1791
- requestInline: function requestInline() {
1792
- var inlineTransactionInstance = this;
1793
- var _this$urlParameters = this.urlParameters,
1794
- language = _this$urlParameters.language,
1795
- connectAccount = _this$urlParameters.connect_account,
1796
- params = _objectWithoutProperties(_this$urlParameters, _excluded$1);
1797
- var request;
1798
- var headers = _objectSpread2({
1799
- 'Content-Type': 'application/json'
1800
- }, language && {
1801
- 'Accept-Language': language
1802
- });
1803
- if (this.accessCode) {
1804
- request = fetch(new URL("transaction/verify_access_code/".concat(this.accessCode), config.paystackApiUrl).toString(), {
1805
- headers: headers
1806
- });
1807
- } else {
1808
- request = fetch(new URL('/checkout/request_inline', config.paystackApiUrl).toString(), {
1809
- method: 'POST',
1810
- body: JSON.stringify(params),
1811
- headers: _objectSpread2(_objectSpread2({}, headers), connectAccount && {
1812
- 'x-connect-account': connectAccount
1813
- })
1814
- });
1815
- }
1816
- return request.then(function (res) {
1817
- return res.json();
1818
- }).then(function (res) {
1819
- if (res.status === false) {
1820
- throw new Error(res.message);
1821
- }
1822
- inlineTransactionInstance.response = res.data;
1823
- inlineTransactionInstance.id = res.data.id;
1824
- inlineTransactionInstance.status = res.data.transaction_status;
1825
- inlineTransactionInstance.accessCode = res.data.access_code;
1826
-
1827
- // Analytics
1828
- inlineTransactionInstance.log = null;
1829
- Object.assign(inlineTransactionInstance, AnalyticsFunctions);
1830
- inlineTransactionInstance.initializeLog(res.data.log);
1831
- inlineTransactionInstance.saveIpAddress();
1832
- return res.data;
1833
- });
1834
- }
1835
- };
1836
-
1837
- var InlineTransaction = /*#__PURE__*/function () {
1838
- function InlineTransaction(data) {
1839
- _classCallCheck(this, InlineTransaction);
1840
- validate(data);
1841
- this.parameters = data;
1842
- this.urlParameters = buildQuery(data);
1843
- this.id = null;
1844
- this.status = null;
1845
- this.accessCode = data.accessCode || null;
1846
- this.authorizationUrl = null;
1847
- this.errors = [];
1848
- this.response = null;
1849
- this.isActive = true;
1850
- var onError = data.onError,
1851
- onLoad = data.onLoad,
1852
- onSuccess = data.onSuccess,
1853
- onCancel = data.onCancel,
1854
- callback = data.callback,
1855
- onClose = data.onClose,
1856
- onBankTransferConfirmationPending = data.onBankTransferConfirmationPending;
1857
- this.callbacks = {
1858
- onError: onError,
1859
- onLoad: onLoad,
1860
- onSuccess: onSuccess,
1861
- onCancel: onCancel,
1862
- onBankTransferConfirmationPending: onBankTransferConfirmationPending
1863
- };
1864
- this.deprecatedCallbacks = {
1865
- callback: callback,
1866
- onClose: onClose
1867
- };
1868
- Object.assign(this, TransactionApi);
1869
- }
1870
- return _createClass(InlineTransaction, [{
1871
- key: "onSetupError",
1872
- value: function onSetupError(response) {
1873
- this.logError(response);
1874
- if (this.callbacks.onError) {
1875
- this.callbacks.onError(response);
1876
- }
1877
- }
1878
- }, {
1879
- key: "onLoad",
1880
- value: function onLoad(response) {
1881
- var id = response.id,
1882
- customer = response.customer,
1883
- accessCode = response.accessCode;
1884
- Object.assign(this, {
1885
- id: id,
1886
- customer: customer,
1887
- accessCode: accessCode
1888
- });
1889
- this.authorizationUrl = "".concat(config.checkoutUrl).concat(accessCode);
1890
- if (this.callbacks.onLoad) {
1891
- this.callbacks.onLoad({
1892
- id: id,
1893
- customer: customer,
1894
- accessCode: accessCode
1895
- });
1896
- }
1897
- }
1898
- }, {
1899
- key: "onSuccess",
1900
- value: function onSuccess(response) {
1901
- this.isActive = false;
1902
- this.response = response;
1903
- this.status = response.status;
1904
- if (this.callbacks.onSuccess) {
1905
- this.callbacks.onSuccess(response);
1906
- }
1907
- // Added for backwards compatibility
1908
- if (this.deprecatedCallbacks.callback) {
1909
- this.deprecatedCallbacks.callback(response);
1910
- }
1911
- }
1912
- }, {
1913
- key: "setStatus",
1914
- value: function setStatus(status) {
1915
- this.status = status;
1916
- }
1917
- }, {
1918
- key: "onCancel",
1919
- value: function onCancel() {
1920
- if (this.callbacks.onCancel) {
1921
- this.callbacks.onCancel();
1922
- }
1923
- // Added for backwards compatibility
1924
- if (this.deprecatedCallbacks.onClose) {
1925
- this.deprecatedCallbacks.onClose();
1926
- }
1927
- }
1928
- }, {
1929
- key: "cancel",
1930
- value: function cancel() {
1931
- this.isActive = false;
1932
- this.onCancel();
1933
- }
1934
- }, {
1935
- key: "onBankTransferConfirmationPending",
1936
- value: function onBankTransferConfirmationPending() {
1937
- this.cancel();
1938
- if (this.callbacks.onBankTransferConfirmationPending) {
1939
- this.callbacks.onBankTransferConfirmationPending();
1940
- }
1941
- }
1942
- }, {
1943
- key: "logError",
1944
- value: function logError(error) {
1945
- this.errors.push(error);
1946
- }
1947
- }]);
1948
- }();
1949
-
1950
- var _excluded = ["preload", "inlineTransaction", "transactionData"],
1951
- _excluded2 = ["container", "styles", "onElementsMount"],
1952
- _excluded3 = ["data"];
1953
- var inlineInstance;
1954
- function findResumableTransaction(transactions, parameters) {
1955
- if (!transactions.length) {
1956
- return null;
1957
- }
1958
- var similarAbandonedTransactions = transactions.filter(function (transaction) {
1959
- var isAbandoned = !transaction.status || transaction.status === 'abandoned';
1960
- var hasSimilarParameters = similarObjects(transaction.parameters, parameters);
1961
- return isAbandoned && hasSimilarParameters;
1962
- });
1963
- var resumableTransaction = similarAbandonedTransactions.length ? similarAbandonedTransactions[similarAbandonedTransactions.length - 1] : null;
1964
- return resumableTransaction;
1965
- }
1966
- function notifyIframeToUpdateURL(options) {
1967
- var checkoutIframe = options.checkoutIframe,
1968
- urlParameters = options.urlParameters;
1969
- if (!checkoutIframe || !urlParameters) {
1970
- return;
1971
- }
1972
- checkoutIframe.contentWindow.postMessage({
1973
- type: 'inline:url',
1974
- path: 'newTransaction',
1975
- params: urlParameters
1976
- }, '*');
1977
- }
1978
- var analyticsActions = {
1979
- TRACK_PAYMENT_ERROR: 'trackPaymentError',
1980
- TRACK_PAYMENT_ATTEMPT: 'trackPaymentAttempt',
1981
- TRACK_PAYMENT_COMPLETION: 'trackPaymentCompletion'
1982
- };
1983
- function handleError(message) {
1984
- logWarning(message);
1985
- throw new Error(message);
1986
- }
1987
- var Inline = /*#__PURE__*/function () {
1988
- function Inline(params) {
1989
- _classCallCheck(this, Inline);
1990
- this.id = randomId();
1991
- this.transactions = [];
1992
- this.isOpen = false;
1993
- this.isLoaded = false;
1994
- this.isCharging = false;
1995
- this.isDeprecatedApi = params && params.isDeprecatedApi; // track deprecatedApi
1996
- if (params && params.isEmbed) {
1997
- this.isEmbed = true;
1998
- } else if (params && params.isPaymentRequest) {
1999
- if (!(params.container && getPaymentRequestContainer(params.container))) {
2000
- handleError('A container is required to mount the payment request button');
2001
- }
2002
- this.paymentRequestContainer = getPaymentRequestContainer(params.container);
2003
- this.paymentRequestTransaction = null;
2004
- }
2005
- this.backgroundIframe = mountBackgroundIframe(this.id);
2006
- this.checkoutIframe = mountCheckoutIframe(this.id);
2007
- this.registerListeners();
2008
- }
2009
- return _createClass(Inline, [{
2010
- key: "registerListeners",
2011
- value: function registerListeners() {
2012
- var _this = this;
2013
- window.addEventListener('message', function (event) {
2014
- var isCheckoutIframe = "".concat(event.origin, "/") === config.checkoutUrl;
2015
- var isThisInline = _this.checkoutIframe && _this.checkoutIframe.contentWindow === event.source;
2016
- var isEmbed = _this.isEmbed;
2017
- if (isCheckoutIframe || isThisInline) {
2018
- _this.respondToEvent(event);
2019
- } else if (isEmbed) {
2020
- _this.respondToEmbedEvents(event);
2021
- }
2022
- });
2023
- }
2024
- }, {
2025
- key: "sendAnalyticsEventToCheckout",
2026
- value: function sendAnalyticsEventToCheckout(action, params) {
2027
- this.checkoutIframe.contentWindow.postMessage({
2028
- type: 'analytics',
2029
- action: action,
2030
- params: params
2031
- }, '*');
2032
- }
2033
- }, {
2034
- key: "checkout",
2035
- value: function checkout(params) {
2036
- if (this.activeTransaction()) {
2037
- this.activeTransaction().cancel();
2038
- }
2039
- inlineInstance = this;
2040
- var resumableTransaction = findResumableTransaction(this.transactions, params);
2041
- var transaction = resumableTransaction || new InlineTransaction(params);
2042
- return new Promise(function (resolve, reject) {
2043
- transaction.requestInline().then(function (response) {
2044
- inlineInstance.newTransaction({
2045
- inlineTransaction: transaction,
2046
- transactionData: response
2047
- });
2048
- resolve(transaction);
2049
- }).catch(function (error) {
2050
- transaction.onSetupError({
2051
- status: false,
2052
- message: error.message
2053
- });
2054
- reject(error);
2055
- });
2056
- });
2057
- }
2058
- }, {
2059
- key: "newTransaction",
2060
- value: function newTransaction(_ref) {
2061
- var preload = _ref.preload,
2062
- inlineTransaction = _ref.inlineTransaction,
2063
- transactionData = _ref.transactionData,
2064
- options = _objectWithoutProperties(_ref, _excluded);
2065
- var hasPaymentRequestButtons = this.hasMountedPaymentRequestButtons();
2066
- var activeTransaction = this.activeTransaction();
2067
- if (activeTransaction && !hasPaymentRequestButtons && activeTransaction !== inlineTransaction) {
2068
- activeTransaction.cancel();
2069
- }
2070
- if (inlineTransaction && transactionData) {
2071
- if (!this.transactions.includes(inlineTransaction)) {
2072
- this.transactions.push(inlineTransaction);
2073
- }
2074
- if (!this.isDeprecatedApi) {
2075
- // TODO: reintroduce this when we resolve checkout caching issues
2076
- // this.open({ transactionData }, preload);
2077
- this.open({
2078
- accessCode: transactionData.access_code,
2079
- language: inlineTransaction.urlParameters.language
2080
- }, preload);
2081
- }
2082
- return inlineTransaction;
2083
- }
2084
- var resumableTransaction = findResumableTransaction(this.transactions, inlineTransaction ? inlineTransaction.parameters : options);
2085
- if (resumableTransaction) {
2086
- resumableTransaction.isActive = true;
2087
- if (!this.isDeprecatedApi) {
2088
- // We could potentially optimize this also by checking if there is a `response` property on `resumableTransaction`
2089
- this.open({
2090
- accessCode: resumableTransaction.accessCode,
2091
- language: resumableTransaction.urlParameters.language
2092
- }, preload);
2093
- }
2094
- return resumableTransaction;
2095
- }
2096
- var transaction = inlineTransaction || new InlineTransaction(options);
2097
- var params = transaction.accessCode ? {
2098
- accessCode: transaction.accessCode,
2099
- language: transaction.urlParameters.language
2100
- } : transaction.urlParameters;
2101
- this.transactions.push(transaction);
2102
- if (!this.isDeprecatedApi) {
2103
- this.open(params, preload);
2104
- }
2105
- return transaction;
2106
- }
2107
- }, {
2108
- key: "preloadTransaction",
2109
- value: function preloadTransaction(options) {
2110
- var _this2 = this;
2111
- this.newTransaction(_objectSpread2(_objectSpread2({}, options), {}, {
2112
- preload: true
2113
- }));
2114
- var loadPopup = function loadPopup() {
2115
- return _this2.animateCheckoutIn();
2116
- };
2117
- return loadPopup;
2118
- }
2119
- }, {
2120
- key: "paymentRequest",
2121
- value: function paymentRequest(parameters) {
2122
- var _this3 = this;
2123
- var container = parameters.container,
2124
- styles = parameters.styles,
2125
- onElementsMount = parameters.onElementsMount,
2126
- transactionParams = _objectWithoutProperties(parameters, _excluded2);
2127
- if ('channels' in transactionParams) {
2128
- transactionParams.channels = withCardForGooglePay(transactionParams.channels);
2129
- }
2130
- inlineInstance = this;
2131
- return new Promise(function (resolve, reject) {
2132
- var loadPaystackCheckoutButton = document.querySelector("#".concat(parameters.loadPaystackCheckoutButton));
2133
- if (inlineInstance.activeTransaction()) {
2134
- inlineInstance.activeTransaction().cancel();
2135
- }
2136
- if (!(container && getPaymentRequestContainer(container))) {
2137
- handleError('A container is required to mount the payment request button');
2138
- }
2139
- inlineInstance.paymentRequestContainer = getPaymentRequestContainer(container);
2140
- var resumableTransaction = findResumableTransaction(inlineInstance.transactions, transactionParams);
2141
- var transaction = resumableTransaction || new InlineTransaction(transactionParams);
2142
- transaction.requestInline().then(function (response) {
2143
- if (resumableTransaction) {
2144
- transaction.isActive = true;
2145
- } else {
2146
- inlineInstance.transactions.push(transaction);
2147
- }
2148
- return mountPaymentRequestButtons(inlineInstance.paymentRequestContainer, {
2149
- transaction: transaction,
2150
- styles: styles,
2151
- onClickApplePayButton: function onClickApplePayButton() {
2152
- return _this3.startApplePay(transaction);
2153
- },
2154
- onClickGooglePayButton: function onClickGooglePayButton() {
2155
- return _this3.startGooglePay(transaction);
2156
- }
2157
- }).then(function (mountedElements) {
2158
- if (onElementsMount) {
2159
- onElementsMount(mountedElements);
2160
- }
2161
- }).catch(function () {
2162
- if (onElementsMount) {
2163
- onElementsMount(null);
2164
- }
2165
- }).finally(function () {
2166
- if (loadPaystackCheckoutButton) {
2167
- var loadPopup = inlineInstance.preloadTransaction({
2168
- inlineTransaction: transaction,
2169
- transactionData: response
2170
- });
2171
- loadPaystackCheckoutButton.onclick = loadPopup;
2172
- } else if (!inlineInstance.hasMountedPaymentRequestButtons()) {
2173
- logWarning("No payment request button could be mounted on this device. Please consult our documentation at https://developers.paystack.co/docs/paystack-inline to see how to load alternative payment options using 'loadPaystackCheckoutButton'");
2174
- }
2175
- resolve(transaction);
2176
- });
2177
- }).catch(function (error) {
2178
- transaction.onSetupError({
2179
- status: false,
2180
- message: error.message
2181
- });
2182
- reject(error);
2183
- });
2184
- });
2185
- }
2186
- }, {
2187
- key: "hasMountedPaymentRequestButtons",
2188
- value: function hasMountedPaymentRequestButtons() {
2189
- return getMountedPaymentRequestButtons(this.paymentRequestContainer).length > 0;
2190
- }
2191
- }, {
2192
- key: "startGooglePay",
2193
- value: function startGooglePay(inlineTransaction) {
2194
- var _this4 = this;
2195
- var paymentMethod = 'google pay';
2196
- var transaction = inlineTransaction || this.activeTransaction();
2197
- if (inlineTransaction && !inlineTransaction.isActive) {
2198
- logWarning('Google Pay: this button belongs to a transaction that is no longer active.');
2199
- return Promise.resolve();
2200
- }
2201
- if (transaction && transaction.response) {
2202
- if (this.isCharging) {
2203
- return Promise.resolve();
2204
- }
2205
- this.isCharging = true;
2206
- var notifyMerchant = function notifyMerchant(notify) {
2207
- try {
2208
- notify();
2209
- } catch (error) {
2210
- logWarning("Google Pay: a merchant callback threw. ".concat(error && error.message || error));
2211
- }
2212
- };
2213
- try {
2214
- var analyticsPayload = {
2215
- channel: CHANNELS.GOOGLE_PAY,
2216
- currency: transaction.response.currency,
2217
- amount: getChannelAmount(transaction.response, CHANNELS.GOOGLE_PAY)
2218
- };
2219
- transaction.logAttempt(paymentMethod);
2220
- this.sendAnalyticsEventToCheckout(analyticsActions.TRACK_PAYMENT_ATTEMPT, _objectSpread2(_objectSpread2({}, analyticsPayload), {}, {
2221
- paymentMethod: paymentMethod
2222
- }));
2223
- var client = getGooglePayClient(resolveGooglePayEnvironment(transaction.response));
2224
- return client.loadPaymentData(buildPaymentDataRequest(transaction)).then(function (paymentData) {
2225
- toggleGooglePayLoadingState(_this4.paymentRequestContainer, true);
2226
- return chargeGooglePay({
2227
- transactionId: transaction.id,
2228
- paymentData: paymentData
2229
- });
2230
- }).then(function (response) {
2231
- toggleGooglePayLoadingState(_this4.paymentRequestContainer, false);
2232
- _this4.isCharging = false;
2233
- transaction.logAPIResponse(response, paymentMethod);
2234
- if (response.status === TRANSACTION_STATUS.SUCCESS) {
2235
- var data = response.data,
2236
- envelope = _objectWithoutProperties(response, _excluded3);
2237
- notifyMerchant(function () {
2238
- return transaction.onSuccess(_objectSpread2(_objectSpread2({}, data), envelope));
2239
- });
2240
- _this4.sendAnalyticsEventToCheckout(analyticsActions.TRACK_PAYMENT_COMPLETION, _objectSpread2(_objectSpread2({}, analyticsPayload), {}, {
2241
- timeSpent: transaction.getTimeSpent()
2242
- }));
2243
- return;
2244
- }
2245
-
2246
- // `auth` means a step-up we cannot render here, so say so rather
2247
- // than leaving the customer holding a token with nowhere to go.
2248
- var message = response.status === TRANSACTION_STATUS.AUTH ? 'This card requires additional authentication, which is not supported here. Please use another payment method.' : response && response.message || 'Transaction attempt failed';
2249
- notifyMerchant(function () {
2250
- return transaction.onSetupError(_objectSpread2(_objectSpread2({}, response), {}, {
2251
- message: message
2252
- }));
2253
- });
2254
- _this4.sendAnalyticsEventToCheckout(analyticsActions.TRACK_PAYMENT_ERROR, {
2255
- channel: CHANNELS.GOOGLE_PAY,
2256
- message: message
2257
- });
2258
- }, function (error) {
2259
- toggleGooglePayLoadingState(_this4.paymentRequestContainer, false);
2260
- _this4.isCharging = false;
2261
- if (error && error.statusCode === GOOGLE_PAY_STATUS_CODE.CANCELED) {
2262
- notifyMerchant(function () {
2263
- return transaction.onCancel();
2264
- });
2265
- return;
2266
- }
2267
- var statusCode = error && error.statusCode;
2268
- if (statusCode === GOOGLE_PAY_STATUS_CODE.DEVELOPER_ERROR || statusCode === GOOGLE_PAY_STATUS_CODE.MERCHANT_ACCOUNT_ERROR) {
2269
- logWarning("Google Pay: ".concat(statusCode, ". Google rejected the merchant or the origin serving the button. Check that the merchant ID and domain saved in Dashboard > Developers > Google Pay match this page."));
2270
- }
2271
- var message = error && (error.statusMessage || error.message) || 'Could not complete the Google Pay payment';
2272
- notifyMerchant(function () {
2273
- return transaction.onSetupError({
2274
- status: false,
2275
- message: message
2276
- });
2277
- });
2278
- _this4.sendAnalyticsEventToCheckout(analyticsActions.TRACK_PAYMENT_ERROR, {
2279
- channel: CHANNELS.GOOGLE_PAY,
2280
- message: message
2281
- });
2282
- }).catch(function (error) {
2283
- _this4.isCharging = false;
2284
- logWarning("Google Pay: the charge handler failed. ".concat(error && error.message || error));
2285
- notifyMerchant(function () {
2286
- return transaction.onSetupError({
2287
- status: false,
2288
- message: 'Could not complete the Google Pay payment'
2289
- });
2290
- });
2291
- });
2292
- } catch (error) {
2293
- this.isCharging = false;
2294
- logWarning('Google Pay: could not start the charge.');
2295
- notifyMerchant(function () {
2296
- return transaction.onSetupError({
2297
- status: false,
2298
- message: 'Could not complete the Google Pay payment'
2299
- });
2300
- });
2301
- return Promise.resolve();
2302
- }
2303
- } else {
2304
- handleError('Could not initiate google pay transaction');
2305
- }
2306
- return Promise.resolve();
2307
- }
2308
- }, {
2309
- key: "startApplePay",
2310
- value: function startApplePay(inlineTransaction) {
2311
- var _this5 = this;
2312
- var paymentMethod = 'apple pay';
2313
- var transaction = inlineTransaction || this.activeTransaction();
2314
- if (inlineTransaction && !inlineTransaction.isActive) {
2315
- logWarning('Apple Pay: this button belongs to a transaction that is no longer active.');
2316
- return;
2317
- }
2318
- if (transaction && transaction.response) {
2319
- if (this.isCharging) {
2320
- return;
2321
- }
2322
- this.isCharging = true;
2323
- try {
2324
- var analyticsPayload = {
2325
- channel: CHANNELS.APPLE_PAY,
2326
- currency: transaction.response.currency,
2327
- amount: getChannelAmount(transaction.response, CHANNELS.APPLE_PAY)
2328
- };
2329
- transaction.logAttempt(paymentMethod);
2330
- this.sendAnalyticsEventToCheckout(analyticsActions.TRACK_PAYMENT_ATTEMPT, _objectSpread2(_objectSpread2({}, analyticsPayload), {}, {
2331
- paymentMethod: paymentMethod
2332
- }));
2333
- var applePayPaymentRequest = generateApplePaymentRequestObject({
2334
- currency: transaction.response.currency,
2335
- amount: getChannelAmount(transaction.response, CHANNELS.APPLE_PAY),
2336
- merchantName: transaction.response.merchant_name,
2337
- interval: transaction.response.plan_details && transaction.response.plan_details.interval
2338
- });
2339
- var applePaySession = new window.ApplePaySession(config.applePayVersion, applePayPaymentRequest);
2340
- applePaySession.onvalidatemerchant = function (_ref2) {
2341
- var validationURL = _ref2.validationURL;
2342
- var validateSession = validateApplePaySession({
2343
- validationURL: validationURL,
2344
- transactionId: transaction.id,
2345
- accessCode: transaction.accessCode,
2346
- publicKey: transaction.parameters.key,
2347
- merchantName: transaction.response.merchant_name
2348
- });
2349
- validateSession.then(function (response) {
2350
- if (response.status !== TRANSACTION_STATUS.SUCCESS) {
2351
- _this5.isCharging = false;
2352
- transaction.onSetupError(response);
2353
- } else {
2354
- applePaySession.completeMerchantValidation(response.data);
2355
- }
2356
- transaction.logValidationResponse(response.message);
2357
- }).catch(function (error) {
2358
- _this5.isCharging = false;
2359
- transaction.onSetupError(error);
2360
- });
2361
- };
2362
- applePaySession.oncancel = function () {
2363
- _this5.isCharging = false;
2364
- transaction.onCancel();
2365
- };
2366
- applePaySession.onpaymentauthorized = function (_ref3) {
2367
- var payment = _ref3.payment;
2368
- var charge = chargeApplePay({
2369
- transactionId: transaction.id,
2370
- accessCode: transaction.accessCode,
2371
- payment: payment
2372
- });
2373
- charge.then(function (response) {
2374
- transaction.logAPIResponse(response, paymentMethod);
2375
- _this5.isCharging = false;
2376
- if (response.status === TRANSACTION_STATUS.SUCCESS) {
2377
- applePaySession.completePayment(window.ApplePaySession.STATUS_SUCCESS);
2378
- transaction.onSuccess(response);
2379
- _this5.sendAnalyticsEventToCheckout(analyticsActions.TRACK_PAYMENT_COMPLETION, _objectSpread2(_objectSpread2({}, analyticsPayload), {}, {
2380
- timeSpent: transaction.getTimeSpent()
2381
- }));
2382
- } else {
2383
- applePaySession.completePayment(window.ApplePaySession.STATUS_FAILURE);
2384
- transaction.onSetupError(response);
2385
- _this5.sendAnalyticsEventToCheckout(analyticsActions.TRACK_PAYMENT_ERROR, {
2386
- channel: CHANNELS.APPLE_PAY,
2387
- message: response && response.message || 'Transaction attempt failed'
2388
- });
2389
- }
2390
- }).catch(function (error) {
2391
- _this5.isCharging = false;
2392
- applePaySession.completePayment(window.ApplePaySession.STATUS_FAILURE);
2393
- transaction.onSetupError(error);
2394
- _this5.sendAnalyticsEventToCheckout(analyticsActions.TRACK_PAYMENT_ERROR, {
2395
- channel: CHANNELS.APPLE_PAY,
2396
- message: error && error.message || 'Error occurred'
2397
- });
2398
- });
2399
- };
2400
- applePaySession.begin();
2401
- } catch (error) {
2402
- this.isCharging = false;
2403
- transaction.onSetupError(error);
2404
- }
2405
- } else {
2406
- handleError('Could not initiate apple pay transaction');
2407
- }
2408
- }
2409
- }, {
2410
- key: "resumeTransaction",
2411
- value: function resumeTransaction(accessCode) {
2412
- var callbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2413
- var onSuccess = callbacks.onSuccess,
2414
- onCancel = callbacks.onCancel,
2415
- onLoad = callbacks.onLoad,
2416
- onError = callbacks.onError;
2417
- return this.newTransaction({
2418
- accessCode: accessCode,
2419
- onSuccess: onSuccess,
2420
- onCancel: onCancel,
2421
- onLoad: onLoad,
2422
- onError: onError
2423
- });
2424
- }
2425
- }, {
2426
- key: "activeTransaction",
2427
- value: function activeTransaction() {
2428
- var activeTransactions = this.transactions.filter(function (transaction) {
2429
- return transaction.isActive;
2430
- });
2431
- var activeTransaction = activeTransactions.length ? activeTransactions[activeTransactions.length - 1] : null;
2432
- return activeTransaction;
2433
- }
2434
- }, {
2435
- key: "cancelTransaction",
2436
- value: function cancelTransaction(id) {
2437
- var transaction = this.transactions.find(function (t) {
2438
- return t.id === id;
2439
- }) || this.activeTransaction();
2440
- if (transaction) {
2441
- transaction.cancel();
2442
- this.close();
2443
- }
2444
- }
2445
- }, {
2446
- key: "respondToEvent",
2447
- value: function respondToEvent(event) {
2448
- if (!event) {
2449
- return;
2450
- }
2451
- var activeTransaction = this.activeTransaction();
2452
- try {
2453
- var actualEvent = event.data || event.message;
2454
- var eventType = actualEvent.event,
2455
- eventData = actualEvent.data;
2456
- if (eventType) {
2457
- switch (eventType) {
2458
- case 'loaded:checkout':
2459
- this.isLoaded = true;
2460
- if (activeTransaction) {
2461
- var checkoutIframe = this.checkoutIframe;
2462
- var urlParameters = activeTransaction.urlParameters,
2463
- response = activeTransaction.response;
2464
- // TODO: reintroduce this when we resolve checkout caching issues
2465
- // const params = response
2466
- // ? { transactionData: response }
2467
- // : urlParameters;
2468
-
2469
- var params = response ? {
2470
- accessCode: response.access_code,
2471
- language: urlParameters === null || urlParameters === void 0 ? void 0 : urlParameters.language
2472
- } : urlParameters;
2473
- notifyIframeToUpdateURL({
2474
- checkoutIframe: checkoutIframe,
2475
- urlParameters: params
2476
- });
2477
- }
2478
- break;
2479
- case 'loaded:transaction':
2480
- hideLoader(this.backgroundIframe);
2481
- activeTransaction.onLoad(eventData);
2482
- break;
2483
- case 'error':
2484
- {
2485
- var error = eventData;
2486
- if (error.type === 'setup') {
2487
- activeTransaction.onSetupError(eventData);
2488
- } else {
2489
- activeTransaction.logError(eventData);
2490
- }
2491
- break;
2492
- }
2493
- case 'cancel':
2494
- case 'close':
2495
- {
2496
- this.close();
2497
- var status = eventData && eventData.status;
2498
- if (status) {
2499
- activeTransaction.setStatus(status);
2500
- }
2501
- var hasPaymentRequestButtons = this.hasMountedPaymentRequestButtons();
2502
- if (!hasPaymentRequestButtons) {
2503
- activeTransaction.isActive = false;
2504
- }
2505
- activeTransaction.onCancel();
2506
- break;
2507
- }
2508
- case 'transfer:pending':
2509
- {
2510
- this.close();
2511
- var _status = eventData && eventData.status;
2512
- if (_status) {
2513
- activeTransaction.setStatus(_status);
2514
- }
2515
- activeTransaction.onBankTransferConfirmationPending();
2516
- break;
2517
- }
2518
- case 'success':
2519
- this.close();
2520
- activeTransaction.onSuccess(eventData);
2521
- break;
2522
- default:
2523
- break;
2524
- }
2525
- }
2526
- } catch (error) {
2527
- // do nothing
2528
- }
2529
- }
2530
- }, {
2531
- key: "respondToEmbedEvents",
2532
- value: function respondToEmbedEvents(event) {
2533
- var activeTransaction = this.activeTransaction();
2534
- var eventData = event.data || event.message;
2535
- if (eventData && (typeof eventData === 'string' || eventData instanceof String)) {
2536
- var response = parseResponse(eventData);
2537
- var oldCheckoutCloseResponse = response && response.action === 'PaystackClose';
2538
- if (oldCheckoutCloseResponse) {
2539
- var chargeResponse = response.data;
2540
- if (chargeResponse) {
2541
- activeTransaction.onSuccess(eventData);
2542
- }
2543
- }
2544
- if (response.action === 'PaystackTLSClose') {
2545
- activeTransaction.cancel();
2546
- }
2547
- }
2548
- }
2549
- }, {
2550
- key: "animateCheckoutIn",
2551
- value: function animateCheckoutIn$1() {
2552
- var _this6 = this;
2553
- if (!this.isOpen) {
2554
- var checkoutIframe = this.checkoutIframe,
2555
- backgroundIframe = this.backgroundIframe;
2556
- animateCheckoutIn({
2557
- checkoutIframe: checkoutIframe,
2558
- backgroundIframe: backgroundIframe
2559
- }).then(function () {
2560
- _this6.checkoutIframe.contentWindow.postMessage('render', '*');
2561
- });
2562
- this.isOpen = true;
2563
- }
2564
- }
2565
- }, {
2566
- key: "open",
2567
- value: function open(urlParameters, preload) {
2568
- if (!urlParameters) {
2569
- return;
2570
- }
2571
- var checkoutIframe = this.checkoutIframe;
2572
- notifyIframeToUpdateURL({
2573
- checkoutIframe: checkoutIframe,
2574
- urlParameters: urlParameters
2575
- });
2576
- if (!preload) {
2577
- this.animateCheckoutIn();
2578
- }
2579
- }
2580
- }, {
2581
- key: "close",
2582
- value: function close() {
2583
- var _this7 = this;
2584
- if (!this.isOpen) {
2585
- return;
2586
- }
2587
- var checkoutIframe = this.checkoutIframe,
2588
- backgroundIframe = this.backgroundIframe;
2589
- animateCheckoutOut({
2590
- checkoutIframe: checkoutIframe,
2591
- backgroundIframe: backgroundIframe
2592
- }).then(function () {
2593
- _this7.checkoutIframe.contentWindow.postMessage('close', '*');
2594
- });
2595
- this.isOpen = false;
2596
- }
2597
- }, {
2598
- key: "isLoaded",
2599
- value: function isLoaded() {
2600
- return this.isLoaded;
2601
- }
2602
- }], [{
2603
- key: "setup",
2604
- value: function setup(parameters) {
2605
- var isDeprecatedApi = true;
2606
- var isEmbed = parameters && parameters.container;
2607
- if (!inlineInstance) {
2608
- inlineInstance = new Inline({
2609
- isDeprecatedApi: isDeprecatedApi,
2610
- isEmbed: isEmbed
2611
- });
2612
- }
2613
- printDeprecationNotice('PaystackPop.setup()', 'new PaystackPop()', 'Please consult our documentation at https://developers.paystack.co/docs/paystack-inline');
2614
- var transaction = inlineInstance.newTransaction(parameters, 'deprecated');
2615
- var urlParameters = transaction.urlParameters;
2616
- if (isEmbed) {
2617
- var inlineUrl = "".concat(config.siteUrl, "/assets/payment/production/inline.html?").concat(serialize(urlParameters));
2618
- var iframe = mountEmbedCheckoutIframe(inlineInstance.id, inlineUrl);
2619
- appendIframeToContainer(parameters.container, iframe);
2620
- iframe.onload = function onLoad() {
2621
- iframe.contentWindow.postMessage("PaystackOpen ".concat(inlineInstance.id), '*');
2622
- animateEmbedCheckoutIn(iframe);
2623
- };
2624
- } else {
2625
- // attach openIframe method
2626
- transaction.openIframe = function () {
2627
- printDeprecationNotice('openIframe', 'open', 'Please consult our documentation at https://developers.paystack.co/docs/paystack-inline');
2628
- inlineInstance.open(urlParameters);
2629
- };
2630
- }
2631
- return transaction;
2632
- }
2633
- }]);
2634
- }();
2635
- if (scriptCanUseDataAttributes()) {
2636
- var parameters = getDataAttributesAsParameters();
2637
- var parentForm = getSourceScript().parentElement;
2638
- if (!inlineInstance) {
2639
- inlineInstance = new Inline();
2640
- }
2641
- var transaction;
2642
- var inlineButton = mountLazyInlineButton({
2643
- inlineId: inlineInstance.id,
2644
- amount: parameters.amount / 100,
2645
- currency: parameters.currency,
2646
- id: parameters.buttonId,
2647
- text: parameters.buttonText,
2648
- variant: parameters.buttonVariant,
2649
- wordmarkVariant: parameters.buttonWordmarkVariant,
2650
- parent: getSourceScript()
2651
- });
2652
- inlineButton.addEventListener('click', function (e) {
2653
- e.preventDefault();
2654
- if (!transaction) {
2655
- transaction = inlineInstance.newTransaction(_objectSpread2(_objectSpread2({}, parameters), {}, {
2656
- onSuccess: function onSuccess(response) {
2657
- mountInput({
2658
- type: 'hidden',
2659
- name: 'reference',
2660
- value: response.reference,
2661
- parent: parentForm
2662
- });
2663
- parentForm.submit();
2664
- }
2665
- }));
2666
- } else {
2667
- inlineInstance.resumeTransaction(transaction.accessCode);
2668
- }
2669
- });
2670
- }
2671
-
2672
- return Inline;
2673
-
2674
- })();
1
+ var PaystackPop=function(){"use strict";function e(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=Array(n);t<n;t++)a[t]=e[t];return a}function n(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function t(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,u(a.key),a)}}function a(e,n,a){return n&&t(e.prototype,n),a&&t(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,n,t){return(n=u(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,a)}return t}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach(function(n){r(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function c(e,n){if(null==e)return{};var t,a,r=function(e,n){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==n.indexOf(a))continue;t[a]=e[a]}return t}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],-1===n.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function s(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,r,o,i,c=[],s=!0,l=!1;try{if(o=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(a=o.call(t)).done)&&(c.push(a.value),c.length!==n);s=!0);}catch(e){l=!0,r=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(l)throw r}}return c}}(e,n)||p(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(n){return function(n){if(Array.isArray(n))return e(n)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||p(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,n||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(n,t){if(n){if("string"==typeof n)return e(n,t);var a={}.toString.call(n).slice(8,-1);return"Object"===a&&n.constructor&&(a=n.constructor.name),"Map"===a||"Set"===a?Array.from(n):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?e(n,t):void 0}}var h={cookieTestUrl:"https://legacy-staging.paystack.co/test-iframe/start.html",publishableKey:"uFmz/uE/SDT6GupOrSEXIZXGByjQ0zFkPyc9LqKHFqnTI0WPN3JS5kQPo/j9or0TOXlqMQj2lzHn/UGsQT4XeQ==",publicKey:"-----BEGIN PUBLIC KEY-----\r\nMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALhZs/7hP0g0+hrqTq0hFyGVxgco0NMx\r\nZD8nPS6ihxap0yNFjzdyUuZED6P4/aK9Ezl5ajEI9pcx5/1BrEE+F3kCAwEAAQ==\r\n-----END PUBLIC KEY-----",applePayVersion:6,applePayValidateSessionPath:"applepay/validate-session/",applePayChargePath:"applepay/charge",googlePayChargePath:"googlepay/charge"},m=i(i({},h),{},{environment:"dev",checkoutUrl:"http://localhost:8081/",paymentBaseUrl:"https://legacy-staging.paystack.co/",paystackApiUrl:"https://studio-api.paystack.co/",siteUrl:"https://paystack.com",pusherKey:"1c7b262ee18455815893",pusherUrl:"http://localhost:8081/static/vendor/pusher.min.js"}),y=i(i({},h),{},{environment:"staging",checkoutUrl:"https://checkout-studio.paystack.com/",paymentBaseUrl:"https://legacy-staging.paystack.co/",paystackApiUrl:"https://studio-api.paystack.co/",siteUrl:"https://beta.paystack.com",pusherKey:"1c7b262ee18455815893",pusherUrl:"https://checkout-studio.paystack.com/static/vendor/pusher.min.js"}),g={dev:m,staging:y,production:i(i({},h),{},{environment:"production",checkoutUrl:"https://checkout.paystack.com/",paymentBaseUrl:"https://standard.paystack.co/",paystackApiUrl:"https://api.paystack.co/",siteUrl:"https://paystack.com",pusherKey:"8e4b9b7ca3418bd5cdc8",pusherUrl:"https://checkout.paystack.com/static/vendor/pusher.min.js"})}.production||y;function f(e,n){var t=[];return Object.keys(e).forEach(function(a){var r=n?"".concat(n,"[").concat(a,"]"):a,o=e[r];t.push(null!==o&&"object"===("undefined"==typeof v?"undefined":d(v))?f(o,r):"".concat(encodeURIComponent(a),"=").concat(encodeURIComponent(o)))}),t.join("&")}var b="50px",k="vertical",w="light",C="apple_pay",P="google_pay",_="card",A="success",E="failed",S="auth",q="test",x="production",T="CANCELED",I="DEVELOPER_ERROR",O="MERCHANT_ACCOUNT_ERROR",M="NG",j={XOF:"CI",GHS:"GH",KES:"KE",NGN:M,ZAR:"ZA",EGP:"EG"};function z(){return document.currentScript||(e=document.getElementsByTagName("script"))[e.length-1];var e}function V(){var e=[],n=z();if(n){var t=Array.prototype.slice.call(n.attributes);e=Object.keys(t).filter(function(e){var n=t[e].nodeName;return n&&n.indexOf("data")>-1}).map(function(e){return t[e].nodeName})}return e}var N={height:b,width:"auto",borderRadius:"3px",padding:"10px",locale:"en",type:"pay"},U=function(e){return e&&"object"===d(e)?Object.keys(N).reduce(function(n,t){return i(i({},n),{},r({},t,e[t]||N[t]))},{}):N};function L(e,n){var t=document.createElement("style");t.type="text/css",t.textContent=n,e.appendChild(t)}var R=function(){return Number(parseFloat((arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)/100).toFixed(2))},B=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.container,a=n.integrity;return new Promise(function(n,r){if(e){var o=document.createElement("script");o.src=e,a&&(o.crossOrigin="anonymous",o.integrity=a),o.addEventListener("load",function(){n(!0)}),o.addEventListener("error",function(){o.remove(),r(!1)}),t?t.appendChild(o):document.head.appendChild(o)}else r("No script url")})},D={headers:{accept:"application/json, text/plain, */*","accept-language":"en-GB,en-US;q=0.9,en;q=0.8","content-type":"application/x-www-form-urlencoded","sec-ch-ua-mobile":"?0","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"cross-site"},referrerPolicy:"no-referrer-when-downgrade",method:"POST",mode:"cors",credentials:"omit"};function G(e){return Object.keys(e).reduce(function(n,t){var a=encodeURIComponent(t),r=encodeURIComponent(e[t]),o="".concat(a,"=").concat(r);return[].concat(l(n),[o])},[]).join("&")}var F=function(e){return{biannually:"BIANNUAL PLAN",annually:"ANNUAL PLAN"}[e]||"".concat(e.toUpperCase()," PLAN")},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(){try{return window.isSecureContext&&window.ApplePaySession&&window.ApplePaySession.supportsVersion(g.applePayVersion)}catch(e){return!1}}()&&e.includes(C)},K=function(e,n){var t=(e&&e.channel_fees_and_amount||{})[n],a=t&&t.amount;return null==a?e&&e.amount:a},J=console?console.warn||console.log:function(){};function H(e,n,t){J('"'.concat(e,'" has been deprecated, please use "').concat(n,'". ').concat(t||""))}var Q=["PAN_ONLY"],X=null,Z=null,Y=function(e){var n=e&&e.response,t=n&&n.channel_settings;return t&&t[P]||null},$=function(e){return(e&&e.allowed_card_auth_methods||[]).filter(function(e){return!Q.includes(e)})},ee=function(e){var n=!!e&&e.domain===q;return g.environment!==x||n?"TEST":"PRODUCTION"},ne=function(e){return X&&Z===e||(X=new window.google.payments.api.PaymentsClient({environment:e}),Z=e),X},te=function(){return!!(window.google&&window.google.payments&&window.google.payments.api&&window.google.payments.api.PaymentsClient)},ae=function(e){return{apiVersion:e.api_version.major,apiVersionMinor:e.api_version.minor}},re=function(e,n){return{type:"CARD",parameters:i({allowedAuthMethods:n,allowedCardNetworks:e.allowed_card_networks,billingAddressRequired:!0,billingAddressParameters:e.billing_address_parameters,assuranceDetailsRequired:!0},e.allowed_issuer_country_codes&&e.allowed_issuer_country_codes.length&&{allowedIssuerCountryCodes:e.allowed_issuer_country_codes})}},oe=function(e){var n=e.registered_merchant_info||{};return{merchantId:n.merchantId,merchantName:n.merchantName,merchantOrigin:n.merchantOrigin}},ie=function(e){var n=Y(e);if(!n)return Promise.resolve(null);var t=$(n);return t.length&&n.tokenization_specification&&te()?(function(e){var n=e.registered_merchant_info&&e.registered_merchant_info.merchantOrigin,t=window.location.hostname;n&&n!==t&&J('Google Pay: the registered merchantOrigin ("'.concat(n,'") does not match this page ("').concat(t,'"). Google may reject the payment sheet. Update the domain in Dashboard > Developers > Google Pay.'))}(n),Promise.resolve().then(function(){return ne(ee(e.response)).isReadyToPay(i(i({},ae(n)),{},{allowedPaymentMethods:[re(n,t)],existingPaymentMethodRequired:!0}))}).then(function(e){return!!e.result}).catch(function(){return null})):Promise.resolve(null)},ce=function(e){if(!((e&&e.response||{}).channels||[]).includes(P))return Promise.resolve(null);var n=Y(e);return n&&!n.registered_merchant_info?(J("Google Pay: this business has no Google Pay merchant profile, so no Google Pay button is shown. Add one in Dashboard > Developers > Google Pay."),Promise.resolve(null)):function(e,n){var t,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return null},r=new Promise(function(e){t=setTimeout(function(){try{e(a())}catch(n){e(null)}},n)});return Promise.race([e,r]).finally(function(){return clearTimeout(t)})}((te()?Promise.resolve(!0):B("https://pay.google.com/gp/p/js/pay.js").then(function(){return te()})).catch(function(){return!1}).then(function(n){return n?ie(e):null}),1e4)},se=["height","width","borderRadius","buttonRadius"];function le(e){var n=document.createElement("iframe");return n.setAttribute("frameBorder","0"),n.setAttribute("allowtransparency","true"),n.id=e,n.style.display="none",n}function ue(e){return e.querySelector("apple-pay-button")||e.querySelector("#apple-pay-button")}function de(e){return document.querySelector("#".concat(e))}function pe(e){return e.querySelector("#google-pay-button-container")}function he(e,n){if(e){var t=e.querySelector("#google-pay-button"),a=e.querySelector("#google-pay-loading-button");t&&a&&(t.style.display=n?"none":"",a.style.display=n?"flex":"none")}}function me(e,n){var t=n.transaction,a=n.styles,r=void 0===a?{}:a,o=n.onClick,s=r.googlePay||{},l=s.height,u=s.width,d=s.borderRadius,p=s.buttonRadius,h=c(s,se),m=Y(t),y=function(e,n){var t=parseFloat(void 0!==e?e:n);return t>=0?t:3}(d,p);L(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.height,t=e.width;return"\n #google-pay-button-container {\n width: ".concat(t||"auto",";\n height: ").concat(n||b,";\n overflow: hidden;\n }\n #google-pay-button-container:empty {\n display: none;\n }\n #google-pay-button-container > div,\n #google-pay-button-container button,\n #google-pay-button-container iframe {\n width: 100%;\n max-width: 100%;\n height: 100%;\n min-width: 100%;\n }\n #google-pay-button-container button {\n outline: none !important;\n }\n")}({height:l,width:u}));var g=h.buttonColor||(r.theme===w?"white":"black");L(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.borderRadius,t="white"===e.buttonColor;return"\n #google-pay-loading-button {\n width: 100%;\n height: 100%;\n border: ".concat(t?"1px solid #3C4043":"none",";\n border-radius: ").concat(void 0===n?3:n,"px;\n background: ").concat(t?"#ffffff":"#000000",";\n cursor: default;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n #google-pay-loading-button__spinner {\n width: 18px;\n height: 18px;\n border: 2px solid ").concat(t?"rgba(60, 64, 67, 0.25)":"rgba(255, 255, 255, 0.35)",";\n border-top-color: ").concat(t?"#3c4043":"#ffffff",";\n border-radius: 50%;\n animation: google-pay-spin 0.8s linear infinite;\n }\n @keyframes google-pay-spin {\n to { transform: rotate(360deg); }\n }\n")}({borderRadius:y,buttonColor:g}));var f=document.createElement("div");f.id="google-pay-button-container";var v=ne(ee(t.response)).createButton(i(i({buttonColor:g,buttonType:"pay",buttonRadius:y,buttonSizeMode:"fill"},h),{},{onClick:o,allowedPaymentMethods:[re(m,$(m))]}));e.appendChild(f);var k=document.createElement("div");k.id="google-pay-button",k.appendChild(v),f.appendChild(k);var C=document.createElement("button");C.id="google-pay-loading-button",C.type="button",C.disabled=!0,C.setAttribute("aria-busy","true"),C.style.display="none";var P=document.createElement("span");return P.id="google-pay-loading-button__spinner",C.appendChild(P),f.appendChild(C),f}function ye(e,n){var t,a,r=n.transaction,o=n.styles,i=void 0===o?{}:o,c=n.onClickApplePayButton,l=n.onClickGooglePayButton;if(!e)return Promise.reject("Container to mount elements was not provided");!function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}(e),L(e,(t=i.orientation,"\n #paystack-payment-request-inner-wrapper {\n display: flex;\n flex-direction: ".concat((a=t===k)?"column":"row",";\n gap: 8px;\n width: 100%;\n max-width: 100%;\n }\n\n #paystack-payment-request-inner-wrapper > * {\n min-width: 0;\n ").concat(a?"":"flex: 1 1 0;","\n }\n\n #paystack-payment-request-inner-wrapper > apple-pay-button,\n #paystack-payment-request-inner-wrapper > #apple-pay-button {\n order: 1;\n }\n #paystack-payment-request-inner-wrapper > #google-pay-button-container {\n order: 2;\n }\n")));var u=document.createElement("div");u.id="paystack-payment-request-inner-wrapper",u.style.display="none",e.appendChild(u);var p={styles:U(i.applePay),theme:i.theme,onClick:c},h=r.response&&r.response.channels||[],m=Promise.resolve(null);W(h)?m=B("https://applepay.cdn-apple.com/jsapi/v1.1.0/apple-pay-sdk.js",{integrity:"sha384-z/6BVHCcSypLSykOVpaT1PQWHOOgU45uOOlMkgi/bElX4yFqmChNMb7qiv80wFav"}).then(function(){if(window&&!Array.isArray(window.webpackJsonp))throw new Error("Incorrect data type for 'webpackJsonp', expected array, got ".concat(d(window.webpackJsonp),". Switching to fallback apple pay button"))}).then(function(){return function(e,n){var t=n.styles,a=n.theme,r=n.onClick;L(e,function(e){var n=e.height,t=e.width,a=e.borderRadius,r=e.padding;return"\n apple-pay-button {\n --apple-pay-button-width: ".concat(t,";\n --apple-pay-button-height: ").concat(n,";\n --apple-pay-button-border-radius: ").concat(a,";\n --apple-pay-button-padding: ").concat(r,";\n --apple-pay-button-box-sizing: border-box;\n width: ").concat(t,";\n }\n")}(t));var o=document.createElement("apple-pay-button");return o.setAttribute("buttonstyle",a===w?"white":"black"),o.setAttribute("type",t.type),o.setAttribute("locale",t.locale),r&&(o.onclick=r),e.appendChild(o),o}(u,p)}).catch(function(){return function(e,n){var t=n.styles,a=n.theme,r=n.onClick;L(e,function(e){var n=e.height,t=e.width,a=e.borderRadius,r=e.padding,o=e.type,i=e.locale;return"\n @supports (-webkit-appearance: -apple-pay-button) {\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n width: ".concat(t,";\n height: ").concat(n,";\n border-radius: ").concat(a,";\n padding: ").concat(r,";\n -apple-pay-button-type: ").concat(o,";\n -webkit-locale: ").concat(i,";\n }\n .apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n .apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n .apple-pay-button-white-with-line {\n -apple-pay-button-style: white-outline;\n }\n }\n\n @supports not (-webkit-appearance: -apple-pay-button) {\n .apple-pay-button {\n display: inline-block;\n background-size: 100% 60%;\n background-repeat: no-repeat;\n background-position: 50% 50%;\n border-radius: 5px;\n padding: 0px;\n box-sizing: border-box;\n min-width: 200px;\n min-height: 32px;\n max-height: 64px;\n }\n .apple-pay-button-black {\n background-image: -webkit-named-image(apple-pay-logo-white);\n background-color: black;\n }\n .apple-pay-button-white {\n background-image: -webkit-named-image(apple-pay-logo-black);\n background-color: white;\n }\n .apple-pay-button-white-with-line {\n background-image: -webkit-named-image(apple-pay-logo-black);\n background-color: white;\n border: .5px solid black;\n }\n }\n")}(t));var o=document.createElement("button");o.classList.add("apple-pay-button",a===w?"apple-pay-button-white":"apple-pay-button-black"),o.id="apple-pay-button";var i=document.createElement("span");return i.classList.add("logo"),o.appendChild(i),r&&(o.onclick=r),e.appendChild(o),o}(u,p)}).catch(function(){return null}):h.includes(C)&&J("Apple Pay: this device or browser cannot pay with Apple Pay. It requires Safari on an Apple device, over HTTPS.");var y=ce(r).then(function(e){return e?me(u,{transaction:r,styles:i,onClick:l}):null}).catch(function(){return null});return Promise.all([m,y]).then(function(e){var n=s(e,2),t=n[0],a=n[1];return t||a?(u.style.display="",{applePay:!!t,googlePay:!!a}):null})}var ge=[{value:"key",required:!0,types:["string"]},{value:"amount",required:!0,or:["plan","planCode"],types:["string","number"]},{value:"currency",required:!1,types:["string"]},{value:"email",required:!0,or:["customerCode"],types:["string"]},{value:"label",required:!1,types:["string"]},{value:"firstName",required:!1,types:["string"]},{value:"lastName",required:!1,types:["string"]},{value:"reference",required:!1,types:["string"]},{value:"phone",required:!1,types:["string"]},{value:"customerCode",required:!1,override:"email",types:["string"]},{value:"channels",required:!1,types:["array"]},{value:"paymentRequest",required:!1,types:["string","number"]},{value:"paymentPage",required:!1,types:["string"]},{value:"hash",required:!1,types:["string"]},{value:"container",required:!1,types:["string"]},{value:"metadata",required:!1,types:["object"]},{value:"subaccountCode",required:!1,types:["string"]},{value:"bearer",required:!1,types:["string"]},{value:"transactionCharge",required:!1,types:["string","number"]},{value:"planCode",required:!1,override:"amount",types:["string"]},{value:"subscriptionCount",required:!1,types:["number"]},{value:"planInterval",required:!1,types:["string"]},{value:"subscriptionLimit",required:!1,types:["number"]},{value:"subscriptionStartDate",required:!1,types:["string"]},{value:"accessCode",required:!1,types:["string"]},{value:"onError",required:!1,types:["function"]},{value:"onLoad",required:!1,types:["function"]},{value:"onSuccess",required:!1,types:["function"]},{value:"onCancel",required:!1,types:["function"]},{value:"callback",required:!1,types:["function"]},{value:"onClose",required:!1,types:["function"]},{value:"onBankTransferConfirmationPending",required:!1,types:["function"]},{value:"firstname",required:!1,types:["string"]},{value:"lastname",required:!1,types:["string"]},{value:"customer_code",required:!1,types:["string"]},{value:"payment_request",required:!1,types:["string","number"]},{value:"subaccount",required:!1,types:["string"]},{value:"transaction_charge",required:!1,types:["number","string"]},{value:"plan",required:!1,types:["string"]},{value:"quantity",required:!1,types:["number"]},{value:"interval",required:!1,types:["string"]},{value:"invoice_limit",required:!1,types:["number","string"]},{value:"start_date",required:!1,types:["string"]},{value:"payment_page",required:!1,types:["number","string"]},{value:"order_id",required:!1,types:["number"]},{value:"ref",required:!1,types:["string"]},{value:"card",required:!1,types:["string"]},{value:"bank",required:!1,types:["string"]},{value:"split",required:!1,types:["object"]},{value:"split_code",required:!1,types:["string"]},{value:"transaction_type",required:!1,types:["string"]},{value:"subscription",required:!1,types:["number"]},{value:"language",required:!1,types:["string"]},{value:"connect_account",required:!1,types:["string"]},{value:"connect_split",required:!1,types:["array"]}];function fe(e){return(null==e?void 0:e.length)>500?e.split("?")[0]:e}function ve(e){var n,t,a,r,o=i({},e);o.metadata=e.metadata||{},o.metadata.referrer=(n=window.location,t=n.href,a=void 0===t?"":t,r=n.ancestorOrigins,[a].concat(l(void 0===r?[]:r)).map(fe).join(",")),o.metadata=JSON.stringify(o.metadata),o.mode="popup",e.split&&"string"!=typeof e.split&&(o.split=JSON.stringify(o.split));return void 0!==o.card&&["false",!1].indexOf(o.card)>-1&&(o.channels=["bank"],delete o.card),void 0!==o.bank&&["false",!1].indexOf(o.bank)>-1&&(o.channels=["card"],delete o.bank),[{to:"firstname",from:"firstName"},{to:"lastname",from:"lastName"},{to:"customer_code",from:"customerCode"},{to:"payment_request",from:"paymentRequest"},{to:"subaccount",from:"subaccountCode"},{to:"transaction_charge",from:"transactionCharge"},{to:"plan",from:"planCode"},{to:"quantity",from:"subscriptionCount"},{to:"interval",from:"planInterval"},{to:"invoice_limit",from:"subscriptionLimit"},{to:"start_date",from:"subscriptionStartDate"},{to:"ref",from:"reference"}].forEach(function(e){o[e.from]&&(o[e.to]=o[e.from],delete o[e.from])}),Object.values(e).forEach(function(n,t){if("function"==typeof n){var a=Object.keys(e)[t];delete o[a]}}),o}var be,ke=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"],we=window&&window.navigator&&(window.navigator.platform||window.navigator.userAgentData&&window.navigator.userAgentData.platform),Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.platform,t=e.userAgent,a=void 0===t?window&&window.navigator&&window.navigator.userAgent:t,r=n||we;return ke.includes(r)||a.includes("Mac")&&"ontouchend"in document},Pe=function(e,n,t){var a="".concat(g.paystackApiUrl,"transaction/update_log/").concat(e),r={Authorization:"Bearer ".concat(n)};return fetch(a,{method:"POST",body:JSON.stringify({payload:JSON.stringify(t)}),headers:r})},_e=function(e,n){var t="".concat(g.paystackApiUrl,"transaction/set_ip/").concat(e),a={Authorization:"Bearer ".concat(n)};return fetch(t,{method:"POST",headers:a})},Ae={initializeLog:function(e){var n=e||{},t=n.attempts,a=n.authentication,r=n.errors,o=n.history;this.log={start_time:Math.round(Date.now()/1e3),time_spent:0,attempts:t||0,authentication:a,errors:r||0,success:!1,mobile:Ce(),input:[],history:o||[]}},getTimeSpent:function(){var e=Math.round(Date.now()/1e3);return this.log.time_spent=e-this.log.start_time,this.log.time_spent},logAPIResponse:function(e,n){switch(e.status){case A:return this.logApiSuccess(n);case E:return this.logApiError(e.message);default:return!1}},logValidationResponse:function(e){return this.log.history.push({type:"action",message:e,time:this.getTimeSpent()}),this.saveLog()},logAttempt:function(e){var n="Attempted to pay";return e&&(n+=" with ".concat(e)),this.log.attempts+=1,this.log.history.push({type:"action",message:n,time:this.getTimeSpent()}),this.saveLog()},logApiError:function(e){var n="Error";return e&&(n+=": ".concat(e)),this.log.errors+=1,this.log.history.push({type:"error",message:n,time:this.getTimeSpent()}),this.saveLog()},logApiSuccess:function(e){var n="Successfully paid";return e&&(n+=" with ".concat(e)),this.log.success=!0,this.log.history.push({type:"success",message:n,time:this.getTimeSpent()}),this.saveLog()},saveLog:function(){try{if(this.response)return Pe(this.id,this.response.merchant_key,this.log)}catch(e){}},saveIpAddress:function(){try{if(this.response)return _e(this.id,this.response.merchant_key)}catch(e){}}},Ee=["language","connect_account"],Se={requestInline:function(){var e=this,n=this.urlParameters,t=n.language,a=n.connect_account,r=c(n,Ee),o=i({"Content-Type":"application/json"},t&&{"Accept-Language":t});return(this.accessCode?fetch(new URL("transaction/verify_access_code/".concat(this.accessCode),g.paystackApiUrl).toString(),{headers:o}):fetch(new URL("/checkout/request_inline",g.paystackApiUrl).toString(),{method:"POST",body:JSON.stringify(r),headers:i(i({},o),a&&{"x-connect-account":a})})).then(function(e){return e.json()}).then(function(n){if(!1===n.status)throw new Error(n.message);return e.response=n.data,e.id=n.data.id,e.status=n.data.transaction_status,e.accessCode=n.data.access_code,e.log=null,Object.assign(e,Ae),e.initializeLog(n.data.log),e.saveIpAddress(),n.data})}},qe=function(){return a(function e(t){n(this,e),function(e){function n(e,n){this.message=e,this.issues=n||[]}if(!e||"object"!==d(e))throw new n("Transaction parameters should be a non-empty object");var t=e;if("accessCode"in t)return{accessCode:t.accessCode};Object.keys(t).forEach(function(e){void 0!==ge.find(function(n){return n.value===e})||delete t[e]});var a=Object.keys(t),r=[];if(ge.filter(function(e){return e.required}).forEach(function(e){var n=!t[e.value],a=e.or?e.or.some(function(e){return t[e]}):null;n&&!a&&r.push({message:"Required parameter missing: ".concat(e.value)})}),a.forEach(function(e){var n=t[e],a=ge.find(function(n){return n.value===e}),o=d(n);"object"===o&&Array.isArray(n)&&(o="array"),a.types.indexOf(o)<=-1&&r.push({message:"Invalid parameter type: ".concat(e),validTypes:a.types})}),a.forEach(function(e){var n=ge.find(function(n){return n.value===e});n.override&&delete t[n.override]}),r.length)throw new n("Invalid transaction parameters",r)}(t),this.parameters=t,this.urlParameters=ve(t),this.id=null,this.status=null,this.accessCode=t.accessCode||null,this.authorizationUrl=null,this.errors=[],this.response=null,this.isActive=!0;var a=t.onError,r=t.onLoad,o=t.onSuccess,i=t.onCancel,c=t.callback,s=t.onClose,l=t.onBankTransferConfirmationPending;this.callbacks={onError:a,onLoad:r,onSuccess:o,onCancel:i,onBankTransferConfirmationPending:l},this.deprecatedCallbacks={callback:c,onClose:s},Object.assign(this,Se)},[{key:"onSetupError",value:function(e){this.logError(e),this.callbacks.onError&&this.callbacks.onError(e)}},{key:"onLoad",value:function(e){var n=e.id,t=e.customer,a=e.accessCode;Object.assign(this,{id:n,customer:t,accessCode:a}),this.authorizationUrl="".concat(g.checkoutUrl).concat(a),this.callbacks.onLoad&&this.callbacks.onLoad({id:n,customer:t,accessCode:a})}},{key:"onSuccess",value:function(e){this.isActive=!1,this.response=e,this.status=e.status,this.callbacks.onSuccess&&this.callbacks.onSuccess(e),this.deprecatedCallbacks.callback&&this.deprecatedCallbacks.callback(e)}},{key:"setStatus",value:function(e){this.status=e}},{key:"onCancel",value:function(){this.callbacks.onCancel&&this.callbacks.onCancel(),this.deprecatedCallbacks.onClose&&this.deprecatedCallbacks.onClose()}},{key:"cancel",value:function(){this.isActive=!1,this.onCancel()}},{key:"onBankTransferConfirmationPending",value:function(){this.cancel(),this.callbacks.onBankTransferConfirmationPending&&this.callbacks.onBankTransferConfirmationPending()}},{key:"logError",value:function(e){this.errors.push(e)}}])}(),xe=["preload","inlineTransaction","transactionData"],Te=["container","styles","onElementsMount"],Ie=["data"];function Oe(e,n){if(!e.length)return null;var t=e.filter(function(e){var t,a,r,o,i=!e.status||"abandoned"===e.status,c=(t=e.parameters,a=n,r=Object.keys(t).sort().join("")===Object.keys(a).sort().join(""),o=Object.values(t).sort().join("")===Object.values(a).sort().join(""),r&&o);return i&&c});return t.length?t[t.length-1]:null}function Me(e){var n=e.checkoutIframe,t=e.urlParameters;n&&t&&n.contentWindow.postMessage({type:"inline:url",path:"newTransaction",params:t},"*")}var je="trackPaymentError",ze="trackPaymentAttempt",Ve="trackPaymentCompletion";function Ne(e){throw J(e),new Error(e)}var Ue,Le,Re=function(){function e(t){var a,r;n(this,e),this.id=function(){for(var e="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=0;t<5;t+=1)e+=n.charAt(Math.floor(62*Math.random()));return e}(),this.transactions=[],this.isOpen=!1,this.isLoaded=!1,this.isCharging=!1,this.isDeprecatedApi=t&&t.isDeprecatedApi,t&&t.isEmbed?this.isEmbed=!0:t&&t.isPaymentRequest&&(t.container&&de(t.container)||Ne("A container is required to mount the payment request button"),this.paymentRequestContainer=de(t.container),this.paymentRequestTransaction=null),this.backgroundIframe=function(e){var n=le("inline-background-".concat(e));n.style.cssText="\n z-index: 999999999999999;\n background: transparent;\n background: rgba(0, 0, 0, 0.75);\n border: 0px none transparent;\n overflow-x: hidden;\n overflow-y: hidden;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.3s;\n -webkit-transition: opacity 0.3s;\n visibility: hidden;\n display: none;\n",n.style.colorScheme="light",document.body.appendChild(n);var t=n.contentWindow.document;return t.open(),t.write('\n <!DOCTYPE html>\n <html lang="en">\n\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n <title>Paystack Popup Loader</title>\n <style>\n .app-loader {\n margin: 200px 0;\n text-align: center;\n color: white;\n }\n @keyframes app-loader__spinner {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n @-webkit-keyframes app-loader__spinner {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n .app-loader__spinner {\n position: relative;\n display: inline-block;\n }\n .app-loader__spinner div {\n left: 95px;\n top: 35px;\n position: absolute;\n -webkit-animation: app-loader__spinner linear 1s infinite;\n animation: app-loader__spinner linear 1s infinite;\n background: white;\n width: 10px;\n height: 30px;\n border-radius: 40%;\n -webkit-transform-origin: 5px 65px;\n transform-origin: 5px 65px;\n }\n .app-loader__spinner div:nth-child(1) {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n -webkit-animation-delay: -0.916666666666667s;\n animation-delay: -0.916666666666667s;\n }\n .app-loader__spinner div:nth-child(2) {\n -webkit-transform: rotate(30deg);\n transform: rotate(30deg);\n -webkit-animation-delay: -0.833333333333333s;\n animation-delay: -0.833333333333333s;\n }\n .app-loader__spinner div:nth-child(3) {\n -webkit-transform: rotate(60deg);\n transform: rotate(60deg);\n -webkit-animation-delay: -0.75s;\n animation-delay: -0.75s;\n }\n .app-loader__spinner div:nth-child(4) {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n -webkit-animation-delay: -0.666666666666667s;\n animation-delay: -0.666666666666667s;\n }\n .app-loader__spinner div:nth-child(5) {\n -webkit-transform: rotate(120deg);\n transform: rotate(120deg);\n -webkit-animation-delay: -0.583333333333333s;\n animation-delay: -0.583333333333333s;\n }\n .app-loader__spinner div:nth-child(6) {\n -webkit-transform: rotate(150deg);\n transform: rotate(150deg);\n -webkit-animation-delay: -0.5s;\n animation-delay: -0.5s;\n }\n .app-loader__spinner div:nth-child(7) {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n -webkit-animation-delay: -0.416666666666667s;\n animation-delay: -0.416666666666667s;\n }\n .app-loader__spinner div:nth-child(8) {\n -webkit-transform: rotate(210deg);\n transform: rotate(210deg);\n -webkit-animation-delay: -0.333333333333333s;\n animation-delay: -0.333333333333333s;\n }\n .app-loader__spinner div:nth-child(9) {\n -webkit-transform: rotate(240deg);\n transform: rotate(240deg);\n -webkit-animation-delay: -0.25s;\n animation-delay: -0.25s;\n }\n .app-loader__spinner div:nth-child(10) {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n -webkit-animation-delay: -0.166666666666667s;\n animation-delay: -0.166666666666667s;\n }\n .app-loader__spinner div:nth-child(11) {\n -webkit-transform: rotate(300deg);\n transform: rotate(300deg);\n -webkit-animation-delay: -0.083333333333333s;\n animation-delay: -0.083333333333333s;\n }\n .app-loader__spinner div:nth-child(12) {\n -webkit-transform: rotate(330deg);\n transform: rotate(330deg);\n -webkit-animation-delay: 0s;\n animation-delay: 0s;\n }\n .app-loader__spinner {\n width: 40px;\n height: 40px;\n -webkit-transform: translate(-20px, -20px) scale(0.2) translate(20px, 20px);\n transform: translate(-20px, -20px) scale(0.2) translate(20px, 20px);\n }\n </style>\n </head>\n\n <body>\n <div id="app-loader" class="app-loader">\n <div id="spinner" class="app-loader__spinner">\n <div></div><div></div><div></div><div></div><div></div><div></div><div>\n </div><div></div><div></div><div></div><div></div><div></div>\n </div>\n </div>\n </body>\n\n </html>\n'),t.close(),n}(this.id),this.checkoutIframe=(a=this.id,(r=le("inline-checkout-".concat(a))).src="".concat(g.checkoutUrl,"popup?precheckout=true"),r.style.cssText="\n z-index: 999999999999999;\n background: transparent;\n border: 0px none transparent;\n overflow-x: hidden;\n overflow-y: hidden;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n visibility: hidden;\n display: none;\n height: 100%;\n",r.style.colorScheme="light",r.setAttribute("allowpaymentrequest","true"),r.setAttribute("allow","payment; clipboard-read; clipboard-write"),document.body.appendChild(r),r),this.registerListeners()}return a(e,[{key:"registerListeners",value:function(){var e=this;window.addEventListener("message",function(n){var t="".concat(n.origin,"/")===g.checkoutUrl,a=e.checkoutIframe&&e.checkoutIframe.contentWindow===n.source,r=e.isEmbed;t||a?e.respondToEvent(n):r&&e.respondToEmbedEvents(n)})}},{key:"sendAnalyticsEventToCheckout",value:function(e,n){this.checkoutIframe.contentWindow.postMessage({type:"analytics",action:e,params:n},"*")}},{key:"checkout",value:function(e){this.activeTransaction()&&this.activeTransaction().cancel(),be=this;var n=Oe(this.transactions,e)||new qe(e);return new Promise(function(e,t){n.requestInline().then(function(t){be.newTransaction({inlineTransaction:n,transactionData:t}),e(n)}).catch(function(e){n.onSetupError({status:!1,message:e.message}),t(e)})})}},{key:"newTransaction",value:function(e){var n=e.preload,t=e.inlineTransaction,a=e.transactionData,r=c(e,xe),o=this.hasMountedPaymentRequestButtons(),i=this.activeTransaction();if(i&&!o&&i!==t&&i.cancel(),t&&a)return this.transactions.includes(t)||this.transactions.push(t),this.isDeprecatedApi||this.open({accessCode:a.access_code,language:t.urlParameters.language},n),t;var s=Oe(this.transactions,t?t.parameters:r);if(s)return s.isActive=!0,this.isDeprecatedApi||this.open({accessCode:s.accessCode,language:s.urlParameters.language},n),s;var l=t||new qe(r),u=l.accessCode?{accessCode:l.accessCode,language:l.urlParameters.language}:l.urlParameters;return this.transactions.push(l),this.isDeprecatedApi||this.open(u,n),l}},{key:"preloadTransaction",value:function(e){var n=this;this.newTransaction(i(i({},e),{},{preload:!0}));return function(){return n.animateCheckoutIn()}}},{key:"paymentRequest",value:function(e){var n,t=this,a=e.container,r=e.styles,o=e.onElementsMount,i=c(e,Te);return"channels"in i&&(i.channels=(n=i.channels,Array.isArray(n)&&n.includes(P)&&!n.includes(_)?[].concat(l(n),[_]):n)),be=this,new Promise(function(n,c){var s=document.querySelector("#".concat(e.loadPaystackCheckoutButton));be.activeTransaction()&&be.activeTransaction().cancel(),a&&de(a)||Ne("A container is required to mount the payment request button"),be.paymentRequestContainer=de(a);var l=Oe(be.transactions,i),u=l||new qe(i);u.requestInline().then(function(e){return l?u.isActive=!0:be.transactions.push(u),ye(be.paymentRequestContainer,{transaction:u,styles:r,onClickApplePayButton:function(){return t.startApplePay(u)},onClickGooglePayButton:function(){return t.startGooglePay(u)}}).then(function(e){o&&o(e)}).catch(function(){o&&o(null)}).finally(function(){if(s){var t=be.preloadTransaction({inlineTransaction:u,transactionData:e});s.onclick=t}else be.hasMountedPaymentRequestButtons()||J("No payment request button could be mounted on this device. Please consult our documentation at https://developers.paystack.co/docs/paystack-inline to see how to load alternative payment options using 'loadPaystackCheckoutButton'");n(u)})}).catch(function(e){u.onSetupError({status:!1,message:e.message}),c(e)})})}},{key:"hasMountedPaymentRequestButtons",value:function(){return(e=this.paymentRequestContainer,e?[ue(e),pe(e)].filter(Boolean):[]).length>0;var e}},{key:"startGooglePay",value:function(e){var n=this,t="google pay",a=e||this.activeTransaction();if(e&&!e.isActive)return J("Google Pay: this button belongs to a transaction that is no longer active."),Promise.resolve();if(a&&a.response){if(this.isCharging)return Promise.resolve();this.isCharging=!0;var r=function(e){try{e()}catch(e){J("Google Pay: a merchant callback threw. ".concat(e&&e.message||e))}};try{var o={channel:P,currency:a.response.currency,amount:K(a.response,P)};return a.logAttempt(t),this.sendAnalyticsEventToCheckout(ze,i(i({},o),{},{paymentMethod:t})),ne(ee(a.response)).loadPaymentData(function(e){var n=Y(e),t=e.response,a=$(n);return i(i({},ae(n)),{},{allowedPaymentMethods:[i(i({},re(n,a)),{},{tokenizationSpecification:n.tokenization_specification})],transactionInfo:{totalPriceStatus:"FINAL",checkoutOption:"COMPLETE_IMMEDIATE_PURCHASE",totalPrice:R(K(t,P)).toFixed(2),currencyCode:t.currency,countryCode:j[t.currency]||M},merchantInfo:oe(n),emailRequired:!0})}(a)).then(function(e){return he(n.paymentRequestContainer,!0),function(e){var n=e.transactionId,t=e.paymentData,a="".concat(g.paymentBaseUrl).concat(g.googlePayChargePath);return fetch(a,{headers:{"content-type":"application/x-www-form-urlencoded"},method:"POST",mode:"cors",credentials:"omit",body:G({transaction:n,paymentObject:JSON.stringify(t)})}).then(function(e){return e.json()})}({transactionId:a.id,paymentData:e})}).then(function(e){if(he(n.paymentRequestContainer,!1),n.isCharging=!1,a.logAPIResponse(e,t),e.status===A){var s=e.data,l=c(e,Ie);return r(function(){return a.onSuccess(i(i({},s),l))}),void n.sendAnalyticsEventToCheckout(Ve,i(i({},o),{},{timeSpent:a.getTimeSpent()}))}var u=e.status===S?"This card requires additional authentication, which is not supported here. Please use another payment method.":e&&e.message||"Transaction attempt failed";r(function(){return a.onSetupError(i(i({},e),{},{message:u}))}),n.sendAnalyticsEventToCheckout(je,{channel:P,message:u})},function(e){if(he(n.paymentRequestContainer,!1),n.isCharging=!1,e&&e.statusCode===T)r(function(){return a.onCancel()});else{var t=e&&e.statusCode;t!==I&&t!==O||J("Google Pay: ".concat(t,". Google rejected the merchant or the origin serving the button. Check that the merchant ID and domain saved in Dashboard > Developers > Google Pay match this page."));var o=e&&(e.statusMessage||e.message)||"Could not complete the Google Pay payment";r(function(){return a.onSetupError({status:!1,message:o})}),n.sendAnalyticsEventToCheckout(je,{channel:P,message:o})}}).catch(function(e){n.isCharging=!1,J("Google Pay: the charge handler failed. ".concat(e&&e.message||e)),r(function(){return a.onSetupError({status:!1,message:"Could not complete the Google Pay payment"})})})}catch(e){return this.isCharging=!1,J("Google Pay: could not start the charge."),r(function(){return a.onSetupError({status:!1,message:"Could not complete the Google Pay payment"})}),Promise.resolve()}}else Ne("Could not initiate google pay transaction");return Promise.resolve()}},{key:"startApplePay",value:function(e){var n,t,a,r,o,c=this,s="apple pay",l=e||this.activeTransaction();if(!e||e.isActive)if(l&&l.response){if(this.isCharging)return;this.isCharging=!0;try{var u={channel:C,currency:l.response.currency,amount:K(l.response,C)};l.logAttempt(s),this.sendAnalyticsEventToCheckout(ze,i(i({},u),{},{paymentMethod:s}));var d=(n={currency:l.response.currency,amount:K(l.response,C),merchantName:l.response.merchant_name,interval:l.response.plan_details&&l.response.plan_details.interval},t=n.currency,a=n.amount,r=n.merchantName,o=n.interval,i({countryCode:"NG",currencyCode:t,merchantCapabilities:["supports3DS","supportsCredit","supportsDebit"],supportedNetworks:["visa","masterCard"],requiredBillingContactFields:["postalAddress","name","phone","email"],total:{label:"".concat(r," - Paystack"),type:"final",amount:String(R(a))}},"string"==typeof o&&""!==o.trim()&&{lineItems:[{label:F(o),amount:String(R(a))}]})),p=new window.ApplePaySession(g.applePayVersion,d);p.onvalidatemerchant=function(e){var n=function(e){var n=e.transactionId,t=e.accessCode,a=e.publicKey,r=e.validationURL,o=e.merchantName,c=e.domainName,s=void 0===c?window&&window.location&&window.location.hostname:c,l="".concat(g.paymentBaseUrl).concat(g.applePayValidateSessionPath),u=G(i(i(i({transaction:n},t&&{accessCode:t}),a&&{publicKey:a}),{},{sessionUrl:r,displayName:o,domainName:s}));return fetch(l,i(i({},D),{},{body:u})).then(function(e){return e.json()})}({validationURL:e.validationURL,transactionId:l.id,accessCode:l.accessCode,publicKey:l.parameters.key,merchantName:l.response.merchant_name});n.then(function(e){e.status!==A?(c.isCharging=!1,l.onSetupError(e)):p.completeMerchantValidation(e.data),l.logValidationResponse(e.message)}).catch(function(e){c.isCharging=!1,l.onSetupError(e)})},p.oncancel=function(){c.isCharging=!1,l.onCancel()},p.onpaymentauthorized=function(e){var n=e.payment,t=function(e){var n=e.transactionId,t=e.accessCode,a=e.payment,r="".concat(g.paymentBaseUrl).concat(g.applePayChargePath),o=G(i(i({transaction:n},t&&{accessCode:t}),{},{paymentObject:JSON.stringify(a)}));return fetch(r,i(i({},D),{},{body:o})).then(function(e){return e.json()})}({transactionId:l.id,accessCode:l.accessCode,payment:n});t.then(function(e){l.logAPIResponse(e,s),c.isCharging=!1,e.status===A?(p.completePayment(p.STATUS_SUCCESS),l.onSuccess(e),c.sendAnalyticsEventToCheckout(Ve,i(i({},u),{},{timeSpent:l.getTimeSpent()}))):(p.completePayment(p.STATUS_FAILURE),l.onSetupError(e),c.sendAnalyticsEventToCheckout(je,{channel:C,message:e&&e.message||"Transaction attempt failed"}))}).catch(function(e){c.isCharging=!1,p.completePayment(p.STATUS_FAILURE),l.onSetupError(e),c.sendAnalyticsEventToCheckout(je,{channel:C,message:e&&e.message||"Error occurred"})})},p.begin()}catch(e){this.isCharging=!1,l.onSetupError(e)}}else Ne("Could not initiate apple pay transaction");else J("Apple Pay: this button belongs to a transaction that is no longer active.")}},{key:"resumeTransaction",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.onSuccess,a=n.onCancel,r=n.onLoad,o=n.onError;return this.newTransaction({accessCode:e,onSuccess:t,onCancel:a,onLoad:r,onError:o})}},{key:"activeTransaction",value:function(){var e=this.transactions.filter(function(e){return e.isActive}),n=e.length?e[e.length-1]:null;return n}},{key:"cancelTransaction",value:function(e){var n=this.transactions.find(function(n){return n.id===e})||this.activeTransaction();n&&(n.cancel(),this.close())}},{key:"respondToEvent",value:function(e){if(e){var n,t,a=this.activeTransaction();try{var r=e.data||e.message,o=r.event,i=r.data;if(o)switch(o){case"loaded:checkout":if(this.isLoaded=!0,a){var c=this.checkoutIframe,s=a.urlParameters,l=a.response;Me({checkoutIframe:c,urlParameters:l?{accessCode:l.access_code,language:null==s?void 0:s.language}:s})}break;case"loaded:transaction":n=this.backgroundIframe,(t=n.contentWindow.document)&&(t.getElementById("app-loader").style.display="none"),a.onLoad(i);break;case"error":"setup"===i.type?a.onSetupError(i):a.logError(i);break;case"cancel":case"close":this.close();var u=i&&i.status;u&&a.setStatus(u),this.hasMountedPaymentRequestButtons()||(a.isActive=!1),a.onCancel();break;case"transfer:pending":this.close();var d=i&&i.status;d&&a.setStatus(d),a.onBankTransferConfirmationPending();break;case"success":this.close(),a.onSuccess(i)}}catch(e){}}}},{key:"respondToEmbedEvents",value:function(e){var n,t,a=this.activeTransaction(),r=e.data||e.message;if(r&&("string"==typeof r||r instanceof String)){var o={action:t=(n=r)&&"string"==typeof n?n.split(" ")[0]:null,data:t?n.split(" ").slice(2).join(" "):null};if(o&&"PaystackClose"===o.action)o.data&&a.onSuccess(r);"PaystackTLSClose"===o.action&&a.cancel()}}},{key:"animateCheckoutIn",value:function(){var e,n=this;if(!this.isOpen){var t=this.checkoutIframe,a=this.backgroundIframe;(e={checkoutIframe:t,backgroundIframe:a},new Promise(function(n,t){e||t("No dom element provided");var a=e.checkoutIframe,r=e.backgroundIframe;a&&r||t("No dom element provided"),a.style.display="",a.style.visibility="visible",r.style.display="",r.style.visibility="visible",n()})).then(function(){n.checkoutIframe.contentWindow.postMessage("render","*")}),this.isOpen=!0}}},{key:"open",value:function(e,n){e&&(Me({checkoutIframe:this.checkoutIframe,urlParameters:e}),n||this.animateCheckoutIn())}},{key:"close",value:function(){var e=this;if(this.isOpen){var n,t=this.checkoutIframe,a=this.backgroundIframe;(n={checkoutIframe:t,backgroundIframe:a},new Promise(function(e,t){n||t("No dom element provided");var a=n.checkoutIframe,r=n.backgroundIframe;a&&r||t("No dom element provided"),r.style.opacity=0,a.style.display="none",a.style.visibility="hidden",setTimeout(function(){r.style.display="none",r.style.visibility="hidden",r.style.opacity=1,e()},300)})).then(function(){e.checkoutIframe.contentWindow.postMessage("close","*")}),this.isOpen=!1}}},{key:"isLoaded",value:function(){return this.isLoaded}}],[{key:"setup",value:function(n){var t=n&&n.container;be||(be=new e({isDeprecatedApi:!0,isEmbed:t})),H("PaystackPop.setup()","new PaystackPop()","Please consult our documentation at https://developers.paystack.co/docs/paystack-inline");var a=be.newTransaction(n,"deprecated"),r=a.urlParameters;if(t){var o="".concat(g.siteUrl,"/assets/payment/production/inline.html?").concat(f(r)),i=function(e,n){var t=le("embed-checkout-".concat(e));return t.style.cssText="\n background: transparent;\n background: rgba(0,0,0,0);\n border: 0px none transparent;\n overflow-x: hidden;\n overflow-y: hidden;\n nmargin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n visibility: hidden;\n display: none;\n",t.src=n,t.id=e,t.name=e,t.setAttribute("allowpaymentrequest","true"),t.setAttribute("allow","payment; clipboard-read; clipboard-write"),t}(be.id,o);!function(e,n){var t=document.getElementById(e);t.innerHTML="",t.removeAttribute("style"),t.className="paystack-embed-container",t.style.position="relative",t.style.width="100%",t.appendChild(n)}(n.container,i),i.onload=function(){var e;i.contentWindow.postMessage("PaystackOpen ".concat(be.id),"*"),e=i,new Promise(function(n,t){e||t("No dom element provided"),e.style.display="",e.style.visibility="visible",n()})}}else a.openIframe=function(){H("openIframe","open","Please consult our documentation at https://developers.paystack.co/docs/paystack-inline"),be.open(r)};return a}}])}();if(Ue=V().length>0,Le=z()&&"FORM"===z().parentElement.tagName,Ue&&Le){var Be,De=function(){var e={},n=z();return V().forEach(function(t){var a=n.getAttribute(t),r=t.split("data-")[1].replace(/-([a-z])/g,function(e){return e[1].toUpperCase()});e[r]=a}),function(e){if(e.buttonId&&!document.getElementById(e.buttonId))throw new Error("Please make sure the buttonId is an element available in the DOM");var n=i({},e);n.buttonText=e.buttonText||"Pay",n.buttonVariant="normal",n.buttonWordmarkVariant="normal";var t=["normal","light"];return e.buttonVariant&&t.indexOf(e.buttonVariant)>-1&&(n.buttonVariant=e.buttonVariant),e.buttonWordmarkVariant&&t.indexOf(e.buttonWordmarkVariant)>-1&&(n.buttonWordmarkVariant=e.buttonWordmarkVariant),n}(e)}(),Ge=z().parentElement;be||(be=new Re),function(e){var n;if(e.id)(n=document.getElementById(e.id)).setAttribute("data-inline-id",e.id);else{var t=document.createElement("div");t.id="inline-button-".concat(e.inlineId),t.innerHTML=function(e){var n,t,a={normal:'\n <svg id="inline-button-wordmark" width="137" height="13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M.037 5.095l1.075-.135c-.011-.774-.025-1.944-.013-2.149C1.19 1.364 2.38.134 3.81.013 3.9.006 3.99.002 4.077 0a2.947 2.947 0 0 1 2.046.76c.574.509.95 1.26 1.008 2.007.015.192.01 1.491.01 2.257l1.096.163L8.2 11.44 4.093 12 0 11.346l.037-6.251zm4.106-.514l1.724.256c-.007-.933-.05-2.295-.26-2.654-.319-.545-.846-.867-1.443-.88h-.063c-.607.008-1.138.322-1.458.864-.222.378-.266 1.66-.265 2.637l1.765-.223zM18.228 10.108c-.576 0-1.064-.072-1.464-.216a2.864 2.864 0 0 1-.972-.6 2.552 2.552 0 0 1-.588-.864 4.067 4.067 0 0 1-.252-1.044h1.008c.032.256.088.5.168.732.08.224.204.424.372.6.168.168.388.304.66.408.28.096.636.144 1.068.144.28 0 .536-.036.768-.108.24-.08.448-.192.624-.336.176-.144.312-.316.408-.516.104-.2.156-.42.156-.66 0-.24-.032-.448-.096-.624a1.02 1.02 0 0 0-.336-.468 1.885 1.885 0 0 0-.636-.324 6.4 6.4 0 0 0-1.008-.228 8.79 8.79 0 0 1-1.212-.276 3.246 3.246 0 0 1-.9-.432 1.982 1.982 0 0 1-.564-.672c-.128-.272-.192-.6-.192-.984 0-.328.068-.632.204-.912.136-.288.324-.536.564-.744.248-.208.54-.372.876-.492.336-.12.708-.18 1.116-.18.864 0 1.548.204 2.052.612.512.4.812.984.9 1.752h-.936c-.104-.544-.316-.932-.636-1.164-.32-.24-.78-.36-1.38-.36-.592 0-1.04.132-1.344.396a1.255 1.255 0 0 0-.444.996c0 .208.024.396.072.564.056.16.156.3.3.42.152.12.36.228.624.324a6.72 6.72 0 0 0 1.068.228c.48.072.9.168 1.26.288.36.12.664.276.912.468s.432.428.552.708c.128.28.192.624.192 1.032 0 .36-.076.696-.228 1.008a2.472 2.472 0 0 1-.612.804c-.264.224-.58.4-.948.528-.36.128-.752.192-1.176.192zM25.355 10.108c-.44 0-.848-.076-1.224-.228a2.916 2.916 0 0 1-.96-.636 2.966 2.966 0 0 1-.636-1.008 3.77 3.77 0 0 1-.216-1.308v-.096c0-.472.072-.904.216-1.296.144-.4.344-.74.6-1.02.264-.288.576-.508.936-.66.36-.16.756-.24 1.188-.24.36 0 .708.06 1.044.18.344.112.648.292.912.54.264.248.472.572.624.972.16.392.24.868.24 1.428v.324h-4.728c.024.72.204 1.272.54 1.656.336.376.828.564 1.476.564.984 0 1.54-.364 1.668-1.092h.996c-.112.632-.408 1.112-.888 1.44-.48.32-1.076.48-1.788.48zm1.704-3.852c-.048-.648-.232-1.112-.552-1.392-.312-.28-.728-.42-1.248-.42-.512 0-.932.164-1.26.492-.32.32-.524.76-.612 1.32h3.672zM32.091 10.108c-.44 0-.848-.072-1.224-.216a3.054 3.054 0 0 1-.972-.636 3.12 3.12 0 0 1-.648-1.008 3.626 3.626 0 0 1-.228-1.32v-.096c0-.48.08-.916.24-1.308.16-.4.376-.74.648-1.02.28-.28.604-.496.972-.648.376-.16.772-.24 1.188-.24.328 0 .644.04.948.12.312.08.588.208.828.384.248.168.456.392.624.672.168.28.276.62.324 1.02h-.984c-.08-.496-.284-.848-.612-1.056-.32-.208-.696-.312-1.128-.312a1.93 1.93 0 0 0-.804.168c-.24.112-.452.272-.636.48a2.23 2.23 0 0 0-.42.744 2.991 2.991 0 0 0-.156.996v.096c0 .776.188 1.364.564 1.764.384.392.88.588 1.488.588.224 0 .436-.032.636-.096a1.651 1.651 0 0 0 .96-.768c.112-.192.18-.416.204-.672h.924a2.595 2.595 0 0 1-.276.948 2.386 2.386 0 0 1-.576.744c-.24.208-.52.372-.84.492-.32.12-.668.18-1.044.18zM38.335 10.108a2.83 2.83 0 0 1-.876-.132 1.724 1.724 0 0 1-.684-.42 2.145 2.145 0 0 1-.456-.756c-.112-.304-.168-.672-.168-1.104V3.724h.996v3.924c0 .552.116.956.348 1.212.24.256.608.384 1.104.384.224 0 .44-.036.648-.108.208-.072.392-.18.552-.324.16-.144.288-.324.384-.54.096-.216.144-.464.144-.744V3.724h.996V10h-.996v-.996c-.144.296-.388.556-.732.78-.336.216-.756.324-1.26.324zM43.216 3.724h.996v1.128c.2-.352.452-.64.756-.864.312-.232.748-.356 1.308-.372v.936a4.461 4.461 0 0 0-.852.12 1.647 1.647 0 0 0-.66.324 1.472 1.472 0 0 0-.408.612c-.096.248-.144.564-.144.948V10h-.996V3.724zM50 10.108c-.44 0-.848-.076-1.224-.228a2.916 2.916 0 0 1-.96-.636 2.966 2.966 0 0 1-.636-1.008 3.77 3.77 0 0 1-.216-1.308v-.096c0-.472.072-.904.216-1.296.144-.4.344-.74.6-1.02.264-.288.576-.508.936-.66.36-.16.756-.24 1.188-.24.36 0 .708.06 1.044.18.344.112.648.292.912.54.264.248.472.572.624.972.16.392.24.868.24 1.428v.324h-4.728c.024.72.204 1.272.54 1.656.336.376.828.564 1.476.564.984 0 1.54-.364 1.668-1.092h.996c-.112.632-.408 1.112-.888 1.44-.48.32-1.076.48-1.788.48zm1.704-3.852c-.048-.648-.232-1.112-.552-1.392-.312-.28-.728-.42-1.248-.42-.512 0-.932.164-1.26.492-.32.32-.524.76-.612 1.32h3.672zM56.496 10.108c-.408 0-.788-.068-1.14-.204a2.683 2.683 0 0 1-.9-.612 3.01 3.01 0 0 1-.588-.984 4.01 4.01 0 0 1-.204-1.32v-.096c0-.48.072-.92.216-1.32.144-.4.344-.744.6-1.032.256-.296.564-.524.924-.684.36-.16.756-.24 1.188-.24.528 0 .956.112 1.284.336.328.216.584.476.768.78V.724h.996V10h-.996V8.92c-.088.152-.208.3-.36.444a2.792 2.792 0 0 1-.516.384 2.874 2.874 0 0 1-.6.252c-.216.072-.44.108-.672.108zm.108-.828c.288 0 .56-.048.816-.144.256-.096.476-.24.66-.432.184-.2.328-.448.432-.744.112-.304.168-.656.168-1.056v-.096c0-.808-.18-1.404-.54-1.788-.352-.384-.836-.576-1.452-.576-.624 0-1.112.208-1.464.624-.352.416-.528 1.008-.528 1.776v.096c0 .392.048.736.144 1.032.104.296.24.54.408.732.176.192.38.336.612.432.232.096.48.144.744.144zM67.712 10.108c-.512 0-.948-.112-1.308-.336a2.38 2.38 0 0 1-.816-.804V10h-.996V.724h.996V4.78a1.92 1.92 0 0 1 .348-.432c.152-.144.32-.268.504-.372.192-.112.396-.2.612-.264.216-.064.436-.096.66-.096.408 0 .788.072 1.14.216.352.144.652.352.9.624.256.272.456.604.6.996.144.392.216.832.216 1.32v.096c0 .48-.068.92-.204 1.32a3.103 3.103 0 0 1-.576 1.02 2.583 2.583 0 0 1-.9.672 2.937 2.937 0 0 1-1.176.228zm-.096-.828c.624 0 1.1-.2 1.428-.6.328-.408.492-.996.492-1.764V6.82c0-.4-.052-.748-.156-1.044a2.095 2.095 0 0 0-.42-.732 1.53 1.53 0 0 0-.612-.444 1.798 1.798 0 0 0-.744-.156c-.288 0-.56.048-.816.144a1.71 1.71 0 0 0-.648.444c-.184.192-.328.44-.432.744a3.152 3.152 0 0 0-.156 1.044v.096c0 .8.192 1.396.576 1.788.384.384.88.576 1.488.576zM73.63 9.352l-2.46-5.628h1.068l1.92 4.5 1.74-4.5h1.02l-3.468 8.46h-1.008l1.188-2.832zM87.127 3.669A3.138 3.138 0 0 0 86.1 2.95a3.09 3.09 0 0 0-1.228-.25c-.448 0-.848.086-1.187.26a2.199 2.199 0 0 0-.662.497v-.191a.387.387 0 0 0-.214-.348.323.323 0 0 0-.14-.03h-1.315a.314.314 0 0 0-.254.116.377.377 0 0 0-.1.262v8.97c0 .1.034.188.1.258a.34.34 0 0 0 .254.103h1.341a.342.342 0 0 0 .244-.103.336.336 0 0 0 .11-.259v-3.06c.178.202.417.357.702.464.35.134.72.203 1.093.203.43 0 .848-.082 1.242-.248a3.124 3.124 0 0 0 1.04-.724c.305-.326.545-.709.707-1.128a3.93 3.93 0 0 0 .263-1.477c0-.54-.086-1.037-.263-1.477a3.387 3.387 0 0 0-.706-1.12zm-1.204 3.24c-.073.19-.18.362-.315.51a1.415 1.415 0 0 1-1.065.466c-.2.001-.4-.04-.584-.12a1.484 1.484 0 0 1-.49-.346 1.593 1.593 0 0 1-.32-.51 1.738 1.738 0 0 1-.115-.63c0-.224.04-.435.115-.631a1.532 1.532 0 0 1 .804-.846c.185-.086.386-.13.59-.129.215 0 .414.044.593.13.177.083.338.199.474.341a1.622 1.622 0 0 1 .425 1.135c0 .225-.037.436-.112.63zM95.298 2.89h-1.33a.339.339 0 0 0-.246.11.384.384 0 0 0-.108.266v.166a1.856 1.856 0 0 0-.602-.472 2.525 2.525 0 0 0-1.166-.258 3.227 3.227 0 0 0-2.284.964 3.554 3.554 0 0 0-.734 1.123 3.827 3.827 0 0 0-.275 1.477c0 .54.092 1.037.275 1.477.184.434.427.817.728 1.128a3.146 3.146 0 0 0 2.277.973c.437 0 .834-.088 1.173-.259.25-.13.456-.287.608-.471v.177a.34.34 0 0 0 .11.259.341.341 0 0 0 .244.104h1.33a.324.324 0 0 0 .25-.105.349.349 0 0 0 .102-.258V3.267a.377.377 0 0 0-.1-.262.325.325 0 0 0-.252-.115zM93.502 6.9a1.55 1.55 0 0 1-.312.511c-.136.143-.296.26-.473.344-.178.085-.38.129-.596.129-.207 0-.407-.044-.59-.13a1.501 1.501 0 0 1-.791-.855 1.766 1.766 0 0 1-.112-.62c0-.225.038-.436.112-.632.075-.193.181-.364.314-.504.137-.143.3-.26.478-.342.182-.085.382-.129.59-.129.215 0 .417.044.595.13.178.085.338.2.473.341a1.623 1.623 0 0 1 .424 1.135c0 .215-.037.424-.112.622zM108.567 6.094a2.265 2.265 0 0 0-.654-.402c-.247-.101-.509-.181-.785-.235l-1.014-.204c-.26-.05-.441-.117-.543-.203a.328.328 0 0 1-.136-.264c0-.11.063-.2.189-.282.137-.086.329-.13.566-.13.26 0 .518.053.757.157.243.106.471.226.67.36.295.187.546.162.727-.053l.487-.57a.543.543 0 0 0 .152-.357c0-.128-.064-.245-.185-.351-.207-.184-.533-.378-.971-.568-.437-.192-.987-.29-1.637-.29-.427 0-.82.058-1.168.172-.35.116-.65.276-.893.474-.245.204-.438.44-.57.713a2 2 0 0 0-.198.875c0 .56.167 1.017.496 1.358.328.333.766.56 1.304.67l1.054.232c.3.062.528.132.675.21.129.067.19.163.19.297 0 .12-.061.227-.188.324-.133.104-.342.155-.622.155a1.83 1.83 0 0 1-.831-.19 3.056 3.056 0 0 1-.678-.458.995.995 0 0 0-.307-.17c-.126-.037-.268.003-.431.13l-.583.461c-.169.145-.24.32-.209.522.029.194.19.394.491.62.269.193.614.368 1.029.518.415.151.901.229 1.453.229.444 0 .854-.058 1.215-.172.362-.119.681-.278.941-.48a2.056 2.056 0 0 0 .819-1.663c0-.319-.053-.6-.165-.836a1.843 1.843 0 0 0-.447-.6zM114.383 7.73a.363.363 0 0 0-.295-.192.55.55 0 0 0-.343.113c-.095.062-.198.11-.306.141a.75.75 0 0 1-.426.013.43.43 0 0 1-.181-.093.554.554 0 0 1-.143-.204.92.92 0 0 1-.059-.362v-2.46h1.731c.099 0 .188-.04.266-.117a.368.368 0 0 0 .112-.26V3.268a.369.369 0 0 0-.115-.268.38.38 0 0 0-.263-.109h-1.732V1.216a.354.354 0 0 0-.108-.27.347.347 0 0 0-.243-.104h-1.344a.36.36 0 0 0-.34.226.371.371 0 0 0-.027.148V2.89h-.767a.324.324 0 0 0-.255.115.385.385 0 0 0-.098.262V4.31a.4.4 0 0 0 .212.346c.044.021.092.032.14.03h.768v2.925c0 .39.069.726.2 1.003.132.274.305.504.514.676.217.178.465.31.731.388.27.084.551.126.833.126.385 0 .75-.061 1.094-.18a2.13 2.13 0 0 0 .861-.552c.152-.181.17-.381.046-.581l-.463-.76zM121.672 2.89h-1.329a.339.339 0 0 0-.244.11.39.39 0 0 0-.08.122.394.394 0 0 0-.027.144v.166a1.906 1.906 0 0 0-.605-.472c-.335-.173-.726-.258-1.168-.258-.42 0-.834.083-1.226.249a3.24 3.24 0 0 0-1.055.715 3.528 3.528 0 0 0-.734 1.123 3.79 3.79 0 0 0-.276 1.477c0 .54.092 1.037.275 1.477.184.434.428.817.729 1.128a3.138 3.138 0 0 0 2.273.973 2.59 2.59 0 0 0 1.175-.259c.255-.13.457-.287.612-.471v.177a.34.34 0 0 0 .108.259.343.343 0 0 0 .243.104h1.329a.335.335 0 0 0 .252-.105.364.364 0 0 0 .102-.258V3.267a.38.38 0 0 0-.1-.262.332.332 0 0 0-.115-.087.311.311 0 0 0-.139-.028zM119.876 6.9a1.534 1.534 0 0 1-.786.855 1.362 1.362 0 0 1-.594.129c-.207 0-.405-.044-.588-.13a1.516 1.516 0 0 1-.792-.855 1.757 1.757 0 0 1-.113-.62c0-.225.037-.436.112-.632.073-.187.179-.358.314-.504.138-.143.3-.26.479-.342.184-.086.385-.13.588-.129.217 0 .415.044.594.13.181.085.34.2.472.341.134.143.24.313.314.504a1.73 1.73 0 0 1 0 1.253zM128.978 7.64l-.763-.593c-.146-.118-.284-.15-.404-.1a.742.742 0 0 0-.279.205 2.527 2.527 0 0 1-.583.535c-.192.122-.444.183-.742.183-.219 0-.42-.04-.6-.122a1.423 1.423 0 0 1-.469-.342 1.575 1.575 0 0 1-.308-.51 1.751 1.751 0 0 1-.106-.617c0-.228.034-.438.106-.632.07-.192.173-.363.308-.503.135-.144.295-.26.472-.342.187-.088.391-.132.597-.13.298 0 .547.064.742.187.198.126.396.306.584.534.078.092.17.16.278.206.122.048.259.016.401-.101l.762-.594a.53.53 0 0 0 .201-.269.437.437 0 0 0-.034-.365 3.329 3.329 0 0 0-1.18-1.127c-.504-.291-1.108-.441-1.784-.441a3.519 3.519 0 0 0-2.51 1.033c-.322.322-.576.71-.747 1.137a3.68 3.68 0 0 0-.273 1.407c0 .495.093.968.273 1.402.173.424.427.808.747 1.128a3.527 3.527 0 0 0 2.51 1.034c.676 0 1.28-.149 1.784-.444a3.286 3.286 0 0 0 1.182-1.13.411.411 0 0 0 .055-.173.415.415 0 0 0-.023-.182.624.624 0 0 0-.197-.273zM136.06 9.045l-2.104-3.143 1.801-2.415c.094-.139.119-.272.075-.397-.031-.09-.116-.2-.334-.2h-1.425a.52.52 0 0 0-.234.058.482.482 0 0 0-.209.205L132.191 5.2h-.349V.363a.37.37 0 0 0-.099-.26.352.352 0 0 0-.253-.103h-1.332a.37.37 0 0 0-.337.22.346.346 0 0 0-.027.143V9.29c0 .103.038.193.11.259a.353.353 0 0 0 .254.104h1.333a.328.328 0 0 0 .251-.105.346.346 0 0 0 .075-.119.333.333 0 0 0 .024-.14V6.927h.386l1.571 2.446c.112.187.267.281.46.281h1.491c.226 0 .32-.11.358-.202.054-.13.038-.262-.047-.406zM102.863 2.89h-1.489a.389.389 0 0 0-.298.122.544.544 0 0 0-.13.249l-1.099 4.167h-.268l-1.182-4.167a.66.66 0 0 0-.113-.247.329.329 0 0 0-.264-.124h-1.544c-.199 0-.325.066-.372.193a.588.588 0 0 0-.002.37l1.887 5.865c.03.093.08.17.145.232a.388.388 0 0 0 .281.104h.798l-.066.19-.19.547a.872.872 0 0 1-.29.426.7.7 0 0 1-.442.148.956.956 0 0 1-.4-.09 1.842 1.842 0 0 1-.35-.209.62.62 0 0 0-.335-.115h-.016c-.13 0-.243.074-.334.216l-.474.708c-.193.304-.086.504.039.615.234.224.528.399.875.524.344.125.723.186 1.126.186.682 0 1.252-.187 1.689-.565.435-.376.756-.887.952-1.524l2.188-7.258c.05-.155.05-.284.005-.389-.037-.08-.125-.174-.327-.174z" fill="#011B33"/>\n </svg>',light:'\n <svg id="inline-button-wordmark--white" width="137" height="13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M.037 5.095l1.075-.135c-.011-.774-.025-1.944-.013-2.149C1.19 1.364 2.38.134 3.81.013 3.9.006 3.99.002 4.077 0a2.947 2.947 0 0 1 2.046.76c.574.509.95 1.26 1.008 2.007.015.192.01 1.491.01 2.257l1.096.163L8.2 11.44 4.093 12 0 11.346l.037-6.251zm4.106-.514l1.724.256c-.007-.933-.05-2.295-.26-2.654-.319-.545-.846-.867-1.443-.88h-.063c-.607.008-1.138.322-1.458.864-.222.378-.266 1.66-.265 2.637l1.765-.223zM18.228 10.108c-.576 0-1.064-.072-1.464-.216a2.864 2.864 0 0 1-.972-.6 2.552 2.552 0 0 1-.588-.864 4.067 4.067 0 0 1-.252-1.044h1.008c.032.256.088.5.168.732.08.224.204.424.372.6.168.168.388.304.66.408.28.096.636.144 1.068.144.28 0 .536-.036.768-.108.24-.08.448-.192.624-.336.176-.144.312-.316.408-.516.104-.2.156-.42.156-.66 0-.24-.032-.448-.096-.624a1.02 1.02 0 0 0-.336-.468 1.885 1.885 0 0 0-.636-.324 6.4 6.4 0 0 0-1.008-.228 8.79 8.79 0 0 1-1.212-.276 3.246 3.246 0 0 1-.9-.432 1.982 1.982 0 0 1-.564-.672c-.128-.272-.192-.6-.192-.984 0-.328.068-.632.204-.912.136-.288.324-.536.564-.744.248-.208.54-.372.876-.492.336-.12.708-.18 1.116-.18.864 0 1.548.204 2.052.612.512.4.812.984.9 1.752h-.936c-.104-.544-.316-.932-.636-1.164-.32-.24-.78-.36-1.38-.36-.592 0-1.04.132-1.344.396a1.255 1.255 0 0 0-.444.996c0 .208.024.396.072.564.056.16.156.3.3.42.152.12.36.228.624.324a6.72 6.72 0 0 0 1.068.228c.48.072.9.168 1.26.288.36.12.664.276.912.468s.432.428.552.708c.128.28.192.624.192 1.032 0 .36-.076.696-.228 1.008a2.472 2.472 0 0 1-.612.804c-.264.224-.58.4-.948.528-.36.128-.752.192-1.176.192zM25.355 10.108c-.44 0-.848-.076-1.224-.228a2.916 2.916 0 0 1-.96-.636 2.966 2.966 0 0 1-.636-1.008 3.77 3.77 0 0 1-.216-1.308v-.096c0-.472.072-.904.216-1.296.144-.4.344-.74.6-1.02.264-.288.576-.508.936-.66.36-.16.756-.24 1.188-.24.36 0 .708.06 1.044.18.344.112.648.292.912.54.264.248.472.572.624.972.16.392.24.868.24 1.428v.324h-4.728c.024.72.204 1.272.54 1.656.336.376.828.564 1.476.564.984 0 1.54-.364 1.668-1.092h.996c-.112.632-.408 1.112-.888 1.44-.48.32-1.076.48-1.788.48zm1.704-3.852c-.048-.648-.232-1.112-.552-1.392-.312-.28-.728-.42-1.248-.42-.512 0-.932.164-1.26.492-.32.32-.524.76-.612 1.32h3.672zM32.091 10.108c-.44 0-.848-.072-1.224-.216a3.054 3.054 0 0 1-.972-.636 3.12 3.12 0 0 1-.648-1.008 3.626 3.626 0 0 1-.228-1.32v-.096c0-.48.08-.916.24-1.308.16-.4.376-.74.648-1.02.28-.28.604-.496.972-.648.376-.16.772-.24 1.188-.24.328 0 .644.04.948.12.312.08.588.208.828.384.248.168.456.392.624.672.168.28.276.62.324 1.02h-.984c-.08-.496-.284-.848-.612-1.056-.32-.208-.696-.312-1.128-.312a1.93 1.93 0 0 0-.804.168c-.24.112-.452.272-.636.48a2.23 2.23 0 0 0-.42.744 2.991 2.991 0 0 0-.156.996v.096c0 .776.188 1.364.564 1.764.384.392.88.588 1.488.588.224 0 .436-.032.636-.096a1.651 1.651 0 0 0 .96-.768c.112-.192.18-.416.204-.672h.924a2.595 2.595 0 0 1-.276.948 2.386 2.386 0 0 1-.576.744c-.24.208-.52.372-.84.492-.32.12-.668.18-1.044.18zM38.335 10.108a2.83 2.83 0 0 1-.876-.132 1.724 1.724 0 0 1-.684-.42 2.145 2.145 0 0 1-.456-.756c-.112-.304-.168-.672-.168-1.104V3.724h.996v3.924c0 .552.116.956.348 1.212.24.256.608.384 1.104.384.224 0 .44-.036.648-.108.208-.072.392-.18.552-.324.16-.144.288-.324.384-.54.096-.216.144-.464.144-.744V3.724h.996V10h-.996v-.996c-.144.296-.388.556-.732.78-.336.216-.756.324-1.26.324zM43.216 3.724h.996v1.128c.2-.352.452-.64.756-.864.312-.232.748-.356 1.308-.372v.936a4.461 4.461 0 0 0-.852.12 1.647 1.647 0 0 0-.66.324 1.472 1.472 0 0 0-.408.612c-.096.248-.144.564-.144.948V10h-.996V3.724zM50 10.108c-.44 0-.848-.076-1.224-.228a2.916 2.916 0 0 1-.96-.636 2.966 2.966 0 0 1-.636-1.008 3.77 3.77 0 0 1-.216-1.308v-.096c0-.472.072-.904.216-1.296.144-.4.344-.74.6-1.02.264-.288.576-.508.936-.66.36-.16.756-.24 1.188-.24.36 0 .708.06 1.044.18.344.112.648.292.912.54.264.248.472.572.624.972.16.392.24.868.24 1.428v.324h-4.728c.024.72.204 1.272.54 1.656.336.376.828.564 1.476.564.984 0 1.54-.364 1.668-1.092h.996c-.112.632-.408 1.112-.888 1.44-.48.32-1.076.48-1.788.48zm1.704-3.852c-.048-.648-.232-1.112-.552-1.392-.312-.28-.728-.42-1.248-.42-.512 0-.932.164-1.26.492-.32.32-.524.76-.612 1.32h3.672zM56.496 10.108c-.408 0-.788-.068-1.14-.204a2.683 2.683 0 0 1-.9-.612 3.01 3.01 0 0 1-.588-.984 4.01 4.01 0 0 1-.204-1.32v-.096c0-.48.072-.92.216-1.32.144-.4.344-.744.6-1.032.256-.296.564-.524.924-.684.36-.16.756-.24 1.188-.24.528 0 .956.112 1.284.336.328.216.584.476.768.78V.724h.996V10h-.996V8.92c-.088.152-.208.3-.36.444a2.792 2.792 0 0 1-.516.384 2.874 2.874 0 0 1-.6.252c-.216.072-.44.108-.672.108zm.108-.828c.288 0 .56-.048.816-.144.256-.096.476-.24.66-.432.184-.2.328-.448.432-.744.112-.304.168-.656.168-1.056v-.096c0-.808-.18-1.404-.54-1.788-.352-.384-.836-.576-1.452-.576-.624 0-1.112.208-1.464.624-.352.416-.528 1.008-.528 1.776v.096c0 .392.048.736.144 1.032.104.296.24.54.408.732.176.192.38.336.612.432.232.096.48.144.744.144zM67.712 10.108c-.512 0-.948-.112-1.308-.336a2.38 2.38 0 0 1-.816-.804V10h-.996V.724h.996V4.78a1.92 1.92 0 0 1 .348-.432c.152-.144.32-.268.504-.372.192-.112.396-.2.612-.264.216-.064.436-.096.66-.096.408 0 .788.072 1.14.216.352.144.652.352.9.624.256.272.456.604.6.996.144.392.216.832.216 1.32v.096c0 .48-.068.92-.204 1.32a3.103 3.103 0 0 1-.576 1.02 2.583 2.583 0 0 1-.9.672 2.937 2.937 0 0 1-1.176.228zm-.096-.828c.624 0 1.1-.2 1.428-.6.328-.408.492-.996.492-1.764V6.82c0-.4-.052-.748-.156-1.044a2.095 2.095 0 0 0-.42-.732 1.53 1.53 0 0 0-.612-.444 1.798 1.798 0 0 0-.744-.156c-.288 0-.56.048-.816.144a1.71 1.71 0 0 0-.648.444c-.184.192-.328.44-.432.744a3.152 3.152 0 0 0-.156 1.044v.096c0 .8.192 1.396.576 1.788.384.384.88.576 1.488.576zM73.63 9.352l-2.46-5.628h1.068l1.92 4.5 1.74-4.5h1.02l-3.468 8.46h-1.008l1.188-2.832zM87.127 3.669A3.138 3.138 0 0 0 86.1 2.95a3.09 3.09 0 0 0-1.228-.25c-.448 0-.848.086-1.187.26a2.199 2.199 0 0 0-.662.497v-.191a.387.387 0 0 0-.214-.348.323.323 0 0 0-.14-.03h-1.315a.314.314 0 0 0-.254.116.377.377 0 0 0-.1.262v8.97c0 .1.034.188.1.258a.34.34 0 0 0 .254.103h1.341a.342.342 0 0 0 .244-.103.336.336 0 0 0 .11-.259v-3.06c.178.202.417.357.702.464.35.134.72.203 1.093.203.43 0 .848-.082 1.242-.248a3.124 3.124 0 0 0 1.04-.724c.305-.326.545-.709.707-1.128a3.93 3.93 0 0 0 .263-1.477c0-.54-.086-1.037-.263-1.477a3.387 3.387 0 0 0-.706-1.12zm-1.204 3.24c-.073.19-.18.362-.315.51a1.415 1.415 0 0 1-1.065.466c-.2.001-.4-.04-.584-.12a1.484 1.484 0 0 1-.49-.346 1.593 1.593 0 0 1-.32-.51 1.738 1.738 0 0 1-.115-.63c0-.224.04-.435.115-.631a1.532 1.532 0 0 1 .804-.846c.185-.086.386-.13.59-.129.215 0 .414.044.593.13.177.083.338.199.474.341a1.622 1.622 0 0 1 .425 1.135c0 .225-.037.436-.112.63zM95.298 2.89h-1.33a.339.339 0 0 0-.246.11.384.384 0 0 0-.108.266v.166a1.856 1.856 0 0 0-.602-.472 2.525 2.525 0 0 0-1.166-.258 3.227 3.227 0 0 0-2.284.964 3.554 3.554 0 0 0-.734 1.123 3.827 3.827 0 0 0-.275 1.477c0 .54.092 1.037.275 1.477.184.434.427.817.728 1.128a3.146 3.146 0 0 0 2.277.973c.437 0 .834-.088 1.173-.259.25-.13.456-.287.608-.471v.177a.34.34 0 0 0 .11.259.341.341 0 0 0 .244.104h1.33a.324.324 0 0 0 .25-.105.349.349 0 0 0 .102-.258V3.267a.377.377 0 0 0-.1-.262.325.325 0 0 0-.252-.115zM93.502 6.9a1.55 1.55 0 0 1-.312.511c-.136.143-.296.26-.473.344-.178.085-.38.129-.596.129-.207 0-.407-.044-.59-.13a1.501 1.501 0 0 1-.791-.855 1.766 1.766 0 0 1-.112-.62c0-.225.038-.436.112-.632.075-.193.181-.364.314-.504.137-.143.3-.26.478-.342.182-.085.382-.129.59-.129.215 0 .417.044.595.13.178.085.338.2.473.341a1.623 1.623 0 0 1 .424 1.135c0 .215-.037.424-.112.622zM108.567 6.094a2.265 2.265 0 0 0-.654-.402c-.247-.101-.509-.181-.785-.235l-1.014-.204c-.26-.05-.441-.117-.543-.203a.328.328 0 0 1-.136-.264c0-.11.063-.2.189-.282.137-.086.329-.13.566-.13.26 0 .518.053.757.157.243.106.471.226.67.36.295.187.546.162.727-.053l.487-.57a.543.543 0 0 0 .152-.357c0-.128-.064-.245-.185-.351-.207-.184-.533-.378-.971-.568-.437-.192-.987-.29-1.637-.29-.427 0-.82.058-1.168.172-.35.116-.65.276-.893.474-.245.204-.438.44-.57.713a2 2 0 0 0-.198.875c0 .56.167 1.017.496 1.358.328.333.766.56 1.304.67l1.054.232c.3.062.528.132.675.21.129.067.19.163.19.297 0 .12-.061.227-.188.324-.133.104-.342.155-.622.155a1.83 1.83 0 0 1-.831-.19 3.056 3.056 0 0 1-.678-.458.995.995 0 0 0-.307-.17c-.126-.037-.268.003-.431.13l-.583.461c-.169.145-.24.32-.209.522.029.194.19.394.491.62.269.193.614.368 1.029.518.415.151.901.229 1.453.229.444 0 .854-.058 1.215-.172.362-.119.681-.278.941-.48a2.056 2.056 0 0 0 .819-1.663c0-.319-.053-.6-.165-.836a1.843 1.843 0 0 0-.447-.6zM114.383 7.73a.363.363 0 0 0-.295-.192.55.55 0 0 0-.343.113c-.095.062-.198.11-.306.141a.75.75 0 0 1-.426.013.43.43 0 0 1-.181-.093.554.554 0 0 1-.143-.204.92.92 0 0 1-.059-.362v-2.46h1.731c.099 0 .188-.04.266-.117a.368.368 0 0 0 .112-.26V3.268a.369.369 0 0 0-.115-.268.38.38 0 0 0-.263-.109h-1.732V1.216a.354.354 0 0 0-.108-.27.347.347 0 0 0-.243-.104h-1.344a.36.36 0 0 0-.34.226.371.371 0 0 0-.027.148V2.89h-.767a.324.324 0 0 0-.255.115.385.385 0 0 0-.098.262V4.31a.4.4 0 0 0 .212.346c.044.021.092.032.14.03h.768v2.925c0 .39.069.726.2 1.003.132.274.305.504.514.676.217.178.465.31.731.388.27.084.551.126.833.126.385 0 .75-.061 1.094-.18a2.13 2.13 0 0 0 .861-.552c.152-.181.17-.381.046-.581l-.463-.76zM121.672 2.89h-1.329a.339.339 0 0 0-.244.11.39.39 0 0 0-.08.122.394.394 0 0 0-.027.144v.166a1.906 1.906 0 0 0-.605-.472c-.335-.173-.726-.258-1.168-.258-.42 0-.834.083-1.226.249a3.24 3.24 0 0 0-1.055.715 3.528 3.528 0 0 0-.734 1.123 3.79 3.79 0 0 0-.276 1.477c0 .54.092 1.037.275 1.477.184.434.428.817.729 1.128a3.138 3.138 0 0 0 2.273.973 2.59 2.59 0 0 0 1.175-.259c.255-.13.457-.287.612-.471v.177a.34.34 0 0 0 .108.259.343.343 0 0 0 .243.104h1.329a.335.335 0 0 0 .252-.105.364.364 0 0 0 .102-.258V3.267a.38.38 0 0 0-.1-.262.332.332 0 0 0-.115-.087.311.311 0 0 0-.139-.028zM119.876 6.9a1.534 1.534 0 0 1-.786.855 1.362 1.362 0 0 1-.594.129c-.207 0-.405-.044-.588-.13a1.516 1.516 0 0 1-.792-.855 1.757 1.757 0 0 1-.113-.62c0-.225.037-.436.112-.632.073-.187.179-.358.314-.504.138-.143.3-.26.479-.342.184-.086.385-.13.588-.129.217 0 .415.044.594.13.181.085.34.2.472.341.134.143.24.313.314.504a1.73 1.73 0 0 1 0 1.253zM128.978 7.64l-.763-.593c-.146-.118-.284-.15-.404-.1a.742.742 0 0 0-.279.205 2.527 2.527 0 0 1-.583.535c-.192.122-.444.183-.742.183-.219 0-.42-.04-.6-.122a1.423 1.423 0 0 1-.469-.342 1.575 1.575 0 0 1-.308-.51 1.751 1.751 0 0 1-.106-.617c0-.228.034-.438.106-.632.07-.192.173-.363.308-.503.135-.144.295-.26.472-.342.187-.088.391-.132.597-.13.298 0 .547.064.742.187.198.126.396.306.584.534.078.092.17.16.278.206.122.048.259.016.401-.101l.762-.594a.53.53 0 0 0 .201-.269.437.437 0 0 0-.034-.365 3.329 3.329 0 0 0-1.18-1.127c-.504-.291-1.108-.441-1.784-.441a3.519 3.519 0 0 0-2.51 1.033c-.322.322-.576.71-.747 1.137a3.68 3.68 0 0 0-.273 1.407c0 .495.093.968.273 1.402.173.424.427.808.747 1.128a3.527 3.527 0 0 0 2.51 1.034c.676 0 1.28-.149 1.784-.444a3.286 3.286 0 0 0 1.182-1.13.411.411 0 0 0 .055-.173.415.415 0 0 0-.023-.182.624.624 0 0 0-.197-.273zM136.06 9.045l-2.104-3.143 1.801-2.415c.094-.139.119-.272.075-.397-.031-.09-.116-.2-.334-.2h-1.425a.52.52 0 0 0-.234.058.482.482 0 0 0-.209.205L132.191 5.2h-.349V.363a.37.37 0 0 0-.099-.26.352.352 0 0 0-.253-.103h-1.332a.37.37 0 0 0-.337.22.346.346 0 0 0-.027.143V9.29c0 .103.038.193.11.259a.353.353 0 0 0 .254.104h1.333a.328.328 0 0 0 .251-.105.346.346 0 0 0 .075-.119.333.333 0 0 0 .024-.14V6.927h.386l1.571 2.446c.112.187.267.281.46.281h1.491c.226 0 .32-.11.358-.202.054-.13.038-.262-.047-.406zM102.863 2.89h-1.489a.389.389 0 0 0-.298.122.544.544 0 0 0-.13.249l-1.099 4.167h-.268l-1.182-4.167a.66.66 0 0 0-.113-.247.329.329 0 0 0-.264-.124h-1.544c-.199 0-.325.066-.372.193a.588.588 0 0 0-.002.37l1.887 5.865c.03.093.08.17.145.232a.388.388 0 0 0 .281.104h.798l-.066.19-.19.547a.872.872 0 0 1-.29.426.7.7 0 0 1-.442.148.956.956 0 0 1-.4-.09 1.842 1.842 0 0 1-.35-.209.62.62 0 0 0-.335-.115h-.016c-.13 0-.243.074-.334.216l-.474.708c-.193.304-.086.504.039.615.234.224.528.399.875.524.344.125.723.186 1.126.186.682 0 1.252-.187 1.689-.565.435-.376.756-.887.952-1.524l2.188-7.258c.05-.155.05-.284.005-.389-.037-.08-.125-.174-.327-.174z" fill="#ffffff"/>\n </svg>\n'};return"\n <style>\n #inline-button-".concat(e.inlineId," {\n position: relative;\n text-align: center;\n display: inline-block;\n }\n #inline-button-").concat(e.inlineId,"__trigger {\n ").concat((n=e.variant||"normal",t={normal:"\n background: linear-gradient(180deg,#44b669 0,#40ad57);\n text-shadow: 1px 1px 1px rgba(0,0,0,.1);\n color: #ffffff;\n ",light:"\n background: white;\n text-shadow: none;\n color: #011b33;\n "},"".concat("\n box-sizing: border-box;\n display: inline-block;\n line-height: 1;\n white-space: nowrap;\n margin: 0 0 10px;\n text-align: center;\n -webkit-appearance: none;\n outline: none;\n font-size: 14px;\n font-weight: 600;\n border-radius: 6px;\n cursor: pointer;\n padding: 16px 24px;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15);\n transition: all .3s ease;\n border: none;\n min-width: 190px;\n ").concat(t[n])),"\n }\n #inline-button-").concat(e.inlineId,"__trigger:hover {\n box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);\n }\n #inline-button-").concat(e.inlineId,'__trigger:active {\n transform: translateY(3px);\n }\n </style>\n <button id="inline-button-').concat(e.inlineId,'__trigger" data-inline-id="').concat(e.inlineId,'">').concat(e.text||"Pay"," ").concat(e.currency||"NGN"," ").concat(e.amount,'</button>\n <div id="inline-button-').concat(e.inlineId,'__wordmark">\n ').concat(a[e.wordmarkVariant||"normal"],"\n </div>\n ")}(e),e.parent.parentNode.insertBefore(t,e.parent.nextSibling),n=s(t.getElementsByTagName("button"),1)[0]}return n}({inlineId:be.id,amount:De.amount/100,currency:De.currency,id:De.buttonId,text:De.buttonText,variant:De.buttonVariant,wordmarkVariant:De.buttonWordmarkVariant,parent:z()}).addEventListener("click",function(e){e.preventDefault(),Be?be.resumeTransaction(Be.accessCode):Be=be.newTransaction(i(i({},De),{},{onSuccess:function(e){var n,t,a,r,o,i;n={type:"hidden",name:"reference",value:e.reference,parent:Ge},t=n.type,a=n.value,r=n.name,o=n.parent,(i=document.createElement("input")).type=t,i.value=a,i.name=r,o.appendChild(i),Ge.submit()}}))})}return Re}();