@timardex/cluemart-shared 1.5.722 → 1.5.723

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.
@@ -6,16 +6,16 @@ import {
6
6
  EnumPostContentType,
7
7
  EnumPostType
8
8
  } from "../chunk-5SCGH7UX.mjs";
9
- import "../chunk-ZN5HT2J4.mjs";
10
- import "../chunk-HWLNH6G2.mjs";
9
+ import "../chunk-6IEQBYEB.mjs";
10
+ import "../chunk-3AI2ROPT.mjs";
11
11
  import "../chunk-NPFJ2CN2.mjs";
12
- import "../chunk-YAPBZ7DK.mjs";
12
+ import "../chunk-SG3S3VQ2.mjs";
13
13
  import {
14
14
  SCHOOL_MIN_STUDENT_COUNT,
15
15
  dateFormat,
16
16
  normalizeUrl,
17
17
  timeFormat
18
- } from "../chunk-KL533AIU.mjs";
18
+ } from "../chunk-HGS6TJTA.mjs";
19
19
  import "../chunk-HV5AID7P.mjs";
20
20
  import {
21
21
  EnumEventDateStatus,
package/dist/index.cjs CHANGED
@@ -35,6 +35,7 @@ __export(index_exports, {
35
35
  DEFAULT_RESOURCES_RETURN_LIMIT: () => DEFAULT_RESOURCES_RETURN_LIMIT,
36
36
  DEFAULT_RESOURCES_RETURN_OFFSET: () => DEFAULT_RESOURCES_RETURN_OFFSET,
37
37
  DEFAULT_SHARE_OG_IMAGE: () => DEFAULT_SHARE_OG_IMAGE,
38
+ EVENT_DATE_STATUS_PERIOD_MAP: () => EVENT_DATE_STATUS_PERIOD_MAP,
38
39
  EnumActivity: () => EnumActivity,
39
40
  EnumAdShowOn: () => EnumAdShowOn,
40
41
  EnumAdStatus: () => EnumAdStatus,
@@ -144,7 +145,9 @@ __export(index_exports, {
144
145
  eventEndDateFields: () => eventEndDateFields,
145
146
  eventInfo: () => eventInfo,
146
147
  eventInfoPaymentInfo: () => eventInfoPaymentInfo,
148
+ eventMatchesDateStatusPeriod: () => eventMatchesDateStatusPeriod,
147
149
  eventStartDateFields: () => eventStartDateFields,
150
+ filterEventsByDateStatusPeriod: () => filterEventsByDateStatusPeriod,
148
151
  fonts: () => fonts,
149
152
  foodFlavourOptions: () => foodFlavourOptions,
150
153
  formatCategoryLabel: () => formatCategoryLabel,
@@ -165,6 +168,7 @@ __export(index_exports, {
165
168
  formatTimestamp: () => formatTimestamp,
166
169
  gameScreenIdentifierList: () => gameScreenIdentifierList,
167
170
  gameTypeToDisplayName: () => gameTypeToDisplayName,
171
+ getAllowedEventDateStatuses: () => getAllowedEventDateStatuses,
168
172
  getCurrentAndFutureDates: () => getCurrentAndFutureDates,
169
173
  iconFiles: () => iconFiles,
170
174
  iconIds: () => iconIds,
@@ -1174,6 +1178,34 @@ var rewardNiceNames = {
1174
1178
  var SCHOOL_MIN_STUDENT_COUNT = 300;
1175
1179
  var SCHOOL_MAX_STUDENT_COUNT = 0;
1176
1180
 
1181
+ // src/utils/eventDateStatus.ts
1182
+ var EVENT_DATE_STATUS_PERIOD_MAP = {
1183
+ ["Today" /* TODAY */]: [
1184
+ "Started" /* STARTED */,
1185
+ "Starting_Soon" /* STARTING_SOON */,
1186
+ "Today" /* TODAY */
1187
+ ],
1188
+ ["This_Week" /* THIS_WEEK */]: [
1189
+ "Started" /* STARTED */,
1190
+ "Starting_Soon" /* STARTING_SOON */,
1191
+ "This_Week" /* THIS_WEEK */,
1192
+ "Today" /* TODAY */,
1193
+ "Tomorrow" /* TOMORROW */
1194
+ ]
1195
+ };
1196
+ function getAllowedEventDateStatuses(period) {
1197
+ return EVENT_DATE_STATUS_PERIOD_MAP[period] ?? [period];
1198
+ }
1199
+ function eventMatchesDateStatusPeriod(dateTime, period) {
1200
+ const allowedStatuses = getAllowedEventDateStatuses(period);
1201
+ return dateTime?.some((dt) => allowedStatuses.includes(dt.dateStatus)) ?? false;
1202
+ }
1203
+ function filterEventsByDateStatusPeriod(events, period) {
1204
+ return events.filter(
1205
+ (event) => eventMatchesDateStatusPeriod(event.dateTime, period)
1206
+ );
1207
+ }
1208
+
1177
1209
  // src/formFields/vendor/vendorInfo.ts
1178
1210
  var vendorElectricity = {
1179
1211
  details: {
@@ -3293,7 +3325,7 @@ var EVENT = import_client3.gql`
3293
3325
  ${RELATION_DATES_FRAGMENT}
3294
3326
  `;
3295
3327
  var GET_EVENTS = import_client3.gql`
3296
- query getEvents($dateStatus: EnumEventDateStatus) {
3328
+ query getEvents($dateStatus: EventDateStatusEnumType) {
3297
3329
  events(dateStatus: $dateStatus) {
3298
3330
  ...EventListItemFields
3299
3331
  }
@@ -3320,7 +3352,7 @@ var GET_EVENTS_BY_REGION = import_client3.gql`
3320
3352
  query getEventsByRegion(
3321
3353
  $region: String!
3322
3354
  $options: ResourcesByRegionOptions
3323
- $dateStatus: EnumEventDateStatus
3355
+ $dateStatus: EventDateStatusEnumType
3324
3356
  ) {
3325
3357
  eventsByRegion(
3326
3358
  region: $region
@@ -3337,7 +3369,7 @@ var SEARCH_EVENTS = import_client3.gql`
3337
3369
  $region: String
3338
3370
  $search: String
3339
3371
  $tags: [String]
3340
- $dateStatus: EnumEventDateStatus
3372
+ $dateStatus: EventDateStatusEnumType
3341
3373
  ) {
3342
3374
  eventsSearch(
3343
3375
  region: $region
@@ -3355,7 +3387,7 @@ var GET_EVENTS_NEAR_ME = import_client3.gql`
3355
3387
  $latitude: Float!
3356
3388
  $longitude: Float!
3357
3389
  $radius: Int
3358
- $dateStatus: EnumEventDateStatus
3390
+ $dateStatus: EventDateStatusEnumType
3359
3391
  ) {
3360
3392
  eventsNearMe(
3361
3393
  latitude: $latitude
@@ -7533,6 +7565,7 @@ var TIER_FROM_LICENCE = {
7533
7565
  DEFAULT_RESOURCES_RETURN_LIMIT,
7534
7566
  DEFAULT_RESOURCES_RETURN_OFFSET,
7535
7567
  DEFAULT_SHARE_OG_IMAGE,
7568
+ EVENT_DATE_STATUS_PERIOD_MAP,
7536
7569
  EnumActivity,
7537
7570
  EnumAdShowOn,
7538
7571
  EnumAdStatus,
@@ -7642,7 +7675,9 @@ var TIER_FROM_LICENCE = {
7642
7675
  eventEndDateFields,
7643
7676
  eventInfo,
7644
7677
  eventInfoPaymentInfo,
7678
+ eventMatchesDateStatusPeriod,
7645
7679
  eventStartDateFields,
7680
+ filterEventsByDateStatusPeriod,
7646
7681
  fonts,
7647
7682
  foodFlavourOptions,
7648
7683
  formatCategoryLabel,
@@ -7663,6 +7698,7 @@ var TIER_FROM_LICENCE = {
7663
7698
  formatTimestamp,
7664
7699
  gameScreenIdentifierList,
7665
7700
  gameTypeToDisplayName,
7701
+ getAllowedEventDateStatuses,
7666
7702
  getCurrentAndFutureDates,
7667
7703
  iconFiles,
7668
7704
  iconIds,