@everymatrix/casino-challenges-player-history 0.0.1

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.
Files changed (62) hide show
  1. package/dist/casino-challenges-player-history/app-globals-0f993ce5.js +1 -0
  2. package/dist/casino-challenges-player-history/casino-challenges-player-history-67980c33.js +1 -0
  3. package/dist/casino-challenges-player-history/casino-challenges-player-history.esm.js +1 -0
  4. package/dist/casino-challenges-player-history/casino-challenges-player-history_2.entry.js +1 -0
  5. package/dist/casino-challenges-player-history/index-29d1f02c.js +2 -0
  6. package/dist/casino-challenges-player-history/index.esm.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/casino-challenges-player-history-0b3c162e.js +2438 -0
  9. package/dist/cjs/casino-challenges-player-history.cjs.js +25 -0
  10. package/dist/cjs/casino-challenges-player-history_2.cjs.entry.js +183 -0
  11. package/dist/cjs/index-f241bc8a.js +1245 -0
  12. package/dist/cjs/index.cjs.js +10 -0
  13. package/dist/cjs/loader.cjs.js +15 -0
  14. package/dist/collection/assets/arrow-down.svg +3 -0
  15. package/dist/collection/assets/arrow-up.svg +3 -0
  16. package/dist/collection/assets/gift.svg +9 -0
  17. package/dist/collection/collection-manifest.json +19 -0
  18. package/dist/collection/components/casino-challenges-player-history/casino-challenges-player-history.css +122 -0
  19. package/dist/collection/components/casino-challenges-player-history/casino-challenges-player-history.js +306 -0
  20. package/dist/collection/components/casino-challenges-player-history/index.js +1 -0
  21. package/dist/collection/index.js +1 -0
  22. package/dist/collection/utils/locale.utils.js +54 -0
  23. package/dist/collection/utils/types.js +7 -0
  24. package/dist/collection/utils/utils.js +3 -0
  25. package/dist/esm/app-globals-0f993ce5.js +3 -0
  26. package/dist/esm/casino-challenges-player-history-67980c33.js +2436 -0
  27. package/dist/esm/casino-challenges-player-history.js +20 -0
  28. package/dist/esm/casino-challenges-player-history_2.entry.js +178 -0
  29. package/dist/esm/index-29d1f02c.js +1217 -0
  30. package/dist/esm/index.js +2 -0
  31. package/dist/esm/loader.js +11 -0
  32. package/dist/index.cjs.js +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/stencil.config.dev.js +19 -0
  35. package/dist/stencil.config.js +19 -0
  36. package/dist/storybook/main.js +43 -0
  37. package/dist/storybook/preview.js +9 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/packages/stencil/casino-challenges-player-history/stencil.config.d.ts +2 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/packages/stencil/casino-challenges-player-history/stencil.config.dev.d.ts +2 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/packages/stencil/casino-challenges-player-history/storybook/main.d.ts +3 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/packages/stencil/casino-challenges-player-history/storybook/preview.d.ts +70 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/tools/plugins/index.d.ts +4 -0
  44. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  45. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  46. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  47. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-player-history/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  48. package/dist/types/components/casino-challenges-player-history/casino-challenges-player-history.d.ts +60 -0
  49. package/dist/types/components/casino-challenges-player-history/index.d.ts +1 -0
  50. package/dist/types/components.d.ts +122 -0
  51. package/dist/types/index.d.ts +1 -0
  52. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  53. package/dist/types/utils/locale.utils.d.ts +3 -0
  54. package/dist/types/utils/types.d.ts +27 -0
  55. package/dist/types/utils/utils.d.ts +1 -0
  56. package/loader/cdn.js +1 -0
  57. package/loader/index.cjs.js +1 -0
  58. package/loader/index.d.ts +24 -0
  59. package/loader/index.es2017.js +1 -0
  60. package/loader/index.js +2 -0
  61. package/loader/package.json +11 -0
  62. package/package.json +27 -0
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const casinoChallengesPlayerHistory = require('./casino-challenges-player-history-0b3c162e.js');
6
+ require('./index-f241bc8a.js');
7
+
8
+
9
+
10
+ exports.CasinoChallengesPlayerHistory = casinoChallengesPlayerHistory.CasinoChallengesPlayerHistory;
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-f241bc8a.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ const defineCustomElements = async (win, options) => {
9
+ if (typeof window === 'undefined') return undefined;
10
+ await appGlobals.globalScripts();
11
+ return index.bootstrapLazy([["casino-challenges-player-history_2.cjs",[[1,"casino-challenges-player-history",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"playerHistory":[16],"loading":[516],"hasMore":[516,"has-more"],"openItems":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"playerHistory":["handlePlayerHistoryChange"]}],[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);
12
+ };
13
+
14
+ exports.setNonce = index.setNonce;
15
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,3 @@
1
+ <svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0.41107 0.910582C0.736507 0.585145 1.26414 0.585145 1.58958 0.910582L6.00033 5.32133L10.4111 0.910582C10.7365 0.585145 11.2641 0.585145 11.5896 0.910582C11.915 1.23602 11.915 1.76366 11.5896 2.08909L6.58958 7.08909C6.26414 7.41453 5.73651 7.41453 5.41107 7.08909L0.41107 2.08909C0.0856329 1.76366 0.0856329 1.23602 0.41107 0.910582Z" fill="#C8D6CE"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5.41107 0.910826C5.73651 0.585389 6.26414 0.585389 6.58958 0.910826L11.5896 5.91083C11.915 6.23626 11.915 6.7639 11.5896 7.08934C11.2641 7.41477 10.7365 7.41477 10.4111 7.08934L6.00033 2.67859L1.58958 7.08934C1.26414 7.41477 0.736507 7.41477 0.41107 7.08934C0.0856329 6.7639 0.0856329 6.23626 0.41107 5.91083L5.41107 0.910826Z" fill="#C8D6CE"/>
3
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="14" height="13" viewBox="0 0 14 13" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.93718 1.24992C4.79142 1.24992 4.64946 1.30878 4.54313 1.41704C4.43645 1.52566 4.37468 1.67518 4.37468 1.83325C4.37468 1.99132 4.43645 2.14084 4.54313 2.24946C4.64946 2.35773 4.79142 2.41659 4.93718 2.41659H6.20299C6.16076 2.31663 6.11217 2.2131 6.05675 2.11049C5.77333 1.58581 5.40949 1.24992 4.93718 1.24992ZM6.41634 3.58325V5.33325L2.09968 5.33325C1.9267 5.33325 1.83206 5.3328 1.76405 5.32724C1.76134 5.32702 1.75878 5.3268 1.75636 5.32657C1.75613 5.32415 1.75591 5.32159 1.75569 5.31888C1.75013 5.25087 1.74968 5.15623 1.74968 4.98325V3.93325C1.74968 3.76028 1.75013 3.66563 1.75569 3.59762C1.75591 3.59491 1.75613 3.59235 1.75636 3.58993C1.75878 3.58971 1.76134 3.58948 1.76405 3.58926C1.83206 3.58371 1.9267 3.58325 2.09968 3.58325H6.41634ZM3.3069 2.41659C3.24197 2.2307 3.20801 2.03356 3.20801 1.83325C3.20801 1.37248 3.38768 0.928511 3.71077 0.599548C4.03421 0.270228 4.47515 0.083252 4.93718 0.083252C5.98409 0.083252 6.63366 0.794017 6.99968 1.40872C7.3657 0.794017 8.01527 0.083252 9.06218 0.083252C9.52421 0.083252 9.96514 0.270228 10.2886 0.599548C10.6117 0.928511 10.7913 1.37248 10.7913 1.83325C10.7913 2.03356 10.7574 2.2307 10.6925 2.41659L11.9183 2.41658C12.0655 2.41657 12.2089 2.41655 12.3303 2.42647C12.4637 2.43737 12.621 2.46307 12.7793 2.54374C12.9989 2.6556 13.1773 2.83407 13.2892 3.0536C13.3699 3.21193 13.3956 3.36927 13.4065 3.50262C13.4164 3.62404 13.4164 3.76742 13.4163 3.91463V5.00187C13.4164 5.14909 13.4164 5.29246 13.4065 5.41389C13.3956 5.54723 13.3699 5.70458 13.2892 5.86291C13.1773 6.08243 12.9989 6.26091 12.7793 6.37276C12.621 6.45343 12.4637 6.47914 12.3303 6.49003C12.3044 6.49215 12.2774 6.49382 12.2497 6.49513V10.4891C12.2497 10.7966 12.2497 11.0619 12.2318 11.2804C12.213 11.511 12.1714 11.7403 12.0589 11.9611C11.8912 12.2904 11.6234 12.5581 11.2942 12.7258C11.0734 12.8383 10.8441 12.8799 10.6134 12.8988C10.3949 12.9166 10.1297 12.9166 9.82218 12.9166H7.00049C7.00022 12.9166 6.99995 12.9166 6.99968 12.9166C6.99941 12.9166 6.99913 12.9166 6.99886 12.9166H4.17718C3.86968 12.9166 3.60441 12.9166 3.38591 12.8988C3.15529 12.8799 2.92592 12.8383 2.70519 12.7258C2.37591 12.5581 2.10819 12.2904 1.94042 11.9611C1.82795 11.7403 1.78635 11.511 1.76751 11.2804C1.74966 11.0619 1.74967 10.7966 1.74968 10.4891L1.74968 6.49513C1.72192 6.49382 1.69498 6.49215 1.66904 6.49003C1.5357 6.47914 1.37835 6.45343 1.22002 6.37276C1.0005 6.26091 0.822022 6.08243 0.71017 5.86291C0.629496 5.70458 0.60379 5.54723 0.592896 5.41389C0.582975 5.29246 0.582992 5.14908 0.583009 5.00186L0.583011 3.93325C0.583011 3.92704 0.58301 3.92084 0.583009 3.91465C0.582992 3.76742 0.582975 3.62404 0.592896 3.50262C0.60379 3.36927 0.629497 3.21193 0.71017 3.0536C0.822022 2.83407 1.0005 2.6556 1.22002 2.54374C1.37835 2.46307 1.5357 2.43737 1.66904 2.42647C1.79047 2.41655 1.93385 2.41657 2.08107 2.41658C2.08727 2.41658 2.09347 2.41659 2.09968 2.41659H3.3069ZM2.91634 6.49992V10.4666C2.91634 10.8029 2.9168 11.0201 2.9303 11.1853C2.94325 11.3438 2.96523 11.4026 2.97992 11.4314C3.03585 11.5412 3.12509 11.6304 3.23485 11.6863C3.26369 11.701 3.32244 11.723 3.48092 11.736C3.6462 11.7495 3.86335 11.7499 4.19968 11.7499H6.41634V6.49992H2.91634ZM7.58301 6.49992V11.7499H9.79968C10.136 11.7499 10.3532 11.7495 10.5184 11.736C10.6769 11.723 10.7357 11.701 10.7645 11.6863C10.8743 11.6304 10.9635 11.5412 11.0194 11.4314C11.0341 11.4026 11.0561 11.3438 11.0691 11.1853C11.0826 11.0201 11.083 10.8029 11.083 10.4666V6.49992H7.58301ZM11.8997 5.33325C12.0727 5.33325 12.1673 5.3328 12.2353 5.32724C12.238 5.32702 12.2406 5.32679 12.243 5.32657C12.2432 5.32415 12.2434 5.32159 12.2437 5.31888C12.2492 5.25087 12.2497 5.15623 12.2497 4.98325V3.93325C12.2497 3.76028 12.2492 3.66563 12.2437 3.59762C12.2434 3.59492 12.2432 3.59235 12.243 3.58993C12.2406 3.58971 12.238 3.58948 12.2353 3.58926C12.1673 3.58371 12.0727 3.58325 11.8997 3.58325H7.58301V5.33325H11.8997ZM9.06218 2.41659C9.20794 2.41659 9.34989 2.35773 9.45623 2.24946C9.56291 2.14084 9.62468 1.99132 9.62468 1.83325C9.62468 1.67518 9.56291 1.52566 9.45623 1.41704C9.34989 1.30878 9.20794 1.24992 9.06218 1.24992C8.58986 1.24992 8.22603 1.58581 7.94261 2.11049C7.88718 2.2131 7.83859 2.31663 7.79637 2.41659H9.06218Z" fill="url(#paint0_linear_1520_2981)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_1520_2981" x1="6.99968" y1="0.083252" x2="6.99968" y2="12.9166" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#EA9018"/>
6
+ <stop offset="1" stop-color="#E0A84E"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1,19 @@
1
+ {
2
+ "entries": [
3
+ "components/casino-challenges-player-history/casino-challenges-player-history.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "4.19.2",
8
+ "typescriptVersion": "5.4.5"
9
+ },
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/ui-skeleton",
13
+ "tags": [
14
+ "ui-skeleton"
15
+ ]
16
+ }
17
+ ],
18
+ "bundles": []
19
+ }
@@ -0,0 +1,122 @@
1
+ .history {
2
+ width: 100%;
3
+ padding: 0 10%;
4
+ box-sizing: border-box;
5
+ display: flex;
6
+ gap: 16px;
7
+ flex-direction: column;
8
+ }
9
+ @container challenges-container (max-width: 800px) {
10
+ .history {
11
+ padding: 0;
12
+ }
13
+ }
14
+
15
+ .item {
16
+ background-color: var(--emw--history-item-background, rgba(114, 118, 114, 0.2));
17
+ border-radius: 12px;
18
+ padding: 20px;
19
+ }
20
+
21
+ .header {
22
+ cursor: pointer;
23
+ border: none;
24
+ width: 100%;
25
+ text-align: left;
26
+ background: transparent;
27
+ color: var(--emw--color-white, white);
28
+ font-size: var(--emw--font-size-medium, 16px);
29
+ font-weight: var(--emw--font-weight-bold, 700);
30
+ display: flex;
31
+ justify-content: space-between;
32
+ padding: 0;
33
+ }
34
+ @container challenges-container (max-width: 800px) {
35
+ .header {
36
+ line-height: var(--emw--font-size-medium, 14px);
37
+ }
38
+ }
39
+
40
+ .content {
41
+ max-height: 0;
42
+ overflow: auto;
43
+ transition: max-height 0.3s ease;
44
+ background: transparent;
45
+ color: var(--emw--color-white, white);
46
+ }
47
+ .content.open {
48
+ max-height: 400px;
49
+ }
50
+ .content .row {
51
+ display: flex;
52
+ font-size: var(--emw--font-size-medium, 14px);
53
+ font-weight: var(--emw--font-weight-medium, 500);
54
+ line-height: 24px;
55
+ padding: 10px 12px 4px;
56
+ box-sizing: border-box;
57
+ color: var(--emw--color-gray-150, #c8d6ce);
58
+ }
59
+ .content .row .col-1 {
60
+ flex-grow: 1;
61
+ }
62
+ .content .row .col-2 {
63
+ width: 120px;
64
+ }
65
+ .content .row .col-2.errored {
66
+ color: var(--emw--color-error, #D6421E);
67
+ }
68
+ @container challenges-container (max-width: 800px) {
69
+ .content .row {
70
+ font-size: var(--emw--font-size-small, 12px);
71
+ line-height: 22px;
72
+ }
73
+ }
74
+ @container challenges-container (max-width: 620px) {
75
+ .content .row .col-1,
76
+ .content .row .col-2 {
77
+ width: 91px;
78
+ }
79
+ }
80
+ .content .reward {
81
+ margin: 0;
82
+ padding: 0 12px 10px;
83
+ box-sizing: border-box;
84
+ font-size: var(--emw--font-size-small, 12px);
85
+ font-weight: var(--emw--font-weight-medium, 500);
86
+ line-height: 19px;
87
+ color: var(--emw--color-valid, #03873e);
88
+ border-bottom: 1px solid var(--emw--button-border-color, rgba(200, 214, 206, 0.1019607843));
89
+ display: flex;
90
+ gap: 8px;
91
+ }
92
+ .content .reward.grayed {
93
+ color: var(--emw--color-gray-300, #555a57);
94
+ }
95
+ @container challenges-container (max-width: 800px) {
96
+ .content .reward {
97
+ font-size: var(--emw--font-size-small, 12px);
98
+ line-height: 14px;
99
+ }
100
+ .content .reward img {
101
+ width: 12px;
102
+ height: 12px;
103
+ }
104
+ }
105
+ .content .list-header {
106
+ padding: 0 12px;
107
+ margin-top: 20px;
108
+ border-radius: 6px 6px 0 0;
109
+ color: var(--emw--history-header-color, #727672);
110
+ background: var(--emw--history-item-header-background, #202120);
111
+ }
112
+ .content .list-header span {
113
+ font-size: var(--emw--font-size-small, 12px);
114
+ font-weight: var(--emw--font-weight-bold, 700);
115
+ line-height: 28px;
116
+ }
117
+ @container challenges-container (max-width: 800px) {
118
+ .content .list-header span {
119
+ font-size: var(--emw--font-size-x-small, 10px);
120
+ line-height: 20px;
121
+ }
122
+ }
@@ -0,0 +1,306 @@
1
+ import { h } from "@stencil/core";
2
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
3
+ import { EHistoryItemLevelStatus, HistoryItemLevelStatusDictionary } from "../../utils/types";
4
+ import { resolveTranslationUrl, translate } from "../../utils/locale.utils";
5
+ import arrowUpIcon from "../../assets/arrow-up.svg";
6
+ import arrowDownIcon from "../../assets/arrow-down.svg";
7
+ import giftIcon from "../../assets/gift.svg";
8
+ import { format } from "date-fns";
9
+ import "../../../../../ui-skeleton/dist/types/index";
10
+ const skeletons = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
11
+ export class CasinoChallengesPlayerHistory {
12
+ constructor() {
13
+ this.setLastItemRef = (el) => {
14
+ if (this.lastItemRef && this.observer) {
15
+ this.observer.unobserve(this.lastItemRef);
16
+ }
17
+ this.lastItemRef = el;
18
+ if (el && this.observer && !this.loading) {
19
+ this.observer.observe(el);
20
+ }
21
+ };
22
+ this.mbSource = undefined;
23
+ this.clientStyling = undefined;
24
+ this.clientStylingUrl = undefined;
25
+ this.translationUrl = '';
26
+ this.language = 'en';
27
+ this.playerHistory = [];
28
+ this.loading = false;
29
+ this.hasMore = false;
30
+ this.openItems = [];
31
+ }
32
+ handleClientStylingChange(newValue, oldValue) {
33
+ if (newValue != oldValue) {
34
+ setClientStyling(this.stylingContainer, this.clientStyling);
35
+ }
36
+ }
37
+ handleClientStylingUrlChange(newValue, oldValue) {
38
+ if (newValue != oldValue) {
39
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
40
+ }
41
+ }
42
+ handleMbSourceChange(newValue, oldValue) {
43
+ if (newValue != oldValue) {
44
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
45
+ }
46
+ }
47
+ handlePlayerHistoryChange() {
48
+ this.openItems = this.playerHistory.map(() => false);
49
+ }
50
+ setupObserver() {
51
+ if (!this.lastItemRef || this.loading || !this.hasMore)
52
+ return;
53
+ if (!this.observer) {
54
+ this.observer = new IntersectionObserver(([entry]) => {
55
+ if (entry.isIntersecting && !this.loading && this.hasMore) {
56
+ this.observer.unobserve(entry.target);
57
+ this.loadMore.emit();
58
+ }
59
+ }, {
60
+ root: null,
61
+ rootMargin: '0px',
62
+ threshold: 0.1
63
+ });
64
+ }
65
+ this.observer.disconnect();
66
+ this.observer.observe(this.lastItemRef);
67
+ }
68
+ componentDidLoad() {
69
+ if (this.stylingContainer) {
70
+ if (this.mbSource)
71
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
72
+ if (this.clientStyling)
73
+ setClientStyling(this.stylingContainer, this.clientStyling);
74
+ if (this.clientStylingUrl)
75
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
76
+ }
77
+ }
78
+ componentWillLoad() {
79
+ if (this.translationUrl) {
80
+ resolveTranslationUrl(this.translationUrl);
81
+ }
82
+ }
83
+ componentDidRender() {
84
+ this.setupObserver();
85
+ }
86
+ disconnectedCallback() {
87
+ var _a;
88
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
89
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
90
+ this.observer = undefined;
91
+ }
92
+ toggle(index) {
93
+ this.openItems = this.openItems.map((open, i) => (i === index ? !open : open));
94
+ }
95
+ renderLevel(level) {
96
+ const rewards = Object.values(level.Rewards)
97
+ .map((r) => r.RewardDescription)
98
+ .join(', ');
99
+ return (h("div", null, h("div", { class: "row" }, h("span", { class: "col-1" }, `${translate('level', this.language)} ${level.OrderNumber + 1}`), h("span", { class: `col-2 ${level.Status === EHistoryItemLevelStatus.Forfeited ? 'errored' : ''}` }, HistoryItemLevelStatusDictionary[level.Status]), h("span", { class: "col-2" }, format(new Date(level.Time), 'dd/MM/yy HH:mm'))), h("p", { class: `reward ${level.Status === EHistoryItemLevelStatus.Completed ? '' : 'grayed'}` }, h("img", { src: giftIcon }), rewards)));
100
+ }
101
+ renderSkeletons() {
102
+ return skeletons.map((skeleton) => (h("div", { class: "loader", key: skeleton }, h("ui-skeleton", { structure: "title", width: "auto", height: "60px", marginBottom: 0 }))));
103
+ }
104
+ render() {
105
+ return (h("div", { key: '0781f3ee74b3f3b8b5b09e3269974e876ece82ef', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '78108ee5c86b0e87363e9ed980c242890f2453b1', class: "history" }, this.playerHistory.map((item, index) => (h("div", { class: "item", ref: index === this.playerHistory.length - 1 ? this.setLastItemRef : null }, h("button", { class: "header", onClick: () => this.toggle(index) }, h("span", null, item.Name), h("img", { src: this.openItems[index] ? arrowUpIcon : arrowDownIcon })), h("div", { class: `content ${this.openItems[index] ? 'open' : ''}` }, h("div", { class: "row list-header" }, h("span", { class: "col-1", style: { textTransform: 'uppercase' } }, translate('level', this.language)), h("span", { class: "col-2", style: { textTransform: 'uppercase' } }, translate('status', this.language)), h("span", { class: "col-2", style: { textTransform: 'uppercase' } }, translate('time', this.language))), item.Levels.map((level) => this.renderLevel(level)))))), this.loading && this.renderSkeletons())));
106
+ }
107
+ static get is() { return "casino-challenges-player-history"; }
108
+ static get encapsulation() { return "shadow"; }
109
+ static get originalStyleUrls() {
110
+ return {
111
+ "$": ["casino-challenges-player-history.scss"]
112
+ };
113
+ }
114
+ static get styleUrls() {
115
+ return {
116
+ "$": ["casino-challenges-player-history.css"]
117
+ };
118
+ }
119
+ static get properties() {
120
+ return {
121
+ "mbSource": {
122
+ "type": "string",
123
+ "mutable": false,
124
+ "complexType": {
125
+ "original": "string",
126
+ "resolved": "string",
127
+ "references": {}
128
+ },
129
+ "required": false,
130
+ "optional": false,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": "Client custom styling via message bus"
134
+ },
135
+ "attribute": "mb-source",
136
+ "reflect": true
137
+ },
138
+ "clientStyling": {
139
+ "type": "string",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "string",
143
+ "resolved": "string",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": "Client custom styling via string"
151
+ },
152
+ "attribute": "client-styling",
153
+ "reflect": true
154
+ },
155
+ "clientStylingUrl": {
156
+ "type": "string",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "string",
160
+ "resolved": "string",
161
+ "references": {}
162
+ },
163
+ "required": false,
164
+ "optional": false,
165
+ "docs": {
166
+ "tags": [],
167
+ "text": "Client custom styling via css file url"
168
+ },
169
+ "attribute": "client-styling-url",
170
+ "reflect": true
171
+ },
172
+ "translationUrl": {
173
+ "type": "string",
174
+ "mutable": false,
175
+ "complexType": {
176
+ "original": "string",
177
+ "resolved": "string",
178
+ "references": {}
179
+ },
180
+ "required": false,
181
+ "optional": false,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": "Client custom translation via json file url"
185
+ },
186
+ "attribute": "translation-url",
187
+ "reflect": true,
188
+ "defaultValue": "''"
189
+ },
190
+ "language": {
191
+ "type": "string",
192
+ "mutable": false,
193
+ "complexType": {
194
+ "original": "string",
195
+ "resolved": "string",
196
+ "references": {}
197
+ },
198
+ "required": false,
199
+ "optional": false,
200
+ "docs": {
201
+ "tags": [],
202
+ "text": "Client custom language for translation"
203
+ },
204
+ "attribute": "language",
205
+ "reflect": true,
206
+ "defaultValue": "'en'"
207
+ },
208
+ "playerHistory": {
209
+ "type": "unknown",
210
+ "mutable": false,
211
+ "complexType": {
212
+ "original": "IHistoryItem[]",
213
+ "resolved": "IHistoryItem[]",
214
+ "references": {
215
+ "IHistoryItem": {
216
+ "location": "import",
217
+ "path": "../../utils/types",
218
+ "id": "../../../../packages/stencil/casino-challenges-player-history/src/utils/types.ts::IHistoryItem"
219
+ }
220
+ }
221
+ },
222
+ "required": false,
223
+ "optional": false,
224
+ "docs": {
225
+ "tags": [],
226
+ "text": "Player challenges history list"
227
+ },
228
+ "defaultValue": "[]"
229
+ },
230
+ "loading": {
231
+ "type": "boolean",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "boolean",
235
+ "resolved": "boolean",
236
+ "references": {}
237
+ },
238
+ "required": false,
239
+ "optional": false,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": "Are player challenge history loading"
243
+ },
244
+ "attribute": "loading",
245
+ "reflect": true,
246
+ "defaultValue": "false"
247
+ },
248
+ "hasMore": {
249
+ "type": "boolean",
250
+ "mutable": false,
251
+ "complexType": {
252
+ "original": "boolean",
253
+ "resolved": "boolean",
254
+ "references": {}
255
+ },
256
+ "required": false,
257
+ "optional": false,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": "Are challenges history list has more item"
261
+ },
262
+ "attribute": "has-more",
263
+ "reflect": true,
264
+ "defaultValue": "false"
265
+ }
266
+ };
267
+ }
268
+ static get states() {
269
+ return {
270
+ "openItems": {}
271
+ };
272
+ }
273
+ static get events() {
274
+ return [{
275
+ "method": "loadMore",
276
+ "name": "loadMore",
277
+ "bubbles": true,
278
+ "cancelable": true,
279
+ "composed": true,
280
+ "docs": {
281
+ "tags": [],
282
+ "text": "Event when scrolled down triggered"
283
+ },
284
+ "complexType": {
285
+ "original": "any",
286
+ "resolved": "any",
287
+ "references": {}
288
+ }
289
+ }];
290
+ }
291
+ static get watchers() {
292
+ return [{
293
+ "propName": "clientStyling",
294
+ "methodName": "handleClientStylingChange"
295
+ }, {
296
+ "propName": "clientStylingUrl",
297
+ "methodName": "handleClientStylingUrlChange"
298
+ }, {
299
+ "propName": "mbSource",
300
+ "methodName": "handleMbSourceChange"
301
+ }, {
302
+ "propName": "playerHistory",
303
+ "methodName": "handlePlayerHistoryChange"
304
+ }];
305
+ }
306
+ }
@@ -0,0 +1 @@
1
+ export { CasinoChallengesPlayerHistory } from './casino-challenges-player-history';
@@ -0,0 +1 @@
1
+ export * from './components/casino-challenges-player-history';
@@ -0,0 +1,54 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const TRANSLATIONS = {
3
+ en: {
4
+ level: 'Level',
5
+ status: 'Status',
6
+ time: 'Time'
7
+ },
8
+ ro: {
9
+ level: 'Nivel',
10
+ status: 'Stare',
11
+ time: 'Timp'
12
+ },
13
+ fr: {
14
+ level: 'Niveau',
15
+ status: 'Statut',
16
+ time: 'Temps'
17
+ },
18
+ ar: {
19
+ level: 'المستوى',
20
+ status: 'الحالة',
21
+ time: 'الوقت'
22
+ },
23
+ hr: {
24
+ level: 'Razina',
25
+ status: 'Status',
26
+ time: 'Vrijeme'
27
+ }
28
+ };
29
+ export const translate = (key, customLang) => {
30
+ const lang = customLang;
31
+ return TRANSLATIONS[lang !== undefined && lang in TRANSLATIONS ? lang : DEFAULT_LANGUAGE][key];
32
+ };
33
+ export const getTranslations = (data) => {
34
+ Object.keys(data).forEach((item) => {
35
+ for (let key in data[item]) {
36
+ TRANSLATIONS[item][key] = data[item][key];
37
+ }
38
+ });
39
+ };
40
+ export const resolveTranslationUrl = async (translationUrl) => {
41
+ if (translationUrl) {
42
+ try {
43
+ const response = await fetch(translationUrl);
44
+ if (!response.ok) {
45
+ throw new Error(`HTTP error! status: ${response.status}`);
46
+ }
47
+ const translations = await response.json();
48
+ getTranslations(translations);
49
+ }
50
+ catch (error) {
51
+ console.error('Failed to fetch or parse translations from URL:', error);
52
+ }
53
+ }
54
+ };
@@ -0,0 +1,7 @@
1
+ export var EHistoryItemLevelStatus;
2
+ (function (EHistoryItemLevelStatus) {
3
+ EHistoryItemLevelStatus[EHistoryItemLevelStatus["Completed"] = 0] = "Completed";
4
+ EHistoryItemLevelStatus[EHistoryItemLevelStatus["Expired"] = 1] = "Expired";
5
+ EHistoryItemLevelStatus[EHistoryItemLevelStatus["Forfeited"] = 2] = "Forfeited";
6
+ })(EHistoryItemLevelStatus || (EHistoryItemLevelStatus = {}));
7
+ export const HistoryItemLevelStatusDictionary = ['Completed', 'Expired', 'Forfeited'];
@@ -0,0 +1,3 @@
1
+ export function format(first, middle, last) {
2
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
+ }
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };