@everymatrix/lottery-game-page 0.1.26 → 1.0.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/{helper-filters_2.cjs.entry.js → helper-accordion_13.cjs.entry.js} +13401 -9890
  3. package/dist/cjs/helper-pagination.cjs.entry.js +197 -189
  4. package/dist/cjs/index-f3851683.js +1345 -0
  5. package/dist/cjs/loader.cjs.js +7 -13
  6. package/dist/cjs/lottery-game-page.cjs.js +17 -11
  7. package/dist/collection/collection-manifest.json +4 -10
  8. package/dist/collection/components/lottery-game-page/index.js +1 -0
  9. package/dist/collection/components/lottery-game-page/lottery-game-page.css +11 -2
  10. package/dist/collection/components/lottery-game-page/lottery-game-page.js +579 -594
  11. package/dist/collection/utils/locale.utils.js +118 -95
  12. package/dist/collection/utils/utils.js +4 -4
  13. package/dist/esm/app-globals-0f993ce5.js +3 -0
  14. package/dist/esm/{helper-filters_2.entry.js → helper-accordion_13.entry.js} +13391 -9891
  15. package/dist/esm/helper-pagination.entry.js +197 -189
  16. package/dist/esm/index-8248702b.js +1316 -0
  17. package/dist/esm/loader.js +7 -13
  18. package/dist/esm/lottery-game-page.js +14 -11
  19. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
  20. package/dist/lottery-game-page/p-46aaa562.entry.js +1 -0
  21. package/dist/lottery-game-page/p-8f2c63c7.js +2 -0
  22. package/dist/lottery-game-page/p-bd89bbf0.entry.js +3567 -0
  23. package/dist/lottery-game-page/p-e1255160.js +1 -0
  24. package/dist/stencil.config.dev.js +17 -0
  25. package/dist/stencil.config.js +12 -36
  26. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.d.ts +2 -0
  27. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.dev.d.ts +2 -0
  28. package/dist/types/components/lottery-game-page/index.d.ts +1 -0
  29. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +99 -90
  30. package/dist/types/components.d.ts +28 -2
  31. package/dist/types/stencil-public-runtime.d.ts +142 -33
  32. package/loader/cdn.js +1 -3
  33. package/loader/index.cjs.js +1 -3
  34. package/loader/index.d.ts +13 -1
  35. package/loader/index.es2017.js +1 -3
  36. package/loader/index.js +1 -3
  37. package/loader/package.json +1 -0
  38. package/package.json +13 -7
  39. package/dist/cjs/helper-accordion.cjs.entry.js +0 -124
  40. package/dist/cjs/helper-modal.cjs.entry.js +0 -76
  41. package/dist/cjs/helper-tab.cjs.entry.js +0 -68
  42. package/dist/cjs/helper-tabs.cjs.entry.js +0 -74
  43. package/dist/cjs/index-cd44e726.js +0 -1324
  44. package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -270
  45. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -198
  46. package/dist/cjs/lottery-game-details.cjs.entry.js +0 -51
  47. package/dist/cjs/lottery-game-page.cjs.entry.js +0 -427
  48. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -116
  49. package/dist/cjs/lottery-ticket.cjs.entry.js +0 -201
  50. package/dist/collection/components/lottery-game-page/static/chrono_desktop.png +0 -0
  51. package/dist/collection/components/lottery-game-page/static/chrono_lottery_mobile.png +0 -0
  52. package/dist/components/assets/chrono_desktop.png +0 -0
  53. package/dist/components/assets/chrono_lottery_mobile.png +0 -0
  54. package/dist/components/helper-accordion.js +0 -6
  55. package/dist/components/helper-accordion2.js +0 -151
  56. package/dist/components/helper-filters.js +0 -6
  57. package/dist/components/helper-filters2.js +0 -22394
  58. package/dist/components/helper-modal.js +0 -6
  59. package/dist/components/helper-modal2.js +0 -94
  60. package/dist/components/helper-pagination.js +0 -251
  61. package/dist/components/helper-tab.js +0 -6
  62. package/dist/components/helper-tab2.js +0 -87
  63. package/dist/components/helper-tabs.js +0 -6
  64. package/dist/components/helper-tabs2.js +0 -103
  65. package/dist/components/index.d.ts +0 -26
  66. package/dist/components/index.js +0 -1
  67. package/dist/components/lottery-bullet.js +0 -6
  68. package/dist/components/lottery-bullet2.js +0 -92
  69. package/dist/components/lottery-draw-results-history.js +0 -6
  70. package/dist/components/lottery-draw-results-history2.js +0 -256
  71. package/dist/components/lottery-draw-results.js +0 -6
  72. package/dist/components/lottery-draw-results2.js +0 -335
  73. package/dist/components/lottery-game-details.js +0 -6
  74. package/dist/components/lottery-game-details2.js +0 -85
  75. package/dist/components/lottery-game-page.d.ts +0 -11
  76. package/dist/components/lottery-game-page.js +0 -542
  77. package/dist/components/lottery-grid.js +0 -6
  78. package/dist/components/lottery-grid2.js +0 -237
  79. package/dist/components/lottery-ticket-controller.js +0 -6
  80. package/dist/components/lottery-ticket-controller2.js +0 -168
  81. package/dist/components/lottery-ticket.js +0 -6
  82. package/dist/components/lottery-ticket2.js +0 -244
  83. package/dist/esm/helper-accordion.entry.js +0 -120
  84. package/dist/esm/helper-modal.entry.js +0 -72
  85. package/dist/esm/helper-tab.entry.js +0 -64
  86. package/dist/esm/helper-tabs.entry.js +0 -70
  87. package/dist/esm/index-d1baacd4.js +0 -1296
  88. package/dist/esm/lottery-bullet_2.entry.js +0 -265
  89. package/dist/esm/lottery-draw-results-history.entry.js +0 -194
  90. package/dist/esm/lottery-game-details.entry.js +0 -47
  91. package/dist/esm/lottery-game-page.entry.js +0 -423
  92. package/dist/esm/lottery-ticket-controller.entry.js +0 -112
  93. package/dist/esm/lottery-ticket.entry.js +0 -197
  94. package/dist/esm/polyfills/core-js.js +0 -11
  95. package/dist/esm/polyfills/css-shim.js +0 -1
  96. package/dist/esm/polyfills/dom.js +0 -79
  97. package/dist/esm/polyfills/es5-html-element.js +0 -1
  98. package/dist/esm/polyfills/index.js +0 -34
  99. package/dist/esm/polyfills/system.js +0 -6
  100. package/dist/lottery-game-page/p-023325a2.entry.js +0 -1
  101. package/dist/lottery-game-page/p-04fbc8fd.entry.js +0 -1
  102. package/dist/lottery-game-page/p-256b151c.entry.js +0 -1
  103. package/dist/lottery-game-page/p-381b5507.entry.js +0 -1
  104. package/dist/lottery-game-page/p-3f8b6ad9.entry.js +0 -1
  105. package/dist/lottery-game-page/p-4274053c.entry.js +0 -1
  106. package/dist/lottery-game-page/p-4f81cd37.entry.js +0 -1
  107. package/dist/lottery-game-page/p-5c389034.entry.js +0 -1
  108. package/dist/lottery-game-page/p-7d06371e.entry.js +0 -1
  109. package/dist/lottery-game-page/p-ca8430a0.entry.js +0 -2849
  110. package/dist/lottery-game-page/p-d6f76e8d.entry.js +0 -1
  111. package/dist/lottery-game-page/p-e765c7d9.js +0 -1
  112. package/dist/lottery-game-page/p-f6fcc22c.entry.js +0 -1
  113. package/dist/lottery-game-page/static/chrono_desktop.png +0 -0
  114. package/dist/lottery-game-page/static/chrono_lottery_mobile.png +0 -0
  115. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
