@timardex/cluemart-shared 1.5.504 → 1.5.506

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.
@@ -1,4 +1,4 @@
1
- import "../chunk-A3BCQJII.mjs";
1
+ import "../chunk-K4J6EBAJ.mjs";
2
2
  import "../chunk-RQDZX76B.mjs";
3
3
  import "../chunk-DWO35OY4.mjs";
4
4
  import "../chunk-I7WE3EBR.mjs";
@@ -14,7 +14,7 @@ import {
14
14
  dateFormat,
15
15
  normalizeUrl,
16
16
  timeFormat
17
- } from "../chunk-XNMKWMNF.mjs";
17
+ } from "../chunk-4H2QFRNE.mjs";
18
18
  import {
19
19
  EnumEventDateStatus,
20
20
  EnumEventType,
package/dist/index.cjs CHANGED
@@ -109,6 +109,7 @@ __export(index_exports, {
109
109
  mapArrayToOptions: () => mapArrayToOptions,
110
110
  mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
111
111
  normalizeUrl: () => normalizeUrl,
112
+ nzStartOfDay: () => nzStartOfDay,
112
113
  packagingOptions: () => packagingOptions,
113
114
  partnerBasicInfoFields: () => partnerBasicInfoFields,
114
115
  paymentMethodOptions: () => paymentMethodOptions,
@@ -857,6 +858,12 @@ var NZ_TZ = "Pacific/Auckland";
857
858
  function toNZTime(date3) {
858
859
  return date3 ? (0, import_dayjs.default)(date3).tz(NZ_TZ) : (0, import_dayjs.default)().tz(NZ_TZ);
859
860
  }
861
+ function nzStartOfDay(input) {
862
+ if (input == null) {
863
+ return (0, import_dayjs.default)().tz(NZ_TZ).startOf("day");
864
+ }
865
+ return (0, import_dayjs.default)(input).tz(NZ_TZ).startOf("day");
866
+ }
860
867
  var formatDate = (dateStr, display = "datetime", timeStr) => {
861
868
  const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
862
869
  const dateTime = timeStr ? (0, import_dayjs.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs.default)(dateStr, dateFormat);
@@ -944,9 +951,9 @@ function getDayIndex(start, today) {
944
951
  function computeDailyClueState(dailyClue) {
945
952
  const { startDate, endDate } = dailyClue.gameFields.gameDate;
946
953
  const { shuffled, collected } = dailyClue.letterInfo;
947
- const today = toNZTime().startOf("day");
948
- const start = toNZTime(startDate).startOf("day");
949
- const end = toNZTime(endDate).startOf("day");
954
+ const today = nzStartOfDay();
955
+ const start = nzStartOfDay(startDate);
956
+ const end = nzStartOfDay(endDate);
950
957
  const shuffledPlacements = seededShuffle(
951
958
  gameScreenIdentifierList,
952
959
  start.toISOString()
@@ -969,8 +976,18 @@ function computeDailyClueState(dailyClue) {
969
976
  }
970
977
  const index = getDayIndex(start, today);
971
978
  if (index < 0 || index >= shuffled.length) return null;
972
- if (collected?.includes(shuffled[index])) {
973
- return null;
979
+ const letterToday = shuffled[index]?.trim().toLowerCase();
980
+ if (!letterToday) return null;
981
+ const alreadyHaveTodaysSlot = (collected ?? []).some(
982
+ (l) => l.trim().toLowerCase() === letterToday
983
+ );
984
+ if (alreadyHaveTodaysSlot) {
985
+ return {
986
+ gameHistory: null,
987
+ todaysClue: null,
988
+ todaysLetter: null,
989
+ todaysPlacement: null
990
+ };
974
991
  }
975
992
  return {
976
993
  gameHistory: null,
@@ -8296,6 +8313,7 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
8296
8313
  mapArrayToOptions,
8297
8314
  mapBaseResourceTypeToFormData,
8298
8315
  normalizeUrl,
8316
+ nzStartOfDay,
8299
8317
  packagingOptions,
8300
8318
  partnerBasicInfoFields,
8301
8319
  paymentMethodOptions,