@one-payments/web-components 1.6.4 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +388 -311
- package/dist/one-payment.d.ts +2 -0
- package/dist/one-payment.d.ts.map +1 -1
- package/dist/one-payment.js +91 -2
- package/dist/one-payment.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const yt = globalThis, qt = yt.ShadowRoot && (yt.ShadyCSS === void 0 || yt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
|
6
|
+
const yt = globalThis, qt = yt.ShadowRoot && (yt.ShadyCSS === void 0 || yt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Yt = Symbol(), Wt = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
let he = class {
|
|
8
8
|
constructor(t, r, i) {
|
|
9
|
-
if (this._$cssResult$ = !0, i !==
|
|
9
|
+
if (this._$cssResult$ = !0, i !== Yt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
10
|
this.cssText = t, this.t = r;
|
|
11
11
|
}
|
|
12
12
|
get styleSheet() {
|
|
@@ -14,7 +14,7 @@ let he = class {
|
|
|
14
14
|
const r = this.t;
|
|
15
15
|
if (qt && t === void 0) {
|
|
16
16
|
const i = r !== void 0 && r.length === 1;
|
|
17
|
-
i && (t =
|
|
17
|
+
i && (t = Wt.get(r)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Wt.set(r, t));
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
}
|
|
@@ -22,13 +22,13 @@ let he = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const Le = (e) => new he(typeof e == "string" ? e : e + "", void 0,
|
|
25
|
+
const Le = (e) => new he(typeof e == "string" ? e : e + "", void 0, Yt), Be = (e, ...t) => {
|
|
26
26
|
const r = e.length === 1 ? e[0] : t.reduce((i, n, s) => i + ((o) => {
|
|
27
27
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
28
28
|
if (typeof o == "number") return o;
|
|
29
29
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
30
30
|
})(n) + e[s + 1], e[0]);
|
|
31
|
-
return new he(r, e,
|
|
31
|
+
return new he(r, e, Yt);
|
|
32
32
|
}, Ue = (e, t) => {
|
|
33
33
|
if (qt) e.adoptedStyleSheets = t.map((r) => r instanceof CSSStyleSheet ? r : r.styleSheet);
|
|
34
34
|
else for (const r of t) {
|
|
@@ -45,7 +45,7 @@ const Le = (e) => new he(typeof e == "string" ? e : e + "", void 0, Ht), Be = (e
|
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is: Fe, defineProperty: Oe, getOwnPropertyDescriptor: ze, getOwnPropertyNames: qe, getOwnPropertySymbols:
|
|
48
|
+
const { is: Fe, defineProperty: Oe, getOwnPropertyDescriptor: ze, getOwnPropertyNames: qe, getOwnPropertySymbols: Ye, getPrototypeOf: He } = Object, z = globalThis, Xt = z.trustedTypes, Ve = Xt ? Xt.emptyScript : "", Et = z.reactiveElementPolyfillSupport, nt = (e, t) => e, bt = { toAttribute(e, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
e = e ? Ve : null;
|
|
@@ -73,7 +73,7 @@ const { is: Fe, defineProperty: Oe, getOwnPropertyDescriptor: ze, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return r;
|
|
76
|
-
} },
|
|
76
|
+
} }, Ht = (e, t) => !Fe(e, t), te = { attribute: !0, type: String, converter: bt, reflect: !1, useDefault: !1, hasChanged: Ht };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), z.litPropertyMetadata ?? (z.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
78
|
let G = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
@@ -104,13 +104,13 @@ let G = class extends HTMLElement {
|
|
|
104
104
|
}
|
|
105
105
|
static _$Ei() {
|
|
106
106
|
if (this.hasOwnProperty(nt("elementProperties"))) return;
|
|
107
|
-
const t =
|
|
107
|
+
const t = He(this);
|
|
108
108
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
109
109
|
}
|
|
110
110
|
static finalize() {
|
|
111
111
|
if (this.hasOwnProperty(nt("finalized"))) return;
|
|
112
112
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(nt("properties"))) {
|
|
113
|
-
const r = this.properties, i = [...qe(r), ...
|
|
113
|
+
const r = this.properties, i = [...qe(r), ...Ye(r)];
|
|
114
114
|
for (const n of i) this.createProperty(n, r[n]);
|
|
115
115
|
}
|
|
116
116
|
const t = this[Symbol.metadata];
|
|
@@ -202,7 +202,7 @@ let G = class extends HTMLElement {
|
|
|
202
202
|
var n;
|
|
203
203
|
if (t !== void 0) {
|
|
204
204
|
const s = this.constructor, o = this[t];
|
|
205
|
-
if (i ?? (i = s.getPropertyOptions(t)), !((i.hasChanged ??
|
|
205
|
+
if (i ?? (i = s.getPropertyOptions(t)), !((i.hasChanged ?? Ht)(o, r) || i.useDefault && i.reflect && o === ((n = this._$Ej) == null ? void 0 : n.get(t)) && !this.hasAttribute(s._$Eu(t, i)))) return;
|
|
206
206
|
this.C(t, r, i);
|
|
207
207
|
}
|
|
208
208
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -284,9 +284,9 @@ G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[nt("elementPrope
|
|
|
284
284
|
* Copyright 2017 Google LLC
|
|
285
285
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
286
286
|
*/
|
|
287
|
-
const st = globalThis, vt = st.trustedTypes, ee = vt ? vt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pe = "$lit$", F = `lit$${Math.random().toFixed(9).slice(2)}$`, me = "?" + F, je = `<${me}>`, K = document, lt = () => K.createComment(""), ct = (e) => e === null || typeof e != "object" && typeof e != "function", Vt = Array.isArray, Ke = (e) => Vt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function",
|
|
288
|
-
\f\r]`, it = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, re = /-->/g, ie = />/g,
|
|
289
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, se = /"/g, fe = /^(?:script|style|textarea|title)$/i, Ge = (e) => (t, ...r) => ({ _$litType$: e, strings: t, values: r }), g = Ge(1),
|
|
287
|
+
const st = globalThis, vt = st.trustedTypes, ee = vt ? vt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pe = "$lit$", F = `lit$${Math.random().toFixed(9).slice(2)}$`, me = "?" + F, je = `<${me}>`, K = document, lt = () => K.createComment(""), ct = (e) => e === null || typeof e != "object" && typeof e != "function", Vt = Array.isArray, Ke = (e) => Vt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Nt = `[
|
|
288
|
+
\f\r]`, it = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, re = /-->/g, ie = />/g, Y = RegExp(`>|${Nt}(?:([^\\s"'>=/]+)(${Nt}*=${Nt}*(?:[^
|
|
289
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, se = /"/g, fe = /^(?:script|style|textarea|title)$/i, Ge = (e) => (t, ...r) => ({ _$litType$: e, strings: t, values: r }), g = Ge(1), J = Symbol.for("lit-noChange"), N = Symbol.for("lit-nothing"), oe = /* @__PURE__ */ new WeakMap(), H = K.createTreeWalker(K, 129);
|
|
290
290
|
function ge(e, t) {
|
|
291
291
|
if (!Vt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
292
292
|
return ee !== void 0 ? ee.createHTML(t) : t;
|
|
@@ -297,8 +297,8 @@ const Qe = (e, t) => {
|
|
|
297
297
|
for (let l = 0; l < r; l++) {
|
|
298
298
|
const a = e[l];
|
|
299
299
|
let c, d, h = -1, p = 0;
|
|
300
|
-
for (; p < a.length && (o.lastIndex = p, d = o.exec(a), d !== null); ) p = o.lastIndex, o === it ? d[1] === "!--" ? o = re : d[1] !== void 0 ? o = ie : d[2] !== void 0 ? (fe.test(d[2]) && (n = RegExp("</" + d[2], "g")), o =
|
|
301
|
-
const u = o ===
|
|
300
|
+
for (; p < a.length && (o.lastIndex = p, d = o.exec(a), d !== null); ) p = o.lastIndex, o === it ? d[1] === "!--" ? o = re : d[1] !== void 0 ? o = ie : d[2] !== void 0 ? (fe.test(d[2]) && (n = RegExp("</" + d[2], "g")), o = Y) : d[3] !== void 0 && (o = Y) : o === Y ? d[0] === ">" ? (o = n ?? it, h = -1) : d[1] === void 0 ? h = -2 : (h = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? Y : d[3] === '"' ? se : ne) : o === se || o === ne ? o = Y : o === re || o === ie ? o = it : (o = Y, n = void 0);
|
|
301
|
+
const u = o === Y && e[l + 1].startsWith("/>") ? " " : "";
|
|
302
302
|
s += o === it ? a + je : h >= 0 ? (i.push(c), a.slice(0, h) + pe + a.slice(h) + F + u) : a + F + (h === -2 ? l : u);
|
|
303
303
|
}
|
|
304
304
|
return [ge(e, s + (e[r] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
@@ -309,21 +309,21 @@ class dt {
|
|
|
309
309
|
this.parts = [];
|
|
310
310
|
let s = 0, o = 0;
|
|
311
311
|
const l = t.length - 1, a = this.parts, [c, d] = Qe(t, r);
|
|
312
|
-
if (this.el = dt.createElement(c, i),
|
|
312
|
+
if (this.el = dt.createElement(c, i), H.currentNode = this.el.content, r === 2 || r === 3) {
|
|
313
313
|
const h = this.el.content.firstChild;
|
|
314
314
|
h.replaceWith(...h.childNodes);
|
|
315
315
|
}
|
|
316
|
-
for (; (n =
|
|
316
|
+
for (; (n = H.nextNode()) !== null && a.length < l; ) {
|
|
317
317
|
if (n.nodeType === 1) {
|
|
318
318
|
if (n.hasAttributes()) for (const h of n.getAttributeNames()) if (h.endsWith(pe)) {
|
|
319
|
-
const p = d[o++], u = n.getAttribute(h).split(F),
|
|
320
|
-
a.push({ type: 1, index: s, name:
|
|
319
|
+
const p = d[o++], u = n.getAttribute(h).split(F), f = /([.?@])?(.*)/.exec(p);
|
|
320
|
+
a.push({ type: 1, index: s, name: f[2], strings: u, ctor: f[1] === "." ? We : f[1] === "?" ? Ze : f[1] === "@" ? Xe : St }), n.removeAttribute(h);
|
|
321
321
|
} else h.startsWith(F) && (a.push({ type: 6, index: s }), n.removeAttribute(h));
|
|
322
322
|
if (fe.test(n.tagName)) {
|
|
323
323
|
const h = n.textContent.split(F), p = h.length - 1;
|
|
324
324
|
if (p > 0) {
|
|
325
325
|
n.textContent = vt ? vt.emptyScript : "";
|
|
326
|
-
for (let u = 0; u < p; u++) n.append(h[u], lt()),
|
|
326
|
+
for (let u = 0; u < p; u++) n.append(h[u], lt()), H.nextNode(), a.push({ type: 2, index: ++s });
|
|
327
327
|
n.append(h[p], lt());
|
|
328
328
|
}
|
|
329
329
|
}
|
|
@@ -340,14 +340,14 @@ class dt {
|
|
|
340
340
|
return i.innerHTML = t, i;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function W(e, t, r = e, i) {
|
|
344
344
|
var o, l;
|
|
345
|
-
if (t ===
|
|
345
|
+
if (t === J) return t;
|
|
346
346
|
let n = i !== void 0 ? (o = r._$Co) == null ? void 0 : o[i] : r._$Cl;
|
|
347
347
|
const s = ct(t) ? void 0 : t._$litDirective$;
|
|
348
|
-
return (n == null ? void 0 : n.constructor) !== s && ((l = n == null ? void 0 : n._$AO) == null || l.call(n, !1), s === void 0 ? n = void 0 : (n = new s(e), n._$AT(e, r, i)), i !== void 0 ? (r._$Co ?? (r._$Co = []))[i] = n : r._$Cl = n), n !== void 0 && (t =
|
|
348
|
+
return (n == null ? void 0 : n.constructor) !== s && ((l = n == null ? void 0 : n._$AO) == null || l.call(n, !1), s === void 0 ? n = void 0 : (n = new s(e), n._$AT(e, r, i)), i !== void 0 ? (r._$Co ?? (r._$Co = []))[i] = n : r._$Cl = n), n !== void 0 && (t = W(e, n._$AS(e, t.values), n, i)), t;
|
|
349
349
|
}
|
|
350
|
-
class
|
|
350
|
+
class Je {
|
|
351
351
|
constructor(t, r) {
|
|
352
352
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = r;
|
|
353
353
|
}
|
|
@@ -359,16 +359,16 @@ class We {
|
|
|
359
359
|
}
|
|
360
360
|
u(t) {
|
|
361
361
|
const { el: { content: r }, parts: i } = this._$AD, n = ((t == null ? void 0 : t.creationScope) ?? K).importNode(r, !0);
|
|
362
|
-
|
|
363
|
-
let s =
|
|
362
|
+
H.currentNode = n;
|
|
363
|
+
let s = H.nextNode(), o = 0, l = 0, a = i[0];
|
|
364
364
|
for (; a !== void 0; ) {
|
|
365
365
|
if (o === a.index) {
|
|
366
366
|
let c;
|
|
367
367
|
a.type === 2 ? c = new ht(s, s.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(s, a.name, a.strings, this, t) : a.type === 6 && (c = new tr(s, this, t)), this._$AV.push(c), a = i[++l];
|
|
368
368
|
}
|
|
369
|
-
o !== (a == null ? void 0 : a.index) && (s =
|
|
369
|
+
o !== (a == null ? void 0 : a.index) && (s = H.nextNode(), o++);
|
|
370
370
|
}
|
|
371
|
-
return
|
|
371
|
+
return H.currentNode = K, n;
|
|
372
372
|
}
|
|
373
373
|
p(t) {
|
|
374
374
|
let r = 0;
|
|
@@ -381,7 +381,7 @@ class ht {
|
|
|
381
381
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
382
382
|
}
|
|
383
383
|
constructor(t, r, i, n) {
|
|
384
|
-
this.type = 2, this._$AH =
|
|
384
|
+
this.type = 2, this._$AH = N, this._$AN = void 0, this._$AA = t, this._$AB = r, this._$AM = i, this.options = n, this._$Cv = (n == null ? void 0 : n.isConnected) ?? !0;
|
|
385
385
|
}
|
|
386
386
|
get parentNode() {
|
|
387
387
|
let t = this._$AA.parentNode;
|
|
@@ -395,7 +395,7 @@ class ht {
|
|
|
395
395
|
return this._$AB;
|
|
396
396
|
}
|
|
397
397
|
_$AI(t, r = this) {
|
|
398
|
-
t =
|
|
398
|
+
t = W(this, t, r), ct(t) ? t === N || t == null || t === "" ? (this._$AH !== N && this._$AR(), this._$AH = N) : t !== this._$AH && t !== J && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ke(t) ? this.k(t) : this._(t);
|
|
399
399
|
}
|
|
400
400
|
O(t) {
|
|
401
401
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -404,14 +404,14 @@ class ht {
|
|
|
404
404
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
405
405
|
}
|
|
406
406
|
_(t) {
|
|
407
|
-
this._$AH !==
|
|
407
|
+
this._$AH !== N && ct(this._$AH) ? this._$AA.nextSibling.data = t : this.T(K.createTextNode(t)), this._$AH = t;
|
|
408
408
|
}
|
|
409
409
|
$(t) {
|
|
410
410
|
var s;
|
|
411
411
|
const { values: r, _$litType$: i } = t, n = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = dt.createElement(ge(i.h, i.h[0]), this.options)), i);
|
|
412
412
|
if (((s = this._$AH) == null ? void 0 : s._$AD) === n) this._$AH.p(r);
|
|
413
413
|
else {
|
|
414
|
-
const o = new
|
|
414
|
+
const o = new Je(n, this), l = o.u(this.options);
|
|
415
415
|
o.p(r), this.T(l), this._$AH = o;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -446,29 +446,29 @@ class St {
|
|
|
446
446
|
return this._$AM._$AU;
|
|
447
447
|
}
|
|
448
448
|
constructor(t, r, i, n, s) {
|
|
449
|
-
this.type = 1, this._$AH =
|
|
449
|
+
this.type = 1, this._$AH = N, this._$AN = void 0, this.element = t, this.name = r, this._$AM = n, this.options = s, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = N;
|
|
450
450
|
}
|
|
451
451
|
_$AI(t, r = this, i, n) {
|
|
452
452
|
const s = this.strings;
|
|
453
453
|
let o = !1;
|
|
454
|
-
if (s === void 0) t =
|
|
454
|
+
if (s === void 0) t = W(this, t, r, 0), o = !ct(t) || t !== this._$AH && t !== J, o && (this._$AH = t);
|
|
455
455
|
else {
|
|
456
456
|
const l = t;
|
|
457
457
|
let a, c;
|
|
458
|
-
for (t = s[0], a = 0; a < s.length - 1; a++) c =
|
|
458
|
+
for (t = s[0], a = 0; a < s.length - 1; a++) c = W(this, l[i + a], r, a), c === J && (c = this._$AH[a]), o || (o = !ct(c) || c !== this._$AH[a]), c === N ? t = N : t !== N && (t += (c ?? "") + s[a + 1]), this._$AH[a] = c;
|
|
459
459
|
}
|
|
460
460
|
o && !n && this.j(t);
|
|
461
461
|
}
|
|
462
462
|
j(t) {
|
|
463
|
-
t ===
|
|
463
|
+
t === N ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
class
|
|
466
|
+
class We extends St {
|
|
467
467
|
constructor() {
|
|
468
468
|
super(...arguments), this.type = 3;
|
|
469
469
|
}
|
|
470
470
|
j(t) {
|
|
471
|
-
this.element[this.name] = t ===
|
|
471
|
+
this.element[this.name] = t === N ? void 0 : t;
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
class Ze extends St {
|
|
@@ -476,7 +476,7 @@ class Ze extends St {
|
|
|
476
476
|
super(...arguments), this.type = 4;
|
|
477
477
|
}
|
|
478
478
|
j(t) {
|
|
479
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
479
|
+
this.element.toggleAttribute(this.name, !!t && t !== N);
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
482
|
class Xe extends St {
|
|
@@ -484,8 +484,8 @@ class Xe extends St {
|
|
|
484
484
|
super(t, r, i, n, s), this.type = 5;
|
|
485
485
|
}
|
|
486
486
|
_$AI(t, r = this) {
|
|
487
|
-
if ((t =
|
|
488
|
-
const i = this._$AH, n = t ===
|
|
487
|
+
if ((t = W(this, t, r, 0) ?? N) === J) return;
|
|
488
|
+
const i = this._$AH, n = t === N && i !== N || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, s = t !== N && (i === N || n);
|
|
489
489
|
n && this.element.removeEventListener(this.name, this, i), s && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
490
490
|
}
|
|
491
491
|
handleEvent(t) {
|
|
@@ -501,11 +501,11 @@ class tr {
|
|
|
501
501
|
return this._$AM._$AU;
|
|
502
502
|
}
|
|
503
503
|
_$AI(t) {
|
|
504
|
-
|
|
504
|
+
W(this, t);
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
const
|
|
508
|
-
|
|
507
|
+
const It = st.litHtmlPolyfillSupport;
|
|
508
|
+
It == null || It(dt, ht), (st.litHtmlVersions ?? (st.litHtmlVersions = [])).push("3.3.1");
|
|
509
509
|
const er = (e, t, r) => {
|
|
510
510
|
const i = (r == null ? void 0 : r.renderBefore) ?? t;
|
|
511
511
|
let n = i._$litPart$;
|
|
@@ -543,7 +543,7 @@ class ot extends G {
|
|
|
543
543
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
544
544
|
}
|
|
545
545
|
render() {
|
|
546
|
-
return
|
|
546
|
+
return J;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
var ue;
|
|
@@ -566,7 +566,7 @@ const rr = (e) => (t, r) => {
|
|
|
566
566
|
* Copyright 2017 Google LLC
|
|
567
567
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
568
568
|
*/
|
|
569
|
-
const ir = { attribute: !0, type: String, converter: bt, reflect: !1, hasChanged:
|
|
569
|
+
const ir = { attribute: !0, type: String, converter: bt, reflect: !1, hasChanged: Ht }, nr = (e = ir, t, r) => {
|
|
570
570
|
const { kind: i, metadata: n } = r;
|
|
571
571
|
let s = globalThis.litPropertyMetadata.get(n);
|
|
572
572
|
if (s === void 0 && globalThis.litPropertyMetadata.set(n, s = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), s.set(r.name, e), i === "accessor") {
|
|
@@ -598,13 +598,13 @@ function D(e) {
|
|
|
598
598
|
* Copyright 2017 Google LLC
|
|
599
599
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
600
600
|
*/
|
|
601
|
-
function
|
|
601
|
+
function I(e) {
|
|
602
602
|
return D({ ...e, state: !0, attribute: !1 });
|
|
603
603
|
}
|
|
604
604
|
function sr(e) {
|
|
605
605
|
return e instanceof Error && ("response" in e && typeof e.response == "object" && e.response !== null || "data" in e && typeof e.data == "object" && e.data !== null);
|
|
606
606
|
}
|
|
607
|
-
var
|
|
607
|
+
var m = {
|
|
608
608
|
CARD: "card",
|
|
609
609
|
PAYNOW: "paynow",
|
|
610
610
|
PROMPTPAY: "promptpay",
|
|
@@ -618,7 +618,8 @@ var f = {
|
|
|
618
618
|
ALIPAYCN: "alipaycn",
|
|
619
619
|
ALIPAYHK: "alipayhk",
|
|
620
620
|
GCASH: "gcash",
|
|
621
|
-
KONBINI: "konbini"
|
|
621
|
+
KONBINI: "konbini",
|
|
622
|
+
PAYEASY: "payeasy"
|
|
622
623
|
}, T = {
|
|
623
624
|
IDLE: "idle",
|
|
624
625
|
INITIALIZING: "initializing",
|
|
@@ -961,63 +962,67 @@ var cr = class {
|
|
|
961
962
|
}, d = [];
|
|
962
963
|
let h = 0;
|
|
963
964
|
return a.result.paymentMethods.forEach((p) => {
|
|
964
|
-
const u = p.type.toLowerCase(),
|
|
965
|
+
const u = p.type.toLowerCase(), f = p.capabilities || [];
|
|
965
966
|
u.includes("card") && d.push({
|
|
966
967
|
id: "card",
|
|
967
968
|
enabled: !0,
|
|
968
969
|
priority: h++
|
|
969
|
-
}), (u.includes("paynow") ||
|
|
970
|
+
}), (u.includes("paynow") || f.includes("payments_pay_now")) && d.push({
|
|
970
971
|
id: "paynow",
|
|
971
972
|
enabled: !0,
|
|
972
973
|
priority: h++
|
|
973
|
-
}), (u.includes("promptpay") || u.includes("prompt pay") ||
|
|
974
|
+
}), (u.includes("promptpay") || u.includes("prompt pay") || f.includes("payments_prompt_pay")) && d.push({
|
|
974
975
|
id: "promptpay",
|
|
975
976
|
enabled: !0,
|
|
976
977
|
priority: h++
|
|
977
|
-
}), (u.includes("duitnow") || u.includes("duit now") ||
|
|
978
|
+
}), (u.includes("duitnow") || u.includes("duit now") || f.includes("payments_duit_now")) && d.push({
|
|
978
979
|
id: "duitnow",
|
|
979
980
|
enabled: !0,
|
|
980
981
|
priority: h++
|
|
981
|
-
}), (u.includes("gopay") || u.includes("go pay") ||
|
|
982
|
+
}), (u.includes("gopay") || u.includes("go pay") || f.includes("payments_go_pay")) && d.push({
|
|
982
983
|
id: "gopay",
|
|
983
984
|
enabled: !0,
|
|
984
985
|
priority: h++
|
|
985
|
-
}), (u.includes("boost") ||
|
|
986
|
+
}), (u.includes("boost") || f.includes("payments_boost")) && d.push({
|
|
986
987
|
id: "boost",
|
|
987
988
|
enabled: !0,
|
|
988
989
|
priority: h++
|
|
989
|
-
}), (u.includes("shopeepay") || u.includes("shopee pay") || u.includes("shopee_pay") ||
|
|
990
|
+
}), (u.includes("shopeepay") || u.includes("shopee pay") || u.includes("shopee_pay") || f.includes("payments_shopee_pay")) && d.push({
|
|
990
991
|
id: "shopeepay",
|
|
991
992
|
enabled: !0,
|
|
992
993
|
priority: h++
|
|
993
|
-
}), (u.includes("atom") || u.includes("atome") ||
|
|
994
|
+
}), (u.includes("atom") || u.includes("atome") || f.includes("payments_atome")) && d.push({
|
|
994
995
|
id: "atom",
|
|
995
996
|
enabled: !0,
|
|
996
997
|
priority: h++
|
|
997
|
-
}), (u.includes("dana") ||
|
|
998
|
+
}), (u.includes("dana") || f.includes("payments_dana")) && d.push({
|
|
998
999
|
id: "dana",
|
|
999
1000
|
enabled: !0,
|
|
1000
1001
|
priority: h++
|
|
1001
|
-
}), (u.includes("tng") || u.includes("touch") ||
|
|
1002
|
+
}), (u.includes("tng") || u.includes("touch") || f.includes("payments_tng")) && d.push({
|
|
1002
1003
|
id: "tng",
|
|
1003
1004
|
enabled: !0,
|
|
1004
1005
|
priority: h++
|
|
1005
|
-
}), (u.includes("alipaycn") || u.includes("alipay cn") || u.includes("alipay_cn") ||
|
|
1006
|
+
}), (u.includes("alipaycn") || u.includes("alipay cn") || u.includes("alipay_cn") || f.includes("payments_alipaycn")) && d.push({
|
|
1006
1007
|
id: "alipaycn",
|
|
1007
1008
|
enabled: !0,
|
|
1008
1009
|
priority: h++
|
|
1009
|
-
}), (u.includes("alipayhk") || u.includes("alipay hk") || u.includes("alipay_hk") ||
|
|
1010
|
+
}), (u.includes("alipayhk") || u.includes("alipay hk") || u.includes("alipay_hk") || f.includes("payments_alipayhk")) && d.push({
|
|
1010
1011
|
id: "alipayhk",
|
|
1011
1012
|
enabled: !0,
|
|
1012
1013
|
priority: h++
|
|
1013
|
-
}), (u.includes("gcash") || u.includes("g cash") ||
|
|
1014
|
+
}), (u.includes("gcash") || u.includes("g cash") || f.includes("payments_gcash")) && d.push({
|
|
1014
1015
|
id: "gcash",
|
|
1015
1016
|
enabled: !0,
|
|
1016
1017
|
priority: h++
|
|
1017
|
-
}), (u.includes("konbini") ||
|
|
1018
|
+
}), (u.includes("konbini") || f.includes("payments_konbini")) && d.push({
|
|
1018
1019
|
id: "konbini",
|
|
1019
1020
|
enabled: !0,
|
|
1020
1021
|
priority: h++
|
|
1022
|
+
}), (u.includes("payeasy") || u.includes("pay-easy") || u.includes("pay easy") || f.includes("payments_payeasy")) && d.push({
|
|
1023
|
+
id: "payeasy",
|
|
1024
|
+
enabled: !0,
|
|
1025
|
+
priority: h++
|
|
1021
1026
|
});
|
|
1022
1027
|
}), this.setState({
|
|
1023
1028
|
status: T.READY,
|
|
@@ -1117,8 +1122,8 @@ var cr = class {
|
|
|
1117
1122
|
}
|
|
1118
1123
|
});
|
|
1119
1124
|
try {
|
|
1120
|
-
const a = (
|
|
1121
|
-
switch (
|
|
1125
|
+
const a = (h) => {
|
|
1126
|
+
switch (h) {
|
|
1122
1127
|
case "paynow":
|
|
1123
1128
|
return "qr";
|
|
1124
1129
|
case "promptpay":
|
|
@@ -1145,14 +1150,16 @@ var cr = class {
|
|
|
1145
1150
|
return "gcash";
|
|
1146
1151
|
case "konbini":
|
|
1147
1152
|
return "konbini";
|
|
1153
|
+
case "payeasy":
|
|
1154
|
+
return "payeasy";
|
|
1148
1155
|
default:
|
|
1149
1156
|
return "qr";
|
|
1150
1157
|
}
|
|
1151
|
-
}, c = {
|
|
1158
|
+
}, c = (h, p) => (p === "konbini" || p === "payeasy") && h.startsWith("+81") ? "0" + h.slice(3).replace(/\s/g, "") : h, d = {
|
|
1152
1159
|
firstName: String(t.firstName),
|
|
1153
1160
|
lastName: String(t.lastName),
|
|
1154
1161
|
email: String(t.email),
|
|
1155
|
-
phoneNumber: String(t.phoneNumber),
|
|
1162
|
+
phoneNumber: c(String(t.phoneNumber), e),
|
|
1156
1163
|
paymentMethod: e === "card" ? {
|
|
1157
1164
|
type: "card",
|
|
1158
1165
|
card: {
|
|
@@ -1165,7 +1172,7 @@ var cr = class {
|
|
|
1165
1172
|
};
|
|
1166
1173
|
return await this.adapters.http.patch(
|
|
1167
1174
|
`${this.getApiBaseUrl()}/payment-intent/confirm`,
|
|
1168
|
-
|
|
1175
|
+
d,
|
|
1169
1176
|
{
|
|
1170
1177
|
"x-token": this.paymentToken
|
|
1171
1178
|
}
|
|
@@ -1324,7 +1331,7 @@ var cr = class {
|
|
|
1324
1331
|
this.stopPolling();
|
|
1325
1332
|
return;
|
|
1326
1333
|
}
|
|
1327
|
-
const r = t.selectedMethod === "promptpay" || t.selectedMethod === "duitnow" || t.selectedMethod === "gopay" || t.selectedMethod === "boost" || t.selectedMethod === "shopeepay" || t.selectedMethod === "atom" || t.selectedMethod === "dana" || t.selectedMethod === "tng" || t.selectedMethod === "alipaycn" || t.selectedMethod === "alipayhk" || t.selectedMethod === "gcash" || t.selectedMethod === "konbini";
|
|
1334
|
+
const r = t.selectedMethod === "promptpay" || t.selectedMethod === "duitnow" || t.selectedMethod === "gopay" || t.selectedMethod === "boost" || t.selectedMethod === "shopeepay" || t.selectedMethod === "atom" || t.selectedMethod === "dana" || t.selectedMethod === "tng" || t.selectedMethod === "alipaycn" || t.selectedMethod === "alipayhk" || t.selectedMethod === "gcash" || t.selectedMethod === "konbini" || t.selectedMethod === "payeasy";
|
|
1328
1335
|
if (e.qrCode && !this.ignoreQRInPolling && !r) {
|
|
1329
1336
|
this.emit({
|
|
1330
1337
|
type: "qr_code_received",
|
|
@@ -1456,6 +1463,16 @@ var cr = class {
|
|
|
1456
1463
|
});
|
|
1457
1464
|
return;
|
|
1458
1465
|
}
|
|
1466
|
+
if (t.selectedMethod === "payeasy") {
|
|
1467
|
+
this.stopPolling(), this.emit({
|
|
1468
|
+
type: "payeasy_redirect",
|
|
1469
|
+
payload: {
|
|
1470
|
+
redirectUrl: e.nextActionUrl,
|
|
1471
|
+
methodId: t.selectedMethod
|
|
1472
|
+
}
|
|
1473
|
+
});
|
|
1474
|
+
return;
|
|
1475
|
+
}
|
|
1459
1476
|
if (t.selectedMethod === "paynow" && !this.ignoreQRInPolling) {
|
|
1460
1477
|
this.emit({
|
|
1461
1478
|
type: "qr_code_received",
|
|
@@ -1553,7 +1570,7 @@ var cr = class {
|
|
|
1553
1570
|
r(e);
|
|
1554
1571
|
});
|
|
1555
1572
|
}
|
|
1556
|
-
}, dr = "https://images.ctfassets.net/c3n7jozh84hr/2A5qlS6JkUsOyFVPzQ0KlK/22b497afd71030ef1a44a52394b15027/______2022-06-30_11.03.43.png", ur = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/xLSOJpNvMp7cBKdvDln0B/eb2f53a0a3f2317750739dceff9df413/______2022-06-30_10.59.00.png", hr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4Iq13VoxktB3amHFbQK1yb/f2fe12add0dac233d56c22cf5651c65c/image-20220630-030728.png", pr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/mjau5Tqscwu9tbhRLFbmJ/a66cd2894060b2d3a94b75d7f4e65355/______2022-07-04_17.05.18.png", mr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1M4DBVFhOrkprPmjxZwS7M/c4a90840d3846b926d3a5524392435fe/Boost.svg", fr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1BYCLeHNQEyPXBjlIdu09h/71d67c5be3975f77091bf45c7ab58f65/ShopeePay.svg", gr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/61LYQ3RuziTGisarZgaAV1/309f3f1e569609dd0b0095857d6382b5/__2022-05-31_11.44.42.png", yr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/79Uj5xItEZE7L51j2oh6IV/6af4cfefdd65834305931fd16f652d87/DANA.svg", br = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/15FHwC4H3W0JrNvsqy6TWH/5d18aa44231c55d6457389e17ac7ea0c/TnG.svg", vr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/5EK8VF1nACmJ0KpPocLuR7/785178078004e82cb69782c570623b8c/Alipay.svg", wr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/3sNSjVq0K9mq5whYcGJhBe/78857434adff807c8e293425491e0bd4/AlipayHK.svg", xr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4WAO5JJPUOrZ9jBA0Vf4tf/c3896e1a5508efa0c569bd3eaa577dad/GCash.svg", Sr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/2k2M0v6xdd5HvUNxX2sYCi/c9de881648bdd61adb15ec1941f2d47e/konbini_420x280.png", Q = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, V = function(e, t, r, i, n, s, o, l, a, c) {
|
|
1573
|
+
}, dr = "https://images.ctfassets.net/c3n7jozh84hr/2A5qlS6JkUsOyFVPzQ0KlK/22b497afd71030ef1a44a52394b15027/______2022-06-30_11.03.43.png", ur = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/xLSOJpNvMp7cBKdvDln0B/eb2f53a0a3f2317750739dceff9df413/______2022-06-30_10.59.00.png", hr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4Iq13VoxktB3amHFbQK1yb/f2fe12add0dac233d56c22cf5651c65c/image-20220630-030728.png", pr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/mjau5Tqscwu9tbhRLFbmJ/a66cd2894060b2d3a94b75d7f4e65355/______2022-07-04_17.05.18.png", mr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1M4DBVFhOrkprPmjxZwS7M/c4a90840d3846b926d3a5524392435fe/Boost.svg", fr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1BYCLeHNQEyPXBjlIdu09h/71d67c5be3975f77091bf45c7ab58f65/ShopeePay.svg", gr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/61LYQ3RuziTGisarZgaAV1/309f3f1e569609dd0b0095857d6382b5/__2022-05-31_11.44.42.png", yr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/79Uj5xItEZE7L51j2oh6IV/6af4cfefdd65834305931fd16f652d87/DANA.svg", br = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/15FHwC4H3W0JrNvsqy6TWH/5d18aa44231c55d6457389e17ac7ea0c/TnG.svg", vr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/5EK8VF1nACmJ0KpPocLuR7/785178078004e82cb69782c570623b8c/Alipay.svg", wr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/3sNSjVq0K9mq5whYcGJhBe/78857434adff807c8e293425491e0bd4/AlipayHK.svg", xr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4WAO5JJPUOrZ9jBA0Vf4tf/c3896e1a5508efa0c569bd3eaa577dad/GCash.svg", Sr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/2k2M0v6xdd5HvUNxX2sYCi/c9de881648bdd61adb15ec1941f2d47e/konbini_420x280.png", Pr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/3DKc8YOvmllqXs9MIZvDFU/195c73003eacb07b60dd2740c59ab4e3/Pay-easy.svg", Q = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, V = function(e, t, r, i, n, s, o, l, a, c) {
|
|
1557
1574
|
var d = this;
|
|
1558
1575
|
d.numeralDecimalMark = e || ".", d.numeralIntegerScale = t > 0 ? t : 0, d.numeralDecimalScale = r >= 0 ? r : 2, d.numeralThousandsGroupStyle = i || V.groupStyle.thousand, d.numeralPositiveOnly = !!n, d.stripLeadingZeroes = s !== !1, d.prefix = o || o === "" ? o : "", d.signBeforePrefix = !!l, d.tailPrefix = !!a, d.delimiter = c || c === "" ? c : ",", d.delimiterRE = c ? new RegExp("\\" + c, "g") : "";
|
|
1559
1576
|
};
|
|
@@ -1583,7 +1600,7 @@ V.prototype = {
|
|
|
1583
1600
|
return t.tailPrefix ? i + s.toString() + (t.numeralDecimalScale > 0 ? o.toString() : "") + t.prefix : n + s.toString() + (t.numeralDecimalScale > 0 ? o.toString() : "");
|
|
1584
1601
|
}
|
|
1585
1602
|
};
|
|
1586
|
-
var
|
|
1603
|
+
var Ar = V, ye = function(e, t, r) {
|
|
1587
1604
|
var i = this;
|
|
1588
1605
|
i.date = [], i.blocks = [], i.datePattern = e, i.dateMin = t.split("-").reverse().map(function(n) {
|
|
1589
1606
|
return parseInt(n, 10);
|
|
@@ -1637,7 +1654,7 @@ ye.prototype = {
|
|
|
1637
1654
|
break;
|
|
1638
1655
|
}
|
|
1639
1656
|
}), c = o * 2, l = n <= o ? n * 2 : n * 2 + 2, a = s <= o ? s * 2 : s * 2 + 2, d = parseInt(e.slice(l, l + 2), 10), h = parseInt(e.slice(a, a + 2), 10), p = parseInt(e.slice(c, c + 4), 10), u = e.slice(c, c + 4).length === 4, i = this.getFixedDate(d, h, p)), e.length === 4 && (r[0] === "y" || r[1] === "y") && (a = r[0] === "m" ? 0 : 2, c = 2 - a, h = parseInt(e.slice(a, a + 2), 10), p = parseInt(e.slice(c, c + 2), 10), u = e.slice(c, c + 2).length === 2, i = [0, h, p]), e.length === 6 && (r[0] === "Y" || r[1] === "Y") && (a = r[0] === "m" ? 0 : 4, c = 2 - 0.5 * a, h = parseInt(e.slice(a, a + 2), 10), p = parseInt(e.slice(c, c + 4), 10), u = e.slice(c, c + 4).length === 4, i = [0, h, p]), i = t.getRangeFixedDate(i), t.date = i;
|
|
1640
|
-
var
|
|
1657
|
+
var f = i.length === 0 ? e : r.reduce(function(v, C) {
|
|
1641
1658
|
switch (C) {
|
|
1642
1659
|
case "d":
|
|
1643
1660
|
return v + (i[0] === 0 ? "" : t.addLeadingZero(i[0]));
|
|
@@ -1649,7 +1666,7 @@ ye.prototype = {
|
|
|
1649
1666
|
return v + (u ? t.addLeadingZeroForYear(i[2], !0) : "");
|
|
1650
1667
|
}
|
|
1651
1668
|
}, "");
|
|
1652
|
-
return
|
|
1669
|
+
return f;
|
|
1653
1670
|
},
|
|
1654
1671
|
getRangeFixedDate: function(e) {
|
|
1655
1672
|
var t = this, r = t.datePattern, i = t.dateMin || [], n = t.dateMax || [];
|
|
@@ -1724,29 +1741,29 @@ be.prototype = {
|
|
|
1724
1741
|
},
|
|
1725
1742
|
getFixedTimeString: function(e) {
|
|
1726
1743
|
var t = this, r = t.timePattern, i = [], n = 0, s = 0, o = 0, l = 0, a = 0, c = 0, d, h, p;
|
|
1727
|
-
return e.length === 6 && (r.forEach(function(u,
|
|
1744
|
+
return e.length === 6 && (r.forEach(function(u, f) {
|
|
1728
1745
|
switch (u) {
|
|
1729
1746
|
case "s":
|
|
1730
|
-
n =
|
|
1747
|
+
n = f * 2;
|
|
1731
1748
|
break;
|
|
1732
1749
|
case "m":
|
|
1733
|
-
s =
|
|
1750
|
+
s = f * 2;
|
|
1734
1751
|
break;
|
|
1735
1752
|
case "h":
|
|
1736
|
-
o =
|
|
1753
|
+
o = f * 2;
|
|
1737
1754
|
break;
|
|
1738
1755
|
}
|
|
1739
|
-
}), c = o, a = s, l = n, d = parseInt(e.slice(l, l + 2), 10), h = parseInt(e.slice(a, a + 2), 10), p = parseInt(e.slice(c, c + 2), 10), i = this.getFixedTime(p, h, d)), e.length === 4 && t.timePattern.indexOf("s") < 0 && (r.forEach(function(u,
|
|
1756
|
+
}), c = o, a = s, l = n, d = parseInt(e.slice(l, l + 2), 10), h = parseInt(e.slice(a, a + 2), 10), p = parseInt(e.slice(c, c + 2), 10), i = this.getFixedTime(p, h, d)), e.length === 4 && t.timePattern.indexOf("s") < 0 && (r.forEach(function(u, f) {
|
|
1740
1757
|
switch (u) {
|
|
1741
1758
|
case "m":
|
|
1742
|
-
s =
|
|
1759
|
+
s = f * 2;
|
|
1743
1760
|
break;
|
|
1744
1761
|
case "h":
|
|
1745
|
-
o =
|
|
1762
|
+
o = f * 2;
|
|
1746
1763
|
break;
|
|
1747
1764
|
}
|
|
1748
|
-
}), c = o, a = s, d = 0, h = parseInt(e.slice(a, a + 2), 10), p = parseInt(e.slice(c, c + 2), 10), i = this.getFixedTime(p, h, d)), t.time = i, i.length === 0 ? e : r.reduce(function(u,
|
|
1749
|
-
switch (
|
|
1765
|
+
}), c = o, a = s, d = 0, h = parseInt(e.slice(a, a + 2), 10), p = parseInt(e.slice(c, c + 2), 10), i = this.getFixedTime(p, h, d)), t.time = i, i.length === 0 ? e : r.reduce(function(u, f) {
|
|
1766
|
+
switch (f) {
|
|
1750
1767
|
case "s":
|
|
1751
1768
|
return u + t.addLeadingZero(i[2]);
|
|
1752
1769
|
case "m":
|
|
@@ -1763,7 +1780,7 @@ be.prototype = {
|
|
|
1763
1780
|
return (e < 10 ? "0" : "") + e;
|
|
1764
1781
|
}
|
|
1765
1782
|
};
|
|
1766
|
-
var
|
|
1783
|
+
var Cr = be, ve = function(e, t) {
|
|
1767
1784
|
var r = this;
|
|
1768
1785
|
r.delimiter = t || t === "" ? t : " ", r.delimiterRE = t ? new RegExp("\\" + t, "g") : "", r.formatter = e;
|
|
1769
1786
|
};
|
|
@@ -1779,7 +1796,7 @@ ve.prototype = {
|
|
|
1779
1796
|
return r = r.replace(/[()]/g, ""), r = r.replace(/[\s-]/g, t.delimiter), r;
|
|
1780
1797
|
}
|
|
1781
1798
|
};
|
|
1782
|
-
var
|
|
1799
|
+
var _r = ve, Bt = {
|
|
1783
1800
|
blocks: {
|
|
1784
1801
|
uatp: [4, 5, 6],
|
|
1785
1802
|
amex: [4, 6, 5],
|
|
@@ -1846,7 +1863,7 @@ var Cr = ve, Bt = {
|
|
|
1846
1863
|
blocks: t ? this.getStrictBlocks(r.general) : r.general
|
|
1847
1864
|
};
|
|
1848
1865
|
}
|
|
1849
|
-
},
|
|
1866
|
+
}, Er = Bt, Nr = {
|
|
1850
1867
|
noop: function() {
|
|
1851
1868
|
},
|
|
1852
1869
|
strip: function(e, t) {
|
|
@@ -1975,7 +1992,7 @@ var Cr = ve, Bt = {
|
|
|
1975
1992
|
isAndroidBackspaceKeydown: function(e, t) {
|
|
1976
1993
|
return !this.isAndroid() || !e || !t ? !1 : t === e.slice(0, -1);
|
|
1977
1994
|
}
|
|
1978
|
-
}, Ir =
|
|
1995
|
+
}, Ir = Nr, Dr = {
|
|
1979
1996
|
// Maybe change to object-assign
|
|
1980
1997
|
// for now just keep it as simple
|
|
1981
1998
|
assign: function(e, t) {
|
|
@@ -1983,7 +2000,7 @@ var Cr = ve, Bt = {
|
|
|
1983
2000
|
}, e.phone = !!t.phone, e.phoneRegionCode = t.phoneRegionCode || "AU", e.phoneFormatter = {}, e.time = !!t.time, e.timePattern = t.timePattern || ["h", "m", "s"], e.timeFormat = t.timeFormat || "24", e.timeFormatter = {}, e.date = !!t.date, e.datePattern = t.datePattern || ["d", "m", "Y"], e.dateMin = t.dateMin || "", e.dateMax = t.dateMax || "", e.dateFormatter = {}, e.numeral = !!t.numeral, e.numeralIntegerScale = t.numeralIntegerScale > 0 ? t.numeralIntegerScale : 0, e.numeralDecimalScale = t.numeralDecimalScale >= 0 ? t.numeralDecimalScale : 2, e.numeralDecimalMark = t.numeralDecimalMark || ".", e.numeralThousandsGroupStyle = t.numeralThousandsGroupStyle || "thousand", e.numeralPositiveOnly = !!t.numeralPositiveOnly, e.stripLeadingZeroes = t.stripLeadingZeroes !== !1, e.signBeforePrefix = !!t.signBeforePrefix, e.tailPrefix = !!t.tailPrefix, e.swapHiddenInput = !!t.swapHiddenInput, e.numericOnly = e.creditCard || e.date || !!t.numericOnly, e.uppercase = !!t.uppercase, e.lowercase = !!t.lowercase, e.prefix = e.creditCard || e.date ? "" : t.prefix || "", e.noImmediatePrefix = !!t.noImmediatePrefix, e.prefixLength = e.prefix.length, e.rawValueTrimPrefix = !!t.rawValueTrimPrefix, e.copyDelimiter = !!t.copyDelimiter, e.initValue = t.initValue !== void 0 && t.initValue !== null ? t.initValue.toString() : "", e.delimiter = t.delimiter || t.delimiter === "" ? t.delimiter : t.date ? "/" : t.time ? ":" : t.numeral ? "," : (t.phone, " "), e.delimiterLength = e.delimiter.length, e.delimiterLazyShow = !!t.delimiterLazyShow, e.delimiters = t.delimiters || [], e.blocks = t.blocks || [], e.blocksLength = e.blocks.length, e.root = typeof Q == "object" && Q ? Q : window, e.document = t.document || e.root.document, e.maxLength = 0, e.backspace = !1, e.result = "", e.onValueChanged = t.onValueChanged || function() {
|
|
1984
2001
|
}, e;
|
|
1985
2002
|
}
|
|
1986
|
-
},
|
|
2003
|
+
}, Mr = Dr, A = function(e, t) {
|
|
1987
2004
|
var r = this, i = !1;
|
|
1988
2005
|
if (typeof e == "string" ? (r.element = document.querySelector(e), i = document.querySelectorAll(e).length > 1) : typeof e.length < "u" && e.length > 0 ? (r.element = e[0], i = e.length > 1) : r.element = e, !r.element)
|
|
1989
2006
|
throw new Error("[cleave.js] Please check the element");
|
|
@@ -1992,16 +2009,16 @@ var Cr = ve, Bt = {
|
|
|
1992
2009
|
console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.");
|
|
1993
2010
|
} catch {
|
|
1994
2011
|
}
|
|
1995
|
-
t.initValue = r.element.value, r.properties =
|
|
2012
|
+
t.initValue = r.element.value, r.properties = A.DefaultProperties.assign({}, t), r.init();
|
|
1996
2013
|
};
|
|
1997
|
-
|
|
2014
|
+
A.prototype = {
|
|
1998
2015
|
init: function() {
|
|
1999
2016
|
var e = this, t = e.properties;
|
|
2000
2017
|
if (!t.numeral && !t.phone && !t.creditCard && !t.time && !t.date && t.blocksLength === 0 && !t.prefix) {
|
|
2001
2018
|
e.onInput(t.initValue);
|
|
2002
2019
|
return;
|
|
2003
2020
|
}
|
|
2004
|
-
t.maxLength =
|
|
2021
|
+
t.maxLength = A.Util.getMaxLength(t.blocks), e.isAndroid = A.Util.isAndroid(), e.lastInputValue = "", e.isBackward = "", e.onChangeListener = e.onChange.bind(e), e.onKeyDownListener = e.onKeyDown.bind(e), e.onFocusListener = e.onFocus.bind(e), e.onCutListener = e.onCut.bind(e), e.onCopyListener = e.onCopy.bind(e), e.initSwapHiddenInput(), e.element.addEventListener("input", e.onChangeListener), e.element.addEventListener("keydown", e.onKeyDownListener), e.element.addEventListener("focus", e.onFocusListener), e.element.addEventListener("cut", e.onCutListener), e.element.addEventListener("copy", e.onCopyListener), e.initPhoneFormatter(), e.initDateFormatter(), e.initTimeFormatter(), e.initNumeralFormatter(), (t.initValue || t.prefix && !t.noImmediatePrefix) && e.onInput(t.initValue);
|
|
2005
2022
|
},
|
|
2006
2023
|
initSwapHiddenInput: function() {
|
|
2007
2024
|
var e = this, t = e.properties;
|
|
@@ -2012,7 +2029,7 @@ k.prototype = {
|
|
|
2012
2029
|
},
|
|
2013
2030
|
initNumeralFormatter: function() {
|
|
2014
2031
|
var e = this, t = e.properties;
|
|
2015
|
-
t.numeral && (t.numeralFormatter = new
|
|
2032
|
+
t.numeral && (t.numeralFormatter = new A.NumeralFormatter(
|
|
2016
2033
|
t.numeralDecimalMark,
|
|
2017
2034
|
t.numeralIntegerScale,
|
|
2018
2035
|
t.numeralDecimalScale,
|
|
@@ -2027,17 +2044,17 @@ k.prototype = {
|
|
|
2027
2044
|
},
|
|
2028
2045
|
initTimeFormatter: function() {
|
|
2029
2046
|
var e = this, t = e.properties;
|
|
2030
|
-
t.time && (t.timeFormatter = new
|
|
2047
|
+
t.time && (t.timeFormatter = new A.TimeFormatter(t.timePattern, t.timeFormat), t.blocks = t.timeFormatter.getBlocks(), t.blocksLength = t.blocks.length, t.maxLength = A.Util.getMaxLength(t.blocks));
|
|
2031
2048
|
},
|
|
2032
2049
|
initDateFormatter: function() {
|
|
2033
2050
|
var e = this, t = e.properties;
|
|
2034
|
-
t.date && (t.dateFormatter = new
|
|
2051
|
+
t.date && (t.dateFormatter = new A.DateFormatter(t.datePattern, t.dateMin, t.dateMax), t.blocks = t.dateFormatter.getBlocks(), t.blocksLength = t.blocks.length, t.maxLength = A.Util.getMaxLength(t.blocks));
|
|
2035
2052
|
},
|
|
2036
2053
|
initPhoneFormatter: function() {
|
|
2037
2054
|
var e = this, t = e.properties;
|
|
2038
2055
|
if (t.phone)
|
|
2039
2056
|
try {
|
|
2040
|
-
t.phoneFormatter = new
|
|
2057
|
+
t.phoneFormatter = new A.PhoneFormatter(
|
|
2041
2058
|
new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),
|
|
2042
2059
|
t.delimiter
|
|
2043
2060
|
);
|
|
@@ -2050,23 +2067,23 @@ k.prototype = {
|
|
|
2050
2067
|
t.lastInputValue = t.element.value, t.isBackward = r === 8;
|
|
2051
2068
|
},
|
|
2052
2069
|
onChange: function(e) {
|
|
2053
|
-
var t = this, r = t.properties, i =
|
|
2070
|
+
var t = this, r = t.properties, i = A.Util;
|
|
2054
2071
|
t.isBackward = t.isBackward || e.inputType === "deleteContentBackward";
|
|
2055
2072
|
var n = i.getPostDelimiter(t.lastInputValue, r.delimiter, r.delimiters);
|
|
2056
2073
|
t.isBackward && n ? r.postDelimiterBackspace = n : r.postDelimiterBackspace = !1, this.onInput(this.element.value);
|
|
2057
2074
|
},
|
|
2058
2075
|
onFocus: function() {
|
|
2059
2076
|
var e = this, t = e.properties;
|
|
2060
|
-
e.lastInputValue = e.element.value, t.prefix && t.noImmediatePrefix && !e.element.value && this.onInput(t.prefix),
|
|
2077
|
+
e.lastInputValue = e.element.value, t.prefix && t.noImmediatePrefix && !e.element.value && this.onInput(t.prefix), A.Util.fixPrefixCursor(e.element, t.prefix, t.delimiter, t.delimiters);
|
|
2061
2078
|
},
|
|
2062
2079
|
onCut: function(e) {
|
|
2063
|
-
|
|
2080
|
+
A.Util.checkFullSelection(this.element.value) && (this.copyClipboardData(e), this.onInput(""));
|
|
2064
2081
|
},
|
|
2065
2082
|
onCopy: function(e) {
|
|
2066
|
-
|
|
2083
|
+
A.Util.checkFullSelection(this.element.value) && this.copyClipboardData(e);
|
|
2067
2084
|
},
|
|
2068
2085
|
copyClipboardData: function(e) {
|
|
2069
|
-
var t = this, r = t.properties, i =
|
|
2086
|
+
var t = this, r = t.properties, i = A.Util, n = t.element.value, s = "";
|
|
2070
2087
|
r.copyDelimiter ? s = n : s = i.stripDelimiters(n, r.delimiter, r.delimiters);
|
|
2071
2088
|
try {
|
|
2072
2089
|
e.clipboardData ? e.clipboardData.setData("Text", s) : window.clipboardData.setData("Text", s), e.preventDefault();
|
|
@@ -2074,7 +2091,7 @@ k.prototype = {
|
|
|
2074
2091
|
}
|
|
2075
2092
|
},
|
|
2076
2093
|
onInput: function(e) {
|
|
2077
|
-
var t = this, r = t.properties, i =
|
|
2094
|
+
var t = this, r = t.properties, i = A.Util, n = i.getPostDelimiter(e, r.delimiter, r.delimiters);
|
|
2078
2095
|
if (!r.numeral && r.postDelimiterBackspace && !n && (e = i.headStr(e, e.length - r.postDelimiterBackspace.length)), r.phone) {
|
|
2079
2096
|
r.prefix && (!r.noImmediatePrefix || e.length) ? r.result = r.prefix + r.phoneFormatter.format(e).slice(r.prefix.length) : r.result = r.phoneFormatter.format(e), t.updateValueState();
|
|
2080
2097
|
return;
|
|
@@ -2097,11 +2114,11 @@ k.prototype = {
|
|
|
2097
2114
|
), t.updateValueState();
|
|
2098
2115
|
},
|
|
2099
2116
|
updateCreditCardPropsByValue: function(e) {
|
|
2100
|
-
var t = this, r = t.properties, i =
|
|
2101
|
-
i.headStr(r.result, 4) !== i.headStr(e, 4) && (n =
|
|
2117
|
+
var t = this, r = t.properties, i = A.Util, n;
|
|
2118
|
+
i.headStr(r.result, 4) !== i.headStr(e, 4) && (n = A.CreditCardDetector.getInfo(e, r.creditCardStrictMode), r.blocks = n.blocks, r.blocksLength = r.blocks.length, r.maxLength = i.getMaxLength(r.blocks), r.creditCardType !== n.type && (r.creditCardType = n.type, r.onCreditCardTypeChanged.call(t, r.creditCardType)));
|
|
2102
2119
|
},
|
|
2103
2120
|
updateValueState: function() {
|
|
2104
|
-
var e = this, t =
|
|
2121
|
+
var e = this, t = A.Util, r = e.properties;
|
|
2105
2122
|
if (e.element) {
|
|
2106
2123
|
var i = e.element.selectionEnd, n = e.element.value, s = r.result;
|
|
2107
2124
|
if (i = t.getNextCursorPosition(i, n, s, r.delimiter, r.delimiters), e.isAndroid) {
|
|
@@ -2132,7 +2149,7 @@ k.prototype = {
|
|
|
2132
2149
|
e = e != null ? e.toString() : "", r.numeral && (e = e.replace(".", r.numeralDecimalMark)), r.postDelimiterBackspace = !1, t.element.value = e, t.onInput(e);
|
|
2133
2150
|
},
|
|
2134
2151
|
getRawValue: function() {
|
|
2135
|
-
var e = this, t = e.properties, r =
|
|
2152
|
+
var e = this, t = e.properties, r = A.Util, i = e.element.value;
|
|
2136
2153
|
return t.rawValueTrimPrefix && (i = r.getPrefixStrippedValue(i, t.prefix, t.prefixLength, t.result, t.delimiter, t.delimiters, t.noImmediatePrefix, t.tailPrefix, t.signBeforePrefix)), t.numeral ? i = t.numeralFormatter.getRawValue(i) : i = r.stripDelimiters(i, t.delimiter, t.delimiters), i;
|
|
2137
2154
|
},
|
|
2138
2155
|
getISOFormatDate: function() {
|
|
@@ -2154,19 +2171,19 @@ k.prototype = {
|
|
|
2154
2171
|
return "[Cleave Object]";
|
|
2155
2172
|
}
|
|
2156
2173
|
};
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
(typeof Q == "object" && Q ? Q : window).Cleave =
|
|
2165
|
-
var ae =
|
|
2174
|
+
A.NumeralFormatter = Ar;
|
|
2175
|
+
A.DateFormatter = kr;
|
|
2176
|
+
A.TimeFormatter = Cr;
|
|
2177
|
+
A.PhoneFormatter = _r;
|
|
2178
|
+
A.CreditCardDetector = Er;
|
|
2179
|
+
A.Util = Ir;
|
|
2180
|
+
A.DefaultProperties = Mr;
|
|
2181
|
+
(typeof Q == "object" && Q ? Q : window).Cleave = A;
|
|
2182
|
+
var ae = A, pt = {}, Tr = function() {
|
|
2166
2183
|
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
2167
2184
|
}, we = {}, M = {};
|
|
2168
2185
|
let jt;
|
|
2169
|
-
const
|
|
2186
|
+
const $r = [
|
|
2170
2187
|
0,
|
|
2171
2188
|
// Not used
|
|
2172
2189
|
26,
|
|
@@ -2216,7 +2233,7 @@ M.getSymbolSize = function(t) {
|
|
|
2216
2233
|
return t * 4 + 17;
|
|
2217
2234
|
};
|
|
2218
2235
|
M.getSymbolTotalCodewords = function(t) {
|
|
2219
|
-
return
|
|
2236
|
+
return $r[t];
|
|
2220
2237
|
};
|
|
2221
2238
|
M.getBCHDigit = function(e) {
|
|
2222
2239
|
let t = 0;
|
|
@@ -2290,7 +2307,7 @@ xe.prototype = {
|
|
|
2290
2307
|
this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
|
|
2291
2308
|
}
|
|
2292
2309
|
};
|
|
2293
|
-
var
|
|
2310
|
+
var Rr = xe;
|
|
2294
2311
|
function mt(e) {
|
|
2295
2312
|
if (!e || e < 1)
|
|
2296
2313
|
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
@@ -2309,7 +2326,7 @@ mt.prototype.xor = function(e, t, r) {
|
|
|
2309
2326
|
mt.prototype.isReserved = function(e, t) {
|
|
2310
2327
|
return this.reservedBit[e * this.size + t];
|
|
2311
2328
|
};
|
|
2312
|
-
var
|
|
2329
|
+
var Lr = mt, Se = {};
|
|
2313
2330
|
(function(e) {
|
|
2314
2331
|
const t = M.getSymbolSize;
|
|
2315
2332
|
e.getRowColCoords = function(i) {
|
|
@@ -2329,9 +2346,9 @@ var Rr = mt, Se = {};
|
|
|
2329
2346
|
};
|
|
2330
2347
|
})(Se);
|
|
2331
2348
|
var Pe = {};
|
|
2332
|
-
const
|
|
2349
|
+
const Br = M.getSymbolSize, le = 7;
|
|
2333
2350
|
Pe.getPositions = function(t) {
|
|
2334
|
-
const r =
|
|
2351
|
+
const r = Br(t);
|
|
2335
2352
|
return [
|
|
2336
2353
|
// top-left
|
|
2337
2354
|
[0, 0],
|
|
@@ -2341,7 +2358,7 @@ Pe.getPositions = function(t) {
|
|
|
2341
2358
|
[0, r - le]
|
|
2342
2359
|
];
|
|
2343
2360
|
};
|
|
2344
|
-
var
|
|
2361
|
+
var Ae = {};
|
|
2345
2362
|
(function(e) {
|
|
2346
2363
|
e.Patterns = {
|
|
2347
2364
|
PATTERN000: 0,
|
|
@@ -2436,8 +2453,8 @@ var ke = {};
|
|
|
2436
2453
|
}
|
|
2437
2454
|
return l;
|
|
2438
2455
|
};
|
|
2439
|
-
})(
|
|
2440
|
-
var
|
|
2456
|
+
})(Ae);
|
|
2457
|
+
var At = {};
|
|
2441
2458
|
const O = Pt, ft = [
|
|
2442
2459
|
// L M Q H
|
|
2443
2460
|
1,
|
|
@@ -2763,7 +2780,7 @@ const O = Pt, ft = [
|
|
|
2763
2780
|
2040,
|
|
2764
2781
|
2430
|
|
2765
2782
|
];
|
|
2766
|
-
|
|
2783
|
+
At.getBlocksCount = function(t, r) {
|
|
2767
2784
|
switch (r) {
|
|
2768
2785
|
case O.L:
|
|
2769
2786
|
return ft[(t - 1) * 4 + 0];
|
|
@@ -2777,7 +2794,7 @@ kt.getBlocksCount = function(t, r) {
|
|
|
2777
2794
|
return;
|
|
2778
2795
|
}
|
|
2779
2796
|
};
|
|
2780
|
-
|
|
2797
|
+
At.getTotalCodewordsCount = function(t, r) {
|
|
2781
2798
|
switch (r) {
|
|
2782
2799
|
case O.L:
|
|
2783
2800
|
return gt[(t - 1) * 4 + 0];
|
|
@@ -2791,7 +2808,7 @@ kt.getTotalCodewordsCount = function(t, r) {
|
|
|
2791
2808
|
return;
|
|
2792
2809
|
}
|
|
2793
2810
|
};
|
|
2794
|
-
var
|
|
2811
|
+
var ke = {}, kt = {};
|
|
2795
2812
|
const at = new Uint8Array(512), wt = new Uint8Array(256);
|
|
2796
2813
|
(function() {
|
|
2797
2814
|
let t = 1;
|
|
@@ -2800,18 +2817,18 @@ const at = new Uint8Array(512), wt = new Uint8Array(256);
|
|
|
2800
2817
|
for (let r = 255; r < 512; r++)
|
|
2801
2818
|
at[r] = at[r - 255];
|
|
2802
2819
|
})();
|
|
2803
|
-
|
|
2820
|
+
kt.log = function(t) {
|
|
2804
2821
|
if (t < 1) throw new Error("log(" + t + ")");
|
|
2805
2822
|
return wt[t];
|
|
2806
2823
|
};
|
|
2807
|
-
|
|
2824
|
+
kt.exp = function(t) {
|
|
2808
2825
|
return at[t];
|
|
2809
2826
|
};
|
|
2810
|
-
|
|
2827
|
+
kt.mul = function(t, r) {
|
|
2811
2828
|
return t === 0 || r === 0 ? 0 : at[wt[t] + wt[r]];
|
|
2812
2829
|
};
|
|
2813
2830
|
(function(e) {
|
|
2814
|
-
const t =
|
|
2831
|
+
const t = kt;
|
|
2815
2832
|
e.mul = function(i, n) {
|
|
2816
2833
|
const s = new Uint8Array(i.length + n.length - 1);
|
|
2817
2834
|
for (let o = 0; o < i.length; o++)
|
|
@@ -2835,8 +2852,8 @@ At.mul = function(t, r) {
|
|
|
2835
2852
|
n = e.mul(n, new Uint8Array([1, t.exp(s)]));
|
|
2836
2853
|
return n;
|
|
2837
2854
|
};
|
|
2838
|
-
})(
|
|
2839
|
-
const Ce =
|
|
2855
|
+
})(ke);
|
|
2856
|
+
const Ce = ke;
|
|
2840
2857
|
function Kt(e) {
|
|
2841
2858
|
this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree);
|
|
2842
2859
|
}
|
|
@@ -2855,30 +2872,30 @@ Kt.prototype.encode = function(t) {
|
|
|
2855
2872
|
}
|
|
2856
2873
|
return i;
|
|
2857
2874
|
};
|
|
2858
|
-
var
|
|
2875
|
+
var Ur = Kt, _e = {}, q = {}, Gt = {};
|
|
2859
2876
|
Gt.isValid = function(t) {
|
|
2860
2877
|
return !isNaN(t) && t >= 1 && t <= 40;
|
|
2861
2878
|
};
|
|
2862
2879
|
var L = {};
|
|
2863
|
-
const Ee = "[0-9]+",
|
|
2880
|
+
const Ee = "[0-9]+", Fr = "[A-Z $%*+\\-./:]+";
|
|
2864
2881
|
let ut = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
2865
2882
|
ut = ut.replace(/u/g, "\\u");
|
|
2866
|
-
const
|
|
2883
|
+
const Or = "(?:(?![A-Z0-9 $%*+\\-./:]|" + ut + `)(?:.|[\r
|
|
2867
2884
|
]))+`;
|
|
2868
2885
|
L.KANJI = new RegExp(ut, "g");
|
|
2869
2886
|
L.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
2870
|
-
L.BYTE = new RegExp(
|
|
2887
|
+
L.BYTE = new RegExp(Or, "g");
|
|
2871
2888
|
L.NUMERIC = new RegExp(Ee, "g");
|
|
2872
|
-
L.ALPHANUMERIC = new RegExp(
|
|
2873
|
-
const
|
|
2889
|
+
L.ALPHANUMERIC = new RegExp(Fr, "g");
|
|
2890
|
+
const zr = new RegExp("^" + ut + "$"), qr = new RegExp("^" + Ee + "$"), Yr = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
2874
2891
|
L.testKanji = function(t) {
|
|
2875
|
-
return
|
|
2892
|
+
return zr.test(t);
|
|
2876
2893
|
};
|
|
2877
2894
|
L.testNumeric = function(t) {
|
|
2878
|
-
return
|
|
2895
|
+
return qr.test(t);
|
|
2879
2896
|
};
|
|
2880
2897
|
L.testAlphanumeric = function(t) {
|
|
2881
|
-
return
|
|
2898
|
+
return Yr.test(t);
|
|
2882
2899
|
};
|
|
2883
2900
|
(function(e) {
|
|
2884
2901
|
const t = Gt, r = L;
|
|
@@ -2940,34 +2957,34 @@ L.testAlphanumeric = function(t) {
|
|
|
2940
2957
|
};
|
|
2941
2958
|
})(q);
|
|
2942
2959
|
(function(e) {
|
|
2943
|
-
const t = M, r =
|
|
2944
|
-
function a(p, u,
|
|
2960
|
+
const t = M, r = At, i = Pt, n = q, s = Gt, o = 7973, l = t.getBCHDigit(o);
|
|
2961
|
+
function a(p, u, f) {
|
|
2945
2962
|
for (let v = 1; v <= 40; v++)
|
|
2946
|
-
if (u <= e.getCapacity(v,
|
|
2963
|
+
if (u <= e.getCapacity(v, f, p))
|
|
2947
2964
|
return v;
|
|
2948
2965
|
}
|
|
2949
2966
|
function c(p, u) {
|
|
2950
2967
|
return n.getCharCountIndicator(p, u) + 4;
|
|
2951
2968
|
}
|
|
2952
2969
|
function d(p, u) {
|
|
2953
|
-
let
|
|
2970
|
+
let f = 0;
|
|
2954
2971
|
return p.forEach(function(v) {
|
|
2955
2972
|
const C = c(v.mode, u);
|
|
2956
|
-
|
|
2957
|
-
}),
|
|
2973
|
+
f += C + v.getBitsLength();
|
|
2974
|
+
}), f;
|
|
2958
2975
|
}
|
|
2959
2976
|
function h(p, u) {
|
|
2960
|
-
for (let
|
|
2961
|
-
if (d(p,
|
|
2962
|
-
return
|
|
2977
|
+
for (let f = 1; f <= 40; f++)
|
|
2978
|
+
if (d(p, f) <= e.getCapacity(f, u, n.MIXED))
|
|
2979
|
+
return f;
|
|
2963
2980
|
}
|
|
2964
|
-
e.from = function(u,
|
|
2965
|
-
return s.isValid(u) ? parseInt(u, 10) :
|
|
2966
|
-
}, e.getCapacity = function(u,
|
|
2981
|
+
e.from = function(u, f) {
|
|
2982
|
+
return s.isValid(u) ? parseInt(u, 10) : f;
|
|
2983
|
+
}, e.getCapacity = function(u, f, v) {
|
|
2967
2984
|
if (!s.isValid(u))
|
|
2968
2985
|
throw new Error("Invalid QR Code version");
|
|
2969
2986
|
typeof v > "u" && (v = n.BYTE);
|
|
2970
|
-
const C = t.getSymbolTotalCodewords(u), w = r.getTotalCodewordsCount(u,
|
|
2987
|
+
const C = t.getSymbolTotalCodewords(u), w = r.getTotalCodewordsCount(u, f), x = (C - w) * 8;
|
|
2971
2988
|
if (v === n.MIXED) return x;
|
|
2972
2989
|
const b = x - c(v, u);
|
|
2973
2990
|
switch (v) {
|
|
@@ -2981,9 +2998,9 @@ L.testAlphanumeric = function(t) {
|
|
|
2981
2998
|
default:
|
|
2982
2999
|
return Math.floor(b / 8);
|
|
2983
3000
|
}
|
|
2984
|
-
}, e.getBestVersionForData = function(u,
|
|
3001
|
+
}, e.getBestVersionForData = function(u, f) {
|
|
2985
3002
|
let v;
|
|
2986
|
-
const C = i.from(
|
|
3003
|
+
const C = i.from(f, i.M);
|
|
2987
3004
|
if (Array.isArray(u)) {
|
|
2988
3005
|
if (u.length > 1)
|
|
2989
3006
|
return h(u, C);
|
|
@@ -2996,25 +3013,25 @@ L.testAlphanumeric = function(t) {
|
|
|
2996
3013
|
}, e.getEncodedBits = function(u) {
|
|
2997
3014
|
if (!s.isValid(u) || u < 7)
|
|
2998
3015
|
throw new Error("Invalid QR Code version");
|
|
2999
|
-
let
|
|
3000
|
-
for (; t.getBCHDigit(
|
|
3001
|
-
|
|
3002
|
-
return u << 12 |
|
|
3016
|
+
let f = u << 12;
|
|
3017
|
+
for (; t.getBCHDigit(f) - l >= 0; )
|
|
3018
|
+
f ^= o << t.getBCHDigit(f) - l;
|
|
3019
|
+
return u << 12 | f;
|
|
3003
3020
|
};
|
|
3004
3021
|
})(_e);
|
|
3005
|
-
var
|
|
3006
|
-
const Ut = M,
|
|
3007
|
-
|
|
3022
|
+
var Ne = {};
|
|
3023
|
+
const Ut = M, Ie = 1335, Hr = 21522, ce = Ut.getBCHDigit(Ie);
|
|
3024
|
+
Ne.getEncodedBits = function(t, r) {
|
|
3008
3025
|
const i = t.bit << 3 | r;
|
|
3009
3026
|
let n = i << 10;
|
|
3010
3027
|
for (; Ut.getBCHDigit(n) - ce >= 0; )
|
|
3011
|
-
n ^=
|
|
3028
|
+
n ^= Ie << Ut.getBCHDigit(n) - ce;
|
|
3012
3029
|
return (i << 10 | n) ^ Hr;
|
|
3013
3030
|
};
|
|
3014
3031
|
var De = {};
|
|
3015
|
-
const
|
|
3032
|
+
const Vr = q;
|
|
3016
3033
|
function Z(e) {
|
|
3017
|
-
this.mode =
|
|
3034
|
+
this.mode = Vr.NUMERIC, this.data = e.toString();
|
|
3018
3035
|
}
|
|
3019
3036
|
Z.getBitsLength = function(t) {
|
|
3020
3037
|
return 10 * Math.floor(t / 3) + (t % 3 ? t % 3 * 3 + 1 : 0);
|
|
@@ -3032,8 +3049,8 @@ Z.prototype.write = function(t) {
|
|
|
3032
3049
|
const s = this.data.length - r;
|
|
3033
3050
|
s > 0 && (i = this.data.substr(r), n = parseInt(i, 10), t.put(n, s * 3 + 1));
|
|
3034
3051
|
};
|
|
3035
|
-
var
|
|
3036
|
-
const
|
|
3052
|
+
var jr = Z;
|
|
3053
|
+
const Kr = q, Mt = [
|
|
3037
3054
|
"0",
|
|
3038
3055
|
"1",
|
|
3039
3056
|
"2",
|
|
@@ -3081,7 +3098,7 @@ const jr = q, Mt = [
|
|
|
3081
3098
|
":"
|
|
3082
3099
|
];
|
|
3083
3100
|
function X(e) {
|
|
3084
|
-
this.mode =
|
|
3101
|
+
this.mode = Kr.ALPHANUMERIC, this.data = e;
|
|
3085
3102
|
}
|
|
3086
3103
|
X.getBitsLength = function(t) {
|
|
3087
3104
|
return 11 * Math.floor(t / 2) + 6 * (t % 2);
|
|
@@ -3100,10 +3117,10 @@ X.prototype.write = function(t) {
|
|
|
3100
3117
|
}
|
|
3101
3118
|
this.data.length % 2 && t.put(Mt.indexOf(this.data[r]), 6);
|
|
3102
3119
|
};
|
|
3103
|
-
var
|
|
3104
|
-
const
|
|
3120
|
+
var Gr = X;
|
|
3121
|
+
const Qr = q;
|
|
3105
3122
|
function tt(e) {
|
|
3106
|
-
this.mode =
|
|
3123
|
+
this.mode = Qr.BYTE, typeof e == "string" ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e);
|
|
3107
3124
|
}
|
|
3108
3125
|
tt.getBitsLength = function(t) {
|
|
3109
3126
|
return t * 8;
|
|
@@ -3118,8 +3135,8 @@ tt.prototype.write = function(e) {
|
|
|
3118
3135
|
for (let t = 0, r = this.data.length; t < r; t++)
|
|
3119
3136
|
e.put(this.data[t], 8);
|
|
3120
3137
|
};
|
|
3121
|
-
var
|
|
3122
|
-
const Wr = q,
|
|
3138
|
+
var Jr = tt;
|
|
3139
|
+
const Wr = q, Zr = M;
|
|
3123
3140
|
function et(e) {
|
|
3124
3141
|
this.mode = Wr.KANJI, this.data = e;
|
|
3125
3142
|
}
|
|
@@ -3135,7 +3152,7 @@ et.prototype.getBitsLength = function() {
|
|
|
3135
3152
|
et.prototype.write = function(e) {
|
|
3136
3153
|
let t;
|
|
3137
3154
|
for (t = 0; t < this.data.length; t++) {
|
|
3138
|
-
let r =
|
|
3155
|
+
let r = Zr.toSJIS(this.data[t]);
|
|
3139
3156
|
if (r >= 33088 && r <= 40956)
|
|
3140
3157
|
r -= 33088;
|
|
3141
3158
|
else if (r >= 57408 && r <= 60351)
|
|
@@ -3148,7 +3165,7 @@ Make sure your charset is UTF-8`
|
|
|
3148
3165
|
r = (r >>> 8 & 255) * 192 + (r & 255), e.put(r, 13);
|
|
3149
3166
|
}
|
|
3150
3167
|
};
|
|
3151
|
-
var
|
|
3168
|
+
var Xr = et, Me = { exports: {} };
|
|
3152
3169
|
(function(e) {
|
|
3153
3170
|
var t = {
|
|
3154
3171
|
single_source_shortest_paths: function(r, i, n) {
|
|
@@ -3156,10 +3173,10 @@ var Zr = et, Me = { exports: {} };
|
|
|
3156
3173
|
o[i] = 0;
|
|
3157
3174
|
var l = t.PriorityQueue.make();
|
|
3158
3175
|
l.push(i, 0);
|
|
3159
|
-
for (var a, c, d, h, p, u,
|
|
3176
|
+
for (var a, c, d, h, p, u, f, v, C; !l.empty(); ) {
|
|
3160
3177
|
a = l.pop(), c = a.value, h = a.cost, p = r[c] || {};
|
|
3161
3178
|
for (d in p)
|
|
3162
|
-
p.hasOwnProperty(d) && (u = p[d],
|
|
3179
|
+
p.hasOwnProperty(d) && (u = p[d], f = h + u, v = o[d], C = typeof o[d] > "u", (C || v > f) && (o[d] = f, l.push(d, f), s[d] = c));
|
|
3163
3180
|
}
|
|
3164
3181
|
if (typeof n < "u" && typeof o[n] > "u") {
|
|
3165
3182
|
var w = ["Could not find a path from ", i, " to ", n, "."].join("");
|
|
@@ -3214,28 +3231,28 @@ var Zr = et, Me = { exports: {} };
|
|
|
3214
3231
|
};
|
|
3215
3232
|
e.exports = t;
|
|
3216
3233
|
})(Me);
|
|
3217
|
-
var
|
|
3234
|
+
var ti = Me.exports;
|
|
3218
3235
|
(function(e) {
|
|
3219
|
-
const t = q, r =
|
|
3236
|
+
const t = q, r = jr, i = Gr, n = Jr, s = Xr, o = L, l = M, a = ti;
|
|
3220
3237
|
function c(w) {
|
|
3221
3238
|
return unescape(encodeURIComponent(w)).length;
|
|
3222
3239
|
}
|
|
3223
3240
|
function d(w, x, b) {
|
|
3224
3241
|
const y = [];
|
|
3225
|
-
let
|
|
3226
|
-
for (; (
|
|
3242
|
+
let k;
|
|
3243
|
+
for (; (k = w.exec(b)) !== null; )
|
|
3227
3244
|
y.push({
|
|
3228
|
-
data:
|
|
3229
|
-
index:
|
|
3245
|
+
data: k[0],
|
|
3246
|
+
index: k.index,
|
|
3230
3247
|
mode: x,
|
|
3231
|
-
length:
|
|
3248
|
+
length: k[0].length
|
|
3232
3249
|
});
|
|
3233
3250
|
return y;
|
|
3234
3251
|
}
|
|
3235
3252
|
function h(w) {
|
|
3236
3253
|
const x = d(o.NUMERIC, t.NUMERIC, w), b = d(o.ALPHANUMERIC, t.ALPHANUMERIC, w);
|
|
3237
|
-
let y,
|
|
3238
|
-
return l.isKanjiModeEnabled() ? (y = d(o.BYTE, t.BYTE, w),
|
|
3254
|
+
let y, k;
|
|
3255
|
+
return l.isKanjiModeEnabled() ? (y = d(o.BYTE, t.BYTE, w), k = d(o.KANJI, t.KANJI, w)) : (y = d(o.BYTE_KANJI, t.BYTE, w), k = []), x.concat(b, y, k).sort(function(E, $) {
|
|
3239
3256
|
return E.index - $.index;
|
|
3240
3257
|
}).map(function(E) {
|
|
3241
3258
|
return {
|
|
@@ -3263,7 +3280,7 @@ var Xr = Me.exports;
|
|
|
3263
3280
|
return y && y.mode === b.mode ? (x[x.length - 1].data += b.data, x) : (x.push(b), x);
|
|
3264
3281
|
}, []);
|
|
3265
3282
|
}
|
|
3266
|
-
function
|
|
3283
|
+
function f(w) {
|
|
3267
3284
|
const x = [];
|
|
3268
3285
|
for (let b = 0; b < w.length; b++) {
|
|
3269
3286
|
const y = w[b];
|
|
@@ -3297,21 +3314,21 @@ var Xr = Me.exports;
|
|
|
3297
3314
|
}
|
|
3298
3315
|
function v(w, x) {
|
|
3299
3316
|
const b = {}, y = { start: {} };
|
|
3300
|
-
let
|
|
3317
|
+
let k = ["start"];
|
|
3301
3318
|
for (let _ = 0; _ < w.length; _++) {
|
|
3302
3319
|
const E = w[_], $ = [];
|
|
3303
3320
|
for (let U = 0; U < E.length; U++) {
|
|
3304
3321
|
const R = E[U], rt = "" + _ + U;
|
|
3305
3322
|
$.push(rt), b[rt] = { node: R, lastCount: 0 }, y[rt] = {};
|
|
3306
|
-
for (let _t = 0; _t <
|
|
3307
|
-
const B =
|
|
3323
|
+
for (let _t = 0; _t < k.length; _t++) {
|
|
3324
|
+
const B = k[_t];
|
|
3308
3325
|
b[B] && b[B].node.mode === R.mode ? (y[B][rt] = p(b[B].lastCount + R.length, R.mode) - p(b[B].lastCount, R.mode), b[B].lastCount += R.length) : (b[B] && (b[B].lastCount = R.length), y[B][rt] = p(R.length, R.mode) + 4 + t.getCharCountIndicator(R.mode, x));
|
|
3309
3326
|
}
|
|
3310
3327
|
}
|
|
3311
|
-
|
|
3328
|
+
k = $;
|
|
3312
3329
|
}
|
|
3313
|
-
for (let _ = 0; _ <
|
|
3314
|
-
y[
|
|
3330
|
+
for (let _ = 0; _ < k.length; _++)
|
|
3331
|
+
y[k[_]].end = 0;
|
|
3315
3332
|
return { map: y, table: b };
|
|
3316
3333
|
}
|
|
3317
3334
|
function C(w, x) {
|
|
@@ -3336,7 +3353,7 @@ var Xr = Me.exports;
|
|
|
3336
3353
|
return typeof y == "string" ? b.push(C(y, null)) : y.data && b.push(C(y.data, y.mode)), b;
|
|
3337
3354
|
}, []);
|
|
3338
3355
|
}, e.fromString = function(x, b) {
|
|
3339
|
-
const y = h(x, l.isKanjiModeEnabled()),
|
|
3356
|
+
const y = h(x, l.isKanjiModeEnabled()), k = f(y), _ = v(k, b), E = a.find_path(_.map, "start", "end"), $ = [];
|
|
3340
3357
|
for (let U = 1; U < E.length - 1; U++)
|
|
3341
3358
|
$.push(_.table[E[U]].node);
|
|
3342
3359
|
return e.fromArray(u($));
|
|
@@ -3346,9 +3363,9 @@ var Xr = Me.exports;
|
|
|
3346
3363
|
);
|
|
3347
3364
|
};
|
|
3348
3365
|
})(De);
|
|
3349
|
-
const Ct = M, Tt = Pt,
|
|
3350
|
-
function
|
|
3351
|
-
const r = e.size, i =
|
|
3366
|
+
const Ct = M, Tt = Pt, ei = Rr, ri = Lr, ii = Se, ni = Pe, Ft = Ae, Ot = At, si = Ur, xt = _e, oi = Ne, ai = q, $t = De;
|
|
3367
|
+
function li(e, t) {
|
|
3368
|
+
const r = e.size, i = ni.getPositions(t);
|
|
3352
3369
|
for (let n = 0; n < i.length; n++) {
|
|
3353
3370
|
const s = i[n][0], o = i[n][1];
|
|
3354
3371
|
for (let l = -1; l <= 7; l++)
|
|
@@ -3357,15 +3374,15 @@ function ai(e, t) {
|
|
|
3357
3374
|
o + a <= -1 || r <= o + a || (l >= 0 && l <= 6 && (a === 0 || a === 6) || a >= 0 && a <= 6 && (l === 0 || l === 6) || l >= 2 && l <= 4 && a >= 2 && a <= 4 ? e.set(s + l, o + a, !0, !0) : e.set(s + l, o + a, !1, !0));
|
|
3358
3375
|
}
|
|
3359
3376
|
}
|
|
3360
|
-
function
|
|
3377
|
+
function ci(e) {
|
|
3361
3378
|
const t = e.size;
|
|
3362
3379
|
for (let r = 8; r < t - 8; r++) {
|
|
3363
3380
|
const i = r % 2 === 0;
|
|
3364
3381
|
e.set(r, 6, i, !0), e.set(6, r, i, !0);
|
|
3365
3382
|
}
|
|
3366
3383
|
}
|
|
3367
|
-
function
|
|
3368
|
-
const r =
|
|
3384
|
+
function di(e, t) {
|
|
3385
|
+
const r = ii.getPositions(t);
|
|
3369
3386
|
for (let i = 0; i < r.length; i++) {
|
|
3370
3387
|
const n = r[i][0], s = r[i][1];
|
|
3371
3388
|
for (let o = -2; o <= 2; o++)
|
|
@@ -3373,20 +3390,20 @@ function ci(e, t) {
|
|
|
3373
3390
|
o === -2 || o === 2 || l === -2 || l === 2 || o === 0 && l === 0 ? e.set(n + o, s + l, !0, !0) : e.set(n + o, s + l, !1, !0);
|
|
3374
3391
|
}
|
|
3375
3392
|
}
|
|
3376
|
-
function
|
|
3393
|
+
function ui(e, t) {
|
|
3377
3394
|
const r = e.size, i = xt.getEncodedBits(t);
|
|
3378
3395
|
let n, s, o;
|
|
3379
3396
|
for (let l = 0; l < 18; l++)
|
|
3380
3397
|
n = Math.floor(l / 3), s = l % 3 + r - 8 - 3, o = (i >> l & 1) === 1, e.set(n, s, o, !0), e.set(s, n, o, !0);
|
|
3381
3398
|
}
|
|
3382
3399
|
function Rt(e, t, r) {
|
|
3383
|
-
const i = e.size, n =
|
|
3400
|
+
const i = e.size, n = oi.getEncodedBits(t, r);
|
|
3384
3401
|
let s, o;
|
|
3385
3402
|
for (s = 0; s < 15; s++)
|
|
3386
3403
|
o = (n >> s & 1) === 1, s < 6 ? e.set(s, 8, o, !0) : s < 8 ? e.set(s + 1, 8, o, !0) : e.set(i - 15 + s, 8, o, !0), s < 8 ? e.set(8, i - s - 1, o, !0) : s < 9 ? e.set(8, 15 - s - 1 + 1, o, !0) : e.set(8, 15 - s - 1, o, !0);
|
|
3387
3404
|
e.set(i - 8, 8, 1, !0);
|
|
3388
3405
|
}
|
|
3389
|
-
function
|
|
3406
|
+
function hi(e, t) {
|
|
3390
3407
|
const r = e.size;
|
|
3391
3408
|
let i = -1, n = r - 1, s = 7, o = 0;
|
|
3392
3409
|
for (let l = r - 1; l > 0; l -= 2)
|
|
@@ -3402,10 +3419,10 @@ function ui(e, t) {
|
|
|
3402
3419
|
}
|
|
3403
3420
|
}
|
|
3404
3421
|
}
|
|
3405
|
-
function
|
|
3406
|
-
const i = new
|
|
3422
|
+
function pi(e, t, r) {
|
|
3423
|
+
const i = new ei();
|
|
3407
3424
|
r.forEach(function(a) {
|
|
3408
|
-
i.put(a.mode.bit, 4), i.put(a.getLength(),
|
|
3425
|
+
i.put(a.mode.bit, 4), i.put(a.getLength(), ai.getCharCountIndicator(a.mode, e)), a.write(i);
|
|
3409
3426
|
});
|
|
3410
3427
|
const n = Ct.getSymbolTotalCodewords(e), s = Ot.getTotalCodewordsCount(e, t), o = (n - s) * 8;
|
|
3411
3428
|
for (i.getLengthInBits() + 4 <= o && i.put(0, 4); i.getLengthInBits() % 8 !== 0; )
|
|
@@ -3413,29 +3430,29 @@ function hi(e, t, r) {
|
|
|
3413
3430
|
const l = (o - i.getLengthInBits()) / 8;
|
|
3414
3431
|
for (let a = 0; a < l; a++)
|
|
3415
3432
|
i.put(a % 2 ? 17 : 236, 8);
|
|
3416
|
-
return
|
|
3433
|
+
return mi(i, e, t);
|
|
3417
3434
|
}
|
|
3418
|
-
function
|
|
3419
|
-
const i = Ct.getSymbolTotalCodewords(t), n = Ot.getTotalCodewordsCount(t, r), s = i - n, o = Ot.getBlocksCount(t, r), l = i % o, a = o - l, c = Math.floor(i / o), d = Math.floor(s / o), h = d + 1, p = c - d, u = new
|
|
3420
|
-
let
|
|
3435
|
+
function mi(e, t, r) {
|
|
3436
|
+
const i = Ct.getSymbolTotalCodewords(t), n = Ot.getTotalCodewordsCount(t, r), s = i - n, o = Ot.getBlocksCount(t, r), l = i % o, a = o - l, c = Math.floor(i / o), d = Math.floor(s / o), h = d + 1, p = c - d, u = new si(p);
|
|
3437
|
+
let f = 0;
|
|
3421
3438
|
const v = new Array(o), C = new Array(o);
|
|
3422
3439
|
let w = 0;
|
|
3423
3440
|
const x = new Uint8Array(e.buffer);
|
|
3424
3441
|
for (let E = 0; E < o; E++) {
|
|
3425
3442
|
const $ = E < a ? d : h;
|
|
3426
|
-
v[E] = x.slice(
|
|
3443
|
+
v[E] = x.slice(f, f + $), C[E] = u.encode(v[E]), f += $, w = Math.max(w, $);
|
|
3427
3444
|
}
|
|
3428
3445
|
const b = new Uint8Array(i);
|
|
3429
|
-
let y = 0,
|
|
3430
|
-
for (
|
|
3446
|
+
let y = 0, k, _;
|
|
3447
|
+
for (k = 0; k < w; k++)
|
|
3431
3448
|
for (_ = 0; _ < o; _++)
|
|
3432
|
-
|
|
3433
|
-
for (
|
|
3449
|
+
k < v[_].length && (b[y++] = v[_][k]);
|
|
3450
|
+
for (k = 0; k < p; k++)
|
|
3434
3451
|
for (_ = 0; _ < o; _++)
|
|
3435
|
-
b[y++] = C[_][
|
|
3452
|
+
b[y++] = C[_][k];
|
|
3436
3453
|
return b;
|
|
3437
3454
|
}
|
|
3438
|
-
function
|
|
3455
|
+
function fi(e, t, r, i) {
|
|
3439
3456
|
let n;
|
|
3440
3457
|
if (Array.isArray(e))
|
|
3441
3458
|
n = $t.fromArray(e);
|
|
@@ -3460,8 +3477,8 @@ The chosen QR Code version cannot contain this amount of data.
|
|
|
3460
3477
|
Minimum version required to store current data is: ` + s + `.
|
|
3461
3478
|
`
|
|
3462
3479
|
);
|
|
3463
|
-
const o =
|
|
3464
|
-
return
|
|
3480
|
+
const o = pi(t, r, n), l = Ct.getSymbolSize(t), a = new ri(l);
|
|
3481
|
+
return li(a, t), ci(a), di(a, t), Rt(a, r, 0), t >= 7 && ui(a, t), hi(a, o), isNaN(i) && (i = Ft.getBestMask(
|
|
3465
3482
|
a,
|
|
3466
3483
|
Rt.bind(null, a, r)
|
|
3467
3484
|
)), Ft.applyMask(i, a), Rt(a, r, i), {
|
|
@@ -3476,7 +3493,7 @@ we.create = function(t, r) {
|
|
|
3476
3493
|
if (typeof t > "u" || t === "")
|
|
3477
3494
|
throw new Error("No input text");
|
|
3478
3495
|
let i = Tt.M, n, s;
|
|
3479
|
-
return typeof r < "u" && (i = Tt.from(r.errorCorrectionLevel, Tt.M), n = xt.from(r.version), s = Ft.from(r.maskPattern), r.toSJISFunc && Ct.setToSJISFunction(r.toSJISFunc)),
|
|
3496
|
+
return typeof r < "u" && (i = Tt.from(r.errorCorrectionLevel, Tt.M), n = xt.from(r.version), s = Ft.from(r.maskPattern), r.toSJISFunc && Ct.setToSJISFunction(r.toSJISFunc)), fi(t, n, i, s);
|
|
3480
3497
|
};
|
|
3481
3498
|
var Te = {}, Qt = {};
|
|
3482
3499
|
(function(e) {
|
|
@@ -3521,12 +3538,12 @@ var Te = {}, Qt = {};
|
|
|
3521
3538
|
const o = n.modules.size, l = n.modules.data, a = e.getScale(o, s), c = Math.floor((o + s.margin * 2) * a), d = s.margin * a, h = [s.color.light, s.color.dark];
|
|
3522
3539
|
for (let p = 0; p < c; p++)
|
|
3523
3540
|
for (let u = 0; u < c; u++) {
|
|
3524
|
-
let
|
|
3541
|
+
let f = (p * c + u) * 4, v = s.color.light;
|
|
3525
3542
|
if (p >= d && u >= d && p < c - d && u < c - d) {
|
|
3526
3543
|
const C = Math.floor((p - d) / a), w = Math.floor((u - d) / a);
|
|
3527
3544
|
v = h[l[C * o + w] ? 1 : 0];
|
|
3528
3545
|
}
|
|
3529
|
-
i[
|
|
3546
|
+
i[f++] = v.r, i[f++] = v.g, i[f++] = v.b, i[f] = v.a;
|
|
3530
3547
|
}
|
|
3531
3548
|
};
|
|
3532
3549
|
})(Qt);
|
|
@@ -3555,7 +3572,7 @@ var Te = {}, Qt = {};
|
|
|
3555
3572
|
};
|
|
3556
3573
|
})(Te);
|
|
3557
3574
|
var $e = {};
|
|
3558
|
-
const
|
|
3575
|
+
const gi = Qt;
|
|
3559
3576
|
function de(e, t) {
|
|
3560
3577
|
const r = e.a / 255, i = t + '="' + e.hex + '"';
|
|
3561
3578
|
return r < 1 ? i + " " + t + '-opacity="' + r.toFixed(2).slice(1) + '"' : i;
|
|
@@ -3564,7 +3581,7 @@ function Lt(e, t, r) {
|
|
|
3564
3581
|
let i = e + t;
|
|
3565
3582
|
return typeof r < "u" && (i += " " + r), i;
|
|
3566
3583
|
}
|
|
3567
|
-
function
|
|
3584
|
+
function yi(e, t, r) {
|
|
3568
3585
|
let i = "", n = 0, s = !1, o = 0;
|
|
3569
3586
|
for (let l = 0; l < e.length; l++) {
|
|
3570
3587
|
const a = Math.floor(l % t), c = Math.floor(l / t);
|
|
@@ -3573,14 +3590,14 @@ function gi(e, t, r) {
|
|
|
3573
3590
|
return i;
|
|
3574
3591
|
}
|
|
3575
3592
|
$e.render = function(t, r, i) {
|
|
3576
|
-
const n =
|
|
3593
|
+
const n = gi.getOptions(r), s = t.modules.size, o = t.modules.data, l = s + n.margin * 2, a = n.color.light.a ? "<path " + de(n.color.light, "fill") + ' d="M0 0h' + l + "v" + l + 'H0z"/>' : "", c = "<path " + de(n.color.dark, "stroke") + ' d="' + yi(o, s, n.margin) + '"/>', d = 'viewBox="0 0 ' + l + " " + l + '"', p = '<svg xmlns="http://www.w3.org/2000/svg" ' + (n.width ? 'width="' + n.width + '" height="' + n.width + '" ' : "") + d + ' shape-rendering="crispEdges">' + a + c + `</svg>
|
|
3577
3594
|
`;
|
|
3578
3595
|
return typeof i == "function" && i(null, p), p;
|
|
3579
3596
|
};
|
|
3580
|
-
const
|
|
3581
|
-
function
|
|
3597
|
+
const bi = Tr, zt = we, Re = Te, vi = $e;
|
|
3598
|
+
function Jt(e, t, r, i, n) {
|
|
3582
3599
|
const s = [].slice.call(arguments, 1), o = s.length, l = typeof s[o - 1] == "function";
|
|
3583
|
-
if (!l && !
|
|
3600
|
+
if (!l && !bi())
|
|
3584
3601
|
throw new Error("Callback required as last argument");
|
|
3585
3602
|
if (l) {
|
|
3586
3603
|
if (o < 2)
|
|
@@ -3606,15 +3623,15 @@ function Wt(e, t, r, i, n) {
|
|
|
3606
3623
|
}
|
|
3607
3624
|
}
|
|
3608
3625
|
pt.create = zt.create;
|
|
3609
|
-
pt.toCanvas =
|
|
3610
|
-
pt.toDataURL =
|
|
3611
|
-
pt.toString =
|
|
3612
|
-
return
|
|
3626
|
+
pt.toCanvas = Jt.bind(null, Re.render);
|
|
3627
|
+
pt.toDataURL = Jt.bind(null, Re.renderToDataURL);
|
|
3628
|
+
pt.toString = Jt.bind(null, function(e, t, r) {
|
|
3629
|
+
return vi.render(e, r);
|
|
3613
3630
|
});
|
|
3614
|
-
var
|
|
3615
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
3631
|
+
var wi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, P = (e, t, r, i) => {
|
|
3632
|
+
for (var n = i > 1 ? void 0 : i ? xi(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
3616
3633
|
(o = e[s]) && (n = (i ? o(t, r, n) : o(n)) || n);
|
|
3617
|
-
return i && n &&
|
|
3634
|
+
return i && n && wi(t, r, n), n;
|
|
3618
3635
|
};
|
|
3619
3636
|
let S = class extends ot {
|
|
3620
3637
|
constructor() {
|
|
@@ -3772,43 +3789,43 @@ let S = class extends ot {
|
|
|
3772
3789
|
var r;
|
|
3773
3790
|
return !((r = this.excludePaymentMethods) != null && r.includes(t.id));
|
|
3774
3791
|
}).map((t) => {
|
|
3775
|
-
if (t.id ===
|
|
3792
|
+
if (t.id === m.PAYNOW && this.getTransactionData().currency !== "SGD")
|
|
3776
3793
|
return {
|
|
3777
3794
|
id: t.id,
|
|
3778
3795
|
enabled: !1,
|
|
3779
3796
|
disabledReason: "PayNow is only available for SGD currency"
|
|
3780
3797
|
};
|
|
3781
|
-
if (t.id ===
|
|
3798
|
+
if (t.id === m.PROMPTPAY && this.getTransactionData().currency !== "THB")
|
|
3782
3799
|
return {
|
|
3783
3800
|
id: t.id,
|
|
3784
3801
|
enabled: !1,
|
|
3785
3802
|
disabledReason: "PromptPay is only available for THB currency"
|
|
3786
3803
|
};
|
|
3787
|
-
if (t.id ===
|
|
3804
|
+
if (t.id === m.DUITNOW && this.getTransactionData().currency !== "MYR")
|
|
3788
3805
|
return {
|
|
3789
3806
|
id: t.id,
|
|
3790
3807
|
enabled: !1,
|
|
3791
3808
|
disabledReason: "DuitNow is only available for MYR currency"
|
|
3792
3809
|
};
|
|
3793
|
-
if (t.id ===
|
|
3810
|
+
if (t.id === m.GOPAY && this.getTransactionData().currency !== "IDR")
|
|
3794
3811
|
return {
|
|
3795
3812
|
id: t.id,
|
|
3796
3813
|
enabled: !1,
|
|
3797
3814
|
disabledReason: "GoPay is only available for IDR currency"
|
|
3798
3815
|
};
|
|
3799
|
-
if (t.id ===
|
|
3816
|
+
if (t.id === m.BOOST && this.getTransactionData().currency !== "MYR")
|
|
3800
3817
|
return {
|
|
3801
3818
|
id: t.id,
|
|
3802
3819
|
enabled: !1,
|
|
3803
3820
|
disabledReason: "Boost is only available for MYR currency"
|
|
3804
3821
|
};
|
|
3805
|
-
if (t.id ===
|
|
3822
|
+
if (t.id === m.SHOPEEPAY && this.getTransactionData().currency !== "MYR")
|
|
3806
3823
|
return {
|
|
3807
3824
|
id: t.id,
|
|
3808
3825
|
enabled: !1,
|
|
3809
3826
|
disabledReason: "ShopeePay is only available for MYR currency"
|
|
3810
3827
|
};
|
|
3811
|
-
if (t.id ===
|
|
3828
|
+
if (t.id === m.ATOM) {
|
|
3812
3829
|
const i = this.getTransactionData().currency;
|
|
3813
3830
|
if (i !== "SGD" && i !== "MYR")
|
|
3814
3831
|
return {
|
|
@@ -3817,30 +3834,34 @@ let S = class extends ot {
|
|
|
3817
3834
|
disabledReason: "Atom is only available for SGD and MYR currencies"
|
|
3818
3835
|
};
|
|
3819
3836
|
}
|
|
3820
|
-
return t.id ===
|
|
3837
|
+
return t.id === m.DANA && this.getTransactionData().currency !== "IDR" ? {
|
|
3821
3838
|
id: t.id,
|
|
3822
3839
|
enabled: !1,
|
|
3823
3840
|
disabledReason: "Dana is only available for IDR currency"
|
|
3824
|
-
} : t.id ===
|
|
3841
|
+
} : t.id === m.TNG && this.getTransactionData().currency !== "MYR" ? {
|
|
3825
3842
|
id: t.id,
|
|
3826
3843
|
enabled: !1,
|
|
3827
3844
|
disabledReason: "Touch 'n Go is only available for MYR currency"
|
|
3828
|
-
} : t.id ===
|
|
3845
|
+
} : t.id === m.ALIPAYCN && this.getTransactionData().currency !== "CNY" ? {
|
|
3829
3846
|
id: t.id,
|
|
3830
3847
|
enabled: !1,
|
|
3831
3848
|
disabledReason: "Alipay is only available for CNY currency"
|
|
3832
|
-
} : t.id ===
|
|
3849
|
+
} : t.id === m.ALIPAYHK && this.getTransactionData().currency !== "HKD" ? {
|
|
3833
3850
|
id: t.id,
|
|
3834
3851
|
enabled: !1,
|
|
3835
3852
|
disabledReason: "AlipayHK is only available for HKD currency"
|
|
3836
|
-
} : t.id ===
|
|
3853
|
+
} : t.id === m.GCASH && this.getTransactionData().currency !== "PHP" ? {
|
|
3837
3854
|
id: t.id,
|
|
3838
3855
|
enabled: !1,
|
|
3839
3856
|
disabledReason: "GCash is only available for PHP currency"
|
|
3840
|
-
} : t.id ===
|
|
3857
|
+
} : t.id === m.KONBINI && this.getTransactionData().currency !== "JPY" ? {
|
|
3841
3858
|
id: t.id,
|
|
3842
3859
|
enabled: !1,
|
|
3843
3860
|
disabledReason: "Konbini is only available for JPY currency"
|
|
3861
|
+
} : t.id === m.PAYEASY && this.getTransactionData().currency !== "JPY" ? {
|
|
3862
|
+
id: t.id,
|
|
3863
|
+
enabled: !1,
|
|
3864
|
+
disabledReason: "Pay-Easy is only available for JPY currency"
|
|
3844
3865
|
} : {
|
|
3845
3866
|
id: t.id,
|
|
3846
3867
|
enabled: !0
|
|
@@ -4007,6 +4028,12 @@ let S = class extends ot {
|
|
|
4007
4028
|
const { redirectUrl: r } = t.payload;
|
|
4008
4029
|
r && (window.location.href = r);
|
|
4009
4030
|
}
|
|
4031
|
+
), this.sdk.on(
|
|
4032
|
+
"payeasy_redirect",
|
|
4033
|
+
(t) => {
|
|
4034
|
+
const { redirectUrl: r } = t.payload;
|
|
4035
|
+
r && (window.location.href = r);
|
|
4036
|
+
}
|
|
4010
4037
|
), this.sdk.initialize({
|
|
4011
4038
|
amount: this.amount,
|
|
4012
4039
|
currency: this.currency,
|
|
@@ -4056,8 +4083,8 @@ let S = class extends ot {
|
|
|
4056
4083
|
const a = /* @__PURE__ */ new Date(), c = a.getFullYear(), d = a.getMonth() + 1;
|
|
4057
4084
|
let h;
|
|
4058
4085
|
if (o.length === 2) {
|
|
4059
|
-
const p = parseInt(o, 10), u = c % 100,
|
|
4060
|
-
p < u && u - p > 80 ? h =
|
|
4086
|
+
const p = parseInt(o, 10), u = c % 100, f = Math.floor(c / 100) * 100;
|
|
4087
|
+
p < u && u - p > 80 ? h = f + 100 + p : h = f + p;
|
|
4061
4088
|
} else
|
|
4062
4089
|
return { valid: !1, error: "Invalid year format" };
|
|
4063
4090
|
return h < c ? { valid: !1, error: "Card has expired" } : h === c && l < d ? { valid: !1, error: "Card has expired" } : { valid: !0 };
|
|
@@ -4077,7 +4104,7 @@ let S = class extends ot {
|
|
|
4077
4104
|
return;
|
|
4078
4105
|
this.paymentLocked = !0;
|
|
4079
4106
|
const e = this.cardFormData.expiry.split("/"), t = (e[0] || "").trim(), i = `20${(e[1] || "").trim().substring(0, 2)}`;
|
|
4080
|
-
this.sdk.submitPayment(
|
|
4107
|
+
this.sdk.submitPayment(m.CARD, {
|
|
4081
4108
|
cardNumber: this.cardFormData.cardNumber.replace(/\s/g, ""),
|
|
4082
4109
|
expiryMonth: t,
|
|
4083
4110
|
expiryYear: i,
|
|
@@ -4089,7 +4116,7 @@ let S = class extends ot {
|
|
|
4089
4116
|
});
|
|
4090
4117
|
}
|
|
4091
4118
|
handlePayNowPayment() {
|
|
4092
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4119
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.PAYNOW, {
|
|
4093
4120
|
firstName: this.firstName,
|
|
4094
4121
|
lastName: this.lastName,
|
|
4095
4122
|
email: this.email,
|
|
@@ -4097,7 +4124,7 @@ let S = class extends ot {
|
|
|
4097
4124
|
}));
|
|
4098
4125
|
}
|
|
4099
4126
|
handlePromptPayPayment() {
|
|
4100
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4127
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.PROMPTPAY, {
|
|
4101
4128
|
firstName: this.firstName,
|
|
4102
4129
|
lastName: this.lastName,
|
|
4103
4130
|
email: this.email,
|
|
@@ -4105,7 +4132,7 @@ let S = class extends ot {
|
|
|
4105
4132
|
}));
|
|
4106
4133
|
}
|
|
4107
4134
|
handleDuitNowPayment() {
|
|
4108
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4135
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.DUITNOW, {
|
|
4109
4136
|
firstName: this.firstName,
|
|
4110
4137
|
lastName: this.lastName,
|
|
4111
4138
|
email: this.email,
|
|
@@ -4113,7 +4140,7 @@ let S = class extends ot {
|
|
|
4113
4140
|
}));
|
|
4114
4141
|
}
|
|
4115
4142
|
handleGoPayPayment() {
|
|
4116
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4143
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.GOPAY, {
|
|
4117
4144
|
firstName: this.firstName,
|
|
4118
4145
|
lastName: this.lastName,
|
|
4119
4146
|
email: this.email,
|
|
@@ -4121,7 +4148,7 @@ let S = class extends ot {
|
|
|
4121
4148
|
}));
|
|
4122
4149
|
}
|
|
4123
4150
|
handleBoostPayment() {
|
|
4124
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4151
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.BOOST, {
|
|
4125
4152
|
firstName: this.firstName,
|
|
4126
4153
|
lastName: this.lastName,
|
|
4127
4154
|
email: this.email,
|
|
@@ -4129,7 +4156,7 @@ let S = class extends ot {
|
|
|
4129
4156
|
}));
|
|
4130
4157
|
}
|
|
4131
4158
|
handleShopeePayPayment() {
|
|
4132
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4159
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.SHOPEEPAY, {
|
|
4133
4160
|
firstName: this.firstName,
|
|
4134
4161
|
lastName: this.lastName,
|
|
4135
4162
|
email: this.email,
|
|
@@ -4137,7 +4164,7 @@ let S = class extends ot {
|
|
|
4137
4164
|
}));
|
|
4138
4165
|
}
|
|
4139
4166
|
handleAtomPayment() {
|
|
4140
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4167
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.ATOM, {
|
|
4141
4168
|
firstName: this.firstName,
|
|
4142
4169
|
lastName: this.lastName,
|
|
4143
4170
|
email: this.email,
|
|
@@ -4145,7 +4172,7 @@ let S = class extends ot {
|
|
|
4145
4172
|
}));
|
|
4146
4173
|
}
|
|
4147
4174
|
handleDanaPayment() {
|
|
4148
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4175
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.DANA, {
|
|
4149
4176
|
firstName: this.firstName,
|
|
4150
4177
|
lastName: this.lastName,
|
|
4151
4178
|
email: this.email,
|
|
@@ -4153,7 +4180,7 @@ let S = class extends ot {
|
|
|
4153
4180
|
}));
|
|
4154
4181
|
}
|
|
4155
4182
|
handleTngPayment() {
|
|
4156
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4183
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.TNG, {
|
|
4157
4184
|
firstName: this.firstName,
|
|
4158
4185
|
lastName: this.lastName,
|
|
4159
4186
|
email: this.email,
|
|
@@ -4161,7 +4188,7 @@ let S = class extends ot {
|
|
|
4161
4188
|
}));
|
|
4162
4189
|
}
|
|
4163
4190
|
handleAlipayCNPayment() {
|
|
4164
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4191
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.ALIPAYCN, {
|
|
4165
4192
|
firstName: this.firstName,
|
|
4166
4193
|
lastName: this.lastName,
|
|
4167
4194
|
email: this.email,
|
|
@@ -4169,7 +4196,7 @@ let S = class extends ot {
|
|
|
4169
4196
|
}));
|
|
4170
4197
|
}
|
|
4171
4198
|
handleAlipayHKPayment() {
|
|
4172
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4199
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.ALIPAYHK, {
|
|
4173
4200
|
firstName: this.firstName,
|
|
4174
4201
|
lastName: this.lastName,
|
|
4175
4202
|
email: this.email,
|
|
@@ -4177,7 +4204,7 @@ let S = class extends ot {
|
|
|
4177
4204
|
}));
|
|
4178
4205
|
}
|
|
4179
4206
|
handleGCashPayment() {
|
|
4180
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4207
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.GCASH, {
|
|
4181
4208
|
firstName: this.firstName,
|
|
4182
4209
|
lastName: this.lastName,
|
|
4183
4210
|
email: this.email,
|
|
@@ -4185,7 +4212,15 @@ let S = class extends ot {
|
|
|
4185
4212
|
}));
|
|
4186
4213
|
}
|
|
4187
4214
|
handleKonbiniPayment() {
|
|
4188
|
-
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(
|
|
4215
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.KONBINI, {
|
|
4216
|
+
firstName: this.firstName,
|
|
4217
|
+
lastName: this.lastName,
|
|
4218
|
+
email: this.email,
|
|
4219
|
+
phoneNumber: this.phoneNumber
|
|
4220
|
+
}));
|
|
4221
|
+
}
|
|
4222
|
+
handlePayEasyPayment() {
|
|
4223
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(m.PAYEASY, {
|
|
4189
4224
|
firstName: this.firstName,
|
|
4190
4225
|
lastName: this.lastName,
|
|
4191
4226
|
email: this.email,
|
|
@@ -4912,6 +4947,42 @@ let S = class extends ot {
|
|
|
4912
4947
|
</div>
|
|
4913
4948
|
`;
|
|
4914
4949
|
}
|
|
4950
|
+
renderPayEasyContent() {
|
|
4951
|
+
return g`
|
|
4952
|
+
<div class="paynow-container">
|
|
4953
|
+
<div class="paynow-instructions">
|
|
4954
|
+
<h3 class="instructions-title">How to Pay with Pay-Easy:</h3>
|
|
4955
|
+
|
|
4956
|
+
<div class="instruction-steps">
|
|
4957
|
+
<div class="instruction-step">
|
|
4958
|
+
<div class="step-number">1</div>
|
|
4959
|
+
<p class="step-text">Click <strong>"Pay"</strong> to get your payment details.</p>
|
|
4960
|
+
</div>
|
|
4961
|
+
|
|
4962
|
+
<div class="instruction-step">
|
|
4963
|
+
<div class="step-number">2</div>
|
|
4964
|
+
<p class="step-text">Use your bank's ATM or online banking to complete the transfer.</p>
|
|
4965
|
+
</div>
|
|
4966
|
+
|
|
4967
|
+
<div class="instruction-step">
|
|
4968
|
+
<div class="step-number">3</div>
|
|
4969
|
+
<p class="step-text">Enter the payment details provided.</p>
|
|
4970
|
+
</div>
|
|
4971
|
+
</div>
|
|
4972
|
+
|
|
4973
|
+
<div class="submit-section">
|
|
4974
|
+
<button
|
|
4975
|
+
class="pay-button ${this.currentState.status === "processing" || this.currentState.status === "requires_action" ? "loading" : ""}"
|
|
4976
|
+
@click=${this.handlePayEasyPayment}
|
|
4977
|
+
?disabled=${this.currentState.status === "processing" || this.currentState.status === "requires_action"}
|
|
4978
|
+
>
|
|
4979
|
+
${this.currentState.status === "processing" || this.currentState.status === "requires_action" ? "Redirecting..." : `Pay ${this.getPayButtonAmount()}`}
|
|
4980
|
+
</button>
|
|
4981
|
+
</div>
|
|
4982
|
+
</div>
|
|
4983
|
+
</div>
|
|
4984
|
+
`;
|
|
4985
|
+
}
|
|
4915
4986
|
render3DSModal() {
|
|
4916
4987
|
return !this.show3DSModal || !this.nextActionUrl ? null : g`
|
|
4917
4988
|
<div class="modal-overlay">
|
|
@@ -4972,38 +5043,40 @@ let S = class extends ot {
|
|
|
4972
5043
|
}
|
|
4973
5044
|
const i = (o) => {
|
|
4974
5045
|
switch (o) {
|
|
4975
|
-
case
|
|
5046
|
+
case m.CARD:
|
|
4976
5047
|
return "Card";
|
|
4977
|
-
case
|
|
5048
|
+
case m.PAYNOW:
|
|
4978
5049
|
return "PayNow";
|
|
4979
|
-
case
|
|
5050
|
+
case m.PROMPTPAY:
|
|
4980
5051
|
return "PromptPay";
|
|
4981
|
-
case
|
|
5052
|
+
case m.DUITNOW:
|
|
4982
5053
|
return "DuitNow";
|
|
4983
|
-
case
|
|
5054
|
+
case m.GOPAY:
|
|
4984
5055
|
return "GoPay";
|
|
4985
|
-
case
|
|
5056
|
+
case m.BOOST:
|
|
4986
5057
|
return "Boost";
|
|
4987
|
-
case
|
|
5058
|
+
case m.SHOPEEPAY:
|
|
4988
5059
|
return "ShopeePay";
|
|
4989
|
-
case
|
|
5060
|
+
case m.ATOM:
|
|
4990
5061
|
return "Atome";
|
|
4991
|
-
case
|
|
5062
|
+
case m.DANA:
|
|
4992
5063
|
return "Dana";
|
|
4993
|
-
case
|
|
5064
|
+
case m.TNG:
|
|
4994
5065
|
return "Touch 'n Go";
|
|
4995
|
-
case
|
|
5066
|
+
case m.ALIPAYCN:
|
|
4996
5067
|
return "Alipay";
|
|
4997
|
-
case
|
|
5068
|
+
case m.ALIPAYHK:
|
|
4998
5069
|
return "AlipayHK";
|
|
4999
|
-
case
|
|
5070
|
+
case m.GCASH:
|
|
5000
5071
|
return "GCash";
|
|
5001
|
-
case
|
|
5072
|
+
case m.KONBINI:
|
|
5002
5073
|
return "Konbini";
|
|
5074
|
+
case m.PAYEASY:
|
|
5075
|
+
return "Pay-Easy";
|
|
5003
5076
|
default:
|
|
5004
5077
|
return o;
|
|
5005
5078
|
}
|
|
5006
|
-
}, n = (o) => o ===
|
|
5079
|
+
}, n = (o) => o === m.CARD ? g`
|
|
5007
5080
|
<div class="method-icon-right">
|
|
5008
5081
|
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
5009
5082
|
<path
|
|
@@ -5016,58 +5089,62 @@ let S = class extends ot {
|
|
|
5016
5089
|
/>
|
|
5017
5090
|
</svg>
|
|
5018
5091
|
</div>
|
|
5019
|
-
` : o ===
|
|
5092
|
+
` : o === m.PAYNOW ? g`
|
|
5020
5093
|
<div class="method-icon-right">
|
|
5021
5094
|
<img src="${dr}" alt="PayNow" style="width: 45px; height: auto;" />
|
|
5022
5095
|
</div>
|
|
5023
|
-
` : o ===
|
|
5096
|
+
` : o === m.PROMPTPAY ? g`
|
|
5024
5097
|
<div class="method-icon-right">
|
|
5025
5098
|
<img src="${ur}" alt="PromptPay" style="width: 45px; height: auto;" />
|
|
5026
5099
|
</div>
|
|
5027
|
-
` : o ===
|
|
5100
|
+
` : o === m.DUITNOW ? g`
|
|
5028
5101
|
<div class="method-icon-right">
|
|
5029
5102
|
<img src="${hr}" alt="DuitNow" style="width: 45px; height: auto;" />
|
|
5030
5103
|
</div>
|
|
5031
|
-
` : o ===
|
|
5104
|
+
` : o === m.GOPAY ? g`
|
|
5032
5105
|
<div class="method-icon-right">
|
|
5033
5106
|
<img src="${pr}" alt="GoPay" style="width: 45px; height: auto;" />
|
|
5034
5107
|
</div>
|
|
5035
|
-
` : o ===
|
|
5108
|
+
` : o === m.BOOST ? g`
|
|
5036
5109
|
<div class="method-icon-right">
|
|
5037
5110
|
<img src="${mr}" alt="Boost" style="width: 45px; height: auto;" />
|
|
5038
5111
|
</div>
|
|
5039
|
-
` : o ===
|
|
5112
|
+
` : o === m.SHOPEEPAY ? g`
|
|
5040
5113
|
<div class="method-icon-right">
|
|
5041
5114
|
<img src="${fr}" alt="ShopeePay" style="width: 45px; height: auto;" />
|
|
5042
5115
|
</div>
|
|
5043
|
-
` : o ===
|
|
5116
|
+
` : o === m.ATOM ? g`
|
|
5044
5117
|
<div class="method-icon-right">
|
|
5045
5118
|
<img src="${gr}" alt="Atome" style="width: 45px; height: auto;" />
|
|
5046
5119
|
</div>
|
|
5047
|
-
` : o ===
|
|
5120
|
+
` : o === m.DANA ? g`
|
|
5048
5121
|
<div class="method-icon-right">
|
|
5049
5122
|
<img src="${yr}" alt="Dana" style="width: 45px; height: auto;" />
|
|
5050
5123
|
</div>
|
|
5051
|
-
` : o ===
|
|
5124
|
+
` : o === m.TNG ? g`
|
|
5052
5125
|
<div class="method-icon-right">
|
|
5053
5126
|
<img src="${br}" alt="Touch 'n Go" style="width: 45px; height: auto;" />
|
|
5054
5127
|
</div>
|
|
5055
|
-
` : o ===
|
|
5128
|
+
` : o === m.ALIPAYCN ? g`
|
|
5056
5129
|
<div class="method-icon-right">
|
|
5057
5130
|
<img src="${vr}" alt="Alipay" style="width: 45px; height: auto;" />
|
|
5058
5131
|
</div>
|
|
5059
|
-
` : o ===
|
|
5132
|
+
` : o === m.ALIPAYHK ? g`
|
|
5060
5133
|
<div class="method-icon-right">
|
|
5061
5134
|
<img src="${wr}" alt="AlipayHK" style="width: 45px; height: auto;" />
|
|
5062
5135
|
</div>
|
|
5063
|
-
` : o ===
|
|
5136
|
+
` : o === m.GCASH ? g`
|
|
5064
5137
|
<div class="method-icon-right">
|
|
5065
5138
|
<img src="${xr}" alt="GCash" style="width: 45px; height: auto;" />
|
|
5066
5139
|
</div>
|
|
5067
|
-
` : o ===
|
|
5140
|
+
` : o === m.KONBINI ? g`
|
|
5068
5141
|
<div class="method-icon-right">
|
|
5069
5142
|
<img src="${Sr}" alt="Konbini" style="width: 45px; height: auto;" />
|
|
5070
5143
|
</div>
|
|
5144
|
+
` : o === m.PAYEASY ? g`
|
|
5145
|
+
<div class="method-icon-right">
|
|
5146
|
+
<img src="${Pr}" alt="Pay-Easy" style="width: 45px; height: auto;" />
|
|
5147
|
+
</div>
|
|
5071
5148
|
` : null, s = [
|
|
5072
5149
|
this.width ? `--one-payment-width: ${this.width}` : "",
|
|
5073
5150
|
this.maxWidth ? `--one-payment-max-width: ${this.maxWidth}` : ""
|
|
@@ -5103,7 +5180,7 @@ let S = class extends ot {
|
|
|
5103
5180
|
${n(o.id)}
|
|
5104
5181
|
</div>
|
|
5105
5182
|
${l ? g`<div class="method-content">
|
|
5106
|
-
${o.id ===
|
|
5183
|
+
${o.id === m.CARD ? this.renderCardForm() : o.id === m.PAYNOW ? this.renderPayNowContent() : o.id === m.PROMPTPAY ? this.renderPromptPayContent() : o.id === m.DUITNOW ? this.renderDuitNowContent() : o.id === m.GOPAY ? this.renderGoPayContent() : o.id === m.BOOST ? this.renderBoostContent() : o.id === m.SHOPEEPAY ? this.renderShopeePayContent() : o.id === m.ATOM ? this.renderAtomContent() : o.id === m.DANA ? this.renderDanaContent() : o.id === m.TNG ? this.renderTngContent() : o.id === m.ALIPAYCN ? this.renderAlipayCNContent() : o.id === m.ALIPAYHK ? this.renderAlipayHKContent() : o.id === m.GCASH ? this.renderGCashContent() : o.id === m.KONBINI ? this.renderKonbiniContent() : o.id === m.PAYEASY ? this.renderPayEasyContent() : null}
|
|
5107
5184
|
</div>` : ""}
|
|
5108
5185
|
</div>
|
|
5109
5186
|
`;
|
|
@@ -6480,64 +6557,64 @@ P([
|
|
|
6480
6557
|
D({ type: Object })
|
|
6481
6558
|
], S.prototype, "appearance", 2);
|
|
6482
6559
|
P([
|
|
6483
|
-
|
|
6560
|
+
I()
|
|
6484
6561
|
], S.prototype, "currentState", 2);
|
|
6485
6562
|
P([
|
|
6486
|
-
|
|
6563
|
+
I()
|
|
6487
6564
|
], S.prototype, "selectedMethod", 2);
|
|
6488
6565
|
P([
|
|
6489
|
-
|
|
6566
|
+
I()
|
|
6490
6567
|
], S.prototype, "cardFormData", 2);
|
|
6491
6568
|
P([
|
|
6492
|
-
|
|
6569
|
+
I()
|
|
6493
6570
|
], S.prototype, "formErrors", 2);
|
|
6494
6571
|
P([
|
|
6495
|
-
|
|
6572
|
+
I()
|
|
6496
6573
|
], S.prototype, "paymentData", 2);
|
|
6497
6574
|
P([
|
|
6498
|
-
|
|
6575
|
+
I()
|
|
6499
6576
|
], S.prototype, "feesExpanded", 2);
|
|
6500
6577
|
P([
|
|
6501
|
-
|
|
6578
|
+
I()
|
|
6502
6579
|
], S.prototype, "isInitializing", 2);
|
|
6503
6580
|
P([
|
|
6504
|
-
|
|
6581
|
+
I()
|
|
6505
6582
|
], S.prototype, "cardBrand", 2);
|
|
6506
6583
|
P([
|
|
6507
|
-
|
|
6584
|
+
I()
|
|
6508
6585
|
], S.prototype, "paymentLocked", 2);
|
|
6509
6586
|
P([
|
|
6510
|
-
|
|
6587
|
+
I()
|
|
6511
6588
|
], S.prototype, "show3DSModal", 2);
|
|
6512
6589
|
P([
|
|
6513
|
-
|
|
6590
|
+
I()
|
|
6514
6591
|
], S.prototype, "showQRModal", 2);
|
|
6515
6592
|
P([
|
|
6516
|
-
|
|
6593
|
+
I()
|
|
6517
6594
|
], S.prototype, "nextActionUrl", 2);
|
|
6518
6595
|
P([
|
|
6519
|
-
|
|
6596
|
+
I()
|
|
6520
6597
|
], S.prototype, "qrCode", 2);
|
|
6521
6598
|
P([
|
|
6522
|
-
|
|
6599
|
+
I()
|
|
6523
6600
|
], S.prototype, "qrCodeDataUrl", 2);
|
|
6524
6601
|
P([
|
|
6525
|
-
|
|
6602
|
+
I()
|
|
6526
6603
|
], S.prototype, "qrAutoResumeTimer", 2);
|
|
6527
6604
|
P([
|
|
6528
|
-
|
|
6605
|
+
I()
|
|
6529
6606
|
], S.prototype, "qrPollingInProgress", 2);
|
|
6530
6607
|
S = P([
|
|
6531
6608
|
rr("one-payment")
|
|
6532
6609
|
], S);
|
|
6533
|
-
const
|
|
6610
|
+
const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6534
6611
|
__proto__: null,
|
|
6535
6612
|
get OnePayment() {
|
|
6536
6613
|
return S;
|
|
6537
6614
|
}
|
|
6538
6615
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6539
6616
|
function ki() {
|
|
6540
|
-
customElements.get("one-payment") || Promise.resolve().then(() =>
|
|
6617
|
+
customElements.get("one-payment") || Promise.resolve().then(() => Si).then(({ OnePayment: e }) => {
|
|
6541
6618
|
customElements.define("one-payment", e);
|
|
6542
6619
|
});
|
|
6543
6620
|
}
|