@timardex/cluemart-shared 2.0.18 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/{ad-ZwLtQn9a.d.ts → ad-CUckkB7I.d.ts} +2 -2
  2. package/dist/{ad-xO8ltnGA.d.mts → ad-sqc3JME-.d.mts} +2 -2
  3. package/dist/{affiliate-Bv4PXBXC.d.mts → affiliate-7SDCo04C.d.mts} +2 -2
  4. package/dist/{affiliate-xDFlLdJI.d.ts → affiliate-C03r7ssL.d.ts} +2 -2
  5. package/dist/auth/index.d.mts +3 -3
  6. package/dist/auth/index.d.ts +3 -3
  7. package/dist/auth/index.mjs +5 -16
  8. package/dist/auth/index.mjs.map +1 -1
  9. package/dist/{chunk-ZUXHEXJU.mjs → chunk-6ZH75TAT.mjs} +3 -3
  10. package/dist/{chunk-3DYFIY72.mjs → chunk-7TZDJXYL.mjs} +1 -2
  11. package/dist/chunk-7TZDJXYL.mjs.map +1 -0
  12. package/dist/{chunk-UH6POK3Y.mjs → chunk-7XIDMA4Z.mjs} +2 -2
  13. package/dist/chunk-N46DFZ3R.mjs +20 -0
  14. package/dist/chunk-N46DFZ3R.mjs.map +1 -0
  15. package/dist/{chunk-JESR7H4R.mjs → chunk-PIEXGXTD.mjs} +1 -1
  16. package/dist/chunk-PIEXGXTD.mjs.map +1 -0
  17. package/dist/chunk-RE4NZPYY.mjs +43 -0
  18. package/dist/chunk-RE4NZPYY.mjs.map +1 -0
  19. package/dist/{chunk-5G3MQXQX.mjs → chunk-UHZHNJHO.mjs} +4 -4
  20. package/dist/{chunk-KUC252SN.mjs → chunk-YMLEIEZD.mjs} +5 -27
  21. package/dist/chunk-YMLEIEZD.mjs.map +1 -0
  22. package/dist/{chunk-PNKTKJ47.mjs → chunk-Z4FML4VL.mjs} +2 -2
  23. package/dist/{contactUs-DtKFwekV.d.ts → contactUs-BG3sJ6gc.d.ts} +1 -1
  24. package/dist/{contactUs-0IhAsiDW.d.mts → contactUs-CWFP59_0.d.mts} +1 -1
  25. package/dist/enums/index.cjs +0 -1
  26. package/dist/enums/index.cjs.map +1 -1
  27. package/dist/enums/index.d.mts +1 -2
  28. package/dist/enums/index.d.ts +1 -2
  29. package/dist/enums/index.mjs +1 -1
  30. package/dist/formFields/index.cjs.map +1 -1
  31. package/dist/formFields/index.d.mts +1 -1
  32. package/dist/formFields/index.d.ts +1 -1
  33. package/dist/formFields/index.mjs +6 -5
  34. package/dist/{global-C6w0hQ5Y.d.mts → global-BqeTWrvk.d.ts} +4 -1
  35. package/dist/{global-Coz5Jgi2.d.ts → global-CWo-hWKZ.d.mts} +4 -1
  36. package/dist/graphql/index.cjs +4 -27
  37. package/dist/graphql/index.cjs.map +1 -1
  38. package/dist/graphql/index.d.mts +6 -14
  39. package/dist/graphql/index.d.ts +6 -14
  40. package/dist/graphql/index.mjs +2 -4
  41. package/dist/hooks/index.cjs +0 -8
  42. package/dist/hooks/index.cjs.map +1 -1
  43. package/dist/hooks/index.d.mts +5 -5
  44. package/dist/hooks/index.d.ts +5 -5
  45. package/dist/hooks/index.mjs +8 -7
  46. package/dist/hooks/index.mjs.map +1 -1
  47. package/dist/index.cjs +47 -28
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.d.mts +9 -11
  50. package/dist/index.d.ts +9 -11
  51. package/dist/index.mjs +44 -27
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/map/index.d.mts +1 -1
  54. package/dist/map/index.d.ts +1 -1
  55. package/dist/region/index.cjs +290 -0
  56. package/dist/region/index.cjs.map +1 -0
  57. package/dist/region/index.d.mts +36 -0
  58. package/dist/region/index.d.ts +36 -0
  59. package/dist/region/index.mjs +220 -0
  60. package/dist/region/index.mjs.map +1 -0
  61. package/dist/{resourceActivities-DScv6fiM.d.ts → resourceActivities-BbhGFtZA.d.ts} +1 -1
  62. package/dist/{resourceActivities-DIK3bwZg.d.mts → resourceActivities-D81u7Mu0.d.mts} +1 -1
  63. package/dist/sharing/index.cjs.map +1 -1
  64. package/dist/sharing/index.d.mts +1 -1
  65. package/dist/sharing/index.d.ts +1 -1
  66. package/dist/sharing/index.mjs +3 -3
  67. package/dist/types/index.cjs.map +1 -1
  68. package/dist/types/index.d.mts +7 -7
  69. package/dist/types/index.d.ts +7 -7
  70. package/dist/types/index.mjs +2 -2
  71. package/dist/{user-DhxdbFT7.d.ts → user-2peJoOeK.d.ts} +1 -1
  72. package/dist/{user-BwcVKK-h.d.mts → user-DKcyf8gn.d.mts} +1 -1
  73. package/dist/utils/index.cjs +43 -0
  74. package/dist/utils/index.cjs.map +1 -1
  75. package/dist/utils/index.d.mts +8 -4
  76. package/dist/utils/index.d.ts +8 -4
  77. package/dist/utils/index.mjs +12 -4
  78. package/package.json +6 -1
  79. package/dist/chunk-3DYFIY72.mjs.map +0 -1
  80. package/dist/chunk-JESR7H4R.mjs.map +0 -1
  81. package/dist/chunk-KUC252SN.mjs.map +0 -1
  82. /package/dist/{chunk-ZUXHEXJU.mjs.map → chunk-6ZH75TAT.mjs.map} +0 -0
  83. /package/dist/{chunk-UH6POK3Y.mjs.map → chunk-7XIDMA4Z.mjs.map} +0 -0
  84. /package/dist/{chunk-5G3MQXQX.mjs.map → chunk-UHZHNJHO.mjs.map} +0 -0
  85. /package/dist/{chunk-PNKTKJ47.mjs.map → chunk-Z4FML4VL.mjs.map} +0 -0
