@everymatrix/lottery-game-page 1.87.28 → 1.87.29
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/general-multi-select_16.cjs.entry.js +466 -69
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/lottery-game-page.cjs.js +1 -1
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +50 -68
- package/dist/collection/models/index.js +10 -0
- package/dist/collection/utils/api.js +33 -0
- package/dist/collection/utils/locale.utils.js +7 -5
- package/dist/collection/utils/utils.js +26 -0
- package/dist/esm/general-multi-select_16.entry.js +466 -69
- package/dist/esm/loader.js +1 -1
- package/dist/esm/lottery-game-page.js +1 -1
- package/dist/lottery-game-page/general-multi-select_16.entry.js +25 -25
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +17 -5
- package/dist/types/components.d.ts +9 -0
- package/dist/types/models/index.d.ts +106 -0
- package/dist/types/utils/api.d.ts +6 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/package.json +1 -1
|
@@ -7253,6 +7253,35 @@ function getTimezoneOffsetInMilliseconds(date) {
|
|
|
7253
7253
|
return date.getTime() - utcDate.getTime();
|
|
7254
7254
|
}
|
|
7255
7255
|
|
|
7256
|
+
/**
|
|
7257
|
+
* Days in 1 week.
|
|
7258
|
+
*
|
|
7259
|
+
* @name daysInWeek
|
|
7260
|
+
* @constant
|
|
7261
|
+
* @type {number}
|
|
7262
|
+
* @default
|
|
7263
|
+
*/
|
|
7264
|
+
|
|
7265
|
+
/**
|
|
7266
|
+
* Milliseconds in 1 minute
|
|
7267
|
+
*
|
|
7268
|
+
* @name millisecondsInMinute
|
|
7269
|
+
* @constant
|
|
7270
|
+
* @type {number}
|
|
7271
|
+
* @default
|
|
7272
|
+
*/
|
|
7273
|
+
var millisecondsInMinute = 60000;
|
|
7274
|
+
|
|
7275
|
+
/**
|
|
7276
|
+
* Milliseconds in 1 hour
|
|
7277
|
+
*
|
|
7278
|
+
* @name millisecondsInHour
|
|
7279
|
+
* @constant
|
|
7280
|
+
* @type {number}
|
|
7281
|
+
* @default
|
|
7282
|
+
*/
|
|
7283
|
+
var millisecondsInHour = 3600000;
|
|
7284
|
+
|
|
7256
7285
|
/**
|
|
7257
7286
|
* @name isDate
|
|
7258
7287
|
* @category Common Helpers
|
|
@@ -7330,6 +7359,77 @@ function isValid(dirtyDate) {
|
|
|
7330
7359
|
return !isNaN(Number(date));
|
|
7331
7360
|
}
|
|
7332
7361
|
|
|
7362
|
+
/**
|
|
7363
|
+
* @name differenceInMilliseconds
|
|
7364
|
+
* @category Millisecond Helpers
|
|
7365
|
+
* @summary Get the number of milliseconds between the given dates.
|
|
7366
|
+
*
|
|
7367
|
+
* @description
|
|
7368
|
+
* Get the number of milliseconds between the given dates.
|
|
7369
|
+
*
|
|
7370
|
+
* @param {Date|Number} dateLeft - the later date
|
|
7371
|
+
* @param {Date|Number} dateRight - the earlier date
|
|
7372
|
+
* @returns {Number} the number of milliseconds
|
|
7373
|
+
* @throws {TypeError} 2 arguments required
|
|
7374
|
+
*
|
|
7375
|
+
* @example
|
|
7376
|
+
* // How many milliseconds are between
|
|
7377
|
+
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
|
7378
|
+
* const result = differenceInMilliseconds(
|
|
7379
|
+
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
|
7380
|
+
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
|
7381
|
+
* )
|
|
7382
|
+
* //=> 1100
|
|
7383
|
+
*/
|
|
7384
|
+
function differenceInMilliseconds(dateLeft, dateRight) {
|
|
7385
|
+
requiredArgs(2, arguments);
|
|
7386
|
+
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
|
|
7387
|
+
}
|
|
7388
|
+
|
|
7389
|
+
var roundingMap = {
|
|
7390
|
+
ceil: Math.ceil,
|
|
7391
|
+
round: Math.round,
|
|
7392
|
+
floor: Math.floor,
|
|
7393
|
+
trunc: function trunc(value) {
|
|
7394
|
+
return value < 0 ? Math.ceil(value) : Math.floor(value);
|
|
7395
|
+
} // Math.trunc is not supported by IE
|
|
7396
|
+
};
|
|
7397
|
+
|
|
7398
|
+
var defaultRoundingMethod = 'trunc';
|
|
7399
|
+
function getRoundingMethod(method) {
|
|
7400
|
+
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
|
|
7401
|
+
}
|
|
7402
|
+
|
|
7403
|
+
/**
|
|
7404
|
+
* @name differenceInSeconds
|
|
7405
|
+
* @category Second Helpers
|
|
7406
|
+
* @summary Get the number of seconds between the given dates.
|
|
7407
|
+
*
|
|
7408
|
+
* @description
|
|
7409
|
+
* Get the number of seconds between the given dates.
|
|
7410
|
+
*
|
|
7411
|
+
* @param {Date|Number} dateLeft - the later date
|
|
7412
|
+
* @param {Date|Number} dateRight - the earlier date
|
|
7413
|
+
* @param {Object} [options] - an object with options.
|
|
7414
|
+
* @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
|
|
7415
|
+
* @returns {Number} the number of seconds
|
|
7416
|
+
* @throws {TypeError} 2 arguments required
|
|
7417
|
+
*
|
|
7418
|
+
* @example
|
|
7419
|
+
* // How many seconds are between
|
|
7420
|
+
* // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?
|
|
7421
|
+
* const result = differenceInSeconds(
|
|
7422
|
+
* new Date(2014, 6, 2, 12, 30, 20, 0),
|
|
7423
|
+
* new Date(2014, 6, 2, 12, 30, 7, 999)
|
|
7424
|
+
* )
|
|
7425
|
+
* //=> 12
|
|
7426
|
+
*/
|
|
7427
|
+
function differenceInSeconds(dateLeft, dateRight, options) {
|
|
7428
|
+
requiredArgs(2, arguments);
|
|
7429
|
+
var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;
|
|
7430
|
+
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
|
|
7431
|
+
}
|
|
7432
|
+
|
|
7333
7433
|
/**
|
|
7334
7434
|
* @name subMilliseconds
|
|
7335
7435
|
* @category Millisecond Helpers
|
|
@@ -9324,6 +9424,257 @@ function cleanEscapedString(input) {
|
|
|
9324
9424
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
9325
9425
|
}
|
|
9326
9426
|
|
|
9427
|
+
/**
|
|
9428
|
+
* @name isBefore
|
|
9429
|
+
* @category Common Helpers
|
|
9430
|
+
* @summary Is the first date before the second one?
|
|
9431
|
+
*
|
|
9432
|
+
* @description
|
|
9433
|
+
* Is the first date before the second one?
|
|
9434
|
+
*
|
|
9435
|
+
* @param {Date|Number} date - the date that should be before the other one to return true
|
|
9436
|
+
* @param {Date|Number} dateToCompare - the date to compare with
|
|
9437
|
+
* @returns {Boolean} the first date is before the second date
|
|
9438
|
+
* @throws {TypeError} 2 arguments required
|
|
9439
|
+
*
|
|
9440
|
+
* @example
|
|
9441
|
+
* // Is 10 July 1989 before 11 February 1987?
|
|
9442
|
+
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
9443
|
+
* //=> false
|
|
9444
|
+
*/
|
|
9445
|
+
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
9446
|
+
requiredArgs(2, arguments);
|
|
9447
|
+
var date = toDate(dirtyDate);
|
|
9448
|
+
var dateToCompare = toDate(dirtyDateToCompare);
|
|
9449
|
+
return date.getTime() < dateToCompare.getTime();
|
|
9450
|
+
}
|
|
9451
|
+
|
|
9452
|
+
/**
|
|
9453
|
+
* @name parseISO
|
|
9454
|
+
* @category Common Helpers
|
|
9455
|
+
* @summary Parse ISO string
|
|
9456
|
+
*
|
|
9457
|
+
* @description
|
|
9458
|
+
* Parse the given string in ISO 8601 format and return an instance of Date.
|
|
9459
|
+
*
|
|
9460
|
+
* Function accepts complete ISO 8601 formats as well as partial implementations.
|
|
9461
|
+
* ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
|
|
9462
|
+
*
|
|
9463
|
+
* If the argument isn't a string, the function cannot parse the string or
|
|
9464
|
+
* the values are invalid, it returns Invalid Date.
|
|
9465
|
+
*
|
|
9466
|
+
* @param {String} argument - the value to convert
|
|
9467
|
+
* @param {Object} [options] - an object with options.
|
|
9468
|
+
* @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format
|
|
9469
|
+
* @returns {Date} the parsed date in the local time zone
|
|
9470
|
+
* @throws {TypeError} 1 argument required
|
|
9471
|
+
* @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
|
|
9472
|
+
*
|
|
9473
|
+
* @example
|
|
9474
|
+
* // Convert string '2014-02-11T11:30:30' to date:
|
|
9475
|
+
* const result = parseISO('2014-02-11T11:30:30')
|
|
9476
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
9477
|
+
*
|
|
9478
|
+
* @example
|
|
9479
|
+
* // Convert string '+02014101' to date,
|
|
9480
|
+
* // if the additional number of digits in the extended year format is 1:
|
|
9481
|
+
* const result = parseISO('+02014101', { additionalDigits: 1 })
|
|
9482
|
+
* //=> Fri Apr 11 2014 00:00:00
|
|
9483
|
+
*/
|
|
9484
|
+
function parseISO(argument, options) {
|
|
9485
|
+
var _options$additionalDi;
|
|
9486
|
+
requiredArgs(1, arguments);
|
|
9487
|
+
var additionalDigits = toInteger((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
|
|
9488
|
+
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
9489
|
+
throw new RangeError('additionalDigits must be 0, 1 or 2');
|
|
9490
|
+
}
|
|
9491
|
+
if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {
|
|
9492
|
+
return new Date(NaN);
|
|
9493
|
+
}
|
|
9494
|
+
var dateStrings = splitDateString(argument);
|
|
9495
|
+
var date;
|
|
9496
|
+
if (dateStrings.date) {
|
|
9497
|
+
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
9498
|
+
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
|
9499
|
+
}
|
|
9500
|
+
if (!date || isNaN(date.getTime())) {
|
|
9501
|
+
return new Date(NaN);
|
|
9502
|
+
}
|
|
9503
|
+
var timestamp = date.getTime();
|
|
9504
|
+
var time = 0;
|
|
9505
|
+
var offset;
|
|
9506
|
+
if (dateStrings.time) {
|
|
9507
|
+
time = parseTime(dateStrings.time);
|
|
9508
|
+
if (isNaN(time)) {
|
|
9509
|
+
return new Date(NaN);
|
|
9510
|
+
}
|
|
9511
|
+
}
|
|
9512
|
+
if (dateStrings.timezone) {
|
|
9513
|
+
offset = parseTimezone(dateStrings.timezone);
|
|
9514
|
+
if (isNaN(offset)) {
|
|
9515
|
+
return new Date(NaN);
|
|
9516
|
+
}
|
|
9517
|
+
} else {
|
|
9518
|
+
var dirtyDate = new Date(timestamp + time);
|
|
9519
|
+
// js parsed string assuming it's in UTC timezone
|
|
9520
|
+
// but we need it to be parsed in our timezone
|
|
9521
|
+
// so we use utc values to build date in our timezone.
|
|
9522
|
+
// Year values from 0 to 99 map to the years 1900 to 1999
|
|
9523
|
+
// so set year explicitly with setFullYear.
|
|
9524
|
+
var result = new Date(0);
|
|
9525
|
+
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
|
|
9526
|
+
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
|
|
9527
|
+
return result;
|
|
9528
|
+
}
|
|
9529
|
+
return new Date(timestamp + time + offset);
|
|
9530
|
+
}
|
|
9531
|
+
var patterns = {
|
|
9532
|
+
dateTimeDelimiter: /[T ]/,
|
|
9533
|
+
timeZoneDelimiter: /[Z ]/i,
|
|
9534
|
+
timezone: /([Z+-].*)$/
|
|
9535
|
+
};
|
|
9536
|
+
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
9537
|
+
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
9538
|
+
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
9539
|
+
function splitDateString(dateString) {
|
|
9540
|
+
var dateStrings = {};
|
|
9541
|
+
var array = dateString.split(patterns.dateTimeDelimiter);
|
|
9542
|
+
var timeString;
|
|
9543
|
+
|
|
9544
|
+
// The regex match should only return at maximum two array elements.
|
|
9545
|
+
// [date], [time], or [date, time].
|
|
9546
|
+
if (array.length > 2) {
|
|
9547
|
+
return dateStrings;
|
|
9548
|
+
}
|
|
9549
|
+
if (/:/.test(array[0])) {
|
|
9550
|
+
timeString = array[0];
|
|
9551
|
+
} else {
|
|
9552
|
+
dateStrings.date = array[0];
|
|
9553
|
+
timeString = array[1];
|
|
9554
|
+
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
|
9555
|
+
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
|
9556
|
+
timeString = dateString.substr(dateStrings.date.length, dateString.length);
|
|
9557
|
+
}
|
|
9558
|
+
}
|
|
9559
|
+
if (timeString) {
|
|
9560
|
+
var token = patterns.timezone.exec(timeString);
|
|
9561
|
+
if (token) {
|
|
9562
|
+
dateStrings.time = timeString.replace(token[1], '');
|
|
9563
|
+
dateStrings.timezone = token[1];
|
|
9564
|
+
} else {
|
|
9565
|
+
dateStrings.time = timeString;
|
|
9566
|
+
}
|
|
9567
|
+
}
|
|
9568
|
+
return dateStrings;
|
|
9569
|
+
}
|
|
9570
|
+
function parseYear(dateString, additionalDigits) {
|
|
9571
|
+
var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)');
|
|
9572
|
+
var captures = dateString.match(regex);
|
|
9573
|
+
// Invalid ISO-formatted year
|
|
9574
|
+
if (!captures) return {
|
|
9575
|
+
year: NaN,
|
|
9576
|
+
restDateString: ''
|
|
9577
|
+
};
|
|
9578
|
+
var year = captures[1] ? parseInt(captures[1]) : null;
|
|
9579
|
+
var century = captures[2] ? parseInt(captures[2]) : null;
|
|
9580
|
+
|
|
9581
|
+
// either year or century is null, not both
|
|
9582
|
+
return {
|
|
9583
|
+
year: century === null ? year : century * 100,
|
|
9584
|
+
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
|
9585
|
+
};
|
|
9586
|
+
}
|
|
9587
|
+
function parseDate(dateString, year) {
|
|
9588
|
+
// Invalid ISO-formatted year
|
|
9589
|
+
if (year === null) return new Date(NaN);
|
|
9590
|
+
var captures = dateString.match(dateRegex);
|
|
9591
|
+
// Invalid ISO-formatted string
|
|
9592
|
+
if (!captures) return new Date(NaN);
|
|
9593
|
+
var isWeekDate = !!captures[4];
|
|
9594
|
+
var dayOfYear = parseDateUnit(captures[1]);
|
|
9595
|
+
var month = parseDateUnit(captures[2]) - 1;
|
|
9596
|
+
var day = parseDateUnit(captures[3]);
|
|
9597
|
+
var week = parseDateUnit(captures[4]);
|
|
9598
|
+
var dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
9599
|
+
if (isWeekDate) {
|
|
9600
|
+
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
9601
|
+
return new Date(NaN);
|
|
9602
|
+
}
|
|
9603
|
+
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
9604
|
+
} else {
|
|
9605
|
+
var date = new Date(0);
|
|
9606
|
+
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
|
|
9607
|
+
return new Date(NaN);
|
|
9608
|
+
}
|
|
9609
|
+
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
9610
|
+
return date;
|
|
9611
|
+
}
|
|
9612
|
+
}
|
|
9613
|
+
function parseDateUnit(value) {
|
|
9614
|
+
return value ? parseInt(value) : 1;
|
|
9615
|
+
}
|
|
9616
|
+
function parseTime(timeString) {
|
|
9617
|
+
var captures = timeString.match(timeRegex);
|
|
9618
|
+
if (!captures) return NaN; // Invalid ISO-formatted time
|
|
9619
|
+
|
|
9620
|
+
var hours = parseTimeUnit(captures[1]);
|
|
9621
|
+
var minutes = parseTimeUnit(captures[2]);
|
|
9622
|
+
var seconds = parseTimeUnit(captures[3]);
|
|
9623
|
+
if (!validateTime(hours, minutes, seconds)) {
|
|
9624
|
+
return NaN;
|
|
9625
|
+
}
|
|
9626
|
+
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;
|
|
9627
|
+
}
|
|
9628
|
+
function parseTimeUnit(value) {
|
|
9629
|
+
return value && parseFloat(value.replace(',', '.')) || 0;
|
|
9630
|
+
}
|
|
9631
|
+
function parseTimezone(timezoneString) {
|
|
9632
|
+
if (timezoneString === 'Z') return 0;
|
|
9633
|
+
var captures = timezoneString.match(timezoneRegex);
|
|
9634
|
+
if (!captures) return 0;
|
|
9635
|
+
var sign = captures[1] === '+' ? -1 : 1;
|
|
9636
|
+
var hours = parseInt(captures[2]);
|
|
9637
|
+
var minutes = captures[3] && parseInt(captures[3]) || 0;
|
|
9638
|
+
if (!validateTimezone(hours, minutes)) {
|
|
9639
|
+
return NaN;
|
|
9640
|
+
}
|
|
9641
|
+
return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
|
|
9642
|
+
}
|
|
9643
|
+
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
9644
|
+
var date = new Date(0);
|
|
9645
|
+
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
9646
|
+
var fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
9647
|
+
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
9648
|
+
date.setUTCDate(date.getUTCDate() + diff);
|
|
9649
|
+
return date;
|
|
9650
|
+
}
|
|
9651
|
+
|
|
9652
|
+
// Validation functions
|
|
9653
|
+
|
|
9654
|
+
// February is null to handle the leap year (using ||)
|
|
9655
|
+
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
9656
|
+
function isLeapYearIndex(year) {
|
|
9657
|
+
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
9658
|
+
}
|
|
9659
|
+
function validateDate(year, month, date) {
|
|
9660
|
+
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
|
|
9661
|
+
}
|
|
9662
|
+
function validateDayOfYearDate(year, dayOfYear) {
|
|
9663
|
+
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
|
9664
|
+
}
|
|
9665
|
+
function validateWeekDate(_year, week, day) {
|
|
9666
|
+
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
9667
|
+
}
|
|
9668
|
+
function validateTime(hours, minutes, seconds) {
|
|
9669
|
+
if (hours === 24) {
|
|
9670
|
+
return minutes === 0 && seconds === 0;
|
|
9671
|
+
}
|
|
9672
|
+
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
|
9673
|
+
}
|
|
9674
|
+
function validateTimezone(_hours, minutes) {
|
|
9675
|
+
return minutes >= 0 && minutes <= 59;
|
|
9676
|
+
}
|
|
9677
|
+
|
|
9327
9678
|
const helperFiltersCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.FilterButtonsWrapper{display:flex;justify-content:flex-end;gap:5px}.FilterButtonsWrapper .FilterOpen{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;width:max-content;background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterOpen:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterButtonsWrapper .FilterClear{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;width:max-content;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-typography-inverse, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterClear:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterModalHeader,.FilterModalBody,.FilterModalFooter{display:flex;flex-direction:column;gap:5px;align-items:center;margin:20px 0}.FilterModalHeader .filterKey,.FilterModalBody .filterKey,.FilterModalFooter .filterKey{color:var(--emw--color-primary, #009993);text-align:left;font-size:16px}.FilterModalHeader .FilterModalTitle,.FilterModalBody .FilterModalTitle,.FilterModalFooter .FilterModalTitle{margin:0;padding:0;font-weight:700;font-size:16px;color:var(--emw--color-primary, #009993);text-transform:uppercase}.FilterModalHeader .FilterModalSearch,.FilterModalBody .FilterModalSearch,.FilterModalFooter .FilterModalSearch{border-radius:var(--emw--button-border-radius, 4px);background:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-primary-variant, #004d4a);width:100%;height:26px;max-width:280px;padding:5px;font-size:15px;border:none;outline:var(--emw--color-primary, #009993)}.FilterModalHeader .FilterCalendarWrapper,.FilterModalBody .FilterCalendarWrapper,.FilterModalFooter .FilterCalendarWrapper{display:flex;gap:5px}.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker{width:50%;max-width:143px}.FilterModalHeader .FilterModalButton,.FilterModalBody .FilterModalButton,.FilterModalFooter .FilterModalButton{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 60px;width:max-content;margin:5px;background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.FilterModalHeader .FilterModalButton:hover,.FilterModalBody .FilterModalButton:hover,.FilterModalFooter .FilterModalButton:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterModalHeader p,.FilterModalBody p,.FilterModalFooter p{margin:5px 0}.ticketFilterItem{margin:12px 0}.general-multi-select-container{width:var(--vaadin-field-default-width, 16em)}.general-multi-select-container vaadin-text-field{width:100%}";
|
|
9328
9679
|
const HelperFiltersStyle0 = helperFiltersCss;
|
|
9329
9680
|
|
|
@@ -15331,10 +15682,12 @@ const TRANSLATIONS$4 = {
|
|
|
15331
15682
|
error: 'Error',
|
|
15332
15683
|
backButton: 'Back',
|
|
15333
15684
|
lobbyButton: 'Lobby',
|
|
15334
|
-
|
|
15685
|
+
nextDrawIn: 'Next draw in: ',
|
|
15686
|
+
startIn: 'Sales Start in:',
|
|
15335
15687
|
buy: 'Buy tickets',
|
|
15336
15688
|
viewLatest: 'View latest results',
|
|
15337
15689
|
submitSuccess: 'Submit successfully!',
|
|
15690
|
+
ticketFailed: 'Failed to submit tickets.',
|
|
15338
15691
|
orderSummaryTitle: 'Order Summary',
|
|
15339
15692
|
orderSummaryTickets: 'Ticket',
|
|
15340
15693
|
orderSummaryTotal: 'Total',
|
|
@@ -15347,7 +15700,7 @@ const TRANSLATIONS$4 = {
|
|
|
15347
15700
|
error: 'Eroare',
|
|
15348
15701
|
backButton: 'Inapoi',
|
|
15349
15702
|
lobbyButton: 'Lobby',
|
|
15350
|
-
|
|
15703
|
+
nextDrawIn: 'Urmatoarea extragere:',
|
|
15351
15704
|
buy: 'Cumpara bilet',
|
|
15352
15705
|
viewLatest: 'Ultimile extrageri',
|
|
15353
15706
|
submitSuccess: 'Submit successfully!',
|
|
@@ -15362,7 +15715,7 @@ const TRANSLATIONS$4 = {
|
|
|
15362
15715
|
error: 'Error',
|
|
15363
15716
|
backButton: 'Back',
|
|
15364
15717
|
lobbyButton: 'Lobby',
|
|
15365
|
-
|
|
15718
|
+
nextDrawIn: 'Next draw in: ',
|
|
15366
15719
|
buy: 'Buy tickets',
|
|
15367
15720
|
viewLatest: 'View latest results',
|
|
15368
15721
|
submitSuccess: 'Submit successfully!',
|
|
@@ -15377,7 +15730,7 @@ const TRANSLATIONS$4 = {
|
|
|
15377
15730
|
error: 'خطأ',
|
|
15378
15731
|
backButton: 'خلف',
|
|
15379
15732
|
lobbyButton: 'ردهة',
|
|
15380
|
-
|
|
15733
|
+
nextDrawIn: 'السحب التالي:',
|
|
15381
15734
|
buy: 'اشتري تذاكر',
|
|
15382
15735
|
viewLatest: 'عرض أحدث النتائج',
|
|
15383
15736
|
submitSuccess: 'Submit successfully!',
|
|
@@ -15392,7 +15745,7 @@ const TRANSLATIONS$4 = {
|
|
|
15392
15745
|
error: 'Greška',
|
|
15393
15746
|
backButton: 'Nazad',
|
|
15394
15747
|
lobbyButton: 'Lobby',
|
|
15395
|
-
|
|
15748
|
+
nextDrawIn: 'Sljedeće izvlačenje za: ',
|
|
15396
15749
|
buy: 'Uplati listić',
|
|
15397
15750
|
viewLatest: 'Pogledajte najnovije rezultate',
|
|
15398
15751
|
submitSuccess: 'Submit successfully!',
|
|
@@ -15426,12 +15779,17 @@ const getTranslations$4 = (url) => {
|
|
|
15426
15779
|
});
|
|
15427
15780
|
};
|
|
15428
15781
|
|
|
15429
|
-
|
|
15430
|
-
|
|
15431
|
-
|
|
15432
|
-
|
|
15433
|
-
|
|
15434
|
-
|
|
15782
|
+
var DrawStatus;
|
|
15783
|
+
(function (DrawStatus) {
|
|
15784
|
+
DrawStatus["OPEN"] = "OPEN";
|
|
15785
|
+
})(DrawStatus || (DrawStatus = {}));
|
|
15786
|
+
var TicketState;
|
|
15787
|
+
(function (TicketState) {
|
|
15788
|
+
TicketState["Settled"] = "Settled";
|
|
15789
|
+
TicketState["Purchased"] = "Purchased";
|
|
15790
|
+
TicketState["Canceled"] = "Canceled";
|
|
15791
|
+
})(TicketState || (TicketState = {}));
|
|
15792
|
+
|
|
15435
15793
|
const generateUUID$1 = () => {
|
|
15436
15794
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
15437
15795
|
var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
@@ -15467,6 +15825,62 @@ const showNotification = ({ message, theme = 'success' }) => {
|
|
|
15467
15825
|
theme
|
|
15468
15826
|
});
|
|
15469
15827
|
};
|
|
15828
|
+
function checkDrawAvailable(currentDraw = {}) {
|
|
15829
|
+
if (currentDraw && currentDraw.id && currentDraw.status === DrawStatus.OPEN) {
|
|
15830
|
+
return true;
|
|
15831
|
+
}
|
|
15832
|
+
return false;
|
|
15833
|
+
}
|
|
15834
|
+
function formatCountdown(stopTime, _now) {
|
|
15835
|
+
if (!stopTime)
|
|
15836
|
+
return;
|
|
15837
|
+
const endTime = typeof stopTime === 'string' ? parseISO(stopTime) : stopTime;
|
|
15838
|
+
const now = _now && new Date();
|
|
15839
|
+
let totalSeconds = differenceInSeconds(endTime, now);
|
|
15840
|
+
if (totalSeconds < 0)
|
|
15841
|
+
return '0D 00H 00M 00S';
|
|
15842
|
+
const days = Math.floor(totalSeconds / 86400);
|
|
15843
|
+
totalSeconds %= 86400;
|
|
15844
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
15845
|
+
totalSeconds %= 3600;
|
|
15846
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
15847
|
+
const seconds = totalSeconds % 60;
|
|
15848
|
+
return `${days}D ${hours.toString().padStart(2, '0')}H ${minutes.toString().padStart(2, '0')}M ${seconds
|
|
15849
|
+
.toString()
|
|
15850
|
+
.padStart(2, '0')}S`;
|
|
15851
|
+
}
|
|
15852
|
+
|
|
15853
|
+
const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
|
|
15854
|
+
const doSubmitTicket = ({ body, sessionId, url }) => {
|
|
15855
|
+
const options = {
|
|
15856
|
+
method: 'POST',
|
|
15857
|
+
headers: {
|
|
15858
|
+
'Content-Type': 'application/json',
|
|
15859
|
+
Accept: 'application/json',
|
|
15860
|
+
Authorization: `Bearer ${sessionId}`,
|
|
15861
|
+
'X-Idempotency-Key': generateUUID$1()
|
|
15862
|
+
},
|
|
15863
|
+
body: JSON.stringify(body)
|
|
15864
|
+
};
|
|
15865
|
+
return fetch(url, options).then((res) => {
|
|
15866
|
+
if (res.status === 401) {
|
|
15867
|
+
throw new Error(TICKET_INVALID_TOKEN);
|
|
15868
|
+
}
|
|
15869
|
+
if (res.status > 300) {
|
|
15870
|
+
throw new Error(res.statusText);
|
|
15871
|
+
}
|
|
15872
|
+
return res.json().then((data) => {
|
|
15873
|
+
if (checkTicketDetailHasError(data.tickets))
|
|
15874
|
+
throw new Error(res.statusText);
|
|
15875
|
+
return data;
|
|
15876
|
+
});
|
|
15877
|
+
});
|
|
15878
|
+
};
|
|
15879
|
+
function checkTicketDetailHasError(tickets) {
|
|
15880
|
+
if (!tickets || !tickets.length)
|
|
15881
|
+
return true;
|
|
15882
|
+
return tickets.some((i) => i.state !== TicketState.Purchased);
|
|
15883
|
+
}
|
|
15470
15884
|
|
|
15471
15885
|
const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n.GamePage {\n background-color: var(--emw--color-background, #fff);\n}\n.GamePage .GridBanner {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n background-repeat: no-repeat;\n background-position: center;\n color: var(--emw--color-typography, #000);\n padding: 0 20px 10px;\n height: 220px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.GamePage .GridBanner .BannerButtonsWrapper {\n display: flex;\n justify-content: space-between;\n padding-top: 16px;\n}\n.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,\n.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 7px 15px;\n font-size: 12px;\n text-transform: uppercase;\n width: 80px;\n cursor: pointer;\n}\n.GamePage .GridBanner .GridBannerArea {\n padding-top: 30px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.GamePage .TotalWinnings {\n color: var(--emw--color-typography, #000);\n font-size: 18px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 10px;\n text-transform: uppercase;\n}\n.GamePage .TotalWinnings span {\n font-size: 18px;\n font-weight: 700;\n}\n.GamePage .NextDraw {\n color: var(--emw--color-primary, #009993);\n font-size: 24px;\n font-weight: 600;\n margin: 0 auto;\n text-align: center;\n text-transform: uppercase;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 4px;\n}\n.GamePage .NextDraw .BannerText {\n font-weight: 400;\n font-size: 18px;\n text-transform: uppercase;\n padding: 0;\n margin: 15px 0 0 0;\n}\n.GamePage .NextDraw .BannerCountdown {\n font-size: 22px;\n color: var(--emw--color-primary, #009993);\n display: flex;\n gap: 20px;\n}\n.GamePage .Tabs {\n display: flex;\n justify-content: center;\n gap: 10px;\n}\n.GamePage .Tabs .TabButton {\n border-radius: var(--emw--button-border-radius, 4px);\n cursor: pointer;\n padding: 8px 0;\n width: 50%;\n max-width: 200px;\n border: 1px solid var(--emw--color-primary, #009993);\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.GamePage .Tabs .TabButton.Active {\n color: var(--emw--color-primary, #009993);\n background: var(--emw--color-gray-50, #f5f5f5);\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n}\n\n.LastDrawResultsTitle {\n color: var(--emw--color-primary, #009993);\n padding: 25px 0 10px 0;\n text-align: center;\n border-radius: var(--emw--button-border-radius, 4px);\n text-transform: uppercase;\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n}\n\n.NextDrawWrapper {\n padding: 10px 15px;\n background: var(--emw--color-background, #fff);\n}\n.NextDrawWrapper .BannerText {\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n.NextDrawWrapper .BannerCountdown {\n font-size: 22px;\n display: flex;\n gap: 8px;\n color: var(--emw--color-primary, #009993);\n font-weight: bolder;\n justify-content: center;\n}\n\n.GamePageContent {\n max-width: 1200px;\n margin: 0 auto;\n background: var(--emw--color-background, #fff);\n container-type: inline-size;\n container-name: gamePage;\n}\n\n.TicketsWrapper {\n min-height: 300px;\n}\n\n@container gamePage (min-width: 1200px) {\n .GamePageContent .TicketsWrapper {\n float: left;\n width: 49%;\n }\n .GamePageContent .GameDetails {\n float: right;\n width: 49%;\n }\n .GamePageContent .OrderSummary {\n float: right;\n width: 49%;\n }\n}\n.GameDetails {\n padding-bottom: 10px;\n margin-bottom: 20px;\n}\n\n.OrderSummary {\n min-width: 200px;\n border-radius: var(--emw--button-border-radius, 4px);\n color: var(--emw--color-typography, #000);\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n background: var(--emw--color-background, #fff);\n}\n.OrderSummary .OrderSummaryTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n text-transform: uppercase;\n text-align: center;\n}\n.OrderSummary .OrderTicketInfo {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n.OrderSummary .OrderTicketInfo .Multiplier {\n margin: 0 6px;\n}\n.OrderSummary .Ticket {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n margin-right: 30px;\n}\n.OrderSummary .Ticket span {\n text-align: right;\n}\n.OrderSummary hr {\n border: none;\n border-top: 1px double var(--emw--color-gray-100, #e6e6e6);\n color: var(--emw--color-gray-100, #e6e6e6);\n width: 100%;\n}\n.OrderSummary .Total {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n}\n.OrderSummary .Total span {\n text-align: right;\n}\n\n.ButtonWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ButtonWrapper .Button {\n cursor: pointer;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 8px 60px;\n width: max-content;\n margin: 5px;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.ButtonWrapper .Button:hover {\n background: var(--emw--color-secondary, #00aba4);\n}\n.ButtonWrapper .Button.ButtonDisabled {\n pointer-events: none;\n background: var(--emw--color-background-tertiary, #ccc);\n}\n.ButtonWrapper .submitError {\n margin-top: 10px;\n color: var(--emw--color-error, #ff3d00);\n}\n.ButtonWrapper .submitWrap {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.SubmitModalSuccess {\n text-align: center;\n font-size: 18px;\n padding: 20px;\n}\n\n.DeleteTicketModalWrapper {\n padding: 20px;\n text-align: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n font-weight: 400;\n text-transform: uppercase;\n margin: 20px 0 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalText {\n font-size: 14px;\n color: var(--emw--color-typography, #000);\n line-height: 22px;\n margin-bottom: 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons {\n display: flex;\n gap: 10px;\n justify-content: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 25px;\n width: max-content;\n margin: 5px;\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-error, #ff3d00);\n border: 1px solid var(--emw--color-error, #ff3d00);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover {\n background: var(--emw--color-tertiary, #ff6536);\n border: 1px solid var(--emw--color-error, #ff3d00);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel {\n cursor: pointer;\n width: max-content;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 10px 25px;\n margin: 5px;\n border: 1px solid var(--emw--color-secondary, #00aba4);\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover {\n background: var(--emw--color-gray-50, #f5f5f5);\n}\n\n.GamePage {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.GamePage .GamePageContentWrapper,\n.GamePage .HistoryContentWrapper {\n padding: 15px;\n flex: 1;\n background: var(--emw--color-background, #fff);\n}\n\n.HistoryContentWrapper::after,\n.GamePageContent::after {\n content: \"\";\n display: block;\n clear: both;\n}\n\n.GamePageWrap .noActiveDraw {\n margin: 10% auto 0px;\n padding: 24px;\n border: 1px solid var(--emw--color-primary, #009993);\n border-radius: 4px;\n width: 280px;\n color: var(--emw--color-primary, #009993);\n}\n\n.fetching {\n margin: 40px auto;\n}";
|
|
15472
15886
|
const LotteryGamePageStyle0 = lotteryGamePageCss;
|
|
@@ -15509,10 +15923,6 @@ const LotteryGamePage = class {
|
|
|
15509
15923
|
this.hasErrors = false;
|
|
15510
15924
|
this.totalAmount = 0;
|
|
15511
15925
|
this.successVisible = false;
|
|
15512
|
-
this.daysRemaining = undefined;
|
|
15513
|
-
this.hoursRemaining = undefined;
|
|
15514
|
-
this.minutesRemaining = undefined;
|
|
15515
|
-
this.secondsRemaining = undefined;
|
|
15516
15926
|
this.nextDate = undefined;
|
|
15517
15927
|
this.isLoggedIn = false;
|
|
15518
15928
|
this.loginModalVisible = false;
|
|
@@ -15528,6 +15938,8 @@ const LotteryGamePage = class {
|
|
|
15528
15938
|
this.subscriptionError = '';
|
|
15529
15939
|
this.isSubscribed = false;
|
|
15530
15940
|
this.isFetchingGame = false;
|
|
15941
|
+
this.drawSubmitAvailable = false;
|
|
15942
|
+
this.formattedTime = undefined;
|
|
15531
15943
|
}
|
|
15532
15944
|
handleClientStylingChange(newValue, oldValue) {
|
|
15533
15945
|
if (newValue != oldValue) {
|
|
@@ -15586,23 +15998,8 @@ const LotteryGamePage = class {
|
|
|
15586
15998
|
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
15587
15999
|
}
|
|
15588
16000
|
}
|
|
15589
|
-
countdownLogic(date) {
|
|
15590
|
-
const setTime = () => {
|
|
15591
|
-
this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
|
|
15592
|
-
this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
|
|
15593
|
-
this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) -
|
|
15594
|
-
this.daysRemaining * 24 * 60 -
|
|
15595
|
-
this.hoursRemaining * 60);
|
|
15596
|
-
this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 -
|
|
15597
|
-
this.daysRemaining * 24 * 60 * 60 -
|
|
15598
|
-
this.hoursRemaining * 60 * 60 -
|
|
15599
|
-
this.minutesRemaining * 60);
|
|
15600
|
-
};
|
|
15601
|
-
setTime();
|
|
15602
|
-
this.interval = setInterval(setTime, 1000);
|
|
15603
|
-
}
|
|
15604
16001
|
disconnectedCallback() {
|
|
15605
|
-
clearInterval(this.interval);
|
|
16002
|
+
this.interval && clearInterval(this.interval);
|
|
15606
16003
|
}
|
|
15607
16004
|
getGameDetails() {
|
|
15608
16005
|
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
@@ -15616,13 +16013,32 @@ const LotteryGamePage = class {
|
|
|
15616
16013
|
return res.json();
|
|
15617
16014
|
})
|
|
15618
16015
|
.then((data) => {
|
|
15619
|
-
var _a, _b;
|
|
16016
|
+
var _a, _b, _c, _d, _e;
|
|
15620
16017
|
this.gameData = data;
|
|
15621
16018
|
this.basicStake = this.gameData.rules.stakes.length ? Number(this.gameData.rules.stakes[0].value) : 0;
|
|
15622
16019
|
this.basicLine = ((_a = this.gameData.rules.betTypes) === null || _a === void 0 ? void 0 : _a.length) ? this.gameData.rules.betTypes[0].boardsAllowed[0] : 1;
|
|
15623
16020
|
this.basicBetType = this.gameData.rules.betTypes[0];
|
|
15624
|
-
this.
|
|
15625
|
-
|
|
16021
|
+
if (this.gameData && checkDrawAvailable((_b = this.gameData) === null || _b === void 0 ? void 0 : _b.currentDraw)) {
|
|
16022
|
+
this.nextDate = (_c = this.gameData.currentDraw) === null || _c === void 0 ? void 0 : _c.date;
|
|
16023
|
+
const start = (_e = (_d = this.gameData) === null || _d === void 0 ? void 0 : _d.currentDraw) === null || _e === void 0 ? void 0 : _e.wagerStartTime;
|
|
16024
|
+
const updateTime = () => {
|
|
16025
|
+
var _a;
|
|
16026
|
+
const now = new Date();
|
|
16027
|
+
if (start && isBefore(now, parseISO(start))) {
|
|
16028
|
+
this.drawSubmitAvailable = false;
|
|
16029
|
+
this.formattedTime = { start: formatCountdown(start, now) };
|
|
16030
|
+
}
|
|
16031
|
+
else {
|
|
16032
|
+
this.drawSubmitAvailable = true;
|
|
16033
|
+
this.formattedTime = { nextIn: formatCountdown((_a = data === null || data === void 0 ? void 0 : data.currentDraw) === null || _a === void 0 ? void 0 : _a.date, now) };
|
|
16034
|
+
}
|
|
16035
|
+
if (this.formattedTime.nextIn === '0D 00H 00M 00S') {
|
|
16036
|
+
clearInterval(this.interval);
|
|
16037
|
+
}
|
|
16038
|
+
};
|
|
16039
|
+
updateTime();
|
|
16040
|
+
this.interval = setInterval(updateTime, 1000);
|
|
16041
|
+
}
|
|
15626
16042
|
this.secondarySelectionAllowed = this.gameData.rules.secondarySelectionAllowed === 'INPUT' ? true : false;
|
|
15627
16043
|
this.quickPick = this.gameData.rules.quickPickAvailable;
|
|
15628
16044
|
this.isSubscription = this.gameData.rules.wagerTypes && this.gameData.rules.wagerTypes.includes('Subscription');
|
|
@@ -15859,6 +16275,8 @@ const LotteryGamePage = class {
|
|
|
15859
16275
|
return body;
|
|
15860
16276
|
}
|
|
15861
16277
|
handleSubmitTickets() {
|
|
16278
|
+
if (!this.drawSubmitAvailable)
|
|
16279
|
+
return;
|
|
15862
16280
|
if (this.isSubscription && this.isSubscribed) {
|
|
15863
16281
|
this.submitTickets();
|
|
15864
16282
|
this.submitSubscriptionTickets();
|
|
@@ -15917,41 +16335,20 @@ const LotteryGamePage = class {
|
|
|
15917
16335
|
// @TODO Body TS type
|
|
15918
16336
|
const body = this.buildTicketParam();
|
|
15919
16337
|
if (body) {
|
|
15920
|
-
const uuid = generateUUID$1();
|
|
15921
|
-
// @TODO Options TS type
|
|
15922
|
-
let options = {
|
|
15923
|
-
method: 'POST',
|
|
15924
|
-
headers: {
|
|
15925
|
-
'Content-Type': 'application/json',
|
|
15926
|
-
Accept: 'application/json',
|
|
15927
|
-
Authorization: `Bearer ${this.sessionId}`,
|
|
15928
|
-
'X-Idempotency-Key': uuid
|
|
15929
|
-
},
|
|
15930
|
-
body: JSON.stringify(body)
|
|
15931
|
-
};
|
|
15932
16338
|
this.isLoading = true;
|
|
15933
|
-
|
|
15934
|
-
.then((res) => {
|
|
15935
|
-
if (res.status > 300) {
|
|
15936
|
-
this.apiError = res.statusText + '.';
|
|
15937
|
-
this.showApiError = true;
|
|
15938
|
-
setTimeout(() => {
|
|
15939
|
-
this.showApiError = false;
|
|
15940
|
-
}, 3000);
|
|
15941
|
-
throw new Error(res.statusText);
|
|
15942
|
-
}
|
|
15943
|
-
return res.json();
|
|
15944
|
-
})
|
|
16339
|
+
doSubmitTicket({ body, sessionId: this.sessionId, url: url.href })
|
|
15945
16340
|
.then(() => {
|
|
15946
|
-
// this.successVisible = true;
|
|
15947
16341
|
showNotification({ message: 'Ticket submitted successfully.', theme: 'success' });
|
|
15948
16342
|
this.resetAllTicketSelection.emit();
|
|
15949
16343
|
const event = new CustomEvent('resetAllTicketSelection', { bubbles: true, composed: true });
|
|
15950
16344
|
document.dispatchEvent(event);
|
|
15951
16345
|
})
|
|
15952
|
-
.catch((
|
|
15953
|
-
|
|
15954
|
-
|
|
16346
|
+
.catch((res) => {
|
|
16347
|
+
if (res.message === TICKET_INVALID_TOKEN) {
|
|
16348
|
+
showNotification({ message: TICKET_INVALID_TOKEN, theme: 'error' });
|
|
16349
|
+
return;
|
|
16350
|
+
}
|
|
16351
|
+
showNotification({ message: translate$4('ticketFailed', this.language), theme: 'error' });
|
|
15955
16352
|
})
|
|
15956
16353
|
.finally(() => {
|
|
15957
16354
|
this.isLoading = false;
|
|
@@ -15968,7 +16365,7 @@ const LotteryGamePage = class {
|
|
|
15968
16365
|
this.goToLobbyEvent.emit();
|
|
15969
16366
|
}
|
|
15970
16367
|
render() {
|
|
15971
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
16368
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
15972
16369
|
if (this.hasErrors) {
|
|
15973
16370
|
return (index.h("div", { class: "GamePage" }, index.h("div", { class: "Title" }, translate$4('error', this.language))));
|
|
15974
16371
|
}
|
|
@@ -15979,14 +16376,14 @@ const LotteryGamePage = class {
|
|
|
15979
16376
|
'background-size': 'contain',
|
|
15980
16377
|
'background-repeat': 'no-repeat',
|
|
15981
16378
|
'background-position': 'center'
|
|
15982
|
-
} }, index.h("div", { class: "BannerButtonsWrapper" }), index.h("div", { class: "Tabs" }, index.h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => (this.tabIndex = 0) }, translate$4('buy', this.language)), index.h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => (this.tabIndex = 1) }, translate$4('viewLatest', this.language)))), this.isFetchingGame ? (index.h("div", { class: "fetching" }, "Loading...")) : (index.h("div", { class: "GamePageWrap" }, this.nextDate ? (index.h("div", null, index.h("div", { class: "NextDrawWrapper" }, index.h("div", { class: "NextDraw" }, index.h("p", { class: "BannerText" }, translate$4('
|
|
16379
|
+
} }, index.h("div", { class: "BannerButtonsWrapper" }), index.h("div", { class: "Tabs" }, index.h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => (this.tabIndex = 0) }, translate$4('buy', this.language)), index.h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => (this.tabIndex = 1) }, translate$4('viewLatest', this.language)))), this.isFetchingGame ? (index.h("div", { class: "fetching" }, "Loading...")) : (index.h("div", { class: "GamePageWrap" }, this.nextDate ? (index.h("div", null, index.h("div", { class: "NextDrawWrapper" }, index.h("div", { class: "NextDraw" }, ((_a = this.formattedTime) === null || _a === void 0 ? void 0 : _a.start) ? (index.h("p", { class: "BannerText" }, translate$4('startIn', this.language))) : (index.h("p", { class: "BannerText" }, translate$4('nextDrawIn', this.language))), index.h("div", { class: "BannerCountdown" }, ((_b = this.formattedTime) === null || _b === void 0 ? void 0 : _b.start) || ((_c = this.formattedTime) === null || _c === void 0 ? void 0 : _c.nextIn)))), this.tabIndex == 0 && (index.h("div", { class: "GamePageContentWrapper" }, index.h("div", { class: "GamePageContent" }, index.h("div", { class: "GameDetails" }, index.h("lottery-game-details", { "low-number": (_e = (_d = this.gameData.rules) === null || _d === void 0 ? void 0 : _d.boards[0]) === null || _e === void 0 ? void 0 : _e.lowNumber, "high-number": (_g = (_f = this.gameData.rules) === null || _f === void 0 ? void 0 : _f.boards[0]) === null || _g === void 0 ? void 0 : _g.highNumber, "minimum-allowed": (_j = (_h = this.gameData.rules) === null || _h === void 0 ? void 0 : _h.boards[0]) === null || _j === void 0 ? void 0 : _j.minimumAllowed, "maxinum-allowed": (_l = (_k = this.gameData.rules) === null || _k === void 0 ? void 0 : _k.boards[0]) === null || _l === void 0 ? void 0 : _l.maxinumAllowed, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "translation-url": this.translationData })), index.h("div", { class: "TicketsWrapper" }, this.mainTickets.map((item) => {
|
|
15983
16380
|
var _a, _b;
|
|
15984
16381
|
return (index.h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": (_a = this.gameData.rules) === null || _a === void 0 ? void 0 : _a.quickPickAvailable, "reset-button": (_b = this.gameData.rules) === null || _b === void 0 ? void 0 : _b.quickPickAvailable, "total-controllers": this.mainTickets.length, "translation-url": this.translationData, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }));
|
|
15985
|
-
})), index.h("div", { class: "OrderSummary" }, index.h("h3", { class: "OrderSummaryTitle" }, translate$4('orderSummaryTitle', this.language)), index.h("div", { class: "OrderTicketInfo" }, index.h("div", { class: "Ticket" }, translate$4('orderSummaryTickets', this.language), ": ", index.h("span", null, this.mainTickets.length)), index.h("div", null, index.h("span", null, this.thousandSeperator(((
|
|
15986
|
-
? `${(
|
|
15987
|
-
: `${(
|
|
15988
|
-
? `${(
|
|
15989
|
-
: `${(
|
|
16382
|
+
})), index.h("div", { class: "OrderSummary" }, index.h("h3", { class: "OrderSummaryTitle" }, translate$4('orderSummaryTitle', this.language)), index.h("div", { class: "OrderTicketInfo" }, index.h("div", { class: "Ticket" }, translate$4('orderSummaryTickets', this.language), ": ", index.h("span", null, this.mainTickets.length)), index.h("div", null, index.h("span", null, this.thousandSeperator(((_o = (_m = this.mainTickets[0]) === null || _m === void 0 ? void 0 : _m.betType) === null || _o === void 0 ? void 0 : _o.combinations) * ((_p = this.mainTickets[0]) === null || _p === void 0 ? void 0 : _p.lineNum))), index.h("span", { class: "Multiplier" }, "x"), ((_q = this.gameData.rules) === null || _q === void 0 ? void 0 : _q.stakeMultiplierAvailable) && (index.h("span", null, index.h("span", null, ((_r = this.mainTickets[0]) === null || _r === void 0 ? void 0 : _r.multiplierNum) === 1
|
|
16383
|
+
? `${(_s = this.mainTickets[0]) === null || _s === void 0 ? void 0 : _s.multiplierNum} Multiplier`
|
|
16384
|
+
: `${(_t = this.mainTickets[0]) === null || _t === void 0 ? void 0 : _t.multiplierNum} Multipliers`), index.h("span", { class: "Multiplier" }, "x"))), index.h("span", null, `${(_u = this.mainTickets[0]) === null || _u === void 0 ? void 0 : _u.stake} EUR`), ((_v = this.gameData.rules) === null || _v === void 0 ? void 0 : _v.drawMultiplierAvailable) && (index.h("span", null, index.h("span", { class: "Multiplier" }, "x"), index.h("span", null, ((_w = this.mainTickets[0]) === null || _w === void 0 ? void 0 : _w.drawCount) === 1
|
|
16385
|
+
? `${(_x = this.mainTickets[0]) === null || _x === void 0 ? void 0 : _x.drawCount} Draw`
|
|
16386
|
+
: `${(_y = this.mainTickets[0]) === null || _y === void 0 ? void 0 : _y.drawCount} Draws`))))), index.h("hr", null), index.h("div", { class: "Total" }, translate$4('orderSummaryTotal', this.language), ":", ' ', index.h("span", null, this.thousandSeperator(this.totalAmount), " ", this.currency)), this.isSubscription && (index.h("div", { class: "SubscriptionWrapper" }, index.h("lottery-subscription", { endpoint: this.endpoint, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, gameName: this.gameData.name }))), index.h("div", { class: "ButtonWrapper" }, this.isLoggedIn && (index.h("div", null, !this.isLoading && (index.h("div", { class: "submitWrap" }, index.h("div", { class: { Button: true, ButtonDisabled: !this.drawSubmitAvailable }, onClick: () => this.handleSubmitTickets() }, translate$4('orderSummarySubmit', this.language)), this.showSubmitError && index.h("div", { class: "submitError" }, this.submitError), this.showApiError && index.h("div", { class: "submitError" }, this.apiError), this.showSubscriptionError && (index.h("div", { class: "submitError" }, this.subscriptionError)))), this.isLoading && (index.h("span", { class: "Button", style: { cursor: 'default' } }, translate$4('loading', this.language))))), !this.isLoggedIn && (index.h("div", null, index.h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate$4('orderSummarySubmit', this.language)), index.h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, index.h("p", { class: "SubmitModalSuccess" }, translate$4('modalLogin', this.language)))))))))), this.tabIndex == 1 && (index.h("div", { class: "HistoryContentWrapper" }, index.h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "translation-url": this.translationData, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }))))) : (index.h("div", { class: "noActiveDraw" }, translate$4('emptyText', this.language))))), index.h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, index.h("p", { class: "SubmitModalSuccess" }, translate$4('submitSuccess', this.language)))));
|
|
15990
16387
|
}
|
|
15991
16388
|
static get assetsDirs() { return ["../static"]; }
|
|
15992
16389
|
get element() { return index.getElement(this); }
|