@everymatrix/pam-account-balance-modal 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pam-account-balance-modal-81ade12d.js → pam-account-balance-modal-8f1e0d8b.js} +90 -65
- package/dist/cjs/pam-account-balance-modal.cjs.js +1 -1
- package/dist/cjs/pam-account-balance-modal_2.cjs.entry.js +1 -1
- package/dist/collection/components/pam-account-balance-modal/pam-account-balance-modal.js +158 -65
- package/dist/collection/utils/locale.utils.js +1 -18
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pam-account-balance-modal-8ebcc863.js → pam-account-balance-modal-d4c15371.js} +90 -65
- package/dist/esm/pam-account-balance-modal.js +1 -1
- package/dist/esm/pam-account-balance-modal_2.entry.js +1 -1
- package/dist/pam-account-balance-modal/index.esm.js +1 -1
- package/dist/pam-account-balance-modal/p-7eb9a9a8.js +7 -0
- package/dist/pam-account-balance-modal/{p-409d26c0.entry.js → p-80fbb82a.entry.js} +1 -1
- package/dist/pam-account-balance-modal/pam-account-balance-modal.esm.js +1 -1
- package/dist/types/components/pam-account-balance-modal/pam-account-balance-modal.d.ts +25 -7
- package/dist/types/components.d.ts +16 -8
- package/package.json +1 -1
- package/dist/pam-account-balance-modal/p-b60c42bd.js +0 -7
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/packages/stencil/pam-account-balance-modal/stencil.config.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/packages/stencil/pam-account-balance-modal/stencil.config.dev.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/packages/stencil/pam-account-balance-modal/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/packages/stencil/pam-account-balance-modal/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/pam-account-balance-modal/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
package/dist/esm/{pam-account-balance-modal-8ebcc863.js → pam-account-balance-modal-d4c15371.js}
RENAMED
@@ -1105,26 +1105,6 @@ var eventsource = {exports: {}};
|
|
1105
1105
|
}(typeof globalThis === 'undefined' ? (typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : commonjsGlobal) : globalThis));
|
1106
1106
|
}(eventsource, eventsource.exports));
|
1107
1107
|
|
1108
|
-
var currency_min$1 = {exports: {}};
|
1109
|
-
|
1110
|
-
/*
|
1111
|
-
currency.js - v2.0.4
|
1112
|
-
http://scurker.github.io/currency.js
|
1113
|
-
|
1114
|
-
Copyright (c) 2021 Jason Wilson
|
1115
|
-
Released under MIT license
|
1116
|
-
*/
|
1117
|
-
|
1118
|
-
(function (module, exports) {
|
1119
|
-
(function(e,g){module.exports=g();})(commonjsGlobal,function(){function e(b,a){if(!(this instanceof e))return new e(b,a);a=Object.assign({},m,a);var d=Math.pow(10,a.precision);this.intValue=b=g(b,a);this.value=b/d;a.increment=a.increment||1/d;a.groups=a.useVedic?n:p;this.s=a;this.p=d;}function g(b,a){var d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!0;var c=a.decimal;
|
1120
|
-
var h=a.errorOnInvalid,k=a.fromCents,l=Math.pow(10,a.precision),f=b instanceof e;if(f&&k)return b.intValue;if("number"===typeof b||f)c=f?b.value:b;else if("string"===typeof b)h=new RegExp("[^-\\d"+c+"]","g"),c=new RegExp("\\"+c,"g"),c=(c=b.replace(/\((.*)\)/,"-$1").replace(h,"").replace(c,"."))||0;else {if(h)throw Error("Invalid Input");c=0;}k||(c=(c*l).toFixed(4));return d?Math.round(c):c}var m={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(b,
|
1121
|
-
a){var d=a.pattern,c=a.negativePattern,h=a.symbol,k=a.separator,l=a.decimal;a=a.groups;var f=(""+b).replace(/^-/,"").split("."),q=f[0];f=f[1];return (0<=b.value?d:c).replace("!",h).replace("#",q.replace(a,"$1"+k)+(f?l+f:""))},fromCents:!1},p=/(\d)(?=(\d{3})+\b)/g,n=/(\d)(?=(\d\d)+\d\b)/g;e.prototype={add:function(b){var a=this.s,d=this.p;return e((this.intValue+g(b,a))/(a.fromCents?1:d),a)},subtract:function(b){var a=this.s,d=this.p;return e((this.intValue-g(b,a))/(a.fromCents?1:d),a)},multiply:function(b){var a=
|
1122
|
-
this.s;return e(this.intValue*b/(a.fromCents?1:Math.pow(10,a.precision)),a)},divide:function(b){var a=this.s;return e(this.intValue/g(b,a,!1),a)},distribute:function(b){var a=this.intValue,d=this.p,c=this.s,h=[],k=Math[0<=a?"floor":"ceil"](a/b),l=Math.abs(a-k*b);for(d=c.fromCents?1:d;0!==b;b--){var f=e(k/d,c);0<l--&&(f=f[0<=a?"add":"subtract"](1/d));h.push(f);}return h},dollars:function(){return ~~this.value},cents:function(){return ~~(this.intValue%this.p)},format:function(b){var a=this.s;return "function"===
|
1123
|
-
typeof b?b(this,a):a.format(this,Object.assign({},a,b))},toString:function(){var b=this.s,a=b.increment;return (Math.round(this.intValue/this.p/a)*a).toFixed(b.precision)},toJSON:function(){return this.value}};return e});
|
1124
|
-
}(currency_min$1));
|
1125
|
-
|
1126
|
-
const currency_min = currency_min$1.exports;
|
1127
|
-
|
1128
1108
|
const DEFAULT_LANGUAGE = 'en';
|
1129
1109
|
const TRANSLATIONS = {
|
1130
1110
|
"en": {
|
@@ -1136,7 +1116,6 @@ const TRANSLATIONS = {
|
|
1136
1116
|
"Casino": "Casino",
|
1137
1117
|
"Sports": "Sports",
|
1138
1118
|
"DepositButton": "Deposit",
|
1139
|
-
"Loading": "Loading ..."
|
1140
1119
|
},
|
1141
1120
|
"zh-hk": {
|
1142
1121
|
"Title": "您的結餘",
|
@@ -1147,7 +1126,6 @@ const TRANSLATIONS = {
|
|
1147
1126
|
"Casino": "賭場",
|
1148
1127
|
"Sports": "體育",
|
1149
1128
|
"DepositButton": "存款",
|
1150
|
-
"Loading": "載入中 ..."
|
1151
1129
|
},
|
1152
1130
|
"de": {
|
1153
1131
|
"Title": "Ihr Guthaben",
|
@@ -1158,7 +1136,6 @@ const TRANSLATIONS = {
|
|
1158
1136
|
"Casino": "Casino",
|
1159
1137
|
"Sports": "Sport",
|
1160
1138
|
"DepositButton": "Einzahlen",
|
1161
|
-
"Loading": "Wird geladen ..."
|
1162
1139
|
},
|
1163
1140
|
"it": {
|
1164
1141
|
"Title": "Il tuo saldo",
|
@@ -1169,7 +1146,6 @@ const TRANSLATIONS = {
|
|
1169
1146
|
"Casino": "Casinò",
|
1170
1147
|
"Sports": "Sport",
|
1171
1148
|
"DepositButton": "Deposita",
|
1172
|
-
"Loading": "Caricamento ..."
|
1173
1149
|
},
|
1174
1150
|
"fr": {
|
1175
1151
|
"Title": "Votre solde",
|
@@ -1180,7 +1156,6 @@ const TRANSLATIONS = {
|
|
1180
1156
|
"Casino": "Casino",
|
1181
1157
|
"Sports": "Sports",
|
1182
1158
|
"DepositButton": "Dépôt",
|
1183
|
-
"Loading": "Chargement ..."
|
1184
1159
|
},
|
1185
1160
|
"es": {
|
1186
1161
|
"Title": "Tu saldo",
|
@@ -1191,7 +1166,6 @@ const TRANSLATIONS = {
|
|
1191
1166
|
"Casino": "Casino",
|
1192
1167
|
"Sports": "Deportes",
|
1193
1168
|
"DepositButton": "Depósito",
|
1194
|
-
"Loading": "Cargando ..."
|
1195
1169
|
},
|
1196
1170
|
"tr": {
|
1197
1171
|
"Title": "Bakiyeniz",
|
@@ -1202,7 +1176,6 @@ const TRANSLATIONS = {
|
|
1202
1176
|
"Casino": "Kumarhane",
|
1203
1177
|
"Sports": "Spor",
|
1204
1178
|
"DepositButton": "Yatır",
|
1205
|
-
"Loading": "Yükleniyor ..."
|
1206
1179
|
},
|
1207
1180
|
"ru": {
|
1208
1181
|
"Title": "Ваш баланс",
|
@@ -1213,7 +1186,6 @@ const TRANSLATIONS = {
|
|
1213
1186
|
"Casino": "Казино",
|
1214
1187
|
"Sports": "Спорт",
|
1215
1188
|
"DepositButton": "Депозит",
|
1216
|
-
"Loading": "Загружается ..."
|
1217
1189
|
},
|
1218
1190
|
"ro": {
|
1219
1191
|
"Title": "Soldul tău",
|
@@ -1224,7 +1196,6 @@ const TRANSLATIONS = {
|
|
1224
1196
|
"Casino": "Cazinou",
|
1225
1197
|
"Sports": "Sporturi",
|
1226
1198
|
"DepositButton": "Depozit",
|
1227
|
-
"Loading": "Se încarcă ..."
|
1228
1199
|
},
|
1229
1200
|
"hr": {
|
1230
1201
|
"Title": "Vaš saldo",
|
@@ -1235,7 +1206,6 @@ const TRANSLATIONS = {
|
|
1235
1206
|
"Casino": "Casino",
|
1236
1207
|
"Sports": "Sportovi",
|
1237
1208
|
"DepositButton": "Depozit",
|
1238
|
-
"Loading": "Učitavanje ..."
|
1239
1209
|
},
|
1240
1210
|
"hu": {
|
1241
1211
|
"Title": "Az egyenleged",
|
@@ -1246,7 +1216,6 @@ const TRANSLATIONS = {
|
|
1246
1216
|
"Casino": "Kaszinó",
|
1247
1217
|
"Sports": "Sport",
|
1248
1218
|
"DepositButton": "Befizetés",
|
1249
|
-
"Loading": "Betöltés ..."
|
1250
1219
|
},
|
1251
1220
|
"pl": {
|
1252
1221
|
"Title": "Twoje saldo",
|
@@ -1257,7 +1226,6 @@ const TRANSLATIONS = {
|
|
1257
1226
|
"Casino": "Kasyno",
|
1258
1227
|
"Sports": "Sport",
|
1259
1228
|
"DepositButton": "Wpłać",
|
1260
|
-
"Loading": "Ładowanie ..."
|
1261
1229
|
},
|
1262
1230
|
"pt": {
|
1263
1231
|
"Title": "Seu Saldo",
|
@@ -1268,7 +1236,6 @@ const TRANSLATIONS = {
|
|
1268
1236
|
"Casino": "Cassino",
|
1269
1237
|
"Sports": "Esportes",
|
1270
1238
|
"DepositButton": "Depositar",
|
1271
|
-
"Loading": "Carregando ..."
|
1272
1239
|
},
|
1273
1240
|
"sl": {
|
1274
1241
|
"Title": "Vaš saldo",
|
@@ -1279,7 +1246,6 @@ const TRANSLATIONS = {
|
|
1279
1246
|
"Casino": "Kasino",
|
1280
1247
|
"Sports": "Šport",
|
1281
1248
|
"DepositButton": "Depozit",
|
1282
|
-
"Loading": "Nalaganje ..."
|
1283
1249
|
},
|
1284
1250
|
"sr": {
|
1285
1251
|
"Title": "Vaš saldo",
|
@@ -1290,7 +1256,6 @@ const TRANSLATIONS = {
|
|
1290
1256
|
"Casino": "Kasino",
|
1291
1257
|
"Sports": "Sport",
|
1292
1258
|
"DepositButton": "Depozit",
|
1293
|
-
"Loading": "Učitavanje ..."
|
1294
1259
|
},
|
1295
1260
|
"pt-br": {
|
1296
1261
|
"Title": "Seu Saldo",
|
@@ -1301,7 +1266,6 @@ const TRANSLATIONS = {
|
|
1301
1266
|
"Casino": "Cassino",
|
1302
1267
|
"Sports": "Esportes",
|
1303
1268
|
"DepositButton": "Depositar",
|
1304
|
-
"Loading": "Carregando ..."
|
1305
1269
|
},
|
1306
1270
|
"es-mx": {
|
1307
1271
|
"Title": "Tu saldo",
|
@@ -1312,7 +1276,6 @@ const TRANSLATIONS = {
|
|
1312
1276
|
"Casino": "Casino",
|
1313
1277
|
"Sports": "Deportes",
|
1314
1278
|
"DepositButton": "Depósito",
|
1315
|
-
"Loading": "Cargando ..."
|
1316
1279
|
},
|
1317
1280
|
"en-us": {
|
1318
1281
|
"Title": "Your Balance",
|
@@ -1323,7 +1286,6 @@ const TRANSLATIONS = {
|
|
1323
1286
|
"Casino": "Casino",
|
1324
1287
|
"Sports": "Sports",
|
1325
1288
|
"DepositButton": "Deposit",
|
1326
|
-
"Loading": "Loading ..."
|
1327
1289
|
}
|
1328
1290
|
};
|
1329
1291
|
const translate = (key, customLang, values) => {
|
@@ -1345,21 +1307,83 @@ const PamAccountBalanceModal = class {
|
|
1345
1307
|
constructor(hostRef) {
|
1346
1308
|
registerInstance(this, hostRef);
|
1347
1309
|
this.totalCalculationModes = ['totalCashAmount', 'totalRealAmount'];
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
};
|
1310
|
+
/**
|
1311
|
+
* Returns the formatted balance
|
1312
|
+
* @param balance -> the balance value to be formatted
|
1313
|
+
*/
|
1353
1314
|
this.formatBalance = (balance) => {
|
1354
|
-
if (this.
|
1355
|
-
return
|
1315
|
+
if (this.customDisplayFormat) {
|
1316
|
+
return this.formatFromCustom(balance);
|
1356
1317
|
}
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1318
|
+
const locales = this.currencyLocale || this.language;
|
1319
|
+
const formatOptions = {
|
1320
|
+
style: 'currency',
|
1321
|
+
currency: this.currency,
|
1322
|
+
useGrouping: true,
|
1323
|
+
currencyDisplay: this.currencyDisplay || 'code',
|
1324
|
+
maximumFractionDigits: this.maximumFractionDigits === '' || isNaN(Number(this.maximumFractionDigits)) ? 2 : Number(this.maximumFractionDigits),
|
1325
|
+
minimumFractionDigits: this.minimumFractionDigits === '' || isNaN(Number(this.minimumFractionDigits)) ? 0 : Number(this.minimumFractionDigits),
|
1326
|
+
};
|
1327
|
+
return new Intl.NumberFormat(locales, formatOptions).format(balance);
|
1328
|
+
};
|
1329
|
+
/**
|
1330
|
+
* Parses customdisplayformat and returns the formatted balance accordingly.
|
1331
|
+
* Example:
|
1332
|
+
* if customdisplayformat = '{amount|,.1} {currency}', currency = 'EUR'
|
1333
|
+
* then formatFromCustom(123123.199) = '123,123.1 EUR'
|
1334
|
+
* @param balance
|
1335
|
+
*/
|
1336
|
+
this.formatFromCustom = (balance) => {
|
1337
|
+
const tokens = [];
|
1338
|
+
let acc = '';
|
1339
|
+
for (const char of this.customDisplayFormat) {
|
1340
|
+
switch (char) {
|
1341
|
+
default:
|
1342
|
+
acc += char;
|
1343
|
+
break;
|
1344
|
+
case '{':
|
1345
|
+
acc && tokens.push(acc);
|
1346
|
+
acc = '';
|
1347
|
+
break;
|
1348
|
+
case '}':
|
1349
|
+
const [variable, args] = acc.split('|');
|
1350
|
+
acc = '';
|
1351
|
+
if (variable.toLowerCase() === 'currency') {
|
1352
|
+
acc = this.currency;
|
1353
|
+
}
|
1354
|
+
else if (variable.toLowerCase() === 'amount') {
|
1355
|
+
// defaults
|
1356
|
+
let sepThousands = ',';
|
1357
|
+
let sepDecimal = '.';
|
1358
|
+
let decimals = 2;
|
1359
|
+
// override defaults if args provided (' ' is considered empty so default is used)
|
1360
|
+
if (args) {
|
1361
|
+
args[0] !== ' ' && (sepThousands = args[0]);
|
1362
|
+
args[1] !== ' ' && (sepDecimal = args[1]);
|
1363
|
+
args[2] !== ' ' && !isNaN(Number(args[2])) && (decimals = Number(args[2]));
|
1364
|
+
}
|
1365
|
+
// separate int and fractional part, also round down to desired precision
|
1366
|
+
let [integerPart, fractionalPart] = String(Math.floor(balance * 10 ** decimals) / 10 ** decimals).split('.');
|
1367
|
+
// format int part by adding thousands separators
|
1368
|
+
acc += integerPart[0];
|
1369
|
+
for (let i = 1; i < integerPart.length; ++i) {
|
1370
|
+
if ((integerPart.length - i) % 3 === 0) {
|
1371
|
+
acc += (sepThousands + integerPart[i]);
|
1372
|
+
}
|
1373
|
+
else {
|
1374
|
+
acc += integerPart[i];
|
1375
|
+
}
|
1376
|
+
}
|
1377
|
+
// add fractional part if it exists
|
1378
|
+
fractionalPart && (acc += (sepDecimal + fractionalPart));
|
1379
|
+
}
|
1380
|
+
acc && tokens.push(acc);
|
1381
|
+
acc = '';
|
1382
|
+
break;
|
1383
|
+
}
|
1360
1384
|
}
|
1361
|
-
|
1362
|
-
return
|
1385
|
+
tokens.push(acc);
|
1386
|
+
return tokens.join('');
|
1363
1387
|
};
|
1364
1388
|
this.getBalances = () => {
|
1365
1389
|
this.isLoading = true;
|
@@ -1526,20 +1550,21 @@ const PamAccountBalanceModal = class {
|
|
1526
1550
|
break;
|
1527
1551
|
}
|
1528
1552
|
};
|
1529
|
-
this.userId =
|
1530
|
-
this.session =
|
1531
|
-
this.endpoint =
|
1532
|
-
this.
|
1533
|
-
this.
|
1534
|
-
this.
|
1535
|
-
this.
|
1536
|
-
this.currencyDecimal = undefined;
|
1537
|
-
this.currencyPrecision = undefined;
|
1538
|
-
this.mbSource = undefined;
|
1539
|
-
this.clientStyling = undefined;
|
1540
|
-
this.clientStylingUrl = undefined;
|
1541
|
-
this.translationUrl = undefined;
|
1553
|
+
this.userId = '';
|
1554
|
+
this.session = '';
|
1555
|
+
this.endpoint = '';
|
1556
|
+
this.mbSource = '';
|
1557
|
+
this.clientStyling = '';
|
1558
|
+
this.clientStylingUrl = '';
|
1559
|
+
this.translationUrl = '';
|
1542
1560
|
this.language = 'en';
|
1561
|
+
this.displayBalanceOption = 'All';
|
1562
|
+
this.totalCalculationMode = 'totalCashAmount';
|
1563
|
+
this.currencyLocale = 'en';
|
1564
|
+
this.currencyDisplay = 'code';
|
1565
|
+
this.maximumFractionDigits = '2';
|
1566
|
+
this.minimumFractionDigits = '0';
|
1567
|
+
this.customDisplayFormat = '';
|
1543
1568
|
this.isLoading = true;
|
1544
1569
|
this.isModalDisplayed = false;
|
1545
1570
|
this.isSplitWallet = false;
|
@@ -1680,10 +1705,10 @@ const PamAccountBalanceModal = class {
|
|
1680
1705
|
}
|
1681
1706
|
}
|
1682
1707
|
render() {
|
1683
|
-
const balanceButton = (h("button", { class: "BalanceValue", onClick: () => this.toggleModal('open') }, h("p", null, this.balances['Total'].length > 0 ? this.formatBalance(this.balances['Total'][0].amount) : '0'
|
1708
|
+
const balanceButton = (h("button", { class: "BalanceValue", onClick: () => this.toggleModal('open') }, h("p", null, this.balances['Total'].length > 0 ? this.formatBalance(this.balances['Total'][0].amount) : '0'), h("span", { class: " {isModalDisplayed ? 'TriangleActive' : 'TriangleInactive'}" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "6.835", viewBox: "0 0 14 6.835" }, h("path", { id: "arrow", d: "M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z", transform: "translate(-274.511 -441.088)", fill: "#d1d1d1" })))));
|
1684
1709
|
const balanceModal = (h("div", { class: this.isModalDisplayed ? 'BalanceModalWrapper Open' : 'BalanceModalWrapper' }, h("button", { class: "BalanceModalClose", onClick: () => this.toggleModal('close') }), h("div", { class: "BalanceModal" }, h("div", { class: "ModalContent" }, h("div", { class: "BalanceModalHeader" }, h("p", { class: "BalanceModalTitle" }, translate('Title', this.language))), h("div", { class: "BalanceModalBody" }, Object.keys(this.balances).map((key) => {
|
1685
1710
|
return (h("div", { class: "BalanceModalRowBoth" }, this.balances[key].map((balance) => {
|
1686
|
-
return (h("div", { class: "BalanceModalRowLine" }, h("p", { class: "BalanceModalText" }, translate(key, this.language), " ", balance.productType ? translate(balance.productType, this.language) : ''), h("p", { class: "BalanceModalValue" }, h("span", { class: "BalanceModalAmount" }, balance.amount ? this.formatBalance(balance.amount) : '0')
|
1711
|
+
return (h("div", { class: "BalanceModalRowLine" }, h("p", { class: "BalanceModalText" }, translate(key, this.language), " ", balance.productType ? translate(balance.productType, this.language) : ''), h("p", { class: "BalanceModalValue" }, h("span", { class: "BalanceModalAmount" }, balance.amount ? this.formatBalance(balance.amount) : '0'))));
|
1687
1712
|
})));
|
1688
1713
|
})), h("div", { class: "BalanceModalFooter" }, h("button", { class: "BalanceModalAction", onClick: () => this.balanceModalOpenDeposit() }, translate('DepositButton', this.language)))))));
|
1689
1714
|
const skeleton = (h("div", { class: "LoadingSkeleton" }, h("ui-skeleton", { structure: "title", height: "20px", width: "auto" })));
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
16
16
|
|
17
17
|
patchBrowser().then(async (options) => {
|
18
18
|
await globalScripts();
|
19
|
-
return bootstrapLazy([["pam-account-balance-modal_2",[[1,"pam-account-balance-modal",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"
|
19
|
+
return bootstrapLazy([["pam-account-balance-modal_2",[[1,"pam-account-balance-modal",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"displayBalanceOption":[513,"display-balance-option"],"totalCalculationMode":[513,"total-calculation-mode"],"currencyLocale":[513,"currency-locale"],"currencyDisplay":[520,"currency-display"],"maximumFractionDigits":[513,"maximum-fraction-digits"],"minimumFractionDigits":[513,"minimum-fraction-digits"],"customDisplayFormat":[513,"custom-display-format"],"isLoading":[32],"isModalDisplayed":[32],"isSplitWallet":[32],"currentStream":[32],"currency":[32],"updateRealAmountState":[32],"balances":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
|
20
20
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { P as pam_account_balance_modal } from './pam-account-balance-modal-
|
1
|
+
export { P as pam_account_balance_modal } from './pam-account-balance-modal-d4c15371.js';
|
2
2
|
import { r as registerInstance, h, H as Host } from './index-ee727666.js';
|
3
3
|
|
4
4
|
const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
|
@@ -1 +1 @@
|
|
1
|
-
export{P as PamAccountBalanceModal}from"./p-
|
1
|
+
export{P as PamAccountBalanceModal}from"./p-7eb9a9a8.js";import"./p-86b371f2.js";
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import{r as t,h as a}from"./p-86b371f2.js";function e(t,a){if(t){const e=document.createElement("style");e.innerHTML=a,t.appendChild(e)}}function o(t,a){const e=new URL(a);fetch(e.href).then((t=>t.text())).then((a=>{const e=document.createElement("style");e.innerHTML=a,t&&t.appendChild(e)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function n(t,a){if(window.emMessageBus){const e=document.createElement("style");window.emMessageBus.subscribe(a,(a=>{e.innerHTML=a,t&&t.appendChild(e)}))}}var i,l,s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={exports:{}};
|
2
|
+
/** @license
|
3
|
+
* eventsource.js
|
4
|
+
* Available under MIT License (MIT)
|
5
|
+
* https://github.com/Yaffle/EventSource/
|
6
|
+
*/
|
7
|
+
i=r,l=r.exports,function(t){var a=t.setTimeout,e=t.clearTimeout,o=t.XMLHttpRequest,n=t.XDomainRequest,s=t.ActiveXObject,r=t.EventSource,c=t.document,d=t.Promise,u=t.fetch,h=t.Response,p=t.TextDecoder,f=t.TextEncoder,B=t.AbortController;if("undefined"==typeof window||void 0===c||"readyState"in c||null!=c.body||(c.readyState="loading",window.addEventListener("load",(function(){c.readyState="complete"}),!1)),null==o&&null!=s&&(o=function(){return new s("Microsoft.XMLHTTP")}),null==Object.create&&(Object.create=function(t){function a(){}return a.prototype=t,new a}),Date.now||(Date.now=function(){return(new Date).getTime()}),null==B){var m=u;u=function(t,a){var e=a.signal;return m(t,{headers:a.headers,credentials:a.credentials,cache:a.cache}).then((function(t){var a=t.body.getReader();return e._reader=a,e._aborted&&e._reader.cancel(),{status:t.status,statusText:t.statusText,headers:t.headers,body:{getReader:function(){return a}}}}))},B=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function v(){this.bitsNeeded=0,this.codePoint=0}v.prototype.decode=function(t){function a(t,a,e){if(1===e)return t>=128>>a&&t<<a<=2047;if(2===e)return t>=2048>>a&&t<<a<=55295||t>=57344>>a&&t<<a<=65535;if(3===e)return t>=65536>>a&&t<<a<=1114111;throw new Error}function e(t,a){if(6===t)return a>>6>15?3:a>31?2:1;if(12===t)return a>15?3:2;if(18===t)return 3;throw new Error}for(var o=65533,n="",i=this.bitsNeeded,l=this.codePoint,s=0;s<t.length;s+=1){var r=t[s];0!==i&&(r<128||r>191||!a(l<<6|63&r,i-6,e(i,l)))&&(i=0,l=o,n+=String.fromCharCode(l)),0===i?(r>=0&&r<=127?(i=0,l=r):r>=192&&r<=223?(i=6,l=31&r):r>=224&&r<=239?(i=12,l=15&r):r>=240&&r<=247?(i=18,l=7&r):(i=0,l=o),0===i||a(l,i,e(i,l))||(i=0,l=o)):(i-=6,l=l<<6|63&r),0===i&&(l<=65535?n+=String.fromCharCode(l):(n+=String.fromCharCode(55296+(l-65535-1>>10)),n+=String.fromCharCode(56320+(l-65535-1&1023))))}return this.bitsNeeded=i,this.codePoint=l,n},null!=p&&null!=f&&function(){try{return"test"===(new p).decode((new f).encode("test"),{stream:!0})}catch(t){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+t)}return!1}()||(p=v);var w=function(){};function g(t){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=w,this.onload=w,this.onerror=w,this.onreadystatechange=w,this._contentType="",this._xhr=t,this._sendTimeout=0,this._abort=w}function M(t){return t.replace(/[A-Z]/g,(function(t){return String.fromCharCode(t.charCodeAt(0)+32)}))}function y(t){for(var a=Object.create(null),e=t.split("\r\n"),o=0;o<e.length;o+=1){var n=e[o].split(": "),i=n.shift(),l=n.join(": ");a[M(i)]=l}this._map=a}function b(){}function S(t){this._headers=t}function x(){}function C(){this._listeners=Object.create(null)}function T(t){a((function(){throw t}),0)}function A(t){this.type=t,this.target=void 0}function D(t,a){A.call(this,t),this.data=a.data,this.lastEventId=a.lastEventId}function R(t,a){A.call(this,t),this.status=a.status,this.statusText=a.statusText,this.headers=a.headers}function k(t,a){A.call(this,t),this.error=a.error}g.prototype.open=function(t,n){this._abort(!0);var i=this,l=this._xhr,s=1,r=0;this._abort=function(t){0!==i._sendTimeout&&(e(i._sendTimeout),i._sendTimeout=0),1!==s&&2!==s&&3!==s||(s=4,l.onload=w,l.onerror=w,l.onabort=w,l.onprogress=w,l.onreadystatechange=w,l.abort(),0!==r&&(e(r),r=0),t||(i.readyState=4,i.onabort(null),i.onreadystatechange())),s=0};var c=function(){if(1===s){var t=0,a="",e=void 0;if("contentType"in l)t=200,a="OK",e=l.contentType;else try{t=l.status,a=l.statusText,e=l.getResponseHeader("Content-Type")}catch(o){t=0,a="",e=void 0}0!==t&&(s=2,i.readyState=2,i.status=t,i.statusText=a,i._contentType=e,i.onreadystatechange())}},d=function(){if(c(),2===s||3===s){s=3;var t="";try{t=l.responseText}catch(t){}i.readyState=3,i.responseText=t,i.onprogress()}},u=function(t,a){if(null!=a&&null!=a.preventDefault||(a={preventDefault:w}),d(),1===s||2===s||3===s){if(s=4,0!==r&&(e(r),r=0),i.readyState=4,"load"===t)i.onload(a);else if("error"===t)i.onerror(a);else{if("abort"!==t)throw new TypeError;i.onabort(a)}i.onreadystatechange()}},h=function(){r=a((function(){h()}),500),3===l.readyState&&d()};"onload"in l&&(l.onload=function(t){u("load",t)}),"onerror"in l&&(l.onerror=function(t){u("error",t)}),"onabort"in l&&(l.onabort=function(t){u("abort",t)}),"onprogress"in l&&(l.onprogress=d),"onreadystatechange"in l&&(l.onreadystatechange=function(t){!function(t){null!=l&&(4===l.readyState?"onload"in l&&"onerror"in l&&"onabort"in l||u(""===l.responseText?"error":"load",t):3===l.readyState?"onprogress"in l||d():2===l.readyState&&c())}(t)}),!("contentType"in l)&&"ontimeout"in o.prototype||(n+=(-1===n.indexOf("?")?"?":"&")+"padding=true"),l.open(t,n,!0),"readyState"in l&&(r=a((function(){h()}),0))},g.prototype.abort=function(){this._abort(!1)},g.prototype.getResponseHeader=function(){return this._contentType},g.prototype.setRequestHeader=function(t,a){var e=this._xhr;"setRequestHeader"in e&&e.setRequestHeader(t,a)},g.prototype.getAllResponseHeaders=function(){return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},g.prototype.send=function(){if("ontimeout"in o.prototype&&("sendAsBinary"in o.prototype||"mozAnon"in o.prototype)||null==c||null==c.readyState||"complete"===c.readyState){var t=this._xhr;"withCredentials"in t&&(t.withCredentials=this.withCredentials);try{t.send(void 0)}catch(t){throw t}}else{var e=this;e._sendTimeout=a((function(){e._sendTimeout=0,e.send()}),4)}},y.prototype.get=function(t){return this._map[M(t)]},null!=o&&null==o.HEADERS_RECEIVED&&(o.HEADERS_RECEIVED=2),b.prototype.open=function(t,a,e,n,i,l,s){t.open("GET",i);var r=0;for(var c in t.onprogress=function(){var a=t.responseText.slice(r);r+=a.length,e(a)},t.onerror=function(t){t.preventDefault(),n(new Error("NetworkError"))},t.onload=function(){n(null)},t.onabort=function(){n(null)},t.onreadystatechange=function(){if(t.readyState===o.HEADERS_RECEIVED){var e=t.status,n=t.statusText,i=t.getResponseHeader("Content-Type"),l=t.getAllResponseHeaders();a(e,n,i,new y(l))}},t.withCredentials=l,s)Object.prototype.hasOwnProperty.call(s,c)&&t.setRequestHeader(c,s[c]);return t.send(),t},S.prototype.get=function(t){return this._headers.get(t)},x.prototype.open=function(t,a,e,o,n,i,l){var s=null,r=new B,c=r.signal,h=new p;return u(n,{headers:l,credentials:i?"include":"same-origin",signal:c,cache:"no-store"}).then((function(t){return s=t.body.getReader(),a(t.status,t.statusText,t.headers.get("Content-Type"),new S(t.headers)),new d((function(t,a){var o=function(){s.read().then((function(a){if(a.done)t(void 0);else{var n=h.decode(a.value,{stream:!0});e(n),o()}})).catch((function(t){a(t)}))};o()}))})).catch((function(t){return"AbortError"===t.name?void 0:t})).then((function(t){o(t)})),{abort:function(){null!=s&&s.cancel(),r.abort()}}},C.prototype.dispatchEvent=function(t){t.target=this;var a=this._listeners[t.type];if(null!=a)for(var e=a.length,o=0;o<e;o+=1){var n=a[o];try{"function"==typeof n.handleEvent?n.handleEvent(t):n.call(this,t)}catch(t){T(t)}}},C.prototype.addEventListener=function(t,a){t=String(t);var e=this._listeners,o=e[t];null==o&&(e[t]=o=[]);for(var n=!1,i=0;i<o.length;i+=1)o[i]===a&&(n=!0);n||o.push(a)},C.prototype.removeEventListener=function(t,a){t=String(t);var e=this._listeners,o=e[t];if(null!=o){for(var n=[],i=0;i<o.length;i+=1)o[i]!==a&&n.push(o[i]);0===n.length?delete e[t]:e[t]=n}},D.prototype=Object.create(A.prototype),R.prototype=Object.create(A.prototype),k.prototype=Object.create(A.prototype);var F=/^text\/event\-stream(;.*)?$/i,P=function(t,a){var e=null==t?a:parseInt(t,10);return e!=e&&(e=a),O(e)},O=function(t){return Math.min(Math.max(t,1e3),18e6)},z=function(t,a,e){try{"function"==typeof a&&a.call(t,e)}catch(t){T(t)}};function E(t,i){C.call(this),i=i||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,function(t,i,l){i=String(i);var s=Boolean(l.withCredentials),r=l.lastEventIdQueryParameterName||"lastEventId",c=O(1e3),d=P(l.heartbeatTimeout,45e3),u="",h=c,p=!1,f=0,B=l.headers||{},m=l.Transport,v=W&&null==m?void 0:new g(null!=m?new m:null!=o&&"withCredentials"in o.prototype||null==n?new o:new n),w=null!=m&&"string"!=typeof m?new m:null==v?new x:new b,M=void 0,y=0,S=-1,C="",T="",A="",E="",j=0,V=0,N=0,L=function(a,e,o,n){if(0===S)if(200===a&&null!=o&&F.test(o)){S=1,p=Date.now(),h=c,t.readyState=1;var i=new R("open",{status:a,statusText:e,headers:n});t.dispatchEvent(i),z(t,t.onopen,i)}else{var l="";200!==a?(e&&(e=e.replace(/\s+/g," ")),l="EventSource's response has a status "+a+" "+e+" that is not 200. Aborting the connection."):l="EventSource's response has a Content-Type specifying an unsupported type: "+(null==o?"-":o.replace(/\s+/g," "))+". Aborting the connection.",K(),i=new R("error",{status:a,statusText:e,headers:n}),t.dispatchEvent(i),z(t,t.onerror,i),console.error(l)}},U=function(o){if(1===S){for(var n=-1,i=0;i<o.length;i+=1)(r=o.charCodeAt(i))!=="\n".charCodeAt(0)&&r!=="\r".charCodeAt(0)||(n=i);var l=(-1!==n?E:"")+o.slice(0,n+1);E=(-1===n?E:"")+o.slice(n+1),""!==o&&(p=Date.now(),f+=o.length);for(var s=0;s<l.length;s+=1){var r=l.charCodeAt(s);if(-1===j&&r==="\n".charCodeAt(0))j=0;else if(-1===j&&(j=0),r==="\r".charCodeAt(0)||r==="\n".charCodeAt(0)){if(0!==j){1===j&&(N=s+1);var B=l.slice(V,N-1),m=l.slice(N+(N<s&&l.charCodeAt(N)===" ".charCodeAt(0)?1:0),s);"data"===B?(C+="\n",C+=m):"id"===B?T=m:"event"===B?A=m:"retry"===B?(c=P(m,c),h=c):"heartbeatTimeout"===B&&(d=P(m,d),0!==y&&(e(y),y=a((function(){G()}),d)))}if(0===j){if(""!==C){u=T,""===A&&(A="message");var v=new D(A,{data:C.slice(1),lastEventId:T});if(t.dispatchEvent(v),"open"===A?z(t,t.onopen,v):"message"===A?z(t,t.onmessage,v):"error"===A&&z(t,t.onerror,v),2===S)return}C="",A=""}j=r==="\r".charCodeAt(0)?-1:0}else 0===j&&(V=s,j=1),1===j?r===":".charCodeAt(0)&&(N=s+1,j=2):2===j&&(j=3)}}},I=function(o){if(1===S||0===S){S=-1,0!==y&&(e(y),y=0),y=a((function(){G()}),h),h=O(Math.min(16*c,2*h)),t.readyState=0;var n=new k("error",{error:o});t.dispatchEvent(n),z(t,t.onerror,n),null!=o&&console.error(o)}},K=function(){S=2,null!=M&&(M.abort(),M=void 0),0!==y&&(e(y),y=0),t.readyState=2},G=function(){if(y=0,-1===S){p=!1,f=0,y=a((function(){G()}),d),S=0,C="",A="",T=u,E="",V=0,N=0,j=0;var e=i;if("data:"!==i.slice(0,5)&&"blob:"!==i.slice(0,5)&&""!==u){var o=i.indexOf("?");e=-1===o?i:i.slice(0,o+1)+i.slice(o+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,(function(t,a){return a===r?"":t})),e+=(-1===i.indexOf("?")?"?":"&")+r+"="+encodeURIComponent(u)}var n=t.withCredentials,l={Accept:"text/event-stream"},s=t.headers;if(null!=s)for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(l[c]=s[c]);try{M=w.open(v,L,U,I,e,n,l)}catch(t){throw K(),t}}else if(p||null==M){var h=Math.max((p||Date.now())+d-Date.now(),1);p=!1,y=a((function(){G()}),h)}else I(new Error("No activity within "+d+" milliseconds. "+(0===S?"No response received.":f+" chars received.")+" Reconnecting.")),null!=M&&(M.abort(),M=void 0)};t.url=i,t.readyState=0,t.withCredentials=s,t.headers=B,t._close=K,G()}(this,t,i)}var W=null!=u&&null!=h&&"body"in h.prototype;(E.prototype=Object.create(C.prototype)).CONNECTING=0,E.prototype.OPEN=1,E.prototype.CLOSED=2,E.prototype.close=function(){this._close()},E.CONNECTING=0,E.OPEN=1,E.CLOSED=2,E.prototype.withCredentials=void 0;var j,V=r;null==o||null!=r&&"withCredentials"in r.prototype||(V=E),j=function(t){t.EventSourcePolyfill=E,t.NativeEventSource=r,t.EventSource=V}(l),void 0!==j&&(i.exports=j)}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:s:globalThis);const c={en:{Title:"Your Balance",Total:"Total Balance",Real:"Cash Balance",Bonus:"Bonus Balance",Credit:"Credit Balance",Casino:"Casino",Sports:"Sports",DepositButton:"Deposit"},"zh-hk":{Title:"您的結餘",Total:"總結餘",Real:"現金結餘",Bonus:"紅利結餘",Credit:"信用結餘",Casino:"賭場",Sports:"體育",DepositButton:"存款"},de:{Title:"Ihr Guthaben",Total:"Gesamtguthaben",Real:"Barguthaben",Bonus:"Bonusguthaben",Credit:"Kreditguthaben",Casino:"Casino",Sports:"Sport",DepositButton:"Einzahlen"},it:{Title:"Il tuo saldo",Total:"Saldo totale",Real:"Saldo in contanti",Bonus:"Saldo bonus",Credit:"Saldo di credito",Casino:"Casinò",Sports:"Sport",DepositButton:"Deposita"},fr:{Title:"Votre solde",Total:"Solde total",Real:"Solde en espèces",Bonus:"Solde bonus",Credit:"Solde de crédit",Casino:"Casino",Sports:"Sports",DepositButton:"Dépôt"},es:{Title:"Tu saldo",Total:"Saldo total",Real:"Saldo en efectivo",Bonus:"Saldo de bono",Credit:"Saldo de crédito",Casino:"Casino",Sports:"Deportes",DepositButton:"Depósito"},tr:{Title:"Bakiyeniz",Total:"Toplam Bakiye",Real:"Nakit Bakiye",Bonus:"Bonus Bakiyesi",Credit:"Kredi Bakiyesi",Casino:"Kumarhane",Sports:"Spor",DepositButton:"Yatır"},ru:{Title:"Ваш баланс",Total:"Общий баланс",Real:"Денежный баланс",Bonus:"Бонусный баланс",Credit:"Кредитный баланс",Casino:"Казино",Sports:"Спорт",DepositButton:"Депозит"},ro:{Title:"Soldul tău",Total:"Sold total",Real:"Sold în numerar",Bonus:"Sold bonus",Credit:"Sold credit",Casino:"Cazinou",Sports:"Sporturi",DepositButton:"Depozit"},hr:{Title:"Vaš saldo",Total:"Ukupni saldo",Real:"Gotovinski saldo",Bonus:"Bonus saldo",Credit:"Kreditni saldo",Casino:"Casino",Sports:"Sportovi",DepositButton:"Depozit"},hu:{Title:"Az egyenleged",Total:"Teljes egyenleg",Real:"Készpénz egyenleg",Bonus:"Bónusz egyenleg",Credit:"Hitel egyenleg",Casino:"Kaszinó",Sports:"Sport",DepositButton:"Befizetés"},pl:{Title:"Twoje saldo",Total:"Całkowite saldo",Real:"Saldo gotówkowe",Bonus:"Saldo bonusowe",Credit:"Saldo kredytowe",Casino:"Kasyno",Sports:"Sport",DepositButton:"Wpłać"},pt:{Title:"Seu Saldo",Total:"Saldo Total",Real:"Saldo em Dinheiro",Bonus:"Saldo de Bônus",Credit:"Saldo de Crédito",Casino:"Cassino",Sports:"Esportes",DepositButton:"Depositar"},sl:{Title:"Vaš saldo",Total:"Skupni saldo",Real:"Gotovinski saldo",Bonus:"Bonus saldo",Credit:"Kreditni saldo",Casino:"Kasino",Sports:"Šport",DepositButton:"Depozit"},sr:{Title:"Vaš saldo",Total:"Ukupan saldo",Real:"Gotovinski saldo",Bonus:"Bonus saldo",Credit:"Kreditni saldo",Casino:"Kasino",Sports:"Sport",DepositButton:"Depozit"},"pt-br":{Title:"Seu Saldo",Total:"Saldo Total",Real:"Saldo em Dinheiro",Bonus:"Saldo de Bônus",Credit:"Saldo de Crédito",Casino:"Cassino",Sports:"Esportes",DepositButton:"Depositar"},"es-mx":{Title:"Tu saldo",Total:"Saldo total",Real:"Saldo en efectivo",Bonus:"Saldo de bono",Credit:"Saldo de crédito",Casino:"Casino",Sports:"Deportes",DepositButton:"Depósito"},"en-us":{Title:"Your Balance",Total:"Total Balance",Real:"Cash Balance",Bonus:"Bonus Balance",Credit:"Credit Balance",Casino:"Casino",Sports:"Sports",DepositButton:"Deposit"}},d=(t,a,e)=>{let o=c[c[a]?a:"en"][t];if(void 0!==e)for(const[t,a]of Object.entries(e.values)){const e=new RegExp(`{${t}}`,"g");o=o.replace(e,a)}return o},u=class{constructor(a){t(this,a),this.totalCalculationModes=["totalCashAmount","totalRealAmount"],this.formatBalance=t=>{if(this.customDisplayFormat)return this.formatFromCustom(t);const a=this.currencyLocale||this.language,e={style:"currency",currency:this.currency,useGrouping:!0,currencyDisplay:this.currencyDisplay||"code",maximumFractionDigits:""===this.maximumFractionDigits||isNaN(Number(this.maximumFractionDigits))?2:Number(this.maximumFractionDigits),minimumFractionDigits:""===this.minimumFractionDigits||isNaN(Number(this.minimumFractionDigits))?0:Number(this.minimumFractionDigits)};return new Intl.NumberFormat(a,e).format(t)},this.formatFromCustom=t=>{const a=[];let e="";for(const o of this.customDisplayFormat)switch(o){default:e+=o;break;case"{":e&&a.push(e),e="";break;case"}":const[n,i]=e.split("|");if(e="","currency"===n.toLowerCase())e=this.currency;else if("amount"===n.toLowerCase()){let a=",",o=".",n=2;i&&(" "!==i[0]&&(a=i[0])," "!==i[1]&&(o=i[1])," "!==i[2]&&!isNaN(Number(i[2]))&&(n=Number(i[2])));let[l,s]=String(Math.floor(t*10**n)/10**n).split(".");e+=l[0];for(let t=1;t<l.length;++t)e+=(l.length-t)%3==0?a+l[t]:l[t];s&&(e+=o+s)}e&&a.push(e),e=""}return a.push(e),a.join("")},this.getBalances=()=>{this.isLoading=!0;const t=new URL(`/v2/player/${this.userId}/balance/`,this.endpoint),a=new Headers;a.append("X-SessionID",this.session);const e={method:"GET",headers:a};return new Promise((a=>fetch(t,e).then((t=>t.json())).then((t=>a(t))).catch((t=>{throw console.log("Balance fetch error",t),new Error("Failed to fetch balance data!")})).finally((()=>this.isLoading=!1))))},this.subscribeToBalanceUpdates=()=>{if(this.currentStream&&this.currentStream.close(),this.session.length<1)return;const t=new URL(`/v2/player/${this.userId}/information/updates/`,this.endpoint),a=new r.exports.EventSourcePolyfill(t,{headers:{accept:"text/event-stream","X-SessionId":this.session}});this.currentStream=a,a.addEventListener("message",this.updateBalances)},this.parseData=t=>{let a;try{a=JSON.parse(t)}catch(t){return void console.log("Balance stream failed: ",t)}return a},this.updateRealAmount=(t,a,e)=>{let o=null;switch(e.walletAccountType){case"Ordinary":e.afterAmount===e.affectedAmount&&0!==a.lastOrdinaryAfterAmount||(a.lastOrdinaryAfterAmount=e.afterAmount,a.showCreditLineAfterAmount||(o=e.afterAmount));break;case"CreditLine":0!==e.afterAmount?(o=e.afterAmount,a.showCreditLineAfterAmount=!0):(o=a.lastOrdinaryAfterAmount,a.showCreditLineAfterAmount=!1);break;default:o=e.afterAmount}return null===o?t:o},this.updateTotalAmount=()=>{switch(this.totalCalculationMode){case"totalCashAmount":let t=0;for(const a of["Real","Bonus"])for(const e of this.balances[a])t+=Math.max(e.amount,0);this.balances.Total[0].amount=t;break;case"totalRealAmount":if(!this.isSplitWallet)return;let a=0;for(const t of this.balances.Real)a+=t.amount;this.balances.Total[0].amount=a}},this.updateBalances=t=>{const a=this.parseData(t.data);if(!a)return void this.subscribeToBalanceUpdates();if("BALANCE_UPDATE_V2"!==a.type)return;const e=a.body.balanceChange;for(const[t,a]of Object.entries(e))if("totalRealAmount"!==this.totalCalculationMode||"Real"!==t||this.isSplitWallet||(this.balances.Total[0].amount=this.updateRealAmount(this.balances.Total[0].amount,this.updateRealAmountState,a)),this.balances[t])for(const e of this.balances[t])this.isSplitWallet?a.productType===e.productType&&(e.amount="Real"===t?this.updateRealAmount(e.amount,this.updateRealAmountState[e.productType],a):a.afterAmount):e.amount="Real"===t?this.updateRealAmount(e.amount,this.updateRealAmountState,a):a.afterAmount;this.updateTotalAmount(),this.balances=Object.assign({},this.balances)},this.balanceModalOpenDeposit=()=>{this.toggleModal("close"),window.postMessage({type:"GoToDeposit"},window.location.href),"function"==typeof gtag&>ag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},this.validateTotalCalculationMode=()=>{this.totalCalculationModes.includes(this.totalCalculationMode)||(console.error(`Unsupported value ('${this.totalCalculationMode}') for totalcalculationmode parameter. Only the following values are supported ${this.totalCalculationModes}. Using default value ('${this.totalCalculationModes[0]}').`),this.totalCalculationMode=this.totalCalculationModes[0])},this.messageHandler=t=>t.data&&"LogoutSuccessfull"===t.data.type&&this.currentStream.close(),this.updateBalanceStyling=()=>{window.postMessage({type:"UpdateBalanceBackground"},window.location.href)},this.toggleModal=t=>{switch(t){case"open":window.postMessage({type:"BalanceModalStatus",status:"open"},window.location.href),this.isModalDisplayed=!0;break;case"close":window.postMessage({type:"BalanceModalStatus",status:"close"},window.location.href),this.isModalDisplayed=!1}},this.userId="",this.session="",this.endpoint="",this.mbSource="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.language="en",this.displayBalanceOption="All",this.totalCalculationMode="totalCashAmount",this.currencyLocale="en",this.currencyDisplay="code",this.maximumFractionDigits="2",this.minimumFractionDigits="0",this.customDisplayFormat="",this.isLoading=!0,this.isModalDisplayed=!1,this.isSplitWallet=!1,this.currentStream=void 0,this.currency=void 0,this.updateRealAmountState=void 0,this.balances={Total:[],Real:[],Bonus:[],Credit:[]}}handleClientStylingChange(t,a){t!=a&&e(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,a){t!=a&&o(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,a){t!=a&&n(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.validateTotalCalculationMode(),this.getBalances().then((t=>this.setBalances(t))),this.subscribeToBalanceUpdates()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&n(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&e(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&o(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}setBalances(t){t[this.totalCalculationMode]||(this.totalCalculationMode=this.totalCalculationModes[0]),this.balances.Total.push({amount:0,productType:""});const a=t.items.find((t=>"Real"===t.type&&"Ordinary"===t.walletAccountType));this.currency=a.currency,this.isSplitWallet=Boolean(a.productType),this.isSplitWallet?this.setBalancesWhenSplitWallet(t):this.setBalancesWhenSingleWallet(t)}setBalancesWhenSingleWallet(t){this.updateRealAmountState={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},this.balances.Total[0].amount=t[this.totalCalculationMode][this.currency];for(const a of t.items)switch(a.type){case"Bonus":0===this.balances.Bonus.length?this.balances.Bonus.push({amount:a.amount,productType:""}):this.balances.Bonus[0].amount+=a.amount;break;case"Real":if(a.creditLine&&0===this.balances.Credit.length&&this.balances.Credit.push({amount:a.creditLine,productType:""}),"totalRealAmount"===this.totalCalculationMode)continue;0===this.balances.Real.length?this.balances.Real.push({amount:a.amount,productType:""}):this.balances.Real[0].amount+=a.amount}for(const[t,a]of Object.entries(this.balances))a.length<1&&delete this.balances[t]}setBalancesWhenSplitWallet(t){this.updateRealAmountState={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let a=t.items;this.displayBalanceOption&&"All"!==this.displayBalanceOption&&(a=t.items.filter((t=>t.productType===this.displayBalanceOption)));for(const t of a){let a;switch(t.type){case"Bonus":a=this.balances.Bonus.findIndex((a=>a.productType===t.productType)),a>0?this.balances.Bonus[a].amount+=t.amount:this.balances.Bonus.push({amount:t.amount,productType:t.productType});break;case"Real":t.creditLine&&this.balances.Credit.push({amount:t.creditLine,productType:t.productType}),a=this.balances.Real.findIndex((a=>a.productType===t.productType)),a>0?this.balances.Real[a].amount+=t.amount:this.balances.Real.push({amount:t.amount,productType:t.productType})}}this.updateTotalAmount();for(const[t,a]of Object.entries(this.balances))a.length<1&&delete this.balances[t]}render(){const t=a("button",{class:"BalanceValue",onClick:()=>this.toggleModal("open")},a("p",null,this.balances.Total.length>0?this.formatBalance(this.balances.Total[0].amount):"0"),a("span",{class:" {isModalDisplayed ? 'TriangleActive' : 'TriangleInactive'}"},a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"6.835",viewBox:"0 0 14 6.835"},a("path",{id:"arrow",d:"M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z",transform:"translate(-274.511 -441.088)",fill:"#d1d1d1"})))),e=a("div",{class:this.isModalDisplayed?"BalanceModalWrapper Open":"BalanceModalWrapper"},a("button",{class:"BalanceModalClose",onClick:()=>this.toggleModal("close")}),a("div",{class:"BalanceModal"},a("div",{class:"ModalContent"},a("div",{class:"BalanceModalHeader"},a("p",{class:"BalanceModalTitle"},d("Title",this.language))),a("div",{class:"BalanceModalBody"},Object.keys(this.balances).map((t=>a("div",{class:"BalanceModalRowBoth"},this.balances[t].map((e=>a("div",{class:"BalanceModalRowLine"},a("p",{class:"BalanceModalText"},d(t,this.language)," ",e.productType?d(e.productType,this.language):""),a("p",{class:"BalanceModalValue"},a("span",{class:"BalanceModalAmount"},e.amount?this.formatBalance(e.amount):"0"))))))))),a("div",{class:"BalanceModalFooter"},a("button",{class:"BalanceModalAction",onClick:()=>this.balanceModalOpenDeposit()},d("DepositButton",this.language)))))),o=a("div",{class:"LoadingSkeleton"},a("ui-skeleton",{structure:"title",height:"20px",width:"auto"}));return a("div",{ref:t=>this.stylingContainer=t},a("div",{class:"PamAccountBalanceModal"},this.isLoading?o:a("div",null,t,e)),this.isModalDisplayed&&a("button",{class:"PamAccountBalanceModalOverlay",onClick:()=>this.toggleModal("close")}))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};u.style='*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.PamAccountBalanceModal{position:relative}.PamAccountBalanceModal .LoadingSkeleton{border-radius:10px;overflow:hidden;width:60px}.PamAccountBalanceModal .BalanceValue{font-size:14px;cursor:pointer;background:transparent;border:none;font:inherit;color:inherit;display:flex;flex-wrap:nowrap;white-space:nowrap}.PamAccountBalanceModal .BalanceValue svg{width:16px;fill:var(--emw--color-black, #000000)}.PamAccountBalanceModal .BalanceValue span{padding-left:5px}.PamAccountBalanceModal .BalanceValue .TriangleActive,.PamAccountBalanceModal .BalanceValue .TriangleInactive{display:block;margin:0 3px;transition:all 0.2s}.PamAccountBalanceModal .BalanceValue .TriangleActive:hover,.PamAccountBalanceModal .BalanceValue .TriangleInactive:hover{transform:scale(1.2)}.PamAccountBalanceModal .BalanceValue .TriangleActive svg,.PamAccountBalanceModal .BalanceValue .TriangleInactive svg{margin:2px 0px}.PamAccountBalanceModal .BalanceValue .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px)}.PamAccountBalanceModal .BalanceValue .TriangleActive:hover{transform:scale(1.1) rotateX(180deg) translateY(3px)}@media only screen and (max-width: 360px){.PamAccountBalanceModal .BalanceValue{font-size:12px}.PamAccountBalanceModal .BalanceValue svg{width:12px}}.PamAccountBalanceModal .BalanceModalWrapper{background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);position:absolute;top:40px;padding:10px;transform:translateX(-45%);box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919;transition:all 0.2s ease-in;opacity:0}.PamAccountBalanceModal .BalanceModalWrapper:before{content:"";background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:50%;width:25px;height:10px;z-index:1}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer;transition:all 0.3s ease;background:transparent;border:none;font:inherit}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModalClose:before{content:"";background:var(--emw--color-secondary, #FFFFFF);position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModalClose:after{content:"";background:var(--emw--color-secondary, #FFFFFF);position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModalClose:hover{transform:scale(1.1)}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal{transition:all 0.2s ease-in;width:270px}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #FFFFFF))}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalBody .BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalBody .BalanceModalRowBoth:last-child{border-bottom:none}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalBody .BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalBody .BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #FFFFFF));font-size:14px;text-transform:capitalize}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalBody .BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #FFFFFF))}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalFooter .BalanceModalAction{background:var(--emw--color-primary, #22B04E);font-size:12px;color:var(--emw--color-white, #FFFFFF);text-transform:uppercase;width:100%;border-radius:30px;border:none;padding:10px 0;cursor:pointer;transition:all 0.2s ease-in;box-shadow:0px 3px 7px 0px rgba(0, 0, 0, 0.2)}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalFooter .BalanceModalAction:hover{background:rgba(255, 255, 255, 0.1);color:var(--emw--color-primary, #22B04E);box-shadow:0px 0px 0px 2px inset var(--emw--color-primary, #22B04E);font-size:14px}.PamAccountBalanceModal .BalanceModalWrapper .BalanceModal .BalanceModalFooter .BalanceModalAction:active{background:rgba(255, 255, 255, 0.5)}.PamAccountBalanceModal .BalanceModalWrapper.Open{opacity:1}.PamAccountBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16;opacity:0;transition:all 0.2s linear}.PamAccountBalanceModalOverlay.Open{opacity:1}';export{u as P}
|
@@ -1 +1 @@
|
|
1
|
-
export{P as pam_account_balance_modal}from"./p-
|
1
|
+
export{P as pam_account_balance_modal}from"./p-7eb9a9a8.js";import{r as e,h as t,H as n}from"./p-86b371f2.js";const i=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight),size:this.handleStylingProps(this.size)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.stylingValue.size};\n }\n `;break;default:e=""}return t(n,{key:"e6b885bfd985ce7663d990756fe9101e25eb97f0"},t("style",{key:"06ae24c7bb74f4dacfc12ae58085333f9dc89da5"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};i.style=":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";export{i as ui_skeleton}
|
@@ -1 +1 @@
|
|
1
|
-
import{p as
|
1
|
+
import{p as t,b as i}from"./p-86b371f2.js";export{s as setNonce}from"./p-86b371f2.js";import{g as a}from"./p-e1255160.js";(()=>{const i=import.meta.url,a={};return""!==i&&(a.resourcesUrl=new URL(".",i).href),t(a)})().then((async t=>(await a(),i([["p-80fbb82a",[[1,"pam-account-balance-modal",{userId:[513,"user-id"],session:[513],endpoint:[513],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],language:[513],displayBalanceOption:[513,"display-balance-option"],totalCalculationMode:[513,"total-calculation-mode"],currencyLocale:[513,"currency-locale"],currencyDisplay:[520,"currency-display"],maximumFractionDigits:[513,"maximum-fraction-digits"],minimumFractionDigits:[513,"minimum-fraction-digits"],customDisplayFormat:[513,"custom-display-format"],isLoading:[32],isModalDisplayed:[32],isSplitWallet:[32],currentStream:[32],currency:[32],updateRealAmountState:[32],balances:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[8,"border-radius"],marginBottom:[8,"margin-bottom"],marginTop:[8,"margin-top"],marginLeft:[8,"margin-left"],marginRight:[8,"margin-right"],animation:[4],rows:[2],size:[1]},null,{structure:["handleStructureChange"]}]]]],t))));
|
@@ -5,17 +5,24 @@ export declare class PamAccountBalanceModal {
|
|
5
5
|
userId: string;
|
6
6
|
session: string;
|
7
7
|
endpoint: string;
|
8
|
-
customLocaleIdentifier: string;
|
9
|
-
displayBalanceOption: string;
|
10
|
-
totalCalculationMode: string;
|
11
|
-
currencySeparator: string;
|
12
|
-
currencyDecimal: string;
|
13
|
-
currencyPrecision: string;
|
14
8
|
mbSource: string;
|
15
9
|
clientStyling: string;
|
16
10
|
clientStylingUrl: string;
|
17
11
|
translationUrl: string;
|
18
12
|
language: string;
|
13
|
+
displayBalanceOption: string;
|
14
|
+
totalCalculationMode: string;
|
15
|
+
currencyLocale: string;
|
16
|
+
currencyDisplay: any;
|
17
|
+
maximumFractionDigits: string;
|
18
|
+
minimumFractionDigits: string;
|
19
|
+
/**
|
20
|
+
* The {} blocks are replaced by their respective values. Everything else in the string is left as it is.
|
21
|
+
* The "amount" block also accepts arguments that must be placed after "|".
|
22
|
+
* First char is the Thousands Separator, second is the Decimal Separator, third is Decimal Precision.
|
23
|
+
* An empty value (' ') indicates that the default values should be used for that specific arg.
|
24
|
+
*/
|
25
|
+
customDisplayFormat: string;
|
19
26
|
private stylingContainer;
|
20
27
|
private stylingSubscription;
|
21
28
|
isLoading: boolean;
|
@@ -32,8 +39,19 @@ export declare class PamAccountBalanceModal {
|
|
32
39
|
componentWillLoad(): void;
|
33
40
|
componentDidLoad(): void;
|
34
41
|
disconnectedCallback(): void;
|
35
|
-
|
42
|
+
/**
|
43
|
+
* Returns the formatted balance
|
44
|
+
* @param balance -> the balance value to be formatted
|
45
|
+
*/
|
36
46
|
formatBalance: (balance: number) => string;
|
47
|
+
/**
|
48
|
+
* Parses customdisplayformat and returns the formatted balance accordingly.
|
49
|
+
* Example:
|
50
|
+
* if customdisplayformat = '{amount|,.1} {currency}', currency = 'EUR'
|
51
|
+
* then formatFromCustom(123123.199) = '123,123.1 EUR'
|
52
|
+
* @param balance
|
53
|
+
*/
|
54
|
+
formatFromCustom: (balance: number) => string;
|
37
55
|
getBalances: () => Promise<Record<string, any>>;
|
38
56
|
setBalances(balanceData: Record<string, any>): void;
|
39
57
|
setBalancesWhenSingleWallet(balanceData: Record<string, any>): void;
|
@@ -9,14 +9,18 @@ export namespace Components {
|
|
9
9
|
interface PamAccountBalanceModal {
|
10
10
|
"clientStyling": string;
|
11
11
|
"clientStylingUrl": string;
|
12
|
-
"
|
13
|
-
"
|
14
|
-
|
15
|
-
|
12
|
+
"currencyDisplay": any;
|
13
|
+
"currencyLocale": string;
|
14
|
+
/**
|
15
|
+
* The {} blocks are replaced by their respective values. Everything else in the string is left as it is. The "amount" block also accepts arguments that must be placed after "|". First char is the Thousands Separator, second is the Decimal Separator, third is Decimal Precision. An empty value (' ') indicates that the default values should be used for that specific arg.
|
16
|
+
*/
|
17
|
+
"customDisplayFormat": string;
|
16
18
|
"displayBalanceOption": string;
|
17
19
|
"endpoint": string;
|
18
20
|
"language": string;
|
21
|
+
"maximumFractionDigits": string;
|
19
22
|
"mbSource": string;
|
23
|
+
"minimumFractionDigits": string;
|
20
24
|
"session": string;
|
21
25
|
"totalCalculationMode": string;
|
22
26
|
"translationUrl": string;
|
@@ -38,14 +42,18 @@ declare namespace LocalJSX {
|
|
38
42
|
interface PamAccountBalanceModal {
|
39
43
|
"clientStyling"?: string;
|
40
44
|
"clientStylingUrl"?: string;
|
41
|
-
"
|
42
|
-
"
|
43
|
-
|
44
|
-
|
45
|
+
"currencyDisplay"?: any;
|
46
|
+
"currencyLocale"?: string;
|
47
|
+
/**
|
48
|
+
* The {} blocks are replaced by their respective values. Everything else in the string is left as it is. The "amount" block also accepts arguments that must be placed after "|". First char is the Thousands Separator, second is the Decimal Separator, third is Decimal Precision. An empty value (' ') indicates that the default values should be used for that specific arg.
|
49
|
+
*/
|
50
|
+
"customDisplayFormat"?: string;
|
45
51
|
"displayBalanceOption"?: string;
|
46
52
|
"endpoint"?: string;
|
47
53
|
"language"?: string;
|
54
|
+
"maximumFractionDigits"?: string;
|
48
55
|
"mbSource"?: string;
|
56
|
+
"minimumFractionDigits"?: string;
|
49
57
|
"session"?: string;
|
50
58
|
"totalCalculationMode"?: string;
|
51
59
|
"translationUrl"?: string;
|