@everymatrix/lottery-tipping-ticket-history 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/general-multi-select_10.cjs.entry.js +9635 -0
- package/dist/cjs/index-4ef2d32a.js +1380 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/lottery-tipping-ticket-history-e9d19600.js +2915 -0
- package/dist/cjs/lottery-tipping-ticket-history.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +42 -0
- package/dist/collection/components/lottery-tipping-filter/index.js +1 -0
- package/dist/collection/components/lottery-tipping-filter/lottery-tipping-filter.css +42 -0
- package/dist/collection/components/lottery-tipping-filter/lottery-tipping-filter.js +333 -0
- package/dist/collection/components/lottery-tipping-pagination/index.js +1 -0
- package/dist/collection/components/lottery-tipping-pagination/lottery-tipping-pagination.css +70 -0
- package/dist/collection/components/lottery-tipping-pagination/lottery-tipping-pagination.js +336 -0
- package/dist/collection/components/lottery-tipping-panel/index.js +1 -0
- package/dist/collection/components/lottery-tipping-panel/lottery-tipping-panel.css +58 -0
- package/dist/collection/components/lottery-tipping-panel/lottery-tipping-panel.js +152 -0
- package/dist/collection/components/lottery-tipping-ticket-history/index.js +1 -0
- package/dist/collection/components/lottery-tipping-ticket-history/lottery-tipping-ticket-history.css +232 -0
- package/dist/collection/components/lottery-tipping-ticket-history/lottery-tipping-ticket-history.js +625 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/index.js +5 -0
- package/dist/collection/utils/locale.utils.js +127 -0
- package/dist/collection/utils/utils.js +177 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/general-multi-select_10.entry.js +9623 -0
- package/dist/esm/index-e620a22a.js +1351 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/lottery-tipping-ticket-history-0d11da88.js +2904 -0
- package/dist/esm/lottery-tipping-ticket-history.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-tipping-ticket-history/app-globals-0f993ce5.js +1 -0
- package/dist/lottery-tipping-ticket-history/general-multi-select_10.entry.js +7975 -0
- package/dist/lottery-tipping-ticket-history/index-e620a22a.js +2 -0
- package/dist/lottery-tipping-ticket-history/index.esm.js +1 -0
- package/dist/lottery-tipping-ticket-history/lottery-tipping-ticket-history-0d11da88.js +1 -0
- package/dist/lottery-tipping-ticket-history/lottery-tipping-ticket-history.esm.js +1 -0
- package/dist/static/add.svg +8 -0
- package/dist/static/delete.svg +37 -0
- package/dist/static/dropdown.svg +2 -0
- package/dist/static/dropup.svg +1 -0
- package/dist/static/info.svg +6 -0
- package/dist/static/left-arrow.svg +15 -0
- package/dist/static/loading.svg +10 -0
- package/dist/static/right-arrow.svg +15 -0
- package/dist/stencil.config.dev.js +19 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/packages/stencil/lottery-tipping-ticket-history/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/packages/stencil/lottery-tipping-ticket-history/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/packages/stencil/lottery-tipping-ticket-history/storybook/main.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/packages/stencil/lottery-tipping-ticket-history/storybook/preview.d.ts +70 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/tools/plugins/index.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-tipping-ticket-history/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/lottery-tipping-filter/index.d.ts +1 -0
- package/dist/types/components/lottery-tipping-filter/lottery-tipping-filter.d.ts +43 -0
- package/dist/types/components/lottery-tipping-pagination/index.d.ts +1 -0
- package/dist/types/components/lottery-tipping-pagination/lottery-tipping-pagination.d.ts +29 -0
- package/dist/types/components/lottery-tipping-panel/index.d.ts +1 -0
- package/dist/types/components/lottery-tipping-panel/lottery-tipping-panel.d.ts +17 -0
- package/dist/types/components/lottery-tipping-ticket-history/index.d.ts +1 -0
- package/dist/types/components/lottery-tipping-ticket-history/lottery-tipping-ticket-history.d.ts +95 -0
- package/dist/types/components.d.ts +224 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/index.d.ts +137 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +10 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +27 -0
package/dist/collection/components/lottery-tipping-ticket-history/lottery-tipping-ticket-history.js
ADDED
|
@@ -0,0 +1,625 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
3
|
+
import { fetchRequest, toQueryParams, parseEachLineNumber, thousandSeperator, isMobile, fetcher } from "../../utils/utils";
|
|
4
|
+
import { DrawResult } from "../../models";
|
|
5
|
+
import { format } from "date-fns";
|
|
6
|
+
import "../../../../../lottery-tipping-dialog/dist/types/index";
|
|
7
|
+
import "../../../../../lottery-tipping-ticket-bet/dist/types/index";
|
|
8
|
+
import { getTranslations, translate } from "../../utils/locale.utils";
|
|
9
|
+
export class LotteryTippingTicketHistory {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.ticketTypeMap = {
|
|
12
|
+
NORMAL: 'Normal',
|
|
13
|
+
SYNDICATE: 'Syndicate',
|
|
14
|
+
SUBSCRIPTION: 'Subscription'
|
|
15
|
+
};
|
|
16
|
+
this.resultMap = { [DrawResult.WON]: 'Win', [DrawResult.LOST]: 'Lose' };
|
|
17
|
+
this.displayPrizeCategory = (details) => {
|
|
18
|
+
const prizeMap = new Map();
|
|
19
|
+
details.forEach((detail) => {
|
|
20
|
+
let prizeName = detail.divisionDisplayName;
|
|
21
|
+
let amount = detail.amount;
|
|
22
|
+
let currency = detail.currency;
|
|
23
|
+
if (prizeName && prizeName != 'None') {
|
|
24
|
+
if (prizeMap.has(prizeName)) {
|
|
25
|
+
prizeMap.set(prizeName, {
|
|
26
|
+
amount: prizeMap.get(prizeName)['amount'] + amount,
|
|
27
|
+
currency,
|
|
28
|
+
times: prizeMap.get(prizeName)['times'] + 1
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
prizeMap.set(prizeName, { amount, currency, times: 1 });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const resultArr = [];
|
|
37
|
+
for (let [key, val] of prizeMap.entries()) {
|
|
38
|
+
resultArr.push({ prizeName: key, amount: val['amount'], currency: val['currency'], times: val['times'] });
|
|
39
|
+
}
|
|
40
|
+
resultArr.sort((p1, p2) => p2.prizeName.localeCompare(p1.prizeName));
|
|
41
|
+
return resultArr;
|
|
42
|
+
};
|
|
43
|
+
this.endpoint = undefined;
|
|
44
|
+
this.endpointTicket = undefined;
|
|
45
|
+
this.gameId = undefined;
|
|
46
|
+
this.playerId = undefined;
|
|
47
|
+
this.sessionId = '';
|
|
48
|
+
this.drawId = undefined;
|
|
49
|
+
this.mbSource = undefined;
|
|
50
|
+
this.clientStyling = undefined;
|
|
51
|
+
this.clientStylingUrl = undefined;
|
|
52
|
+
this.language = 'en';
|
|
53
|
+
this.translationUrl = '';
|
|
54
|
+
this.ticketHistory = [];
|
|
55
|
+
this.activeStatus = '';
|
|
56
|
+
this.statusOptions = undefined;
|
|
57
|
+
this.isLoading = false;
|
|
58
|
+
this.rawData = {};
|
|
59
|
+
this.filterData = {
|
|
60
|
+
offset: 0,
|
|
61
|
+
limit: 10,
|
|
62
|
+
state: '',
|
|
63
|
+
from: '',
|
|
64
|
+
to: '',
|
|
65
|
+
wagerType: '',
|
|
66
|
+
vendorGameType: 'PoolGame',
|
|
67
|
+
id: ''
|
|
68
|
+
};
|
|
69
|
+
this.paginationInfo = {
|
|
70
|
+
current: 1,
|
|
71
|
+
total: 0,
|
|
72
|
+
pageSize: 10
|
|
73
|
+
};
|
|
74
|
+
this.quickFiltersActive = false;
|
|
75
|
+
this.showCurrentTicketLine = false;
|
|
76
|
+
this.curTicketItem = undefined;
|
|
77
|
+
this.curSelection = [];
|
|
78
|
+
this.curSelectionIdx = 0;
|
|
79
|
+
this.showCurrentDrawResult = false;
|
|
80
|
+
this.curDrawItem = undefined;
|
|
81
|
+
this.curDrawSelection = [];
|
|
82
|
+
this.curDrawSelectionBettingType = undefined;
|
|
83
|
+
this.curDrawSelectionMap = {};
|
|
84
|
+
}
|
|
85
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
86
|
+
if (newValue != oldValue) {
|
|
87
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
91
|
+
if (newValue != oldValue) {
|
|
92
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
96
|
+
if (newValue != oldValue) {
|
|
97
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
componentDidLoad() {
|
|
101
|
+
if (this.stylingContainer) {
|
|
102
|
+
if (this.mbSource)
|
|
103
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
104
|
+
if (this.clientStyling)
|
|
105
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
106
|
+
if (this.clientStylingUrl)
|
|
107
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
connectedCallback() {
|
|
111
|
+
const fetchData = () => {
|
|
112
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
113
|
+
this.isLoading = true;
|
|
114
|
+
fetcher(url.href)
|
|
115
|
+
.then((res) => {
|
|
116
|
+
this.rawData = res;
|
|
117
|
+
})
|
|
118
|
+
.finally(() => {
|
|
119
|
+
this.isLoading = false;
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
fetchData();
|
|
123
|
+
}
|
|
124
|
+
disconnectedCallback() {
|
|
125
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
126
|
+
}
|
|
127
|
+
async fetchTicketList() {
|
|
128
|
+
this.isLoading = true;
|
|
129
|
+
try {
|
|
130
|
+
const { items, total } = await fetchRequest(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
|
|
131
|
+
Authorization: `Bearer ${this.sessionId}`
|
|
132
|
+
});
|
|
133
|
+
this.ticketHistory = items;
|
|
134
|
+
this.paginationInfo.total = total;
|
|
135
|
+
this.isLoading = false;
|
|
136
|
+
if (items.length > 0) {
|
|
137
|
+
this.getDrawResult();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
console.log('in fetchTicketList error is: ', e);
|
|
142
|
+
if (e.status === 401) {
|
|
143
|
+
this.showNotification(e.message, 'error');
|
|
144
|
+
this.logout.emit();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
finally {
|
|
148
|
+
this.isLoading = false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async fetchDrwaResult(gameId, drawId) {
|
|
152
|
+
try {
|
|
153
|
+
const res = await fetchRequest(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
|
|
154
|
+
return res;
|
|
155
|
+
}
|
|
156
|
+
catch (e) {
|
|
157
|
+
console.log(e);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
showNotification(message, theme = '', position = 'top-end') {
|
|
161
|
+
const notification = document.createElement('vaadin-notification');
|
|
162
|
+
notification.renderer = (root) => {
|
|
163
|
+
root.textContent = message;
|
|
164
|
+
};
|
|
165
|
+
notification.duration = 5000;
|
|
166
|
+
if (theme) {
|
|
167
|
+
notification.setAttribute('theme', theme);
|
|
168
|
+
}
|
|
169
|
+
notification.setAttribute('position', position);
|
|
170
|
+
document.body.appendChild(notification);
|
|
171
|
+
notification.opened = true;
|
|
172
|
+
}
|
|
173
|
+
getDivision(detail, drawData) {
|
|
174
|
+
var _a;
|
|
175
|
+
let division = detail.division;
|
|
176
|
+
let prize = (_a = drawData.prizes) === null || _a === void 0 ? void 0 : _a.filter((prize) => prize.order === division);
|
|
177
|
+
if (prize && prize.length) {
|
|
178
|
+
return prize[0].division;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
async getDrawResult() {
|
|
185
|
+
const idMapper = new Map();
|
|
186
|
+
this.ticketHistory.forEach((item, ticketIndex) => {
|
|
187
|
+
item.drawResults.forEach((drawResult, drawIndex) => {
|
|
188
|
+
const id = `${drawResult.drawId}-${item.gameId}`;
|
|
189
|
+
if (!idMapper.has(id)) {
|
|
190
|
+
idMapper.set(id, {
|
|
191
|
+
drawId: drawResult.drawId,
|
|
192
|
+
gameId: item.gameId,
|
|
193
|
+
indices: [{ ticketIndex, drawIndex }]
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
idMapper.get(id).indices.push({ ticketIndex, drawIndex });
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
let updatedTicketHistory = [...this.ticketHistory];
|
|
202
|
+
await Promise.all(Array.from(idMapper.values()).map(async ({ gameId, drawId, indices }) => {
|
|
203
|
+
try {
|
|
204
|
+
const drawData = await this.fetchDrwaResult(gameId, drawId);
|
|
205
|
+
if (drawData) {
|
|
206
|
+
indices.forEach(({ ticketIndex, drawIndex }) => {
|
|
207
|
+
const updatedDrawResult = Object.assign(Object.assign({}, updatedTicketHistory[ticketIndex].drawResults[drawIndex]), { tempDrawData: Object.assign(Object.assign({}, drawData), { vendorGameId: updatedTicketHistory[ticketIndex].vendorGameId }), prizeDetails: this.displayPrizeCategory(updatedTicketHistory[ticketIndex].drawResults[drawIndex].details) });
|
|
208
|
+
const updatedDrawResults = [...updatedTicketHistory[ticketIndex].drawResults];
|
|
209
|
+
updatedDrawResults[drawIndex] = updatedDrawResult;
|
|
210
|
+
updatedTicketHistory[ticketIndex] = Object.assign(Object.assign({}, updatedTicketHistory[ticketIndex]), { drawResults: updatedDrawResults });
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
console.error(`failed to fetch draw result (gameId: ${gameId}, drawId: ${drawId}):`, error);
|
|
216
|
+
}
|
|
217
|
+
}));
|
|
218
|
+
this.ticketHistory = updatedTicketHistory;
|
|
219
|
+
}
|
|
220
|
+
componentWillLoad() {
|
|
221
|
+
if (this.translationUrl) {
|
|
222
|
+
getTranslations(JSON.parse(this.translationUrl));
|
|
223
|
+
}
|
|
224
|
+
this.statusOptions = [
|
|
225
|
+
{
|
|
226
|
+
label: translate('settled', this.language),
|
|
227
|
+
value: 'Settled'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
label: translate('purchased', this.language),
|
|
231
|
+
value: 'Purchased'
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
label: translate('canceled', this.language),
|
|
235
|
+
value: 'Canceled'
|
|
236
|
+
}
|
|
237
|
+
];
|
|
238
|
+
this.fetchTicketList();
|
|
239
|
+
}
|
|
240
|
+
changeStatus(status) {
|
|
241
|
+
this.activeStatus = status;
|
|
242
|
+
this.filterData.state = status;
|
|
243
|
+
this.quickFiltersActive = true;
|
|
244
|
+
this.fetchTicketList();
|
|
245
|
+
}
|
|
246
|
+
handlePageSizeChange(event) {
|
|
247
|
+
this.filterData.limit = event.detail;
|
|
248
|
+
this.fetchTicketList();
|
|
249
|
+
}
|
|
250
|
+
handlePageChange(event) {
|
|
251
|
+
this.filterData.offset = (event.detail - 1) * this.filterData.limit;
|
|
252
|
+
this.fetchTicketList();
|
|
253
|
+
}
|
|
254
|
+
handleShowTicketLineDetial(item) {
|
|
255
|
+
this.curSelectionIdx = 0;
|
|
256
|
+
this.showCurrentTicketLine = true;
|
|
257
|
+
this.curTicketItem = item;
|
|
258
|
+
this.curSelection = this.parseSelection();
|
|
259
|
+
}
|
|
260
|
+
handleShowCurrentDraw(item) {
|
|
261
|
+
this.showCurrentDrawResult = true;
|
|
262
|
+
this.curDrawItem = item;
|
|
263
|
+
this.curDrawSelectionBettingType = item.winningNumbers[0].winning_type;
|
|
264
|
+
this.curDrawItem.winningNumbers.forEach((item) => {
|
|
265
|
+
this.curDrawSelectionMap[item.winning_type] = [parseEachLineNumber(item.numbers)];
|
|
266
|
+
});
|
|
267
|
+
this.curDrawSelection = this.curDrawSelectionMap[this.curDrawSelectionBettingType];
|
|
268
|
+
}
|
|
269
|
+
parseSelection() {
|
|
270
|
+
const result = [];
|
|
271
|
+
this.curTicketItem.selection.forEach((selection, index) => {
|
|
272
|
+
result[index] = parseEachLineNumber(selection.selections);
|
|
273
|
+
});
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
handleFilterChange(e) {
|
|
277
|
+
const filterData = e.detail;
|
|
278
|
+
this.filterData.from = filterData.filterFromCalendar;
|
|
279
|
+
this.filterData.to = filterData.filterToCalendar;
|
|
280
|
+
this.filterData.id = filterData.ticketId;
|
|
281
|
+
this.filterData.wagerType = filterData.ticketType;
|
|
282
|
+
this.fetchTicketList();
|
|
283
|
+
}
|
|
284
|
+
handleFilterClear() {
|
|
285
|
+
this.activeStatus = '';
|
|
286
|
+
this.quickFiltersActive = false;
|
|
287
|
+
this.filterData = {
|
|
288
|
+
offset: 0,
|
|
289
|
+
limit: 10,
|
|
290
|
+
state: '',
|
|
291
|
+
from: '',
|
|
292
|
+
to: '',
|
|
293
|
+
wagerType: '',
|
|
294
|
+
vendorGameType: 'PoolGame',
|
|
295
|
+
id: ''
|
|
296
|
+
};
|
|
297
|
+
this.fetchTicketList();
|
|
298
|
+
}
|
|
299
|
+
get playTypeConfig() {
|
|
300
|
+
var _a, _b, _c;
|
|
301
|
+
return (_c = (_b = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.rules) === null || _b === void 0 ? void 0 : _b.poolGame) === null || _c === void 0 ? void 0 : _c.playTypes;
|
|
302
|
+
}
|
|
303
|
+
get bettingTypeConfig() {
|
|
304
|
+
var _a, _b, _c;
|
|
305
|
+
return (_c = (_b = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.rules) === null || _b === void 0 ? void 0 : _b.poolGame) === null || _c === void 0 ? void 0 : _c.bettingTypes;
|
|
306
|
+
}
|
|
307
|
+
getBettingType(betTypeId) {
|
|
308
|
+
var _a;
|
|
309
|
+
return (_a = this.playTypeConfig.find((item) => item.betTypeId === betTypeId)['bettingType']) !== null && _a !== void 0 ? _a : '';
|
|
310
|
+
}
|
|
311
|
+
handlePoolGameCurrentPageChange(e) {
|
|
312
|
+
const { currentPage } = e.detail;
|
|
313
|
+
this.curSelectionIdx = currentPage - 1;
|
|
314
|
+
}
|
|
315
|
+
handleDrawBettingTypeChange(bettingType) {
|
|
316
|
+
this.curDrawSelectionBettingType = bettingType;
|
|
317
|
+
this.curDrawSelection = this.curDrawSelectionMap[this.curDrawSelectionBettingType];
|
|
318
|
+
}
|
|
319
|
+
getBettingTypeName(bettingType) {
|
|
320
|
+
var _a, _b;
|
|
321
|
+
const name = (_b = (_a = this.bettingTypeConfig) === null || _a === void 0 ? void 0 : _a.find((item) => item.code === bettingType)) === null || _b === void 0 ? void 0 : _b.name;
|
|
322
|
+
return name !== null && name !== void 0 ? name : bettingType;
|
|
323
|
+
}
|
|
324
|
+
render() {
|
|
325
|
+
return (h("div", { key: '27d7945395c1bd5cf8c50fabcf9358dd10a2f379', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, h("div", { key: '29bf61bc1b7a2f34bf24814c5d256bc84b703fa9', class: "ticket-history-title" }, translate('ticketsHistory', this.language)), h("div", { key: 'aabcc336535e36248c07afac1b3777c8e00e6d36', class: "filter-wrap" }, h("div", { key: '6a2ce1224363104c27d63026e3d246f70db12516', class: "filter-status" }, this.statusOptions.map((status) => (h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), h("div", { key: '740826baea69e1adf534bcf9a2bb4d5083fa9d90', class: "filter-operation" }, h("lottery-tipping-filter", { key: '395ebb8b2c040804adb4e0a87daff0d01a0598cf', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (h("div", { key: 'c27852dcd7902ac43a1ff7408476e5f8667c1010', class: "loading-wrap" }, h("section", { key: '9ab2fea4cafdefe3accbc0e49be19ec16158cd14', class: "dots-container" }, h("div", { key: 'c5d6c3227c51c462eb4bcca926b7ab70e3676dfd', class: "dot" }), h("div", { key: '9ac68a72b257614a1c048a870f18753fe85967db', class: "dot" }), h("div", { key: '6c5d426f926a5726a3d88ad509fc6e38f715c10d', class: "dot" }), h("div", { key: '90959f4befb4d2308a1cf1651dd76f7be71b3e34', class: "dot" }), h("div", { key: '1e8dda2f5e4e460cb0f4aa7897b19fad23d98834', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (h("div", { key: '452303d3d8221e2c3905b1d0d2e81651f1e62038', class: "empty-wrap" }, translate('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (h("div", { key: 'e7c5d75d70077d6b65a006fa6169ff9d2edca2ea', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (h("lottery-tipping-panel", { "header-title": format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, h("div", { class: "panel-content", slot: "content" }, h("div", { class: "ticket-info" }, h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate('ticketId', this.language)), h("div", { class: "ticket-info-val" }, item.id, " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate('ticketType', this.language)), h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate('ticketAmount', this.language)), h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate('lineDetail', this.language)), h("div", { class: "ticket-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate('seeDetails', this.language)))), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate('numberOfDraw', this.language)), h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
|
|
326
|
+
item.drawResults.map((drawResultItem) => (h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (h("div", { class: "draw-info" }, h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate('ticketResult', this.language)), h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate('drawId', this.language)), h("div", { class: "draw-info-val" }, drawResultItem.drawId)), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate('drawDate', this.language)), h("div", { class: "draw-info-val" }, format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate('result', this.language)), h("div", { class: "draw-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate('prize', this.language)), h("div", { class: "draw-info-val1" }, h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (h("span", null, h("div", null, h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (h("div", { class: "skeleton-line" })))))))))))))), h("lottery-tipping-dialog", { key: '913a521d05ae95b088fba515d951bc79b1433938', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
|
|
327
|
+
this.showCurrentTicketLine = false;
|
|
328
|
+
}, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (h("div", { key: '6608c983a4bc781f4beac6488b0857abfb59ca48' }, h("div", { key: '77690236f6e654e8f178bdb6fb76f49826b02a60', class: "betting-type" }, h("div", { key: '30d239aa23d01edb20049b5fbbbbc094c6742f75', class: "betting-type-title" }, translate('bettingType', this.language)), h("div", { key: '93770717ac08bbacc84d9de8b16133073e36d4c9', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), h("lottery-tipping-ticket-bet", { key: '11641a37abe2ca65ecb706f94ce8a911f9e849d9', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("lottery-tipping-dialog", { key: 'fdac976410e6b1b1e1ea20072d5c4caa474f4130', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
|
|
329
|
+
this.showCurrentDrawResult = false;
|
|
330
|
+
}, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (h("div", { key: 'b495d8bb01c4bb18edf951889850d56700564d8b' }, h("div", { key: '77443b43ee363dd2051da4a8c6cb004f2acab410', class: "betting-type" }, h("div", { key: 'ada4a3803b9073e78c248790f24de86900e5776f', class: "betting-type-title" }, translate('bettingType', this.language)), h("div", { key: '20826ed1192db8acfb25310c31252cb7f5a75f2a', class: "betting-type-text" }, h("div", { key: '7721c04879283138870833b3ce0b881cd84aec6c', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (h("button", { class: {
|
|
331
|
+
LotteryTippingTicketController__segment: true,
|
|
332
|
+
'LotteryTippingTicketController__segment--active': this.curDrawSelectionBettingType === bettingType
|
|
333
|
+
}, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), h("lottery-tipping-ticket-bet", { key: 'b8b29a1a6e6bda2ce5004765e219e58d8e12bb2f', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("div", { key: 'a84c658d87e936cbf20731a64bc753f13c099024', class: "pagination-wrap" }, h("lottery-tipping-pagination", { key: 'fdf7443bd153e90c131e4ba937f08d611706a56d', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
|
|
334
|
+
}
|
|
335
|
+
static get is() { return "lottery-tipping-ticket-history"; }
|
|
336
|
+
static get encapsulation() { return "shadow"; }
|
|
337
|
+
static get originalStyleUrls() {
|
|
338
|
+
return {
|
|
339
|
+
"$": ["lottery-tipping-ticket-history.scss"]
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
static get styleUrls() {
|
|
343
|
+
return {
|
|
344
|
+
"$": ["lottery-tipping-ticket-history.css"]
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
static get properties() {
|
|
348
|
+
return {
|
|
349
|
+
"endpoint": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"mutable": false,
|
|
352
|
+
"complexType": {
|
|
353
|
+
"original": "string",
|
|
354
|
+
"resolved": "string",
|
|
355
|
+
"references": {}
|
|
356
|
+
},
|
|
357
|
+
"required": false,
|
|
358
|
+
"optional": false,
|
|
359
|
+
"docs": {
|
|
360
|
+
"tags": [],
|
|
361
|
+
"text": ""
|
|
362
|
+
},
|
|
363
|
+
"attribute": "endpoint",
|
|
364
|
+
"reflect": true
|
|
365
|
+
},
|
|
366
|
+
"endpointTicket": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"mutable": false,
|
|
369
|
+
"complexType": {
|
|
370
|
+
"original": "string",
|
|
371
|
+
"resolved": "string",
|
|
372
|
+
"references": {}
|
|
373
|
+
},
|
|
374
|
+
"required": false,
|
|
375
|
+
"optional": false,
|
|
376
|
+
"docs": {
|
|
377
|
+
"tags": [],
|
|
378
|
+
"text": "EndpointTicket URL for the source of ticket data"
|
|
379
|
+
},
|
|
380
|
+
"attribute": "endpoint-ticket",
|
|
381
|
+
"reflect": true
|
|
382
|
+
},
|
|
383
|
+
"gameId": {
|
|
384
|
+
"type": "string",
|
|
385
|
+
"mutable": true,
|
|
386
|
+
"complexType": {
|
|
387
|
+
"original": "string",
|
|
388
|
+
"resolved": "string",
|
|
389
|
+
"references": {}
|
|
390
|
+
},
|
|
391
|
+
"required": false,
|
|
392
|
+
"optional": false,
|
|
393
|
+
"docs": {
|
|
394
|
+
"tags": [],
|
|
395
|
+
"text": "GameID of the lottery game"
|
|
396
|
+
},
|
|
397
|
+
"attribute": "game-id",
|
|
398
|
+
"reflect": true
|
|
399
|
+
},
|
|
400
|
+
"playerId": {
|
|
401
|
+
"type": "number",
|
|
402
|
+
"mutable": true,
|
|
403
|
+
"complexType": {
|
|
404
|
+
"original": "number",
|
|
405
|
+
"resolved": "number",
|
|
406
|
+
"references": {}
|
|
407
|
+
},
|
|
408
|
+
"required": false,
|
|
409
|
+
"optional": false,
|
|
410
|
+
"docs": {
|
|
411
|
+
"tags": [],
|
|
412
|
+
"text": "Player ID"
|
|
413
|
+
},
|
|
414
|
+
"attribute": "player-id",
|
|
415
|
+
"reflect": true
|
|
416
|
+
},
|
|
417
|
+
"sessionId": {
|
|
418
|
+
"type": "string",
|
|
419
|
+
"mutable": true,
|
|
420
|
+
"complexType": {
|
|
421
|
+
"original": "string",
|
|
422
|
+
"resolved": "string",
|
|
423
|
+
"references": {}
|
|
424
|
+
},
|
|
425
|
+
"required": false,
|
|
426
|
+
"optional": false,
|
|
427
|
+
"docs": {
|
|
428
|
+
"tags": [],
|
|
429
|
+
"text": "GIC Session"
|
|
430
|
+
},
|
|
431
|
+
"attribute": "session-id",
|
|
432
|
+
"reflect": true,
|
|
433
|
+
"defaultValue": "''"
|
|
434
|
+
},
|
|
435
|
+
"drawId": {
|
|
436
|
+
"type": "string",
|
|
437
|
+
"mutable": false,
|
|
438
|
+
"complexType": {
|
|
439
|
+
"original": "string",
|
|
440
|
+
"resolved": "string",
|
|
441
|
+
"references": {}
|
|
442
|
+
},
|
|
443
|
+
"required": false,
|
|
444
|
+
"optional": false,
|
|
445
|
+
"docs": {
|
|
446
|
+
"tags": [],
|
|
447
|
+
"text": "Draw ID"
|
|
448
|
+
},
|
|
449
|
+
"attribute": "draw-id",
|
|
450
|
+
"reflect": true
|
|
451
|
+
},
|
|
452
|
+
"mbSource": {
|
|
453
|
+
"type": "string",
|
|
454
|
+
"mutable": false,
|
|
455
|
+
"complexType": {
|
|
456
|
+
"original": "string",
|
|
457
|
+
"resolved": "string",
|
|
458
|
+
"references": {}
|
|
459
|
+
},
|
|
460
|
+
"required": false,
|
|
461
|
+
"optional": false,
|
|
462
|
+
"docs": {
|
|
463
|
+
"tags": [],
|
|
464
|
+
"text": ""
|
|
465
|
+
},
|
|
466
|
+
"attribute": "mb-source",
|
|
467
|
+
"reflect": true
|
|
468
|
+
},
|
|
469
|
+
"clientStyling": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"mutable": false,
|
|
472
|
+
"complexType": {
|
|
473
|
+
"original": "string",
|
|
474
|
+
"resolved": "string",
|
|
475
|
+
"references": {}
|
|
476
|
+
},
|
|
477
|
+
"required": false,
|
|
478
|
+
"optional": false,
|
|
479
|
+
"docs": {
|
|
480
|
+
"tags": [],
|
|
481
|
+
"text": ""
|
|
482
|
+
},
|
|
483
|
+
"attribute": "client-styling",
|
|
484
|
+
"reflect": true
|
|
485
|
+
},
|
|
486
|
+
"clientStylingUrl": {
|
|
487
|
+
"type": "string",
|
|
488
|
+
"mutable": false,
|
|
489
|
+
"complexType": {
|
|
490
|
+
"original": "string",
|
|
491
|
+
"resolved": "string",
|
|
492
|
+
"references": {}
|
|
493
|
+
},
|
|
494
|
+
"required": false,
|
|
495
|
+
"optional": false,
|
|
496
|
+
"docs": {
|
|
497
|
+
"tags": [],
|
|
498
|
+
"text": ""
|
|
499
|
+
},
|
|
500
|
+
"attribute": "client-styling-url",
|
|
501
|
+
"reflect": true
|
|
502
|
+
},
|
|
503
|
+
"language": {
|
|
504
|
+
"type": "string",
|
|
505
|
+
"mutable": false,
|
|
506
|
+
"complexType": {
|
|
507
|
+
"original": "string",
|
|
508
|
+
"resolved": "string",
|
|
509
|
+
"references": {}
|
|
510
|
+
},
|
|
511
|
+
"required": false,
|
|
512
|
+
"optional": false,
|
|
513
|
+
"docs": {
|
|
514
|
+
"tags": [],
|
|
515
|
+
"text": ""
|
|
516
|
+
},
|
|
517
|
+
"attribute": "language",
|
|
518
|
+
"reflect": true,
|
|
519
|
+
"defaultValue": "'en'"
|
|
520
|
+
},
|
|
521
|
+
"translationUrl": {
|
|
522
|
+
"type": "string",
|
|
523
|
+
"mutable": false,
|
|
524
|
+
"complexType": {
|
|
525
|
+
"original": "string",
|
|
526
|
+
"resolved": "string",
|
|
527
|
+
"references": {}
|
|
528
|
+
},
|
|
529
|
+
"required": false,
|
|
530
|
+
"optional": false,
|
|
531
|
+
"docs": {
|
|
532
|
+
"tags": [],
|
|
533
|
+
"text": ""
|
|
534
|
+
},
|
|
535
|
+
"attribute": "translation-url",
|
|
536
|
+
"reflect": true,
|
|
537
|
+
"defaultValue": "''"
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
static get states() {
|
|
542
|
+
return {
|
|
543
|
+
"ticketHistory": {},
|
|
544
|
+
"activeStatus": {},
|
|
545
|
+
"statusOptions": {},
|
|
546
|
+
"isLoading": {},
|
|
547
|
+
"rawData": {},
|
|
548
|
+
"filterData": {},
|
|
549
|
+
"paginationInfo": {},
|
|
550
|
+
"quickFiltersActive": {},
|
|
551
|
+
"showCurrentTicketLine": {},
|
|
552
|
+
"curTicketItem": {},
|
|
553
|
+
"curSelection": {},
|
|
554
|
+
"curSelectionIdx": {},
|
|
555
|
+
"showCurrentDrawResult": {},
|
|
556
|
+
"curDrawItem": {},
|
|
557
|
+
"curDrawSelection": {},
|
|
558
|
+
"curDrawSelectionBettingType": {},
|
|
559
|
+
"curDrawSelectionMap": {}
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
static get events() {
|
|
563
|
+
return [{
|
|
564
|
+
"method": "logout",
|
|
565
|
+
"name": "logout",
|
|
566
|
+
"bubbles": true,
|
|
567
|
+
"cancelable": true,
|
|
568
|
+
"composed": true,
|
|
569
|
+
"docs": {
|
|
570
|
+
"tags": [],
|
|
571
|
+
"text": ""
|
|
572
|
+
},
|
|
573
|
+
"complexType": {
|
|
574
|
+
"original": "void",
|
|
575
|
+
"resolved": "void",
|
|
576
|
+
"references": {}
|
|
577
|
+
}
|
|
578
|
+
}];
|
|
579
|
+
}
|
|
580
|
+
static get watchers() {
|
|
581
|
+
return [{
|
|
582
|
+
"propName": "clientStyling",
|
|
583
|
+
"methodName": "handleClientStylingChange"
|
|
584
|
+
}, {
|
|
585
|
+
"propName": "clientStylingUrl",
|
|
586
|
+
"methodName": "handleClientStylingUrlChange"
|
|
587
|
+
}, {
|
|
588
|
+
"propName": "mbSource",
|
|
589
|
+
"methodName": "handleMbSourceChange"
|
|
590
|
+
}];
|
|
591
|
+
}
|
|
592
|
+
static get listeners() {
|
|
593
|
+
return [{
|
|
594
|
+
"name": "pageSizeChange",
|
|
595
|
+
"method": "handlePageSizeChange",
|
|
596
|
+
"target": undefined,
|
|
597
|
+
"capture": false,
|
|
598
|
+
"passive": false
|
|
599
|
+
}, {
|
|
600
|
+
"name": "pageChange",
|
|
601
|
+
"method": "handlePageChange",
|
|
602
|
+
"target": undefined,
|
|
603
|
+
"capture": false,
|
|
604
|
+
"passive": false
|
|
605
|
+
}, {
|
|
606
|
+
"name": "filterChange",
|
|
607
|
+
"method": "handleFilterChange",
|
|
608
|
+
"target": undefined,
|
|
609
|
+
"capture": false,
|
|
610
|
+
"passive": false
|
|
611
|
+
}, {
|
|
612
|
+
"name": "filterClear",
|
|
613
|
+
"method": "handleFilterClear",
|
|
614
|
+
"target": undefined,
|
|
615
|
+
"capture": false,
|
|
616
|
+
"passive": false
|
|
617
|
+
}, {
|
|
618
|
+
"name": "poolGameCurrentPageChange",
|
|
619
|
+
"method": "handlePoolGameCurrentPageChange",
|
|
620
|
+
"target": undefined,
|
|
621
|
+
"capture": false,
|
|
622
|
+
"passive": false
|
|
623
|
+
}];
|
|
624
|
+
}
|
|
625
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/lottery-tipping-ticket-history';
|