@everymatrix/lottery-oddsbom-entrance 0.7.19 → 0.7.21
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/{index-4e91c0c2.js → index-b0be9007.js} +3 -36
- package/dist/cjs/index.cjs.js +3 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{helper-date-navigator_8.cjs.entry.js → lottery-oddsbom-bomb_2.cjs.entry.js} +27 -1887
- package/dist/cjs/{lottery-oddsbom-entrance-492c9f11.js → lottery-oddsbom-entrance-5723d41e.js} +2 -1
- package/dist/cjs/lottery-oddsbom-entrance.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +0 -36
- package/dist/collection/components/lottery-oddsbom-entrance/lottery-oddsbom-entrance.js +1 -1
- package/dist/esm/{index-068e610e.js → index-275ec96c.js} +4 -36
- package/dist/esm/index.js +3 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{helper-date-navigator_8.entry.js → lottery-oddsbom-bomb_2.entry.js} +29 -1883
- package/dist/esm/{lottery-oddsbom-entrance-e1fe7c9f.js → lottery-oddsbom-entrance-267e1b22.js} +2 -1
- package/dist/esm/lottery-oddsbom-entrance.js +3 -3
- package/dist/lottery-oddsbom-entrance/index-275ec96c.js +2 -0
- package/dist/lottery-oddsbom-entrance/index.esm.js +1 -1
- package/dist/lottery-oddsbom-entrance/lottery-oddsbom-bomb_2.entry.js +1 -0
- package/dist/lottery-oddsbom-entrance/{lottery-oddsbom-entrance-e1fe7c9f.js → lottery-oddsbom-entrance-267e1b22.js} +1 -1
- package/dist/lottery-oddsbom-entrance/lottery-oddsbom-entrance.esm.js +1 -1
- package/dist/types/components/lottery-oddsbom-entrance/lottery-oddsbom-entrance.d.ts +1 -1
- package/package.json +1 -1
- package/dist/lottery-oddsbom-entrance/helper-date-navigator_8.entry.js +0 -1
- package/dist/lottery-oddsbom-entrance/index-068e610e.js +0 -2
package/dist/cjs/{helper-date-navigator_8.cjs.entry.js → lottery-oddsbom-bomb_2.cjs.entry.js}
RENAMED
|
@@ -2,358 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const lotteryOddsbomEntrance = require('./lottery-oddsbom-entrance-
|
|
7
|
-
|
|
8
|
-
// This icon file is generated automatically.
|
|
9
|
-
var CalendarOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z" } }] }, "name": "calendar", "theme": "outlined" };
|
|
10
|
-
const CalendarOutlined$1 = CalendarOutlined;
|
|
11
|
-
|
|
12
|
-
// This icon file is generated automatically.
|
|
13
|
-
var DeleteFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z" } }] }, "name": "delete", "theme": "filled" };
|
|
14
|
-
const DeleteFilled$1 = DeleteFilled;
|
|
15
|
-
|
|
16
|
-
// This icon file is generated automatically.
|
|
17
|
-
var LeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
|
|
18
|
-
const LeftOutlined$1 = LeftOutlined;
|
|
19
|
-
|
|
20
|
-
// This icon file is generated automatically.
|
|
21
|
-
var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
|
|
22
|
-
const RightOutlined$1 = RightOutlined;
|
|
23
|
-
|
|
24
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
25
|
-
__assign = Object.assign || function(t) {
|
|
26
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
27
|
-
s = arguments[i];
|
|
28
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
29
|
-
t[p] = s[p];
|
|
30
|
-
}
|
|
31
|
-
return t;
|
|
32
|
-
};
|
|
33
|
-
return __assign.apply(this, arguments);
|
|
34
|
-
};
|
|
35
|
-
var defaultColors = {
|
|
36
|
-
primaryColor: '#333',
|
|
37
|
-
secondaryColor: '#E6E6E6'
|
|
38
|
-
};
|
|
39
|
-
function renderIconDefinitionToSVGElement(icond, options) {
|
|
40
|
-
if (options === void 0) { options = {}; }
|
|
41
|
-
if (typeof icond.icon === 'function') {
|
|
42
|
-
// two-tone
|
|
43
|
-
var placeholders = options.placeholders || defaultColors;
|
|
44
|
-
return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
|
|
45
|
-
}
|
|
46
|
-
// fill, outline
|
|
47
|
-
return renderAbstractNodeToSVGElement(icond.icon, options);
|
|
48
|
-
}
|
|
49
|
-
function renderAbstractNodeToSVGElement(node, options) {
|
|
50
|
-
var targetAttrs = node.tag === 'svg'
|
|
51
|
-
? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
|
|
52
|
-
var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
|
|
53
|
-
var key = nextKey;
|
|
54
|
-
var value = targetAttrs[key];
|
|
55
|
-
var token = "".concat(key, "=\"").concat(value, "\"");
|
|
56
|
-
acc.push(token);
|
|
57
|
-
return acc;
|
|
58
|
-
}, []);
|
|
59
|
-
var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
|
|
60
|
-
var children = (node.children || [])
|
|
61
|
-
.map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
|
|
62
|
-
.join('');
|
|
63
|
-
if (children && children.length) {
|
|
64
|
-
return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
|
|
65
|
-
}
|
|
66
|
-
return "<".concat(node.tag).concat(attrsToken, " />");
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const DEFAULT_LANGUAGE$3 = 'en';
|
|
70
|
-
const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
71
|
-
const TRANSLATIONS$3 = {
|
|
72
|
-
en: {
|
|
73
|
-
weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
const translate$3 = (key, customLang, replacements) => {
|
|
77
|
-
const lang = customLang;
|
|
78
|
-
let translation = TRANSLATIONS$3[lang !== undefined && SUPPORTED_LANGUAGES$3.includes(lang) ? lang : DEFAULT_LANGUAGE$3][key];
|
|
79
|
-
if (replacements) {
|
|
80
|
-
Object.keys(replacements).forEach((placeholder) => {
|
|
81
|
-
translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return translation;
|
|
85
|
-
};
|
|
86
|
-
const getTranslations$2 = (data) => {
|
|
87
|
-
Object.keys(data).forEach((item) => {
|
|
88
|
-
for (let key in data[item]) {
|
|
89
|
-
TRANSLATIONS$3[item][key] = data[item][key];
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
const resolveTranslationUrl$2 = async (translationUrl) => {
|
|
94
|
-
if (translationUrl) {
|
|
95
|
-
try {
|
|
96
|
-
const response = await fetch(translationUrl);
|
|
97
|
-
if (!response.ok) {
|
|
98
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
99
|
-
}
|
|
100
|
-
const translations = await response.json();
|
|
101
|
-
getTranslations$2(translations);
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
console.error('Failed to fetch or parse translations from URL:', error);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const helperDateNavigatorCss = ".lottery-tipping-calendar{position:relative;display:inline-block}.calendar-visible{opacity:1;visibility:visible}.calendar-leave{opacity:0;visibility:hidden}.calendar{position:absolute;top:40px;left:-50%;background:var(--emw--color-background, #fff);color:var(--emw--color-typography-secondary, #6f6f6f);padding:16px;width:fit-content;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:var(--emw--border-radius-small, 4px);box-shadow:2px 3px 5px rgba(0, 0, 0, 0.1);cursor:pointer;transition:opacity 0.2s ease, visibility 0.2s ease;z-index:99}.calendar-header{display:flex;align-items:center}.calendar-header .date-picker{display:flex;margin:0 18px;align-items:center}.calendar-header .date-picker-delimiter{font-size:16px;margin:auto 4px}.calendar-header .month-plus,.calendar-header .month-minus,.calendar-header .year-plus,.calendar-header .year-minus{cursor:pointer;font-size:14px}.calendar-header .month-plus:hover,.calendar-header .month-minus:hover,.calendar-header .year-plus:hover,.calendar-header .year-minus:hover{color:var(--emw-pool-game-acition-active, #005fdb);transition:color 0.2s}.calendar-header .year-minus,.calendar-header .month-plus{margin-right:6px}.calendar-content{padding:3px;width:fit-content}.calendar-content .day-item{text-align:center;line-height:40px;cursor:not-allowed;position:relative;pointer-events:none}.calendar-content .day-item:hover{background-color:var(--emw--color-background-secondary, #f5f5f5)}.calendar-content .day-item.isCurDay{border-radius:4px;background:var(--emw--color-secondary, #fff3b9);background-size:50%;color:var(--emw--color-typography-secondary, #6f6f6f);font-weight:600;box-shadow:2px 2px 2px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight{cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight::after{content:\"\";position:absolute;left:calc(50% - 4px);bottom:0;width:6px;height:6px;border-radius:50%;background-color:var(--emw--color-error, red)}.calendar-content-week{display:grid;grid-template-columns:repeat(7, 40px);grid-template-rows:repeat(1, 36px);justify-items:center;align-items:center;border-bottom:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));color:var(--emw--color-typography-secondary, #6f6f6f)}.calendar-content-day{margin-top:4px;display:grid;grid-template-rows:repeat(6, 40px);grid-template-columns:repeat(7, 40px)}.calling-input{height:36px;width:160px;display:flex;align-items:center;justify-content:space-between;padding:0px 4px;background-color:var(--emw--color-background, #f5f5f5);border-radius:var(--emw--border-radius-small, 4px);border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));cursor:pointer}.calling-input .input{color:var(--emw--color-typography, #000)}.calling-input-text{color:var(--emw--color-typography, #000)}.date-selection{display:flex;align-items:center;justify-content:center;gap:24px}.date-selection-leftIcon,.date-selection-rightIcon{cursor:pointer;color:var(--emw--color-typography, #000)}";
|
|
110
|
-
const HelperDateNavigatorStyle0 = helperDateNavigatorCss;
|
|
111
|
-
|
|
112
|
-
const leftArrowIcon = renderIconDefinitionToSVGElement(LeftOutlined$1, {
|
|
113
|
-
extraSVGAttrs: { width: '16px', height: '16px', fill: 'currentColor' }
|
|
114
|
-
});
|
|
115
|
-
const rightArrowIcon = renderIconDefinitionToSVGElement(RightOutlined$1, {
|
|
116
|
-
extraSVGAttrs: { width: '16px', height: '16px', fill: 'currentColor' }
|
|
117
|
-
});
|
|
118
|
-
const calendarIcon = renderIconDefinitionToSVGElement(CalendarOutlined$1, {
|
|
119
|
-
extraSVGAttrs: { width: '18px', height: '18px', fill: 'var(--emw--color-primary-variant, #1367e7)' }
|
|
120
|
-
});
|
|
121
|
-
const HelperDateNavigator = class {
|
|
122
|
-
constructor(hostRef) {
|
|
123
|
-
index.registerInstance(this, hostRef);
|
|
124
|
-
this.changeDate = index.createEvent(this, "changeDate", 7);
|
|
125
|
-
this.handleNext = index.createEvent(this, "next", 7);
|
|
126
|
-
this.handlePrev = index.createEvent(this, "prev", 7);
|
|
127
|
-
this.handleOutsideClick = (event) => {
|
|
128
|
-
if (!this.showCalendar)
|
|
129
|
-
return;
|
|
130
|
-
const path = event.composedPath ? event.composedPath() : [];
|
|
131
|
-
// check if clicked on calendar
|
|
132
|
-
const isCalendarClick = path.includes(this.calendarRef);
|
|
133
|
-
// check if click select option
|
|
134
|
-
const isSelectOption = path.some((el) => {
|
|
135
|
-
var _a, _b;
|
|
136
|
-
return el instanceof HTMLElement &&
|
|
137
|
-
(((_a = el.getAttribute('part')) === null || _a === void 0 ? void 0 : _a.includes('item')) || ((_b = el.getAttribute('part')) === null || _b === void 0 ? void 0 : _b.includes('overlay')));
|
|
138
|
-
});
|
|
139
|
-
if (!isCalendarClick && !isSelectOption) {
|
|
140
|
-
this.showCalendar = false;
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
this.onYearMinus = () => {
|
|
144
|
-
const years = this.yearOptions.map((item) => Number(item.value));
|
|
145
|
-
if (this.alterDate.year - 1 < Math.min(...years))
|
|
146
|
-
return;
|
|
147
|
-
this.alterDate.year--;
|
|
148
|
-
this.loadRecords();
|
|
149
|
-
};
|
|
150
|
-
this.onYearPlus = () => {
|
|
151
|
-
const years = this.yearOptions.map((item) => Number(item.value));
|
|
152
|
-
if (this.alterDate.year + 1 > Math.max(...years))
|
|
153
|
-
return;
|
|
154
|
-
this.alterDate.year++;
|
|
155
|
-
this.loadRecords();
|
|
156
|
-
};
|
|
157
|
-
this.onMonthMinus = () => {
|
|
158
|
-
if (this.alterDate.month === 0) {
|
|
159
|
-
this.onYearMinus();
|
|
160
|
-
this.alterDate.month = 11;
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
this.alterDate.month--;
|
|
164
|
-
this.loadRecords();
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
this.onMonthPlus = () => {
|
|
168
|
-
if (this.alterDate.month === 11) {
|
|
169
|
-
this.onYearPlus();
|
|
170
|
-
this.alterDate.month = 0;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
this.alterDate.month++;
|
|
174
|
-
this.loadRecords();
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
this.onYearChange = (e) => {
|
|
178
|
-
this.alterDate.year = parseInt(e.detail.value);
|
|
179
|
-
this.loadRecords();
|
|
180
|
-
};
|
|
181
|
-
this.onMonthChange = (e) => {
|
|
182
|
-
this.alterDate.month = parseInt(e.detail.value) - 1;
|
|
183
|
-
this.loadRecords();
|
|
184
|
-
};
|
|
185
|
-
this.mbSource = undefined;
|
|
186
|
-
this.clientStyling = undefined;
|
|
187
|
-
this.clientStylingUrl = undefined;
|
|
188
|
-
this.translationUrl = '';
|
|
189
|
-
this.language = 'en';
|
|
190
|
-
this.date = '';
|
|
191
|
-
this.defaultHighlightDates = undefined;
|
|
192
|
-
this.highlightDates = [];
|
|
193
|
-
this.weeks = undefined;
|
|
194
|
-
this.days = [];
|
|
195
|
-
this.alterDate = { year: 0, month: 0, day: 0 };
|
|
196
|
-
this.curDate = { year: 0, month: 0, day: 0 };
|
|
197
|
-
this.recordInfo = [];
|
|
198
|
-
this.showCalendar = false;
|
|
199
|
-
}
|
|
200
|
-
handleClientStylingChange(newValue, oldValue) {
|
|
201
|
-
if (newValue != oldValue) {
|
|
202
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
handleClientStylingUrlChange(newValue, oldValue) {
|
|
206
|
-
if (newValue != oldValue) {
|
|
207
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
handleMbSourceChange(newValue, oldValue) {
|
|
211
|
-
if (newValue != oldValue) {
|
|
212
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
handleGameIdStringChange(newValue, oldValue) {
|
|
216
|
-
if (newValue != oldValue) {
|
|
217
|
-
this.setHighlightDates();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
componentWillLoad() {
|
|
221
|
-
resolveTranslationUrl$2(this.translationUrl);
|
|
222
|
-
this.weeks = translate$3('weeks', this.language);
|
|
223
|
-
const d = this.date ? new Date(this.date) : new Date();
|
|
224
|
-
this.alterDate = { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
|
|
225
|
-
this.curDate = Object.assign({}, this.alterDate);
|
|
226
|
-
this.loadRecords();
|
|
227
|
-
}
|
|
228
|
-
handleDateChange() {
|
|
229
|
-
const d = this.date ? new Date(this.date) : new Date();
|
|
230
|
-
this.alterDate = { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
|
|
231
|
-
this.curDate = Object.assign({}, this.alterDate);
|
|
232
|
-
this.loadRecords();
|
|
233
|
-
}
|
|
234
|
-
setHighlightDates() {
|
|
235
|
-
if (this.defaultHighlightDates) {
|
|
236
|
-
try {
|
|
237
|
-
this.highlightDates = JSON.parse(this.defaultHighlightDates);
|
|
238
|
-
}
|
|
239
|
-
catch (_a) {
|
|
240
|
-
this.highlightDates = [];
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
componentDidLoad() {
|
|
245
|
-
if (this.stylingContainer) {
|
|
246
|
-
if (this.mbSource)
|
|
247
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
248
|
-
if (this.clientStyling)
|
|
249
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
250
|
-
if (this.clientStylingUrl)
|
|
251
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
252
|
-
}
|
|
253
|
-
this.setHighlightDates();
|
|
254
|
-
document.addEventListener('click', this.handleOutsideClick);
|
|
255
|
-
}
|
|
256
|
-
disconnectedCallback() {
|
|
257
|
-
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
258
|
-
document.removeEventListener('click', this.handleOutsideClick);
|
|
259
|
-
}
|
|
260
|
-
get yearOptions() {
|
|
261
|
-
const years = Array.from({ length: 101 }, (_, i) => this.alterDate.year - 50 + i);
|
|
262
|
-
return years.map((item) => {
|
|
263
|
-
return {
|
|
264
|
-
label: String(item),
|
|
265
|
-
value: String(item)
|
|
266
|
-
};
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
get monthOptions() {
|
|
270
|
-
const months = Array.from({ length: 12 }, (_, i) => i + 1);
|
|
271
|
-
return months.map((item) => {
|
|
272
|
-
return {
|
|
273
|
-
label: String(item),
|
|
274
|
-
value: String(item)
|
|
275
|
-
};
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
loadRecords() {
|
|
279
|
-
const { year, month } = this.alterDate;
|
|
280
|
-
this.setDays(year, month);
|
|
281
|
-
}
|
|
282
|
-
setDays(year, month) {
|
|
283
|
-
this.days = [];
|
|
284
|
-
const firstDayOfMonth = new Date(year, month, 1);
|
|
285
|
-
const firstDayWeek = firstDayOfMonth.getDay();
|
|
286
|
-
const startDate = new Date(year, month, 1 - firstDayWeek);
|
|
287
|
-
for (let i = 0; i < 42; i++) {
|
|
288
|
-
const temp = new Date(startDate);
|
|
289
|
-
temp.setDate(startDate.getDate() + i);
|
|
290
|
-
const day = {
|
|
291
|
-
date: temp.getDate(),
|
|
292
|
-
month: temp.getMonth(),
|
|
293
|
-
year: temp.getFullYear()
|
|
294
|
-
};
|
|
295
|
-
this.days.push(day);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
getFullDayOfMonth(year, month) {
|
|
299
|
-
return new Date(year, month, 0).getDate();
|
|
300
|
-
}
|
|
301
|
-
showFormatedDate(date) {
|
|
302
|
-
return `${date.day}/${date.month + 1}/${date.year}`;
|
|
303
|
-
}
|
|
304
|
-
handleSelectDate(curDay, curMonth, curYear) {
|
|
305
|
-
this.alterDate.day = curDay;
|
|
306
|
-
this.curDate = Object.assign({}, this.alterDate);
|
|
307
|
-
this.showCalendar = false;
|
|
308
|
-
const formattedHighLightArr = this.highlightDates.map((date) => {
|
|
309
|
-
const d = new Date(date);
|
|
310
|
-
return { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
|
|
311
|
-
});
|
|
312
|
-
const idx = formattedHighLightArr.findIndex((obj) => {
|
|
313
|
-
const { year, month, day } = obj;
|
|
314
|
-
return curMonth === month && curYear === year && curDay === day;
|
|
315
|
-
});
|
|
316
|
-
if (idx > -1) {
|
|
317
|
-
this.changeDate.emit(idx);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
tellIsCurDay(curDay, curMonth, curYear) {
|
|
321
|
-
return this.curDate.day === curDay && this.curDate.month === curMonth && this.curDate.year === curYear;
|
|
322
|
-
}
|
|
323
|
-
tellIsHighLight(curDay, curMonth, curYear) {
|
|
324
|
-
if (!this.highlightDates || !this.highlightDates.length)
|
|
325
|
-
return false;
|
|
326
|
-
const formattedHighLightArr = this.highlightDates.map((date) => {
|
|
327
|
-
const d = new Date(date);
|
|
328
|
-
return { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
|
|
329
|
-
});
|
|
330
|
-
return formattedHighLightArr.some((obj) => {
|
|
331
|
-
const { year, month, day } = obj;
|
|
332
|
-
return curMonth === month && curYear === year && curDay === day;
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
renderInner() {
|
|
336
|
-
const calendarClass = ['calendar', this.showCalendar ? 'calendar-visible' : 'calendar-leave'];
|
|
337
|
-
return (index.h("div", { class: "lottery-tipping-calendar", ref: (el) => (this.calendarRef = el) }, index.h("div", { class: "calling-input", onClick: () => {
|
|
338
|
-
this.showCalendar = true;
|
|
339
|
-
} }, index.h("div", { class: "calling-input-text" }, this.showFormatedDate(this.curDate)), index.h("div", { class: "calling-input-icon", innerHTML: calendarIcon })), index.h("div", { class: calendarClass.join(' ') }, index.h("div", { class: "calendar-header" }, index.h("div", { class: "date-controller year-minus", onClick: this.onYearMinus }, "<"), index.h("div", { class: "date-controller month-minus", onClick: this.onMonthMinus }, "<"), index.h("div", { class: "date-picker" }, index.h("div", { class: "date-picker-year" }, index.h("vaadin-select", { items: this.yearOptions, value: this.alterDate.year, style: { '--vaadin-field-default-width': '90px' }, "on-value-changed": this.onYearChange.bind(this) })), index.h("div", { class: "date-picker-delimiter" }, "-"), index.h("div", { class: "date-picker-month" }, index.h("vaadin-select", { items: this.monthOptions, value: this.alterDate.month + 1, style: { '--vaadin-field-default-width': '64px' }, "on-value-changed": this.onMonthChange.bind(this) })), index.h("div", { class: "date-picker-delimiter" }, "-"), index.h("div", { class: "date-picker-day" }, this.alterDate.day)), index.h("div", { class: "date-controller month-plus", onClick: this.onMonthPlus }, ">"), index.h("div", { class: "date-controller year-plus", onClick: this.onYearPlus }, ">")), index.h("div", { class: "calendar-content" }, index.h("div", { class: "calendar-content-week" }, this.weeks.map((week) => (index.h("div", { class: "week-item" }, week)))), index.h("div", { class: "calendar-content-day" }, this.days.map((item) => (index.h("div", { class: {
|
|
340
|
-
'day-item': true,
|
|
341
|
-
isCurDay: this.tellIsCurDay(item.date, item.month, item.year),
|
|
342
|
-
isHighLight: this.tellIsHighLight(item.date, item.month, item.year)
|
|
343
|
-
}, onClick: () => this.handleSelectDate(item.date, item.month, item.year) }, item.date))))))));
|
|
344
|
-
}
|
|
345
|
-
render() {
|
|
346
|
-
return (index.h("div", { key: 'da34c4c86cac49411fb15ab8bceda89e379befc6', class: "date-selection" }, index.h("div", { key: '29f06ef7a5df466018ae6561b54fcbdfbab9f23b', class: "date-selection-leftIcon", innerHTML: leftArrowIcon, onClick: () => this.handlePrev.emit() }), index.h("div", { key: 'c6d75d873c2683752c37d4083c57761c4f7e523b', class: "date-selection-calendar" }, this.renderInner()), index.h("div", { key: '8b16b3e0761dd4c877f169aea84d028aaf193b69', class: "date-selection-rightIcon", innerHTML: rightArrowIcon, onClick: () => this.handleNext.emit() })));
|
|
347
|
-
}
|
|
348
|
-
static get watchers() { return {
|
|
349
|
-
"clientStyling": ["handleClientStylingChange"],
|
|
350
|
-
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
351
|
-
"mbSource": ["handleMbSourceChange"],
|
|
352
|
-
"defaultHighlightDates": ["handleGameIdStringChange"],
|
|
353
|
-
"date": ["handleDateChange"]
|
|
354
|
-
}; }
|
|
355
|
-
};
|
|
356
|
-
HelperDateNavigator.style = HelperDateNavigatorStyle0;
|
|
5
|
+
const index = require('./index-b0be9007.js');
|
|
6
|
+
const lotteryOddsbomEntrance = require('./lottery-oddsbom-entrance-5723d41e.js');
|
|
7
|
+
require('@everymatrix/lottery-oddsbom-latest-result-group');
|
|
357
8
|
|
|
358
9
|
var Bomb;
|
|
359
10
|
(function (Bomb) {
|
|
@@ -697,33 +348,6 @@ function isValid(dirtyDate) {
|
|
|
697
348
|
return !isNaN(Number(date));
|
|
698
349
|
}
|
|
699
350
|
|
|
700
|
-
/**
|
|
701
|
-
* @name differenceInMilliseconds
|
|
702
|
-
* @category Millisecond Helpers
|
|
703
|
-
* @summary Get the number of milliseconds between the given dates.
|
|
704
|
-
*
|
|
705
|
-
* @description
|
|
706
|
-
* Get the number of milliseconds between the given dates.
|
|
707
|
-
*
|
|
708
|
-
* @param {Date|Number} dateLeft - the later date
|
|
709
|
-
* @param {Date|Number} dateRight - the earlier date
|
|
710
|
-
* @returns {Number} the number of milliseconds
|
|
711
|
-
* @throws {TypeError} 2 arguments required
|
|
712
|
-
*
|
|
713
|
-
* @example
|
|
714
|
-
* // How many milliseconds are between
|
|
715
|
-
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
|
716
|
-
* const result = differenceInMilliseconds(
|
|
717
|
-
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
|
718
|
-
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
|
719
|
-
* )
|
|
720
|
-
* //=> 1100
|
|
721
|
-
*/
|
|
722
|
-
function differenceInMilliseconds(dateLeft, dateRight) {
|
|
723
|
-
requiredArgs(2, arguments);
|
|
724
|
-
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
|
|
725
|
-
}
|
|
726
|
-
|
|
727
351
|
/**
|
|
728
352
|
* @name subMilliseconds
|
|
729
353
|
* @category Millisecond Helpers
|
|
@@ -2996,7 +2620,7 @@ function validateTimezone(_hours, minutes) {
|
|
|
2996
2620
|
return minutes >= 0 && minutes <= 59;
|
|
2997
2621
|
}
|
|
2998
2622
|
|
|
2999
|
-
function fetchRequest
|
|
2623
|
+
function fetchRequest(url, method = 'GET', body = null, headers = {}) {
|
|
3000
2624
|
return new Promise((resolve, reject) => {
|
|
3001
2625
|
const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
|
|
3002
2626
|
const options = {
|
|
@@ -3052,7 +2676,7 @@ function formattedTime(date) {
|
|
|
3052
2676
|
const weekday = format(parsedDate, 'EEEE');
|
|
3053
2677
|
return `${weekday} at ${hhmm}`;
|
|
3054
2678
|
}
|
|
3055
|
-
function toQueryParams
|
|
2679
|
+
function toQueryParams(params) {
|
|
3056
2680
|
const finalParams = {};
|
|
3057
2681
|
Object.entries(params).forEach(([key, value]) => {
|
|
3058
2682
|
if (!isEmptyValue(value, true)) {
|
|
@@ -3120,7 +2744,7 @@ function isEmptyValueOfObject(obj) {
|
|
|
3120
2744
|
return false;
|
|
3121
2745
|
}
|
|
3122
2746
|
const DEFAULT_ALL_BOMB = { name: 'All', code: 'All' };
|
|
3123
|
-
function thousandSeparator
|
|
2747
|
+
function thousandSeparator(value) {
|
|
3124
2748
|
if (value === 0) {
|
|
3125
2749
|
return '0';
|
|
3126
2750
|
}
|
|
@@ -3135,7 +2759,7 @@ function thousandSeparator$1(value) {
|
|
|
3135
2759
|
|
|
3136
2760
|
async function fetchLiveDrawsByGroupId({ endpoint, groupId, params = {} }) {
|
|
3137
2761
|
try {
|
|
3138
|
-
const res = await fetchRequest
|
|
2762
|
+
const res = await fetchRequest(`${endpoint}/groups/${groupId}/liveDraws${toQueryParams(params)}`);
|
|
3139
2763
|
return res;
|
|
3140
2764
|
}
|
|
3141
2765
|
catch (error) {
|
|
@@ -3143,16 +2767,16 @@ async function fetchLiveDrawsByGroupId({ endpoint, groupId, params = {} }) {
|
|
|
3143
2767
|
return {};
|
|
3144
2768
|
}
|
|
3145
2769
|
}
|
|
3146
|
-
async function fetchSaleStatistics
|
|
2770
|
+
async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
|
|
3147
2771
|
try {
|
|
3148
|
-
const res = await fetchRequest
|
|
2772
|
+
const res = await fetchRequest(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
|
|
3149
2773
|
return res;
|
|
3150
2774
|
}
|
|
3151
2775
|
catch (error) {
|
|
3152
2776
|
return Promise.reject(error);
|
|
3153
2777
|
}
|
|
3154
2778
|
}
|
|
3155
|
-
async function fetchData
|
|
2779
|
+
async function fetchData({ endpoint, groupId, params }) {
|
|
3156
2780
|
try {
|
|
3157
2781
|
const { sportTags = [], liveDraws = [] } = await fetchLiveDrawsByGroupId({
|
|
3158
2782
|
endpoint,
|
|
@@ -3184,7 +2808,7 @@ async function getTurnoverForAll({ endpoint, configs }) {
|
|
|
3184
2808
|
const fallback = { turnover: formattedTurnover(null) };
|
|
3185
2809
|
const promises = configs.map(async ({ gameId, drawId }) => {
|
|
3186
2810
|
var _a;
|
|
3187
|
-
const res = await fetchSaleStatistics
|
|
2811
|
+
const res = await fetchSaleStatistics({
|
|
3188
2812
|
endpoint: endpoint,
|
|
3189
2813
|
gameId,
|
|
3190
2814
|
drawId
|
|
@@ -3194,9 +2818,9 @@ async function getTurnoverForAll({ endpoint, configs }) {
|
|
|
3194
2818
|
const results = await Promise.allSettled(promises);
|
|
3195
2819
|
return results.map((r) => (r.status === 'fulfilled' ? r.value : fallback));
|
|
3196
2820
|
}
|
|
3197
|
-
async function fetchGameInfo
|
|
2821
|
+
async function fetchGameInfo(endpoint, gameId) {
|
|
3198
2822
|
try {
|
|
3199
|
-
const response = await fetchRequest
|
|
2823
|
+
const response = await fetchRequest(`${endpoint}/games/${gameId}`, 'GET', {});
|
|
3200
2824
|
return response;
|
|
3201
2825
|
}
|
|
3202
2826
|
catch (error) {
|
|
@@ -3204,9 +2828,9 @@ async function fetchGameInfo$1(endpoint, gameId) {
|
|
|
3204
2828
|
throw new Error('The game is currently not available. Please try again later.');
|
|
3205
2829
|
}
|
|
3206
2830
|
}
|
|
3207
|
-
async function fetchTicketMatch
|
|
2831
|
+
async function fetchTicketMatch({ endpoint, gameId, drawId }) {
|
|
3208
2832
|
try {
|
|
3209
|
-
const res = await fetchRequest
|
|
2833
|
+
const res = await fetchRequest(`${endpoint}/poolgames/${gameId}/draws/${drawId}/matchConfig`);
|
|
3210
2834
|
return res || [];
|
|
3211
2835
|
}
|
|
3212
2836
|
catch (e) {
|
|
@@ -3217,12 +2841,12 @@ async function fetchTicketMatch$1({ endpoint, gameId, drawId }) {
|
|
|
3217
2841
|
function formattedTurnover(turnover, unit = '€') {
|
|
3218
2842
|
if (turnover === null)
|
|
3219
2843
|
return '';
|
|
3220
|
-
return `${unit}${turnover ? thousandSeparator
|
|
2844
|
+
return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
|
|
3221
2845
|
}
|
|
3222
2846
|
|
|
3223
|
-
const DEFAULT_LANGUAGE
|
|
3224
|
-
const SUPPORTED_LANGUAGES
|
|
3225
|
-
const TRANSLATIONS
|
|
2847
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2848
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
2849
|
+
const TRANSLATIONS = {
|
|
3226
2850
|
en: {
|
|
3227
2851
|
logout: 'Log out',
|
|
3228
2852
|
draws: 'DRAWS',
|
|
@@ -3275,15 +2899,15 @@ const TRANSLATIONS$2 = {
|
|
|
3275
2899
|
instructionContent: 'Sadržaj uputa ide ovdje.'
|
|
3276
2900
|
}
|
|
3277
2901
|
};
|
|
3278
|
-
const translate
|
|
2902
|
+
const translate = (key, customLang) => {
|
|
3279
2903
|
const lang = customLang;
|
|
3280
|
-
return TRANSLATIONS
|
|
2904
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
3281
2905
|
};
|
|
3282
2906
|
|
|
3283
2907
|
const lotteryOddsbomBombCss = "/* --- Component: Bomb Card Grid --- */\n.lottery-oddsbom-bomb-wrapper {\n background: var(--emw--color-background, #fff);\n color: var(--emw--color-typography, #000);\n height: 100%;\n}\n\n.bomb-grid-container {\n margin-top: 20px;\n width: 100%;\n display: flex;\n justify-content: center;\n container-type: inline-size;\n container-name: bomb-grid;\n background: var(--emw--color-background, #fff);\n color: var(--emw--color-typography, #000);\n /* --- Component: Bomb Card --- */\n}\n.bomb-grid-container .bomb-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 0.75rem;\n place-items: center;\n}\n.bomb-grid-container .bomb-card-wrapper {\n width: 100%;\n max-width: 30rem;\n height: 100%;\n box-sizing: border-box;\n border-radius: 8px;\n padding: 1rem;\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n.bomb-grid-container .bomb-card {\n height: 100%;\n min-width: 24rem;\n transition: transform 0.3s;\n}\n.bomb-grid-container .bomb-card:hover {\n transform: scale(1.02);\n cursor: pointer;\n}\n.bomb-grid-container .card-header {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin-bottom: 0.8rem;\n}\n.bomb-grid-container .card-icon {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.bomb-grid-container .card-icon svg {\n width: 28px;\n height: 28px;\n}\n.bomb-grid-container .card-title {\n flex-grow: 1;\n word-break: break-all;\n}\n.bomb-grid-container .card-title h2 {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 700;\n word-wrap: break-word;\n}\n.bomb-grid-container .card-title p {\n margin: 0;\n color: var(--emw--color-typography-secondary, #333);\n font-size: 0.9rem;\n word-wrap: break-word;\n}\n.bomb-grid-container .card-info {\n display: flex;\n gap: 0.75rem;\n margin-bottom: 0.8rem;\n flex-wrap: wrap;\n}\n.bomb-grid-container .card-tag {\n background-color: var(--emw--color-tertiary, #e3f2fd);\n padding: 0.3rem 0.75rem;\n border-radius: 4px;\n font-size: 0.85rem;\n font-weight: 500;\n max-width: 120px;\n}\n.bomb-grid-container .card-matches {\n max-height: 6.8rem;\n overflow-y: auto;\n}\n.bomb-grid-container .card-matches ol {\n margin: 0;\n padding-left: 1.25rem;\n font-size: 0.85rem;\n line-height: 1.6;\n}\n.bomb-grid-container .card-matches li {\n padding-left: 0.2rem;\n word-wrap: break-word;\n}\n\n/* --- CONTAINER QUERIES FOR RESPONSIVENESS --- */\n@container bomb-grid (max-width: 768px) {\n .bomb-grid-container .bomb-grid {\n /* On smaller containers, switch to a single column */\n grid-template-columns: 1fr;\n }\n .bomb-card-wrapper .bomb-card {\n min-width: 200px;\n }\n}\n/* --- Component: Filter Controls --- */\n.OddsbomEntranceController__section {\n margin-top: 1.5rem;\n display: flex;\n gap: 12px;\n color: var(--emw--color-typography, #000);\n container-type: inline-size;\n container-name: controller;\n justify-content: center;\n}\n.OddsbomEntranceController__label {\n font-weight: 500;\n white-space: nowrap;\n width: 6rem;\n line-height: 2.2rem;\n}\n.OddsbomEntranceController__segmented-control {\n display: inline-flex;\n gap: 1rem;\n flex-wrap: wrap;\n}\n.OddsbomEntranceController__segment {\n height: 2.2rem;\n border: none;\n padding: 0.3rem 0.8rem;\n cursor: pointer;\n font-weight: 500;\n border-radius: 2rem;\n outline: none;\n white-space: nowrap;\n background-color: var(--emw--color-background, #ffffff);\n color: var(--emw--color-typography, #000);\n}\n.OddsbomEntranceController__segment--active {\n background-color: var(--emw--color-primary-variant, #1367e7);\n color: var(--emw--color-typography-reverse, #fff);\n font-weight: 600;\n}\n.OddsbomEntranceController__segment--disabled:hover {\n cursor: not-allowed !important;\n}\n.OddsbomEntranceController__segment:not(.OddsbomEntranceController__segment--active):hover {\n background-color: var(--emw--color-background-tertiary, #ccc);\n}\n\n.skeleton-content {\n display: flex;\n flex-direction: column;\n gap: 29px;\n align-items: center;\n}\n\n.skeleton-item {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 4px;\n height: 40px;\n width: 200px;\n}\n\n.skeleton-animated {\n animation: skeleton-shimmer 1.5s infinite linear;\n background: linear-gradient(90deg, var(--emw--color-background-secondary, #f5f5f5) 25%, var(--emw--color-background-tertiary, #ccc) 37%, var(--emw--color-background-secondary, #f5f5f5) 63%);\n background-size: 200% 100%;\n}\n\n@keyframes skeleton-shimmer {\n to {\n background-position: 100% 0;\n }\n}\n.loading-icon.scale {\n animation: scale 1s infinite ease-in-out;\n}\n\n@keyframes scale {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.2);\n }\n}\n@container controller (max-width: 500px) {\n .OddsbomEntranceController__segmented-control {\n gap: 0rem;\n }\n .OddsbomEntranceController__segment {\n padding: 0.2rem 0.6rem;\n }\n .OddsbomEntranceController__label,\n .OddsbomEntranceController____segment {\n line-height: 1.8rem;\n }\n}\n.loading-wrap {\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100px;\n}\n.loading-wrap .dots-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n.loading-wrap .dot {\n height: 14px;\n width: 14px;\n margin-right: 14px;\n border-radius: 14px;\n background-color: var(--emw--color-gray-300, #333);\n animation: pulse 1.5s infinite ease-in-out;\n}\n.loading-wrap .dot:last-child {\n margin-right: 0;\n}\n.loading-wrap .dot:nth-child(1) {\n animation-delay: -0.3s;\n}\n.loading-wrap .dot:nth-child(2) {\n animation-delay: -0.1s;\n}\n.loading-wrap .dot:nth-child(3) {\n animation-delay: 0.1s;\n}\n@keyframes pulse {\n 0% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-300, #333);\n }\n 50% {\n transform: scale(1.2);\n background-color: var(--emw--color-gray-100, #e6e6e6);\n }\n 100% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-150, #6f6f6f);\n }\n}\n\n.empty-draw-wrap {\n padding-top: 100px;\n}\n.empty-draw-wrap .empty-draw {\n width: 240px;\n height: 160px;\n padding: 18px 12px 12px 12px;\n background: var(--emw--color-secondary-variant, #e3f2fd);\n position: relative;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n border-radius: 12px;\n}\n.empty-draw-wrap .empty-draw img {\n position: absolute;\n top: -64%;\n left: 50%;\n transform: translateX(-50%);\n width: 200px;\n}\n.empty-draw-wrap .empty-draw-content {\n display: flex;\n gap: 4px;\n}\n.empty-draw-wrap .empty-draw-text {\n font-size: 14px;\n font-weight: bold;\n line-height: 20px;\n}";
|
|
3284
2908
|
const LotteryOddsbomBombStyle0 = lotteryOddsbomBombCss;
|
|
3285
2909
|
|
|
3286
|
-
const BombIcons
|
|
2910
|
+
const BombIcons = {
|
|
3287
2911
|
[Bomb.Football]: (index.h("svg", { height: "18px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", class: "text-sm" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M19.063 19.072l-.81-.97-.117.083.385-2.43.136-.211 2.23-3.464.037-.057h1.075a9.964 9.964 0 01-2.936 7.049zM4.769 5.112l2.8.877-.072 3.246-2.427 2.95-1.561-.153L2.39 9.26a9.977 9.977 0 012.378-4.148zm7.745-3.086l-.72 1.645-3.798 1.404-2.395-.75A9.953 9.953 0 0112 2c.174 0 .343.017.514.026zm7.346 3.812l-1.128 1.29-3.402-.755-.033-.008-2.446-2.241.057.016.862-1.973a9.996 9.996 0 016.09 3.67zm-1.87 8.894l-3.385-.493-1.358-4.067 2.173-2.755 3.144.698 1.347 3.634-1.921 2.983zm-4.64 5.787l4.304-1.486.62.742a9.945 9.945 0 01-5.878 2.205l.954-1.461zm-6.314-2.84l3.91.873-.001.003 1.509 1.507-1.24 1.898a9.946 9.946 0 01-5.908-2.553l1.73-1.728zm1.16-7.72l4.168.725 1.302 3.9-2.552 2.98-3.97-.885-1.412-3.724L8.196 9.96zM2 12c0-.31.019-.615.047-.92l.485 1.203-.454.907A9.934 9.934 0 012 11.999zM12 1C5.934 1 1 5.935 1 12c0 6.067 4.935 11 11 11 6.066 0 11-4.933 11-11 0-6.065-4.934-11-11-11z", fill: "currentColor" })))
|
|
3288
2912
|
};
|
|
3289
2913
|
const LotteryOddsbomBomb = class {
|
|
@@ -3359,7 +2983,7 @@ const LotteryOddsbomBomb = class {
|
|
|
3359
2983
|
async fetchSingleGameData() {
|
|
3360
2984
|
var _a, _b, _c;
|
|
3361
2985
|
const { endpoint, gameId } = this;
|
|
3362
|
-
const gameInfo = await fetchGameInfo
|
|
2986
|
+
const gameInfo = await fetchGameInfo(endpoint, gameId);
|
|
3363
2987
|
const wagerCloseTime = (_a = gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.currentDraw) === null || _a === void 0 ? void 0 : _a.wagerCloseTime;
|
|
3364
2988
|
const drawId = (_b = gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.currentDraw) === null || _b === void 0 ? void 0 : _b.id;
|
|
3365
2989
|
if (!wagerCloseTime || new Date() >= new Date(wagerCloseTime)) {
|
|
@@ -3368,7 +2992,7 @@ const LotteryOddsbomBomb = class {
|
|
|
3368
2992
|
}
|
|
3369
2993
|
else {
|
|
3370
2994
|
this.isGameAvailable = true;
|
|
3371
|
-
const matchInfo = await fetchTicketMatch
|
|
2995
|
+
const matchInfo = await fetchTicketMatch({ endpoint, gameId: gameInfo.type, drawId });
|
|
3372
2996
|
this.gameList = [
|
|
3373
2997
|
{
|
|
3374
2998
|
drawId,
|
|
@@ -3385,7 +3009,7 @@ const LotteryOddsbomBomb = class {
|
|
|
3385
3009
|
this.bombList = [];
|
|
3386
3010
|
}
|
|
3387
3011
|
async fetchGroupData(params) {
|
|
3388
|
-
this.liveDrawsInfoByGroupId = await fetchData
|
|
3012
|
+
this.liveDrawsInfoByGroupId = await fetchData({
|
|
3389
3013
|
endpoint: this.endpoint,
|
|
3390
3014
|
groupId: this.groupId,
|
|
3391
3015
|
params
|
|
@@ -3417,7 +3041,7 @@ const LotteryOddsbomBomb = class {
|
|
|
3417
3041
|
}
|
|
3418
3042
|
renderEmpty() {
|
|
3419
3043
|
const infoImagePath = index.getAssetPath('../static/empty-info.svg');
|
|
3420
|
-
const message = translate
|
|
3044
|
+
const message = translate('gameNotAvailable', this.language);
|
|
3421
3045
|
return (index.h("div", { class: "empty-draw-wrap" }, index.h("div", { class: "empty-draw" }, index.h("img", { src: infoImagePath, class: "empty-draw-logo" }), index.h("div", { class: "empty-draw-content" }, index.h("div", { class: "empty-draw-text" }, "\u24D8 ", message)))));
|
|
3422
3046
|
}
|
|
3423
3047
|
renderFilter() {
|
|
@@ -3433,7 +3057,7 @@ const LotteryOddsbomBomb = class {
|
|
|
3433
3057
|
return this.renderEmpty();
|
|
3434
3058
|
return (index.h("div", { class: "bomb-grid" }, this.gameList.map(({ title, subTitle, icon, date, turnover, matchList, drawId, gameId }) => (index.h("div", { class: "bomb-card-wrapper" }, index.h("div", { class: "bomb-card", onClick: () => {
|
|
3435
3059
|
this.handleBombItemClick.emit({ drawId, gameId });
|
|
3436
|
-
} }, index.h("div", { class: "card-header" }, BombIcons
|
|
3060
|
+
} }, index.h("div", { class: "card-header" }, BombIcons[icon] && index.h("div", { class: "card-icon football" }, BombIcons[icon]), index.h("div", { class: "card-title" }, index.h("h2", null, title), index.h("p", null, subTitle)), index.h("div", { class: "card-jackpot" })), index.h("div", { class: "card-info" }, index.h("span", { class: "card-tag" }, date), index.h("span", { class: "card-tag" }, translate('turnover', this.language) + turnover)), index.h("div", { class: "card-matches" }, index.h("ol", null, matchList.map((item) => (index.h("li", null, item)))))))))));
|
|
3437
3061
|
}
|
|
3438
3062
|
render() {
|
|
3439
3063
|
return (index.h("div", { key: '4a2641a511f0837649cfedeb4807069ce4051731', ref: (el) => (this.stylingContainer = el), class: "lottery-oddsbom-bomb-wrapper" }, this.renderFilter(), index.h("div", { key: '15f8dbeace39a87f87e4639b8082719023d6bed5', class: "bomb-grid-container" }, this.isLoading ? this.renderLoading() : this.renderMain())));
|
|
@@ -3447,1489 +3071,5 @@ const LotteryOddsbomBomb = class {
|
|
|
3447
3071
|
};
|
|
3448
3072
|
LotteryOddsbomBomb.style = LotteryOddsbomBombStyle0;
|
|
3449
3073
|
|
|
3450
|
-
const lotteryOddsbomBulletCss = ".OddsbomBullet .OddsbomBulletBtn__normal{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:var(--emw--color-background, #fff);border:2px solid var(--emw--color-primary, #0d196e);border-radius:var(--emw--border-radius-medium, 8px);color:var(--emw--color-typography, #000);font-weight:bold;cursor:pointer;transition:transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease, background-color 0.3s;user-select:none;position:relative}.OddsbomBullet .OddsbomBulletBtn__normal:hover{transform:scale(1.15) rotate(-5deg);box-shadow:var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15)) 7px 6px 6px}.OddsbomBullet .OddsbomBulletBtn__normal .OddsbomBullet--deleteIcon{display:none}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover{background-color:var(--emw--color-background, #fff)}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover .OddsbomBullet--text{display:none}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover .OddsbomBullet--deleteIcon{display:inline;fill:var(--emw--color-typography, #000)}.OddsbomBullet .OddsbomBulletBtn__normal.isCallDialogBtn:hover{transform:none;box-shadow:none}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__selected{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff);transform:scale(1.05);box-shadow:0 5px 10px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15))}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__disabled{background-color:var(--emw--color-gray-50, #f5f5f5);border-color:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-gray-150, #6f6f6f);cursor:not-allowed;transform:none;box-shadow:none}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__disabled:hover{transform:none;box-shadow:none}";
|
|
3451
|
-
const LotteryOddsbomBulletStyle0 = lotteryOddsbomBulletCss;
|
|
3452
|
-
|
|
3453
|
-
const DeleteFilledIcon = renderIconDefinitionToSVGElement(DeleteFilled$1, {
|
|
3454
|
-
extraSVGAttrs: { width: '18px', height: '18px', fill: '' }
|
|
3455
|
-
});
|
|
3456
|
-
const LotteryOddsbomBullet = class {
|
|
3457
|
-
constructor(hostRef) {
|
|
3458
|
-
index.registerInstance(this, hostRef);
|
|
3459
|
-
this.oddsbomBulletToggleEvent = index.createEvent(this, "oddsbomBulletToggle", 7);
|
|
3460
|
-
this.oddsbomBulletDeleteEvent = index.createEvent(this, "oddsbomBulletDelete", 7);
|
|
3461
|
-
this.oddsbomBulletAddedByMoreBtnDeleteEvent = index.createEvent(this, "oddsbomBulletAddedByMoreBtnDelete", 7);
|
|
3462
|
-
this.oddsbomBulletCallDialogEvent = index.createEvent(this, "oddsbomBulletCallDialog", 7);
|
|
3463
|
-
this.isSelected = undefined;
|
|
3464
|
-
this.disabled = undefined;
|
|
3465
|
-
this.text = undefined;
|
|
3466
|
-
this.idx = undefined;
|
|
3467
|
-
this.isReading = undefined;
|
|
3468
|
-
this.isDeleteByIcon = undefined;
|
|
3469
|
-
this.isCallDialogBtn = undefined;
|
|
3470
|
-
this.isAddedByMoreBtn = undefined;
|
|
3471
|
-
this.mbSource = undefined;
|
|
3472
|
-
this.clientStyling = undefined;
|
|
3473
|
-
this.clientStylingUrl = undefined;
|
|
3474
|
-
}
|
|
3475
|
-
handleClientStylingChange(newValue, oldValue) {
|
|
3476
|
-
if (newValue != oldValue) {
|
|
3477
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
3478
|
-
}
|
|
3479
|
-
}
|
|
3480
|
-
handleClientStylingUrlChange(newValue, oldValue) {
|
|
3481
|
-
if (newValue != oldValue) {
|
|
3482
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
3483
|
-
}
|
|
3484
|
-
}
|
|
3485
|
-
handleMbSourceChange(newValue, oldValue) {
|
|
3486
|
-
if (newValue != oldValue) {
|
|
3487
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
3488
|
-
}
|
|
3489
|
-
}
|
|
3490
|
-
componentDidLoad() {
|
|
3491
|
-
if (this.stylingContainer) {
|
|
3492
|
-
if (this.mbSource)
|
|
3493
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
3494
|
-
if (this.clientStyling)
|
|
3495
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
3496
|
-
if (this.clientStylingUrl)
|
|
3497
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
3498
|
-
}
|
|
3499
|
-
}
|
|
3500
|
-
disconnectedCallback() {
|
|
3501
|
-
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
3502
|
-
}
|
|
3503
|
-
handleClick() {
|
|
3504
|
-
if (this.isCallDialogBtn) {
|
|
3505
|
-
this.oddsbomBulletCallDialogEvent.emit();
|
|
3506
|
-
return;
|
|
3507
|
-
}
|
|
3508
|
-
if (this.isDeleteByIcon) {
|
|
3509
|
-
if (this.isAddedByMoreBtn) {
|
|
3510
|
-
this.oddsbomBulletAddedByMoreBtnDeleteEvent.emit(this.text);
|
|
3511
|
-
}
|
|
3512
|
-
else {
|
|
3513
|
-
this.oddsbomBulletDeleteEvent.emit(this.idx);
|
|
3514
|
-
}
|
|
3515
|
-
return;
|
|
3516
|
-
}
|
|
3517
|
-
if (!this.disabled) {
|
|
3518
|
-
this.oddsbomBulletToggleEvent.emit(this.idx);
|
|
3519
|
-
}
|
|
3520
|
-
}
|
|
3521
|
-
render() {
|
|
3522
|
-
return (index.h("div", { key: 'e21cf46108e35dcbf7d65e8c6a5f12f5d5ae49cb', class: "OddsbomBullet", ref: (el) => (this.stylingContainer = el) }, index.h("button", { key: '4edf5cd481d8283bd71f6806b6f93949e1308095', class: {
|
|
3523
|
-
OddsbomBulletBtn__normal: true,
|
|
3524
|
-
OddsbomBulletBtn__selected: this.isSelected,
|
|
3525
|
-
OddsbomBulletBtn__disabled: this.disabled,
|
|
3526
|
-
isDeleteByIcon: this.isDeleteByIcon,
|
|
3527
|
-
isCallDialogBtn: this.isCallDialogBtn || this.isReading
|
|
3528
|
-
}, onClick: this.handleClick.bind(this), disabled: this.disabled }, index.h("span", { key: 'fa1aed0293dc004808e6992c069d6992317b0788', class: "OddsbomBullet--deleteIcon", innerHTML: DeleteFilledIcon }), index.h("span", { key: '53ed96f2c2b833d21488049f987b6131718d563e', class: "OddsbomBullet--text" }, this.text))));
|
|
3529
|
-
}
|
|
3530
|
-
static get watchers() { return {
|
|
3531
|
-
"clientStyling": ["handleClientStylingChange"],
|
|
3532
|
-
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
3533
|
-
"mbSource": ["handleMbSourceChange"]
|
|
3534
|
-
}; }
|
|
3535
|
-
};
|
|
3536
|
-
LotteryOddsbomBullet.style = LotteryOddsbomBulletStyle0;
|
|
3537
|
-
|
|
3538
|
-
const generateUUID$1 = () => {
|
|
3539
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
3540
|
-
var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
3541
|
-
return v.toString(16);
|
|
3542
|
-
});
|
|
3543
|
-
};
|
|
3544
|
-
function fetchRequest$2(url, method = 'GET', body = null, headers = {}) {
|
|
3545
|
-
return new Promise((resolve, reject) => {
|
|
3546
|
-
const uuid = generateUUID$1();
|
|
3547
|
-
const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
|
|
3548
|
-
if (method !== 'GET' && method !== 'HEAD') {
|
|
3549
|
-
headersOrigin['X-Idempotency-Key'] = uuid;
|
|
3550
|
-
}
|
|
3551
|
-
const options = {
|
|
3552
|
-
method,
|
|
3553
|
-
headers: headersOrigin,
|
|
3554
|
-
body: null
|
|
3555
|
-
};
|
|
3556
|
-
if (body && method !== 'GET' && method !== 'HEAD') {
|
|
3557
|
-
options.body = JSON.stringify(body);
|
|
3558
|
-
}
|
|
3559
|
-
else {
|
|
3560
|
-
delete options.body;
|
|
3561
|
-
}
|
|
3562
|
-
fetch(url, options)
|
|
3563
|
-
.then((response) => {
|
|
3564
|
-
if (!response.ok) {
|
|
3565
|
-
reject(`HTTP error! Status: ${response.status}`);
|
|
3566
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
3567
|
-
}
|
|
3568
|
-
return response.json();
|
|
3569
|
-
})
|
|
3570
|
-
.then((data) => resolve(data))
|
|
3571
|
-
.catch((error) => reject(error));
|
|
3572
|
-
});
|
|
3573
|
-
}
|
|
3574
|
-
function toQueryParams$1(params) {
|
|
3575
|
-
function isEmptyValueOfArray(arr) {
|
|
3576
|
-
if (arr.length === 0) {
|
|
3577
|
-
return true;
|
|
3578
|
-
}
|
|
3579
|
-
const len = arr.length;
|
|
3580
|
-
let count = 0;
|
|
3581
|
-
for (let i = 0; i < len; i++) {
|
|
3582
|
-
if (isEmptyValue(arr[i])) {
|
|
3583
|
-
count++;
|
|
3584
|
-
}
|
|
3585
|
-
else {
|
|
3586
|
-
return false;
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3589
|
-
if (count === len) {
|
|
3590
|
-
return true;
|
|
3591
|
-
}
|
|
3592
|
-
return false;
|
|
3593
|
-
}
|
|
3594
|
-
function isEmptyValueOfObject(obj) {
|
|
3595
|
-
if (Object.keys(obj).length === 0) {
|
|
3596
|
-
return true;
|
|
3597
|
-
}
|
|
3598
|
-
const len = Object.keys(obj).length;
|
|
3599
|
-
let count = 0;
|
|
3600
|
-
for (const val of Object.values(obj)) {
|
|
3601
|
-
if (isEmptyValue(val)) {
|
|
3602
|
-
count++;
|
|
3603
|
-
}
|
|
3604
|
-
else {
|
|
3605
|
-
return false;
|
|
3606
|
-
}
|
|
3607
|
-
}
|
|
3608
|
-
if (count === len) {
|
|
3609
|
-
return true;
|
|
3610
|
-
}
|
|
3611
|
-
return false;
|
|
3612
|
-
}
|
|
3613
|
-
function isEmptyValue(value, allowZero) {
|
|
3614
|
-
if (value === null || value === undefined || value === '') {
|
|
3615
|
-
return true;
|
|
3616
|
-
}
|
|
3617
|
-
else if (value === 0 && allowZero) {
|
|
3618
|
-
return false;
|
|
3619
|
-
}
|
|
3620
|
-
else if (Array.isArray(value)) {
|
|
3621
|
-
return isEmptyValueOfArray(value);
|
|
3622
|
-
}
|
|
3623
|
-
else if (Object.prototype.toString.call(value) === '[object Object]') {
|
|
3624
|
-
return isEmptyValueOfObject(value);
|
|
3625
|
-
}
|
|
3626
|
-
else {
|
|
3627
|
-
return !value;
|
|
3628
|
-
}
|
|
3629
|
-
}
|
|
3630
|
-
const finalParams = {};
|
|
3631
|
-
Object.entries(params).forEach(([key, value]) => {
|
|
3632
|
-
if (!isEmptyValue(value, true)) {
|
|
3633
|
-
finalParams[key] = value;
|
|
3634
|
-
}
|
|
3635
|
-
});
|
|
3636
|
-
const queryString = Object.entries(finalParams)
|
|
3637
|
-
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
3638
|
-
.join('&');
|
|
3639
|
-
return queryString ? `?${queryString}` : '';
|
|
3640
|
-
}
|
|
3641
|
-
function transformResults(results) {
|
|
3642
|
-
if (results && results.length > 0) {
|
|
3643
|
-
return results.map((i) => i === null || i === void 0 ? void 0 : i[0]);
|
|
3644
|
-
}
|
|
3645
|
-
return [[]];
|
|
3646
|
-
}
|
|
3647
|
-
function thousandSeparator(value) {
|
|
3648
|
-
if (value === 0) {
|
|
3649
|
-
return '0';
|
|
3650
|
-
}
|
|
3651
|
-
if (!value) {
|
|
3652
|
-
return '';
|
|
3653
|
-
}
|
|
3654
|
-
value = value.toString();
|
|
3655
|
-
const parts = value.split('.');
|
|
3656
|
-
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
3657
|
-
return parts.join('.');
|
|
3658
|
-
}
|
|
3659
|
-
function changeCurDrawItemByDate(date, drawList) {
|
|
3660
|
-
var _a, _b, _c;
|
|
3661
|
-
const curDrawItem = drawList.find((i) => i.date === date);
|
|
3662
|
-
if (!curDrawItem) {
|
|
3663
|
-
// NO DATA
|
|
3664
|
-
return Promise.reject();
|
|
3665
|
-
}
|
|
3666
|
-
const curDrawSelectionBettingType = curDrawItem.winningNumbers[0].winningScope;
|
|
3667
|
-
const curDrawSelectionMap = {};
|
|
3668
|
-
curDrawItem.winningNumbers.forEach((item) => {
|
|
3669
|
-
curDrawSelectionMap[item.winningScope] = transformResults(item.poolGameOutcomes);
|
|
3670
|
-
});
|
|
3671
|
-
const results = curDrawSelectionMap[curDrawSelectionBettingType];
|
|
3672
|
-
const curPrizeMap = {};
|
|
3673
|
-
curDrawItem.prizes.forEach((prize) => {
|
|
3674
|
-
const winningScope = prize.winningScope;
|
|
3675
|
-
if (!curPrizeMap[winningScope]) {
|
|
3676
|
-
curPrizeMap[winningScope] = [prize];
|
|
3677
|
-
}
|
|
3678
|
-
else {
|
|
3679
|
-
curPrizeMap[winningScope].push(prize);
|
|
3680
|
-
curPrizeMap[winningScope].sort((a, b) => { var _a; return ((_a = b.totalAmount) === null || _a === void 0 ? void 0 : _a.value) - (a === null || a === void 0 ? void 0 : a.totalAmount.value); });
|
|
3681
|
-
}
|
|
3682
|
-
});
|
|
3683
|
-
const prizes = (((_a = Object.values(curPrizeMap)) === null || _a === void 0 ? void 0 : _a[0]) || []);
|
|
3684
|
-
const currency = ((_c = (_b = prizes[0]) === null || _b === void 0 ? void 0 : _b.totalAmount) === null || _c === void 0 ? void 0 : _c.currency) || '';
|
|
3685
|
-
const { turnOver, winNumber, winTurnOver } = prizes.reduce((pre, cur) => {
|
|
3686
|
-
var _a;
|
|
3687
|
-
const { turnOver: _turnOver, winNumber: _winNumber, winTurnOver: _winTurnOver } = pre;
|
|
3688
|
-
// FIXME: no turnover
|
|
3689
|
-
const turnOver = 0;
|
|
3690
|
-
const winNumber = _winNumber + Number(cur === null || cur === void 0 ? void 0 : cur.players);
|
|
3691
|
-
const winTurnOver = _turnOver + Number((_a = cur === null || cur === void 0 ? void 0 : cur.totalAmount) === null || _a === void 0 ? void 0 : _a.value);
|
|
3692
|
-
return {
|
|
3693
|
-
turnOver,
|
|
3694
|
-
winNumber,
|
|
3695
|
-
winTurnOver
|
|
3696
|
-
};
|
|
3697
|
-
}, {
|
|
3698
|
-
turnOver: 0,
|
|
3699
|
-
winNumber: 0,
|
|
3700
|
-
winTurnOver: 0
|
|
3701
|
-
});
|
|
3702
|
-
return Promise.resolve({
|
|
3703
|
-
date,
|
|
3704
|
-
formattedTurnOver: currency + ' ' + thousandSeparator(turnOver),
|
|
3705
|
-
winNumber,
|
|
3706
|
-
formattedWinTurnOver: currency + ' ' + thousandSeparator(winTurnOver),
|
|
3707
|
-
drawId: curDrawItem.id,
|
|
3708
|
-
results
|
|
3709
|
-
});
|
|
3710
|
-
}
|
|
3711
|
-
function findLatestDateIdx$1(dateArr) {
|
|
3712
|
-
const currentDate = new Date();
|
|
3713
|
-
let closestIndex = 0;
|
|
3714
|
-
let minDiff = Infinity;
|
|
3715
|
-
dateArr.forEach((dateStr, index) => {
|
|
3716
|
-
const date = new Date(dateStr);
|
|
3717
|
-
const diff = Math.abs(differenceInMilliseconds(currentDate, date));
|
|
3718
|
-
if (diff < minDiff) {
|
|
3719
|
-
minDiff = diff;
|
|
3720
|
-
closestIndex = index;
|
|
3721
|
-
}
|
|
3722
|
-
});
|
|
3723
|
-
return closestIndex;
|
|
3724
|
-
}
|
|
3725
|
-
|
|
3726
|
-
async function fetchGameInfo({ endpoint, gameId }) {
|
|
3727
|
-
if (!(endpoint && gameId))
|
|
3728
|
-
return;
|
|
3729
|
-
const gameInfo = await fetchRequest$2(`${endpoint}/games/${gameId}`, 'GET', {});
|
|
3730
|
-
return {
|
|
3731
|
-
vendorGameId: gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.type,
|
|
3732
|
-
gameName: gameInfo.name
|
|
3733
|
-
};
|
|
3734
|
-
}
|
|
3735
|
-
async function fetchDrawsInfo$1({ endpoint, gameId }) {
|
|
3736
|
-
if (!(endpoint && gameId))
|
|
3737
|
-
return;
|
|
3738
|
-
const GAME_DRAW_LIMIT = 9999;
|
|
3739
|
-
const filterData = { status: 'CLOSED', limit: GAME_DRAW_LIMIT };
|
|
3740
|
-
const { items: drawList } = await fetchRequest$2(`${endpoint}/games/${gameId}/draws${toQueryParams$1(filterData)}`);
|
|
3741
|
-
if (!drawList || drawList.length === 0)
|
|
3742
|
-
return {};
|
|
3743
|
-
const settledDrawList = drawList
|
|
3744
|
-
.filter((item) => item.winningNumbers.length > 0)
|
|
3745
|
-
.sort((a, b) => a === null || a === void 0 ? void 0 : a.date.localeCompare(b === null || b === void 0 ? void 0 : b.date));
|
|
3746
|
-
const drawDatesOptions = settledDrawList.map((item) => item.date);
|
|
3747
|
-
return {
|
|
3748
|
-
drawDatesOptions,
|
|
3749
|
-
drawResultsList: settledDrawList
|
|
3750
|
-
};
|
|
3751
|
-
}
|
|
3752
|
-
async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
|
|
3753
|
-
try {
|
|
3754
|
-
const res = await fetchRequest$2(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
|
|
3755
|
-
return res;
|
|
3756
|
-
}
|
|
3757
|
-
catch (error) {
|
|
3758
|
-
return Promise.reject(error);
|
|
3759
|
-
}
|
|
3760
|
-
}
|
|
3761
|
-
|
|
3762
|
-
const DEFAULT_LANGUAGE$1 = 'en';
|
|
3763
|
-
const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
3764
|
-
const TRANSLATIONS$1 = {
|
|
3765
|
-
en: {
|
|
3766
|
-
weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
|
3767
|
-
bettingType: 'Betting Type:',
|
|
3768
|
-
prizeAllocation: 'Prize Allocation (Turnover: €{turnover})',
|
|
3769
|
-
prizes: 'Prizes',
|
|
3770
|
-
numberOfWinners: 'Number of Winners',
|
|
3771
|
-
prizeMoney: 'Prize Money',
|
|
3772
|
-
noLatestResult: 'No latest result.',
|
|
3773
|
-
loading: 'Loading....',
|
|
3774
|
-
turnover: 'Turnover:',
|
|
3775
|
-
winners: 'winners,',
|
|
3776
|
-
prize: 'Prize:',
|
|
3777
|
-
},
|
|
3778
|
-
};
|
|
3779
|
-
const translate$1 = (key, customLang, replacements) => {
|
|
3780
|
-
const lang = customLang;
|
|
3781
|
-
let translation = TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
|
|
3782
|
-
if (replacements) {
|
|
3783
|
-
Object.keys(replacements).forEach((placeholder) => {
|
|
3784
|
-
translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
|
|
3785
|
-
});
|
|
3786
|
-
}
|
|
3787
|
-
return translation;
|
|
3788
|
-
};
|
|
3789
|
-
const getTranslations$1 = (data) => {
|
|
3790
|
-
Object.keys(data).forEach((item) => {
|
|
3791
|
-
for (let key in data[item]) {
|
|
3792
|
-
TRANSLATIONS$1[item][key] = data[item][key];
|
|
3793
|
-
}
|
|
3794
|
-
});
|
|
3795
|
-
};
|
|
3796
|
-
const resolveTranslationUrl$1 = async (translationUrl) => {
|
|
3797
|
-
if (translationUrl) {
|
|
3798
|
-
try {
|
|
3799
|
-
const response = await fetch(translationUrl);
|
|
3800
|
-
if (!response.ok) {
|
|
3801
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
3802
|
-
}
|
|
3803
|
-
const translations = await response.json();
|
|
3804
|
-
getTranslations$1(translations);
|
|
3805
|
-
}
|
|
3806
|
-
catch (error) {
|
|
3807
|
-
console.error('Failed to fetch or parse translations from URL:', error);
|
|
3808
|
-
}
|
|
3809
|
-
}
|
|
3810
|
-
};
|
|
3811
|
-
|
|
3812
|
-
const lotteryOddsbomLatestResultCss = ".lottery-tipping-latest-result{container-type:inline-size;background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.lottery-tipping-latest-result .header-section{display:flex;justify-content:center;align-items:center}.lottery-tipping-latest-result .match-info-section{justify-content:space-between;padding:15px 0px;height:18px}.lottery-tipping-latest-result .match-details,.lottery-tipping-latest-result .prize-details{font-weight:600;display:flex;align-items:center}.lottery-tipping-latest-result .match-details .title-icon{margin-right:8px;display:flex}.lottery-tipping-latest-result .match-details .title-text__extra{margin-left:5px}.lottery-tipping-latest-result .prize-details .winners-count{margin-right:5px}.loading-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:100px}.loading-wrap .dots-container{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-wrap .dot{height:14px;width:14px;margin-right:14px;border-radius:14px;background-color:var(--emw--color-gray-300, #333);animation:pulse 1.5s infinite ease-in-out}.loading-wrap .dot:last-child{margin-right:0}.loading-wrap .dot:nth-child(1){animation-delay:-0.3s}.loading-wrap .dot:nth-child(2){animation-delay:-0.1s}.loading-wrap .dot:nth-child(3){animation-delay:0.1s}@keyframes pulse{0%{transform:scale(0.8);background-color:var(--emw--color-gray-300, #333)}50%{transform:scale(1.2);background-color:var(--emw--color-gray-100, #e6e6e6)}100%{transform:scale(0.8);background-color:var(--emw--color-gray-150, #6f6f6f)}}.latest-result-wrapper{background:var(--emw--color-background, #fff)}.latest-result-wrapper.game-wrapper{border:1px solid var(--emw--color-background-tertiary, #ccc);border-radius:8px;box-shadow:0 2px 4px var(--emw--color-background-tertiary, #ccc);overflow-x:auto;transition:box-shadow 0.3s ease;padding:20px}.latest-result-wrapper.game-wrapper:hover{box-shadow:0 4px 12px var(--emw--color-background-tertiary, #ccc)}.loading-turnOver{display:inline-flex;align-items:center}";
|
|
3813
|
-
const LotteryOddsbomLatestResultStyle0 = lotteryOddsbomLatestResultCss;
|
|
3814
|
-
|
|
3815
|
-
const BombIcons = {
|
|
3816
|
-
['Football']: (index.h("svg", { height: "18px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", class: "text-sm" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M19.063 19.072l-.81-.97-.117.083.385-2.43.136-.211 2.23-3.464.037-.057h1.075a9.964 9.964 0 01-2.936 7.049zM4.769 5.112l2.8.877-.072 3.246-2.427 2.95-1.561-.153L2.39 9.26a9.977 9.977 0 012.378-4.148zm7.745-3.086l-.72 1.645-3.798 1.404-2.395-.75A9.953 9.953 0 0112 2c.174 0 .343.017.514.026zm7.346 3.812l-1.128 1.29-3.402-.755-.033-.008-2.446-2.241.057.016.862-1.973a9.996 9.996 0 016.09 3.67zm-1.87 8.894l-3.385-.493-1.358-4.067 2.173-2.755 3.144.698 1.347 3.634-1.921 2.983zm-4.64 5.787l4.304-1.486.62.742a9.945 9.945 0 01-5.878 2.205l.954-1.461zm-6.314-2.84l3.91.873-.001.003 1.509 1.507-1.24 1.898a9.946 9.946 0 01-5.908-2.553l1.73-1.728zm1.16-7.72l4.168.725 1.302 3.9-2.552 2.98-3.97-.885-1.412-3.724L8.196 9.96zM2 12c0-.31.019-.615.047-.92l.485 1.203-.454.907A9.934 9.934 0 012 11.999zM12 1C5.934 1 1 5.935 1 12c0 6.067 4.935 11 11 11 6.066 0 11-4.933 11-11 0-6.065-4.934-11-11-11z", fill: "currentColor" })))
|
|
3817
|
-
};
|
|
3818
|
-
const LotteryOddsbomLatestResult = class {
|
|
3819
|
-
constructor(hostRef) {
|
|
3820
|
-
index.registerInstance(this, hostRef);
|
|
3821
|
-
this.getGameDrawInfoEvent = index.createEvent(this, "getGameDrawInfo", 7);
|
|
3822
|
-
this.mbSource = undefined;
|
|
3823
|
-
this.clientStyling = undefined;
|
|
3824
|
-
this.clientStylingUrl = undefined;
|
|
3825
|
-
this.translationUrl = '';
|
|
3826
|
-
this.language = 'en';
|
|
3827
|
-
this.endpoint = undefined;
|
|
3828
|
-
this.gameId = undefined;
|
|
3829
|
-
this.curDate = undefined;
|
|
3830
|
-
this.showLoading = true;
|
|
3831
|
-
this.hideWrapperEmpty = false;
|
|
3832
|
-
this.isPassingData = false;
|
|
3833
|
-
this.drawResults = '';
|
|
3834
|
-
this.isEmpty = true;
|
|
3835
|
-
this._curDate = undefined;
|
|
3836
|
-
this.drawResultsList = [];
|
|
3837
|
-
this.curDrawItem = {};
|
|
3838
|
-
this.curTurnOver = 0;
|
|
3839
|
-
this.isLoadingTurnover = false;
|
|
3840
|
-
this.vendorGameId = undefined;
|
|
3841
|
-
this.gameName = undefined;
|
|
3842
|
-
this.isLoading = false;
|
|
3843
|
-
}
|
|
3844
|
-
handleClientStylingChange(newValue, oldValue) {
|
|
3845
|
-
if (newValue != oldValue) {
|
|
3846
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
3847
|
-
}
|
|
3848
|
-
}
|
|
3849
|
-
handleClientStylingUrlChange(newValue, oldValue) {
|
|
3850
|
-
if (newValue != oldValue) {
|
|
3851
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
3852
|
-
}
|
|
3853
|
-
}
|
|
3854
|
-
handleMbSourceChange(newValue, oldValue) {
|
|
3855
|
-
if (newValue != oldValue) {
|
|
3856
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
3857
|
-
}
|
|
3858
|
-
}
|
|
3859
|
-
async handleDateChange(n, o) {
|
|
3860
|
-
if (n !== o) {
|
|
3861
|
-
await this.setCurItem(n);
|
|
3862
|
-
if (this.curDrawItem && this.curDrawItem.drawId) {
|
|
3863
|
-
this.getTurnOver();
|
|
3864
|
-
}
|
|
3865
|
-
}
|
|
3866
|
-
}
|
|
3867
|
-
async handleDrawResultsChange(n, o) {
|
|
3868
|
-
if (n !== o) {
|
|
3869
|
-
await this.setDrawResults();
|
|
3870
|
-
}
|
|
3871
|
-
}
|
|
3872
|
-
async getTurnOver() {
|
|
3873
|
-
var _a, _b;
|
|
3874
|
-
try {
|
|
3875
|
-
this.isLoadingTurnover = true;
|
|
3876
|
-
const res = await fetchSaleStatistics({
|
|
3877
|
-
endpoint: this.endpoint,
|
|
3878
|
-
gameId: this.vendorGameId,
|
|
3879
|
-
drawId: this.curDrawItem.drawId
|
|
3880
|
-
});
|
|
3881
|
-
this.curTurnOver = (_b = (_a = res === null || res === void 0 ? void 0 : res.wagerSegment) === null || _a === void 0 ? void 0 : _a.totalSalesCrossDraw) !== null && _b !== void 0 ? _b : 0;
|
|
3882
|
-
}
|
|
3883
|
-
catch (e) {
|
|
3884
|
-
console.error(e);
|
|
3885
|
-
}
|
|
3886
|
-
finally {
|
|
3887
|
-
this.isLoadingTurnover = false;
|
|
3888
|
-
}
|
|
3889
|
-
}
|
|
3890
|
-
get formattedTurnover() {
|
|
3891
|
-
const turnover = this.curTurnOver;
|
|
3892
|
-
const unit = '€';
|
|
3893
|
-
if (turnover === null || turnover === undefined)
|
|
3894
|
-
return '';
|
|
3895
|
-
return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
|
|
3896
|
-
}
|
|
3897
|
-
async setCurItem(curDate) {
|
|
3898
|
-
var _a;
|
|
3899
|
-
try {
|
|
3900
|
-
if (curDate && ((_a = this.drawResultsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
3901
|
-
this.curDrawItem = await changeCurDrawItemByDate(curDate, this.drawResultsList);
|
|
3902
|
-
this.isEmpty = false;
|
|
3903
|
-
}
|
|
3904
|
-
else {
|
|
3905
|
-
this.isEmpty = true;
|
|
3906
|
-
}
|
|
3907
|
-
}
|
|
3908
|
-
catch (_b) {
|
|
3909
|
-
this.isEmpty = true;
|
|
3910
|
-
}
|
|
3911
|
-
}
|
|
3912
|
-
async setDrawResults() {
|
|
3913
|
-
try {
|
|
3914
|
-
if (this.drawResults) {
|
|
3915
|
-
this.drawResultsList = JSON.parse(this.drawResults);
|
|
3916
|
-
await this.setCurItem(this.curDate);
|
|
3917
|
-
}
|
|
3918
|
-
}
|
|
3919
|
-
catch (err) {
|
|
3920
|
-
console.error(err);
|
|
3921
|
-
}
|
|
3922
|
-
}
|
|
3923
|
-
componentDidLoad() {
|
|
3924
|
-
if (this.stylingContainer) {
|
|
3925
|
-
if (this.mbSource)
|
|
3926
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
3927
|
-
if (this.clientStyling)
|
|
3928
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
3929
|
-
if (this.clientStylingUrl)
|
|
3930
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
3931
|
-
}
|
|
3932
|
-
}
|
|
3933
|
-
disconnectedCallback() {
|
|
3934
|
-
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
3935
|
-
}
|
|
3936
|
-
async getDrawData() {
|
|
3937
|
-
if (this.isPassingData) {
|
|
3938
|
-
this.setDrawResults();
|
|
3939
|
-
}
|
|
3940
|
-
else {
|
|
3941
|
-
this.fetchData();
|
|
3942
|
-
}
|
|
3943
|
-
}
|
|
3944
|
-
async getGameInfo() {
|
|
3945
|
-
return fetchGameInfo({ endpoint: this.endpoint, gameId: this.gameId }).then(({ vendorGameId, gameName }) => {
|
|
3946
|
-
this.vendorGameId = vendorGameId;
|
|
3947
|
-
this.gameName = gameName;
|
|
3948
|
-
});
|
|
3949
|
-
}
|
|
3950
|
-
async componentWillLoad() {
|
|
3951
|
-
resolveTranslationUrl$1(this.translationUrl);
|
|
3952
|
-
await Promise.all([this.getDrawData(), this.getGameInfo()]);
|
|
3953
|
-
if (this.curDrawItem && this.curDrawItem.drawId) {
|
|
3954
|
-
this.getTurnOver();
|
|
3955
|
-
}
|
|
3956
|
-
}
|
|
3957
|
-
async fetchData() {
|
|
3958
|
-
this.isLoading = true;
|
|
3959
|
-
try {
|
|
3960
|
-
const res = await fetchDrawsInfo$1({ endpoint: this.endpoint, gameId: this.gameId });
|
|
3961
|
-
this.getGameDrawInfoEvent.emit({
|
|
3962
|
-
drawDatesOptions: res.drawDatesOptions,
|
|
3963
|
-
gameId: this.gameId
|
|
3964
|
-
});
|
|
3965
|
-
this.drawResultsList = res.drawResultsList;
|
|
3966
|
-
this._curDate = res.drawDatesOptions[findLatestDateIdx$1(res.drawDatesOptions)];
|
|
3967
|
-
await this.setCurItem(this._curDate);
|
|
3968
|
-
}
|
|
3969
|
-
catch (error) {
|
|
3970
|
-
this.getGameDrawInfoEvent.emit({
|
|
3971
|
-
drawDatesOptions: [],
|
|
3972
|
-
gameId: this.gameId
|
|
3973
|
-
});
|
|
3974
|
-
}
|
|
3975
|
-
finally {
|
|
3976
|
-
this.isLoading = false;
|
|
3977
|
-
}
|
|
3978
|
-
}
|
|
3979
|
-
renderLoading() {
|
|
3980
|
-
return (index.h("div", { class: "loading-wrap" }, index.h("section", { class: "dots-container" }, index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }))));
|
|
3981
|
-
}
|
|
3982
|
-
renderEmpty() {
|
|
3983
|
-
return null;
|
|
3984
|
-
}
|
|
3985
|
-
renderMainContent() {
|
|
3986
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3987
|
-
if (!(this.curDate || this._curDate) || this.isEmpty) {
|
|
3988
|
-
return this.renderEmpty();
|
|
3989
|
-
}
|
|
3990
|
-
return (index.h("div", { class: "lottery-tipping-latest-result" }, index.h("div", { class: "header-section match-info-section" }, index.h("div", { class: "match-details" }, index.h("span", { class: "title-icon" }, BombIcons.Football), index.h("span", { class: "title-text" }, this.gameName, ' ', this.isLoadingTurnover ? (index.h("div", { class: "loading-turnOver" }, index.h("ui-skeleton", { structure: "rectangle", width: "100px", height: "16px" }))) : (index.h("span", { class: "title-text__extra" }, "(", translate$1('turnover', this.language) + ' ' + this.formattedTurnover || 0, ")")))), index.h("div", { class: "prize-details" }, index.h("span", { class: "winners-count" }, (((_a = this.curDrawItem) === null || _a === void 0 ? void 0 : _a.winNumber) || 0) + ' ' + translate$1('winners', this.language)), index.h("span", { class: "prize-amount" }, translate$1('prize', this.language) + ' ' + (((_b = this.curDrawItem) === null || _b === void 0 ? void 0 : _b.formattedWinTurnOver) || 0)))), !!(((_c = this.curDrawItem) === null || _c === void 0 ? void 0 : _c.drawId) || (((_d = this.curDrawItem) === null || _d === void 0 ? void 0 : _d.results) || []).length) && (index.h("lottery-oddsbom-ticket-result", { language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, endpoint: this.endpoint, "game-id": this.vendorGameId, "draw-id": (_e = this.curDrawItem) === null || _e === void 0 ? void 0 : _e.drawId, "default-results": JSON.stringify(((_f = this.curDrawItem) === null || _f === void 0 ? void 0 : _f.results) || []), "split-view": false }))));
|
|
3991
|
-
}
|
|
3992
|
-
render() {
|
|
3993
|
-
return (index.h("div", { key: '08c7308433c4d55f4cec1540002a03596155fe98', ref: (el) => (this.stylingContainer = el), class: {
|
|
3994
|
-
'latest-result-wrapper': true,
|
|
3995
|
-
'game-wrapper': !(this.hideWrapperEmpty && this.isEmpty)
|
|
3996
|
-
} }, this.isLoading && this.showLoading ? this.renderLoading() : this.renderMainContent()));
|
|
3997
|
-
}
|
|
3998
|
-
static get watchers() { return {
|
|
3999
|
-
"clientStyling": ["handleClientStylingChange"],
|
|
4000
|
-
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
4001
|
-
"mbSource": ["handleMbSourceChange"],
|
|
4002
|
-
"curDate": ["handleDateChange"],
|
|
4003
|
-
"drawResults": ["handleDrawResultsChange"]
|
|
4004
|
-
}; }
|
|
4005
|
-
};
|
|
4006
|
-
LotteryOddsbomLatestResult.style = LotteryOddsbomLatestResultStyle0;
|
|
4007
|
-
|
|
4008
|
-
var DrawStatusEnum;
|
|
4009
|
-
(function (DrawStatusEnum) {
|
|
4010
|
-
DrawStatusEnum["UPCOMING"] = "UPCOMING";
|
|
4011
|
-
DrawStatusEnum["OPEN"] = "OPEN";
|
|
4012
|
-
DrawStatusEnum["PENDING"] = "PENDING";
|
|
4013
|
-
DrawStatusEnum["ACTIVE"] = "ACTIVE";
|
|
4014
|
-
DrawStatusEnum["DRAWN"] = "DRAWN";
|
|
4015
|
-
DrawStatusEnum["SETTLED"] = "SETTLED";
|
|
4016
|
-
DrawStatusEnum["CLOSED"] = "CLOSED";
|
|
4017
|
-
DrawStatusEnum["PAYABLE"] = "PAYABLE";
|
|
4018
|
-
DrawStatusEnum["CANCELED"] = "CANCELED";
|
|
4019
|
-
})(DrawStatusEnum || (DrawStatusEnum = {}));
|
|
4020
|
-
|
|
4021
|
-
const generateUUID = () => {
|
|
4022
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
4023
|
-
var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
4024
|
-
return v.toString(16);
|
|
4025
|
-
});
|
|
4026
|
-
};
|
|
4027
|
-
function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
|
|
4028
|
-
return new Promise((resolve, reject) => {
|
|
4029
|
-
const uuid = generateUUID();
|
|
4030
|
-
const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
|
|
4031
|
-
if (method !== 'GET' && method !== 'HEAD') {
|
|
4032
|
-
headersOrigin['X-Idempotency-Key'] = uuid;
|
|
4033
|
-
}
|
|
4034
|
-
const options = {
|
|
4035
|
-
method,
|
|
4036
|
-
headers: headersOrigin,
|
|
4037
|
-
body: null
|
|
4038
|
-
};
|
|
4039
|
-
if (body && method !== 'GET' && method !== 'HEAD') {
|
|
4040
|
-
options.body = JSON.stringify(body);
|
|
4041
|
-
}
|
|
4042
|
-
else {
|
|
4043
|
-
delete options.body;
|
|
4044
|
-
}
|
|
4045
|
-
fetch(url, options)
|
|
4046
|
-
.then((response) => {
|
|
4047
|
-
if (!response.ok) {
|
|
4048
|
-
reject(`HTTP error! Status: ${response.status}`);
|
|
4049
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
4050
|
-
}
|
|
4051
|
-
return response.json();
|
|
4052
|
-
})
|
|
4053
|
-
.then((data) => resolve(data))
|
|
4054
|
-
.catch((error) => reject(error));
|
|
4055
|
-
});
|
|
4056
|
-
}
|
|
4057
|
-
function toQueryParams(params) {
|
|
4058
|
-
function isEmptyValueOfArray(arr) {
|
|
4059
|
-
if (arr.length === 0) {
|
|
4060
|
-
return true;
|
|
4061
|
-
}
|
|
4062
|
-
const len = arr.length;
|
|
4063
|
-
let count = 0;
|
|
4064
|
-
for (let i = 0; i < len; i++) {
|
|
4065
|
-
if (isEmptyValue(arr[i])) {
|
|
4066
|
-
count++;
|
|
4067
|
-
}
|
|
4068
|
-
else {
|
|
4069
|
-
return false;
|
|
4070
|
-
}
|
|
4071
|
-
}
|
|
4072
|
-
if (count === len) {
|
|
4073
|
-
return true;
|
|
4074
|
-
}
|
|
4075
|
-
return false;
|
|
4076
|
-
}
|
|
4077
|
-
function isEmptyValueOfObject(obj) {
|
|
4078
|
-
if (Object.keys(obj).length === 0) {
|
|
4079
|
-
return true;
|
|
4080
|
-
}
|
|
4081
|
-
const len = Object.keys(obj).length;
|
|
4082
|
-
let count = 0;
|
|
4083
|
-
for (const val of Object.values(obj)) {
|
|
4084
|
-
if (isEmptyValue(val)) {
|
|
4085
|
-
count++;
|
|
4086
|
-
}
|
|
4087
|
-
else {
|
|
4088
|
-
return false;
|
|
4089
|
-
}
|
|
4090
|
-
}
|
|
4091
|
-
if (count === len) {
|
|
4092
|
-
return true;
|
|
4093
|
-
}
|
|
4094
|
-
return false;
|
|
4095
|
-
}
|
|
4096
|
-
function isEmptyValue(value, allowZero) {
|
|
4097
|
-
if (value === null || value === undefined || value === '') {
|
|
4098
|
-
return true;
|
|
4099
|
-
}
|
|
4100
|
-
else if (value === 0 && allowZero) {
|
|
4101
|
-
return false;
|
|
4102
|
-
}
|
|
4103
|
-
else if (Array.isArray(value)) {
|
|
4104
|
-
return isEmptyValueOfArray(value);
|
|
4105
|
-
}
|
|
4106
|
-
else if (Object.prototype.toString.call(value) === '[object Object]') {
|
|
4107
|
-
return isEmptyValueOfObject(value);
|
|
4108
|
-
}
|
|
4109
|
-
else {
|
|
4110
|
-
return !value;
|
|
4111
|
-
}
|
|
4112
|
-
}
|
|
4113
|
-
const finalParams = {};
|
|
4114
|
-
Object.entries(params).forEach(([key, value]) => {
|
|
4115
|
-
if (!isEmptyValue(value, true)) {
|
|
4116
|
-
finalParams[key] = value;
|
|
4117
|
-
}
|
|
4118
|
-
});
|
|
4119
|
-
const queryString = Object.entries(finalParams)
|
|
4120
|
-
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
4121
|
-
.join('&');
|
|
4122
|
-
return queryString ? `?${queryString}` : '';
|
|
4123
|
-
}
|
|
4124
|
-
function findLatestDateIdx(dateArr) {
|
|
4125
|
-
const currentDate = new Date();
|
|
4126
|
-
let closestIndex = 0;
|
|
4127
|
-
let minDiff = Infinity;
|
|
4128
|
-
dateArr.forEach((dateStr, index) => {
|
|
4129
|
-
const date = new Date(dateStr);
|
|
4130
|
-
const diff = Math.abs(differenceInMilliseconds(currentDate, date));
|
|
4131
|
-
if (diff < minDiff) {
|
|
4132
|
-
minDiff = diff;
|
|
4133
|
-
closestIndex = index;
|
|
4134
|
-
}
|
|
4135
|
-
});
|
|
4136
|
-
return closestIndex;
|
|
4137
|
-
}
|
|
4138
|
-
function getUniqueDatesOptions(preDates = [], dates = []) {
|
|
4139
|
-
const dateSet = new Set();
|
|
4140
|
-
dates.forEach((date) => {
|
|
4141
|
-
if (!dateSet.has(date)) {
|
|
4142
|
-
dateSet.add(date);
|
|
4143
|
-
preDates.push(date);
|
|
4144
|
-
}
|
|
4145
|
-
});
|
|
4146
|
-
return preDates.length ? [...sortDates(preDates)] : [];
|
|
4147
|
-
}
|
|
4148
|
-
function sortDates(dateArray) {
|
|
4149
|
-
return dateArray.slice().sort((a, b) => a.localeCompare(b));
|
|
4150
|
-
}
|
|
4151
|
-
|
|
4152
|
-
async function fetchDrawsInfo({ endpoint, gameId }) {
|
|
4153
|
-
if (!(endpoint && gameId))
|
|
4154
|
-
return;
|
|
4155
|
-
const GAME_DRAW_LIMIT = 9999;
|
|
4156
|
-
const filterData = { status: [DrawStatusEnum.PAYABLE, DrawStatusEnum.CLOSED], limit: GAME_DRAW_LIMIT };
|
|
4157
|
-
const { items: drawList } = await fetchRequest$1(`${endpoint}/games/${gameId}/draws${toQueryParams(filterData)}`);
|
|
4158
|
-
if (!drawList || drawList.length === 0)
|
|
4159
|
-
return {};
|
|
4160
|
-
const settledDrawList = drawList.sort((a, b) => a === null || a === void 0 ? void 0 : a.date.localeCompare(b === null || b === void 0 ? void 0 : b.date));
|
|
4161
|
-
const drawDatesOptions = settledDrawList.map((item) => item.date);
|
|
4162
|
-
return {
|
|
4163
|
-
drawDatesOptions,
|
|
4164
|
-
drawResultsList: settledDrawList
|
|
4165
|
-
};
|
|
4166
|
-
}
|
|
4167
|
-
function fetchData({ endpoint, gameIds }) {
|
|
4168
|
-
if (!(endpoint && gameIds))
|
|
4169
|
-
return;
|
|
4170
|
-
return Promise.allSettled(gameIds.map((gameId) => fetchDrawsInfo({ endpoint, gameId })
|
|
4171
|
-
.then((res) => {
|
|
4172
|
-
return { gameId, drawResultsList: res.drawResultsList, drawDatesOptions: res.drawDatesOptions };
|
|
4173
|
-
})
|
|
4174
|
-
.catch((error) => {
|
|
4175
|
-
console.error(`Failed to fetch data for gameId: ${gameId}`, error);
|
|
4176
|
-
return { gameId, drawResultsList: [], drawDatesOptions: [] };
|
|
4177
|
-
}))).then((results) => {
|
|
4178
|
-
return results.reduce((pre, cur) => {
|
|
4179
|
-
if (cur.status === 'fulfilled') {
|
|
4180
|
-
const { gameId, drawResultsList, drawDatesOptions } = cur.value;
|
|
4181
|
-
pre[gameId] = {
|
|
4182
|
-
drawResultsList,
|
|
4183
|
-
drawDatesOptions
|
|
4184
|
-
};
|
|
4185
|
-
return pre;
|
|
4186
|
-
}
|
|
4187
|
-
}, {});
|
|
4188
|
-
});
|
|
4189
|
-
}
|
|
4190
|
-
|
|
4191
|
-
const lotteryOddsbomLatestResultGroupCss = ".lottery-tipping-latest-result-group{container-type:inline-size;padding:16px;background-color:var(--emw--color-background, #fff);height:100%}.games-container{display:flex;flex-direction:column;gap:24px;max-width:800px;margin:0 auto;margin-top:24px}.loading-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:100px}.loading-wrap .dots-container{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-wrap .dot{height:14px;width:14px;margin-right:14px;border-radius:14px;background-color:var(--emw--color-gray-300, #333);animation:pulse 1.5s infinite ease-in-out}.loading-wrap .dot:last-child{margin-right:0}.loading-wrap .dot:nth-child(1){animation-delay:-0.3s}.loading-wrap .dot:nth-child(2){animation-delay:-0.1s}.loading-wrap .dot:nth-child(3){animation-delay:0.1s}@keyframes pulse{0%{transform:scale(0.8);background-color:var(--emw--color-gray-300, #333)}50%{transform:scale(1.2);background-color:var(--emw--color-gray-100, #e6e6e6)}100%{transform:scale(0.8);background-color:var(--emw--color-gray-150, #6f6f6f)}}";
|
|
4192
|
-
const LotteryOddsbomLatestResultGroupStyle0 = lotteryOddsbomLatestResultGroupCss;
|
|
4193
|
-
|
|
4194
|
-
const LotteryOddsbomLatestResultGroup = class {
|
|
4195
|
-
constructor(hostRef) {
|
|
4196
|
-
index.registerInstance(this, hostRef);
|
|
4197
|
-
this.mbSource = undefined;
|
|
4198
|
-
this.clientStyling = undefined;
|
|
4199
|
-
this.clientStylingUrl = undefined;
|
|
4200
|
-
this.translationUrl = '';
|
|
4201
|
-
this.language = 'en';
|
|
4202
|
-
this.endpoint = undefined;
|
|
4203
|
-
this.sessionId = undefined;
|
|
4204
|
-
this.playerId = '';
|
|
4205
|
-
this.gameIds = undefined;
|
|
4206
|
-
this.gameIdArr = [];
|
|
4207
|
-
this.drawDatesOptions = [];
|
|
4208
|
-
this.curDate = undefined;
|
|
4209
|
-
this.isLoading = false;
|
|
4210
|
-
this.drawResultsObj = {};
|
|
4211
|
-
}
|
|
4212
|
-
handleClientStylingChange(newValue, oldValue) {
|
|
4213
|
-
if (newValue != oldValue) {
|
|
4214
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
4215
|
-
}
|
|
4216
|
-
}
|
|
4217
|
-
handleClientStylingUrlChange(newValue, oldValue) {
|
|
4218
|
-
if (newValue != oldValue) {
|
|
4219
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
4220
|
-
}
|
|
4221
|
-
}
|
|
4222
|
-
handleMbSourceChange(newValue, oldValue) {
|
|
4223
|
-
if (newValue != oldValue) {
|
|
4224
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
4225
|
-
}
|
|
4226
|
-
}
|
|
4227
|
-
handleGameIdStringChange(newValue, oldValue) {
|
|
4228
|
-
var _a;
|
|
4229
|
-
if (newValue != oldValue) {
|
|
4230
|
-
this.gameIdArr = ((_a = this.gameIds) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
|
|
4231
|
-
this.getData();
|
|
4232
|
-
}
|
|
4233
|
-
}
|
|
4234
|
-
componentDidLoad() {
|
|
4235
|
-
var _a;
|
|
4236
|
-
this.gameIdArr = ((_a = this.gameIds) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
|
|
4237
|
-
this.getData();
|
|
4238
|
-
if (this.stylingContainer) {
|
|
4239
|
-
if (this.mbSource)
|
|
4240
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
4241
|
-
if (this.clientStyling)
|
|
4242
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
4243
|
-
if (this.clientStylingUrl)
|
|
4244
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
4245
|
-
}
|
|
4246
|
-
}
|
|
4247
|
-
disconnectedCallback() {
|
|
4248
|
-
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
4249
|
-
}
|
|
4250
|
-
getData() {
|
|
4251
|
-
this.isLoading = true;
|
|
4252
|
-
fetchData({ endpoint: this.endpoint, gameIds: this.gameIdArr })
|
|
4253
|
-
.then((res) => {
|
|
4254
|
-
this.drawResultsObj = res;
|
|
4255
|
-
const dates = Object.values(res)
|
|
4256
|
-
.map((i) => i.drawDatesOptions)
|
|
4257
|
-
.filter(Boolean)
|
|
4258
|
-
.flat();
|
|
4259
|
-
this.drawDatesOptions = getUniqueDatesOptions([], dates);
|
|
4260
|
-
this.curDate = this.drawDatesOptions[findLatestDateIdx(this.drawDatesOptions)];
|
|
4261
|
-
})
|
|
4262
|
-
.finally(() => {
|
|
4263
|
-
this.isLoading = false;
|
|
4264
|
-
});
|
|
4265
|
-
}
|
|
4266
|
-
handleChange(e) {
|
|
4267
|
-
const idx = e.detail;
|
|
4268
|
-
this.curDate = this.drawDatesOptions[idx];
|
|
4269
|
-
}
|
|
4270
|
-
handleNext() {
|
|
4271
|
-
if (this.curDate) {
|
|
4272
|
-
const idx = this.drawDatesOptions.findIndex((v) => v === this.curDate);
|
|
4273
|
-
if (idx < this.drawDatesOptions.length - 1) {
|
|
4274
|
-
this.curDate = this.drawDatesOptions[idx + 1];
|
|
4275
|
-
}
|
|
4276
|
-
}
|
|
4277
|
-
}
|
|
4278
|
-
handlePrev() {
|
|
4279
|
-
if (this.curDate) {
|
|
4280
|
-
const idx = this.drawDatesOptions.findIndex((v) => v === this.curDate);
|
|
4281
|
-
if (idx > 0) {
|
|
4282
|
-
this.curDate = this.drawDatesOptions[idx - 1];
|
|
4283
|
-
}
|
|
4284
|
-
}
|
|
4285
|
-
}
|
|
4286
|
-
renderLoading() {
|
|
4287
|
-
return (index.h("div", { class: "loading-wrap" }, index.h("section", { class: "dots-container" }, index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }))));
|
|
4288
|
-
}
|
|
4289
|
-
renderMainContent() {
|
|
4290
|
-
return (index.h("div", null, this.curDate && (index.h("helper-date-navigator", { language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, date: this.curDate, "default-highlight-dates": JSON.stringify(this.drawDatesOptions || []), onNext: this.handleNext.bind(this), onPrev: this.handlePrev.bind(this), onChangeDate: this.handleChange.bind(this) })), index.h("div", { class: "games-container" }, this.gameIdArr.map((gameId) => {
|
|
4291
|
-
var _a, _b;
|
|
4292
|
-
return (index.h("lottery-oddsbom-latest-result", { endpoint: this.endpoint, "game-id": gameId, "cur-date": this.curDate, drawResults: JSON.stringify((_b = (_a = this.drawResultsObj) === null || _a === void 0 ? void 0 : _a[gameId]) === null || _b === void 0 ? void 0 : _b.drawResultsList), "is-passing-data": true, "show-loading": false, "hide-wrapper-empty": true, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "session-id": this.sessionId, "player-id": this.playerId }));
|
|
4293
|
-
}))));
|
|
4294
|
-
}
|
|
4295
|
-
render() {
|
|
4296
|
-
return (index.h("div", { key: 'e576645b260f4a713cce833aae814ce7edad137e', ref: (el) => (this.stylingContainer = el), class: "lottery-tipping-latest-result-group" }, this.isLoading ? this.renderLoading() : this.renderMainContent()));
|
|
4297
|
-
}
|
|
4298
|
-
static get watchers() { return {
|
|
4299
|
-
"clientStyling": ["handleClientStylingChange"],
|
|
4300
|
-
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
4301
|
-
"mbSource": ["handleMbSourceChange"],
|
|
4302
|
-
"gameIds": ["handleGameIdStringChange"]
|
|
4303
|
-
}; }
|
|
4304
|
-
};
|
|
4305
|
-
LotteryOddsbomLatestResultGroup.style = LotteryOddsbomLatestResultGroupStyle0;
|
|
4306
|
-
|
|
4307
|
-
const formatDate = ({ date, type = 'date', format: format$1 }) => {
|
|
4308
|
-
try {
|
|
4309
|
-
const parsedDate = parseISO(date);
|
|
4310
|
-
if (isNaN(parsedDate.getTime())) {
|
|
4311
|
-
throw new Error(`Invalid date: ${date}`);
|
|
4312
|
-
}
|
|
4313
|
-
if (format$1)
|
|
4314
|
-
return format(parsedDate, format$1);
|
|
4315
|
-
let formatStr = 'dd/MM/yyyy';
|
|
4316
|
-
if (type === 'time') {
|
|
4317
|
-
formatStr = 'dd/MM/yyyy HH:mm:ss';
|
|
4318
|
-
}
|
|
4319
|
-
else if (type === 'week') {
|
|
4320
|
-
formatStr = 'ccc dd/MM/yyyy HH:mm:ss';
|
|
4321
|
-
}
|
|
4322
|
-
return format(parsedDate, formatStr);
|
|
4323
|
-
}
|
|
4324
|
-
catch (error) {
|
|
4325
|
-
console.error('Error formatting date:', error.message);
|
|
4326
|
-
return '';
|
|
4327
|
-
}
|
|
4328
|
-
};
|
|
4329
|
-
function fetchRequest(url, method = 'GET', body = null, headers = {}) {
|
|
4330
|
-
return new Promise((resolve, reject) => {
|
|
4331
|
-
const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
|
|
4332
|
-
const options = {
|
|
4333
|
-
method,
|
|
4334
|
-
headers: headersOrigin,
|
|
4335
|
-
body: null
|
|
4336
|
-
};
|
|
4337
|
-
if (body && method !== 'GET' && method !== 'HEAD') {
|
|
4338
|
-
options.body = JSON.stringify(body);
|
|
4339
|
-
}
|
|
4340
|
-
else {
|
|
4341
|
-
delete options.body;
|
|
4342
|
-
}
|
|
4343
|
-
fetch(url, options)
|
|
4344
|
-
.then((response) => {
|
|
4345
|
-
if (!response.ok) {
|
|
4346
|
-
return response.json().then((errorData) => {
|
|
4347
|
-
const error = {
|
|
4348
|
-
status: response.status,
|
|
4349
|
-
statusText: response.statusText,
|
|
4350
|
-
code: errorData.code || 'UNKNOWN_ERROR',
|
|
4351
|
-
message: errorData.message || 'An unknown error occurred',
|
|
4352
|
-
data: errorData.data || null
|
|
4353
|
-
};
|
|
4354
|
-
reject(error);
|
|
4355
|
-
}, () => reject({
|
|
4356
|
-
status: response.status,
|
|
4357
|
-
statusText: response.statusText,
|
|
4358
|
-
code: 'PARSE_ERROR',
|
|
4359
|
-
message: 'Failed to parse error response'
|
|
4360
|
-
}));
|
|
4361
|
-
}
|
|
4362
|
-
else {
|
|
4363
|
-
return response.json();
|
|
4364
|
-
}
|
|
4365
|
-
})
|
|
4366
|
-
.then((data) => resolve(data), (error) => reject(error));
|
|
4367
|
-
});
|
|
4368
|
-
}
|
|
4369
|
-
|
|
4370
|
-
async function fetchTicketMatch({ endpoint, gameId, drawId }) {
|
|
4371
|
-
try {
|
|
4372
|
-
const res = await fetchRequest(`${endpoint}/poolgames/${gameId}/draws/${drawId}/matchConfig`);
|
|
4373
|
-
return res || [];
|
|
4374
|
-
}
|
|
4375
|
-
catch (e) {
|
|
4376
|
-
console.log(e);
|
|
4377
|
-
}
|
|
4378
|
-
}
|
|
4379
|
-
function getTeamsFromEventName(eventName) {
|
|
4380
|
-
if (!eventName)
|
|
4381
|
-
return '';
|
|
4382
|
-
return eventName.split('vs').map((i) => i.trim());
|
|
4383
|
-
}
|
|
4384
|
-
function resolveSelections(resInMatch) {
|
|
4385
|
-
const mySet1 = new Set();
|
|
4386
|
-
const mySet2 = new Set();
|
|
4387
|
-
for (const resInLine of resInMatch) {
|
|
4388
|
-
const [team1Score, team2Score] = resInLine.split(':');
|
|
4389
|
-
if (!mySet1.has(team1Score))
|
|
4390
|
-
mySet1.add(team1Score);
|
|
4391
|
-
if (!mySet2.has(team2Score))
|
|
4392
|
-
mySet2.add(team2Score);
|
|
4393
|
-
}
|
|
4394
|
-
return [Array.from(mySet1), Array.from(mySet2)];
|
|
4395
|
-
}
|
|
4396
|
-
async function buildTicketBetDataSource({ endpoint, gameId, drawId, results, splitView = false }) {
|
|
4397
|
-
const res = await fetchTicketMatch({ endpoint, gameId, drawId });
|
|
4398
|
-
if (splitView) {
|
|
4399
|
-
return (res.reduce((pre, item, index) => {
|
|
4400
|
-
const [team1Name, team2Name] = getTeamsFromEventName(item.eventName);
|
|
4401
|
-
const [team1Res, team2Res] = resolveSelections(results[index] || []);
|
|
4402
|
-
pre === null || pre === void 0 ? void 0 : pre.push({
|
|
4403
|
-
index: index + 1,
|
|
4404
|
-
teamName: team1Name,
|
|
4405
|
-
startTime: item.startTime,
|
|
4406
|
-
results: team1Res
|
|
4407
|
-
});
|
|
4408
|
-
pre === null || pre === void 0 ? void 0 : pre.push({
|
|
4409
|
-
index: index + 1,
|
|
4410
|
-
teamName: team2Name,
|
|
4411
|
-
startTime: item.startTime,
|
|
4412
|
-
results: team2Res
|
|
4413
|
-
});
|
|
4414
|
-
return pre;
|
|
4415
|
-
}, []) || []);
|
|
4416
|
-
}
|
|
4417
|
-
return res.map((item, index) => ({
|
|
4418
|
-
index: index + 1,
|
|
4419
|
-
eventName: item.eventName,
|
|
4420
|
-
startTime: item.startTime,
|
|
4421
|
-
results: results[index] || []
|
|
4422
|
-
}));
|
|
4423
|
-
}
|
|
4424
|
-
|
|
4425
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
4426
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
4427
|
-
const TRANSLATIONS = {
|
|
4428
|
-
en: {
|
|
4429
|
-
filter: 'Filter',
|
|
4430
|
-
clear: 'Clear',
|
|
4431
|
-
searchByTicketId: 'Search by Ticket ID',
|
|
4432
|
-
enterTicketId: 'Enter Ticket ID',
|
|
4433
|
-
searchByTicketType: 'Search by Ticket Type',
|
|
4434
|
-
selectTicketType: 'Select Ticket Type',
|
|
4435
|
-
searchByDate: 'Search by Date',
|
|
4436
|
-
from: 'From',
|
|
4437
|
-
to: 'To',
|
|
4438
|
-
normal: 'Normal',
|
|
4439
|
-
subscription: 'Subscription',
|
|
4440
|
-
ticketsHistory: 'Tickets History',
|
|
4441
|
-
settled: 'Settled',
|
|
4442
|
-
purchased: 'Purchased',
|
|
4443
|
-
canceled: 'Canceled',
|
|
4444
|
-
noData: 'No data Avaliable.',
|
|
4445
|
-
ticketId: 'Ticket ID:',
|
|
4446
|
-
ticketType: 'Ticket Type:',
|
|
4447
|
-
ticketAmount: 'Ticket Amount:',
|
|
4448
|
-
lineDetail: 'Line Detail:',
|
|
4449
|
-
seeDetails: 'See Details',
|
|
4450
|
-
numberOfDraw: 'Number of Draw:',
|
|
4451
|
-
ticketResult: 'Ticket Result:',
|
|
4452
|
-
drawId: 'Draw ID:',
|
|
4453
|
-
drawDate: 'Draw Date:',
|
|
4454
|
-
result: 'Result:',
|
|
4455
|
-
prize: 'Prize:',
|
|
4456
|
-
bettingType: 'Betting Type:'
|
|
4457
|
-
},
|
|
4458
|
-
ro: {
|
|
4459
|
-
ticketsHistory: 'Istoric bilete',
|
|
4460
|
-
settled: 'Decontat',
|
|
4461
|
-
purchased: 'Achiziționat',
|
|
4462
|
-
canceled: 'Anulat',
|
|
4463
|
-
noData: 'Nu sunt date disponibile.',
|
|
4464
|
-
ticketId: 'ID bilet:',
|
|
4465
|
-
ticketType: 'Tip bilet:',
|
|
4466
|
-
ticketAmount: 'Suma biletului:',
|
|
4467
|
-
lineDetail: 'Detaliu linie:',
|
|
4468
|
-
seeDetails: 'Vezi detalii',
|
|
4469
|
-
numberOfDraw: 'Număr de extrageri:',
|
|
4470
|
-
ticketResult: 'Rezultat bilet:',
|
|
4471
|
-
drawId: 'ID extragere:',
|
|
4472
|
-
drawDate: 'Data extragerii:',
|
|
4473
|
-
result: 'Rezultat:',
|
|
4474
|
-
prize: 'Premiu:',
|
|
4475
|
-
bettingType: 'Tip de pariu:'
|
|
4476
|
-
},
|
|
4477
|
-
fr: {
|
|
4478
|
-
ticketsHistory: 'Historique des billets',
|
|
4479
|
-
settled: 'Réglé',
|
|
4480
|
-
purchased: 'Acheté',
|
|
4481
|
-
canceled: 'Annulé',
|
|
4482
|
-
noData: 'Aucune donnée disponible.',
|
|
4483
|
-
ticketId: 'ID du billet:',
|
|
4484
|
-
ticketType: 'Type de billet:',
|
|
4485
|
-
ticketAmount: 'Montant du billet:',
|
|
4486
|
-
lineDetail: 'Détail de la ligne:',
|
|
4487
|
-
seeDetails: 'Voir les détails',
|
|
4488
|
-
numberOfDraw: 'Nombre de tirages:',
|
|
4489
|
-
ticketResult: 'Résultat du billet:',
|
|
4490
|
-
drawId: 'ID du tirage:',
|
|
4491
|
-
drawDate: 'Date du tirage:',
|
|
4492
|
-
result: 'Résultat:',
|
|
4493
|
-
prize: 'Prix:',
|
|
4494
|
-
bettingType: 'Type de pari:'
|
|
4495
|
-
},
|
|
4496
|
-
ar: {
|
|
4497
|
-
ticketsHistory: 'سجل التذاكر',
|
|
4498
|
-
settled: 'تمت التسوية',
|
|
4499
|
-
purchased: 'تم شراؤها',
|
|
4500
|
-
canceled: 'تم الإلغاء',
|
|
4501
|
-
noData: 'لا توجد بيانات متاحة.',
|
|
4502
|
-
ticketId: 'معرف التذكرة:',
|
|
4503
|
-
ticketType: 'نوع التذكرة:',
|
|
4504
|
-
ticketAmount: 'مبلغ التذكرة:',
|
|
4505
|
-
lineDetail: 'تفاصيل الخط:',
|
|
4506
|
-
seeDetails: 'انظر التفاصيل',
|
|
4507
|
-
numberOfDraw: 'عدد السحوبات:',
|
|
4508
|
-
ticketResult: 'نتيجة التذكرة:',
|
|
4509
|
-
drawId: 'معرف السحب:',
|
|
4510
|
-
drawDate: 'تاريخ السحب:',
|
|
4511
|
-
result: 'النتيجة:',
|
|
4512
|
-
prize: 'الجائزة:',
|
|
4513
|
-
bettingType: 'نوع الرهان:'
|
|
4514
|
-
},
|
|
4515
|
-
hr: {
|
|
4516
|
-
ticketsHistory: 'Povijest listića',
|
|
4517
|
-
settled: 'Riješeno',
|
|
4518
|
-
purchased: 'Kupljeno',
|
|
4519
|
-
canceled: 'Otkazano',
|
|
4520
|
-
noData: 'Nema dostupnih podataka.',
|
|
4521
|
-
ticketId: 'ID listića:',
|
|
4522
|
-
ticketType: 'Vrsta listića:',
|
|
4523
|
-
ticketAmount: 'Iznos listića:',
|
|
4524
|
-
lineDetail: 'Detalji linije:',
|
|
4525
|
-
seeDetails: 'Vidi detalje',
|
|
4526
|
-
numberOfDraw: 'Broj izvlačenja:',
|
|
4527
|
-
ticketResult: 'Rezultat listića:',
|
|
4528
|
-
drawId: 'ID izvlačenja:',
|
|
4529
|
-
drawDate: 'Datum izvlačenja:',
|
|
4530
|
-
result: 'Rezultat:',
|
|
4531
|
-
prize: 'Nagrada:',
|
|
4532
|
-
bettingType: 'Vrsta oklade:'
|
|
4533
|
-
}
|
|
4534
|
-
};
|
|
4535
|
-
const translate = (key, customLang, replacements) => {
|
|
4536
|
-
const lang = customLang;
|
|
4537
|
-
let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
4538
|
-
if (replacements) {
|
|
4539
|
-
Object.keys(replacements).forEach((placeholder) => {
|
|
4540
|
-
translation = translation === null || translation === void 0 ? void 0 : translation.replace(`{${placeholder}}`, replacements[placeholder]);
|
|
4541
|
-
});
|
|
4542
|
-
}
|
|
4543
|
-
return translation;
|
|
4544
|
-
};
|
|
4545
|
-
const getTranslations = (data) => {
|
|
4546
|
-
Object.keys(data).forEach((item) => {
|
|
4547
|
-
for (let key in data[item]) {
|
|
4548
|
-
TRANSLATIONS[item][key] = data[item][key];
|
|
4549
|
-
}
|
|
4550
|
-
});
|
|
4551
|
-
};
|
|
4552
|
-
const resolveTranslationUrl = async (translationUrl) => {
|
|
4553
|
-
if (translationUrl) {
|
|
4554
|
-
try {
|
|
4555
|
-
const response = await fetch(translationUrl);
|
|
4556
|
-
if (!response.ok) {
|
|
4557
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
4558
|
-
}
|
|
4559
|
-
const translations = await response.json();
|
|
4560
|
-
getTranslations(translations);
|
|
4561
|
-
}
|
|
4562
|
-
catch (error) {
|
|
4563
|
-
console.error('Failed to fetch or parse translations from URL:', error);
|
|
4564
|
-
}
|
|
4565
|
-
}
|
|
4566
|
-
};
|
|
4567
|
-
|
|
4568
|
-
const lotteryOddsbomTicketResultCss = ".LotteryTippingTicketBet__container {\n display: block; /* Or inline-block, depending on desired layout flow */\n font-size: 14px;\n line-height: 1.5715;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n overflow: hidden;\n min-width: 300px;\n container-type: inline-size;\n}\n@container (max-width: 375px) {\n .LotteryTippingTicketBet__container {\n font-size: 12px;\n }\n}\n\n.my-table-component {\n width: 100%;\n border-collapse: collapse; /* Important for borders */\n text-align: left;\n border-radius: 0.1rem; /* Ant Design like subtle rounding */\n border-spacing: 0;\n}\n\n/* Header */\n.my-table-component th {\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-weight: 600;\n padding: 0.4rem 0.5rem;\n transition: background 0.3s ease;\n}\n\n/* Cells */\n.my-table-component td {\n padding: 0.4rem 0.5rem;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n transition: background 0.3s;\n}\n@container (max-width: 400px) {\n .my-table-component td {\n padding: 0.3rem 0.3rem;\n }\n}\n\n.my-table-component.bordered th,\n.my-table-component.bordered td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Bordered style */\n.my-table-component.grid th,\n.my-table-component.grid td {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid th {\n border-bottom-width: 1px; /* Ensure bottom border is consistent */\n}\n\n.my-table-component.grid {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6); /* Outer border */\n border-right-width: 0;\n border-bottom-width: 0;\n}\n\n.my-table-component.grid th:last-child,\n.my-table-component.grid td:last-child {\n border-right: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid tr:last-child td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Striped style */\n.my-table-component.striped tbody tr:nth-child(even) td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n/* Hover (optional, but nice) */\n.my-table-component tbody tr:hover td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n.flex {\n display: flex;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.gap-1 {\n gap: 4px;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.align-center {\n align-items: center;\n}\n\n.gap-1 {\n gap: 0.5rem;\n}\n\n.match-info-item {\n display: flex;\n}\n\n.match-info-item-label {\n margin-right: 6px;\n}\n\n.info-icon:hover {\n cursor: pointer;\n}\n\n.LotteryTippingTicketBet__empty p {\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n\n.no-wrap {\n white-space: nowrap;\n overflow: hidden;\n}\n\n.eventNameContainer__item {\n line-height: 1rem;\n}\n.eventNameContainer__item--title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 300px;\n}\n@container (max-width: 600px) {\n .eventNameContainer__item--title {\n max-width: 180px;\n }\n}\n@container (max-width: 500px) {\n .eventNameContainer__item--title {\n max-width: 150px;\n }\n}\n@container (max-width: 400px) {\n .eventNameContainer__item--title {\n max-width: 100px;\n }\n}\n@container (max-width: 330px) {\n .eventNameContainer__item--title {\n max-width: 70px;\n }\n}\n\n.LotteryTippingTicketBet__main {\n perspective: 800px;\n will-change: transform, opacity;\n backface-visibility: hidden;\n}\n\n@container (max-width: 520px) {\n .LotteryTippingTicketBet__main {\n flex-wrap: wrap;\n justify-content: center;\n }\n}\n.loading-wrap {\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100px;\n}\n.loading-wrap .dots-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n.loading-wrap .dot {\n height: 14px;\n width: 14px;\n margin-right: 14px;\n border-radius: 14px;\n background-color: var(--emw--color-gray-300, #333);\n animation: pulse 1.5s infinite ease-in-out;\n}\n.loading-wrap .dot:last-child {\n margin-right: 0;\n}\n.loading-wrap .dot:nth-child(1) {\n animation-delay: -0.3s;\n}\n.loading-wrap .dot:nth-child(2) {\n animation-delay: -0.1s;\n}\n.loading-wrap .dot:nth-child(3) {\n animation-delay: 0.1s;\n}\n@keyframes pulse {\n 0% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-300, #333);\n }\n 50% {\n transform: scale(1.2);\n background-color: var(--emw--color-gray-100, #e6e6e6);\n }\n 100% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-150, #6f6f6f);\n }\n}";
|
|
4569
|
-
const LotteryOddsbomTicketResultStyle0 = lotteryOddsbomTicketResultCss;
|
|
4570
|
-
|
|
4571
|
-
const LotteryOddsbomTicketResult = class {
|
|
4572
|
-
constructor(hostRef) {
|
|
4573
|
-
index.registerInstance(this, hostRef);
|
|
4574
|
-
this.latestRequestId = 0;
|
|
4575
|
-
this.mbSource = undefined;
|
|
4576
|
-
this.clientStyling = undefined;
|
|
4577
|
-
this.clientStylingUrl = undefined;
|
|
4578
|
-
this.translationUrl = '';
|
|
4579
|
-
this.language = 'en';
|
|
4580
|
-
this.sessionId = undefined;
|
|
4581
|
-
this.endpoint = '';
|
|
4582
|
-
this.gameId = undefined;
|
|
4583
|
-
this.drawId = undefined;
|
|
4584
|
-
this.defaultResults = undefined;
|
|
4585
|
-
this.splitView = false;
|
|
4586
|
-
this.allResults = undefined;
|
|
4587
|
-
this.ticketBetDataSource = [];
|
|
4588
|
-
this.isLoading = false;
|
|
4589
|
-
}
|
|
4590
|
-
handleClientStylingChange(newValue, oldValue) {
|
|
4591
|
-
if (newValue !== oldValue) {
|
|
4592
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
4593
|
-
}
|
|
4594
|
-
}
|
|
4595
|
-
handleClientStylingUrlChange(newValue, oldValue) {
|
|
4596
|
-
if (newValue !== oldValue) {
|
|
4597
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
4598
|
-
}
|
|
4599
|
-
}
|
|
4600
|
-
handleMbSourceChange(newValue, oldValue) {
|
|
4601
|
-
if (newValue !== oldValue) {
|
|
4602
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
4603
|
-
}
|
|
4604
|
-
}
|
|
4605
|
-
componentDidLoad() {
|
|
4606
|
-
if (this.stylingContainer) {
|
|
4607
|
-
if (this.mbSource)
|
|
4608
|
-
lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
4609
|
-
if (this.clientStyling)
|
|
4610
|
-
lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
4611
|
-
if (this.clientStylingUrl)
|
|
4612
|
-
lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
4613
|
-
}
|
|
4614
|
-
}
|
|
4615
|
-
disconnectedCallback() {
|
|
4616
|
-
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
4617
|
-
}
|
|
4618
|
-
componentWillLoad() {
|
|
4619
|
-
resolveTranslationUrl(this.translationUrl);
|
|
4620
|
-
this.fetchMatchData();
|
|
4621
|
-
}
|
|
4622
|
-
async fetchMatchData() {
|
|
4623
|
-
const currentId = ++this.latestRequestId;
|
|
4624
|
-
if (!this.gameId || !this.drawId) {
|
|
4625
|
-
return;
|
|
4626
|
-
}
|
|
4627
|
-
try {
|
|
4628
|
-
if (this.defaultResults)
|
|
4629
|
-
this.allResults = JSON.parse(this.defaultResults);
|
|
4630
|
-
this.isLoading = true;
|
|
4631
|
-
const res = await buildTicketBetDataSource({
|
|
4632
|
-
endpoint: this.endpoint,
|
|
4633
|
-
gameId: this.gameId,
|
|
4634
|
-
drawId: this.drawId,
|
|
4635
|
-
results: this.allResults || [[]],
|
|
4636
|
-
splitView: this.splitView
|
|
4637
|
-
});
|
|
4638
|
-
if (currentId === this.latestRequestId) {
|
|
4639
|
-
this.ticketBetDataSource = res;
|
|
4640
|
-
}
|
|
4641
|
-
}
|
|
4642
|
-
finally {
|
|
4643
|
-
if (currentId === this.latestRequestId) {
|
|
4644
|
-
this.isLoading = false;
|
|
4645
|
-
}
|
|
4646
|
-
}
|
|
4647
|
-
}
|
|
4648
|
-
get columns() {
|
|
4649
|
-
const dateRender = (_, value) => formatDate({ date: value, format: 'ccc dd/MM HH:mm' });
|
|
4650
|
-
if (this.splitView) {
|
|
4651
|
-
return [
|
|
4652
|
-
{
|
|
4653
|
-
title: 'No.',
|
|
4654
|
-
value: 'index',
|
|
4655
|
-
width: 5,
|
|
4656
|
-
rowSpan: 2
|
|
4657
|
-
},
|
|
4658
|
-
{
|
|
4659
|
-
title: 'Date',
|
|
4660
|
-
value: 'startTime',
|
|
4661
|
-
width: 25,
|
|
4662
|
-
rowSpan: 2,
|
|
4663
|
-
nowrap: true,
|
|
4664
|
-
render: dateRender
|
|
4665
|
-
},
|
|
4666
|
-
{
|
|
4667
|
-
title: 'Team',
|
|
4668
|
-
value: 'teamName',
|
|
4669
|
-
width: 30
|
|
4670
|
-
},
|
|
4671
|
-
{
|
|
4672
|
-
title: 'Scores',
|
|
4673
|
-
value: 'results',
|
|
4674
|
-
width: 45,
|
|
4675
|
-
render: (_, value) => (index.h("div", { class: "flex gap-1" }, value.map((i) => (index.h("lottery-oddsbom-bullet", { text: i, "is-reading": true, "is-selected": true })))))
|
|
4676
|
-
}
|
|
4677
|
-
];
|
|
4678
|
-
}
|
|
4679
|
-
const eventNameRender = (_, value) => (index.h("div", { class: "flex gap-1 eventNameContainer__item" }, index.h("span", { class: "eventNameContainer__item--title" }, value)));
|
|
4680
|
-
return [
|
|
4681
|
-
{
|
|
4682
|
-
title: 'Match',
|
|
4683
|
-
value: 'eventName',
|
|
4684
|
-
width: 50,
|
|
4685
|
-
render: eventNameRender
|
|
4686
|
-
},
|
|
4687
|
-
{
|
|
4688
|
-
title: 'Date',
|
|
4689
|
-
value: 'startTime',
|
|
4690
|
-
width: 25,
|
|
4691
|
-
nowrap: true,
|
|
4692
|
-
render: dateRender
|
|
4693
|
-
},
|
|
4694
|
-
{
|
|
4695
|
-
title: 'Match Result',
|
|
4696
|
-
value: 'results',
|
|
4697
|
-
width: 25,
|
|
4698
|
-
render: (_, value) => index.h("div", null, value === null || value === void 0 ? void 0 : value[0])
|
|
4699
|
-
}
|
|
4700
|
-
];
|
|
4701
|
-
}
|
|
4702
|
-
renderLoading() {
|
|
4703
|
-
return (index.h("div", { class: "loading-wrap" }, index.h("section", { class: "dots-container" }, index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }))));
|
|
4704
|
-
}
|
|
4705
|
-
renderEmpty() {
|
|
4706
|
-
return (index.h("div", { class: "LotteryTippingTicketBet__empty" }, index.h("p", null, translate('noData', this.language))));
|
|
4707
|
-
}
|
|
4708
|
-
renderTable({ columns, dataSource, hideHead = false, grid = true, bordered = true }) {
|
|
4709
|
-
const skipMap = {};
|
|
4710
|
-
return (index.h("table", { class: { bordered: bordered, grid: grid, 'my-table-component': true } }, !hideHead && (index.h("thead", null, index.h("tr", null, columns.map((column) => {
|
|
4711
|
-
var _a;
|
|
4712
|
-
return (index.h("th", { key: column.value, style: { width: column.width + '%', textAlign: column.align } }, typeof column.title === 'string' ? column.title : (_a = column.title) === null || _a === void 0 ? void 0 : _a.call(column)));
|
|
4713
|
-
})))), index.h("tbody", null, dataSource.map((row, index$1) => (index.h("tr", { key: index$1 }, columns.map((column) => {
|
|
4714
|
-
if (skipMap[column.value] && skipMap[column.value] > 0) {
|
|
4715
|
-
skipMap[column.value]--;
|
|
4716
|
-
return null;
|
|
4717
|
-
}
|
|
4718
|
-
const span = column.rowSpan;
|
|
4719
|
-
if (span && span > 1) {
|
|
4720
|
-
skipMap[column.value] = span - 1;
|
|
4721
|
-
}
|
|
4722
|
-
return (index.h("td", { key: column.value, rowSpan: span, style: { width: column.width + '%', textAlign: column.align }, class: { 'no-wrap': column.nowrap } }, column.render ? column.render(row, row[column.value], index$1) : row[column.value]));
|
|
4723
|
-
})))))));
|
|
4724
|
-
}
|
|
4725
|
-
renderContent() {
|
|
4726
|
-
if (this.isLoading) {
|
|
4727
|
-
return this.renderLoading();
|
|
4728
|
-
}
|
|
4729
|
-
if (!this.ticketBetDataSource || this.ticketBetDataSource.length === 0) {
|
|
4730
|
-
return this.renderEmpty();
|
|
4731
|
-
}
|
|
4732
|
-
return (index.h("div", { class: "flex align-center LotteryTippingTicketBet__main" }, this.renderTable({
|
|
4733
|
-
columns: this.columns,
|
|
4734
|
-
dataSource: this.ticketBetDataSource || [],
|
|
4735
|
-
hideHead: false,
|
|
4736
|
-
grid: false,
|
|
4737
|
-
bordered: false
|
|
4738
|
-
})));
|
|
4739
|
-
}
|
|
4740
|
-
render() {
|
|
4741
|
-
return (index.h("div", { key: '9932926b2958b13636d617cc20a0c77a76a36ebe', ref: (el) => (this.stylingContainer = el), class: "LotteryTippingTicketBet__container" }, this.renderContent()));
|
|
4742
|
-
}
|
|
4743
|
-
static get watchers() { return {
|
|
4744
|
-
"clientStyling": ["handleClientStylingChange"],
|
|
4745
|
-
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
4746
|
-
"mbSource": ["handleMbSourceChange"],
|
|
4747
|
-
"gameId": ["fetchMatchData"],
|
|
4748
|
-
"drawId": ["fetchMatchData"],
|
|
4749
|
-
"defaultResults": ["fetchMatchData"]
|
|
4750
|
-
}; }
|
|
4751
|
-
};
|
|
4752
|
-
LotteryOddsbomTicketResult.style = LotteryOddsbomTicketResultStyle0;
|
|
4753
|
-
|
|
4754
|
-
const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.SkeletonRectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.SkeletonCircle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.SkeletonText{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.SkeletonText:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.SkeletonTitle{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.SkeletonImage{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.SkeletonLogo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
|
|
4755
|
-
const UiSkeletonStyle0 = uiSkeletonCss;
|
|
4756
|
-
|
|
4757
|
-
const UiSkeleton = class {
|
|
4758
|
-
constructor(hostRef) {
|
|
4759
|
-
index.registerInstance(this, hostRef);
|
|
4760
|
-
this.stylingValue = {
|
|
4761
|
-
width: this.handleStylingProps(this.width),
|
|
4762
|
-
height: this.handleStylingProps(this.height),
|
|
4763
|
-
borderRadius: this.handleStylingProps(this.borderRadius),
|
|
4764
|
-
marginBottom: this.handleStylingProps(this.marginBottom),
|
|
4765
|
-
marginTop: this.handleStylingProps(this.marginTop),
|
|
4766
|
-
marginLeft: this.handleStylingProps(this.marginLeft),
|
|
4767
|
-
marginRight: this.handleStylingProps(this.marginRight),
|
|
4768
|
-
size: this.handleStylingProps(this.size),
|
|
4769
|
-
};
|
|
4770
|
-
this.structure = undefined;
|
|
4771
|
-
this.width = 'unset';
|
|
4772
|
-
this.height = 'unset';
|
|
4773
|
-
this.borderRadius = 'unset';
|
|
4774
|
-
this.marginBottom = 'unset';
|
|
4775
|
-
this.marginTop = 'unset';
|
|
4776
|
-
this.marginLeft = 'unset';
|
|
4777
|
-
this.marginRight = 'unset';
|
|
4778
|
-
this.animation = true;
|
|
4779
|
-
this.rows = 0;
|
|
4780
|
-
this.size = '100%';
|
|
4781
|
-
}
|
|
4782
|
-
handleStructureChange(newValue, oldValue) {
|
|
4783
|
-
if (oldValue !== newValue) {
|
|
4784
|
-
this.handleStructure(newValue);
|
|
4785
|
-
}
|
|
4786
|
-
}
|
|
4787
|
-
handleStylingProps(value) {
|
|
4788
|
-
switch (typeof value) {
|
|
4789
|
-
case 'number':
|
|
4790
|
-
return value === 0 ? 0 : `${value}px`;
|
|
4791
|
-
case 'undefined':
|
|
4792
|
-
return 'unset';
|
|
4793
|
-
case 'string':
|
|
4794
|
-
if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
|
|
4795
|
-
value.endsWith('px') ||
|
|
4796
|
-
value.endsWith('%')) {
|
|
4797
|
-
return value;
|
|
4798
|
-
}
|
|
4799
|
-
else {
|
|
4800
|
-
return 'unset';
|
|
4801
|
-
}
|
|
4802
|
-
default:
|
|
4803
|
-
return 'unset';
|
|
4804
|
-
}
|
|
4805
|
-
}
|
|
4806
|
-
handleStructure(structure) {
|
|
4807
|
-
switch (structure) {
|
|
4808
|
-
case 'logo':
|
|
4809
|
-
return this.renderLogo();
|
|
4810
|
-
case 'image':
|
|
4811
|
-
return this.renderImage();
|
|
4812
|
-
case 'title':
|
|
4813
|
-
return this.renderTitle();
|
|
4814
|
-
case 'text':
|
|
4815
|
-
return this.renderText();
|
|
4816
|
-
case 'rectangle':
|
|
4817
|
-
return this.renderRectangle();
|
|
4818
|
-
case 'circle':
|
|
4819
|
-
return this.renderCircle();
|
|
4820
|
-
default:
|
|
4821
|
-
return null;
|
|
4822
|
-
}
|
|
4823
|
-
}
|
|
4824
|
-
renderLogo() {
|
|
4825
|
-
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'SkeletonLogo ' + (this.animation ? 'Skeleton' : '') })));
|
|
4826
|
-
}
|
|
4827
|
-
renderImage() {
|
|
4828
|
-
return index.h("div", { class: 'SkeletonImage ' + (this.animation ? 'Skeleton' : '') });
|
|
4829
|
-
}
|
|
4830
|
-
renderTitle() {
|
|
4831
|
-
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'SkeletonTitle ' + (this.animation ? 'Skeleton' : '') })));
|
|
4832
|
-
}
|
|
4833
|
-
renderText() {
|
|
4834
|
-
return (index.h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index$1) => (index.h("div", { key: index$1, class: 'SkeletonText ' + (this.animation ? 'Skeleton' : '') })))));
|
|
4835
|
-
}
|
|
4836
|
-
renderRectangle() {
|
|
4837
|
-
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'SkeletonRectangle ' + (this.animation ? 'Skeleton' : '') })));
|
|
4838
|
-
}
|
|
4839
|
-
renderCircle() {
|
|
4840
|
-
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'SkeletonCircle ' + (this.animation ? 'Skeleton' : '') })));
|
|
4841
|
-
}
|
|
4842
|
-
render() {
|
|
4843
|
-
let styleBlock = '';
|
|
4844
|
-
switch (this.structure) {
|
|
4845
|
-
case 'logo':
|
|
4846
|
-
styleBlock = `
|
|
4847
|
-
:host {
|
|
4848
|
-
--emw-skeleton-logo-width: ${this.stylingValue.width};
|
|
4849
|
-
--emw-skeleton-logo-height: ${this.stylingValue.height};
|
|
4850
|
-
--emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
|
|
4851
|
-
--emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
|
|
4852
|
-
--emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
|
|
4853
|
-
--emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
|
|
4854
|
-
--emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
|
|
4855
|
-
}
|
|
4856
|
-
`;
|
|
4857
|
-
break;
|
|
4858
|
-
case 'image':
|
|
4859
|
-
styleBlock = `
|
|
4860
|
-
:host {
|
|
4861
|
-
--emw-skeleton-image-width: ${this.stylingValue.width};
|
|
4862
|
-
--emw-skeleton-image-height: ${this.stylingValue.height};
|
|
4863
|
-
--emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
|
|
4864
|
-
--emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
|
|
4865
|
-
--emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
|
|
4866
|
-
--emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
|
|
4867
|
-
--emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
|
|
4868
|
-
}
|
|
4869
|
-
`;
|
|
4870
|
-
break;
|
|
4871
|
-
case 'title':
|
|
4872
|
-
styleBlock = `
|
|
4873
|
-
:host {
|
|
4874
|
-
--emw-skeleton-title-width: ${this.stylingValue.width};
|
|
4875
|
-
--emw-skeleton-title-height: ${this.stylingValue.height};
|
|
4876
|
-
--emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
|
|
4877
|
-
--emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
|
|
4878
|
-
--emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
|
|
4879
|
-
--emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
|
|
4880
|
-
--emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
|
|
4881
|
-
}
|
|
4882
|
-
`;
|
|
4883
|
-
break;
|
|
4884
|
-
case 'text':
|
|
4885
|
-
styleBlock = `
|
|
4886
|
-
:host {
|
|
4887
|
-
--emw-skeleton-text-width: ${this.stylingValue.width};
|
|
4888
|
-
--emw-skeleton-text-height: ${this.stylingValue.height};
|
|
4889
|
-
--emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
|
|
4890
|
-
--emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
|
|
4891
|
-
--emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
|
|
4892
|
-
--emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
|
|
4893
|
-
--emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
|
|
4894
|
-
}
|
|
4895
|
-
`;
|
|
4896
|
-
break;
|
|
4897
|
-
case 'rectangle':
|
|
4898
|
-
styleBlock = `
|
|
4899
|
-
:host {
|
|
4900
|
-
--emw-skeleton-rectangle-width: ${this.stylingValue.width};
|
|
4901
|
-
--emw-skeleton-rectangle-height: ${this.stylingValue.height};
|
|
4902
|
-
--emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
|
|
4903
|
-
--emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
|
|
4904
|
-
--emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
|
|
4905
|
-
--emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
|
|
4906
|
-
--emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
|
|
4907
|
-
}
|
|
4908
|
-
`;
|
|
4909
|
-
break;
|
|
4910
|
-
case 'circle':
|
|
4911
|
-
styleBlock = `
|
|
4912
|
-
:host {
|
|
4913
|
-
--emw-skeleton-circle-size: ${this.stylingValue.size};
|
|
4914
|
-
}
|
|
4915
|
-
`;
|
|
4916
|
-
break;
|
|
4917
|
-
default:
|
|
4918
|
-
styleBlock = '';
|
|
4919
|
-
}
|
|
4920
|
-
return (index.h(index.Host, { key: 'c2a2650acd416962a2bc4e1a7ee18bc6d8e2def8' }, index.h("style", { key: '9bd7fc1f9e9ed9f17735a7b72fce6f09696f5e19' }, styleBlock), this.handleStructure(this.structure)));
|
|
4921
|
-
}
|
|
4922
|
-
static get watchers() { return {
|
|
4923
|
-
"structure": ["handleStructureChange"]
|
|
4924
|
-
}; }
|
|
4925
|
-
};
|
|
4926
|
-
UiSkeleton.style = UiSkeletonStyle0;
|
|
4927
|
-
|
|
4928
3074
|
exports.lottery_oddsbom_entrance = lotteryOddsbomEntrance.LotteryOddsbomEntrance;
|
|
4929
|
-
exports.helper_date_navigator = HelperDateNavigator;
|
|
4930
3075
|
exports.lottery_oddsbom_bomb = LotteryOddsbomBomb;
|
|
4931
|
-
exports.lottery_oddsbom_bullet = LotteryOddsbomBullet;
|
|
4932
|
-
exports.lottery_oddsbom_latest_result = LotteryOddsbomLatestResult;
|
|
4933
|
-
exports.lottery_oddsbom_latest_result_group = LotteryOddsbomLatestResultGroup;
|
|
4934
|
-
exports.lottery_oddsbom_ticket_result = LotteryOddsbomTicketResult;
|
|
4935
|
-
exports.ui_skeleton = UiSkeleton;
|