moyasar-payment-form 2.0.4 → 2.0.6
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/__vite-browser-external-DYxpcVy9.mjs +1 -1
- package/dist/moyasar.css +1 -1
- package/dist/moyasar.mjs +454 -455
- package/dist/moyasar.umd.js +3 -3
- package/package.json +1 -1
package/dist/moyasar.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: moyasar-payment-form
|
|
3
|
-
* version: v2.0.
|
|
3
|
+
* version: v2.0.6
|
|
4
4
|
* description: Moyasar payment form utilities
|
|
5
5
|
* author: Jan Jagieła - Railwaymen Team
|
|
6
6
|
* homepage: https://docs.moyasar.com/credit-card
|
|
@@ -26,7 +26,7 @@ var be = (e, t) => {
|
|
|
26
26
|
t.indexOf(r) < 0 && dt.call(e, r) && (n[r] = e[r]);
|
|
27
27
|
return n;
|
|
28
28
|
};
|
|
29
|
-
var
|
|
29
|
+
var q = (e, t, n) => new Promise((r, o) => {
|
|
30
30
|
var a = (u) => {
|
|
31
31
|
try {
|
|
32
32
|
s(n.next(u));
|
|
@@ -42,8 +42,8 @@ var Y = (e, t, n) => new Promise((r, o) => {
|
|
|
42
42
|
}, s = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(a, i);
|
|
43
43
|
s((n = n.apply(e, t)).next());
|
|
44
44
|
});
|
|
45
|
-
var Re, E, Gt,
|
|
46
|
-
function
|
|
45
|
+
var Re, E, Gt, ne, ft, Bt, je, rt, He, Ke, zt, pe = {}, jt = [], wn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ie = Array.isArray;
|
|
46
|
+
function $(e, t) {
|
|
47
47
|
for (var n in t) e[n] = t[n];
|
|
48
48
|
return e;
|
|
49
49
|
}
|
|
@@ -61,16 +61,16 @@ function Ee(e, t, n, r, o) {
|
|
|
61
61
|
var a = { type: e, props: t, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: o == null ? ++Gt : o, __i: -1, __u: 0 };
|
|
62
62
|
return o == null && E.vnode != null && E.vnode(a), a;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function ee(e) {
|
|
65
65
|
return e.children;
|
|
66
66
|
}
|
|
67
67
|
function X(e, t) {
|
|
68
68
|
this.props = e, this.context = t;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
if (t == null) return e.__ ?
|
|
70
|
+
function oe(e, t) {
|
|
71
|
+
if (t == null) return e.__ ? oe(e.__, e.__i + 1) : null;
|
|
72
72
|
for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
|
|
73
|
-
return typeof e.type == "function" ?
|
|
73
|
+
return typeof e.type == "function" ? oe(e) : null;
|
|
74
74
|
}
|
|
75
75
|
function Kt(e) {
|
|
76
76
|
var t, n;
|
|
@@ -83,22 +83,22 @@ function Kt(e) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
function qe(e) {
|
|
86
|
-
(!e.__d && (e.__d = !0) &&
|
|
86
|
+
(!e.__d && (e.__d = !0) && ne.push(e) && !Ae.__r++ || ft !== E.debounceRendering) && ((ft = E.debounceRendering) || Bt)(Ae);
|
|
87
87
|
}
|
|
88
88
|
function Ae() {
|
|
89
89
|
var e, t, n, r, o, a, i, s;
|
|
90
|
-
for (
|
|
90
|
+
for (ne.sort(je); e = ne.shift(); ) e.__d && (t = ne.length, r = void 0, a = (o = (n = e).__v).__e, i = [], s = [], n.__P && ((r = $({}, o)).__v = o.__v + 1, E.vnode && E.vnode(r), ot(n.__P, r, o, n.__n, n.__P.namespaceURI, 32 & o.__u ? [a] : null, i, a == null ? oe(o) : a, !!(32 & o.__u), s), r.__v = o.__v, r.__.__k[r.__i] = r, Yt(i, r, s), r.__e != a && Kt(r)), ne.length > t && ne.sort(je));
|
|
91
91
|
Ae.__r = 0;
|
|
92
92
|
}
|
|
93
93
|
function Zt(e, t, n, r, o, a, i, s, u, l, d) {
|
|
94
|
-
var c,
|
|
95
|
-
for (n.__d = u, kn(n, t, m), u = n.__d, c = 0; c <
|
|
94
|
+
var c, h, p, _, g, m = r && r.__k || jt, y = t.length;
|
|
95
|
+
for (n.__d = u, kn(n, t, m), u = n.__d, c = 0; c < y; c++) (p = n.__k[c]) != null && typeof p != "boolean" && typeof p != "function" && (h = p.__i === -1 ? pe : m[p.__i] || pe, p.__i = c, ot(e, p, h, o, a, i, s, u, l, d), _ = p.__e, p.ref && h.ref != p.ref && (h.ref && at(h.ref, null, p), d.push(p.ref, p.__c || _, p)), g == null && _ != null && (g = _), 65536 & p.__u || h.__k === p.__k ? (u && typeof p.type == "string" && !e.contains(u) && (u = oe(h)), u = qt(p, u, e)) : typeof p.type == "function" && p.__d !== void 0 ? u = p.__d : _ && (u = _.nextSibling), p.__d = void 0, p.__u &= -196609);
|
|
96
96
|
n.__d = u, n.__e = g;
|
|
97
97
|
}
|
|
98
98
|
function kn(e, t, n) {
|
|
99
99
|
var r, o, a, i, s, u = t.length, l = n.length, d = l, c = 0;
|
|
100
|
-
for (e.__k = [], r = 0; r < u; r++) i = r + c, (o = e.__k[r] = (o = t[r]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Ee(null, o, null, null, null) : Ie(o) ? Ee(
|
|
101
|
-
if (d) for (r = 0; r < l; r++) (a = n[r]) != null && !(131072 & a.__u) && (a.__e == e.__d && (e.__d =
|
|
100
|
+
for (e.__k = [], r = 0; r < u; r++) i = r + c, (o = e.__k[r] = (o = t[r]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Ee(null, o, null, null, null) : Ie(o) ? Ee(ee, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? Ee(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o) != null ? (o.__ = e, o.__b = e.__b + 1, s = xn(o, n, i, d), o.__i = s, a = null, s !== -1 && (d--, (a = n[s]) && (a.__u |= 131072)), a == null || a.__v === null ? (s == -1 && c--, typeof o.type != "function" && (o.__u |= 65536)) : s !== i && (s == i - 1 ? c = s - i : s == i + 1 ? c++ : s > i ? d > u - i ? c += s - i : c-- : s < i && c++, s !== r + c && (o.__u |= 65536))) : (a = n[i]) && a.key == null && a.__e && !(131072 & a.__u) && (a.__e == e.__d && (e.__d = oe(a)), Ye(a, a, !1), n[i] = null, d--);
|
|
101
|
+
if (d) for (r = 0; r < l; r++) (a = n[r]) != null && !(131072 & a.__u) && (a.__e == e.__d && (e.__d = oe(a)), Ye(a, a));
|
|
102
102
|
}
|
|
103
103
|
function qt(e, t, n) {
|
|
104
104
|
var r, o;
|
|
@@ -164,32 +164,32 @@ function ht(e) {
|
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
function ot(e, t, n, r, o, a, i, s, u, l) {
|
|
167
|
-
var d, c,
|
|
167
|
+
var d, c, h, p, _, g, m, y, v, b, w, k, x, D, T, V, A = t.type;
|
|
168
168
|
if (t.constructor !== void 0) return null;
|
|
169
169
|
128 & n.__u && (u = !!(32 & n.__u), a = [s = t.__e = n.__e]), (d = E.__b) && d(t);
|
|
170
|
-
e: if (typeof
|
|
171
|
-
if (
|
|
170
|
+
e: if (typeof A == "function") try {
|
|
171
|
+
if (y = t.props, v = "prototype" in A && A.prototype.render, b = (d = A.contextType) && r[d.__c], w = d ? b ? b.props.value : d.__ : r, n.__c ? m = (c = t.__c = n.__c).__ = c.__E : (v ? t.__c = c = new A(y, w) : (t.__c = c = new X(y, w), c.constructor = A, c.render = En), b && b.sub(c), c.props = y, c.state || (c.state = {}), c.context = w, c.__n = r, h = c.__d = !0, c.__h = [], c._sb = []), v && c.__s == null && (c.__s = c.state), v && A.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = $({}, c.__s)), $(c.__s, A.getDerivedStateFromProps(y, c.__s))), p = c.props, _ = c.state, c.__v = t, h) v && A.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), v && c.componentDidMount != null && c.__h.push(c.componentDidMount);
|
|
172
172
|
else {
|
|
173
|
-
if (v &&
|
|
174
|
-
for (t.__v !== n.__v && (c.props =
|
|
175
|
-
|
|
176
|
-
}),
|
|
173
|
+
if (v && A.getDerivedStateFromProps == null && y !== p && c.componentWillReceiveProps != null && c.componentWillReceiveProps(y, w), !c.__e && (c.shouldComponentUpdate != null && c.shouldComponentUpdate(y, c.__s, w) === !1 || t.__v === n.__v)) {
|
|
174
|
+
for (t.__v !== n.__v && (c.props = y, c.state = c.__s, c.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(C) {
|
|
175
|
+
C && (C.__ = t);
|
|
176
|
+
}), k = 0; k < c._sb.length; k++) c.__h.push(c._sb[k]);
|
|
177
177
|
c._sb = [], c.__h.length && i.push(c);
|
|
178
178
|
break e;
|
|
179
179
|
}
|
|
180
|
-
c.componentWillUpdate != null && c.componentWillUpdate(
|
|
181
|
-
c.componentDidUpdate(p,
|
|
180
|
+
c.componentWillUpdate != null && c.componentWillUpdate(y, c.__s, w), v && c.componentDidUpdate != null && c.__h.push(function() {
|
|
181
|
+
c.componentDidUpdate(p, _, g);
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
if (c.context = w, c.props =
|
|
185
|
-
for (c.state = c.__s, c.__d = !1, x && x(t), d = c.render(c.props, c.state, c.context),
|
|
184
|
+
if (c.context = w, c.props = y, c.__P = e, c.__e = !1, x = E.__r, D = 0, v) {
|
|
185
|
+
for (c.state = c.__s, c.__d = !1, x && x(t), d = c.render(c.props, c.state, c.context), T = 0; T < c._sb.length; T++) c.__h.push(c._sb[T]);
|
|
186
186
|
c._sb = [];
|
|
187
187
|
} else do
|
|
188
188
|
c.__d = !1, x && x(t), d = c.render(c.props, c.state, c.context), c.state = c.__s;
|
|
189
|
-
while (c.__d && ++
|
|
190
|
-
c.state = c.__s, c.getChildContext != null && (r =
|
|
191
|
-
} catch (
|
|
192
|
-
t.__v = null, u || a != null ? (t.__e = s, t.__u |= u ? 160 : 32, a[a.indexOf(s)] = null) : (t.__e = n.__e, t.__k = n.__k), E.__e(
|
|
189
|
+
while (c.__d && ++D < 25);
|
|
190
|
+
c.state = c.__s, c.getChildContext != null && (r = $($({}, r), c.getChildContext())), v && !h && c.getSnapshotBeforeUpdate != null && (g = c.getSnapshotBeforeUpdate(p, _)), Zt(e, Ie(V = d != null && d.type === ee && d.key == null ? d.props.children : d) ? V : [V], t, n, r, o, a, i, s, u, l), c.base = t.__e, t.__u &= -161, c.__h.length && i.push(c), m && (c.__E = c.__ = null);
|
|
191
|
+
} catch (C) {
|
|
192
|
+
t.__v = null, u || a != null ? (t.__e = s, t.__u |= u ? 160 : 32, a[a.indexOf(s)] = null) : (t.__e = n.__e, t.__k = n.__k), E.__e(C, t, n);
|
|
193
193
|
}
|
|
194
194
|
else a == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = Pn(n.__e, t, n, r, o, a, i, u, l);
|
|
195
195
|
(d = E.diffed) && d(t);
|
|
@@ -208,7 +208,7 @@ function Yt(e, t, n) {
|
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
function Pn(e, t, n, r, o, a, i, s, u) {
|
|
211
|
-
var l, d, c,
|
|
211
|
+
var l, d, c, h, p, _, g, m = n.props, y = t.props, v = t.type;
|
|
212
212
|
if (v === "svg" ? o = "http://www.w3.org/2000/svg" : v === "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), a != null) {
|
|
213
213
|
for (l = 0; l < a.length; l++) if ((p = a[l]) && "setAttribute" in p == !!v && (v ? p.localName === v : p.nodeType === 3)) {
|
|
214
214
|
e = p, a[l] = null;
|
|
@@ -216,23 +216,23 @@ function Pn(e, t, n, r, o, a, i, s, u) {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
if (e == null) {
|
|
219
|
-
if (v === null) return document.createTextNode(
|
|
220
|
-
e = document.createElementNS(o, v,
|
|
219
|
+
if (v === null) return document.createTextNode(y);
|
|
220
|
+
e = document.createElementNS(o, v, y.is && y), a = null, s = !1;
|
|
221
221
|
}
|
|
222
|
-
if (v === null) m ===
|
|
222
|
+
if (v === null) m === y || s && e.data === y || (e.data = y);
|
|
223
223
|
else {
|
|
224
|
-
if (a = a && Re.call(e.childNodes), m = n.props ||
|
|
224
|
+
if (a = a && Re.call(e.childNodes), m = n.props || pe, !s && a != null) for (m = {}, l = 0; l < e.attributes.length; l++) m[(p = e.attributes[l]).name] = p.value;
|
|
225
225
|
for (l in m) if (p = m[l], l != "children") {
|
|
226
226
|
if (l == "dangerouslySetInnerHTML") c = p;
|
|
227
|
-
else if (l !== "key" && !(l in
|
|
228
|
-
if (l == "value" && "defaultValue" in
|
|
227
|
+
else if (l !== "key" && !(l in y)) {
|
|
228
|
+
if (l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y) continue;
|
|
229
229
|
we(e, l, null, p, o);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
for (l in
|
|
232
|
+
for (l in y) p = y[l], l == "children" ? h = p : l == "dangerouslySetInnerHTML" ? d = p : l == "value" ? _ = p : l == "checked" ? g = p : l === "key" || s && typeof p != "function" || m[l] === p || we(e, l, p, m[l], o);
|
|
233
233
|
if (d) s || c && (d.__html === c.__html || d.__html === e.innerHTML) || (e.innerHTML = d.__html), t.__k = [];
|
|
234
|
-
else if (c && (e.innerHTML = ""), Zt(e, Ie(
|
|
235
|
-
s || (l = "value",
|
|
234
|
+
else if (c && (e.innerHTML = ""), Zt(e, Ie(h) ? h : [h], t, n, r, v === "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, a, i, a ? a[0] : n.__k && oe(n, 0), s, u), a != null) for (l = a.length; l--; ) a[l] != null && Ht(a[l]);
|
|
235
|
+
s || (l = "value", _ !== void 0 && (_ !== e[l] || v === "progress" && !_ || v === "option" && _ !== m[l]) && we(e, l, _, m[l], o), l = "checked", g !== void 0 && g !== e[l] && we(e, l, g, m[l], o));
|
|
236
236
|
}
|
|
237
237
|
return e;
|
|
238
238
|
}
|
|
@@ -261,7 +261,7 @@ function En(e, t, n) {
|
|
|
261
261
|
}
|
|
262
262
|
function _t(e, t, n) {
|
|
263
263
|
var r, o, a, i;
|
|
264
|
-
E.__ && E.__(e, t), o = (r = typeof n == "function") ? null : t.__k, a = [], i = [], ot(t, e = (!r && n || t).__k = Ze(
|
|
264
|
+
E.__ && E.__(e, t), o = (r = typeof n == "function") ? null : t.__k, a = [], i = [], ot(t, e = (!r && n || t).__k = Ze(ee, null, [e]), o || pe, pe, t.namespaceURI, !r && n ? [n] : o ? null : t.firstChild ? Re.call(t.childNodes) : null, a, !r && n ? n : o ? o.__e : t.firstChild, r, i), Yt(a, e, i);
|
|
265
265
|
}
|
|
266
266
|
function it(e, t) {
|
|
267
267
|
var n = { __c: t = "__cC" + zt++, __: e, Consumer: function(r, o) {
|
|
@@ -295,10 +295,10 @@ Re = jt.slice, E = { __e: function(e, t, n, r) {
|
|
|
295
295
|
throw e;
|
|
296
296
|
} }, Gt = 0, X.prototype.setState = function(e, t) {
|
|
297
297
|
var n;
|
|
298
|
-
n = this.__s != null && this.__s !== this.state ? this.__s : this.__s =
|
|
298
|
+
n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = $({}, this.state), typeof e == "function" && (e = e($({}, n), this.props)), e && $(n, e), e != null && this.__v && (t && this._sb.push(t), qe(this));
|
|
299
299
|
}, X.prototype.forceUpdate = function(e) {
|
|
300
300
|
this.__v && (this.__e = !0, e && this.__h.push(e), qe(this));
|
|
301
|
-
}, X.prototype.render =
|
|
301
|
+
}, X.prototype.render = ee, ne = [], Bt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, je = function(e, t) {
|
|
302
302
|
return e.__v.__b - t.__v.__b;
|
|
303
303
|
}, Ae.__r = 0, rt = 0, He = ht(!1), Ke = ht(!0), zt = 0;
|
|
304
304
|
var Sn = 0;
|
|
@@ -310,35 +310,35 @@ function f(e, t, n, r, o, a) {
|
|
|
310
310
|
if (typeof e == "function" && (i = e.defaultProps)) for (s in i) u[s] === void 0 && (u[s] = i[s]);
|
|
311
311
|
return E.vnode && E.vnode(l), l;
|
|
312
312
|
}
|
|
313
|
-
const Jt = "2.0.
|
|
314
|
-
var
|
|
313
|
+
const Jt = "2.0.6", z = it({});
|
|
314
|
+
var se, R, Ge, yt, fe = 0, Wt = [], N = E, vt = N.__b, gt = N.__r, bt = N.diffed, wt = N.__c, kt = N.unmount, xt = N.__;
|
|
315
315
|
function Ne(e, t) {
|
|
316
|
-
N.__h && N.__h(R, e,
|
|
316
|
+
N.__h && N.__h(R, e, fe || t), fe = 0;
|
|
317
317
|
var n = R.__H || (R.__H = { __: [], __h: [] });
|
|
318
318
|
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
319
319
|
}
|
|
320
320
|
function I(e) {
|
|
321
|
-
return
|
|
321
|
+
return fe = 1, Cn($t, e);
|
|
322
322
|
}
|
|
323
323
|
function Cn(e, t, n) {
|
|
324
|
-
var r = Ne(
|
|
324
|
+
var r = Ne(se++, 2);
|
|
325
325
|
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : $t(void 0, t), function(s) {
|
|
326
326
|
var u = r.__N ? r.__N[0] : r.__[0], l = r.t(u, s);
|
|
327
327
|
u !== l && (r.__N = [l, r.__[1]], r.__c.setState({}));
|
|
328
328
|
}], r.__c = R, !R.u)) {
|
|
329
329
|
var o = function(s, u, l) {
|
|
330
330
|
if (!r.__c.__H) return !0;
|
|
331
|
-
var d = r.__c.__H.__.filter(function(
|
|
332
|
-
return !!
|
|
331
|
+
var d = r.__c.__H.__.filter(function(h) {
|
|
332
|
+
return !!h.__c;
|
|
333
333
|
});
|
|
334
|
-
if (d.every(function(
|
|
335
|
-
return !
|
|
334
|
+
if (d.every(function(h) {
|
|
335
|
+
return !h.__N;
|
|
336
336
|
})) return !a || a.call(this, s, u, l);
|
|
337
337
|
var c = !1;
|
|
338
|
-
return d.forEach(function(
|
|
339
|
-
if (
|
|
340
|
-
var p =
|
|
341
|
-
|
|
338
|
+
return d.forEach(function(h) {
|
|
339
|
+
if (h.__N) {
|
|
340
|
+
var p = h.__[0];
|
|
341
|
+
h.__ = h.__N, h.__N = void 0, p !== h.__[0] && (c = !0);
|
|
342
342
|
}
|
|
343
343
|
}), !(!c && r.__c.props === s) && (!a || a.call(this, s, u, l));
|
|
344
344
|
};
|
|
@@ -354,26 +354,26 @@ function Cn(e, t, n) {
|
|
|
354
354
|
}
|
|
355
355
|
return r.__N || r.__;
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
var n = Ne(
|
|
357
|
+
function j(e, t) {
|
|
358
|
+
var n = Ne(se++, 3);
|
|
359
359
|
!N.__s && Qt(n.__H, t) && (n.__ = e, n.i = t, R.__H.__h.push(n));
|
|
360
360
|
}
|
|
361
361
|
function J(e) {
|
|
362
|
-
return
|
|
362
|
+
return fe = 5, ae(function() {
|
|
363
363
|
return { current: e };
|
|
364
364
|
}, []);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
var n = Ne(
|
|
366
|
+
function ae(e, t) {
|
|
367
|
+
var n = Ne(se++, 7);
|
|
368
368
|
return Qt(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
369
369
|
}
|
|
370
370
|
function Xt(e, t) {
|
|
371
|
-
return
|
|
371
|
+
return fe = 8, ae(function() {
|
|
372
372
|
return e;
|
|
373
373
|
}, t);
|
|
374
374
|
}
|
|
375
375
|
function F(e) {
|
|
376
|
-
var t = R.context[e.__c], n = Ne(
|
|
376
|
+
var t = R.context[e.__c], n = Ne(se++, 9);
|
|
377
377
|
return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(R)), t.props.value) : e.__;
|
|
378
378
|
}
|
|
379
379
|
function An() {
|
|
@@ -388,11 +388,11 @@ N.__b = function(e) {
|
|
|
388
388
|
}, N.__ = function(e, t) {
|
|
389
389
|
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), xt && xt(e, t);
|
|
390
390
|
}, N.__r = function(e) {
|
|
391
|
-
gt && gt(e),
|
|
391
|
+
gt && gt(e), se = 0;
|
|
392
392
|
var t = (R = e.__c).__H;
|
|
393
393
|
t && (Ge === R ? (t.__h = [], R.__h = [], t.__.forEach(function(n) {
|
|
394
394
|
n.__N && (n.__ = n.__N), n.i = n.__N = void 0;
|
|
395
|
-
})) : (t.__h.forEach(Se), t.__h.forEach(Je), t.__h = [],
|
|
395
|
+
})) : (t.__h.forEach(Se), t.__h.forEach(Je), t.__h = [], se = 0)), Ge = R;
|
|
396
396
|
}, N.diffed = function(e) {
|
|
397
397
|
bt && bt(e);
|
|
398
398
|
var t = e.__c;
|
|
@@ -445,7 +445,7 @@ function Qt(e, t) {
|
|
|
445
445
|
function $t(e, t) {
|
|
446
446
|
return typeof t == "function" ? t(e) : t;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function H() {
|
|
449
449
|
const { language: e, translations: t } = F(z);
|
|
450
450
|
function n(r) {
|
|
451
451
|
if (!t)
|
|
@@ -458,7 +458,7 @@ function K() {
|
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
460
|
const Tn = () => {
|
|
461
|
-
const { t: e } =
|
|
461
|
+
const { t: e } = H(), { isTestMode: t } = F(z);
|
|
462
462
|
return /* @__PURE__ */ f("footer", { class: "flex flex-col items-center gap-4 text-xs", children: [
|
|
463
463
|
/* @__PURE__ */ f("a", { href: "https://moyasar.com/?ref=payment-form-v1.14.0", target: "_blank", class: "text-black/70", children: [
|
|
464
464
|
e("form.powered_by"),
|
|
@@ -623,7 +623,7 @@ function Nn() {
|
|
|
623
623
|
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = en(e)) && (r && (r += " "), r += t);
|
|
624
624
|
return r;
|
|
625
625
|
}
|
|
626
|
-
const
|
|
626
|
+
const te = (...e) => Nn(e), We = (e) => {
|
|
627
627
|
const p = e, {
|
|
628
628
|
children: t,
|
|
629
629
|
type: n = "button",
|
|
@@ -648,7 +648,7 @@ const oe = (...e) => Nn(e), We = (e) => {
|
|
|
648
648
|
error: "bg-error text-white pointer-events-none",
|
|
649
649
|
success: "bg-success text-white"
|
|
650
650
|
};
|
|
651
|
-
function
|
|
651
|
+
function h() {
|
|
652
652
|
return s ? c.error : u ? c.success : c[r];
|
|
653
653
|
}
|
|
654
654
|
return /* @__PURE__ */ f(
|
|
@@ -657,9 +657,9 @@ const oe = (...e) => Nn(e), We = (e) => {
|
|
|
657
657
|
type: n,
|
|
658
658
|
disabled: d || a,
|
|
659
659
|
onClick: o,
|
|
660
|
-
class:
|
|
660
|
+
class: te([
|
|
661
661
|
"flex h-11 w-full cursor-pointer items-center justify-center gap-2 rounded-lg px-3 py-2 transition-colors disabled:cursor-default disabled:opacity-70",
|
|
662
|
-
|
|
662
|
+
h(),
|
|
663
663
|
e.class,
|
|
664
664
|
d && !s && "pointer-events-none grayscale"
|
|
665
665
|
]),
|
|
@@ -732,7 +732,7 @@ const oe = (...e) => Nn(e), We = (e) => {
|
|
|
732
732
|
]
|
|
733
733
|
})
|
|
734
734
|
);
|
|
735
|
-
},
|
|
735
|
+
}, le = (e) => {
|
|
736
736
|
const u = e, { name: t, placeholder: n, type: r = "text", onBlur: o, disabled: a } = u, i = be(u, ["name", "placeholder", "type", "onBlur", "disabled"]), { isProcessing: s } = F(z);
|
|
737
737
|
return /* @__PURE__ */ f(
|
|
738
738
|
"input",
|
|
@@ -741,7 +741,7 @@ const oe = (...e) => Nn(e), We = (e) => {
|
|
|
741
741
|
id: t,
|
|
742
742
|
name: t,
|
|
743
743
|
disabled: s || a,
|
|
744
|
-
class:
|
|
744
|
+
class: te([
|
|
745
745
|
"relative block w-full rounded-lg border-0 px-4 py-2 text-sm text-black shadow-input placeholder:text-black/70 focus:z-[2] focus:shadow-input-focus focus:outline-none",
|
|
746
746
|
e.class,
|
|
747
747
|
s && "pointer-events-none grayscale",
|
|
@@ -836,8 +836,8 @@ E.unmount = function(e) {
|
|
|
836
836
|
}
|
|
837
837
|
this.__b = null;
|
|
838
838
|
}
|
|
839
|
-
var o = t.__a && Ze(
|
|
840
|
-
return o && (o.__u &= -33), [Ze(
|
|
839
|
+
var o = t.__a && Ze(ee, null, e.fallback);
|
|
840
|
+
return o && (o.__u &= -33), [Ze(ee, null, t.__a ? null : e.children), o];
|
|
841
841
|
};
|
|
842
842
|
var Dt = function(e, t, n) {
|
|
843
843
|
if (++n[1] === n[0] && e.o.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.o.size)) for (n = e.u; n; ) {
|
|
@@ -918,56 +918,56 @@ E.diffed = function(e) {
|
|
|
918
918
|
var t = e.props, n = e.__e;
|
|
919
919
|
n != null && e.type === "textarea" && "value" in t && t.value !== n.value && (n.value = t.value == null ? "" : t.value);
|
|
920
920
|
};
|
|
921
|
-
function
|
|
921
|
+
function ce(e, t, n) {
|
|
922
922
|
var r = this, o = J(null), a = J(0), i = J(null), s = J([]), u = J(), l = J(), d = J(e), c = J(!0);
|
|
923
923
|
d.current = e;
|
|
924
|
-
var
|
|
924
|
+
var h = typeof window != "undefined", p = !t && t !== 0 && h;
|
|
925
925
|
if (typeof e != "function") throw new TypeError("Expected a function");
|
|
926
926
|
t = +t || 0;
|
|
927
|
-
var
|
|
928
|
-
|
|
927
|
+
var _ = !!(n = n || {}).leading, g = !("trailing" in n) || !!n.trailing, m = "maxWait" in n, y = "debounceOnServer" in n && !!n.debounceOnServer, v = m ? Math.max(+n.maxWait || 0, t) : null;
|
|
928
|
+
j(function() {
|
|
929
929
|
return c.current = !0, function() {
|
|
930
930
|
c.current = !1;
|
|
931
931
|
};
|
|
932
932
|
}, []);
|
|
933
|
-
var
|
|
934
|
-
var w = function(
|
|
935
|
-
var
|
|
936
|
-
return s.current = u.current = null, a.current =
|
|
937
|
-
},
|
|
938
|
-
p && cancelAnimationFrame(i.current), i.current = p ? requestAnimationFrame(
|
|
939
|
-
}, x = function(
|
|
933
|
+
var b = ae(function() {
|
|
934
|
+
var w = function(A) {
|
|
935
|
+
var C = s.current, U = u.current;
|
|
936
|
+
return s.current = u.current = null, a.current = A, l.current = d.current.apply(U, C);
|
|
937
|
+
}, k = function(A, C) {
|
|
938
|
+
p && cancelAnimationFrame(i.current), i.current = p ? requestAnimationFrame(A) : setTimeout(A, C);
|
|
939
|
+
}, x = function(A) {
|
|
940
940
|
if (!c.current) return !1;
|
|
941
|
-
var
|
|
942
|
-
return !o.current ||
|
|
943
|
-
},
|
|
944
|
-
return i.current = null, g && s.current ? w(
|
|
945
|
-
},
|
|
946
|
-
var
|
|
947
|
-
if (x(
|
|
941
|
+
var C = A - o.current;
|
|
942
|
+
return !o.current || C >= t || C < 0 || m && A - a.current >= v;
|
|
943
|
+
}, D = function(A) {
|
|
944
|
+
return i.current = null, g && s.current ? w(A) : (s.current = u.current = null, l.current);
|
|
945
|
+
}, T = function A() {
|
|
946
|
+
var C = Date.now();
|
|
947
|
+
if (x(C)) return D(C);
|
|
948
948
|
if (c.current) {
|
|
949
|
-
var
|
|
950
|
-
|
|
949
|
+
var U = t - (C - o.current), Y = m ? Math.min(U, v - (C - a.current)) : U;
|
|
950
|
+
k(A, Y);
|
|
951
951
|
}
|
|
952
|
-
},
|
|
953
|
-
if (
|
|
954
|
-
var
|
|
955
|
-
if (s.current = [].slice.call(arguments), u.current = r, o.current =
|
|
956
|
-
if (!i.current && c.current) return a.current = o.current,
|
|
957
|
-
if (m) return
|
|
952
|
+
}, V = function() {
|
|
953
|
+
if (h || y) {
|
|
954
|
+
var A = Date.now(), C = x(A);
|
|
955
|
+
if (s.current = [].slice.call(arguments), u.current = r, o.current = A, C) {
|
|
956
|
+
if (!i.current && c.current) return a.current = o.current, k(T, t), _ ? w(o.current) : l.current;
|
|
957
|
+
if (m) return k(T, t), w(o.current);
|
|
958
958
|
}
|
|
959
|
-
return i.current ||
|
|
959
|
+
return i.current || k(T, t), l.current;
|
|
960
960
|
}
|
|
961
961
|
};
|
|
962
|
-
return
|
|
962
|
+
return V.cancel = function() {
|
|
963
963
|
i.current && (p ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), a.current = 0, s.current = o.current = u.current = i.current = null;
|
|
964
|
-
},
|
|
964
|
+
}, V.isPending = function() {
|
|
965
965
|
return !!i.current;
|
|
966
|
-
},
|
|
967
|
-
return i.current ?
|
|
968
|
-
},
|
|
969
|
-
}, [
|
|
970
|
-
return
|
|
966
|
+
}, V.flush = function() {
|
|
967
|
+
return i.current ? D(Date.now()) : l.current;
|
|
968
|
+
}, V;
|
|
969
|
+
}, [_, m, t, v, g, p, h, y]);
|
|
970
|
+
return b;
|
|
971
971
|
}
|
|
972
972
|
var Yn = Object.defineProperty, Jn = (e, t, n) => t in e ? Yn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Te = (e, t, n) => Jn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
973
973
|
const It = {
|
|
@@ -983,19 +983,19 @@ const It = {
|
|
|
983
983
|
roundingMode: "trunc"
|
|
984
984
|
});
|
|
985
985
|
}, Wn = (e, t = !0, n) => {
|
|
986
|
-
var m,
|
|
986
|
+
var m, y, v;
|
|
987
987
|
var r, o, a, i;
|
|
988
988
|
const s = ((r = n.number) == null ? void 0 : r.unsigned) == null && e.startsWith("-") ? "-" : "", u = (m = (o = n.number) == null ? void 0 : o.fraction) != null ? m : 0;
|
|
989
989
|
let l = Ft(0, u, n);
|
|
990
|
-
const d = l.formatToParts(1000.12), c = (
|
|
990
|
+
const d = l.formatToParts(1000.12), c = (y = (a = d.find((b) => b.type === "group")) == null ? void 0 : a.value) != null ? y : " ", h = (v = (i = d.find((b) => b.type === "decimal")) == null ? void 0 : i.value) != null ? v : ".", p = Nt(e, c, h);
|
|
991
991
|
if (Number.isNaN(parseFloat(p))) return s;
|
|
992
|
-
const
|
|
993
|
-
if (
|
|
994
|
-
const
|
|
995
|
-
l = Ft(
|
|
992
|
+
const _ = p.split(".");
|
|
993
|
+
if (_[1] != null && _[1].length >= 1) {
|
|
994
|
+
const b = _[1].length <= u ? _[1].length : u;
|
|
995
|
+
l = Ft(b, u, n);
|
|
996
996
|
}
|
|
997
997
|
let g = l.format(parseFloat(p));
|
|
998
|
-
return t ? u > 0 && p.endsWith(".") && !p.slice(0, -1).includes(".") && (g +=
|
|
998
|
+
return t ? u > 0 && p.endsWith(".") && !p.slice(0, -1).includes(".") && (g += h) : g = Nt(g, c, h), s + g;
|
|
999
999
|
};
|
|
1000
1000
|
class Xn {
|
|
1001
1001
|
constructor(t = {}) {
|
|
@@ -1051,18 +1051,18 @@ class Xn {
|
|
|
1051
1051
|
if (n == null) return t;
|
|
1052
1052
|
const o = `v=${t},mr=${n},m=${r ? 1 : 0}`;
|
|
1053
1053
|
if (this.memo.has(o)) return this.memo.get(o);
|
|
1054
|
-
const { mask: a, escaped: i } = this.escapeMask(n), s = [], u = this.opts.tokens != null ? this.opts.tokens : {}, l = this.isReversed() ? -1 : 1, d = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : a.length - 1,
|
|
1055
|
-
let
|
|
1056
|
-
for (;
|
|
1057
|
-
const
|
|
1058
|
-
if (!i.includes(m) && w != null ? (
|
|
1054
|
+
const { mask: a, escaped: i } = this.escapeMask(n), s = [], u = this.opts.tokens != null ? this.opts.tokens : {}, l = this.isReversed() ? -1 : 1, d = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : a.length - 1, h = this.isReversed() ? () => m > -1 && y > -1 : () => m < a.length && y < t.length, p = (b) => !this.isReversed() && b <= c || this.isReversed() && b >= c;
|
|
1055
|
+
let _, g = -1, m = this.isReversed() ? a.length - 1 : 0, y = this.isReversed() ? t.length - 1 : 0, v = !1;
|
|
1056
|
+
for (; h(); ) {
|
|
1057
|
+
const b = a.charAt(m), w = u[b], k = (w == null ? void 0 : w.transform) != null ? w.transform(t.charAt(y)) : t.charAt(y);
|
|
1058
|
+
if (!i.includes(m) && w != null ? (k.match(w.pattern) != null ? (s[d](k), w.repeated ? (g === -1 ? g = m : m === c && m !== g && (m = g - l), c === g && (m -= l)) : w.multiple && (v = !0, m -= l), m += l) : w.multiple ? v && (m += l, y -= l, v = !1) : k === _ ? _ = void 0 : w.optional && (m += l, y -= l), y += l) : (r && !this.isEager() && s[d](b), k === b && !this.isEager() ? y += l : _ = b, this.isEager() || (m += l)), this.isEager())
|
|
1059
1059
|
for (; p(m) && (u[a.charAt(m)] == null || i.includes(m)); ) {
|
|
1060
1060
|
if (r) {
|
|
1061
|
-
if (s[d](a.charAt(m)), t.charAt(
|
|
1062
|
-
m += l,
|
|
1061
|
+
if (s[d](a.charAt(m)), t.charAt(y) === a.charAt(m)) {
|
|
1062
|
+
m += l, y += l;
|
|
1063
1063
|
continue;
|
|
1064
1064
|
}
|
|
1065
|
-
} else a.charAt(m) === t.charAt(
|
|
1065
|
+
} else a.charAt(m) === t.charAt(y) && (y += l);
|
|
1066
1066
|
m += l;
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
@@ -1147,14 +1147,14 @@ class Fe {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
}
|
|
1149
1149
|
const tr = ({ showOtp: e, value: t, setValue: n }) => {
|
|
1150
|
-
const { t: r } =
|
|
1150
|
+
const { t: r } = H(), { handleBlur: o, err: a } = F(st), i = "### ### ####", s = (l) => {
|
|
1151
1151
|
const d = l.target, { value: c } = d;
|
|
1152
1152
|
n(c);
|
|
1153
|
-
}, u =
|
|
1154
|
-
return
|
|
1153
|
+
}, u = ce(o, 1e3);
|
|
1154
|
+
return j(() => {
|
|
1155
1155
|
new Fe('[name="mysr-stc-mobile"]');
|
|
1156
1156
|
}, []), /* @__PURE__ */ f(
|
|
1157
|
-
|
|
1157
|
+
le,
|
|
1158
1158
|
{
|
|
1159
1159
|
name: "mysr-stc-mobile",
|
|
1160
1160
|
label: r("form.mobile"),
|
|
@@ -1163,7 +1163,7 @@ const tr = ({ showOtp: e, value: t, setValue: n }) => {
|
|
|
1163
1163
|
maxLength: i.length,
|
|
1164
1164
|
autocomplete: "tel-national",
|
|
1165
1165
|
placeholder: "05x xxx xxxx",
|
|
1166
|
-
class:
|
|
1166
|
+
class: te(["animate-fade-in text-center", !e && "hidden"]),
|
|
1167
1167
|
onAnimationEnd: (l) => {
|
|
1168
1168
|
l.target && l.target.focus();
|
|
1169
1169
|
},
|
|
@@ -1178,14 +1178,14 @@ const tr = ({ showOtp: e, value: t, setValue: n }) => {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
);
|
|
1180
1180
|
}, nr = ({ showPhone: e, value: t, setValue: n }) => {
|
|
1181
|
-
const { t: r } =
|
|
1181
|
+
const { t: r } = H(), { handleBlur: o, err: a } = F(st), i = (u) => {
|
|
1182
1182
|
const l = u.target, { value: d } = l;
|
|
1183
1183
|
n(d);
|
|
1184
|
-
}, s =
|
|
1185
|
-
return
|
|
1184
|
+
}, s = ce(o, 1e3);
|
|
1185
|
+
return j(() => {
|
|
1186
1186
|
new Fe('[name="mysr-stc-otp"]');
|
|
1187
1187
|
}, []), /* @__PURE__ */ f(
|
|
1188
|
-
|
|
1188
|
+
le,
|
|
1189
1189
|
{
|
|
1190
1190
|
name: "mysr-stc-otp",
|
|
1191
1191
|
label: r("form.otp"),
|
|
@@ -1193,7 +1193,7 @@ const tr = ({ showOtp: e, value: t, setValue: n }) => {
|
|
|
1193
1193
|
inputMode: "numeric",
|
|
1194
1194
|
autocomplete: "one-time-code",
|
|
1195
1195
|
placeholder: r("form.code"),
|
|
1196
|
-
class:
|
|
1196
|
+
class: te(["animate-fade-in text-center", e && "hidden"]),
|
|
1197
1197
|
onAnimationEnd: (u) => {
|
|
1198
1198
|
u.target && u.target.focus();
|
|
1199
1199
|
},
|
|
@@ -1215,11 +1215,11 @@ const tr = ({ showOtp: e, value: t, setValue: n }) => {
|
|
|
1215
1215
|
const s = e ? new Date(e).getTime() - (/* @__PURE__ */ new Date()).getTime() : 0;
|
|
1216
1216
|
return s < 0 ? 0 : s;
|
|
1217
1217
|
}, [e]), [o, a] = I(r());
|
|
1218
|
-
|
|
1218
|
+
j(() => (n.current = setInterval(() => {
|
|
1219
1219
|
a(r());
|
|
1220
1220
|
}, 500), () => {
|
|
1221
1221
|
n.current && clearInterval(n.current);
|
|
1222
|
-
}), [r]),
|
|
1222
|
+
}), [r]), j(() => {
|
|
1223
1223
|
o === 0 && (n.current && clearInterval(n.current), typeof t == "function" && t(0));
|
|
1224
1224
|
}, [t, o]);
|
|
1225
1225
|
const i = () => {
|
|
@@ -1230,13 +1230,13 @@ const tr = ({ showOtp: e, value: t, setValue: n }) => {
|
|
|
1230
1230
|
l < 10 ? `0${l}` : l
|
|
1231
1231
|
] });
|
|
1232
1232
|
};
|
|
1233
|
-
return !e || !o ? null : /* @__PURE__ */ f("div", { class:
|
|
1233
|
+
return !e || !o ? null : /* @__PURE__ */ f("div", { class: te("inline-flex gap-2 text-sm"), children: i() });
|
|
1234
1234
|
}, or = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20512%20174'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cpath%20d='M326.531,121.529l-0,-74.676l12.663,0l0,5.988c3.854,-4.818%209.567,-7.433%2016.655,-7.433c14.592,-0%2025.053,11.631%2025.053,28.286c-0,16.656%20-10.53,28.494%20-25.053,28.494c-7.157,0%20-12.801,-2.753%20-16.655,-7.571l0,26.911l-12.663,-0l-0,0.001Zm12.664,-54.716l0,13.765c2.684,5.576%207.502,9.636%2014.453,9.636c8.398,-0%2014.041,-6.264%2014.041,-16.587c0,-10.186%20-5.643,-16.381%20-14.041,-16.381c-6.951,0.069%20-11.769,3.854%20-14.453,9.567'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M389.093,85.258c-0,-9.085%205.643,-15.417%2015.003,-16.587l21.543,-2.753l-0,-2.684c-0,-3.234%20-1.652,-4.956%20-4.68,-4.956l-27.048,0l-0,-11.493l27.53,-0c10.943,-0%2016.931,5.368%2016.931,14.867l-0,38.885l-12.802,0l0,-6.538c-3.716,5.232%20-9.841,8.19%20-17.757,8.19c-11.149,0%20-18.72,-6.813%20-18.72,-16.931m21.817,6.607c6.469,-0%2012.457,-3.648%2014.659,-9.016l0,-6.745l-16.449,2.271c-4.542,0.62%20-7.089,3.028%20-7.089,6.952c0.001,4.198%203.235,6.538%208.879,6.538'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M447.594,110.035l9.223,0c3.51,0%205.093,-1.446%206.263,-4.749l1.652,-4.75l-19.547,-53.752l13.215,-0l12.182,37.441l0.275,0l11.632,-37.441l13.007,-0l-21.404,61.736c-2.891,8.465%20-6.746,13.008%20-16.174,13.008l-10.323,-0l-0.001,-11.493Z'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M61.142,158.488c14.729,0%2026.842,-4.611%2034.826,-12.319c5.987,-5.92%209.497,-13.903%209.497,-23.125c0,-8.328%20-3.097,-15.83%20-8.809,-21.543c-5.712,-5.713%20-13.903,-9.911%20-24.227,-11.907l-16.931,-3.304c-7.02,-1.307%20-11.011,-4.817%20-11.011,-9.703c-0,-6.402%206.194,-10.806%2016.105,-10.806c6.194,0%2011.493,1.996%2015.003,5.506c2.202,2.409%203.716,5.506%204.198,9.016l24.433,-5.506c-0.688,-7.02%20-3.992,-13.215%20-9.016,-18.307c-8.052,-7.915%20-20.372,-12.939%20-34.894,-12.939c-13.421,-0%20-24.639,4.405%20-32.416,11.425c-6.608,6.194%20-10.324,14.521%20-10.324,23.813c0,8.121%202.616,15.003%207.915,20.234c5.3,5.3%2013.008,9.223%2023.125,11.7l16.725,3.992c8.397,1.996%2012.113,5.093%2012.113,10.599c0,6.814%20-6.194,10.806%20-16.311,10.806c-7.295,-0%20-13.215,-2.41%20-16.931,-6.402c-2.616,-2.615%20-4.198,-6.194%20-4.405,-10.117l-25.122,5.507c0.688,7.502%204.198,14.109%209.498,19.409c8.327,8.74%2021.818,13.971%2036.959,13.971m185.965,0c16.311,0%2028.838,-5.919%2037.44,-14.315c6.814,-6.608%2011.012,-14.316%2013.215,-22.231l-25.74,-8.603c-1.102,3.992%20-3.304,8.19%20-6.814,11.425c-4.198,3.992%20-9.911,6.814%20-18.101,6.814c-7.502,-0%20-14.522,-2.891%20-19.615,-7.916c-5.093,-5.299%20-8.19,-13.007%20-8.19,-22.712c0,-9.911%203.098,-17.413%208.19,-22.713c5.024,-5.093%2011.907,-7.708%2019.409,-7.708c7.915,0%2013.421,2.616%2017.413,6.608c3.303,3.304%205.299,7.502%206.607,11.7l26.222,-8.81c-1.995,-7.708%20-6.193,-15.417%20-12.319,-21.817c-8.81,-8.603%20-21.611,-14.729%20-38.542,-14.729c-15.623,0%20-29.732,5.919%20-39.849,16.105c-10.118,10.324%20-16.312,24.709%20-16.312,41.433c0,16.725%206.401,31.04%2016.725,41.433c10.047,10.117%2024.362,16.036%2040.261,16.036m-88.991,0c11.425,0%2019.615,-3.51%2023.125,-6.607l0,-23.813c-2.684,1.996%20-7.915,4.405%20-14.797,4.405c-4.886,-0%20-8.397,-1.102%20-11.012,-3.51c-2.202,-2.202%20-3.303,-5.988%20-3.303,-11.012l-0,-100.828l-29.113,0l0,29.732l58.157,0l-0,28.219l-58.157,-0l0,50.035c0,10.117%203.097,18.307%208.603,24.02c6.194,6.055%2015.278,9.359%2026.497,9.359'%20style='fill:%23502c84;fill-rule:nonzero;'%20/%3e%3c/g%3e%3c/svg%3e";
|
|
1235
1235
|
function an(e) {
|
|
1236
1236
|
return e.errors !== void 0;
|
|
1237
1237
|
}
|
|
1238
1238
|
const ar = () => {
|
|
1239
|
-
const { t: e } =
|
|
1239
|
+
const { t: e } = H(), [t, n] = I(!1), {
|
|
1240
1240
|
amount: r,
|
|
1241
1241
|
currency: o,
|
|
1242
1242
|
description: a,
|
|
@@ -1246,46 +1246,46 @@ const ar = () => {
|
|
|
1246
1246
|
version: l,
|
|
1247
1247
|
base_url: d,
|
|
1248
1248
|
on_failure: c,
|
|
1249
|
-
setFormSettings:
|
|
1249
|
+
setFormSettings: h
|
|
1250
1250
|
} = F(z), p = (v) => {
|
|
1251
|
-
|
|
1251
|
+
h && (n(v), h((b) => O(S({}, b), {
|
|
1252
1252
|
isProcessing: v
|
|
1253
1253
|
})));
|
|
1254
|
-
},
|
|
1254
|
+
}, _ = {
|
|
1255
1255
|
amount: r,
|
|
1256
1256
|
currency: o,
|
|
1257
1257
|
description: a,
|
|
1258
1258
|
publishable_api_key: i
|
|
1259
1259
|
};
|
|
1260
|
-
s && Object.keys(s).length > 0 && (
|
|
1260
|
+
s && Object.keys(s).length > 0 && (_.metadata = s), u && (_.invoice_id = u.toLowerCase());
|
|
1261
1261
|
const g = (v) => {
|
|
1262
|
-
|
|
1262
|
+
h && h((b) => O(S({}, b), {
|
|
1263
1263
|
apiError: `${e("error." + v.type)}, ${v.message}`
|
|
1264
1264
|
}));
|
|
1265
1265
|
}, m = () => {
|
|
1266
|
-
|
|
1266
|
+
h && h((v) => O(S({}, v), { apiError: "" }));
|
|
1267
1267
|
};
|
|
1268
1268
|
return {
|
|
1269
1269
|
processing: t,
|
|
1270
|
-
postData: (w) =>
|
|
1270
|
+
postData: (w) => q(void 0, [w], function* ({
|
|
1271
1271
|
data: v,
|
|
1272
|
-
path:
|
|
1272
|
+
path: b
|
|
1273
1273
|
}) {
|
|
1274
1274
|
p(!0), m();
|
|
1275
|
-
const
|
|
1275
|
+
const k = b || `${d}/v1/payments`;
|
|
1276
1276
|
try {
|
|
1277
|
-
const x = yield fetch(
|
|
1277
|
+
const x = yield fetch(k, {
|
|
1278
1278
|
method: "POST",
|
|
1279
1279
|
headers: {
|
|
1280
1280
|
"Content-Type": "application/json",
|
|
1281
1281
|
"X-Moyasar-Form-Version": l
|
|
1282
1282
|
},
|
|
1283
|
-
body: JSON.stringify(S(S({},
|
|
1283
|
+
body: JSON.stringify(S(S({}, _), v))
|
|
1284
1284
|
});
|
|
1285
1285
|
if (!x.ok) {
|
|
1286
1286
|
if (typeof x == "object") {
|
|
1287
|
-
const
|
|
1288
|
-
if (console.log("fetch error:",
|
|
1287
|
+
const D = yield x.json();
|
|
1288
|
+
if (console.log("fetch error:", D), !an(D)) {
|
|
1289
1289
|
g({
|
|
1290
1290
|
type: "api_error",
|
|
1291
1291
|
message: `Error code: ${x.status}`,
|
|
@@ -1293,7 +1293,7 @@ const ar = () => {
|
|
|
1293
1293
|
});
|
|
1294
1294
|
return;
|
|
1295
1295
|
}
|
|
1296
|
-
return g(
|
|
1296
|
+
return g(D), D;
|
|
1297
1297
|
}
|
|
1298
1298
|
return yield Promise.reject(x);
|
|
1299
1299
|
}
|
|
@@ -1302,8 +1302,8 @@ const ar = () => {
|
|
|
1302
1302
|
if (c)
|
|
1303
1303
|
try {
|
|
1304
1304
|
yield c(x);
|
|
1305
|
-
} catch (
|
|
1306
|
-
console.error("An error happened when firing failure callback"), console.error(
|
|
1305
|
+
} catch (D) {
|
|
1306
|
+
console.error("An error happened when firing failure callback"), console.error(D);
|
|
1307
1307
|
}
|
|
1308
1308
|
console.error(x);
|
|
1309
1309
|
} finally {
|
|
@@ -1313,9 +1313,9 @@ const ar = () => {
|
|
|
1313
1313
|
};
|
|
1314
1314
|
}, ir = () => {
|
|
1315
1315
|
const { apiError: e } = F(z), [t, n] = I(!1);
|
|
1316
|
-
return
|
|
1316
|
+
return j(() => {
|
|
1317
1317
|
n(!!e);
|
|
1318
|
-
}, [e]),
|
|
1318
|
+
}, [e]), j(() => {
|
|
1319
1319
|
let r = null;
|
|
1320
1320
|
return t && (r = setTimeout(() => {
|
|
1321
1321
|
n(!1);
|
|
@@ -1325,7 +1325,7 @@ const ar = () => {
|
|
|
1325
1325
|
}, [t]), {
|
|
1326
1326
|
fail: t
|
|
1327
1327
|
};
|
|
1328
|
-
}, sr = (n) =>
|
|
1328
|
+
}, sr = (n) => q(void 0, [n], function* ({
|
|
1329
1329
|
on_initiating: e,
|
|
1330
1330
|
setFormSettings: t
|
|
1331
1331
|
}) {
|
|
@@ -1348,11 +1348,11 @@ const ar = () => {
|
|
|
1348
1348
|
if (typeof o == "object")
|
|
1349
1349
|
return r(o), !0;
|
|
1350
1350
|
throw new Error(`Invalid on_initiating handler result: ${o}`);
|
|
1351
|
-
}), lr = (e, t, n) =>
|
|
1351
|
+
}), lr = (e, t, n) => q(void 0, null, function* () {
|
|
1352
1352
|
var o;
|
|
1353
1353
|
const r = `${e}${e.indexOf("?") > -1 ? "&" : "?"}id=${t.id}&status=${t.status}&message=${(o = t.source) == null ? void 0 : o.message}`;
|
|
1354
1354
|
n && typeof n == "function" ? yield n(r) : window.location.href = r;
|
|
1355
|
-
}), cr = (n) =>
|
|
1355
|
+
}), cr = (n) => q(void 0, [n], function* ({
|
|
1356
1356
|
payment: e,
|
|
1357
1357
|
on_completed: t
|
|
1358
1358
|
}) {
|
|
@@ -1365,56 +1365,56 @@ const ar = () => {
|
|
|
1365
1365
|
throw new Error("Unexpected error while handling on_completed callback");
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
}),
|
|
1368
|
+
}), me = ({
|
|
1369
1369
|
defaultError: e
|
|
1370
1370
|
}) => {
|
|
1371
|
-
const { callback_url: t, on_initiating: n, on_redirect: r, on_completed: o, setFormSettings: a } = F(z), [i, s] = I(e), { processing: u, postData: l } = ar(), [d, c] = I(!1), [
|
|
1372
|
-
function g(
|
|
1373
|
-
return
|
|
1374
|
-
const
|
|
1371
|
+
const { callback_url: t, on_initiating: n, on_redirect: r, on_completed: o, setFormSettings: a } = F(z), [i, s] = I(e), { processing: u, postData: l } = ar(), [d, c] = I(!1), [h, p] = I(!1), { fail: _ } = ir();
|
|
1372
|
+
function g(D) {
|
|
1373
|
+
return q(this, arguments, function* ({ data: v, path: b, onSuccess: w, onFailed: k, initPayment: x }) {
|
|
1374
|
+
const T = yield l({
|
|
1375
1375
|
data: v,
|
|
1376
|
-
path:
|
|
1376
|
+
path: b
|
|
1377
1377
|
});
|
|
1378
|
-
an(
|
|
1379
|
-
payment:
|
|
1378
|
+
an(T) || (T && (w && w(T), o && !x && (yield cr({
|
|
1379
|
+
payment: T,
|
|
1380
1380
|
on_completed: o
|
|
1381
|
-
}).catch((
|
|
1382
|
-
console.error(
|
|
1383
|
-
})),
|
|
1384
|
-
lr(t,
|
|
1381
|
+
}).catch((V) => {
|
|
1382
|
+
console.error(V);
|
|
1383
|
+
})), T.status === "paid" && (p(!0), setTimeout(() => {
|
|
1384
|
+
lr(t, T, r).catch(() => {
|
|
1385
1385
|
});
|
|
1386
|
-
}, 100)),
|
|
1386
|
+
}, 100)), T.status === "failed" && k && k(T)), c(!1));
|
|
1387
1387
|
});
|
|
1388
1388
|
}
|
|
1389
1389
|
function m(v) {
|
|
1390
|
-
return
|
|
1390
|
+
return q(this, null, function* () {
|
|
1391
1391
|
if (c(!0), v.initPayment) {
|
|
1392
1392
|
try {
|
|
1393
|
-
const
|
|
1393
|
+
const b = yield sr({
|
|
1394
1394
|
on_initiating: n,
|
|
1395
1395
|
setFormSettings: a
|
|
1396
1396
|
});
|
|
1397
|
-
if (typeof
|
|
1397
|
+
if (typeof b == "boolean" && !b) {
|
|
1398
1398
|
c(!1);
|
|
1399
1399
|
return;
|
|
1400
1400
|
}
|
|
1401
1401
|
yield g(v);
|
|
1402
|
-
} catch (
|
|
1403
|
-
console.error(
|
|
1402
|
+
} catch (b) {
|
|
1403
|
+
console.error(b), c(!1);
|
|
1404
1404
|
}
|
|
1405
1405
|
return;
|
|
1406
1406
|
}
|
|
1407
1407
|
yield g(v);
|
|
1408
1408
|
});
|
|
1409
1409
|
}
|
|
1410
|
-
const
|
|
1410
|
+
const y = ae(() => u || d, [u, d]);
|
|
1411
1411
|
return {
|
|
1412
1412
|
makePayment: m,
|
|
1413
1413
|
busy: d,
|
|
1414
|
-
fail:
|
|
1415
|
-
success:
|
|
1414
|
+
fail: _,
|
|
1415
|
+
success: h,
|
|
1416
1416
|
processing: u,
|
|
1417
|
-
loading:
|
|
1417
|
+
loading: y,
|
|
1418
1418
|
error: i,
|
|
1419
1419
|
setError: s
|
|
1420
1420
|
};
|
|
@@ -1422,39 +1422,39 @@ const ar = () => {
|
|
|
1422
1422
|
const { apiError: t, showForm: n } = F(z);
|
|
1423
1423
|
return n && !e ? null : /* @__PURE__ */ f("p", { class: "flex flex-col gap-2 rounded-md border border-error bg-red-100 px-4 py-2 text-xs font-medium text-error empty:hidden", children: t });
|
|
1424
1424
|
}, ur = () => {
|
|
1425
|
-
const { t: e } =
|
|
1425
|
+
const { t: e } = H(), { formattedAmount: t, isRtl: n, fixed_width: r, setFormSettings: o, showForm: a } = F(z), [i, s] = I(null), [u, l] = I(!1), d = {
|
|
1426
1426
|
phone: "",
|
|
1427
1427
|
otp: ""
|
|
1428
1428
|
}, {
|
|
1429
1429
|
makePayment: c,
|
|
1430
|
-
busy:
|
|
1430
|
+
busy: h,
|
|
1431
1431
|
fail: p,
|
|
1432
|
-
success:
|
|
1432
|
+
success: _,
|
|
1433
1433
|
loading: g,
|
|
1434
1434
|
error: m,
|
|
1435
|
-
setError:
|
|
1436
|
-
} =
|
|
1437
|
-
const
|
|
1438
|
-
return
|
|
1439
|
-
phone:
|
|
1440
|
-
})),
|
|
1441
|
-
},
|
|
1442
|
-
const
|
|
1443
|
-
return
|
|
1444
|
-
otp:
|
|
1445
|
-
})),
|
|
1446
|
-
},
|
|
1447
|
-
const { value:
|
|
1448
|
-
if (l(!1), !
|
|
1449
|
-
l(!
|
|
1435
|
+
setError: y
|
|
1436
|
+
} = me({ defaultError: d }), [v, b] = I(""), [w, k] = I(""), [x, D] = I(""), T = (L) => {
|
|
1437
|
+
const M = /^05[503649187][0-9]{7}$/.test(B(L));
|
|
1438
|
+
return y((K) => O(S({}, K), {
|
|
1439
|
+
phone: M ? "" : "error.invalid_mobile"
|
|
1440
|
+
})), M;
|
|
1441
|
+
}, V = (L) => {
|
|
1442
|
+
const M = /^[0-9]{4,}$/.test(B(L));
|
|
1443
|
+
return y((K) => O(S({}, K), {
|
|
1444
|
+
otp: M ? "" : "error.invalid_otp"
|
|
1445
|
+
})), M;
|
|
1446
|
+
}, A = (L) => {
|
|
1447
|
+
const { value: M, name: K } = L.target, Q = M.trim();
|
|
1448
|
+
if (l(!1), !Q) {
|
|
1449
|
+
l(!Q);
|
|
1450
1450
|
return;
|
|
1451
1451
|
}
|
|
1452
|
-
|
|
1453
|
-
},
|
|
1454
|
-
if (!
|
|
1455
|
-
function
|
|
1456
|
-
const { transaction_url:
|
|
1457
|
-
|
|
1452
|
+
K === "mysr-stc-mobile" && T(Q), K === "mysr-stc-otp" && V(Q);
|
|
1453
|
+
}, C = () => {
|
|
1454
|
+
if (!T(v)) return;
|
|
1455
|
+
function L(M) {
|
|
1456
|
+
const { transaction_url: K } = M.source;
|
|
1457
|
+
D(K), s((/* @__PURE__ */ new Date()).getTime() + 5 * 60 * 1e3);
|
|
1458
1458
|
}
|
|
1459
1459
|
c({
|
|
1460
1460
|
data: {
|
|
@@ -1463,53 +1463,53 @@ const ar = () => {
|
|
|
1463
1463
|
mobile: B(v)
|
|
1464
1464
|
}
|
|
1465
1465
|
},
|
|
1466
|
-
onSuccess:
|
|
1466
|
+
onSuccess: L,
|
|
1467
1467
|
initPayment: !0
|
|
1468
|
-
}).catch((
|
|
1469
|
-
console.error(
|
|
1468
|
+
}).catch((M) => {
|
|
1469
|
+
console.error(M);
|
|
1470
1470
|
});
|
|
1471
|
-
},
|
|
1472
|
-
if (!i || !
|
|
1473
|
-
function
|
|
1474
|
-
var
|
|
1475
|
-
|
|
1471
|
+
}, U = () => {
|
|
1472
|
+
if (!i || !V(w)) return;
|
|
1473
|
+
function L(M) {
|
|
1474
|
+
var K;
|
|
1475
|
+
M.status === "failed" && ((K = M.source) == null ? void 0 : K.message) === "Invalid OTP" && (y((Q) => O(S({}, Q), {
|
|
1476
1476
|
otp: "error.invalid_otp"
|
|
1477
|
-
})),
|
|
1477
|
+
})), k(""), s(null));
|
|
1478
1478
|
}
|
|
1479
1479
|
c({
|
|
1480
1480
|
data: {
|
|
1481
1481
|
otp_value: B(w)
|
|
1482
1482
|
},
|
|
1483
1483
|
path: x,
|
|
1484
|
-
onFailed:
|
|
1485
|
-
}).catch((
|
|
1486
|
-
console.error(
|
|
1484
|
+
onFailed: L
|
|
1485
|
+
}).catch((M) => {
|
|
1486
|
+
console.error(M);
|
|
1487
1487
|
});
|
|
1488
|
-
},
|
|
1489
|
-
if (
|
|
1490
|
-
|
|
1488
|
+
}, Y = (L) => {
|
|
1489
|
+
if (L.preventDefault(), y(d), !i) {
|
|
1490
|
+
C();
|
|
1491
1491
|
return;
|
|
1492
1492
|
}
|
|
1493
|
-
|
|
1494
|
-
},
|
|
1495
|
-
|
|
1493
|
+
U();
|
|
1494
|
+
}, _e = (L) => {
|
|
1495
|
+
L > 0 || (y((M) => O(S({}, M), {
|
|
1496
1496
|
otp: "error.otp_time_out"
|
|
1497
|
-
})),
|
|
1498
|
-
},
|
|
1499
|
-
|
|
1497
|
+
})), k(""), s(null));
|
|
1498
|
+
}, ye = ae(() => m.phone || i && m.otp && m.otp !== "error.otp_time_out" ? !0 : u || g, [m, u, g]), ue = (L) => o((M) => O(S({}, M), { showForm: L })), [ie, de] = I(!1), ve = () => {
|
|
1499
|
+
de(!0);
|
|
1500
1500
|
}, Ve = () => {
|
|
1501
|
-
|
|
1501
|
+
ie && (b(""), k(""), y(d), ue(!1), de(!1), l(!1));
|
|
1502
1502
|
};
|
|
1503
1503
|
return /* @__PURE__ */ f(
|
|
1504
1504
|
st.Provider,
|
|
1505
1505
|
{
|
|
1506
1506
|
value: {
|
|
1507
1507
|
err: m,
|
|
1508
|
-
setErr:
|
|
1509
|
-
handleBlur:
|
|
1508
|
+
setErr: y,
|
|
1509
|
+
handleBlur: A
|
|
1510
1510
|
},
|
|
1511
|
-
children: /* @__PURE__ */ f(
|
|
1512
|
-
/* @__PURE__ */ f(We, { variant: "stc", onClick: () =>
|
|
1511
|
+
children: /* @__PURE__ */ f(ee, { children: [
|
|
1512
|
+
/* @__PURE__ */ f(We, { variant: "stc", onClick: () => ue(!0), children: /* @__PURE__ */ f(
|
|
1513
1513
|
"img",
|
|
1514
1514
|
{
|
|
1515
1515
|
class: "pointer-events-none h-4 max-h-full",
|
|
@@ -1519,23 +1519,23 @@ const ar = () => {
|
|
|
1519
1519
|
src: In
|
|
1520
1520
|
}
|
|
1521
1521
|
) }),
|
|
1522
|
-
a && /* @__PURE__ */ f(
|
|
1522
|
+
a && /* @__PURE__ */ f(ee, { children: [
|
|
1523
1523
|
/* @__PURE__ */ f(
|
|
1524
1524
|
"div",
|
|
1525
1525
|
{
|
|
1526
|
-
class:
|
|
1526
|
+
class: te([
|
|
1527
1527
|
"fixed inset-0 z-[9] bg-gray-500/75 transition-opacity",
|
|
1528
|
-
|
|
1528
|
+
ie ? "animate-fade-out duration-300" : "animate-fade-in duration-200"
|
|
1529
1529
|
])
|
|
1530
1530
|
}
|
|
1531
1531
|
),
|
|
1532
1532
|
/* @__PURE__ */ f("div", { class: "fixed inset-0 z-10 flex flex-col justify-end md:justify-center", children: /* @__PURE__ */ f(
|
|
1533
1533
|
"div",
|
|
1534
1534
|
{
|
|
1535
|
-
class:
|
|
1535
|
+
class: te([
|
|
1536
1536
|
"flex w-full origin-bottom flex-col gap-4 rounded-t-lg border-neutral-300 bg-slate-100 p-4 shadow transition-all md:rounded-b-lg lg:p-10",
|
|
1537
1537
|
r && "md:mx-auto md:max-w-96 lg:max-w-screen-sm",
|
|
1538
|
-
|
|
1538
|
+
ie ? "animate-dialog-out-mobile duration-200 md:animate-dialog-out" : "animate-dialog-in-mobile duration-300 md:animate-dialog-in"
|
|
1539
1539
|
]),
|
|
1540
1540
|
onAnimationEnd: Ve,
|
|
1541
1541
|
children: [
|
|
@@ -1544,7 +1544,7 @@ const ar = () => {
|
|
|
1544
1544
|
/* @__PURE__ */ f("img", { alt: "", src: or, class: "h-5" }),
|
|
1545
1545
|
/* @__PURE__ */ f("button", { onClick: ve, class: "ms-auto", children: "Cancel" })
|
|
1546
1546
|
] }),
|
|
1547
|
-
/* @__PURE__ */ f("form", { class: "flex flex-col gap-4", onSubmit:
|
|
1547
|
+
/* @__PURE__ */ f("form", { class: "flex flex-col gap-4", onSubmit: Y, children: [
|
|
1548
1548
|
/* @__PURE__ */ f("div", { class: "space-y-2", children: [
|
|
1549
1549
|
/* @__PURE__ */ f("div", { class: "flex items-end justify-between text-xs font-medium", children: [
|
|
1550
1550
|
i ? /* @__PURE__ */ f("label", { for: "mysr-stc-mobile", children: e("form.otp") }) : /* @__PURE__ */ f("label", { for: "mysr-stc-otp", children: e("form.mobile") }),
|
|
@@ -1554,7 +1554,7 @@ const ar = () => {
|
|
|
1554
1554
|
tr,
|
|
1555
1555
|
{
|
|
1556
1556
|
value: v,
|
|
1557
|
-
setValue:
|
|
1557
|
+
setValue: b,
|
|
1558
1558
|
showOtp: !i && typeof i != "number"
|
|
1559
1559
|
}
|
|
1560
1560
|
),
|
|
@@ -1562,7 +1562,7 @@ const ar = () => {
|
|
|
1562
1562
|
nr,
|
|
1563
1563
|
{
|
|
1564
1564
|
value: w,
|
|
1565
|
-
setValue:
|
|
1565
|
+
setValue: k,
|
|
1566
1566
|
showPhone: !i && typeof i != "number"
|
|
1567
1567
|
}
|
|
1568
1568
|
)
|
|
@@ -1570,22 +1570,22 @@ const ar = () => {
|
|
|
1570
1570
|
/* @__PURE__ */ f(
|
|
1571
1571
|
We,
|
|
1572
1572
|
{
|
|
1573
|
-
success:
|
|
1573
|
+
success: _,
|
|
1574
1574
|
fail: p,
|
|
1575
|
-
busy:
|
|
1575
|
+
busy: h,
|
|
1576
1576
|
variant: "stc",
|
|
1577
1577
|
class: "flex gap-1",
|
|
1578
|
-
disabled:
|
|
1578
|
+
disabled: ye,
|
|
1579
1579
|
type: "submit",
|
|
1580
1580
|
children: [
|
|
1581
1581
|
!n && e("button.pay"),
|
|
1582
1582
|
" ",
|
|
1583
|
-
i ? /* @__PURE__ */ f(rr, { countTo: i, callback:
|
|
1583
|
+
i ? /* @__PURE__ */ f(rr, { countTo: i, callback: _e }) : t
|
|
1584
1584
|
]
|
|
1585
1585
|
}
|
|
1586
1586
|
)
|
|
1587
1587
|
] }),
|
|
1588
|
-
/* @__PURE__ */ f("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(m).map(([
|
|
1588
|
+
/* @__PURE__ */ f("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(m).map(([L, M]) => /* @__PURE__ */ f("span", { class: "empty:hidden", children: e(M) }, L)) })
|
|
1589
1589
|
]
|
|
1590
1590
|
}
|
|
1591
1591
|
) })
|
|
@@ -1594,7 +1594,7 @@ const ar = () => {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
);
|
|
1596
1596
|
}, dr = () => {
|
|
1597
|
-
const { t: e } =
|
|
1597
|
+
const { t: e } = H(), {
|
|
1598
1598
|
base_url: t,
|
|
1599
1599
|
payment_button_type: n,
|
|
1600
1600
|
publishable_api_key: r,
|
|
@@ -1605,8 +1605,8 @@ const ar = () => {
|
|
|
1605
1605
|
decimalAmount: u,
|
|
1606
1606
|
statement_descriptor: l,
|
|
1607
1607
|
setFormSettings: d
|
|
1608
|
-
} = F(z), { makePayment: c } =
|
|
1609
|
-
function
|
|
1608
|
+
} = F(z), { makePayment: c } = me({ defaultError: {} });
|
|
1609
|
+
function h() {
|
|
1610
1610
|
if (!ApplePaySession)
|
|
1611
1611
|
return;
|
|
1612
1612
|
const p = (o == null ? void 0 : o.label) || (a == null ? void 0 : a.label), g = {
|
|
@@ -1619,14 +1619,14 @@ const ar = () => {
|
|
|
1619
1619
|
amount: u
|
|
1620
1620
|
}
|
|
1621
1621
|
}, m = new ApplePaySession(o.version, g);
|
|
1622
|
-
m.onvalidatemerchant = (
|
|
1622
|
+
m.onvalidatemerchant = (y) => {
|
|
1623
1623
|
const v = {
|
|
1624
|
-
validation_url:
|
|
1624
|
+
validation_url: y.validationURL,
|
|
1625
1625
|
display_name: p,
|
|
1626
1626
|
domain_name: window.location.hostname,
|
|
1627
1627
|
publishable_api_key: r
|
|
1628
|
-
},
|
|
1629
|
-
fetch(
|
|
1628
|
+
}, b = o.validate_merchant_url || `${t}/v1/applepay/initiate`;
|
|
1629
|
+
fetch(b, {
|
|
1630
1630
|
method: "POST",
|
|
1631
1631
|
headers: {
|
|
1632
1632
|
"Content-Type": "application/json"
|
|
@@ -1635,46 +1635,46 @@ const ar = () => {
|
|
|
1635
1635
|
}).then((w) => w.ok ? w : Promise.reject(w)).then((w) => w.json()).then((w) => {
|
|
1636
1636
|
m.completeMerchantValidation(w);
|
|
1637
1637
|
}).catch((w) => {
|
|
1638
|
-
console.error("Apple Pay error:", w), d((
|
|
1638
|
+
console.error("Apple Pay error:", w), d((k) => O(S({}, k), {
|
|
1639
1639
|
apiError: e("error.applePay")
|
|
1640
1640
|
})), m.abort();
|
|
1641
1641
|
});
|
|
1642
|
-
}, m.onpaymentauthorized = (
|
|
1642
|
+
}, m.onpaymentauthorized = (y) => {
|
|
1643
1643
|
const v = {
|
|
1644
1644
|
source: {
|
|
1645
1645
|
type: "applepay",
|
|
1646
|
-
token: JSON.stringify(
|
|
1646
|
+
token: JSON.stringify(y.payment.token)
|
|
1647
1647
|
}
|
|
1648
1648
|
};
|
|
1649
1649
|
l && (v.statement_descriptor = l);
|
|
1650
|
-
function k
|
|
1651
|
-
var
|
|
1652
|
-
console.error(
|
|
1650
|
+
function b(k) {
|
|
1651
|
+
var D;
|
|
1652
|
+
console.error(k), m.completePayment({
|
|
1653
1653
|
status: ApplePaySession.STATUS_FAILURE,
|
|
1654
1654
|
errors: []
|
|
1655
1655
|
});
|
|
1656
1656
|
let x = "Payment failed.";
|
|
1657
|
-
|
|
1657
|
+
k instanceof Response ? x += " Error: " + k.statusText : typeof k == "string" ? x += " Error: " + k : k.status === "failed" && (x += " Error: " + ((D = k.source) == null ? void 0 : D.message)), d((T) => O(S({}, T), {
|
|
1658
1658
|
apiError: x
|
|
1659
1659
|
}));
|
|
1660
1660
|
}
|
|
1661
|
-
function w(
|
|
1662
|
-
console.error(
|
|
1661
|
+
function w(k) {
|
|
1662
|
+
console.error(k), m.completePayment({
|
|
1663
1663
|
status: ApplePaySession.STATUS_SUCCESS
|
|
1664
1664
|
});
|
|
1665
1665
|
}
|
|
1666
1666
|
c({
|
|
1667
1667
|
data: v,
|
|
1668
|
-
onFailed:
|
|
1668
|
+
onFailed: b,
|
|
1669
1669
|
onSuccess: w
|
|
1670
|
-
}).catch((
|
|
1671
|
-
console.error(
|
|
1670
|
+
}).catch((k) => {
|
|
1671
|
+
console.error(k);
|
|
1672
1672
|
});
|
|
1673
1673
|
}, m.oncancel = () => {
|
|
1674
1674
|
try {
|
|
1675
1675
|
m.abort();
|
|
1676
|
-
} catch (
|
|
1677
|
-
console.error(
|
|
1676
|
+
} catch (y) {
|
|
1677
|
+
console.error(y);
|
|
1678
1678
|
}
|
|
1679
1679
|
}, m.begin();
|
|
1680
1680
|
}
|
|
@@ -1683,122 +1683,121 @@ const ar = () => {
|
|
|
1683
1683
|
{
|
|
1684
1684
|
class: "apple-pay-button",
|
|
1685
1685
|
style: { "-apple-pay-button-type": n },
|
|
1686
|
-
onClick:
|
|
1686
|
+
onClick: h
|
|
1687
1687
|
}
|
|
1688
1688
|
);
|
|
1689
1689
|
}, pr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeEAAABLCAMAAABwZM8AAAADAFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7LtSl7AAAA/3RSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3+Dh4uPk5ebn6Onq6+zt7u/w8fLz9PX29/j5+vv8/f7rCNk1AAAZe0lEQVR42uyad5RU1R3Hv7fM7LoUAZWsDSluRKKgYK9EcLFgyxE1NmzHEjXG3kUkIrYQLBijUVSkiRJDUUQ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OHVb2sKqr4QEIadOJl/R9/eIVAmWuIbgAAAABJRU5ErkJggg==", fr = () => {
|
|
1690
1690
|
const {
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
window.SamsungPay && l(!0);
|
|
1691
|
+
payment_button_type: e,
|
|
1692
|
+
samsung_pay: t,
|
|
1693
|
+
payment_options: n,
|
|
1694
|
+
supported_networks: r,
|
|
1695
|
+
currency: o,
|
|
1696
|
+
decimalAmount: a,
|
|
1697
|
+
setFormSettings: i
|
|
1698
|
+
} = F(z), [s, u] = I(!1), [l, d] = I(!1), { makePayment: c } = me({ defaultError: {} }), { t: h } = H(), p = J(null);
|
|
1699
|
+
j(() => {
|
|
1700
|
+
let m = null;
|
|
1701
|
+
return s || (m = setInterval(() => {
|
|
1702
|
+
window.SamsungPay && u(!0);
|
|
1704
1703
|
}, 100)), () => {
|
|
1705
|
-
clearInterval(
|
|
1704
|
+
clearInterval(m);
|
|
1706
1705
|
};
|
|
1707
|
-
}, [
|
|
1708
|
-
const
|
|
1709
|
-
if (!(!
|
|
1710
|
-
return new SamsungPay.PaymentClient({ environment:
|
|
1711
|
-
}, [
|
|
1712
|
-
if (
|
|
1713
|
-
if (!
|
|
1706
|
+
}, [s]);
|
|
1707
|
+
const _ = ae(() => {
|
|
1708
|
+
if (!(!s || !t))
|
|
1709
|
+
return new SamsungPay.PaymentClient({ environment: t.environment });
|
|
1710
|
+
}, [s]);
|
|
1711
|
+
if (j(() => q(void 0, null, function* () {
|
|
1712
|
+
if (!_ || !t)
|
|
1714
1713
|
return;
|
|
1715
|
-
const
|
|
1716
|
-
version:
|
|
1717
|
-
serviceId:
|
|
1714
|
+
const m = r == null ? void 0 : r.map((v) => v.toLowerCase()), y = {
|
|
1715
|
+
version: t.version.toString(),
|
|
1716
|
+
serviceId: t.service_id,
|
|
1718
1717
|
protocol: "PROTOCOL_3DS",
|
|
1719
|
-
allowedBrands:
|
|
1718
|
+
allowedBrands: m
|
|
1720
1719
|
};
|
|
1721
|
-
|
|
1722
|
-
const { order_number:
|
|
1723
|
-
orderNumber:
|
|
1720
|
+
p.current = () => q(void 0, null, function* () {
|
|
1721
|
+
const { order_number: v, id: b, country: w, label: k } = t, x = k || (n == null ? void 0 : n.label), D = w || (n == null ? void 0 : n.country), T = {
|
|
1722
|
+
orderNumber: v,
|
|
1724
1723
|
merchant: {
|
|
1725
|
-
name:
|
|
1726
|
-
id:
|
|
1727
|
-
countryCode:
|
|
1724
|
+
name: x,
|
|
1725
|
+
id: b,
|
|
1726
|
+
countryCode: D,
|
|
1728
1727
|
url: window.location.hostname
|
|
1729
1728
|
},
|
|
1730
1729
|
amount: {
|
|
1731
1730
|
option: "FORMAT_TOTAL_ESTIMATED_AMOUNT",
|
|
1732
|
-
currency:
|
|
1733
|
-
total:
|
|
1731
|
+
currency: o,
|
|
1732
|
+
total: a
|
|
1734
1733
|
}
|
|
1735
|
-
},
|
|
1736
|
-
|
|
1734
|
+
}, V = () => {
|
|
1735
|
+
_.notify({
|
|
1737
1736
|
status: "CHARGED",
|
|
1738
1737
|
provider: "Moyasar"
|
|
1739
1738
|
});
|
|
1740
|
-
},
|
|
1741
|
-
var
|
|
1742
|
-
|
|
1739
|
+
}, A = (C) => {
|
|
1740
|
+
var Y;
|
|
1741
|
+
_.notify({
|
|
1743
1742
|
status: "REJECTED",
|
|
1744
1743
|
provider: "Moyasar"
|
|
1745
1744
|
});
|
|
1746
|
-
let
|
|
1747
|
-
|
|
1745
|
+
let U = "Payment failed.";
|
|
1746
|
+
C instanceof Payment && C.isFailed() ? U += " Error: " + ((Y = C.source) == null ? void 0 : Y.message) : C instanceof Response ? U += " Error: " + C.statusText : typeof C == "string" && (U += " Error: " + C), console.log("Samsung Pay error: ", U);
|
|
1748
1747
|
};
|
|
1749
1748
|
try {
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1752
|
-
|
|
1749
|
+
const C = yield _.loadPaymentSheet(
|
|
1750
|
+
y,
|
|
1751
|
+
T
|
|
1753
1752
|
);
|
|
1754
|
-
|
|
1753
|
+
c({
|
|
1755
1754
|
initPayment: !0,
|
|
1756
1755
|
data: {
|
|
1757
1756
|
source: {
|
|
1758
1757
|
type: "samsungpay",
|
|
1759
|
-
token:
|
|
1758
|
+
token: C["3DS"].data
|
|
1760
1759
|
}
|
|
1761
1760
|
},
|
|
1762
|
-
onFailed:
|
|
1763
|
-
onSuccess:
|
|
1761
|
+
onFailed: A,
|
|
1762
|
+
onSuccess: V
|
|
1764
1763
|
});
|
|
1765
|
-
} catch (
|
|
1764
|
+
} catch (C) {
|
|
1766
1765
|
try {
|
|
1767
|
-
|
|
1766
|
+
_.notify({
|
|
1768
1767
|
status: "ERRED",
|
|
1769
1768
|
provider: "Moyasar"
|
|
1770
1769
|
});
|
|
1771
|
-
} catch (
|
|
1770
|
+
} catch (U) {
|
|
1772
1771
|
}
|
|
1773
|
-
console.log("Samsung Pay error: ",
|
|
1772
|
+
console.log("Samsung Pay error: ", C);
|
|
1774
1773
|
}
|
|
1775
1774
|
});
|
|
1776
1775
|
try {
|
|
1777
|
-
(yield
|
|
1776
|
+
(yield _.isReadyToPay(y)).result ? d(!0) : i((b) => O(S({}, b), {
|
|
1778
1777
|
apiError: "Cannot initialize Samsung Pay"
|
|
1779
1778
|
}));
|
|
1780
|
-
} catch (
|
|
1779
|
+
} catch (v) {
|
|
1781
1780
|
try {
|
|
1782
|
-
|
|
1781
|
+
_.notify({
|
|
1783
1782
|
status: "ERRED",
|
|
1784
1783
|
provider: "Moyasar"
|
|
1785
1784
|
});
|
|
1786
|
-
} catch (
|
|
1785
|
+
} catch (b) {
|
|
1787
1786
|
}
|
|
1788
|
-
|
|
1787
|
+
i((b) => O(S({}, b), {
|
|
1789
1788
|
apiError: "Cannot initialize Samsung Pay"
|
|
1790
|
-
})), console.error("Samsung Pay Error: ",
|
|
1789
|
+
})), console.error("Samsung Pay Error: ", v);
|
|
1791
1790
|
}
|
|
1792
|
-
}), [
|
|
1791
|
+
}), [_, t]), !s || !l)
|
|
1793
1792
|
return null;
|
|
1794
|
-
const
|
|
1793
|
+
const g = e === "pay" ? "pay-with" : e;
|
|
1795
1794
|
return /* @__PURE__ */ f(
|
|
1796
1795
|
"button",
|
|
1797
1796
|
{
|
|
1798
1797
|
class: "flex h-11 w-full items-center justify-center gap-1 rounded-md bg-black text-white",
|
|
1799
|
-
onClick:
|
|
1798
|
+
onClick: p.current,
|
|
1800
1799
|
children: [
|
|
1801
|
-
/* @__PURE__ */ f("span", { children:
|
|
1800
|
+
/* @__PURE__ */ f("span", { children: h(`button.${g}`) }),
|
|
1802
1801
|
/* @__PURE__ */ f("img", { src: pr, alt: "", class: "-mb-[3px] h-[22px]" }),
|
|
1803
1802
|
/* @__PURE__ */ f("div", { class: "mb-0.5 h-[9px] w-[9px] rotate-45 rounded-sm border-r-[3px] border-t-[3px] border-white" })
|
|
1804
1803
|
]
|
|
@@ -1814,67 +1813,67 @@ const ar = () => {
|
|
|
1814
1813
|
currency: a,
|
|
1815
1814
|
decimalAmount: i,
|
|
1816
1815
|
setFormSettings: s
|
|
1817
|
-
} = F(z), [u, l] = I(!1), { makePayment: d } =
|
|
1818
|
-
|
|
1819
|
-
let
|
|
1820
|
-
return u || (
|
|
1821
|
-
var p,
|
|
1822
|
-
(
|
|
1816
|
+
} = F(z), [u, l] = I(!1), { makePayment: d } = me({ defaultError: {} });
|
|
1817
|
+
j(() => {
|
|
1818
|
+
let h = null;
|
|
1819
|
+
return u || (h = setInterval(() => {
|
|
1820
|
+
var p, _;
|
|
1821
|
+
(_ = (p = window.google) == null ? void 0 : p.payments) != null && _.api && l(!0);
|
|
1823
1822
|
}, 100)), () => {
|
|
1824
|
-
clearInterval(
|
|
1823
|
+
clearInterval(h);
|
|
1825
1824
|
};
|
|
1826
1825
|
}, [u]);
|
|
1827
|
-
const c =
|
|
1826
|
+
const c = ae(() => {
|
|
1828
1827
|
if (u)
|
|
1829
1828
|
return new google.payments.api.PaymentsClient({
|
|
1830
1829
|
environment: n.environment
|
|
1831
1830
|
});
|
|
1832
1831
|
}, [u]);
|
|
1833
|
-
return
|
|
1834
|
-
const
|
|
1835
|
-
if (!c || !n || (
|
|
1832
|
+
return j(() => q(void 0, null, function* () {
|
|
1833
|
+
const h = document.getElementById("googlePay-container");
|
|
1834
|
+
if (!c || !n || (h == null ? void 0 : h.children.length) >= 1)
|
|
1836
1835
|
return;
|
|
1837
1836
|
n.merchant_id;
|
|
1838
|
-
const p = o == null ? void 0 : o.filter((x) => x !== "mada").map((x) => x.toUpperCase()),
|
|
1837
|
+
const p = o == null ? void 0 : o.filter((x) => x !== "mada").map((x) => x.toUpperCase()), _ = n.auth_methods, g = {
|
|
1839
1838
|
apiVersion: 2,
|
|
1840
1839
|
apiVersionMinor: 0
|
|
1841
1840
|
}, m = {
|
|
1842
1841
|
type: "CARD",
|
|
1843
1842
|
parameters: {
|
|
1844
|
-
allowedAuthMethods:
|
|
1843
|
+
allowedAuthMethods: _,
|
|
1845
1844
|
allowedCardNetworks: p
|
|
1846
1845
|
}
|
|
1847
|
-
},
|
|
1848
|
-
|
|
1849
|
-
const v = () =>
|
|
1850
|
-
const { country: x, label:
|
|
1851
|
-
allowedPaymentMethods: [
|
|
1846
|
+
}, y = Object.assign({}, g);
|
|
1847
|
+
y.allowedPaymentMethods = [m];
|
|
1848
|
+
const v = () => q(void 0, null, function* () {
|
|
1849
|
+
const { country: x, label: D, merchant_id: T } = n, V = D || (r == null ? void 0 : r.label), A = x || (r == null ? void 0 : r.country), C = O(S({}, g), {
|
|
1850
|
+
allowedPaymentMethods: [k],
|
|
1852
1851
|
merchantInfo: {
|
|
1853
|
-
merchantId:
|
|
1854
|
-
merchantName:
|
|
1852
|
+
merchantId: T,
|
|
1853
|
+
merchantName: V
|
|
1855
1854
|
},
|
|
1856
1855
|
transactionInfo: {
|
|
1857
|
-
countryCode:
|
|
1856
|
+
countryCode: A,
|
|
1858
1857
|
currencyCode: a,
|
|
1859
1858
|
totalPriceStatus: "FINAL",
|
|
1860
1859
|
totalPrice: i
|
|
1861
1860
|
}
|
|
1862
1861
|
});
|
|
1863
1862
|
try {
|
|
1864
|
-
const
|
|
1863
|
+
const U = yield c.loadPaymentData(C);
|
|
1865
1864
|
d({
|
|
1866
1865
|
initPayment: !0,
|
|
1867
1866
|
data: {
|
|
1868
1867
|
source: {
|
|
1869
1868
|
type: "googlepay",
|
|
1870
|
-
token:
|
|
1869
|
+
token: U.paymentMethodData.tokenizationData.token
|
|
1871
1870
|
}
|
|
1872
1871
|
}
|
|
1873
1872
|
});
|
|
1874
|
-
} catch (
|
|
1875
|
-
console.error(
|
|
1873
|
+
} catch (U) {
|
|
1874
|
+
console.error(U);
|
|
1876
1875
|
}
|
|
1877
|
-
}),
|
|
1876
|
+
}), b = () => {
|
|
1878
1877
|
const x = c.createButton({
|
|
1879
1878
|
onClick: v,
|
|
1880
1879
|
buttonLocale: e,
|
|
@@ -1883,22 +1882,22 @@ const ar = () => {
|
|
|
1883
1882
|
buttonRadius: 6,
|
|
1884
1883
|
buttonSizeMode: "fill"
|
|
1885
1884
|
});
|
|
1886
|
-
|
|
1885
|
+
h.appendChild(x);
|
|
1887
1886
|
}, w = {
|
|
1888
1887
|
type: "PAYMENT_GATEWAY",
|
|
1889
1888
|
parameters: {
|
|
1890
1889
|
gateway: "moyasar",
|
|
1891
1890
|
gatewayMerchantId: n.gateway_merchant_id
|
|
1892
1891
|
}
|
|
1893
|
-
},
|
|
1892
|
+
}, k = Object.assign({}, m, {
|
|
1894
1893
|
tokenizationSpecification: w
|
|
1895
1894
|
});
|
|
1896
1895
|
try {
|
|
1897
|
-
(yield c.isReadyToPay(
|
|
1896
|
+
(yield c.isReadyToPay(y)).result ? b() : s((D) => O(S({}, D), {
|
|
1898
1897
|
apiError: "Cannot initialize Google Pay"
|
|
1899
1898
|
}));
|
|
1900
1899
|
} catch (x) {
|
|
1901
|
-
s((
|
|
1900
|
+
s((D) => O(S({}, D), {
|
|
1902
1901
|
apiError: "Cannot initialize Google Pay"
|
|
1903
1902
|
})), console.error("Google Pay Error: ", x);
|
|
1904
1903
|
}
|
|
@@ -1910,7 +1909,7 @@ const ar = () => {
|
|
|
1910
1909
|
}
|
|
1911
1910
|
) : null;
|
|
1912
1911
|
}, hr = () => {
|
|
1913
|
-
const { t: e } =
|
|
1912
|
+
const { t: e } = H(), { methods: t, apple_pay: n, samsung_pay: r, google_pay: o } = F(z), a = t.includes("stcpay"), i = t.includes("creditcard"), s = location.protocol === "https:" && t.includes("applepay") && typeof window.ApplePaySession != "undefined" && ApplePaySession.canMakePayments() && (n == null ? void 0 : n.version) && ApplePaySession.supportsVersion(n == null ? void 0 : n.version), u = !!(r != null && r.service_id), l = !!(o != null && o.merchant_id);
|
|
1914
1913
|
return !s && !a && !u && !l ? null : /* @__PURE__ */ f("div", { class: "flex w-full flex-col gap-4", role: "main", children: [
|
|
1915
1914
|
a && /* @__PURE__ */ f(ur, {}),
|
|
1916
1915
|
s && /* @__PURE__ */ f(dr, {}),
|
|
@@ -2139,9 +2138,9 @@ const ar = () => {
|
|
|
2139
2138
|
isValid: !t && n && r
|
|
2140
2139
|
};
|
|
2141
2140
|
}, vr = ({ value: e, setValue: t, err: n, setErr: r }) => {
|
|
2142
|
-
const { t: o } =
|
|
2143
|
-
const c = d.target.value.trim(), { isEmpty:
|
|
2144
|
-
if (
|
|
2141
|
+
const { t: o } = H(), [a, i] = I(!1), s = (d) => {
|
|
2142
|
+
const c = d.target.value.trim(), { isEmpty: h, isEnglishOnly: p, isValidFormat: _ } = ln(c);
|
|
2143
|
+
if (h) {
|
|
2145
2144
|
i(!c);
|
|
2146
2145
|
return;
|
|
2147
2146
|
}
|
|
@@ -2149,22 +2148,22 @@ const ar = () => {
|
|
|
2149
2148
|
r((g) => O(S({}, g), { name: "validation.should_be_english_letters_only" }));
|
|
2150
2149
|
return;
|
|
2151
2150
|
}
|
|
2152
|
-
if (!
|
|
2151
|
+
if (!_) {
|
|
2153
2152
|
r((g) => O(S({}, g), { name: "validation.first_and_last_name_required" }));
|
|
2154
2153
|
return;
|
|
2155
2154
|
}
|
|
2156
2155
|
i(!1), r((g) => O(S({}, g), { name: "" }));
|
|
2157
2156
|
}, u = (d) => {
|
|
2158
|
-
const c = d.target, { value:
|
|
2159
|
-
t(
|
|
2160
|
-
}, l =
|
|
2157
|
+
const c = d.target, { value: h } = c;
|
|
2158
|
+
t(h);
|
|
2159
|
+
}, l = ce(s, 1e3);
|
|
2161
2160
|
return /* @__PURE__ */ f("div", { class: "space-y-2", role: "complementary", "aria-label": o("form.name_on_card"), children: [
|
|
2162
2161
|
/* @__PURE__ */ f("div", { class: "flex items-end justify-between text-xs font-medium", children: [
|
|
2163
2162
|
/* @__PURE__ */ f("label", { for: "mysr-cc-name", children: o("form.name_on_card") }),
|
|
2164
2163
|
a && /* @__PURE__ */ f("span", { class: "uppercase text-error", children: o("form.required") })
|
|
2165
2164
|
] }),
|
|
2166
2165
|
/* @__PURE__ */ f(
|
|
2167
|
-
|
|
2166
|
+
le,
|
|
2168
2167
|
{
|
|
2169
2168
|
name: "mysr-cc-name",
|
|
2170
2169
|
placeholder: o("form.name_on_card"),
|
|
@@ -2188,14 +2187,14 @@ const ar = () => {
|
|
|
2188
2187
|
msg: n ? "" : "error.invalid_csc"
|
|
2189
2188
|
};
|
|
2190
2189
|
}, Ue = it({}), gr = ({ setValue: e }) => {
|
|
2191
|
-
const { t } =
|
|
2190
|
+
const { t } = H(), { handleBlur: n, err: r } = F(Ue), o = "** / **", a = (s) => {
|
|
2192
2191
|
const u = s.target, { value: l } = u;
|
|
2193
2192
|
e(l);
|
|
2194
|
-
}, i =
|
|
2195
|
-
return
|
|
2193
|
+
}, i = ce(n, 1e3);
|
|
2194
|
+
return j(() => {
|
|
2196
2195
|
new Fe('[name="mysr-cc-exp"]');
|
|
2197
2196
|
}, []), /* @__PURE__ */ f(
|
|
2198
|
-
|
|
2197
|
+
le,
|
|
2199
2198
|
{
|
|
2200
2199
|
"aria-label": t("form.date"),
|
|
2201
2200
|
name: "mysr-cc-exp",
|
|
@@ -2214,12 +2213,12 @@ const ar = () => {
|
|
|
2214
2213
|
}
|
|
2215
2214
|
);
|
|
2216
2215
|
}, br = ({ value: e, setValue: t }) => {
|
|
2217
|
-
const { t: n } =
|
|
2216
|
+
const { t: n } = H(), { handleBlur: r, err: o, config: a } = F(Ue), i = (u) => {
|
|
2218
2217
|
const l = u.target, { value: d } = l;
|
|
2219
2218
|
t(d);
|
|
2220
|
-
}, s =
|
|
2219
|
+
}, s = ce(r, 1e3);
|
|
2221
2220
|
return /* @__PURE__ */ f(
|
|
2222
|
-
|
|
2221
|
+
le,
|
|
2223
2222
|
{
|
|
2224
2223
|
"aria-label": n("form.csc"),
|
|
2225
2224
|
name: "mysr-cc-csc",
|
|
@@ -2252,16 +2251,16 @@ const ar = () => {
|
|
|
2252
2251
|
getCardSchema: t
|
|
2253
2252
|
};
|
|
2254
2253
|
}, xr = ({ value: e, setValue: t }) => {
|
|
2255
|
-
const { t: n } =
|
|
2254
|
+
const { t: n } = H(), { handleBlur: r, err: o, setType: a } = F(Ue), { getCardSchema: i } = lt(), s = (l) => {
|
|
2256
2255
|
const d = l.target, { value: c } = d;
|
|
2257
2256
|
t(c), a(i(c));
|
|
2258
|
-
}, u =
|
|
2259
|
-
return
|
|
2257
|
+
}, u = ce(r, 1e3);
|
|
2258
|
+
return j(() => {
|
|
2260
2259
|
new Fe('[name="mysr-cc-number"]', {
|
|
2261
2260
|
mask: (l) => un(l) ? "#### ###### #####" : "#### #### #### ####"
|
|
2262
2261
|
});
|
|
2263
2262
|
}, []), /* @__PURE__ */ f(
|
|
2264
|
-
|
|
2263
|
+
le,
|
|
2265
2264
|
{
|
|
2266
2265
|
"aria-label": n("form.cc"),
|
|
2267
2266
|
name: "mysr-cc-number",
|
|
@@ -2357,31 +2356,31 @@ const ar = () => {
|
|
|
2357
2356
|
isValidCc: t
|
|
2358
2357
|
};
|
|
2359
2358
|
}, Tr = ({ cc: e, setCc: t, cvc: n, setCvc: r, exp: o, setExp: a, err: i, setErr: s }) => {
|
|
2360
|
-
const { t: u } =
|
|
2361
|
-
const { value:
|
|
2362
|
-
if (!
|
|
2363
|
-
d(!
|
|
2359
|
+
const { t: u } = H(), [l, d] = I(!1), [c, h] = I(""), { isValidCc: p } = mn(), _ = Xt(() => pn(c), [c]), g = (m) => {
|
|
2360
|
+
const { value: y, name: v } = m.target, b = B(y.trim());
|
|
2361
|
+
if (!b) {
|
|
2362
|
+
d(!b);
|
|
2364
2363
|
return;
|
|
2365
2364
|
}
|
|
2366
2365
|
if (v === "mysr-cc-csc") {
|
|
2367
|
-
const { msg: w } = cn(
|
|
2368
|
-
s((
|
|
2366
|
+
const { msg: w } = cn(b, c);
|
|
2367
|
+
s((k) => O(S({}, k), {
|
|
2369
2368
|
csc: w
|
|
2370
2369
|
}));
|
|
2371
2370
|
}
|
|
2372
2371
|
if (v === "mysr-cc-exp") {
|
|
2373
|
-
const { isValidExpFormat: w, isValidYear:
|
|
2374
|
-
s((
|
|
2372
|
+
const { isValidExpFormat: w, isValidYear: k, inValidMonth: x } = fn(b);
|
|
2373
|
+
s((D) => O(S({}, D), {
|
|
2375
2374
|
exp_month: x ? "" : "error.invalid_month",
|
|
2376
|
-
exp_year:
|
|
2375
|
+
exp_year: k ? "" : "error.invalid_year",
|
|
2377
2376
|
exp: w ? "" : "error.invalid_date"
|
|
2378
2377
|
}));
|
|
2379
2378
|
}
|
|
2380
2379
|
v === "mysr-cc-number" && s((w) => O(S({}, w), {
|
|
2381
|
-
cc: c === "" ? "error.unsupported_cc_type" : p(
|
|
2380
|
+
cc: c === "" ? "error.unsupported_cc_type" : p(b) ? "" : "error.invalid_cc_number"
|
|
2382
2381
|
}));
|
|
2383
2382
|
};
|
|
2384
|
-
return
|
|
2383
|
+
return j(() => {
|
|
2385
2384
|
Object.values(i).filter((m) => m).length === 0 && d(!1);
|
|
2386
2385
|
}, [i]), /* @__PURE__ */ f(
|
|
2387
2386
|
Ue.Provider,
|
|
@@ -2391,8 +2390,8 @@ const ar = () => {
|
|
|
2391
2390
|
setErr: s,
|
|
2392
2391
|
handleBlur: g,
|
|
2393
2392
|
type: c,
|
|
2394
|
-
setType:
|
|
2395
|
-
config:
|
|
2393
|
+
setType: h,
|
|
2394
|
+
config: _()
|
|
2396
2395
|
},
|
|
2397
2396
|
children: /* @__PURE__ */ f("div", { class: "space-y-2", role: "complementary", "aria-label": u("form.card_info"), children: [
|
|
2398
2397
|
/* @__PURE__ */ f("div", { class: "flex items-end justify-between text-xs font-medium", children: [
|
|
@@ -2405,19 +2404,19 @@ const ar = () => {
|
|
|
2405
2404
|
/* @__PURE__ */ f(gr, { value: o, setValue: a }),
|
|
2406
2405
|
/* @__PURE__ */ f(br, { value: n, setValue: r })
|
|
2407
2406
|
] }),
|
|
2408
|
-
/* @__PURE__ */ f("p", { class: "flex flex-col gap-2 text-xs font-medium text-error", children: Object.entries(i).filter(([m]) => m !== "name").map(([m,
|
|
2407
|
+
/* @__PURE__ */ f("p", { class: "flex flex-col gap-2 text-xs font-medium text-error", children: Object.entries(i).filter(([m]) => m !== "name").map(([m, y]) => /* @__PURE__ */ f("span", { class: "empty:hidden", children: u(y) }, m)) })
|
|
2409
2408
|
] })
|
|
2410
2409
|
}
|
|
2411
2410
|
);
|
|
2412
2411
|
}, Mr = () => {
|
|
2413
|
-
const { t: e } =
|
|
2412
|
+
const { t: e } = H(), {
|
|
2414
2413
|
formattedAmount: t,
|
|
2415
2414
|
isRtl: n,
|
|
2416
2415
|
credit_card: r,
|
|
2417
2416
|
statement_descriptor: o,
|
|
2418
2417
|
callback_url: a,
|
|
2419
2418
|
payment_button_type: i
|
|
2420
|
-
} = F(z), [s, u] = I(""), [l, d] = I(""), [c,
|
|
2419
|
+
} = F(z), [s, u] = I(""), [l, d] = I(""), [c, h] = I(""), [p, _] = I(""), { getCardSchema: g } = lt(), { isValidCc: m } = mn(), y = {
|
|
2421
2420
|
name: "",
|
|
2422
2421
|
csc: "",
|
|
2423
2422
|
cc: "",
|
|
@@ -2426,64 +2425,64 @@ const ar = () => {
|
|
|
2426
2425
|
exp_year: ""
|
|
2427
2426
|
}, {
|
|
2428
2427
|
makePayment: v,
|
|
2429
|
-
busy:
|
|
2428
|
+
busy: b,
|
|
2430
2429
|
fail: w,
|
|
2431
|
-
success:
|
|
2430
|
+
success: k,
|
|
2432
2431
|
loading: x,
|
|
2433
|
-
error:
|
|
2434
|
-
setError:
|
|
2435
|
-
} =
|
|
2436
|
-
return /* @__PURE__ */ f("form", { class: "space-y-6", onSubmit: (
|
|
2437
|
-
|
|
2438
|
-
const { isValid:
|
|
2439
|
-
if (!
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2432
|
+
error: D,
|
|
2433
|
+
setError: T
|
|
2434
|
+
} = me({ defaultError: y });
|
|
2435
|
+
return /* @__PURE__ */ f("form", { class: "space-y-6", onSubmit: (C) => {
|
|
2436
|
+
C.preventDefault();
|
|
2437
|
+
const { isValid: U } = ln(s), Y = B(l), _e = B(p), ye = B(c), ue = g(Y), ie = m(Y, ue), { isValid: de } = cn(ye, ue), { isValid: ve } = fn(_e);
|
|
2438
|
+
if (!U || !ie || !de || !ve) {
|
|
2439
|
+
const Z = S({}, y);
|
|
2440
|
+
U || (Z.name = e("error.invalid_name")), ie || (Z.cc = e("error.invalid_cc_number")), de || (Z.csc = e("error.invalid_csc")), ve || (Z.exp = e("error.invalid_date")), T(Z);
|
|
2442
2441
|
return;
|
|
2443
2442
|
}
|
|
2444
|
-
const [Ve,
|
|
2443
|
+
const [Ve, L] = _e.split("/"), M = {
|
|
2445
2444
|
type: "creditcard",
|
|
2446
2445
|
name: s,
|
|
2447
|
-
number:
|
|
2446
|
+
number: Y,
|
|
2448
2447
|
month: Ve,
|
|
2449
|
-
year:
|
|
2450
|
-
cvc:
|
|
2448
|
+
year: L,
|
|
2449
|
+
cvc: ye
|
|
2451
2450
|
};
|
|
2452
|
-
r != null && r.manual && (
|
|
2453
|
-
function Z
|
|
2454
|
-
const { transaction_url: yn } =
|
|
2451
|
+
r != null && r.manual && (M.manual = !0), r != null && r.save_card && (M.save_card = !0), o && (M.statement_descriptor = o);
|
|
2452
|
+
function K(Z) {
|
|
2453
|
+
const { transaction_url: yn } = Z.source;
|
|
2455
2454
|
window.location.href = yn;
|
|
2456
2455
|
}
|
|
2457
|
-
function
|
|
2458
|
-
console.error(
|
|
2456
|
+
function Q(Z) {
|
|
2457
|
+
console.error(Z);
|
|
2459
2458
|
}
|
|
2460
2459
|
v({
|
|
2461
2460
|
data: {
|
|
2462
2461
|
callback_url: a,
|
|
2463
|
-
source:
|
|
2462
|
+
source: M
|
|
2464
2463
|
},
|
|
2465
2464
|
initPayment: !0,
|
|
2466
|
-
onFailed:
|
|
2467
|
-
onSuccess:
|
|
2468
|
-
}).catch((
|
|
2469
|
-
console.error(
|
|
2465
|
+
onFailed: Q,
|
|
2466
|
+
onSuccess: K
|
|
2467
|
+
}).catch((Z) => {
|
|
2468
|
+
console.error(Z);
|
|
2470
2469
|
});
|
|
2471
2470
|
}, children: [
|
|
2472
|
-
/* @__PURE__ */ f(vr, { value: s, setValue: u, err:
|
|
2471
|
+
/* @__PURE__ */ f(vr, { value: s, setValue: u, err: D, setErr: T }),
|
|
2473
2472
|
/* @__PURE__ */ f(
|
|
2474
2473
|
Tr,
|
|
2475
2474
|
{
|
|
2476
2475
|
cc: l,
|
|
2477
2476
|
setCc: d,
|
|
2478
2477
|
cvc: c,
|
|
2479
|
-
setCvc:
|
|
2478
|
+
setCvc: h,
|
|
2480
2479
|
exp: p,
|
|
2481
|
-
setExp:
|
|
2482
|
-
err:
|
|
2483
|
-
setErr:
|
|
2480
|
+
setExp: _,
|
|
2481
|
+
err: D,
|
|
2482
|
+
setErr: T
|
|
2484
2483
|
}
|
|
2485
2484
|
),
|
|
2486
|
-
/* @__PURE__ */ f(We, { type: "submit", disabled: x, success:
|
|
2485
|
+
/* @__PURE__ */ f(We, { type: "submit", disabled: x, success: k, fail: w, busy: b, children: [
|
|
2487
2486
|
(i !== "plain" || !n) && e(`button.${i}`),
|
|
2488
2487
|
" ",
|
|
2489
2488
|
t
|
|
@@ -2570,7 +2569,7 @@ function Le(e, t, n, r) {
|
|
|
2570
2569
|
l((r = r.apply(e, t || [])).next());
|
|
2571
2570
|
});
|
|
2572
2571
|
}
|
|
2573
|
-
function
|
|
2572
|
+
function he(e, t) {
|
|
2574
2573
|
var n = { label: 0, sent: function() {
|
|
2575
2574
|
if (a[0] & 1) throw a[1];
|
|
2576
2575
|
return a[1];
|
|
@@ -2792,7 +2791,7 @@ var Lr = function() {
|
|
|
2792
2791
|
return e.prototype.send = function(t) {
|
|
2793
2792
|
return Le(this, void 0, void 0, function() {
|
|
2794
2793
|
var n, r, o;
|
|
2795
|
-
return
|
|
2794
|
+
return he(this, function(a) {
|
|
2796
2795
|
switch (a.label) {
|
|
2797
2796
|
case 0:
|
|
2798
2797
|
return [4, fetch(this.url, {
|
|
@@ -2835,7 +2834,7 @@ var Lr = function() {
|
|
|
2835
2834
|
}
|
|
2836
2835
|
return e.prototype.push = function(t) {
|
|
2837
2836
|
return Le(this, void 0, void 0, function() {
|
|
2838
|
-
return
|
|
2837
|
+
return he(this, function(n) {
|
|
2839
2838
|
switch (n.label) {
|
|
2840
2839
|
case 0:
|
|
2841
2840
|
return [4, this._transport.send(t.toJSON())];
|
|
@@ -2902,7 +2901,7 @@ var Lr = function() {
|
|
|
2902
2901
|
var n;
|
|
2903
2902
|
return Array.isArray(t) ? (n = this._data).push.apply(n, Oe([], Me(t), !1)) : this._data.push(t);
|
|
2904
2903
|
}, e.prototype.drain = function() {
|
|
2905
|
-
return
|
|
2904
|
+
return he(this, function(t) {
|
|
2906
2905
|
switch (t.label) {
|
|
2907
2906
|
case 0:
|
|
2908
2907
|
return this._data.length > 0 ? [4, this._data.shift()] : [3, 2];
|
|
@@ -2922,8 +2921,8 @@ var Lr = function() {
|
|
|
2922
2921
|
t === void 0 && (t = this._duration);
|
|
2923
2922
|
var r = Ce(), o = 1.3, a = function() {
|
|
2924
2923
|
return Le(n, void 0, void 0, function() {
|
|
2925
|
-
var i, s, u, l, d, c,
|
|
2926
|
-
return
|
|
2924
|
+
var i, s, u, l, d, c, h;
|
|
2925
|
+
return he(this, function(p) {
|
|
2927
2926
|
switch (p.label) {
|
|
2928
2927
|
case 0:
|
|
2929
2928
|
p.trys.push([0, 7, 8, 9]), i = Rr(this._queue.drain()), s = i.next(), p.label = 1;
|
|
@@ -2946,7 +2945,7 @@ var Lr = function() {
|
|
|
2946
2945
|
return d = p.sent(), c = { error: d }, [3, 9];
|
|
2947
2946
|
case 8:
|
|
2948
2947
|
try {
|
|
2949
|
-
s && !s.done && (
|
|
2948
|
+
s && !s.done && (h = i.return) && h.call(i);
|
|
2950
2949
|
} finally {
|
|
2951
2950
|
if (c) throw c.error;
|
|
2952
2951
|
}
|
|
@@ -3035,7 +3034,7 @@ var Lr = function() {
|
|
|
3035
3034
|
}, e.prototype.wrap = function(t, n, r) {
|
|
3036
3035
|
return Le(this, void 0, void 0, function() {
|
|
3037
3036
|
var o;
|
|
3038
|
-
return
|
|
3037
|
+
return he(this, function(a) {
|
|
3039
3038
|
switch (a.label) {
|
|
3040
3039
|
case 0:
|
|
3041
3040
|
return a.trys.push([0, 2, , 5]), [4, t()];
|
|
@@ -3081,7 +3080,7 @@ var Lr = function() {
|
|
|
3081
3080
|
}, e;
|
|
3082
3081
|
}();
|
|
3083
3082
|
const Yr = new qr({
|
|
3084
|
-
key:
|
|
3083
|
+
key: void 0,
|
|
3085
3084
|
revision: Jt
|
|
3086
3085
|
});
|
|
3087
3086
|
var Jr = /* @__PURE__ */ function() {
|
|
@@ -3137,7 +3136,7 @@ function Qr({ config: e }) {
|
|
|
3137
3136
|
minimumFractionDigits: s
|
|
3138
3137
|
}).format(u), [d, c] = I(O(S({
|
|
3139
3138
|
version: Jt,
|
|
3140
|
-
base_url:
|
|
3139
|
+
base_url: void 0
|
|
3141
3140
|
}, e), {
|
|
3142
3141
|
translations: Rn(o),
|
|
3143
3142
|
formattedAmount: l,
|
|
@@ -3147,15 +3146,15 @@ function Qr({ config: e }) {
|
|
|
3147
3146
|
showForm: !1,
|
|
3148
3147
|
isTestMode: (a == null ? void 0 : a.startsWith("pk_test")) || location.protocol === "http:"
|
|
3149
3148
|
}));
|
|
3150
|
-
return
|
|
3151
|
-
var
|
|
3149
|
+
return j(() => {
|
|
3150
|
+
var h, p;
|
|
3152
3151
|
if (!window.SamsungPay && e.samsung_pay) {
|
|
3153
|
-
const
|
|
3154
|
-
|
|
3152
|
+
const _ = document.createElement("script");
|
|
3153
|
+
_.src = "https://img.mpay.samsung.com/gsmpi/sdk/samsungpay_web_sdk.js", document.body.append(_);
|
|
3155
3154
|
}
|
|
3156
|
-
if (!((p = (
|
|
3157
|
-
const
|
|
3158
|
-
|
|
3155
|
+
if (!((p = (h = window.google) == null ? void 0 : h.payments) != null && p.api) && e.google_pay) {
|
|
3156
|
+
const _ = document.createElement("script");
|
|
3157
|
+
_.src = "https://pay.google.com/gp/p/js/pay.js", document.body.append(_);
|
|
3159
3158
|
}
|
|
3160
3159
|
}, []), /* @__PURE__ */ f(
|
|
3161
3160
|
z.Provider,
|
|
@@ -3172,7 +3171,7 @@ function Qr({ config: e }) {
|
|
|
3172
3171
|
children: /* @__PURE__ */ f(
|
|
3173
3172
|
"div",
|
|
3174
3173
|
{
|
|
3175
|
-
class:
|
|
3174
|
+
class: te([
|
|
3176
3175
|
"box-border flex w-full min-w-60 flex-col gap-4 text-base leading-4 text-black/90",
|
|
3177
3176
|
e.fixed_width && "md:mx-auto md:max-w-80"
|
|
3178
3177
|
]),
|
|
@@ -3207,39 +3206,39 @@ const $r = (e) => {
|
|
|
3207
3206
|
), !0;
|
|
3208
3207
|
}, eo = (e) => {
|
|
3209
3208
|
var t, n;
|
|
3210
|
-
return e.payment_button_type && typeof e.payment_button_type != "string" &&
|
|
3209
|
+
return e.payment_button_type && typeof e.payment_button_type != "string" && re("Payment button type"), e.payment_button_type && !_r.includes(e.payment_button_type) && P("Unsupported button type, check documentation for list of supported types"), e.language && typeof e.language != "string" && re("Language"), e.translations && typeof e.translations != "object" && re("Translations"), e.metadata && typeof e.metadata != "object" && P("Metadata must be and object"), e.metadata && Object.entries(e.metadata).length > 50 && P("Only 50 Key/Value pairs are allowed in metadata"), e.invoice_id && typeof e.invoice_id != "string" && P("Invoice ID must be a string"), e.invoice_id && (/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/.test(
|
|
3211
3210
|
(t = e.invoice_id) != null ? t : ""
|
|
3212
3211
|
) || P("Invalid invoice ID format")), e.statement_descriptor && typeof e.statement_descriptor != "string" && P("Statement descriptor must be a string"), e.statement_descriptor && (/^[\w\s\d\-~]{1,64}$/.test((n = e.statement_descriptor) != null ? n : "") || P(
|
|
3213
3212
|
'Invalid format for the statement descriptor [length between 1 and 64 characters, allowed alphanumeric characters, white-spaces, "/", "-" and "~" symbols] '
|
|
3214
3213
|
)), e.fixed_width && typeof e.fixed_width != "boolean" && P("Fixed width expects boolean value"), !0;
|
|
3215
3214
|
}, ze = (e, t) => e.every((n) => t.includes(n)), to = (e) => {
|
|
3216
|
-
var t, n, r, o, a, i, s, u, l, d, c,
|
|
3215
|
+
var t, n, r, o, a, i, s, u, l, d, c, h;
|
|
3217
3216
|
if (e.methods && !Array.isArray(e.methods) && P("Methods must be an array"), e.methods.includes("creditcard") && ((t = e.credit_card) != null && t.manual && typeof e.credit_card.manual != "boolean" && P("Credit Card manual option must be a boolean"), (n = e.credit_card) != null && n.save_card && typeof e.credit_card.save_card != "boolean" && P("Credit Card save card option must be a boolean")), e.methods.includes("applepay") && (e.apple_pay || G("Apple Pay configuration"), e.apple_pay)) {
|
|
3218
|
-
const p = e.apple_pay.country || ((r = e.payment_options) == null ? void 0 : r.country),
|
|
3219
|
-
p || G("Apple Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"),
|
|
3217
|
+
const p = e.apple_pay.country || ((r = e.payment_options) == null ? void 0 : r.country), _ = e.apple_pay.label || ((o = e.payment_options) == null ? void 0 : o.label);
|
|
3218
|
+
p || G("Apple Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"), _ || G("Apple Pay label or Payment Options label"), (_ == null ? void 0 : _.trim().length) === 0 && P("Apple Pay label or Payment Options label can't be empty"), e.apple_pay.validate_merchant_url && !_n(e.apple_pay.validate_merchant_url) && re("Apple Pay Validate Merchant URL"), (a = e.apple_pay) != null && a.merchant_capabilities && (ze(e.apple_pay.merchant_capabilities, $e) || P(`Apple Pay merchant capabilities supports only ${$e.join(", ")}`)), (i = e.apple_pay) != null && i.supported_countries && !Array.isArray(e.apple_pay.supported_countries) && P("Apple Pay Supported Countries must be an array of country codes");
|
|
3220
3219
|
}
|
|
3221
3220
|
if (e.samsung_pay) {
|
|
3222
|
-
const p = e.samsung_pay.country || ((s = e.payment_options) == null ? void 0 : s.country),
|
|
3221
|
+
const p = e.samsung_pay.country || ((s = e.payment_options) == null ? void 0 : s.country), _ = e.samsung_pay.label || ((u = e.payment_options) == null ? void 0 : u.label), g = e.samsung_pay.order_number, m = e.publishable_api_key.startsWith("pk_test") || location.protocol === "http:";
|
|
3223
3222
|
!window.SamsungPay && m && console.warn(
|
|
3224
3223
|
"To speed up loading of Samsung Pay button you can include the Samsung Pay Web SDK JavaScript file in your website front-end directly. If there will be no Samsung Pay available on form initialization it will be loaded automatically"
|
|
3225
|
-
), e.samsung_pay.service_id || G("Samsung Pay service_id"), e.samsung_pay.service_id.trim().length === 0 && P("Samsung Pay service_id can't be empty"), g || G("Samsung Pay order_number or Payment Options order_number"), (g == null ? void 0 : g.trim().length) === 0 && P("Order number can't be empty"), p || G("Samsung Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"),
|
|
3224
|
+
), e.samsung_pay.service_id || G("Samsung Pay service_id"), e.samsung_pay.service_id.trim().length === 0 && P("Samsung Pay service_id can't be empty"), g || G("Samsung Pay order_number or Payment Options order_number"), (g == null ? void 0 : g.trim().length) === 0 && P("Order number can't be empty"), p || G("Samsung Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"), _ || G("Samsung Pay label or Payment Options label"), (_ == null ? void 0 : _.trim().length) === 0 && P("Samsung Pay label or Payment Options label can't be empty");
|
|
3226
3225
|
}
|
|
3227
3226
|
if (e.google_pay) {
|
|
3228
|
-
const p = e.google_pay.country || ((l = e.payment_options) == null ? void 0 : l.country),
|
|
3229
|
-
!((
|
|
3227
|
+
const p = e.google_pay.country || ((l = e.payment_options) == null ? void 0 : l.country), _ = e.google_pay.label || ((d = e.payment_options) == null ? void 0 : d.label), g = e.publishable_api_key.startsWith("pk_test") || location.protocol === "http:", m = e.google_pay.environment;
|
|
3228
|
+
!((h = (c = window.google) == null ? void 0 : c.payments) != null && h.api) && g && console.warn(
|
|
3230
3229
|
"To speed up loading of Google Pay button you can include the Google Pay Web SDK JavaScript file in your website front-end directly. If there will be no Google Pay available on form initialization it will be loaded automatically"
|
|
3231
|
-
), e.google_pay.merchant_id || G("Google Pay service_id"), e.google_pay.merchant_id.trim().length === 0 && P("Google Pay service_id can't be empty"), p || G("Google Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"),
|
|
3232
|
-
const { auth_methods:
|
|
3233
|
-
|
|
3230
|
+
), e.google_pay.merchant_id || G("Google Pay service_id"), e.google_pay.merchant_id.trim().length === 0 && P("Google Pay service_id can't be empty"), p || G("Google Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"), _ || G("Google Pay label or Payment Options label"), (_ == null ? void 0 : _.trim().length) === 0 && P("Google Pay label or Payment Options label can't be empty"), m && !["PRODUCTION", "TEST"].includes(m) && P("Google Pay environment can be set to `TEST` or `PRODUCTION`");
|
|
3231
|
+
const { auth_methods: y } = e.google_pay;
|
|
3232
|
+
y && !Array.isArray(y) && P("Google Pay auth_methods must be an array"), y && !y.every((v) => v === "PAN_ONLY" || v === "CRYPTOGRAM_3DS") && P("Google Pay auth_methods must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'");
|
|
3234
3233
|
}
|
|
3235
3234
|
return e.methods && (ze(e.methods, Qe) || P(`Moyasar form supports only ${Qe.join(", ")} methods`)), e.supported_networks && (ze(e.supported_networks, Xe) || P(`Moyasar form supports only ${Xe.join(", ")} networks`)), !0;
|
|
3236
|
-
}, no = (e) => (e.element || G("element"), typeof e.element != "string" && !(e.element instanceof Element) &&
|
|
3235
|
+
}, no = (e) => (e.element || G("element"), typeof e.element != "string" && !(e.element instanceof Element) && re("Element"), typeof e.element == "string" && !document.querySelector(e.element) && P(`Selector ${e.element} does't exist id DOM`), e.publishable_api_key.trim() || G("publishable_api_key"), e.publishable_api_key && (/^pk_(test|live)_.{40}$/.test(e.publishable_api_key) || re("Publishable API Key"), location.protocol.toLowerCase() === "http:" && e.publishable_api_key.startsWith("pk_live") && P(
|
|
3237
3236
|
"Production key (pk_live) require secure connection, for development use key starting with pk_test"
|
|
3238
3237
|
)), e.amount || G("amount"), e.amount && ((typeof e.amount != "number" || e.amount < 100) && P("Amount must be a non-negative integer. Minimal supported value is 100."), Number.isInteger(e.amount) || P(
|
|
3239
3238
|
"Amount must be in minor unit of selected currency, e.g. for $19.99 set amount to 1999."
|
|
3240
|
-
)), e.currency || G("currency"), e.currency && e.currency.trim().length !== 3 && P("Currency must be in ISO 3166-1 alpha-3 country code format"), e.description || G("description"), e.description && e.description.trim().length === 0 && P("Description can't be empty"), e.callback_url || G("callback_url"), _n(e.callback_url) ||
|
|
3239
|
+
)), e.currency || G("currency"), e.currency && e.currency.trim().length !== 3 && P("Currency must be in ISO 3166-1 alpha-3 country code format"), e.description || G("description"), e.description && e.description.trim().length === 0 && P("Description can't be empty"), e.callback_url || G("callback_url"), _n(e.callback_url) || re("Callback URL"), !0), P = (e) => {
|
|
3241
3240
|
throw window.silentError && console.error(e), new Error(e);
|
|
3242
|
-
}, G = (e) => P(`Missing entry: ${e} is required`),
|
|
3241
|
+
}, G = (e) => P(`Missing entry: ${e} is required`), re = (e) => P(`${e} is invalid`), _n = (e) => typeof e == "string" && /^https?:\/\/.+/.test(e), ro = (e, t = !1) => (t && (window.silentError = t), no(e), to(e), eo(e), $r(e), !0), oo = (e) => {
|
|
3243
3242
|
const t = e.publishable_api_key.startsWith("pk_test") || location.protocol === "http:", n = e.element;
|
|
3244
3243
|
let r;
|
|
3245
3244
|
if (typeof n == "string" && (r = document.querySelector(n)), n instanceof Element && (r = n), !r) {
|