@paynext/sdk 0.0.65 → 0.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1701 @@
1
+ import { c as Y, g as te } from "./_commonjs-dynamic-modules-C4BgavC4.js";
2
+ function re(K, X) {
3
+ for (var a = 0; a < X.length; a++) {
4
+ const d = X[a];
5
+ if (typeof d != "string" && !Array.isArray(d)) {
6
+ for (const h in d)
7
+ if (h !== "default" && !(h in K)) {
8
+ const n = Object.getOwnPropertyDescriptor(d, h);
9
+ n && Object.defineProperty(K, h, n.get ? n : {
10
+ enumerable: !0,
11
+ get: () => d[h]
12
+ });
13
+ }
14
+ }
15
+ }
16
+ return Object.freeze(Object.defineProperty(K, Symbol.toStringTag, { value: "Module" }));
17
+ }
18
+ var Z = { exports: {} }, $;
19
+ function ne() {
20
+ return $ || ($ = 1, function(K, X) {
21
+ (function(a) {
22
+ K.exports = a();
23
+ })(function() {
24
+ return (/* @__PURE__ */ function() {
25
+ function a(d, h, n) {
26
+ function o(s, u) {
27
+ if (!h[s]) {
28
+ if (!d[s]) {
29
+ var t = typeof Y == "function" && Y;
30
+ if (!u && t) return t(s, !0);
31
+ if (i) return i(s, !0);
32
+ var r = new Error("Cannot find module '" + s + "'");
33
+ throw r.code = "MODULE_NOT_FOUND", r;
34
+ }
35
+ var e = h[s] = { exports: {} };
36
+ d[s][0].call(e.exports, function(c) {
37
+ var p = d[s][1][c];
38
+ return o(p || c);
39
+ }, e, e.exports, a, d, h, n);
40
+ }
41
+ return h[s].exports;
42
+ }
43
+ for (var i = typeof Y == "function" && Y, l = 0; l < n.length; l++) o(n[l]);
44
+ return o;
45
+ }
46
+ return a;
47
+ }())({ 1: [function(a, d, h) {
48
+ var n = {};
49
+ function o(i) {
50
+ var l, s = JSON.stringify(i);
51
+ if (!i.forceScriptReload && (l = n[s], l))
52
+ return l;
53
+ var u = document.createElement("script"), t = i.dataAttributes || {}, r = i.container || document.head;
54
+ return u.src = i.src, u.id = i.id || "", u.async = !0, i.type && u.setAttribute("type", "".concat(i.type)), i.crossorigin && u.setAttribute("crossorigin", "".concat(i.crossorigin)), i.integrity && u.setAttribute("integrity", "".concat(i.integrity)), Object.keys(t).forEach(function(e) {
55
+ u.setAttribute("data-".concat(e), "".concat(t[e]));
56
+ }), l = new Promise(function(e, c) {
57
+ u.addEventListener("load", function() {
58
+ e(u);
59
+ }), u.addEventListener("error", function() {
60
+ c(new Error("".concat(i.src, " failed to load.")));
61
+ }), u.addEventListener("abort", function() {
62
+ c(new Error("".concat(i.src, " has aborted.")));
63
+ }), r.appendChild(u);
64
+ }), n[s] = l, l;
65
+ }
66
+ o.clearCache = function() {
67
+ n = {};
68
+ }, d.exports = o;
69
+ }, {}], 2: [function(a, d, h) {
70
+ d.exports = a("./dist/load-script");
71
+ }, { "./dist/load-script": 1 }], 3: [function(a, d, h) {
72
+ function n() {
73
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(o) {
74
+ var i = Math.random() * 16 | 0, l = o === "x" ? i : i & 3 | 8;
75
+ return l.toString(16);
76
+ });
77
+ }
78
+ d.exports = n;
79
+ }, {}], 4: [function(a, d, h) {
80
+ Object.defineProperty(h, "__esModule", { value: !0 });
81
+ function n(o) {
82
+ return function() {
83
+ for (var i = [], l = 0; l < arguments.length; l++)
84
+ i[l] = arguments[l];
85
+ setTimeout(function() {
86
+ try {
87
+ o.apply(void 0, i);
88
+ } catch (s) {
89
+ console.log("Error in callback function"), console.log(s);
90
+ }
91
+ }, 1);
92
+ };
93
+ }
94
+ h.deferred = n;
95
+ }, {}], 5: [function(a, d, h) {
96
+ Object.defineProperty(h, "__esModule", { value: !0 });
97
+ function n(o) {
98
+ var i = !1;
99
+ return function() {
100
+ for (var l = [], s = 0; s < arguments.length; s++)
101
+ l[s] = arguments[s];
102
+ i || (i = !0, o.apply(void 0, l));
103
+ };
104
+ }
105
+ h.once = n;
106
+ }, {}], 6: [function(a, d, h) {
107
+ Object.defineProperty(h, "__esModule", { value: !0 });
108
+ function n(o, i) {
109
+ if (!i)
110
+ return o;
111
+ o.then(function(l) {
112
+ return i(null, l);
113
+ }).catch(function(l) {
114
+ return i(l);
115
+ });
116
+ }
117
+ h.promiseOrCallback = n;
118
+ }, {}], 7: [function(a, d, h) {
119
+ var n = a("./lib/deferred"), o = a("./lib/once"), i = a("./lib/promise-or-callback");
120
+ function l(s) {
121
+ return function() {
122
+ for (var u = [], t = 0; t < arguments.length; t++)
123
+ u[t] = arguments[t];
124
+ var r, e = u[u.length - 1];
125
+ return typeof e == "function" && (r = u.pop(), r = o.once(n.deferred(r))), i.promiseOrCallback(s.apply(this, u), r);
126
+ };
127
+ }
128
+ l.wrapPrototype = function(s, u) {
129
+ u === void 0 && (u = {});
130
+ var t = u.ignoreMethods || [], r = u.transformPrivateMethods === !0, e = Object.getOwnPropertyNames(s.prototype).filter(function(c) {
131
+ var p, T = c !== "constructor" && typeof s.prototype[c] == "function", C = t.indexOf(c) === -1;
132
+ return r ? p = !0 : p = c.charAt(0) !== "_", T && p && C;
133
+ });
134
+ return e.forEach(function(c) {
135
+ var p = s.prototype[c];
136
+ s.prototype[c] = l(p);
137
+ }), s;
138
+ }, d.exports = l;
139
+ }, { "./lib/deferred": 4, "./lib/once": 5, "./lib/promise-or-callback": 6 }], 8: [function(a, d, h) {
140
+ (function(n, o) {
141
+ typeof h == "object" && typeof d != "undefined" ? o(h) : (n = typeof globalThis != "undefined" ? globalThis : n || self, o(n.loadAxo = {}));
142
+ })(this, function(n) {
143
+ /*! *****************************************************************************
144
+ Copyright (c) Microsoft Corporation.
145
+
146
+ Permission to use, copy, modify, and/or distribute this software for any
147
+ purpose with or without fee is hereby granted.
148
+
149
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
150
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
151
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
152
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
153
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
154
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
155
+ PERFORMANCE OF THIS SOFTWARE.
156
+ ***************************************************************************** */
157
+ function o(E, N, f, O) {
158
+ function w(I) {
159
+ return I instanceof f ? I : new f(function(M) {
160
+ M(I);
161
+ });
162
+ }
163
+ return new (f || (f = Promise))(function(I, M) {
164
+ function F(V) {
165
+ try {
166
+ L(O.next(V));
167
+ } catch (J) {
168
+ M(J);
169
+ }
170
+ }
171
+ function W(V) {
172
+ try {
173
+ L(O.throw(V));
174
+ } catch (J) {
175
+ M(J);
176
+ }
177
+ }
178
+ function L(V) {
179
+ V.done ? I(V.value) : w(V.value).then(F, W);
180
+ }
181
+ L((O = O.apply(E, [])).next());
182
+ });
183
+ }
184
+ function i(E, N) {
185
+ var f = { label: 0, sent: function() {
186
+ if (I[0] & 1) throw I[1];
187
+ return I[1];
188
+ }, trys: [], ops: [] }, O, w, I, M;
189
+ return M = { next: F(0), throw: F(1), return: F(2) }, typeof Symbol == "function" && (M[Symbol.iterator] = function() {
190
+ return this;
191
+ }), M;
192
+ function F(L) {
193
+ return function(V) {
194
+ return W([L, V]);
195
+ };
196
+ }
197
+ function W(L) {
198
+ if (O) throw new TypeError("Generator is already executing.");
199
+ for (; f; ) try {
200
+ if (O = 1, w && (I = L[0] & 2 ? w.return : L[0] ? w.throw || ((I = w.return) && I.call(w), 0) : w.next) && !(I = I.call(w, L[1])).done) return I;
201
+ switch (w = 0, I && (L = [L[0] & 2, I.value]), L[0]) {
202
+ case 0:
203
+ case 1:
204
+ I = L;
205
+ break;
206
+ case 4:
207
+ return f.label++, { value: L[1], done: !1 };
208
+ case 5:
209
+ f.label++, w = L[1], L = [0];
210
+ continue;
211
+ case 7:
212
+ L = f.ops.pop(), f.trys.pop();
213
+ continue;
214
+ default:
215
+ if (I = f.trys, !(I = I.length > 0 && I[I.length - 1]) && (L[0] === 6 || L[0] === 2)) {
216
+ f = 0;
217
+ continue;
218
+ }
219
+ if (L[0] === 3 && (!I || L[1] > I[0] && L[1] < I[3])) {
220
+ f.label = L[1];
221
+ break;
222
+ }
223
+ if (L[0] === 6 && f.label < I[1]) {
224
+ f.label = I[1], I = L;
225
+ break;
226
+ }
227
+ if (I && f.label < I[2]) {
228
+ f.label = I[2], f.ops.push(L);
229
+ break;
230
+ }
231
+ I[2] && f.ops.pop(), f.trys.pop();
232
+ continue;
233
+ }
234
+ L = N.call(E, f);
235
+ } catch (V) {
236
+ L = [6, V], w = 0;
237
+ } finally {
238
+ O = I = 0;
239
+ }
240
+ if (L[0] & 5) throw L[1];
241
+ return { value: L[0] ? L[1] : void 0, done: !0 };
242
+ }
243
+ }
244
+ var l = {}, s = {};
245
+ function u(E) {
246
+ var N, f = JSON.stringify(E);
247
+ if (!E.forceScriptReload && (N = s[f], N))
248
+ return N;
249
+ var O = document.createElement("script"), w = E.dataAttributes || {}, I = E.container || document.head;
250
+ return O.src = E.src, O.id = E.id || "", O.async = !0, E.type && O.setAttribute("type", "".concat(E.type)), E.crossorigin && O.setAttribute("crossorigin", "".concat(E.crossorigin)), Object.keys(w).forEach(function(M) {
251
+ O.setAttribute("data-".concat(M), "".concat(w[M]));
252
+ }), N = new Promise(function(M, F) {
253
+ O.addEventListener("load", function() {
254
+ M(O);
255
+ }), O.addEventListener("error", function() {
256
+ F(new Error("".concat(E.src, " failed to load.")));
257
+ }), O.addEventListener("abort", function() {
258
+ F(new Error("".concat(E.src, " has aborted.")));
259
+ }), I.appendChild(O);
260
+ }), s[f] = N, N;
261
+ }
262
+ u.clearCache = function() {
263
+ s = {};
264
+ };
265
+ var t = u, r = function(N) {
266
+ var f = document.querySelector('link[href="'.concat(N.href, '"]'));
267
+ if (f)
268
+ return Promise.resolve(f);
269
+ f = document.createElement("link");
270
+ var O = N.container || document.head;
271
+ return f.setAttribute("rel", "stylesheet"), f.setAttribute("type", "text/css"), f.setAttribute("href", N.href), f.setAttribute("id", N.id), O.firstChild ? O.insertBefore(f, O.firstChild) : O.appendChild(f), Promise.resolve(f);
272
+ };
273
+ Object.defineProperty(l, "__esModule", { value: !0 }), l.loadStylesheet = c = l.loadScript = void 0;
274
+ var e = t, c = l.loadScript = e, p = r;
275
+ l.loadStylesheet = p;
276
+ var T = "https://www.paypalobjects.com", C = {
277
+ minified: "axo.min",
278
+ unminified: "axo"
279
+ }, _ = "fastlane", A = "connect-boba", m = "".concat(A, "/locales/"), g = {
280
+ AXO_ASSET_NAME: C,
281
+ AXO_ASSET_PATH: A,
282
+ LOCALE_PATH: m,
283
+ CDNX_PROD: T
284
+ }, R = {
285
+ BT: "BT",
286
+ PPCP: "PPCP"
287
+ };
288
+ function b() {
289
+ return typeof window.define == "function" && !!window.define.amd;
290
+ }
291
+ function B() {
292
+ return b() && typeof window.requirejs == "function" && typeof window.requirejs.config == "function";
293
+ }
294
+ function z(E, N, f) {
295
+ var O, w;
296
+ return f === void 0 && (f = !0), o(this, void 0, void 0, function() {
297
+ var I, M;
298
+ return i(this, function(F) {
299
+ if (I = H(), I && I[E.module]) {
300
+ if (N && ((O = I[E.module]) === null || O === void 0 ? void 0 : O.VERSION) !== N)
301
+ throw M = (w = I[E.module]) === null || w === void 0 ? void 0 : w.VERSION, new Error("".concat(E.module, " already loaded with version ").concat(M, " cannot load version ").concat(N));
302
+ return [2, !0];
303
+ }
304
+ if (!N)
305
+ throw new Error("Attempted to load ".concat(E.module, " without specifying version"));
306
+ return [2, Q(E, N, f)];
307
+ });
308
+ });
309
+ }
310
+ function Q(E, N, f) {
311
+ if (f === void 0 && (f = !0), b()) {
312
+ var O = f ? E.amdModule.minified : E.amdModule.unminified;
313
+ return new Promise(function(I, M) {
314
+ window.require([O], I, M);
315
+ });
316
+ }
317
+ var w = f ? E.script.minified : E.script.unminified;
318
+ return c({
319
+ id: "".concat(E.id, "-").concat(N),
320
+ src: "https://js.braintreegateway.com/web/".concat(N, "/js/").concat(w)
321
+ });
322
+ }
323
+ function H() {
324
+ return window == null ? void 0 : window.braintree;
325
+ }
326
+ var k, x, D = {
327
+ Client: "client",
328
+ HostedCardFields: "hostedFields"
329
+ }, q = "braintree", v = (k = {}, k[D.Client] = "client", k[D.HostedCardFields] = "hosted-fields", k), S = (x = {}, x[D.Client] = {
330
+ id: "client",
331
+ module: D.Client,
332
+ amdModule: {
333
+ unminified: "".concat(q, "/").concat(v[D.Client]),
334
+ minified: "".concat(q, "/").concat(v[D.Client], ".min")
335
+ },
336
+ script: {
337
+ unminified: "".concat(v[D.Client], ".js"),
338
+ minified: "".concat(v[D.Client], ".min.js")
339
+ }
340
+ }, x[D.HostedCardFields] = {
341
+ id: "hcf",
342
+ module: D.HostedCardFields,
343
+ amdModule: {
344
+ unminified: "".concat(q, "/").concat(v[D.HostedCardFields]),
345
+ minified: "".concat(q, "/").concat(v[D.HostedCardFields], ".min")
346
+ },
347
+ script: {
348
+ unminified: "".concat(v[D.HostedCardFields], ".js"),
349
+ minified: "".concat(v[D.HostedCardFields], ".min.js")
350
+ }
351
+ }, x);
352
+ function y(E) {
353
+ return o(this, void 0, void 0, function() {
354
+ var N, f, O, w;
355
+ return i(this, function(I) {
356
+ switch (I.label) {
357
+ case 0:
358
+ return performance.mark("pp_axo_sdk_init_invoked"), N = E.btSdkVersion, f = E.minified, O = G(E), w = j(E), E.platform !== R.BT ? [3, 2] : [4, Promise.all([
359
+ z(S.hostedFields, N, f),
360
+ P(O, f)
361
+ ])];
362
+ case 1:
363
+ return I.sent(), [3, 5];
364
+ case 2:
365
+ return E.platform !== R.PPCP ? [3, 4] : [4, Promise.all([
366
+ z(S.client, N, f),
367
+ z(S.hostedFields, N, f),
368
+ P(O, f)
369
+ ])];
370
+ case 3:
371
+ return I.sent(), [3, 5];
372
+ case 4:
373
+ throw new Error("unsupported axo platform");
374
+ case 5:
375
+ return [2, { metadata: { localeUrl: w } }];
376
+ }
377
+ });
378
+ });
379
+ }
380
+ function P(E, N) {
381
+ var f;
382
+ if (N === void 0 && (N = !0), b()) {
383
+ B() && requirejs.config({
384
+ paths: (f = {}, f[_] = E, f)
385
+ });
386
+ var O = "".concat(_, "/").concat(N ? g.AXO_ASSET_NAME.minified : g.AXO_ASSET_NAME.unminified);
387
+ return new Promise(function(w, I) {
388
+ window.require([O], w, I);
389
+ });
390
+ }
391
+ return c({
392
+ id: "axo-id",
393
+ src: E,
394
+ forceScriptReload: !0
395
+ });
396
+ }
397
+ function U(E) {
398
+ var N = E.assetUrl, f = E.bundleId;
399
+ return f ? "https://cdn-".concat(f, ".static.engineering.dev.paypalinc.com/").concat(N) : "".concat(g.CDNX_PROD, "/").concat(N);
400
+ }
401
+ function G(E) {
402
+ var N, f = (E == null ? void 0 : E.minified) !== !1 ? g.AXO_ASSET_NAME.minified : g.AXO_ASSET_NAME.unminified, O = b() ? g.AXO_ASSET_PATH : "".concat(g.AXO_ASSET_PATH, "/").concat(f, ".js");
403
+ return U({
404
+ assetUrl: O,
405
+ bundleId: (N = E == null ? void 0 : E.metadata) === null || N === void 0 ? void 0 : N.bundleIdOverride
406
+ });
407
+ }
408
+ function j(E) {
409
+ var N;
410
+ return U({
411
+ assetUrl: g.LOCALE_PATH,
412
+ bundleId: (N = E == null ? void 0 : E.metadata) === null || N === void 0 ? void 0 : N.bundleIdOverride
413
+ });
414
+ }
415
+ n.constants = g, n.loadAxo = y;
416
+ });
417
+ }, {}], 9: [function(a, d, h) {
418
+ var n = a("./constants").BRAINTREE_VERSION, o = a("./request/graphql"), i = a("./request"), l = a("../lib/is-verified-domain"), s = a("../lib/braintree-error"), u = a("../lib/convert-to-braintree-error"), t = a("./get-configuration").getConfiguration, r = a("../lib/create-authorization-data"), e = a("../lib/add-metadata"), c = a("@braintree/wrap-promise"), p = a("../lib/once"), T = a("../lib/deferred"), C = a("../lib/assign").assign, _ = a("../lib/analytics"), A = a("./errors"), m = a("../lib/constants").VERSION, g = a("../lib/constants").GRAPHQL_URLS, R = a("../lib/methods"), b = a("../lib/convert-methods-to-error"), B = a("../lib/assets"), z = a("../lib/constants").FRAUDNET_FNCLS, Q = a("../lib/constants").FRAUDNET_SOURCE, H = a("../lib/constants").FRAUDNET_URL, k = {};
419
+ function x(v) {
420
+ var S, y;
421
+ if (v = v || {}, S = JSON.stringify(v), y = v.gatewayConfiguration, !y)
422
+ throw new s(A.CLIENT_MISSING_GATEWAY_CONFIGURATION);
423
+ if (["assetsUrl", "clientApiUrl", "configUrl"].forEach(function(P) {
424
+ if (P in y && !l(y[P]))
425
+ throw new s({
426
+ type: A.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,
427
+ code: A.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,
428
+ message: P + " property is on an invalid domain."
429
+ });
430
+ }), this.getConfiguration = function() {
431
+ return JSON.parse(S);
432
+ }, this._request = i, this._configuration = this.getConfiguration(), this._clientApiBaseUrl = y.clientApiUrl + "/v1/", y.graphQL) {
433
+ if (!l(y.graphQL.url))
434
+ throw new s({
435
+ type: A.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,
436
+ code: A.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,
437
+ message: "graphQL.url property is on an invalid domain."
438
+ });
439
+ this._graphQL = new o({
440
+ graphQL: y.graphQL
441
+ });
442
+ }
443
+ }
444
+ x.initialize = function(v) {
445
+ var S, y, P = k[v.authorization];
446
+ if (P)
447
+ return _.sendEvent(P, "custom.client.load.cached"), P;
448
+ try {
449
+ y = r(v.authorization);
450
+ } catch (U) {
451
+ return Promise.reject(
452
+ new s(A.CLIENT_INVALID_AUTHORIZATION)
453
+ );
454
+ }
455
+ return P = t(y, v.sessionId).then(
456
+ function(U) {
457
+ return v.debug && (U.isDebug = !0), U.authorization = v.authorization, S = new x(U), S;
458
+ }
459
+ ), k[v.authorization] = P, _.sendEvent(P, "custom.client.load.initialized"), P.then(function(U) {
460
+ return _.sendEvent(S, "custom.client.load.succeeded"), U;
461
+ }).catch(function(U) {
462
+ return delete k[v.authorization], Promise.reject(U);
463
+ });
464
+ }, x.clearCache = function() {
465
+ k = {};
466
+ }, x.prototype._findOrCreateFraudnetJSON = function(v) {
467
+ var S = document.querySelector('script[fncls="' + z + '"]'), y, P, U, G;
468
+ S || (S = document.body.appendChild(document.createElement("script")), S.type = "application/json", S.setAttribute("fncls", z)), y = this.getConfiguration(), P = {
469
+ rda_tenant: "bt_card",
470
+ // eslint-disable-line camelcase
471
+ mid: y.gatewayConfiguration.merchantId
472
+ }, U = y.authorizationFingerprint, U && U.split("&").forEach(function(j) {
473
+ var E = j.split("=");
474
+ E[0] === "customer_id" && E.length > 1 && (P.cid = E[1]);
475
+ }), G = {
476
+ f: v.substr(0, 32),
477
+ fp: P,
478
+ bu: !1,
479
+ s: Q
480
+ }, S.text = JSON.stringify(G);
481
+ }, x.prototype.request = function(v, S) {
482
+ var y = this, P = new Promise(function(U, G) {
483
+ var j, E, N, f, O = !!(v.endpoint === "payment_methods/credit_cards" && y.getConfiguration().gatewayConfiguration.creditCards.collectDeviceData);
484
+ if (v.api !== "graphQLApi" && (v.method ? v.endpoint || (j = "options.endpoint") : j = "options.method"), j)
485
+ throw new s({
486
+ type: A.CLIENT_OPTION_REQUIRED.type,
487
+ code: A.CLIENT_OPTION_REQUIRED.code,
488
+ message: j + " is required when making a request."
489
+ });
490
+ if ("api" in v ? E = v.api : E = "clientApi", f = {
491
+ method: v.method,
492
+ graphQL: y._graphQL,
493
+ timeout: v.timeout,
494
+ metadata: y._configuration.analyticsMetadata
495
+ }, E === "clientApi")
496
+ N = y._clientApiBaseUrl, f.data = e.addMetadata(
497
+ y._configuration,
498
+ v.data
499
+ );
500
+ else if (E === "graphQLApi")
501
+ N = g[y._configuration.gatewayConfiguration.environment], v.endpoint = "", f.method = "post", f.data = C(
502
+ {
503
+ clientSdkMetadata: {
504
+ platform: y._configuration.analyticsMetadata.platform,
505
+ source: y._configuration.analyticsMetadata.source,
506
+ integration: y._configuration.analyticsMetadata.integration,
507
+ sessionId: y._configuration.analyticsMetadata.sessionId,
508
+ version: m
509
+ }
510
+ },
511
+ v.data
512
+ ), f.headers = q(
513
+ y._configuration
514
+ );
515
+ else
516
+ throw new s({
517
+ type: A.CLIENT_OPTION_INVALID.type,
518
+ code: A.CLIENT_OPTION_INVALID.code,
519
+ message: "options.api is invalid."
520
+ });
521
+ f.url = N + v.endpoint, f.sendAnalyticsEvent = function(w) {
522
+ _.sendEvent(y, w);
523
+ }, y._request(f, function(w, I, M) {
524
+ var F, W;
525
+ if (W = D(M, w), W) {
526
+ G(W);
527
+ return;
528
+ }
529
+ if (E === "graphQLApi" && I.errors) {
530
+ G(
531
+ u(I.errors, {
532
+ type: A.CLIENT_GRAPHQL_REQUEST_ERROR.type,
533
+ code: A.CLIENT_GRAPHQL_REQUEST_ERROR.code,
534
+ message: A.CLIENT_GRAPHQL_REQUEST_ERROR.message
535
+ })
536
+ );
537
+ return;
538
+ }
539
+ F = C({ _httpStatus: M }, I), O && F.creditCards && F.creditCards.length > 0 && (y._findOrCreateFraudnetJSON(F.creditCards[0].nonce), B.loadScript({
540
+ src: H,
541
+ forceScriptReload: !0
542
+ })), U(F);
543
+ });
544
+ });
545
+ if (typeof S == "function") {
546
+ S = p(T(S)), P.then(function(U) {
547
+ S(null, U, U._httpStatus);
548
+ }).catch(function(U) {
549
+ var G = U && U.details && U.details.httpStatus;
550
+ S(U, null, G);
551
+ });
552
+ return;
553
+ }
554
+ return P;
555
+ };
556
+ function D(v, S) {
557
+ var y;
558
+ if (v === -1 ? y = new s(A.CLIENT_REQUEST_TIMEOUT) : v === 401 ? y = new s(A.CLIENT_AUTHORIZATION_INVALID) : v === 403 ? y = new s(A.CLIENT_AUTHORIZATION_INSUFFICIENT) : v === 429 ? y = new s(A.CLIENT_RATE_LIMITED) : v >= 500 ? y = new s(A.CLIENT_GATEWAY_NETWORK) : (v < 200 || v >= 400) && (y = u(S, {
559
+ type: A.CLIENT_REQUEST_ERROR.type,
560
+ code: A.CLIENT_REQUEST_ERROR.code,
561
+ message: A.CLIENT_REQUEST_ERROR.message
562
+ })), y)
563
+ return y.details = y.details || {}, y.details.httpStatus = v, y;
564
+ }
565
+ x.prototype.toJSON = function() {
566
+ return this.getConfiguration();
567
+ }, x.prototype.getVersion = function() {
568
+ return m;
569
+ }, x.prototype.teardown = c(function() {
570
+ var v = this;
571
+ return delete k[v.getConfiguration().authorization], b(v, R(x.prototype)), Promise.resolve();
572
+ });
573
+ function q(v) {
574
+ var S = v.authorizationFingerprint || v.authorization;
575
+ return {
576
+ Authorization: "Bearer " + S,
577
+ "Braintree-Version": n
578
+ };
579
+ }
580
+ d.exports = x;
581
+ }, { "../lib/add-metadata": 29, "../lib/analytics": 30, "../lib/assets": 31, "../lib/assign": 32, "../lib/braintree-error": 33, "../lib/constants": 34, "../lib/convert-methods-to-error": 35, "../lib/convert-to-braintree-error": 36, "../lib/create-authorization-data": 37, "../lib/deferred": 38, "../lib/is-verified-domain": 43, "../lib/methods": 45, "../lib/once": 46, "./constants": 10, "./errors": 11, "./get-configuration": 12, "./request": 25, "./request/graphql": 23, "@braintree/wrap-promise": 7 }], 10: [function(a, d, h) {
582
+ d.exports = {
583
+ BRAINTREE_VERSION: "2018-05-10"
584
+ };
585
+ }, {}], 11: [function(a, d, h) {
586
+ var n = a("../lib/braintree-error");
587
+ d.exports = {
588
+ CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN: {
589
+ type: n.types.MERCHANT,
590
+ code: "CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN"
591
+ },
592
+ CLIENT_OPTION_REQUIRED: {
593
+ type: n.types.MERCHANT,
594
+ code: "CLIENT_OPTION_REQUIRED"
595
+ },
596
+ CLIENT_OPTION_INVALID: {
597
+ type: n.types.MERCHANT,
598
+ code: "CLIENT_OPTION_INVALID"
599
+ },
600
+ CLIENT_MISSING_GATEWAY_CONFIGURATION: {
601
+ type: n.types.INTERNAL,
602
+ code: "CLIENT_MISSING_GATEWAY_CONFIGURATION",
603
+ message: "Missing gatewayConfiguration."
604
+ },
605
+ CLIENT_INVALID_AUTHORIZATION: {
606
+ type: n.types.MERCHANT,
607
+ code: "CLIENT_INVALID_AUTHORIZATION",
608
+ message: "Authorization is invalid. Make sure your client token or tokenization key is valid."
609
+ },
610
+ CLIENT_GATEWAY_NETWORK: {
611
+ type: n.types.NETWORK,
612
+ code: "CLIENT_GATEWAY_NETWORK",
613
+ message: "Cannot contact the gateway at this time."
614
+ },
615
+ CLIENT_REQUEST_TIMEOUT: {
616
+ type: n.types.NETWORK,
617
+ code: "CLIENT_REQUEST_TIMEOUT",
618
+ message: "Request timed out waiting for a reply."
619
+ },
620
+ CLIENT_REQUEST_ERROR: {
621
+ type: n.types.NETWORK,
622
+ code: "CLIENT_REQUEST_ERROR",
623
+ message: "There was a problem with your request."
624
+ },
625
+ CLIENT_GRAPHQL_REQUEST_ERROR: {
626
+ type: n.types.NETWORK,
627
+ code: "CLIENT_GRAPHQL_REQUEST_ERROR",
628
+ message: "There was a problem with your request."
629
+ },
630
+ CLIENT_RATE_LIMITED: {
631
+ type: n.types.MERCHANT,
632
+ code: "CLIENT_RATE_LIMITED",
633
+ message: "You are being rate-limited; please try again in a few minutes."
634
+ },
635
+ CLIENT_AUTHORIZATION_INSUFFICIENT: {
636
+ type: n.types.MERCHANT,
637
+ code: "CLIENT_AUTHORIZATION_INSUFFICIENT",
638
+ message: "The authorization used has insufficient privileges."
639
+ },
640
+ CLIENT_AUTHORIZATION_INVALID: {
641
+ type: n.types.MERCHANT,
642
+ code: "CLIENT_AUTHORIZATION_INVALID",
643
+ message: "Either the client token has expired and a new one should be generated or the tokenization key has been deactivated or deleted."
644
+ }
645
+ };
646
+ }, { "../lib/braintree-error": 33 }], 12: [function(a, d, h) {
647
+ var n = a("../lib/braintree-error"), o = a("@braintree/wrap-promise"), i = a("./request"), l = a("@braintree/uuid"), s = a("../lib/constants"), u = a("./errors"), t = a("./request/graphql"), r = a("../lib/constants").GRAPHQL_URLS, e = a("../lib/is-date-string-before-or-on"), c = a("./constants").BRAINTREE_VERSION;
648
+ function p(T, C) {
649
+ return new Promise(function(_, A) {
650
+ var m, g, R, b, B = C || l(), z = {
651
+ merchantAppId: window.location.host,
652
+ platform: s.PLATFORM,
653
+ sdkVersion: s.VERSION,
654
+ source: s.SOURCE,
655
+ // NEXT_MAJOR_VERSION remove one of these to not duplicate data. Target parity with mobile platforms approach.
656
+ integration: s.INTEGRATION,
657
+ integrationType: s.INTEGRATION,
658
+ sessionId: B
659
+ };
660
+ g = T.attrs, R = T.configUrl, g._meta = z, g.braintreeLibraryVersion = s.BRAINTREE_LIBRARY_VERSION, g.configVersion = "3", b = {
661
+ url: R,
662
+ method: "GET",
663
+ data: g
664
+ }, g.authorizationFingerprint && T.graphQL ? (e(T.graphQL.date, c) && (b.graphQL = new t({
665
+ graphQL: {
666
+ url: T.graphQL.url,
667
+ features: ["configuration"]
668
+ }
669
+ })), b.metadata = z) : g.tokenizationKey && (b.graphQL = new t({
670
+ graphQL: {
671
+ url: r[T.environment],
672
+ features: ["configuration"]
673
+ }
674
+ }), b.metadata = z), i(b, function(Q, H, k) {
675
+ var x;
676
+ if (Q) {
677
+ k === 403 ? x = u.CLIENT_AUTHORIZATION_INSUFFICIENT : k === 401 ? x = u.CLIENT_AUTHORIZATION_INVALID : x = u.CLIENT_GATEWAY_NETWORK, A(
678
+ new n({
679
+ type: x.type,
680
+ code: x.code,
681
+ message: x.message,
682
+ details: {
683
+ originalError: Q
684
+ }
685
+ })
686
+ );
687
+ return;
688
+ }
689
+ m = {
690
+ authorizationType: g.tokenizationKey ? "TOKENIZATION_KEY" : "CLIENT_TOKEN",
691
+ authorizationFingerprint: g.authorizationFingerprint,
692
+ analyticsMetadata: z,
693
+ gatewayConfiguration: H
694
+ }, _(m);
695
+ });
696
+ });
697
+ }
698
+ d.exports = {
699
+ getConfiguration: o(p)
700
+ };
701
+ }, { "../lib/braintree-error": 33, "../lib/constants": 34, "../lib/is-date-string-before-or-on": 41, "./constants": 10, "./errors": 11, "./request": 25, "./request/graphql": 23, "@braintree/uuid": 3, "@braintree/wrap-promise": 7 }], 13: [function(a, d, h) {
702
+ var n = a("../lib/braintree-error"), o = a("./client"), i = "3.126.0", l = a("@braintree/wrap-promise"), s = a("../lib/errors");
703
+ function u(t) {
704
+ return t.authorization ? o.initialize(t) : Promise.reject(
705
+ new n({
706
+ type: s.INSTANTIATION_OPTION_REQUIRED.type,
707
+ code: s.INSTANTIATION_OPTION_REQUIRED.code,
708
+ message: "options.authorization is required when instantiating a client."
709
+ })
710
+ );
711
+ }
712
+ d.exports = {
713
+ create: l(u),
714
+ /**
715
+ * @description The current version of the SDK, i.e. `{@pkg version}`.
716
+ * @type {string}
717
+ */
718
+ VERSION: i
719
+ };
720
+ }, { "../lib/braintree-error": 33, "../lib/errors": 40, "./client": 9, "@braintree/wrap-promise": 7 }], 14: [function(a, d, h) {
721
+ var n = a("../../lib/querystring"), o = a("../../lib/assign").assign, i = a("./prep-body"), l = a("./parse-body"), s = a("./xhr"), u = s.isAvailable, t = a("./graphql/request"), r = a("./default-request"), e = 1, c = 408;
722
+ function p(A) {
723
+ return !A || A === c;
724
+ }
725
+ function T(A) {
726
+ var m = !A.data && A.errors && A.errors[0] && A.errors[0].extensions && A.errors[0].extensions.errorClass;
727
+ return m === "UNKNOWN" || m === "INTERNAL";
728
+ }
729
+ function C(A, m, g) {
730
+ var R, b, B, z, Q, H, k, x = A.url, D = A.graphQL, q = A.timeout, v = s.getRequestObject(), S = g, y = !!(D && D.isGraphQLRequest(x, A.data));
731
+ A.headers = o(
732
+ { "Content-Type": "application/json" },
733
+ A.headers
734
+ ), y ? B = new t(A) : B = new r(A), x = B.getUrl(), z = B.getBody(), Q = B.getMethod(), H = B.getHeaders(), Q === "GET" && (x = n.queryify(x, z), z = null), u ? v.onreadystatechange = function() {
735
+ if (v.readyState === 4) {
736
+ if (v.status === 0 && y) {
737
+ delete A.graphQL, C(A, m, g);
738
+ return;
739
+ }
740
+ if (k = l(v.responseText), b = B.adaptResponseBody(k), R = B.determineStatus(v.status, k), R >= 400 || R < 200) {
741
+ if (y && T(k)) {
742
+ delete A.graphQL, C(A, m, g);
743
+ return;
744
+ }
745
+ if (m < e && p(R)) {
746
+ m++, C(A, m, g);
747
+ return;
748
+ }
749
+ S(b || "error", null, R || 500);
750
+ } else
751
+ S(null, b, R);
752
+ }
753
+ } : (A.headers && (x = n.queryify(x, H)), v.onload = function() {
754
+ S(null, l(v.responseText), v.status);
755
+ }, v.onerror = function() {
756
+ S("error", null, 500);
757
+ }, v.onprogress = function() {
758
+ }, v.ontimeout = function() {
759
+ S("timeout", null, -1);
760
+ });
761
+ try {
762
+ v.open(Q, x, !0);
763
+ } catch (P) {
764
+ if (!y)
765
+ throw P;
766
+ delete A.graphQL, C(A, m, g);
767
+ return;
768
+ }
769
+ v.timeout = q, u && Object.keys(H).forEach(function(P) {
770
+ v.setRequestHeader(P, H[P]);
771
+ });
772
+ try {
773
+ v.send(i(Q, z));
774
+ } catch (P) {
775
+ }
776
+ }
777
+ function _(A, m) {
778
+ C(A, 0, m);
779
+ }
780
+ d.exports = {
781
+ request: _
782
+ };
783
+ }, { "../../lib/assign": 32, "../../lib/querystring": 47, "./default-request": 15, "./graphql/request": 24, "./parse-body": 26, "./prep-body": 27, "./xhr": 28 }], 15: [function(a, d, h) {
784
+ function n(o) {
785
+ this._url = o.url, this._data = o.data, this._method = o.method, this._headers = o.headers;
786
+ }
787
+ n.prototype.getUrl = function() {
788
+ return this._url;
789
+ }, n.prototype.getBody = function() {
790
+ return this._data;
791
+ }, n.prototype.getMethod = function() {
792
+ return this._method;
793
+ }, n.prototype.getHeaders = function() {
794
+ return this._headers;
795
+ }, n.prototype.adaptResponseBody = function(o) {
796
+ return o;
797
+ }, n.prototype.determineStatus = function(o) {
798
+ return o;
799
+ }, d.exports = n;
800
+ }, {}], 16: [function(a, d, h) {
801
+ var n = a("./error"), o = a("../../../../lib/assign").assign, i = {
802
+ creditCard: {
803
+ AMERICAN_EXPRESS: "American Express",
804
+ DISCOVER: "Discover",
805
+ INTERNATIONAL_MAESTRO: "Maestro",
806
+ JCB: "JCB",
807
+ MASTERCARD: "MasterCard",
808
+ SOLO: "Solo",
809
+ UK_MAESTRO: "UK Maestro",
810
+ UNION_PAY: "UnionPay",
811
+ VISA: "Visa",
812
+ ELO: "Elo",
813
+ HIPER: "Hiper",
814
+ HIPERCARD: "Hipercard"
815
+ },
816
+ applePayWeb: {
817
+ VISA: "visa",
818
+ MASTERCARD: "mastercard",
819
+ DISCOVER: "discover",
820
+ AMERICAN_EXPRESS: "amex",
821
+ INTERNATIONAL_MAESTRO: "maestro",
822
+ ELO: "elo"
823
+ },
824
+ visaCheckout: {
825
+ VISA: "Visa",
826
+ MASTERCARD: "MasterCard",
827
+ DISCOVER: "Discover",
828
+ AMERICAN_EXPRESS: "American Express"
829
+ },
830
+ googlePay: {
831
+ VISA: "visa",
832
+ MASTERCARD: "mastercard",
833
+ DISCOVER: "discover",
834
+ AMERICAN_EXPRESS: "amex",
835
+ INTERNATIONAL_MAESTRO: "maestro",
836
+ ELO: "elo"
837
+ },
838
+ masterpass: {
839
+ VISA: "visa",
840
+ MASTERCARD: "master",
841
+ DISCOVER: "discover",
842
+ AMERICAN_EXPRESS: "amex",
843
+ DINERS: "diners",
844
+ INTERNATIONAL_MAESTRO: "maestro",
845
+ JCB: "jcb"
846
+ }
847
+ };
848
+ function l(t, r) {
849
+ var e;
850
+ return t.data && !t.errors ? e = s(t, r) : e = n(t), e;
851
+ }
852
+ function s(t, r) {
853
+ var e = t.data.clientConfiguration, c;
854
+ return c = {
855
+ environment: e.environment.toLowerCase(),
856
+ clientApiUrl: e.clientApiUrl,
857
+ assetsUrl: e.assetsUrl,
858
+ analytics: {
859
+ url: e.analyticsUrl
860
+ },
861
+ merchantId: e.merchantId,
862
+ venmo: "off"
863
+ }, e.supportedFeatures && (c.graphQL = {
864
+ url: r._graphQL._config.url,
865
+ features: e.supportedFeatures.map(function(p) {
866
+ return p.toLowerCase();
867
+ })
868
+ }), e.braintreeApi && (c.braintreeApi = e.braintreeApi), e.applePayWeb && (c.applePayWeb = e.applePayWeb, c.applePayWeb.supportedNetworks = u(
869
+ e.applePayWeb.supportedCardBrands,
870
+ i.applePayWeb
871
+ ), delete c.applePayWeb.supportedCardBrands), e.fastlane && (c.fastlane = e.fastlane), e.ideal && (c.ideal = e.ideal), e.creditCard ? (c.challenges = e.creditCard.challenges.map(
872
+ function(p) {
873
+ return p.toLowerCase();
874
+ }
875
+ ), c.creditCards = {
876
+ supportedCardTypes: u(
877
+ e.creditCard.supportedCardBrands,
878
+ i.creditCard
879
+ )
880
+ }, c.threeDSecureEnabled = e.creditCard.threeDSecureEnabled, c.threeDSecure = e.creditCard.threeDSecure) : (c.challenges = [], c.creditCards = {
881
+ supportedCardTypes: []
882
+ }, c.threeDSecureEnabled = !1), e.googlePay && (c.androidPay = {
883
+ displayName: e.googlePay.displayName,
884
+ enabled: !0,
885
+ environment: e.googlePay.environment.toLowerCase(),
886
+ googleAuthorizationFingerprint: e.googlePay.googleAuthorization,
887
+ paypalClientId: e.googlePay.paypalClientId,
888
+ supportedNetworks: u(
889
+ e.googlePay.supportedCardBrands,
890
+ i.googlePay
891
+ )
892
+ }), e.venmo && (c.payWithVenmo = {
893
+ merchantId: e.venmo.merchantId,
894
+ accessToken: e.venmo.accessToken,
895
+ environment: e.venmo.environment.toLowerCase(),
896
+ enrichedCustomerDataEnabled: e.venmo.enrichedCustomerDataEnabled
897
+ }), e.paypal ? (c.paypalEnabled = !0, c.paypal = o({}, e.paypal), c.paypal.currencyIsoCode = c.paypal.currencyCode, c.paypal.environment = c.paypal.environment.toLowerCase(), delete c.paypal.currencyCode) : c.paypalEnabled = !1, e.unionPay && (c.unionPay = {
898
+ enabled: !0,
899
+ merchantAccountId: e.unionPay.merchantAccountId
900
+ }), e.visaCheckout && (c.visaCheckout = {
901
+ apikey: e.visaCheckout.apiKey,
902
+ encryptionKey: e.visaCheckout.encryptionKey,
903
+ externalClientId: e.visaCheckout.externalClientId,
904
+ supportedCardTypes: u(
905
+ e.visaCheckout.supportedCardBrands,
906
+ i.visaCheckout
907
+ )
908
+ }), e.masterpass && (c.masterpass = {
909
+ merchantCheckoutId: e.masterpass.merchantCheckoutId,
910
+ supportedNetworks: u(
911
+ e.masterpass.supportedCardBrands,
912
+ i.masterpass
913
+ )
914
+ }), e.usBankAccount && (c.usBankAccount = {
915
+ routeId: e.usBankAccount.routeId,
916
+ plaid: {
917
+ publicKey: e.usBankAccount.plaidPublicKey
918
+ }
919
+ }), c;
920
+ }
921
+ function u(t, r) {
922
+ return t.reduce(function(e, c) {
923
+ return r.hasOwnProperty(c) ? e.concat(r[c]) : e;
924
+ }, []);
925
+ }
926
+ d.exports = l;
927
+ }, { "../../../../lib/assign": 32, "./error": 19 }], 17: [function(a, d, h) {
928
+ var n = a("./error"), o = {
929
+ AMERICAN_EXPRESS: "American Express",
930
+ DINERS: "Discover",
931
+ DISCOVER: "Discover",
932
+ ELO: "Elo",
933
+ HIPER: "Hiper",
934
+ HIPERCARD: "Hipercard",
935
+ INTERNATIONAL_MAESTRO: "Maestro",
936
+ JCB: "JCB",
937
+ MASTERCARD: "MasterCard",
938
+ UK_MAESTRO: "Maestro",
939
+ UNION_PAY: "UnionPay",
940
+ VISA: "Visa"
941
+ }, i = {
942
+ YES: "Yes",
943
+ NO: "No",
944
+ UNKNOWN: "Unknown"
945
+ }, l = {
946
+ PSDTWO: "psd2"
947
+ };
948
+ function s(t) {
949
+ var r;
950
+ return t.data && !t.errors ? r = u(t) : r = n(t), r;
951
+ }
952
+ function u(t) {
953
+ var r = t.data.tokenizeCreditCardForPayPalConnect, e = r.paymentMethod.details, c = e.last4 ? e.last4.substr(2, 4) : "", p = e.binData, T, C;
954
+ return p && ([
955
+ "commercial",
956
+ "debit",
957
+ "durbinRegulated",
958
+ "healthcare",
959
+ "payroll",
960
+ "prepaid"
961
+ ].forEach(function(_) {
962
+ p[_] ? p[_] = i[p[_]] : p[_] = "Unknown";
963
+ }), [
964
+ "issuingBank",
965
+ "countryOfIssuance",
966
+ "productId",
967
+ "business",
968
+ "consumer",
969
+ "purchase",
970
+ "corporate"
971
+ ].forEach(function(_) {
972
+ p[_] || (p[_] = "Unknown");
973
+ })), T = {
974
+ creditCards: [
975
+ {
976
+ binData: p,
977
+ consumed: !1,
978
+ description: c ? "ending in " + c : "",
979
+ nonce: r.paymentMethod.id,
980
+ details: {
981
+ cardholderName: e.cardholderName,
982
+ expirationMonth: e.expirationMonth,
983
+ expirationYear: e.expirationYear,
984
+ bin: e.bin || "",
985
+ cardType: o[e.brandCode] || "Unknown",
986
+ lastFour: e.last4 || "",
987
+ lastTwo: c
988
+ },
989
+ type: "CreditCard",
990
+ threeDSecureInfo: null
991
+ }
992
+ ]
993
+ }, r.authenticationInsight && (C = r.authenticationInsight.customerAuthenticationRegulationEnvironment, T.creditCards[0].authenticationInsight = {
994
+ regulationEnvironment: l[C] || C.toLowerCase()
995
+ }), T;
996
+ }
997
+ d.exports = s;
998
+ }, { "./error": 19 }], 18: [function(a, d, h) {
999
+ var n = a("./error"), o = {
1000
+ AMERICAN_EXPRESS: "American Express",
1001
+ DINERS: "Discover",
1002
+ DISCOVER: "Discover",
1003
+ ELO: "Elo",
1004
+ HIPER: "Hiper",
1005
+ HIPERCARD: "Hipercard",
1006
+ INTERNATIONAL_MAESTRO: "Maestro",
1007
+ JCB: "JCB",
1008
+ MASTERCARD: "MasterCard",
1009
+ UK_MAESTRO: "Maestro",
1010
+ UNION_PAY: "UnionPay",
1011
+ VISA: "Visa"
1012
+ }, i = {
1013
+ YES: "Yes",
1014
+ NO: "No",
1015
+ UNKNOWN: "Unknown"
1016
+ }, l = {
1017
+ PSDTWO: "psd2"
1018
+ };
1019
+ function s(t) {
1020
+ var r;
1021
+ return t.data && !t.errors ? r = u(t) : r = n(t), r;
1022
+ }
1023
+ function u(t) {
1024
+ var r = t.data.tokenizeCreditCard, e = r.creditCard, c = e.last4 ? e.last4.substr(2, 4) : "", p = e.binData, T, C;
1025
+ return p && ([
1026
+ "commercial",
1027
+ "debit",
1028
+ "durbinRegulated",
1029
+ "healthcare",
1030
+ "payroll",
1031
+ "prepaid"
1032
+ ].forEach(function(_) {
1033
+ p[_] ? p[_] = i[p[_]] : p[_] = "Unknown";
1034
+ }), [
1035
+ "issuingBank",
1036
+ "countryOfIssuance",
1037
+ "productId",
1038
+ "business",
1039
+ "consumer",
1040
+ "purchase",
1041
+ "corporate"
1042
+ ].forEach(function(_) {
1043
+ p[_] || (p[_] = "Unknown");
1044
+ })), T = {
1045
+ creditCards: [
1046
+ {
1047
+ binData: p,
1048
+ consumed: !1,
1049
+ description: c ? "ending in " + c : "",
1050
+ nonce: r.token,
1051
+ details: {
1052
+ cardholderName: e.cardholderName,
1053
+ expirationMonth: e.expirationMonth,
1054
+ expirationYear: e.expirationYear,
1055
+ bin: e.bin || "",
1056
+ cardType: o[e.brandCode] || "Unknown",
1057
+ lastFour: e.last4 || "",
1058
+ lastTwo: c
1059
+ },
1060
+ type: "CreditCard",
1061
+ threeDSecureInfo: null
1062
+ }
1063
+ ]
1064
+ }, r.authenticationInsight && (C = r.authenticationInsight.customerAuthenticationRegulationEnvironment, T.creditCards[0].authenticationInsight = {
1065
+ regulationEnvironment: l[C] || C.toLowerCase()
1066
+ }), T;
1067
+ }
1068
+ d.exports = s;
1069
+ }, { "./error": 19 }], 19: [function(a, d, h) {
1070
+ function n(t) {
1071
+ var r, e = t.errors && t.errors[0] && t.errors[0].extensions && t.errors[0].extensions.errorClass;
1072
+ return e === "VALIDATION" ? r = i(t) : e ? r = o(t) : r = {
1073
+ error: { message: "There was a problem serving your request" },
1074
+ fieldErrors: []
1075
+ }, r;
1076
+ }
1077
+ function o(t) {
1078
+ return {
1079
+ error: { message: t.errors[0].message },
1080
+ fieldErrors: []
1081
+ };
1082
+ }
1083
+ function i(t) {
1084
+ var r = l(t.errors);
1085
+ return r.length === 0 ? { error: { message: t.errors[0].message } } : {
1086
+ error: { message: u(r) },
1087
+ fieldErrors: r
1088
+ };
1089
+ }
1090
+ function l(t) {
1091
+ var r = [];
1092
+ return t.forEach(function(e) {
1093
+ e.extensions && e.extensions.inputPath && s(e.extensions.inputPath.slice(1), e, r);
1094
+ }), r;
1095
+ }
1096
+ function s(t, r, e) {
1097
+ var c, p = r.extensions.legacyCode, T = t[0];
1098
+ if (t.length === 1) {
1099
+ e.push({
1100
+ code: p,
1101
+ field: T,
1102
+ message: r.message
1103
+ });
1104
+ return;
1105
+ }
1106
+ e.forEach(function(C) {
1107
+ C.field === T && (c = C);
1108
+ }), c || (c = { field: T, fieldErrors: [] }, e.push(c)), s(t.slice(1), r, c.fieldErrors);
1109
+ }
1110
+ function u(t) {
1111
+ var r = {
1112
+ creditCard: "Credit card is invalid"
1113
+ }, e = t[0].field;
1114
+ return r[e];
1115
+ }
1116
+ d.exports = n;
1117
+ }, {}], 20: [function(a, d, h) {
1118
+ var n = "query ClientConfiguration { clientConfiguration { analyticsUrl environment merchantId assetsUrl clientApiUrl creditCard { supportedCardBrands challenges threeDSecureEnabled threeDSecure { cardinalAuthenticationJWT cardinalSongbirdUrl cardinalSongbirdIdentityHash } } applePayWeb { countryCode currencyCode merchantIdentifier supportedCardBrands } fastlane { enabled tokensOnDemand { enabled tokenExchange { enabled } } } googlePay { displayName supportedCardBrands environment googleAuthorization paypalClientId } ideal { routeId assetsUrl } masterpass { merchantCheckoutId supportedCardBrands } paypal { displayName clientId assetsUrl environment environmentNoNetwork unvettedMerchant braintreeClientId billingAgreementsEnabled merchantAccountId currencyCode payeeEmail } unionPay { merchantAccountId } usBankAccount { routeId plaidPublicKey } venmo { merchantId accessToken environment enrichedCustomerDataEnabled } visaCheckout { apiKey externalClientId supportedCardBrands } braintreeApi { accessToken url } supportedFeatures } }";
1119
+ function o() {
1120
+ return {
1121
+ query: n,
1122
+ operationName: "ClientConfiguration"
1123
+ };
1124
+ }
1125
+ d.exports = o;
1126
+ }, {}], 21: [function(a, d, h) {
1127
+ var n = a("../../../../lib/assign").assign;
1128
+ function o(t) {
1129
+ var r = t.hasAuthenticationInsight, e = "mutation TokenizeCreditCardForPayPalConnect($input: TokenizeCreditCardForPayPalConnectInput!";
1130
+ return r && (e += ", $authenticationInsightInput: AuthenticationInsightInput!"), e += ") { tokenizeCreditCardForPayPalConnect(input: $input) { clientMutationId paymentMethod { id details { ... on CreditCardDetails { bin brandCode last4 cardholderName expirationMonth expirationYear binData { prepaid healthcare debit durbinRegulated commercial payroll issuingBank countryOfIssuance productId business consumer purchase corporate } } } }", r && (e += " authenticationInsight(input: $authenticationInsightInput) { customerAuthenticationRegulationEnvironment }"), e += " } }", e;
1131
+ }
1132
+ function i(t, r) {
1133
+ var e = t.creditCard, c = e.fastlane || {}, p = "fastlane" in e && "termsAndConditionsVersion" in e.fastlane && e.fastlane.termsAndConditionsVersion, T = "fastlane" in e && "termsAndConditionsCountry" in e.fastlane && e.fastlane.termsAndConditionsCountry, C = e.email, _ = "hasBuyerConsent" in c && c.hasBuyerConsent, A = e.shippingAddress, m = l(t, r), g = n({}, m.input, {
1134
+ email: C,
1135
+ optIn: _,
1136
+ phone: e.phone
1137
+ });
1138
+ return p && (g.termsAndConditionsVersion = p), T && (g.termsAndConditionsCountry = T), "authAssertion" in c && (g.authAssertion = c.authAssertion), A && (g.shippingAddress = A), { input: g };
1139
+ }
1140
+ function l(t, r) {
1141
+ var e = t.creditCard, c = e && e.billingAddress, p = e && e.expirationDate, T = e && (e.expirationMonth || p && p.split("/")[0].trim()), C = e && (e.expirationYear || p && p.split("/")[1].trim()), _ = {
1142
+ input: {
1143
+ creditCard: {
1144
+ number: e && e.number,
1145
+ expirationMonth: T,
1146
+ expirationYear: C,
1147
+ cvv: e && e.cvv,
1148
+ cardholderName: e && e.cardholderName
1149
+ },
1150
+ options: {}
1151
+ }
1152
+ };
1153
+ return r.hasAuthenticationInsight && (_.authenticationInsightInput = {
1154
+ merchantAccountId: t.merchantAccountId
1155
+ }), c && (_.input.creditCard.billingAddress = c), _.input = s(t, _.input), _;
1156
+ }
1157
+ function s(t, r) {
1158
+ var e;
1159
+ return t.creditCard && t.creditCard.options && typeof t.creditCard.options.validate == "boolean" ? e = t.creditCard.options.validate : t.authorizationFingerprint && t.tokenizationKey || t.authorizationFingerprint ? e = !0 : t.tokenizationKey && (e = !1), typeof e == "boolean" && (r.options = n(
1160
+ {
1161
+ validate: e
1162
+ },
1163
+ r.options
1164
+ )), r;
1165
+ }
1166
+ function u(t) {
1167
+ var r = {
1168
+ hasAuthenticationInsight: !!(t.authenticationInsight && t.merchantAccountId)
1169
+ };
1170
+ return {
1171
+ query: o(r),
1172
+ variables: i(t, r),
1173
+ operationName: "TokenizeCreditCardForPayPalConnect"
1174
+ };
1175
+ }
1176
+ d.exports = u;
1177
+ }, { "../../../../lib/assign": 32 }], 22: [function(a, d, h) {
1178
+ var n = a("../../../../lib/assign").assign;
1179
+ function o(u) {
1180
+ var t = u.hasAuthenticationInsight, r = "mutation TokenizeCreditCard($input: TokenizeCreditCardInput!";
1181
+ return t && (r += ", $authenticationInsightInput: AuthenticationInsightInput!"), r += ") { tokenizeCreditCard(input: $input) { token creditCard { bin brandCode last4 cardholderName expirationMonth expirationYear binData { prepaid healthcare debit durbinRegulated commercial payroll issuingBank countryOfIssuance productId business consumer purchase corporate } } ", t && (r += " authenticationInsight(input: $authenticationInsightInput) { customerAuthenticationRegulationEnvironment }"), r += " } }", r;
1182
+ }
1183
+ function i(u, t) {
1184
+ var r = u.creditCard, e = r && r.billingAddress, c = r && r.expirationDate, p = r && (r.expirationMonth || c && c.split("/")[0].trim()), T = r && (r.expirationYear || c && c.split("/")[1].trim()), C = {
1185
+ input: {
1186
+ creditCard: {
1187
+ number: r && r.number,
1188
+ expirationMonth: p,
1189
+ expirationYear: T,
1190
+ cvv: r && r.cvv,
1191
+ cardholderName: r && r.cardholderName
1192
+ },
1193
+ options: {}
1194
+ }
1195
+ };
1196
+ return t.hasAuthenticationInsight && (C.authenticationInsightInput = {
1197
+ merchantAccountId: u.merchantAccountId
1198
+ }), e && (C.input.creditCard.billingAddress = e), C.input = l(u, C.input), C;
1199
+ }
1200
+ function l(u, t) {
1201
+ var r;
1202
+ return u.creditCard && u.creditCard.options && typeof u.creditCard.options.validate == "boolean" ? r = u.creditCard.options.validate : u.authorizationFingerprint && u.tokenizationKey || u.authorizationFingerprint ? r = !0 : u.tokenizationKey && (r = !1), typeof r == "boolean" && (t.options = n(
1203
+ {
1204
+ validate: r
1205
+ },
1206
+ t.options
1207
+ )), t;
1208
+ }
1209
+ function s(u) {
1210
+ var t = {
1211
+ hasAuthenticationInsight: !!(u.authenticationInsight && u.merchantAccountId)
1212
+ };
1213
+ return {
1214
+ query: o(t),
1215
+ variables: i(u, t),
1216
+ operationName: "TokenizeCreditCard"
1217
+ };
1218
+ }
1219
+ d.exports = s;
1220
+ }, { "../../../../lib/assign": 32 }], 23: [function(a, d, h) {
1221
+ var n = {
1222
+ tokenize_credit_cards: "payment_methods/credit_cards",
1223
+ // eslint-disable-line camelcase
1224
+ configuration: "configuration"
1225
+ }, o = ["creditCard.options.unionPayEnrollment"];
1226
+ function i(s) {
1227
+ this._config = s.graphQL;
1228
+ }
1229
+ i.prototype.getGraphQLEndpoint = function() {
1230
+ return this._config.url;
1231
+ }, i.prototype.isGraphQLRequest = function(s, u) {
1232
+ var t, r = this.getClientApiPath(s);
1233
+ return !this._isGraphQLEnabled() || !r || (t = this._config.features.some(function(e) {
1234
+ return n[e] === r;
1235
+ }), l(u)) ? !1 : t;
1236
+ }, i.prototype.getClientApiPath = function(s) {
1237
+ var u, t = "/client_api/v1/", r = s.split(t);
1238
+ return r.length > 1 && (u = r[1].split("?")[0]), u;
1239
+ }, i.prototype._isGraphQLEnabled = function() {
1240
+ return !!this._config;
1241
+ };
1242
+ function l(s) {
1243
+ return o.some(function(u) {
1244
+ var t = u.split(".").reduce(function(r, e) {
1245
+ return r && r[e];
1246
+ }, s);
1247
+ return t !== void 0;
1248
+ });
1249
+ }
1250
+ d.exports = i;
1251
+ }, {}], 24: [function(a, d, h) {
1252
+ var n = a("../../constants").BRAINTREE_VERSION, o = a("../../../lib/assign").assign, i = a("../../../lib/snake-case-to-camel-case"), l = a("../../../lib/is-fastlane-checkout"), s = a("./generators/credit-card-tokenization"), u = a("./adapters/credit-card-tokenization"), t = a("./adapters/credit-card-tokenization-fastlane"), r = a("./generators/credit-card-for-fastlane-tokenization"), e = a("./generators/configuration"), c = a("./adapters/configuration"), p = {
1253
+ "payment_methods/credit_cards": function(m, g) {
1254
+ return g ? r(m) : s(m);
1255
+ },
1256
+ configuration: e
1257
+ }, T = {
1258
+ "payment_methods/credit_cards": function(m, g, R) {
1259
+ return R ? t(m, g) : u(m, g);
1260
+ },
1261
+ configuration: c
1262
+ };
1263
+ function C(m) {
1264
+ var g = m.graphQL.getClientApiPath(m.url);
1265
+ this._graphQL = m.graphQL, this._data = m.data, this._method = m.method, this._headers = m.headers, this._clientSdkMetadata = {
1266
+ source: m.metadata.source,
1267
+ integration: m.metadata.integration,
1268
+ sessionId: m.metadata.sessionId
1269
+ }, this._sendAnalyticsEvent = m.sendAnalyticsEvent || Function.prototype, this._generator = p[g], this._adapter = T[g], this._sendAnalyticsEvent("graphql.init");
1270
+ }
1271
+ C.prototype.getUrl = function() {
1272
+ return this._graphQL.getGraphQLEndpoint();
1273
+ }, C.prototype.getBody = function() {
1274
+ var m = A(this._data), g = this._generator(
1275
+ m,
1276
+ // Since this is used for all GQL requests, we only want this if it's a Fastlane Tokenization request
1277
+ l(this._data.creditCard)
1278
+ ), R = o(
1279
+ { clientSdkMetadata: this._clientSdkMetadata },
1280
+ g
1281
+ );
1282
+ return JSON.stringify(R);
1283
+ }, C.prototype.getMethod = function() {
1284
+ return "POST";
1285
+ }, C.prototype.getHeaders = function() {
1286
+ var m, g;
1287
+ return this._data.authorizationFingerprint ? (this._sendAnalyticsEvent("graphql.authorization-fingerprint"), m = this._data.authorizationFingerprint) : (this._sendAnalyticsEvent("graphql.tokenization-key"), m = this._data.tokenizationKey), g = {
1288
+ Authorization: "Bearer " + m,
1289
+ "Braintree-Version": n
1290
+ }, o({}, this._headers, g);
1291
+ }, C.prototype.adaptResponseBody = function(m) {
1292
+ return this._adapter(
1293
+ m,
1294
+ this,
1295
+ // Since this is used for all GQL requests, we only want this if it's a Fastlane Checkout Tokenization request
1296
+ "creditCard" in this._data && l(this._data.creditCard)
1297
+ );
1298
+ }, C.prototype.determineStatus = function(m, g) {
1299
+ var R, b;
1300
+ return m === 200 ? (b = g.errors && g.errors[0] && g.errors[0].extensions && g.errors[0].extensions.errorClass, g.data && !g.errors ? R = 200 : b === "VALIDATION" ? R = 422 : b === "AUTHORIZATION" ? R = 403 : b === "AUTHENTICATION" ? R = 401 : _(b, g) ? R = 403 : R = 500) : m ? R = m : R = 500, this._sendAnalyticsEvent("graphql.status." + m), this._sendAnalyticsEvent("graphql.determinedStatus." + R), R;
1301
+ };
1302
+ function _(m, g) {
1303
+ return !m && g.errors[0].message;
1304
+ }
1305
+ function A(m) {
1306
+ var g = {};
1307
+ return Object.keys(m).forEach(function(R) {
1308
+ var b = i(R);
1309
+ typeof m[R] == "object" ? g[b] = A(m[R]) : typeof m[R] == "number" ? g[b] = String(m[R]) : g[b] = m[R];
1310
+ }), g;
1311
+ }
1312
+ d.exports = C;
1313
+ }, { "../../../lib/assign": 32, "../../../lib/is-fastlane-checkout": 42, "../../../lib/snake-case-to-camel-case": 48, "../../constants": 10, "./adapters/configuration": 16, "./adapters/credit-card-tokenization": 18, "./adapters/credit-card-tokenization-fastlane": 17, "./generators/configuration": 20, "./generators/credit-card-for-fastlane-tokenization": 21, "./generators/credit-card-tokenization": 22 }], 25: [function(a, d, h) {
1314
+ var n = a("../../lib/once"), o = a("./ajax-driver");
1315
+ d.exports = function(i, l) {
1316
+ l = n(l || Function.prototype), i.method = (i.method || "GET").toUpperCase(), i.timeout = i.timeout == null ? 6e4 : i.timeout, i.data = i.data || {}, o.request(i, l);
1317
+ };
1318
+ }, { "../../lib/once": 46, "./ajax-driver": 14 }], 26: [function(a, d, h) {
1319
+ d.exports = function(n) {
1320
+ try {
1321
+ n = JSON.parse(n);
1322
+ } catch (o) {
1323
+ }
1324
+ return n;
1325
+ };
1326
+ }, {}], 27: [function(a, d, h) {
1327
+ d.exports = function(n, o) {
1328
+ if (typeof n != "string")
1329
+ throw new Error("Method must be a string");
1330
+ return n.toLowerCase() !== "get" && o != null && (o = typeof o == "string" ? o : JSON.stringify(o)), o;
1331
+ };
1332
+ }, {}], 28: [function(a, d, h) {
1333
+ var n = typeof window != "undefined" && window.XMLHttpRequest && "withCredentials" in new window.XMLHttpRequest();
1334
+ function o() {
1335
+ return n ? new window.XMLHttpRequest() : new window.XDomainRequest();
1336
+ }
1337
+ d.exports = {
1338
+ isAvailable: n,
1339
+ getRequestObject: o
1340
+ };
1341
+ }, {}], 29: [function(a, d, h) {
1342
+ var n = a("./create-authorization-data"), o = a("./json-clone"), i = a("./constants");
1343
+ function l(u, t) {
1344
+ var r, e = t ? o(t) : {}, c = n(u.authorization).attrs, p = o(u.analyticsMetadata);
1345
+ e.braintreeLibraryVersion = i.BRAINTREE_LIBRARY_VERSION;
1346
+ for (r in e._meta)
1347
+ e._meta.hasOwnProperty(r) && (p[r] = e._meta[r]);
1348
+ return e._meta = p, c.tokenizationKey ? e.tokenizationKey = c.tokenizationKey : e.authorizationFingerprint = c.authorizationFingerprint, e;
1349
+ }
1350
+ function s(u) {
1351
+ var t = u.getConfiguration(), r = n(t.authorization).attrs, e = t.gatewayConfiguration.environment === "production", c = {
1352
+ api_integration_type: t.analyticsMetadata.integrationType,
1353
+ app_id: window.location.host,
1354
+ c_sdk_ver: i.VERSION,
1355
+ component: "braintreeclientsdk",
1356
+ merchant_sdk_env: e ? "production" : "sandbox",
1357
+ merchant_id: t.gatewayConfiguration.merchantId,
1358
+ event_source: "web",
1359
+ platform: i.PLATFORM,
1360
+ platform_version: window.navigator.userAgent,
1361
+ session_id: t.analyticsMetadata.sessionId,
1362
+ client_session_id: t.analyticsMetadata.sessionId,
1363
+ tenant_name: "braintree",
1364
+ product_name: "BT_DCC",
1365
+ space_key: "SKDUYK"
1366
+ };
1367
+ return r.tokenizationKey ? c.tokenization_key = r.tokenizationKey : c.auth_fingerprint = r.authorizationFingerprint, c;
1368
+ }
1369
+ d.exports = {
1370
+ addMetadata: l,
1371
+ addEventMetadata: s
1372
+ };
1373
+ }, { "./constants": 34, "./create-authorization-data": 37, "./json-clone": 44 }], 30: [function(a, d, h) {
1374
+ var n = a("./constants"), o = a("./add-metadata"), i = a("./assign").assign;
1375
+ function l(t, r, e) {
1376
+ return s(
1377
+ t,
1378
+ r,
1379
+ {},
1380
+ e
1381
+ );
1382
+ }
1383
+ function s(t, r, e, c) {
1384
+ var p = Date.now();
1385
+ return e.flow === "vault" ? e.context_type = "BA_Token" : e.flow === "checkout" && (e.context_type = "EC_Token"), Promise.resolve(t).then(function(T) {
1386
+ var C = T._request, _ = n.ANALYTICS_URL, A = n.ANALYTICS_PREFIX + r, m = T.getConfiguration(), g = m.gatewayConfiguration.environment === "production", R = {
1387
+ events: [],
1388
+ tracking: []
1389
+ }, b = o.addEventMetadata(T, R);
1390
+ return b.event_name = A, b.t = p, R.events = [
1391
+ {
1392
+ level: "info",
1393
+ event: A,
1394
+ payload: i(
1395
+ {
1396
+ env: g ? "production" : "sandbox",
1397
+ timestamp: p
1398
+ },
1399
+ e
1400
+ )
1401
+ }
1402
+ ], R.tracking = [b], e && typeof e == "object" && (R.tracking = [u(b, e)]), C(
1403
+ {
1404
+ url: _,
1405
+ method: "post",
1406
+ data: R,
1407
+ timeout: n.ANALYTICS_REQUEST_TIMEOUT_MS
1408
+ },
1409
+ c
1410
+ );
1411
+ }).catch(function(T) {
1412
+ c && c(T);
1413
+ });
1414
+ }
1415
+ function u(t, r) {
1416
+ var e = {}, c = i({}, r);
1417
+ return Object.keys(c).forEach(function(p) {
1418
+ n.ALLOWED_EXTRA_EVENT_FIELDS.indexOf(p) === -1 && delete c[p];
1419
+ }), e = i(t, c), e;
1420
+ }
1421
+ d.exports = {
1422
+ sendEvent: l,
1423
+ sendEventPlus: s
1424
+ };
1425
+ }, { "./add-metadata": 29, "./assign": 32, "./constants": 34 }], 31: [function(a, d, h) {
1426
+ var n = a("@braintree/asset-loader/load-script"), o = a("@paypal/accelerated-checkout-loader");
1427
+ d.exports = {
1428
+ loadScript: n,
1429
+ loadFastlane: o.loadAxo
1430
+ };
1431
+ }, { "@braintree/asset-loader/load-script": 2, "@paypal/accelerated-checkout-loader": 8 }], 32: [function(a, d, h) {
1432
+ var n = typeof Object.assign == "function" ? Object.assign : o;
1433
+ function o(i) {
1434
+ var l, s, u;
1435
+ for (l = 1; l < arguments.length; l++) {
1436
+ s = arguments[l];
1437
+ for (u in s)
1438
+ s.hasOwnProperty(u) && (i[u] = s[u]);
1439
+ }
1440
+ return i;
1441
+ }
1442
+ d.exports = {
1443
+ assign: n,
1444
+ _assign: o
1445
+ };
1446
+ }, {}], 33: [function(a, d, h) {
1447
+ var n = a("./enumerate");
1448
+ function o(i) {
1449
+ if (!o.types.hasOwnProperty(i.type))
1450
+ throw new Error(i.type + " is not a valid type.");
1451
+ if (!i.code)
1452
+ throw new Error("Error code required.");
1453
+ if (!i.message)
1454
+ throw new Error("Error message required.");
1455
+ this.name = "BraintreeError", this.code = i.code, this.message = i.message, this.type = i.type, this.details = i.details;
1456
+ }
1457
+ o.prototype = Object.create(Error.prototype), o.prototype.constructor = o, o.types = n([
1458
+ "CUSTOMER",
1459
+ "MERCHANT",
1460
+ "NETWORK",
1461
+ "INTERNAL",
1462
+ "UNKNOWN"
1463
+ ]), o.findRootError = function(i) {
1464
+ return i instanceof o && i.details && i.details.originalError ? o.findRootError(i.details.originalError) : i;
1465
+ }, d.exports = o;
1466
+ }, { "./enumerate": 39 }], 34: [function(a, d, h) {
1467
+ var n = "3.126.0", o = "web", i = {
1468
+ production: "https://api.braintreegateway.com:443",
1469
+ sandbox: "https://api.sandbox.braintreegateway.com:443"
1470
+ }, l = {
1471
+ production: "https://assets.braintreegateway.com",
1472
+ sandbox: "https://assets.braintreegateway.com"
1473
+ }, s = {
1474
+ production: "https://payments.braintree-api.com/graphql",
1475
+ sandbox: "https://payments.sandbox.braintree-api.com/graphql"
1476
+ };
1477
+ d.exports = {
1478
+ ANALYTICS_PREFIX: o + ".",
1479
+ ANALYTICS_REQUEST_TIMEOUT_MS: 2e3,
1480
+ ANALYTICS_URL: "https://www.paypal.com/xoplatform/logger/api/logger",
1481
+ ASSETS_URLS: l,
1482
+ CLIENT_API_URLS: i,
1483
+ FRAUDNET_SOURCE: "BRAINTREE_SIGNIN",
1484
+ FRAUDNET_FNCLS: "fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99",
1485
+ FRAUDNET_URL: "https://c.paypal.com/da/r/fb.js",
1486
+ BUS_CONFIGURATION_REQUEST_EVENT: "BUS_CONFIGURATION_REQUEST",
1487
+ GRAPHQL_URLS: s,
1488
+ INTEGRATION_TIMEOUT_MS: 6e4,
1489
+ VERSION: n,
1490
+ INTEGRATION: "custom",
1491
+ SOURCE: "client",
1492
+ PLATFORM: o,
1493
+ BRAINTREE_LIBRARY_VERSION: "braintree/" + o + "/" + n,
1494
+ ALLOWED_EXTRA_EVENT_FIELDS: ["context_id", "context_type"]
1495
+ };
1496
+ }, {}], 35: [function(a, d, h) {
1497
+ var n = a("./braintree-error"), o = a("./errors");
1498
+ d.exports = function(i, l) {
1499
+ l.forEach(function(s) {
1500
+ i[s] = function() {
1501
+ throw new n({
1502
+ type: o.METHOD_CALLED_AFTER_TEARDOWN.type,
1503
+ code: o.METHOD_CALLED_AFTER_TEARDOWN.code,
1504
+ message: s + " cannot be called after teardown."
1505
+ });
1506
+ };
1507
+ });
1508
+ };
1509
+ }, { "./braintree-error": 33, "./errors": 40 }], 36: [function(a, d, h) {
1510
+ var n = a("./braintree-error");
1511
+ function o(i, l) {
1512
+ return i instanceof n ? i : new n({
1513
+ type: l.type,
1514
+ code: l.code,
1515
+ message: l.message,
1516
+ details: {
1517
+ originalError: i
1518
+ }
1519
+ });
1520
+ }
1521
+ d.exports = o;
1522
+ }, { "./braintree-error": 33 }], 37: [function(a, d, h) {
1523
+ var n = a("../lib/vendor/polyfill").atob, o = a("../lib/constants").CLIENT_API_URLS;
1524
+ function i(u) {
1525
+ return /^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(u);
1526
+ }
1527
+ function l(u) {
1528
+ var t = u.split("_"), r = t[0], e = t.slice(2).join("_");
1529
+ return {
1530
+ merchantId: e,
1531
+ environment: r
1532
+ };
1533
+ }
1534
+ function s(u) {
1535
+ var t, r, e = {
1536
+ attrs: {},
1537
+ configUrl: ""
1538
+ };
1539
+ return i(u) ? (r = l(u), e.environment = r.environment, e.attrs.tokenizationKey = u, e.configUrl = o[r.environment] + "/merchants/" + r.merchantId + "/client_api/v1/configuration") : (t = JSON.parse(n(u)), e.environment = t.environment, e.attrs.authorizationFingerprint = t.authorizationFingerprint, e.configUrl = t.configUrl, e.graphQL = t.graphQL), e;
1540
+ }
1541
+ d.exports = s;
1542
+ }, { "../lib/constants": 34, "../lib/vendor/polyfill": 49 }], 38: [function(a, d, h) {
1543
+ d.exports = function(n) {
1544
+ return function() {
1545
+ var o = arguments;
1546
+ setTimeout(function() {
1547
+ n.apply(null, o);
1548
+ }, 1);
1549
+ };
1550
+ };
1551
+ }, {}], 39: [function(a, d, h) {
1552
+ function n(o, i) {
1553
+ return i = i == null ? "" : i, o.reduce(function(l, s) {
1554
+ return l[s] = i + s, l;
1555
+ }, {});
1556
+ }
1557
+ d.exports = n;
1558
+ }, {}], 40: [function(a, d, h) {
1559
+ var n = a("./braintree-error");
1560
+ d.exports = {
1561
+ INVALID_USE_OF_INTERNAL_FUNCTION: {
1562
+ type: n.types.INTERNAL,
1563
+ code: "INVALID_USE_OF_INTERNAL_FUNCTION"
1564
+ },
1565
+ INSTANTIATION_OPTION_REQUIRED: {
1566
+ type: n.types.MERCHANT,
1567
+ code: "INSTANTIATION_OPTION_REQUIRED"
1568
+ },
1569
+ INCOMPATIBLE_VERSIONS: {
1570
+ type: n.types.MERCHANT,
1571
+ code: "INCOMPATIBLE_VERSIONS"
1572
+ },
1573
+ CLIENT_SCRIPT_FAILED_TO_LOAD: {
1574
+ type: n.types.NETWORK,
1575
+ code: "CLIENT_SCRIPT_FAILED_TO_LOAD",
1576
+ message: "Braintree client script could not be loaded."
1577
+ },
1578
+ METHOD_CALLED_AFTER_TEARDOWN: {
1579
+ type: n.types.MERCHANT,
1580
+ code: "METHOD_CALLED_AFTER_TEARDOWN"
1581
+ }
1582
+ };
1583
+ }, { "./braintree-error": 33 }], 41: [function(a, d, h) {
1584
+ function n(i) {
1585
+ var l = i.split("-");
1586
+ return new Date(l[0], l[1], l[2]);
1587
+ }
1588
+ function o(i, l) {
1589
+ return n(i) <= n(l);
1590
+ }
1591
+ d.exports = o;
1592
+ }, {}], 42: [function(a, d, h) {
1593
+ d.exports = function(n) {
1594
+ return n && n.hasOwnProperty("fastlane") && n.fastlane;
1595
+ };
1596
+ }, {}], 43: [function(a, d, h) {
1597
+ var n, o = {
1598
+ "paypal.com": 1,
1599
+ "braintreepayments.com": 1,
1600
+ "braintreegateway.com": 1,
1601
+ "braintree-api.com": 1
1602
+ };
1603
+ function i(s) {
1604
+ return s.split(".").slice(-2).join(".");
1605
+ }
1606
+ function l(s) {
1607
+ var u;
1608
+ return s = s.toLowerCase(), /^https:/.test(s) ? (n = n || document.createElement("a"), n.href = s, u = i(n.hostname), o.hasOwnProperty(u)) : !1;
1609
+ }
1610
+ d.exports = l;
1611
+ }, {}], 44: [function(a, d, h) {
1612
+ d.exports = function(n) {
1613
+ return JSON.parse(JSON.stringify(n));
1614
+ };
1615
+ }, {}], 45: [function(a, d, h) {
1616
+ d.exports = function(n) {
1617
+ return Object.keys(n).filter(function(o) {
1618
+ return typeof n[o] == "function";
1619
+ });
1620
+ };
1621
+ }, {}], 46: [function(a, d, h) {
1622
+ function n(o) {
1623
+ var i = !1;
1624
+ return function() {
1625
+ i || (i = !0, o.apply(null, arguments));
1626
+ };
1627
+ }
1628
+ d.exports = n;
1629
+ }, {}], 47: [function(a, d, h) {
1630
+ function n(t) {
1631
+ var r;
1632
+ for (r in t)
1633
+ if (t.hasOwnProperty(r))
1634
+ return !0;
1635
+ return !1;
1636
+ }
1637
+ function o(t) {
1638
+ return t && typeof t == "object" && typeof t.length == "number" && Object.prototype.toString.call(t) === "[object Array]" || !1;
1639
+ }
1640
+ function i(t) {
1641
+ return t = t || window.location.href, /\?/.test(t);
1642
+ }
1643
+ function l(t) {
1644
+ var r, e;
1645
+ return t = t || window.location.href, i(t) ? (r = t.split("?")[1] || "", r = r.replace(/#.*$/, "").split("&"), e = r.reduce(function(c, p) {
1646
+ var T = p.split("="), C = decodeURIComponent(T[0]), _ = decodeURIComponent(T[1]);
1647
+ return c[C] = _, c;
1648
+ }, {}), e) : {};
1649
+ }
1650
+ function s(t, r) {
1651
+ var e, c, p, T = [];
1652
+ for (p in t)
1653
+ t.hasOwnProperty(p) && (c = t[p], r ? o(t) ? e = r + "[]" : e = r + "[" + p + "]" : e = p, typeof c == "object" ? T.push(s(c, e)) : T.push(encodeURIComponent(e) + "=" + encodeURIComponent(c)));
1654
+ return T.join("&");
1655
+ }
1656
+ function u(t, r) {
1657
+ return t = t || "", r != null && typeof r == "object" && n(r) && (t += t.indexOf("?") === -1 ? "?" : "", t += t.indexOf("=") !== -1 ? "&" : "", t += s(r)), t;
1658
+ }
1659
+ d.exports = {
1660
+ parse: l,
1661
+ stringify: s,
1662
+ queryify: u,
1663
+ hasQueryParams: i
1664
+ };
1665
+ }, {}], 48: [function(a, d, h) {
1666
+ d.exports = function(n) {
1667
+ return n.indexOf("_") === -1 ? n : n.toLowerCase().replace(/(\_\w)/g, function(o) {
1668
+ return o[1].toUpperCase();
1669
+ });
1670
+ };
1671
+ }, {}], 49: [function(a, d, h) {
1672
+ var n = typeof atob == "function" ? atob : o;
1673
+ function o(i) {
1674
+ var l, s, u, t, r, e, c, p, T = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$/, C = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", _ = "";
1675
+ if (!T.test(i))
1676
+ throw new Error("Non base64 encoded input passed to window.atob polyfill");
1677
+ p = 0;
1678
+ do
1679
+ t = C.indexOf(i.charAt(p++)), r = C.indexOf(i.charAt(p++)), e = C.indexOf(i.charAt(p++)), c = C.indexOf(i.charAt(p++)), l = (t & 63) << 2 | r >> 4 & 3, s = (r & 15) << 4 | e >> 2 & 15, u = (e & 3) << 6 | c & 63, _ += String.fromCharCode(l) + (s ? String.fromCharCode(s) : "") + (u ? String.fromCharCode(u) : "");
1680
+ while (p < i.length);
1681
+ return _;
1682
+ }
1683
+ d.exports = {
1684
+ atob: function(i) {
1685
+ return n.call(window, i);
1686
+ },
1687
+ _atob: o
1688
+ };
1689
+ }, {}] }, {}, [13])(13);
1690
+ });
1691
+ }(Z)), Z.exports;
1692
+ }
1693
+ var ee = ne();
1694
+ const ae = /* @__PURE__ */ te(ee), oe = /* @__PURE__ */ re({
1695
+ __proto__: null,
1696
+ default: ae
1697
+ }, [ee]);
1698
+ export {
1699
+ oe as c
1700
+ };
1701
+ //# sourceMappingURL=client-Cz7Nq-cT.js.map