@@ -1,607 +1,592 @@
1
- import { Component, h, Prop, State, Listen, Element, Watch, getAssetPath } from '@stencil/core';
2
- import { translate } from '../../utils/locale.utils';
1
+ import { h, getAssetPath } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
3
  import { isMobile } from "../../utils/utils";
4
- import '@everymatrix/lottery-ticket-controller';
5
- import '@everymatrix/helper-modal';
6
- import '@everymatrix/lottery-game-details';
7
- import '@everymatrix/lottery-draw-results-history';
8
- import '@everymatrix/lottery-draw-results';
4
+ import "../../../../../lottery-ticket-controller/dist/types/index";
5
+ import "../../../../../helper-modal/dist/types/index";
6
+ import "../../../../../lottery-game-details/dist/types/index";
7
+ import "../../../../../lottery-draw-results-history/dist/types/index";
8
+ import "../../../../../lottery-draw-results/dist/types/index";
9
9
  export class LotteryGamePage {
10
- constructor() {
11
- /**
12
- * Language of the widget
13
- */
14
- this.language = 'en';
15
- /**
16
- * Shows the auto-pick button
17
- */
18
- this.autoPick = false;
19
- /**
20
- * Shows the reset button
21
- */
22
- this.resetButton = false;
23
- /**
24
- * Client custom styling via string
25
- */
26
- this.clientStyling = '';
27
- /**
28
- * Client custom styling via url
29
- */
30
- this.clientStylingurl = '';
31
- this.clientStylingUrlContent = '';
32
- this.tickets = [];
33
- this.tabIndex = 0;
34
- this.hasErrors = false;
35
- this.totalAmount = 0;
36
- this.successVisible = false;
37
- this.deleteVisible = false;
38
- this.latestDraw = {};
39
- this.totalWinningsAmount = 0;
40
- this.isLoggedIn = false;
41
- this.loginModalVisible = false;
42
- this.limitStylingAppends = false;
10
+ constructor() {
11
+ // @TODO fix any type
12
+ this.userAgent = window.navigator.userAgent;
13
+ this.multiplier = false;
14
+ this.quickPick = false;
15
+ this.isMobile = isMobile(this.userAgent);
16
+ this.setClientStyling = () => {
17
+ let sheet = document.createElement('style');
18
+ sheet.innerHTML = this.clientStyling;
19
+ this.stylingContainer.prepend(sheet);
20
+ };
21
+ this.setClientStylingURL = () => {
22
+ let url = new URL(this.clientStylingurl);
23
+ let cssFile = document.createElement('style');
24
+ fetch(url.href)
25
+ .then((res) => res.text())
26
+ .then((data) => {
27
+ this.clientStylingUrlContent = data;
28
+ cssFile.innerHTML = data;
29
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
30
+ })
31
+ .catch((err) => {
32
+ console.log('error ', err);
33
+ });
34
+ };
35
+ this.endpoint = undefined;
36
+ this.gameId = undefined;
37
+ this.playerId = undefined;
38
+ this.sessionId = undefined;
39
+ this.language = 'en';
40
+ this.backgroundUrl = undefined;
41
+ this.autoPick = false;
42
+ this.resetButton = false;
43
+ this.clientStyling = '';
44
+ this.clientStylingurl = '';
45
+ this.clientStylingUrlContent = '';
46
+ this.tickets = [];
47
+ this.tabIndex = 0;
48
+ this.hasErrors = false;
49
+ this.totalAmount = 0;
50
+ this.successVisible = false;
51
+ this.deleteVisible = false;
52
+ this.deleteEventData = undefined;
53
+ this.daysRemaining = undefined;
54
+ this.hoursRemaining = undefined;
55
+ this.minutesRemaining = undefined;
56
+ this.secondsRemaining = undefined;
57
+ this.latestDraw = {};
58
+ this.totalWinningsAmount = 0;
59
+ this.nextDate = undefined;
60
+ this.isLoggedIn = false;
61
+ this.loginModalVisible = false;
62
+ this.limitStylingAppends = false;
63
+ }
64
+ // @TODO fix `any` type later, I'm lazy now
65
+ connectedCallback() {
66
+ this.getGameDetails();
67
+ this.getDraws();
68
+ if (this.sessionId) {
69
+ this.isLoggedIn = true;
70
+ }
71
+ }
72
+ componentDidRender() {
73
+ // start custom styling area
74
+ if (!this.limitStylingAppends && this.stylingContainer) {
75
+ if (this.clientStyling)
76
+ this.setClientStyling();
77
+ if (this.clientStylingurl)
78
+ this.setClientStylingURL();
79
+ this.limitStylingAppends = true;
80
+ }
81
+ // end custom styling area
82
+ }
83
+ countdownLogic(date) {
84
+ this.interval = setInterval(() => {
85
+ this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
86
+ this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
87
+ this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
88
+ this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
89
+ }, 1000);
90
+ }
91
+ disconnectedCallback() {
92
+ clearInterval(this.interval);
93
+ }
94
+ getGameDetails() {
95
+ let url = new URL(`${this.endpoint}/games/${this.gameId}`);
96
+ fetch(url.href)
97
+ .then((res) => {
98
+ if (res.status >= 300) {
99
+ this.hasErrors = true;
100
+ throw new Error('There was an error while fetching the data');
101
+ }
102
+ return res.json();
103
+ })
104
+ .then((data) => {
105
+ this.gameData = data;
106
+ this.basicStake = this.gameData.type.stakes[0].amount;
107
+ let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
108
+ draws.length > 0 && (this.nextDraw = draws[0].id);
109
+ this.createNewTicket();
110
+ })
111
+ .catch((err) => {
112
+ this.hasErrors = true;
113
+ console.log('Error', err);
114
+ });
115
+ }
116
+ calculateTotalAmount() {
117
+ const { currency } = this.gameData.type.stakes[0];
118
+ this.totalAmount = 0;
119
+ this.tickets.forEach((item) => {
120
+ if (item.completed) {
121
+ this.totalAmount += item.amount * item.stake;
122
+ }
123
+ });
124
+ this.currency = currency;
125
+ }
126
+ // @TODO CustomEvent type
127
+ gridFilledHandler(event) {
128
+ // @TODO item ts
129
+ this.tickets = this.tickets.map((item) => {
130
+ if (item.ticketId == event.detail.id) {
131
+ let arr = item.selectedNumbers || [];
132
+ arr[event.detail.index] = event.detail.selectedNumbers.map((item) => parseInt(item, 10));
133
+ return {
134
+ gameId: item.gameId,
135
+ ticketId: item.ticketId,
136
+ completed: true,
137
+ amount: event.detail.draws,
138
+ stake: item.stake,
139
+ selectedNumbers: arr
140
+ };
141
+ }
142
+ return item;
143
+ });
144
+ this.calculateTotalAmount();
145
+ }
43
146
  // @TODO fix any type
44
- this.userAgent = window.navigator.userAgent;
45
- this.multiplier = false;
46
- this.quickPick = false;
47
- this.setClientStyling = () => {
48
- let sheet = document.createElement('style');
49
- sheet.innerHTML = this.clientStyling;
50
- this.stylingContainer.prepend(sheet);
51
- };
52
- this.setClientStylingURL = () => {
53
- let url = new URL(this.clientStylingurl);
54
- let cssFile = document.createElement('style');
55
- fetch(url.href)
56
- .then((res) => res.text())
57
- .then((data) => {
58
- this.clientStylingUrlContent = data;
59
- cssFile.innerHTML = data;
60
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
61
- })
62
- .catch((err) => {
63
- console.log('error ', err);
64
- });
65
- };
66
- }
67
- // @TODO fix `any` type later, I'm lazy now
68
- handleSessionIdValue() {
69
- this.isLoggedIn = true;
70
- }
71
- connectedCallback() {
72
- this.getGameDetails();
73
- this.getDraws();
74
- if (this.sessionId) {
75
- this.isLoggedIn = true;
147
+ gridDirtyHandler(event) {
148
+ // @TODO item ts
149
+ this.tickets = this.tickets.map((item) => {
150
+ if (item.gameId == event.detail.id) {
151
+ return {
152
+ gameId: item.gameId,
153
+ ticketId: item.ticketId,
154
+ completed: false,
155
+ amount: item.amount,
156
+ stake: item.stake,
157
+ grids: []
158
+ };
159
+ }
160
+ return item;
161
+ });
162
+ }
163
+ // @TODO CustomEvent type
164
+ deleteTicketHandler(event) {
165
+ this.deleteVisible = true;
166
+ this.deleteEventData = event;
167
+ }
168
+ modalCloseEvent() {
169
+ this.deleteVisible = false;
170
+ this.loginModalVisible = false;
171
+ }
172
+ stakeChangeHandler(event) {
173
+ const { ticketId, stake } = event.detail;
174
+ this.tickets[ticketId - 1].stake = stake;
175
+ this.calculateTotalAmount();
76
176
  }
77
- }
78
- componentDidRender() {
79
- // start custom styling area
80
- if (!this.limitStylingAppends && this.stylingContainer) {
81
- if (this.clientStyling)
82
- this.setClientStyling();
83
- if (this.clientStylingurl)
84
- this.setClientStylingURL();
85
- this.limitStylingAppends = true;
177
+ multiplierChangeHandler(event) {
178
+ this.multiplier = event.detail;
179
+ }
180
+ getDraws() {
181
+ // append from query param with the current date value in order to get the next draw
182
+ let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
183
+ let drawOptions = {
184
+ method: "GET",
185
+ headers: {
186
+ 'Content-Type': "application/json",
187
+ 'Accept': 'application/json',
188
+ },
189
+ };
190
+ fetch(url.href, drawOptions)
191
+ .then((response) => {
192
+ return response.json();
193
+ })
194
+ .then((data) => {
195
+ var _a;
196
+ let upcoming = data.items.filter((item) => {
197
+ if (Date.parse(item.date) > new Date().getTime()) {
198
+ return !item.winningNumbers;
199
+ }
200
+ });
201
+ let past = data.items.filter((item) => item.winningNumbers);
202
+ if (!upcoming[0])
203
+ return;
204
+ this.latestDraw = upcoming[0];
205
+ this.nextDate = this.latestDraw.date;
206
+ this.countdownLogic(this.nextDate);
207
+ this.lastDrawId = past[past.length - 1].id;
208
+ // calculate total winnings
209
+ // @TODO fix any type
210
+ (_a = this.latestDraw) === null || _a === void 0 ? void 0 : _a.prizes.forEach((element) => {
211
+ this.totalWinningsAmount += JSON.parse(element.amount);
212
+ });
213
+ })
214
+ .catch((err) => {
215
+ console.log('error ', err);
216
+ });
217
+ }
218
+ ;
219
+ // @TODO fix any type
220
+ confirmDeleteTicketHandler(event) {
221
+ // @TODO fix any type
222
+ this.tickets = this.tickets.filter((item) => {
223
+ if (item.ticketId == event.detail.ticketId) {
224
+ return false;
225
+ }
226
+ return true;
227
+ });
228
+ this.calculateTotalAmount();
229
+ this.deleteVisible = false;
86
230
  }
87
- // end custom styling area
88
- }
89
- countdownLogic(date) {
90
- if (date) {
91
- this.interval = setInterval(() => {
92
- this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
93
- this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
94
- this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
95
- this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
96
- }, 1000);
231
+ createNewTicket() {
232
+ this.tickets = [
233
+ ...this.tickets,
234
+ { gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
235
+ ];
97
236
  }
98
- }
99
- disconnectedCallback() {
100
- clearInterval(this.interval);
101
- }
102
- getGameDetails() {
103
- let url = new URL(`${this.endpoint}/games/${this.gameId}`);
104
- fetch(url.href)
105
- .then((res) => {
106
- if (res.status >= 300) {
107
- this.hasErrors = true;
108
- throw new Error('There was an error while fetching the data');
109
- }
110
- return res.json();
111
- })
112
- .then((data) => {
113
- this.gameData = data;
114
- this.basicStake = this.gameData.rules.stakes[0].amount;
115
- let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
116
- this.nextDraw = draws[0].id;
117
- this.createNewTicket();
118
- })
119
- .catch((err) => {
120
- this.hasErrors = true;
121
- console.log('Error', err);
122
- });
123
- }
124
- calculateTotalAmount() {
125
- const { currency } = this.gameData.rules.stakes[0];
126
- this.totalAmount = 0;
127
- this.tickets.forEach((item) => {
128
- if (item.completed) {
129
- this.totalAmount += item.amount * item.stake;
130
- }
131
- });
132
- this.currency = currency;
133
- }
134
- // @TODO CustomEvent type
135
- gridFilledHandler(event) {
136
- // @TODO item ts
137
- this.tickets = this.tickets.map((item) => {
138
- if (item.ticketId == event.detail.id) {
139
- let arr = item.selectedNumbers || [];
140
- arr[event.detail.index] = event.detail.selectedNumbers.map((item) => parseInt(item, 10));
237
+ showLoginModal() {
238
+ this.loginModalVisible = true;
239
+ }
240
+ submitTickets() {
241
+ let url = new URL(`${this.endpoint}/tickets`);
242
+ // @TODO Body TS type
243
+ let body = {
244
+ gameId: this.gameId,
245
+ tickets: []
246
+ };
247
+ this.tickets.forEach((item) => {
248
+ body.tickets.push({
249
+ startingDrawId: this.nextDraw,
250
+ amount: item.stake,
251
+ gameId: this.gameId,
252
+ currency: this.currency,
253
+ selection: item.selectedNumbers,
254
+ multiplier: this.multiplier,
255
+ drawCount: item.amount,
256
+ quickPick: this.quickPick,
257
+ });
258
+ });
259
+ // @TODO Options TS type
260
+ let options = {
261
+ method: 'POST',
262
+ headers: {
263
+ 'Content-Type': 'application/json',
264
+ 'Accept': 'application/json',
265
+ 'Authorization': `Bearer ${this.sessionId}`
266
+ },
267
+ body: JSON.stringify(body)
268
+ };
269
+ fetch(url.href, options)
270
+ .then((res) => {
271
+ if (res.status > 300) {
272
+ throw new Error('err');
273
+ }
274
+ return res.json();
275
+ })
276
+ .then((data) => {
277
+ // should we treat this res?
278
+ console.log('data', data);
279
+ })
280
+ .catch((err) => {
281
+ console.log('error ', err);
282
+ });
283
+ this.successVisible = true;
284
+ }
285
+ goBack() {
286
+ this.goBackEvent.emit();
287
+ }
288
+ goToLobby() {
289
+ this.goToLobbyEvent.emit();
290
+ }
291
+ render() {
292
+ //Get path for background image
293
+ const backgroundImagePath = getAssetPath(this.isMobile ? '/assets/chrono_lottery_mobile.png' : '/assets/chrono_desktop.png');
294
+ if (this.hasErrors) {
295
+ return (h("div", { class: "GamePage" }, h("div", { class: "Title" }, translate('error', this.language))));
296
+ }
297
+ return (
298
+ /* Game details */
299
+ h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el }, h("div", { class: "GridBanner", style: { 'background': `url(${this.backgroundUrl ? this.backgroundUrl : backgroundImagePath})`, 'background-size': 'contain', 'background-repeat': 'no-repeat', 'background-position': 'center' } }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton", onClick: this.goBack.bind(this) }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton", onClick: this.goToLobby.bind(this) }, 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 &&
300
+ h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), 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, "total-controllers": this.tickets.length, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), 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("hr", null), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.totalAmount, " ", this.currency)), h("div", { class: "ButtonWrapper" }, this.isLoggedIn &&
301
+ h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language)), !this.isLoggedIn &&
302
+ h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
303
+ 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, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }), h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, 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)))))));
304
+ }
305
+ static get is() { return "lottery-game-page"; }
306
+ static get encapsulation() { return "shadow"; }
307
+ static get originalStyleUrls() {
308
+ return {
309
+ "$": ["lottery-game-page.scss"]
310
+ };
311
+ }
312
+ static get styleUrls() {
141
313
  return {
142
- gameId: item.gameId,
143
- ticketId: item.ticketId,
144
- completed: true,
145
- amount: event.detail.draws,
146
- stake: item.stake,
147
- selectedNumbers: arr
314
+ "$": ["lottery-game-page.css"]
148
315
  };
149
- }
150
- return item;
151
- });
152
- this.calculateTotalAmount();
153
- }
154
- // @TODO fix any type
155
- gridDirtyHandler(event) {
156
- // @TODO item ts
157
- this.tickets = this.tickets.map((item) => {
158
- if (item.gameId == event.detail.id) {
316
+ }
317
+ static get assetsDirs() { return ["static"]; }
318
+ static get properties() {
159
319
  return {
160
- gameId: item.gameId,
161
- ticketId: item.ticketId,
162
- completed: false,
163
- amount: item.amount,
164
- stake: item.stake,
165
- grids: []
320
+ "endpoint": {
321
+ "type": "string",
322
+ "mutable": false,
323
+ "complexType": {
324
+ "original": "string",
325
+ "resolved": "string",
326
+ "references": {}
327
+ },
328
+ "required": false,
329
+ "optional": false,
330
+ "docs": {
331
+ "tags": [],
332
+ "text": "Endpoint URL for the source of data"
333
+ },
334
+ "attribute": "endpoint",
335
+ "reflect": true
336
+ },
337
+ "gameId": {
338
+ "type": "string",
339
+ "mutable": false,
340
+ "complexType": {
341
+ "original": "string",
342
+ "resolved": "string",
343
+ "references": {}
344
+ },
345
+ "required": false,
346
+ "optional": false,
347
+ "docs": {
348
+ "tags": [],
349
+ "text": "GameID of the lottery game"
350
+ },
351
+ "attribute": "game-id",
352
+ "reflect": true
353
+ },
354
+ "playerId": {
355
+ "type": "number",
356
+ "mutable": false,
357
+ "complexType": {
358
+ "original": "number",
359
+ "resolved": "number",
360
+ "references": {}
361
+ },
362
+ "required": false,
363
+ "optional": false,
364
+ "docs": {
365
+ "tags": [],
366
+ "text": "Player ID"
367
+ },
368
+ "attribute": "player-id",
369
+ "reflect": true
370
+ },
371
+ "sessionId": {
372
+ "type": "string",
373
+ "mutable": false,
374
+ "complexType": {
375
+ "original": "string",
376
+ "resolved": "string",
377
+ "references": {}
378
+ },
379
+ "required": false,
380
+ "optional": false,
381
+ "docs": {
382
+ "tags": [],
383
+ "text": "GIC Session"
384
+ },
385
+ "attribute": "session-id",
386
+ "reflect": true
387
+ },
388
+ "language": {
389
+ "type": "string",
390
+ "mutable": false,
391
+ "complexType": {
392
+ "original": "string",
393
+ "resolved": "string",
394
+ "references": {}
395
+ },
396
+ "required": false,
397
+ "optional": false,
398
+ "docs": {
399
+ "tags": [],
400
+ "text": "Language of the widget"
401
+ },
402
+ "attribute": "language",
403
+ "reflect": true,
404
+ "defaultValue": "'en'"
405
+ },
406
+ "backgroundUrl": {
407
+ "type": "string",
408
+ "mutable": false,
409
+ "complexType": {
410
+ "original": "string",
411
+ "resolved": "string",
412
+ "references": {}
413
+ },
414
+ "required": false,
415
+ "optional": false,
416
+ "docs": {
417
+ "tags": [],
418
+ "text": "Url for banner's custom background image"
419
+ },
420
+ "attribute": "background-url",
421
+ "reflect": true
422
+ },
423
+ "autoPick": {
424
+ "type": "boolean",
425
+ "mutable": false,
426
+ "complexType": {
427
+ "original": "boolean",
428
+ "resolved": "boolean",
429
+ "references": {}
430
+ },
431
+ "required": false,
432
+ "optional": false,
433
+ "docs": {
434
+ "tags": [],
435
+ "text": "Shows the auto-pick button"
436
+ },
437
+ "attribute": "auto-pick",
438
+ "reflect": true,
439
+ "defaultValue": "false"
440
+ },
441
+ "resetButton": {
442
+ "type": "boolean",
443
+ "mutable": false,
444
+ "complexType": {
445
+ "original": "boolean",
446
+ "resolved": "boolean",
447
+ "references": {}
448
+ },
449
+ "required": false,
450
+ "optional": false,
451
+ "docs": {
452
+ "tags": [],
453
+ "text": "Shows the reset button"
454
+ },
455
+ "attribute": "reset-button",
456
+ "reflect": true,
457
+ "defaultValue": "false"
458
+ },
459
+ "clientStyling": {
460
+ "type": "string",
461
+ "mutable": false,
462
+ "complexType": {
463
+ "original": "string",
464
+ "resolved": "string",
465
+ "references": {}
466
+ },
467
+ "required": false,
468
+ "optional": false,
469
+ "docs": {
470
+ "tags": [],
471
+ "text": "Client custom styling via string"
472
+ },
473
+ "attribute": "client-styling",
474
+ "reflect": true,
475
+ "defaultValue": "''"
476
+ },
477
+ "clientStylingurl": {
478
+ "type": "string",
479
+ "mutable": false,
480
+ "complexType": {
481
+ "original": "string",
482
+ "resolved": "string",
483
+ "references": {}
484
+ },
485
+ "required": false,
486
+ "optional": false,
487
+ "docs": {
488
+ "tags": [],
489
+ "text": "Client custom styling via url"
490
+ },
491
+ "attribute": "client-stylingurl",
492
+ "reflect": true,
493
+ "defaultValue": "''"
494
+ }
166
495
  };
167
- }
168
- return item;
169
- });
170
- }
171
- // @TODO CustomEvent type
172
- deleteTicketHandler(event) {
173
- this.deleteVisible = true;
174
- this.deleteEventData = event;
175
- }
176
- modalCloseEvent() {
177
- this.deleteVisible = false;
178
- this.loginModalVisible = false;
179
- }
180
- stakeChangeHandler(event) {
181
- const { ticketId, stake } = event.detail;
182
- this.tickets[ticketId - 1].stake = stake;
183
- this.calculateTotalAmount();
184
- }
185
- multiplierChangeHandler(event) {
186
- this.multiplier = event.detail;
187
- }
188
- getDraws() {
189
- // append from query param with the current date value in order to get the next draw
190
- let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
191
- let drawOptions = {
192
- method: "GET",
193
- headers: {
194
- 'Content-Type': "application/json",
195
- 'Accept': 'application/json',
196
- },
197
- };
198
- fetch(url.href, drawOptions)
199
- .then((response) => {
200
- return response.json();
201
- })
202
- .then((data) => {
203
- var _a, _b;
204
- let upcoming = data.items.filter((item) => {
205
- if (Date.parse(item.date) > new Date().getTime()) {
206
- return !item.winningNumbers;
207
- }
208
- });
209
- let past = data.items.filter((item) => item.winningNumbers);
210
- this.latestDraw = upcoming[0] || {};
211
- this.nextDate = (_a = this.latestDraw) === null || _a === void 0 ? void 0 : _a.date;
212
- this.countdownLogic(this.nextDate || '');
213
- this.lastDrawId = past[past.length - 1].id;
214
- // calculate total winnings
215
- // @TODO fix any type
216
- (_b = this.latestDraw) === null || _b === void 0 ? void 0 : _b.prizes.forEach((element) => {
217
- this.totalWinningsAmount += JSON.parse(element.amount);
218
- });
219
- })
220
- .catch((err) => {
221
- console.log('error ', err);
222
- });
223
- }
224
- ;
225
- // @TODO fix any type
226
- confirmDeleteTicketHandler(event) {
227
- // @TODO fix any type
228
- this.tickets = this.tickets.filter((item) => {
229
- if (item.ticketId == event.detail.ticketId) {
230
- return false;
231
- }
232
- return true;
233
- });
234
- this.calculateTotalAmount();
235
- this.deleteVisible = false;
236
- }
237
- createNewTicket() {
238
- this.tickets = [
239
- ...this.tickets,
240
- { gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
241
- ];
242
- }
243
- showLoginModal() {
244
- this.loginModalVisible = true;
245
- }
246
- submitTickets() {
247
- let url = new URL(`${this.endpoint}/tickets`);
248
- // @TODO Body TS type
249
- let body = {
250
- gameId: this.gameId,
251
- tickets: []
252
- };
253
- this.tickets.forEach((item) => {
254
- body.tickets.push({
255
- startingDrawId: this.nextDraw,
256
- amount: item.stake,
257
- gameId: this.gameId,
258
- currency: this.currency,
259
- selection: item.selectedNumbers,
260
- multiplier: this.multiplier,
261
- drawCount: item.amount,
262
- quickPick: this.quickPick,
263
- });
264
- });
265
- // @TODO Options TS type
266
- let options = {
267
- method: 'POST',
268
- headers: {
269
- 'Content-Type': 'application/json',
270
- 'Accept': 'application/json',
271
- 'Authorization': `Bearer ${this.sessionId}`
272
- },
273
- body: JSON.stringify(body)
274
- };
275
- fetch(url.href, options)
276
- .then((res) => {
277
- if (res.status > 300) {
278
- throw new Error('err');
279
- }
280
- return res.json();
281
- })
282
- .then((data) => {
283
- console.log('data', data);
284
- })
285
- .catch((err) => {
286
- console.log('error ', err);
287
- });
288
- this.successVisible = true;
289
- }
290
- render() {
291
- const backgroundSrc = getAssetPath('./static/chrono_lottery_mobile.png');
292
- const backgroundDesktopSrc = getAssetPath('./static/chrono_desktop.png');
293
- if (this.hasErrors) {
294
- return (h("div", { class: "GamePage" },
295
- h("div", { class: "Title" }, translate('error', this.language))));
296
496
  }
297
- return (
298
- /* Game details */
299
- h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el },
300
- h("div", { class: "GridBanner", style: { backgroundImage: isMobile(this.userAgent) ? `url(${backgroundSrc})` : `url(${backgroundDesktopSrc})` } },
301
- h("div", { class: "BannerButtonsWrapper" },
302
- h("button", { class: "BannerBackButton" },
303
- h("span", { class: "BannerBackButtonArrow" }, "\u1438 "),
304
- translate('backButton', this.language)),
305
- h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))),
306
- h("div", { class: "Tabs" },
307
- h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)),
308
- h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))),
309
- h("div", { class: "NextDrawWrapper" },
310
- h("div", { class: "TotalWinnings" },
311
- translate('winUpTo', this.language),
312
- ": ",
313
- h("span", null,
314
- "$",
315
- this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))),
316
- h("div", { class: "NextDraw" },
317
- h("p", { class: "BannerText" }, translate('nextDraw', this.language)),
318
- h("div", { class: "BannerCountdown" },
319
- h("span", { class: "CountdownDays" },
320
- this.daysRemaining,
321
- "D"),
322
- h("span", { class: "CountdownHours" },
323
- this.hoursRemaining,
324
- "H"),
325
- h("span", { class: "CountdownMinutes" },
326
- this.minutesRemaining,
327
- "M"),
328
- h("span", { class: "CountdownSeconds" },
329
- this.secondsRemaining,
330
- "S")))),
331
- this.tabIndex == 0 &&
332
- h("div", { class: "GamePageContent" },
333
- h("div", { class: "GameDetails" },
334
- h("lottery-game-details", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })),
335
- h("div", { class: "TicketsWrapper" },
336
- 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, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })),
337
- h("div", { class: "CreateNewTicket" },
338
- h("button", { onClick: () => this.createNewTicket() }, "+"),
339
- h("span", null, translate('createTicket', this.language)))),
340
- h("div", { class: "OrderSummary" },
341
- h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)),
342
- h("div", { class: "Ticket" },
343
- translate('orderSummaryTickets', this.language),
344
- ": ",
345
- h("span", null, this.tickets.length)),
346
- h("div", { class: "Total" },
347
- translate('orderSummaryTotal', this.language),
348
- ": ",
349
- h("span", null,
350
- this.totalAmount,
351
- " ",
352
- this.currency)),
353
- h("div", { class: "ButtonWrapper" },
354
- this.isLoggedIn &&
355
- h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language)),
356
- !this.isLoggedIn &&
357
- h("div", null,
358
- h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)),
359
- h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent },
360
- h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))),
361
- this.tabIndex == 1 &&
362
- h("div", null,
363
- h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)),
364
- h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }),
365
- h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })),
366
- h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent },
367
- h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))),
368
- h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent },
369
- h("div", { class: "DeleteTicketModalWrapper" },
370
- h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)),
371
- h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)),
372
- h("div", { class: "DeleteTicketModalButtons" },
373
- h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)),
374
- h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
375
- }
376
- static get is() { return "lottery-game-page"; }
377
- static get encapsulation() { return "shadow"; }
378
- static get originalStyleUrls() { return {
379
- "$": ["lottery-game-page.scss"]
380
- }; }
381
- static get styleUrls() { return {
382
- "$": ["lottery-game-page.css"]
383
- }; }
384
- static get assetsDirs() { return ["static"]; }
385
- static get properties() { return {
386
- "endpoint": {
387
- "type": "string",
388
- "mutable": false,
389
- "complexType": {
390
- "original": "string",
391
- "resolved": "string",
392
- "references": {}
393
- },
394
- "required": true,
395
- "optional": false,
396
- "docs": {
397
- "tags": [],
398
- "text": "Endpoint URL for the source of data"
399
- },
400
- "attribute": "endpoint",
401
- "reflect": false
402
- },
403
- "gameId": {
404
- "type": "string",
405
- "mutable": false,
406
- "complexType": {
407
- "original": "string",
408
- "resolved": "string",
409
- "references": {}
410
- },
411
- "required": true,
412
- "optional": false,
413
- "docs": {
414
- "tags": [],
415
- "text": "GameID of the lottery game"
416
- },
417
- "attribute": "game-id",
418
- "reflect": false
419
- },
420
- "playerId": {
421
- "type": "number",
422
- "mutable": false,
423
- "complexType": {
424
- "original": "number",
425
- "resolved": "number",
426
- "references": {}
427
- },
428
- "required": false,
429
- "optional": false,
430
- "docs": {
431
- "tags": [],
432
- "text": "Player ID"
433
- },
434
- "attribute": "player-id",
435
- "reflect": false
436
- },
437
- "sessionId": {
438
- "type": "string",
439
- "mutable": false,
440
- "complexType": {
441
- "original": "string",
442
- "resolved": "string",
443
- "references": {}
444
- },
445
- "required": false,
446
- "optional": false,
447
- "docs": {
448
- "tags": [],
449
- "text": "GIC Session"
450
- },
451
- "attribute": "session-id",
452
- "reflect": false
453
- },
454
- "language": {
455
- "type": "string",
456
- "mutable": false,
457
- "complexType": {
458
- "original": "string",
459
- "resolved": "string",
460
- "references": {}
461
- },
462
- "required": false,
463
- "optional": false,
464
- "docs": {
465
- "tags": [],
466
- "text": "Language of the widget"
467
- },
468
- "attribute": "language",
469
- "reflect": false,
470
- "defaultValue": "'en'"
471
- },
472
- "autoPick": {
473
- "type": "boolean",
474
- "mutable": false,
475
- "complexType": {
476
- "original": "boolean",
477
- "resolved": "boolean",
478
- "references": {}
479
- },
480
- "required": false,
481
- "optional": false,
482
- "docs": {
483
- "tags": [],
484
- "text": "Shows the auto-pick button"
485
- },
486
- "attribute": "auto-pick",
487
- "reflect": false,
488
- "defaultValue": "false"
489
- },
490
- "resetButton": {
491
- "type": "boolean",
492
- "mutable": false,
493
- "complexType": {
494
- "original": "boolean",
495
- "resolved": "boolean",
496
- "references": {}
497
- },
498
- "required": false,
499
- "optional": false,
500
- "docs": {
501
- "tags": [],
502
- "text": "Shows the reset button"
503
- },
504
- "attribute": "reset-button",
505
- "reflect": false,
506
- "defaultValue": "false"
507
- },
508
- "clientStyling": {
509
- "type": "string",
510
- "mutable": false,
511
- "complexType": {
512
- "original": "string",
513
- "resolved": "string",
514
- "references": {}
515
- },
516
- "required": false,
517
- "optional": false,
518
- "docs": {
519
- "tags": [],
520
- "text": "Client custom styling via string"
521
- },
522
- "attribute": "client-styling",
523
- "reflect": false,
524
- "defaultValue": "''"
525
- },
526
- "clientStylingurl": {
527
- "type": "string",
528
- "mutable": false,
529
- "complexType": {
530
- "original": "string",
531
- "resolved": "string",
532
- "references": {}
533
- },
534
- "required": false,
535
- "optional": false,
536
- "docs": {
537
- "tags": [],
538
- "text": "Client custom styling via url"
539
- },
540
- "attribute": "client-stylingurl",
541
- "reflect": false,
542
- "defaultValue": "''"
497
+ static get states() {
498
+ return {
499
+ "clientStylingUrlContent": {},
500
+ "tickets": {},
501
+ "tabIndex": {},
502
+ "hasErrors": {},
503
+ "totalAmount": {},
504
+ "successVisible": {},
505
+ "deleteVisible": {},
506
+ "deleteEventData": {},
507
+ "daysRemaining": {},
508
+ "hoursRemaining": {},
509
+ "minutesRemaining": {},
510
+ "secondsRemaining": {},
511
+ "latestDraw": {},
512
+ "totalWinningsAmount": {},
513
+ "nextDate": {},
514
+ "isLoggedIn": {},
515
+ "loginModalVisible": {},
516
+ "limitStylingAppends": {}
517
+ };
518
+ }
519
+ static get events() {
520
+ return [{
521
+ "method": "goBackEvent",
522
+ "name": "goBackEvent",
523
+ "bubbles": true,
524
+ "cancelable": true,
525
+ "composed": true,
526
+ "docs": {
527
+ "tags": [],
528
+ "text": ""
529
+ },
530
+ "complexType": {
531
+ "original": "string",
532
+ "resolved": "string",
533
+ "references": {}
534
+ }
535
+ }, {
536
+ "method": "goToLobbyEvent",
537
+ "name": "goToLobbyEvent",
538
+ "bubbles": true,
539
+ "cancelable": true,
540
+ "composed": true,
541
+ "docs": {
542
+ "tags": [],
543
+ "text": ""
544
+ },
545
+ "complexType": {
546
+ "original": "string",
547
+ "resolved": "string",
548
+ "references": {}
549
+ }
550
+ }];
551
+ }
552
+ static get elementRef() { return "element"; }
553
+ static get listeners() {
554
+ return [{
555
+ "name": "ticketCompleted",
556
+ "method": "gridFilledHandler",
557
+ "target": undefined,
558
+ "capture": false,
559
+ "passive": false
560
+ }, {
561
+ "name": "gridDirty",
562
+ "method": "gridDirtyHandler",
563
+ "target": undefined,
564
+ "capture": false,
565
+ "passive": false
566
+ }, {
567
+ "name": "deleteTicket",
568
+ "method": "deleteTicketHandler",
569
+ "target": undefined,
570
+ "capture": false,
571
+ "passive": false
572
+ }, {
573
+ "name": "modalCloseEvent",
574
+ "method": "modalCloseEvent",
575
+ "target": undefined,
576
+ "capture": false,
577
+ "passive": false
578
+ }, {
579
+ "name": "stakeChange",
580
+ "method": "stakeChangeHandler",
581
+ "target": undefined,
582
+ "capture": false,
583
+ "passive": false
584
+ }, {
585
+ "name": "multiplierChange",
586
+ "method": "multiplierChangeHandler",
587
+ "target": undefined,
588
+ "capture": false,
589
+ "passive": false
590
+ }];
543
591
  }
544
- }; }
545
- static get states() { return {
546
- "clientStylingUrlContent": {},
547
- "tickets": {},
548
- "tabIndex": {},
549
- "hasErrors": {},
550
- "totalAmount": {},
551
- "successVisible": {},
552
- "deleteVisible": {},
553
- "deleteEventData": {},
554
- "daysRemaining": {},
555
- "hoursRemaining": {},
556
- "minutesRemaining": {},
557
- "secondsRemaining": {},
558
- "latestDraw": {},
559
- "totalWinningsAmount": {},
560
- "nextDate": {},
561
- "isLoggedIn": {},
562
- "loginModalVisible": {},
563
- "limitStylingAppends": {}
564
- }; }
565
- static get elementRef() { return "element"; }
566
- static get watchers() { return [{
567
- "propName": "sessionId",
568
- "methodName": "handleSessionIdValue"
569
- }]; }
570
- static get listeners() { return [{
571
- "name": "ticketCompleted",
572
- "method": "gridFilledHandler",
573
- "target": undefined,
574
- "capture": false,
575
- "passive": false
576
- }, {
577
- "name": "gridDirty",
578
- "method": "gridDirtyHandler",
579
- "target": undefined,
580
- "capture": false,
581
- "passive": false
582
- }, {
583
- "name": "deleteTicket",
584
- "method": "deleteTicketHandler",
585
- "target": undefined,
586
- "capture": false,
587
- "passive": false
588
- }, {
589
- "name": "modalCloseEvent",
590
- "method": "modalCloseEvent",
591
- "target": undefined,
592
- "capture": false,
593
- "passive": false
594
- }, {
595
- "name": "stakeChange",
596
- "method": "stakeChangeHandler",
597
- "target": undefined,
598
- "capture": false,
599
- "passive": false
600
- }, {
601
- "name": "multiplierChange",
602
- "method": "multiplierChangeHandler",
603
- "target": undefined,
604
- "capture": false,
605
- "passive": false
606
- }]; }
607
592
  }