@everymatrix/lottery-game-page 0.0.17 → 0.1.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.
- package/dist/cjs/helper-modal.cjs.entry.js +1 -1
- package/dist/cjs/{index-81cb3b3b.js → index-614098f4.js} +5 -47
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/lottery-draw-results.cjs.entry.js +188 -0
- package/dist/cjs/lottery-game-page.cjs.entry.js +53 -13
- package/dist/cjs/lottery-game-page.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -62
- package/dist/collection/components/lottery-game-page/lottery-game-page.css +27 -7
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +22 -5
- package/dist/collection/utils/locale.utils.js +33 -6
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +0 -14
- package/dist/components/lottery-draw-results2.js +62 -59
- package/dist/components/lottery-game-page.js +59 -77
- package/dist/esm/helper-modal.entry.js +1 -1
- package/dist/esm/{index-be84da79.js → index-0fa076cd.js} +5 -47
- package/dist/esm/loader.js +3 -3
- package/dist/esm/lottery-draw-results.entry.js +184 -0
- package/dist/esm/lottery-game-page.entry.js +53 -13
- package/dist/esm/lottery-game-page.js +3 -3
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/lottery-game-page/p-2d7ccc96.js +1 -0
- package/dist/lottery-game-page/{p-88f81126.entry.js → p-6183a920.entry.js} +1 -1
- package/dist/lottery-game-page/p-9ca649d9.entry.js +1 -0
- package/dist/lottery-game-page/p-e98ee83a.entry.js +1 -0
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/helper-accordion.cjs.entry.js +0 -88
- package/dist/cjs/helper-filters_2.cjs.entry.js +0 -22490
- package/dist/cjs/helper-pagination.cjs.entry.js +0 -188
- package/dist/cjs/helper-tab.cjs.entry.js +0 -33
- package/dist/cjs/helper-tabs.cjs.entry.js +0 -38
- package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -202
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -124
- package/dist/cjs/lottery-game-details.cjs.entry.js +0 -19
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -69
- package/dist/cjs/lottery-ticket.cjs.entry.js +0 -146
- package/dist/components/helper-accordion.js +0 -6
- package/dist/components/helper-accordion2.js +0 -111
- package/dist/components/helper-filters.js +0 -6
- package/dist/components/helper-filters2.js +0 -22348
- package/dist/components/helper-pagination.js +0 -216
- package/dist/components/helper-tab.js +0 -6
- package/dist/components/helper-tab2.js +0 -48
- package/dist/components/helper-tabs.js +0 -6
- package/dist/components/helper-tabs2.js +0 -63
- package/dist/components/lottery-bullet.js +0 -6
- package/dist/components/lottery-bullet2.js +0 -57
- package/dist/components/lottery-draw-results-history.js +0 -6
- package/dist/components/lottery-draw-results-history2.js +0 -175
- package/dist/components/lottery-game-details.js +0 -6
- package/dist/components/lottery-game-details2.js +0 -49
- package/dist/components/lottery-grid.js +0 -6
- package/dist/components/lottery-grid2.js +0 -197
- package/dist/components/lottery-ticket-controller.js +0 -6
- package/dist/components/lottery-ticket-controller2.js +0 -118
- package/dist/components/lottery-ticket.js +0 -6
- package/dist/components/lottery-ticket2.js +0 -184
- package/dist/esm/helper-accordion.entry.js +0 -84
- package/dist/esm/helper-filters_2.entry.js +0 -22485
- package/dist/esm/helper-pagination.entry.js +0 -184
- package/dist/esm/helper-tab.entry.js +0 -29
- package/dist/esm/helper-tabs.entry.js +0 -34
- package/dist/esm/lottery-bullet_2.entry.js +0 -197
- package/dist/esm/lottery-draw-results-history.entry.js +0 -120
- package/dist/esm/lottery-game-details.entry.js +0 -15
- package/dist/esm/lottery-ticket-controller.entry.js +0 -65
- package/dist/esm/lottery-ticket.entry.js +0 -142
- package/dist/lottery-game-page/p-010895a3.entry.js +0 -1
- package/dist/lottery-game-page/p-08581ede.entry.js +0 -1
- package/dist/lottery-game-page/p-09f983c6.entry.js +0 -1
- package/dist/lottery-game-page/p-0c7ada78.entry.js +0 -1
- package/dist/lottery-game-page/p-2932d2a7.entry.js +0 -1
- package/dist/lottery-game-page/p-48831184.entry.js +0 -1
- package/dist/lottery-game-page/p-50298d2c.entry.js +0 -1
- package/dist/lottery-game-page/p-6736fa79.entry.js +0 -1
- package/dist/lottery-game-page/p-91420518.js +0 -2
- package/dist/lottery-game-page/p-95b37270.entry.js +0 -2849
- package/dist/lottery-game-page/p-a1dd3eb2.entry.js +0 -1
- package/dist/lottery-game-page/p-caf09eaf.entry.js +0 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-0fa076cd.js';
|
|
2
|
+
import '@everymatrix/lottery-grid';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
5
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
6
|
+
const TRANSLATIONS = {
|
|
7
|
+
en: {
|
|
8
|
+
drawResultsHeader: 'Last draw results',
|
|
9
|
+
drawId: 'Draw ID',
|
|
10
|
+
drawName: 'Game name',
|
|
11
|
+
drawDate: 'Draw Date',
|
|
12
|
+
drawNumbersGridDraw: 'Draw numbers Grid A',
|
|
13
|
+
drawNumbersGridTicket: 'Draw numbers Grid B',
|
|
14
|
+
ticketResult: 'Ticket result',
|
|
15
|
+
amountWon: 'Amount won',
|
|
16
|
+
numberOfDraws: 'Number of draws',
|
|
17
|
+
multiplier: 'Multiplier:',
|
|
18
|
+
ticketPurchaseDate: 'Ticket Purchase Date',
|
|
19
|
+
ticketStatus: 'Ticket Status',
|
|
20
|
+
ticketId: 'Ticket ID',
|
|
21
|
+
ticketAmount: 'Ticket Amount',
|
|
22
|
+
winUpTo: 'Win up to',
|
|
23
|
+
},
|
|
24
|
+
ro: {
|
|
25
|
+
drawResultsHeader: 'Ultimele rezultate extragere',
|
|
26
|
+
drawId: 'Id extragere',
|
|
27
|
+
drawName: 'Numele jocului',
|
|
28
|
+
drawDate: 'Data extragerii',
|
|
29
|
+
drawNumbersGridDraw: 'Numerele extrase Grid A',
|
|
30
|
+
drawNumbersGridTicket: 'Numerele extrase Grid B',
|
|
31
|
+
ticketResult: 'Rezultatul biletului',
|
|
32
|
+
amountWon: 'Suma castigata',
|
|
33
|
+
numberOfDraws: 'Numarul de extrageri',
|
|
34
|
+
multiplier: 'Multiplicator:',
|
|
35
|
+
ticketPurchaseDate: 'Data achizitionarii biletului',
|
|
36
|
+
ticketStatus: 'Statusul biletului',
|
|
37
|
+
ticketId: 'Id biletul',
|
|
38
|
+
ticketAmount: 'Valoarea biletului',
|
|
39
|
+
winUpTo: 'Poti castiga'
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
const translate = (key, customLang) => {
|
|
43
|
+
const lang = customLang;
|
|
44
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsArea{margin-top:15px}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0px 20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;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%, #eee 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:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{line-height:12px;font-weight:lighter;width:100%;height:100%;max-height:70px;float:left;margin:0 0 20px 0;border:1px solid #f1f1f1;background:#fff;border-radius:4px;padding:10px;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden;box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}";
|
|
48
|
+
|
|
49
|
+
const LotteryDrawResults = class {
|
|
50
|
+
constructor(hostRef) {
|
|
51
|
+
registerInstance(this, hostRef);
|
|
52
|
+
/**
|
|
53
|
+
* Language of the widget
|
|
54
|
+
*/
|
|
55
|
+
this.language = 'en';
|
|
56
|
+
/**
|
|
57
|
+
* Shows only the last draw
|
|
58
|
+
*/
|
|
59
|
+
this.drawMode = false;
|
|
60
|
+
/**
|
|
61
|
+
* The drawID (option)
|
|
62
|
+
*/
|
|
63
|
+
this.drawId = '';
|
|
64
|
+
/**
|
|
65
|
+
* The game name
|
|
66
|
+
*/
|
|
67
|
+
this.gameName = '';
|
|
68
|
+
/**
|
|
69
|
+
* The ticket submission date
|
|
70
|
+
*/
|
|
71
|
+
this.ticketDate = '';
|
|
72
|
+
/**
|
|
73
|
+
* The ticket status
|
|
74
|
+
*/
|
|
75
|
+
this.ticketStatus = '';
|
|
76
|
+
/**
|
|
77
|
+
* The ticket id
|
|
78
|
+
*/
|
|
79
|
+
this.ticketId = '';
|
|
80
|
+
/**
|
|
81
|
+
* The ticket amount
|
|
82
|
+
*/
|
|
83
|
+
this.ticketAmount = '';
|
|
84
|
+
/**
|
|
85
|
+
* The ticket multiplier
|
|
86
|
+
*/
|
|
87
|
+
this.ticketMultiplier = false;
|
|
88
|
+
/**
|
|
89
|
+
* The ticket draw count
|
|
90
|
+
*/
|
|
91
|
+
this.ticketDrawCount = 0;
|
|
92
|
+
this.multiplier = 3;
|
|
93
|
+
this.isLoading = true;
|
|
94
|
+
this.drawResults = [];
|
|
95
|
+
this.rules = {};
|
|
96
|
+
this.toggleDrawer = [false];
|
|
97
|
+
this.hasErrors = false;
|
|
98
|
+
this.errorText = '';
|
|
99
|
+
this.changeBox = (index) => {
|
|
100
|
+
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
101
|
+
if (itemIndex == index) {
|
|
102
|
+
return !item;
|
|
103
|
+
}
|
|
104
|
+
return item;
|
|
105
|
+
});
|
|
106
|
+
if (index >= this.toggleDrawer.length) {
|
|
107
|
+
this.toggleDrawer.push(true);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
connectedCallback() {
|
|
112
|
+
let promises = [];
|
|
113
|
+
promises.push(this.getGameData());
|
|
114
|
+
if (this.drawId) {
|
|
115
|
+
promises.push(this.getDrawData());
|
|
116
|
+
}
|
|
117
|
+
Promise.all(promises)
|
|
118
|
+
.then(() => {
|
|
119
|
+
this.isLoading = false;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
getDrawData() {
|
|
123
|
+
return new Promise((resolve, reject) => {
|
|
124
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);
|
|
125
|
+
fetch(url.href)
|
|
126
|
+
.then((response) => {
|
|
127
|
+
// @TODO EXCEPTIONS
|
|
128
|
+
return response.json();
|
|
129
|
+
})
|
|
130
|
+
.then((data) => {
|
|
131
|
+
this.drawData = data;
|
|
132
|
+
resolve(true);
|
|
133
|
+
this.isLoading = false;
|
|
134
|
+
})
|
|
135
|
+
.catch((err) => {
|
|
136
|
+
reject(err);
|
|
137
|
+
this.isLoading = false;
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
getGameData() {
|
|
142
|
+
return new Promise((resolve, reject) => {
|
|
143
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
144
|
+
fetch(url.href)
|
|
145
|
+
.then((response) => {
|
|
146
|
+
return response.json();
|
|
147
|
+
})
|
|
148
|
+
.then((data) => {
|
|
149
|
+
this.rules = {
|
|
150
|
+
maximumAllowed: data.rules.boards[0].maximumAllowed,
|
|
151
|
+
totalNumbers: data.rules.boards[0].totalNumbers
|
|
152
|
+
};
|
|
153
|
+
resolve(true);
|
|
154
|
+
this.isLoading = false;
|
|
155
|
+
this.hasErrors = false;
|
|
156
|
+
})
|
|
157
|
+
.catch((err) => {
|
|
158
|
+
this.isLoading = false;
|
|
159
|
+
this.hasErrors = true;
|
|
160
|
+
this.errorText = err;
|
|
161
|
+
reject(err);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
render() {
|
|
166
|
+
if (this.isLoading) {
|
|
167
|
+
return (h("p", null, "Loading, please wait ..."));
|
|
168
|
+
}
|
|
169
|
+
else if (this.hasErrors) {
|
|
170
|
+
h("p", null, this.errorText);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
return (h("section", { class: "DrawResultsSection" }, !this.drawMode ?
|
|
174
|
+
h("div", { class: "DrawResultsArea" }, h("div", { class: "TicketInfo" }, h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", h("span", null, this.gameName)), h("div", { class: "TicketDate" }, translate('ticketPurchaseDate', this.language), ": ", h("span", null, this.ticketDate.slice(0, 10))), h("div", { class: "TicketStatus" }, translate('ticketStatus', this.language), ": ", h("span", null, this.ticketStatus))), h("div", { class: "DrawResultsBody" }, h("div", { class: "TicketIdContainer" }, h("p", null, translate('ticketId', this.language), ": ", h("span", null, this.ticketId))), h("div", { class: "TicketAmountContainer" }, h("p", null, translate('ticketAmount', this.language), " ", h("span", null, this.ticketAmount))), h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridTicket', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.selection, selectable: false, "display-selected": true, language: this.language }))), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('winUpTo', this.language), " ", h("span", null, JSON.stringify(this.ticketMultiplier)))), h("div", { class: "NumberOfDrawsContainer" }, h("p", null, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" }, h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) }, h("div", { class: "TicketResultContainer" }, h("p", null, translate('ticketResult', this.language), ": ", item.status)), item.state == 'won' &&
|
|
175
|
+
h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", item.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('winUpTo', this.language), " ", item.multiplier)))))))))
|
|
176
|
+
:
|
|
177
|
+
h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
178
|
+
h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
LotteryDrawResults.style = lotteryDrawResultsCss;
|
|
183
|
+
|
|
184
|
+
export { LotteryDrawResults as lottery_draw_results };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-0fa076cd.js';
|
|
2
|
+
import '@everymatrix/lottery-ticket-controller';
|
|
3
|
+
import '@everymatrix/lottery-game-details';
|
|
4
|
+
import '@everymatrix/lottery-draw-results-history';
|
|
2
5
|
|
|
3
6
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
7
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'ar'];
|
|
5
8
|
const TRANSLATIONS = {
|
|
6
9
|
en: {
|
|
7
10
|
error: 'Error',
|
|
@@ -14,7 +17,7 @@ const TRANSLATIONS = {
|
|
|
14
17
|
buy: 'Buy tickets',
|
|
15
18
|
viewLatest: 'View latest results',
|
|
16
19
|
createTicket: 'Create Ticket',
|
|
17
|
-
modalSuccess: 'Purchase
|
|
20
|
+
modalSuccess: 'Purchase successfully completed!',
|
|
18
21
|
deleteTicketModalTitle: 'Delete Ticket',
|
|
19
22
|
deleteTicketModalText: 'Are you sure you want to delete this ticket?',
|
|
20
23
|
deleteTicketModalCancel: 'Cancel',
|
|
@@ -22,7 +25,9 @@ const TRANSLATIONS = {
|
|
|
22
25
|
orderSummaryTitle: 'Order Summary',
|
|
23
26
|
orderSummaryTickets: 'Ticket',
|
|
24
27
|
orderSummaryTotal: 'Total',
|
|
25
|
-
orderSummarySubmit: 'Submit'
|
|
28
|
+
orderSummarySubmit: 'Submit',
|
|
29
|
+
lastDrawResultsTitle: 'Last Draw Results',
|
|
30
|
+
modalLogin: 'Please login to submit a ticket',
|
|
26
31
|
},
|
|
27
32
|
ro: {
|
|
28
33
|
error: 'Eroare',
|
|
@@ -31,11 +36,11 @@ const TRANSLATIONS = {
|
|
|
31
36
|
lobbyButton: 'Lobby',
|
|
32
37
|
prize: 'MARELE JACKPOT OMG',
|
|
33
38
|
winUpTo: 'Castiga pana la',
|
|
34
|
-
nextDraw: '
|
|
39
|
+
nextDraw: 'Urmatoarea extragere:',
|
|
35
40
|
buy: 'Cumpara bilet',
|
|
36
41
|
viewLatest: 'Ultimile extrageri',
|
|
37
42
|
createTicket: 'Creeaza bilet',
|
|
38
|
-
modalSuccess: '
|
|
43
|
+
modalSuccess: 'Achizitie efectuata cu succes',
|
|
39
44
|
deleteTicketModalTitle: 'Sterge biletul',
|
|
40
45
|
deleteTicketModalText: 'Esti sigur ca vrei sa stergi acest bilet?',
|
|
41
46
|
deleteTicketModalCancel: 'Anuleaza',
|
|
@@ -43,7 +48,32 @@ const TRANSLATIONS = {
|
|
|
43
48
|
orderSummaryTitle: 'Rezumat comanda',
|
|
44
49
|
orderSummaryTickets: 'Bilet',
|
|
45
50
|
orderSummaryTotal: 'Total',
|
|
46
|
-
orderSummarySubmit: 'Trimite'
|
|
51
|
+
orderSummarySubmit: 'Trimite',
|
|
52
|
+
lastDrawResultsTitle: 'Cele mai recente extrageri',
|
|
53
|
+
modalLogin: 'Please login to submit a ticket',
|
|
54
|
+
},
|
|
55
|
+
ar: {
|
|
56
|
+
error: 'خطأ',
|
|
57
|
+
title: 'كرونو',
|
|
58
|
+
backButton: 'خلف',
|
|
59
|
+
lobbyButton: 'ردهة',
|
|
60
|
+
prize: 'جائزة',
|
|
61
|
+
winUpTo: 'الفوز بما يصل الى',
|
|
62
|
+
nextDraw: 'السحب التالي:',
|
|
63
|
+
buy: 'اشتري تذاكر',
|
|
64
|
+
viewLatest: 'عرض أحدث النتائج',
|
|
65
|
+
createTicket: 'إنشاء تذكرة',
|
|
66
|
+
modalSuccess: '!سيتم الشراء بنجاح قريبًا',
|
|
67
|
+
deleteTicketModalTitle: 'حذف التذكرة',
|
|
68
|
+
deleteTicketModalText: 'هل أنت متأكد أنك تريد حذف هذه التذكرة؟',
|
|
69
|
+
deleteTicketModalCancel: 'يلغي',
|
|
70
|
+
deleteTicketModalConfirm: 'حذف',
|
|
71
|
+
orderSummaryTitle: 'ملخص الطلب',
|
|
72
|
+
orderSummaryTickets: 'تذكرة',
|
|
73
|
+
orderSummaryTotal: 'المجموع',
|
|
74
|
+
orderSummarySubmit: 'يُقدِّم',
|
|
75
|
+
lastDrawResultsTitle: 'Cele mai recente extrageri',
|
|
76
|
+
modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'
|
|
47
77
|
},
|
|
48
78
|
};
|
|
49
79
|
const translate = (key, customLang) => {
|
|
@@ -51,7 +81,7 @@ const translate = (key, customLang) => {
|
|
|
51
81
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
52
82
|
};
|
|
53
83
|
|
|
54
|
-
const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#
|
|
84
|
+
const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#F1F1F1;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{background:#00958f;color:#FFF}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;border-bottom:solid 1px #D4D4D4;line-height:50px}.OrderSummary .Ticket span{text-align:right}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}";
|
|
55
85
|
|
|
56
86
|
const LotteryGamePage = class {
|
|
57
87
|
constructor(hostRef) {
|
|
@@ -76,6 +106,8 @@ const LotteryGamePage = class {
|
|
|
76
106
|
this.deleteVisible = false;
|
|
77
107
|
this.latestDraw = {};
|
|
78
108
|
this.totalWinningsAmount = 0;
|
|
109
|
+
this.isLoggedIn = false;
|
|
110
|
+
this.loginModalVisible = false;
|
|
79
111
|
this.multiplier = false;
|
|
80
112
|
this.quickPick = false;
|
|
81
113
|
}
|
|
@@ -83,6 +115,10 @@ const LotteryGamePage = class {
|
|
|
83
115
|
connectedCallback() {
|
|
84
116
|
this.getGameDetails();
|
|
85
117
|
this.getDraws();
|
|
118
|
+
console.log(this.language);
|
|
119
|
+
if (this.sessionId) {
|
|
120
|
+
this.isLoggedIn = true;
|
|
121
|
+
}
|
|
86
122
|
}
|
|
87
123
|
countdownLogic(date) {
|
|
88
124
|
this.interval = setInterval(() => {
|
|
@@ -109,7 +145,6 @@ const LotteryGamePage = class {
|
|
|
109
145
|
this.gameData = data;
|
|
110
146
|
this.basicStake = this.gameData.rules.stakes[0].amount;
|
|
111
147
|
let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
|
|
112
|
-
console.log('draws', draws);
|
|
113
148
|
this.nextDraw = draws[0].id;
|
|
114
149
|
this.createNewTicket();
|
|
115
150
|
})
|
|
@@ -172,6 +207,7 @@ const LotteryGamePage = class {
|
|
|
172
207
|
}
|
|
173
208
|
modalCloseEvent() {
|
|
174
209
|
this.deleteVisible = false;
|
|
210
|
+
this.loginModalVisible = false;
|
|
175
211
|
}
|
|
176
212
|
stakeChangeHandler(event) {
|
|
177
213
|
const { ticketId, stake } = event.detail;
|
|
@@ -233,6 +269,9 @@ const LotteryGamePage = class {
|
|
|
233
269
|
{ gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
|
|
234
270
|
];
|
|
235
271
|
}
|
|
272
|
+
showLoginModal() {
|
|
273
|
+
this.loginModalVisible = true;
|
|
274
|
+
}
|
|
236
275
|
submitTickets() {
|
|
237
276
|
let url = new URL(`${this.endpoint}/tickets`);
|
|
238
277
|
// @TODO Body TS type
|
|
@@ -240,7 +279,6 @@ const LotteryGamePage = class {
|
|
|
240
279
|
gameId: this.gameId,
|
|
241
280
|
tickets: []
|
|
242
281
|
};
|
|
243
|
-
console.log('body', body);
|
|
244
282
|
this.tickets.forEach((item) => {
|
|
245
283
|
body.tickets.push({
|
|
246
284
|
startingDrawId: this.nextDraw,
|
|
@@ -283,9 +321,11 @@ const LotteryGamePage = class {
|
|
|
283
321
|
}
|
|
284
322
|
return (
|
|
285
323
|
/* Game details */
|
|
286
|
-
h("div", { class: "GamePage" }, h("div", { class: "GridBanner" }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton" }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), h("div", { class: "NextDrawWrapper" }, h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate('nextDraw', this.language)), h("div", { class: "BannerCountdown" }, h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
|
|
287
|
-
h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", null)), h("div", { class: "TicketsWrapper" }, this.tickets.map((item) => h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton })), h("div", { class: "CreateNewTicket" }, h("button", { onClick: () => this.createNewTicket() }, "+"), h("span", null, translate('createTicket', this.language)))), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.tickets.length)), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.totalAmount, " ", this.currency)), h("div", { class: "ButtonWrapper" },
|
|
288
|
-
|
|
324
|
+
h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr' }, h("div", { class: "GridBanner" }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton" }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), h("div", { class: "NextDrawWrapper" }, h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate('nextDraw', this.language)), h("div", { class: "BannerCountdown" }, h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
|
|
325
|
+
h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", null)), h("div", { class: "TicketsWrapper" }, this.tickets.map((item) => h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton })), h("div", { class: "CreateNewTicket" }, h("button", { onClick: () => this.createNewTicket() }, "+"), h("span", null, translate('createTicket', this.language)))), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.tickets.length)), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.totalAmount, " ", this.currency)), h("div", { class: "ButtonWrapper" }, this.isLoggedIn &&
|
|
326
|
+
h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language)), !this.isLoggedIn &&
|
|
327
|
+
h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
|
|
328
|
+
h("div", null, h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }), h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible }, h("div", { class: "DeleteTicketModalWrapper" }, h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), h("div", { class: "DeleteTicketModalButtons" }, h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
|
|
289
329
|
}
|
|
290
330
|
static get assetsDirs() { return ["static"]; }
|
|
291
331
|
get element() { return getElement(this); }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-0fa076cd.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
Stencil Client Patch Browser v2.
|
|
4
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
5
5
|
*/
|
|
6
6
|
const patchBrowser = () => {
|
|
7
7
|
const importMeta = import.meta.url;
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["
|
|
16
|
+
return bootstrapLazy([["helper-modal",[[1,"helper-modal",{"titleModal":[1,"title-modal"],"visible":[1540]}]]],["lottery-draw-results",[[1,"lottery-draw-results",{"endpoint":[1],"gameId":[1,"game-id"],"language":[1],"playerId":[1,"player-id"],"drawMode":[4,"draw-mode"],"drawId":[1,"draw-id"],"gameName":[1,"game-name"],"ticketDate":[1,"ticket-date"],"ticketStatus":[1,"ticket-status"],"ticketId":[1,"ticket-id"],"ticketAmount":[1,"ticket-amount"],"ticketMultiplier":[4,"ticket-multiplier"],"ticketDrawCount":[2,"ticket-draw-count"],"multiplier":[32],"isLoading":[32],"drawResults":[32],"rules":[32],"toggleDrawer":[32],"hasErrors":[32],"errorText":[32]}]]],["lottery-game-page",[[1,"lottery-game-page",{"endpoint":[1],"gameId":[1,"game-id"],"playerId":[2,"player-id"],"sessionId":[1,"session-id"],"language":[1],"autoPick":[4,"auto-pick"],"resetButton":[4,"reset-button"],"tickets":[32],"tabIndex":[32],"hasErrors":[32],"totalAmount":[32],"successVisible":[32],"deleteVisible":[32],"deleteEventData":[32],"daysRemaining":[32],"hoursRemaining":[32],"minutesRemaining":[32],"secondsRemaining":[32],"latestDraw":[32],"totalWinningsAmount":[32],"nextDate":[32],"isLoggedIn":[32],"loginModalVisible":[32]},[[0,"ticketCompleted","gridFilledHandler"],[0,"gridDirty","gridDirtyHandler"],[0,"deleteTicket","deleteTicketHandler"],[0,"modalCloseEvent","modalCloseEvent"],[0,"stakeChange","stakeChangeHandler"],[0,"multiplierChange","multiplierChangeHandler"]]]]]], options);
|
|
17
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-
|
|
1
|
+
import{p as e,b as t}from"./p-2d7ccc96.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-6183a920",[[1,"helper-modal",{titleModal:[1,"title-modal"],visible:[1540]}]]],["p-9ca649d9",[[1,"lottery-draw-results",{endpoint:[1],gameId:[1,"game-id"],language:[1],playerId:[1,"player-id"],drawMode:[4,"draw-mode"],drawId:[1,"draw-id"],gameName:[1,"game-name"],ticketDate:[1,"ticket-date"],ticketStatus:[1,"ticket-status"],ticketId:[1,"ticket-id"],ticketAmount:[1,"ticket-amount"],ticketMultiplier:[4,"ticket-multiplier"],ticketDrawCount:[2,"ticket-draw-count"],multiplier:[32],isLoading:[32],drawResults:[32],rules:[32],toggleDrawer:[32],hasErrors:[32],errorText:[32]}]]],["p-e98ee83a",[[1,"lottery-game-page",{endpoint:[1],gameId:[1,"game-id"],playerId:[2,"player-id"],sessionId:[1,"session-id"],language:[1],autoPick:[4,"auto-pick"],resetButton:[4,"reset-button"],tickets:[32],tabIndex:[32],hasErrors:[32],totalAmount:[32],successVisible:[32],deleteVisible:[32],deleteEventData:[32],daysRemaining:[32],hoursRemaining:[32],minutesRemaining:[32],secondsRemaining:[32],latestDraw:[32],totalWinningsAmount:[32],nextDate:[32],isLoggedIn:[32],loginModalVisible:[32]},[[0,"ticketCompleted","gridFilledHandler"],[0,"gridDirty","gridDirtyHandler"],[0,"deleteTicket","deleteTicketHandler"],[0,"modalCloseEvent","modalCloseEvent"],[0,"stakeChange","stakeChangeHandler"],[0,"multiplierChange","multiplierChangeHandler"]]]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),r=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=(e,t,n)=>{n&&n.map((([n,l,s])=>{const c=e,r=a(t,s),i=u(n);o.ael(c,l,r,i),(t.o=t.o||[]).push((()=>o.rel(c,l,r,i)))}))},a=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){J(e)}},u=e=>0!=(2&e),f=new WeakMap,d=e=>"sc-"+e.h,h={},$=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!$(l))&&(l+=""),s&&o?c[c.length-1].$+=l:c.push(s?m(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=m(e,null);return i.m=t,c.length>0&&(i.p=c),i},m=(e,t)=>({t:0,g:e,$:t,S:null,p:null,m:null}),p={},b=(e,t,n,s,c,r)=>{if(n!==s){let i=I(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,l=g(n),o=g(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(i||"o"!==t[0]||"n"!==t[1]){const l=$(s);if((i||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):I(l,a)?a.slice(2):a[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},w=/\s/,g=e=>e?e.split(w):[],S=(e,t,n,l)=>{const s=11===t.S.nodeType&&t.S.host?t.S.host:t.S,o=e&&e.m||h,c=t.m||h;for(l in o)l in c||b(s,l,o[l],void 0,n,t.t);for(l in c)b(s,l,o[l],c[l],n,t.t)},j=(t,n,l)=>{let o,c,r=n.p[l],i=0;if(null!==r.$)o=r.S=s.createTextNode(r.$);else if(o=r.S=s.createElement(r.g),S(null,r,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),r.p)for(i=0;i<r.p.length;++i)c=j(t,r,i),c&&o.appendChild(c);return o},v=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=j(null,l,o),r&&(s[o].S=r,i.insertBefore(r,n)))},k=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.S.remove()},C=(e,t)=>e.g===t.g,M=(e,t)=>{const n=t.S=e.S,l=e.p,s=t.p,o=t.$;null===o?("slot"===t.g||S(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],a=t[r],u=l.length-1,f=l[0],d=l[u];for(;o<=r&&c<=u;)null==i?i=t[++o]:null==a?a=t[--r]:null==f?f=l[++c]:null==d?d=l[--u]:C(i,f)?(M(i,f),i=t[++o],f=l[++c]):C(a,d)?(M(a,d),a=t[--r],d=l[--u]):C(i,d)?(M(i,d),e.insertBefore(i.S,a.S.nextSibling),i=t[++o],d=l[--u]):C(a,f)?(M(a,f),e.insertBefore(a.S,i.S),a=t[--r],f=l[++c]):(s=j(t&&t[c],n,c),f=l[++c],s&&i.S.parentNode.insertBefore(s,i.S));o>r?v(e,null==l[u+1]?null:l[u+1].S,n,l,c,u):c>u&&k(t,o,r)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&k(l,0,l.length-1)):e.$!==o&&(n.data=o)},O=e=>B(e).j,P=(e,t,n)=>{const l=O(e);return{emit:e=>x(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},x=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},E=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},N=(e,t)=>{if(e.t|=16,!(4&e.t))return E(e,e.k),se((()=>T(e,t)));e.t|=512},T=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>U(n,e,t))),e.u=null)),W(void 0,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.C,n=e.j,l=t.t,o=((e,t)=>{let n=d(t),l=X.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=f.get(e=e.head||e);o||f.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);F(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>L(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},F=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C,c=n.M||m(null,null),r=(e=>e&&e.g===p)(l)?l:y(null,null,l);t=s.tagName,o.O&&(r.m=r.m||{},o.O.map((([e,t])=>r.m[t]=s[e]))),r.g=null,r.t|=4,n.M=r,r.S=c.S=s.shadowRoot||s,e=s["s-sc"],M(c,r)})(n,l)}catch(e){J(e,n.j)}return null},L=e=>{const t=e.j,n=e.k;64&e.t||(e.t|=64,q(t),e.P(t),n||R()),e.v&&(e.v(),e.v=void 0),512&e.t&&le((()=>N(e,!1))),e.t&=-517},R=()=>{q(s.documentElement),le((()=>x(l,"appload",{detail:{namespace:"lottery-game-page"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){J(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),q=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.N){const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>B(this).T.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=B(e),o=s.T.get(t),c=s.t,r=s.i;n=((e,t)=>null==e||$(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.N[t][0]),8&c&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.T.set(t,n),r&&2==(18&c)&&N(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.O.push([e,s]),s}))}}return e},V=e=>{U(e,"connectedCallback")},_=(e,t={})=>{const n=[],c=t.exclude||[],a=l.customElements,u=s.head,f=u.querySelector("meta[charset]"),h=s.createElement("style"),$=[];let y,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],N:t[2],A:t[3]};l.N=t[2],l.A=t[3],l.O=[];const s=l.h,u=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=B(e),n=t.C,l=()=>{};if(1&t.t)i(e,t,n.A),V(t.i);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){E(t,t.k=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,e(),V(t.i)}if(s.style){let e=s.style;const t=d(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);r&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,c=()=>N(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=B(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),U(t,"disconnectedCallback")}})()))}componentOnReady(){return B(this).F}};l.L=e[0],c.includes(s)||a.get(s)||(n.push(s),a.define(s,H(u,l,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),u.insertBefore(h,f?f.nextSibling:u.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>y=setTimeout(R,30)))},z=new WeakMap,B=e=>z.get(e),D=(e,t)=>z.set(t.i=e,t),G=(e,t)=>{const n={t:0,j:e,C:t,T:new Map};return n.F=new Promise((e=>n.P=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.A),z.set(e,n)},I=(e,t)=>t in e,J=(e,t)=>(0,console.error)(e,t),K=new Map,Q=e=>{const t=e.h.replace(/-/g,"_"),n=e.L,l=K.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(K.set(n,e),e[t])),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?le(ne):o.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){J(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&o.raf(ne)},le=e=>c().then(e),se=ee(Z,!0);export{_ as b,P as c,O as g,y as h,c as p,D as r}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as i,h as e}from"./p-
|
|
1
|
+
import{r as o,c as i,h as e}from"./p-2d7ccc96.js";const s=o=>!!(o.toLowerCase().match(/android/i)||o.toLowerCase().match(/blackberry|bb/i)||o.toLowerCase().match(/iphone|ipad|ipod/i)||o.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),l=class{constructor(e){o(this,e),this.cancel=i(this,"modalCloseEvent",7),this.visible=!0,this.userAgent=window.navigator.userAgent}handleHelperModalClose(){this.visible=!1,this.cancel.emit()}render(){return this.visible&&e("div",{class:this.visible?"HelperModalWrapper HelperModalVisible":"HelperModalWrapper"},e("div",{class:"HelperModalWrapper HelperModalVisible"},e("div",{class:"HelperModalContent"+(s(this.userAgent)?" HelperModalMobileContent":"")},e("span",{class:"HelperModalClose"+(s(this.userAgent)?" HelperModalMobileClose":""),onClick:this.handleHelperModalClose.bind(this)},"X"),e("slot",null))))}};l.style=":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px #848e97;box-shadow:2px 2px 2px rgba(0, 0, 0, 0.007);font-size:14px;padding:10px 10px 5px 10px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:#FFF;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:#000}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:#000}";export{l as helper_modal}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e}from"./p-2d7ccc96.js";import"@everymatrix/lottery-grid";const i=["ro","en"],s={en:{drawResultsHeader:"Last draw results",drawId:"Draw ID",drawName:"Game name",drawDate:"Draw Date",drawNumbersGridDraw:"Draw numbers Grid A",drawNumbersGridTicket:"Draw numbers Grid B",ticketResult:"Ticket result",amountWon:"Amount won",numberOfDraws:"Number of draws",multiplier:"Multiplier:",ticketPurchaseDate:"Ticket Purchase Date",ticketStatus:"Ticket Status",ticketId:"Ticket ID",ticketAmount:"Ticket Amount",winUpTo:"Win up to"},ro:{drawResultsHeader:"Ultimele rezultate extragere",drawId:"Id extragere",drawName:"Numele jocului",drawDate:"Data extragerii",drawNumbersGridDraw:"Numerele extrase Grid A",drawNumbersGridTicket:"Numerele extrase Grid B",ticketResult:"Rezultatul biletului",amountWon:"Suma castigata",numberOfDraws:"Numarul de extrageri",multiplier:"Multiplicator:",ticketPurchaseDate:"Data achizitionarii biletului",ticketStatus:"Statusul biletului",ticketId:"Id biletul",ticketAmount:"Valoarea biletului",winUpTo:"Poti castiga"}},a=(t,e)=>{const a=e;return s[void 0!==a&&i.includes(a)?a:"en"][t]},r=class{constructor(e){t(this,e),this.language="en",this.drawMode=!1,this.drawId="",this.gameName="",this.ticketDate="",this.ticketStatus="",this.ticketId="",this.ticketAmount="",this.ticketMultiplier=!1,this.ticketDrawCount=0,this.multiplier=3,this.isLoading=!0,this.drawResults=[],this.rules={},this.toggleDrawer=[!1],this.hasErrors=!1,this.errorText="",this.changeBox=t=>{this.toggleDrawer=this.toggleDrawer.map(((e,i)=>i==t?!e:e)),t>=this.toggleDrawer.length&&this.toggleDrawer.push(!0)}}connectedCallback(){let t=[];t.push(this.getGameData()),this.drawId&&t.push(this.getDrawData()),Promise.all(t).then((()=>{this.isLoading=!1}))}getDrawData(){return new Promise(((t,e)=>{let i=new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);fetch(i.href).then((t=>t.json())).then((e=>{this.drawData=e,t(!0),this.isLoading=!1})).catch((t=>{e(t),this.isLoading=!1}))}))}getGameData(){return new Promise(((t,e)=>{let i=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(i.href).then((t=>t.json())).then((e=>{this.rules={maximumAllowed:e.rules.boards[0].maximumAllowed,totalNumbers:e.rules.boards[0].totalNumbers},t(!0),this.isLoading=!1,this.hasErrors=!1})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,this.errorText=t,e(t)}))}))}render(){return this.isLoading?e("p",null,"Loading, please wait ..."):this.hasErrors?void e("p",null,this.errorText):e("section",{class:"DrawResultsSection"},this.drawMode?e("div",{class:"DrawResultsArea"},this.drawData&&e("div",null,e("div",{class:"DrawResultsHeader"},e("span",null,a("drawId",this.language),": ",this.drawData.id),e("span",null,a("drawDate",this.language),": ",this.drawData.date.slice(0,10))),e("div",{class:"DrawResultsBody"},e("div",{class:"DrawNumbersGrid"},e("p",null,a("drawNumbersGridDraw",this.language),":"),e("div",{class:"BulletContainer"},e("lottery-grid",{"maximum-allowed":this.rules.maximumAllowed,"total-numbers":this.rules.totalNumbers,selectedNumbers:this.drawData.winningNumbers.join(","),"display-selected":!0,selectable:!1,language:this.language})),e("div",{class:"DrawMultipler"},e("label",{class:"Label"},a("multiplier",this.language)," ",this.multiplier)))))):e("div",{class:"DrawResultsArea"},e("div",{class:"TicketInfo"},e("div",{class:"TicketGameName"},a("drawName",this.language),": ",e("span",null,this.gameName)),e("div",{class:"TicketDate"},a("ticketPurchaseDate",this.language),": ",e("span",null,this.ticketDate.slice(0,10))),e("div",{class:"TicketStatus"},a("ticketStatus",this.language),": ",e("span",null,this.ticketStatus))),e("div",{class:"DrawResultsBody"},e("div",{class:"TicketIdContainer"},e("p",null,a("ticketId",this.language),": ",e("span",null,this.ticketId))),e("div",{class:"TicketAmountContainer"},e("p",null,a("ticketAmount",this.language)," ",e("span",null,this.ticketAmount))),e("div",{class:"DrawNumbersGrid"},e("p",null,a("drawNumbersGridTicket",this.language),":"),e("div",{class:"BulletContainer"},e("lottery-grid",{"maximum-allowed":this.rules.maximumAllowed,"total-numbers":this.rules.totalNumbers,"selected-numbers":this.selection,selectable:!1,"display-selected":!0,language:this.language}))),e("div",{class:"DrawMultipler"},e("label",{class:"Label"},a("winUpTo",this.language)," ",e("span",null,JSON.stringify(this.ticketMultiplier)))),e("div",{class:"NumberOfDrawsContainer"},e("p",null,a("numberOfDraws",this.language),": ",this.ticketDrawCount),e("div",{class:"DrawTicketsContainer"},this.drawResults.map(((t,i)=>e("div",{class:"ExpandableBoxes"},e("div",{class:this.toggleDrawer[i]?"ExpandableBox ShowBox":"ExpandableBox",onClick:()=>this.changeBox(i)},e("div",{class:"TicketResultContainer"},e("p",null,a("ticketResult",this.language),": ",t.status)),"won"==t.state&&e("div",{class:"AmountWonContainer"},e("p",null,a("amountWon",this.language),": ",Number(t.amount).toLocaleString("en")," ",t.currency)),e("div",{class:"DrawIdContainer"},e("p",null,a("drawId",this.language),": ",t.drawId)),e("div",{class:"DrawDateContainer"},e("p",null,a("drawDate",this.language),": ",t.updatedAt.slice(0,10)," | ",t.updatedAt.slice(11,19))),e("div",{class:"DrawNumbersGrid"}),e("div",{class:"DrawMultipler"},e("label",{class:"Label"},a("winUpTo",this.language)," ",t.multiplier)))))))))))}};r.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsArea{margin-top:15px}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0px 20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;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%, #eee 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:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{line-height:12px;font-weight:lighter;width:100%;height:100%;max-height:70px;float:left;margin:0 0 20px 0;border:1px solid #f1f1f1;background:#fff;border-radius:4px;padding:10px;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden;box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}';export{r as lottery_draw_results}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as t,g as i}from"./p-2d7ccc96.js";import"@everymatrix/lottery-ticket-controller";import"@everymatrix/lottery-game-details";import"@everymatrix/lottery-draw-results-history";const a=["ro","en","ar"],r={en:{error:"Error",title:"Chrono",backButton:"Back",lobbyButton:"Lobby",prize:"Prize",winUpTo:"Win up to",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",createTicket:"Create Ticket",modalSuccess:"Purchase successfully completed!",deleteTicketModalTitle:"Delete Ticket",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Cancel",deleteTicketModalConfirm:"Delete",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",lastDrawResultsTitle:"Last Draw Results",modalLogin:"Please login to submit a ticket"},ro:{error:"Eroare",title:"Loto 6/49",backButton:"Inapoi",lobbyButton:"Lobby",prize:"MARELE JACKPOT OMG",winUpTo:"Castiga pana la",nextDraw:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",createTicket:"Creeaza bilet",modalSuccess:"Achizitie efectuata cu succes",deleteTicketModalTitle:"Sterge biletul",deleteTicketModalText:"Esti sigur ca vrei sa stergi acest bilet?",deleteTicketModalCancel:"Anuleaza",deleteTicketModalConfirm:"Sterge",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",lastDrawResultsTitle:"Cele mai recente extrageri",modalLogin:"Please login to submit a ticket"},ar:{error:"خطأ",title:"كرونو",backButton:"خلف",lobbyButton:"ردهة",prize:"جائزة",winUpTo:"الفوز بما يصل الى",nextDraw:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",createTicket:"إنشاء تذكرة",modalSuccess:"!سيتم الشراء بنجاح قريبًا",deleteTicketModalTitle:"حذف التذكرة",deleteTicketModalText:"هل أنت متأكد أنك تريد حذف هذه التذكرة؟",deleteTicketModalCancel:"يلغي",deleteTicketModalConfirm:"حذف",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",lastDrawResultsTitle:"Cele mai recente extrageri",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة"}},s=(e,t)=>{const i=t;return r[void 0!==i&&a.includes(i)?i:"en"][e]},n=class{constructor(t){e(this,t),this.language="en",this.autoPick=!1,this.resetButton=!1,this.tickets=[],this.tabIndex=0,this.hasErrors=!1,this.totalAmount=0,this.successVisible=!1,this.deleteVisible=!1,this.latestDraw={},this.totalWinningsAmount=0,this.isLoggedIn=!1,this.loginModalVisible=!1,this.multiplier=!1,this.quickPick=!1}connectedCallback(){this.getGameDetails(),this.getDraws(),console.log(this.language),this.sessionId&&(this.isLoggedIn=!0)}countdownLogic(e){this.interval=setInterval((()=>{this.daysRemaining=Math.floor((Date.parse(e)-(new Date).getTime())/864e5),this.hoursRemaining=Math.floor((Date.parse(e)-(new Date).getTime())/36e5-24*this.daysRemaining),this.minutesRemaining=Math.floor((Date.parse(e)-(new Date).getTime())/6e4-24*this.daysRemaining*60-60*this.hoursRemaining),this.secondsRemaining=Math.floor((Date.parse(e)-(new Date).getTime())/1e3-24*this.daysRemaining*60*60-60*this.hoursRemaining*60-60*this.minutesRemaining)}),1e3)}disconnectedCallback(){clearInterval(this.interval)}getGameDetails(){let e=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(e.href).then((e=>{if(e.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return e.json()})).then((e=>{this.gameData=e,this.basicStake=this.gameData.rules.stakes[0].amount;let t=this.gameData.draws.filter((e=>!e.winningNumbers));this.nextDraw=t[0].id,this.createNewTicket()})).catch((e=>{this.hasErrors=!0,console.log("Error",e)}))}calculateTotalAmount(){const{currency:e}=this.gameData.rules.stakes[0];this.totalAmount=0,this.tickets.forEach((e=>{e.completed&&(this.totalAmount+=e.amount*e.stake)})),this.currency=e}gridFilledHandler(e){this.tickets=this.tickets.map((t=>{if(t.ticketId==e.detail.id){let i=t.selectedNumbers||[];return i[e.detail.index]=e.detail.selectedNumbers.map((e=>parseInt(e,10))),{gameId:t.gameId,ticketId:t.ticketId,completed:!0,amount:e.detail.draws,stake:t.stake,selectedNumbers:i}}return t})),this.calculateTotalAmount()}gridDirtyHandler(e){this.tickets=this.tickets.map((t=>t.gameId==e.detail.id?{gameId:t.gameId,ticketId:t.ticketId,completed:!1,amount:t.amount,stake:t.stake,grids:[]}:t))}deleteTicketHandler(e){this.deleteVisible=!0,this.deleteEventData=e}modalCloseEvent(){this.deleteVisible=!1,this.loginModalVisible=!1}stakeChangeHandler(e){const{ticketId:t,stake:i}=e.detail;this.tickets[t-1].stake=i,this.calculateTotalAmount()}multiplierChangeHandler(e){this.multiplier=e.detail}getDraws(){let e=new URL(`${this.endpoint}/games/${this.gameId}/draws`);fetch(e.href,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>e.json())).then((e=>{var t;let i=e.items.filter((e=>{if(Date.parse(e.date)>(new Date).getTime())return!e.winningNumbers})),a=e.items.filter((e=>e.winningNumbers));this.latestDraw=i[0],this.nextDate=this.latestDraw.date,this.countdownLogic(this.nextDate),this.lastDrawId=a[a.length-1].id,null===(t=this.latestDraw)||void 0===t||t.prizes.forEach((e=>{this.totalWinningsAmount+=JSON.parse(e.amount)}))}))}confirmDeleteTicketHandler(e){this.tickets=this.tickets.filter((t=>t.ticketId!=e.detail.ticketId)),this.calculateTotalAmount(),this.deleteVisible=!1}createNewTicket(){this.tickets=[...this.tickets,{gameId:this.gameId,ticketId:this.tickets.length+1,completed:!1,amount:1,stake:this.basicStake,grids:[]}]}showLoginModal(){this.loginModalVisible=!0}submitTickets(){let e=new URL(`${this.endpoint}/tickets`),t={gameId:this.gameId,tickets:[]};this.tickets.forEach((e=>{t.tickets.push({startingDrawId:this.nextDraw,amount:e.stake,gameId:this.gameId,currency:this.currency,selection:e.selectedNumbers,multiplier:this.multiplier,drawCount:e.amount,quickPick:this.quickPick})}));let i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.sessionId}`},body:JSON.stringify(t)};fetch(e.href,i).then((e=>{if(e.status>300)throw new Error("err");return e.json()})).then((e=>{console.log("data",e)})),this.successVisible=!0}render(){return this.hasErrors?t("div",{class:"GamePage"},t("div",{class:"Title"},s("error",this.language))):t("div",{class:"GamePage",dir:"ar"==this.language?"rtl":"ltr"},t("div",{class:"GridBanner"},t("div",{class:"BannerButtonsWrapper"},t("button",{class:"BannerBackButton"},t("span",{class:"BannerBackButtonArrow"},"ᐸ "),s("backButton",this.language)),t("button",{class:"BannerLobbyButton"},s("lobbyButton",this.language))),t("div",{class:"Tabs"},t("div",{class:"TabButton"+(0==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=0},s("buy",this.language)),t("div",{class:"TabButton"+(1==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=1},s("viewLatest",this.language)))),t("div",{class:"NextDrawWrapper"},t("div",{class:"TotalWinnings"},s("winUpTo",this.language),": ",t("span",null,"$",this.totalWinningsAmount.toLocaleString("en-US",{maximumFractionDigits:2}))),t("div",{class:"NextDraw"},t("p",{class:"BannerText"},s("nextDraw",this.language)),t("div",{class:"BannerCountdown"},t("span",{class:"CountdownDays"},this.daysRemaining,"D"),t("span",{class:"CountdownHours"},this.hoursRemaining,"H"),t("span",{class:"CountdownMinutes"},this.minutesRemaining,"M"),t("span",{class:"CountdownSeconds"},this.secondsRemaining,"S")))),0==this.tabIndex&&t("div",{class:"GamePageContent"},t("div",{class:"GameDetails"},t("lottery-game-details",null)),t("div",{class:"TicketsWrapper"},this.tickets.map((e=>t("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":e.ticketId,"game-id":e.gameId,collapsed:!1,last:!0,language:this.language,"auto-pick":this.autoPick,"reset-button":this.resetButton}))),t("div",{class:"CreateNewTicket"},t("button",{onClick:()=>this.createNewTicket()},"+"),t("span",null,s("createTicket",this.language)))),t("div",{class:"OrderSummary"},t("h3",{class:"OrderSummaryTitle"},s("orderSummaryTitle",this.language)),t("div",{class:"Ticket"},s("orderSummaryTickets",this.language),": ",t("span",null,this.tickets.length)),t("div",{class:"Total"},s("orderSummaryTotal",this.language),": ",t("span",null,this.totalAmount," ",this.currency)),t("div",{class:"ButtonWrapper"},this.isLoggedIn&&t("span",{class:"Button",onClick:()=>this.submitTickets()},s("orderSummarySubmit",this.language)),!this.isLoggedIn&&t("div",null,t("span",{class:"Button",onClick:()=>this.showLoginModal()},s("orderSummarySubmit",this.language)),t("helper-modal",{"title-modal":"Success",visible:this.loginModalVisible},t("p",{class:"SubmitModalSuccess"},s("modalLogin",this.language))))))),1==this.tabIndex&&t("div",null,t("h4",{class:"LastDrawResultsTitle"},s("lastDrawResultsTitle",this.language)),t("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"draw-id":this.lastDrawId,"draw-mode":!0}),t("lottery-draw-results-history",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language})),t("helper-modal",{"title-modal":"Success",visible:this.successVisible},t("p",{class:"SubmitModalSuccess"},s("modalSuccess",this.language))),t("helper-modal",{"title-modal":"Delete Ticket",visible:this.deleteVisible},t("div",{class:"DeleteTicketModalWrapper"},t("h3",{class:"DeleteTicketModalTitle"},s("deleteTicketModalTitle",this.language)),t("p",{class:"DeleteTicketModalText"},s("deleteTicketModalText",this.language)),t("div",{class:"DeleteTicketModalButtons"},t("button",{class:"DeleteTicketModalCancel",onClick:()=>this.modalCloseEvent()},s("deleteTicketModalCancel",this.language)),t("button",{class:"DeleteTicketModalConfirm",onClick:()=>this.confirmDeleteTicketHandler(this.deleteEventData)},s("deleteTicketModalConfirm",this.language))))))}static get assetsDirs(){return["static"]}get element(){return i(this)}};n.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#F1F1F1;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{background:#00958f;color:#FFF}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;border-bottom:solid 1px #D4D4D4;line-height:50px}.OrderSummary .Ticket span{text-align:right}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}';export{n as lottery_game_page}
|
|
@@ -46,6 +46,8 @@ export declare class LotteryGamePage {
|
|
|
46
46
|
private latestDraw;
|
|
47
47
|
private totalWinningsAmount;
|
|
48
48
|
private nextDate;
|
|
49
|
+
private isLoggedIn;
|
|
50
|
+
private loginModalVisible;
|
|
49
51
|
element: HTMLElement;
|
|
50
52
|
private basicStake;
|
|
51
53
|
private multiplier;
|
|
@@ -69,6 +71,7 @@ export declare class LotteryGamePage {
|
|
|
69
71
|
getDraws(): void;
|
|
70
72
|
confirmDeleteTicketHandler(event: any): void;
|
|
71
73
|
createNewTicket(): void;
|
|
74
|
+
showLoginModal(): void;
|
|
72
75
|
submitTickets(): void;
|
|
73
76
|
render(): void;
|
|
74
77
|
}
|