@paydock/client-sdk 1.105.1 → 1.106.1

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.
Files changed (54) hide show
  1. package/README.md +255 -246
  2. package/bundles/widget.umd.js +1197 -1724
  3. package/bundles/widget.umd.min.js +1 -1
  4. package/lib/api/api-service-internal.d.ts +2 -1
  5. package/lib/api/api-service-internal.js +1 -0
  6. package/lib/api/api-service-internal.js.map +1 -1
  7. package/lib/components/iframe-event.d.ts +2 -0
  8. package/lib/components/iframe-event.js +2 -0
  9. package/lib/components/iframe-event.js.map +1 -1
  10. package/lib/components/link.d.ts +3 -2
  11. package/lib/components/link.js +1 -0
  12. package/lib/components/link.js.map +1 -1
  13. package/lib/components/param.d.ts +2 -2
  14. package/lib/components/param.js.map +1 -1
  15. package/lib/components/wallet-background.js +12 -0
  16. package/lib/components/wallet-background.js.map +1 -1
  17. package/lib/configs/sdk.js +1 -1
  18. package/lib/secure-remote-commerce/index.d.ts +102 -1
  19. package/lib/secure-remote-commerce/index.js +102 -1
  20. package/lib/secure-remote-commerce/index.js.map +1 -1
  21. package/lib/secure-remote-commerce/interfaces.d.ts +109 -32
  22. package/lib/secure-remote-commerce/interfaces.js +31 -11
  23. package/lib/secure-remote-commerce/interfaces.js.map +1 -1
  24. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +30 -0
  25. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js +40 -0
  26. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +1 -0
  27. package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +1 -0
  28. package/lib/secure-remote-commerce/providers/mastercard-src/index.js +2 -0
  29. package/lib/secure-remote-commerce/providers/mastercard-src/index.js.map +1 -0
  30. package/lib/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +4 -7
  31. package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +89 -0
  32. package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +1 -0
  33. package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
  34. package/lib/secure-remote-commerce/secure-remote-commerce.js +15 -99
  35. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -1
  36. package/lib/wallet-buttons/flypay-v2.wallet-service.d.ts +0 -1
  37. package/lib/wallet-buttons/flypay-v2.wallet-service.js +28 -30
  38. package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -1
  39. package/package.json +2 -2
  40. package/slate.md +69 -131
  41. package/typings/index.d.ts +0 -1
  42. package/vendors/zipmoney.js +1 -2
  43. package/lib/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -7
  44. package/lib/secure-remote-commerce/providers/visa-src/helper.js +0 -36
  45. package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +0 -1
  46. package/lib/secure-remote-commerce/providers/visa-src/index.d.ts +0 -1
  47. package/lib/secure-remote-commerce/providers/visa-src/index.js +0 -2
  48. package/lib/secure-remote-commerce/providers/visa-src/index.js.map +0 -1
  49. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +0 -113
  50. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +0 -1
  51. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -8
  52. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +0 -10
  53. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +0 -1
  54. package/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +0 -43
@@ -52,307 +52,6 @@
52
52
  }
53
53
  return e;
54
54
  }
