@timardex/cluemart-shared 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/{ad-D0xWGTAB.d.mts → ad-BdPabW-h.d.mts} +2 -2
  2. package/dist/{ad-rrCulESo.d.ts → ad-Ogzb0O0U.d.ts} +2 -2
  3. package/dist/{affiliate-C9eTAxEj.d.ts → affiliate-CxZHVZb2.d.ts} +2 -2
  4. package/dist/{affiliate-CGe0hR-U.d.mts → affiliate-D-L_UtL8.d.mts} +2 -2
  5. package/dist/auth/index.d.mts +3 -3
  6. package/dist/auth/index.d.ts +3 -3
  7. package/dist/{chunk-T7A7ZG55.mjs → chunk-2DTCLBHT.mjs} +19 -4
  8. package/dist/chunk-2DTCLBHT.mjs.map +1 -0
  9. package/dist/{chunk-OK3BPZYA.mjs → chunk-576YBZYO.mjs} +2 -2
  10. package/dist/{chunk-PIEXGXTD.mjs → chunk-MRBTCICB.mjs} +1 -1
  11. package/dist/chunk-MRBTCICB.mjs.map +1 -0
  12. package/dist/{chunk-KT65YYOB.mjs → chunk-UIG4A4U3.mjs} +15 -11
  13. package/dist/chunk-UIG4A4U3.mjs.map +1 -0
  14. package/dist/{chunk-BTZIWVSF.mjs → chunk-VWGCXGEL.mjs} +3 -3
  15. package/dist/chunk-VWGCXGEL.mjs.map +1 -0
  16. package/dist/{contactUs-Be0zqd9Q.d.ts → contactUs-CR-nghbk.d.ts} +1 -1
  17. package/dist/{contactUs-CQXyz40A.d.mts → contactUs-CwHKoGEt.d.mts} +1 -1
  18. package/dist/formFields/index.cjs.map +1 -1
  19. package/dist/formFields/index.d.mts +1 -1
  20. package/dist/formFields/index.d.ts +1 -1
  21. package/dist/formFields/index.mjs +4 -4
  22. package/dist/{global-CAf04GRC.d.ts → global-B4mmQo6R.d.ts} +25 -7
  23. package/dist/{global-d8RFwoYS.d.mts → global-D1r5ZuQO.d.mts} +25 -7
  24. package/dist/graphql/index.d.mts +5 -5
  25. package/dist/graphql/index.d.ts +5 -5
  26. package/dist/hooks/index.cjs +12 -12
  27. package/dist/hooks/index.cjs.map +1 -1
  28. package/dist/hooks/index.d.mts +5 -5
  29. package/dist/hooks/index.d.ts +5 -5
  30. package/dist/hooks/index.mjs +17 -17
  31. package/dist/hooks/index.mjs.map +1 -1
  32. package/dist/index.cjs +31 -12
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.mts +37 -15
  35. package/dist/index.d.ts +37 -15
  36. package/dist/index.mjs +31 -12
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/map/index.d.mts +1 -1
  39. package/dist/map/index.d.ts +1 -1
  40. package/dist/region/index.d.mts +1 -1
  41. package/dist/region/index.d.ts +1 -1
  42. package/dist/{resourceActivities-DO_PjmMN.d.mts → resourceActivities-DUReu_jD.d.mts} +1 -1
  43. package/dist/{resourceActivities-ByCZO0rJ.d.ts → resourceActivities-Uz9uavhK.d.ts} +1 -1
  44. package/dist/sharing/index.cjs +1 -1
  45. package/dist/sharing/index.cjs.map +1 -1
  46. package/dist/sharing/index.d.mts +1 -1
  47. package/dist/sharing/index.d.ts +1 -1
  48. package/dist/sharing/index.mjs +2 -2
  49. package/dist/types/index.cjs.map +1 -1
  50. package/dist/types/index.d.mts +7 -7
  51. package/dist/types/index.d.ts +7 -7
  52. package/dist/types/index.mjs +1 -1
  53. package/dist/{user-BHYl7drL.d.mts → user-BpR-FTW2.d.mts} +1 -1
  54. package/dist/{user-DCqDbTLd.d.ts → user-IR0bHKFb.d.ts} +1 -1
  55. package/dist/utils/index.cjs +30 -11
  56. package/dist/utils/index.cjs.map +1 -1
  57. package/dist/utils/index.d.mts +15 -11
  58. package/dist/utils/index.d.ts +15 -11
  59. package/dist/utils/index.mjs +3 -3
  60. package/package.json +1 -1
  61. package/dist/chunk-BTZIWVSF.mjs.map +0 -1
  62. package/dist/chunk-KT65YYOB.mjs.map +0 -1
  63. package/dist/chunk-PIEXGXTD.mjs.map +0 -1
  64. package/dist/chunk-T7A7ZG55.mjs.map +0 -1
  65. /package/dist/{chunk-OK3BPZYA.mjs.map → chunk-576YBZYO.mjs.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { EnumOSPlatform, EnumResourceType, EnumReward, EnumUserRole, EnumBillingPeriod, EnumUserLicence, EnumSubscriptionStatus, EnumNotificationResourceType } from './enums/index.js';
2
- import { aS as ResourceImageType, L as LocationType, aY as TermsAgreement, l as UserLicenceType, aH as PromoCodeType, a5 as DateTimeType, M as MutationResponse, a2 as CreateFormData } from './global-CAf04GRC.js';
2
+ import { aU as ResourceImageType, L as LocationType, a_ as TermsAgreement, l as UserLicenceType, aJ as PromoCodeType, a6 as DateTimeType, M as MutationResponse, a2 as CreateFormData } from './global-B4mmQo6R.js';
3
3
 
4
4
  /**
5
5
  * Canonical permission IDs. Add new permissions here first, then map them in
@@ -370,6 +370,9 @@ var formatDate = (dateStr, display = "datetime", timeStr) => {
370
370
  var getCurrentAndFutureDates = (dates) => {
371
371
  const now = (0, import_dayjs.default)();
372
372
  return dates.filter((dateObj) => {
373
+ if (!dateObj.startDate || !dateObj.startTime) {
374
+ return false;
375
+ }
373
376
  const dateTime = (0, import_dayjs.default)(
374
377
  `${dateObj.startDate} ${dateObj.startTime}`,
375
378
  `${dateFormat} ${timeFormat}`
@@ -378,6 +381,9 @@ var getCurrentAndFutureDates = (dates) => {
378
381
  });
379
382
  };
380
383
  var isFutureDatesBeforeThreshold = (date, minHoursFromNow) => {
384
+ if (!date.startDate || !date.startTime) {
385
+ return false;
386
+ }
381
387
  const threshold = minHoursFromNow ? (0, import_dayjs.default)().add(minHoursFromNow, "hour") : (0, import_dayjs.default)().startOf("day");
382
388
  const dateTime = (0, import_dayjs.default)(
383
389
  `${date.startDate} ${date.startTime}`,
@@ -398,9 +404,18 @@ function sortDatesChronologically(dates) {
398
404
  }
399
405
  return [...dates].sort((a, b) => {
400
406
  const dateTimeFormat = `${dateFormat} ${timeFormat}`;
401
- const dateA = (0, import_dayjs.default)(`${a.startDate} ${a.startTime}`, dateTimeFormat);
402
- const dateB = (0, import_dayjs.default)(`${b.startDate} ${b.startTime}`, dateTimeFormat);
403
- return dateA.valueOf() - dateB.valueOf();
407
+ const dateA = a.startDate && a.startTime ? (0, import_dayjs.default)(`${a.startDate} ${a.startTime}`, dateTimeFormat) : null;
408
+ const dateB = b.startDate && b.startTime ? (0, import_dayjs.default)(`${b.startDate} ${b.startTime}`, dateTimeFormat) : null;
409
+ if (dateA && dateB) {
410
+ return dateA.valueOf() - dateB.valueOf();
411
+ }
412
+ if (dateA) {
413
+ return -1;
414
+ }
415
+ if (dateB) {
416
+ return 1;
417
+ }
418
+ return 0;
404
419
  });
405
420
  }
406
421
  var futureTimePeriods = FUTURE_EVENT_DATE_STATUSES.filter(
@@ -768,7 +783,9 @@ function fromCalendarIsoDate(isoDate) {
768
783
  return (0, import_dayjs2.default)(isoDate, "YYYY-MM-DD").format(dateFormat);
769
784
  }
770
785
  function getEventCalendarIsoDates(dateTimes) {
771
- return dateTimes?.map((dateTime) => toCalendarIsoDate(dateTime.startDate)).filter((date) => Boolean(date)) ?? [];
786
+ return dateTimes?.map(
787
+ (dateTime) => dateTime.startDate ? toCalendarIsoDate(dateTime.startDate) : null
788
+ ).filter((date) => Boolean(date)) ?? [];
772
789
  }
773
790
  function findEventDateTimeByIsoDate(dateTimes, isoDate) {
774
791
  const selected = fromCalendarIsoDate(isoDate);
@@ -1857,7 +1874,9 @@ var availableCategories = assignColorToCategories([
1857
1874
 
1858
1875
  // src/eventStallholders/eventStallholderFilters.ts
1859
1876
  function eventStartDatesSet(dateTime) {
1860
- return new Set((dateTime ?? []).map((date) => date.startDate));
1877
+ return new Set(
1878
+ (dateTime ?? []).map((date) => date.startDate).filter((date) => Boolean(date))
1879
+ );
1861
1880
  }
1862
1881
  function hasMatchingEventDate(vendorStartDates, eventStartDates) {
1863
1882
  return vendorStartDates.some((startDate) => eventStartDates.has(startDate));
@@ -1877,9 +1896,7 @@ function matchesCategory(categoryNames, selectedCategory) {
1877
1896
  function getRegisteredVendorStartDates(vendor) {
1878
1897
  const relations = vendor.relations ?? [];
1879
1898
  return relations.flatMap(
1880
- (relation) => (relation.relationDates ?? []).map(
1881
- (relationDate) => relationDate.dateTime.startDate
1882
- )
1899
+ (relation) => (relation.relationDates ?? []).map((relationDate) => relationDate.dateTime.startDate).filter((date) => Boolean(date))
1883
1900
  );
1884
1901
  }
1885
1902
  function getRegisteredVendorCategoryNames(vendor) {
@@ -1887,7 +1904,7 @@ function getRegisteredVendorCategoryNames(vendor) {
1887
1904
  }
1888
1905
  function getUnregisteredVendorStartDates(vendor) {
1889
1906
  return (vendor.invitations ?? []).flatMap(
1890
- (invitation) => invitation.dateTime.map((date) => date.startDate)
1907
+ (invitation) => invitation.dateTime.map((date) => date.startDate).filter((date) => Boolean(date))
1891
1908
  );
1892
1909
  }
1893
1910
  function getUnregisteredVendorCategoryNames(vendor) {
@@ -1947,7 +1964,9 @@ function getEventDatesWithStallholders(eventDateTime, stallholderStartDates) {
1947
1964
  }
1948
1965
  const startDates = new Set(stallholderStartDates);
1949
1966
  return sortDatesChronologically(
1950
- eventDateTime.filter((date) => startDates.has(date.startDate))
1967
+ eventDateTime.filter(
1968
+ (date) => Boolean(date.startDate) && startDates.has(date.startDate)
1969
+ )
1951
1970
  );
1952
1971
  }
1953
1972
  function getStallholderCategoryNames(registeredVendors, unregisteredVendors = []) {
@@ -2008,7 +2027,7 @@ function getVendorEventRelationStartDates(events) {
2008
2027
  );
2009
2028
  const uniqueStartDates = [];
2010
2029
  for (const dateTime of sortedDates) {
2011
- if (!uniqueStartDates.includes(dateTime.startDate)) {
2030
+ if (dateTime.startDate && !uniqueStartDates.includes(dateTime.startDate)) {
2012
2031
  uniqueStartDates.push(dateTime.startDate);
2013
2032
  }
2014
2033
  }