@timardex/cluemart-shared 2.2.23 → 2.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/auth/index.mjs +1 -1
  2. package/dist/{chunk-FWKZZMQR.mjs → chunk-IKRXLKJ3.mjs} +1 -1
  3. package/dist/{chunk-FWKZZMQR.mjs.map → chunk-IKRXLKJ3.mjs.map} +1 -1
  4. package/dist/{chunk-6NGXF4G7.mjs → chunk-J62YICHJ.mjs} +3 -3
  5. package/dist/{chunk-Q2WLLXTA.mjs → chunk-U3KUTQ43.mjs} +2 -1
  6. package/dist/chunk-U3KUTQ43.mjs.map +1 -0
  7. package/dist/{chunk-OWEIH2ME.mjs → chunk-UM3UYMGK.mjs} +33 -4
  8. package/dist/chunk-UM3UYMGK.mjs.map +1 -0
  9. package/dist/enums/index.cjs +1 -0
  10. package/dist/enums/index.cjs.map +1 -1
  11. package/dist/enums/index.d.mts +1 -0
  12. package/dist/enums/index.d.ts +1 -0
  13. package/dist/enums/index.mjs +1 -1
  14. package/dist/formFields/index.cjs.map +1 -1
  15. package/dist/formFields/index.mjs +4 -4
  16. package/dist/graphql/index.mjs +1 -1
  17. package/dist/hooks/index.cjs.map +1 -1
  18. package/dist/hooks/index.mjs +4 -4
  19. package/dist/index.cjs +34 -1
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.mts +33 -1
  22. package/dist/index.d.ts +33 -1
  23. package/dist/index.mjs +31 -1
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/region/index.cjs.map +1 -1
  26. package/dist/region/index.mjs +1 -1
  27. package/dist/sharing/index.mjs +1 -1
  28. package/dist/types/index.cjs.map +1 -1
  29. package/dist/types/index.mjs +2 -2
  30. package/dist/utils/index.cjs +33 -1
  31. package/dist/utils/index.cjs.map +1 -1
  32. package/dist/utils/index.d.mts +32 -1
  33. package/dist/utils/index.d.ts +32 -1
  34. package/dist/utils/index.mjs +9 -3
  35. package/package.json +1 -1
  36. package/dist/chunk-OWEIH2ME.mjs.map +0 -1
  37. package/dist/chunk-Q2WLLXTA.mjs.map +0 -1
  38. /package/dist/{chunk-6NGXF4G7.mjs.map → chunk-J62YICHJ.mjs.map} +0 -0
@@ -2,12 +2,12 @@ import "../chunk-6O6TRUOV.mjs";
2
2
  import "../chunk-VA5YN2K3.mjs";
3
3
  import "../chunk-VPANTTZI.mjs";
4
4
  import "../chunk-DWO35OY4.mjs";
5
- import "../chunk-6NGXF4G7.mjs";
5
+ import "../chunk-J62YICHJ.mjs";
6
6
  import {
7
7
  SCHOOL_MIN_STUDENT_COUNT,
8
8
  isValidIrdNumber,
9
9
  normalizeUrl
10
- } from "../chunk-OWEIH2ME.mjs";
10
+ } from "../chunk-UM3UYMGK.mjs";
11
11
  import "../chunk-RE4NZPYY.mjs";
12
12
  import {
13
13
  dateFormat,
@@ -21,7 +21,7 @@ import {
21
21
  EnumAffiliateParticipantType,
22
22
  EnumPostContentType,
23
23
  EnumPostType
24
- } from "../chunk-FWKZZMQR.mjs";
24
+ } from "../chunk-IKRXLKJ3.mjs";
25
25
  import "../chunk-RAYUJODN.mjs";
26
26
  import "../chunk-DQ7ZHIXW.mjs";
27
27
  import "../chunk-TCV735VY.mjs";
@@ -36,7 +36,7 @@ import {
36
36
  EnumResourceType,
37
37
  EnumSocialMedia,
38
38
  EnumVendorType
39
- } from "../chunk-Q2WLLXTA.mjs";
39
+ } from "../chunk-U3KUTQ43.mjs";
40
40
  import "../chunk-NPFJ2CN2.mjs";
41
41
 
42
42
  // src/hooks/useLocationSearch.ts
