@everymatrix/lottery-game-page 1.44.0 → 1.45.2

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