@everymatrix/lottery-ticket-controller 1.44.0 → 1.45.2
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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/helper-accordion_5.cjs.entry.js +570 -697
- package/dist/cjs/index-2275f129.js +1304 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/lottery-ticket-controller.cjs.js +17 -11
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/lottery-ticket-controller/index.js +1 -0
- package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.css +1 -1
- package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.js +371 -399
- package/dist/collection/utils/locale.utils.js +17 -17
- package/dist/collection/utils/utils.js +1 -1
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/helper-accordion_5.entry.js +570 -697
- package/dist/esm/index-cf1a7f99.js +1277 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/lottery-ticket-controller.js +14 -11
- package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -1
- package/dist/lottery-ticket-controller/p-5d5cd019.entry.js +1 -0
- package/dist/lottery-ticket-controller/p-e1255160.js +1 -0
- package/dist/lottery-ticket-controller/p-ee226061.js +2 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-ticket-controller/.stencil/packages/stencil/lottery-ticket-controller/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-ticket-controller/.stencil/packages/stencil/lottery-ticket-controller/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/lottery-ticket-controller/index.d.ts +1 -0
- package/dist/types/components/lottery-ticket-controller/lottery-ticket-controller.d.ts +70 -70
- package/dist/types/components.d.ts +16 -1
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +10 -3
- package/dist/cjs/index-797fecd9.js +0 -1286
- package/dist/components/helper-accordion.js +0 -6
- package/dist/components/helper-accordion2.js +0 -158
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/lottery-bullet.js +0 -6
- package/dist/components/lottery-bullet2.js +0 -91
- package/dist/components/lottery-grid.js +0 -6
- package/dist/components/lottery-grid2.js +0 -245
- package/dist/components/lottery-ticket-controller.d.ts +0 -11
- package/dist/components/lottery-ticket-controller.js +0 -185
- package/dist/components/lottery-ticket.js +0 -6
- package/dist/components/lottery-ticket2.js +0 -273
- package/dist/esm/index-c4bda097.js +0 -1260
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/lottery-ticket-controller/p-1f81b6df.js +0 -1
- package/dist/lottery-ticket-controller/p-2577bcb1.entry.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-ticket-controller/.stencil/packages/lottery-ticket-controller/stencil.config.d.ts +0 -2
|
@@ -2,752 +2,625 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2275f129.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE$2 = 'en';
|
|
8
8
|
const TRANSLATIONS$2 = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
en: {
|
|
10
|
+
deleteTicket: 'Delete ticket'
|
|
11
|
+
},
|
|
12
|
+
ro: {
|
|
13
|
+
deleteTicket: 'Sterge biletul'
|
|
14
|
+
},
|
|
15
|
+
fr: {
|
|
16
|
+
deleteTicket: 'Supprimer le billet'
|
|
17
|
+
},
|
|
18
|
+
ar: {
|
|
19
|
+
deleteTicket: 'حذف التذكرة'
|
|
20
|
+
},
|
|
21
|
+
hr: {
|
|
22
|
+
deleteTicket: 'Izbriši listić'
|
|
23
|
+
}
|
|
24
24
|
};
|
|
25
25
|
const translate$2 = (key, customLang) => {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const lang = customLang;
|
|
27
|
+
return TRANSLATIONS$2[(lang !== undefined) && (lang in TRANSLATIONS$2) ? lang : DEFAULT_LANGUAGE$2][key];
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:5px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff;text-transform:capitalize}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
|
|
31
|
+
const HelperAccordionStyle0 = helperAccordionCss;
|
|
31
32
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.stylingContainer.prepend(cssFile);
|
|
95
|
-
}, 1);
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
// @TODO fix the `any` type :)
|
|
99
|
-
connectedCallback() {
|
|
100
|
-
this.showContent = !this.collapsed;
|
|
101
|
-
}
|
|
102
|
-
componentDidRender() {
|
|
103
|
-
// start custom styling area
|
|
104
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
105
|
-
if (this.clientStyling)
|
|
106
|
-
this.setClientStyling();
|
|
107
|
-
if (this.clientStylingUrlContent)
|
|
108
|
-
this.setClientStylingURL();
|
|
109
|
-
this.limitStylingAppends = true;
|
|
110
|
-
}
|
|
111
|
-
// end custom styling area
|
|
112
|
-
}
|
|
113
|
-
toggleContent() {
|
|
114
|
-
this.showContent = !this.showContent;
|
|
115
|
-
}
|
|
116
|
-
deleteAction() {
|
|
117
|
-
if (this.postMessage) {
|
|
118
|
-
// @TODO maybe change the name type, this one sucks
|
|
119
|
-
window.postMessage({ type: this.eventName }, window.location.href);
|
|
120
|
-
}
|
|
121
|
-
this.accordionEvent.emit();
|
|
122
|
-
}
|
|
123
|
-
render() {
|
|
124
|
-
return (index.h("div", { class: "Wrapper", ref: el => this.stylingContainer = el }, index.h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header', onClick: () => this.toggleContent() }, index.h("p", { class: "Title" }, this.headerTitle), index.h("p", { class: "Subtitle" }, this.headerSubtitle), index.h("p", { class: "Subtitle Description" }, this.description), index.h("span", { class: "Expand" }, this.showContent ? '<' : '>')), this.showContent &&
|
|
125
|
-
index.h("div", null, index.h("div", { class: "Content" }, index.h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
126
|
-
index.h("div", null, this.deleteTab &&
|
|
127
|
-
index.h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate$2('deleteTicket', this.language)))))));
|
|
128
|
-
}
|
|
33
|
+
const HelperAccordion = class {
|
|
34
|
+
constructor(hostRef) {
|
|
35
|
+
index.registerInstance(this, hostRef);
|
|
36
|
+
this.accordionEvent = index.createEvent(this, "helperAccordionAction", 7);
|
|
37
|
+
this.setClientStyling = () => {
|
|
38
|
+
let sheet = document.createElement('style');
|
|
39
|
+
sheet.innerHTML = this.clientStyling;
|
|
40
|
+
this.stylingContainer.prepend(sheet);
|
|
41
|
+
};
|
|
42
|
+
this.setClientStylingURL = () => {
|
|
43
|
+
let cssFile = document.createElement('style');
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
46
|
+
this.stylingContainer.prepend(cssFile);
|
|
47
|
+
}, 1);
|
|
48
|
+
};
|
|
49
|
+
this.ticketHistoryFlag = false;
|
|
50
|
+
this.headerTitle = '';
|
|
51
|
+
this.headerSubtitle = '';
|
|
52
|
+
this.description = '';
|
|
53
|
+
this.footer = false;
|
|
54
|
+
this.deleteTab = false;
|
|
55
|
+
this.postMessage = false;
|
|
56
|
+
this.eventName = 'helperAccordionAction';
|
|
57
|
+
this.collapsed = true;
|
|
58
|
+
this.language = 'en';
|
|
59
|
+
this.clientStyling = '';
|
|
60
|
+
this.clientStylingUrlContent = '';
|
|
61
|
+
this.showContent = undefined;
|
|
62
|
+
this.limitStylingAppends = false;
|
|
63
|
+
}
|
|
64
|
+
// @TODO fix the `any` type :)
|
|
65
|
+
connectedCallback() {
|
|
66
|
+
this.showContent = !this.collapsed;
|
|
67
|
+
}
|
|
68
|
+
componentDidRender() {
|
|
69
|
+
// start custom styling area
|
|
70
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
71
|
+
if (this.clientStyling)
|
|
72
|
+
this.setClientStyling();
|
|
73
|
+
if (this.clientStylingUrlContent)
|
|
74
|
+
this.setClientStylingURL();
|
|
75
|
+
this.limitStylingAppends = true;
|
|
76
|
+
}
|
|
77
|
+
// end custom styling area
|
|
78
|
+
}
|
|
79
|
+
toggleContent() {
|
|
80
|
+
this.showContent = !this.showContent;
|
|
81
|
+
}
|
|
82
|
+
deleteAction() {
|
|
83
|
+
if (this.postMessage) {
|
|
84
|
+
// @TODO maybe change the name type, this one sucks
|
|
85
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
86
|
+
}
|
|
87
|
+
this.accordionEvent.emit();
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
return (index.h("div", { key: 'ad26faefd6e3dd089171c7e2bff13faa5a26d972', class: "Wrapper", ref: el => this.stylingContainer = el }, index.h("div", { key: 'bb7045653ec12a2526029589744f7ef014ec6a6a', class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header', onClick: () => this.toggleContent() }, index.h("p", { key: 'ae30943582063e368e942124d8d5acadc1732629', class: "Title" }, this.headerTitle), index.h("p", { key: '7c35076cb768de784177988900c61fe40a71594c', class: "Subtitle" }, this.headerSubtitle), index.h("p", { key: 'daff2b456a427f45b00efc32ba33a68cdc2228f0', class: "Subtitle Description" }, this.description), index.h("span", { key: '0c4f942642da6e8b1ac3d2aeac46034963965d8f', class: "Expand" }, this.showContent ? '<' : '>')), this.showContent &&
|
|
91
|
+
index.h("div", { key: 'c688ab7cc629a3974b905a2fdc43063e996a3b90' }, index.h("div", { key: 'aaa3ad7d9f1503b8e1baaa2c756376a580ffe261', class: "Content" }, index.h("slot", { key: '8c5c8ff70857da9414c7284b052a3fbc5f503f4a', name: 'accordionContent' }), this.footer && this.showContent &&
|
|
92
|
+
index.h("div", { key: '917191f55a45647d708a5e3ff5e188c7e565a0c0' }, this.deleteTab &&
|
|
93
|
+
index.h("span", { key: 'e7fdd5b4f18cacaceda206b36ce9576cc3fc1472', class: "ActionButton", onClick: () => this.deleteAction() }, translate$2('deleteTicket', this.language)))))));
|
|
94
|
+
}
|
|
129
95
|
};
|
|
130
|
-
|
|
96
|
+
HelperAccordion.style = HelperAccordionStyle0;
|
|
131
97
|
|
|
132
|
-
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top,
|
|
98
|
+
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, rgb(255, 255, 255) 0%, rgb(255, 255, 255) 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, rgb(255, 255, 255) 0%, rgb(241, 241, 241) 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
|
|
99
|
+
const LotteryBulletStyle0 = lotteryBulletCss;
|
|
133
100
|
|
|
134
101
|
const LotteryBullet = class {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.isSelected =
|
|
162
|
-
this.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
componentDidRender() {
|
|
182
|
-
// start custom styling area
|
|
183
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
184
|
-
if (this.clientStyling)
|
|
185
|
-
this.setClientStyling();
|
|
186
|
-
if (this.clientStylingUrlContent)
|
|
187
|
-
this.setClientStylingURL();
|
|
188
|
-
this.limitStylingAppends = true;
|
|
189
|
-
}
|
|
190
|
-
// end custom styling area
|
|
191
|
-
}
|
|
192
|
-
render() {
|
|
193
|
-
return (index.h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
194
|
-
}
|
|
102
|
+
constructor(hostRef) {
|
|
103
|
+
index.registerInstance(this, hostRef);
|
|
104
|
+
this.bulletEvent = index.createEvent(this, "lotteryBulletSelection", 7);
|
|
105
|
+
this.select = () => {
|
|
106
|
+
if (this.selectable) {
|
|
107
|
+
this.isSelected = !this.isSelected;
|
|
108
|
+
this.bulletEvent.emit({
|
|
109
|
+
value: this.value,
|
|
110
|
+
selected: this.isSelected
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
this.setClientStyling = () => {
|
|
115
|
+
let sheet = document.createElement('style');
|
|
116
|
+
sheet.innerHTML = this.clientStyling;
|
|
117
|
+
this.stylingContainer.prepend(sheet);
|
|
118
|
+
};
|
|
119
|
+
this.setClientStylingURL = () => {
|
|
120
|
+
let cssFile = document.createElement('style');
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
123
|
+
this.stylingContainer.prepend(cssFile);
|
|
124
|
+
}, 1);
|
|
125
|
+
};
|
|
126
|
+
this.value = '0';
|
|
127
|
+
this.selectable = true;
|
|
128
|
+
this.isSelected = false;
|
|
129
|
+
this.clientStyling = '';
|
|
130
|
+
this.clientStylingUrlContent = '';
|
|
131
|
+
this.limitStylingAppends = false;
|
|
132
|
+
}
|
|
133
|
+
componentDidRender() {
|
|
134
|
+
// start custom styling area
|
|
135
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
136
|
+
if (this.clientStyling)
|
|
137
|
+
this.setClientStyling();
|
|
138
|
+
if (this.clientStylingUrlContent)
|
|
139
|
+
this.setClientStylingURL();
|
|
140
|
+
this.limitStylingAppends = true;
|
|
141
|
+
}
|
|
142
|
+
// end custom styling area
|
|
143
|
+
}
|
|
144
|
+
render() {
|
|
145
|
+
return (index.h("div", { key: 'af3601684ecf1f39d65fc9461430cba96b9e4b8c', class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
146
|
+
}
|
|
195
147
|
};
|
|
196
|
-
LotteryBullet.style =
|
|
148
|
+
LotteryBullet.style = LotteryBulletStyle0;
|
|
197
149
|
|
|
198
150
|
const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}";
|
|
151
|
+
const LotteryGridStyle0 = lotteryGridCss;
|
|
199
152
|
|
|
200
153
|
const LotteryGrid = class {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
* Number of maximum bullets that can be selected
|
|
211
|
-
*/
|
|
212
|
-
this.maximumAllowed = 0;
|
|
213
|
-
/**
|
|
214
|
-
* Minimum allowed of bullets
|
|
215
|
-
*/
|
|
216
|
-
this.minimumAllowed = 1;
|
|
217
|
-
/**
|
|
218
|
-
* Allows the user to select numbers on the grid
|
|
219
|
-
*/
|
|
220
|
-
this.selectable = true;
|
|
221
|
-
/**
|
|
222
|
-
* Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
|
|
223
|
-
*/
|
|
224
|
-
this.selectedNumbers = '';
|
|
225
|
-
/**
|
|
226
|
-
* Show only selected numbers
|
|
227
|
-
*/
|
|
228
|
-
this.displaySelected = false;
|
|
229
|
-
/**
|
|
230
|
-
* Language
|
|
231
|
-
*/
|
|
232
|
-
this.language = 'en';
|
|
233
|
-
/**
|
|
234
|
-
* Personalize grid for ticket
|
|
235
|
-
*/
|
|
236
|
-
this.gridType = '';
|
|
237
|
-
/**
|
|
238
|
-
* Client custom styling via string
|
|
239
|
-
*/
|
|
240
|
-
this.clientStyling = '';
|
|
241
|
-
/**
|
|
242
|
-
* Client custom styling via url content
|
|
243
|
-
*/
|
|
244
|
-
this.clientStylingUrlContent = '';
|
|
245
|
-
this.numbers = [];
|
|
246
|
-
this.limitStylingAppends = false;
|
|
247
|
-
this.selectedCounter = 0;
|
|
248
|
-
this.setClientStyling = () => {
|
|
249
|
-
let sheet = document.createElement('style');
|
|
250
|
-
sheet.innerHTML = this.clientStyling;
|
|
251
|
-
this.stylingContainer.prepend(sheet);
|
|
252
|
-
};
|
|
253
|
-
this.setClientStylingURL = () => {
|
|
254
|
-
let cssFile = document.createElement('style');
|
|
255
|
-
setTimeout(() => {
|
|
256
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
257
|
-
this.stylingContainer.prepend(cssFile);
|
|
258
|
-
}, 1);
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
connectedCallback() {
|
|
262
|
-
let selected = [];
|
|
263
|
-
if (this.selectedNumbers.length > 0) {
|
|
264
|
-
selected = this.selectedNumbers.split(',');
|
|
265
|
-
this.selectedCounter = selected.length;
|
|
266
|
-
}
|
|
267
|
-
if (this.displaySelected) {
|
|
268
|
-
selected.forEach((item) => {
|
|
269
|
-
this.numbers.push({
|
|
270
|
-
number: item,
|
|
271
|
-
selected: true,
|
|
272
|
-
selectable: this.selectable
|
|
273
|
-
});
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
[...Array(this.totalNumbers).keys()]
|
|
278
|
-
.map(number => (number + 1).toString())
|
|
279
|
-
.forEach((number) => {
|
|
280
|
-
this.numbers.push({
|
|
281
|
-
number,
|
|
282
|
-
selected: selected.indexOf(number) >= 0 ? true : false,
|
|
283
|
-
selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
componentDidRender() {
|
|
289
|
-
// start custom styling area
|
|
290
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
291
|
-
if (this.clientStyling)
|
|
292
|
-
this.setClientStyling();
|
|
293
|
-
if (this.clientStylingUrlContent)
|
|
294
|
-
this.setClientStylingURL();
|
|
295
|
-
this.limitStylingAppends = true;
|
|
296
|
-
}
|
|
297
|
-
// end custom styling area
|
|
298
|
-
}
|
|
299
|
-
// wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
|
|
300
|
-
shuffleArray(array) {
|
|
301
|
-
const result = [];
|
|
302
|
-
while (array.length > 0) {
|
|
303
|
-
const randomIndex = Math.floor(Math.random() * (array.length));
|
|
304
|
-
result.push(array.splice(randomIndex, 1)[0]);
|
|
305
|
-
}
|
|
306
|
-
return result;
|
|
307
|
-
}
|
|
308
|
-
lotteryBulletSelectionHandler(event) {
|
|
309
|
-
this.numbers = this.numbers.map((item) => {
|
|
310
|
-
if (item.number == event.detail.value) {
|
|
311
|
-
return {
|
|
312
|
-
number: item.number,
|
|
313
|
-
selected: event.detail.selected,
|
|
314
|
-
selectable: item.selectable
|
|
154
|
+
constructor(hostRef) {
|
|
155
|
+
index.registerInstance(this, hostRef);
|
|
156
|
+
this.gridFilledEvent = index.createEvent(this, "gridFilled", 7);
|
|
157
|
+
this.gridDirtyEvent = index.createEvent(this, "gridDirty", 7);
|
|
158
|
+
this.selectedCounter = 0;
|
|
159
|
+
this.setClientStyling = () => {
|
|
160
|
+
let sheet = document.createElement('style');
|
|
161
|
+
sheet.innerHTML = this.clientStyling;
|
|
162
|
+
this.stylingContainer.prepend(sheet);
|
|
315
163
|
};
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
this.
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
this.
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
164
|
+
this.setClientStylingURL = () => {
|
|
165
|
+
let cssFile = document.createElement('style');
|
|
166
|
+
setTimeout(() => {
|
|
167
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
168
|
+
this.stylingContainer.prepend(cssFile);
|
|
169
|
+
}, 1);
|
|
170
|
+
};
|
|
171
|
+
this.ticketId = undefined;
|
|
172
|
+
this.totalNumbers = 0;
|
|
173
|
+
this.gameId = undefined;
|
|
174
|
+
this.maximumAllowed = 0;
|
|
175
|
+
this.minimumAllowed = 1;
|
|
176
|
+
this.selectable = true;
|
|
177
|
+
this.selectedNumbers = '';
|
|
178
|
+
this.displaySelected = false;
|
|
179
|
+
this.language = 'en';
|
|
180
|
+
this.gridIndex = undefined;
|
|
181
|
+
this.gridType = '';
|
|
182
|
+
this.clientStyling = '';
|
|
183
|
+
this.clientStylingUrlContent = '';
|
|
184
|
+
this.numbers = [];
|
|
185
|
+
this.limitStylingAppends = false;
|
|
339
186
|
}
|
|
340
|
-
|
|
341
|
-
|
|
187
|
+
connectedCallback() {
|
|
188
|
+
let selected = [];
|
|
189
|
+
if (this.selectedNumbers.length > 0) {
|
|
190
|
+
selected = this.selectedNumbers.split(',');
|
|
191
|
+
this.selectedCounter = selected.length;
|
|
192
|
+
}
|
|
193
|
+
if (this.displaySelected) {
|
|
194
|
+
selected.forEach((item) => {
|
|
195
|
+
this.numbers.push({
|
|
196
|
+
number: item,
|
|
197
|
+
selected: true,
|
|
198
|
+
selectable: this.selectable
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
[...Array(this.totalNumbers).keys()]
|
|
204
|
+
.map(number => (number + 1).toString())
|
|
205
|
+
.forEach((number) => {
|
|
206
|
+
this.numbers.push({
|
|
207
|
+
number,
|
|
208
|
+
selected: selected.indexOf(number) >= 0 ? true : false,
|
|
209
|
+
selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
componentDidRender() {
|
|
215
|
+
// start custom styling area
|
|
216
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
217
|
+
if (this.clientStyling)
|
|
218
|
+
this.setClientStyling();
|
|
219
|
+
if (this.clientStylingUrlContent)
|
|
220
|
+
this.setClientStylingURL();
|
|
221
|
+
this.limitStylingAppends = true;
|
|
222
|
+
}
|
|
223
|
+
// end custom styling area
|
|
224
|
+
}
|
|
225
|
+
// wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
|
|
226
|
+
shuffleArray(array) {
|
|
227
|
+
const result = [];
|
|
228
|
+
while (array.length > 0) {
|
|
229
|
+
const randomIndex = Math.floor(Math.random() * (array.length));
|
|
230
|
+
result.push(array.splice(randomIndex, 1)[0]);
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
234
|
+
lotteryBulletSelectionHandler(event) {
|
|
342
235
|
this.numbers = this.numbers.map((item) => {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
236
|
+
if (item.number == event.detail.value) {
|
|
237
|
+
return {
|
|
238
|
+
number: item.number,
|
|
239
|
+
selected: event.detail.selected,
|
|
240
|
+
selectable: item.selectable
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
number: item.number,
|
|
245
|
+
selected: item.selected,
|
|
246
|
+
selectable: item.selectable
|
|
247
|
+
};
|
|
348
248
|
});
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
249
|
+
if (event.detail.selected) {
|
|
250
|
+
this.selectedCounter += 1;
|
|
251
|
+
if (this.selectedCounter == this.maximumAllowed) {
|
|
252
|
+
this.numbers = this.numbers.map((item) => {
|
|
253
|
+
return {
|
|
254
|
+
number: item.number,
|
|
255
|
+
selected: item.selected,
|
|
256
|
+
selectable: item.selected ? true : false
|
|
257
|
+
};
|
|
258
|
+
});
|
|
259
|
+
this.gridFilledEvent.emit({
|
|
260
|
+
id: this.ticketId,
|
|
261
|
+
index: this.gridIndex,
|
|
262
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
if (this.selectedCounter == this.maximumAllowed) {
|
|
268
|
+
this.numbers = this.numbers.map((item) => {
|
|
269
|
+
return {
|
|
270
|
+
number: item.number,
|
|
271
|
+
selected: item.selected,
|
|
272
|
+
selectable: true
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
this.gridDirtyEvent.emit({
|
|
276
|
+
id: this.ticketId,
|
|
277
|
+
index: this.gridIndex,
|
|
278
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
this.selectedCounter -= 1;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
async resetSelectionHandler(event) {
|
|
285
|
+
if (event.detail && event.detail == this.ticketId) {
|
|
286
|
+
this.selectedCounter = 0;
|
|
287
|
+
this.numbers = this.numbers.map((item) => {
|
|
288
|
+
return {
|
|
289
|
+
number: item.number,
|
|
290
|
+
selected: false,
|
|
291
|
+
selectable: this.selectable
|
|
292
|
+
};
|
|
293
|
+
});
|
|
294
|
+
this.gridDirtyEvent.emit({
|
|
295
|
+
id: this.ticketId,
|
|
296
|
+
index: this.gridIndex,
|
|
297
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
async autoSelectionHandler(event) {
|
|
302
|
+
if (event.detail && event.detail == this.ticketId) {
|
|
303
|
+
this.resetSelectionHandler(event);
|
|
304
|
+
let array = [...Array(this.totalNumbers).keys()]
|
|
305
|
+
.map(number => number + 1);
|
|
306
|
+
array = this.shuffleArray(array);
|
|
307
|
+
array = array.slice(0, this.minimumAllowed);
|
|
308
|
+
this.numbers = this.numbers.map((item) => {
|
|
309
|
+
return {
|
|
310
|
+
number: item.number,
|
|
311
|
+
selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
312
|
+
selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
313
|
+
};
|
|
314
|
+
});
|
|
315
|
+
this.gridFilledEvent.emit({
|
|
316
|
+
id: this.ticketId,
|
|
317
|
+
index: this.gridIndex,
|
|
318
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
319
|
+
});
|
|
320
|
+
this.selectedCounter = this.maximumAllowed;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
render() {
|
|
324
|
+
return (index.h("div", { key: '54b9187146b5d2625fd5ce7f53f38abf091cd943', class: "GridContainer", ref: el => this.stylingContainer = el }, index.h("div", { key: 'e7e8570557ebaa78edf881cdbc1ed720028cdf6e', class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => index.h("div", null, index.h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
|
|
325
|
+
}
|
|
400
326
|
};
|
|
401
|
-
LotteryGrid.style =
|
|
327
|
+
LotteryGrid.style = LotteryGridStyle0;
|
|
402
328
|
|
|
403
329
|
const DEFAULT_LANGUAGE$1 = 'en';
|
|
404
330
|
const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'hr'];
|
|
405
331
|
const TRANSLATIONS$1 = {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
332
|
+
en: {
|
|
333
|
+
loading: 'Loading, please wait ...',
|
|
334
|
+
error: 'It was an error while trying to fetch the data',
|
|
335
|
+
grid: 'Grid',
|
|
336
|
+
multiplier: 'Multiplier',
|
|
337
|
+
numberOfDraws: 'Number of draws',
|
|
338
|
+
wagerPerDraw: 'Wager per draw',
|
|
339
|
+
resetButton: 'Reset',
|
|
340
|
+
autoButton: 'I feel lucky'
|
|
341
|
+
},
|
|
342
|
+
ro: {
|
|
343
|
+
loading: 'Se incarca, va rugam asteptati ...',
|
|
344
|
+
error: 'A fost o eroare in timp ce asteptam datele',
|
|
345
|
+
grid: 'Grid',
|
|
346
|
+
multiplier: 'Multiplicator',
|
|
347
|
+
numberOfDraws: 'Numarul de extrageri',
|
|
348
|
+
wagerPerDraw: 'Pariul per extragere',
|
|
349
|
+
resetButton: 'Reseteaza',
|
|
350
|
+
autoButton: 'Ma simt norocos'
|
|
351
|
+
},
|
|
352
|
+
fr: {
|
|
353
|
+
loading: 'Loading, please wait ...',
|
|
354
|
+
error: 'It was an error while trying to fetch the data',
|
|
355
|
+
grid: 'Grid',
|
|
356
|
+
multiplier: 'Multiplier',
|
|
357
|
+
numberOfDraws: 'Number of draws',
|
|
358
|
+
wagerPerDraw: 'Wager per draw',
|
|
359
|
+
resetButton: 'Reset',
|
|
360
|
+
autoButton: 'I feel lucky'
|
|
361
|
+
},
|
|
362
|
+
ar: {
|
|
363
|
+
loading: 'Loading, please wait ...',
|
|
364
|
+
error: 'It was an error while trying to fetch the data',
|
|
365
|
+
grid: 'Grid',
|
|
366
|
+
multiplier: 'Multiplier',
|
|
367
|
+
numberOfDraws: 'Number of draws',
|
|
368
|
+
wagerPerDraw: 'Wager per draw',
|
|
369
|
+
resetButton: 'Reset',
|
|
370
|
+
autoButton: 'I feel lucky'
|
|
371
|
+
},
|
|
372
|
+
hr: {
|
|
373
|
+
loading: 'Učitavanje, molimo pričekajte ...',
|
|
374
|
+
error: 'Došlo je do pogreške prilikom pokušaja dohvaćanja podataka',
|
|
375
|
+
grid: 'Tablica',
|
|
376
|
+
multiplier: 'Multiplikator',
|
|
377
|
+
numberOfDraws: 'Broj izvlačenja',
|
|
378
|
+
wagerPerDraw: 'Ulog po izvlačenju',
|
|
379
|
+
resetButton: 'Resetiraj',
|
|
380
|
+
autoButton: 'Osjećam se sretno'
|
|
381
|
+
}
|
|
456
382
|
};
|
|
457
383
|
const translate$1 = (key, customLang) => {
|
|
458
|
-
|
|
459
|
-
|
|
384
|
+
const lang = customLang;
|
|
385
|
+
return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
|
|
460
386
|
};
|
|
461
387
|
|
|
462
388
|
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.ButtonContainer{display:flex;justify-content:flex-end}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:#FFF;background:#009993}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:#FFF;background:#009993}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid #ccc;border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid #ccc;overflow:hidden;background:#fff}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:#009993;color:#fff}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:#f1f1f1;border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:#ccc;border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:#f2f2f2}";
|
|
389
|
+
const LotteryTicketStyle0 = lotteryTicketCss;
|
|
463
390
|
|
|
464
391
|
const LotteryTicket = class {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
392
|
+
constructor(hostRef) {
|
|
393
|
+
index.registerInstance(this, hostRef);
|
|
394
|
+
this.ticketCompleted = index.createEvent(this, "ticketCompleted", 7);
|
|
395
|
+
this.autoSelection = index.createEvent(this, "autoSelection", 7);
|
|
396
|
+
this.resetSelection = index.createEvent(this, "resetSelection", 7);
|
|
397
|
+
this.stakeChange = index.createEvent(this, "stakeChange", 7);
|
|
398
|
+
this.multiplierChange = index.createEvent(this, "multiplierChange", 7);
|
|
399
|
+
this.setClientStyling = () => {
|
|
400
|
+
let sheet = document.createElement('style');
|
|
401
|
+
sheet.innerHTML = this.clientStyling;
|
|
402
|
+
this.stylingContainer.prepend(sheet);
|
|
403
|
+
};
|
|
404
|
+
this.setClientStylingURL = () => {
|
|
405
|
+
let cssFile = document.createElement('style');
|
|
406
|
+
setTimeout(() => {
|
|
407
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
408
|
+
this.stylingContainer.prepend(cssFile);
|
|
409
|
+
}, 1);
|
|
410
|
+
};
|
|
411
|
+
this.endpoint = undefined;
|
|
412
|
+
this.gameId = undefined;
|
|
413
|
+
this.numberOfGrids = 1;
|
|
414
|
+
this.multipleDraws = true;
|
|
415
|
+
this.ticketId = undefined;
|
|
416
|
+
this.resetButton = false;
|
|
417
|
+
this.autoPick = false;
|
|
418
|
+
this.language = 'en';
|
|
419
|
+
this.clientStyling = '';
|
|
420
|
+
this.clientStylingUrlContent = '';
|
|
421
|
+
this.multiplier = false;
|
|
422
|
+
this.numberOfDraws = 1;
|
|
423
|
+
this.isLoading = true;
|
|
424
|
+
this.hasErrors = false;
|
|
425
|
+
this.ticketDone = false;
|
|
426
|
+
this.isCustomSelect = false;
|
|
427
|
+
this.amountInfo = {};
|
|
428
|
+
this.limitStylingAppends = false;
|
|
429
|
+
}
|
|
496
430
|
/**
|
|
497
|
-
*
|
|
431
|
+
* @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
|
|
498
432
|
*/
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
//
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
this.
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
};
|
|
599
|
-
this.isCustomSelect = false;
|
|
600
|
-
this.changeStake(this.ticketId, item.amount);
|
|
601
|
-
}
|
|
602
|
-
render() {
|
|
603
|
-
if (this.isLoading) {
|
|
604
|
-
return (index.h("div", null, index.h("p", null, translate$1('loading', this.language))));
|
|
605
|
-
}
|
|
606
|
-
else {
|
|
607
|
-
if (this.hasErrors) {
|
|
608
|
-
return (index.h("div", null, index.h("p", null, translate$1('error', this.language))));
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
const { type } = this.gameData;
|
|
612
|
-
return (index.h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
613
|
-
index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate$1('resetButton', this.language))), this.autoPick && !this.ticketDone &&
|
|
614
|
-
index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate$1('autoButton', this.language))), this.grids.map((_, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate$1('grid', this.language), " ", index$1 + 1), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": type.boards[index$1].maximumAllowed, "minimum-allowed": type.boards[index$1].minimumAllowed, "total-numbers": type.boards[index$1].highNumber - type.boards[index$1].lowNumber + 1, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), type.multiplier &&
|
|
615
|
-
index.h("div", null, index.h("label", { class: "Toggle" }, index.h("label", { class: "Label" }, translate$1('multiplier', this.language), ": "), index.h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), index.h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
616
|
-
index.h("div", { class: "TicketDraws" }, index.h("label", { class: "Label" }, translate$1('numberOfDraws', this.language), ": "), index.h("div", { class: "NumberInput" }, index.h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), index.h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), index.h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), index.h("div", null, index.h("label", { class: "Label" }, translate$1('wagerPerDraw', this.language), ": "), index.h("div", { class: "WagerInput" }, type.stakes.length > 1 ?
|
|
617
|
-
(index.h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, index.h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, index.h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.value, " ", this.amountInfo.currency), index.h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), index.h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, index.h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, type.stakes.map((item) => index.h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.value == item.value ? 'SelectedValue' : '', value: item.value, onClick: () => this.setDropdownItem(item) }, item.value, " ", item.currency)))))) : (index.h("div", null, index.h("input", { min: "1", value: type.stakes[0].amount, type: "number", disabled: true }), index.h("p", { class: "WagerInputTitle" }, type.stakes[0].currency)))))));
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
static get watchers() { return {
|
|
622
|
-
"numberOfDraws": ["drawsChangeHandler"]
|
|
623
|
-
}; }
|
|
433
|
+
checkForClickOutside(ev) {
|
|
434
|
+
if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
|
|
435
|
+
this.isCustomSelect = false;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
connectedCallback() {
|
|
439
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
440
|
+
fetch(url.href)
|
|
441
|
+
.then((response) => {
|
|
442
|
+
if (response.ok) {
|
|
443
|
+
return response.json();
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
// Throw error
|
|
447
|
+
this.hasErrors = true;
|
|
448
|
+
}
|
|
449
|
+
})
|
|
450
|
+
.then((data) => {
|
|
451
|
+
this.isLoading = false;
|
|
452
|
+
this.gameData = data;
|
|
453
|
+
this.grids = [...Array(this.gameData.type.boards.length).keys()];
|
|
454
|
+
this.amountInfo = this.gameData.type.stakes[0]; // initial value for select
|
|
455
|
+
})
|
|
456
|
+
.catch((err) => {
|
|
457
|
+
this.isLoading = false;
|
|
458
|
+
this.hasErrors = true;
|
|
459
|
+
console.error('Error!', err);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
componentDidRender() {
|
|
463
|
+
// start custom styling area
|
|
464
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
465
|
+
if (this.clientStyling)
|
|
466
|
+
this.setClientStyling();
|
|
467
|
+
if (this.clientStylingUrlContent)
|
|
468
|
+
this.setClientStylingURL();
|
|
469
|
+
this.limitStylingAppends = true;
|
|
470
|
+
}
|
|
471
|
+
// end custom styling area
|
|
472
|
+
}
|
|
473
|
+
multiplierChangeHandler(e) {
|
|
474
|
+
this.multiplier = e.target ? e.target.checked : false;
|
|
475
|
+
this.multiplierChange.emit(this.multiplier);
|
|
476
|
+
}
|
|
477
|
+
drawsChangeHandler(event) {
|
|
478
|
+
this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });
|
|
479
|
+
this.ticketCompleted.emit(this.ticket);
|
|
480
|
+
}
|
|
481
|
+
gridFilledHandler(event) {
|
|
482
|
+
this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });
|
|
483
|
+
this.ticketDone = true;
|
|
484
|
+
this.ticketCompleted.emit(this.ticket);
|
|
485
|
+
}
|
|
486
|
+
toggleAutoSelection() {
|
|
487
|
+
this.ticketDone = true;
|
|
488
|
+
this.autoSelection.emit(this.ticketId);
|
|
489
|
+
}
|
|
490
|
+
toggleResetSelection() {
|
|
491
|
+
this.ticketDone = false;
|
|
492
|
+
this.resetSelection.emit(this.ticketId);
|
|
493
|
+
}
|
|
494
|
+
changeStake(ticketid, amount) {
|
|
495
|
+
this.stakeChange.emit({
|
|
496
|
+
ticketId: ticketid,
|
|
497
|
+
stake: amount
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
toggleClass() {
|
|
501
|
+
this.isCustomSelect = !this.isCustomSelect;
|
|
502
|
+
}
|
|
503
|
+
setDropdownItem(item) {
|
|
504
|
+
this.amountInfo = {
|
|
505
|
+
value: item.value,
|
|
506
|
+
currency: item.currency
|
|
507
|
+
};
|
|
508
|
+
this.isCustomSelect = false;
|
|
509
|
+
this.changeStake(this.ticketId, item.amount);
|
|
510
|
+
}
|
|
511
|
+
render() {
|
|
512
|
+
if (this.isLoading) {
|
|
513
|
+
return (index.h("div", null, index.h("p", null, translate$1('loading', this.language))));
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
if (this.hasErrors) {
|
|
517
|
+
return (index.h("div", null, index.h("p", null, translate$1('error', this.language))));
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
const { type } = this.gameData;
|
|
521
|
+
return (index.h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
522
|
+
index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate$1('resetButton', this.language))), this.autoPick && !this.ticketDone &&
|
|
523
|
+
index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate$1('autoButton', this.language))), this.grids.map((_, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate$1('grid', this.language), " ", index$1 + 1), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": type.boards[index$1].maximumAllowed, "minimum-allowed": type.boards[index$1].minimumAllowed, "total-numbers": type.boards[index$1].highNumber - type.boards[index$1].lowNumber + 1, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), type.multiplier &&
|
|
524
|
+
index.h("div", null, index.h("label", { class: "Toggle" }, index.h("label", { class: "Label" }, translate$1('multiplier', this.language), ": "), index.h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), index.h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
525
|
+
index.h("div", { class: "TicketDraws" }, index.h("label", { class: "Label" }, translate$1('numberOfDraws', this.language), ": "), index.h("div", { class: "NumberInput" }, index.h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), index.h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), index.h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), index.h("div", null, index.h("label", { class: "Label" }, translate$1('wagerPerDraw', this.language), ": "), index.h("div", { class: "WagerInput" }, type.stakes.length > 1 ?
|
|
526
|
+
(index.h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, index.h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, index.h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.value, " ", this.amountInfo.currency), index.h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), index.h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, index.h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, type.stakes.map((item) => index.h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.value == item.value ? 'SelectedValue' : '', value: item.value, onClick: () => this.setDropdownItem(item) }, item.value, " ", item.currency)))))) : (index.h("div", null, index.h("input", { min: "1", value: type.stakes[0].amount, type: "number", disabled: true }), index.h("p", { class: "WagerInputTitle" }, type.stakes[0].currency)))))));
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
static get watchers() { return {
|
|
531
|
+
"numberOfDraws": ["drawsChangeHandler"]
|
|
532
|
+
}; }
|
|
624
533
|
};
|
|
625
|
-
LotteryTicket.style =
|
|
534
|
+
LotteryTicket.style = LotteryTicketStyle0;
|
|
626
535
|
|
|
627
536
|
const DEFAULT_LANGUAGE = 'en';
|
|
628
537
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
629
538
|
const TRANSLATIONS = {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
539
|
+
en: {
|
|
540
|
+
ticket: 'Ticket',
|
|
541
|
+
},
|
|
542
|
+
ro: {
|
|
543
|
+
ticket: 'Bilet',
|
|
544
|
+
},
|
|
545
|
+
fr: {
|
|
546
|
+
ticket: 'Billet'
|
|
547
|
+
},
|
|
548
|
+
ar: {
|
|
549
|
+
ticket: 'تذكرة',
|
|
550
|
+
},
|
|
551
|
+
hr: {
|
|
552
|
+
ticket: 'Listić',
|
|
553
|
+
}
|
|
645
554
|
};
|
|
646
555
|
const translate = (key, customLang) => {
|
|
647
|
-
|
|
648
|
-
|
|
556
|
+
const lang = customLang;
|
|
557
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
649
558
|
};
|
|
650
559
|
|
|
651
|
-
const lotteryTicketControllerCss = ":host{font-family:\"Roboto\", system-ui, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.player-account-gaming-limits-popup-2{background:var(--emfe-w-color-black, #000000);color:var(--emfe-w-color-white, #000)}.Title{font-weight:800;font-size:18px}button{display:block;font-size:0.75rem;padding:12px 0;border:0;border-radius:2px;cursor:pointer}button.PrimaryButtonStyle{font-size:14px;color:#fff;background
|
|
560
|
+
const lotteryTicketControllerCss = ":host{font-family:\"Roboto\", system-ui, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.player-account-gaming-limits-popup-2{background:var(--emfe-w-color-black, #000000);color:var(--emfe-w-color-white, #000)}.Title{font-weight:800;font-size:18px}button{display:block;font-size:0.75rem;padding:12px 0;border:0;border-radius:2px;cursor:pointer}button.PrimaryButtonStyle{font-size:14px;color:#fff;background:rgb(122, 195, 23)}button.SecondaryButtonStyle{border:1px solid #999;color:#666;background:#fff}.LinkButton{display:inline;padding:0;color:#3366CC;text-decoration:underline;background-color:rgba(0, 0, 0, 0)}.ResultIconWrapper{display:flex;flex-direction:column;align-items:center;margin:12px 0}.ResultIconWrapper svg{height:auto;width:60px;margin:12px}.ResultIconWrapper p{color:#666}.Overlay{position:absolute;top:0;left:0;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center}.ModalContainer{position:fixed;top:30vh;width:320px;height:auto;padding:18px 14px;background:#fff;border-radius:4px}.InitialWrapper{display:flex;flex-direction:column;gap:12px}.AdditionalInformation{margin:10px 0;font-size:14px}.TermsConditions{font-size:12px}.ExpandButton{font-size:14px;background-color:#fff;border:0;padding:0;margin-top:-10px;color:#999;display:flex;justify-content:center;align-items:center;cursor:pointer}.ExpandButton svg{width:28px;height:auto;margin-left:-4px}.LeftAlign{text-align:left;font-size:16px}.CenterAlign{text-align:center}.SetLimitSection{display:flex;flex-direction:column;gap:6px}.DepositTextSection{display:flex;justify-content:space-between}.DepositInputSection{height:32px;display:flex;gap:4px}.DepositInput{flex-grow:1;padding:0 6px}.SubmitDepositButton{flex-grow:1;font-size:0.75rem;padding:0}.SubmitDepositButton[disabled]{align-items:center;color:#ccc;cursor:not-allowed;background:#fff;border:#ccc 1px solid}.Hidden{display:none}.Extended{transform:rotate(180deg)}";
|
|
561
|
+
const LotteryTicketControllerStyle0 = lotteryTicketControllerCss;
|
|
652
562
|
|
|
653
563
|
const LotteryTicketController = class {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
this.setClientStyling = () => {
|
|
711
|
-
let sheet = document.createElement('style');
|
|
712
|
-
sheet.innerHTML = this.clientStyling;
|
|
713
|
-
this.stylingContainer.prepend(sheet);
|
|
714
|
-
};
|
|
715
|
-
this.setClientStylingURL = () => {
|
|
716
|
-
let cssFile = document.createElement('style');
|
|
717
|
-
setTimeout(() => {
|
|
718
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
719
|
-
this.stylingContainer.prepend(cssFile);
|
|
720
|
-
}, 1);
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
// @TODO fix the `any` type
|
|
724
|
-
helperAccordionActionHandler() {
|
|
725
|
-
if (this.postMessage) {
|
|
726
|
-
window.postMessage({ type: this.eventName }, window.location.href);
|
|
727
|
-
}
|
|
728
|
-
this.deleteTicketEvent.emit({
|
|
729
|
-
ticketId: this.ticketId
|
|
730
|
-
});
|
|
731
|
-
}
|
|
732
|
-
componentDidRender() {
|
|
733
|
-
// start custom styling area
|
|
734
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
735
|
-
if (this.clientStyling)
|
|
736
|
-
this.setClientStyling();
|
|
737
|
-
if (this.clientStylingUrlContent)
|
|
738
|
-
this.setClientStylingURL();
|
|
739
|
-
this.limitStylingAppends = true;
|
|
740
|
-
}
|
|
741
|
-
// end custom styling area
|
|
742
|
-
}
|
|
743
|
-
render() {
|
|
744
|
-
console.log('ticket id:', this.ticketId);
|
|
745
|
-
return (index.h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, index.h("helper-accordion", { "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": this.totalControllers !== 1, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("div", { slot: "accordionContent" }, index.h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
|
|
746
|
-
}
|
|
564
|
+
constructor(hostRef) {
|
|
565
|
+
index.registerInstance(this, hostRef);
|
|
566
|
+
this.deleteTicketEvent = index.createEvent(this, "deleteTicket", 7);
|
|
567
|
+
this.setClientStyling = () => {
|
|
568
|
+
let sheet = document.createElement('style');
|
|
569
|
+
sheet.innerHTML = this.clientStyling;
|
|
570
|
+
this.stylingContainer.prepend(sheet);
|
|
571
|
+
};
|
|
572
|
+
this.setClientStylingURL = () => {
|
|
573
|
+
let cssFile = document.createElement('style');
|
|
574
|
+
setTimeout(() => {
|
|
575
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
576
|
+
this.stylingContainer.prepend(cssFile);
|
|
577
|
+
}, 1);
|
|
578
|
+
};
|
|
579
|
+
this.endpoint = '';
|
|
580
|
+
this.ticketId = 1;
|
|
581
|
+
this.ticketDescription = undefined;
|
|
582
|
+
this.gameId = undefined;
|
|
583
|
+
this.postMessage = false;
|
|
584
|
+
this.eventName = 'deleteTicketAction';
|
|
585
|
+
this.collapsed = true;
|
|
586
|
+
this.numberOfGrids = 1;
|
|
587
|
+
this.last = false;
|
|
588
|
+
this.language = 'en';
|
|
589
|
+
this.autoPick = false;
|
|
590
|
+
this.resetButton = false;
|
|
591
|
+
this.totalControllers = 1;
|
|
592
|
+
this.clientStyling = '';
|
|
593
|
+
this.clientStylingUrlContent = '';
|
|
594
|
+
this.limitStylingAppends = false;
|
|
595
|
+
}
|
|
596
|
+
// @TODO fix the `any` type
|
|
597
|
+
helperAccordionActionHandler() {
|
|
598
|
+
if (this.postMessage) {
|
|
599
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
600
|
+
}
|
|
601
|
+
this.deleteTicketEvent.emit({
|
|
602
|
+
ticketId: this.ticketId
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
componentDidRender() {
|
|
606
|
+
// start custom styling area
|
|
607
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
608
|
+
if (this.clientStyling)
|
|
609
|
+
this.setClientStyling();
|
|
610
|
+
if (this.clientStylingUrlContent)
|
|
611
|
+
this.setClientStylingURL();
|
|
612
|
+
this.limitStylingAppends = true;
|
|
613
|
+
}
|
|
614
|
+
// end custom styling area
|
|
615
|
+
}
|
|
616
|
+
render() {
|
|
617
|
+
console.log('ticket id:', this.ticketId);
|
|
618
|
+
return (index.h("div", { key: '203c89c4b240cd7c99eb3d37fa3a4dbc17ed18e3', class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, index.h("helper-accordion", { key: 'ad9801b15a1718ff7470ab3084c4b569ad23f6e3', "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": this.totalControllers !== 1, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("div", { key: 'b9c618987e848d4b44fee6941f8b5c9696bd44e8', slot: "accordionContent" }, index.h("lottery-ticket", { key: '8acdc3d3cce5b654e7cddd71576c2e993881786f', endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
|
|
619
|
+
}
|
|
747
620
|
};
|
|
748
|
-
LotteryTicketController.style =
|
|
621
|
+
LotteryTicketController.style = LotteryTicketControllerStyle0;
|
|
749
622
|
|
|
750
|
-
exports.helper_accordion =
|
|
623
|
+
exports.helper_accordion = HelperAccordion;
|
|
751
624
|
exports.lottery_bullet = LotteryBullet;
|
|
752
625
|
exports.lottery_grid = LotteryGrid;
|
|
753
626
|
exports.lottery_ticket = LotteryTicket;
|