@timardex/cluemart-shared 1.5.740 → 1.5.742
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/{ad-CqfSmtG_.d.ts → ad-DTOtubs3.d.ts} +1 -1
- package/dist/{ad-sgD-lSbO.d.mts → ad-DpwV6VZX.d.mts} +1 -1
- package/dist/{chunk-6OBMKN7F.mjs → chunk-64ZADXXH.mjs} +2 -2
- package/dist/{chunk-XWFE6U3E.mjs → chunk-K5OWNJY5.mjs} +131 -119
- package/dist/chunk-K5OWNJY5.mjs.map +1 -0
- package/dist/{chunk-6YISZ3OD.mjs → chunk-KXQLOILF.mjs} +2 -2
- package/dist/{chunk-7VNXO63T.mjs → chunk-LNIT5OS3.mjs} +1 -1
- package/dist/chunk-LNIT5OS3.mjs.map +1 -0
- package/dist/{chunk-3AI2ROPT.mjs → chunk-TIXEG66V.mjs} +19 -1
- package/dist/chunk-TIXEG66V.mjs.map +1 -0
- package/dist/{contactUs-DA3p41Uq.d.ts → contactUs-BK5MKYPx.d.ts} +1 -1
- package/dist/{contactUs-B6lQQq-x.d.mts → contactUs-CRypzI-A.d.mts} +1 -1
- package/dist/formFields/index.cjs +28 -4
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/formFields/index.mjs +3 -3
- package/dist/{global-BEUzBSyY.d.mts → global-q9JjONd1.d.mts} +280 -1
- package/dist/{global-585slmSH.d.ts → global-vWzQNI8w.d.ts} +280 -1
- package/dist/graphql/index.cjs +18 -0
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +3 -4
- package/dist/graphql/index.d.ts +3 -4
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs +34 -6
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +3 -4
- package/dist/hooks/index.d.ts +3 -4
- package/dist/hooks/index.mjs +5 -5
- package/dist/index.cjs +171 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +922 -914
- package/dist/index.d.ts +922 -914
- package/dist/index.mjs +170 -141
- package/dist/index.mjs.map +1 -1
- package/dist/{resourceActivities-CZqXBve8.d.mts → resourceActivities-CpjJeH23.d.mts} +1 -1
- package/dist/{resourceActivities-CjJdhVR7.d.ts → resourceActivities-DtxRUlrT.d.ts} +1 -1
- package/dist/sharing/index.cjs +82 -58
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +1 -1
- package/dist/sharing/index.d.ts +1 -1
- package/dist/sharing/index.mjs +3 -3
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +5 -6
- package/dist/types/index.d.ts +5 -6
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.cjs +167 -141
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +6 -3
- package/dist/utils/index.d.ts +6 -3
- package/dist/utils/index.mjs +4 -2
- package/package.json +1 -1
- package/dist/chunk-3AI2ROPT.mjs.map +0 -1
- package/dist/chunk-7VNXO63T.mjs.map +0 -1
- package/dist/chunk-XWFE6U3E.mjs.map +0 -1
- package/dist/post-CdLrXuH1.d.mts +0 -279
- package/dist/post-D6n4Vszs.d.ts +0 -279
- /package/dist/{chunk-6OBMKN7F.mjs.map → chunk-64ZADXXH.mjs.map} +0 -0
- /package/dist/{chunk-6YISZ3OD.mjs.map → chunk-KXQLOILF.mjs.map} +0 -0
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts","../../src/types/auth.ts","../../src/types/global.ts","../../src/types/ad.ts","../../src/types/resourceActivities.ts","../../src/types/post.ts","../../src/types/game/index.ts","../../src/types/game/dailyClue.ts","../../src/types/game/global.ts","../../src/types/subscription.ts"],"sourcesContent":["export * from \"./admin\";\nexport * from \"./auth\";\nexport * from \"./chat\";\nexport * from \"./contactUs\";\nexport * from \"./global\";\nexport * from \"./event\";\nexport * from \"./notification\";\nexport * from \"./poster\";\nexport * from \"./relation\";\nexport * from \"./vendor\";\nexport * from \"./user\";\nexport * from \"./ad\";\nexport * from \"./resourceActivities\";\nexport * from \"./partner\";\nexport * from \"./post\";\nexport * from \"./pushToken\";\nexport * from \"./appSettings\";\nexport * from \"./googleImportedMarket\";\nexport * from \"./game\";\nexport * from \"./game/dailyClue\";\nexport * from \"./game/global\";\nexport * from \"./game/puzzleGame\";\nexport * from \"./school\";\nexport * from \"./subscription\";\n","import {\n CreateFormData,\n EnumOSPlatform,\n PromoCodeType,\n TermsAgreement,\n} from \"src\";\n\nimport { SafeUserType } from \"./user\";\n\nexport enum EnumVerificationType {\n REGISTER = \"register\",\n RESET_PASSWORD = \"resetPassword\",\n}\n\nexport type LoginFormData = {\n email: string;\n isAdminPage?: boolean;\n password: string;\n platform?: EnumOSPlatform;\n};\n\nexport type CreateLoginFormData = CreateFormData<LoginFormData>;\n\nexport type RegisterFormData = {\n email: string;\n firstName: string;\n lastName: string;\n password: string;\n platform?: EnumOSPlatform;\n preferredRegion: string;\n promoCode?: PromoCodeType | null;\n termsAgreement?: TermsAgreement | null;\n};\n\nexport type CreateRegisterFormData = CreateFormData<RegisterFormData>;\n\nexport type RequestPasswordResetFormData = {\n email: string;\n};\n\nexport type CreateRequestPasswordResetFormData =\n CreateFormData<RequestPasswordResetFormData>;\n\nexport type ResetPasswordFormData = {\n confirmPassword: string;\n email: string;\n password: string;\n};\n\nexport type CreateResetPasswordFormData = CreateFormData<ResetPasswordFormData>;\n\nexport type ValidateVerificationTokenFormData = {\n email: string;\n verificationToken: string;\n verificationType?: EnumVerificationType;\n};\n\nexport type CreateValidateVerificationTokenFormData =\n CreateFormData<ValidateVerificationTokenFormData>;\n\nexport type AuthPayloadType = {\n message: string;\n token: string;\n refreshToken: string | null;\n user: SafeUserType;\n};\n\nexport type RefreshTokenPayloadType = {\n refreshToken: string;\n token: string;\n};\n","import {\n Control,\n FieldValues,\n FormState,\n UseFormGetValues,\n UseFormHandleSubmit,\n UseFormReset,\n UseFormSetValue,\n UseFormWatch,\n} from \"react-hook-form\";\n\nimport {\n EnumEventDateStatus,\n EnumEventType,\n EnumResourceType,\n EnumSocialMedia,\n EnumUserLicence,\n} from \"../enums\";\n\nimport { EventListItemType } from \"./event\";\nimport { VendorType } from \"./vendor\";\n\nexport const PROMO_CODE_PREFIX = \"CM-\";\n\nexport type PromoCodeType = `${typeof PROMO_CODE_PREFIX}${string}`;\n\nexport type Nullable<T> = {\n [K in keyof T]: T[K] | null | undefined;\n};\n\nexport type DeviceInfo = {\n appBuildNumber: string;\n appId: string;\n appVersion: string;\n brand: string;\n deviceName: string;\n installationId: string;\n manufacturer: string;\n modelName: string;\n osName: string;\n osVersion: string;\n timestamp: string;\n};\n\nexport type TermsAgreement = DeviceInfo & {\n termVersion: string;\n};\n\nexport type ResourceContactDetailsType = {\n email?: string | null;\n landlinePhone?: string | null;\n mobilePhone?: string | null;\n};\n\nexport type ResourceImageType = {\n active?: boolean | null;\n source: string;\n title: string;\n};\n\nexport type SocialMediaType = {\n name?: EnumSocialMedia;\n link?: string;\n};\n\nexport type UserLicenceType = {\n expiryDate: Date;\n issuedDate: Date;\n licenceType: EnumUserLicence;\n prevLicenceType?: EnumUserLicence | null;\n};\n\nexport type AssociateType = {\n email: string;\n resourceId: string;\n resourceType: EnumResourceType;\n licence: UserLicenceType;\n};\n\nexport type OwnerType = {\n email: string;\n userId: string;\n};\n\nexport interface BaseResourceTypeFormData {\n _id?: string;\n active: boolean;\n associates: AssociateType[] | null;\n contactDetails: ResourceContactDetailsType | null;\n cover: ResourceImageType;\n coverUpload?: ResourceImageType | null;\n description: string;\n images?: ResourceImageType[] | null;\n imagesUpload?: ResourceImageType[] | null;\n logo?: ResourceImageType | null;\n logoUpload?: ResourceImageType | null;\n name: string;\n owner?: OwnerType | null;\n promoCodes?: PromoCodeType[] | null;\n region: string;\n socialMedia: SocialMediaType[] | null;\n termsAgreement?: TermsAgreement | null;\n}\n\nexport type PosterUsageType = {\n month: string;\n count: number;\n};\n\nexport type BaseResourceType = Omit<\n BaseResourceTypeFormData,\n \"_id\" | \"coverUpload\" | \"imagesUpload\" | \"logoUpload\"\n> & {\n _id: string;\n adIds?: string[] | null;\n createdAt: Date;\n deletedAt: Date | null;\n posterUsage?: PosterUsageType | null;\n rating?: number | null;\n reviewCount?: number | null;\n updatedAt: Date | null;\n};\n\nexport type LocationGeoType = {\n coordinates: number[]; // [longitude, latitude]\n type: \"Point\"; // Mongoose GeoJSON type\n};\n\nexport type LocationType = {\n city: string;\n country: string;\n fullAddress: string;\n geo: LocationGeoType;\n latitude: number;\n longitude: number;\n region: string;\n};\n\nexport type DateTimeType = {\n dateStatus: EnumEventDateStatus;\n endDate: string;\n endTime: string;\n startDate: string;\n startTime: string;\n};\n\nexport type Region = {\n latitude: number;\n latitudeDelta: number;\n longitude: number;\n longitudeDelta: number;\n};\n\nexport type ResourceDetails = {\n dateTime: DateTimeType[] | null;\n description: string | null;\n eventStatus?: EventStatusType | null;\n location: LocationType | null;\n resourceCover: ResourceImageType | null;\n resourceId: string;\n resourceLogo: ResourceImageType | null;\n resourceName: string;\n resourceType: EnumResourceType;\n};\n\nexport type GeocodeLocation = Pick<LocationType, \"latitude\" | \"longitude\">;\n\nexport type EventStatusType = {\n claimed: boolean;\n eventType: EnumEventType;\n googlePlaceId?: string | null;\n};\n\nexport interface FormField {\n disabled?: boolean;\n helperText?: string;\n isTextArea?: boolean;\n keyboardType?:\n | \"default\"\n | \"email-address\"\n | \"number-pad\"\n | \"url\"\n | \"decimal-pad\"\n | \"phone-pad\";\n name: string;\n placeholder: string;\n required?: boolean;\n secureTextEntry?: boolean;\n}\n\nexport interface FormDateField {\n dateMode: \"date\" | \"time\";\n helperText?: string;\n name: \"endDate\" | \"endTime\" | \"startDate\" | \"startTime\";\n placeholder: string;\n}\n\nexport interface SubcategoryItems {\n id: string;\n name: string;\n description?: string | null;\n}\n\nexport interface Subcategory {\n id: string;\n name: string;\n items?: SubcategoryItems[] | null;\n}\n\nexport interface Category {\n color?: string | null;\n description?: string | null;\n id: string;\n name: string;\n subcategories: Subcategory[];\n}\n\nexport type OptionItem = {\n value: string;\n label: string;\n};\n\nexport type ImageObjectType = {\n uri: string;\n type: string;\n name: string;\n};\n\nexport interface ResourceConnectionsType {\n events: EventListItemType[] | null;\n vendors: VendorType[] | null;\n}\n\nexport interface CreateFormData<T extends FieldValues> {\n control: Control<T, any>;\n fields: T;\n formState: FormState<T>;\n handleSubmit: UseFormHandleSubmit<T, any>;\n reset: UseFormReset<T>;\n setValue: UseFormSetValue<T>;\n watch: UseFormWatch<T>;\n getValues: UseFormGetValues<T>;\n}\n\nexport interface UseGetResourcesByRegionOptions {\n onlyClaimed?: boolean;\n limit?: number;\n offset?: number;\n}\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData } from \"./global\";\n\nexport enum EnumAdShowOn {\n EVENTS_PAGE = \"Events_page\",\n FRONT_PAGE = \"Front_page\",\n PARTNERS_PAGE = \"Partners_page\",\n VENDORS_PAGE = \"Vendors_page\",\n}\n\nexport enum EnumAdStatus {\n ACTIVE = \"Active\",\n PAUSED = \"Paused\",\n EXPIRED = \"Expired\",\n}\n\nexport enum EnumAdType {\n SPONSORED = \"Sponsored\",\n FREE = \"Free\",\n}\n\nexport enum EnumAdStyle {\n BLOOM = \"Bloom\",\n RISE = \"Rise\",\n}\n\nexport type AdResource = {\n adDescription: string;\n adImage: string;\n adStyle: EnumAdStyle;\n adTitle: string;\n adType: EnumAdType;\n resourceId: string;\n resourceName: string;\n resourceRegion: string;\n resourceType: EnumResourceType;\n};\n\nexport interface AdFormData {\n active: boolean;\n end: Date; // ISO date string\n resource: AdResource;\n showOn: EnumAdShowOn[];\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion: string[];\n}\n\n// Form state matches the validation schema: all resource fields are present.\n// Use empty strings / explicit enum defaults in `defaultValues` for \"create\" flows.\nexport type AdFormState = AdFormData;\n\nexport type CreateAdFormData = CreateFormData<AdFormData>;\nexport type CreateAdFormState = CreateFormData<AdFormState>;\n\nexport interface AdType extends AdFormData {\n _id: string;\n clicks?: number; // How many times the ad was clicked\n createdAt: Date;\n impressions?: number; // How often the ad was seen\n start: Date; // ISO date string\n updatedAt: Date | null;\n}\n","import {\n EnumEventDateStatus,\n EnumOSPlatform,\n EnumResourceType,\n} from \"src/enums\";\n\nimport { LocationGeoType } from \"./global\";\n\nexport enum EnumActivity {\n FAVORITE = \"FAVORITE\",\n GOING = \"GOING\",\n INTERESTED = \"INTERESTED\",\n PRESENT = \"PRESENT\",\n VIEW = \"VIEW\",\n}\n\nexport type ResourceActivityEntry = {\n activityType: EnumActivity;\n location: LocationGeoType | null;\n dateStatus?: EnumEventDateStatus | null;\n startDate?: string | null;\n startTime?: string | null;\n timestamp: Date;\n userAgent: EnumOSPlatform;\n userId?: string | null;\n};\n\nexport type ResourceActivityType = {\n _id: string;\n resourceType: EnumResourceType;\n resourceId: string;\n activity: ResourceActivityEntry[];\n};\n\nexport type ResourceActivityInputType = {\n resourceId: string;\n resourceType: EnumResourceType;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n","import { EnumResourceType } from \"src/enums\";\n\nimport { BaseGameType } from \"./game\";\nimport { CreateFormData, ResourceImageType } from \"./global\";\n\nexport enum EnumPostType {\n MARKET_FACES = \"market_faces\",\n CLUE_BITES = \"clue_bites\",\n PLAY_AND_WIN = \"play_and_win\",\n}\n\nexport enum EnumPostContentType {\n GAME = \"game\",\n IMAGE = \"image\",\n LIST = \"list\",\n TEXTAREA = \"textarea\",\n VIDEO = \"video\",\n}\n\nexport type PostFileInput = {\n source: File;\n title?: string;\n};\n\nexport type PostContentTextarea = {\n textarea: {\n title?: string;\n data: string;\n };\n};\n\nexport type PostContentImage = {\n images: ResourceImageType[] | null;\n imagesUpload?: PostFileInput[] | null;\n};\n\nexport type PostContentVideo = {\n video: {\n source: string;\n title?: string;\n };\n};\n\nexport type PostContentList = {\n list: {\n title?: string;\n items: {\n text: string;\n }[];\n };\n};\n\nexport type PostContentGame = {\n game: BaseGameType;\n};\n\nexport type PostContentData =\n | PostContentGame\n | PostContentTextarea\n | PostContentImage\n | PostContentVideo\n | PostContentList;\n\nexport type PostContentFormData = {\n contentData?: PostContentData | null;\n contentOrder?: number | null;\n contentType?: EnumPostContentType | null;\n};\n\nexport interface PostFormData {\n active: boolean;\n caption: string;\n content: PostContentFormData[];\n cover?: ResourceImageType | null;\n coverUpload?: PostFileInput | null;\n postType: EnumPostType;\n resource?: {\n resourceId: string;\n resourceType: EnumResourceType;\n resourceRegion: string;\n } | null;\n tags?: string[] | null;\n title: string;\n notifyUsers?: boolean | null;\n}\n\nexport type CreatePostFormData = CreateFormData<PostFormData>;\n\nexport type PostContentType = Omit<PostContentFormData, \"contentData\"> & {\n contentData: Omit<PostContentData, \"imagesUpload\">;\n};\n\nexport type PostType = Omit<PostFormData, \"content\" | \"coverUpload\"> & {\n _id: string;\n content: PostContentType[];\n createdAt: Date;\n deletedAt: Date | null;\n updatedAt: Date | null;\n};\n","import { OwnerType } from \"../global\";\n\nimport { DailyClueBaseGame, DailyClueGameData } from \"./dailyClue\";\nimport { EnumGameType, GameDate } from \"./global\";\nimport { PuzzleBaseGame, PuzzleGameData } from \"./puzzleGame\";\n\nexport type BaseGameMap = {\n [EnumGameType.DAILY_CLUE]: DailyClueBaseGame;\n [EnumGameType.MINI_QUIZ]: PuzzleBaseGame;\n [EnumGameType.ODD_ONE_OUT]: PuzzleBaseGame;\n};\n\nexport type BaseGameType = {\n gameType: EnumGameType;\n gameTypeId: string;\n gameTitle: string;\n} & {\n [K in keyof BaseGameMap]?: BaseGameMap[K] | null;\n};\n\nexport enum EnumGameStatus {\n GAME_COMPLETED = \"GAME_COMPLETED\",\n GAME_IN_PROGRESS = \"GAME_IN_PROGRESS\",\n GAME_LEFT = \"GAME_LEFT\",\n GAME_STARTED = \"GAME_STARTED\",\n}\n\nexport type GameHistory = Pick<\n BaseGameType,\n \"gameTitle\" | \"gameType\" | \"gameTypeId\"\n> & {\n createdAt: Date;\n gameDate: GameDate;\n gameStatus: EnumGameStatus;\n /** Per-event delta. Not persisted for overallGamePoints (computed at read time). */\n pointsEarned: number;\n /** Running total for this game instance; computed at read time, not stored in Mongo. */\n overallGamePoints?: number;\n};\n\ntype GameDataMap = {\n [EnumGameType.DAILY_CLUE]: DailyClueGameData;\n [EnumGameType.MINI_QUIZ]: PuzzleGameData;\n [EnumGameType.ODD_ONE_OUT]: PuzzleGameData;\n};\ntype GameDataType = {\n [K in keyof GameDataMap]?: GameDataMap[K] | null;\n};\n\nexport type GameType = Pick<\n BaseGameType,\n \"gameTitle\" | \"gameType\" | \"gameTypeId\"\n> & {\n _id: string;\n active: boolean;\n createdAt: Date;\n gameData: GameDataType;\n gameHistory: GameHistory[] | null;\n updatedAt: Date | null;\n};\n\nexport type GameDocType = {\n _id: string;\n active: boolean;\n createdAt: Date;\n deletedAt: Date | null;\n games: GameType[] | null;\n owner: OwnerType;\n points: number;\n updatedAt: Date | null;\n};\n\nexport type GameLeaderboard = {\n gameHistory: GameHistory[] | null;\n overallPoints: number;\n owner: OwnerType;\n};\n","import { GameDate, GlobalGameData } from \"./global\";\n\nconst OBJECT_ID_PATH_SEGMENT = \"[a-f0-9]{24}\";\nconst OBJECT_ID_PATH_SEGMENT_END = `${OBJECT_ID_PATH_SEGMENT}$`;\n\nexport const gameScreenIdentifierList = [\n {\n clue: \"Where your actions turn into a timeline.\",\n id: \"activities\",\n match: \"/profile/activities\",\n },\n {\n clue: \"Where conversations happen without speaking.\",\n id: \"chat\",\n match: \"/profile/chat\",\n },\n {\n clue: \"The place to redefine who you are.\",\n id: \"edit-profile\",\n match: \"/profile/edit-profile\",\n },\n {\n clue: \"A single moment worth showing up for.\",\n id: \"single-event\",\n match: new RegExp(`^/events/${OBJECT_ID_PATH_SEGMENT_END}`),\n },\n {\n clue: \"What’s happening around you, right now.\",\n id: \"events-near-me\",\n match: \"/events/events-near-me\",\n },\n {\n clue: \"Where events appear as pins on a map.\",\n id: \"events-map\",\n match: \"/events/events-map\",\n },\n {\n clue: \"A collection of events worth attending.\",\n id: \"events\",\n match: \"/events\",\n },\n {\n clue: \"What’s happening in a wider area — not just nearby.\",\n id: \"events-region\",\n match: /^\\/events\\/region\\/[^/]+$/,\n },\n {\n clue: \"Where fun becomes a challenge.\",\n id: \"games\",\n match: \"/games\",\n },\n {\n clue: \"Your starting point for everything.\",\n id: \"home\",\n match: \"/\",\n },\n {\n clue: \"Where the app whispers what you shouldn’t miss.\",\n id: \"notifications\",\n match: \"/notifications\",\n },\n {\n clue: \"Where you fine-tune your experience.\",\n id: \"options\",\n match: \"/options\",\n },\n {\n clue: \"An organisation or creator supporting the community.\",\n id: \"single-partner\",\n match: new RegExp(`^/partners/${OBJECT_ID_PATH_SEGMENT_END}`),\n },\n {\n clue: \"Organisations and creators supporting the community.\",\n id: \"partners\",\n match: \"/partners\",\n },\n {\n clue: \"A single published post in full view.\",\n id: \"single-visitor-post\",\n match: new RegExp(`^/visitors/post/${OBJECT_ID_PATH_SEGMENT_END}`),\n },\n {\n clue: \"Your identity, on display.\",\n id: \"profile\",\n match: \"/profile\",\n },\n {\n clue: \"One stallholder offering something valuable.\",\n id: \"single-vendor\",\n match: new RegExp(`^/vendors/${OBJECT_ID_PATH_SEGMENT_END}`),\n },\n {\n clue: \"Where every stallholder waits under the right category.\",\n id: \"vendors\",\n match: \"/vendors\",\n },\n {\n clue: \"Where you browse articles and posts from around the platform.\",\n id: \"visitors\",\n match: \"/visitors\",\n },\n] as const;\n\nexport type GamePlacement = (typeof gameScreenIdentifierList)[number][\"id\"];\nexport type GamePlacementClue =\n (typeof gameScreenIdentifierList)[number][\"clue\"];\n\nexport type DailyClueBaseGame = {\n gameDate: GameDate;\n gameSolution: string;\n};\n\nexport type DailyClueGameData = GlobalGameData & {\n gameFields: DailyClueBaseGame;\n lastFoundDate: Date | null;\n letterInfo: {\n collected: string[] | null; // The letters the user has found, e.g. [\"C\", \"L\", \"U\"]\n solutionShuffled: string[]; // The letters of the solution, but shuffled, e.g. [\"L\", \"C\", \"U\"]\n todaysClue: GamePlacementClue | null; // The clue for user to find the letter, e.g. related to {todaysPlacement}\n todaysLetter: string | null; // The letter the user has to find today, e.g. \"C\"\n todaysPlacement: GamePlacement | null; // The screen where the user has to find the clue, e.g. \"HomeScreen\"\n };\n};\n","export enum EnumGameType {\n DAILY_CLUE = \"dailyClue\",\n MINI_QUIZ = \"miniQuiz\",\n ODD_ONE_OUT = \"oddOneOut\",\n}\n\nexport type GameDate = {\n startDate: Date;\n endDate: Date;\n};\n\nexport const gameTypeToDisplayName: Record<EnumGameType, string> = {\n [EnumGameType.DAILY_CLUE]: \"Daily Clue\",\n [EnumGameType.MINI_QUIZ]: \"Mini Quiz\",\n [EnumGameType.ODD_ONE_OUT]: \"Odd One Out\",\n};\n\nexport type GlobalGameData = {\n points: number;\n // User has found the clue 3 days in a row, this is incrementing if the user finds the clue and decrements if user misses a day\n streak: number;\n};\n","import { EnumUserLicence } from \"../enums\";\n\n/** Tier keys in descending priority (highest first) for licence resolution. */\nexport const TIERS_BY_PRIORITY = [\"pro_plus\", \"pro\", \"standard\"] as const;\n\n/** Canonical subscription tier keys — matches Stripe/server tier identifiers. */\nexport type Tier = (typeof TIERS_BY_PRIORITY)[number];\n\n/** User-facing tier labels (decoupled from the Tier discriminant). */\nexport const TIER_DISPLAY_LABELS: Record<Tier, string> = {\n pro: \"Pro\",\n // eslint-disable-next-line camelcase\n pro_plus: \"Pro+ Ads\",\n standard: \"Standard\",\n};\n\n/** Maps licence enums to their canonical tier key. */\nexport const TIER_FROM_LICENCE: Record<EnumUserLicence, Tier> = {\n [EnumUserLicence.PRO_EVENT]: \"pro\",\n [EnumUserLicence.PRO_PLUS_EVENT]: \"pro_plus\",\n [EnumUserLicence.PRO_PLUS_VENDOR]: \"pro_plus\",\n [EnumUserLicence.PRO_VENDOR]: \"pro\",\n [EnumUserLicence.STANDARD_EV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AAG;AAAA,EACnC,8BAA2B,GAAG;AAAA,EAC9B,sCAA+B,GAAG;AAAA,EAClC,0CAAiC,GAAG;AAAA,EACpC,wCAAgC,GAAG;AACrC;","names":["EnumVerificationType","EnumAdShowOn","EnumAdStatus","EnumAdType","EnumAdStyle","EnumActivity","EnumPostType","EnumPostContentType","EnumGameStatus","EnumGameType"]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts","../../src/types/auth.ts","../../src/types/global.ts","../../src/types/ad.ts","../../src/types/resourceActivities.ts","../../src/types/post.ts","../../src/types/game/index.ts","../../src/types/game/dailyClue.ts","../../src/types/game/global.ts","../../src/types/subscription.ts"],"sourcesContent":["export * from \"./admin\";\nexport * from \"./auth\";\nexport * from \"./chat\";\nexport * from \"./contactUs\";\nexport * from \"./global\";\nexport * from \"./event\";\nexport * from \"./notification\";\nexport * from \"./poster\";\nexport * from \"./relation\";\nexport * from \"./vendor\";\nexport * from \"./user\";\nexport * from \"./ad\";\nexport * from \"./resourceActivities\";\nexport * from \"./partner\";\nexport * from \"./post\";\nexport * from \"./pushToken\";\nexport * from \"./appSettings\";\nexport * from \"./googleImportedMarket\";\nexport * from \"./game\";\nexport * from \"./game/dailyClue\";\nexport * from \"./game/global\";\nexport * from \"./game/puzzleGame\";\nexport * from \"./school\";\nexport * from \"./subscription\";\n","import {\n CreateFormData,\n EnumOSPlatform,\n PromoCodeType,\n TermsAgreement,\n} from \"src\";\n\nimport { SafeUserType } from \"./user\";\n\nexport enum EnumVerificationType {\n REGISTER = \"register\",\n RESET_PASSWORD = \"resetPassword\",\n}\n\nexport type LoginFormData = {\n email: string;\n isAdminPage?: boolean;\n password: string;\n platform?: EnumOSPlatform;\n};\n\nexport type CreateLoginFormData = CreateFormData<LoginFormData>;\n\nexport type RegisterFormData = {\n email: string;\n firstName: string;\n lastName: string;\n password: string;\n platform?: EnumOSPlatform;\n preferredRegion: string;\n promoCode?: PromoCodeType | null;\n termsAgreement?: TermsAgreement | null;\n};\n\nexport type CreateRegisterFormData = CreateFormData<RegisterFormData>;\n\nexport type RequestPasswordResetFormData = {\n email: string;\n};\n\nexport type CreateRequestPasswordResetFormData =\n CreateFormData<RequestPasswordResetFormData>;\n\nexport type ResetPasswordFormData = {\n confirmPassword: string;\n email: string;\n password: string;\n};\n\nexport type CreateResetPasswordFormData = CreateFormData<ResetPasswordFormData>;\n\nexport type ValidateVerificationTokenFormData = {\n email: string;\n verificationToken: string;\n verificationType?: EnumVerificationType;\n};\n\nexport type CreateValidateVerificationTokenFormData =\n CreateFormData<ValidateVerificationTokenFormData>;\n\nexport type AuthPayloadType = {\n message: string;\n token: string;\n refreshToken: string | null;\n user: SafeUserType;\n};\n\nexport type RefreshTokenPayloadType = {\n refreshToken: string;\n token: string;\n};\n","import {\n Control,\n FieldValues,\n FormState,\n UseFormGetValues,\n UseFormHandleSubmit,\n UseFormReset,\n UseFormSetValue,\n UseFormWatch,\n} from \"react-hook-form\";\n\nimport {\n EnumEventDateStatus,\n EnumEventType,\n EnumResourceType,\n EnumSocialMedia,\n EnumUserLicence,\n} from \"../enums\";\n\nimport { EventListItemType } from \"./event\";\nimport { EnumPostType } from \"./post\";\nimport { VendorType } from \"./vendor\";\n\nexport const PROMO_CODE_PREFIX = \"CM-\";\n\nexport type PromoCodeType = `${typeof PROMO_CODE_PREFIX}${string}`;\n\nexport type Nullable<T> = {\n [K in keyof T]: T[K] | null | undefined;\n};\n\nexport type DeviceInfo = {\n appBuildNumber: string;\n appId: string;\n appVersion: string;\n brand: string;\n deviceName: string;\n installationId: string;\n manufacturer: string;\n modelName: string;\n osName: string;\n osVersion: string;\n timestamp: string;\n};\n\nexport type TermsAgreement = DeviceInfo & {\n termVersion: string;\n};\n\nexport type ResourceContactDetailsType = {\n email?: string | null;\n landlinePhone?: string | null;\n mobilePhone?: string | null;\n};\n\nexport type ResourceImageType = {\n active?: boolean | null;\n source: string;\n title: string;\n};\n\nexport type SocialMediaType = {\n name?: EnumSocialMedia;\n link?: string;\n};\n\nexport type UserLicenceType = {\n expiryDate: Date;\n issuedDate: Date;\n licenceType: EnumUserLicence;\n prevLicenceType?: EnumUserLicence | null;\n};\n\nexport type AssociateType = {\n email: string;\n resourceId: string;\n resourceType: EnumResourceType;\n licence: UserLicenceType;\n};\n\nexport type OwnerType = {\n email: string;\n userId: string;\n};\n\nexport interface BaseResourceTypeFormData {\n _id?: string;\n active: boolean;\n associates: AssociateType[] | null;\n contactDetails: ResourceContactDetailsType | null;\n cover: ResourceImageType;\n coverUpload?: ResourceImageType | null;\n description: string;\n images?: ResourceImageType[] | null;\n imagesUpload?: ResourceImageType[] | null;\n logo?: ResourceImageType | null;\n logoUpload?: ResourceImageType | null;\n name: string;\n owner?: OwnerType | null;\n promoCodes?: PromoCodeType[] | null;\n region: string;\n socialMedia: SocialMediaType[] | null;\n termsAgreement?: TermsAgreement | null;\n}\n\nexport type PosterUsageType = {\n month: string;\n count: number;\n};\n\nexport type BaseResourceType = Omit<\n BaseResourceTypeFormData,\n \"_id\" | \"coverUpload\" | \"imagesUpload\" | \"logoUpload\"\n> & {\n _id: string;\n adIds?: string[] | null;\n createdAt: Date;\n deletedAt: Date | null;\n posterUsage?: PosterUsageType | null;\n rating?: number | null;\n reviewCount?: number | null;\n updatedAt: Date | null;\n relatedPost?: {\n postId: string;\n postType: EnumPostType;\n } | null;\n};\n\nexport type LocationGeoType = {\n coordinates: number[]; // [longitude, latitude]\n type: \"Point\"; // Mongoose GeoJSON type\n};\n\nexport type LocationType = {\n city: string;\n country: string;\n fullAddress: string;\n geo: LocationGeoType;\n latitude: number;\n longitude: number;\n region: string;\n};\n\nexport type DateTimeType = {\n dateStatus: EnumEventDateStatus;\n endDate: string;\n endTime: string;\n startDate: string;\n startTime: string;\n};\n\nexport type Region = {\n latitude: number;\n latitudeDelta: number;\n longitude: number;\n longitudeDelta: number;\n};\n\nexport type ResourceDetails = {\n dateTime: DateTimeType[] | null;\n description: string | null;\n eventStatus?: EventStatusType | null;\n location: LocationType | null;\n resourceCover: ResourceImageType | null;\n resourceId: string;\n resourceLogo: ResourceImageType | null;\n resourceName: string;\n resourceType: EnumResourceType;\n};\n\nexport type GeocodeLocation = Pick<LocationType, \"latitude\" | \"longitude\">;\n\nexport type EventStatusType = {\n claimed: boolean;\n eventType: EnumEventType;\n googlePlaceId?: string | null;\n};\n\nexport interface FormField {\n disabled?: boolean;\n helperText?: string;\n isTextArea?: boolean;\n keyboardType?:\n | \"default\"\n | \"email-address\"\n | \"number-pad\"\n | \"url\"\n | \"decimal-pad\"\n | \"phone-pad\";\n name: string;\n placeholder: string;\n required?: boolean;\n secureTextEntry?: boolean;\n}\n\nexport interface FormDateField {\n dateMode: \"date\" | \"time\";\n helperText?: string;\n name: \"endDate\" | \"endTime\" | \"startDate\" | \"startTime\";\n placeholder: string;\n}\n\nexport interface SubcategoryItems {\n id: string;\n name: string;\n description?: string | null;\n}\n\nexport interface Subcategory {\n id: string;\n name: string;\n items?: SubcategoryItems[] | null;\n}\n\nexport interface Category {\n color?: string | null;\n description?: string | null;\n id: string;\n name: string;\n subcategories: Subcategory[];\n}\n\nexport type OptionItem = {\n value: string;\n label: string;\n};\n\nexport type ImageObjectType = {\n uri: string;\n type: string;\n name: string;\n};\n\nexport interface ResourceConnectionsType {\n events: EventListItemType[] | null;\n vendors: VendorType[] | null;\n}\n\nexport interface CreateFormData<T extends FieldValues> {\n control: Control<T, any>;\n fields: T;\n formState: FormState<T>;\n handleSubmit: UseFormHandleSubmit<T, any>;\n reset: UseFormReset<T>;\n setValue: UseFormSetValue<T>;\n watch: UseFormWatch<T>;\n getValues: UseFormGetValues<T>;\n}\n\nexport interface UseGetResourcesByRegionOptions {\n onlyClaimed?: boolean;\n limit?: number;\n offset?: number;\n}\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData } from \"./global\";\n\nexport enum EnumAdShowOn {\n EVENTS_PAGE = \"Events_page\",\n FRONT_PAGE = \"Front_page\",\n PARTNERS_PAGE = \"Partners_page\",\n VENDORS_PAGE = \"Vendors_page\",\n}\n\nexport enum EnumAdStatus {\n ACTIVE = \"Active\",\n PAUSED = \"Paused\",\n EXPIRED = \"Expired\",\n}\n\nexport enum EnumAdType {\n SPONSORED = \"Sponsored\",\n FREE = \"Free\",\n}\n\nexport enum EnumAdStyle {\n BLOOM = \"Bloom\",\n RISE = \"Rise\",\n}\n\nexport type AdResource = {\n adDescription: string;\n adImage: string;\n adStyle: EnumAdStyle;\n adTitle: string;\n adType: EnumAdType;\n resourceId: string;\n resourceName: string;\n resourceRegion: string;\n resourceType: EnumResourceType;\n};\n\nexport interface AdFormData {\n active: boolean;\n end: Date; // ISO date string\n resource: AdResource;\n showOn: EnumAdShowOn[];\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion: string[];\n}\n\n// Form state matches the validation schema: all resource fields are present.\n// Use empty strings / explicit enum defaults in `defaultValues` for \"create\" flows.\nexport type AdFormState = AdFormData;\n\nexport type CreateAdFormData = CreateFormData<AdFormData>;\nexport type CreateAdFormState = CreateFormData<AdFormState>;\n\nexport interface AdType extends AdFormData {\n _id: string;\n clicks?: number; // How many times the ad was clicked\n createdAt: Date;\n impressions?: number; // How often the ad was seen\n start: Date; // ISO date string\n updatedAt: Date | null;\n}\n","import {\n EnumEventDateStatus,\n EnumOSPlatform,\n EnumResourceType,\n} from \"src/enums\";\n\nimport { LocationGeoType } from \"./global\";\n\nexport enum EnumActivity {\n FAVORITE = \"FAVORITE\",\n GOING = \"GOING\",\n INTERESTED = \"INTERESTED\",\n PRESENT = \"PRESENT\",\n VIEW = \"VIEW\",\n}\n\nexport type ResourceActivityEntry = {\n activityType: EnumActivity;\n location: LocationGeoType | null;\n dateStatus?: EnumEventDateStatus | null;\n startDate?: string | null;\n startTime?: string | null;\n timestamp: Date;\n userAgent: EnumOSPlatform;\n userId?: string | null;\n};\n\nexport type ResourceActivityType = {\n _id: string;\n resourceType: EnumResourceType;\n resourceId: string;\n activity: ResourceActivityEntry[];\n};\n\nexport type ResourceActivityInputType = {\n resourceId: string;\n resourceType: EnumResourceType;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n","import { EnumResourceType } from \"src/enums\";\n\nimport { BaseGameType } from \"./game\";\nimport { CreateFormData, ResourceImageType } from \"./global\";\n\nexport enum EnumPostType {\n MARKET_FACES = \"market_faces\",\n CLUE_BITES = \"clue_bites\",\n PLAY_AND_WIN = \"play_and_win\",\n}\n\nexport enum EnumPostContentType {\n GAME = \"game\",\n IMAGE = \"image\",\n LIST = \"list\",\n TEXTAREA = \"textarea\",\n VIDEO = \"video\",\n}\n\nexport type PostFileInput = {\n source: File;\n title?: string;\n};\n\nexport type PostContentTextarea = {\n textarea: {\n title?: string;\n data: string;\n };\n};\n\nexport type PostContentImage = {\n images: ResourceImageType[] | null;\n imagesUpload?: PostFileInput[] | null;\n};\n\nexport type PostContentVideo = {\n video: {\n source: string;\n title?: string;\n };\n};\n\nexport type PostContentList = {\n list: {\n title?: string;\n items: {\n text: string;\n }[];\n };\n};\n\nexport type PostContentGame = {\n game: BaseGameType;\n};\n\nexport type PostContentData =\n | PostContentGame\n | PostContentTextarea\n | PostContentImage\n | PostContentVideo\n | PostContentList;\n\nexport type PostContentFormData = {\n contentData?: PostContentData | null;\n contentOrder?: number | null;\n contentType?: EnumPostContentType | null;\n};\n\nexport interface PostFormData {\n active: boolean;\n caption: string;\n content: PostContentFormData[];\n cover?: ResourceImageType | null;\n coverUpload?: PostFileInput | null;\n postType: EnumPostType;\n resource?: {\n resourceId: string;\n resourceType: EnumResourceType;\n resourceRegion: string;\n } | null;\n tags?: string[] | null;\n title: string;\n notifyUsers?: boolean | null;\n}\n\nexport type CreatePostFormData = CreateFormData<PostFormData>;\n\nexport type PostContentType = Omit<PostContentFormData, \"contentData\"> & {\n contentData: Omit<PostContentData, \"imagesUpload\">;\n};\n\nexport type PostType = Omit<PostFormData, \"content\" | \"coverUpload\"> & {\n _id: string;\n content: PostContentType[];\n createdAt: Date;\n deletedAt: Date | null;\n updatedAt: Date | null;\n};\n","import { OwnerType } from \"../global\";\n\nimport { DailyClueBaseGame, DailyClueGameData } from \"./dailyClue\";\nimport { EnumGameType, GameDate } from \"./global\";\nimport { PuzzleBaseGame, PuzzleGameData } from \"./puzzleGame\";\n\nexport type BaseGameMap = {\n [EnumGameType.DAILY_CLUE]: DailyClueBaseGame;\n [EnumGameType.MINI_QUIZ]: PuzzleBaseGame;\n [EnumGameType.ODD_ONE_OUT]: PuzzleBaseGame;\n};\n\nexport type BaseGameType = {\n gameType: EnumGameType;\n gameTypeId: string;\n gameTitle: string;\n} & {\n [K in keyof BaseGameMap]?: BaseGameMap[K] | null;\n};\n\nexport enum EnumGameStatus {\n GAME_COMPLETED = \"GAME_COMPLETED\",\n GAME_IN_PROGRESS = \"GAME_IN_PROGRESS\",\n GAME_LEFT = \"GAME_LEFT\",\n GAME_STARTED = \"GAME_STARTED\",\n}\n\nexport type GameHistory = Pick<\n BaseGameType,\n \"gameTitle\" | \"gameType\" | \"gameTypeId\"\n> & {\n createdAt: Date;\n gameDate: GameDate;\n gameStatus: EnumGameStatus;\n /** Per-event delta. Not persisted for overallGamePoints (computed at read time). */\n pointsEarned: number;\n /** Running total for this game instance; computed at read time, not stored in Mongo. */\n overallGamePoints?: number;\n};\n\ntype GameDataMap = {\n [EnumGameType.DAILY_CLUE]: DailyClueGameData;\n [EnumGameType.MINI_QUIZ]: PuzzleGameData;\n [EnumGameType.ODD_ONE_OUT]: PuzzleGameData;\n};\ntype GameDataType = {\n [K in keyof GameDataMap]?: GameDataMap[K] | null;\n};\n\nexport type GameType = Pick<\n BaseGameType,\n \"gameTitle\" | \"gameType\" | \"gameTypeId\"\n> & {\n _id: string;\n active: boolean;\n createdAt: Date;\n gameData: GameDataType;\n gameHistory: GameHistory[] | null;\n updatedAt: Date | null;\n};\n\nexport type GameDocType = {\n _id: string;\n active: boolean;\n createdAt: Date;\n deletedAt: Date | null;\n games: GameType[] | null;\n owner: OwnerType;\n points: number;\n updatedAt: Date | null;\n};\n\nexport type GameLeaderboard = {\n gameHistory: GameHistory[] | null;\n overallPoints: number;\n owner: OwnerType;\n};\n","import { GameDate, GlobalGameData } from \"./global\";\n\nconst OBJECT_ID_PATH_SEGMENT = \"[a-f0-9]{24}\";\nconst OBJECT_ID_PATH_SEGMENT_END = `${OBJECT_ID_PATH_SEGMENT}$`;\n\nexport const gameScreenIdentifierList = [\n {\n clue: \"Where your actions turn into a timeline.\",\n id: \"activities\",\n match: \"/profile/activities\",\n },\n {\n clue: \"Where conversations happen without speaking.\",\n id: \"chat\",\n match: \"/profile/chat\",\n },\n {\n clue: \"The place to redefine who you are.\",\n id: \"edit-profile\",\n match: \"/profile/edit-profile\",\n },\n {\n clue: \"A single moment worth showing up for.\",\n id: \"single-event\",\n match: new RegExp(`^/events/${OBJECT_ID_PATH_SEGMENT_END}`),\n },\n {\n clue: \"What’s happening around you, right now.\",\n id: \"events-near-me\",\n match: \"/events/events-near-me\",\n },\n {\n clue: \"Where events appear as pins on a map.\",\n id: \"events-map\",\n match: \"/events/events-map\",\n },\n {\n clue: \"A collection of events worth attending.\",\n id: \"events\",\n match: \"/events\",\n },\n {\n clue: \"What’s happening in a wider area — not just nearby.\",\n id: \"events-region\",\n match: /^\\/events\\/region\\/[^/]+$/,\n },\n {\n clue: \"Where fun becomes a challenge.\",\n id: \"games\",\n match: \"/games\",\n },\n {\n clue: \"Your starting point for everything.\",\n id: \"home\",\n match: \"/\",\n },\n {\n clue: \"Where the app whispers what you shouldn’t miss.\",\n id: \"notifications\",\n match: \"/notifications\",\n },\n {\n clue: \"Where you fine-tune your experience.\",\n id: \"options\",\n match: \"/options\",\n },\n {\n clue: \"An organisation or creator supporting the community.\",\n id: \"single-partner\",\n match: new RegExp(`^/partners/${OBJECT_ID_PATH_SEGMENT_END}`),\n },\n {\n clue: \"Organisations and creators supporting the community.\",\n id: \"partners\",\n match: \"/partners\",\n },\n {\n clue: \"A single published post in full view.\",\n id: \"single-visitor-post\",\n match: new RegExp(`^/visitors/post/${OBJECT_ID_PATH_SEGMENT_END}`),\n },\n {\n clue: \"Your identity, on display.\",\n id: \"profile\",\n match: \"/profile\",\n },\n {\n clue: \"One stallholder offering something valuable.\",\n id: \"single-vendor\",\n match: new RegExp(`^/vendors/${OBJECT_ID_PATH_SEGMENT_END}`),\n },\n {\n clue: \"Where every stallholder waits under the right category.\",\n id: \"vendors\",\n match: \"/vendors\",\n },\n {\n clue: \"Where you browse articles and posts from around the platform.\",\n id: \"visitors\",\n match: \"/visitors\",\n },\n] as const;\n\nexport type GamePlacement = (typeof gameScreenIdentifierList)[number][\"id\"];\nexport type GamePlacementClue =\n (typeof gameScreenIdentifierList)[number][\"clue\"];\n\nexport type DailyClueBaseGame = {\n gameDate: GameDate;\n gameSolution: string;\n};\n\nexport type DailyClueGameData = GlobalGameData & {\n gameFields: DailyClueBaseGame;\n lastFoundDate: Date | null;\n letterInfo: {\n collected: string[] | null; // The letters the user has found, e.g. [\"C\", \"L\", \"U\"]\n solutionShuffled: string[]; // The letters of the solution, but shuffled, e.g. [\"L\", \"C\", \"U\"]\n todaysClue: GamePlacementClue | null; // The clue for user to find the letter, e.g. related to {todaysPlacement}\n todaysLetter: string | null; // The letter the user has to find today, e.g. \"C\"\n todaysPlacement: GamePlacement | null; // The screen where the user has to find the clue, e.g. \"HomeScreen\"\n };\n};\n","export enum EnumGameType {\n DAILY_CLUE = \"dailyClue\",\n MINI_QUIZ = \"miniQuiz\",\n ODD_ONE_OUT = \"oddOneOut\",\n}\n\nexport type GameDate = {\n startDate: Date;\n endDate: Date;\n};\n\nexport const gameTypeToDisplayName: Record<EnumGameType, string> = {\n [EnumGameType.DAILY_CLUE]: \"Daily Clue\",\n [EnumGameType.MINI_QUIZ]: \"Mini Quiz\",\n [EnumGameType.ODD_ONE_OUT]: \"Odd One Out\",\n};\n\nexport type GlobalGameData = {\n points: number;\n // User has found the clue 3 days in a row, this is incrementing if the user finds the clue and decrements if user misses a day\n streak: number;\n};\n","import { EnumUserLicence } from \"../enums\";\n\n/** Tier keys in descending priority (highest first) for licence resolution. */\nexport const TIERS_BY_PRIORITY = [\"pro_plus\", \"pro\", \"standard\"] as const;\n\n/** Canonical subscription tier keys — matches Stripe/server tier identifiers. */\nexport type Tier = (typeof TIERS_BY_PRIORITY)[number];\n\n/** User-facing tier labels (decoupled from the Tier discriminant). */\nexport const TIER_DISPLAY_LABELS: Record<Tier, string> = {\n pro: \"Pro\",\n // eslint-disable-next-line camelcase\n pro_plus: \"Pro+ Ads\",\n standard: \"Standard\",\n};\n\n/** Maps licence enums to their canonical tier key. */\nexport const TIER_FROM_LICENCE: Record<EnumUserLicence, Tier> = {\n [EnumUserLicence.PRO_EVENT]: \"pro\",\n [EnumUserLicence.PRO_PLUS_EVENT]: \"pro_plus\",\n [EnumUserLicence.PRO_PLUS_VENDOR]: \"pro_plus\",\n [EnumUserLicence.PRO_VENDOR]: \"pro\",\n [EnumUserLicence.STANDARD_EVENT]: \"standard\",\n [EnumUserLicence.STANDARD_PARTNER]: \"standard\",\n [EnumUserLicence.STANDARD_VENDOR]: \"standard\",\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,cAAW;AACX,EAAAA,sBAAA,oBAAiB;AAFP,SAAAA;AAAA,GAAA;;;ACcL,IAAM,oBAAoB;;;ACnB1B,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,mBAAgB;AAChB,EAAAA,cAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;AAOL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,aAAU;AAHA,SAAAA;AAA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IACE,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AACF;;;ACrGO,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,eAAY;AACZ,EAAAA,cAAA,iBAAc;AAHJ,SAAAA;AAAA,GAAA;AAWL,IAAM,wBAAsD;AAAA,EACjE,CAAC,4BAAuB,GAAG;AAAA,EAC3B,CAAC,0BAAsB,GAAG;AAAA,EAC1B,CAAC,6BAAwB,GAAG;AAC9B;;;ACZO,IAAM,oBAAoB,CAAC,YAAY,OAAO,UAAU;AAMxD,IAAM,sBAA4C;AAAA,EACvD,KAAK;AAAA;AAAA,EAEL,UAAU;AAAA,EACV,UAAU;AACZ;AAGO,IAAM,oBAAmD;AAAA,EAC9D,4BAA0B,GAAG;AAAA,EAC7B,sCAA+B,GAAG;AAAA,EAClC,wCAAgC,GAAG;AAAA,EACnC,8BAA2B,GAAG;AAAA,EAC9B,sCAA+B,GAAG;AAAA,EAClC,0CAAiC,GAAG;AAAA,EACpC,wCAAgC,GAAG;AACrC;","names":["EnumVerificationType","EnumAdShowOn","EnumAdStatus","EnumAdType","EnumAdStyle","EnumActivity","EnumPostType","EnumPostContentType","EnumGameStatus","EnumGameType"]}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { EnumResourceType, EnumOSPlatform, EnumUserLicence } from '../enums/index.mjs';
|
|
2
|
-
export { o as AdFormData, v as AdFormState, w as AdResource, c as AdType, r as AppSettingsFormData, f as AppSettingsType, A as AuthPayloadType, x as CreateAdFormData, p as CreateAdFormState, s as CreateAppSettingsFormData, i as CreateLoginFormData, q as CreatePartnerFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, m as CreateResetPasswordFormData, u as CreateSchoolFormData, C as CreateUserFormData, l as CreateValidateVerificationTokenFormData, y as EnumAdShowOn, E as EnumAdStatus, z as EnumAdStyle, B as EnumAdType, D as EnumVerificationType, L as LoginFormData, M as MarketingMaterialRequestInputType, n as PartnerFormData, P as PartnerType, F as PosterInputType, G as RedeemRewardInput, a as RedeemRewardResponse, H as RedeemedReward, R as RefreshTokenPayloadType, I as RegisterFormData, J as RequestPasswordResetFormData, K as ResetPasswordFormData, b as ResourceByUser, S as SafeUserType, N as SchoolCampaignType, t as SchoolFormData, O as SchoolRegisteredUserType, g as SchoolReturnType, h as SchoolType, Q as StripeSubscription, T as SubscriptionPlanData, d as SubscriptionPlansResponse, V as SubscriptionPricingData, e as SubscriptionStatusData, W as UserActivity, X as UserActivityEvent, U as UserFormData, Y as UserType, Z as ValidateVerificationTokenFormData } from '../ad-
|
|
3
|
-
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-
|
|
4
|
-
export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-
|
|
5
|
-
import { c as EventListItemType } from '../global-
|
|
6
|
-
export { A as AssociateType,
|
|
7
|
-
export { B as BaseGameMap, c as BaseGameType, C as CreatePostFormData, D as DailyClueBaseGame, d as DailyClueGameData, e as EnumGameStatus, f as EnumGameType, g as EnumPostContentType, E as EnumPostType, h as GameDate, G as GameDocType, i as GameHistory, a as GameLeaderboard, j as GamePlacement, k as GamePlacementClue, l as GameType, m as GlobalGameData, n as PostContentData, o as PostContentFormData, p as PostContentGame, q as PostContentImage, r as PostContentList, s as PostContentTextarea, t as PostContentType, u as PostContentVideo, v as PostFileInput, b as PostFormData, P as PostType, w as PuzzleAnswer, x as PuzzleAnsweredQuestion, y as PuzzleBaseGame, z as PuzzleGameData, A as PuzzleQuestion, F as gameScreenIdentifierList, H as gameTypeToDisplayName } from '../post-CdLrXuH1.mjs';
|
|
2
|
+
export { o as AdFormData, v as AdFormState, w as AdResource, c as AdType, r as AppSettingsFormData, f as AppSettingsType, A as AuthPayloadType, x as CreateAdFormData, p as CreateAdFormState, s as CreateAppSettingsFormData, i as CreateLoginFormData, q as CreatePartnerFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, m as CreateResetPasswordFormData, u as CreateSchoolFormData, C as CreateUserFormData, l as CreateValidateVerificationTokenFormData, y as EnumAdShowOn, E as EnumAdStatus, z as EnumAdStyle, B as EnumAdType, D as EnumVerificationType, L as LoginFormData, M as MarketingMaterialRequestInputType, n as PartnerFormData, P as PartnerType, F as PosterInputType, G as RedeemRewardInput, a as RedeemRewardResponse, H as RedeemedReward, R as RefreshTokenPayloadType, I as RegisterFormData, J as RequestPasswordResetFormData, K as ResetPasswordFormData, b as ResourceByUser, S as SafeUserType, N as SchoolCampaignType, t as SchoolFormData, O as SchoolRegisteredUserType, g as SchoolReturnType, h as SchoolType, Q as StripeSubscription, T as SubscriptionPlanData, d as SubscriptionPlansResponse, V as SubscriptionPricingData, e as SubscriptionStatusData, W as UserActivity, X as UserActivityEvent, U as UserFormData, Y as UserType, Z as ValidateVerificationTokenFormData } from '../ad-DpwV6VZX.mjs';
|
|
3
|
+
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-CpjJeH23.mjs';
|
|
4
|
+
export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-CRypzI-A.mjs';
|
|
5
|
+
import { c as EventListItemType } from '../global-q9JjONd1.mjs';
|
|
6
|
+
export { A as AssociateType, x as BaseGameMap, y as BaseGameType, z as BaseResourceType, B as BaseResourceTypeFormData, C as Category, s as CreateEventFormData, u as CreateEventInfoFormData, D as CreateFormData, w as CreatePostFormData, q as CreateUnregisteredVendorFormData, m as CreateVendorFormData, o as CreateVendorInfoFormData, H as DailyClueBaseGame, I as DailyClueGameData, J as DateTimeType, K as DateTimeWithPriceType, M as DeviceInfo, N as EnumGameStatus, Q as EnumGameType, T as EnumPostContentType, j as EnumPostType, r as EventFormData, t as EventInfoFormData, d as EventInfoType, W as EventStatusType, E as EventType, a as FormDateField, F as FormField, X as GameDate, G as GameDocType, Y as GameHistory, k as GameLeaderboard, Z as GamePlacement, _ as GamePlacementClue, $ as GameType, a0 as GeocodeLocation, a1 as GlobalGameData, a2 as ImageObjectType, a3 as LocationGeoType, L as LocationType, a4 as Nullable, O as OptionItem, a5 as OwnerType, a6 as PROMO_CODE_PREFIX, a7 as PaymentInfoType, a8 as PostContentData, a9 as PostContentFormData, aa as PostContentGame, ab as PostContentImage, ac as PostContentList, ad as PostContentTextarea, ae as PostContentType, af as PostContentVideo, ag as PostFileInput, v as PostFormData, P as PostType, ah as PosterUsageType, ai as PromoCodeType, aj as PuzzleAnswer, ak as PuzzleAnsweredQuestion, al as PuzzleBaseGame, am as PuzzleGameData, an as PuzzleQuestion, R as RefundPolicy, ao as Region, ap as RelationDate, aq as RelationInputType, e as RelationType, b as Requirement, f as ResourceConnectionsType, ar as ResourceContactDetailsType, as as ResourceDetails, at as ResourceImageType, au as SocialMediaType, S as StallType, av as Subcategory, aw as SubcategoryItems, ax as TermsAgreement, p as UnregisteredVendorFormData, ay as UnregisteredVendorInvitationType, g as UnregisteredVendorType, U as UseGetResourcesByRegionOptions, i as UserLicenceType, az as VendorAttributes, aA as VendorCalendarData, l as VendorFormData, n as VendorInfoFormData, h as VendorInfoType, aB as VendorProductList, V as VendorType, aC as gameScreenIdentifierList, aD as gameTypeToDisplayName } from '../global-q9JjONd1.mjs';
|
|
8
7
|
import '../images/index.mjs';
|
|
9
8
|
import 'react-hook-form';
|
|
10
9
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { EnumResourceType, EnumOSPlatform, EnumUserLicence } from '../enums/index.js';
|
|
2
|
-
export { o as AdFormData, v as AdFormState, w as AdResource, c as AdType, r as AppSettingsFormData, f as AppSettingsType, A as AuthPayloadType, x as CreateAdFormData, p as CreateAdFormState, s as CreateAppSettingsFormData, i as CreateLoginFormData, q as CreatePartnerFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, m as CreateResetPasswordFormData, u as CreateSchoolFormData, C as CreateUserFormData, l as CreateValidateVerificationTokenFormData, y as EnumAdShowOn, E as EnumAdStatus, z as EnumAdStyle, B as EnumAdType, D as EnumVerificationType, L as LoginFormData, M as MarketingMaterialRequestInputType, n as PartnerFormData, P as PartnerType, F as PosterInputType, G as RedeemRewardInput, a as RedeemRewardResponse, H as RedeemedReward, R as RefreshTokenPayloadType, I as RegisterFormData, J as RequestPasswordResetFormData, K as ResetPasswordFormData, b as ResourceByUser, S as SafeUserType, N as SchoolCampaignType, t as SchoolFormData, O as SchoolRegisteredUserType, g as SchoolReturnType, h as SchoolType, Q as StripeSubscription, T as SubscriptionPlanData, d as SubscriptionPlansResponse, V as SubscriptionPricingData, e as SubscriptionStatusData, W as UserActivity, X as UserActivityEvent, U as UserFormData, Y as UserType, Z as ValidateVerificationTokenFormData } from '../ad-
|
|
3
|
-
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-
|
|
4
|
-
export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-
|
|
5
|
-
import { c as EventListItemType } from '../global-
|
|
6
|
-
export { A as AssociateType,
|
|
7
|
-
export { B as BaseGameMap, c as BaseGameType, C as CreatePostFormData, D as DailyClueBaseGame, d as DailyClueGameData, e as EnumGameStatus, f as EnumGameType, g as EnumPostContentType, E as EnumPostType, h as GameDate, G as GameDocType, i as GameHistory, a as GameLeaderboard, j as GamePlacement, k as GamePlacementClue, l as GameType, m as GlobalGameData, n as PostContentData, o as PostContentFormData, p as PostContentGame, q as PostContentImage, r as PostContentList, s as PostContentTextarea, t as PostContentType, u as PostContentVideo, v as PostFileInput, b as PostFormData, P as PostType, w as PuzzleAnswer, x as PuzzleAnsweredQuestion, y as PuzzleBaseGame, z as PuzzleGameData, A as PuzzleQuestion, F as gameScreenIdentifierList, H as gameTypeToDisplayName } from '../post-D6n4Vszs.js';
|
|
2
|
+
export { o as AdFormData, v as AdFormState, w as AdResource, c as AdType, r as AppSettingsFormData, f as AppSettingsType, A as AuthPayloadType, x as CreateAdFormData, p as CreateAdFormState, s as CreateAppSettingsFormData, i as CreateLoginFormData, q as CreatePartnerFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, m as CreateResetPasswordFormData, u as CreateSchoolFormData, C as CreateUserFormData, l as CreateValidateVerificationTokenFormData, y as EnumAdShowOn, E as EnumAdStatus, z as EnumAdStyle, B as EnumAdType, D as EnumVerificationType, L as LoginFormData, M as MarketingMaterialRequestInputType, n as PartnerFormData, P as PartnerType, F as PosterInputType, G as RedeemRewardInput, a as RedeemRewardResponse, H as RedeemedReward, R as RefreshTokenPayloadType, I as RegisterFormData, J as RequestPasswordResetFormData, K as ResetPasswordFormData, b as ResourceByUser, S as SafeUserType, N as SchoolCampaignType, t as SchoolFormData, O as SchoolRegisteredUserType, g as SchoolReturnType, h as SchoolType, Q as StripeSubscription, T as SubscriptionPlanData, d as SubscriptionPlansResponse, V as SubscriptionPricingData, e as SubscriptionStatusData, W as UserActivity, X as UserActivityEvent, U as UserFormData, Y as UserType, Z as ValidateVerificationTokenFormData } from '../ad-DTOtubs3.js';
|
|
3
|
+
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-DtxRUlrT.js';
|
|
4
|
+
export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-BK5MKYPx.js';
|
|
5
|
+
import { c as EventListItemType } from '../global-vWzQNI8w.js';
|
|
6
|
+
export { A as AssociateType, x as BaseGameMap, y as BaseGameType, z as BaseResourceType, B as BaseResourceTypeFormData, C as Category, s as CreateEventFormData, u as CreateEventInfoFormData, D as CreateFormData, w as CreatePostFormData, q as CreateUnregisteredVendorFormData, m as CreateVendorFormData, o as CreateVendorInfoFormData, H as DailyClueBaseGame, I as DailyClueGameData, J as DateTimeType, K as DateTimeWithPriceType, M as DeviceInfo, N as EnumGameStatus, Q as EnumGameType, T as EnumPostContentType, j as EnumPostType, r as EventFormData, t as EventInfoFormData, d as EventInfoType, W as EventStatusType, E as EventType, a as FormDateField, F as FormField, X as GameDate, G as GameDocType, Y as GameHistory, k as GameLeaderboard, Z as GamePlacement, _ as GamePlacementClue, $ as GameType, a0 as GeocodeLocation, a1 as GlobalGameData, a2 as ImageObjectType, a3 as LocationGeoType, L as LocationType, a4 as Nullable, O as OptionItem, a5 as OwnerType, a6 as PROMO_CODE_PREFIX, a7 as PaymentInfoType, a8 as PostContentData, a9 as PostContentFormData, aa as PostContentGame, ab as PostContentImage, ac as PostContentList, ad as PostContentTextarea, ae as PostContentType, af as PostContentVideo, ag as PostFileInput, v as PostFormData, P as PostType, ah as PosterUsageType, ai as PromoCodeType, aj as PuzzleAnswer, ak as PuzzleAnsweredQuestion, al as PuzzleBaseGame, am as PuzzleGameData, an as PuzzleQuestion, R as RefundPolicy, ao as Region, ap as RelationDate, aq as RelationInputType, e as RelationType, b as Requirement, f as ResourceConnectionsType, ar as ResourceContactDetailsType, as as ResourceDetails, at as ResourceImageType, au as SocialMediaType, S as StallType, av as Subcategory, aw as SubcategoryItems, ax as TermsAgreement, p as UnregisteredVendorFormData, ay as UnregisteredVendorInvitationType, g as UnregisteredVendorType, U as UseGetResourcesByRegionOptions, i as UserLicenceType, az as VendorAttributes, aA as VendorCalendarData, l as VendorFormData, n as VendorInfoFormData, h as VendorInfoType, aB as VendorProductList, V as VendorType, aC as gameScreenIdentifierList, aD as gameTypeToDisplayName } from '../global-vWzQNI8w.js';
|
|
8
7
|
import '../images/index.js';
|
|
9
8
|
import 'react-hook-form';
|
|
10
9
|
|
package/dist/types/index.mjs
CHANGED
package/dist/utils/index.cjs
CHANGED
|
@@ -49,6 +49,7 @@ __export(utils_exports, {
|
|
|
49
49
|
filterEventsByDateStatusPeriod: () => filterEventsByDateStatusPeriod,
|
|
50
50
|
formatDate: () => formatDate,
|
|
51
51
|
formatTimestamp: () => formatTimestamp,
|
|
52
|
+
futureTimePeriods: () => futureTimePeriods,
|
|
52
53
|
getAllowedEventDateStatuses: () => getAllowedEventDateStatuses,
|
|
53
54
|
getCurrentAndFutureDates: () => getCurrentAndFutureDates,
|
|
54
55
|
isFutureDatesBeforeThreshold: () => isFutureDatesBeforeThreshold,
|
|
@@ -176,147 +177,6 @@ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.j
|
|
|
176
177
|
var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter.js"));
|
|
177
178
|
var import_timezone = __toESM(require("dayjs/plugin/timezone.js"));
|
|
178
179
|
var import_utc = __toESM(require("dayjs/plugin/utc.js"));
|
|
179
|
-
var dateFormat = "DD-MM-YYYY";
|
|
180
|
-
var timeFormat = "HH:mm";
|
|
181
|
-
import_dayjs.default.extend(import_customParseFormat.default);
|
|
182
|
-
import_dayjs.default.extend(import_utc.default);
|
|
183
|
-
import_dayjs.default.extend(import_timezone.default);
|
|
184
|
-
import_dayjs.default.extend(import_isSameOrAfter.default);
|
|
185
|
-
var NZ_TZ = "Pacific/Auckland";
|
|
186
|
-
function toNZTime(date) {
|
|
187
|
-
return date ? (0, import_dayjs.default)(date).tz(NZ_TZ) : (0, import_dayjs.default)().tz(NZ_TZ);
|
|
188
|
-
}
|
|
189
|
-
function nzStartOfDay(input) {
|
|
190
|
-
if (input == null) {
|
|
191
|
-
return (0, import_dayjs.default)().tz(NZ_TZ).startOf("day");
|
|
192
|
-
}
|
|
193
|
-
return import_dayjs.default.tz(input, NZ_TZ).startOf("day");
|
|
194
|
-
}
|
|
195
|
-
var formatDate = (dateStr, display = "datetime", timeStr) => {
|
|
196
|
-
const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
|
|
197
|
-
const dateTime = timeStr ? (0, import_dayjs.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs.default)(dateStr, dateFormat);
|
|
198
|
-
const formattedDate = dateTime.format("dddd, D MMMM, YYYY");
|
|
199
|
-
const formattedTime = dateTime.format("h:mm a");
|
|
200
|
-
switch (display) {
|
|
201
|
-
case "date":
|
|
202
|
-
return formattedDate;
|
|
203
|
-
case "time":
|
|
204
|
-
return formattedTime;
|
|
205
|
-
case "datetime":
|
|
206
|
-
return `${formattedDate} at ${formattedTime}`;
|
|
207
|
-
default:
|
|
208
|
-
return formattedDate;
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
var getCurrentAndFutureDates = (dates) => {
|
|
212
|
-
const now = (0, import_dayjs.default)();
|
|
213
|
-
return dates.filter((dateObj) => {
|
|
214
|
-
const dateTime = (0, import_dayjs.default)(
|
|
215
|
-
`${dateObj.startDate} ${dateObj.startTime}`,
|
|
216
|
-
`${dateFormat} ${timeFormat}`
|
|
217
|
-
);
|
|
218
|
-
return dateTime.isSameOrAfter(now);
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
var isFutureDatesBeforeThreshold = (date, minHoursFromNow) => {
|
|
222
|
-
const threshold = minHoursFromNow ? (0, import_dayjs.default)().add(minHoursFromNow, "hour") : (0, import_dayjs.default)().startOf("day");
|
|
223
|
-
const dateTime = (0, import_dayjs.default)(
|
|
224
|
-
`${date.startDate} ${date.startTime}`,
|
|
225
|
-
`${dateFormat} ${timeFormat}`
|
|
226
|
-
);
|
|
227
|
-
return dateTime.isSameOrAfter(threshold);
|
|
228
|
-
};
|
|
229
|
-
var formatTimestamp = (timestamp) => {
|
|
230
|
-
const formattedDate = toNZTime(timestamp).format(dateFormat);
|
|
231
|
-
return formatDate(formattedDate, "date");
|
|
232
|
-
};
|
|
233
|
-
var isIsoDateString = (value) => {
|
|
234
|
-
return typeof value === "string" && !isNaN(Date.parse(value));
|
|
235
|
-
};
|
|
236
|
-
function sortDatesChronologically(dates) {
|
|
237
|
-
if (!dates || !dates.length) {
|
|
238
|
-
return [];
|
|
239
|
-
}
|
|
240
|
-
return [...dates].sort((a, b) => {
|
|
241
|
-
const dateTimeFormat = `${dateFormat} ${timeFormat}`;
|
|
242
|
-
const dateA = (0, import_dayjs.default)(`${a.startDate} ${a.startTime}`, dateTimeFormat);
|
|
243
|
-
const dateB = (0, import_dayjs.default)(`${b.startDate} ${b.startTime}`, dateTimeFormat);
|
|
244
|
-
return dateA.valueOf() - dateB.valueOf();
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// src/utils/dailyClueGame.ts
|
|
249
|
-
function createSeededRng(seed) {
|
|
250
|
-
let t = seed >>> 0;
|
|
251
|
-
return function random() {
|
|
252
|
-
t += 1831565813;
|
|
253
|
-
let x = t;
|
|
254
|
-
x = Math.imul(x ^ x >>> 15, x | 1);
|
|
255
|
-
x ^= x + Math.imul(x ^ x >>> 7, x | 61);
|
|
256
|
-
return ((x ^ x >>> 14) >>> 0) / 4294967296;
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
function hashStringToNumber(seed) {
|
|
260
|
-
let hash = 2166136261;
|
|
261
|
-
for (let i = 0; i < seed.length; i++) {
|
|
262
|
-
hash ^= seed.codePointAt(i) ?? 0;
|
|
263
|
-
hash = Math.imul(hash, 16777619);
|
|
264
|
-
}
|
|
265
|
-
return hash >>> 0;
|
|
266
|
-
}
|
|
267
|
-
function seededShuffle(array, seed) {
|
|
268
|
-
const rng = createSeededRng(hashStringToNumber(seed));
|
|
269
|
-
const result = [...array];
|
|
270
|
-
for (let i = result.length - 1; i > 0; i--) {
|
|
271
|
-
const j = Math.floor(rng() * (i + 1));
|
|
272
|
-
[result[i], result[j]] = [result[j], result[i]];
|
|
273
|
-
}
|
|
274
|
-
return result;
|
|
275
|
-
}
|
|
276
|
-
function getDayIndex(start, today) {
|
|
277
|
-
return today.diff(start, "day");
|
|
278
|
-
}
|
|
279
|
-
function computeDailyClueState(dailyClue) {
|
|
280
|
-
const { startDate, endDate } = dailyClue.gameFields.gameDate;
|
|
281
|
-
const { solutionShuffled, collected } = dailyClue.letterInfo;
|
|
282
|
-
const today = nzStartOfDay();
|
|
283
|
-
const start = nzStartOfDay(startDate);
|
|
284
|
-
const end = nzStartOfDay(endDate);
|
|
285
|
-
if (today.isBefore(start)) {
|
|
286
|
-
return null;
|
|
287
|
-
}
|
|
288
|
-
const shuffledPlacements = seededShuffle(
|
|
289
|
-
gameScreenIdentifierList,
|
|
290
|
-
start.toISOString()
|
|
291
|
-
);
|
|
292
|
-
const index = getDayIndex(start, today);
|
|
293
|
-
if (today.isAfter(end)) {
|
|
294
|
-
return {
|
|
295
|
-
todaysClue: null,
|
|
296
|
-
todaysLetter: null,
|
|
297
|
-
todaysPlacement: null
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
if (index < 0 || index >= solutionShuffled.length || index >= shuffledPlacements.length) {
|
|
301
|
-
return null;
|
|
302
|
-
}
|
|
303
|
-
const letterToday = solutionShuffled[index];
|
|
304
|
-
const placement = shuffledPlacements[index];
|
|
305
|
-
if (!letterToday || !placement) return null;
|
|
306
|
-
const alreadyCollectedToday = (collected ?? []).includes(letterToday);
|
|
307
|
-
if (alreadyCollectedToday) {
|
|
308
|
-
return {
|
|
309
|
-
todaysClue: null,
|
|
310
|
-
todaysLetter: null,
|
|
311
|
-
todaysPlacement: null
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
return {
|
|
315
|
-
todaysClue: placement.clue,
|
|
316
|
-
todaysLetter: letterToday,
|
|
317
|
-
todaysPlacement: placement.id
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
180
|
|
|
321
181
|
// src/enums/index.ts
|
|
322
182
|
var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus2) => {
|
|
@@ -353,6 +213,20 @@ var EnumRegions = /* @__PURE__ */ ((EnumRegions2) => {
|
|
|
353
213
|
EnumRegions2["Wellington"] = "Wellington";
|
|
354
214
|
return EnumRegions2;
|
|
355
215
|
})(EnumRegions || {});
|
|
216
|
+
var EnumEventDateStatus = /* @__PURE__ */ ((EnumEventDateStatus2) => {
|
|
217
|
+
EnumEventDateStatus2["STARTING_SOON"] = "Starting_Soon";
|
|
218
|
+
EnumEventDateStatus2["STARTED"] = "Started";
|
|
219
|
+
EnumEventDateStatus2["TODAY"] = "Today";
|
|
220
|
+
EnumEventDateStatus2["TOMORROW"] = "Tomorrow";
|
|
221
|
+
EnumEventDateStatus2["THIS_WEEK"] = "This_Week";
|
|
222
|
+
EnumEventDateStatus2["NEXT_WEEK"] = "Next_Week";
|
|
223
|
+
EnumEventDateStatus2["UPCOMING"] = "Upcoming";
|
|
224
|
+
EnumEventDateStatus2["ENDED"] = "Ended";
|
|
225
|
+
EnumEventDateStatus2["RE_SCHEDULED"] = "Rescheduled";
|
|
226
|
+
EnumEventDateStatus2["CANCELED"] = "Canceled";
|
|
227
|
+
EnumEventDateStatus2["INVALID"] = "Invalid";
|
|
228
|
+
return EnumEventDateStatus2;
|
|
229
|
+
})(EnumEventDateStatus || {});
|
|
356
230
|
|
|
357
231
|
// src/types/subscription.ts
|
|
358
232
|
var TIER_FROM_LICENCE = {
|
|
@@ -468,6 +342,157 @@ var PostTypeLabels = {
|
|
|
468
342
|
["play_and_win" /* PLAY_AND_WIN */]: "Play & Win"
|
|
469
343
|
};
|
|
470
344
|
|
|
345
|
+
// src/utils/date.ts
|
|
346
|
+
var dateFormat = "DD-MM-YYYY";
|
|
347
|
+
var timeFormat = "HH:mm";
|
|
348
|
+
import_dayjs.default.extend(import_customParseFormat.default);
|
|
349
|
+
import_dayjs.default.extend(import_utc.default);
|
|
350
|
+
import_dayjs.default.extend(import_timezone.default);
|
|
351
|
+
import_dayjs.default.extend(import_isSameOrAfter.default);
|
|
352
|
+
var NZ_TZ = "Pacific/Auckland";
|
|
353
|
+
function toNZTime(date) {
|
|
354
|
+
return date ? (0, import_dayjs.default)(date).tz(NZ_TZ) : (0, import_dayjs.default)().tz(NZ_TZ);
|
|
355
|
+
}
|
|
356
|
+
function nzStartOfDay(input) {
|
|
357
|
+
if (input == null) {
|
|
358
|
+
return (0, import_dayjs.default)().tz(NZ_TZ).startOf("day");
|
|
359
|
+
}
|
|
360
|
+
return import_dayjs.default.tz(input, NZ_TZ).startOf("day");
|
|
361
|
+
}
|
|
362
|
+
var formatDate = (dateStr, display = "datetime", timeStr) => {
|
|
363
|
+
const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
|
|
364
|
+
const dateTime = timeStr ? (0, import_dayjs.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs.default)(dateStr, dateFormat);
|
|
365
|
+
const formattedDate = dateTime.format("dddd, D MMMM, YYYY");
|
|
366
|
+
const formattedTime = dateTime.format("h:mm a");
|
|
367
|
+
switch (display) {
|
|
368
|
+
case "date":
|
|
369
|
+
return formattedDate;
|
|
370
|
+
case "time":
|
|
371
|
+
return formattedTime;
|
|
372
|
+
case "datetime":
|
|
373
|
+
return `${formattedDate} at ${formattedTime}`;
|
|
374
|
+
default:
|
|
375
|
+
return formattedDate;
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
var getCurrentAndFutureDates = (dates) => {
|
|
379
|
+
const now = (0, import_dayjs.default)();
|
|
380
|
+
return dates.filter((dateObj) => {
|
|
381
|
+
const dateTime = (0, import_dayjs.default)(
|
|
382
|
+
`${dateObj.startDate} ${dateObj.startTime}`,
|
|
383
|
+
`${dateFormat} ${timeFormat}`
|
|
384
|
+
);
|
|
385
|
+
return dateTime.isSameOrAfter(now);
|
|
386
|
+
});
|
|
387
|
+
};
|
|
388
|
+
var isFutureDatesBeforeThreshold = (date, minHoursFromNow) => {
|
|
389
|
+
const threshold = minHoursFromNow ? (0, import_dayjs.default)().add(minHoursFromNow, "hour") : (0, import_dayjs.default)().startOf("day");
|
|
390
|
+
const dateTime = (0, import_dayjs.default)(
|
|
391
|
+
`${date.startDate} ${date.startTime}`,
|
|
392
|
+
`${dateFormat} ${timeFormat}`
|
|
393
|
+
);
|
|
394
|
+
return dateTime.isSameOrAfter(threshold);
|
|
395
|
+
};
|
|
396
|
+
var formatTimestamp = (timestamp) => {
|
|
397
|
+
const formattedDate = toNZTime(timestamp).format(dateFormat);
|
|
398
|
+
return formatDate(formattedDate, "date");
|
|
399
|
+
};
|
|
400
|
+
var isIsoDateString = (value) => {
|
|
401
|
+
return typeof value === "string" && !Number.isNaN(Date.parse(value));
|
|
402
|
+
};
|
|
403
|
+
function sortDatesChronologically(dates) {
|
|
404
|
+
if (!dates?.length) {
|
|
405
|
+
return [];
|
|
406
|
+
}
|
|
407
|
+
return [...dates].sort((a, b) => {
|
|
408
|
+
const dateTimeFormat = `${dateFormat} ${timeFormat}`;
|
|
409
|
+
const dateA = (0, import_dayjs.default)(`${a.startDate} ${a.startTime}`, dateTimeFormat);
|
|
410
|
+
const dateB = (0, import_dayjs.default)(`${b.startDate} ${b.startTime}`, dateTimeFormat);
|
|
411
|
+
return dateA.valueOf() - dateB.valueOf();
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
var futureTimePeriods = mapArrayToOptions(
|
|
415
|
+
Object.values(EnumEventDateStatus)
|
|
416
|
+
).filter(
|
|
417
|
+
(period) => period.value !== "Starting_Soon" /* STARTING_SOON */ && period.value !== "Canceled" /* CANCELED */ && period.value !== "Rescheduled" /* RE_SCHEDULED */ && period.value !== "Started" /* STARTED */ && period.value !== "Ended" /* ENDED */ && period.value !== "Invalid" /* INVALID */
|
|
418
|
+
).map((period) => ({
|
|
419
|
+
label: period.value.replaceAll("_", " "),
|
|
420
|
+
value: period.value
|
|
421
|
+
}));
|
|
422
|
+
|
|
423
|
+
// src/utils/dailyClueGame.ts
|
|
424
|
+
function createSeededRng(seed) {
|
|
425
|
+
let t = seed >>> 0;
|
|
426
|
+
return function random() {
|
|
427
|
+
t += 1831565813;
|
|
428
|
+
let x = t;
|
|
429
|
+
x = Math.imul(x ^ x >>> 15, x | 1);
|
|
430
|
+
x ^= x + Math.imul(x ^ x >>> 7, x | 61);
|
|
431
|
+
return ((x ^ x >>> 14) >>> 0) / 4294967296;
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
function hashStringToNumber(seed) {
|
|
435
|
+
let hash = 2166136261;
|
|
436
|
+
for (let i = 0; i < seed.length; i++) {
|
|
437
|
+
hash ^= seed.codePointAt(i) ?? 0;
|
|
438
|
+
hash = Math.imul(hash, 16777619);
|
|
439
|
+
}
|
|
440
|
+
return hash >>> 0;
|
|
441
|
+
}
|
|
442
|
+
function seededShuffle(array, seed) {
|
|
443
|
+
const rng = createSeededRng(hashStringToNumber(seed));
|
|
444
|
+
const result = [...array];
|
|
445
|
+
for (let i = result.length - 1; i > 0; i--) {
|
|
446
|
+
const j = Math.floor(rng() * (i + 1));
|
|
447
|
+
[result[i], result[j]] = [result[j], result[i]];
|
|
448
|
+
}
|
|
449
|
+
return result;
|
|
450
|
+
}
|
|
451
|
+
function getDayIndex(start, today) {
|
|
452
|
+
return today.diff(start, "day");
|
|
453
|
+
}
|
|
454
|
+
function computeDailyClueState(dailyClue) {
|
|
455
|
+
const { startDate, endDate } = dailyClue.gameFields.gameDate;
|
|
456
|
+
const { solutionShuffled, collected } = dailyClue.letterInfo;
|
|
457
|
+
const today = nzStartOfDay();
|
|
458
|
+
const start = nzStartOfDay(startDate);
|
|
459
|
+
const end = nzStartOfDay(endDate);
|
|
460
|
+
if (today.isBefore(start)) {
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
const shuffledPlacements = seededShuffle(
|
|
464
|
+
gameScreenIdentifierList,
|
|
465
|
+
start.toISOString()
|
|
466
|
+
);
|
|
467
|
+
const index = getDayIndex(start, today);
|
|
468
|
+
if (today.isAfter(end)) {
|
|
469
|
+
return {
|
|
470
|
+
todaysClue: null,
|
|
471
|
+
todaysLetter: null,
|
|
472
|
+
todaysPlacement: null
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
if (index < 0 || index >= solutionShuffled.length || index >= shuffledPlacements.length) {
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
const letterToday = solutionShuffled[index];
|
|
479
|
+
const placement = shuffledPlacements[index];
|
|
480
|
+
if (!letterToday || !placement) return null;
|
|
481
|
+
const alreadyCollectedToday = (collected ?? []).includes(letterToday);
|
|
482
|
+
if (alreadyCollectedToday) {
|
|
483
|
+
return {
|
|
484
|
+
todaysClue: null,
|
|
485
|
+
todaysLetter: null,
|
|
486
|
+
todaysPlacement: null
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
return {
|
|
490
|
+
todaysClue: placement.clue,
|
|
491
|
+
todaysLetter: letterToday,
|
|
492
|
+
todaysPlacement: placement.id
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
|
|
471
496
|
// src/utils/school.ts
|
|
472
497
|
var SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
473
498
|
var SCHOOL_MAX_STUDENT_COUNT = 0;
|
|
@@ -520,6 +545,7 @@ function filterEventsByDateStatusPeriod(events, period) {
|
|
|
520
545
|
filterEventsByDateStatusPeriod,
|
|
521
546
|
formatDate,
|
|
522
547
|
formatTimestamp,
|
|
548
|
+
futureTimePeriods,
|
|
523
549
|
getAllowedEventDateStatuses,
|
|
524
550
|
getCurrentAndFutureDates,
|
|
525
551
|
isFutureDatesBeforeThreshold,
|