package/dist/index.cjs CHANGED
@@ -213,6 +213,8 @@ __export(index_exports, {
213
213
  computeDailyClueState: () => computeDailyClueState,
214
214
  computeHasMore: () => computeHasMore,
215
215
  contactUsFields: () => contactUsFields,
216
+ countLetterOccurrences: () => countLetterOccurrences,
217
+ countLetterOccurrencesUpTo: () => countLetterOccurrencesUpTo,
216
218
  createAffiliateReward: () => createAffiliateReward,
217
219
  darkColors: () => darkColors,
218
220
  dateFormat: () => dateFormat,
@@ -262,6 +264,7 @@ __export(index_exports, {
262
264
  getAllowedEventDateStatuses: () => getAllowedEventDateStatuses,
263
265
  getBillingCatalogKeyForSelection: () => getBillingCatalogKeyForSelection,
264
266
  getCurrentAndFutureDates: () => getCurrentAndFutureDates,
267
+ getDailyClueDayIndex: () => getDailyClueDayIndex,
265
268
  getDefaultAdminHome: () => getDefaultAdminHome,
266
269
  getDistanceInKilometers: () => getDistanceInKilometers,
267
270
  getDistanceInMeters: () => getDistanceInMeters,
@@ -686,6 +689,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
686
689
  EnumNotificationResourceType2["DOWNGRADED_PARTNER"] = "downgraded_partner";
687
690
  EnumNotificationResourceType2["DOWNGRADED_VENDOR"] = "downgraded_vendor";
688
691
  EnumNotificationResourceType2["EVENT_DATE_CANCELED"] = "event_date_canceled";
692
+ EnumNotificationResourceType2["EVENT_INFO_CREATED"] = "event_info_created";
689
693
  EnumNotificationResourceType2["EVENT_INVITE_VENDOR"] = "event_invite_vendor" /* EVENT_INVITE_VENDOR */;
690
694
  EnumNotificationResourceType2["EVENT_STARTING_SOON"] = "event_starting_soon";
691
695
  EnumNotificationResourceType2["EVENT_UPDATE_RELATION_TO_VENDOR"] = "event_update_relation_to_vendor" /* EVENT_UPDATE_RELATION_TO_VENDOR */;
@@ -1387,6 +1391,31 @@ function seededShuffle(array, seed) {
1387
1391
  function getDayIndex(start, today) {
1388
1392
  return today.diff(start, "day");
1389
1393
  }
1394
+ function getDailyClueDayIndex(dailyClue) {
1395
+ const today = nzStartOfDay();
1396
+ const start = nzStartOfDay(dailyClue.gameFields.gameDate.startDate);
1397
+ const end = nzStartOfDay(dailyClue.gameFields.gameDate.endDate);
1398
+ if (today.isBefore(start) || today.isAfter(end)) {
1399
+ return null;
1400
+ }
1401
+ return getDayIndex(start, today);
1402
+ }
1403
+ function countLetterOccurrences(letters, letter) {
1404
+ return letters.reduce(
1405
+ (count, candidate) => candidate === letter ? count + 1 : count,
1406
+ 0
1407
+ );
1408
+ }
1409
+ function countLetterOccurrencesUpTo(letters, letter, index) {
1410
+ let count = 0;
1411
+ const end = Math.min(index, letters.length - 1);
1412
+ for (let i = 0; i <= end; i++) {
1413
+ if (letters[i] === letter) {
1414
+ count++;
1415
+ }
1416
+ }
1417
+ return count;
1418
+ }
1390
1419
  function computeDailyClueState(dailyClue) {
1391
1420
  const { startDate, endDate } = dailyClue.gameFields.gameDate;
1392
1421
  const { solutionShuffled, collected } = dailyClue.letterInfo;
@@ -1414,7 +1443,8 @@ function computeDailyClueState(dailyClue) {
1414
1443
  const letterToday = solutionShuffled[index];
1415
1444
  const placement = shuffledPlacements[index];
1416
1445
  if (!letterToday || !placement) return null;
1417
- const alreadyCollectedToday = (collected ?? []).includes(letterToday);
1446
+ const collectedLetters = collected ?? [];
1447
+ const alreadyCollectedToday = countLetterOccurrences(collectedLetters, letterToday) >= countLetterOccurrencesUpTo(solutionShuffled, letterToday, index);
1418
1448
  if (alreadyCollectedToday) {
1419
1449
  return {
1420
1450
  todaysClue: null,
@@ -10349,6 +10379,8 @@ function canAccessAdminPath(roles, pathname) {
10349
10379
  computeDailyClueState,
10350
10380
  computeHasMore,
10351
10381
  contactUsFields,
10382
+ countLetterOccurrences,
10383
+ countLetterOccurrencesUpTo,
10352
10384
  createAffiliateReward,
10353
10385
  darkColors,
10354
10386
  dateFormat,
@@ -10398,6 +10430,7 @@ function canAccessAdminPath(roles, pathname) {
10398
10430
  getAllowedEventDateStatuses,
10399
10431
  getBillingCatalogKeyForSelection,
10400
10432
  getCurrentAndFutureDates,
10433
+ getDailyClueDayIndex,
10401
10434
  getDefaultAdminHome,
10402
10435
  getDistanceInKilometers,
10403
10436
  getDistanceInMeters,