@timardex/cluemart-shared 1.5.705 → 1.5.706
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/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index.cjs +69 -2025
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -106
- package/dist/index.d.ts +1 -106
- package/dist/index.mjs +69 -1998
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/{auth-Dvp1IEH_.d.mts → post-CswgI5jI.d.mts} +49 -49
- package/dist/{auth-Cp3BRIVM.d.ts → post-NK1XwGmZ.d.ts} +49 -49
package/dist/index.cjs
CHANGED
|
@@ -138,13 +138,6 @@ __export(index_exports, {
|
|
|
138
138
|
contactUsFields: () => contactUsFields,
|
|
139
139
|
darkColors: () => darkColors,
|
|
140
140
|
dateFormat: () => dateFormat,
|
|
141
|
-
defaultEventFormValues: () => defaultEventFormValues,
|
|
142
|
-
defaultEventInfoFormValues: () => defaultEventInfoFormValues,
|
|
143
|
-
defaultLocation: () => defaultLocation,
|
|
144
|
-
defaultPartnerFormValues: () => defaultPartnerFormValues,
|
|
145
|
-
defaultUnregisteredVendorFormValues: () => defaultUnregisteredVendorFormValues,
|
|
146
|
-
defaultVendorFormValues: () => defaultVendorFormValues,
|
|
147
|
-
defaultVendorInfoFormValues: () => defaultVendorInfoFormValues,
|
|
148
141
|
emailField: () => emailField,
|
|
149
142
|
eventBasicInfoFields: () => eventBasicInfoFields,
|
|
150
143
|
eventEndDateFields: () => eventEndDateFields,
|
|
@@ -172,7 +165,6 @@ __export(index_exports, {
|
|
|
172
165
|
gameScreenIdentifierList: () => gameScreenIdentifierList,
|
|
173
166
|
gameTypeToDisplayName: () => gameTypeToDisplayName,
|
|
174
167
|
getCurrentAndFutureDates: () => getCurrentAndFutureDates,
|
|
175
|
-
globalDefaultValues: () => globalDefaultValues,
|
|
176
168
|
iconFiles: () => iconFiles,
|
|
177
169
|
iconIds: () => iconIds,
|
|
178
170
|
icons: () => icons,
|
|
@@ -189,7 +181,6 @@ __export(index_exports, {
|
|
|
189
181
|
logoIds: () => logoIds,
|
|
190
182
|
logos: () => logos,
|
|
191
183
|
mapArrayToOptions: () => mapArrayToOptions,
|
|
192
|
-
mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
|
|
193
184
|
normalizeShareOgDescription: () => normalizeShareOgDescription,
|
|
194
185
|
normalizeShareRouteId: () => normalizeShareRouteId,
|
|
195
186
|
normalizeShareText: () => normalizeShareText,
|
|
@@ -225,7 +216,6 @@ __export(index_exports, {
|
|
|
225
216
|
timeFormat: () => timeFormat,
|
|
226
217
|
toNZTime: () => toNZTime,
|
|
227
218
|
truncateText: () => truncateText,
|
|
228
|
-
useAdForm: () => useAdForm,
|
|
229
219
|
useAddParticipantToChat: () => useAddParticipantToChat,
|
|
230
220
|
useAddUserFavouriteResource: () => useAddUserFavouriteResource,
|
|
231
221
|
useAddUserGoingResource: () => useAddUserGoingResource,
|
|
@@ -234,10 +224,8 @@ __export(index_exports, {
|
|
|
234
224
|
useAdminPermanentlyDeleteResource: () => useAdminPermanentlyDeleteResource,
|
|
235
225
|
useAdminResendUserVerificationEmail: () => useAdminResendUserVerificationEmail,
|
|
236
226
|
useAdminUpdateResourceType: () => useAdminUpdateResourceType,
|
|
237
|
-
useAppSettingsForm: () => useAppSettingsForm,
|
|
238
227
|
useCancelSubscription: () => useCancelSubscription,
|
|
239
228
|
useContactUs: () => useContactUs,
|
|
240
|
-
useContactUsForm: () => useContactUsForm,
|
|
241
229
|
useCrawlGoogleMarkets: () => useCrawlGoogleMarkets,
|
|
242
230
|
useCreateAd: () => useCreateAd,
|
|
243
231
|
useCreateBulkNotifications: () => useCreateBulkNotifications,
|
|
@@ -269,8 +257,6 @@ __export(index_exports, {
|
|
|
269
257
|
useDeleteUnregisteredVendor: () => useDeleteUnregisteredVendor,
|
|
270
258
|
useDeleteUser: () => useDeleteUser,
|
|
271
259
|
useDeleteVendor: () => useDeleteVendor,
|
|
272
|
-
useEventForm: () => useEventForm,
|
|
273
|
-
useEventInfoForm: () => useEventInfoForm,
|
|
274
260
|
useGetAd: () => useGetAd,
|
|
275
261
|
useGetAds: () => useGetAds,
|
|
276
262
|
useGetAdsByRegion: () => useGetAdsByRegion,
|
|
@@ -324,18 +310,13 @@ __export(index_exports, {
|
|
|
324
310
|
useGetVendors: () => useGetVendors,
|
|
325
311
|
useGetVendorsByRegion: () => useGetVendorsByRegion,
|
|
326
312
|
useLeaveGame: () => useLeaveGame,
|
|
327
|
-
useLocationSearch: () => useLocationSearch,
|
|
328
313
|
useLogin: () => useLogin,
|
|
329
|
-
useLoginForm: () => useLoginForm,
|
|
330
314
|
useLogout: () => useLogout,
|
|
331
315
|
useMarkAllNotificationsRead: () => useMarkAllNotificationsRead,
|
|
332
316
|
useMarkChatMessagesSeen: () => useMarkChatMessagesSeen,
|
|
333
317
|
useMarkNotificationRead: () => useMarkNotificationRead,
|
|
334
|
-
usePartnerForm: () => usePartnerForm,
|
|
335
|
-
usePostForm: () => usePostForm,
|
|
336
318
|
useRefreshToken: () => useRefreshToken,
|
|
337
319
|
useRegister: () => useRegister,
|
|
338
|
-
useRegisterForm: () => useRegisterForm,
|
|
339
320
|
useRemoveParticipantFromChat: () => useRemoveParticipantFromChat,
|
|
340
321
|
useRemoveUserFavouriteResource: () => useRemoveUserFavouriteResource,
|
|
341
322
|
useRemoveUserGoingResource: () => useRemoveUserGoingResource,
|
|
@@ -344,10 +325,7 @@ __export(index_exports, {
|
|
|
344
325
|
useReportChatUser: () => useReportChatUser,
|
|
345
326
|
useRequestMarketingMaterial: () => useRequestMarketingMaterial,
|
|
346
327
|
useRequestPasswordReset: () => useRequestPasswordReset,
|
|
347
|
-
useRequestPasswordResetForm: () => useRequestPasswordResetForm,
|
|
348
328
|
useResetPassword: () => useResetPassword,
|
|
349
|
-
useResetPasswordForm: () => useResetPasswordForm,
|
|
350
|
-
useSchoolForm: () => useSchoolForm,
|
|
351
329
|
useSearchEvents: () => useSearchEvents,
|
|
352
330
|
useSearchPartners: () => useSearchPartners,
|
|
353
331
|
useSearchVendors: () => useSearchVendors,
|
|
@@ -357,7 +335,6 @@ __export(index_exports, {
|
|
|
357
335
|
useStartGame: () => useStartGame,
|
|
358
336
|
useToggleChatMessageLike: () => useToggleChatMessageLike,
|
|
359
337
|
useUnlinkUnregisteredVendorByInviterId: () => useUnlinkUnregisteredVendorByInviterId,
|
|
360
|
-
useUnregisteredVendorForm: () => useUnregisteredVendorForm,
|
|
361
338
|
useUpdateAd: () => useUpdateAd,
|
|
362
339
|
useUpdateAppSettings: () => useUpdateAppSettings,
|
|
363
340
|
useUpdateDailyClueGame: () => useUpdateDailyClueGame,
|
|
@@ -374,11 +351,7 @@ __export(index_exports, {
|
|
|
374
351
|
useUpdateUser: () => useUpdateUser,
|
|
375
352
|
useUpdateVendor: () => useUpdateVendor,
|
|
376
353
|
useUpdateVendorInfo: () => useUpdateVendorInfo,
|
|
377
|
-
useUserForm: () => useUserForm,
|
|
378
354
|
useValidateVerificationToken: () => useValidateVerificationToken,
|
|
379
|
-
useValidateVerificationTokenForm: () => useValidateVerificationTokenForm,
|
|
380
|
-
useVendorForm: () => useVendorForm,
|
|
381
|
-
useVendorInfoForm: () => useVendorInfoForm,
|
|
382
355
|
validateVerificationTokenFields: () => validateVerificationTokenFields,
|
|
383
356
|
vendorAvailability: () => vendorAvailability,
|
|
384
357
|
vendorBasicInfoFields: () => vendorBasicInfoFields,
|
|
@@ -433,13 +406,13 @@ var EnumPaymentMethod = /* @__PURE__ */ ((EnumPaymentMethod2) => {
|
|
|
433
406
|
EnumPaymentMethod2["STRIPE"] = "stripe";
|
|
434
407
|
return EnumPaymentMethod2;
|
|
435
408
|
})(EnumPaymentMethod || {});
|
|
436
|
-
var EnumFoodFlavor = /* @__PURE__ */ ((
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return
|
|
409
|
+
var EnumFoodFlavor = /* @__PURE__ */ ((EnumFoodFlavor2) => {
|
|
410
|
+
EnumFoodFlavor2["SALTY"] = "Salty";
|
|
411
|
+
EnumFoodFlavor2["SAVOURY"] = "Savoury";
|
|
412
|
+
EnumFoodFlavor2["SPICY"] = "Spicy";
|
|
413
|
+
EnumFoodFlavor2["SWEET"] = "Sweet";
|
|
414
|
+
EnumFoodFlavor2["OTHER"] = "Not_Applicable";
|
|
415
|
+
return EnumFoodFlavor2;
|
|
443
416
|
})(EnumFoodFlavor || {});
|
|
444
417
|
var EnumFoodType = /* @__PURE__ */ ((EnumFoodType2) => {
|
|
445
418
|
EnumFoodType2["ADDITIVE_FREE"] = "Additive_Free";
|
|
@@ -485,23 +458,23 @@ var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
|
|
|
485
458
|
EnumResourceType2["PARTNER"] = "partner";
|
|
486
459
|
return EnumResourceType2;
|
|
487
460
|
})(EnumResourceType || {});
|
|
488
|
-
var EnumEventType = /* @__PURE__ */ ((
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
return
|
|
461
|
+
var EnumEventType = /* @__PURE__ */ ((EnumEventType2) => {
|
|
462
|
+
EnumEventType2["MARKET"] = "Market";
|
|
463
|
+
EnumEventType2["EXPO"] = "Expo";
|
|
464
|
+
EnumEventType2["FAIR"] = "Fair";
|
|
465
|
+
EnumEventType2["FESTIVAL"] = "Festival";
|
|
466
|
+
return EnumEventType2;
|
|
494
467
|
})(EnumEventType || {});
|
|
495
468
|
var EnumVendorType = /* @__PURE__ */ ((EnumVendorType2) => {
|
|
496
469
|
EnumVendorType2["STALLHOLDER"] = "Stallholder";
|
|
497
470
|
EnumVendorType2["SHOP"] = "Shop";
|
|
498
471
|
return EnumVendorType2;
|
|
499
472
|
})(EnumVendorType || {});
|
|
500
|
-
var EnumPartnerType = /* @__PURE__ */ ((
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return
|
|
473
|
+
var EnumPartnerType = /* @__PURE__ */ ((EnumPartnerType2) => {
|
|
474
|
+
EnumPartnerType2["CHARITY_PARTNER"] = "Charity_Partner";
|
|
475
|
+
EnumPartnerType2["MEDIA_PARTNER"] = "Media_Partner";
|
|
476
|
+
EnumPartnerType2["SUPPORTING_PARTNER"] = "Supporting_Partner";
|
|
477
|
+
return EnumPartnerType2;
|
|
505
478
|
})(EnumPartnerType || {});
|
|
506
479
|
var EnumOSPlatform = /* @__PURE__ */ ((EnumOSPlatform2) => {
|
|
507
480
|
EnumOSPlatform2["ANDROID"] = "android";
|
|
@@ -954,8 +927,8 @@ import_dayjs.default.extend(import_utc.default);
|
|
|
954
927
|
import_dayjs.default.extend(import_timezone.default);
|
|
955
928
|
import_dayjs.default.extend(import_isSameOrAfter.default);
|
|
956
929
|
var NZ_TZ = "Pacific/Auckland";
|
|
957
|
-
function toNZTime(
|
|
958
|
-
return
|
|
930
|
+
function toNZTime(date) {
|
|
931
|
+
return date ? (0, import_dayjs.default)(date).tz(NZ_TZ) : (0, import_dayjs.default)().tz(NZ_TZ);
|
|
959
932
|
}
|
|
960
933
|
function nzStartOfDay(input) {
|
|
961
934
|
if (input == null) {
|
|
@@ -989,10 +962,10 @@ var getCurrentAndFutureDates = (dates) => {
|
|
|
989
962
|
return dateTime.isSameOrAfter(now);
|
|
990
963
|
});
|
|
991
964
|
};
|
|
992
|
-
var isFutureDatesBeforeThreshold = (
|
|
965
|
+
var isFutureDatesBeforeThreshold = (date, minHoursFromNow) => {
|
|
993
966
|
const threshold = minHoursFromNow ? (0, import_dayjs.default)().add(minHoursFromNow, "hour") : (0, import_dayjs.default)().startOf("day");
|
|
994
967
|
const dateTime = (0, import_dayjs.default)(
|
|
995
|
-
`${
|
|
968
|
+
`${date.startDate} ${date.startTime}`,
|
|
996
969
|
`${dateFormat} ${timeFormat}`
|
|
997
970
|
);
|
|
998
971
|
return dateTime.isSameOrAfter(threshold);
|
|
@@ -1035,9 +1008,9 @@ function hashStringToNumber(seed) {
|
|
|
1035
1008
|
}
|
|
1036
1009
|
return hash >>> 0;
|
|
1037
1010
|
}
|
|
1038
|
-
function seededShuffle(
|
|
1011
|
+
function seededShuffle(array, seed) {
|
|
1039
1012
|
const rng = createSeededRng(hashStringToNumber(seed));
|
|
1040
|
-
const result = [...
|
|
1013
|
+
const result = [...array];
|
|
1041
1014
|
for (let i = result.length - 1; i > 0; i--) {
|
|
1042
1015
|
const j = Math.floor(rng() * (i + 1));
|
|
1043
1016
|
[result[i], result[j]] = [result[j], result[i]];
|
|
@@ -6914,1949 +6887,6 @@ var useGetSchool = (_id) => {
|
|
|
6914
6887
|
};
|
|
6915
6888
|
};
|
|
6916
6889
|
|
|
6917
|
-
// src/hooks/useLocationSearch.ts
|
|
6918
|
-
var handleApiError = (error, message) => {
|
|
6919
|
-
console.error(message, error);
|
|
6920
|
-
};
|
|
6921
|
-
var useLocationSearch = (googleApi) => {
|
|
6922
|
-
const getPredictions = async (text) => {
|
|
6923
|
-
try {
|
|
6924
|
-
const response = await fetch(
|
|
6925
|
-
"https://places.googleapis.com/v1/places:autocomplete",
|
|
6926
|
-
{
|
|
6927
|
-
body: JSON.stringify({
|
|
6928
|
-
input: `${text} New Zealand`,
|
|
6929
|
-
languageCode: "en",
|
|
6930
|
-
regionCode: "nz"
|
|
6931
|
-
}),
|
|
6932
|
-
headers: {
|
|
6933
|
-
"Content-Type": "application/json",
|
|
6934
|
-
"X-Goog-Api-Key": googleApi,
|
|
6935
|
-
"X-Goog-FieldMask": "suggestions.placePrediction.placeId,suggestions.placePrediction.text.text"
|
|
6936
|
-
},
|
|
6937
|
-
method: "POST"
|
|
6938
|
-
}
|
|
6939
|
-
);
|
|
6940
|
-
if (!response.ok) {
|
|
6941
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
6942
|
-
}
|
|
6943
|
-
const data = await response.json();
|
|
6944
|
-
const suggestions = data.suggestions ?? [];
|
|
6945
|
-
const predictions = suggestions.map((suggestion) => suggestion.placePrediction).filter(Boolean).map((prediction) => ({
|
|
6946
|
-
description: prediction?.text?.text || "",
|
|
6947
|
-
place_id: prediction?.placeId || ""
|
|
6948
|
-
})).filter((prediction) => prediction.place_id && prediction.description);
|
|
6949
|
-
return predictions;
|
|
6950
|
-
} catch (error) {
|
|
6951
|
-
console.error("Error fetching predictions:", error);
|
|
6952
|
-
handleApiError(error, "Failed to fetch address predictions.");
|
|
6953
|
-
}
|
|
6954
|
-
};
|
|
6955
|
-
const getPlaceDetails = async (placeId) => {
|
|
6956
|
-
try {
|
|
6957
|
-
const response = await fetch(
|
|
6958
|
-
`https://places.googleapis.com/v1/places/${placeId}`,
|
|
6959
|
-
{
|
|
6960
|
-
headers: {
|
|
6961
|
-
"X-Goog-Api-Key": googleApi,
|
|
6962
|
-
"X-Goog-FieldMask": "addressComponents,formattedAddress,location"
|
|
6963
|
-
}
|
|
6964
|
-
}
|
|
6965
|
-
);
|
|
6966
|
-
if (!response.ok) {
|
|
6967
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
6968
|
-
}
|
|
6969
|
-
const result = await response.json();
|
|
6970
|
-
const { latitude, longitude } = result.location;
|
|
6971
|
-
const { addressComponents, formattedAddress } = result;
|
|
6972
|
-
const address = addressComponents.reduce((acc, item) => {
|
|
6973
|
-
if (!Array.isArray(item.types)) return acc;
|
|
6974
|
-
if (item.types.includes("street_number")) {
|
|
6975
|
-
return { ...acc, streetNumber: item.longText };
|
|
6976
|
-
}
|
|
6977
|
-
if (item.types.includes("route")) {
|
|
6978
|
-
return { ...acc, streetName: item.longText };
|
|
6979
|
-
}
|
|
6980
|
-
if (item.types.includes("locality")) {
|
|
6981
|
-
return { ...acc, city: item.longText };
|
|
6982
|
-
}
|
|
6983
|
-
if (item.types.includes("administrative_area_level_1")) {
|
|
6984
|
-
return { ...acc, region: item.longText };
|
|
6985
|
-
}
|
|
6986
|
-
if (item.types.includes("country")) {
|
|
6987
|
-
return { ...acc, country: item.longText };
|
|
6988
|
-
}
|
|
6989
|
-
return acc;
|
|
6990
|
-
}, {});
|
|
6991
|
-
const newLocation = {
|
|
6992
|
-
city: address.city ? address.city.toLowerCase() : "",
|
|
6993
|
-
country: address.country,
|
|
6994
|
-
fullAddress: formattedAddress,
|
|
6995
|
-
geo: {
|
|
6996
|
-
coordinates: [longitude, latitude],
|
|
6997
|
-
// [longitude, latitude]
|
|
6998
|
-
type: "Point"
|
|
6999
|
-
// Mongoose GeoJSON type
|
|
7000
|
-
},
|
|
7001
|
-
latitude,
|
|
7002
|
-
longitude,
|
|
7003
|
-
region: address.region ? address.region.replace(/ Region$/, "") : ""
|
|
7004
|
-
// Remove " Region" suffix
|
|
7005
|
-
};
|
|
7006
|
-
return newLocation;
|
|
7007
|
-
} catch (error) {
|
|
7008
|
-
handleApiError(error, "Failed to fetch place details.");
|
|
7009
|
-
}
|
|
7010
|
-
};
|
|
7011
|
-
return {
|
|
7012
|
-
getPlaceDetails,
|
|
7013
|
-
getPredictions
|
|
7014
|
-
};
|
|
7015
|
-
};
|
|
7016
|
-
|
|
7017
|
-
// src/hooks/vendor/useVendorForm.ts
|
|
7018
|
-
var import_yup = require("@hookform/resolvers/yup");
|
|
7019
|
-
var React = __toESM(require("react"));
|
|
7020
|
-
var import_react_hook_form = require("react-hook-form");
|
|
7021
|
-
|
|
7022
|
-
// src/yupSchema/global.ts
|
|
7023
|
-
var import_dayjs2 = __toESM(require("dayjs"));
|
|
7024
|
-
var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
7025
|
-
var import_isSameOrAfter2 = __toESM(require("dayjs/plugin/isSameOrAfter.js"));
|
|
7026
|
-
var yup = __toESM(require("yup"));
|
|
7027
|
-
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
7028
|
-
var nzbnRegex = /^94\d{11}$/;
|
|
7029
|
-
var normalizedUrlTransform = () => yup.string().trim().transform(
|
|
7030
|
-
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
7031
|
-
).transform(
|
|
7032
|
-
(value) => typeof value === "string" ? normalizeUrl(value) : value
|
|
7033
|
-
);
|
|
7034
|
-
var noLeadingZeros = (fieldName, options = {}) => {
|
|
7035
|
-
return function(value, context) {
|
|
7036
|
-
const original = context.originalValue;
|
|
7037
|
-
if (typeof original !== "string") {
|
|
7038
|
-
return true;
|
|
7039
|
-
}
|
|
7040
|
-
if (original === "") {
|
|
7041
|
-
return true;
|
|
7042
|
-
}
|
|
7043
|
-
const regex = options.allowDecimal ? /^0\d+(\.\d+)?$/ : /^0\d+$/;
|
|
7044
|
-
if (regex.test(original)) {
|
|
7045
|
-
return context.createError({
|
|
7046
|
-
message: `${fieldName} must not have leading zeros`
|
|
7047
|
-
});
|
|
7048
|
-
}
|
|
7049
|
-
return true;
|
|
7050
|
-
};
|
|
7051
|
-
};
|
|
7052
|
-
var toOptionalNumber = (originalValue) => {
|
|
7053
|
-
if (originalValue === "" || originalValue === null || originalValue === void 0) {
|
|
7054
|
-
return void 0;
|
|
7055
|
-
}
|
|
7056
|
-
let parsed;
|
|
7057
|
-
if (typeof originalValue === "number") {
|
|
7058
|
-
parsed = originalValue;
|
|
7059
|
-
} else if (typeof originalValue === "string") {
|
|
7060
|
-
parsed = Number(originalValue.replace(",", "."));
|
|
7061
|
-
} else {
|
|
7062
|
-
parsed = void 0;
|
|
7063
|
-
}
|
|
7064
|
-
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
7065
|
-
};
|
|
7066
|
-
import_dayjs2.default.extend(import_isSameOrAfter2.default);
|
|
7067
|
-
import_dayjs2.default.extend(import_customParseFormat2.default);
|
|
7068
|
-
var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
7069
|
-
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
7070
|
-
);
|
|
7071
|
-
var emailOptionalSchema = yup.string().nullable().notRequired().transform(
|
|
7072
|
-
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
7073
|
-
).test(
|
|
7074
|
-
"is-valid-email",
|
|
7075
|
-
"Invalid email address",
|
|
7076
|
-
(value) => !value || yup.string().email().isValidSync(value)
|
|
7077
|
-
).label("Email");
|
|
7078
|
-
var mobileRegex = /^02\d{7,9}$/;
|
|
7079
|
-
var landlineRegex = /^0[34679]\d{7}$/;
|
|
7080
|
-
var mobilePhoneSchema = yup.string().label("Mobile Phone").nullable().notRequired().test(
|
|
7081
|
-
"mobile-phone",
|
|
7082
|
-
"Mobile must start with 02 and be 9\u201311 digits",
|
|
7083
|
-
(value) => !value || mobileRegex.test(value)
|
|
7084
|
-
// skip empty values
|
|
7085
|
-
);
|
|
7086
|
-
var landlinePhoneSchema = yup.string().label("Landline Phone").nullable().notRequired().test(
|
|
7087
|
-
"landline-phone",
|
|
7088
|
-
"Landline must start with 03, 04, 06, 07, or 09 (not 090) and have 7 digits after area code",
|
|
7089
|
-
(value) => !value || landlineRegex.test(value)
|
|
7090
|
-
// skip empty values
|
|
7091
|
-
);
|
|
7092
|
-
var contactDetailsSchema = yup.object({
|
|
7093
|
-
email: emailOptionalSchema,
|
|
7094
|
-
mobilePhone: mobilePhoneSchema,
|
|
7095
|
-
landlinePhone: landlinePhoneSchema
|
|
7096
|
-
}).nullable().default(void 0);
|
|
7097
|
-
var endDateNotInPastTest = yup.string().test("not-in-past", "End date cannot be in the past", (value) => {
|
|
7098
|
-
const now = (0, import_dayjs2.default)();
|
|
7099
|
-
return value ? (0, import_dayjs2.default)(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
7100
|
-
});
|
|
7101
|
-
var startDateNotInPastTest = yup.string().test("not-in-past", "Start date cannot be in the past", (value) => {
|
|
7102
|
-
const now = (0, import_dayjs2.default)();
|
|
7103
|
-
return value ? (0, import_dayjs2.default)(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
7104
|
-
});
|
|
7105
|
-
var endDateAfterStartDateTest = yup.string().test(
|
|
7106
|
-
"end-after-start",
|
|
7107
|
-
"End date cannot be before start date",
|
|
7108
|
-
function(value) {
|
|
7109
|
-
const { startDate } = this.parent;
|
|
7110
|
-
if (!startDate || !value) return false;
|
|
7111
|
-
return (0, import_dayjs2.default)(value, dateFormat, true).isSameOrAfter(
|
|
7112
|
-
(0, import_dayjs2.default)(startDate, dateFormat, true),
|
|
7113
|
-
"day"
|
|
7114
|
-
);
|
|
7115
|
-
}
|
|
7116
|
-
);
|
|
7117
|
-
var endTimeMustBeAfterStartTimeTest = yup.string().test(
|
|
7118
|
-
"valid-end-time",
|
|
7119
|
-
"End time must be after start time",
|
|
7120
|
-
function(value) {
|
|
7121
|
-
const { startDate, endDate, startTime } = this.parent;
|
|
7122
|
-
if (!startDate || !endDate || !startTime || !value) return false;
|
|
7123
|
-
const startDateTime = (0, import_dayjs2.default)(
|
|
7124
|
-
`${startDate} ${startTime}`,
|
|
7125
|
-
`${dateFormat} ${timeFormat}`,
|
|
7126
|
-
true
|
|
7127
|
-
);
|
|
7128
|
-
const endDateTime = (0, import_dayjs2.default)(
|
|
7129
|
-
`${endDate} ${value}`,
|
|
7130
|
-
`${dateFormat} ${timeFormat}`,
|
|
7131
|
-
true
|
|
7132
|
-
);
|
|
7133
|
-
return endDateTime.isAfter(startDateTime);
|
|
7134
|
-
}
|
|
7135
|
-
);
|
|
7136
|
-
var startTimeCannotBeInPastTest = yup.string().test(
|
|
7137
|
-
"valid-start-time",
|
|
7138
|
-
"Start time cannot be in the past",
|
|
7139
|
-
function(value) {
|
|
7140
|
-
const now = (0, import_dayjs2.default)();
|
|
7141
|
-
const { startDate } = this.parent;
|
|
7142
|
-
if (!startDate || !value) return false;
|
|
7143
|
-
const startDateTime = (0, import_dayjs2.default)(
|
|
7144
|
-
`${startDate} ${value}`,
|
|
7145
|
-
`${dateFormat} ${timeFormat}`,
|
|
7146
|
-
true
|
|
7147
|
-
);
|
|
7148
|
-
return startDateTime.isSameOrAfter(now);
|
|
7149
|
-
}
|
|
7150
|
-
);
|
|
7151
|
-
var dateTimeSchema = yup.object().shape({
|
|
7152
|
-
dateStatus: yup.mixed().oneOf(Object.values(EnumEventDateStatus)).required("Date status is required"),
|
|
7153
|
-
endDate: yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
|
|
7154
|
-
endTime: yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
|
|
7155
|
-
startDate: yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
|
|
7156
|
-
startTime: yup.string().label("Start Time").concat(startTimeCannotBeInPastTest).required("Start time is required")
|
|
7157
|
-
});
|
|
7158
|
-
var stallTypesSchema = yup.object({
|
|
7159
|
-
label: yup.string().trim().label("Stall Type").required("Stall type is required"),
|
|
7160
|
-
price: yup.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Stall Price").min(0.1, "Stall price must be at least 0.1").required("Stall price is required").test(
|
|
7161
|
-
"no-leading-zeros",
|
|
7162
|
-
"",
|
|
7163
|
-
noLeadingZeros("Stall price", { allowDecimal: true })
|
|
7164
|
-
),
|
|
7165
|
-
stallCapacity: yup.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Stall Capacity").typeError("Stall capacity must be a number").min(0, "Stall capacity cannot be negative").integer("Stall capacity must be a whole number").required("Stall capacity is required").test("no-leading-zeros", "", noLeadingZeros("Stall capacity"))
|
|
7166
|
-
});
|
|
7167
|
-
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
7168
|
-
stallTypes: yup.array().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
|
|
7169
|
-
});
|
|
7170
|
-
var locationSchema = yup.object().shape({
|
|
7171
|
-
city: yup.string().label("City").required("City is required"),
|
|
7172
|
-
country: yup.string().label("Country").required("Country is required"),
|
|
7173
|
-
fullAddress: yup.string().label("Address").required("Address is required"),
|
|
7174
|
-
geo: yup.object().shape({
|
|
7175
|
-
coordinates: yup.array().of(yup.number().required("Coordinates must be numbers")).length(
|
|
7176
|
-
2,
|
|
7177
|
-
"Coordinates must contain exactly two numbers (longitude, latitude)"
|
|
7178
|
-
).required("Coordinates are required"),
|
|
7179
|
-
type: yup.string().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
|
|
7180
|
-
}),
|
|
7181
|
-
latitude: yup.number().label("Latitude").required("Latitude is required"),
|
|
7182
|
-
longitude: yup.number().label("Longitude").required("Longitude is required"),
|
|
7183
|
-
region: yup.string().label("Region").required("Region is required")
|
|
7184
|
-
});
|
|
7185
|
-
var passwordSchema = yup.string().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
7186
|
-
var socialMediaSchema = yup.object({
|
|
7187
|
-
name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).label("Social Media Name").optional(),
|
|
7188
|
-
link: yup.string().when("name", {
|
|
7189
|
-
is: (name) => !!name,
|
|
7190
|
-
// If name has a value
|
|
7191
|
-
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
7192
|
-
otherwise: (schema) => schema.notRequired()
|
|
7193
|
-
})
|
|
7194
|
-
});
|
|
7195
|
-
var globalResourceSchema = yup.object().shape({
|
|
7196
|
-
active: yup.boolean().required("Active is required"),
|
|
7197
|
-
cover: yup.object({
|
|
7198
|
-
source: yup.string().label("Cover").required("Cover Image is required"),
|
|
7199
|
-
title: yup.string().label("Cover Title").required("Cover Title is required")
|
|
7200
|
-
}),
|
|
7201
|
-
contactDetails: contactDetailsSchema,
|
|
7202
|
-
description: yup.string().label("Description").trim().min(50).required("Description is required"),
|
|
7203
|
-
name: yup.string().label("Name").trim().min(3).required("Name is required"),
|
|
7204
|
-
region: yup.string().label("Region").required("Region is required"),
|
|
7205
|
-
socialMedia: yup.array().of(socialMediaSchema).nullable().default(null),
|
|
7206
|
-
associates: yup.array().of(
|
|
7207
|
-
yup.object().shape({
|
|
7208
|
-
email: emailRequiredSchema,
|
|
7209
|
-
resourceId: yup.string().label("Resource ID").required("Resource ID is required"),
|
|
7210
|
-
resourceType: yup.mixed().oneOf(Object.values(EnumResourceType)).label("Resource Type").required("Resource Type is required"),
|
|
7211
|
-
licence: yup.object({
|
|
7212
|
-
expiryDate: yup.date().required("Expiry Date is required"),
|
|
7213
|
-
issuedDate: yup.date().required("Issued Date is required"),
|
|
7214
|
-
licenceType: yup.mixed().oneOf(Object.values(EnumUserLicence)).label("Licence Type").required("Licence Type is required")
|
|
7215
|
-
})
|
|
7216
|
-
})
|
|
7217
|
-
).nullable().default(null)
|
|
7218
|
-
});
|
|
7219
|
-
var categorySchema = yup.array().of(
|
|
7220
|
-
yup.object().shape({
|
|
7221
|
-
id: yup.string().required("Category id is required"),
|
|
7222
|
-
name: yup.string().required("Category name is required"),
|
|
7223
|
-
subcategories: yup.array().of(
|
|
7224
|
-
yup.object().shape({
|
|
7225
|
-
id: yup.string().defined(),
|
|
7226
|
-
items: yup.array().of(
|
|
7227
|
-
yup.object().shape({
|
|
7228
|
-
id: yup.string().defined(),
|
|
7229
|
-
name: yup.string().defined()
|
|
7230
|
-
})
|
|
7231
|
-
).nullable(),
|
|
7232
|
-
name: yup.string().defined()
|
|
7233
|
-
})
|
|
7234
|
-
).min(1, "At least one subcategory is required").required("Subcategories are required")
|
|
7235
|
-
})
|
|
7236
|
-
);
|
|
7237
|
-
|
|
7238
|
-
// src/yupSchema/event.ts
|
|
7239
|
-
var yup2 = __toESM(require("yup"));
|
|
7240
|
-
var eventSchema = globalResourceSchema.shape({
|
|
7241
|
-
dateTime: yup2.array().of(dateTimeSchema).min(1, "At least one Event date required").max(50, "You can only add up to 50 Event dates").required("DateTime is required").test(
|
|
7242
|
-
"unique-start-date-time",
|
|
7243
|
-
"Start Date and Start Time must be unique",
|
|
7244
|
-
function(value) {
|
|
7245
|
-
if (!value) return true;
|
|
7246
|
-
const seen = /* @__PURE__ */ new Set();
|
|
7247
|
-
for (const item of value) {
|
|
7248
|
-
if (!item.startDate || !item.startTime) continue;
|
|
7249
|
-
const key = `${item.startDate}_${item.startTime}`;
|
|
7250
|
-
if (seen.has(key)) {
|
|
7251
|
-
return false;
|
|
7252
|
-
}
|
|
7253
|
-
seen.add(key);
|
|
7254
|
-
}
|
|
7255
|
-
return true;
|
|
7256
|
-
}
|
|
7257
|
-
),
|
|
7258
|
-
eventType: yup2.mixed().oneOf(Object.values(EnumEventType), "Please select a valid Event type").required("Please select an Event type"),
|
|
7259
|
-
location: locationSchema,
|
|
7260
|
-
nzbn: yup2.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
|
|
7261
|
-
rainOrShine: yup2.boolean().label("Rain or Shine").required("Please specify if the event is rain or shine"),
|
|
7262
|
-
tags: yup2.array().of(yup2.string().defined()).min(1, "Tags are required").required("Tags are required")
|
|
7263
|
-
});
|
|
7264
|
-
var paymentInfoSchema = yup2.object({
|
|
7265
|
-
paymentMethod: yup2.mixed().oneOf(
|
|
7266
|
-
Object.values(EnumPaymentMethod),
|
|
7267
|
-
"Please select a valid Payment method"
|
|
7268
|
-
).required("Please select a Payment method"),
|
|
7269
|
-
accountHolderName: yup2.string().when("paymentMethod", {
|
|
7270
|
-
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
7271
|
-
then: (schema) => schema.required("Account holder name is required for bank transfer").trim(),
|
|
7272
|
-
otherwise: (schema) => schema.notRequired()
|
|
7273
|
-
}),
|
|
7274
|
-
accountNumber: yup2.string().when("paymentMethod", {
|
|
7275
|
-
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
7276
|
-
then: (schema) => schema.required("Account number is required for bank transfer").matches(
|
|
7277
|
-
nzBankAccountRegex,
|
|
7278
|
-
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
7279
|
-
).trim(),
|
|
7280
|
-
otherwise: (schema) => schema.notRequired()
|
|
7281
|
-
}),
|
|
7282
|
-
link: yup2.string().when("paymentMethod", {
|
|
7283
|
-
is: (val) => val === "paypal" /* PAYPAL */ || val === "stripe" /* STRIPE */,
|
|
7284
|
-
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
7285
|
-
otherwise: (schema) => schema.notRequired()
|
|
7286
|
-
})
|
|
7287
|
-
});
|
|
7288
|
-
var eventInfoSchema = yup2.object().shape({
|
|
7289
|
-
applicationDeadlineHours: yup2.number().label("Application Deadline Hours").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
|
|
7290
|
-
dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
7291
|
-
eventId: yup2.string().trim().required("Event ID is required"),
|
|
7292
|
-
packInTime: yup2.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Pack In Time").typeError("Pack in time must be a number").min(1, "Pack in time must be at least 1").required("Pack in time is required").test("no-leading-zeros", "", noLeadingZeros("Pack in time")),
|
|
7293
|
-
paymentDueHours: yup2.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Payment Due Hours").typeError("Payment due hours must be a number").min(1, "Payment due hours must be at least 1").required("Payment due hours is required").test("no-leading-zeros", "", noLeadingZeros("Payment due hours")).test(
|
|
7294
|
-
"payment-before-deadline",
|
|
7295
|
-
"Payment due hours must be less than application deadline hours",
|
|
7296
|
-
function(value) {
|
|
7297
|
-
const { applicationDeadlineHours } = this.parent;
|
|
7298
|
-
return value < applicationDeadlineHours;
|
|
7299
|
-
}
|
|
7300
|
-
),
|
|
7301
|
-
paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required"),
|
|
7302
|
-
refundPolicy: yup2.array().of(
|
|
7303
|
-
yup2.object({
|
|
7304
|
-
category: yup2.mixed().required("Category is required"),
|
|
7305
|
-
label: yup2.string().required("Label is required"),
|
|
7306
|
-
value: yup2.boolean().required("Value is required")
|
|
7307
|
-
})
|
|
7308
|
-
).min(1, "At least one refund policy item is required").test(
|
|
7309
|
-
"at-least-one-true",
|
|
7310
|
-
"At least one refund policy option must be selected",
|
|
7311
|
-
(value) => {
|
|
7312
|
-
if (!value) return false;
|
|
7313
|
-
return value.some((item) => item.value === true);
|
|
7314
|
-
}
|
|
7315
|
-
).required("Refund policy is required")
|
|
7316
|
-
});
|
|
7317
|
-
|
|
7318
|
-
// src/yupSchema/vendor.ts
|
|
7319
|
-
var yup3 = __toESM(require("yup"));
|
|
7320
|
-
var vendorMenuSchema = yup3.object({
|
|
7321
|
-
description: yup3.string().nullable().optional(),
|
|
7322
|
-
name: yup3.string().nullable().required("Product name is required"),
|
|
7323
|
-
price: yup3.number().transform((v, o) => o === "" ? null : v).min(1, "Product price must be greater than 0").required("Product price is required"),
|
|
7324
|
-
priceUnit: yup3.string().required("Product unit is required")
|
|
7325
|
-
});
|
|
7326
|
-
var vendorSchema = globalResourceSchema.shape({
|
|
7327
|
-
categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
7328
|
-
foodTruck: yup3.boolean().label("Food Truck").required("Please specify if the vendor is a food truck"),
|
|
7329
|
-
products: yup3.object().shape({
|
|
7330
|
-
active: yup3.boolean().nullable().optional(),
|
|
7331
|
-
productsList: yup3.array().of(vendorMenuSchema).nullable().optional()
|
|
7332
|
-
}).nullable().optional(),
|
|
7333
|
-
vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
|
|
7334
|
-
});
|
|
7335
|
-
var unregisteredVendorSchema = yup3.object().shape({
|
|
7336
|
-
categoryIds: yup3.array().of(yup3.string().defined()).min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
7337
|
-
dateTime: yup3.array().of(dateTimeSchema).min(1, "DateTime list must contain at least one item").required("DateTime is required"),
|
|
7338
|
-
email: emailOptionalSchema,
|
|
7339
|
-
inviterId: yup3.string().required("Inviter ID is required"),
|
|
7340
|
-
name: yup3.string().label("Stallholder Name").trim().min(3, "Name must be at least 3 characters").required("Name is required"),
|
|
7341
|
-
region: yup3.string().label("Region").required("Region is required")
|
|
7342
|
-
});
|
|
7343
|
-
var vendorInfoSchema = yup3.object().shape({
|
|
7344
|
-
product: yup3.object().shape({
|
|
7345
|
-
foodFlavors: yup3.array().of(
|
|
7346
|
-
yup3.mixed().oneOf(Object.values(EnumFoodFlavor), "Invalid flavor selected").required("Flavor is required")
|
|
7347
|
-
).min(1, "Food flavors list must contain at least one item").required("Food flavors are required"),
|
|
7348
|
-
packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
|
|
7349
|
-
priceRange: yup3.object().shape({
|
|
7350
|
-
max: yup3.string().required("Max price is required").test(
|
|
7351
|
-
"is-number",
|
|
7352
|
-
"Max price must be a valid number",
|
|
7353
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
7354
|
-
).test(
|
|
7355
|
-
"is-greater",
|
|
7356
|
-
"Max price must be greater than or equal to Min price",
|
|
7357
|
-
function(max) {
|
|
7358
|
-
const { min } = this.parent;
|
|
7359
|
-
if (!max || !min) return true;
|
|
7360
|
-
const maxNum = Number(max);
|
|
7361
|
-
const minNum = Number(min);
|
|
7362
|
-
if (isNaN(maxNum) || isNaN(minNum)) return true;
|
|
7363
|
-
return maxNum >= minNum;
|
|
7364
|
-
}
|
|
7365
|
-
),
|
|
7366
|
-
min: yup3.string().required("Min price is required").test(
|
|
7367
|
-
"is-number",
|
|
7368
|
-
"Min price must be a valid number",
|
|
7369
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
7370
|
-
)
|
|
7371
|
-
}),
|
|
7372
|
-
producedIn: yup3.array().of(yup3.string().defined()).min(1, "Produced in list must contain at least one item").required("Produced in is required")
|
|
7373
|
-
}),
|
|
7374
|
-
requirements: yup3.object().shape({
|
|
7375
|
-
electricity: yup3.object().shape({
|
|
7376
|
-
details: yup3.string().trim().test(
|
|
7377
|
-
"details-required",
|
|
7378
|
-
"Please add electricity details",
|
|
7379
|
-
function(value) {
|
|
7380
|
-
return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
|
|
7381
|
-
}
|
|
7382
|
-
).nullable(),
|
|
7383
|
-
isRequired: yup3.boolean().required("Electricity requirement is required")
|
|
7384
|
-
}),
|
|
7385
|
-
gazebo: yup3.object().shape({
|
|
7386
|
-
details: yup3.string().trim().test(
|
|
7387
|
-
"details-required",
|
|
7388
|
-
"Please add gazebo details",
|
|
7389
|
-
function(value) {
|
|
7390
|
-
return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
|
|
7391
|
-
}
|
|
7392
|
-
).nullable(),
|
|
7393
|
-
isRequired: yup3.boolean().required("Gazebo requirement is required")
|
|
7394
|
-
}),
|
|
7395
|
-
table: yup3.object().shape({
|
|
7396
|
-
details: yup3.string().trim().test(
|
|
7397
|
-
"details-required",
|
|
7398
|
-
"Please add table details",
|
|
7399
|
-
function(value) {
|
|
7400
|
-
return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
|
|
7401
|
-
}
|
|
7402
|
-
).nullable(),
|
|
7403
|
-
isRequired: yup3.boolean().required("Table requirement is required")
|
|
7404
|
-
})
|
|
7405
|
-
}).optional(),
|
|
7406
|
-
stallInfo: yup3.object().shape({
|
|
7407
|
-
size: yup3.object().shape({
|
|
7408
|
-
depth: yup3.string().required("Depth is required").test(
|
|
7409
|
-
"is-number",
|
|
7410
|
-
"Depth must be a valid number",
|
|
7411
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
7412
|
-
).test(
|
|
7413
|
-
"is-positive",
|
|
7414
|
-
"Depth must be greater than 0",
|
|
7415
|
-
(value) => value !== void 0 && value !== "" && Number(value) > 0
|
|
7416
|
-
),
|
|
7417
|
-
width: yup3.string().required("Width is required").test(
|
|
7418
|
-
"is-number",
|
|
7419
|
-
"Width must be a valid number",
|
|
7420
|
-
(value) => value !== void 0 && value !== "" && !isNaN(Number(value))
|
|
7421
|
-
).test(
|
|
7422
|
-
"is-positive",
|
|
7423
|
-
"Width must be greater than 0",
|
|
7424
|
-
(value) => value !== void 0 && value !== "" && Number(value) > 0
|
|
7425
|
-
)
|
|
7426
|
-
})
|
|
7427
|
-
}),
|
|
7428
|
-
vendorId: yup3.string().trim().required("Vendor ID is required")
|
|
7429
|
-
});
|
|
7430
|
-
|
|
7431
|
-
// src/yupSchema/user.ts
|
|
7432
|
-
var yup4 = __toESM(require("yup"));
|
|
7433
|
-
var userSchema = yup4.object().shape({
|
|
7434
|
-
active: yup4.boolean().required("Active is required"),
|
|
7435
|
-
email: emailRequiredSchema,
|
|
7436
|
-
firstName: yup4.string().label("First Name").trim().required("First name is required"),
|
|
7437
|
-
lastName: yup4.string().label("Last Name").trim().required("Last name is required"),
|
|
7438
|
-
isTester: yup4.boolean().required("Tester status is required"),
|
|
7439
|
-
password: yup4.string().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
|
|
7440
|
-
preferredRegion: yup4.string().label("Preferred Region").required("Preferred region is required"),
|
|
7441
|
-
confirmPassword: yup4.string().nullable().trim().label("Confirm Password").when("password", {
|
|
7442
|
-
is: (val) => !!val,
|
|
7443
|
-
// only necessary if password typed
|
|
7444
|
-
then: (schema) => schema.required("Confirm Password is required").oneOf([yup4.ref("password")], "Passwords must match"),
|
|
7445
|
-
otherwise: (schema) => schema.notRequired()
|
|
7446
|
-
}),
|
|
7447
|
-
role: yup4.mixed().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
7448
|
-
});
|
|
7449
|
-
|
|
7450
|
-
// src/yupSchema/auth.ts
|
|
7451
|
-
var yup5 = __toESM(require("yup"));
|
|
7452
|
-
var loginSchema = yup5.object().shape({
|
|
7453
|
-
email: emailRequiredSchema,
|
|
7454
|
-
password: passwordSchema
|
|
7455
|
-
});
|
|
7456
|
-
var registerSchema = yup5.object().shape({
|
|
7457
|
-
email: emailRequiredSchema,
|
|
7458
|
-
firstName: yup5.string().label("First Name").required("First Name is required"),
|
|
7459
|
-
lastName: yup5.string().label("Last Name").required("Last Name is required"),
|
|
7460
|
-
password: passwordSchema,
|
|
7461
|
-
preferredRegion: yup5.string().label("Preferred Region").required("Preferred Region is required")
|
|
7462
|
-
});
|
|
7463
|
-
var requestPasswordResetSchema = yup5.object().shape({
|
|
7464
|
-
email: emailRequiredSchema
|
|
7465
|
-
});
|
|
7466
|
-
var resetPasswordSchema = yup5.object().shape({
|
|
7467
|
-
email: emailRequiredSchema,
|
|
7468
|
-
password: passwordSchema,
|
|
7469
|
-
// eslint-disable-next-line sort-keys
|
|
7470
|
-
confirmPassword: yup5.string().oneOf([yup5.ref("password")], "Passwords must match").required("Confirm Password is required")
|
|
7471
|
-
});
|
|
7472
|
-
var validateVerificationTokenSchema = yup5.object().shape({
|
|
7473
|
-
email: emailRequiredSchema,
|
|
7474
|
-
verificationToken: yup5.string().required("Verification code is required").matches(/^\d{6}$/, "Verification code must be exactly 6 digits")
|
|
7475
|
-
});
|
|
7476
|
-
|
|
7477
|
-
// src/yupSchema/ad.ts
|
|
7478
|
-
var yup6 = __toESM(require("yup"));
|
|
7479
|
-
|
|
7480
|
-
// src/types/ad.ts
|
|
7481
|
-
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
7482
|
-
EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
|
|
7483
|
-
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
7484
|
-
EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
|
|
7485
|
-
EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
|
|
7486
|
-
return EnumAdShowOn2;
|
|
7487
|
-
})(EnumAdShowOn || {});
|
|
7488
|
-
var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
7489
|
-
EnumAdStatus2["ACTIVE"] = "Active";
|
|
7490
|
-
EnumAdStatus2["PAUSED"] = "Paused";
|
|
7491
|
-
EnumAdStatus2["EXPIRED"] = "Expired";
|
|
7492
|
-
return EnumAdStatus2;
|
|
7493
|
-
})(EnumAdStatus || {});
|
|
7494
|
-
var EnumAdType = /* @__PURE__ */ ((EnumAdType2) => {
|
|
7495
|
-
EnumAdType2["SPONSORED"] = "Sponsored";
|
|
7496
|
-
EnumAdType2["FREE"] = "Free";
|
|
7497
|
-
return EnumAdType2;
|
|
7498
|
-
})(EnumAdType || {});
|
|
7499
|
-
var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
|
|
7500
|
-
EnumAdStyle2["BLOOM"] = "Bloom";
|
|
7501
|
-
EnumAdStyle2["RISE"] = "Rise";
|
|
7502
|
-
return EnumAdStyle2;
|
|
7503
|
-
})(EnumAdStyle || {});
|
|
7504
|
-
|
|
7505
|
-
// src/yupSchema/ad.ts
|
|
7506
|
-
var adResourceSchema = yup6.object({
|
|
7507
|
-
adDescription: yup6.string().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
|
|
7508
|
-
adImage: yup6.string().required("Ad image is required"),
|
|
7509
|
-
adStyle: yup6.mixed().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
|
|
7510
|
-
adTitle: yup6.string().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
|
|
7511
|
-
adType: yup6.mixed().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
|
|
7512
|
-
resourceId: yup6.string().required("Resource ID is required"),
|
|
7513
|
-
resourceName: yup6.string().required("Resource name is required"),
|
|
7514
|
-
resourceRegion: yup6.string().required("Resource region is required"),
|
|
7515
|
-
resourceType: yup6.mixed().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required")
|
|
7516
|
-
});
|
|
7517
|
-
var adSchema = yup6.object().shape({
|
|
7518
|
-
active: yup6.boolean().required("Active status is required"),
|
|
7519
|
-
end: yup6.date().required("End date is required").test("is-future-date", "End date must be in the future", (value) => {
|
|
7520
|
-
if (!value) return false;
|
|
7521
|
-
const endDate = new Date(value);
|
|
7522
|
-
const now = /* @__PURE__ */ new Date();
|
|
7523
|
-
return endDate > now;
|
|
7524
|
-
}).when("start", {
|
|
7525
|
-
is: (val) => val && val.length > 0,
|
|
7526
|
-
then: (schema) => schema.test(
|
|
7527
|
-
"is-after-start",
|
|
7528
|
-
"End date must be after start date",
|
|
7529
|
-
function(value) {
|
|
7530
|
-
const { start } = this.parent;
|
|
7531
|
-
if (!value || !start) return false;
|
|
7532
|
-
return new Date(value) > new Date(start);
|
|
7533
|
-
}
|
|
7534
|
-
)
|
|
7535
|
-
}),
|
|
7536
|
-
resource: adResourceSchema.required("Resource information is required"),
|
|
7537
|
-
showOn: yup6.array().of(yup6.mixed().oneOf(Object.values(EnumAdShowOn)).required()).min(1, "At least one display location is required").required("Display location is required"),
|
|
7538
|
-
status: yup6.mixed().oneOf(Object.values(EnumAdStatus)).required("Ad status is required"),
|
|
7539
|
-
start: yup6.date().when("status", {
|
|
7540
|
-
is: (status) => status !== "Active" /* ACTIVE */,
|
|
7541
|
-
then: () => yup6.date().required("Start date is required").test("is-future-date", "Start date must be in the future", (value) => {
|
|
7542
|
-
if (!value) return false;
|
|
7543
|
-
return value > /* @__PURE__ */ new Date();
|
|
7544
|
-
}),
|
|
7545
|
-
// Keep `start` optional (not null) when ACTIVE to match TS type `start?: Date`.
|
|
7546
|
-
otherwise: () => yup6.date().notRequired()
|
|
7547
|
-
}),
|
|
7548
|
-
targetRegion: yup6.array().of(yup6.string().required()).min(1, "At least one target region is required").required("Target region is required")
|
|
7549
|
-
});
|
|
7550
|
-
|
|
7551
|
-
// src/yupSchema/partner.ts
|
|
7552
|
-
var yup7 = __toESM(require("yup"));
|
|
7553
|
-
var partnerSchema = globalResourceSchema.shape({
|
|
7554
|
-
location: locationSchema,
|
|
7555
|
-
nzbn: yup7.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
|
|
7556
|
-
partnerType: yup7.mixed().oneOf(Object.values(EnumPartnerType), "Please select a valid Partner type").required("Please select a Partner type")
|
|
7557
|
-
});
|
|
7558
|
-
|
|
7559
|
-
// src/yupSchema/post.ts
|
|
7560
|
-
var yup8 = __toESM(require("yup"));
|
|
7561
|
-
|
|
7562
|
-
// src/types/post.ts
|
|
7563
|
-
var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
7564
|
-
EnumPostType2["DAILY_MEETS"] = "daily_meets";
|
|
7565
|
-
EnumPostType2["DAILY_TIPS"] = "daily_tips";
|
|
7566
|
-
EnumPostType2["DAILY_GAMES"] = "daily_games";
|
|
7567
|
-
return EnumPostType2;
|
|
7568
|
-
})(EnumPostType || {});
|
|
7569
|
-
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
7570
|
-
EnumPostContentType2["GAME"] = "game";
|
|
7571
|
-
EnumPostContentType2["IMAGE"] = "image";
|
|
7572
|
-
EnumPostContentType2["LIST"] = "list";
|
|
7573
|
-
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
7574
|
-
EnumPostContentType2["VIDEO"] = "video";
|
|
7575
|
-
return EnumPostContentType2;
|
|
7576
|
-
})(EnumPostContentType || {});
|
|
7577
|
-
|
|
7578
|
-
// src/yupSchema/post.ts
|
|
7579
|
-
var postContentSchema = yup8.object().shape({
|
|
7580
|
-
contentData: yup8.mixed().optional().nullable(),
|
|
7581
|
-
contentOrder: yup8.number().nullable(),
|
|
7582
|
-
contentType: yup8.mixed().oneOf(Object.values(EnumPostContentType)).nullable()
|
|
7583
|
-
});
|
|
7584
|
-
var postSchema = yup8.object().shape({
|
|
7585
|
-
active: yup8.boolean().required(),
|
|
7586
|
-
caption: yup8.string().required(),
|
|
7587
|
-
content: yup8.array().of(postContentSchema).required(),
|
|
7588
|
-
postType: yup8.mixed().oneOf(Object.values(EnumPostType)).required(),
|
|
7589
|
-
resource: yup8.object({
|
|
7590
|
-
resourceId: yup8.string().required(),
|
|
7591
|
-
resourceRegion: yup8.string().required(),
|
|
7592
|
-
resourceType: yup8.mixed().oneOf(Object.values(EnumResourceType)).required()
|
|
7593
|
-
}).nullable().optional(),
|
|
7594
|
-
tags: yup8.array().of(yup8.string().required()).nullable().optional(),
|
|
7595
|
-
title: yup8.string().required()
|
|
7596
|
-
});
|
|
7597
|
-
|
|
7598
|
-
// src/yupSchema/appSettings.ts
|
|
7599
|
-
var yup9 = __toESM(require("yup"));
|
|
7600
|
-
var appSettingsSchema = yup9.object({
|
|
7601
|
-
appVersion: yup9.string().trim().label("App Version").matches(
|
|
7602
|
-
/^\d+\.\d+\.\d+$/,
|
|
7603
|
-
"App Version must be in the format X.Y.Z (e.g. 1.12.50)"
|
|
7604
|
-
).required("App Version is required"),
|
|
7605
|
-
isOfflineMode: yup9.boolean().label("Is Offline Mode").required("Is Offline Mode is required")
|
|
7606
|
-
});
|
|
7607
|
-
|
|
7608
|
-
// src/hooks/utils.ts
|
|
7609
|
-
var defaultLocation = {
|
|
7610
|
-
city: "",
|
|
7611
|
-
country: "",
|
|
7612
|
-
fullAddress: "",
|
|
7613
|
-
geo: {
|
|
7614
|
-
coordinates: [0, 0],
|
|
7615
|
-
// [longitude, latitude]
|
|
7616
|
-
type: "Point"
|
|
7617
|
-
},
|
|
7618
|
-
latitude: 0,
|
|
7619
|
-
longitude: 0,
|
|
7620
|
-
region: ""
|
|
7621
|
-
};
|
|
7622
|
-
var globalDefaultValues = {
|
|
7623
|
-
active: false,
|
|
7624
|
-
associates: null,
|
|
7625
|
-
contactDetails: {
|
|
7626
|
-
email: null,
|
|
7627
|
-
landlinePhone: null,
|
|
7628
|
-
mobilePhone: null
|
|
7629
|
-
},
|
|
7630
|
-
cover: {
|
|
7631
|
-
active: true,
|
|
7632
|
-
source: "",
|
|
7633
|
-
title: ""
|
|
7634
|
-
},
|
|
7635
|
-
coverUpload: {
|
|
7636
|
-
active: true,
|
|
7637
|
-
source: "",
|
|
7638
|
-
title: ""
|
|
7639
|
-
},
|
|
7640
|
-
description: "",
|
|
7641
|
-
images: null,
|
|
7642
|
-
imagesUpload: null,
|
|
7643
|
-
logo: null,
|
|
7644
|
-
logoUpload: null,
|
|
7645
|
-
name: "",
|
|
7646
|
-
promoCodes: [],
|
|
7647
|
-
region: "",
|
|
7648
|
-
socialMedia: []
|
|
7649
|
-
};
|
|
7650
|
-
var defaultPartnerFormValues = {
|
|
7651
|
-
...globalDefaultValues,
|
|
7652
|
-
location: defaultLocation,
|
|
7653
|
-
nzbn: "",
|
|
7654
|
-
partnerType: ""
|
|
7655
|
-
};
|
|
7656
|
-
var defaultEventFormValues = {
|
|
7657
|
-
...globalDefaultValues,
|
|
7658
|
-
claimed: true,
|
|
7659
|
-
dateTime: [],
|
|
7660
|
-
eventType: "",
|
|
7661
|
-
googlePlaceId: null,
|
|
7662
|
-
location: defaultLocation,
|
|
7663
|
-
nzbn: "",
|
|
7664
|
-
provider: null,
|
|
7665
|
-
rainOrShine: false,
|
|
7666
|
-
tags: []
|
|
7667
|
-
};
|
|
7668
|
-
var defaultEventInfoFormValues = {
|
|
7669
|
-
applicationDeadlineHours: 24,
|
|
7670
|
-
dateTime: [],
|
|
7671
|
-
eventId: "",
|
|
7672
|
-
packInTime: 2,
|
|
7673
|
-
// e.g., 2 hours before event opens
|
|
7674
|
-
paymentDueHours: 12,
|
|
7675
|
-
paymentInfo: [],
|
|
7676
|
-
refundPolicy: [],
|
|
7677
|
-
requirements: []
|
|
7678
|
-
};
|
|
7679
|
-
var defaultVendorFormValues = {
|
|
7680
|
-
...globalDefaultValues,
|
|
7681
|
-
availability: {
|
|
7682
|
-
corporate: false,
|
|
7683
|
-
private: false,
|
|
7684
|
-
school: false
|
|
7685
|
-
},
|
|
7686
|
-
categories: [],
|
|
7687
|
-
claimed: true,
|
|
7688
|
-
foodTruck: false,
|
|
7689
|
-
products: null,
|
|
7690
|
-
unregisteredVendorId: null,
|
|
7691
|
-
vendorType: "Stallholder" /* STALLHOLDER */
|
|
7692
|
-
};
|
|
7693
|
-
var defaultUnregisteredVendorFormValues = {
|
|
7694
|
-
categoryIds: [],
|
|
7695
|
-
dateTime: [],
|
|
7696
|
-
email: null,
|
|
7697
|
-
inviterId: "",
|
|
7698
|
-
name: "",
|
|
7699
|
-
region: ""
|
|
7700
|
-
};
|
|
7701
|
-
var defaultVendorInfoFormValues = {
|
|
7702
|
-
compliance: { foodBeverageLicense: false, liabilityInsurance: false },
|
|
7703
|
-
documents: null,
|
|
7704
|
-
documentsUpload: null,
|
|
7705
|
-
product: {
|
|
7706
|
-
foodFlavors: [],
|
|
7707
|
-
packaging: [],
|
|
7708
|
-
priceRange: { max: "", min: "" },
|
|
7709
|
-
producedIn: []
|
|
7710
|
-
},
|
|
7711
|
-
requirements: {
|
|
7712
|
-
electricity: { details: null, isRequired: false },
|
|
7713
|
-
gazebo: { details: null, isRequired: false },
|
|
7714
|
-
table: { details: null, isRequired: false }
|
|
7715
|
-
},
|
|
7716
|
-
stallInfo: {
|
|
7717
|
-
size: { depth: "", width: "" }
|
|
7718
|
-
},
|
|
7719
|
-
vendorId: ""
|
|
7720
|
-
};
|
|
7721
|
-
function mapBaseResourceTypeToFormData(data) {
|
|
7722
|
-
return {
|
|
7723
|
-
_id: data._id,
|
|
7724
|
-
active: data.active,
|
|
7725
|
-
associates: data.associates,
|
|
7726
|
-
contactDetails: data.contactDetails,
|
|
7727
|
-
cover: data.cover,
|
|
7728
|
-
coverUpload: data.coverUpload,
|
|
7729
|
-
description: data.description,
|
|
7730
|
-
images: data.images,
|
|
7731
|
-
imagesUpload: data.imagesUpload,
|
|
7732
|
-
logo: data.logo,
|
|
7733
|
-
logoUpload: data.logoUpload,
|
|
7734
|
-
name: data.name,
|
|
7735
|
-
owner: data.owner,
|
|
7736
|
-
promoCodes: data.promoCodes,
|
|
7737
|
-
region: data.region,
|
|
7738
|
-
socialMedia: data.socialMedia,
|
|
7739
|
-
termsAgreement: data.termsAgreement
|
|
7740
|
-
};
|
|
7741
|
-
}
|
|
7742
|
-
|
|
7743
|
-
// src/hooks/vendor/useVendorForm.ts
|
|
7744
|
-
function useVendorForm(data) {
|
|
7745
|
-
const {
|
|
7746
|
-
control,
|
|
7747
|
-
formState,
|
|
7748
|
-
getValues,
|
|
7749
|
-
handleSubmit,
|
|
7750
|
-
reset,
|
|
7751
|
-
setValue,
|
|
7752
|
-
watch
|
|
7753
|
-
} = (0, import_react_hook_form.useForm)({
|
|
7754
|
-
defaultValues: defaultVendorFormValues,
|
|
7755
|
-
resolver: (0, import_yup.yupResolver)(vendorSchema)
|
|
7756
|
-
});
|
|
7757
|
-
React.useEffect(() => {
|
|
7758
|
-
if (data) {
|
|
7759
|
-
reset({
|
|
7760
|
-
...mapBaseResourceTypeToFormData(data),
|
|
7761
|
-
availability: data.availability,
|
|
7762
|
-
calendar: data.calendar,
|
|
7763
|
-
categories: data.categories,
|
|
7764
|
-
claimed: data.claimed ?? false,
|
|
7765
|
-
foodTruck: data.foodTruck,
|
|
7766
|
-
products: data.products,
|
|
7767
|
-
unregisteredVendorId: data.unregisteredVendorId,
|
|
7768
|
-
vendorType: data.vendorType
|
|
7769
|
-
});
|
|
7770
|
-
} else {
|
|
7771
|
-
reset(defaultVendorFormValues);
|
|
7772
|
-
}
|
|
7773
|
-
}, [data]);
|
|
7774
|
-
const {
|
|
7775
|
-
_id,
|
|
7776
|
-
active,
|
|
7777
|
-
associates,
|
|
7778
|
-
availability,
|
|
7779
|
-
calendar,
|
|
7780
|
-
categories,
|
|
7781
|
-
claimed,
|
|
7782
|
-
contactDetails,
|
|
7783
|
-
cover,
|
|
7784
|
-
coverUpload,
|
|
7785
|
-
description,
|
|
7786
|
-
foodTruck,
|
|
7787
|
-
images,
|
|
7788
|
-
imagesUpload,
|
|
7789
|
-
logo,
|
|
7790
|
-
logoUpload,
|
|
7791
|
-
name,
|
|
7792
|
-
owner,
|
|
7793
|
-
products,
|
|
7794
|
-
promoCodes,
|
|
7795
|
-
region,
|
|
7796
|
-
socialMedia: socialMedia2,
|
|
7797
|
-
termsAgreement,
|
|
7798
|
-
unregisteredVendorId,
|
|
7799
|
-
vendorType
|
|
7800
|
-
} = getValues();
|
|
7801
|
-
return {
|
|
7802
|
-
control,
|
|
7803
|
-
fields: {
|
|
7804
|
-
_id,
|
|
7805
|
-
active,
|
|
7806
|
-
associates,
|
|
7807
|
-
availability,
|
|
7808
|
-
calendar,
|
|
7809
|
-
categories,
|
|
7810
|
-
claimed,
|
|
7811
|
-
contactDetails,
|
|
7812
|
-
cover,
|
|
7813
|
-
coverUpload,
|
|
7814
|
-
description,
|
|
7815
|
-
foodTruck,
|
|
7816
|
-
images,
|
|
7817
|
-
imagesUpload,
|
|
7818
|
-
logo,
|
|
7819
|
-
logoUpload,
|
|
7820
|
-
name,
|
|
7821
|
-
owner,
|
|
7822
|
-
products,
|
|
7823
|
-
promoCodes,
|
|
7824
|
-
region,
|
|
7825
|
-
socialMedia: socialMedia2,
|
|
7826
|
-
termsAgreement,
|
|
7827
|
-
unregisteredVendorId,
|
|
7828
|
-
vendorType
|
|
7829
|
-
},
|
|
7830
|
-
formState,
|
|
7831
|
-
getValues,
|
|
7832
|
-
handleSubmit,
|
|
7833
|
-
reset,
|
|
7834
|
-
setValue,
|
|
7835
|
-
watch
|
|
7836
|
-
};
|
|
7837
|
-
}
|
|
7838
|
-
|
|
7839
|
-
// src/hooks/vendor/useVendorInfoForm.ts
|
|
7840
|
-
var import_yup2 = require("@hookform/resolvers/yup");
|
|
7841
|
-
var React2 = __toESM(require("react"));
|
|
7842
|
-
var import_react_hook_form2 = require("react-hook-form");
|
|
7843
|
-
function useVendorInfoForm(data) {
|
|
7844
|
-
const {
|
|
7845
|
-
control,
|
|
7846
|
-
formState,
|
|
7847
|
-
getValues,
|
|
7848
|
-
handleSubmit,
|
|
7849
|
-
reset,
|
|
7850
|
-
setValue,
|
|
7851
|
-
watch
|
|
7852
|
-
} = (0, import_react_hook_form2.useForm)({
|
|
7853
|
-
defaultValues: defaultVendorInfoFormValues,
|
|
7854
|
-
resolver: (0, import_yup2.yupResolver)(vendorInfoSchema)
|
|
7855
|
-
});
|
|
7856
|
-
React2.useEffect(() => {
|
|
7857
|
-
if (data) {
|
|
7858
|
-
reset({
|
|
7859
|
-
_id: data._id,
|
|
7860
|
-
compliance: data.compliance,
|
|
7861
|
-
documents: data.documents,
|
|
7862
|
-
documentsUpload: data.documentsUpload,
|
|
7863
|
-
product: data.product,
|
|
7864
|
-
requirements: data.requirements,
|
|
7865
|
-
stallInfo: data.stallInfo,
|
|
7866
|
-
vendorId: data.vendorId
|
|
7867
|
-
});
|
|
7868
|
-
} else {
|
|
7869
|
-
reset(defaultVendorInfoFormValues);
|
|
7870
|
-
}
|
|
7871
|
-
}, [data]);
|
|
7872
|
-
const {
|
|
7873
|
-
_id,
|
|
7874
|
-
compliance,
|
|
7875
|
-
documents,
|
|
7876
|
-
documentsUpload,
|
|
7877
|
-
product,
|
|
7878
|
-
requirements,
|
|
7879
|
-
stallInfo,
|
|
7880
|
-
vendorId
|
|
7881
|
-
} = getValues();
|
|
7882
|
-
return {
|
|
7883
|
-
control,
|
|
7884
|
-
fields: {
|
|
7885
|
-
_id,
|
|
7886
|
-
compliance,
|
|
7887
|
-
documents,
|
|
7888
|
-
documentsUpload,
|
|
7889
|
-
product,
|
|
7890
|
-
requirements,
|
|
7891
|
-
stallInfo,
|
|
7892
|
-
vendorId
|
|
7893
|
-
},
|
|
7894
|
-
formState,
|
|
7895
|
-
getValues,
|
|
7896
|
-
handleSubmit,
|
|
7897
|
-
reset,
|
|
7898
|
-
setValue,
|
|
7899
|
-
watch
|
|
7900
|
-
};
|
|
7901
|
-
}
|
|
7902
|
-
|
|
7903
|
-
// src/hooks/vendor/useUnregisteredVendorForm.ts
|
|
7904
|
-
var import_yup3 = require("@hookform/resolvers/yup");
|
|
7905
|
-
var React3 = __toESM(require("react"));
|
|
7906
|
-
var import_react_hook_form3 = require("react-hook-form");
|
|
7907
|
-
function useUnregisteredVendorForm(data) {
|
|
7908
|
-
const {
|
|
7909
|
-
control,
|
|
7910
|
-
formState,
|
|
7911
|
-
getValues,
|
|
7912
|
-
handleSubmit,
|
|
7913
|
-
reset,
|
|
7914
|
-
setValue,
|
|
7915
|
-
watch
|
|
7916
|
-
} = (0, import_react_hook_form3.useForm)({
|
|
7917
|
-
defaultValues: defaultUnregisteredVendorFormValues,
|
|
7918
|
-
resolver: (0, import_yup3.yupResolver)(unregisteredVendorSchema)
|
|
7919
|
-
});
|
|
7920
|
-
React3.useEffect(() => {
|
|
7921
|
-
if (data) {
|
|
7922
|
-
reset({
|
|
7923
|
-
categoryIds: data.categoryIds,
|
|
7924
|
-
dateTime: data.dateTime,
|
|
7925
|
-
email: data.email,
|
|
7926
|
-
inviterId: data.inviterId,
|
|
7927
|
-
name: data.name,
|
|
7928
|
-
region: data.region
|
|
7929
|
-
});
|
|
7930
|
-
} else {
|
|
7931
|
-
reset(defaultUnregisteredVendorFormValues);
|
|
7932
|
-
}
|
|
7933
|
-
}, [data]);
|
|
7934
|
-
const { categoryIds, dateTime, email, inviterId, name, region } = getValues();
|
|
7935
|
-
return {
|
|
7936
|
-
control,
|
|
7937
|
-
fields: {
|
|
7938
|
-
categoryIds,
|
|
7939
|
-
dateTime,
|
|
7940
|
-
email,
|
|
7941
|
-
inviterId,
|
|
7942
|
-
name,
|
|
7943
|
-
region
|
|
7944
|
-
},
|
|
7945
|
-
formState,
|
|
7946
|
-
getValues,
|
|
7947
|
-
handleSubmit,
|
|
7948
|
-
reset,
|
|
7949
|
-
setValue,
|
|
7950
|
-
watch
|
|
7951
|
-
};
|
|
7952
|
-
}
|
|
7953
|
-
|
|
7954
|
-
// src/hooks/event/useEventForm.ts
|
|
7955
|
-
var import_yup4 = require("@hookform/resolvers/yup");
|
|
7956
|
-
var React4 = __toESM(require("react"));
|
|
7957
|
-
var import_react_hook_form4 = require("react-hook-form");
|
|
7958
|
-
function useEventForm(data) {
|
|
7959
|
-
const {
|
|
7960
|
-
control,
|
|
7961
|
-
formState,
|
|
7962
|
-
getValues,
|
|
7963
|
-
handleSubmit,
|
|
7964
|
-
reset,
|
|
7965
|
-
setValue,
|
|
7966
|
-
watch
|
|
7967
|
-
} = (0, import_react_hook_form4.useForm)({
|
|
7968
|
-
defaultValues: defaultEventFormValues,
|
|
7969
|
-
resolver: (0, import_yup4.yupResolver)(eventSchema)
|
|
7970
|
-
});
|
|
7971
|
-
React4.useEffect(() => {
|
|
7972
|
-
if (data) {
|
|
7973
|
-
reset({
|
|
7974
|
-
...mapBaseResourceTypeToFormData(data),
|
|
7975
|
-
claimed: data.claimed ?? false,
|
|
7976
|
-
dateTime: data.dateTime,
|
|
7977
|
-
eventType: data.eventType,
|
|
7978
|
-
googlePlaceId: data.googlePlaceId,
|
|
7979
|
-
location: data.location,
|
|
7980
|
-
nzbn: data.nzbn,
|
|
7981
|
-
provider: data.provider,
|
|
7982
|
-
rainOrShine: data.rainOrShine,
|
|
7983
|
-
tags: data.tags
|
|
7984
|
-
});
|
|
7985
|
-
} else {
|
|
7986
|
-
reset(defaultEventFormValues);
|
|
7987
|
-
}
|
|
7988
|
-
}, [data]);
|
|
7989
|
-
const {
|
|
7990
|
-
_id,
|
|
7991
|
-
active,
|
|
7992
|
-
associates,
|
|
7993
|
-
claimed,
|
|
7994
|
-
contactDetails,
|
|
7995
|
-
cover,
|
|
7996
|
-
coverUpload,
|
|
7997
|
-
dateTime,
|
|
7998
|
-
description,
|
|
7999
|
-
eventType,
|
|
8000
|
-
googlePlaceId,
|
|
8001
|
-
images,
|
|
8002
|
-
imagesUpload,
|
|
8003
|
-
location,
|
|
8004
|
-
logo,
|
|
8005
|
-
logoUpload,
|
|
8006
|
-
name,
|
|
8007
|
-
nzbn,
|
|
8008
|
-
owner,
|
|
8009
|
-
promoCodes,
|
|
8010
|
-
provider,
|
|
8011
|
-
rainOrShine,
|
|
8012
|
-
region,
|
|
8013
|
-
socialMedia: socialMedia2,
|
|
8014
|
-
tags,
|
|
8015
|
-
termsAgreement
|
|
8016
|
-
} = getValues();
|
|
8017
|
-
return {
|
|
8018
|
-
control,
|
|
8019
|
-
fields: {
|
|
8020
|
-
_id,
|
|
8021
|
-
active,
|
|
8022
|
-
associates,
|
|
8023
|
-
claimed,
|
|
8024
|
-
contactDetails,
|
|
8025
|
-
cover,
|
|
8026
|
-
coverUpload,
|
|
8027
|
-
dateTime,
|
|
8028
|
-
description,
|
|
8029
|
-
eventType,
|
|
8030
|
-
googlePlaceId,
|
|
8031
|
-
images,
|
|
8032
|
-
imagesUpload,
|
|
8033
|
-
location,
|
|
8034
|
-
logo,
|
|
8035
|
-
logoUpload,
|
|
8036
|
-
name,
|
|
8037
|
-
nzbn,
|
|
8038
|
-
owner,
|
|
8039
|
-
promoCodes,
|
|
8040
|
-
provider,
|
|
8041
|
-
rainOrShine,
|
|
8042
|
-
region,
|
|
8043
|
-
socialMedia: socialMedia2,
|
|
8044
|
-
tags,
|
|
8045
|
-
termsAgreement
|
|
8046
|
-
},
|
|
8047
|
-
formState,
|
|
8048
|
-
getValues,
|
|
8049
|
-
handleSubmit,
|
|
8050
|
-
reset,
|
|
8051
|
-
setValue,
|
|
8052
|
-
watch
|
|
8053
|
-
};
|
|
8054
|
-
}
|
|
8055
|
-
|
|
8056
|
-
// src/hooks/event/useEventInfoForm.ts
|
|
8057
|
-
var import_yup5 = require("@hookform/resolvers/yup");
|
|
8058
|
-
var React5 = __toESM(require("react"));
|
|
8059
|
-
var import_react_hook_form5 = require("react-hook-form");
|
|
8060
|
-
function useEventInfoForm(data) {
|
|
8061
|
-
const {
|
|
8062
|
-
control,
|
|
8063
|
-
formState,
|
|
8064
|
-
getValues,
|
|
8065
|
-
handleSubmit,
|
|
8066
|
-
reset,
|
|
8067
|
-
setValue,
|
|
8068
|
-
watch
|
|
8069
|
-
} = (0, import_react_hook_form5.useForm)({
|
|
8070
|
-
defaultValues: defaultEventInfoFormValues,
|
|
8071
|
-
resolver: (0, import_yup5.yupResolver)(eventInfoSchema)
|
|
8072
|
-
});
|
|
8073
|
-
React5.useEffect(() => {
|
|
8074
|
-
if (data) {
|
|
8075
|
-
reset({
|
|
8076
|
-
_id: data._id,
|
|
8077
|
-
applicationDeadlineHours: data.applicationDeadlineHours,
|
|
8078
|
-
dateTime: data.dateTime,
|
|
8079
|
-
eventId: data.eventId,
|
|
8080
|
-
packInTime: data.packInTime,
|
|
8081
|
-
paymentDueHours: data.paymentDueHours,
|
|
8082
|
-
paymentInfo: data.paymentInfo,
|
|
8083
|
-
refundPolicy: data.refundPolicy,
|
|
8084
|
-
requirements: data.requirements
|
|
8085
|
-
});
|
|
8086
|
-
} else {
|
|
8087
|
-
reset(defaultEventInfoFormValues);
|
|
8088
|
-
}
|
|
8089
|
-
}, [data]);
|
|
8090
|
-
const {
|
|
8091
|
-
_id,
|
|
8092
|
-
applicationDeadlineHours,
|
|
8093
|
-
dateTime,
|
|
8094
|
-
eventId,
|
|
8095
|
-
packInTime,
|
|
8096
|
-
paymentDueHours,
|
|
8097
|
-
paymentInfo,
|
|
8098
|
-
refundPolicy,
|
|
8099
|
-
requirements
|
|
8100
|
-
} = getValues();
|
|
8101
|
-
return {
|
|
8102
|
-
control,
|
|
8103
|
-
fields: {
|
|
8104
|
-
_id,
|
|
8105
|
-
applicationDeadlineHours,
|
|
8106
|
-
dateTime,
|
|
8107
|
-
eventId,
|
|
8108
|
-
packInTime,
|
|
8109
|
-
paymentDueHours,
|
|
8110
|
-
paymentInfo,
|
|
8111
|
-
refundPolicy,
|
|
8112
|
-
requirements
|
|
8113
|
-
},
|
|
8114
|
-
formState,
|
|
8115
|
-
getValues,
|
|
8116
|
-
handleSubmit,
|
|
8117
|
-
reset,
|
|
8118
|
-
setValue,
|
|
8119
|
-
watch
|
|
8120
|
-
};
|
|
8121
|
-
}
|
|
8122
|
-
|
|
8123
|
-
// src/hooks/useUserForm.ts
|
|
8124
|
-
var import_yup6 = require("@hookform/resolvers/yup");
|
|
8125
|
-
var React6 = __toESM(require("react"));
|
|
8126
|
-
var import_react_hook_form6 = require("react-hook-form");
|
|
8127
|
-
var defaultValues = {
|
|
8128
|
-
active: false,
|
|
8129
|
-
avatar: null,
|
|
8130
|
-
avatarUpload: null,
|
|
8131
|
-
confirmPassword: "",
|
|
8132
|
-
email: "",
|
|
8133
|
-
firstName: "",
|
|
8134
|
-
isTester: false,
|
|
8135
|
-
lastName: "",
|
|
8136
|
-
password: null,
|
|
8137
|
-
preferredRegion: "",
|
|
8138
|
-
role: "customer" /* CUSTOMER */
|
|
8139
|
-
};
|
|
8140
|
-
function useUserForm(data) {
|
|
8141
|
-
const {
|
|
8142
|
-
control,
|
|
8143
|
-
formState,
|
|
8144
|
-
getValues,
|
|
8145
|
-
handleSubmit,
|
|
8146
|
-
reset,
|
|
8147
|
-
setValue,
|
|
8148
|
-
watch
|
|
8149
|
-
} = (0, import_react_hook_form6.useForm)({
|
|
8150
|
-
defaultValues,
|
|
8151
|
-
resolver: (0, import_yup6.yupResolver)(userSchema)
|
|
8152
|
-
});
|
|
8153
|
-
React6.useEffect(() => {
|
|
8154
|
-
if (data) {
|
|
8155
|
-
reset({
|
|
8156
|
-
_id: data._id,
|
|
8157
|
-
active: data.active,
|
|
8158
|
-
avatar: data.avatar,
|
|
8159
|
-
avatarUpload: data.avatarUpload,
|
|
8160
|
-
email: data.email,
|
|
8161
|
-
firstName: data.firstName,
|
|
8162
|
-
isTester: data.isTester,
|
|
8163
|
-
lastName: data.lastName,
|
|
8164
|
-
password: data.password,
|
|
8165
|
-
preferredRegion: data.preferredRegion,
|
|
8166
|
-
role: data.role,
|
|
8167
|
-
termsAgreement: data.termsAgreement
|
|
8168
|
-
});
|
|
8169
|
-
} else {
|
|
8170
|
-
reset(defaultValues);
|
|
8171
|
-
}
|
|
8172
|
-
}, [data]);
|
|
8173
|
-
const {
|
|
8174
|
-
_id,
|
|
8175
|
-
active,
|
|
8176
|
-
avatar,
|
|
8177
|
-
avatarUpload,
|
|
8178
|
-
email,
|
|
8179
|
-
firstName,
|
|
8180
|
-
isTester,
|
|
8181
|
-
lastName,
|
|
8182
|
-
password,
|
|
8183
|
-
preferredRegion,
|
|
8184
|
-
role,
|
|
8185
|
-
termsAgreement
|
|
8186
|
-
} = getValues();
|
|
8187
|
-
return {
|
|
8188
|
-
control,
|
|
8189
|
-
fields: {
|
|
8190
|
-
_id,
|
|
8191
|
-
active,
|
|
8192
|
-
avatar,
|
|
8193
|
-
avatarUpload,
|
|
8194
|
-
email,
|
|
8195
|
-
firstName,
|
|
8196
|
-
isTester,
|
|
8197
|
-
lastName,
|
|
8198
|
-
password,
|
|
8199
|
-
preferredRegion,
|
|
8200
|
-
role,
|
|
8201
|
-
termsAgreement
|
|
8202
|
-
},
|
|
8203
|
-
formState,
|
|
8204
|
-
getValues,
|
|
8205
|
-
handleSubmit,
|
|
8206
|
-
reset,
|
|
8207
|
-
setValue,
|
|
8208
|
-
watch
|
|
8209
|
-
};
|
|
8210
|
-
}
|
|
8211
|
-
|
|
8212
|
-
// src/hooks/auth/useLoginForm.ts
|
|
8213
|
-
var import_yup7 = require("@hookform/resolvers/yup");
|
|
8214
|
-
var import_react_hook_form7 = require("react-hook-form");
|
|
8215
|
-
var defaultValues2 = {
|
|
8216
|
-
email: "",
|
|
8217
|
-
password: ""
|
|
8218
|
-
};
|
|
8219
|
-
function useLoginForm() {
|
|
8220
|
-
const {
|
|
8221
|
-
control,
|
|
8222
|
-
formState,
|
|
8223
|
-
getValues,
|
|
8224
|
-
handleSubmit,
|
|
8225
|
-
reset,
|
|
8226
|
-
setValue,
|
|
8227
|
-
watch
|
|
8228
|
-
} = (0, import_react_hook_form7.useForm)({
|
|
8229
|
-
defaultValues: defaultValues2,
|
|
8230
|
-
resolver: (0, import_yup7.yupResolver)(loginSchema)
|
|
8231
|
-
});
|
|
8232
|
-
const { email, password } = getValues();
|
|
8233
|
-
return {
|
|
8234
|
-
control,
|
|
8235
|
-
fields: {
|
|
8236
|
-
email,
|
|
8237
|
-
password
|
|
8238
|
-
},
|
|
8239
|
-
formState,
|
|
8240
|
-
getValues,
|
|
8241
|
-
handleSubmit,
|
|
8242
|
-
reset,
|
|
8243
|
-
setValue,
|
|
8244
|
-
watch
|
|
8245
|
-
};
|
|
8246
|
-
}
|
|
8247
|
-
|
|
8248
|
-
// src/hooks/auth/useRegisterForm.ts
|
|
8249
|
-
var import_yup8 = require("@hookform/resolvers/yup");
|
|
8250
|
-
var import_react_hook_form8 = require("react-hook-form");
|
|
8251
|
-
var defaultValues3 = {
|
|
8252
|
-
email: "",
|
|
8253
|
-
firstName: "",
|
|
8254
|
-
lastName: "",
|
|
8255
|
-
password: "",
|
|
8256
|
-
preferredRegion: "",
|
|
8257
|
-
promoCode: null,
|
|
8258
|
-
termsAgreement: null
|
|
8259
|
-
};
|
|
8260
|
-
function useRegisterForm() {
|
|
8261
|
-
const {
|
|
8262
|
-
control,
|
|
8263
|
-
formState,
|
|
8264
|
-
getValues,
|
|
8265
|
-
handleSubmit,
|
|
8266
|
-
reset,
|
|
8267
|
-
setValue,
|
|
8268
|
-
watch
|
|
8269
|
-
} = (0, import_react_hook_form8.useForm)({
|
|
8270
|
-
defaultValues: defaultValues3,
|
|
8271
|
-
resolver: (0, import_yup8.yupResolver)(registerSchema)
|
|
8272
|
-
});
|
|
8273
|
-
const {
|
|
8274
|
-
email,
|
|
8275
|
-
firstName,
|
|
8276
|
-
lastName,
|
|
8277
|
-
password,
|
|
8278
|
-
preferredRegion,
|
|
8279
|
-
promoCode,
|
|
8280
|
-
termsAgreement
|
|
8281
|
-
} = getValues();
|
|
8282
|
-
return {
|
|
8283
|
-
control,
|
|
8284
|
-
fields: {
|
|
8285
|
-
email,
|
|
8286
|
-
firstName,
|
|
8287
|
-
lastName,
|
|
8288
|
-
password,
|
|
8289
|
-
preferredRegion,
|
|
8290
|
-
promoCode,
|
|
8291
|
-
termsAgreement
|
|
8292
|
-
},
|
|
8293
|
-
formState,
|
|
8294
|
-
getValues,
|
|
8295
|
-
handleSubmit,
|
|
8296
|
-
reset,
|
|
8297
|
-
setValue,
|
|
8298
|
-
watch
|
|
8299
|
-
};
|
|
8300
|
-
}
|
|
8301
|
-
|
|
8302
|
-
// src/hooks/auth/useRequestPasswordResetForm.ts
|
|
8303
|
-
var import_yup9 = require("@hookform/resolvers/yup");
|
|
8304
|
-
var import_react_hook_form9 = require("react-hook-form");
|
|
8305
|
-
var defaultValues4 = {
|
|
8306
|
-
email: ""
|
|
8307
|
-
};
|
|
8308
|
-
function useRequestPasswordResetForm() {
|
|
8309
|
-
const {
|
|
8310
|
-
control,
|
|
8311
|
-
formState,
|
|
8312
|
-
getValues,
|
|
8313
|
-
handleSubmit,
|
|
8314
|
-
reset,
|
|
8315
|
-
setValue,
|
|
8316
|
-
watch
|
|
8317
|
-
} = (0, import_react_hook_form9.useForm)({
|
|
8318
|
-
defaultValues: defaultValues4,
|
|
8319
|
-
resolver: (0, import_yup9.yupResolver)(requestPasswordResetSchema)
|
|
8320
|
-
});
|
|
8321
|
-
const { email } = getValues();
|
|
8322
|
-
return {
|
|
8323
|
-
control,
|
|
8324
|
-
fields: {
|
|
8325
|
-
email
|
|
8326
|
-
},
|
|
8327
|
-
formState,
|
|
8328
|
-
getValues,
|
|
8329
|
-
handleSubmit,
|
|
8330
|
-
reset,
|
|
8331
|
-
setValue,
|
|
8332
|
-
watch
|
|
8333
|
-
};
|
|
8334
|
-
}
|
|
8335
|
-
|
|
8336
|
-
// src/hooks/auth/useValidateVerificationTokenForm.ts
|
|
8337
|
-
var import_yup10 = require("@hookform/resolvers/yup");
|
|
8338
|
-
var import_react_hook_form10 = require("react-hook-form");
|
|
8339
|
-
var defaultValues5 = {
|
|
8340
|
-
email: "",
|
|
8341
|
-
verificationToken: ""
|
|
8342
|
-
};
|
|
8343
|
-
function useValidateVerificationTokenForm() {
|
|
8344
|
-
const {
|
|
8345
|
-
control,
|
|
8346
|
-
formState,
|
|
8347
|
-
getValues,
|
|
8348
|
-
handleSubmit,
|
|
8349
|
-
reset,
|
|
8350
|
-
setValue,
|
|
8351
|
-
watch
|
|
8352
|
-
} = (0, import_react_hook_form10.useForm)({
|
|
8353
|
-
defaultValues: defaultValues5,
|
|
8354
|
-
resolver: (0, import_yup10.yupResolver)(validateVerificationTokenSchema)
|
|
8355
|
-
});
|
|
8356
|
-
const { email, verificationToken } = getValues();
|
|
8357
|
-
return {
|
|
8358
|
-
control,
|
|
8359
|
-
fields: {
|
|
8360
|
-
email,
|
|
8361
|
-
verificationToken
|
|
8362
|
-
},
|
|
8363
|
-
formState,
|
|
8364
|
-
getValues,
|
|
8365
|
-
handleSubmit,
|
|
8366
|
-
reset,
|
|
8367
|
-
setValue,
|
|
8368
|
-
watch
|
|
8369
|
-
};
|
|
8370
|
-
}
|
|
8371
|
-
|
|
8372
|
-
// src/hooks/auth/useResetPasswordForm.ts
|
|
8373
|
-
var import_yup11 = require("@hookform/resolvers/yup");
|
|
8374
|
-
var import_react_hook_form11 = require("react-hook-form");
|
|
8375
|
-
var defaultValues6 = {
|
|
8376
|
-
confirmPassword: "",
|
|
8377
|
-
email: "",
|
|
8378
|
-
password: ""
|
|
8379
|
-
};
|
|
8380
|
-
function useResetPasswordForm() {
|
|
8381
|
-
const {
|
|
8382
|
-
control,
|
|
8383
|
-
formState,
|
|
8384
|
-
getValues,
|
|
8385
|
-
handleSubmit,
|
|
8386
|
-
reset,
|
|
8387
|
-
setValue,
|
|
8388
|
-
watch
|
|
8389
|
-
} = (0, import_react_hook_form11.useForm)({
|
|
8390
|
-
defaultValues: defaultValues6,
|
|
8391
|
-
resolver: (0, import_yup11.yupResolver)(resetPasswordSchema)
|
|
8392
|
-
});
|
|
8393
|
-
const { confirmPassword, email, password } = getValues();
|
|
8394
|
-
return {
|
|
8395
|
-
control,
|
|
8396
|
-
fields: {
|
|
8397
|
-
confirmPassword,
|
|
8398
|
-
email,
|
|
8399
|
-
password
|
|
8400
|
-
},
|
|
8401
|
-
formState,
|
|
8402
|
-
getValues,
|
|
8403
|
-
handleSubmit,
|
|
8404
|
-
reset,
|
|
8405
|
-
setValue,
|
|
8406
|
-
watch
|
|
8407
|
-
};
|
|
8408
|
-
}
|
|
8409
|
-
|
|
8410
|
-
// src/hooks/useContactUsForm.ts
|
|
8411
|
-
var import_yup12 = require("@hookform/resolvers/yup");
|
|
8412
|
-
var import_react = __toESM(require("react"));
|
|
8413
|
-
var import_react_hook_form12 = require("react-hook-form");
|
|
8414
|
-
|
|
8415
|
-
// src/yupSchema/contactUs.ts
|
|
8416
|
-
var yup10 = __toESM(require("yup"));
|
|
8417
|
-
var contactUsSchema = yup10.object().shape({
|
|
8418
|
-
email: emailRequiredSchema,
|
|
8419
|
-
firstName: yup10.string().label("First Name").required("First name is required"),
|
|
8420
|
-
lastName: yup10.string().label("Last Name").required("Last name is required"),
|
|
8421
|
-
message: yup10.string().label("Message").required("Message is required")
|
|
8422
|
-
});
|
|
8423
|
-
|
|
8424
|
-
// src/hooks/useContactUsForm.ts
|
|
8425
|
-
var defaultValues7 = {
|
|
8426
|
-
email: "",
|
|
8427
|
-
firstName: "",
|
|
8428
|
-
lastName: "",
|
|
8429
|
-
message: ""
|
|
8430
|
-
};
|
|
8431
|
-
function useContactUsForm(data) {
|
|
8432
|
-
const {
|
|
8433
|
-
control,
|
|
8434
|
-
formState,
|
|
8435
|
-
getValues,
|
|
8436
|
-
handleSubmit,
|
|
8437
|
-
reset,
|
|
8438
|
-
setValue,
|
|
8439
|
-
watch
|
|
8440
|
-
} = (0, import_react_hook_form12.useForm)({
|
|
8441
|
-
defaultValues: defaultValues7,
|
|
8442
|
-
resolver: (0, import_yup12.yupResolver)(contactUsSchema)
|
|
8443
|
-
});
|
|
8444
|
-
import_react.default.useEffect(() => {
|
|
8445
|
-
if (data) {
|
|
8446
|
-
reset({
|
|
8447
|
-
email: data.email,
|
|
8448
|
-
firstName: data.firstName,
|
|
8449
|
-
lastName: data.lastName,
|
|
8450
|
-
message: data.message
|
|
8451
|
-
});
|
|
8452
|
-
} else {
|
|
8453
|
-
reset(defaultValues7);
|
|
8454
|
-
}
|
|
8455
|
-
}, [data]);
|
|
8456
|
-
const { email, firstName, lastName, message } = getValues();
|
|
8457
|
-
return {
|
|
8458
|
-
control,
|
|
8459
|
-
fields: {
|
|
8460
|
-
email,
|
|
8461
|
-
firstName,
|
|
8462
|
-
lastName,
|
|
8463
|
-
message
|
|
8464
|
-
},
|
|
8465
|
-
formState,
|
|
8466
|
-
getValues,
|
|
8467
|
-
handleSubmit,
|
|
8468
|
-
reset,
|
|
8469
|
-
setValue,
|
|
8470
|
-
watch
|
|
8471
|
-
};
|
|
8472
|
-
}
|
|
8473
|
-
|
|
8474
|
-
// src/hooks/useAdForm.ts
|
|
8475
|
-
var import_yup13 = require("@hookform/resolvers/yup");
|
|
8476
|
-
var import_react2 = __toESM(require("react"));
|
|
8477
|
-
var import_react_hook_form13 = require("react-hook-form");
|
|
8478
|
-
var defaultValues8 = {
|
|
8479
|
-
active: true,
|
|
8480
|
-
// Use a future default so yup "future date" rules pass on first submit.
|
|
8481
|
-
end: new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3),
|
|
8482
|
-
resource: {
|
|
8483
|
-
adDescription: "",
|
|
8484
|
-
adImage: "",
|
|
8485
|
-
adStyle: "Bloom" /* BLOOM */,
|
|
8486
|
-
adTitle: "",
|
|
8487
|
-
adType: "Sponsored" /* SPONSORED */,
|
|
8488
|
-
resourceId: "",
|
|
8489
|
-
resourceName: "",
|
|
8490
|
-
resourceRegion: "",
|
|
8491
|
-
resourceType: "event" /* EVENT */
|
|
8492
|
-
},
|
|
8493
|
-
showOn: ["Front_page" /* FRONT_PAGE */],
|
|
8494
|
-
// `start` is only required (and must be future) when status !== ACTIVE.
|
|
8495
|
-
start: void 0,
|
|
8496
|
-
status: "Active" /* ACTIVE */,
|
|
8497
|
-
targetRegion: []
|
|
8498
|
-
};
|
|
8499
|
-
function useAdForm(data) {
|
|
8500
|
-
const {
|
|
8501
|
-
control,
|
|
8502
|
-
formState,
|
|
8503
|
-
getValues,
|
|
8504
|
-
handleSubmit,
|
|
8505
|
-
reset,
|
|
8506
|
-
setValue,
|
|
8507
|
-
watch
|
|
8508
|
-
} = (0, import_react_hook_form13.useForm)({
|
|
8509
|
-
defaultValues: defaultValues8,
|
|
8510
|
-
resolver: (0, import_yup13.yupResolver)(adSchema)
|
|
8511
|
-
});
|
|
8512
|
-
import_react2.default.useEffect(() => {
|
|
8513
|
-
if (data) {
|
|
8514
|
-
reset({
|
|
8515
|
-
active: data.active,
|
|
8516
|
-
end: data.end,
|
|
8517
|
-
resource: data.resource,
|
|
8518
|
-
showOn: data.showOn,
|
|
8519
|
-
start: data.start,
|
|
8520
|
-
status: data.status,
|
|
8521
|
-
targetRegion: data.targetRegion
|
|
8522
|
-
});
|
|
8523
|
-
} else {
|
|
8524
|
-
reset(defaultValues8);
|
|
8525
|
-
}
|
|
8526
|
-
}, [data]);
|
|
8527
|
-
const { active, end, resource, showOn, start, status, targetRegion } = getValues();
|
|
8528
|
-
return {
|
|
8529
|
-
control,
|
|
8530
|
-
fields: {
|
|
8531
|
-
active,
|
|
8532
|
-
end,
|
|
8533
|
-
resource,
|
|
8534
|
-
showOn,
|
|
8535
|
-
start,
|
|
8536
|
-
status,
|
|
8537
|
-
targetRegion
|
|
8538
|
-
},
|
|
8539
|
-
formState,
|
|
8540
|
-
getValues,
|
|
8541
|
-
handleSubmit,
|
|
8542
|
-
reset,
|
|
8543
|
-
setValue,
|
|
8544
|
-
watch
|
|
8545
|
-
};
|
|
8546
|
-
}
|
|
8547
|
-
|
|
8548
|
-
// src/hooks/partner/usePartnerForm.ts
|
|
8549
|
-
var import_yup14 = require("@hookform/resolvers/yup");
|
|
8550
|
-
var React9 = __toESM(require("react"));
|
|
8551
|
-
var import_react_hook_form14 = require("react-hook-form");
|
|
8552
|
-
function usePartnerForm(data) {
|
|
8553
|
-
const {
|
|
8554
|
-
control,
|
|
8555
|
-
formState,
|
|
8556
|
-
getValues,
|
|
8557
|
-
handleSubmit,
|
|
8558
|
-
reset,
|
|
8559
|
-
setValue,
|
|
8560
|
-
watch
|
|
8561
|
-
} = (0, import_react_hook_form14.useForm)({
|
|
8562
|
-
defaultValues: defaultPartnerFormValues,
|
|
8563
|
-
resolver: (0, import_yup14.yupResolver)(partnerSchema)
|
|
8564
|
-
});
|
|
8565
|
-
React9.useEffect(() => {
|
|
8566
|
-
if (data) {
|
|
8567
|
-
reset({
|
|
8568
|
-
...mapBaseResourceTypeToFormData(data),
|
|
8569
|
-
location: data.location,
|
|
8570
|
-
nzbn: data.nzbn,
|
|
8571
|
-
partnerType: data.partnerType
|
|
8572
|
-
});
|
|
8573
|
-
} else {
|
|
8574
|
-
reset(defaultPartnerFormValues);
|
|
8575
|
-
}
|
|
8576
|
-
}, [data]);
|
|
8577
|
-
const {
|
|
8578
|
-
_id,
|
|
8579
|
-
active,
|
|
8580
|
-
associates,
|
|
8581
|
-
contactDetails,
|
|
8582
|
-
cover,
|
|
8583
|
-
coverUpload,
|
|
8584
|
-
description,
|
|
8585
|
-
images,
|
|
8586
|
-
imagesUpload,
|
|
8587
|
-
location,
|
|
8588
|
-
logo,
|
|
8589
|
-
logoUpload,
|
|
8590
|
-
name,
|
|
8591
|
-
nzbn,
|
|
8592
|
-
owner,
|
|
8593
|
-
partnerType,
|
|
8594
|
-
promoCodes,
|
|
8595
|
-
region,
|
|
8596
|
-
socialMedia: socialMedia2,
|
|
8597
|
-
termsAgreement
|
|
8598
|
-
} = getValues();
|
|
8599
|
-
return {
|
|
8600
|
-
control,
|
|
8601
|
-
fields: {
|
|
8602
|
-
_id,
|
|
8603
|
-
active,
|
|
8604
|
-
associates,
|
|
8605
|
-
contactDetails,
|
|
8606
|
-
cover,
|
|
8607
|
-
coverUpload,
|
|
8608
|
-
description,
|
|
8609
|
-
images,
|
|
8610
|
-
imagesUpload,
|
|
8611
|
-
location,
|
|
8612
|
-
logo,
|
|
8613
|
-
logoUpload,
|
|
8614
|
-
name,
|
|
8615
|
-
nzbn,
|
|
8616
|
-
owner,
|
|
8617
|
-
partnerType,
|
|
8618
|
-
promoCodes,
|
|
8619
|
-
region,
|
|
8620
|
-
socialMedia: socialMedia2,
|
|
8621
|
-
termsAgreement
|
|
8622
|
-
},
|
|
8623
|
-
formState,
|
|
8624
|
-
getValues,
|
|
8625
|
-
handleSubmit,
|
|
8626
|
-
reset,
|
|
8627
|
-
setValue,
|
|
8628
|
-
watch
|
|
8629
|
-
};
|
|
8630
|
-
}
|
|
8631
|
-
|
|
8632
|
-
// src/hooks/usePostForm.ts
|
|
8633
|
-
var import_yup15 = require("@hookform/resolvers/yup");
|
|
8634
|
-
var import_react3 = __toESM(require("react"));
|
|
8635
|
-
var import_react_hook_form15 = require("react-hook-form");
|
|
8636
|
-
var defaultValues9 = {
|
|
8637
|
-
active: true,
|
|
8638
|
-
caption: "",
|
|
8639
|
-
content: [],
|
|
8640
|
-
cover: null,
|
|
8641
|
-
coverUpload: null,
|
|
8642
|
-
postType: "",
|
|
8643
|
-
resource: null,
|
|
8644
|
-
tags: [],
|
|
8645
|
-
title: ""
|
|
8646
|
-
};
|
|
8647
|
-
function usePostForm(data) {
|
|
8648
|
-
const {
|
|
8649
|
-
control,
|
|
8650
|
-
formState,
|
|
8651
|
-
getValues,
|
|
8652
|
-
handleSubmit,
|
|
8653
|
-
reset,
|
|
8654
|
-
setValue,
|
|
8655
|
-
watch
|
|
8656
|
-
} = (0, import_react_hook_form15.useForm)({
|
|
8657
|
-
defaultValues: defaultValues9,
|
|
8658
|
-
resolver: (0, import_yup15.yupResolver)(postSchema)
|
|
8659
|
-
});
|
|
8660
|
-
import_react3.default.useEffect(() => {
|
|
8661
|
-
if (data) {
|
|
8662
|
-
reset({
|
|
8663
|
-
active: data.active,
|
|
8664
|
-
caption: data.caption,
|
|
8665
|
-
content: data.content,
|
|
8666
|
-
cover: data.cover,
|
|
8667
|
-
coverUpload: data.coverUpload,
|
|
8668
|
-
postType: data.postType,
|
|
8669
|
-
resource: data.resource,
|
|
8670
|
-
tags: data.tags,
|
|
8671
|
-
title: data.title
|
|
8672
|
-
});
|
|
8673
|
-
} else {
|
|
8674
|
-
reset(defaultValues9);
|
|
8675
|
-
}
|
|
8676
|
-
}, [data]);
|
|
8677
|
-
const {
|
|
8678
|
-
active,
|
|
8679
|
-
caption,
|
|
8680
|
-
content,
|
|
8681
|
-
cover,
|
|
8682
|
-
coverUpload,
|
|
8683
|
-
postType,
|
|
8684
|
-
resource,
|
|
8685
|
-
tags,
|
|
8686
|
-
title
|
|
8687
|
-
} = getValues();
|
|
8688
|
-
return {
|
|
8689
|
-
control,
|
|
8690
|
-
fields: {
|
|
8691
|
-
active,
|
|
8692
|
-
caption,
|
|
8693
|
-
content,
|
|
8694
|
-
cover,
|
|
8695
|
-
coverUpload,
|
|
8696
|
-
postType,
|
|
8697
|
-
resource,
|
|
8698
|
-
tags,
|
|
8699
|
-
title
|
|
8700
|
-
},
|
|
8701
|
-
formState,
|
|
8702
|
-
getValues,
|
|
8703
|
-
handleSubmit,
|
|
8704
|
-
reset,
|
|
8705
|
-
setValue,
|
|
8706
|
-
watch
|
|
8707
|
-
};
|
|
8708
|
-
}
|
|
8709
|
-
|
|
8710
|
-
// src/hooks/useAppSettingsForm.ts
|
|
8711
|
-
var import_yup16 = require("@hookform/resolvers/yup");
|
|
8712
|
-
var import_react4 = __toESM(require("react"));
|
|
8713
|
-
var import_react_hook_form16 = require("react-hook-form");
|
|
8714
|
-
var defaultValues10 = {
|
|
8715
|
-
appVersion: "",
|
|
8716
|
-
isOfflineMode: false
|
|
8717
|
-
};
|
|
8718
|
-
function useAppSettingsForm(data) {
|
|
8719
|
-
const {
|
|
8720
|
-
control,
|
|
8721
|
-
formState,
|
|
8722
|
-
getValues,
|
|
8723
|
-
handleSubmit,
|
|
8724
|
-
reset,
|
|
8725
|
-
setValue,
|
|
8726
|
-
watch
|
|
8727
|
-
} = (0, import_react_hook_form16.useForm)({
|
|
8728
|
-
defaultValues: defaultValues10,
|
|
8729
|
-
resolver: (0, import_yup16.yupResolver)(appSettingsSchema)
|
|
8730
|
-
});
|
|
8731
|
-
import_react4.default.useEffect(() => {
|
|
8732
|
-
if (data) {
|
|
8733
|
-
reset({
|
|
8734
|
-
appVersion: data.appVersion,
|
|
8735
|
-
isOfflineMode: data.isOfflineMode
|
|
8736
|
-
});
|
|
8737
|
-
} else {
|
|
8738
|
-
reset(defaultValues10);
|
|
8739
|
-
}
|
|
8740
|
-
}, [data]);
|
|
8741
|
-
const { appVersion, isOfflineMode } = getValues();
|
|
8742
|
-
return {
|
|
8743
|
-
control,
|
|
8744
|
-
fields: {
|
|
8745
|
-
appVersion,
|
|
8746
|
-
isOfflineMode
|
|
8747
|
-
},
|
|
8748
|
-
formState,
|
|
8749
|
-
getValues,
|
|
8750
|
-
handleSubmit,
|
|
8751
|
-
reset,
|
|
8752
|
-
setValue,
|
|
8753
|
-
watch
|
|
8754
|
-
};
|
|
8755
|
-
}
|
|
8756
|
-
|
|
8757
|
-
// src/hooks/useSchoolForm.ts
|
|
8758
|
-
var import_yup17 = require("@hookform/resolvers/yup");
|
|
8759
|
-
var import_react5 = require("react");
|
|
8760
|
-
var import_react_hook_form17 = require("react-hook-form");
|
|
8761
|
-
|
|
8762
|
-
// src/yupSchema/school.ts
|
|
8763
|
-
var yup11 = __toESM(require("yup"));
|
|
8764
|
-
var schoolSchema = yup11.object().shape({
|
|
8765
|
-
active: yup11.boolean().required("Active is required"),
|
|
8766
|
-
contactDetails: contactDetailsSchema,
|
|
8767
|
-
location: locationSchema,
|
|
8768
|
-
name: yup11.string().trim().required("Name is required"),
|
|
8769
|
-
region: yup11.string().trim().required("Region is required"),
|
|
8770
|
-
socialMedia: yup11.array().of(socialMediaSchema).nullable().default(null),
|
|
8771
|
-
studentCount: yup11.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Student Count").nullable().typeError("Student count must be a number").min(
|
|
8772
|
-
SCHOOL_MIN_STUDENT_COUNT,
|
|
8773
|
-
`Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
|
|
8774
|
-
).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
|
|
8775
|
-
});
|
|
8776
|
-
|
|
8777
|
-
// src/hooks/useSchoolForm.ts
|
|
8778
|
-
var defaultSchoolFormValues = {
|
|
8779
|
-
// New schools are active by default
|
|
8780
|
-
active: true,
|
|
8781
|
-
contactDetails: null,
|
|
8782
|
-
location: defaultLocation,
|
|
8783
|
-
logo: null,
|
|
8784
|
-
logoUpload: null,
|
|
8785
|
-
name: "",
|
|
8786
|
-
region: "",
|
|
8787
|
-
socialMedia: [],
|
|
8788
|
-
studentCount: 0,
|
|
8789
|
-
termsAgreement: null
|
|
8790
|
-
};
|
|
8791
|
-
function useSchoolForm(data) {
|
|
8792
|
-
const {
|
|
8793
|
-
control,
|
|
8794
|
-
formState,
|
|
8795
|
-
getValues,
|
|
8796
|
-
handleSubmit,
|
|
8797
|
-
reset,
|
|
8798
|
-
setValue,
|
|
8799
|
-
watch
|
|
8800
|
-
} = (0, import_react_hook_form17.useForm)({
|
|
8801
|
-
defaultValues: defaultSchoolFormValues,
|
|
8802
|
-
resolver: (0, import_yup17.yupResolver)(schoolSchema)
|
|
8803
|
-
});
|
|
8804
|
-
(0, import_react5.useEffect)(() => {
|
|
8805
|
-
if (data) {
|
|
8806
|
-
reset({
|
|
8807
|
-
_id: data._id,
|
|
8808
|
-
active: data.active,
|
|
8809
|
-
contactDetails: data.contactDetails,
|
|
8810
|
-
location: data.location,
|
|
8811
|
-
logo: data.logo,
|
|
8812
|
-
logoUpload: data.logoUpload,
|
|
8813
|
-
name: data.name,
|
|
8814
|
-
region: data.region,
|
|
8815
|
-
socialMedia: data.socialMedia,
|
|
8816
|
-
studentCount: data.studentCount,
|
|
8817
|
-
termsAgreement: data.termsAgreement
|
|
8818
|
-
});
|
|
8819
|
-
} else {
|
|
8820
|
-
reset(defaultSchoolFormValues);
|
|
8821
|
-
}
|
|
8822
|
-
}, [data]);
|
|
8823
|
-
const {
|
|
8824
|
-
_id,
|
|
8825
|
-
socialMedia: socialMedia2,
|
|
8826
|
-
active,
|
|
8827
|
-
contactDetails,
|
|
8828
|
-
location,
|
|
8829
|
-
logo,
|
|
8830
|
-
logoUpload,
|
|
8831
|
-
name,
|
|
8832
|
-
region,
|
|
8833
|
-
studentCount,
|
|
8834
|
-
termsAgreement
|
|
8835
|
-
} = getValues();
|
|
8836
|
-
return {
|
|
8837
|
-
control,
|
|
8838
|
-
fields: {
|
|
8839
|
-
_id,
|
|
8840
|
-
active,
|
|
8841
|
-
contactDetails,
|
|
8842
|
-
location,
|
|
8843
|
-
logo,
|
|
8844
|
-
logoUpload,
|
|
8845
|
-
name,
|
|
8846
|
-
region,
|
|
8847
|
-
socialMedia: socialMedia2,
|
|
8848
|
-
studentCount,
|
|
8849
|
-
termsAgreement
|
|
8850
|
-
},
|
|
8851
|
-
formState,
|
|
8852
|
-
getValues,
|
|
8853
|
-
handleSubmit,
|
|
8854
|
-
reset,
|
|
8855
|
-
setValue,
|
|
8856
|
-
watch
|
|
8857
|
-
};
|
|
8858
|
-
}
|
|
8859
|
-
|
|
8860
6890
|
// src/images/index.ts
|
|
8861
6891
|
var PKG = "@timardex/cluemart-shared";
|
|
8862
6892
|
var IMAGE_EXTENSION = ".webp";
|
|
@@ -9044,9 +7074,9 @@ function formatShareStallLine(stall) {
|
|
|
9044
7074
|
return ` - ${stall.label} \u2014 $${stall.price}${formatStallCapacityLabel(stall.stallCapacity)}`;
|
|
9045
7075
|
}
|
|
9046
7076
|
function formatShareInvitationMarketDatesSection(dateTime) {
|
|
9047
|
-
const dateBlocks = dateTime.map((
|
|
9048
|
-
const formattedDate = formatShareMarketDate(
|
|
9049
|
-
const stallLines =
|
|
7077
|
+
const dateBlocks = dateTime.map((date) => {
|
|
7078
|
+
const formattedDate = formatShareMarketDate(date.startDate);
|
|
7079
|
+
const stallLines = date.stallTypes.map(formatShareStallLine);
|
|
9050
7080
|
return [`- ${formattedDate}`, ...stallLines].join("\n");
|
|
9051
7081
|
});
|
|
9052
7082
|
return `${SHARE_MARKET_DATES_SECTION_HEADING}
|
|
@@ -9103,7 +7133,7 @@ function formatShareInvitationApplicationDeadlineLine(applicationDeadlineHours)
|
|
|
9103
7133
|
return `${SHARE_APPLICATION_DEADLINE_PREFIX} vendors must apply at least ${applicationDeadlineHours} hours before each market date.`;
|
|
9104
7134
|
}
|
|
9105
7135
|
function buildInvitationShareDescription(event, eventInfo2) {
|
|
9106
|
-
const stallTypes2 = eventInfo2?.dateTime?.flatMap((
|
|
7136
|
+
const stallTypes2 = eventInfo2?.dateTime?.flatMap((date) => date.stallTypes) ?? [];
|
|
9107
7137
|
if (!eventInfo2 || stallTypes2.length === 0) {
|
|
9108
7138
|
return event.description?.trim() || "";
|
|
9109
7139
|
}
|
|
@@ -9289,6 +7319,31 @@ var EnumVerificationType = /* @__PURE__ */ ((EnumVerificationType2) => {
|
|
|
9289
7319
|
// src/types/global.ts
|
|
9290
7320
|
var PROMO_CODE_PREFIX = "CM-";
|
|
9291
7321
|
|
|
7322
|
+
// src/types/ad.ts
|
|
7323
|
+
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
7324
|
+
EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
|
|
7325
|
+
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
7326
|
+
EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
|
|
7327
|
+
EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
|
|
7328
|
+
return EnumAdShowOn2;
|
|
7329
|
+
})(EnumAdShowOn || {});
|
|
7330
|
+
var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
7331
|
+
EnumAdStatus2["ACTIVE"] = "Active";
|
|
7332
|
+
EnumAdStatus2["PAUSED"] = "Paused";
|
|
7333
|
+
EnumAdStatus2["EXPIRED"] = "Expired";
|
|
7334
|
+
return EnumAdStatus2;
|
|
7335
|
+
})(EnumAdStatus || {});
|
|
7336
|
+
var EnumAdType = /* @__PURE__ */ ((EnumAdType2) => {
|
|
7337
|
+
EnumAdType2["SPONSORED"] = "Sponsored";
|
|
7338
|
+
EnumAdType2["FREE"] = "Free";
|
|
7339
|
+
return EnumAdType2;
|
|
7340
|
+
})(EnumAdType || {});
|
|
7341
|
+
var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
|
|
7342
|
+
EnumAdStyle2["BLOOM"] = "Bloom";
|
|
7343
|
+
EnumAdStyle2["RISE"] = "Rise";
|
|
7344
|
+
return EnumAdStyle2;
|
|
7345
|
+
})(EnumAdStyle || {});
|
|
7346
|
+
|
|
9292
7347
|
// src/types/resourceActivities.ts
|
|
9293
7348
|
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
9294
7349
|
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
@@ -9299,6 +7354,22 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
9299
7354
|
return EnumActivity2;
|
|
9300
7355
|
})(EnumActivity || {});
|
|
9301
7356
|
|
|
7357
|
+
// src/types/post.ts
|
|
7358
|
+
var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
7359
|
+
EnumPostType2["DAILY_MEETS"] = "daily_meets";
|
|
7360
|
+
EnumPostType2["DAILY_TIPS"] = "daily_tips";
|
|
7361
|
+
EnumPostType2["DAILY_GAMES"] = "daily_games";
|
|
7362
|
+
return EnumPostType2;
|
|
7363
|
+
})(EnumPostType || {});
|
|
7364
|
+
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
7365
|
+
EnumPostContentType2["GAME"] = "game";
|
|
7366
|
+
EnumPostContentType2["IMAGE"] = "image";
|
|
7367
|
+
EnumPostContentType2["LIST"] = "list";
|
|
7368
|
+
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
7369
|
+
EnumPostContentType2["VIDEO"] = "video";
|
|
7370
|
+
return EnumPostContentType2;
|
|
7371
|
+
})(EnumPostContentType || {});
|
|
7372
|
+
|
|
9302
7373
|
// src/types/game/index.ts
|
|
9303
7374
|
var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
|
|
9304
7375
|
EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
|
|
@@ -9446,13 +7517,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9446
7517
|
contactUsFields,
|
|
9447
7518
|
darkColors,
|
|
9448
7519
|
dateFormat,
|
|
9449
|
-
defaultEventFormValues,
|
|
9450
|
-
defaultEventInfoFormValues,
|
|
9451
|
-
defaultLocation,
|
|
9452
|
-
defaultPartnerFormValues,
|
|
9453
|
-
defaultUnregisteredVendorFormValues,
|
|
9454
|
-
defaultVendorFormValues,
|
|
9455
|
-
defaultVendorInfoFormValues,
|
|
9456
7520
|
emailField,
|
|
9457
7521
|
eventBasicInfoFields,
|
|
9458
7522
|
eventEndDateFields,
|
|
@@ -9480,7 +7544,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9480
7544
|
gameScreenIdentifierList,
|
|
9481
7545
|
gameTypeToDisplayName,
|
|
9482
7546
|
getCurrentAndFutureDates,
|
|
9483
|
-
globalDefaultValues,
|
|
9484
7547
|
iconFiles,
|
|
9485
7548
|
iconIds,
|
|
9486
7549
|
icons,
|
|
@@ -9497,7 +7560,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9497
7560
|
logoIds,
|
|
9498
7561
|
logos,
|
|
9499
7562
|
mapArrayToOptions,
|
|
9500
|
-
mapBaseResourceTypeToFormData,
|
|
9501
7563
|
normalizeShareOgDescription,
|
|
9502
7564
|
normalizeShareRouteId,
|
|
9503
7565
|
normalizeShareText,
|
|
@@ -9533,7 +7595,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9533
7595
|
timeFormat,
|
|
9534
7596
|
toNZTime,
|
|
9535
7597
|
truncateText,
|
|
9536
|
-
useAdForm,
|
|
9537
7598
|
useAddParticipantToChat,
|
|
9538
7599
|
useAddUserFavouriteResource,
|
|
9539
7600
|
useAddUserGoingResource,
|
|
@@ -9542,10 +7603,8 @@ var TIER_FROM_LICENCE = {
|
|
|
9542
7603
|
useAdminPermanentlyDeleteResource,
|
|
9543
7604
|
useAdminResendUserVerificationEmail,
|
|
9544
7605
|
useAdminUpdateResourceType,
|
|
9545
|
-
useAppSettingsForm,
|
|
9546
7606
|
useCancelSubscription,
|
|
9547
7607
|
useContactUs,
|
|
9548
|
-
useContactUsForm,
|
|
9549
7608
|
useCrawlGoogleMarkets,
|
|
9550
7609
|
useCreateAd,
|
|
9551
7610
|
useCreateBulkNotifications,
|
|
@@ -9577,8 +7636,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9577
7636
|
useDeleteUnregisteredVendor,
|
|
9578
7637
|
useDeleteUser,
|
|
9579
7638
|
useDeleteVendor,
|
|
9580
|
-
useEventForm,
|
|
9581
|
-
useEventInfoForm,
|
|
9582
7639
|
useGetAd,
|
|
9583
7640
|
useGetAds,
|
|
9584
7641
|
useGetAdsByRegion,
|
|
@@ -9632,18 +7689,13 @@ var TIER_FROM_LICENCE = {
|
|
|
9632
7689
|
useGetVendors,
|
|
9633
7690
|
useGetVendorsByRegion,
|
|
9634
7691
|
useLeaveGame,
|
|
9635
|
-
useLocationSearch,
|
|
9636
7692
|
useLogin,
|
|
9637
|
-
useLoginForm,
|
|
9638
7693
|
useLogout,
|
|
9639
7694
|
useMarkAllNotificationsRead,
|
|
9640
7695
|
useMarkChatMessagesSeen,
|
|
9641
7696
|
useMarkNotificationRead,
|
|
9642
|
-
usePartnerForm,
|
|
9643
|
-
usePostForm,
|
|
9644
7697
|
useRefreshToken,
|
|
9645
7698
|
useRegister,
|
|
9646
|
-
useRegisterForm,
|
|
9647
7699
|
useRemoveParticipantFromChat,
|
|
9648
7700
|
useRemoveUserFavouriteResource,
|
|
9649
7701
|
useRemoveUserGoingResource,
|
|
@@ -9652,10 +7704,7 @@ var TIER_FROM_LICENCE = {
|
|
|
9652
7704
|
useReportChatUser,
|
|
9653
7705
|
useRequestMarketingMaterial,
|
|
9654
7706
|
useRequestPasswordReset,
|
|
9655
|
-
useRequestPasswordResetForm,
|
|
9656
7707
|
useResetPassword,
|
|
9657
|
-
useResetPasswordForm,
|
|
9658
|
-
useSchoolForm,
|
|
9659
7708
|
useSearchEvents,
|
|
9660
7709
|
useSearchPartners,
|
|
9661
7710
|
useSearchVendors,
|
|
@@ -9665,7 +7714,6 @@ var TIER_FROM_LICENCE = {
|
|
|
9665
7714
|
useStartGame,
|
|
9666
7715
|
useToggleChatMessageLike,
|
|
9667
7716
|
useUnlinkUnregisteredVendorByInviterId,
|
|
9668
|
-
useUnregisteredVendorForm,
|
|
9669
7717
|
useUpdateAd,
|
|
9670
7718
|
useUpdateAppSettings,
|
|
9671
7719
|
useUpdateDailyClueGame,
|
|
@@ -9682,11 +7730,7 @@ var TIER_FROM_LICENCE = {
|
|
|
9682
7730
|
useUpdateUser,
|
|
9683
7731
|
useUpdateVendor,
|
|
9684
7732
|
useUpdateVendorInfo,
|
|
9685
|
-
useUserForm,
|
|
9686
7733
|
useValidateVerificationToken,
|
|
9687
|
-
useValidateVerificationTokenForm,
|
|
9688
|
-
useVendorForm,
|
|
9689
|
-
useVendorInfoForm,
|
|
9690
7734
|
validateVerificationTokenFields,
|
|
9691
7735
|
vendorAvailability,
|
|
9692
7736
|
vendorBasicInfoFields,
|