@everymatrix/cashier-page 1.54.11 → 1.54.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,707 @@
1
+ import { S as Ee, b as xe, s as Te, f as C, c as Ae, n as ie, e as z, l as D, p as _, w as Pe, v as Ne, Q as ze, H as De, E as v, o as y, K as le, L as He, m as d, q as w, x, y as T, z as Fe, r as We, B as oe, J as Q, A as ee, D as Oe } from "./CashierConfirmModal-Bop0eOiK.js";
2
+ import { a as Ue, i as je, $ as Re, b as Be } from "./CashierError-D3O2fglb.js";
3
+ import { d as re, u as Ie } from "./CashierMethodDetails-WRu0moNB.js";
4
+ function ae(t, e) {
5
+ Ue(t, e);
6
+ }
7
+ function Ge(t) {
8
+ je({
9
+ fallbackLocale: "en"
10
+ }), Re.set(t);
11
+ }
12
+ const me = {
13
+ en: {
14
+ generalMin: "Min",
15
+ generalMax: "Max",
16
+ showAll: "SHOW ALL",
17
+ showLess: "SHOW LESS",
18
+ error: "Error",
19
+ noPaymentMethods: "No payment methods available"
20
+ },
21
+ uk: {
22
+ generalMin: "Мін",
23
+ generalMax: "Макс"
24
+ },
25
+ hr: {
26
+ generalMin: "Minimalno",
27
+ generalMax: "Maksimalno",
28
+ showAll: "Prikaži sve",
29
+ showLess: "Prikaži manje"
30
+ },
31
+ tr: {
32
+ generalMin: "Min",
33
+ generalMax: "Maks",
34
+ showAll: "HEPSİNİ GÖSTER",
35
+ showLess: "DAHA AZ GÖSTER",
36
+ error: "Hata",
37
+ noPaymentMethods: "Hiçbir ödeme yöntemi mevcut değil"
38
+ },
39
+ "en-us": {
40
+ generalMin: "Min",
41
+ generalMax: "Max",
42
+ showAll: "SHOW ALL",
43
+ showLess: "SHOW LESS"
44
+ }
45
+ };
46
+ function Ve(t) {
47
+ Ae(t, "svelte-1wlv0rl", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.CashierMethodList{display:flex;flex-direction:column;background:var(--emw--color-background, #fff);box-shadow:0 0 4px var(--mmw--color-black-transparency-10, rgba(0, 0, 0, 0.1));width:100%;border-radius:var(--mmw--border-radius-medium-plus, 6px);container-name:method-list;container-type:inline-size}.SelectorWrapper{display:flex;flex-direction:row;align-items:center;justify-content:left;cursor:pointer;position:relative;height:var(--mmw-method-height, 80px);box-sizing:border-box;border-bottom:1px solid var(--mmw--color-grey-105, #E8E9EB);padding:0 var(--emw--spacing-small, 12px)}.SelectorWrapper:first-child{border-radius:var(--mmw--border-radius-medium-plus, 6px) var(--mmw--border-radius-medium-plus, 6px) 0 0}.SelectorWrapper:last-child{border-radius:0 0 var(--mmw--border-radius-medium-plus, 6px) var(--mmw--border-radius-medium-plus, 6px)}.SelectorWrapper.checked{background:var(--emw--color-background-secondary, #F9F8F8)}.SelectorWrapper:not(.checked):hover{background:linear-gradient(0, var(--emw--color-background-secondary, #F9F8F8) 0%, var(--emw--color-background, #fff) 100%)}.MethodLogo{display:flex;justify-content:center;align-items:center;margin-right:var(--mmw--spacing-small, 14px);width:var(--mmw-logo-width, 110px);min-height:var(--mmw-logo-height, 64px);background:var(--emw--color-background, #FFF);border:1px solid var(--mmw--color-grey-105, #E8E9EB);border-radius:var(--mmw--border-radius-medium-plus, 6px);overflow:hidden;max-height:calc(100% - var(--emw--spacing-small, 12px) - var(--emw--spacing-small, 12px))}.MethodLogo img{width:100%;height:100%}.MethodTitle{color:var(--mmw--color-grey-10, #111);font-size:var(--emw--font-size-medium, 16px);word-break:break-all}.MethodLimits{display:flex;flex-direction:column;align-items:flex-end;margin-left:auto}.Limits{max-width:100%;white-space:nowrap;font-size:var(--emw--font-size-small, 14px);line-height:var(--emw--line-height-xl, 24px);color:var(--mmw--color-grey-290, #666);font-weight:var(--emw--font-weight-normal, 400);font-style:normal}.EmptyContentMessageWrapper{display:flex;flex-direction:column;box-sizing:border-box;background:var(--emw--color-gray-50, #F7F8FA);border-bottom:1px solid var(--mmw--color-grey-105, #E8E9EB);padding:var(--emw--spacing-small, 12px);max-height:500px}.EmptyContentMessageHeader{display:flex;gap:4px;align-items:end}.EmptyContentMessageTitle{font-size:var(--emw--font-size-small, 16px);font-weight:var(--emw--font-weight-semibold, 500);color:var(--emw--color-warning, rgb(250, 146, 0))}.EmptyContentMessageText{word-break:break-word;padding:var(--emw--spacing-small, 12px) calc(var(--emw--spacing-small, 12px) / 2);font-size:var(--emw--font-size-small, 14px)}.EmptyContentMessageDesktop p{font-size:var(--emw--font-size-medium, 16px)}.IconWarning{width:30px;display:flex}.IconWarning svg{height:18px;fill:var(--emw--color-warning, rgb(250, 146, 0))}.ShowAllButton{cursor:pointer;color:var(--mmw--color-grey-290, #666);text-align:center;font-size:var(--emw--font-size-x-small, 12px);font-style:normal;font-weight:var(--emw--font-weight-semibold, 500);font-family:inherit;background:var(--emw--color-gray-50, #F7F8FA);line-height:normal;border:1px solid var(--mmw--color-grey-105, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);margin:var(--emw--spacing-small, 12px) auto;height:36px;display:flex;align-items:center;justify-content:center;width:80%}.ShowAllButton:hover{background:var(--emw--color-background, #fff)}@container method-list (width < 450px){.MethodLogo{min-width:var(--mmw-logo-small-width, 90px);min-height:var(--mmw-logo--small-height, 50px);overflow:hidden}.CashierMethodList .MethodTitle{display:inline-block;flex-grow:1;font-size:var(--emw--font-size-medium, 16px);line-height:120%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.CashierMethodList .MethodLimits .Limits{flex-shrink:0;font-size:var(--emw--font-size-x-small, 12px)}}@container method-list (max-width: 300px){.Limits{display:none}}");
48
+ }
49
+ function ce(t, e, s) {
50
+ const r = t.slice();
51
+ return r[48] = e[s], r[50] = s, r;
52
+ }
53
+ function de(t) {
54
+ let e;
55
+ return {
56
+ c() {
57
+ e = y("cashier-spinner"), v(
58
+ e,
59
+ "clientstylingurl",
60
+ /*clientstylingurl*/
61
+ t[4]
62
+ ), v(
63
+ e,
64
+ "clientstyling",
65
+ /*clientstyling*/
66
+ t[3]
67
+ );
68
+ },
69
+ m(s, r) {
70
+ D(s, e, r);
71
+ },
72
+ p(s, r) {
73
+ r[0] & /*clientstylingurl*/
74
+ 16 && v(
75
+ e,
76
+ "clientstylingurl",
77
+ /*clientstylingurl*/
78
+ s[4]
79
+ ), r[0] & /*clientstyling*/
80
+ 8 && v(
81
+ e,
82
+ "clientstyling",
83
+ /*clientstyling*/
84
+ s[3]
85
+ );
86
+ },
87
+ d(s) {
88
+ s && z(e);
89
+ }
90
+ };
91
+ }
92
+ function ue(t) {
93
+ let e, s, r, a, l = le(
94
+ /*paymentMethodsToShow*/
95
+ t[8]
96
+ ), o = [];
97
+ for (let c = 0; c < l.length; c += 1)
98
+ o[c] = he(ce(t, l, c));
99
+ let i = (
100
+ /*noPaymentMethodsAvailable*/
101
+ t[13] && !/*showSpinner*/
102
+ t[12] && ge(t)
103
+ ), m = (
104
+ /*methodsButtonToggleText*/
105
+ t[7] && fe(t)
106
+ );
107
+ return {
108
+ c() {
109
+ e = y("div"), s = y("div");
110
+ for (let c = 0; c < o.length; c += 1)
111
+ o[c].c();
112
+ r = _(), i && i.c(), a = _(), m && m.c(), w(s, "class", "CashierMethodList"), w(e, "class", "CashierMethodListWidget");
113
+ },
114
+ m(c, f) {
115
+ D(c, e, f), d(e, s);
116
+ for (let u = 0; u < o.length; u += 1)
117
+ o[u] && o[u].m(s, null);
118
+ d(s, r), i && i.m(s, null), d(e, a), m && m.m(e, null), t[27](e);
119
+ },
120
+ p(c, f) {
121
+ if (f[0] & /*selectedPaymentMethod, paymentMethodsToShow, selectPayMeth, formatter, $_*/
122
+ 115008) {
123
+ l = le(
124
+ /*paymentMethodsToShow*/
125
+ c[8]
126
+ );
127
+ let u;
128
+ for (u = 0; u < l.length; u += 1) {
129
+ const g = ce(c, l, u);
130
+ o[u] ? o[u].p(g, f) : (o[u] = he(g), o[u].c(), o[u].m(s, r));
131
+ }
132
+ for (; u < o.length; u += 1)
133
+ o[u].d(1);
134
+ o.length = l.length;
135
+ }
136
+ /*noPaymentMethodsAvailable*/
137
+ c[13] && !/*showSpinner*/
138
+ c[12] ? i ? i.p(c, f) : (i = ge(c), i.c(), i.m(s, null)) : i && (i.d(1), i = null), /*methodsButtonToggleText*/
139
+ c[7] ? m ? m.p(c, f) : (m = fe(c), m.c(), m.m(e, null)) : m && (m.d(1), m = null);
140
+ },
141
+ d(c) {
142
+ c && z(e), He(o, c), i && i.d(), m && m.d(), t[27](null);
143
+ }
144
+ };
145
+ }
146
+ function he(t) {
147
+ let e, s, r, a, l, o, i, m, c = (
148
+ /*payMeth*/
149
+ (t[48].Label || /*payMeth*/
150
+ t[48].Name) + ""
151
+ ), f, u, g, p, P = (
152
+ /*$_*/
153
+ t[14]("generalMin") + ""
154
+ ), H, k, S = (
155
+ /*formatter*/
156
+ t[15].format(
157
+ /*payMeth*/
158
+ t[48].DisplayCurrency.MinAmountLimit
159
+ ) + ""
160
+ ), N, F, L = (
161
+ /*payMeth*/
162
+ t[48].DisplayCurrency.Name + ""
163
+ ), W, J, E, O = (
164
+ /*$_*/
165
+ t[14]("generalMax") + ""
166
+ ), U, I, j = (
167
+ /*formatter*/
168
+ t[15].format(
169
+ /*payMeth*/
170
+ t[48].DisplayCurrency.MaxAmountLimit
171
+ ) + ""
172
+ ), R, Y, G = (
173
+ /*payMeth*/
174
+ t[48].DisplayCurrency.Name + ""
175
+ ), V, q, X;
176
+ function K() {
177
+ return (
178
+ /*click_handler*/
179
+ t[25](
180
+ /*payMeth*/
181
+ t[48]
182
+ )
183
+ );
184
+ }
185
+ return {
186
+ c() {
187
+ e = y("div"), s = y("div"), r = y("img"), o = _(), i = y("div"), m = y("span"), f = T(c), u = _(), g = y("div"), p = y("span"), H = T(P), k = _(), N = T(S), F = _(), W = T(L), J = _(), E = y("span"), U = T(O), I = _(), R = T(j), Y = _(), V = T(G), oe(r.src, a = /*payMeth*/
188
+ t[48].LogoUrl) || w(r, "src", a), w(r, "alt", l = /*payMeth*/
189
+ t[48].Label), w(s, "class", "MethodLogo"), w(i, "class", "MethodTitle"), w(p, "class", "Limits"), w(E, "class", "Limits"), w(g, "class", "MethodLimits"), w(e, "class", "SelectorWrapper"), Q(
190
+ e,
191
+ "checked",
192
+ /*selectedPaymentMethod*/
193
+ t[6] === /*payMeth*/
194
+ t[48].Name
195
+ );
196
+ },
197
+ m(B, M) {
198
+ D(B, e, M), d(e, s), d(s, r), d(e, o), d(e, i), d(i, m), d(m, f), d(e, u), d(e, g), d(g, p), d(p, H), d(p, k), d(p, N), d(p, F), d(p, W), d(g, J), d(g, E), d(E, U), d(E, I), d(E, R), d(E, Y), d(E, V), q || (X = [
199
+ ee(e, "click", K),
200
+ ee(e, "keyup", Je)
201
+ ], q = !0);
202
+ },
203
+ p(B, M) {
204
+ t = B, M[0] & /*paymentMethodsToShow*/
205
+ 256 && !oe(r.src, a = /*payMeth*/
206
+ t[48].LogoUrl) && w(r, "src", a), M[0] & /*paymentMethodsToShow*/
207
+ 256 && l !== (l = /*payMeth*/
208
+ t[48].Label) && w(r, "alt", l), M[0] & /*paymentMethodsToShow*/
209
+ 256 && c !== (c = /*payMeth*/
210
+ (t[48].Label || /*payMeth*/
211
+ t[48].Name) + "") && x(f, c), M[0] & /*$_*/
212
+ 16384 && P !== (P = /*$_*/
213
+ t[14]("generalMin") + "") && x(H, P), M[0] & /*paymentMethodsToShow*/
214
+ 256 && S !== (S = /*formatter*/
215
+ t[15].format(
216
+ /*payMeth*/
217
+ t[48].DisplayCurrency.MinAmountLimit
218
+ ) + "") && x(N, S), M[0] & /*paymentMethodsToShow*/
219
+ 256 && L !== (L = /*payMeth*/
220
+ t[48].DisplayCurrency.Name + "") && x(W, L), M[0] & /*$_*/
221
+ 16384 && O !== (O = /*$_*/
222
+ t[14]("generalMax") + "") && x(U, O), M[0] & /*paymentMethodsToShow*/
223
+ 256 && j !== (j = /*formatter*/
224
+ t[15].format(
225
+ /*payMeth*/
226
+ t[48].DisplayCurrency.MaxAmountLimit
227
+ ) + "") && x(R, j), M[0] & /*paymentMethodsToShow*/
228
+ 256 && G !== (G = /*payMeth*/
229
+ t[48].DisplayCurrency.Name + "") && x(V, G), M[0] & /*selectedPaymentMethod, paymentMethodsToShow*/
230
+ 320 && Q(
231
+ e,
232
+ "checked",
233
+ /*selectedPaymentMethod*/
234
+ t[6] === /*payMeth*/
235
+ t[48].Name
236
+ );
237
+ },
238
+ d(B) {
239
+ B && z(e), q = !1, We(X);
240
+ }
241
+ };
242
+ }
243
+ function ge(t) {
244
+ let e, s, r, a, l, o = (
245
+ /*$_*/
246
+ t[14]("error") + ""
247
+ ), i, m, c, f = (
248
+ /*$_*/
249
+ t[14]("noPaymentMethods") + ""
250
+ ), u;
251
+ return {
252
+ c() {
253
+ e = y("div"), s = y("div"), r = y("div"), r.innerHTML = '<svg fill="currentColor" height="200px" width="200px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 294.995 294.995" xml:space="preserve" stroke="#fa9200"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><g><path d="M291.874,248.279L165.605,26.526c-4.007-7.037-10.776-11.26-18.107-11.26s-14.101,4.202-18.107,11.239L3.121,248.238 c-3.979,6.989-4.164,15.013-0.493,21.326c3.67,6.313,10.663,10.165,18.705,10.165h252.329c8.042,0,15.035-3.852,18.705-10.165 C296.038,263.251,295.854,255.268,291.874,248.279z M146.665,86.229c9.665,0,17.5,7.835,17.5,17.5v63c0,9.665-7.835,17.5-17.5,17.5 c-9.665,0-17.5-7.835-17.5-17.5v-63C129.165,94.064,137,86.229,146.665,86.229z M147.498,204.005c9.665,0,17.5,7.835,17.5,17.5 c0,9.665-7.835,17.5-17.5,17.5c-9.665,0-17.5-7.835-17.5-17.5C129.998,211.84,137.833,204.005,147.498,204.005z"></path></g></g></svg>', a = _(), l = y("p"), i = T(o), m = _(), c = y("p"), u = T(f), w(r, "class", "IconWarning"), w(l, "class", "EmptyContentMessageTitle"), w(s, "class", "EmptyContentMessageHeader"), w(c, "class", "EmptyContentMessageText"), w(e, "class", "EmptyContentMessageWrapper"), Q(
254
+ e,
255
+ "EmptyContentMessageDesktop",
256
+ /*desktopView*/
257
+ t[11]
258
+ );
259
+ },
260
+ m(g, p) {
261
+ D(g, e, p), d(e, s), d(s, r), d(s, a), d(s, l), d(l, i), d(e, m), d(e, c), d(c, u);
262
+ },
263
+ p(g, p) {
264
+ p[0] & /*$_*/
265
+ 16384 && o !== (o = /*$_*/
266
+ g[14]("error") + "") && x(i, o), p[0] & /*$_*/
267
+ 16384 && f !== (f = /*$_*/
268
+ g[14]("noPaymentMethods") + "") && x(u, f), p[0] & /*desktopView*/
269
+ 2048 && Q(
270
+ e,
271
+ "EmptyContentMessageDesktop",
272
+ /*desktopView*/
273
+ g[11]
274
+ );
275
+ },
276
+ d(g) {
277
+ g && z(e);
278
+ }
279
+ };
280
+ }
281
+ function fe(t) {
282
+ let e, s, r, a;
283
+ return {
284
+ c() {
285
+ e = y("div"), s = T(
286
+ /*methodsButtonToggleText*/
287
+ t[7]
288
+ ), w(e, "class", "ShowAllButton");
289
+ },
290
+ m(l, o) {
291
+ D(l, e, o), d(e, s), r || (a = ee(
292
+ e,
293
+ "click",
294
+ /*click_handler_1*/
295
+ t[26]
296
+ ), r = !0);
297
+ },
298
+ p(l, o) {
299
+ o[0] & /*methodsButtonToggleText*/
300
+ 128 && x(
301
+ s,
302
+ /*methodsButtonToggleText*/
303
+ l[7]
304
+ );
305
+ },
306
+ d(l) {
307
+ l && z(e), r = !1, a();
308
+ }
309
+ };
310
+ }
311
+ function pe(t) {
312
+ let e, s, r;
313
+ return {
314
+ c() {
315
+ e = y("cashier-error"), s = y("span"), r = T(
316
+ /*errorMessage*/
317
+ t[10]
318
+ ), w(s, "slot", "text"), v(
319
+ e,
320
+ "lang",
321
+ /*lang*/
322
+ t[0]
323
+ ), v(
324
+ e,
325
+ "assetsurl",
326
+ /*assetsurl*/
327
+ t[1]
328
+ ), v(
329
+ e,
330
+ "translationurl",
331
+ /*translationurl*/
332
+ t[2]
333
+ ), v(
334
+ e,
335
+ "clientstylingurl",
336
+ /*clientstylingurl*/
337
+ t[4]
338
+ ), v(
339
+ e,
340
+ "clientstyling",
341
+ /*clientstyling*/
342
+ t[3]
343
+ ), v(e, "hidebuttons", "true");
344
+ },
345
+ m(a, l) {
346
+ D(a, e, l), d(e, s), d(s, r);
347
+ },
348
+ p(a, l) {
349
+ l[0] & /*errorMessage*/
350
+ 1024 && x(
351
+ r,
352
+ /*errorMessage*/
353
+ a[10]
354
+ ), l[0] & /*lang*/
355
+ 1 && v(
356
+ e,
357
+ "lang",
358
+ /*lang*/
359
+ a[0]
360
+ ), l[0] & /*assetsurl*/
361
+ 2 && v(
362
+ e,
363
+ "assetsurl",
364
+ /*assetsurl*/
365
+ a[1]
366
+ ), l[0] & /*translationurl*/
367
+ 4 && v(
368
+ e,
369
+ "translationurl",
370
+ /*translationurl*/
371
+ a[2]
372
+ ), l[0] & /*clientstylingurl*/
373
+ 16 && v(
374
+ e,
375
+ "clientstylingurl",
376
+ /*clientstylingurl*/
377
+ a[4]
378
+ ), l[0] & /*clientstyling*/
379
+ 8 && v(
380
+ e,
381
+ "clientstyling",
382
+ /*clientstyling*/
383
+ a[3]
384
+ );
385
+ },
386
+ d(a) {
387
+ a && z(e);
388
+ }
389
+ };
390
+ }
391
+ function qe(t) {
392
+ let e, s, r, a = (
393
+ /*showSpinner*/
394
+ t[12] && de(t)
395
+ ), l = (
396
+ /*showMethodsList*/
397
+ (t[9] || /*desktopView*/
398
+ t[11]) && ue(t)
399
+ ), o = (
400
+ /*errorMessage*/
401
+ t[10] && pe(t)
402
+ );
403
+ return {
404
+ c() {
405
+ a && a.c(), e = _(), l && l.c(), s = _(), o && o.c(), r = Pe();
406
+ },
407
+ m(i, m) {
408
+ a && a.m(i, m), D(i, e, m), l && l.m(i, m), D(i, s, m), o && o.m(i, m), D(i, r, m);
409
+ },
410
+ p(i, m) {
411
+ /*showSpinner*/
412
+ i[12] ? a ? a.p(i, m) : (a = de(i), a.c(), a.m(e.parentNode, e)) : a && (a.d(1), a = null), /*showMethodsList*/
413
+ i[9] || /*desktopView*/
414
+ i[11] ? l ? l.p(i, m) : (l = ue(i), l.c(), l.m(s.parentNode, s)) : l && (l.d(1), l = null), /*errorMessage*/
415
+ i[10] ? o ? o.p(i, m) : (o = pe(i), o.c(), o.m(r.parentNode, r)) : o && (o.d(1), o = null);
416
+ },
417
+ i: ie,
418
+ o: ie,
419
+ d(i) {
420
+ i && (z(e), z(s), z(r)), a && a.d(i), l && l.d(i), o && o.d(i);
421
+ }
422
+ };
423
+ }
424
+ const Je = () => {
425
+ };
426
+ function Ye(t, e, s) {
427
+ let r;
428
+ Ne(t, Be, (n) => s(14, r = n)), re.extend(Ie);
429
+ let { lang: a = "en" } = e, { local: l = "en-US" } = e, { endpoint: o } = e, { session: i } = e, { customerid: m } = e, { assetsurl: c } = e, { currency: f } = e, { numberofmethodsshown: u } = e, { translationurl: g = "" } = e, { clientstyling: p = "" } = e, { clientstylingurl: P = "" } = e, { ismobileview: H } = e, k = [], S, N, F = "", L = [], W = !0, J = new Intl.NumberFormat(l, { minimumFractionDigits: 2 }), E = "", O, U = !0, I = !1, j = !1;
430
+ var R;
431
+ (function(n) {
432
+ n.PlayerSessionIsNotValid = "PlayerSessionIsNotValid", n.Success = "Success", n.JwtTokenError = "JwtTokenError";
433
+ })(R || (R = {})), ze();
434
+ const Y = () => {
435
+ let n = g;
436
+ if (n)
437
+ return fetch(n).then((h) => h.json()).then((h) => {
438
+ Object.keys(h).forEach((A) => {
439
+ ae(A, h[A]);
440
+ });
441
+ }).catch((h) => {
442
+ console.log(h);
443
+ });
444
+ };
445
+ Object.keys(me).forEach((n) => {
446
+ ae(n, me[n]);
447
+ });
448
+ const G = () => {
449
+ Ge(a);
450
+ }, V = () => {
451
+ s(12, I = !0);
452
+ const n = new URL(`${o}/v1/player/${m}/payment/GetPaymentMetadata`), h = new Headers();
453
+ h.append("accept", "application/json"), h.append("Content-Type", "application/json"), h.append("X-Client-Request-Timestamp", re.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
454
+ const A = {
455
+ method: "POST",
456
+ headers: h,
457
+ body: JSON.stringify({
458
+ XPaymentSessionToken: i,
459
+ Currency: f,
460
+ Tags: { UserAgent: window.navigator.userAgent }
461
+ })
462
+ };
463
+ fetch(n, A).then((b) => b.json()).then((b) => {
464
+ if (b.error) {
465
+ s(10, E = b.error);
466
+ return;
467
+ }
468
+ if (b.ResponseCode !== R.Success) {
469
+ O = b.ResponseCode, B();
470
+ return;
471
+ }
472
+ k = b.PaymentMethods?.Ordering ? q(b) : X(b), s(7, F = u && +u > 0 && k.length > +u ? r("showAll") : ""), s(8, L = F ? k.slice(0, +u) : k), window.postMessage(
473
+ {
474
+ type: "StartSessionCountdown",
475
+ paymentMethodName: k[0].Name,
476
+ xPaymentSessionToken: b.XPaymentSessionToken
477
+ },
478
+ window.location.href
479
+ );
480
+ }).finally(() => {
481
+ s(12, I = !1), s(13, j = !L.length);
482
+ });
483
+ }, q = (n) => {
484
+ const h = [];
485
+ return n.PaymentMethods.Ordering.DefaultPaymentMethodsOrder.forEach((A) => {
486
+ const b = n.PaymentMethods.PaymentMethods.find((Z) => Z.Name === A);
487
+ if (b) {
488
+ const Z = b?.Logos.find(($) => $.LogoType === "Desktop") || {}, Ce = b?.Logos.find(($) => $.LogoType === "Mobile") || {}, ne = U ? Z : Ce;
489
+ h.push({
490
+ ...b,
491
+ LogoUrl: ne.LogoUrl ? `https:${ne.LogoUrl}` : ""
492
+ });
493
+ }
494
+ }), h;
495
+ }, X = (n) => n.PaymentMethods.PaymentMethods.map((h) => ({
496
+ ...h,
497
+ LogoUrl: h.Logos && h.Logos.length && h.Logos[0].LogoUrl ? `https:${h.Logos[0].LogoUrl}` : ""
498
+ })), K = (n) => {
499
+ s(6, N = n.Name), window.postMessage({ type: "SelectPayMeth", details: n }, window.location.href), dispatchEvent(new CustomEvent(
500
+ "selectPayMeth",
501
+ {
502
+ detail: n,
503
+ bubbles: !0,
504
+ cancelable: !0,
505
+ composed: !0
506
+ }
507
+ ));
508
+ }, B = () => {
509
+ window.postMessage(
510
+ {
511
+ type: "ErrorResponseCode",
512
+ errorResponseCode: O
513
+ },
514
+ window.location.href
515
+ );
516
+ }, M = () => {
517
+ s(11, U = H === "false");
518
+ }, te = () => {
519
+ L == k ? ye() : we();
520
+ }, we = () => {
521
+ s(8, L = k), s(7, F = r("showLess"));
522
+ }, ye = () => {
523
+ s(8, L = k.slice(0, +u)), N && !L.find((n) => n.Name === N) && L.splice(0, 0, k.find((n) => n.Name === N)), s(7, F = r("showAll"));
524
+ }, be = () => {
525
+ s(9, W = !0);
526
+ }, ve = (n) => {
527
+ s(9, W = !n.hideMethodsList);
528
+ }, Me = () => {
529
+ let n = document.createElement("style");
530
+ n.innerHTML = p, S.appendChild(n);
531
+ }, Le = () => {
532
+ let n = new URL(P), h = document.createElement("style");
533
+ fetch(n.href).then((A) => A.text()).then((A) => {
534
+ h.innerHTML = A, setTimeout(
535
+ () => {
536
+ S.appendChild(h);
537
+ },
538
+ 1
539
+ ), setTimeout(
540
+ () => {
541
+ },
542
+ 500
543
+ );
544
+ });
545
+ };
546
+ De(() => (window.addEventListener("message", se, !1), () => {
547
+ window.removeEventListener("message", se, !1);
548
+ }));
549
+ const se = (n) => {
550
+ switch (n.data.type) {
551
+ case "BackToMethodList":
552
+ be();
553
+ break;
554
+ case "HideMethodsList":
555
+ ve(n.data.details);
556
+ break;
557
+ }
558
+ }, _e = (n) => K(n), ke = () => te();
559
+ function Se(n) {
560
+ Fe[n ? "unshift" : "push"](() => {
561
+ S = n, s(5, S);
562
+ });
563
+ }
564
+ return t.$$set = (n) => {
565
+ "lang" in n && s(0, a = n.lang), "local" in n && s(18, l = n.local), "endpoint" in n && s(19, o = n.endpoint), "session" in n && s(20, i = n.session), "customerid" in n && s(21, m = n.customerid), "assetsurl" in n && s(1, c = n.assetsurl), "currency" in n && s(22, f = n.currency), "numberofmethodsshown" in n && s(23, u = n.numberofmethodsshown), "translationurl" in n && s(2, g = n.translationurl), "clientstyling" in n && s(3, p = n.clientstyling), "clientstylingurl" in n && s(4, P = n.clientstylingurl), "ismobileview" in n && s(24, H = n.ismobileview);
566
+ }, t.$$.update = () => {
567
+ t.$$.dirty[0] & /*endpoint, session, customerid*/
568
+ 3670016 && o && i && m && V(), t.$$.dirty[0] & /*lang*/
569
+ 1 && a && G(), t.$$.dirty[0] & /*clientstyling, customStylingContainer*/
570
+ 40 && p && S && Me(), t.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
571
+ 48 && P && S && Le(), t.$$.dirty[0] & /*ismobileview*/
572
+ 16777216 && H && M(), t.$$.dirty[0] & /*lang, translationurl*/
573
+ 5 && a && g && Y();
574
+ }, [
575
+ a,
576
+ c,
577
+ g,
578
+ p,
579
+ P,
580
+ S,
581
+ N,
582
+ F,
583
+ L,
584
+ W,
585
+ E,
586
+ U,
587
+ I,
588
+ j,
589
+ r,
590
+ J,
591
+ K,
592
+ te,
593
+ l,
594
+ o,
595
+ i,
596
+ m,
597
+ f,
598
+ u,
599
+ H,
600
+ _e,
601
+ ke,
602
+ Se
603
+ ];
604
+ }
605
+ class Xe extends Ee {
606
+ constructor(e) {
607
+ super(), xe(
608
+ this,
609
+ e,
610
+ Ye,
611
+ qe,
612
+ Te,
613
+ {
614
+ lang: 0,
615
+ local: 18,
616
+ endpoint: 19,
617
+ session: 20,
618
+ customerid: 21,
619
+ assetsurl: 1,
620
+ currency: 22,
621
+ numberofmethodsshown: 23,
622
+ translationurl: 2,
623
+ clientstyling: 3,
624
+ clientstylingurl: 4,
625
+ ismobileview: 24
626
+ },
627
+ Ve,
628
+ [-1, -1]
629
+ );
630
+ }
631
+ get lang() {
632
+ return this.$$.ctx[0];
633
+ }
634
+ set lang(e) {
635
+ this.$$set({ lang: e }), C();
636
+ }
637
+ get local() {
638
+ return this.$$.ctx[18];
639
+ }
640
+ set local(e) {
641
+ this.$$set({ local: e }), C();
642
+ }
643
+ get endpoint() {
644
+ return this.$$.ctx[19];
645
+ }
646
+ set endpoint(e) {
647
+ this.$$set({ endpoint: e }), C();
648
+ }
649
+ get session() {
650
+ return this.$$.ctx[20];
651
+ }
652
+ set session(e) {
653
+ this.$$set({ session: e }), C();
654
+ }
655
+ get customerid() {
656
+ return this.$$.ctx[21];
657
+ }
658
+ set customerid(e) {
659
+ this.$$set({ customerid: e }), C();
660
+ }
661
+ get assetsurl() {
662
+ return this.$$.ctx[1];
663
+ }
664
+ set assetsurl(e) {
665
+ this.$$set({ assetsurl: e }), C();
666
+ }
667
+ get currency() {
668
+ return this.$$.ctx[22];
669
+ }
670
+ set currency(e) {
671
+ this.$$set({ currency: e }), C();
672
+ }
673
+ get numberofmethodsshown() {
674
+ return this.$$.ctx[23];
675
+ }
676
+ set numberofmethodsshown(e) {
677
+ this.$$set({ numberofmethodsshown: e }), C();
678
+ }
679
+ get translationurl() {
680
+ return this.$$.ctx[2];
681
+ }
682
+ set translationurl(e) {
683
+ this.$$set({ translationurl: e }), C();
684
+ }
685
+ get clientstyling() {
686
+ return this.$$.ctx[3];
687
+ }
688
+ set clientstyling(e) {
689
+ this.$$set({ clientstyling: e }), C();
690
+ }
691
+ get clientstylingurl() {
692
+ return this.$$.ctx[4];
693
+ }
694
+ set clientstylingurl(e) {
695
+ this.$$set({ clientstylingurl: e }), C();
696
+ }
697
+ get ismobileview() {
698
+ return this.$$.ctx[24];
699
+ }
700
+ set ismobileview(e) {
701
+ this.$$set({ ismobileview: e }), C();
702
+ }
703
+ }
704
+ Oe(Xe, { lang: {}, local: {}, endpoint: {}, session: {}, customerid: {}, assetsurl: {}, currency: {}, numberofmethodsshown: {}, translationurl: {}, clientstyling: {}, clientstylingurl: {}, ismobileview: {} }, [], [], !0);
705
+ export {
706
+ Xe as default
707
+ };