@@ -1,13 +1,13 @@
1
- export { A as AdminUpdateResourceType, c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, a as NotificationCount, i as NotificationDataType, N as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-DScv6fiM.js';
2
- export { q as AdBookingType, r as AdDailyPriceKey, s as AdDailyPriceType, j as AdFormData, t as AdFormState, u as AdPlacement, v as AdResource, w as AdSettingsFormData, x as AdSettingsType, a as AdType, m as AppSettingsFormData, c as AppSettingsType, A as AuthMutationResponse, y as AuthPayloadType, z as CreateAdFormData, k as CreateAdFormState, n as CreateAppSettingsFormData, C as CreateLoginFormData, l as CreatePartnerFormData, e as CreateRegisterFormData, f as CreateRequestPasswordResetFormData, h as CreateResetPasswordFormData, p as CreateSchoolFormData, g as CreateValidateVerificationTokenFormData, B as EnumAdApprovalStatus, D as EnumAdBookingSlotKind, F as EnumAdBookingState, G as EnumAdEntitlementSource, H as EnumAdPaymentStatus, E as EnumAdPlatform, b as EnumAdShowOn, I as EnumAdStatus, J as EnumAdStyle, K as EnumAdType, L as EnumVerificationType, M as LoginFormData, N as MarketingMaterialRequestInputType, i as PartnerFormData, P as PartnerType, O as PosterInputType, R as RefreshTokenMutationResponse, Q as RefreshTokenPayloadType, T as RegisterFormData, U as RequestPasswordResetFormData, V as ResetPasswordFormData, W as SchoolCampaignType, o as SchoolFormData, X as SchoolRegisteredUserType, d as SchoolReturnType, S as SchoolType, Y as ValidateVerificationTokenFormData } from '../ad-ZwLtQn9a.js';
3
- export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-DtKFwekV.js';
4
- import { d as EventListItemType } from '../global-Coz5Jgi2.js';
5
- export { K as BaseGameMap, N as BaseGameType, Q as BaseResourceType, B as BaseResourceTypeFormData, C as Category, c as CategoryColorType, T as CouponCodeType, W as CouponDataProductsType, X as CouponDataType, H as CouponDefaultsFormData, Y as CouponMarketPassportOption, Z as CouponMarketVisitOption, _ as CouponOption, $ as CouponParticipantUserType, a0 as CouponPurchaseOption, o as CouponType, p as CouponTypeList, a1 as CouponVendorProduct, I as CreateCouponFormData, x as CreateEventFormData, z as CreateEventInfoFormData, a2 as CreateFormData, D as CreatePostFormData, v as CreateUnregisteredVendorFormData, r as CreateVendorFormData, t as CreateVendorInfoFormData, a3 as DailyClueBaseGame, a4 as DailyClueGameData, a5 as DateTimeType, a6 as DateTimeWithPriceType, a7 as DeviceInfo, a8 as EnumCouponListType, a9 as EnumCouponQualificationType, aa as EnumGameStatus, ab as EnumGameType, ac as EnumPostContentType, ad as EnumPostType, w as EventFormData, y as EventInfoFormData, e as EventInfoType, ae as EventListFilter, af as EventStatusType, E as EventType, a as FormDateField, F as FormField, ag as GameDate, G as GameDocType, ah as GameHistory, n as GameLeaderboard, ai as GamePlacement, aj as GamePlacementClue, ak as GameType, al as GeocodeLocation, am as GlobalGameData, an as ImageObjectType, ao as LocationGeoType, L as LocationType, M as MutationResponse, k as MyPendingVendorClaim, ap as Nullable, O as OptionItem, aq as OwnerType, ar as PROMO_CODE_PREFIX, as as PaginationOptions, at as PartnerListFilter, au as PaymentInfoType, av as PostContentData, aw as PostContentFormData, ax as PostContentGame, ay as PostContentImage, az as PostContentList, aA as PostContentTextarea, aB as PostContentType, aC as PostContentVideo, aD as PostFileInput, A as PostFormData, aE as PostListFilter, aF as PostResource, m as PostType, P as PosterUsageType, aG as ProductCoupon, aH as PromoCodeType, aI as PuzzleAnswer, aJ as PuzzleAnsweredQuestion, aK as PuzzleBaseGame, aL as PuzzleGameData, aM as PuzzleQuestion, R as RefundPolicy, J as Region, aN as RelatedPostType, aO as RelationDate, aP as RelationInputType, f as RelationType, b as Requirement, g as ResourceConnectionsType, aQ as ResourceContactDetailsType, aR as ResourceDetails, aS as ResourceImageType, aT as SocialMediaType, aU as SocialShareResourceType, S as StallType, aV as Subcategory, aW as SubcategoryItems, aX as TermsAgreement, u as UnregisteredVendorFormData, aY as UnregisteredVendorInvitationType, h as UnregisteredVendorType, U as UseGetResourcesByRegionOptions, l as UserLicenceType, aZ as UserListFilter, a_ as VendorAttributes, a$ as VendorAvailability, b0 as VendorCalendarData, V as VendorClaimTokenValidation, b1 as VendorDowngradeSnapshot, q as VendorFormData, s as VendorInfoFormData, j as VendorInfoType, b2 as VendorListFilter, b3 as VendorProductList, i as VendorType, b4 as gameScreenIdentifierList, b5 as gameTypeToDisplayName } from '../global-Coz5Jgi2.js';
6
- export { C as CreateUserFormData, f as RedeemRewardInput, R as RedeemRewardMutationResponse, g as RedeemRewardResponse, h as RedeemedReward, b as ResourceByUser, S as SafeUserType, i as StripeSubscription, j as SubscriptionPlanData, d as SubscriptionPlansResponse, k as SubscriptionPricingData, c as SubscriptionStatusData, l as UserActivity, m as UserActivityEvent, e as UserFormData, n as UserType, U as UsersByPromoCode } from '../user-DhxdbFT7.js';
1
+ export { A as AdminUpdateResourceType, c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, a as NotificationCount, i as NotificationDataType, N as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-BbhGFtZA.js';
2
+ export { q as AdBookingType, r as AdDailyPriceKey, s as AdDailyPriceType, j as AdFormData, t as AdFormState, u as AdPlacement, v as AdResource, w as AdSettingsFormData, x as AdSettingsType, a as AdType, m as AppSettingsFormData, c as AppSettingsType, A as AuthMutationResponse, y as AuthPayloadType, z as CreateAdFormData, k as CreateAdFormState, n as CreateAppSettingsFormData, C as CreateLoginFormData, l as CreatePartnerFormData, e as CreateRegisterFormData, f as CreateRequestPasswordResetFormData, h as CreateResetPasswordFormData, p as CreateSchoolFormData, g as CreateValidateVerificationTokenFormData, B as EnumAdApprovalStatus, D as EnumAdBookingSlotKind, F as EnumAdBookingState, G as EnumAdEntitlementSource, H as EnumAdPaymentStatus, E as EnumAdPlatform, b as EnumAdShowOn, I as EnumAdStatus, J as EnumAdStyle, K as EnumAdType, L as EnumVerificationType, M as LoginFormData, N as MarketingMaterialRequestInputType, i as PartnerFormData, P as PartnerType, O as PosterInputType, R as RefreshTokenMutationResponse, Q as RefreshTokenPayloadType, T as RegisterFormData, U as RequestPasswordResetFormData, V as ResetPasswordFormData, W as SchoolCampaignType, o as SchoolFormData, X as SchoolRegisteredUserType, d as SchoolReturnType, S as SchoolType, Y as ValidateVerificationTokenFormData } from '../ad-CUckkB7I.js';
3
+ export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-BG3sJ6gc.js';
4
+ import { d as EventListItemType } from '../global-BqeTWrvk.js';
5
+ export { K as BaseGameMap, N as BaseGameType, Q as BaseResourceType, B as BaseResourceTypeFormData, C as Category, c as CategoryColorType, T as CouponCodeType, W as CouponDataProductsType, X as CouponDataType, H as CouponDefaultsFormData, Y as CouponMarketPassportOption, Z as CouponMarketVisitOption, _ as CouponOption, $ as CouponParticipantUserType, a0 as CouponPurchaseOption, o as CouponType, p as CouponTypeList, a1 as CouponVendorProduct, I as CreateCouponFormData, x as CreateEventFormData, z as CreateEventInfoFormData, a2 as CreateFormData, D as CreatePostFormData, v as CreateUnregisteredVendorFormData, r as CreateVendorFormData, t as CreateVendorInfoFormData, a3 as DailyClueBaseGame, a4 as DailyClueGameData, a5 as DateTimeType, a6 as DateTimeWithPriceType, a7 as DeviceInfo, a8 as EnumCouponListType, a9 as EnumCouponQualificationType, aa as EnumGameStatus, ab as EnumGameType, ac as EnumPostContentType, ad as EnumPostType, w as EventFormData, y as EventInfoFormData, e as EventInfoType, ae as EventListFilter, af as EventStatusType, E as EventType, a as FormDateField, F as FormField, ag as GameDate, G as GameDocType, ah as GameHistory, n as GameLeaderboard, ai as GamePlacement, aj as GamePlacementClue, ak as GameType, al as GeocodeLocation, am as GlobalGameData, an as ImageObjectType, ao as LocationGeoType, L as LocationType, M as MutationResponse, k as MyPendingVendorClaim, ap as Nullable, O as OptionItem, aq as OwnerType, ar as PROMO_CODE_PREFIX, as as PaginationOptions, at as PartnerListFilter, au as PaymentInfoType, av as PostContentData, aw as PostContentFormData, ax as PostContentGame, ay as PostContentImage, az as PostContentList, aA as PostContentTextarea, aB as PostContentType, aC as PostContentVideo, aD as PostFileInput, A as PostFormData, aE as PostListFilter, aF as PostResource, m as PostType, P as PosterUsageType, aG as ProductCoupon, aH as PromoCodeType, aI as PuzzleAnswer, aJ as PuzzleAnsweredQuestion, aK as PuzzleBaseGame, aL as PuzzleGameData, aM as PuzzleQuestion, R as RefundPolicy, J as Region, aN as RelatedPostType, aO as RelationDate, aP as RelationInputType, f as RelationType, b as Requirement, g as ResourceConnectionsType, aQ as ResourceContactDetailsType, aR as ResourceDetails, aS as ResourceImageType, aT as SocialMediaType, aU as SocialShareResourceType, S as StallType, aV as Subcategory, aW as SubcategoryItems, aX as TermsAgreement, u as UnregisteredVendorFormData, aY as UnregisteredVendorInvitationType, h as UnregisteredVendorType, U as UseGetResourcesByRegionOptions, l as UserLicenceType, aZ as UserListFilter, a_ as VendorAttributes, a$ as VendorAvailability, b0 as VendorCalendarData, V as VendorClaimTokenValidation, b1 as VendorDowngradeSnapshot, q as VendorFormData, s as VendorInfoFormData, j as VendorInfoType, b2 as VendorListFilter, b3 as VendorProductList, i as VendorType, b4 as gameScreenIdentifierList, b5 as gameTypeToDisplayName } from '../global-BqeTWrvk.js';
6
+ export { C as CreateUserFormData, f as RedeemRewardInput, R as RedeemRewardMutationResponse, g as RedeemRewardResponse, h as RedeemedReward, b as ResourceByUser, S as SafeUserType, i as StripeSubscription, j as SubscriptionPlanData, d as SubscriptionPlansResponse, k as SubscriptionPricingData, c as SubscriptionStatusData, l as UserActivity, m as UserActivityEvent, e as UserFormData, n as UserType, U as UsersByPromoCode } from '../user-2peJoOeK.js';
7
7
  import { EnumOSPlatform } from '../enums/index.js';
8
8
  export { a as BillingCatalogDefinition, B as BillingCatalogEntryType, b as BillingCatalogInitialEntry, c as BillingCatalogKey, d as BillingCatalogPriceHistoryEntry, P as PaidVendorBillingPeriod, e as PaidVendorLicence, S as SyncBillingCatalogPriceInput, U as UpdateBillingCatalogPriceInput } from '../billingCatalog-oWAfZX95.js';
9
9
  export { a as TIERS_BY_PRIORITY, b as TIER_DISPLAY_LABELS, c as TIER_FROM_LICENCE, T as Tier } from '../subscription-BU8GvH2K.js';
10
- export { b as AffiliateBankAccountDetailsType, c as AffiliateContactDetails, d as AffiliateDetailsType, a as AffiliateFormData, e as AffiliateResourceType, f as AffiliateRewardType, A as AffiliateType, g as AffiliateUserDefaultFields, C as CreateAffiliateFormData, E as EnumAffiliateParticipantType, h as EnumAffiliateRewardType, R as RedeemHistoryType } from '../affiliate-xDFlLdJI.js';
10
+ export { b as AffiliateBankAccountDetailsType, c as AffiliateContactDetails, d as AffiliateDetailsType, a as AffiliateFormData, e as AffiliateResourceType, f as AffiliateRewardType, A as AffiliateType, g as AffiliateUserDefaultFields, C as CreateAffiliateFormData, E as EnumAffiliateParticipantType, h as EnumAffiliateRewardType, R as RedeemHistoryType } from '../affiliate-C03r7ssL.js';
11
11
  import '../images/index.js';
12
12
  import 'react-hook-form';
13
13
 
@@ -22,13 +22,13 @@ import {
22
22
  PROMO_CODE_PREFIX,
23
23
  gameScreenIdentifierList,
24
24
  gameTypeToDisplayName
25
- } from "../chunk-JESR7H4R.mjs";
25
+ } from "../chunk-PIEXGXTD.mjs";
26
26
  import {
27
27
  TIERS_BY_PRIORITY,
28
28
  TIER_DISPLAY_LABELS,
29
29
  TIER_FROM_LICENCE
30
30
  } from "../chunk-DQ7ZHIXW.mjs";
31
- import "../chunk-3DYFIY72.mjs";
31
+ import "../chunk-7TZDJXYL.mjs";
32
32
  export {
33
33
  EnumActivity,
34
34
  EnumAdApprovalStatus,
@@ -1,5 +1,5 @@
1
1
  import { EnumOSPlatform, EnumResourceType, EnumReward, EnumUserRole, EnumBillingPeriod, EnumUserLicence, EnumSubscriptionStatus, EnumNotificationResourceType } from './enums/index.js';
2
- import { aS as ResourceImageType, L as LocationType, aX as TermsAgreement, l as UserLicenceType, aH as PromoCodeType, a5 as DateTimeType, M as MutationResponse, a2 as CreateFormData } from './global-Coz5Jgi2.js';
2
+ import { aS as ResourceImageType, L as LocationType, aX as TermsAgreement, l as UserLicenceType, aH as PromoCodeType, a5 as DateTimeType, M as MutationResponse, a2 as CreateFormData } from './global-BqeTWrvk.js';
3
3
 
4
4
  /**
5
5
  * Canonical permission IDs. Add new permissions here first, then map them in
@@ -1,5 +1,5 @@
1
1
  import { EnumOSPlatform, EnumResourceType, EnumReward, EnumUserRole, EnumBillingPeriod, EnumUserLicence, EnumSubscriptionStatus, EnumNotificationResourceType } from './enums/index.mjs';
2
- import { aS as ResourceImageType, L as LocationType, aX as TermsAgreement, l as UserLicenceType, aH as PromoCodeType, a5 as DateTimeType, M as MutationResponse, a2 as CreateFormData } from './global-C6w0hQ5Y.mjs';
2
+ import { aS as ResourceImageType, L as LocationType, aX as TermsAgreement, l as UserLicenceType, aH as PromoCodeType, a5 as DateTimeType, M as MutationResponse, a2 as CreateFormData } from './global-CWo-hWKZ.mjs';
3
3
 
4
4
  /**
5
5
  * Canonical permission IDs. Add new permissions here first, then map them in
@@ -76,6 +76,7 @@ __export(utils_exports, {
76
76
  filterVendorEventsBySelectedDate: () => filterVendorEventsBySelectedDate,
77
77
  findEventDateTimeByIsoDate: () => findEventDateTimeByIsoDate,
78
78
  formatDate: () => formatDate,
79
+ formatDistance: () => formatDistance,
79
80
  formatIrdNumber: () => formatIrdNumber,
80
81
  formatNZBankAccount: () => formatNZBankAccount,
81
82
  formatTimestamp: () => formatTimestamp,
@@ -84,6 +85,8 @@ __export(utils_exports, {
84
85
  getAllowedEventDateStatuses: () => getAllowedEventDateStatuses,
85
86
  getBillingCatalogKeyForSelection: () => getBillingCatalogKeyForSelection,
86
87
  getCurrentAndFutureDates: () => getCurrentAndFutureDates,
88
+ getDistanceInKilometers: () => getDistanceInKilometers,
89
+ getDistanceInMeters: () => getDistanceInMeters,
87
90
  getErrorMessage: () => getErrorMessage,
88
91
  getEventCalendarIsoDates: () => getEventCalendarIsoDates,
89
92
  getEventDatesWithStallholders: () => getEventDatesWithStallholders,
@@ -458,6 +461,43 @@ function computeDailyClueState(dailyClue) {
458
461
  };
459
462
  }
460
463
 
464
+ // src/utils/distance.ts
465
+ function getDistanceInMeters(coordinates1, coordinates2) {
466
+ const [lon1, lat1] = coordinates1;
467
+ const [lon2, lat2] = coordinates2;
468
+ const values = [lon1, lat1, lon2, lat2];
469
+ if (values.some((v) => !Number.isFinite(v))) {
470
+ return Infinity;
471
+ }
472
+ const toRadians = (deg) => deg * Math.PI / 180;
473
+ const R = 6371e3;
474
+ const dLat = toRadians(lat2 - lat1);
475
+ const dLon = toRadians(lon2 - lon1);
476
+ const radLat1 = toRadians(lat1);
477
+ const radLat2 = toRadians(lat2);
478
+ const a = Math.sin(dLat / 2) ** 2 + Math.sin(dLon / 2) ** 2 * Math.cos(radLat1) * Math.cos(radLat2);
479
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
480
+ return R * c;
481
+ }
482
+ function getDistanceInKilometers(coordinates1, coordinates2) {
483
+ const distanceInMeters = getDistanceInMeters(coordinates1, coordinates2);
484
+ if (!Number.isFinite(distanceInMeters)) {
485
+ return Infinity;
486
+ }
487
+ return Math.round(distanceInMeters / 1e3);
488
+ }
489
+ function formatDistance(coordinates1, coordinates2) {
490
+ const distanceInMeters = getDistanceInMeters(coordinates1, coordinates2);
491
+ if (!Number.isFinite(distanceInMeters)) {
492
+ return "\u2014";
493
+ }
494
+ const roundedMeters = Math.round(distanceInMeters);
495
+ if (roundedMeters < 1e3) {
496
+ return `${roundedMeters} m`;
497
+ }
498
+ return `${Math.round(roundedMeters / 1e3)} km`;
499
+ }
500
+
461
501
  // src/utils/pagination.ts
462
502
  var DEFAULT_PAGE_SIZE = 50;
463
503
  function defaultGetId(item) {
@@ -2274,6 +2314,7 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
2274
2314
  filterVendorEventsBySelectedDate,
2275
2315
  findEventDateTimeByIsoDate,
2276
2316
  formatDate,
2317
+ formatDistance,
2277
2318
  formatIrdNumber,
2278
2319
  formatNZBankAccount,
2279
2320
  formatTimestamp,
@@ -2282,6 +2323,8 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
2282
2323
  getAllowedEventDateStatuses,
2283
2324
  getBillingCatalogKeyForSelection,
2284
2325
  getCurrentAndFutureDates,
2326
+ getDistanceInKilometers,
2327
+ getDistanceInMeters,
2285
2328
  getErrorMessage,
2286
2329
  getEventCalendarIsoDates,
2287
2330
  getEventDatesWithStallholders,