55
- function _regeneratorRuntime() {
56
- _regeneratorRuntime = function () {
57
- return e;
58
- };
59
- var t,
60
- e = {},
61
- r = Object.prototype,
62
- n = r.hasOwnProperty,
63
- o = Object.defineProperty || function (t, e, r) {
64
- t[e] = r.value;
65
- },
66
- i = "function" == typeof Symbol ? Symbol : {},
67
- a = i.iterator || "@@iterator",
68
- c = i.asyncIterator || "@@asyncIterator",
69
- u = i.toStringTag || "@@toStringTag";
70
- function define(t, e, r) {
71
- return Object.defineProperty(t, e, {
72
- value: r,
73
- enumerable: !0,
74
- configurable: !0,
75
- writable: !0
76
- }), t[e];
77
- }
78
- try {
79
- define({}, "");
80
- } catch (t) {
81
- define = function (t, e, r) {
82
- return t[e] = r;
83
- };
84
- }
85
- function wrap(t, e, r, n) {
86
- var i = e && e.prototype instanceof Generator ? e : Generator,
87
- a = Object.create(i.prototype),
88
- c = new Context(n || []);
89
- return o(a, "_invoke", {
90
- value: makeInvokeMethod(t, r, c)
91
- }), a;
92
- }
93
- function tryCatch(t, e, r) {
94
- try {
95
- return {
96
- type: "normal",
97
- arg: t.call(e, r)
98
- };
99
- } catch (t) {
100
- return {
101
- type: "throw",
102
- arg: t
103
- };
104
- }
105
- }
106
- e.wrap = wrap;
107
- var h = "suspendedStart",
108
- l = "suspendedYield",
109
- f = "executing",
110
- s = "completed",
111
- y = {};
112
- function Generator() {}
113
- function GeneratorFunction() {}
114
- function GeneratorFunctionPrototype() {}
115
- var p = {};
116
- define(p, a, function () {
117
- return this;
118
- });
119
- var d = Object.getPrototypeOf,
120
- v = d && d(d(values([])));
121
- v && v !== r && n.call(v, a) && (p = v);
122
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
123
- function defineIteratorMethods(t) {
124
- ["next", "throw", "return"].forEach(function (e) {
125
- define(t, e, function (t) {
126
- return this._invoke(e, t);
127
- });
128
- });
129
- }
130
- function AsyncIterator(t, e) {
131
- function invoke(r, o, i, a) {
132
- var c = tryCatch(t[r], t, o);
133
- if ("throw" !== c.type) {
134
- var u = c.arg,
135
- h = u.value;
136
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
137
- invoke("next", t, i, a);
138
- }, function (t) {
139
- invoke("throw", t, i, a);
140
- }) : e.resolve(h).then(function (t) {
141
- u.value = t, i(u);
142
- }, function (t) {
143
- return invoke("throw", t, i, a);
144
- });
145
- }
146
- a(c.arg);
147
- }
148
- var r;
149
- o(this, "_invoke", {
150
- value: function (t, n) {
151
- function callInvokeWithMethodAndArg() {
152
- return new e(function (e, r) {
153
- invoke(t, n, e, r);
154
- });
155
- }
156
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
157
- }
158
- });
159
- }
160
- function makeInvokeMethod(e, r, n) {
161
- var o = h;
162
- return function (i, a) {
163
- if (o === f) throw new Error("Generator is already running");
164
- if (o === s) {
165
- if ("throw" === i) throw a;
166
- return {
167
- value: t,
168
- done: !0
169
- };
170
- }
171
- for (n.method = i, n.arg = a;;) {
172
- var c = n.delegate;
173
- if (c) {
174
- var u = maybeInvokeDelegate(c, n);
175
- if (u) {
176
- if (u === y) continue;
177
- return u;
178
- }
179
- }
180
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
181
- if (o === h) throw o = s, n.arg;
182
- n.dispatchException(n.arg);
183
- } else "return" === n.method && n.abrupt("return", n.arg);
184
- o = f;
185
- var p = tryCatch(e, r, n);
186
- if ("normal" === p.type) {
187
- if (o = n.done ? s : l, p.arg === y) continue;
188
- return {
189
- value: p.arg,
190
- done: n.done
191
- };
192
- }
193
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
194
- }
195
- };
196
- }
197
- function maybeInvokeDelegate(e, r) {
198
- var n = r.method,
199
- o = e.iterator[n];
200
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
201
- var i = tryCatch(o, e.iterator, r.arg);
202
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
203
- var a = i.arg;
204
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
205
- }
206
- function pushTryEntry(t) {
207
- var e = {
208
- tryLoc: t[0]
209
- };
210
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
211
- }
212
- function resetTryEntry(t) {
213
- var e = t.completion || {};
214
- e.type = "normal", delete e.arg, t.completion = e;
215
- }
216
- function Context(t) {
217
- this.tryEntries = [{
218
- tryLoc: "root"
219
- }], t.forEach(pushTryEntry, this), this.reset(!0);
220
- }
221
- function values(e) {
222
- if (e || "" === e) {
223
- var r = e[a];
224
- if (r) return r.call(e);
225
- if ("function" == typeof e.next) return e;
226
- if (!isNaN(e.length)) {
227
- var o = -1,
228
- i = function next() {
229
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
230
- return next.value = t, next.done = !0, next;
231
- };
232
- return i.next = i;
233
- }
234
- }
235
- throw new TypeError(typeof e + " is not iterable");
236
- }
237
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
238
- value: GeneratorFunctionPrototype,
239
- configurable: !0
240
- }), o(GeneratorFunctionPrototype, "constructor", {
241
- value: GeneratorFunction,
242
- configurable: !0
243
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
244
- var e = "function" == typeof t && t.constructor;
245
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
246
- }, e.mark = function (t) {
247
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
248
- }, e.awrap = function (t) {
249
- return {
250
- __await: t
251
- };
252
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
253
- return this;
254
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
255
- void 0 === i && (i = Promise);
256
- var a = new AsyncIterator(wrap(t, r, n, o), i);
257
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
258
- return t.done ? t.value : a.next();
259
- });
260
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
261
- return this;
262
- }), define(g, "toString", function () {
263
- return "[object Generator]";
264
- }), e.keys = function (t) {
265
- var e = Object(t),
266
- r = [];
267
- for (var n in e) r.push(n);
268
- return r.reverse(), function next() {
269
- for (; r.length;) {
270
- var t = r.pop();
271
- if (t in e) return next.value = t, next.done = !1, next;
272
- }
273
- return next.done = !0, next;
274
- };
275
- }, e.values = values, Context.prototype = {
276
- constructor: Context,
277
- reset: function (e) {
278
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
279
- },
280
- stop: function () {
281
- this.done = !0;
282
- var t = this.tryEntries[0].completion;
283
- if ("throw" === t.type) throw t.arg;
284
- return this.rval;
285
- },
286
- dispatchException: function (e) {
287
- if (this.done) throw e;
288
- var r = this;
289
- function handle(n, o) {
290
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
291
- }
292
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
293
- var i = this.tryEntries[o],
294
- a = i.completion;
295
- if ("root" === i.tryLoc) return handle("end");
296
- if (i.tryLoc <= this.prev) {
297
- var c = n.call(i, "catchLoc"),
298
- u = n.call(i, "finallyLoc");
299
- if (c && u) {
300
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
301
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
302
- } else if (c) {
303
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
304
- } else {
305
- if (!u) throw new Error("try statement without catch or finally");
306
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
307
- }
308
- }
309
- }
310
- },
311
- abrupt: function (t, e) {
312
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
313
- var o = this.tryEntries[r];
314
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
315
- var i = o;
316
- break;
317
- }
318
- }
319
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
320
- var a = i ? i.completion : {};
321
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
322
- },
323
- complete: function (t, e) {
324
- if ("throw" === t.type) throw t.arg;
325
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
326
- },
327
- finish: function (t) {
328
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
329
- var r = this.tryEntries[e];
330
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
331
- }
332
- },
333
- catch: function (t) {
334
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
335
- var r = this.tryEntries[e];
336
- if (r.tryLoc === t) {
337
- var n = r.completion;
338
- if ("throw" === n.type) {
339
- var o = n.arg;
340
- resetTryEntry(r);
341
- }
342
- return o;
343
- }
344
- }
345
- throw new Error("illegal catch attempt");
346
- },
347
- delegateYield: function (e, r, n) {
348
- return this.delegate = {
349
- iterator: values(e),
350
- resultName: r,
351
- nextLoc: n
352
- }, "next" === this.method && (this.arg = t), y;
353
- }
354
- }, e;
355
- }
356
55
  function _typeof(o) {
357
56
  "@babel/helpers - typeof";
358
57
 
@@ -684,7 +383,7 @@
684
383
  // the empty string is set in case if version not provided.
685
384
  //
686
385
  // e.g: grunt build --sdk-version=v1.0.0
687
- SDK._version = 'v1.105.1';
386
+ SDK._version = 'v1.106.1';
688
387
 
689
388
  var ENV = {
690
389
  SANDBOX: 'sandbox',
@@ -939,7 +638,7 @@
939
638
  var SECURE_3D = '/3ds/webhook';
940
639
  var FLYPAY_LINK = '/wallet/flypay';
941
640
  var FLYPAY_LOGO_LINK = '/images/logo.png';
942
- var VISA_SRC = '/secure-remote-commerce/visa';
641
+ var MASTERCARD_SRC = '/secure-remote-commerce/mastercard';
943
642
  var Link = /*#__PURE__*/function () {
944
643
  function Link(linkResource) {
945
644
  _classCallCheck(this, Link);
@@ -2218,6 +1917,8 @@
2218
1917
  CHECKOUT_READY: 'checkoutReady',
2219
1918
  CHECKOUT_ERROR: 'checkoutError',
2220
1919
  CHECKOUT_COMPLETED: 'checkoutCompleted',
1920
+ CHECKOUT_POPUP_OPEN: 'checkoutPopupOpen',
1921
+ CHECKOUT_POPUP_CLOSE: 'checkoutPopupClose',
2221
1922
  VALIDATION: 'validation',
2222
1923
  SELECT: 'select',
2223
1924
  UNSELECT: 'unselect',
@@ -3875,514 +3576,429 @@
3875
3576
  }
3876
3577
 
3877
3578
  var zipmoney = createCommonjsModule(function (module) {
3878
- !function e(t, n, r) {
3879
- function o(u, c) {
3579
+ !function t(e, n, r) {
3580
+ function o(u, a) {
3880
3581
  if (!n[u]) {
3881
- if (!t[u]) {
3882
- var a = "function" == typeof commonjsRequire && commonjsRequire;
3883
- if (!c && a) return a(u, !0);
3582
+ if (!e[u]) {
3583
+ var c = "function" == typeof commonjsRequire && commonjsRequire;
3584
+ if (!a && c) return c(u, !0);
3884
3585
  if (i) return i(u, !0);
3885
- var s = new Error("Cannot find module '" + u + "'");
3586
+ var s = Error("Cannot find module '" + u + "'");
3886
3587
  throw s.code = "MODULE_NOT_FOUND", s;
3887
3588
  }
3888
3589
  var f = n[u] = {
3889
3590
  exports: {}
3890
3591
  };
3891
- t[u][0].call(f.exports, function (e) {
3892
- var n = t[u][1][e];
3893
- return o(n || e);
3894
- }, f, f.exports, e, t, n, r);
3592
+ e[u][0].call(f.exports, function (t) {
3593
+ return o(e[u][1][t] || t);
3594
+ }, f, f.exports, t, e, n, r);
3895
3595
  }
3896
3596
  return n[u].exports;
3897
3597
  }
3898
3598
  for (var i = "function" == typeof commonjsRequire && commonjsRequire, u = 0; u < r.length; u++) o(r[u]);
3899
3599
  return o;
3900
3600
  }({
3901
- 1: [function (e, t, n) {
3601
+ 1: [function (t, e, n) {
3902
3602
  function r() {
3903
- throw new Error("setTimeout has not been defined");
3603
+ throw Error("setTimeout has not been defined");
3904
3604
  }
3905
3605
  function o() {
3906
- throw new Error("clearTimeout has not been defined");
3907
- }
3908
- function i(e) {
3909
- if (l === setTimeout) return setTimeout(e, 0);
3910
- if ((l === r || !l) && setTimeout) return l = setTimeout, setTimeout(e, 0);
3911
- try {
3912
- return l(e, 0);
3913
- } catch (t) {
3914
- try {
3915
- return l.call(null, e, 0);
3916
- } catch (t) {
3917
- return l.call(this, e, 0);
3918
- }
3919
- }
3606
+ throw Error("clearTimeout has not been defined");
3920
3607
  }
3921
- function u(e) {
3922
- if (p === clearTimeout) return clearTimeout(e);
3923
- if ((p === o || !p) && clearTimeout) return p = clearTimeout, clearTimeout(e);
3608
+ function i(t) {
3609
+ if (f === setTimeout) return setTimeout(t, 0);
3610
+ if ((f === r || !f) && setTimeout) return f = setTimeout, setTimeout(t, 0);
3924
3611
  try {
3925
- return p(e);
3926
- } catch (t) {
3612
+ return f(t, 0);
3613
+ } catch (e) {
3927
3614
  try {
3928
- return p.call(null, e);
3929
- } catch (t) {
3930
- return p.call(this, e);
3615
+ return f.call(null, t, 0);
3616
+ } catch (n) {
3617
+ return f.call(this, t, 0);
3931
3618
  }
3932
3619
  }
3933
3620
  }
3934
- function c() {
3935
- y && h && (y = !1, h.length ? v = h.concat(v) : m = -1, v.length && a());
3621
+ function u() {
3622
+ v && d && (v = !1, d.length ? h = d.concat(h) : y = -1, h.length && a());
3936
3623
  }
3937
3624
  function a() {
3938
- if (!y) {
3939
- var e = i(c);
3940
- y = !0;
3941
- for (var t = v.length; t;) {
3942
- for (h = v, v = []; ++m < t;) h && h[m].run();
3943
- m = -1, t = v.length;
3625
+ if (!v) {
3626
+ var t = i(u);
3627
+ v = !0;
3628
+ for (var e = h.length; e;) {
3629
+ for (d = h, h = []; ++y < e;) d && d[y].run();
3630
+ y = -1, e = h.length;
3944
3631
  }
3945
- h = null, y = !1, u(e);
3632
+ d = null, v = !1, function t(e) {
3633
+ if (l === clearTimeout) return clearTimeout(e);
3634
+ if ((l === o || !l) && clearTimeout) return l = clearTimeout, clearTimeout(e);
3635
+ try {
3636
+ return l(e);
3637
+ } catch (n) {
3638
+ try {
3639
+ return l.call(null, e);
3640
+ } catch (r) {
3641
+ return l.call(this, e);
3642
+ }
3643
+ }
3644
+ }(t);
3946
3645
  }
3947
3646
  }
3948
- function s(e, t) {
3949
- this.fun = e, this.array = t;
3647
+ function c(t, e) {
3648
+ this.fun = t, this.array = e;
3950
3649
  }
3951
- function f() {}
3952
- var l,
3953
- p,
3954
- d = t.exports = {};
3650
+ function s() {}
3651
+ var f,
3652
+ l,
3653
+ p = e.exports = {};
3955
3654
  !function () {
3956
3655
  try {
3957
- l = "function" == typeof setTimeout ? setTimeout : r;
3958
- } catch (e) {
3959
- l = r;
3656
+ f = "function" == typeof setTimeout ? setTimeout : r;
3657
+ } catch (t) {
3658
+ f = r;
3960
3659
  }
3961
3660
  try {
3962
- p = "function" == typeof clearTimeout ? clearTimeout : o;
3661
+ l = "function" == typeof clearTimeout ? clearTimeout : o;
3963
3662
  } catch (e) {
3964
- p = o;
3663
+ l = o;
3965
3664
  }
3966
3665
  }();
3967
- var h,
3968
- v = [],
3969
- y = !1,
3970
- m = -1;
3971
- d.nextTick = function (e) {
3972
- var t = new Array(arguments.length - 1);
3973
- if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
3974
- v.push(new s(e, t)), 1 !== v.length || y || i(a);
3975
- }, s.prototype.run = function () {
3666
+ var d,
3667
+ h = [],
3668
+ v = !1,
3669
+ y = -1;
3670
+ p.nextTick = function (t) {
3671
+ var e = Array(arguments.length - 1);
3672
+ if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
3673
+ h.push(new c(t, e)), 1 !== h.length || v || i(a);
3674
+ }, c.prototype.run = function () {
3976
3675
  this.fun.apply(null, this.array);
3977
- }, d.title = "browser", d.browser = !0, d.env = {}, d.argv = [], d.version = "", d.versions = {}, d.on = f, d.addListener = f, d.once = f, d.off = f, d.removeListener = f, d.removeAllListeners = f, d.emit = f, d.prependListener = f, d.prependOnceListener = f, d.listeners = function (e) {
3676
+ }, p.title = "browser", p.browser = !0, p.env = {}, p.argv = [], p.version = "", p.versions = {}, p.on = s, p.addListener = s, p.once = s, p.off = s, p.removeListener = s, p.removeAllListeners = s, p.emit = s, p.prependListener = s, p.prependOnceListener = s, p.listeners = function (t) {
3978
3677
  return [];
3979
- }, d.binding = function (e) {
3980
- throw new Error("process.binding is not supported");
3981
- }, d.cwd = function () {
3678
+ }, p.binding = function (t) {
3679
+ throw Error("process.binding is not supported");
3680
+ }, p.cwd = function () {
3982
3681
  return "/";
3983
- }, d.chdir = function (e) {
3984
- throw new Error("process.chdir is not supported");
3985
- }, d.umask = function () {
3682
+ }, p.chdir = function (t) {
3683
+ throw Error("process.chdir is not supported");
3684
+ }, p.umask = function () {
3986
3685
  return 0;
3987
3686
  };
3988
3687
  }, {}],
3989
- 2: [function (e, t, n) {
3990
- (function (e) {
3991
- !function (e) {
3688
+ 2: [function (t, e, n) {
3689
+ (function (t) {
3690
+ !function (t) {
3992
3691
 
3993
- if ("function" == typeof bootstrap) bootstrap("promise", e);else if ("object" == _typeof(n) && "object" == _typeof(t)) t.exports = e();else if ("undefined" != typeof ses) {
3692
+ if ("function" == typeof bootstrap) bootstrap("promise", t);else if ("object" == _typeof(n) && "object" == _typeof(e)) e.exports = t();else if ("undefined" != typeof ses) {
3994
3693
  if (!ses.ok()) return;
3995
- ses.makeQ = e;
3694
+ ses.makeQ = t;
3996
3695
  } else {
3997
- if ("undefined" == typeof window && "undefined" == typeof self) throw new Error("This environment was not anticipated by Q. Please file a bug.");
3696
+ if ("undefined" == typeof window && "undefined" == typeof self) throw Error("This environment was not anticipated by Q. Please file a bug.");
3998
3697
  var r = "undefined" != typeof window ? window : self,
3999
3698
  o = r.Q;
4000
- r.Q = e(), r.Q.noConflict = function () {
3699
+ r.Q = t(), r.Q.noConflict = function () {
4001
3700
  return r.Q = o, this;
4002
3701
  };
4003
3702
  }
4004
3703
  }(function () {
4005
3704
 
4006
- function t(e) {
3705
+ function e(t) {
4007
3706
  return function () {
4008
- return Z.apply(e, arguments);
3707
+ return M.apply(t, arguments);
4009
3708
  };
4010
3709
  }
4011
- function n(e) {
4012
- return e === Object(e);
4013
- }
4014
- function r(e) {
4015
- return "[object StopIteration]" === ne(e) || e instanceof F;
4016
- }
4017
- function o(e, t) {
4018
- if (N && t.stack && "object" == _typeof(e) && null !== e && e.stack) {
4019
- for (var n = [], r = t; r; r = r.source) r.stack && (!e.__minimumStackCounter__ || e.__minimumStackCounter__ > r.stackCounter) && (K(e, "__minimumStackCounter__", {
4020
- value: r.stackCounter,
3710
+ function n(t, e) {
3711
+ if (x && e.stack && "object" == _typeof(t) && null !== t && t.stack) {
3712
+ for (var n = [], o = e; o; o = o.source) o.stack && (!t.__minimumStackCounter__ || t.__minimumStackCounter__ > o.stackCounter) && (U(t, "__minimumStackCounter__", {
3713
+ value: o.stackCounter,
4021
3714
  configurable: !0
4022
- }), n.unshift(r.stack));
4023
- n.unshift(e.stack);
4024
- var o = n.join("\n" + re + "\n"),
4025
- u = i(o);
4026
- K(e, "stack", {
4027
- value: u,
3715
+ }), n.unshift(o.stack));
3716
+ n.unshift(t.stack), U(t, "stack", {
3717
+ value: function t(e) {
3718
+ for (var n = e.split("\n"), o = [], u = 0; u < n.length; ++u) {
3719
+ var a = n[u];
3720
+ i(a) || r(a) || !a || o.push(a);
3721
+ }
3722
+ return o.join("\n");
3723
+ }(n.join("\n" + I + "\n")),
4028
3724
  configurable: !0
4029
3725
  });
4030
3726
  }
4031
3727
  }
4032
- function i(e) {
4033
- for (var t = e.split("\n"), n = [], r = 0; r < t.length; ++r) {
4034
- var o = t[r];
4035
- a(o) || u(o) || !o || n.push(o);
4036
- }
4037
- return n.join("\n");
4038
- }
4039
- function u(e) {
4040
- return -1 !== e.indexOf("(module.js:") || -1 !== e.indexOf("(node.js:");
3728
+ function r(t) {
3729
+ return -1 !== t.indexOf("(module.js:") || -1 !== t.indexOf("(node.js:");
4041
3730
  }
4042
- function c(e) {
4043
- var t = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);
4044
- if (t) return [t[1], Number(t[2])];
4045
- var n = /at ([^ ]+):(\d+):(?:\d+)$/.exec(e);
3731
+ function o(t) {
3732
+ var e = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);
3733
+ if (e) return [e[1], Number(e[2])];
3734
+ var n = /at ([^ ]+):(\d+):(?:\d+)$/.exec(t);
4046
3735
  if (n) return [n[1], Number(n[2])];
4047
- var r = /.*@(.+):(\d+)$/.exec(e);
3736
+ var r = /.*@(.+):(\d+)$/.exec(t);
4048
3737
  return r ? [r[1], Number(r[2])] : void 0;
4049
3738
  }
4050
- function a(e) {
4051
- var t = c(e);
4052
- if (!t) return !1;
4053
- var n = t[0],
4054
- r = t[1];
4055
- return n === W && r >= Q && r <= se;
3739
+ function i(t) {
3740
+ var e = o(t);
3741
+ if (!e) return !1;
3742
+ var n = e[0],
3743
+ r = e[1];
3744
+ return n === j && r >= C && r <= Z;
4056
3745
  }
4057
- function s() {
4058
- if (N) try {
4059
- throw new Error();
4060
- } catch (r) {
4061
- var e = r.stack.split("\n"),
4062
- t = e[0].indexOf("@") > 0 ? e[1] : e[2],
4063
- n = c(t);
3746
+ function u() {
3747
+ if (x) try {
3748
+ throw Error();
3749
+ } catch (t) {
3750
+ var e = t.stack.split("\n"),
3751
+ n = o(e[0].indexOf("@") > 0 ? e[1] : e[2]);
4064
3752
  if (!n) return;
4065
- return W = n[0], n[1];
3753
+ return j = n[0], n[1];
4066
3754
  }
4067
3755
  }
4068
- function f(e) {
4069
- return e instanceof h ? e : g(e) ? O(e) : j(e);
3756
+ function a(t) {
3757
+ var e, n;
3758
+ return t instanceof l ? t : v(t) ? (e = t, n = c(), a.nextTick(function () {
3759
+ try {
3760
+ e.then(n.resolve, n.reject, n.notify);
3761
+ } catch (t) {
3762
+ n.reject(t);
3763
+ }
3764
+ }), n.promise) : $(t);
4070
3765
  }
4071
- function l() {
4072
- function e(e) {
4073
- t = e, f.longStackSupport && N && (i.source = e), $(n, function (t, n) {
4074
- f.nextTick(function () {
4075
- e.promiseDispatch.apply(e, n);
3766
+ function c() {
3767
+ function t(t) {
3768
+ e = t, a.longStackSupport && x && (i.source = t), L(n, function (e, n) {
3769
+ a.nextTick(function () {
3770
+ t.promiseDispatch.apply(t, n);
4076
3771
  });
4077
3772
  }, void 0), n = void 0, r = void 0;
4078
3773
  }
4079
- var t,
3774
+ var e,
4080
3775
  n = [],
4081
3776
  r = [],
4082
- o = Y(l.prototype),
4083
- i = Y(h.prototype);
4084
- if (i.promiseDispatch = function (e, o, i) {
4085
- var u = X(arguments);
4086
- n ? (n.push(u), "when" === o && i[1] && r.push(i[1])) : f.nextTick(function () {
4087
- t.promiseDispatch.apply(t, u);
3777
+ o = H(c.prototype),
3778
+ i = H(l.prototype);
3779
+ if (i.promiseDispatch = function (t, o, i) {
3780
+ var u = P(arguments);
3781
+ n ? (n.push(u), "when" === o && i[1] && r.push(i[1])) : a.nextTick(function () {
3782
+ e.promiseDispatch.apply(e, u);
4088
3783
  });
4089
3784
  }, i.valueOf = function () {
4090
3785
  if (n) return i;
4091
- var e = y(t);
4092
- return m(e) && (t = e), e;
3786
+ var t = d(e);
3787
+ return h(t) && (e = t), t;
4093
3788
  }, i.inspect = function () {
4094
- return t ? t.inspect() : {
3789
+ return e ? e.inspect() : {
4095
3790
  state: "pending"
4096
3791
  };
4097
- }, f.longStackSupport && N) try {
4098
- throw new Error();
4099
- } catch (e) {
4100
- i.stack = e.stack.substring(e.stack.indexOf("\n") + 1), i.stackCounter = oe++;
3792
+ }, a.longStackSupport && x) try {
3793
+ throw Error();
3794
+ } catch (u) {
3795
+ i.stack = u.stack.substring(u.stack.indexOf("\n") + 1), i.stackCounter = N++;
4101
3796
  }
4102
3797
  return o.promise = i, o.resolve = function (n) {
4103
- t || e(f(n));
3798
+ e || t(a(n));
4104
3799
  }, o.fulfill = function (n) {
4105
- t || e(j(n));
3800
+ e || t($(n));
4106
3801
  }, o.reject = function (n) {
4107
- t || e(T(n));
4108
- }, o.notify = function (e) {
4109
- t || $(r, function (t, n) {
4110
- f.nextTick(function () {
4111
- n(e);
3802
+ e || t(m(n));
3803
+ }, o.notify = function (t) {
3804
+ e || L(r, function (e, n) {
3805
+ a.nextTick(function () {
3806
+ n(t);
4112
3807
  });
4113
3808
  }, void 0);
4114
3809
  }, o;
4115
3810
  }
4116
- function p(e) {
4117
- if ("function" != typeof e) throw new TypeError("resolver must be a function.");
4118
- var t = l();
3811
+ function s(t) {
3812
+ if ("function" != typeof t) throw TypeError("resolver must be a function.");
3813
+ var e = c();
4119
3814
  try {
4120
- e(t.resolve, t.reject, t.notify);
4121
- } catch (e) {
4122
- t.reject(e);
3815
+ t(e.resolve, e.reject, e.notify);
3816
+ } catch (n) {
3817
+ e.reject(n);
4123
3818
  }
4124
- return t.promise;
3819
+ return e.promise;
4125
3820
  }
4126
- function d(e) {
4127
- return p(function (t, n) {
4128
- for (var r = 0, o = e.length; r < o; r++) f(e[r]).then(t, n);
3821
+ function f(t) {
3822
+ return s(function (e, n) {
3823
+ for (var r = 0, o = t.length; r < o; r++) a(t[r]).then(e, n);
4129
3824
  });
4130
3825
  }
4131
- function h(e, t, n) {
4132
- void 0 === t && (t = function t(e) {
4133
- return T(new Error("Promise does not support operation: " + e));
3826
+ function l(t, e, n) {
3827
+ void 0 === e && (e = function e(t) {
3828
+ return m(Error("Promise does not support operation: " + t));
4134
3829
  }), void 0 === n && (n = function n() {
4135
3830
  return {
4136
3831
  state: "unknown"
4137
3832
  };
4138
3833
  });
4139
- var r = Y(h.prototype);
3834
+ var r = H(l.prototype);
4140
3835
  if (r.promiseDispatch = function (n, o, i) {
4141
3836
  var u;
4142
3837
  try {
4143
- u = e[o] ? e[o].apply(r, i) : t.call(r, o, i);
4144
- } catch (e) {
4145
- u = T(e);
3838
+ u = t[o] ? t[o].apply(r, i) : e.call(r, o, i);
3839
+ } catch (a) {
3840
+ u = m(a);
4146
3841
  }
4147
3842
  n && n(u);
4148
3843
  }, r.inspect = n, n) {
4149
3844
  var o = n();
4150
3845
  "rejected" === o.state && (r.exception = o.reason), r.valueOf = function () {
4151
- var e = n();
4152
- return "pending" === e.state || "rejected" === e.state ? r : e.value;
3846
+ var t = n();
3847
+ return "pending" === t.state || "rejected" === t.state ? r : t.value;
4153
3848
  };
4154
3849
  }
4155
3850
  return r;
4156
3851
  }
4157
- function v(e, t, n, r) {
4158
- return f(e).then(t, n, r);
3852
+ function p(t, e, n, r) {
3853
+ return a(t).then(e, n, r);
4159
3854
  }
4160
- function y(e) {
4161
- if (m(e)) {
4162
- var t = e.inspect();
4163
- if ("fulfilled" === t.state) return t.value;
3855
+ function d(t) {
3856
+ if (h(t)) {
3857
+ var e = t.inspect();
3858
+ if ("fulfilled" === e.state) return e.value;
4164
3859
  }
4165
- return e;
4166
- }
4167
- function m(e) {
4168
- return e instanceof h;
4169
- }
4170
- function g(e) {
4171
- return n(e) && "function" == typeof e.then;
4172
- }
4173
- function b(e) {
4174
- return m(e) && "pending" === e.inspect().state;
4175
- }
4176
- function w(e) {
4177
- return !m(e) || "fulfilled" === e.inspect().state;
3860
+ return t;
4178
3861
  }
4179
- function k(e) {
4180
- return m(e) && "rejected" === e.inspect().state;
3862
+ function h(t) {
3863
+ return t instanceof l;
4181
3864
  }
4182
- function E() {
4183
- ie.length = 0, ue.length = 0, ae || (ae = !0);
4184
- }
4185
- function _(t, n) {
4186
- ae && ("object" == _typeof(e) && "function" == typeof e.emit && f.nextTick.runAfter(function () {
4187
- -1 !== J(ue, t) && (e.emit("unhandledRejection", n, t), ce.push(t));
4188
- }), ue.push(t), n && void 0 !== n.stack ? ie.push(n.stack) : ie.push("(no stack) " + n));
3865
+ function v(t) {
3866
+ var e;
3867
+ return (e = t) === Object(e) && "function" == typeof t.then;
4189
3868
  }
4190
- function x(t) {
4191
- if (ae) {
4192
- var n = J(ue, t);
4193
- -1 !== n && ("object" == _typeof(e) && "function" == typeof e.emit && f.nextTick.runAfter(function () {
4194
- var r = J(ce, t);
4195
- -1 !== r && (e.emit("rejectionHandled", ie[n], t), ce.splice(r, 1));
4196
- }), ue.splice(n, 1), ie.splice(n, 1));
4197
- }
3869
+ function y() {
3870
+ Q.length = 0, F.length = 0, G || (G = !0);
4198
3871
  }
4199
- function T(e) {
4200
- var t = h({
4201
- when: function when(t) {
4202
- return t && x(this), t ? t(e) : this;
4203
- }
4204
- }, function () {
4205
- return this;
4206
- }, function () {
4207
- return {
4208
- state: "rejected",
4209
- reason: e
4210
- };
4211
- });
4212
- return _(t, e), t;
3872
+ function m(e) {
3873
+ var n,
3874
+ r,
3875
+ o = l({
3876
+ when: function when(n) {
3877
+ return n && function e(n) {
3878
+ if (G) {
3879
+ var r = z(F, n);
3880
+ -1 !== r && ("object" == _typeof(t) && "function" == typeof t.emit && a.nextTick.runAfter(function () {
3881
+ var e = z(B, n);
3882
+ -1 !== e && (t.emit("rejectionHandled", Q[r], n), B.splice(e, 1));
3883
+ }), F.splice(r, 1), Q.splice(r, 1));
3884
+ }
3885
+ }(this), n ? n(e) : this;
3886
+ }
3887
+ }, function () {
3888
+ return this;
3889
+ }, function () {
3890
+ return {
3891
+ state: "rejected",
3892
+ reason: e
3893
+ };
3894
+ });
3895
+ return n = o, r = e, G && ("object" == _typeof(t) && "function" == typeof t.emit && a.nextTick.runAfter(function () {
3896
+ -1 !== z(F, n) && (t.emit("unhandledRejection", r, n), B.push(n));
3897
+ }), F.push(n), r && void 0 !== r.stack ? Q.push(r.stack) : Q.push("(no stack) " + r)), o;
4213
3898
  }
4214
- function j(e) {
4215
- return h({
3899
+ function $(t) {
3900
+ return l({
4216
3901
  when: function when() {
4217
- return e;
3902
+ return t;
4218
3903
  },
4219
- get: function get(t) {
4220
- return e[t];
3904
+ get: function get(e) {
3905
+ return t[e];
4221
3906
  },
4222
- set: function set(t, n) {
4223
- e[t] = n;
3907
+ set: function set(e, n) {
3908
+ t[e] = n;
4224
3909
  },
4225
- "delete": function _delete(t) {
4226
- delete e[t];
3910
+ "delete": function _delete(e) {
3911
+ delete t[e];
4227
3912
  },
4228
- post: function post(t, n) {
4229
- return null === t || void 0 === t ? e.apply(void 0, n) : e[t].apply(e, n);
3913
+ post: function post(e, n) {
3914
+ return null == e ? t.apply(void 0, n) : t[e].apply(t, n);
4230
3915
  },
4231
- apply: function apply(t, n) {
4232
- return e.apply(t, n);
3916
+ apply: function apply(e, n) {
3917
+ return t.apply(e, n);
4233
3918
  },
4234
3919
  keys: function keys() {
4235
- return te(e);
3920
+ return q(t);
4236
3921
  }
4237
3922
  }, void 0, function () {
4238
3923
  return {
4239
3924
  state: "fulfilled",
4240
- value: e
3925
+ value: t
4241
3926
  };
4242
3927
  });
4243
3928
  }
4244
- function O(e) {
4245
- var t = l();
4246
- return f.nextTick(function () {
4247
- try {
4248
- e.then(t.resolve, t.reject, t.notify);
4249
- } catch (e) {
4250
- t.reject(e);
4251
- }
4252
- }), t.promise;
4253
- }
4254
- function C(e) {
4255
- return h({
4256
- isDef: function isDef() {}
4257
- }, function (t, n) {
4258
- return z(e, t, n);
4259
- }, function () {
4260
- return f(e).inspect();
4261
- });
3929
+ function g(t, e, n) {
3930
+ return a(t).spread(e, n);
4262
3931
  }
4263
- function R(e, t, n) {
4264
- return f(e).spread(t, n);
3932
+ function b(t, e, n) {
3933
+ return a(t).dispatch(e, n);
4265
3934
  }
4266
- function M(e) {
4267
- return function () {
4268
- function t(e, t) {
3935
+ function k(t) {
3936
+ return p(t, function (t) {
3937
+ var e = 0,
3938
+ n = c();
3939
+ return L(t, function (r, o, i) {
4269
3940
  var u;
4270
- if ("undefined" == typeof StopIteration) {
4271
- try {
4272
- u = n[e](t);
4273
- } catch (e) {
4274
- return T(e);
4275
- }
4276
- return u.done ? f(u.value) : v(u.value, o, i);
4277
- }
4278
- try {
4279
- u = n[e](t);
4280
- } catch (e) {
4281
- return r(e) ? f(e.value) : T(e);
4282
- }
4283
- return v(u, o, i);
4284
- }
4285
- var n = e.apply(this, arguments),
4286
- o = t.bind(t, "next"),
4287
- i = t.bind(t, "throw");
4288
- return o();
4289
- };
4290
- }
4291
- function S(e) {
4292
- f.done(f.async(e)());
4293
- }
4294
- function P(e) {
4295
- throw new F(e);
4296
- }
4297
- function L(e) {
4298
- return function () {
4299
- return R([this, H(arguments)], function (t, n) {
4300
- return e.apply(t, n);
4301
- });
4302
- };
4303
- }
4304
- function z(e, t, n) {
4305
- return f(e).dispatch(t, n);
4306
- }
4307
- function H(e) {
4308
- return v(e, function (e) {
4309
- var t = 0,
4310
- n = l();
4311
- return $(e, function (r, o, i) {
4312
- var u;
4313
- m(o) && "fulfilled" === (u = o.inspect()).state ? e[i] = u.value : (++t, v(o, function (r) {
4314
- e[i] = r, 0 == --t && n.resolve(e);
4315
- }, n.reject, function (e) {
3941
+ h(o) && "fulfilled" === (u = o.inspect()).state ? t[i] = u.value : (++e, p(o, function (r) {
3942
+ t[i] = r, 0 == --e && n.resolve(t);
3943
+ }, n.reject, function (t) {
4316
3944
  n.notify({
4317
3945
  index: i,
4318
- value: e
3946
+ value: t
4319
3947
  });
4320
3948
  }));
4321
- }, void 0), 0 === t && n.resolve(e), n.promise;
3949
+ }, void 0), 0 === e && n.resolve(t), n.promise;
4322
3950
  });
4323
3951
  }
4324
- function U(e) {
4325
- if (0 === e.length) return f.resolve();
4326
- var t = f.defer(),
3952
+ function _(t) {
3953
+ if (0 === t.length) return a.resolve();
3954
+ var e = a.defer(),
4327
3955
  n = 0;
4328
- return $(e, function (r, o, i) {
4329
- function u(e) {
4330
- t.resolve(e);
4331
- }
4332
- function c(e) {
4333
- 0 === --n && (e.message = "Q can't get fulfillment value from any promise, all promises were rejected. Last error message: " + e.message, t.reject(e));
4334
- }
4335
- function a(e) {
4336
- t.notify({
3956
+ return L(t, function (r, o, i) {
3957
+ var u = t[i];
3958
+ n++, p(u, function t(n) {
3959
+ e.resolve(n);
3960
+ }, function t(r) {
3961
+ 0 == --n && (r.message = "Q can't get fulfillment value from any promise, all promises were rejected. Last error message: " + r.message, e.reject(r));
3962
+ }, function t(n) {
3963
+ e.notify({
4337
3964
  index: i,
4338
- value: e
3965
+ value: n
4339
3966
  });
4340
- }
4341
- var s = e[i];
4342
- n++, v(s, u, c, a);
4343
- }, void 0), t.promise;
3967
+ });
3968
+ }, void 0), e.promise;
4344
3969
  }
4345
- function A(e) {
4346
- return v(e, function (e) {
4347
- return e = V(e, f), v(H(V(e, function (e) {
4348
- return v(e, B, B);
3970
+ function w(t) {
3971
+ return p(t, function (t) {
3972
+ return t = S(t, a), p(k(S(t, function (t) {
3973
+ return p(t, R, R);
4349
3974
  })), function () {
4350
- return e;
3975
+ return t;
4351
3976
  });
4352
3977
  });
4353
3978
  }
4354
- function I(e) {
4355
- return f(e).allSettled();
4356
- }
4357
- function q(e, t) {
4358
- return f(e).then(void 0, void 0, t);
4359
- }
4360
- function D(e, t) {
4361
- return f(e).nodeify(t);
4362
- }
4363
- var N = !1;
3979
+ var x = !1;
4364
3980
  try {
4365
- throw new Error();
4366
- } catch (e) {
4367
- N = !!e.stack;
3981
+ throw Error();
3982
+ } catch (E) {
3983
+ x = !!E.stack;
4368
3984
  }
4369
- var W,
4370
- F,
4371
- Q = s(),
4372
- B = function B() {},
4373
- G = function () {
4374
- function t() {
4375
- for (var e, t; r.next;) r = r.next, e = r.task, r.task = void 0, t = r.domain, t && (r.domain = void 0, t.enter()), n(e, t);
4376
- for (; a.length;) e = a.pop(), n(e);
3985
+ var j,
3986
+ T,
3987
+ C = u(),
3988
+ R = function R() {},
3989
+ O = function () {
3990
+ function e() {
3991
+ for (var t, e; r.next;) t = (r = r.next).task, r.task = void 0, (e = r.domain) && (r.domain = void 0, e.enter()), n(t, e);
3992
+ for (; c.length;) n(t = c.pop());
4377
3993
  i = !1;
4378
3994
  }
4379
- function n(e, n) {
3995
+ function n(t, n) {
4380
3996
  try {
4381
- e();
4382
- } catch (e) {
4383
- if (c) throw n && n.exit(), setTimeout(t, 0), n && n.enter(), e;
3997
+ t();
3998
+ } catch (r) {
3999
+ if (a) throw n && n.exit(), setTimeout(e, 0), n && n.enter(), r;
4384
4000
  setTimeout(function () {
4385
- throw e;
4001
+ throw r;
4386
4002
  }, 0);
4387
4003
  }
4388
4004
  n && n.exit();
@@ -4394,507 +4010,553 @@
4394
4010
  o = r,
4395
4011
  i = !1,
4396
4012
  u = void 0,
4397
- c = !1,
4398
- a = [];
4399
- if (G = function G(t) {
4013
+ a = !1,
4014
+ c = [];
4015
+ if (O = function O(e) {
4400
4016
  o = o.next = {
4401
- task: t,
4402
- domain: c && e.domain,
4017
+ task: e,
4018
+ domain: a && t.domain,
4403
4019
  next: null
4404
4020
  }, i || (i = !0, u());
4405
- }, "object" == _typeof(e) && "[object process]" === e.toString() && e.nextTick) c = !0, u = function u() {
4406
- e.nextTick(t);
4407
- };else if ("function" == typeof setImmediate) u = "undefined" != typeof window ? setImmediate.bind(window, t) : function () {
4408
- setImmediate(t);
4021
+ }, "object" == _typeof(t) && "[object process]" === t.toString() && t.nextTick) a = !0, u = function u() {
4022
+ t.nextTick(e);
4023
+ };else if ("function" == typeof setImmediate) u = "undefined" != typeof window ? setImmediate.bind(window, e) : function () {
4024
+ setImmediate(e);
4409
4025
  };else if ("undefined" != typeof MessageChannel) {
4410
4026
  var s = new MessageChannel();
4411
4027
  s.port1.onmessage = function () {
4412
- u = f, s.port1.onmessage = t, t();
4028
+ u = f, s.port1.onmessage = e, e();
4413
4029
  };
4414
4030
  var f = function f() {
4415
4031
  s.port2.postMessage(0);
4416
4032
  };
4417
4033
  u = function u() {
4418
- setTimeout(t, 0), f();
4034
+ setTimeout(e, 0), f();
4419
4035
  };
4420
4036
  } else u = function u() {
4421
- setTimeout(t, 0);
4037
+ setTimeout(e, 0);
4422
4038
  };
4423
- return G.runAfter = function (e) {
4424
- a.push(e), i || (i = !0, u());
4425
- }, G;
4039
+ return O.runAfter = function (t) {
4040
+ c.push(t), i || (i = !0, u());
4041
+ }, O;
4426
4042
  }(),
4427
- Z = Function.call,
4428
- X = t(Array.prototype.slice),
4429
- $ = t(Array.prototype.reduce || function (e, t) {
4043
+ M = Function.call,
4044
+ P = e(Array.prototype.slice),
4045
+ L = e(Array.prototype.reduce || function (t, e) {
4430
4046
  var n = 0,
4431
4047
  r = this.length;
4432
4048
  if (1 === arguments.length) for (;;) {
4433
4049
  if (n in this) {
4434
- t = this[n++];
4050
+ e = this[n++];
4435
4051
  break;
4436
4052
  }
4437
- if (++n >= r) throw new TypeError();
4053
+ if (++n >= r) throw TypeError();
4438
4054
  }
4439
- for (; n < r; n++) n in this && (t = e(t, this[n], n));
4440
- return t;
4055
+ for (; n < r; n++) n in this && (e = t(e, this[n], n));
4056
+ return e;
4441
4057
  }),
4442
- J = t(Array.prototype.indexOf || function (e) {
4443
- for (var t = 0; t < this.length; t++) if (this[t] === e) return t;
4058
+ z = e(Array.prototype.indexOf || function (t) {
4059
+ for (var e = 0; e < this.length; e++) if (this[e] === t) return e;
4444
4060
  return -1;
4445
4061
  }),
4446
- V = t(Array.prototype.map || function (e, t) {
4062
+ S = e(Array.prototype.map || function (t, e) {
4447
4063
  var n = this,
4448
4064
  r = [];
4449
- return $(n, function (o, i, u) {
4450
- r.push(e.call(t, i, u, n));
4065
+ return L(n, function (o, i, u) {
4066
+ r.push(t.call(e, i, u, n));
4451
4067
  }, void 0), r;
4452
4068
  }),
4453
- Y = Object.create || function (e) {
4454
- function t() {}
4455
- return t.prototype = e, new t();
4069
+ H = Object.create || function (t) {
4070
+ function e() {}
4071
+ return e.prototype = t, new e();
4456
4072
  },
4457
- K = Object.defineProperty || function (e, t, n) {
4458
- return e[t] = n.value, e;
4073
+ U = Object.defineProperty || function (t, e, n) {
4074
+ return t[e] = n.value, t;
4459
4075
  },
4460
- ee = t(Object.prototype.hasOwnProperty),
4461
- te = Object.keys || function (e) {
4462
- var t = [];
4463
- for (var n in e) ee(e, n) && t.push(n);
4464
- return t;
4076
+ A = e(Object.prototype.hasOwnProperty),
4077
+ q = Object.keys || function (t) {
4078
+ var e = [];
4079
+ for (var n in t) A(t, n) && e.push(n);
4080
+ return e;
4465
4081
  },
4466
- ne = t(Object.prototype.toString);
4467
- F = "undefined" != typeof ReturnValue ? ReturnValue : function (e) {
4468
- this.value = e;
4082
+ D = e(Object.prototype.toString);
4083
+ T = "undefined" != typeof ReturnValue ? ReturnValue : function (t) {
4084
+ this.value = t;
4469
4085
  };
4470
- var re = "From previous event:";
4471
- f.resolve = f, f.nextTick = G, f.longStackSupport = !1;
4472
- var oe = 1;
4473
- "object" == _typeof(e) && e && e.env && e.env.Q_DEBUG && (f.longStackSupport = !0), f.defer = l, l.prototype.makeNodeResolver = function () {
4474
- var e = this;
4475
- return function (t, n) {
4476
- t ? e.reject(t) : arguments.length > 2 ? e.resolve(X(arguments, 1)) : e.resolve(n);
4086
+ var I = "From previous event:";
4087
+ a.resolve = a, a.nextTick = O, a.longStackSupport = !1;
4088
+ var N = 1;
4089
+ "object" == _typeof(t) && t && t.env && t.env.Q_DEBUG && (a.longStackSupport = !0), a.defer = c, c.prototype.makeNodeResolver = function () {
4090
+ var t = this;
4091
+ return function (e, n) {
4092
+ e ? t.reject(e) : arguments.length > 2 ? t.resolve(P(arguments, 1)) : t.resolve(n);
4477
4093
  };
4478
- }, f.Promise = p, f.promise = p, p.race = d, p.all = H, p.reject = T, p.resolve = f, f.passByCopy = function (e) {
4479
- return e;
4480
- }, h.prototype.passByCopy = function () {
4094
+ }, a.Promise = s, a.promise = s, s.race = f, s.all = k, s.reject = m, s.resolve = a, a.passByCopy = function (t) {
4095
+ return t;
4096
+ }, l.prototype.passByCopy = function () {
4481
4097
  return this;
4482
- }, f.join = function (e, t) {
4483
- return f(e).join(t);
4484
- }, h.prototype.join = function (e) {
4485
- return f([this, e]).spread(function (e, t) {
4486
- if (e === t) return e;
4487
- throw new Error("Q can't join: not the same: " + e + " " + t);
4098
+ }, a.join = function (t, e) {
4099
+ return a(t).join(e);
4100
+ }, l.prototype.join = function (t) {
4101
+ return a([this, t]).spread(function (t, e) {
4102
+ if (t === e) return t;
4103
+ throw Error("Q can't join: not the same: " + t + " " + e);
4488
4104
  });
4489
- }, f.race = d, h.prototype.race = function () {
4490
- return this.then(f.race);
4491
- }, f.makePromise = h, h.prototype.toString = function () {
4105
+ }, a.race = f, l.prototype.race = function () {
4106
+ return this.then(a.race);
4107
+ }, a.makePromise = l, l.prototype.toString = function () {
4492
4108
  return "[object Promise]";
4493
- }, h.prototype.then = function (e, t, n) {
4494
- function r(t) {
4495
- try {
4496
- return "function" == typeof e ? e(t) : t;
4497
- } catch (e) {
4498
- return T(e);
4499
- }
4500
- }
4501
- function i(e) {
4502
- if ("function" == typeof t) {
4503
- o(e, c);
4504
- try {
4505
- return t(e);
4506
- } catch (e) {
4507
- return T(e);
4508
- }
4509
- }
4510
- return T(e);
4511
- }
4512
- function u(e) {
4513
- return "function" == typeof n ? n(e) : e;
4514
- }
4515
- var c = this,
4516
- a = l(),
4517
- s = !1;
4518
- return f.nextTick(function () {
4519
- c.promiseDispatch(function (e) {
4520
- s || (s = !0, a.resolve(r(e)));
4521
- }, "when", [function (e) {
4522
- s || (s = !0, a.resolve(i(e)));
4109
+ }, l.prototype.then = function (t, e, r) {
4110
+ var o = this,
4111
+ i = c(),
4112
+ u = !1;
4113
+ return a.nextTick(function () {
4114
+ o.promiseDispatch(function (e) {
4115
+ u || (u = !0, i.resolve(function e(n) {
4116
+ try {
4117
+ return "function" == typeof t ? t(n) : n;
4118
+ } catch (r) {
4119
+ return m(r);
4120
+ }
4121
+ }(e)));
4122
+ }, "when", [function (t) {
4123
+ u || (u = !0, i.resolve(function t(r) {
4124
+ if ("function" == typeof e) {
4125
+ n(r, o);
4126
+ try {
4127
+ return e(r);
4128
+ } catch (i) {
4129
+ return m(i);
4130
+ }
4131
+ }
4132
+ return m(r);
4133
+ }(t)));
4523
4134
  }]);
4524
- }), c.promiseDispatch(void 0, "when", [void 0, function (e) {
4525
- var t,
4526
- n = !1;
4135
+ }), o.promiseDispatch(void 0, "when", [void 0, function (t) {
4136
+ var e,
4137
+ n,
4138
+ o = !1;
4527
4139
  try {
4528
- t = u(e);
4529
- } catch (e) {
4530
- if (n = !0, !f.onerror) throw e;
4531
- f.onerror(e);
4140
+ n = (e = t, "function" == typeof r ? r(e) : e);
4141
+ } catch (u) {
4142
+ if (o = !0, !a.onerror) throw u;
4143
+ a.onerror(u);
4532
4144
  }
4533
- n || a.notify(t);
4534
- }]), a.promise;
4535
- }, f.tap = function (e, t) {
4536
- return f(e).tap(t);
4537
- }, h.prototype.tap = function (e) {
4538
- return e = f(e), this.then(function (t) {
4539
- return e.fcall(t).thenResolve(t);
4145
+ o || i.notify(n);
4146
+ }]), i.promise;
4147
+ }, a.tap = function (t, e) {
4148
+ return a(t).tap(e);
4149
+ }, l.prototype.tap = function (t) {
4150
+ return t = a(t), this.then(function (e) {
4151
+ return t.fcall(e).thenResolve(e);
4540
4152
  });
4541
- }, f.when = v, h.prototype.thenResolve = function (e) {
4153
+ }, a.when = p, l.prototype.thenResolve = function (t) {
4542
4154
  return this.then(function () {
4543
- return e;
4155
+ return t;
4544
4156
  });
4545
- }, f.thenResolve = function (e, t) {
4546
- return f(e).thenResolve(t);
4547
- }, h.prototype.thenReject = function (e) {
4157
+ }, a.thenResolve = function (t, e) {
4158
+ return a(t).thenResolve(e);
4159
+ }, l.prototype.thenReject = function (t) {
4548
4160
  return this.then(function () {
4549
- throw e;
4161
+ throw t;
4550
4162
  });
4551
- }, f.thenReject = function (e, t) {
4552
- return f(e).thenReject(t);
4553
- }, f.nearer = y, f.isPromise = m, f.isPromiseAlike = g, f.isPending = b, h.prototype.isPending = function () {
4163
+ }, a.thenReject = function (t, e) {
4164
+ return a(t).thenReject(e);
4165
+ }, a.nearer = d, a.isPromise = h, a.isPromiseAlike = v, a.isPending = function t(e) {
4166
+ return h(e) && "pending" === e.inspect().state;
4167
+ }, l.prototype.isPending = function () {
4554
4168
  return "pending" === this.inspect().state;
4555
- }, f.isFulfilled = w, h.prototype.isFulfilled = function () {
4169
+ }, a.isFulfilled = function t(e) {
4170
+ return !h(e) || "fulfilled" === e.inspect().state;
4171
+ }, l.prototype.isFulfilled = function () {
4556
4172
  return "fulfilled" === this.inspect().state;
4557
- }, f.isRejected = k, h.prototype.isRejected = function () {
4173
+ }, a.isRejected = function t(e) {
4174
+ return h(e) && "rejected" === e.inspect().state;
4175
+ }, l.prototype.isRejected = function () {
4558
4176
  return "rejected" === this.inspect().state;
4559
4177
  };
4560
- var ie = [],
4561
- ue = [],
4562
- ce = [],
4563
- ae = !0;
4564
- f.resetUnhandledRejections = E, f.getUnhandledReasons = function () {
4565
- return ie.slice();
4566
- }, f.stopUnhandledRejectionTracking = function () {
4567
- E(), ae = !1;
4568
- }, E(), f.reject = T, f.fulfill = j, f.master = C, f.spread = R, h.prototype.spread = function (e, t) {
4569
- return this.all().then(function (t) {
4570
- return e.apply(void 0, t);
4571
- }, t);
4572
- }, f.async = M, f.spawn = S, f["return"] = P, f.promised = L, f.dispatch = z, h.prototype.dispatch = function (e, t) {
4178
+ var W,
4179
+ Q = [],
4180
+ F = [],
4181
+ B = [],
4182
+ G = !0;
4183
+ a.resetUnhandledRejections = y, a.getUnhandledReasons = function () {
4184
+ return Q.slice();
4185
+ }, a.stopUnhandledRejectionTracking = function () {
4186
+ y(), G = !1;
4187
+ }, y(), a.reject = m, a.fulfill = $, a.master = function t(e) {
4188
+ return l({
4189
+ isDef: function isDef() {}
4190
+ }, function (t, n) {
4191
+ return b(e, t, n);
4192
+ }, function () {
4193
+ return a(e).inspect();
4194
+ });
4195
+ }, a.spread = g, l.prototype.spread = function (t, e) {
4196
+ return this.all().then(function (e) {
4197
+ return t.apply(void 0, e);
4198
+ }, e);
4199
+ }, a.async = function t(e) {
4200
+ return function () {
4201
+ function t(t, e) {
4202
+ var i, u;
4203
+ if ("undefined" == typeof StopIteration) {
4204
+ try {
4205
+ i = n[t](e);
4206
+ } catch (c) {
4207
+ return m(c);
4208
+ }
4209
+ return i.done ? a(i.value) : p(i.value, r, o);
4210
+ }
4211
+ try {
4212
+ i = n[t](e);
4213
+ } catch (s) {
4214
+ return "[object StopIteration]" === D(u = s) || u instanceof T ? a(s.value) : m(s);
4215
+ }
4216
+ return p(i, r, o);
4217
+ }
4218
+ var n = e.apply(this, arguments),
4219
+ r = t.bind(t, "next"),
4220
+ o = t.bind(t, "throw");
4221
+ return r();
4222
+ };
4223
+ }, a.spawn = function t(e) {
4224
+ a.done(a.async(e)());
4225
+ }, a["return"] = function t(e) {
4226
+ throw new T(e);
4227
+ }, a.promised = function t(e) {
4228
+ return function () {
4229
+ return g([this, k(arguments)], function (t, n) {
4230
+ return e.apply(t, n);
4231
+ });
4232
+ };
4233
+ }, a.dispatch = b, l.prototype.dispatch = function (t, e) {
4573
4234
  var n = this,
4574
- r = l();
4575
- return f.nextTick(function () {
4576
- n.promiseDispatch(r.resolve, e, t);
4235
+ r = c();
4236
+ return a.nextTick(function () {
4237
+ n.promiseDispatch(r.resolve, t, e);
4577
4238
  }), r.promise;
4578
- }, f.get = function (e, t) {
4579
- return f(e).dispatch("get", [t]);
4580
- }, h.prototype.get = function (e) {
4581
- return this.dispatch("get", [e]);
4582
- }, f.set = function (e, t, n) {
4583
- return f(e).dispatch("set", [t, n]);
4584
- }, h.prototype.set = function (e, t) {
4585
- return this.dispatch("set", [e, t]);
4586
- }, f.del = f["delete"] = function (e, t) {
4587
- return f(e).dispatch("delete", [t]);
4588
- }, h.prototype.del = h.prototype["delete"] = function (e) {
4589
- return this.dispatch("delete", [e]);
4590
- }, f.mapply = f.post = function (e, t, n) {
4591
- return f(e).dispatch("post", [t, n]);
4592
- }, h.prototype.mapply = h.prototype.post = function (e, t) {
4593
- return this.dispatch("post", [e, t]);
4594
- }, f.send = f.mcall = f.invoke = function (e, t) {
4595
- return f(e).dispatch("post", [t, X(arguments, 2)]);
4596
- }, h.prototype.send = h.prototype.mcall = h.prototype.invoke = function (e) {
4597
- return this.dispatch("post", [e, X(arguments, 1)]);
4598
- }, f.fapply = function (e, t) {
4599
- return f(e).dispatch("apply", [void 0, t]);
4600
- }, h.prototype.fapply = function (e) {
4601
- return this.dispatch("apply", [void 0, e]);
4602
- }, f["try"] = f.fcall = function (e) {
4603
- return f(e).dispatch("apply", [void 0, X(arguments, 1)]);
4604
- }, h.prototype.fcall = function () {
4605
- return this.dispatch("apply", [void 0, X(arguments)]);
4606
- }, f.fbind = function (e) {
4607
- var t = f(e),
4608
- n = X(arguments, 1);
4239
+ }, a.get = function (t, e) {
4240
+ return a(t).dispatch("get", [e]);
4241
+ }, l.prototype.get = function (t) {
4242
+ return this.dispatch("get", [t]);
4243
+ }, a.set = function (t, e, n) {
4244
+ return a(t).dispatch("set", [e, n]);
4245
+ }, l.prototype.set = function (t, e) {
4246
+ return this.dispatch("set", [t, e]);
4247
+ }, a.del = a["delete"] = function (t, e) {
4248
+ return a(t).dispatch("delete", [e]);
4249
+ }, l.prototype.del = l.prototype["delete"] = function (t) {
4250
+ return this.dispatch("delete", [t]);
4251
+ }, a.mapply = a.post = function (t, e, n) {
4252
+ return a(t).dispatch("post", [e, n]);
4253
+ }, l.prototype.mapply = l.prototype.post = function (t, e) {
4254
+ return this.dispatch("post", [t, e]);
4255
+ }, a.send = a.mcall = a.invoke = function (t, e) {
4256
+ return a(t).dispatch("post", [e, P(arguments, 2)]);
4257
+ }, l.prototype.send = l.prototype.mcall = l.prototype.invoke = function (t) {
4258
+ return this.dispatch("post", [t, P(arguments, 1)]);
4259
+ }, a.fapply = function (t, e) {
4260
+ return a(t).dispatch("apply", [void 0, e]);
4261
+ }, l.prototype.fapply = function (t) {
4262
+ return this.dispatch("apply", [void 0, t]);
4263
+ }, a["try"] = a.fcall = function (t) {
4264
+ return a(t).dispatch("apply", [void 0, P(arguments, 1)]);
4265
+ }, l.prototype.fcall = function () {
4266
+ return this.dispatch("apply", [void 0, P(arguments)]);
4267
+ }, a.fbind = function (t) {
4268
+ var e = a(t),
4269
+ n = P(arguments, 1);
4609
4270
  return function () {
4610
- return t.dispatch("apply", [this, n.concat(X(arguments))]);
4271
+ return e.dispatch("apply", [this, n.concat(P(arguments))]);
4611
4272
  };
4612
- }, h.prototype.fbind = function () {
4613
- var e = this,
4614
- t = X(arguments);
4273
+ }, l.prototype.fbind = function () {
4274
+ var t = this,
4275
+ e = P(arguments);
4615
4276
  return function () {
4616
- return e.dispatch("apply", [this, t.concat(X(arguments))]);
4277
+ return t.dispatch("apply", [this, e.concat(P(arguments))]);
4617
4278
  };
4618
- }, f.keys = function (e) {
4619
- return f(e).dispatch("keys", []);
4620
- }, h.prototype.keys = function () {
4279
+ }, a.keys = function (t) {
4280
+ return a(t).dispatch("keys", []);
4281
+ }, l.prototype.keys = function () {
4621
4282
  return this.dispatch("keys", []);
4622
- }, f.all = H, h.prototype.all = function () {
4623
- return H(this);
4624
- }, f.any = U, h.prototype.any = function () {
4625
- return U(this);
4626
- }, f.allResolved = function (e, t, n) {
4627
- return function () {
4628
- return "undefined" != typeof console && "function" == typeof console.warn && console.warn(t + " is deprecated, use " + n + " instead.", new Error("").stack), e.apply(e, arguments);
4629
- };
4630
- }(A, "allResolved", "allSettled"), h.prototype.allResolved = function () {
4631
- return A(this);
4632
- }, f.allSettled = I, h.prototype.allSettled = function () {
4633
- return this.then(function (e) {
4634
- return H(V(e, function (e) {
4635
- function t() {
4636
- return e.inspect();
4283
+ }, a.all = k, l.prototype.all = function () {
4284
+ return k(this);
4285
+ }, a.any = _, l.prototype.any = function () {
4286
+ return _(this);
4287
+ }, a.allResolved = (W = w, function () {
4288
+ return "undefined" != typeof console && "function" == typeof console.warn && console.warn("allResolved is deprecated, use allSettled instead.", Error("").stack), W.apply(W, arguments);
4289
+ }), l.prototype.allResolved = function () {
4290
+ return w(this);
4291
+ }, a.allSettled = function t(e) {
4292
+ return a(e).allSettled();
4293
+ }, l.prototype.allSettled = function () {
4294
+ return this.then(function (t) {
4295
+ return k(S(t, function (t) {
4296
+ function e() {
4297
+ return t.inspect();
4637
4298
  }
4638
- return e = f(e), e.then(t, t);
4299
+ return (t = a(t)).then(e, e);
4639
4300
  }));
4640
4301
  });
4641
- }, f.fail = f["catch"] = function (e, t) {
4642
- return f(e).then(void 0, t);
4643
- }, h.prototype.fail = h.prototype["catch"] = function (e) {
4644
- return this.then(void 0, e);
4645
- }, f.progress = q, h.prototype.progress = function (e) {
4646
- return this.then(void 0, void 0, e);
4647
- }, f.fin = f["finally"] = function (e, t) {
4648
- return f(e)["finally"](t);
4649
- }, h.prototype.fin = h.prototype["finally"] = function (e) {
4650
- if (!e || "function" != typeof e.apply) throw new Error("Q can't apply finally callback");
4651
- return e = f(e), this.then(function (t) {
4652
- return e.fcall().then(function () {
4653
- return t;
4302
+ }, a.fail = a["catch"] = function (t, e) {
4303
+ return a(t).then(void 0, e);
4304
+ }, l.prototype.fail = l.prototype["catch"] = function (t) {
4305
+ return this.then(void 0, t);
4306
+ }, a.progress = function t(e, n) {
4307
+ return a(e).then(void 0, void 0, n);
4308
+ }, l.prototype.progress = function (t) {
4309
+ return this.then(void 0, void 0, t);
4310
+ }, a.fin = a["finally"] = function (t, e) {
4311
+ return a(t)["finally"](e);
4312
+ }, l.prototype.fin = l.prototype["finally"] = function (t) {
4313
+ if (!t || "function" != typeof t.apply) throw Error("Q can't apply finally callback");
4314
+ return t = a(t), this.then(function (e) {
4315
+ return t.fcall().then(function () {
4316
+ return e;
4654
4317
  });
4655
- }, function (t) {
4656
- return e.fcall().then(function () {
4657
- throw t;
4318
+ }, function (e) {
4319
+ return t.fcall().then(function () {
4320
+ throw e;
4658
4321
  });
4659
4322
  });
4660
- }, f.done = function (e, t, n, r) {
4661
- return f(e).done(t, n, r);
4662
- }, h.prototype.done = function (t, n, r) {
4663
- var i = function i(e) {
4664
- f.nextTick(function () {
4665
- if (o(e, u), !f.onerror) throw e;
4666
- f.onerror(e);
4323
+ }, a.done = function (t, e, n, r) {
4324
+ return a(t).done(e, n, r);
4325
+ }, l.prototype.done = function (e, r, o) {
4326
+ var i = function i(t) {
4327
+ a.nextTick(function () {
4328
+ if (n(t, u), !a.onerror) throw t;
4329
+ a.onerror(t);
4667
4330
  });
4668
4331
  },
4669
- u = t || n || r ? this.then(t, n, r) : this;
4670
- "object" == _typeof(e) && e && e.domain && (i = e.domain.bind(i)), u.then(void 0, i);
4671
- }, f.timeout = function (e, t, n) {
4672
- return f(e).timeout(t, n);
4673
- }, h.prototype.timeout = function (e, t) {
4674
- var n = l(),
4332
+ u = e || r || o ? this.then(e, r, o) : this;
4333
+ "object" == _typeof(t) && t && t.domain && (i = t.domain.bind(i)), u.then(void 0, i);
4334
+ }, a.timeout = function (t, e, n) {
4335
+ return a(t).timeout(e, n);
4336
+ }, l.prototype.timeout = function (t, e) {
4337
+ var n = c(),
4675
4338
  r = setTimeout(function () {
4676
- t && "string" != typeof t || (t = new Error(t || "Timed out after " + e + " ms"), t.code = "ETIMEDOUT"), n.reject(t);
4677
- }, e);
4678
- return this.then(function (e) {
4679
- clearTimeout(r), n.resolve(e);
4680
- }, function (e) {
4681
- clearTimeout(r), n.reject(e);
4682
- }, n.notify), n.promise;
4683
- }, f.delay = function (e, t) {
4684
- return void 0 === t && (t = e, e = void 0), f(e).delay(t);
4685
- }, h.prototype.delay = function (e) {
4339
+ e && "string" != typeof e || ((e = Error(e || "Timed out after " + t + " ms")).code = "ETIMEDOUT"), n.reject(e);
4340
+ }, t);
4686
4341
  return this.then(function (t) {
4687
- var n = l();
4342
+ clearTimeout(r), n.resolve(t);
4343
+ }, function (t) {
4344
+ clearTimeout(r), n.reject(t);
4345
+ }, n.notify), n.promise;
4346
+ }, a.delay = function (t, e) {
4347
+ return void 0 === e && (e = t, t = void 0), a(t).delay(e);
4348
+ }, l.prototype.delay = function (t) {
4349
+ return this.then(function (e) {
4350
+ var n = c();
4688
4351
  return setTimeout(function () {
4689
- n.resolve(t);
4690
- }, e), n.promise;
4352
+ n.resolve(e);
4353
+ }, t), n.promise;
4691
4354
  });
4692
- }, f.nfapply = function (e, t) {
4693
- return f(e).nfapply(t);
4694
- }, h.prototype.nfapply = function (e) {
4695
- var t = l(),
4696
- n = X(e);
4697
- return n.push(t.makeNodeResolver()), this.fapply(n).fail(t.reject), t.promise;
4698
- }, f.nfcall = function (e) {
4699
- var t = X(arguments, 1);
4700
- return f(e).nfapply(t);
4701
- }, h.prototype.nfcall = function () {
4702
- var e = X(arguments),
4703
- t = l();
4704
- return e.push(t.makeNodeResolver()), this.fapply(e).fail(t.reject), t.promise;
4705
- }, f.nfbind = f.denodeify = function (e) {
4706
- if (void 0 === e) throw new Error("Q can't wrap an undefined function");
4707
- var t = X(arguments, 1);
4355
+ }, a.nfapply = function (t, e) {
4356
+ return a(t).nfapply(e);
4357
+ }, l.prototype.nfapply = function (t) {
4358
+ var e = c(),
4359
+ n = P(t);
4360
+ return n.push(e.makeNodeResolver()), this.fapply(n).fail(e.reject), e.promise;
4361
+ }, a.nfcall = function (t) {
4362
+ var e = P(arguments, 1);
4363
+ return a(t).nfapply(e);
4364
+ }, l.prototype.nfcall = function () {
4365
+ var t = P(arguments),
4366
+ e = c();
4367
+ return t.push(e.makeNodeResolver()), this.fapply(t).fail(e.reject), e.promise;
4368
+ }, a.nfbind = a.denodeify = function (t) {
4369
+ if (void 0 === t) throw Error("Q can't wrap an undefined function");
4370
+ var e = P(arguments, 1);
4708
4371
  return function () {
4709
- var n = t.concat(X(arguments)),
4710
- r = l();
4711
- return n.push(r.makeNodeResolver()), f(e).fapply(n).fail(r.reject), r.promise;
4372
+ var n = e.concat(P(arguments)),
4373
+ r = c();
4374
+ return n.push(r.makeNodeResolver()), a(t).fapply(n).fail(r.reject), r.promise;
4712
4375
  };
4713
- }, h.prototype.nfbind = h.prototype.denodeify = function () {
4714
- var e = X(arguments);
4715
- return e.unshift(this), f.denodeify.apply(void 0, e);
4716
- }, f.nbind = function (e, t) {
4717
- var n = X(arguments, 2);
4376
+ }, l.prototype.nfbind = l.prototype.denodeify = function () {
4377
+ var t = P(arguments);
4378
+ return t.unshift(this), a.denodeify.apply(void 0, t);
4379
+ }, a.nbind = function (t, e) {
4380
+ var n = P(arguments, 2);
4718
4381
  return function () {
4719
- function r() {
4720
- return e.apply(t, arguments);
4721
- }
4722
- var o = n.concat(X(arguments)),
4723
- i = l();
4724
- return o.push(i.makeNodeResolver()), f(r).fapply(o).fail(i.reject), i.promise;
4382
+ var r = n.concat(P(arguments)),
4383
+ o = c();
4384
+ return r.push(o.makeNodeResolver()), a(function n() {
4385
+ return t.apply(e, arguments);
4386
+ }).fapply(r).fail(o.reject), o.promise;
4725
4387
  };
4726
- }, h.prototype.nbind = function () {
4727
- var e = X(arguments, 0);
4728
- return e.unshift(this), f.nbind.apply(void 0, e);
4729
- }, f.nmapply = f.npost = function (e, t, n) {
4730
- return f(e).npost(t, n);
4731
- }, h.prototype.nmapply = h.prototype.npost = function (e, t) {
4732
- var n = X(t || []),
4733
- r = l();
4734
- return n.push(r.makeNodeResolver()), this.dispatch("post", [e, n]).fail(r.reject), r.promise;
4735
- }, f.nsend = f.nmcall = f.ninvoke = function (e, t) {
4736
- var n = X(arguments, 2),
4737
- r = l();
4738
- return n.push(r.makeNodeResolver()), f(e).dispatch("post", [t, n]).fail(r.reject), r.promise;
4739
- }, h.prototype.nsend = h.prototype.nmcall = h.prototype.ninvoke = function (e) {
4740
- var t = X(arguments, 1),
4741
- n = l();
4742
- return t.push(n.makeNodeResolver()), this.dispatch("post", [e, t]).fail(n.reject), n.promise;
4743
- }, f.nodeify = D, h.prototype.nodeify = function (e) {
4744
- if (!e) return this;
4745
- this.then(function (t) {
4746
- f.nextTick(function () {
4747
- e(null, t);
4388
+ }, l.prototype.nbind = function () {
4389
+ var t = P(arguments, 0);
4390
+ return t.unshift(this), a.nbind.apply(void 0, t);
4391
+ }, a.nmapply = a.npost = function (t, e, n) {
4392
+ return a(t).npost(e, n);
4393
+ }, l.prototype.nmapply = l.prototype.npost = function (t, e) {
4394
+ var n = P(e || []),
4395
+ r = c();
4396
+ return n.push(r.makeNodeResolver()), this.dispatch("post", [t, n]).fail(r.reject), r.promise;
4397
+ }, a.nsend = a.nmcall = a.ninvoke = function (t, e) {
4398
+ var n = P(arguments, 2),
4399
+ r = c();
4400
+ return n.push(r.makeNodeResolver()), a(t).dispatch("post", [e, n]).fail(r.reject), r.promise;
4401
+ }, l.prototype.nsend = l.prototype.nmcall = l.prototype.ninvoke = function (t) {
4402
+ var e = P(arguments, 1),
4403
+ n = c();
4404
+ return e.push(n.makeNodeResolver()), this.dispatch("post", [t, e]).fail(n.reject), n.promise;
4405
+ }, a.nodeify = function t(e, n) {
4406
+ return a(e).nodeify(n);
4407
+ }, l.prototype.nodeify = function (t) {
4408
+ if (!t) return this;
4409
+ this.then(function (e) {
4410
+ a.nextTick(function () {
4411
+ t(null, e);
4748
4412
  });
4749
- }, function (t) {
4750
- f.nextTick(function () {
4751
- e(t);
4413
+ }, function (e) {
4414
+ a.nextTick(function () {
4415
+ t(e);
4752
4416
  });
4753
4417
  });
4754
- }, f.noConflict = function () {
4755
- throw new Error("Q.noConflict only works when Q is used as a global");
4418
+ }, a.noConflict = function () {
4419
+ throw Error("Q.noConflict only works when Q is used as a global");
4756
4420
  };
4757
- var se = s();
4758
- return f;
4421
+ var Z = u();
4422
+ return a;
4759
4423
  });
4760
- }).call(this, e("_process"));
4424
+ }).call(this, t("_process"));
4761
4425
  }, {
4762
4426
  _process: 1
4763
4427
  }],
4764
- 3: [function (e, t, n) {
4428
+ 3: [function (t, e, n) {
4765
4429
 
4766
- var r = function r(e) {
4767
- switch (_typeof(e)) {
4430
+ var r = function r(t) {
4431
+ switch (_typeof(t)) {
4768
4432
  case "string":
4769
- return e;
4433
+ return t;
4770
4434
  case "boolean":
4771
- return e ? "true" : "false";
4435
+ return t ? "true" : "false";
4772
4436
  case "number":
4773
- return isFinite(e) ? e : "";
4437
+ return isFinite(t) ? t : "";
4774
4438
  default:
4775
4439
  return "";
4776
4440
  }
4777
4441
  };
4778
- t.exports = function (e, t, n, o) {
4779
- return t = t || "&", n = n || "=", null === e && (e = void 0), "object" == _typeof(e) ? Object.keys(e).map(function (o) {
4442
+ e.exports = function (t, e, n, o) {
4443
+ return e = e || "&", n = n || "=", null === t && (t = void 0), "object" == _typeof(t) ? Object.keys(t).map(function (o) {
4780
4444
  var i = encodeURIComponent(r(o)) + n;
4781
- return Array.isArray(e[o]) ? e[o].map(function (e) {
4782
- return i + encodeURIComponent(r(e));
4783
- }).join(t) : i + encodeURIComponent(r(e[o]));
4784
- }).join(t) : o ? encodeURIComponent(r(o)) + n + encodeURIComponent(r(e)) : "";
4445
+ return Array.isArray(t[o]) ? t[o].map(function (t) {
4446
+ return i + encodeURIComponent(r(t));
4447
+ }).join(e) : i + encodeURIComponent(r(t[o]));
4448
+ }).join(e) : o ? encodeURIComponent(r(o)) + n + encodeURIComponent(r(t)) : "";
4785
4449
  };
4786
4450
  }, {}],
4787
- 4: [function (e, t, n) {
4451
+ 4: [function (t, e, n) {
4788
4452
 
4789
- function r(e) {
4790
- return e && e.__esModule ? e : {
4791
- "default": e
4453
+ function r(t) {
4454
+ return t && t.__esModule ? t : {
4455
+ "default": t
4792
4456
  };
4793
4457
  }
4794
- function o(e, t) {
4795
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
4796
- }
4797
- function i(e) {
4798
- var t = new s["default"]();
4799
- t.onClose = e.onComplete.bind(e), t.build(), u(e, function (e) {
4800
- return t.setUri(e.redirectUri);
4801
- }, function (e) {
4802
- return t.close(!1);
4803
- });
4804
- }
4805
- function u(e, t, n) {
4806
- return v["default"].information("zip:checkout:init"), m["default"].Promise(function (t, n) {
4807
- return e.onCheckout(t, n, {});
4458
+ function o(t, e, n) {
4459
+ return d["default"].information("zip:checkout:init"), v["default"].Promise(function (e, n) {
4460
+ return t.onCheckout(e, n, {});
4808
4461
  }).then(function (r) {
4809
4462
  var o = r.redirect_uri || r.redirectUri || r.data && (r.data.redirect_uri || r.data.redirectUri);
4810
- if (!o) return v["default"].debug("zip:checkout:error", "Response does not contain redirectUri property"), n(r), void e.onError({
4463
+ if (!o) return d["default"].debug("zip:checkout:error", "Response does not contain redirectUri property"), n(r), void t.onError({
4811
4464
  code: "checkout_error",
4812
4465
  message: "The response does not contain the redirectUri property",
4813
4466
  detail: r
4814
4467
  });
4815
- v["default"].debug("zip:checkout:success", r), t({
4468
+ d["default"].debug("zip:checkout:success", r), e({
4816
4469
  redirectUri: o
4817
4470
  });
4818
- })["catch"](function (t) {
4819
- v["default"].debug("zip:checkout:error", t), n(t), e.onError({
4471
+ })["catch"](function (e) {
4472
+ d["default"].debug("zip:checkout:error", e), n(e), t.onError({
4820
4473
  code: "checkout_error",
4821
4474
  message: "Checkout response error",
4822
- detail: t
4475
+ detail: e
4823
4476
  });
4824
4477
  });
4825
4478
  }
4826
4479
  Object.defineProperty(n, "__esModule", {
4827
4480
  value: !0
4828
4481
  }), n.Checkout = void 0;
4829
- var c = function () {
4830
- function e(e, t) {
4831
- for (var n = 0; n < t.length; n++) {
4832
- var r = t[n];
4833
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
4482
+ var i = function () {
4483
+ function t(t, e) {
4484
+ for (var n = 0; n < e.length; n++) {
4485
+ var r = e[n];
4486
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r);
4834
4487
  }
4835
4488
  }
4836
- return function (t, n, r) {
4837
- return n && e(t.prototype, n), r && e(t, r), t;
4489
+ return function (e, n, r) {
4490
+ return n && t(e.prototype, n), r && t(e, r), e;
4838
4491
  };
4839
4492
  }(),
4840
- a = e("./modal"),
4841
- s = r(a),
4842
- f = e("./options"),
4493
+ u = t("./modal"),
4494
+ a = r(u),
4495
+ c = t("./options"),
4496
+ s = r(c),
4497
+ f = t("./utility"),
4843
4498
  l = r(f),
4844
- p = e("./utility"),
4499
+ p = t("./console"),
4845
4500
  d = r(p),
4846
- h = e("./console"),
4501
+ h = (t("./events"), t("q")),
4847
4502
  v = r(h),
4848
- y = (e("./events"), e("q")),
4849
- m = r(y),
4850
- g = function () {
4851
- function e() {
4852
- o(this, e);
4503
+ y = function () {
4504
+ function t() {
4505
+ !function t(e, n) {
4506
+ if (!(e instanceof n)) throw TypeError("Cannot call a class as a function");
4507
+ }(this, t);
4853
4508
  }
4854
- return c(e, null, [{
4509
+ return i(t, null, [{
4855
4510
  key: "init",
4856
- value: function value(e) {
4857
- if ("function" != typeof Object.assign && (Object.assign = function (e) {
4858
- if (null == e) throw new TypeError("Cannot convert undefined or null to object");
4859
- e = Object(e);
4860
- for (var t = 1; t < arguments.length; t++) {
4861
- var n = arguments[t];
4862
- if (null != n) for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
4511
+ value: function value(t) {
4512
+ if ("function" != typeof Object.assign && (Object.assign = function (t) {
4513
+ if (null == t) throw TypeError("Cannot convert undefined or null to object");
4514
+ t = Object(t);
4515
+ for (var e = 1; e < arguments.length; e++) {
4516
+ var n = arguments[e];
4517
+ if (null != n) for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
4863
4518
  }
4864
- return e;
4865
- }), e = _extends({}, l["default"], e), !this._validate(e)) return v["default"].setLevel(e.logLevel), e.redirect ? u(e, function (t) {
4866
- return e.redirectFn(t.redirectUri);
4867
- }) : i(e);
4519
+ return t;
4520
+ }), t = _extends({}, s["default"], t), !this._validate(t)) {
4521
+ var e, n;
4522
+ return d["default"].setLevel(t.logLevel), t.redirect ? o(t, function (e) {
4523
+ return t.redirectFn(e.redirectUri);
4524
+ }) : (e = t, void ((n = new a["default"]()).onClose = e.onComplete.bind(e), n.build(), o(e, function (t) {
4525
+ return n.setUri(t.redirectUri);
4526
+ }, function (t) {
4527
+ return n.close(!1);
4528
+ })));
4529
+ }
4868
4530
  }
4869
4531
  }, {
4870
4532
  key: "attachButton",
4871
- value: function value(e, t) {
4872
- var n = document.querySelectorAll(e);
4533
+ value: function value(t, e) {
4534
+ var n = document.querySelectorAll(t);
4873
4535
  if (!n.length) return config.onError({
4874
4536
  code: "attach_error",
4875
4537
  message: "Cannot find button to attach zipMoney checkout"
4876
4538
  });
4877
- for (var r = 0; r < n.length; r++) d["default"].addEventHandler(n[r], "click", function () {
4878
- return Zip.Checkout.init(t);
4539
+ for (var r = 0; r < n.length; r++) l["default"].addEventHandler(n[r], "click", function () {
4540
+ return Zip.Checkout.init(e);
4879
4541
  });
4880
4542
  }
4881
4543
  }, {
4882
4544
  key: "_validate",
4883
- value: function value(e) {
4884
- return ["error", "information", "debug"].indexOf(e.logLevel.toLowerCase()) < 0 && (e.logLevel = "error"), ["standard", "express"].indexOf(e.request.toLowerCase()) < 0 && (e.request = "standard"), e.onComplete = e.onComplete || function () {}, e.onError = e.onError || function () {}, e.checkoutUri || e.onCheckout !== l["default"].onCheckout ? "express" === e.request ? e.onError({
4545
+ value: function value(t) {
4546
+ return 0 > ["error", "information", "debug"].indexOf(t.logLevel.toLowerCase()) && (t.logLevel = "error"), 0 > ["standard", "express"].indexOf(t.request.toLowerCase()) && (t.request = "standard"), t.onComplete = t.onComplete || function () {}, t.onError = t.onError || function () {}, t.checkoutUri || t.onCheckout !== s["default"].onCheckout ? "express" === t.request ? t.onError({
4885
4547
  code: "not_implemented",
4886
4548
  message: "This feature is not yet implemented"
4887
- }) : e.redirect ? void 0 : e.onComplete !== l["default"].onComplete || e.redirectUri ? void 0 : e.onError({
4549
+ }) : t.redirect ? void 0 : t.onComplete !== s["default"].onComplete || t.redirectUri ? void 0 : t.onError({
4888
4550
  code: "validation",
4889
4551
  message: "if onComplete function is not specified then redirectUri must be specified"
4890
- }) : e.onError({
4552
+ }) : t.onError({
4891
4553
  code: "validation",
4892
4554
  message: "if onCheckout function is not specified then checkoutUri must be specified"
4893
4555
  });
4894
4556
  }
4895
- }]), e;
4557
+ }]), t;
4896
4558
  }();
4897
- n.Checkout = g;
4559
+ n.Checkout = y;
4898
4560
  }, {
4899
4561
  "./console": 5,
4900
4562
  "./events": 6,
@@ -4903,293 +4565,261 @@
4903
4565
  "./utility": 10,
4904
4566
  q: 2
4905
4567
  }],
4906
- 5: [function (e, t, n) {
4568
+ 5: [function (t, e, n) {
4907
4569
 
4908
4570
  Object.defineProperty(n, "__esModule", {
4909
4571
  value: !0
4910
4572
  });
4911
- var r = "error",
4912
- o = {
4913
- error: function error() {
4914
- var e;
4915
- (e = window.console).log.apply(e, arguments);
4916
- },
4917
- information: function information() {
4918
- if ("error" !== r) {
4919
- var e;
4920
- (e = window.console).log.apply(e, arguments);
4921
- }
4922
- },
4923
- debug: function debug() {
4924
- if ("debug" === r) {
4925
- var e;
4926
- (e = window.console).log.apply(e, arguments);
4927
- }
4928
- },
4929
- setLevel: function setLevel(e) {
4930
- r = e;
4573
+ var r = "error";
4574
+ n["default"] = {
4575
+ error: function error() {
4576
+ var t;
4577
+ (t = window.console).log.apply(t, arguments);
4578
+ },
4579
+ information: function information() {
4580
+ if ("error" !== r) {
4581
+ var t;
4582
+ (t = window.console).log.apply(t, arguments);
4931
4583
  }
4932
- };
4933
- n["default"] = o;
4584
+ },
4585
+ debug: function debug() {
4586
+ if ("debug" === r) {
4587
+ var t;
4588
+ (t = window.console).log.apply(t, arguments);
4589
+ }
4590
+ },
4591
+ setLevel: function setLevel(t) {
4592
+ r = t;
4593
+ }
4594
+ };
4934
4595
  }, {}],
4935
- 6: [function (e, t, n) {
4936
- (function (t) {
4596
+ 6: [function (t, e, n) {
4597
+ (function (e) {
4937
4598
 
4938
- function r(e, t) {
4939
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
4940
- }
4941
- function o(e) {
4942
- var n = new t.CustomEvent("zipmoney", {
4943
- detail: e
4944
- });
4945
- t.dispatchEvent(n);
4946
- }
4947
- function i(e) {
4948
- console.log("Unexpected Event", e);
4949
- }
4950
4599
  Object.defineProperty(n, "__esModule", {
4951
4600
  value: !0
4952
4601
  }), n.EventListener = void 0;
4953
- var u = function () {
4954
- function e(e, t) {
4955
- for (var n = 0; n < t.length; n++) {
4956
- var r = t[n];
4957
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
4602
+ var r,
4603
+ o = function () {
4604
+ function t(t, e) {
4605
+ for (var n = 0; n < e.length; n++) {
4606
+ var r = e[n];
4607
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r);
4958
4608
  }
4959
4609
  }
4960
- return function (t, n, r) {
4961
- return n && e(t.prototype, n), r && e(t, r), t;
4610
+ return function (e, n, r) {
4611
+ return n && t(e.prototype, n), r && t(e, r), e;
4962
4612
  };
4963
- }(),
4964
- c = e("./utility");
4965
- if (function (e) {
4966
- return e && e.__esModule ? e : {
4967
- "default": e
4968
- };
4969
- }(c)["default"].isIe) {
4970
- var a = function a(e, t) {
4971
- t = t || {
4613
+ }();
4614
+ if (((r = t("./utility")) && r.__esModule ? r : {
4615
+ "default": r
4616
+ })["default"].isIe) {
4617
+ var i = function i(t, e) {
4618
+ e = e || {
4972
4619
  bubbles: !1,
4973
4620
  cancelable: !1,
4974
4621
  detail: void 0
4975
4622
  };
4976
4623
  var n = document.createEvent("CustomEvent");
4977
- return n.initCustomEvent(e, t.bubbles, t.cancelable, t.detail), n;
4624
+ return n.initCustomEvent(t, e.bubbles, e.cancelable, e.detail), n;
4978
4625
  };
4979
- a.prototype = t.Event.prototype, t.CustomEvent = a;
4626
+ i.prototype = e.Event.prototype, e.CustomEvent = i;
4980
4627
  }
4981
- var s = {},
4982
- f = n.EventListener = function () {
4983
- function e() {
4984
- r(this, e);
4628
+ var u = {},
4629
+ a = n.EventListener = function () {
4630
+ function t() {
4631
+ !function t(e, n) {
4632
+ if (!(e instanceof n)) throw TypeError("Cannot call a class as a function");
4633
+ }(this, t);
4985
4634
  }
4986
- return u(e, null, [{
4635
+ return o(t, null, [{
4987
4636
  key: "constructor",
4988
4637
  value: function value() {
4989
- s = {};
4638
+ u = {};
4990
4639
  }
4991
4640
  }, {
4992
4641
  key: "on",
4993
- value: function value(e, t) {
4994
- s[e] = t;
4642
+ value: function value(t, e) {
4643
+ u[t] = e;
4995
4644
  }
4996
4645
  }, {
4997
4646
  key: "off",
4998
- value: function value(e) {
4999
- s[e] = null;
4647
+ value: function value(t) {
4648
+ u[t] = null;
5000
4649
  }
5001
- }]), e;
4650
+ }]), t;
5002
4651
  }();
5003
- f.Event = function (e, t) {
5004
- this.eventType = e, this.data = t || {};
5005
- }, f.Event.eventTypes = {
4652
+ a.Event = function (t, e) {
4653
+ this.eventType = t, this.data = e || {};
4654
+ }, a.Event.eventTypes = {
5006
4655
  resize: "resize",
5007
4656
  transition: "transition",
5008
4657
  close: "close",
5009
4658
  complete: "complete",
5010
4659
  clear: "clear"
5011
4660
  };
5012
- var l = window.addEventListener ? "addEventListener" : "attachEvent",
5013
- p = window[l];
5014
- p("attachEvent" == l ? "onmessage" : "message", function (e) {
5015
- e.data.zipmoney && o(e.data.msg);
5016
- }, !1), p("zipmoney", function (e) {
5017
- var t = e.detail.eventType,
5018
- n = s[t];
5019
- n ? n(e.detail.data || {}) : i(e);
4661
+ var c = window.addEventListener ? "addEventListener" : "attachEvent",
4662
+ s = window[c];
4663
+ s("attachEvent" == c ? "onmessage" : "message", function (t) {
4664
+ var n, r;
4665
+ t.data.zipmoney && (n = t.data.msg, r = new e.CustomEvent("zipmoney", {
4666
+ detail: n
4667
+ }), e.dispatchEvent(r));
4668
+ }, !1), s("zipmoney", function (t) {
4669
+ var e,
4670
+ n = u[t.detail.eventType];
4671
+ n ? n(t.detail.data || {}) : (e = t, console.log("Unexpected Event", e));
5020
4672
  }, !1);
5021
4673
  }).call(this, "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
5022
4674
  }, {
5023
4675
  "./utility": 10
5024
4676
  }],
5025
- 7: [function (e, t, n) {
5026
- (function (t) {
4677
+ 7: [function (t, e, n) {
4678
+ (function (e) {
5027
4679
 
5028
- var n = e("./checkout"),
5029
- r = e("./events");
5030
- t.Zip = t.Zip || {}, t.Zip.Checkout = n.Checkout, t.zipMoneyEvent = r.EventListener.ZipEvent;
4680
+ var n = t("./checkout"),
4681
+ r = t("./events");
4682
+ e.Zip = e.Zip || {}, e.Zip.Checkout = n.Checkout, e.zipMoneyEvent = r.EventListener.ZipEvent;
5031
4683
  }).call(this, "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
5032
4684
  }, {
5033
4685
  "./checkout": 4,
5034
4686
  "./events": 6
5035
4687
  }],
5036
- 8: [function (e, t, n) {
4688
+ 8: [function (t, e, n) {
5037
4689
 
5038
- function r(e) {
5039
- return e && e.__esModule ? e : {
5040
- "default": e
4690
+ function r(t) {
4691
+ return t && t.__esModule ? t : {
4692
+ "default": t
5041
4693
  };
5042
4694
  }
5043
- function o(e, t) {
5044
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
4695
+ function o() {
4696
+ return Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
5045
4697
  }
5046
4698
  function i() {
5047
- return Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
4699
+ var t = document.body,
4700
+ e = document.documentElement;
4701
+ return Math.max(t.scrollHeight, t.offsetHeight, e.clientHeight, e.scrollHeight, e.offsetHeight);
5048
4702
  }
5049
- function u() {
5050
- var e = document.body,
5051
- t = document.documentElement;
5052
- return Math.max(e.scrollHeight, e.offsetHeight, t.clientHeight, t.scrollHeight, t.offsetHeight);
5053
- }
5054
- function c(e, t) {
5055
- var n = document.createElement("div");
5056
- return n.className = "zipmoney-overlay", _extends(n.style, {
5057
- position: "absolute",
5058
- left: "0",
5059
- top: "0",
5060
- display: "table-cell",
5061
- textAlign: "center",
5062
- verticalAlign: "middle",
5063
- background: "rgba(0, 0, 0, 0.75)",
5064
- zIndex: "10000",
5065
- height: "100%",
5066
- width: "100%"
5067
- }), n;
5068
- }
5069
- function a(e, t) {
5070
- var n = document.createElement("iframe");
5071
- return n.id = "zipmoney-iframe", n.frameborder = 0, _extends(n.style, {
5072
- padding: "0",
5073
- border: "none",
5074
- zIndex: "999999",
5075
- backgroundColor: "#FFF",
5076
- backgroundImage: "url(" + k + "spinner.gif)",
5077
- backgroundRepeat: "no-repeat",
5078
- backgroundPosition: "50% 50%"
5079
- }), t ? _extends(n.style, {
5080
- overflow: "scroll",
5081
- width: "100%",
5082
- height: "100%",
5083
- position: "absolute",
5084
- top: "0",
5085
- bottom: "0",
5086
- left: "0",
5087
- right: "0",
5088
- margin: "0"
5089
- }) : _extends(n.style, {
5090
- width: b.iframeWidth + "px",
5091
- minWidth: b.iframeMinWidth + "px",
5092
- height: b.iframeInitialHeight + "px",
5093
- margin: b.verticalMargin + "px auto 0 auto",
5094
- display: "table-row",
5095
- backgroundSize: "25%",
5096
- textAlign: "center",
5097
- boxShadow: "0px 0px 70px 0px rgb(0, 0, 0)"
5098
- }), n.src = e || "", n;
5099
- }
5100
- function s() {
5101
- var e = document.createElement("img");
5102
- return e.src = k + "icon-close.png", _extends(e.style, {
5103
- width: "50px",
5104
- height: "50px",
5105
- position: "absolute",
5106
- top: "20px",
5107
- right: "20px",
5108
- cursor: "pointer"
5109
- }), e;
5110
- }
5111
- function f() {
5112
- var e = document.createElement("div");
5113
- e.style.width = b.iframeWidth + "px", e.style.minWidth = b.iframeMinWidth + "px", e.style.margin = "10px auto 0 auto", e.style.overflow = "hidden";
5114
- var t = document.createElement("img");
5115
- t.src = k + "iframe-secure.png", t.style.cssFloat = "left";
5116
- var n = document.createElement("img");
5117
- return n.src = k + "poweredby-trans.png", n.style.cssFloat = "right", e.appendChild(t), e.appendChild(n), e;
5118
- }
5119
- function l(e) {
5120
- for (var t = document.querySelectorAll("html, body"), n = 0; n < t.length; n++) t[n].style.overflowY = e;
5121
- }
5122
- function p(e) {
5123
- var t = document.body.currentStyle || window.getComputedStyle(document.body),
5124
- n = document.body.offsetHeight,
5125
- r = parseInt(t.marginTop, 10) + parseInt(t.marginBottom, 10),
5126
- o = n + r,
5127
- i = o - parseInt(t.height, 10),
5128
- u = e - i;
5129
- document.body.style.height = u + "px";
4703
+ function u(t) {
4704
+ for (var e = document.querySelectorAll("html, body"), n = 0; n < e.length; n++) e[n].style.overflowY = t;
5130
4705
  }
5131
- function d(e) {
5132
- document.body.style.height = "initial";
4706
+ function a(t) {
4707
+ var e = document.body.currentStyle || window.getComputedStyle(document.body),
4708
+ n = document.body.offsetHeight,
4709
+ r = parseInt(e.marginTop, 10) + parseInt(e.marginBottom, 10),
4710
+ o = n + r - parseInt(e.height, 10);
4711
+ document.body.style.height = t - o + "px";
5133
4712
  }
5134
4713
  Object.defineProperty(n, "__esModule", {
5135
4714
  value: !0
5136
4715
  });
5137
- var h = function () {
5138
- function e(e, t) {
5139
- for (var n = 0; n < t.length; n++) {
5140
- var r = t[n];
5141
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
4716
+ var c = function () {
4717
+ function t(t, e) {
4718
+ for (var n = 0; n < e.length; n++) {
4719
+ var r = e[n];
4720
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r);
5142
4721
  }
5143
4722
  }
5144
- return function (t, n, r) {
5145
- return n && e(t.prototype, n), r && e(t, r), t;
4723
+ return function (e, n, r) {
4724
+ return n && t(e.prototype, n), r && t(e, r), e;
5146
4725
  };
5147
4726
  }(),
5148
- v = e("./utility"),
5149
- y = r(v),
5150
- m = e("./events"),
5151
- g = e("./console"),
5152
- b = (r(g), {
4727
+ s = t("./utility"),
4728
+ f = r(s),
4729
+ l = t("./events"),
4730
+ p = t("./console"),
4731
+ d = (r(p), {
5153
4732
  iframeWidth: 400,
5154
4733
  iframeMinWidth: 320,
5155
4734
  iframeInitialHeight: 704,
5156
4735
  iframeMinHeight: 600,
5157
4736
  verticalMargin: 35
5158
4737
  }),
5159
- w = ["resize", "transition", "close", "complete", "clear"],
5160
- k = "https://d3k1w8lx8mqizo.cloudfront.net/zm/",
5161
- E = function () {
5162
- function e() {
5163
- var t = this;
5164
- o(this, e), this._events = [], this._isMobile = y["default"].isMobileDevice(), w.forEach(function (e) {
5165
- return m.EventListener.on(m.EventListener.Event.eventTypes[e], t[e].bind(t));
4738
+ h = ["resize", "transition", "close", "complete", "clear"],
4739
+ v = "https://d3k1w8lx8mqizo.cloudfront.net/zm/",
4740
+ y = function () {
4741
+ function t() {
4742
+ var e = this;
4743
+ (function t(e, n) {
4744
+ if (!(e instanceof n)) throw TypeError("Cannot call a class as a function");
4745
+ })(this, t), this._events = [], this._isMobile = f["default"].isMobileDevice(), h.forEach(function (t) {
4746
+ return l.EventListener.on(l.EventListener.Event.eventTypes[t], e[t].bind(e));
5166
4747
  });
5167
4748
  }
5168
- return h(e, [{
4749
+ return c(t, [{
5169
4750
  key: "build",
5170
4751
  value: function value() {
5171
- this._initialHtmlHeight = u(), window.scrollTo(0, 0);
5172
- var e = this._frame = a(this._frameUri, this._isMobile);
4752
+ this._initialHtmlHeight = i(), window.scrollTo(0, 0);
4753
+ var t = this._frame = (e = this._frameUri, n = this._isMobile, (r = document.createElement("iframe")).id = "zipmoney-iframe", r.frameborder = 0, _extends(r.style, {
4754
+ padding: "0",
4755
+ border: "none",
4756
+ zIndex: "999999",
4757
+ backgroundColor: "#FFF",
4758
+ backgroundImage: "url(" + v + "spinner.gif)",
4759
+ backgroundRepeat: "no-repeat",
4760
+ backgroundPosition: "50% 50%"
4761
+ }), n ? _extends(r.style, {
4762
+ overflow: "scroll",
4763
+ width: "100%",
4764
+ height: "100%",
4765
+ position: "absolute",
4766
+ top: "0",
4767
+ bottom: "0",
4768
+ left: "0",
4769
+ right: "0",
4770
+ margin: "0"
4771
+ }) : _extends(r.style, {
4772
+ width: d.iframeWidth + "px",
4773
+ minWidth: d.iframeMinWidth + "px",
4774
+ height: d.iframeInitialHeight + "px",
4775
+ margin: d.verticalMargin + "px auto 0 auto",
4776
+ display: "table-row",
4777
+ backgroundSize: "25%",
4778
+ textAlign: "center",
4779
+ boxShadow: "0px 0px 70px 0px rgb(0, 0, 0)"
4780
+ }), r.src = e || "", r);
5173
4781
  if (!this._isMobile) {
5174
- var t = s();
5175
- t.onclick = this.close.bind(this), this._overlay = c(), this._overlay.appendChild(t), this._overlay.appendChild(this._frame), this._overlay.appendChild(f()), e = this._overlay;
4782
+ var e,
4783
+ n,
4784
+ r,
4785
+ o,
4786
+ c,
4787
+ s = ((o = document.createElement("img")).src = v + "icon-close.png", _extends(o.style, {
4788
+ width: "50px",
4789
+ height: "50px",
4790
+ position: "absolute",
4791
+ top: "20px",
4792
+ right: "20px",
4793
+ cursor: "pointer"
4794
+ }), o);
4795
+ s.onclick = this.close.bind(this), this._overlay = ((c = document.createElement("div")).className = "zipmoney-overlay", _extends(c.style, {
4796
+ position: "absolute",
4797
+ left: "0",
4798
+ top: "0",
4799
+ display: "table-cell",
4800
+ textAlign: "center",
4801
+ verticalAlign: "middle",
4802
+ background: "rgba(0, 0, 0, 0.75)",
4803
+ zIndex: "10000",
4804
+ height: "100%",
4805
+ width: "100%"
4806
+ }), c), this._overlay.appendChild(s), this._overlay.appendChild(this._frame), t = this._overlay;
5176
4807
  }
5177
- document.body.appendChild(e), this._isMobile && p(this._frame.offsetHeight), l("auto"), this._startMonitoringWindowResize();
4808
+ document.body.appendChild(t), this._isMobile && a(this._frame.offsetHeight), u("auto"), this._startMonitoringWindowResize();
5178
4809
  }
5179
4810
  }, {
5180
4811
  key: "setUri",
5181
- value: function value(e) {
5182
- this._frameUri = e, this._frame && (this._frame.src = e);
4812
+ value: function value(t) {
4813
+ this._frameUri = t, this._frame && (this._frame.src = t);
5183
4814
  }
5184
4815
  }, {
5185
4816
  key: "resize",
5186
- value: function value(e) {
5187
- var t = this._isMobile ? 16 : 0,
5188
- e = e >= b.iframeMinHeight ? e : b.iframeMinHeight;
5189
- e += t;
5190
- var n = e + 2 * b.verticalMargin,
5191
- r = i();
5192
- this._frame.style.height = e + "px", this._overlay && (this._overlay.style.height = Math.max(r, this._initialHtmlHeight, n) + "px"), this._isMobile && p(e);
4817
+ value: function value(t) {
4818
+ var e = this._isMobile ? 16 : 0,
4819
+ t = t >= d.iframeMinHeight ? t : d.iframeMinHeight,
4820
+ n = (t += e) + 2 * d.verticalMargin,
4821
+ r = o();
4822
+ this._frame.style.height = t + "px", this._overlay && (this._overlay.style.height = Math.max(r, this._initialHtmlHeight, n) + "px"), this._isMobile && a(t);
5193
4823
  }
5194
4824
  }, {
5195
4825
  key: "transition",
@@ -5199,241 +4829,227 @@
5199
4829
  }, {
5200
4830
  key: "close",
5201
4831
  value: function value() {
5202
- var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0],
5203
- t = {
4832
+ var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0],
4833
+ e = {
5204
4834
  state: "cancelled"
5205
4835
  };
5206
- this._events.length && (t = this._events.pop()), this._destroy(), this.onClose && e && this.onClose(t);
4836
+ this._events.length && (e = this._events.pop()), this._destroy(), this.onClose && t && this.onClose(e);
5207
4837
  }
5208
4838
  }, {
5209
4839
  key: "complete",
5210
- value: function value(e) {
5211
- this._events.push(e);
4840
+ value: function value(t) {
4841
+ this._events.push(t);
5212
4842
  }
5213
4843
  }, {
5214
4844
  key: "clear",
5215
- value: function value(e) {
4845
+ value: function value(t) {
5216
4846
  this._events = [];
5217
4847
  }
5218
4848
  }, {
5219
4849
  key: "_startMonitoringWindowResize",
5220
4850
  value: function value() {
5221
- function e(e) {
5222
- var t = i(),
5223
- n = u(),
5224
- r = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
5225
- e._overlay && (e._overlay.style.height = Math.max(t, n) + "px"), e._isMobile || r < b.iframeWidth ? e._frame.style.width = "100%" : e._frame.style.width = b.iframeWidth + "px";
5226
- }
5227
4851
  var t = this;
5228
- this._resizeHandler = y["default"].debounce(function () {
5229
- return e(t);
5230
- }, 250), y["default"].addEventHandler(window, "resize", this._resizeHandler);
4852
+ this._resizeHandler = f["default"].debounce(function () {
4853
+ var e, n, r, u;
4854
+ return e = t, n = o(), r = i(), u = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, void (e._overlay && (e._overlay.style.height = Math.max(n, r) + "px"), e._isMobile || u < d.iframeWidth ? e._frame.style.width = "100%" : e._frame.style.width = d.iframeWidth + "px");
4855
+ }, 250), f["default"].addEventHandler(window, "resize", this._resizeHandler);
5231
4856
  }
5232
4857
  }, {
5233
4858
  key: "_stopMonitoringWindowResize",
5234
4859
  value: function value() {
5235
- y["default"].removeEventHandler(window, "resize", this._resizeHandler);
4860
+ f["default"].removeEventHandler(window, "resize", this._resizeHandler);
5236
4861
  }
5237
4862
  }, {
5238
4863
  key: "_destroy",
5239
4864
  value: function value() {
5240
- this._stopMonitoringWindowResize(), this._overlay ? document.body.removeChild(this._overlay) : document.body.removeChild(this._frame), this._isMobile && d(), l("initial"), this._overlay = this._frame = null, w.forEach(function (e) {
5241
- return m.EventListener.off(m.EventListener.Event.eventTypes[e]);
4865
+ this._stopMonitoringWindowResize(), this._overlay ? document.body.removeChild(this._overlay) : document.body.removeChild(this._frame), this._isMobile && (document.body.style.height = "initial"), u("initial"), this._overlay = this._frame = null, h.forEach(function (t) {
4866
+ return l.EventListener.off(l.EventListener.Event.eventTypes[t]);
5242
4867
  });
5243
4868
  }
5244
- }]), e;
4869
+ }]), t;
5245
4870
  }();
5246
- n["default"] = E;
4871
+ n["default"] = y;
5247
4872
  }, {
5248
4873
  "./console": 5,
5249
4874
  "./events": 6,
5250
4875
  "./utility": 10
5251
4876
  }],
5252
- 9: [function (e, t, n) {
4877
+ 9: [function (t, e, n) {
5253
4878
 
5254
- function r(e) {
5255
- return e && e.__esModule ? e : {
5256
- "default": e
4879
+ function r(t) {
4880
+ return t && t.__esModule ? t : {
4881
+ "default": t
5257
4882
  };
5258
4883
  }
5259
4884
  Object.defineProperty(n, "__esModule", {
5260
4885
  value: !0
5261
4886
  });
5262
- var o = e("./xr"),
4887
+ var o = t("./xr"),
5263
4888
  i = r(o),
5264
- u = e("./console"),
5265
- c = r(u);
4889
+ u = t("./console"),
4890
+ a = r(u);
5266
4891
  i["default"].configure({
5267
4892
  headers: {
5268
4893
  "X-Requested-With": "XMLHttpRequest"
5269
4894
  }
5270
- });
5271
- var a = {
4895
+ }), n["default"] = {
5272
4896
  request: "standard",
5273
4897
  redirect: !1,
5274
4898
  logLevel: "Error",
5275
- onCheckout: function onCheckout(e, t, n) {
5276
- i["default"].post(this.checkoutUri).then(function (t) {
5277
- return e(t.data);
5278
- })["catch"](t);
4899
+ onCheckout: function onCheckout(t, e, n) {
4900
+ i["default"].post(this.checkoutUri).then(function (e) {
4901
+ return t(e.data);
4902
+ })["catch"](e);
5279
4903
  },
5280
- onShippingAddressChanged: function onShippingAddressChanged(e, t, n) {
5281
- i["default"].post(this.shippingUri).then(e)["catch"](t);
4904
+ onShippingAddressChanged: function onShippingAddressChanged(t, e, n) {
4905
+ i["default"].post(this.shippingUri).then(t)["catch"](e);
5282
4906
  },
5283
- onComplete: function onComplete(e) {
5284
- if (c["default"].information("zip:completed", e), "cancelled" !== e.state) {
5285
- var t = e.checkoutId ? "&checkoutId=" + e.checkoutId : "";
5286
- this.redirectFn(this.redirectUri + "?result=" + e.state + t);
4907
+ onComplete: function onComplete(t) {
4908
+ if (a["default"].information("zip:completed", t), "cancelled" !== t.state) {
4909
+ var e = t.checkoutId ? "&checkoutId=" + t.checkoutId : "";
4910
+ this.redirectFn(this.redirectUri + "?result=" + t.state + e);
5287
4911
  }
5288
4912
  },
5289
- onError: function onError(e) {
5290
- c["default"].error(e);
4913
+ onError: function onError(t) {
4914
+ a["default"].error(t);
5291
4915
  },
5292
- redirectFn: function redirectFn(e) {
5293
- window.location.href = e;
4916
+ redirectFn: function redirectFn(t) {
4917
+ window.location.href = t;
5294
4918
  }
5295
4919
  };
5296
- n["default"] = a;
5297
4920
  }, {
5298
4921
  "./console": 5,
5299
4922
  "./xr": 11
5300
4923
  }],
5301
- 10: [function (e, t, n) {
4924
+ 10: [function (t, e, n) {
5302
4925
 
5303
- function r(e, t) {
5304
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
5305
- }
5306
4926
  Object.defineProperty(n, "__esModule", {
5307
4927
  value: !0
5308
4928
  });
5309
- var o = function () {
5310
- function e(e, t) {
5311
- for (var n = 0; n < t.length; n++) {
5312
- var r = t[n];
5313
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
4929
+ var r = function () {
4930
+ function t(t, e) {
4931
+ for (var n = 0; n < e.length; n++) {
4932
+ var r = e[n];
4933
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r);
5314
4934
  }
5315
4935
  }
5316
- return function (t, n, r) {
5317
- return n && e(t.prototype, n), r && e(t, r), t;
4936
+ return function (e, n, r) {
4937
+ return n && t(e.prototype, n), r && t(e, r), e;
5318
4938
  };
5319
4939
  }(),
5320
- i = function () {
5321
- function e() {
5322
- r(this, e);
4940
+ o = function () {
4941
+ function t() {
4942
+ !function t(e, n) {
4943
+ if (!(e instanceof n)) throw TypeError("Cannot call a class as a function");
4944
+ }(this, t);
5323
4945
  }
5324
- return o(e, null, [{
4946
+ return r(t, null, [{
5325
4947
  key: "isIe",
5326
4948
  value: function value() {
5327
- var e = -1,
5328
- t = window.navigator.userAgent,
5329
- n = t.indexOf("MSIE "),
5330
- r = t.indexOf("Trident/");
5331
- if (n > 0) e = parseInt(t.substring(n + 5, t.indexOf(".", n)), 10);else if (r > 0) {
5332
- var o = t.indexOf("rv:");
5333
- e = parseInt(t.substring(o + 3, t.indexOf(".", o)), 10);
4949
+ var t = -1,
4950
+ e = window.navigator.userAgent,
4951
+ n = e.indexOf("MSIE "),
4952
+ r = e.indexOf("Trident/");
4953
+ if (n > 0) t = parseInt(e.substring(n + 5, e.indexOf(".", n)), 10);else if (r > 0) {
4954
+ var o = e.indexOf("rv:");
4955
+ t = parseInt(e.substring(o + 3, e.indexOf(".", o)), 10);
5334
4956
  }
5335
- return e > -1 ? e : void 0;
4957
+ return t > -1 ? t : void 0;
5336
4958
  }
5337
4959
  }, {
5338
4960
  key: "isMobileDevice",
5339
4961
  value: function value() {
5340
- var e = navigator.userAgent || navigator.vendor || window.opera;
5341
- return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4));
4962
+ var t = navigator.userAgent || navigator.vendor || window.opera;
4963
+ return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4));
5342
4964
  }
5343
4965
  }, {
5344
4966
  key: "debounce",
5345
- value: function value(e, t) {
4967
+ value: function value(t, e) {
5346
4968
  var n;
5347
4969
  return function () {
5348
4970
  var r = this,
5349
4971
  o = arguments,
5350
4972
  i = function i() {
5351
- n = null, e.apply(r, o);
4973
+ n = null, t.apply(r, o);
5352
4974
  },
5353
4975
  u = !n;
5354
- clearTimeout(n), n = setTimeout(i, t), u && e.apply(r, o);
4976
+ clearTimeout(n), n = setTimeout(i, e), u && t.apply(r, o);
5355
4977
  };
5356
4978
  }
5357
4979
  }, {
5358
4980
  key: "addEventHandler",
5359
- value: function value(e, t, n) {
5360
- e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent && e.attachEvent("on" + t, n);
4981
+ value: function value(t, e, n) {
4982
+ t.addEventListener ? t.addEventListener(e, n, !1) : t.attachEvent && t.attachEvent("on" + e, n);
5361
4983
  }
5362
4984
  }, {
5363
4985
  key: "removeEventHandler",
5364
- value: function value(e, t, n) {
5365
- e.removeEventListener ? e.removeEventListener(t, n, !1) : e.detachEvent && e.detachEvent("on" + t, n);
4986
+ value: function value(t, e, n) {
4987
+ t.removeEventListener ? t.removeEventListener(e, n, !1) : t.detachEvent && t.detachEvent("on" + e, n);
5366
4988
  }
5367
- }]), e;
4989
+ }]), t;
5368
4990
  }();
5369
- n["default"] = i;
4991
+ n["default"] = o;
5370
4992
  }, {}],
5371
- 11: [function (e, t, n) {
4993
+ 11: [function (t, e, n) {
5372
4994
 
5373
- function r(e) {
5374
- return e && e.__esModule ? e : {
5375
- "default": e
4995
+ function r(t) {
4996
+ return t && t.__esModule ? t : {
4997
+ "default": t
5376
4998
  };
5377
4999
  }
5378
- function o(e, t) {
5000
+ function o(t, e) {
5379
5001
  return {
5380
- status: e.status,
5381
- response: e.response,
5382
- data: t,
5383
- xhr: e
5002
+ status: t.status,
5003
+ response: t.response,
5004
+ data: e,
5005
+ xhr: t
5384
5006
  };
5385
5007
  }
5386
- function i(e) {
5387
- for (var t = arguments.length, n = Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r];
5008
+ function i(t) {
5009
+ for (var e = arguments.length, n = Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r];
5388
5010
  for (var o in n) if ({}.hasOwnProperty.call(n, o)) {
5389
5011
  var i = n[o];
5390
- if ("object" === (void 0 === i ? "undefined" : s(i))) for (var u in i) ({}).hasOwnProperty.call(i, u) && (e[u] = i[u]);
5012
+ if ("object" === (void 0 === i ? "undefined" : a(i))) for (var u in i) ({}).hasOwnProperty.call(i, u) && (t[u] = i[u]);
5391
5013
  }
5392
- return e;
5393
- }
5394
- function u(e) {
5395
- m = i({}, m, e);
5396
- }
5397
- function c(e, t) {
5398
- return (e && e.promise ? e.promise : m.promise || y.promise)(t);
5014
+ return t;
5399
5015
  }
5400
- function a(e) {
5401
- return c(e, function (t, n) {
5402
- var r = i({}, y, m, e),
5016
+ function u(t) {
5017
+ var e, n;
5018
+ return e = t, n = function n(e, _n) {
5019
+ var r = i({}, h, v, t),
5403
5020
  u = r.xmlHttpRequest();
5404
- r.abort && e.abort(function () {
5405
- n(o(u)), u.abort();
5406
- }), u.open(r.method, r.params ? r.url.split("?")[0] + "?" + (0, l["default"])(r.params) : r.url, !0), u.withCredentials = r.withCredentials, u.addEventListener(v.LOAD, function () {
5021
+ for (var c in r.abort && t.abort(function () {
5022
+ _n(o(u)), u.abort();
5023
+ }), u.open(r.method, r.params ? r.url.split("?")[0] + "?" + (0, s["default"])(r.params) : r.url, !0), u.withCredentials = r.withCredentials, u.addEventListener(d.LOAD, function () {
5407
5024
  if (u.status >= 200 && u.status < 300) {
5408
- var e = null;
5409
- u.responseText && (e = !0 === r.raw ? u.responseText : r.load(u.responseText)), t(o(u, e));
5410
- } else n(o(u));
5411
- }), u.addEventListener(v.ABORT, function () {
5412
- return n(o(u));
5413
- }), u.addEventListener(v.ERROR, function () {
5414
- return n(o(u));
5415
- }), u.addEventListener(v.TIMEOUT, function () {
5416
- return n(o(u));
5417
- });
5418
- for (var c in r.headers) ({}).hasOwnProperty.call(r.headers, c) && u.setRequestHeader(c, r.headers[c]);
5419
- for (var a in r.events) ({}).hasOwnProperty.call(r.events, a) && u.addEventListener(a, r.events[a].bind(null, u), !1);
5420
- var f = "object" !== s(r.data) || r.raw ? r.data : r.dump(r.data);
5421
- void 0 !== f ? u.send(f) : u.send();
5422
- });
5025
+ var t = null;
5026
+ u.responseText && (t = !0 === r.raw ? u.responseText : r.load(u.responseText)), e(o(u, t));
5027
+ } else _n(o(u));
5028
+ }), u.addEventListener(d.ABORT, function () {
5029
+ return _n(o(u));
5030
+ }), u.addEventListener(d.ERROR, function () {
5031
+ return _n(o(u));
5032
+ }), u.addEventListener(d.TIMEOUT, function () {
5033
+ return _n(o(u));
5034
+ }), r.headers) ({}).hasOwnProperty.call(r.headers, c) && u.setRequestHeader(c, r.headers[c]);
5035
+ for (var f in r.events) ({}).hasOwnProperty.call(r.events, f) && u.addEventListener(f, r.events[f].bind(null, u), !1);
5036
+ var l = "object" !== a(r.data) || r.raw ? r.data : r.dump(r.data);
5037
+ void 0 !== l ? u.send(l) : u.send();
5038
+ }, (e && e.promise ? e.promise : v.promise || h.promise)(n);
5423
5039
  }
5424
5040
  Object.defineProperty(n, "__esModule", {
5425
5041
  value: !0
5426
5042
  });
5427
- var s = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
5428
- return _typeof(e);
5429
- } : function (e) {
5430
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
5043
+ var a = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (t) {
5044
+ return _typeof(t);
5045
+ } : function (t) {
5046
+ return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : _typeof(t);
5431
5047
  },
5432
- f = e("querystring/encode"),
5048
+ c = t("querystring/encode"),
5049
+ s = r(c),
5050
+ f = t("q"),
5433
5051
  l = r(f),
5434
- p = e("q"),
5435
- d = r(p),
5436
- h = {
5052
+ p = {
5437
5053
  GET: "GET",
5438
5054
  POST: "POST",
5439
5055
  PUT: "PUT",
@@ -5441,7 +5057,7 @@
5441
5057
  PATCH: "PATCH",
5442
5058
  OPTIONS: "OPTIONS"
5443
5059
  },
5444
- v = {
5060
+ d = {
5445
5061
  READY_STATE_CHANGE: "readystatechange",
5446
5062
  LOAD_START: "loadstart",
5447
5063
  PROGRESS: "progress",
@@ -5451,8 +5067,8 @@
5451
5067
  TIMEOUT: "timeout",
5452
5068
  LOAD_END: "loadend"
5453
5069
  },
5454
- y = {
5455
- method: h.GET,
5070
+ h = {
5071
+ method: p.GET,
5456
5072
  data: void 0,
5457
5073
  headers: {
5458
5074
  Accept: "application/json",
@@ -5463,47 +5079,49 @@
5463
5079
  xmlHttpRequest: function xmlHttpRequest() {
5464
5080
  return new XMLHttpRequest();
5465
5081
  },
5466
- promise: function promise(e) {
5467
- return d["default"].Promise(e);
5082
+ promise: function promise(t) {
5083
+ return l["default"].Promise(t);
5468
5084
  },
5469
5085
  withCredentials: !1
5470
5086
  },
5471
- m = {};
5472
- a.assign = i, a.encode = l["default"], a.configure = u, a.Methods = h, a.Events = v, a.defaults = y, a.get = function (e, t, n) {
5473
- return a(i({
5474
- url: e,
5475
- method: h.GET,
5476
- params: t
5087
+ v = {};
5088
+ u.assign = i, u.encode = s["default"], u.configure = function t(e) {
5089
+ v = i({}, v, e);
5090
+ }, u.Methods = p, u.Events = d, u.defaults = h, u.get = function (t, e, n) {
5091
+ return u(i({
5092
+ url: t,
5093
+ method: p.GET,
5094
+ params: e
5477
5095
  }, n));
5478
- }, a.put = function (e, t, n) {
5479
- return a(i({
5480
- url: e,
5481
- method: h.PUT,
5482
- data: t
5096
+ }, u.put = function (t, e, n) {
5097
+ return u(i({
5098
+ url: t,
5099
+ method: p.PUT,
5100
+ data: e
5483
5101
  }, n));
5484
- }, a.post = function (e, t, n) {
5485
- return a(i({
5486
- url: e,
5487
- method: h.POST,
5488
- data: t
5102
+ }, u.post = function (t, e, n) {
5103
+ return u(i({
5104
+ url: t,
5105
+ method: p.POST,
5106
+ data: e
5489
5107
  }, n));
5490
- }, a.patch = function (e, t, n) {
5491
- return a(i({
5492
- url: e,
5493
- method: h.PATCH,
5494
- data: t
5108
+ }, u.patch = function (t, e, n) {
5109
+ return u(i({
5110
+ url: t,
5111
+ method: p.PATCH,
5112
+ data: e
5495
5113
  }, n));
5496
- }, a.del = function (e, t) {
5497
- return a(i({
5498
- url: e,
5499
- method: h.DELETE
5500
- }, t));
5501
- }, a.options = function (e, t) {
5502
- return a(i({
5503
- url: e,
5504
- method: h.OPTIONS
5505
- }, t));
5506
- }, n["default"] = a;
5114
+ }, u.del = function (t, e) {
5115
+ return u(i({
5116
+ url: t,
5117
+ method: p.DELETE
5118
+ }, e));
5119
+ }, u.options = function (t, e) {
5120
+ return u(i({
5121
+ url: t,
5122
+ method: p.OPTIONS
5123
+ }, e));
5124
+ }, n["default"] = u;
5507
5125
  }, {
5508
5126
  q: 2,
5509
5127
  "querystring/encode": 3
@@ -6532,7 +6150,7 @@
6532
6150
  }(Trigger);
6533
6151
 
6534
6152
  var TEMPLATE$2 = "\n <div class=\"checkout-container\">\n <div class=\"checkout-bg-logo\"></div>\n <a href=\"#\" data-close>Close</a>\n </div>\n";
6535
- var STYLES$1 = "\n .checkout-bg-logo {\n display: block;\n background: url({{url}}) no-repeat;\n width: 100px;\n height: 50px;\n margin: 0 auto;\n border-radius: 10px;\n background-size: contain;\n }\n";
6153
+ var STYLES$1 = "\n .checkout-bg-logo {\n display: block;\n background: url({{url}}) no-repeat;\n width: 100px;\n height: 50px;\n margin: 0 auto;\n border-radius: 10px;\n background-size: contain;\n }\n\n .checkout-overlay {\n z-index: 2147483647;\n }\n\n .checkout-container [data-close] {\n opacity: 1;\n }\n .checkout-container [data-close]:before,\n .checkout-container [data-close]:after {\n background-color: #fff;\n }\n";
6536
6154
  var WalletBackground = /*#__PURE__*/function (_Background) {
6537
6155
  _inherits(WalletBackground, _Background);
6538
6156
  var _super = _createSuper(WalletBackground);
@@ -8307,6 +7925,7 @@
8307
7925
  var CARD_SCHEME_SERVICE;
8308
7926
  (function (CARD_SCHEME_SERVICE) {
8309
7927
  CARD_SCHEME_SERVICE["VISA_SRC"] = "VisaSRC";
7928
+ CARD_SCHEME_SERVICE["MASTERCARD_SRC"] = "MastercardSRCClickToPay";
8310
7929
  })(CARD_SCHEME_SERVICE || (CARD_SCHEME_SERVICE = {}));
8311
7930
 
8312
7931
  var ApiInternal = /*#__PURE__*/function (_ApiBase) {
@@ -8494,6 +8113,7 @@
8494
8113
 
8495
8114
  // src/checkout.ts
8496
8115
  var Checkout = /*#__PURE__*/function () {
8116
+ // eslint-disable-next-line sonarjs/cognitive-complexity
8497
8117
  function Checkout(_ref3) {
8498
8118
  var _this = this,
8499
8119
  _this$callback;
@@ -8507,6 +8127,7 @@
8507
8127
  onTokensChanged = _ref3.onTokensChanged,
8508
8128
  onPaymentSuccess = _ref3.onPaymentSuccess,
8509
8129
  onPaymentError = _ref3.onPaymentError,
8130
+ redirectUrl = _ref3.redirectUrl,
8510
8131
  title = _ref3.title,
8511
8132
  windowFeatures = _ref3.windowFeatures;
8512
8133
  _classCallCheck(this, Checkout);
@@ -8527,6 +8148,7 @@
8527
8148
  _defineProperty(this, "refreshToken", void 0);
8528
8149
  _defineProperty(this, "clientId", void 0);
8529
8150
  _defineProperty(this, "onCheckoutClosed", void 0);
8151
+ _defineProperty(this, "redirectUrl", void 0);
8530
8152
  _defineProperty(this, "rootUrl", void 0);
8531
8153
  _defineProperty(this, "targetOrigin", void 0);
8532
8154
  _defineProperty(this, "title", void 0);
@@ -8543,6 +8165,8 @@
8543
8165
  }
8544
8166
  });
8545
8167
  _defineProperty(this, "close", function () {
8168
+ var _this$frame2;
8169
+ (_this$frame2 = _this.frame) === null || _this$frame2 === void 0 || _this$frame2.close();
8546
8170
  _this.frame = void 0;
8547
8171
  _this.isCheckoutOpen = false;
8548
8172
  _this.stopWindowObserver();
@@ -8623,9 +8247,11 @@
8623
8247
  }
8624
8248
  };
8625
8249
  var checkoutMode = mode || "default" /* DEFAULT */;
8626
- this.rootUrl = url;
8250
+ var TRAILING_SLASH_REGEX = /\/+$/g;
8251
+ var redirectQueryString = !!redirectUrl ? "&redirectUrl=".concat(redirectUrl) : "";
8252
+ this.rootUrl = url.replaceAll(TRAILING_SLASH_REGEX, "");
8627
8253
  this.targetOrigin = window.location.href.replace(/\/$/, "");
8628
- this.url = "".concat(url, "?orderId=").concat(orderId, "&merchantUrl=").concat(encodeURIComponent(this.targetOrigin), "&mode=").concat(checkoutMode);
8254
+ this.url = "".concat(this.rootUrl, "?orderId=").concat(orderId, "&merchantUrl=").concat(encodeURIComponent(this.targetOrigin), "&mode=").concat(checkoutMode).concat(redirectQueryString);
8629
8255
  this.orderId = orderId;
8630
8256
  this.clientId = clientId;
8631
8257
  this.onCheckoutClosed = onCheckoutClosed;
@@ -8698,33 +8324,6 @@
8698
8324
  return "\n ".concat(containerId, " {\n position: relative;\n }\n\n #loading-overlay {\n position: absolute;\n height: 100%;\n width: 100%;\n background: rgba(255, 255, 255, 0.7);\n display: none;\n justify-content: center;\n align-items: center;\n cursor: not-allowed; /* Make it look not clickable */\n }\n\n #loading-overlay::after {\n content: \"\";\n height: 60%;\n aspect-ratio: 1 / 1;\n display: inline-block;\n border: 4px solid #ccc;\n border-top-color: #333;\n border-radius: 50%;\n\n /* Vendor prefixes for animation property */\n -webkit-animation: spin 1s infinite linear;\n -moz-animation: spin 1s infinite linear;\n -o-animation: spin 1s infinite linear;\n animation: spin 1s infinite linear;\n }\n\n @-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @-moz-keyframes spin {\n 0% {\n -moz-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @-o-keyframes spin {\n 0% {\n -o-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -o-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n\n .flypay-v2-checkout-btn {\n width: 100%;\n height: fit-content;\n border: none; /* Remove borders */\n background: transparent; /* Make the button background transparent */\n cursor: pointer; /* Make it look clickable */\n outline: none; /* Remove focus outline */\n padding: 0; /* Remove any default padding */\n }\n\n .flypay-v2-checkout-btn-disabled {\n width: 100%;\n height: fit-content;\n border: none; /* Remove borders */\n background: transparent; /* Make the button background transparent */\n cursor: not-allowed; /* Make it look not clickable */\n outline: none; /* Remove focus outline */\n padding: 0; /* Remove any default padding */\n }\n ");
8699
8325
  }
8700
8326
 
8701
- var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
8702
- function adopt(value) {
8703
- return value instanceof P ? value : new P(function (resolve) {
8704
- resolve(value);
8705
- });
8706
- }
8707
- return new (P || (P = Promise))(function (resolve, reject) {
8708
- function fulfilled(value) {
8709
- try {
8710
- step(generator.next(value));
8711
- } catch (e) {
8712
- reject(e);
8713
- }
8714
- }
8715
- function rejected(value) {
8716
- try {
8717
- step(generator["throw"](value));
8718
- } catch (e) {
8719
- reject(e);
8720
- }
8721
- }
8722
- function step(result) {
8723
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
8724
- }
8725
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8726
- });
8727
- };
8728
8327
  var FlypayV2WalletService = /*#__PURE__*/function (_WalletService) {
8729
8328
  _inherits(FlypayV2WalletService, _WalletService);
8730
8329
  var _super = _createSuper(FlypayV2WalletService);
@@ -8732,80 +8331,48 @@
8732
8331
  var _this;
8733
8332
  _classCallCheck(this, FlypayV2WalletService);
8734
8333
  _this = _super.call(this, publicKey, meta);
8735
- _this.processingButtonClick = false;
8736
8334
  _this.onFlypayV2ButtonClick = function () {
8737
- return __awaiter(_assertThisInitialized(_this), void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
8738
- var _this2 = this;
8739
- var setLoadingOverlayDisplay;
8740
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8741
- while (1) switch (_context2.prev = _context2.next) {
8742
- case 0:
8743
- setLoadingOverlayDisplay = function setLoadingOverlayDisplay(displayStyle) {
8744
- var loadingOverlay = document.getElementById('loading-overlay');
8745
- if (loadingOverlay) loadingOverlay.style.display = displayStyle;
8746
- };
8747
- this.disable();
8748
- setLoadingOverlayDisplay('flex');
8749
- if (!this.processingButtonClick) {
8750
- _context2.next = 5;
8751
- break;
8752
- }
8753
- return _context2.abrupt("return");
8754
- case 5:
8755
- this.processingButtonClick = true;
8756
- this.handleMerchantOnButtonClickEvent().then(function () {
8757
- return __awaiter(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8758
- var _a, _b;
8759
- return _regeneratorRuntime().wrap(function _callee$(_context) {
8760
- while (1) switch (_context.prev = _context.next) {
8761
- case 0:
8762
- _context.prev = 0;
8763
- this.processingButtonClick = false;
8764
- if (this.orderId) {
8765
- _context.next = 6;
8766
- break;
8767
- }
8768
- _context.next = 5;
8769
- return this.getOrderId();
8770
- case 5:
8771
- this.orderId = _context.sent;
8772
- case 6:
8773
- setLoadingOverlayDisplay('none');
8774
- this.background = this.initBackground();
8775
- if (this.orderId) {
8776
- (_a = this.background) === null || _a === void 0 ? void 0 : _a.initControl();
8777
- this.flypayV2Checkout(this.orderId);
8778
- } else {
8779
- this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE);
8780
- }
8781
- _context.next = 17;
8782
- break;
8783
- case 11:
8784
- _context.prev = 11;
8785
- _context.t0 = _context["catch"](0);
8786
- (_b = this.background) === null || _b === void 0 ? void 0 : _b.clear();
8787
- setLoadingOverlayDisplay('none');
8788
- this.enable();
8789
- this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE, {
8790
- err: _context.t0
8791
- });
8792
- case 17:
8793
- case "end":
8794
- return _context.stop();
8795
- }
8796
- }, _callee, this, [[0, 11]]);
8797
- }));
8798
- })["catch"](function (err) {
8799
- _this2.processingButtonClick = false;
8800
- setLoadingOverlayDisplay('none');
8801
- _this2.enable();
8802
- });
8803
- case 7:
8804
- case "end":
8805
- return _context2.stop();
8335
+ var setLoadingOverlayDisplay = function setLoadingOverlayDisplay(displayStyle) {
8336
+ var loadingOverlay = document.getElementById('loading-overlay');
8337
+ if (loadingOverlay) loadingOverlay.style.display = displayStyle;
8338
+ };
8339
+ _this.disable();
8340
+ setLoadingOverlayDisplay('flex');
8341
+ _this.handleMerchantOnButtonClickEvent().then(function () {
8342
+ var processButtonClick = function processButtonClick(orderId) {
8343
+ var _a;
8344
+ setLoadingOverlayDisplay('none');
8345
+ _this.background = _this.initBackground();
8346
+ if (_this.orderId) {
8347
+ (_a = _this.background) === null || _a === void 0 ? void 0 : _a.initControl();
8348
+ _this.flypayV2Checkout(_this.orderId);
8349
+ } else {
8350
+ _this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE);
8806
8351
  }
8807
- }, _callee2, this);
8808
- }));
8352
+ };
8353
+ var processFailure = function processFailure(err) {
8354
+ var _a;
8355
+ (_a = _this.background) === null || _a === void 0 ? void 0 : _a.clear();
8356
+ setLoadingOverlayDisplay('none');
8357
+ _this.enable();
8358
+ _this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE, {
8359
+ err: err
8360
+ });
8361
+ };
8362
+ if (_this.orderId) {
8363
+ processButtonClick(_this.orderId);
8364
+ } else {
8365
+ _this.getOrderId().then(function (orderId) {
8366
+ _this.orderId = orderId;
8367
+ processButtonClick();
8368
+ })["catch"](function (err) {
8369
+ processFailure(err);
8370
+ });
8371
+ }
8372
+ })["catch"](function (err) {
8373
+ setLoadingOverlayDisplay('none');
8374
+ _this.enable();
8375
+ });
8809
8376
  };
8810
8377
  _this.accessToken = meta === null || meta === void 0 ? void 0 : meta.access_token;
8811
8378
  _this.refreshToken = meta === null || meta === void 0 ? void 0 : meta.refresh_token;
@@ -8866,10 +8433,10 @@
8866
8433
  }, {
8867
8434
  key: "handleMerchantOnButtonClickEvent",
8868
8435
  value: function handleMerchantOnButtonClickEvent() {
8869
- var _this3 = this;
8436
+ var _this2 = this;
8870
8437
  return new Promise(function (resolve, reject) {
8871
8438
  var merchantResult;
8872
- _this3.eventEmitter.emit(WALLET_EVENT.BUTTON_CLICK, {
8439
+ _this2.eventEmitter.emit(WALLET_EVENT.BUTTON_CLICK, {
8873
8440
  attachResult: function attachResult(value) {
8874
8441
  merchantResult = value;
8875
8442
  }
@@ -8888,9 +8455,9 @@
8888
8455
  }, {
8889
8456
  key: "getOrderId",
8890
8457
  value: function getOrderId() {
8891
- var _this4 = this;
8458
+ var _this3 = this;
8892
8459
  return new Promise(function (resolve, reject) {
8893
- return _this4.eventEmitter.emit(WALLET_EVENT.CALLBACK, {
8460
+ return _this3.eventEmitter.emit(WALLET_EVENT.CALLBACK, {
8894
8461
  data: {
8895
8462
  request_type: 'CREATE_SESSION'
8896
8463
  },
@@ -8906,45 +8473,44 @@
8906
8473
  }, {
8907
8474
  key: "flypayV2Checkout",
8908
8475
  value: function flypayV2Checkout(orderId) {
8909
- var _this5 = this;
8476
+ var _this4 = this;
8910
8477
  var _a, _b;
8911
8478
  this.checkout = new Checkout(_extends(_extends({
8912
8479
  orderId: orderId
8913
- }, (this.accessToken || this.refreshToken) && {
8914
- auth: _extends(_extends({}, this.accessToken && {
8915
- access_token: this.accessToken
8916
- }), this.refreshToken && {
8480
+ }, this.accessToken && this.refreshToken && {
8481
+ auth: {
8482
+ access_token: this.accessToken,
8917
8483
  refresh_token: this.refreshToken
8918
- }),
8484
+ },
8919
8485
  mode: 'express'
8920
8486
  }), {
8921
8487
  clientId: ((_a = this.meta) === null || _a === void 0 ? void 0 : _a.gateway_mode) === 'live' ? 'dbbd114e-3583-4db5-915e-59f1b3dcd08b' : '924ac1ce-00f4-44e4-8277-06cae751ef1a',
8922
8488
  url: ((_b = this.meta) === null || _b === void 0 ? void 0 : _b.gateway_mode) === 'live' ? 'https://checkout.cxbflypay.com.au' : 'https://checkout.sandbox.cxbflypay.com.au',
8923
8489
  onCheckoutClosed: function onCheckoutClosed() {
8924
8490
  var _a;
8925
- _this5.eventEmitter.emit(WALLET_EVENT.CHECKOUT_CLOSE);
8926
- (_a = _this5.background) === null || _a === void 0 ? void 0 : _a.clear();
8927
- _this5.enable();
8491
+ _this4.eventEmitter.emit(WALLET_EVENT.CHECKOUT_CLOSE);
8492
+ (_a = _this4.background) === null || _a === void 0 ? void 0 : _a.clear();
8493
+ _this4.enable();
8928
8494
  },
8929
8495
  onError: function onError(err) {
8930
- return _this5.eventEmitter.emit(WALLET_EVENT.PAYMENT_ERROR, {
8496
+ return _this4.eventEmitter.emit(WALLET_EVENT.PAYMENT_ERROR, {
8931
8497
  error: err
8932
8498
  });
8933
8499
  },
8934
8500
  onPaymentSuccess: function onPaymentSuccess(data) {
8935
- return _this5.eventEmitter.emit(WALLET_EVENT.PAYMENT_SUCCESS, data);
8501
+ return _this4.eventEmitter.emit(WALLET_EVENT.PAYMENT_SUCCESS, data);
8936
8502
  },
8937
8503
  onPaymentError: function onPaymentError(err) {
8938
- return _this5.eventEmitter.emit(WALLET_EVENT.PAYMENT_ERROR, {
8504
+ return _this4.eventEmitter.emit(WALLET_EVENT.PAYMENT_ERROR, {
8939
8505
  error: err
8940
8506
  });
8941
8507
  },
8942
8508
  onTokensChanged: function onTokensChanged(_ref) {
8943
8509
  var accessToken = _ref.accessToken,
8944
8510
  refreshToken = _ref.refreshToken;
8945
- _this5.accessToken = accessToken;
8946
- _this5.refreshToken = refreshToken;
8947
- _this5.eventEmitter.emit(WALLET_EVENT.AUTH_TOKENS_CHANGED, {
8511
+ _this4.accessToken = accessToken;
8512
+ _this4.refreshToken = refreshToken;
8513
+ _this4.eventEmitter.emit(WALLET_EVENT.AUTH_TOKENS_CHANGED, {
8948
8514
  accessToken: accessToken,
8949
8515
  refreshToken: refreshToken
8950
8516
  });
@@ -8957,15 +8523,15 @@
8957
8523
  }, {
8958
8524
  key: "initBackground",
8959
8525
  value: function initBackground() {
8960
- var _this6 = this;
8961
- var hideCloseButton = true;
8962
- var bg = new WalletBackground(this.link.getNetUrl() + FLYPAY_LOGO_LINK, hideCloseButton);
8526
+ var _this5 = this;
8527
+ var bg = new WalletBackground(this.link.getNetUrl() + FLYPAY_LOGO_LINK);
8963
8528
  bg.setBackdropTitle("");
8964
8529
  bg.setBackdropDescription("");
8965
8530
  bg.onTrigger(TRIGGER$1.CLOSE, function () {
8966
8531
  var _a;
8967
- _this6.checkout.close();
8968
- (_a = _this6.background) === null || _a === void 0 ? void 0 : _a.clear();
8532
+ _this5.checkout.close();
8533
+ (_a = _this5.background) === null || _a === void 0 ? void 0 : _a.clear();
8534
+ _this5.enable();
8969
8535
  });
8970
8536
  return bg;
8971
8537
  }
@@ -10663,87 +10229,58 @@
10663
10229
  return VaultDisplayWidget;
10664
10230
  }();
10665
10231
 
10666
- var VisaSRCStyles = /*#__PURE__*/_createClass(function VisaSRCStyles() {
10667
- _classCallCheck(this, VisaSRCStyles);
10668
- });
10669
- VisaSRCStyles.buttonContainerStyles = "display: flex; flex-direction: column; justify-content: center; align-items: center;";
10670
- VisaSRCStyles.buttonStyles = "color: #ffff; background-color: #ffbe24; border: none; width: 100%; min-height: 40px; font-size: 16px; font-weight: bold; line-height: 19px; letter-spacing: 0.7px; text-transform: uppercase; border-radius: 4px; margin-bottom: 15px; cursor: pointer;";
10671
- VisaSRCStyles.footerContainerStyles = "display: flex; flex: 1; flex-wrap: wrap; justify-content: center;";
10672
- VisaSRCStyles.footerTextStyles = "text-align: center; color: #666666; margin: 2px 0;";
10673
- VisaSRCStyles.verticalLineStyle = "display: inline-block; padding: 0.5px; background-color: #E5E5E5; height: 15px;";
10674
- VisaSRCStyles.clickToPayAllCardsStyle = "height: 17px; margin-left: 8px; vertical-align: middle; padding-top: 3px;";
10675
- // TODO: Remind to add in docs that if merchant's div is smaller than 240px the button styles will broke
10676
-
10677
10232
  /**
10678
10233
  * List of available event's name in the SRC checkout lifecycle
10679
10234
  * @enum EVENT
10680
10235
  *
10681
10236
  * @type {object}
10682
- * @param {string} CHECKOUT_BUTTON_LOADED=checkoutButtonLoaded
10683
- * @param {string} CHECKOUT_BUTTON_CLICKED=checkoutButtonClicked
10684
- * @param {string} IFRAME_LOADED=iframeLoaded
10685
- * @param {string} CHECKOUT_READY=checkoutReady
10686
- * @param {string} CHECKOUT_COMPLETED=checkoutCompleted
10687
- * @param {string} CHECKOUT_ERROR=checkoutError
10237
+ * @param {string} IFRAME_LOADED=iframeLoaded Initial event sent when IFrame is initially loaded.
10238
+ * @param {string} CHECKOUT_READY=checkoutReady Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout).
10239
+ * @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when SRC Checkout flow is started, regardless of embedded or windowed mode.
10240
+ * @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when SRC Checkout flow is closed, regardless of embedded or windowed mode.
10241
+ * @param {string} CHECKOUT_COMPLETED=checkoutCompleted Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information.
10242
+ * @param {string} CHECKOUT_ERROR=checkoutError Event sent on error checkout by customer. Check [data](#EventData) for more information.
10688
10243
  */
10689
10244
  var EVENT$2;
10690
10245
  (function (EVENT) {
10691
- EVENT["CHECKOUT_BUTTON_LOADED"] = "checkoutButtonLoaded";
10692
- EVENT["CHECKOUT_BUTTON_CLICKED"] = "checkoutButtonClicked";
10693
10246
  EVENT["IFRAME_LOADED"] = "iframeLoaded";
10694
10247
  EVENT["CHECKOUT_READY"] = "checkoutReady";
10695
10248
  EVENT["CHECKOUT_COMPLETED"] = "checkoutCompleted";
10696
10249
  EVENT["CHECKOUT_ERROR"] = "checkoutError";
10250
+ EVENT["CHECKOUT_POPUP_OPEN"] = "checkoutPopupOpen";
10251
+ EVENT["CHECKOUT_POPUP_CLOSE"] = "checkoutPopupClose";
10697
10252
  })(EVENT$2 || (EVENT$2 = {}));
10253
+ /**
10254
+ * List of available event data types
10255
+ * @enum EVENT_DATA_TYPE
10256
+ *
10257
+ * @type {object}
10258
+ * @param {string} CRITICAL_ERROR=CriticalError in this error scenario the checkout is understood to be in a non-recoverable state and should be closed by the merchant and give alternate payment options to the user
10259
+ * @param {string} USER_ERROR=UserError in this error scenario the error in likely a user input error and the checkout is in a recoverable state, so the user will be kept within the checkout and can retry the flow
10260
+ * @param {string} SUCCESS=Success
10261
+ */
10262
+ var EVENT_DATA_TYPE;
10263
+ (function (EVENT_DATA_TYPE) {
10264
+ EVENT_DATA_TYPE["CRITICAL_ERROR"] = "CriticalError";
10265
+ EVENT_DATA_TYPE["USER_ERROR"] = "UserError";
10266
+ EVENT_DATA_TYPE["SUCCESS"] = "Success";
10267
+ })(EVENT_DATA_TYPE || (EVENT_DATA_TYPE = {}));
10698
10268
  var STYLE$2 = {
10699
- BUTTON_TEXT_COLOR: 'button_text_color',
10700
- PRIMARY_COLOR: 'primary_color',
10269
+ PRIMARY_BUTTON_COLOR: 'primary_button_color',
10270
+ SECONDARY_BUTTON_COLOR: 'secondary_button_color',
10271
+ PRIMARY_BUTTON_TEXT_COLOR: 'primary_button_text_color',
10272
+ SECONDARY_BUTTON_TEXT_COLOR: 'secondary_button_text_color',
10701
10273
  FONT_FAMILY: 'font_family',
10702
- CARD_SCHEMES: 'card_schemes'
10703
- };
10704
-
10705
- var CARD_SCHEME = {
10706
- VISA: 'visa',
10707
- MASTERCARD: 'mastercard',
10708
- AMEX: 'amex',
10709
- DISCOVER: 'discover'
10710
- };
10711
- var CHEVRON_VMAD_IMG_PATH = '/images/visa-src/Chevron_Large_VMAD.png';
10712
- var CHEVRON_VMA_IMG_PATH = '/images/visa-src/Chevron_Large_VMA.png';
10713
- var CHEVRON_VM_IMG_PATH = '/images/visa-src/Chevron_Large_VM.png';
10714
- var CHEVRON_M_IMG_PATH = '/images/visa-src/Chevron_Large_M.png';
10715
- var CHEVRON_D_IMG_PATH = '/images/visa-src/Chevron_Large_D.png';
10716
- var CHEVRON_V_IMG_PATH = '/images/visa-src/Chevron_Large_V.png';
10717
- var VMAD_IMG_PATH = '/images/visa-src/vmad.svg';
10718
- var VMA_IMG_PATH = '/images/visa-src/logos/Networks_Large_VMA.png';
10719
- var VM_IMG_PATH = '/images/visa-src/logos/Networks_Large_VM.png';
10720
- var M_IMG_PATH = '/images/visa-src/logos/master-logo.png';
10721
- var D_IMG_PATH = '/images/visa-src/logos/Networks_Large_D.png';
10722
- var V_IMG_PATH = '/images/visa-src/logos/visa-logo.png';
10723
- var GenerateCardSchemesLogo = function GenerateCardSchemesLogo(card_scheme) {
10724
- var chevron = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
10725
- if (!card_scheme || !Array.isArray(card_scheme)) return chevron ? CHEVRON_VMAD_IMG_PATH : VMAD_IMG_PATH;
10726
- var card_scheme_sort = card_scheme.sort();
10727
- if (includeArray([CARD_SCHEME.AMEX, CARD_SCHEME.MASTERCARD, CARD_SCHEME.VISA], card_scheme_sort)) return chevron ? CHEVRON_VMA_IMG_PATH : VMA_IMG_PATH;
10728
- if (includeArray([CARD_SCHEME.MASTERCARD, CARD_SCHEME.VISA], card_scheme_sort)) return chevron ? CHEVRON_VM_IMG_PATH : VM_IMG_PATH;
10729
- if (includeArray([CARD_SCHEME.MASTERCARD], card_scheme_sort)) return chevron ? CHEVRON_M_IMG_PATH : M_IMG_PATH;
10730
- if (includeArray([CARD_SCHEME.DISCOVER], card_scheme_sort)) return chevron ? CHEVRON_D_IMG_PATH : D_IMG_PATH;
10731
- if (includeArray([CARD_SCHEME.VISA], card_scheme_sort)) return chevron ? CHEVRON_V_IMG_PATH : V_IMG_PATH;
10732
- return chevron ? CHEVRON_V_IMG_PATH : VMAD_IMG_PATH;
10733
- };
10734
- var includeArray = function includeArray(condition, card_scheme) {
10735
- return condition.every(function (card, index) {
10736
- return card === card_scheme[index];
10737
- });
10274
+ ENABLE_SRC_POPUP: 'enable_src_popup'
10738
10275
  };
10739
10276
 
10740
- var VisaSRC = /*#__PURE__*/function () {
10741
- function VisaSRC(button_selector, iframe_selector, service_id, public_key, meta, eventEmitter, autoResize, env, alias) {
10742
- _classCallCheck(this, VisaSRC);
10277
+ var MastercardSRC = /*#__PURE__*/function () {
10278
+ function MastercardSRC(iframe_selector, service_id, public_key, meta, eventEmitter, autoResize, env, alias) {
10279
+ _classCallCheck(this, MastercardSRC);
10743
10280
  this.meta = meta;
10744
10281
  this.eventEmitter = eventEmitter;
10745
10282
  this.autoResize = autoResize;
10746
- this.link = new Link(VISA_SRC);
10283
+ this.link = new Link(MASTERCARD_SRC);
10747
10284
  this.link.setParams(_extends({
10748
10285
  service_id: service_id,
10749
10286
  public_key: public_key
@@ -10759,15 +10296,15 @@
10759
10296
  if (env) this.link.setEnv(env, alias);
10760
10297
  this.iFrameContainer = new Container(iframe_selector);
10761
10298
  this.iFrame = new IFrame(this.iFrameContainer);
10762
- this.buttonContainer = new Container(button_selector);
10763
10299
  this.iFrameEvent = new IFrameEvent(window);
10764
10300
  this.setupIFrameEvents();
10765
10301
  }
10766
- _createClass(VisaSRC, [{
10302
+ _createClass(MastercardSRC, [{
10767
10303
  key: "setupIFrameEvents",
10768
10304
  value: function setupIFrameEvents() {
10769
10305
  var _this = this;
10770
10306
  var widgetId = this.link.getParams().widget_id;
10307
+ if (!widgetId) return;
10771
10308
  this.iFrameEvent.on(EVENT$2.CHECKOUT_READY, widgetId, function (_ref) {
10772
10309
  var data = _ref.data;
10773
10310
  _this.eventEmitter.emit(EVENT$2.CHECKOUT_READY, data);
@@ -10776,8 +10313,16 @@
10776
10313
  var data = _ref2.data;
10777
10314
  _this.eventEmitter.emit(EVENT$2.CHECKOUT_COMPLETED, data);
10778
10315
  });
10779
- this.iFrameEvent.on(EVENT$2.CHECKOUT_ERROR, widgetId, function (_ref3) {
10316
+ this.iFrameEvent.on(EVENT$2.CHECKOUT_POPUP_OPEN, widgetId, function (_ref3) {
10780
10317
  var data = _ref3.data;
10318
+ _this.eventEmitter.emit(EVENT$2.CHECKOUT_POPUP_OPEN, data);
10319
+ });
10320
+ this.iFrameEvent.on(EVENT$2.CHECKOUT_POPUP_CLOSE, widgetId, function (_ref4) {
10321
+ var data = _ref4.data;
10322
+ _this.eventEmitter.emit(EVENT$2.CHECKOUT_POPUP_CLOSE, data);
10323
+ });
10324
+ this.iFrameEvent.on(EVENT$2.CHECKOUT_ERROR, widgetId, function (_ref5) {
10325
+ var data = _ref5.data;
10781
10326
  _this.eventEmitter.emit(EVENT$2.CHECKOUT_ERROR, data);
10782
10327
  });
10783
10328
  if (this.autoResize) this.useAutoResize(true);
@@ -10786,55 +10331,20 @@
10786
10331
  key: "load",
10787
10332
  value: function load() {
10788
10333
  var _this2 = this;
10789
- var _a;
10790
- var container = document.createElement('div');
10791
- container.setAttribute('style', VisaSRCStyles.buttonContainerStyles);
10792
- var checkoutButton = document.createElement('button');
10793
- checkoutButton.setAttribute('style', VisaSRCStyles.buttonStyles);
10794
- if (this.meta.customizations.primary_color) checkoutButton.style.backgroundColor = this.meta.customizations.primary_color;
10795
- if (this.meta.customizations.button_text_color) checkoutButton.style.color = this.meta.customizations.button_text_color;
10796
- checkoutButton.innerHTML = 'Checkout';
10797
- var footerContainer = document.createElement('div');
10798
- footerContainer.setAttribute('style', VisaSRCStyles.footerContainerStyles);
10799
- var verticalLine = document.createElement('div');
10800
- verticalLine.setAttribute('style', VisaSRCStyles.verticalLineStyle);
10801
- var footerText = document.createElement('p');
10802
- footerText.setAttribute('style', VisaSRCStyles.footerTextStyles);
10803
- footerText.innerHTML = 'WE ACCEPT';
10804
- var clickToPayAllCards = document.createElement('img');
10805
- clickToPayAllCards.setAttribute('style', VisaSRCStyles.clickToPayAllCardsStyle);
10806
- clickToPayAllCards.src = this.link.getBaseUrl() + "".concat(GenerateCardSchemesLogo((_a = this.meta.customizations) === null || _a === void 0 ? void 0 : _a.card_schemes, true));
10807
- checkoutButton.onclick = function () {
10808
- _this2.eventEmitter.emit(EVENT$2.CHECKOUT_BUTTON_CLICKED, {});
10809
- _this2.iFrame.load(_this2.link.getUrl(), {
10810
- title: 'Visa SRC checkout'
10811
- });
10812
- _this2.iFrame.getElement().onload = function () {
10813
- return _this2.eventEmitter.emit(EVENT$2.IFRAME_LOADED, {});
10814
- };
10334
+ this.iFrame.load(this.link.getUrl(), {
10335
+ title: 'Mastercard SRC checkout'
10336
+ });
10337
+ var iframeElement = this.iFrame.getElement();
10338
+ this.iFrame.setStyle('width', '100%');
10339
+ if (iframeElement) iframeElement.onload = function () {
10340
+ return _this2.eventEmitter.emit(EVENT$2.IFRAME_LOADED, {});
10815
10341
  };
10816
- container.appendChild(checkoutButton);
10817
- container.appendChild(footerContainer);
10818
- footerContainer.appendChild(footerText);
10819
- footerContainer.appendChild(clickToPayAllCards);
10820
- this.buttonContainer.getElement().appendChild(container);
10821
- this.eventEmitter.emit(EVENT$2.CHECKOUT_BUTTON_LOADED, {});
10822
10342
  }
10823
10343
  }, {
10824
10344
  key: "getEnv",
10825
10345
  value: function getEnv() {
10826
10346
  return this.link.getEnv();
10827
10347
  }
10828
- }, {
10829
- key: "hideButton",
10830
- value: function hideButton(_saveSize) {
10831
- if (this.buttonContainer.getElement()) this.buttonContainer.getElement().style['display'] = 'none';
10832
- }
10833
- }, {
10834
- key: "showButton",
10835
- value: function showButton() {
10836
- if (this.buttonContainer.getElement()) this.buttonContainer.getElement().style['display'] = 'block';
10837
- }
10838
10348
  }, {
10839
10349
  key: "hideCheckout",
10840
10350
  value: function hideCheckout(saveSize) {
@@ -10857,83 +10367,25 @@
10857
10367
  var _this3 = this;
10858
10368
  if (this.autoResize && !force) return;
10859
10369
  this.autoResize = true;
10860
- this.iFrameEvent.on('resize', this.link.getParams().widget_id, function (_ref4) {
10861
- var data = _ref4.data;
10862
- if (_this3.iFrame.getElement()) {
10863
- _this3.iFrame.getElement().scrolling = 'no';
10864
- if (data.height) _this3.iFrame.setStyle('height', data.height + 'px');
10370
+ var params = this.link.getParams();
10371
+ if (!(params === null || params === void 0 ? void 0 : params.widget_id)) return;
10372
+ this.iFrameEvent.on('resize', params.widget_id, function (_ref6) {
10373
+ var data = _ref6.data;
10374
+ var _a, _b;
10375
+ var iframeElement = _this3.iFrame.getElement();
10376
+ if (iframeElement) {
10377
+ iframeElement.scrolling = 'no';
10378
+ if ((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.height) _this3.iFrame.setStyle('height', ((_b = data === null || data === void 0 ? void 0 : data.data) === null || _b === void 0 ? void 0 : _b.height) + 'px');
10865
10379
  }
10866
10380
  });
10867
10381
  }
10868
10382
  }]);
10869
- return VisaSRC;
10383
+ return MastercardSRC;
10870
10384
  }();
10871
10385
 
10872
- /**
10873
- * Interface of data used for the Visa Checkout.
10874
- * @interface IVisaSRCMeta
10875
- *
10876
- * @type {object}
10877
- * @param {string} [srci_transaction_id] Used to identify the SRC Id.
10878
- * @param {object} [dpa_data] Object where the DPA creation data is stored.
10879
- * @param {string} [dpa_data.dpa_presentation_name] Name in which the DPA is presented in.
10880
- * @param {string} [dpa_data.dpa_uri] Used for indicating the DPA URI.
10881
- * @param {object} [dpa_transaction_options] Object that stores options for creating a trasaction with DPA.
10882
- * @param {string} [dpa_transaction_options.dpa_locale] DPA’s preferred locale, example en_US.
10883
- * @param {Array} [dpa_transaction_options.dpa_accepted_billing_countries] Used to indicate list of accepted billing countries for DPA.
10884
- * @param {Array} [dpa_transaction_options.dpa_accepted_shipping_countries] Used to indicate list of accepted shipping countries for DPA.
10885
- * @param {string} [dpa_transaction_options.dpa_billing_preference] Used for listing the enumeration for billing preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'.
10886
- * @param {string} [dpa_transaction_options.dpa_shipping_preference] Used for listing the enumeration for shipping preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'.
10887
- * @param {boolean} [dpa_transaction_options.consumer_name_requested] Used to check if the name of the consumer is needed.
10888
- * @param {boolean} [dpa_transaction_options.consumer_email_address_requested] Used to check if the email of the consumer is needed.
10889
- * @param {boolean} [dpa_transaction_options.consumer_phone_number_requested] Used to check if the phone number of the consumer is needed.
10890
- * @param {object} [dpa_transaction_options.payment_options] Object used to check the payment options that are included.
10891
- * @param {number} [dpa_transaction_options.payment_options.dpa_dynamic_data_ttl_minutes] The minimum requested validity period for the transaction credentials.
10892
- * @param {string} [dpa_transaction_options.payment_options.dynamic_data_type] Used for listing the enumeration for dynamic data types. Options are 'TAVV' and 'DTVV'.
10893
- * @param {boolean} [dpa_transaction_options.payment_options.dpa_pan_requested] Used to check if PAN number was requested.
10894
- * @param {string} [dpa_transaction_options.review_action] Used for listing the enumeration of review actions. Options are 'pay' and 'continue'.
10895
- * @param {string} [dpa_transaction_options.checkout_description] Used for indicating the description of the checkout.
10896
- * @param {string} [dpa_transaction_options.transaction_type] Used for listing the enumeration of the type of the transaction. 'PURCHASE', 'BILL_PAYMENT' and 'MONEY_TRANSFER'
10897
- * @param {string} [dpa_transaction_options.order_type] Used for listing the enumeration of the type of the order. Options are 'REAUTHORIZATION', 'RECURRING' and 'INSTALLMENT'.
10898
- * @param {object} [dpa_transaction_options.transaction_amount] Object used to describe the details of the transaction.
10899
- * @param {number} [dpa_transaction_options.transaction_amount.transaction_amount] Used to indicate the amount of the transaction.
10900
- * @param {string} [dpa_transaction_options.transaction_amount.transaction_currency_code] Used to indicate the currency code of the transaction. 3 letter ISO code format.
10901
- * @param {string} [dpa_transaction_options.merchant_order_id] Used to indicate the merchants order Id.
10902
- * @param {string} [dpa_transaction_options.merchant_category_code] Used to indicate the merchants category code.
10903
- * @param {string} [dpa_transaction_options.merchant_country_code] Used to indicate the merchants country code. 2 letter ISO code format.
10904
- * @param {object} [customer] Object where the customer data is stored to prefill in the checkout.
10905
- * @param {string} [customer.email] Customer email.
10906
- * @param {string} [customer.first_name] Customer first name.
10907
- * @param {string} [customer.last_name] Customer last name.
10908
- * @param {object} [customer.phone] Object where the customer phone is stored.
10909
- * @param {string} [customer.phone.country_code] Customer phone country code (example "1" for US).
10910
- * @param {string} [customer.phone.phone] Customer phone number.
10911
- * @param {object} [customer.payment_source] Object where the customer billing address data is stored.
10912
- * @param {string} [customer.payment_source.address_line1] Customer billing address line 1.
10913
- * @param {string} [customer.payment_source.address_line2] Customer billing address line 2.
10914
- * @param {string} [customer.payment_source.address_city] Customer billing address city.
10915
- * @param {string} [customer.payment_source.address_postcode] Customer billing address postcode.
10916
- * @param {string} [customer.payment_source.address_state] Customer billing address state code (if applicable for the country, example "FL" for Florida).
10917
- * @param {string} [customer.payment_source.address_country] Customer billing address country code (example "US").
10918
- */
10919
- /**
10920
- * Class SRC include methods for interacting with different secure remote commerce options such as Visa SRC
10921
- * @constructor
10922
- *
10923
- * @param {string} button_selector - Selector of html element. Container for SRC checkout button.
10924
- * @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
10925
- * @param {string} service_id - Card Scheme Service ID
10926
- * @param {string} public_key_or_access_token - Paydock public key or Access Token
10927
- * @param {IVisaSRCMeta} meta - Data that configures the SRC checkout
10928
- * @example
10929
- * var SRC = new SRC('#checkoutButton', '#checkoutIframe', 'service_id', 'public_key', {});
10930
- *
10931
- */
10932
10386
  var SRC = /*#__PURE__*/function () {
10933
- /** @constructs */ // constructs added for correct parse classes jsdoc2md
10934
- function SRC(button_selector, iframe_selector, service_id, public_key_or_access_token, meta) {
10387
+ function SRC(iframe_selector, service_id, public_key_or_access_token, meta) {
10935
10388
  _classCallCheck(this, SRC);
10936
- this.button_selector = button_selector;
10937
10389
  this.iframe_selector = iframe_selector;
10938
10390
  this.service_id = service_id;
10939
10391
  this.public_key_or_access_token = public_key_or_access_token;
@@ -10948,11 +10400,13 @@
10948
10400
  *
10949
10401
  * @example
10950
10402
  * widget.setStyles({
10951
- * button_text_color: '#32a852',
10952
- * primary_color: '#32a852',
10953
- * font_family: 'sans-serif',
10954
- * card_schemes: ['visa']
10955
- * });
10403
+ * enable_src_popup: true
10404
+ * primary_button_color: 'red',
10405
+ * secondary_button_color: 'blue',
10406
+ * primary_button_text_color: 'white',
10407
+ * secondary_button_text_color: 'white',
10408
+ * font_family: 'Arial',
10409
+ * });
10956
10410
  * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
10957
10411
  */
10958
10412
  _createClass(SRC, [{
@@ -10967,10 +10421,6 @@
10967
10421
  value: function setStyle(param, value) {
10968
10422
  if (ObjectHelper.values(STYLE$2).indexOf(param) !== -1) this.style[param] = value;else console.warn("Widget::setStyle[s: unsupported style param ".concat(param));
10969
10423
  }
10970
- /**
10971
- * The final method after configuring the SRC to start the load process of SRC checkout
10972
- *
10973
- */
10974
10424
  }, {
10975
10425
  key: "load",
10976
10426
  value: function load() {
@@ -10980,8 +10430,8 @@
10980
10430
  var type = _ref.type;
10981
10431
  _this.meta.customizations = _this.style; // assign the style on the start of the widget
10982
10432
  switch (type) {
10983
- case CARD_SCHEME_SERVICE.VISA_SRC:
10984
- _this.provider = new VisaSRC(_this.button_selector, _this.iframe_selector, _this.service_id, _this.public_key_or_access_token, _this.meta, _this.eventEmitter, _this.autoResize, _this.env, _this.alias);
10433
+ case CARD_SCHEME_SERVICE.MASTERCARD_SRC:
10434
+ _this.provider = new MastercardSRC(_this.iframe_selector, _this.service_id, _this.public_key_or_access_token, _this.meta, _this.eventEmitter, _this.autoResize, _this.env, _this.alias);
10985
10435
  break;
10986
10436
  }
10987
10437
  if (_this.provider) _this.provider.load();
@@ -11027,8 +10477,9 @@
11027
10477
  * SRC.on('checkoutCompleted').then(function (token) {
11028
10478
  * console.log(token);
11029
10479
  * });
10480
+ *
11030
10481
  * @param {string} eventName - Available event names [EVENT]{@link EVENT}
11031
- * @param {listener} [cb]
10482
+ * @param {listener} [cb] - The callback to handle the event. When available, it will send back data of type [EventData]{@link EventData}
11032
10483
  * @return {Promise<any> | void}
11033
10484
  */
11034
10485
  }, {
@@ -11042,29 +10493,6 @@
11042
10493
  });
11043
10494
  });
11044
10495
  }
11045
- /**
11046
- * Using this method you can hide button
11047
- * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
11048
- *
11049
- * @example
11050
- * SRC.hideButton();
11051
- */
11052
- }, {
11053
- key: "hideButton",
11054
- value: function hideButton(saveSize) {
11055
- if (this.provider && typeof this.provider.hideButton === 'function') this.provider.hideButton(saveSize);
11056
- }
11057
- /**
11058
- * Using this method you can show the SRC button after using hideButton method
11059
- *
11060
- * @example
11061
- * SRC.showButton();
11062
- */
11063
- }, {
11064
- key: "showButton",
11065
- value: function showButton() {
11066
- if (this.provider && typeof this.provider.showButton === 'function') this.provider.showButton();
11067
- }
11068
10496
  /**
11069
10497
  * Using this method you can hide checkout after load and button click
11070
10498
  * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
@@ -11116,6 +10544,51 @@
11116
10544
  return SRC;
11117
10545
  }();
11118
10546
 
10547
+ /**
10548
+ * Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option
10549
+ *
10550
+ * @extends SRC
10551
+ *
10552
+ * @constructor
10553
+ *
10554
+ * @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
10555
+ * @param {string} service_id - Card Scheme Service ID
10556
+ * @param {string} public_key_or_access_token - Paydock public key or Access Token
10557
+ * @param {IMastercardSRCMeta} meta - Data that configures the SRC checkout
10558
+ * @example
10559
+ * var mastercardSRC = new MastercardSRCClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
10560
+ *
10561
+ */
10562
+ var MastercardSRCClickToPay = /*#__PURE__*/function (_SRC) {
10563
+ _inherits(MastercardSRCClickToPay, _SRC);
10564
+ var _super = _createSuper(MastercardSRCClickToPay);
10565
+ /** @constructs */ // constructs added for correct parse classes jsdoc2md
10566
+ function MastercardSRCClickToPay(iframe_selector, service_id, public_key_or_access_token, meta) {
10567
+ var _this;
10568
+ _classCallCheck(this, MastercardSRCClickToPay);
10569
+ _this = _super.call(this, iframe_selector, service_id, public_key_or_access_token, meta);
10570
+ _this.iframe_selector = iframe_selector;
10571
+ _this.service_id = service_id;
10572
+ _this.public_key_or_access_token = public_key_or_access_token;
10573
+ _this.meta = meta;
10574
+ return _this;
10575
+ }
10576
+ /**
10577
+ * The final method after configuring the SRC to start the load process of SRC checkout
10578
+ *
10579
+ */
10580
+ _createClass(MastercardSRCClickToPay, [{
10581
+ key: "load",
10582
+ value: function load() {
10583
+ if (this.provider) return;
10584
+ this.meta.customizations = this.style;
10585
+ this.provider = new MastercardSRC(this.iframe_selector, this.service_id, this.public_key_or_access_token, this.meta, this.eventEmitter, this.autoResize, this.env, this.alias);
10586
+ this.provider.load();
10587
+ }
10588
+ }]);
10589
+ return MastercardSRCClickToPay;
10590
+ }(SRC);
10591
+
11119
10592
  exports.AfterpayCheckoutButton = AfterpayCheckoutButton;
11120
10593
  exports.Api = Api;
11121
10594
  exports.CHECKOUT_BUTTON_EVENT = CHECKOUT_BUTTON_EVENT;
@@ -11129,13 +10602,13 @@
11129
10602
  exports.HtmlMultiWidget = HtmlMultiWidget;
11130
10603
  exports.HtmlPaymentSourceWidget = HtmlPaymentSourceWidget;
11131
10604
  exports.HtmlWidget = HtmlWidget;
10605
+ exports.MastercardSRCClickToPay = MastercardSRCClickToPay;
11132
10606
  exports.MultiWidget = MultiWidget;
11133
10607
  exports.PAYMENT_TYPE = PAYMENT_TYPE;
11134
10608
  exports.PURPOSE = PURPOSE;
11135
10609
  exports.PaymentSourceBuilder = Builder$1;
11136
10610
  exports.PaymentSourceWidget = PaymentSourceWidget;
11137
10611
  exports.PaypalCheckoutButton = PaypalCheckoutButton;
11138
- exports.SRC = SRC;
11139
10612
  exports.STYLABLE_ELEMENT = STYLABLE_ELEMENT;
11140
10613
  exports.STYLABLE_ELEMENT_STATE = STYLABLE_ELEMENT_STATE;
11141
10614
  exports.STYLE = STYLE;