@moneyto/components 0.0.15 → 0.0.16
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/Styles-Zk7nSJeB.js +2736 -0
- package/dist/calculator.js +1673 -1521
- package/dist/country-list.js +56 -65
- package/dist/flags-B8q5zheo.js +1136 -0
- package/dist/{google-play-C27Sopj3.js → google-play-CvltNTKq.js} +158 -197
- package/dist/mobile-apps.js +29 -32
- package/package.json +1 -1
- package/dist/Styles-BlozloOq.js +0 -2287
- package/dist/api-IpW7K_i5.js +0 -1060
|
@@ -0,0 +1,1136 @@
|
|
|
1
|
+
var Ot = Object.defineProperty;
|
|
2
|
+
var Gt = (t, e, s) => e in t ? Ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var st = (t, e, s) => Gt(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import { z as Bt, l as nt, T as Pt, U as wt, L as Ut, V as At, W as Ft, X as ot, Y as gt, A as z, Z as Dt, _ as rt, D as k, $ as Et, a0 as Ht, a1 as H, a2 as x, C as Tt, a3 as K, a4 as Kt, a5 as jt, a6 as Wt, a7 as xt, a8 as Yt, a9 as Zt, O as Vt, aa as Mt, ab as Jt, ac as Y, ad as zt, G as qt, ae as Xt, af as Qt, ag as at, ah as Z, F as P, ai as $t, aj as te } from "./Styles-Zk7nSJeB.js";
|
|
5
|
+
let V = null;
|
|
6
|
+
function pa(t, e) {
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
function ee(t, e, s) {
|
|
10
|
+
for (var n = t.items, o = [], r = e.length, i = 0; i < r; i++)
|
|
11
|
+
Wt(e[i].e, o, !0);
|
|
12
|
+
var u = r > 0 && o.length === 0 && s !== null;
|
|
13
|
+
if (u) {
|
|
14
|
+
var m = (
|
|
15
|
+
/** @type {Element} */
|
|
16
|
+
/** @type {Element} */
|
|
17
|
+
s.parentNode
|
|
18
|
+
);
|
|
19
|
+
xt(m), m.append(
|
|
20
|
+
/** @type {Element} */
|
|
21
|
+
s
|
|
22
|
+
), n.clear(), S(t, e[0].prev, e[r - 1].next);
|
|
23
|
+
}
|
|
24
|
+
Yt(o, () => {
|
|
25
|
+
for (var f = 0; f < r; f++) {
|
|
26
|
+
var g = e[f];
|
|
27
|
+
u || (n.delete(g.k), S(t, g.prev, g.next)), Tt(g.e, !u);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function da(t, e, s, n, o, r = null) {
|
|
32
|
+
var i = t, u = { flags: e, items: /* @__PURE__ */ new Map(), first: null }, m = (e & Mt) !== 0;
|
|
33
|
+
if (m) {
|
|
34
|
+
var f = (
|
|
35
|
+
/** @type {Element} */
|
|
36
|
+
t
|
|
37
|
+
);
|
|
38
|
+
i = k ? Y(
|
|
39
|
+
/** @type {Comment | Text} */
|
|
40
|
+
zt(f)
|
|
41
|
+
) : f.appendChild(gt());
|
|
42
|
+
}
|
|
43
|
+
k && qt();
|
|
44
|
+
var g = null, M = !1, y = /* @__PURE__ */ new Map(), C = Pt(() => {
|
|
45
|
+
var v = s();
|
|
46
|
+
return Ft(v) ? v : v == null ? [] : At(v);
|
|
47
|
+
}), p, E;
|
|
48
|
+
function a() {
|
|
49
|
+
se(
|
|
50
|
+
E,
|
|
51
|
+
p,
|
|
52
|
+
u,
|
|
53
|
+
y,
|
|
54
|
+
i,
|
|
55
|
+
o,
|
|
56
|
+
e,
|
|
57
|
+
n,
|
|
58
|
+
s
|
|
59
|
+
), r !== null && (p.length === 0 ? g ? Et(g) : g = z(() => r(i)) : g !== null && Ht(g, () => {
|
|
60
|
+
g = null;
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
Bt(() => {
|
|
64
|
+
E ?? (E = /** @type {Effect} */
|
|
65
|
+
Zt), p = /** @type {V[]} */
|
|
66
|
+
nt(C);
|
|
67
|
+
var v = p.length;
|
|
68
|
+
if (M && v === 0)
|
|
69
|
+
return;
|
|
70
|
+
M = v === 0;
|
|
71
|
+
let _ = !1;
|
|
72
|
+
if (k) {
|
|
73
|
+
var c = Xt(i) === Qt;
|
|
74
|
+
c !== (v === 0) && (i = at(), Y(i), Z(!1), _ = !0);
|
|
75
|
+
}
|
|
76
|
+
if (k) {
|
|
77
|
+
for (var d = null, h, l = 0; l < v; l++) {
|
|
78
|
+
if (P.nodeType === $t && /** @type {Comment} */
|
|
79
|
+
P.data === te) {
|
|
80
|
+
i = /** @type {Comment} */
|
|
81
|
+
P, _ = !0, Z(!1);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
var A = p[l], T = n(A, l);
|
|
85
|
+
h = q(
|
|
86
|
+
P,
|
|
87
|
+
u,
|
|
88
|
+
d,
|
|
89
|
+
null,
|
|
90
|
+
A,
|
|
91
|
+
T,
|
|
92
|
+
l,
|
|
93
|
+
o,
|
|
94
|
+
e,
|
|
95
|
+
s
|
|
96
|
+
), u.items.set(T, h), d = h;
|
|
97
|
+
}
|
|
98
|
+
v > 0 && Y(at());
|
|
99
|
+
}
|
|
100
|
+
if (k)
|
|
101
|
+
v === 0 && r && (g = z(() => r(i)));
|
|
102
|
+
else if (wt()) {
|
|
103
|
+
var G = /* @__PURE__ */ new Set(), U = (
|
|
104
|
+
/** @type {Batch} */
|
|
105
|
+
Ut
|
|
106
|
+
);
|
|
107
|
+
for (l = 0; l < v; l += 1) {
|
|
108
|
+
A = p[l], T = n(A, l);
|
|
109
|
+
var N = u.items.get(T) ?? y.get(T);
|
|
110
|
+
N ? (e & (K | H)) !== 0 && yt(N, A, l, e) : (h = q(
|
|
111
|
+
null,
|
|
112
|
+
u,
|
|
113
|
+
null,
|
|
114
|
+
null,
|
|
115
|
+
A,
|
|
116
|
+
T,
|
|
117
|
+
l,
|
|
118
|
+
o,
|
|
119
|
+
e,
|
|
120
|
+
s,
|
|
121
|
+
!0
|
|
122
|
+
), y.set(T, h)), G.add(T);
|
|
123
|
+
}
|
|
124
|
+
for (const [R, F] of u.items)
|
|
125
|
+
G.has(R) || U.skipped_effects.add(F.e);
|
|
126
|
+
U.add_callback(a);
|
|
127
|
+
} else
|
|
128
|
+
a();
|
|
129
|
+
_ && Z(!0), nt(C);
|
|
130
|
+
}), k && (i = P);
|
|
131
|
+
}
|
|
132
|
+
function se(t, e, s, n, o, r, i, u, m) {
|
|
133
|
+
var X, Q, $, tt;
|
|
134
|
+
var f = (i & Jt) !== 0, g = (i & (K | H)) !== 0, M = e.length, y = s.items, C = s.first, p = C, E, a = null, v, _ = [], c = [], d, h, l, A;
|
|
135
|
+
if (f)
|
|
136
|
+
for (A = 0; A < M; A += 1)
|
|
137
|
+
d = e[A], h = u(d, A), l = y.get(h), l !== void 0 && ((X = l.a) == null || X.measure(), (v ?? (v = /* @__PURE__ */ new Set())).add(l));
|
|
138
|
+
for (A = 0; A < M; A += 1) {
|
|
139
|
+
if (d = e[A], h = u(d, A), l = y.get(h), l === void 0) {
|
|
140
|
+
var T = n.get(h);
|
|
141
|
+
if (T !== void 0) {
|
|
142
|
+
n.delete(h), y.set(h, T);
|
|
143
|
+
var G = a ? a.next : p;
|
|
144
|
+
S(s, a, T), S(s, T, G), J(T, G, o), a = T;
|
|
145
|
+
} else {
|
|
146
|
+
var U = p ? (
|
|
147
|
+
/** @type {TemplateNode} */
|
|
148
|
+
p.e.nodes_start
|
|
149
|
+
) : o;
|
|
150
|
+
a = q(
|
|
151
|
+
U,
|
|
152
|
+
s,
|
|
153
|
+
a,
|
|
154
|
+
a === null ? s.first : a.next,
|
|
155
|
+
d,
|
|
156
|
+
h,
|
|
157
|
+
A,
|
|
158
|
+
r,
|
|
159
|
+
i,
|
|
160
|
+
m
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
y.set(h, a), _ = [], c = [], p = a.next;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (g && yt(l, d, A, i), (l.e.f & x) !== 0 && (Et(l.e), f && ((Q = l.a) == null || Q.unfix(), (v ?? (v = /* @__PURE__ */ new Set())).delete(l))), l !== p) {
|
|
167
|
+
if (E !== void 0 && E.has(l)) {
|
|
168
|
+
if (_.length < c.length) {
|
|
169
|
+
var N = c[0], R;
|
|
170
|
+
a = N.prev;
|
|
171
|
+
var F = _[0], j = _[_.length - 1];
|
|
172
|
+
for (R = 0; R < _.length; R += 1)
|
|
173
|
+
J(_[R], N, o);
|
|
174
|
+
for (R = 0; R < c.length; R += 1)
|
|
175
|
+
E.delete(c[R]);
|
|
176
|
+
S(s, F.prev, j.next), S(s, a, F), S(s, j, N), p = N, a = j, A -= 1, _ = [], c = [];
|
|
177
|
+
} else
|
|
178
|
+
E.delete(l), J(l, p, o), S(s, l.prev, l.next), S(s, l, a === null ? s.first : a.next), S(s, a, l), a = l;
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
for (_ = [], c = []; p !== null && p.k !== h; )
|
|
182
|
+
(p.e.f & x) === 0 && (E ?? (E = /* @__PURE__ */ new Set())).add(p), c.push(p), p = p.next;
|
|
183
|
+
if (p === null)
|
|
184
|
+
continue;
|
|
185
|
+
l = p;
|
|
186
|
+
}
|
|
187
|
+
_.push(l), a = l, p = l.next;
|
|
188
|
+
}
|
|
189
|
+
if (p !== null || E !== void 0) {
|
|
190
|
+
for (var B = E === void 0 ? [] : At(E); p !== null; )
|
|
191
|
+
(p.e.f & x) === 0 && B.push(p), p = p.next;
|
|
192
|
+
var W = B.length;
|
|
193
|
+
if (W > 0) {
|
|
194
|
+
var Lt = (i & Mt) !== 0 && M === 0 ? o : null;
|
|
195
|
+
if (f) {
|
|
196
|
+
for (A = 0; A < W; A += 1)
|
|
197
|
+
($ = B[A].a) == null || $.measure();
|
|
198
|
+
for (A = 0; A < W; A += 1)
|
|
199
|
+
(tt = B[A].a) == null || tt.fix();
|
|
200
|
+
}
|
|
201
|
+
ee(s, B, Lt);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
f && Vt(() => {
|
|
205
|
+
var et;
|
|
206
|
+
if (v !== void 0)
|
|
207
|
+
for (l of v)
|
|
208
|
+
(et = l.a) == null || et.apply();
|
|
209
|
+
}), t.first = s.first && s.first.e, t.last = a && a.e;
|
|
210
|
+
for (var It of n.values())
|
|
211
|
+
Tt(It.e);
|
|
212
|
+
n.clear();
|
|
213
|
+
}
|
|
214
|
+
function yt(t, e, s, n) {
|
|
215
|
+
(n & K) !== 0 && ot(t.v, e), (n & H) !== 0 ? ot(
|
|
216
|
+
/** @type {Value<number>} */
|
|
217
|
+
t.i,
|
|
218
|
+
s
|
|
219
|
+
) : t.i = s;
|
|
220
|
+
}
|
|
221
|
+
function q(t, e, s, n, o, r, i, u, m, f, g) {
|
|
222
|
+
var M = V, y = (m & K) !== 0, C = (m & Kt) === 0, p = y ? C ? Dt(o, !1, !1) : rt(o) : o, E = (m & H) === 0 ? i : rt(i), a = {
|
|
223
|
+
i: E,
|
|
224
|
+
v: p,
|
|
225
|
+
k: r,
|
|
226
|
+
a: null,
|
|
227
|
+
// @ts-expect-error
|
|
228
|
+
e: null,
|
|
229
|
+
prev: s,
|
|
230
|
+
next: n
|
|
231
|
+
};
|
|
232
|
+
V = a;
|
|
233
|
+
try {
|
|
234
|
+
if (t === null) {
|
|
235
|
+
var v = document.createDocumentFragment();
|
|
236
|
+
v.append(t = gt());
|
|
237
|
+
}
|
|
238
|
+
return a.e = z(() => u(
|
|
239
|
+
/** @type {Node} */
|
|
240
|
+
t,
|
|
241
|
+
p,
|
|
242
|
+
E,
|
|
243
|
+
f
|
|
244
|
+
), k), a.e.prev = s && s.e, a.e.next = n && n.e, s === null ? g || (e.first = a) : (s.next = a, s.e.next = a.e), n !== null && (n.prev = a, n.e.prev = a.e), a;
|
|
245
|
+
} finally {
|
|
246
|
+
V = M;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function J(t, e, s) {
|
|
250
|
+
for (var n = t.next ? (
|
|
251
|
+
/** @type {TemplateNode} */
|
|
252
|
+
t.next.e.nodes_start
|
|
253
|
+
) : s, o = e ? (
|
|
254
|
+
/** @type {TemplateNode} */
|
|
255
|
+
e.e.nodes_start
|
|
256
|
+
) : s, r = (
|
|
257
|
+
/** @type {TemplateNode} */
|
|
258
|
+
t.e.nodes_start
|
|
259
|
+
); r !== null && r !== n; ) {
|
|
260
|
+
var i = (
|
|
261
|
+
/** @type {TemplateNode} */
|
|
262
|
+
jt(r)
|
|
263
|
+
);
|
|
264
|
+
o.before(r), r = i;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function S(t, e, s) {
|
|
268
|
+
e === null ? t.first = s : (e.next = s, e.e.next = s && s.e), s !== null && (s.prev = e, s.e.prev = e && e.e);
|
|
269
|
+
}
|
|
270
|
+
const ne = '"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif';
|
|
271
|
+
function oe() {
|
|
272
|
+
const t = document.createElement("canvas");
|
|
273
|
+
t.width = t.height = 1;
|
|
274
|
+
const e = t.getContext("2d", { willReadFrequently: !0 });
|
|
275
|
+
return e.textBaseline = "top", e.font = `100px ${ne}`, e.scale(0.01, 0.01), e;
|
|
276
|
+
}
|
|
277
|
+
function it(t, e, s) {
|
|
278
|
+
return t.clearRect(0, 0, 100, 100), t.fillStyle = s, t.fillText(e, 0, 0), t.getImageData(0, 0, 1, 1).data.join(",");
|
|
279
|
+
}
|
|
280
|
+
function ct(t) {
|
|
281
|
+
const e = oe(), s = it(e, t, "#fff"), n = it(e, t, "#000");
|
|
282
|
+
return n === s && !n.startsWith("0,0,0,");
|
|
283
|
+
}
|
|
284
|
+
function ma(t = "Twemoji Country Flags", e = "https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2") {
|
|
285
|
+
if (typeof window < "u" && ct("😊") && !ct("🇨🇭")) {
|
|
286
|
+
const s = document.createElement("style");
|
|
287
|
+
return s.textContent = `@font-face {
|
|
288
|
+
font-family: "${t}";
|
|
289
|
+
unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
|
|
290
|
+
U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
|
|
291
|
+
src: url('${e}') format('woff2');
|
|
292
|
+
font-display: swap;
|
|
293
|
+
}`, document.head.appendChild(s), !0;
|
|
294
|
+
}
|
|
295
|
+
return !1;
|
|
296
|
+
}
|
|
297
|
+
var re = Object.defineProperty, ae = (t, e, s) => e in t ? re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, w = (t, e, s) => ae(t, typeof e != "symbol" ? e + "" : e, s);
|
|
298
|
+
const lt = {
|
|
299
|
+
"#": { pattern: /[0-9]/ },
|
|
300
|
+
"@": { pattern: /[a-zA-Z]/ },
|
|
301
|
+
"*": { pattern: /[a-zA-Z0-9]/ }
|
|
302
|
+
}, ut = (t, e, s) => t.replaceAll(e, "").replace(s, ".").replace("..", ".").replace(/[^.\d]/g, ""), ft = (t, e, s) => {
|
|
303
|
+
var n;
|
|
304
|
+
return new Intl.NumberFormat(((n = s.number) == null ? void 0 : n.locale) ?? "en", {
|
|
305
|
+
minimumFractionDigits: t,
|
|
306
|
+
maximumFractionDigits: e,
|
|
307
|
+
roundingMode: "trunc"
|
|
308
|
+
});
|
|
309
|
+
}, ie = (t, e = !0, s) => {
|
|
310
|
+
var n, o, r, i;
|
|
311
|
+
const u = ((n = s.number) == null ? void 0 : n.unsigned) !== !0 && t.startsWith("-") ? "-" : "", m = ((o = s.number) == null ? void 0 : o.fraction) ?? 0;
|
|
312
|
+
let f = ft(0, m, s);
|
|
313
|
+
const g = f.formatToParts(1000.12), M = ((r = g.find((a) => a.type === "group")) == null ? void 0 : r.value) ?? " ", y = ((i = g.find((a) => a.type === "decimal")) == null ? void 0 : i.value) ?? ".", C = ut(t, M, y);
|
|
314
|
+
if (Number.isNaN(parseFloat(C))) return u;
|
|
315
|
+
const p = C.split(".");
|
|
316
|
+
if (p[1] != null && p[1].length >= 1) {
|
|
317
|
+
const a = p[1].length <= m ? p[1].length : m;
|
|
318
|
+
f = ft(a, m, s);
|
|
319
|
+
}
|
|
320
|
+
let E = f.format(parseFloat(C));
|
|
321
|
+
return e ? m > 0 && C.endsWith(".") && !C.slice(0, -1).includes(".") && (E += y) : E = ut(E, M, y), u + E;
|
|
322
|
+
}, Ct = (t) => JSON.parse(t.replaceAll("'", '"')), ce = (t, e = {}) => {
|
|
323
|
+
const s = { ...e };
|
|
324
|
+
t.dataset.maska != null && t.dataset.maska !== "" && (s.mask = le(t.dataset.maska)), t.dataset.maskaEager != null && (s.eager = D(t.dataset.maskaEager)), t.dataset.maskaReversed != null && (s.reversed = D(t.dataset.maskaReversed)), t.dataset.maskaTokensReplace != null && (s.tokensReplace = D(t.dataset.maskaTokensReplace)), t.dataset.maskaTokens != null && (s.tokens = ue(t.dataset.maskaTokens));
|
|
325
|
+
const n = {};
|
|
326
|
+
return t.dataset.maskaNumberLocale != null && (n.locale = t.dataset.maskaNumberLocale), t.dataset.maskaNumberFraction != null && (n.fraction = parseInt(t.dataset.maskaNumberFraction)), t.dataset.maskaNumberUnsigned != null && (n.unsigned = D(t.dataset.maskaNumberUnsigned)), (t.dataset.maskaNumber != null || Object.values(n).length > 0) && (s.number = n), s;
|
|
327
|
+
}, D = (t) => t !== "" ? !!JSON.parse(t) : !0, le = (t) => t.startsWith("[") && t.endsWith("]") ? Ct(t) : t, ue = (t) => {
|
|
328
|
+
if (t.startsWith("{") && t.endsWith("}"))
|
|
329
|
+
return Ct(t);
|
|
330
|
+
const e = {};
|
|
331
|
+
return t.split("|").forEach((s) => {
|
|
332
|
+
const n = s.split(":");
|
|
333
|
+
e[n[0]] = {
|
|
334
|
+
pattern: _t() ? new RegExp(n[1], "u") : new RegExp(n[1]),
|
|
335
|
+
optional: n[2] === "optional",
|
|
336
|
+
multiple: n[2] === "multiple",
|
|
337
|
+
repeated: n[2] === "repeated"
|
|
338
|
+
};
|
|
339
|
+
}), e;
|
|
340
|
+
}, _t = () => {
|
|
341
|
+
try {
|
|
342
|
+
return new RegExp("\\p{L}", "u"), !0;
|
|
343
|
+
} catch {
|
|
344
|
+
return !1;
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
class Rt {
|
|
348
|
+
constructor(e = {}) {
|
|
349
|
+
w(this, "opts", {}), w(this, "memo", /* @__PURE__ */ new Map());
|
|
350
|
+
const s = { ...e };
|
|
351
|
+
if (s.tokens != null) {
|
|
352
|
+
s.tokens = s.tokensReplace ? { ...s.tokens } : { ...lt, ...s.tokens };
|
|
353
|
+
for (const n of Object.values(s.tokens))
|
|
354
|
+
typeof n.pattern == "string" && (n.pattern = _t() ? new RegExp(n.pattern, "u") : new RegExp(n.pattern));
|
|
355
|
+
} else
|
|
356
|
+
s.tokens = lt;
|
|
357
|
+
Array.isArray(s.mask) && (s.mask.length > 1 ? s.mask = [...s.mask].sort((n, o) => n.length - o.length) : s.mask = s.mask[0] ?? ""), s.mask === "" && (s.mask = null), this.opts = s;
|
|
358
|
+
}
|
|
359
|
+
masked(e) {
|
|
360
|
+
return this.process(String(e), this.findMask(String(e)));
|
|
361
|
+
}
|
|
362
|
+
unmasked(e) {
|
|
363
|
+
return this.process(String(e), this.findMask(String(e)), !1);
|
|
364
|
+
}
|
|
365
|
+
isEager() {
|
|
366
|
+
return this.opts.eager === !0;
|
|
367
|
+
}
|
|
368
|
+
isReversed() {
|
|
369
|
+
return this.opts.reversed === !0;
|
|
370
|
+
}
|
|
371
|
+
completed(e) {
|
|
372
|
+
const s = this.findMask(String(e));
|
|
373
|
+
if (this.opts.mask == null || s == null) return !1;
|
|
374
|
+
const n = this.process(String(e), s).length;
|
|
375
|
+
return typeof this.opts.mask == "string" ? n >= this.opts.mask.length : n >= s.length;
|
|
376
|
+
}
|
|
377
|
+
findMask(e) {
|
|
378
|
+
const s = this.opts.mask;
|
|
379
|
+
if (s == null)
|
|
380
|
+
return null;
|
|
381
|
+
if (typeof s == "string")
|
|
382
|
+
return s;
|
|
383
|
+
if (typeof s == "function")
|
|
384
|
+
return s(e);
|
|
385
|
+
const n = this.process(e, s.slice(-1).pop() ?? "", !1);
|
|
386
|
+
return s.find((o) => this.process(e, o, !1).length >= n.length) ?? "";
|
|
387
|
+
}
|
|
388
|
+
escapeMask(e) {
|
|
389
|
+
const s = [], n = [];
|
|
390
|
+
return e.split("").forEach((o, r) => {
|
|
391
|
+
o === "!" && e[r - 1] !== "!" ? n.push(r - n.length) : s.push(o);
|
|
392
|
+
}), { mask: s.join(""), escaped: n };
|
|
393
|
+
}
|
|
394
|
+
process(e, s, n = !0) {
|
|
395
|
+
if (this.opts.number != null) return ie(e, n, this.opts);
|
|
396
|
+
if (s == null) return e;
|
|
397
|
+
const o = `v=${e},mr=${s},m=${n ? 1 : 0}`;
|
|
398
|
+
if (this.memo.has(o)) return this.memo.get(o);
|
|
399
|
+
const { mask: r, escaped: i } = this.escapeMask(s), u = [], m = this.opts.tokens != null ? this.opts.tokens : {}, f = this.isReversed() ? -1 : 1, g = this.isReversed() ? "unshift" : "push", M = this.isReversed() ? 0 : r.length - 1, y = this.isReversed() ? () => a > -1 && v > -1 : () => a < r.length && v < e.length, C = (c) => !this.isReversed() && c <= M || this.isReversed() && c >= M;
|
|
400
|
+
let p, E = -1, a = this.isReversed() ? r.length - 1 : 0, v = this.isReversed() ? e.length - 1 : 0, _ = !1;
|
|
401
|
+
for (; y(); ) {
|
|
402
|
+
const c = r.charAt(a), d = m[c], h = (d == null ? void 0 : d.transform) != null ? d.transform(e.charAt(v)) : e.charAt(v);
|
|
403
|
+
if (!i.includes(a) && d != null ? (h.match(d.pattern) != null ? (u[g](h), d.repeated ? (E === -1 ? E = a : a === M && a !== E && (a = E - f), M === E && (a -= f)) : d.multiple && (_ = !0, a -= f), a += f) : d.multiple ? _ && (a += f, v -= f, _ = !1) : h === p ? p = void 0 : d.optional && (a += f, v -= f), v += f) : (n && !this.isEager() && u[g](c), h === c && !this.isEager() ? v += f : p = c, this.isEager() || (a += f)), this.isEager())
|
|
404
|
+
for (; C(a) && (m[r.charAt(a)] == null || i.includes(a)); ) {
|
|
405
|
+
if (n) {
|
|
406
|
+
if (u[g](r.charAt(a)), e.charAt(v) === r.charAt(a)) {
|
|
407
|
+
a += f, v += f;
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
} else r.charAt(a) === e.charAt(v) && (v += f);
|
|
411
|
+
a += f;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return this.memo.set(o, u.join("")), this.memo.get(o);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
class va {
|
|
418
|
+
constructor(e, s = {}) {
|
|
419
|
+
w(this, "items", /* @__PURE__ */ new Map()), w(this, "eventAbortController"), w(this, "onInput", (n) => {
|
|
420
|
+
if (n instanceof CustomEvent && n.type === "input" && !n.isTrusted && !n.bubbles)
|
|
421
|
+
return;
|
|
422
|
+
const o = n.target, r = this.items.get(o);
|
|
423
|
+
if (r === void 0) return;
|
|
424
|
+
const i = "inputType" in n && n.inputType.startsWith("delete"), u = r.isEager(), m = i && u && r.unmasked(o.value) === "" ? "" : o.value;
|
|
425
|
+
this.fixCursor(o, i, () => this.setValue(o, m));
|
|
426
|
+
}), this.options = s, this.eventAbortController = new AbortController(), this.init(this.getInputs(e));
|
|
427
|
+
}
|
|
428
|
+
update(e = {}) {
|
|
429
|
+
this.options = { ...e }, this.init(Array.from(this.items.keys()));
|
|
430
|
+
}
|
|
431
|
+
updateValue(e) {
|
|
432
|
+
var s;
|
|
433
|
+
e.value !== "" && e.value !== ((s = this.processInput(e)) == null ? void 0 : s.masked) && this.setValue(e, e.value);
|
|
434
|
+
}
|
|
435
|
+
destroy() {
|
|
436
|
+
this.eventAbortController.abort(), this.items.clear();
|
|
437
|
+
}
|
|
438
|
+
init(e) {
|
|
439
|
+
const s = this.getOptions(this.options);
|
|
440
|
+
for (const n of e) {
|
|
441
|
+
if (!this.items.has(n)) {
|
|
442
|
+
const { signal: r } = this.eventAbortController;
|
|
443
|
+
n.addEventListener("input", this.onInput, { capture: !0, signal: r });
|
|
444
|
+
}
|
|
445
|
+
const o = new Rt(ce(n, s));
|
|
446
|
+
this.items.set(n, o), queueMicrotask(() => this.updateValue(n)), n.selectionStart === null && o.isEager() && console.warn("Maska: input of `%s` type is not supported", n.type);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
getInputs(e) {
|
|
450
|
+
return typeof e == "string" ? Array.from(document.querySelectorAll(e)) : "length" in e ? Array.from(e) : [e];
|
|
451
|
+
}
|
|
452
|
+
getOptions(e) {
|
|
453
|
+
const { onMaska: s, preProcess: n, postProcess: o, ...r } = e;
|
|
454
|
+
return r;
|
|
455
|
+
}
|
|
456
|
+
fixCursor(e, s, n) {
|
|
457
|
+
var o, r;
|
|
458
|
+
const i = e.selectionStart, u = e.value;
|
|
459
|
+
if (n(), i === null || i === u.length && !s) return;
|
|
460
|
+
const m = e.value, f = u.slice(0, i), g = m.slice(0, i), M = (o = this.processInput(e, f)) == null ? void 0 : o.unmasked, y = (r = this.processInput(e, g)) == null ? void 0 : r.unmasked;
|
|
461
|
+
if (M === void 0 || y === void 0) return;
|
|
462
|
+
let C = i;
|
|
463
|
+
f !== g && (C += s ? m.length - u.length : M.length - y.length), e.setSelectionRange(C, C);
|
|
464
|
+
}
|
|
465
|
+
setValue(e, s) {
|
|
466
|
+
const n = this.processInput(e, s);
|
|
467
|
+
n !== void 0 && (e.value = n.masked, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((o) => o(n)) : this.options.onMaska(n)), e.dispatchEvent(new CustomEvent("maska", { detail: n })), e.dispatchEvent(new CustomEvent("input", { detail: n.masked })));
|
|
468
|
+
}
|
|
469
|
+
processInput(e, s) {
|
|
470
|
+
const n = this.items.get(e);
|
|
471
|
+
if (n === void 0) return;
|
|
472
|
+
let o = s ?? e.value;
|
|
473
|
+
this.options.preProcess != null && (o = this.options.preProcess(o));
|
|
474
|
+
let r = n.masked(o);
|
|
475
|
+
return this.options.postProcess != null && (r = this.options.postProcess(r)), {
|
|
476
|
+
masked: r,
|
|
477
|
+
unmasked: n.unmasked(o),
|
|
478
|
+
completed: n.completed(o)
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
const fe = "application/json", St = "Content-Type", I = Symbol(), Nt = Symbol();
|
|
483
|
+
function ht(t = {}) {
|
|
484
|
+
var e;
|
|
485
|
+
const s = t instanceof Array ? Object.fromEntries(t) : t;
|
|
486
|
+
return (e = Object.entries(s).find(([n]) => n.toLowerCase() === St.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
|
|
487
|
+
}
|
|
488
|
+
function pt(t) {
|
|
489
|
+
return /^application\/.*json.*/.test(t);
|
|
490
|
+
}
|
|
491
|
+
const b = function(t, e, s = !1) {
|
|
492
|
+
return Object.entries(e).reduce((n, [o, r]) => {
|
|
493
|
+
const i = t[o];
|
|
494
|
+
return Array.isArray(i) && Array.isArray(r) ? n[o] = s ? [...i, ...r] : r : typeof i == "object" && typeof r == "object" ? n[o] = b(i, r, s) : n[o] = r, n;
|
|
495
|
+
}, { ...t });
|
|
496
|
+
}, O = {
|
|
497
|
+
// Default options
|
|
498
|
+
options: {},
|
|
499
|
+
// Error type
|
|
500
|
+
errorType: "text",
|
|
501
|
+
// Polyfills
|
|
502
|
+
polyfills: {
|
|
503
|
+
// fetch: null,
|
|
504
|
+
// FormData: null,
|
|
505
|
+
// URL: null,
|
|
506
|
+
// URLSearchParams: null,
|
|
507
|
+
// performance: null,
|
|
508
|
+
// PerformanceObserver: null,
|
|
509
|
+
// AbortController: null,
|
|
510
|
+
},
|
|
511
|
+
polyfill(t, e = !0, s = !1, ...n) {
|
|
512
|
+
const o = this.polyfills[t] || (typeof self < "u" ? self[t] : null) || (typeof global < "u" ? global[t] : null);
|
|
513
|
+
if (e && !o)
|
|
514
|
+
throw new Error(t + " is not defined");
|
|
515
|
+
return s && o ? new o(...n) : o;
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
function he(t, e = !1) {
|
|
519
|
+
O.options = e ? t : b(O.options, t);
|
|
520
|
+
}
|
|
521
|
+
function pe(t, e = !1) {
|
|
522
|
+
O.polyfills = e ? t : b(O.polyfills, t);
|
|
523
|
+
}
|
|
524
|
+
function de(t) {
|
|
525
|
+
O.errorType = t;
|
|
526
|
+
}
|
|
527
|
+
const me = (t) => (e) => t.reduceRight((s, n) => n(s), e) || e;
|
|
528
|
+
class kt extends Error {
|
|
529
|
+
}
|
|
530
|
+
const ve = (t) => {
|
|
531
|
+
const e = /* @__PURE__ */ Object.create(null);
|
|
532
|
+
t = t._addons.reduce((c, d) => d.beforeRequest && d.beforeRequest(c, t._options, e) || c, t);
|
|
533
|
+
const { _url: s, _options: n, _config: o, _catchers: r, _resolvers: i, _middlewares: u, _addons: m } = t, f = new Map(r), g = b(o.options, n);
|
|
534
|
+
let M = s;
|
|
535
|
+
const y = me(u)((c, d) => (M = c, o.polyfill("fetch")(c, d)))(s, g), C = new Error(), p = y.catch((c) => {
|
|
536
|
+
throw { [I]: c };
|
|
537
|
+
}).then((c) => {
|
|
538
|
+
var d;
|
|
539
|
+
if (!c.ok) {
|
|
540
|
+
const h = new kt();
|
|
541
|
+
if (h.cause = C, h.stack = h.stack + `
|
|
542
|
+
CAUSE: ` + C.stack, h.response = c, h.status = c.status, h.url = M, c.type === "opaque")
|
|
543
|
+
throw h;
|
|
544
|
+
const l = o.errorType === "json" || ((d = c.headers.get("Content-Type")) === null || d === void 0 ? void 0 : d.split(";")[0]) === "application/json";
|
|
545
|
+
return (o.errorType ? l ? c.text() : c[o.errorType]() : Promise.resolve(c.body)).then((T) => {
|
|
546
|
+
throw h.message = typeof T == "string" ? T : c.statusText, T && (l && typeof T == "string" ? (h.text = T, h.json = JSON.parse(T)) : h[o.errorType] = T), h;
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
return c;
|
|
550
|
+
}), E = (c) => c.catch((d) => {
|
|
551
|
+
const h = Object.prototype.hasOwnProperty.call(d, I), l = h ? d[I] : d, A = (l == null ? void 0 : l.status) && f.get(l.status) || f.get(l == null ? void 0 : l.name) || h && f.has(I) && f.get(I);
|
|
552
|
+
if (A)
|
|
553
|
+
return A(l, t);
|
|
554
|
+
const T = f.get(Nt);
|
|
555
|
+
if (T)
|
|
556
|
+
return T(l, t);
|
|
557
|
+
throw l;
|
|
558
|
+
}), a = (c) => (d) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ E(c ? p.then((h) => h && h[c]()).then((h) => d ? d(h) : h) : p.then((h) => d ? d(h) : h)), v = {
|
|
559
|
+
_wretchReq: t,
|
|
560
|
+
_fetchReq: y,
|
|
561
|
+
_sharedState: e,
|
|
562
|
+
res: a(null),
|
|
563
|
+
json: a("json"),
|
|
564
|
+
blob: a("blob"),
|
|
565
|
+
formData: a("formData"),
|
|
566
|
+
arrayBuffer: a("arrayBuffer"),
|
|
567
|
+
text: a("text"),
|
|
568
|
+
error(c, d) {
|
|
569
|
+
return f.set(c, d), this;
|
|
570
|
+
},
|
|
571
|
+
badRequest(c) {
|
|
572
|
+
return this.error(400, c);
|
|
573
|
+
},
|
|
574
|
+
unauthorized(c) {
|
|
575
|
+
return this.error(401, c);
|
|
576
|
+
},
|
|
577
|
+
forbidden(c) {
|
|
578
|
+
return this.error(403, c);
|
|
579
|
+
},
|
|
580
|
+
notFound(c) {
|
|
581
|
+
return this.error(404, c);
|
|
582
|
+
},
|
|
583
|
+
timeout(c) {
|
|
584
|
+
return this.error(408, c);
|
|
585
|
+
},
|
|
586
|
+
internalError(c) {
|
|
587
|
+
return this.error(500, c);
|
|
588
|
+
},
|
|
589
|
+
fetchError(c) {
|
|
590
|
+
return this.error(I, c);
|
|
591
|
+
}
|
|
592
|
+
}, _ = m.reduce((c, d) => ({
|
|
593
|
+
...c,
|
|
594
|
+
...typeof d.resolver == "function" ? d.resolver(c) : d.resolver
|
|
595
|
+
}), v);
|
|
596
|
+
return i.reduce((c, d) => d(c, t), _);
|
|
597
|
+
}, Ae = {
|
|
598
|
+
_url: "",
|
|
599
|
+
_options: {},
|
|
600
|
+
_config: O,
|
|
601
|
+
_catchers: /* @__PURE__ */ new Map(),
|
|
602
|
+
_resolvers: [],
|
|
603
|
+
_deferred: [],
|
|
604
|
+
_middlewares: [],
|
|
605
|
+
_addons: [],
|
|
606
|
+
addon(t) {
|
|
607
|
+
return { ...this, _addons: [...this._addons, t], ...t.wretch };
|
|
608
|
+
},
|
|
609
|
+
errorType(t) {
|
|
610
|
+
return {
|
|
611
|
+
...this,
|
|
612
|
+
_config: {
|
|
613
|
+
...this._config,
|
|
614
|
+
errorType: t
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
},
|
|
618
|
+
polyfills(t, e = !1) {
|
|
619
|
+
return {
|
|
620
|
+
...this,
|
|
621
|
+
_config: {
|
|
622
|
+
...this._config,
|
|
623
|
+
polyfills: e ? t : b(this._config.polyfills, t)
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
},
|
|
627
|
+
url(t, e = !1) {
|
|
628
|
+
if (e)
|
|
629
|
+
return { ...this, _url: t };
|
|
630
|
+
const s = this._url.split("?");
|
|
631
|
+
return {
|
|
632
|
+
...this,
|
|
633
|
+
_url: s.length > 1 ? s[0] + t + "?" + s[1] : this._url + t
|
|
634
|
+
};
|
|
635
|
+
},
|
|
636
|
+
options(t, e = !1) {
|
|
637
|
+
return { ...this, _options: e ? t : b(this._options, t) };
|
|
638
|
+
},
|
|
639
|
+
headers(t) {
|
|
640
|
+
const e = t ? Array.isArray(t) ? Object.fromEntries(t) : "entries" in t ? Object.fromEntries(t.entries()) : t : {};
|
|
641
|
+
return { ...this, _options: b(this._options, { headers: e }) };
|
|
642
|
+
},
|
|
643
|
+
accept(t) {
|
|
644
|
+
return this.headers({ Accept: t });
|
|
645
|
+
},
|
|
646
|
+
content(t) {
|
|
647
|
+
return this.headers({ [St]: t });
|
|
648
|
+
},
|
|
649
|
+
auth(t) {
|
|
650
|
+
return this.headers({ Authorization: t });
|
|
651
|
+
},
|
|
652
|
+
catcher(t, e) {
|
|
653
|
+
const s = new Map(this._catchers);
|
|
654
|
+
return s.set(t, e), { ...this, _catchers: s };
|
|
655
|
+
},
|
|
656
|
+
catcherFallback(t) {
|
|
657
|
+
return this.catcher(Nt, t);
|
|
658
|
+
},
|
|
659
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
660
|
+
resolve(t, e = !1) {
|
|
661
|
+
return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
|
|
662
|
+
},
|
|
663
|
+
defer(t, e = !1) {
|
|
664
|
+
return {
|
|
665
|
+
...this,
|
|
666
|
+
_deferred: e ? [t] : [...this._deferred, t]
|
|
667
|
+
};
|
|
668
|
+
},
|
|
669
|
+
middlewares(t, e = !1) {
|
|
670
|
+
return {
|
|
671
|
+
...this,
|
|
672
|
+
_middlewares: e ? t : [...this._middlewares, ...t]
|
|
673
|
+
};
|
|
674
|
+
},
|
|
675
|
+
fetch(t = this._options.method, e = "", s = null) {
|
|
676
|
+
let n = this.url(e).options({ method: t });
|
|
677
|
+
const o = ht(n._options.headers), r = this._config.polyfill("FormData", !1), i = typeof s == "object" && !(r && s instanceof r) && (!n._options.headers || !o || pt(o));
|
|
678
|
+
return n = s ? i ? n.json(s, o) : n.body(s) : n, ve(n._deferred.reduce((u, m) => m(u, u._url, u._options), n));
|
|
679
|
+
},
|
|
680
|
+
get(t = "") {
|
|
681
|
+
return this.fetch("GET", t);
|
|
682
|
+
},
|
|
683
|
+
delete(t = "") {
|
|
684
|
+
return this.fetch("DELETE", t);
|
|
685
|
+
},
|
|
686
|
+
put(t, e = "") {
|
|
687
|
+
return this.fetch("PUT", e, t);
|
|
688
|
+
},
|
|
689
|
+
post(t, e = "") {
|
|
690
|
+
return this.fetch("POST", e, t);
|
|
691
|
+
},
|
|
692
|
+
patch(t, e = "") {
|
|
693
|
+
return this.fetch("PATCH", e, t);
|
|
694
|
+
},
|
|
695
|
+
head(t = "") {
|
|
696
|
+
return this.fetch("HEAD", t);
|
|
697
|
+
},
|
|
698
|
+
opts(t = "") {
|
|
699
|
+
return this.fetch("OPTIONS", t);
|
|
700
|
+
},
|
|
701
|
+
body(t) {
|
|
702
|
+
return { ...this, _options: { ...this._options, body: t } };
|
|
703
|
+
},
|
|
704
|
+
json(t, e) {
|
|
705
|
+
const s = ht(this._options.headers);
|
|
706
|
+
return this.content(e || pt(s) && s || fe).body(JSON.stringify(t));
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
function L(t = "", e = {}) {
|
|
710
|
+
return { ...Ae, _url: t, _options: e };
|
|
711
|
+
}
|
|
712
|
+
L.default = L;
|
|
713
|
+
L.options = he;
|
|
714
|
+
L.errorType = de;
|
|
715
|
+
L.polyfills = pe;
|
|
716
|
+
L.WretchError = kt;
|
|
717
|
+
const ge = () => ({
|
|
718
|
+
beforeRequest(t, e, s) {
|
|
719
|
+
const n = t._config.polyfill("AbortController", !1, !0);
|
|
720
|
+
!e.signal && n && (e.signal = n.signal);
|
|
721
|
+
const o = {
|
|
722
|
+
ref: null,
|
|
723
|
+
clear() {
|
|
724
|
+
o.ref && (clearTimeout(o.ref), o.ref = null);
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
return s.abort = {
|
|
728
|
+
timeout: o,
|
|
729
|
+
fetchController: n
|
|
730
|
+
}, t;
|
|
731
|
+
},
|
|
732
|
+
wretch: {
|
|
733
|
+
signal(t) {
|
|
734
|
+
return { ...this, _options: { ...this._options, signal: t.signal } };
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
resolver: {
|
|
738
|
+
setTimeout(t, e = this._sharedState.abort.fetchController) {
|
|
739
|
+
const { timeout: s } = this._sharedState.abort;
|
|
740
|
+
return s.clear(), s.ref = setTimeout(() => e.abort(), t), this;
|
|
741
|
+
},
|
|
742
|
+
controller() {
|
|
743
|
+
return [this._sharedState.abort.fetchController, this];
|
|
744
|
+
},
|
|
745
|
+
onAbort(t) {
|
|
746
|
+
return this.error("AbortError", t);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
function bt(t, e = !1, s, n = s.polyfill("FormData", !0, !0), o = []) {
|
|
751
|
+
return Object.entries(t).forEach(([r, i]) => {
|
|
752
|
+
let u = o.reduce((m, f) => m ? `${m}[${f}]` : f, null);
|
|
753
|
+
if (u = u ? `${u}[${r}]` : r, i instanceof Array || globalThis.FileList && i instanceof FileList)
|
|
754
|
+
for (const m of i)
|
|
755
|
+
n.append(u, m);
|
|
756
|
+
else e && typeof i == "object" && (!(e instanceof Array) || !e.includes(r)) ? i !== null && bt(i, e, s, n, [...o, r]) : n.append(u, i);
|
|
757
|
+
}), n;
|
|
758
|
+
}
|
|
759
|
+
const Ee = {
|
|
760
|
+
wretch: {
|
|
761
|
+
formData(t, e = !1) {
|
|
762
|
+
return this.body(bt(t, e, this._config));
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
function dt(t) {
|
|
767
|
+
return typeof t < "u" ? t : "";
|
|
768
|
+
}
|
|
769
|
+
const Te = (t, e, s, n, o) => {
|
|
770
|
+
let r;
|
|
771
|
+
if (typeof e == "string")
|
|
772
|
+
r = e;
|
|
773
|
+
else {
|
|
774
|
+
const u = o.polyfill("URLSearchParams", !0, !0);
|
|
775
|
+
for (const m in e) {
|
|
776
|
+
const f = e[m];
|
|
777
|
+
if (!(n && f == null))
|
|
778
|
+
if (e[m] instanceof Array)
|
|
779
|
+
for (const g of f)
|
|
780
|
+
u.append(m, dt(g));
|
|
781
|
+
else
|
|
782
|
+
u.append(m, dt(f));
|
|
783
|
+
}
|
|
784
|
+
r = u.toString();
|
|
785
|
+
}
|
|
786
|
+
const i = t.split("?");
|
|
787
|
+
return r ? s || i.length < 2 ? i[0] + "?" + r : t + "&" + r : s ? i[0] : t;
|
|
788
|
+
}, Me = {
|
|
789
|
+
wretch: {
|
|
790
|
+
query(t, e = !1, s = !1) {
|
|
791
|
+
return { ...this, _url: Te(this._url, t, e, s, this._config) };
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}, ye = {
|
|
795
|
+
number: {
|
|
796
|
+
locale: "uk",
|
|
797
|
+
fraction: 2,
|
|
798
|
+
unsigned: !0
|
|
799
|
+
}
|
|
800
|
+
}, Aa = {
|
|
801
|
+
number: {
|
|
802
|
+
locale: "uk",
|
|
803
|
+
fraction: 0,
|
|
804
|
+
unsigned: !0
|
|
805
|
+
}
|
|
806
|
+
}, ga = (t) => {
|
|
807
|
+
const e = t.split(",");
|
|
808
|
+
return e.length > 1 && e[1].length === 1 ? t.padEnd(t.length + 1, "0") : t;
|
|
809
|
+
}, Ce = (t) => new Rt(ye).unmasked(t), mt = Symbol("aborted");
|
|
810
|
+
class Ea {
|
|
811
|
+
constructor(e) {
|
|
812
|
+
st(this, "abort");
|
|
813
|
+
this.version = e;
|
|
814
|
+
}
|
|
815
|
+
getProfile(e) {
|
|
816
|
+
return e === "GBP" ? "uk" : "euro";
|
|
817
|
+
}
|
|
818
|
+
async loadData(e = "https://transfer.moneyto.co.uk/sf/country-list") {
|
|
819
|
+
const s = await this.makeRequest().url(e).get();
|
|
820
|
+
if (s.status === "success")
|
|
821
|
+
return s.result;
|
|
822
|
+
}
|
|
823
|
+
async calculate(e, s = "https://transfer.moneyto.co.uk/sf/calculate") {
|
|
824
|
+
var i;
|
|
825
|
+
(i = this.abort) == null || i.abort(mt), this.abort = new AbortController();
|
|
826
|
+
const n = e.isReceive ? e.payoutAmount : e.sendAmount, o = new URLSearchParams(window.location.search), r = {
|
|
827
|
+
country: e.country,
|
|
828
|
+
method: e.payoutType,
|
|
829
|
+
amount: Ce(n),
|
|
830
|
+
currency: e.payoutCurrency,
|
|
831
|
+
send_currency: e.sendCurrency,
|
|
832
|
+
is_receive: e.isReceive ? 1 : 0,
|
|
833
|
+
profile: this.getProfile(e.sendCurrency),
|
|
834
|
+
utm_source: o.get("utm_source"),
|
|
835
|
+
utm_medium: o.get("utm_medium"),
|
|
836
|
+
utm_campaign: o.get("utm_campaign"),
|
|
837
|
+
utm_content: o.get("utm_content"),
|
|
838
|
+
utm_term: o.get("utm_term")
|
|
839
|
+
};
|
|
840
|
+
try {
|
|
841
|
+
const u = await this.makeRequest().url(s).formData(r).signal(this.abort).post();
|
|
842
|
+
if (u.status !== "success")
|
|
843
|
+
throw new Error();
|
|
844
|
+
return u.result;
|
|
845
|
+
} catch (u) {
|
|
846
|
+
throw u === mt ? u : new Error("Calculation error, please try later");
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
makeRequest() {
|
|
850
|
+
let e = L().errorType("json").addon(ge()).addon(Ee).addon(Me).resolve((s) => s.json());
|
|
851
|
+
return this.version && (e = e.query({ api_version: this.version })), e;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
const _e = "AD", Re = "AE", Se = "AF", Ne = "AG", ke = "AI", be = "AL", Le = "AM", Ie = "AO", Oe = "AQ", Ge = "AR", Be = "AS", Pe = "AT", we = "AU", Ue = "AW", Fe = "AX", De = "AZ", He = "BA", Ke = "BB", je = "BD", We = "BE", xe = "BF", Ye = "BG", Ze = "BH", Ve = "BI", Je = "BJ", ze = "BL", qe = "BM", Xe = "BN", Qe = "BO", $e = "BQ", ts = "BR", es = "BS", ss = "BT", ns = "BV", os = "BW", rs = "BY", as = "BZ", is = "CA", cs = "CC", ls = "CD", us = "CF", fs = "CG", hs = "CH", ps = "CI", ds = "CK", ms = "CL", vs = "CM", As = "CN", gs = "CO", Es = "CR", Ts = "CU", Ms = "CV", ys = "CW", Cs = "CX", _s = "CY", Rs = "CZ", Ss = "DE", Ns = "DJ", ks = "DK", bs = "DM", Ls = "DO", Is = "DZ", Os = "EC", Gs = "EE", Bs = "EG", Ps = "EH", ws = "ER", Us = "ES", Fs = "ET", Ds = "FI", Hs = "FJ", Ks = "FK", js = "FM", Ws = "FO", xs = "FR", Ys = "GA", Zs = "GB", Vs = "GD", Js = "GE", zs = "GF", qs = "GG", Xs = "GH", Qs = "GI", $s = "GL", tn = "GM", en = "GN", sn = "GP", nn = "GQ", on = "GR", rn = "GS", an = "GT", cn = "GU", ln = "GW", un = "GY", fn = "HK", hn = "HM", pn = "HN", dn = "HR", mn = "HT", vn = "HU", An = "ID", gn = "IE", En = "IL", Tn = "IM", Mn = "IN", yn = "IO", Cn = "IQ", _n = "IR", Rn = "IS", Sn = "IT", Nn = "JE", kn = "JM", bn = "JO", Ln = "JP", In = "KE", On = "KG", Gn = "KH", Bn = "KI", Pn = "KM", wn = "KN", Un = "KP", Fn = "KR", Dn = "KW", Hn = "KY", Kn = "KZ", jn = "LA", Wn = "LB", xn = "LC", Yn = "LI", Zn = "LK", Vn = "LR", Jn = "LS", zn = "LT", qn = "LU", Xn = "LV", Qn = "LY", $n = "MA", to = "MC", eo = "MD", so = "ME", no = "MF", oo = "MG", ro = "MH", ao = "MK", io = "ML", co = "MM", lo = "MN", uo = "MO", fo = "MP", ho = "MQ", po = "MR", mo = "MS", vo = "MT", Ao = "MU", go = "MV", Eo = "MW", To = "MX", Mo = "MY", yo = "MZ", Co = "NA", _o = "NC", Ro = "NE", So = "NF", No = "NG", ko = "NI", bo = "NL", Lo = "NO", Io = "NP", Oo = "NR", Go = "NU", Bo = "NZ", Po = "OM", wo = "PA", Uo = "PE", Fo = "PF", Do = "PG", Ho = "PH", Ko = "PK", jo = "PL", Wo = "PM", xo = "PN", Yo = "PR", Zo = "PS", Vo = "PT", Jo = "PW", zo = "PY", qo = "QA", Xo = "RE", Qo = "RO", $o = "RS", tr = "RU", er = "RW", sr = "SA", nr = "SB", or = "SC", rr = "SD", ar = "SE", ir = "SG", cr = "SH", lr = "SI", ur = "SJ", fr = "SK", hr = "SL", pr = "SM", dr = "SN", mr = "SO", vr = "SR", Ar = "SS", gr = "ST", Er = "SV", Tr = "SX", Mr = "SY", yr = "SZ", Cr = "TC", _r = "TD", Rr = "TF", Sr = "TG", Nr = "TH", kr = "TJ", br = "TK", Lr = "TL", Ir = "TM", Or = "TN", Gr = "TO", Br = "TR", Pr = "TT", wr = "TV", Ur = "TW", Fr = "TZ", Dr = "UA", Hr = "UG", Kr = "UM", jr = "US", Wr = "UY", xr = "UZ", Yr = "VA", Zr = "VC", Vr = "VE", Jr = "VG", zr = "VI", qr = "VN", Xr = "VU", Qr = "WF", $r = "WS", ta = "XK", ea = "YE", sa = "YT", na = "ZA", oa = "ZM", ra = "ZW", vt = {
|
|
855
|
+
AND: _e,
|
|
856
|
+
ARE: Re,
|
|
857
|
+
AFG: Se,
|
|
858
|
+
ATG: Ne,
|
|
859
|
+
AIA: ke,
|
|
860
|
+
ALB: be,
|
|
861
|
+
ARM: Le,
|
|
862
|
+
AGO: Ie,
|
|
863
|
+
ATA: Oe,
|
|
864
|
+
ARG: Ge,
|
|
865
|
+
ASM: Be,
|
|
866
|
+
AUT: Pe,
|
|
867
|
+
AUS: we,
|
|
868
|
+
ABW: Ue,
|
|
869
|
+
ALA: Fe,
|
|
870
|
+
AZE: De,
|
|
871
|
+
BIH: He,
|
|
872
|
+
BRB: Ke,
|
|
873
|
+
BGD: je,
|
|
874
|
+
BEL: We,
|
|
875
|
+
BFA: xe,
|
|
876
|
+
BGR: Ye,
|
|
877
|
+
BHR: Ze,
|
|
878
|
+
BDI: Ve,
|
|
879
|
+
BEN: Je,
|
|
880
|
+
BLM: ze,
|
|
881
|
+
BMU: qe,
|
|
882
|
+
BRN: Xe,
|
|
883
|
+
BOL: Qe,
|
|
884
|
+
BES: $e,
|
|
885
|
+
BRA: ts,
|
|
886
|
+
BHS: es,
|
|
887
|
+
BTN: ss,
|
|
888
|
+
BVT: ns,
|
|
889
|
+
BWA: os,
|
|
890
|
+
BLR: rs,
|
|
891
|
+
BLZ: as,
|
|
892
|
+
CAN: is,
|
|
893
|
+
CCK: cs,
|
|
894
|
+
COD: ls,
|
|
895
|
+
CAF: us,
|
|
896
|
+
COG: fs,
|
|
897
|
+
CHE: hs,
|
|
898
|
+
CIV: ps,
|
|
899
|
+
COK: ds,
|
|
900
|
+
CHL: ms,
|
|
901
|
+
CMR: vs,
|
|
902
|
+
CHN: As,
|
|
903
|
+
COL: gs,
|
|
904
|
+
CRI: Es,
|
|
905
|
+
CUB: Ts,
|
|
906
|
+
CPV: Ms,
|
|
907
|
+
CUW: ys,
|
|
908
|
+
CXR: Cs,
|
|
909
|
+
CYP: _s,
|
|
910
|
+
CZE: Rs,
|
|
911
|
+
DEU: Ss,
|
|
912
|
+
DJI: Ns,
|
|
913
|
+
DNK: ks,
|
|
914
|
+
DMA: bs,
|
|
915
|
+
DOM: Ls,
|
|
916
|
+
DZA: Is,
|
|
917
|
+
ECU: Os,
|
|
918
|
+
EST: Gs,
|
|
919
|
+
EGY: Bs,
|
|
920
|
+
ESH: Ps,
|
|
921
|
+
ERI: ws,
|
|
922
|
+
ESP: Us,
|
|
923
|
+
ETH: Fs,
|
|
924
|
+
FIN: Ds,
|
|
925
|
+
FJI: Hs,
|
|
926
|
+
FLK: Ks,
|
|
927
|
+
FSM: js,
|
|
928
|
+
FRO: Ws,
|
|
929
|
+
FRA: xs,
|
|
930
|
+
GAB: Ys,
|
|
931
|
+
GBR: Zs,
|
|
932
|
+
GRD: Vs,
|
|
933
|
+
GEO: Js,
|
|
934
|
+
GUF: zs,
|
|
935
|
+
GGY: qs,
|
|
936
|
+
GHA: Xs,
|
|
937
|
+
GIB: Qs,
|
|
938
|
+
GRL: $s,
|
|
939
|
+
GMB: tn,
|
|
940
|
+
GIN: en,
|
|
941
|
+
GLP: sn,
|
|
942
|
+
GNQ: nn,
|
|
943
|
+
GRC: on,
|
|
944
|
+
SGS: rn,
|
|
945
|
+
GTM: an,
|
|
946
|
+
GUM: cn,
|
|
947
|
+
GNB: ln,
|
|
948
|
+
GUY: un,
|
|
949
|
+
HKG: fn,
|
|
950
|
+
HMD: hn,
|
|
951
|
+
HND: pn,
|
|
952
|
+
HRV: dn,
|
|
953
|
+
HTI: mn,
|
|
954
|
+
HUN: vn,
|
|
955
|
+
IDN: An,
|
|
956
|
+
IRL: gn,
|
|
957
|
+
ISR: En,
|
|
958
|
+
IMN: Tn,
|
|
959
|
+
IND: Mn,
|
|
960
|
+
IOT: yn,
|
|
961
|
+
IRQ: Cn,
|
|
962
|
+
IRN: _n,
|
|
963
|
+
ISL: Rn,
|
|
964
|
+
ITA: Sn,
|
|
965
|
+
JEY: Nn,
|
|
966
|
+
JAM: kn,
|
|
967
|
+
JOR: bn,
|
|
968
|
+
JPN: Ln,
|
|
969
|
+
KEN: In,
|
|
970
|
+
KGZ: On,
|
|
971
|
+
KHM: Gn,
|
|
972
|
+
KIR: Bn,
|
|
973
|
+
COM: Pn,
|
|
974
|
+
KNA: wn,
|
|
975
|
+
PRK: Un,
|
|
976
|
+
KOR: Fn,
|
|
977
|
+
KWT: Dn,
|
|
978
|
+
CYM: Hn,
|
|
979
|
+
KAZ: Kn,
|
|
980
|
+
LAO: jn,
|
|
981
|
+
LBN: Wn,
|
|
982
|
+
LCA: xn,
|
|
983
|
+
LIE: Yn,
|
|
984
|
+
LKA: Zn,
|
|
985
|
+
LBR: Vn,
|
|
986
|
+
LSO: Jn,
|
|
987
|
+
LTU: zn,
|
|
988
|
+
LUX: qn,
|
|
989
|
+
LVA: Xn,
|
|
990
|
+
LBY: Qn,
|
|
991
|
+
MAR: $n,
|
|
992
|
+
MCO: to,
|
|
993
|
+
MDA: eo,
|
|
994
|
+
MNE: so,
|
|
995
|
+
MAF: no,
|
|
996
|
+
MDG: oo,
|
|
997
|
+
MHL: ro,
|
|
998
|
+
MKD: ao,
|
|
999
|
+
MLI: io,
|
|
1000
|
+
MMR: co,
|
|
1001
|
+
MNG: lo,
|
|
1002
|
+
MAC: uo,
|
|
1003
|
+
MNP: fo,
|
|
1004
|
+
MTQ: ho,
|
|
1005
|
+
MRT: po,
|
|
1006
|
+
MSR: mo,
|
|
1007
|
+
MLT: vo,
|
|
1008
|
+
MUS: Ao,
|
|
1009
|
+
MDV: go,
|
|
1010
|
+
MWI: Eo,
|
|
1011
|
+
MEX: To,
|
|
1012
|
+
MYS: Mo,
|
|
1013
|
+
MOZ: yo,
|
|
1014
|
+
NAM: Co,
|
|
1015
|
+
NCL: _o,
|
|
1016
|
+
NER: Ro,
|
|
1017
|
+
NFK: So,
|
|
1018
|
+
NGA: No,
|
|
1019
|
+
NIC: ko,
|
|
1020
|
+
NLD: bo,
|
|
1021
|
+
NOR: Lo,
|
|
1022
|
+
NPL: Io,
|
|
1023
|
+
NRU: Oo,
|
|
1024
|
+
NIU: Go,
|
|
1025
|
+
NZL: Bo,
|
|
1026
|
+
OMN: Po,
|
|
1027
|
+
PAN: wo,
|
|
1028
|
+
PER: Uo,
|
|
1029
|
+
PYF: Fo,
|
|
1030
|
+
PNG: Do,
|
|
1031
|
+
PHL: Ho,
|
|
1032
|
+
PAK: Ko,
|
|
1033
|
+
POL: jo,
|
|
1034
|
+
SPM: Wo,
|
|
1035
|
+
PCN: xo,
|
|
1036
|
+
PRI: Yo,
|
|
1037
|
+
PSE: Zo,
|
|
1038
|
+
PRT: Vo,
|
|
1039
|
+
PLW: Jo,
|
|
1040
|
+
PRY: zo,
|
|
1041
|
+
QAT: qo,
|
|
1042
|
+
REU: Xo,
|
|
1043
|
+
ROU: Qo,
|
|
1044
|
+
SRB: $o,
|
|
1045
|
+
RUS: tr,
|
|
1046
|
+
RWA: er,
|
|
1047
|
+
SAU: sr,
|
|
1048
|
+
SLB: nr,
|
|
1049
|
+
SYC: or,
|
|
1050
|
+
SDN: rr,
|
|
1051
|
+
SWE: ar,
|
|
1052
|
+
SGP: ir,
|
|
1053
|
+
SHN: cr,
|
|
1054
|
+
SVN: lr,
|
|
1055
|
+
SJM: ur,
|
|
1056
|
+
SVK: fr,
|
|
1057
|
+
SLE: hr,
|
|
1058
|
+
SMR: pr,
|
|
1059
|
+
SEN: dr,
|
|
1060
|
+
SOM: mr,
|
|
1061
|
+
SUR: vr,
|
|
1062
|
+
SSD: Ar,
|
|
1063
|
+
STP: gr,
|
|
1064
|
+
SLV: Er,
|
|
1065
|
+
SXM: Tr,
|
|
1066
|
+
SYR: Mr,
|
|
1067
|
+
SWZ: yr,
|
|
1068
|
+
TCA: Cr,
|
|
1069
|
+
TCD: _r,
|
|
1070
|
+
ATF: Rr,
|
|
1071
|
+
TGO: Sr,
|
|
1072
|
+
THA: Nr,
|
|
1073
|
+
TJK: kr,
|
|
1074
|
+
TKL: br,
|
|
1075
|
+
TLS: Lr,
|
|
1076
|
+
TKM: Ir,
|
|
1077
|
+
TUN: Or,
|
|
1078
|
+
TON: Gr,
|
|
1079
|
+
TUR: Br,
|
|
1080
|
+
TTO: Pr,
|
|
1081
|
+
TUV: wr,
|
|
1082
|
+
TWN: Ur,
|
|
1083
|
+
TZA: Fr,
|
|
1084
|
+
UKR: Dr,
|
|
1085
|
+
UGA: Hr,
|
|
1086
|
+
UMI: Kr,
|
|
1087
|
+
USA: jr,
|
|
1088
|
+
URY: Wr,
|
|
1089
|
+
UZB: xr,
|
|
1090
|
+
VAT: Yr,
|
|
1091
|
+
VCT: Zr,
|
|
1092
|
+
VEN: Vr,
|
|
1093
|
+
VGB: Jr,
|
|
1094
|
+
VIR: zr,
|
|
1095
|
+
VNM: qr,
|
|
1096
|
+
VUT: Xr,
|
|
1097
|
+
WLF: Qr,
|
|
1098
|
+
WSM: $r,
|
|
1099
|
+
XKX: ta,
|
|
1100
|
+
YEM: ea,
|
|
1101
|
+
MYT: sa,
|
|
1102
|
+
ZAF: na,
|
|
1103
|
+
ZMB: oa,
|
|
1104
|
+
ZWE: ra
|
|
1105
|
+
};
|
|
1106
|
+
function aa(t) {
|
|
1107
|
+
return String.fromCodePoint(t.toLowerCase().charCodeAt(0) + 127365);
|
|
1108
|
+
}
|
|
1109
|
+
function ia(t) {
|
|
1110
|
+
return t.split("-").pop().toUpperCase();
|
|
1111
|
+
}
|
|
1112
|
+
function ca(t) {
|
|
1113
|
+
if (!t)
|
|
1114
|
+
throw new Error("countryCode is required");
|
|
1115
|
+
return Array.from(ia(t)).map(aa).join("");
|
|
1116
|
+
}
|
|
1117
|
+
const la = `<svg viewBox="0 0 600 300" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h600v300h-600z" fill="#00993e"/><g fill="#fff"><path d="m0 42.857h600v42.857h-600z"/><path d="m0 128.571h600v42.857h-600z"/><path d="m0 214.286h600v42.857h-600z"/></g><path d="m0 0h228v128.571h-228z" fill="#c8312a"/><g fill="#fff"><path d="m96.352 71.821s-1.965.823-.619 16.509c1.099 12.911 5.699 17.117 5.699 17.117l2.009 7.992 19.056.078s.345-4.949 1.083-6.514c1.813-3.845 8.999-8.24 12.079-14.876 3.312-4.045 1.653-12.3 8.301-20.268 3.301-3.957-3.867-2.282-3.867-2.282-3.931 2.607-5.852 5.667-6.843 7.805-.667 4.119-3.75 7.563-4.041 4.572 0 0-1.12-5.172-4.481-15.226-.333-2.98-1.774-13.286-2.082-21.152-.219-5.118-4.699-5.426-5.073-.231l-.541 20.595-1.071-23.786c-.455-6.732-5.548-5.734-5.769-.155l-.219 24.767-.928-24.008c-1.38-4.586-5.006-1.868-5.073 3.1l-.618 23.36s-.781-12.793-.957-18.195c-.166-3.249-3.971-3.009-4.33 1.636-.518 6.718-1.333 12.201-1.715 19.162z"/><path d="m108.206 27.97 5.794-17.832 5.794 17.832-15.169-11.02h18.749z"/><path d="m153.263 35.084-15.169-11.021h18.749l-15.169 11.021 5.794-17.832z"/><path d="m181.896 56.272-15.169-11.021h18.749l-15.169 11.021 5.794-17.832z"/><path d="m198.484 86.198-15.169-11.021h18.749l-15.168 11.021 5.794-17.832z"/><path d="m74.738 35.084 15.169-11.021h-18.75l15.169 11.021-5.794-17.832z"/><path d="m46.104 56.272 15.169-11.021h-18.749l15.169 11.021-5.795-17.832z"/><path d="m29.516 86.198 15.169-11.021h-18.75l15.169 11.021-5.794-17.832z"/></g></svg>
|
|
1118
|
+
`, ua = { ABH: la }, Ta = (t) => {
|
|
1119
|
+
const e = t;
|
|
1120
|
+
return vt[e] ? ca(vt[e]) : ua[e] ?? "";
|
|
1121
|
+
};
|
|
1122
|
+
export {
|
|
1123
|
+
Ea as A,
|
|
1124
|
+
Rt as O,
|
|
1125
|
+
va as V,
|
|
1126
|
+
V as a,
|
|
1127
|
+
Aa as b,
|
|
1128
|
+
Ta as c,
|
|
1129
|
+
ye as d,
|
|
1130
|
+
da as e,
|
|
1131
|
+
ma as f,
|
|
1132
|
+
mt as g,
|
|
1133
|
+
Ce as h,
|
|
1134
|
+
pa as i,
|
|
1135
|
+
ga as p
|
|
1136
|
+
};
|