@smartico/public-api 0.0.397 → 0.0.398
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/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/Base/ClassId.ts","../src/IntUtils.ts","../src/MiniGames/SAWBuyInType.ts","../src/MiniGames/SAWUtils.ts","../src/MiniGames/SAWAcknowledgeType.ts","../src/MiniGames/SAWAskForUsername.ts","../src/MiniGames/SAWGameType.ts","../src/MiniGames/SAWExposeUserSpinId.ts","../src/MiniGames/SAWGameLayout.ts","../src/MiniGames/SAWPrizeType.ts","../src/MiniGames/SAWGetTemplatesResponse.ts","../src/MiniGames/SAWSpinErrorCode.ts","../src/MiniGames/SAWWinSoundType.ts","../src/MiniGames/SAWWinningHistoryResponse.ts","../src/MiniGames/PrizeModifiers.ts","../src/MiniGames/SAWWheelLayout.ts","../src/MiniGames/SAWGameDifficulty.ts","../src/MiniGames/AttemptPeriodType.ts","../src/NodeCache.ts","../src/OCache.ts","../src/Core/ActivityTypeLimited.ts","../src/Core/CoreUtils.ts","../src/Core/PublicLabelSettings.ts","../src/Core/TranslationArea.ts","../src/Inbox/GetInboxMessagesResponse.ts","../src/Inbox/InboxMessage.ts","../src/Inbox/InboxMessageType.ts","../src/Inbox/OpenLinksType.ts","../src/Inbox/InboxCategories.ts","../src/Inbox/InboxReadStatus.ts","../src/Store/BuyStoreItemErrorCode.ts","../src/Store/StoreCategory.ts","../src/Store/StoreItemPurchaseType.ts","../src/Store/StoreItemType.ts","../src/Store/StoreItem.ts","../src/Store/StoreItemPurchased.ts","../src/Missions/AchievementStatus.ts","../src/Missions/AchievementTaskType.ts","../src/Missions/AchievementType.ts","../src/Missions/AchievementAvailabilityStatus.ts","../src/Missions/BadgesTimeLimitStates.ts","../src/Missions/MissionsUtils.ts","../src/Missions/UserAchievement.ts","../src/Missions/ScheduledMissionType.ts","../src/Missions/AchievementCategory.ts","../src/Missions/MissionCategory.ts","../src/Missions/AchievementClaimTypeId.ts","../src/Tournaments/GetClanTournamentPlayersResponse.ts","../src/Tournaments/TournamentRegistrationType.ts","../src/Tournaments/TournamentRegistrationStatus.ts","../src/Tournaments/TournamentInstanceStatus.ts","../src/Tournaments/TournamentUtils.ts","../src/Tournaments/Tournament.ts","../src/Tournaments/GetTournamentInfoResponse.ts","../src/Tournaments/TournamentRegistrationError.ts","../src/Tournaments/TournamentType.ts","../src/Leaderboard/LeaderBoardPeriodType.ts","../src/Leaderboard/LeaderBoards.ts","../src/Level/GetLevelMapResponse.ts","../src/WSAPI/WSAPIBase.ts","../src/Raffle/GetRafflesResponse.ts","../src/Raffle/GetDrawRunResponse.ts","../src/Raffle/Raffle.ts","../src/Raffle/RaffleDraw.ts","../src/Raffle/GetRaffleDrawRunsHistoryResponse.ts","../src/Raffle/RaffleClaimPrizeResponse.ts","../src/WSAPI/WSAPIUser.ts","../src/WSAPI/WSAPIGeneral.ts","../src/WSAPI/WSAPIMissions.ts","../src/WSAPI/WSAPIBonuses.ts","../src/WSAPI/WSAPIStore.ts","../src/WSAPI/WSAPITournaments.ts","../src/WSAPI/WSAPIClans.ts","../src/WSAPI/WSAPIJackpots.ts","../src/WSAPI/WSAPIRaffles.ts","../src/WSAPI/WSAPIMiniGames.ts","../src/WSAPI/WSAPIAvatars.ts","../src/WSAPI/WSAPIGamePick.ts","../src/WSAPI/WSAPILeaderBoard.ts","../src/WSAPI/WSAPIInbox.ts","../src/WSAPI/WSAPI.ts","../src/CustomSections/AchCustomSection.ts","../src/CustomSections/UICustomSection.ts","../src/Bonuses/Bonus.ts","../src/Bonuses/BonusStatus.ts","../src/ActivityLog/UserBalanceType.ts","../src/ActivityLog/GetActivityLogResponse.ts","../src/ActivityLog/PointChangeSourceType.ts","../src/Avatars/GetAvatarsListResponse.ts","../src/Avatars/GetAvatarsCustomizedResponse.ts","../src/Avatars/GetAvatarPromptsResponse.ts","../src/Jackpots/GetJackpotWinnersResponse.ts","../src/Jackpots/GetJackpotEligibleGamesResponse.ts","../src/SmarticoAPI.ts","../src/CookieStore.ts","../src/Analytics/AnalyticStoreData.ts","../src/GamePick/SportTypes.ts","../src/GamePick/MarketsType.ts","../src/GamePick/MarketsAnswers.ts","../src/GamePick/MarketsInfo.ts","../src/GamePick/MarketsPerSport.ts","../src/GamePick/GamePickTypes.ts","../src/Jackpots/JackpotContributionType.ts","../src/Jackpots/JackpotPot.ts","../src/Jackpots/JackpotType.ts","../src/Avatars/AvatarCustomizeErrorCode.ts","../src/Clans/JoinClanErrorCode.ts"],"sourcesContent":["export enum ClassId {\n\tPING = 1,\n\tPONG = 2,\n\n\tINIT = 3,\n\tINIT_RESPONSE = 4,\n\tIDENTIFY = 5,\n\tIDENTIFY_RESPONSE = 6,\n\tLOGIN = 7,\n\tLOGOUT = 8,\n\tEVENT = 9,\n\tEVENT_RESPONSE = 10,\n\n\tLOGIN_RESPONSE = 11,\n\tLOGOUT_RESPONSE = 12,\n\n\tGET_TRANSLATIONS_REQUEST = 13,\n\tGET_TRANSLATIONS_RESPONSE = 14,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tCLIENT_ENGAGEMENT_IMPRESSION_REQUEST = 103,\n\tCLIENT_ENGAGEMENT_ACTION_REQUEST = 104,\n\tCLIENT_EXECUTE_DEEPLINK_EVENT = 105,\n\tCLIENT_ENGAGEMENT_FAILED_REQUEST = 106,\n\tCLIENT_EXECUTE_JS_EVENT = 107,\n\tCLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT = 108,\n\tCLIENT_ENGAGEMENT_EVENT_NEW = 110,\n\n\tCLIENT_TRACK_ACTIVITY_REQUEST = 155,\n\tCLIENT_SET_AVATAR_REQUEST = 157,\n\tCLIENT_SET_AVATAR_RESPONSE = 158,\n\n\tCLIENT_SET_CUSTOM_USERNAME_REQUEST = 159,\n\tCLIENT_SET_CUSTOM_USERNAME_RESPONSE = 160,\n\n\tCHECK_SEGMENT_MATCH_REQUEST = 161,\n\tCHECK_SEGMENT_MATCH_RESPONSE = 162,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\t// 500-1000 - Achievements\n\tGET_LEVEL_MAP_REQUEST = 500,\n\tGET_LEVEL_MAP_RESPONSE = 501,\n\tGET_ACHIEVEMENT_MAP_REQUEST = 502,\n\tGET_ACHIEVEMENT_MAP_RESPONSE = 503,\n\tRELOAD_ACHIEVEMENTS_EVENT = 504,\n\tGET_LEADERS_BOARD_REQUEST = 505,\n\tGET_LEADERS_BOARD_RESPONSE = 506,\n\tGET_SHOP_ITEMS_REQUEST = 509,\n\tGET_SHOP_ITEMS_RESPONSE = 510,\n\tBUY_SHOP_ITEM_REQUEST = 511,\n\tBUY_SHOP_ITEM_RESPONSE = 512,\n\tGET_INBOX_MESSAGES_REQUEST = 513,\n\tGET_INBOX_MESSAGES_RESPONSE = 514,\n\tGET_SHOP_CATEGORIES_REQUEST = 515,\n\tGET_SHOP_CATEGORIES_RESPONSE = 516,\n\tGET_TOURNAMENT_LOBBY_REQUEST = 517,\n\tGET_TOURNAMENT_LOBBY_RESPONSE = 518,\n\tGET_TOURNAMENT_INFO_REQUEST = 519,\n\tGET_TOURNAMENT_INFO_RESPONSE = 520,\n\tTOURNAMENT_REGISTER_REQUEST = 521,\n\tTOURNAMENT_REGISTER_RESPONSE = 522,\n\tGET_CUSTOM_SECTIONS_REQUEST = 523,\n\tGET_CUSTOM_SECTIONS_RESPONSE = 524,\n\tMISSION_OPTIN_REQUEST = 525,\n\tMISSION_OPTIN_RESPONSE = 526,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tGET_ACHIEVEMENT_USER_REQUEST = 527,\n\tGET_ACHIEVEMENT_USER_RESPONSE = 528,\n\n\tMARK_INBOX_READ_REQUEST = 529,\n\tMARK_INBOX_READ_RESPONSE = 530,\n\tMARK_INBOX_STARRED_REQUEST = 531,\n\tMARK_INBOX_STARRED_RESPONSE = 532,\n\tMARK_INBOX_DELETED_REQUEST = 535,\n\tMARK_INBOX_DELETED_RESPONSE = 536,\n\n\tGET_ACH_CATEGORIES_REQUEST = 537,\n\tGET_ACH_CATEGORIES_RESPONSE = 538,\n\n\tACHIEVEMENT_CLAIM_PRIZE_REQUEST = 539,\n\tACHIEVEMENT_CLAIM_PRIZE_RESPONSE = 540,\n\n\tACH_SHOP_ITEM_HISTORY_REQUEST = 541,\n\tACH_SHOP_ITEM_HISTORY_RESPONSE = 542,\n\n\tGET_RELATED_ACH_N_TOURNAMENTS_REQUEST = 543,\n\tGET_RELATED_ACH_N_TOURNAMENTS_RESPONSE = 544,\n\n\tGET_POINT_HISTORY_REQUEST = 545,\n\tGET_POINT_HISTORY_RESPONSE = 546,\n\n\tGET_AVATARS_LIST_REQUEST = 560,\n\tGET_AVATARS_LIST_RESPONSE = 561,\n\tGET_AVATARS_CUSTOMIZED_REQUEST = 562,\n\tGET_AVATARS_CUSTOMIZED_RESPONSE = 563,\n\tGET_AVATAR_PROMPTS_REQUEST = 564,\n\tGET_AVATAR_PROMPTS_RESPONSE = 565,\n\n\tGET_CLAN_LIST_REQUEST = 570,\n\tGET_CLAN_LIST_RESPONSE = 571,\n\n\tGET_CLAN_INFO_REQUEST = 572,\n\tGET_CLAN_INFO_RESPONSE = 573,\n\n\tJOIN_CLAN_REQUEST = 574,\n\tJOIN_CLAN_RESPONSE = 575,\n\n\tGET_CLAN_TOURNAMENT_PLAYERS_REQUEST = 576,\n\tGET_CLAN_TOURNAMENT_PLAYERS_RESPONSE = 577,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tGET_BONUSES_REQUEST = 600,\n\tGET_BONUSES_RESPONSE = 601,\n\tCLAIM_BONUS_REQUEST = 602,\n\tCLAIM_BONUS_RESPONSE = 603,\n\n\tSAW_GET_SPINS_REQUEST = 700,\n\tSAW_GET_SPINS_RESPONSE = 701,\n\tSAW_DO_SPIN_REQUEST = 702,\n\tSAW_DO_SPIN_RESPONSE = 703,\n\tSAW_AKNOWLEDGE_REQUEST = 704,\n\tSAW_AKNOWLEDGE_RESPONSE = 705,\n\tSAW_SPINS_COUNT_PUSH = 706,\n\tSAW_SHOW_SPIN_PUSH = 707,\n\tSAW_PRIZE_DROP_WIN_PUSH = 708,\n\tSAW_PRIZE_DROP_WIN_AKNOWLEDGE_REQUEST = 709,\n\tSAW_PRIZE_DROP_WIN_AKNOWLEDGE_RESPONSE = 710,\n\tSAW_AKNOWLEDGE_SPIN_PUSH = 711,\n\tSAW_DO_SPIN_BATCH_REQUEST = 712,\n\tSAW_DO_SPIN_BATCH_RESPONSE = 713,\n\tSAW_AKNOWLEDGE_BATCH_REQUEST = 714,\n\tSAW_AKNOWLEDGE_BATCH_RESPONSE = 715,\n\n\tGET_SAW_HISTORY_REQUEST = 716,\n\tGET_SAW_HISTORY_RESPONSE = 717,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tJP_GET_JACKPOTS_REQUEST = 800,\n\tJP_GET_JACKPOTS_RESPONSE = 801,\n\n\tJP_GET_LATEST_POTS_REQUEST = 802,\n\tJP_GET_LATEST_POTS_RESPONSE = 803,\n\n\tJP_OPTIN_REQUEST = 804,\n\tJP_OPTIN_RESPONSE = 805,\n\n\tJP_OPTOUT_REQUEST = 806,\n\tJP_OPTOUT_RESPONSE = 807,\n\n\tJP_WIN_PUSH = 808,\n\tJP_GET_WINNERS_REQUEST = 809,\n\tJP_GET_WINNERS_RESPONSE = 810,\n\n\tJP_GET_ELIGIBLE_GAMES_REQUEST = 811,\n\tJP_GET_ELIGIBLE_GAMES_RESPONSE = 812,\n\n\tRAF_GET_RAFFLES_REQUEST = 902,\n\tRAF_GET_RAFFLES_RESPONSE = 903,\n\tRAF_GET_DRAW_RUN_REQUEST = 904,\n\tRAF_GET_DRAW_RUN_RESPONSE = 905,\n\tRAF_GET_DRAW_HISTORY_REQUEST = 906,\n\tRAF_GET_DRAW_HISTORY_RESPONSE = 907,\n\tRAF_CLAIM_PRIZE_REQUEST = 908,\n\tRAF_CLAIM_PRIZE_RESPONSE = 909,\n\tRAF_OPTIN_REQUEST = 916,\n\tRAF_OPTIN_RESPONSE = 917,\n\tRAF_GET_WON_PRIZES_REQUEST = 920,\n\tRAF_GET_WON_PRIZES_RESPONSE = 921,\n\t/*\n\tRAF_GET_TICKETS_REQUEST = 902,\n\tRAF_GET_TICKETS_RESPONSE = 903,\n\n\tRAF_CLAIM_PRIZE_REQUEST = 906,\n\t*/\n\n\tBNR_GET_BANNER_PLACEMENTS_REQUEST = 950,\n\tBNR_GET_BANNER_PLACEMENTS_RESPONSE = 951,\n\tBNR_GET_BANNER_CONTENT_REQUEST = 952,\n\tBNR_GET_BANNER_CONTENT_RESPONSE = 953,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tREGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,\n\tREGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,\n\n\tCLIENT_DEBUG_REQUEST = 77777,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tUNSUPPORTED_COMMAND = 99999,\n}\n","class IntUtils {\n\tpublic static uuid(): string {\n\t\tlet a: any;\n\t\tlet b: any;\n\t\tfor (\n\t\t\tb = a = '';\n\t\t\ta++ < 36;\n\t\t\tb += (a * 51) & 52 ? (a ^ 15 ? 8 ^ (Math.random() * (a ^ 20 ? 16 : 4)) : 4).toString(16) : '-'\n\t\t) {}\n\t\treturn b;\n\t}\n\n\tpublic static isNotNull(val: any): boolean {\n\t\treturn typeof val !== 'undefined' && val !== null;\n\t}\n\n\tpublic static isNotEmpty(val: string): boolean {\n\t\treturn typeof val !== 'undefined' && val !== null && val.length > 0;\n\t}\n\n\tpublic static replaceAll(value: string, regex: string, replacement: string | number): string {\n\t\tif (IntUtils.isNotNull(value)) {\n\t\t\treturn value.replace(new RegExp(IntUtils.escapeRegExp(regex), 'g'), replacement?.toString());\n\t\t}\n\t\treturn value;\n\t}\n\n\tpublic static escapeRegExp(v: string): string {\n\t\tif (IntUtils.isNotEmpty(v)) {\n\t\t\treturn v.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\t\t}\n\t\treturn v;\n\t}\n\n\tpublic static JsonOrText = (str: string): any => {\n\t\tif (str && str.includes && (str.includes('{') || str.includes('['))) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(str);\n\t\t\t} catch (e) {\n\t\t\t\treturn str;\n\t\t\t}\n\t\t}\n\t\treturn str || {};\n\t};\n\n\t// public static wsTimeToEpoch = (time: string): number => {\n\t// if (time) {\n\t// return moment.utc(time, \"DD/MM/YYYY HH:mm:ss\").valueOf()\n\t// } else {\n\t// return null\n\t// }\n\t// }\n\n\tpublic static isWithinPeriod = (timestamp: number, period: 'today' | 'thisWeek' | 'thisMonth'): boolean => {\n\t\tconst now = new Date();\n\t\tconst completedDate = new Date(timestamp);\n\n\t\tswitch (period) {\n\t\t\tcase 'today':\n\t\t\t\treturn (\n\t\t\t\t\tnow.getFullYear() === completedDate.getFullYear() &&\n\t\t\t\t\tnow.getMonth() === completedDate.getMonth() &&\n\t\t\t\t\tnow.getDate() === completedDate.getDate()\n\t\t\t\t);\n\t\t\tcase 'thisWeek':\n\t\t\t\tconst startOfWeek = new Date(now);\n\t\t\t\tstartOfWeek.setDate(now.getDate() - now.getDay());\n\t\t\t\tstartOfWeek.setHours(0, 0, 0, 0);\n\n\t\t\t\tconst endOfWeek = new Date(startOfWeek);\n\t\t\t\tendOfWeek.setDate(startOfWeek.getDate() + 6);\n\t\t\t\tendOfWeek.setHours(23, 59, 59, 999);\n\n\t\t\t\treturn completedDate >= startOfWeek && completedDate <= endOfWeek;\n\t\t\tcase 'thisMonth':\n\t\t\t\treturn now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth();\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t};\n}\n\nexport { IntUtils };\n","export enum SAWBuyInType {\n\tFree = 1,\n\tPoints = 2,\n\tSpins = 3,\n\tGems = 4,\n\tDiamonds = 5,\n}\n\nexport enum SAWBuyInTypeName {\n\tFree = 'free',\n\tPoints = 'points',\n\tSpins = 'spins',\n\tUnknown = 'unknown',\n\tGems = 'gems',\n\tDiamonds = 'diamonds',\n}\n\n/** @hidden */\nexport const SAWBuyInTypeNamed = (type: SAWBuyInType): SAWBuyInTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWBuyInType.Free]: SAWBuyInTypeName.Free,\n\t\t\t[SAWBuyInType.Points]: SAWBuyInTypeName.Points,\n\t\t\t[SAWBuyInType.Spins]: SAWBuyInTypeName.Spins,\n\t\t\t[SAWBuyInType.Gems]: SAWBuyInTypeName.Gems,\n\t\t\t[SAWBuyInType.Diamonds]: SAWBuyInTypeName.Diamonds,\n\t\t}[type] || SAWBuyInTypeName.Unknown\n\t);\n};\n","import { SAWBuyInType } from './SAWBuyInType';\nimport { SAWTemplate } from './SAWTemplate';\n\nclass SAWUtils {\n\tpublic static canPlay = (t: SAWTemplate, user_balances: {ach_points_balance: number, ach_gems_balance: number, ach_diamonds_balance: number}): boolean => {\n\t\tif (t === null || t === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (t.saw_buyin_type_id) {\n\t\t\tcase SAWBuyInType.Free: {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcase SAWBuyInType.Spins: {\n\t\t\t\treturn t.spin_count !== null && t.spin_count > 0;\n\t\t\t}\n\t\t\tcase SAWBuyInType.Points:\n\t\t\tcase SAWBuyInType.Gems:\n\t\t\tcase SAWBuyInType.Diamonds: {\n\t\t\t\tlet balance = user_balances.ach_points_balance;\n\t\t\t\tif (t.saw_buyin_type_id === SAWBuyInType.Gems) {\n\t\t\t\t\tbalance = user_balances.ach_gems_balance;\n\t\t\t\t} else if (t.saw_buyin_type_id === SAWBuyInType.Diamonds) {\n\t\t\t\t\tbalance = user_balances.ach_diamonds_balance;\n\t\t\t\t}\n\t\t\t\treturn t.buyin_cost_points <= balance;\n\t\t\t}\n\t\t\t\n\t\t\tdefault: {\n\t\t\t\tconsole.error('MiniGamesUtils.canPlay: Unknwon SAW buyin type ' + t.saw_buyin_type_id);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport { SAWUtils };\n","export enum SAWAcknowledgeType {\n\tSilent = 1,\n\tQuickMessage = 2,\n\tFullMessage = 3,\n\tExplicityAcknowledge = 4\n}\n\nexport enum SAWAcknowledgeTypeName {\n\tSilent = 'silent',\n\tQuickMessage = 'quick-message',\n\tFullMessage = 'full-message',\n\tExplicityAcknowledge = 'explicity-acknowledge'\n}\n\n/** @hidden */\nexport const SAWAcknowledgeTypeNamed = (type: SAWAcknowledgeType): SAWAcknowledgeTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWAcknowledgeType.Silent]: SAWAcknowledgeTypeName.Silent,\n\t\t\t[SAWAcknowledgeType.QuickMessage]: SAWAcknowledgeTypeName.QuickMessage,\n\t\t\t[SAWAcknowledgeType.FullMessage]: SAWAcknowledgeTypeName.FullMessage,\n\t\t\t[SAWAcknowledgeType.ExplicityAcknowledge]: SAWAcknowledgeTypeName.ExplicityAcknowledge\n\t\t}[type]\n\t);\n};\n","export enum SAWAskForUsername {\n\tNOASK = 'no-ask',\n\tONSUMBIT = 'on-submit',\n}\n","export enum SAWGameType {\n\tSpinAWheel = 1,\n\tScratchCard = 2,\n\tMatchX = 3,\n\tGiftBox = 4,\n\tPrizeDrop = 5,\n\tQuiz = 6,\n\tLootboxWeekdays = 7,\n\tLootboxCalendarDays = 8,\n\tTreasureHunt = 9,\n\tVoyager = 10,\n\tPlinko = 11,\n\tCoinFlip = 12,\n\tCustomMinigame = 13,\n}\n\nexport enum SAWGameTypeName {\n\tSpinAWheel = 'wheel',\n\tScratchCard = 'scratch',\n\tMatchX = 'matchx',\n\tGiftBox = 'giftbox',\n\tPrizeDrop = 'prizedrop',\n\tQuiz = 'quiz',\n\tLootboxWeekdays = 'lootbox_weekdays',\n\tLootboxCalendarDays = 'lootbox_calendar_days',\n\tTreasureHunt = 'treasure_hunt',\n\tVoyager = 'voyager',\n\tPlinko = 'plinko',\n\tCoinFlip = 'coin_flip',\n\tCustomMinigame = 'custom_minigame',\n\tUnknown = 'unknown',\n}\n\n/** @hidden */\nexport const SAWGameTypeNamed = (type: SAWGameType): SAWGameTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWGameType.SpinAWheel]: SAWGameTypeName.SpinAWheel,\n\t\t\t[SAWGameType.ScratchCard]: SAWGameTypeName.ScratchCard,\n\t\t\t[SAWGameType.MatchX]: SAWGameTypeName.MatchX,\n\t\t\t[SAWGameType.GiftBox]: SAWGameTypeName.GiftBox,\n\t\t\t[SAWGameType.PrizeDrop]: SAWGameTypeName.PrizeDrop,\n\t\t\t[SAWGameType.Quiz]: SAWGameTypeName.Quiz,\n\t\t\t[SAWGameType.LootboxWeekdays]: SAWGameTypeName.LootboxWeekdays,\n\t\t\t[SAWGameType.LootboxCalendarDays]: SAWGameTypeName.LootboxCalendarDays,\n\t\t\t[SAWGameType.TreasureHunt]: SAWGameTypeName.TreasureHunt,\n\t\t\t[SAWGameType.Voyager]: SAWGameTypeName.Voyager,\n\t\t\t[SAWGameType.Plinko]: SAWGameTypeName.Plinko,\n\t\t\t[SAWGameType.CoinFlip]: SAWGameTypeName.CoinFlip,\n\t\t\t[SAWGameType.CustomMinigame]: SAWGameTypeName.CustomMinigame,\n\t\t}[type] || SAWGameTypeName.Unknown\n\t);\n};\n","export enum SAWExposeUserSpinId {\n UserId = 1,\n SpinId = 2,\n}\n\nexport enum SAWExposeUserSpinIdName {\n UserId = 'userId',\n SpinId = 'spinId',\n}\n\n/** @hidden */\nexport const SAWExposeUserSpinIdNamed = (id: SAWExposeUserSpinId): SAWExposeUserSpinIdName => {\n return (\n {\n [SAWExposeUserSpinId.UserId]: SAWExposeUserSpinIdName.UserId,\n [SAWExposeUserSpinId.SpinId]: SAWExposeUserSpinIdName.SpinId,\n }[id]\n );\n};","export enum SAWGameLayout {\n Horizontal = 1,\n VerticalMap = 2,\n}\n\nexport enum SAWGameLayoutName {\n Horizontal = 'horizontal',\n VerticalMap = 'vertical-map',\n}\n\n/** @hidden */\nexport const SAWGameLayoutNamed = (layout: SAWGameLayout): SAWGameLayoutName => {\n return (\n {\n [SAWGameLayout.Horizontal]: SAWGameLayoutName.Horizontal,\n [SAWGameLayout.VerticalMap]: SAWGameLayoutName.VerticalMap,\n }[layout]\n );\n};","export enum SAWPrizeType {\n\tNO_PRIZE = 1,\n\tPOINTS = 2,\n\tBONUS = 3,\n\tMANUAL = 4,\n\tSPIN = 5,\n\tJACKPOT = 6,\n\tCHANGE_LEVEL = 7,\n\tMISSION = 8,\n\tRAFFLE_TICKET = 9,\n\tGEMS_AND_DIAMONDS = 10,\n}\n\nexport enum MiniGamePrizeTypeName {\n\tNO_PRIZE = 'no-prize',\n\tPOINTS = 'points',\n\tBONUS = 'bonus',\n\tMANUAL = 'manual',\n\tSPIN = 'spin',\n\tJACKPOT = 'jackpot',\n\tCHANGE_LEVEL = 'change-level',\n\tMISSION = 'mission',\n\tRAFFLE_TICKET = 'raffle-ticket',\n\tGEMS_AND_DIAMONDS = 'gems-and-diamonds',\n\tUNKNOWN = 'unknown',\n}\n\n/** @hidden */\nexport const MiniGamePrizeTypeNamed = (type: SAWPrizeType): MiniGamePrizeTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWPrizeType.NO_PRIZE]: MiniGamePrizeTypeName.NO_PRIZE,\n\t\t\t[SAWPrizeType.POINTS]: MiniGamePrizeTypeName.POINTS,\n\t\t\t[SAWPrizeType.BONUS]: MiniGamePrizeTypeName.BONUS,\n\t\t\t[SAWPrizeType.MANUAL]: MiniGamePrizeTypeName.MANUAL,\n\t\t\t[SAWPrizeType.SPIN]: MiniGamePrizeTypeName.SPIN,\n\t\t\t[SAWPrizeType.JACKPOT]: MiniGamePrizeTypeName.JACKPOT,\n\t\t\t[SAWPrizeType.CHANGE_LEVEL]: MiniGamePrizeTypeName.CHANGE_LEVEL,\n\t\t\t[SAWPrizeType.MISSION]: MiniGamePrizeTypeName.MISSION,\n\t\t\t[SAWPrizeType.RAFFLE_TICKET]: MiniGamePrizeTypeName.RAFFLE_TICKET,\n\t\t\t[SAWPrizeType.GEMS_AND_DIAMONDS]: MiniGamePrizeTypeName.GEMS_AND_DIAMONDS,\n\t\t}[type] || MiniGamePrizeTypeName.UNKNOWN\n\t);\n};\n","import { IntUtils } from '../IntUtils';\nimport { TMiniGamePrize, TMiniGameTemplate } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from './../Base/ProtocolResponse';\nimport { SAWAcknowledgeTypeNamed } from './SAWAcknowledgeType';\nimport { SAWBuyInType, SAWBuyInTypeNamed } from './SAWBuyInType';\nimport { SAWExposeUserSpinIdNamed } from './SAWExposeUserSpinId';\nimport { SAWGameLayoutNamed } from './SAWGameLayout';\nimport { SAWGameType, SAWGameTypeNamed } from './SAWGameType';\nimport { MiniGamePrizeTypeNamed } from './SAWPrizeType';\nimport { SAWTemplate } from './SAWTemplate';\n\nexport interface SAWGetTemplatesResponse extends ProtocolResponse {\n\ttemplates: SAWTemplate[];\n}\n\nexport const SAWTemplatesTransform = (items: SAWTemplate[]): TMiniGameTemplate[] => {\n\treturn items.map((r) => {\n\t\tconst x: TMiniGameTemplate = {\n\t\t\tid: r.saw_template_id,\n\t\t\tname: r.saw_template_ui_definition.name,\n\t\t\tdescription: r.saw_template_ui_definition.description,\n\t\t\tthumbnail: r.saw_template_ui_definition.thumbnail\n\t\t\t? r.saw_template_ui_definition.thumbnail\n\t\t\t: r.saw_skin_ui_definition?.skin_folder\n\t\t\t\t? `${r.saw_skin_ui_definition.skin_folder}/ico.png`\n\t\t\t\t: `https://d312ucx3huj7iy.cloudfront.net/gf/images/saw/${r.saw_skin_key}/ico.png`,\n\t\t\tvisibile_when_can_spin: r.visibile_when_can_spin,\n\t\t\tover_limit_message: r.saw_template_ui_definition.over_limit_message,\n\t\t\tno_attempts_message: r.saw_template_ui_definition.no_attempts_message,\n\t\t\tjackpot_symbol: r.saw_template_ui_definition.jackpot_symbol,\n\t\t\tsaw_game_type: SAWGameTypeNamed(r.saw_game_type_id),\n\t\t\tsaw_buyin_type: SAWBuyInTypeNamed(r.saw_buyin_type_id),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Points ? { buyin_cost_points: r.buyin_cost_points } : {}),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Gems ? { buyin_cost_gems: r.buyin_cost_points } : {}),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Diamonds ? { buyin_cost_diamonds: r.buyin_cost_points } : {}),\n\t\t\tjackpot_add_on_attempt: r.jackpot_add_on_attempt,\n\t\t\tjackpot_current: r.jackpot_current,\n\t\t\tspin_count: r.spin_count,\n\t\t\tpromo_image: r.saw_template_ui_definition.promo_image,\n\t\t\tpromo_text: r.saw_template_ui_definition.promo_text,\n\t\t\tcustom_data: IntUtils.JsonOrText(r.saw_template_ui_definition.custom_data),\n\t\t\texpose_game_stat_on_api: r.expose_game_stat_on_api,\n\t\t\trelative_period_timezone: r.relative_period_timezone,\n\t\t\tactiveFromDate: r.activeFromDate,\n\t\t\tactiveTillDate: r.activeTillDate,\n\t\t\tnext_available_spin_ts: r.next_available_spin_ts,\n\t\t\tsteps_to_finish_game: r.saw_template_ui_definition.steps_to_finish_game,\n\t\t\tcustom_section_id: r.saw_template_ui_definition.custom_section_id,\n\t\t\tsaw_template_ui_definition: r.saw_template_ui_definition,\n\t\t\t...(r.saw_game_type_id === SAWGameType.LootboxCalendarDays || r.saw_game_type_id === SAWGameType.LootboxWeekdays\n\t\t\t\t? { game_layout: SAWGameLayoutNamed(r.saw_template_ui_definition.game_layout) }\n\t\t\t\t: {}\n\t\t\t),\n\t\t\tshow_prize_history: r.show_prize_history,\n\t\t\tmax_number_of_attempts: r.maxSpinsCount,\n\t\t\tmax_spins_period_ms: r.maxSpinsPediodMs,\n\t\t\t...(r.saw_template_ui_definition.expose_user_spin_id\n\t\t\t\t? { expose_user_spin_id: SAWExposeUserSpinIdNamed(r.saw_template_ui_definition.expose_user_spin_id) } \n\t\t\t\t: {}),\n\n\t\t\tprizes: r.prizes.map((p) => {\n\t\t\t\tconst y: TMiniGamePrize = {\n\t\t\t\t\tid: p.saw_prize_id,\n\t\t\t\t\tname: p.saw_prize_ui_definition.name,\n\t\t\t\t\tprize_type: MiniGamePrizeTypeNamed(p.prize_type_id),\n\t\t\t\t\tprize_value: p.prize_value,\n\t\t\t\t\tfont_size: p.saw_prize_ui_definition.font_size,\n\t\t\t\t\tfont_size_mobile: p.saw_prize_ui_definition.font_size_mobile,\n\t\t\t\t\ticon: p.saw_prize_ui_definition.icon,\n\t\t\t\t\tposition: p.saw_prize_ui_definition.position,\n\t\t\t\t\tsectors: p.saw_prize_ui_definition.sectors,\n\t\t\t\t\tacknowledge_type: SAWAcknowledgeTypeNamed(p.saw_prize_ui_definition.acknowledge_type),\n\t\t\t\t\taknowledge_message: p.saw_prize_ui_definition.aknowledge_message,\n\t\t\t\t\tacknowledge_dp: p.saw_prize_ui_definition.acknowledge_dp,\n\t\t\t\t\tacknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,\n\t\t\t\t\tacknowledge_dp_additional: p.saw_prize_ui_definition.acknowledge_dp_additional,\n\t\t\t\t\tacknowledge_action_title_additional: p.saw_prize_ui_definition.acknowledge_action_title_additional,\n\t\t\t\t\tout_of_stock_message: p.saw_prize_ui_definition.out_of_stock_message,\n\t\t\t\t\tpool: p.pool,\n\t\t\t\t\tpool_initial: p.pool_initial,\n\t\t\t\t\twins_count: p.wins_count,\n\t\t\t\t\tweekdays: p.weekdays,\n\t\t\t\t\tactive_from_ts: p.active_from_ts,\n\t\t\t\t\tactive_till_ts: p.active_till_ts,\n\t\t\t\t\trelative_period_timezone: p.relative_period_timezone,\n\t\t\t\t\tis_surcharge: p.is_surcharge,\n\t\t\t\t\tis_deleted: p.is_deleted,\n\t\t\t\t\tcustom_data: IntUtils.JsonOrText(p.saw_prize_ui_definition?.custom_data),\n\t\t\t\t\tprize_modifiers: p.saw_prize_ui_definition.prize_modifiers,\n\t\t\t\t\tallow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,\n\t\t\t\t\thide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history,\n\t\t\t\t\trequirements_to_get_prize: p.saw_prize_ui_definition.requirements_to_get_prize,\n\t\t\t\t\tmax_give_period_type_id: p.max_give_period_type_id,\n\t\t\t\t};\n\t\t\t\treturn y;\n\t\t\t}),\n\t\t};\n\t\treturn x;\n\t});\n};\n","/*\n * Possible error codes for the mini-games attempts\n */\nexport enum SAWSpinErrorCode {\n\t/** No error */\n\tSAW_OK = 0,\n\t/** User doesn't have 'spin attempts' to play. In case buy in type for the game is 'spins' based */\n\tSAW_NO_SPINS = 40001,\n\t/** The are no prizes left to play the game */\n\tSAW_PRIZE_POOL_EMPTY = 40002,\n\t/** User doesn't have enough points to play. In case buy in type for the game is 'points' based */\n\tSAW_NOT_ENOUGH_POINTS = 40003,\n\t/** User reached max number of game attempts defined in the BackOffice */\n\tSAW_FAILED_MAX_SPINS_REACHED = 40004,\n\t/** User tries to play a template that is restricted by date */\n\tSAW_TEMPLATE_NOT_ACTIVE = 40007,\n\t/** Special code for the 'visitor' mode */\n\tSAW_VISITOR_STOP_SPIN_REQUEST = -40001,\n\t/** User is not in the segment */\n\tSAW_NOT_IN_SEGMENT = 40009,\n\t/** User doesn't have enough gems to play. In case buy in type for the game is 'gems' based */\n\tSAW_NO_BALANCE_GEMS = 40011,\n\t/** User doesn't have enough diamonds to play. In case buy in type for the game is 'diamonds' based */\n\tSAW_NO_BALANCE_DIAMONDS = 40012,\n}\n","export enum SAWWinSoundType {\n\tDisappointing = 1,\n\tPositive = 2,\n\tHighlyPositive = 3,\n\tNoSound = 4,\n\tCustom = 5,\n}\n\nexport const SAWWinSoundFiles = {\n\t[SAWWinSoundType.NoSound]: null,\n\t[SAWWinSoundType.Disappointing]: 'saw-disappointed.m4a',\n\t[SAWWinSoundType.Positive]: 'saw-positive.m4a',\n\t[SAWWinSoundType.HighlyPositive]: 'saw-highly-positive.m4a',\n};\n","import { ProtocolResponse } from \"../SmarticoLib\";\nimport { TSawHistory } from \"../WSAPI/WSAPITypes\";\nimport { SAWTemplate } from \"./SAWTemplate\";\n\nexport interface SAWWinningHistoryResponse extends ProtocolResponse {\n\tprizes: SAWPrizesHistory[];\n\thasMore: boolean;\n}\n\nexport interface SAWPrizesHistory {\n\ttemplate: SAWTemplate,\n\tsaw_template_id: number,\n\tsaw_prize_id: number,\n\tprize_amount: number,\n\tclient_request_id: string,\n\tis_claimed: boolean,\n\tcreate_date_ts: number;\n\tacknowledge_date_ts: number;\n}\n\nexport const SAWHistoryTransform = (items: SAWPrizesHistory[]): TSawHistory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TSawHistory = {\n\t\t\ttemplate: r.template,\n\t\t\tsaw_template_id: r.saw_template_id,\n\t\t\tsaw_prize_id: r.saw_prize_id,\n\t\t\tprize_amount: r.prize_amount,\n\t\t\tclient_request_id: r.client_request_id,\n\t\t\tis_claimed: r.is_claimed,\n\t\t\tcreate_date_ts: r.create_date_ts,\n\t\t\tacknowledge_date_ts: r.acknowledge_date_ts,\n\t\t}\n\t\treturn x;\n\t})\n}\n\n","export enum PrizeModifiers {\n '2x' = 1,\n '5x' = 2,\n '10x' = 3,\n '/2' = 4,\n '/5' = 5,\n '/10' = 6,\n '0x' = 7,\n \"reset\" = 8,\n}\n\nexport const PrizeModifiersKeysNames = {\n [PrizeModifiers['2x']]: '2x',\n [PrizeModifiers['5x']]: '5x',\n [PrizeModifiers['10x']]: '10x',\n [PrizeModifiers['/2']]: '/2',\n [PrizeModifiers['/5']]: '/5',\n [PrizeModifiers['/10']]: '/10',\n [PrizeModifiers['0x']]: '0',\n [PrizeModifiers['reset']]: 'Reset to 0',\n};","export enum SAWWheelLayout {\n Centered = 1,\n LeftAligned = 2,\n RightAligned = 3,\n BottomAligned = 4,\n}","export enum SAWGameDifficultyType {\n\tEASY = 1,\n\tMEDIUM = 2,\n\tHARD = 3,\n}\n\nexport enum SAWGameDifficultyTypeName {\n\tEASY = 'easy',\n\tMEDIUM = 'medium',\n\tHARD = 'hard',\n}\n\n/** @hidden */\nexport const SawGameDifficultyTypeNamed = (type: SAWGameDifficultyType): SAWGameDifficultyTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWGameDifficultyType.EASY]: SAWGameDifficultyTypeName.EASY,\n\t\t\t[SAWGameDifficultyType.MEDIUM]: SAWGameDifficultyTypeName.MEDIUM,\n\t\t\t[SAWGameDifficultyType.HARD]: SAWGameDifficultyTypeName.HARD,\n\t\t}[type]\n\t);\n};\n","export enum AttemptPeriodType {\n\tFromLastAttempt = 1,\n\tCalendarDaysUTC = 2,\n\tCalendarDaysUserTimeZone = 3,\n\tLifetime = 4,\n}","class NodeCache {\n\tprivate ttlChecker: NodeJS.Timeout;\n\n\tprivate cache: { [key: string]: any } = {};\n\n\tconstructor() {\t\t\n\t\tif (this.ttlChecker === undefined) {\n\t\t\tthis.ttlChecker = setInterval(() => {\n\t\t\t\tconst now = new Date().getTime();\n\t\t\t\tfor (const key in this.cache) {\n\t\t\t\t\tif (this.cache.hasOwnProperty(key)) {\n\t\t\t\t\t\tconst o = this.cache[key];\n\t\t\t\t\t\tif (o.ttl < now) {\n\t\t\t\t\t\t\tdelete this.cache[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\n\tpublic get(key: string): any {\n\t\tconst o = this.cache[key];\n\t\tif (o !== undefined && o.ttl > new Date().getTime()) {\n\t\t\treturn o.value;\n\t\t}\n\t}\n\n\tpublic set(key: string, value: any, ttlSeconds: number = 60) {\n\t\tthis.cache[key] = {\n\t\t\tvalue,\n\t\t\tttl: new Date().getTime() + ttlSeconds * 1000,\n\t\t};\n\t}\n\n\tpublic remove(key: string) {\n\t\tif (this.cache.hasOwnProperty(key)) {\n\t\t\tdelete this.cache[key];\n\t\t}\n\t}\n\n\tpublic flushAll() {\n\t\tthis.cache = {};\n\t\tif (this.ttlChecker) {\n\t\t\tclearInterval(this.ttlChecker);\n\t\t\tthis.ttlChecker = undefined\n\t\t}\n\t}\n}\n\nexport { NodeCache };\n","import { NodeCache } from './NodeCache';\n\nexport enum ECacheContext {\n\tTranslations,\n\tLabelInfo,\n\tWSAPI,\n}\n\nconst WITH_REF_CACHE = [ECacheContext.Translations];\n\nexport class OCache {\n\tprivate static cache: { [key: string]: NodeCache } = {};\n\n\tprivate static init(cacheContext: ECacheContext) {\n\t\tif (this.cache[cacheContext] === undefined) {\n\t\t\tthis.cache[cacheContext] = new NodeCache();\n\t\t}\n\t}\n\n\tpublic static get<T>(oKey: any, cacheContext: ECacheContext): T | undefined {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tthis.init(cacheContext);\n\n\t\treturn deepClone(this.cache[cacheContext].get(key));\n\t}\n\n\tpublic static set(oKey: any, o: any, cacheContext: ECacheContext, ttlSeconds: number = 60) {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tthis.init(cacheContext);\n\n\t\tthis.cache[cacheContext].set(key, deepClone(o), ttlSeconds);\n\t}\n\n\tpublic static async use<T>(oKey: any, cacheContext: ECacheContext, f: () => Promise<T>, ttlSeconds: number = 60) {\n\t\tif (ttlSeconds <= 0) {\n\t\t\treturn await f();\n\t\t} else {\n\t\t\tlet o: T = OCache.get(oKey, cacheContext);\n\n\t\t\tif (o === undefined) {\n\t\t\t\to = await f();\n\t\t\t\tOCache.set(oKey, o, cacheContext, ttlSeconds);\n\t\t\t}\n\n\t\t\treturn o;\n\t\t}\n\t}\n\n\tpublic static async clear(cacheContext: ECacheContext, oKey: any) {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tif (this.cache[cacheContext]) {\n\t\t\tthis.cache[cacheContext].remove(key);\n\t\t}\n\t}\n\n\tpublic static async clearContext(cacheContext: ECacheContext) {\n\t\tif (this.cache[cacheContext]) {\n\t\t\tthis.cache[cacheContext].flushAll();\n\t\t}\n\t}\n\n\tpublic static async clearAll() {\n\t\tfor (const cacheContext in this.cache) {\n\t\t\tif (this.cache.hasOwnProperty(cacheContext)) {\n\t\t\t\tthis.cache[cacheContext].flushAll();\n\t\t\t}\n\t\t}\n\t\tthis.cache = {};\n\t}\n}\n\nconst deepClone = (o: any) => {\n\tif (o) {\n\t\treturn JSON.parse(JSON.stringify(o));\n\t}\n\n\treturn o;\n};\n","export enum ActivityTypeLimited {\n\tDoNothing = 8,\n\tPoints = 12,\n\tGiveMission = 14,\n\tStartAnotherCampaign = 15,\n\tMiniGameAttempt = 16,\n\tDeductPoints = 21,\n\tResetPoints = 22,\n\tAddGemsAndDiamonds = 25,\n\tDeductGemsAndDiamonds = 26,\n\tResetGemsAndDiamonds = 27,\n\tPopup = 30,\n\tInbox = 31,\n\tSlack = 70,\n\tEmail_To_Customer_Support = 80,\n\tEmail_To_Risk_Operator = 90,\n\tBonus = 100,\n\tWebHook = 200,\n\tTagCustomer = 504,\n\tUnTagCustomer = 505,\n}\n","class CoreUtils {\n\tpublic static avatarUrl = (avatar_id: string, avatarDomain: string): string => {\n\t\tif (\n\t\t\tavatarDomain &&\n\t\t\tavatar_id !== null &&\n\t\t\tavatar_id !== undefined &&\n\t\t\t!(avatar_id.startsWith && avatar_id.startsWith('http'))\n\t\t) {\n\t\t\tif (avatarDomain.endsWith('/')) {\n\t\t\t\treturn avatarDomain.slice(0, -1) + '/avatar/' + avatar_id;\n\t\t\t} else {\n\t\t\t\treturn avatarDomain + '/avatar/' + avatar_id;\n\t\t\t}\n\t\t} else {\n\t\t\treturn avatar_id;\n\t\t}\n\t};\n\n\tpublic static currencySymbol(currency: string) {\n\t\treturn {\n\t\t\t[currency?.toUpperCase()]: currency?.toUpperCase(),\n\t\t\tUSD: '$', // United States Dollar\n\t\t\tEUR: '\\u20AC', // Euro\n\t\t\tJPY: '\\u00A5', // Japanese Yen\n\t\t\tGBP: '\\u00A3', // British Pound Sterling\n\t\t\tAUD: 'A$', // Australian Dollar\n\t\t\tCAD: 'C$', // Canadian Dollar\n\t\t\tCHF: 'CHF', // Swiss Franc\n\t\t\tCNY: '\\u00A5', // Chinese Yuan\n\t\t\tSEK: 'kr', // Swedish Krona\n\t\t\tNZD: 'NZ$', // New Zealand Dollar\n\t\t\tMXN: 'MX$', // Mexican Peso\n\t\t\tSGD: 'S$', // Singapore Dollar\n\t\t\tHKD: 'HK$', // Hong Kong Dollar\n\t\t\tNOK: 'kr', // Norwegian Krone\n\t\t\tKRW: '\\u20A9', // South Korean Won\n\t\t\tTRY: '\\u20BA', // Turkish Lira\n\t\t\tINR: '\\u20B9', // Indian Rupee\n\t\t\tRUB: '\\u20BD', // Russian Ruble\n\t\t\tBRL: 'R$', // Brazilian Real\n\t\t\tZAR: 'R', // South African Rand\n\t\t}[currency?.toUpperCase()];\n\t}\n}\n\nexport { CoreUtils };\n","export enum PublicLabelSettings {\n\tPUBLIC_API_URL = 'PUBLIC_API_URL',\n\tRECORDING_ENABLED_FOR_ALL_USERS = 'RECORDING_ENABLED_FOR_ALL_USERS',\n\tJS_INJECTION = 'JS_INJECTION',\n\tGAMIFICATION_UI_MAIN = 'GAMIFICATION_UI_MAIN',\n\tGAMIFICATION_UI_WIDGET = 'GAMIFICATION_UI_WIDGET',\n\tGAMIFICATION_UI_MINI_GAME = 'GAMIFICATION_UI_MINI_GAME',\n\tGAMIFICATION_UI_SETTINGS = 'GAMIFICATION_UI_SETTINGS',\n\tGAMIFICATION_UI_MAIN_TEST = 'GAMIFICATION_UI_MAIN_TEST',\n\tGAMIFICATION_UI_WIDGET_TEST = 'GAMIFICATION_UI_WIDGET_TEST',\n\tGAMIFICATION_UI_SETTINGS_TEST = 'GAMIFICATION_UI_SETTINGS_TEST',\n\tFRONT_END_ALLOWED_LANGUAGES = 'FRONT_END_ALLOWED_LANGUAGES',\n\tFRONT_END_ALLOW_DOMAINS = 'FRONT_END_ALLOW_DOMAINS',\n\tDELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS = 'DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS',\n\tSHADOW_LABEL_PUBLIC_KEY = 'SHADOW_LABEL_PUBLIC_KEY',\n\tDYNAMIC_IMAGE_DOMAIN = 'DYNAMIC_IMAGE_DOMAIN',\n\n\tGAMIFICATION_LEVELS_LOGIC2 = 'GAMIFICATION_LEVELS_LOGIC2',\n\tGAMIFICATION_LEVELS_LOGIC3 = 'GAMIFICATION_LEVELS_LOGIC2',\n\n\tAVATAR_CUSTOM_IMAGE_MAX_ID = 'AVATAR_CUSTOM_IMAGE_MAX_ID',\n\tAVATAR_CUSTOM_IMAGE_FOLDER = 'AVATAR_CUSTOM_IMAGE_FOLDER',\n\n\tGAMIFICATION_SHOW_POWERED_BY = 'GAMIFICATION_SHOW_POWERED_BY',\n\t_system_leader_board_mask_username = '_system_leader_board_mask_username',\n\t_system_gamification_mask_username = '_system_gamification_mask_username',\n\n\tINBOX_PUBLIC_CDN = 'INBOX_PUBLIC_CDN',\n}\n","enum TranslationArea {\n\tCasino = 1,\n\tGamification = 2,\n\tTrading = 3,\n\tArchived = 4,\n\tAffiliation = 5,\n\tRetentionGames = 6,\n\tAffIliateAdminNew = 7,\n\tAcademy = 8,\n}\n\nexport { TranslationArea };\n","import { TInboxMessage } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { InboxMessage } from './InboxMessage';\n\nexport interface GetInboxMessagesResponse extends ProtocolResponse {\n\tlog: InboxMessage[];\n\tunread_count: number;\n}\n\nexport const InboxMessagesTransform = (items: InboxMessage[]): TInboxMessage[] => {\n\treturn items.map((item) => {\n\t\tconst x: TInboxMessage = {\n\t\t\tsent_date: item.createDate,\n\t\t\tmessage_guid: item.engagement_uid,\n\t\t\tread: item.is_read,\n\t\t\tfavorite: item.is_starred,\n\t\t\tcategory_id: item.category_id,\n\t\t\texpire_on_dt: item.expire_on_dt,\n\t\t};\n\t\treturn x;\n\t});\n};\n","import { IntUtils } from '../IntUtils';\nimport { TInboxMessageBody } from '../WSAPI/WSAPITypes';\nimport { InboxCategories } from './InboxCategories';\nimport { InboxMessageType } from './InboxMessageType';\nimport { OpenLinksType } from './OpenLinksType';\n\nexport interface InboxMessageBody {\n\t// URL or deep-link that neeed to be executed when user clicks on the message\n\taction: string;\n\t// the body of the message in case it's 'simple' inbox message\n\tbody: string;\n\t// type of message, deprecated\n\ttype: InboxMessageType;\n\t// image of the icon\n\timage: string;\n\t// title of the message\n\ttitle: string;\n\t// HTML body of the message in case it's 'rich' inbox message\n\thtml_body: string;\n\t// set of the buttons with text on the button and action that could be URL or deep-link\n\tadditional_buttons?: { inbox_cta_text: string; action: string }[];\n\t// indicator if the message need to be shown when sent and overlay or it should be shown only in the inbox, when user open 'inbox' interface explicitly\n\t// default is 'true'\n\tshow_preview?: boolean;\n\t// duration in seconds for how long to show preview, default is 7 seconds\n\tshow_duration_sec?: number;\n\t// indicator if the image in html_body can be zoomed out\n\t// default is 'false'\n\tenable_zoom_mode?: boolean;\n\t// options that allows to open links in buttons either in new window or in the current one\n\topen_links?: OpenLinksType;\n\t// The custom data of the inbox message defined by operator. Can be a JSON object, string or number\n\tcustom_data?: string;\n}\n\nexport interface InboxMessage {\n\t// date when the message was created\n\tcreateDate: string;\n\t// body of the message according to the interface\n\tbody: InboxMessageBody;\n\t// unique identifier of the message that connects it to the campaign from which it was sent\n\tengagement_uid: string;\n\t// flag that indicates if the message was read by the user\n\tis_read: boolean;\n\t// flag that indicates if the message was marked as favorite by the user\n\tis_starred: boolean;\n\t// flag that indicates if the message was deleted by the user. Such messages are not returned in the response and property is used only internaly in Smartico\n\tis_deleted?: boolean;\n\t// category id of the inbox message, could be categorized as System/Personal/General messages in mentioned tabs\n\tcategory_id?: InboxCategories;\n\t// The epoch timestamp, with milliseconds, when the message is going to be expired \n\texpire_on_dt?: number;\n}\n\nexport const InboxMessageBodyTransform = (item: InboxMessageBody): TInboxMessageBody => {\n\tif (!item) {\n\t\treturn null;\n\t}\n\tconst x: TInboxMessageBody = {\n\t\taction: item.action,\n\t\ticon: item.image,\n\t\ttitle: item.title,\n\t\tpreview_body: item.body,\n\t\tcustom_data: IntUtils.JsonOrText(item?.custom_data),\n\t};\n\n\tif (item.action === 'dp:inbox') {\n\t\tif (item.additional_buttons && item.additional_buttons.length) {\n\t\t\tx.buttons = item.additional_buttons.map((b) => ({\n\t\t\t\taction: b.action,\n\t\t\t\ttext: b.inbox_cta_text,\n\t\t\t}));\n\t\t}\n\n\t\tx.html_body = item?.html_body || null;\n\t}\n\n\treturn x;\n};\n","export enum InboxMessageType {\n\tCustom = 0,\n\tMissionCompleted = 1,\n\tMissionUnlocked = 2,\n\tLeaderboardWon = 3,\n\tLevelChanged = 4,\n\tBonusGiven = 5,\n\tPointsAdded = 6,\n\tPointsUsed = 7,\n\tPersonalMessage = 8,\n}\n\n// keep in sync with BO enum\n","export enum OpenLinksType {\n\tNewWindow = 1,\n\tCurrentWindow = 2\n}","export enum InboxCategories {\n General = 0,\n\tPlatform = 1,\n\tPersonal = 2,\n}","export enum InboxReadStatus {\n\tUnreadOnly = 1,\n\tReadOnly = 2,\n}","export enum BuyStoreItemErrorCode {\n\t/** Generic server error / control-group rejection */\n\tSHOP_FAILED_GENERIC = 1,\n\t/** Label mismatch detected before purchase transaction */\n\tSHOP_WRONG_LABEL_PRECHECK = 106,\n\t/** User don't have enough points on balance */\n\tSHOP_NO_BALANCE = 11000,\n\t/** Wrong shop item id */\n\tSHOP_WRONG_LABEL = 11001,\n\t/** Failed to buy bonus item, probably something wrong with the bonus configuration. */\n\tSHOP_FAILED_TO_BUY_BONUS = 11002, // remote product restriction\n\t/** Failed to buy store item because segment conditions are set by operator for specific CRM item */\n\tSHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003, // when not visible but trying to buy. shouldn't happen\n\t/** Segment conditions are set by operator for specific CRM item and user not matching to this conditions */\n\tSHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004, // when visible but not matching to purchase segment\n\t/** Failed to buy matching bonus item */\n\tSHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,\n\t/** Failed to buy item because of limit of max items is reached */\n\tSHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006,\n\t/** Bonus was issued but a follow-up redemption step failed */\n\tSHOP_FAILED_BONUS_REDEMPTION = 11007,\n\t/** Failed to buy item because no more items are available */\n\tSHOP_FAILED_POOL_EMPTY = 11009,\n\t/** User doesn't have enough gems on balance */\n\tSHOP_NO_BALANCE_GEMS = 11011,\n\t/** User doesn't have enough diamonds on balance */\n\tSHOP_NO_BALANCE_DIAMONDS = 11012,\n\t/** Failed to buy item because of purchase limitation */\n\tSHOP_FAILED_PURCHASE_LIMITATION = 11014,\n\t/** Uncaught server exception */\n\tSHOP_UNEXPECTED_EXCEPTION = 9999,\n}\n","import { TStoreCategory } from '../WSAPI/WSAPITypes';\nimport { StoreCategoryPublicMeta } from './StoreCategoryPublicMeta';\n\nexport interface StoreCategory {\n\tid?: number;\n\tpublicMeta?: StoreCategoryPublicMeta;\n}\n\nexport const StoreCategoryTransform = (items: StoreCategory[]): TStoreCategory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TStoreCategory = {\n\t\t\tid: r.id,\n\t\t\tname: r.publicMeta?.name,\n\t\t\torder: r.publicMeta?.order,\n\t\t};\n\t\treturn x;\n\t});\n};\n","export enum StoreItemPurchaseType {\n Points = 0,\n Gems = 1,\n Diamonds = 2,\n}","export enum StoreItemType {\n\tBonus = 1,\n\tTangible = 2,\n\tMiniGameSpin = 3,\n\tChangeLevel = 4,\n\tPrizeDrop = 5,\n\tRaffleTicket = 6,\n}\n\nexport enum StoreItemTypeName {\n\tBonus = 'bonus',\n\tTangible = 'tangible',\n\tMiniGameSpin = 'minigamespin',\n\tChangeLevel = 'changelevel',\n\tPrizeDrop = 'prizedrop',\n\tRaffleTicket = 'raffleticket',\n\tUnknown = 'unknown',\n}\n\nexport const StoreItemTypeNamed = (type: StoreItemType): StoreItemTypeName => {\n\treturn (\n\t\t{\n\t\t\t[StoreItemType.Bonus]: StoreItemTypeName.Bonus,\n\t\t\t[StoreItemType.Tangible]: StoreItemTypeName.Tangible,\n\t\t\t[StoreItemType.MiniGameSpin]: StoreItemTypeName.MiniGameSpin,\n\t\t\t[StoreItemType.ChangeLevel]: StoreItemTypeName.ChangeLevel,\n\t\t\t[StoreItemType.PrizeDrop]: StoreItemTypeName.PrizeDrop,\n\t\t\t[StoreItemType.RaffleTicket]: StoreItemTypeName.RaffleTicket,\n\t\t}[type] || StoreItemTypeName.Unknown\n\t);\n};\n","import { AchRelatedGame } from '../Base/AchRelatedGame';\nimport { IntUtils } from '../IntUtils';\nimport { TStoreItem } from '../WSAPI/WSAPITypes';\nimport { StoreItemPublicMeta } from './StoreItemPublicMeta';\nimport { StoreItemPurchaseType } from './StoreItemPurchaseType';\nimport { StoreItemType, StoreItemTypeNamed } from './StoreItemType';\n\nexport interface StoreItem {\n\tid: number;\n\titemTypeId: StoreItemType;\n\titemPublicMeta: StoreItemPublicMeta;\n\tcategoryIds?: number[];\n\tcanBuy?: boolean;\n\tshopPool: number;\n\tactiveTillDate?: number;\n\trelatedGames?: AchRelatedGame[];\n}\n\nconst mapPurchaseType = (purchaseType: StoreItemPurchaseType) => {\n\tif (purchaseType === StoreItemPurchaseType.Points) {\n\t\treturn 'points';\n\t} else if (purchaseType === StoreItemPurchaseType.Gems) {\n\t\treturn 'gems';\n\t} else if (purchaseType === StoreItemPurchaseType.Diamonds) {\n\t\treturn 'diamonds';\n\t}\n\n\treturn 'points';\n};\n\nexport const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {\n\t\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TStoreItem = {\n\t\t\t\tid: r.id,\n\t\t\t\tname: r.itemPublicMeta.name,\n\t\t\t\tpurchase_type: mapPurchaseType(r.itemPublicMeta.purchase_type),\n\t\t\t\tprice: r.itemPublicMeta.price as any as number, // AA: strange why it's string\n\t\t\t\timage: r.itemPublicMeta.image_url,\n\t\t\t\tdescription: r.itemPublicMeta.description,\n\t\t\t\tribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,\n\t\t\t\tlimit_message: r.itemPublicMeta.limit_message,\n\t\t\t\tpurchase_limit_message: r.itemPublicMeta.purchase_limit_message,\n\t\t\t\tpriority: r.itemPublicMeta.priority ?? 0,\n\t\t\t\trelated_item_ids: r.itemPublicMeta.related_items,\n\t\t\t\thint_text: r.itemPublicMeta.hint_text,\n\t\t\t\ttype: StoreItemTypeNamed(r.itemTypeId),\n\t\t\t\tcan_buy: r.canBuy,\n\t\t\t\tcategory_ids: r.categoryIds ?? [],\n\t\t\t\tpool: r.shopPool,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.itemPublicMeta.custom_data),\n\t\t\t\tactive_till_date: r.activeTillDate,\n\t\t\t\tshow_timer: r.itemPublicMeta.show_timer,\n\t\t\t\tdiscounted_price: r.itemPublicMeta.discount_prize,\n\t\t\t\tdiscount_price_ribbon: r.itemPublicMeta.discount_prize_ribbon,\n\t\t\t\tcustom_ribbon_image: r.itemPublicMeta.custom_ribbon_image,\n\t\t\t\tcustom_section_id: r.itemPublicMeta.custom_section_id,\n\t\t\t\tonly_in_custom_section: r.itemPublicMeta.only_in_custom_section,\n\t\t\t\tcustom_section_type_id: r.itemPublicMeta.custom_section_type_id,\n\t\t\t\t...(r.itemPublicMeta.cant_buy_message ? { cant_buy_message: r.itemPublicMeta.cant_buy_message } : {}),\n\t\t\t\trelated_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t};\n\t\t\treturn x;\n\t\t});\n};\n","import { IntUtils } from '../IntUtils';\nimport { TStoreItem } from '../WSAPI/WSAPITypes';\nimport { StoreItem } from './StoreItem';\nimport { StoreItemPurchaseType } from './StoreItemPurchaseType';\nimport { StoreItemTypeNamed } from './StoreItemType';\n\ninterface StoreItemPurchased extends StoreItem {\n\tpurchase_ts: number;\n\tpurchase_points_amount: number;\n\tpurchased_today?: boolean;\n\tpurchased_this_week?: boolean;\n\tpurchased_this_month?: boolean;\n}\n\nconst mapPurchaseType = (purchaseType: StoreItemPurchaseType) => {\n\tif (purchaseType === StoreItemPurchaseType.Points) {\n\t\treturn 'points';\n\t} else if (purchaseType === StoreItemPurchaseType.Gems) {\n\t\treturn 'gems';\n\t} else if (purchaseType === StoreItemPurchaseType.Diamonds) {\n\t\treturn 'diamonds';\n\t}\n\n\treturn 'points';\n};\n\nexport const StoreItemPurchasedTransform = (items: StoreItemPurchased[]): TStoreItem[] => {\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst purchasedToday = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'today') : false;\n\t\t\tconst purchasedThisWeek = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisWeek') : false;\n\t\t\tconst purchasedThisMonth = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisMonth') : false;\n\n\t\t\tconst x: TStoreItem = {\n\t\t\t\tid: r.id,\n\t\t\t\tname: r.itemPublicMeta.name,\n\t\t\t\tprice: r.itemPublicMeta.price as any as number, // AA: strange why it's string\n\t\t\t\tpurchase_type: mapPurchaseType(r.itemPublicMeta.purchase_type),\n\t\t\t\timage: r.itemPublicMeta.image_url,\n\t\t\t\tdescription: r.itemPublicMeta.description,\n\t\t\t\tribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,\n\t\t\t\tlimit_message: r.itemPublicMeta.limit_message,\n\t\t\t\tpurchase_limit_message: r.itemPublicMeta.purchase_limit_message,\n\t\t\t\tpriority: r.itemPublicMeta.priority ?? 0,\n\t\t\t\trelated_item_ids: r.itemPublicMeta.related_items,\n\t\t\t\thint_text: r.itemPublicMeta.hint_text,\n\t\t\t\ttype: StoreItemTypeNamed(r.itemTypeId),\n\t\t\t\tcan_buy: r.canBuy,\n\t\t\t\tcategory_ids: r.categoryIds ?? [],\n\t\t\t\tpool: r.shopPool,\n\t\t\t\tpurchase_ts: r.purchase_ts,\n\t\t\t\tpurchase_points_amount: r.purchase_points_amount,\n\t\t\t\tpurchased_today: purchasedToday,\n\t\t\t\tpurchased_this_week: purchasedThisWeek,\n\t\t\t\tpurchased_this_month: purchasedThisMonth,\n\t\t\t\tcustom_data: r.itemPublicMeta.custom_data,\n\t\t\t\tshow_timer: r.itemPublicMeta.show_timer,\n\t\t\t\trelated_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t};\n\n\t\t\treturn x;\n\t\t});\n};\n\nexport { StoreItemPurchased };\n","export enum AchievementStatus {\n\tDraft = 1,\n\tAvailableUnlocked = 2,\n\tAvailableLocked = 3,\n\tArchived = 4,\n\tFeaturedManually = 5,\n\tFeaturedAI = 6,\n\tRecurring = 7,\n\tRecurringUponCompletion = 8\n}\n","export enum AchievementTaskType {\n\tCompleteAchievement = 1,\n\tUnlockAchievement = 2,\n}\n","export enum AchievementType {\n\tMission = 1,\n\tBadge = 2,\n}\n","/** Possible statuses of the mission availability. \n * Notes:\n * - Recurring missions have a special field next_recurrence_date_ts, but it's only relevant if the mission has no active till date or the next recurrence date is before the active till date.\n * - For a locked mission or mission that requires opt-in, the time limit should be calculated as dt_start + time_limit_ms. For a mission that does not require opt-in or type is not Locked, it should be the highest value of dt_start and active_from_ts (if defined) + time_limit_ms.\n * */\n\nexport enum AchievementAvailabilityStatus {\n /** Mission without date/time restrictions or with passed active from date and no opt-in required and mission is unlocked */\n Available = 0,\n\n /** Mission without date/time restrictions or with passed active from date, opt-in is required, user is not opted-in or mission is locked */\n AvailableInactive = 1,\n\n /** Mission without date/time restrictions or with passed active from date, opt-in is required, user is opted-in or mission is unlocked*/\n AvailableActive = 2,\n\n /** Mission with active from date defined, date is in future.\n * Field: active_from_ts\n */\n UnavailableWithActiveFrom = 3,\n\n /** Mission with active till date defined, date is in future, and no opt-in required and mission is unlocked.\n * Field: active_till_ts\n */\n AvailableWithActiveTill = 4,\n\n /** Mission with active till date defined, date is in future, and opt-in is required, user is not opted in or mission is locked.\n * Fields: active_till_ts, is_requires_optin, is_opted_in, is_locked.\n */\n AvailableWithActiveTillInactive = 5,\n\n /** Mission with active till date defined, date is in future, and opt-in is required, user is opted in or mission is unlocked.\n * Fields: active_till_ts, is_requires_optin, is_opted_in, is_locked.\n */\n AvailableWithActiveTillActive = 6,\n\n /** Available mission with time limit, and opt-in is required or mission is unlocked.\n * The time limit is calculated as the sum of two properties: (highest value from dt_start and active_from_ts) + time_limit_ms.\n * \n */\n AvailableLimited = 7,\n\n /** Available mission with time limit, opt-in is required, user is not opted-in or mission is locked.\n * Time limit at this stage is not relevant, user should be opted-in or mission should be unlocked.\n */\n AvailableLimitedInactive = 8,\n\n /** Available mission with time limit, opt-in is required, user is opted-in or mission unlocked.\n * The time limit is calculated as the sum of two properties: dt_start + time_limit_ms.\n */\n AvailableLimitedActive = 9,\n\n /** Available mission with time limit and active till date, opt-in is not required and mission is unlocked.\n * Fields: active_till_ts, time_limit_ms, dt_start, active_from_ts;\n * The time limit is calculated as the sum of two properties: (highest value from dt_start and active_from_ts) + time_limit_ms.\n */\n AvailableFullyLimited = 10,\n\n /** Available mission with time limit and active till date, opt-in is required, user is not opted in or mission is locked.\n * Fields: active_till_ts, time_limit_ms, dt_start, active_from_ts, is_requires_optin, is_opted_in, is_locked.\n * On this stage only active_till_ts is relevant. time_limit_ms is ignored because user should be opted in.\n */\n AvailableFullyLimitedInactive = 11,\n\n /** Available mission with time limit and active till date, opt-in is required, user is opted in or mission is unlocked.\n * Fields: active_till_ts, time_limit_ms, dt_start, is_requires_optin, is_opted_in, is_locked.\n * The time limit is calculated as the sum of two properties: dt_start + time_limit_ms.\n */\n AvailableFullyLimitedActive = 12,\n\n /** Missed mission when active till date is already passed. is_completed field indicating if mission is completed or just missed */\n MissedByActiveTill = 13,\n\n /** Missed mission when start_date + time_limit_ms is already passed. is_completed field indicating if mission is completed or just missed */\n MissedByLimitInTime = 14,\n}","export enum BadgesTimeLimitStates {\n\t/** Before Start Date */\n\tBeforeStartDate = 0,\n\t/** After Start Date but before earned */\n\tAfterStartDateNoProgress = 1,\n\t/** After Start Date but before started (no progress) + End date */\n\tAfterStartDateNoProgressAndEndDate = 2,\n\t/** After Start Date, but with some progress + End date */\n\tAfterStartDateWithProgressAndEndDate = 3,\n\t/** After End Date (not started) */\n\tAfterEndDateNotStarted = 4,\n\t/** After End Date (player has some progress, but not completed) */\n\tAfterEndDateWithProgress = 5,\n}\n\n","import { IntUtils } from \"../IntUtils\";\nimport { AchievementAvailabilityStatus } from \"./AchievementAvailabilityStatus\";\nimport { AchievementStatus } from \"./AchievementStatus\";\nimport { UserAchievement } from \"./UserAchievement\";\nimport { UserAchievementTask } from \"./UserAchievementTask\";\nimport { BadgesTimeLimitStates } from \"./BadgesTimeLimitStates\";\n\ntype UserStateParamsKeys = 'core_fav_game_top3' | 'core_fav_game_type_top3' | 'core_fav_game_provider_top3' | 'core_recommended_deposit_amount' | 'core_recommended_casino_bet_amount';\nconst USER_STATE_PARAMS_KEYS_GAMES: UserStateParamsKeys[] = ['core_fav_game_top3', 'core_fav_game_type_top3', 'core_fav_game_provider_top3'];\nconst USER_STATE_PARAMS_KEYS_BET_AMOUNT: UserStateParamsKeys[] = [\n 'core_recommended_deposit_amount',\n 'core_recommended_casino_bet_amount',\n];\n\nconst MINOR_WORDS = new Set([\n 'of', 'at', 'in', 'on', 'to', 'up', 'as', 'by', 'for',\n 'from', 'into', 'onto', 'with', 'upon', 'via',\n 'and', 'but', 'or', 'nor', 'so', 'yet',\n 'vs', 'v',\n 'a', 'an', 'the',\n]);\n\nfunction toGameTitleCase(raw: string): string {\n if (!raw) return raw;\n const tokens = raw.toLowerCase().split(/(\\b\\w+\\b)/);\n const wordTokens = tokens.filter((t) => /^\\w+$/.test(t));\n const lastWordIdx = wordTokens.length - 1;\n let wordIndex = 0;\n return tokens\n .map((token) => {\n if (!/^\\w+$/.test(token)) return token;\n const isFirst = wordIndex === 0;\n const isLast = wordIndex === lastWordIdx;\n wordIndex++;\n if (isFirst || isLast || !MINOR_WORDS.has(token)) {\n return token.charAt(0).toUpperCase() + token.slice(1);\n }\n return token;\n })\n .join('');\n}\n\nexport class MissionUtils {\n\n public static getAvailabilityStatus = (mission: UserAchievement) => {\n\n if (!mission) {\n return null;\n }\n\n const activeFrom = mission.active_from_ts ? MissionUtils.getMs(mission.active_from_ts) : null\n const activeTill = mission.active_till_ts ? MissionUtils.getMs(mission.active_till_ts) : null;\n const startDate = mission.start_date_ts ? MissionUtils.getMs(mission.start_date_ts) : null;\n const timeLimit = mission.time_limit_ms;\n const requiresOptIn = mission.requiresOptin;\n const optedIn = mission.isOptedIn;\n const isLockedMission = mission.ach_status_id === AchievementStatus.AvailableLocked;\n const isLocked = mission.isLocked;\n\n if (!activeFrom && !activeTill && !timeLimit) {\n if (requiresOptIn) {\n if (optedIn) {\n return AchievementAvailabilityStatus.AvailableActive;\n } else {\n return AchievementAvailabilityStatus.AvailableInactive;\n }\n } else if (isLockedMission) {\n if (!isLocked) {\n return AchievementAvailabilityStatus.AvailableActive;\n } else {\n return AchievementAvailabilityStatus.AvailableInactive;\n }\n } else {\n return AchievementAvailabilityStatus.Available;\n }\n }\n\n if (activeFrom && activeFrom > Date.now()) {\n return AchievementAvailabilityStatus.UnavailableWithActiveFrom;\n }\n\n if ((activeFrom && activeFrom < Date.now()) || !activeFrom) {\n if (!activeTill && !timeLimit) {\n if (requiresOptIn) {\n if (optedIn) {\n return AchievementAvailabilityStatus.AvailableActive;\n } else {\n return AchievementAvailabilityStatus.AvailableInactive;\n }\n } else if (isLockedMission) {\n if (!isLocked) {\n return AchievementAvailabilityStatus.AvailableActive;\n } else {\n return AchievementAvailabilityStatus.AvailableInactive;\n }\n } else {\n return AchievementAvailabilityStatus.Available;\n }\n }\n\n if (activeTill && !timeLimit) {\n if (activeTill > Date.now()) {\n if (requiresOptIn) {\n if (optedIn) {\n return AchievementAvailabilityStatus.AvailableWithActiveTillActive;\n } else {\n return AchievementAvailabilityStatus.AvailableWithActiveTillInactive;\n }\n } else if (isLockedMission) {\n if (!isLocked) {\n return AchievementAvailabilityStatus.AvailableWithActiveTillActive;\n } else {\n return AchievementAvailabilityStatus.AvailableWithActiveTillInactive;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableWithActiveTill;\n }\n } else {\n return AchievementAvailabilityStatus.MissedByActiveTill;\n }\n }\n\n if (timeLimit && !activeTill) {\n if (requiresOptIn) {\n const endDate = startDate + timeLimit;\n\n if (optedIn) {\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableLimitedActive;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableLimitedInactive;\n }\n } else if (isLockedMission) {\n const endDate = startDate + timeLimit;\n\n if (!isLocked) {\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableLimitedActive;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableLimitedInactive;\n }\n } else {\n const endDate = activeFrom && activeFrom > startDate ? activeFrom + timeLimit : startDate + timeLimit;\n\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableLimited;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n }\n }\n\n if (timeLimit && activeTill) {\n if (activeTill > Date.now()) {\n if (requiresOptIn) {\n if (optedIn) {\n const endDate = startDate + timeLimit;\n\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableFullyLimitedActive;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableFullyLimitedInactive;\n }\n } else if (isLockedMission) {\n if (!isLocked) {\n const endDate = startDate + timeLimit;\n\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableFullyLimitedActive;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableFullyLimitedInactive;\n }\n } else {\n const endDate = activeFrom && activeFrom > startDate ? activeFrom + timeLimit : startDate + timeLimit;\n\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableFullyLimited;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n }\n } else {\n return AchievementAvailabilityStatus.MissedByActiveTill;\n }\n }\n }\n }\n\n public static getMs = (ts: number): number => {\n return new Date(ts).getTime();\n }\n\n public static replaceTagsFavMissionTask = ({ task, valueToReplace, currencySymbol }: { task: UserAchievementTask, valueToReplace: string, currencySymbol?: string }): string => {\n let result = valueToReplace || '';\n\n if (!task) {\n return result;\n }\n\n const userStateParams = (task.user_state_params || {});\n const userStateOperator = task.task_public_meta?.user_state_operations;\n const userStateParamsKeys = Object.keys(userStateParams);\n\n if (userStateParamsKeys.length === 0 || !userStateOperator) {\n return result;\n }\n\n const operatorsMulti = ['has', '!has'];\n const operatorsPos = ['pos1', 'pos2', 'pos3'];\n\n let suggestedGames: string = '';\n let suggestedValue: string = '';\n\n userStateParamsKeys.forEach((k: UserStateParamsKeys) => {\n const operator = userStateOperator[k]?.op;\n\n if (USER_STATE_PARAMS_KEYS_GAMES.includes(k)) {\n if (operatorsMulti.includes(operator)) {\n const value = userStateParams[k]?.filter(v => Boolean(v));\n if (value && value.length > 0) {\n suggestedGames = value.map((v: string) => {\n const cleaned = v.replace(/_/g, ' ');\n return toGameTitleCase(cleaned);\n }).join(', ');\n }\n }\n\n if (operatorsPos.includes(operator)) {\n const value = userStateParams[k];\n const pos = Number(operator.replace('pos', '')) - 1;\n\n if (IntUtils.isNotNull(pos) && value && value[pos]) {\n suggestedGames = value[pos];\n\n if (suggestedGames) {\n suggestedGames = toGameTitleCase(suggestedGames.replace(/_/g, ' '));\n }\n\n }\n }\n }\n\n if (USER_STATE_PARAMS_KEYS_BET_AMOUNT.includes(k)) { \n suggestedValue = userStateParams[k];\n\n if (suggestedValue) {\n const currencyFromTheTask = userStateParams?.core_wallet_currency;\n\n suggestedValue = `${suggestedValue} ${currencySymbol || currencyFromTheTask || ''}`;\n }\n }\n });\n\n if (suggestedGames && result) {\n result = result.replace('{{suggested_games}}', suggestedGames);\n }\n\n if (suggestedValue && result) {\n result = result.replace('{{suggested_value}}', suggestedValue);\n }\n\n return result;\n }\n\n public static replaceFavGameNameTag = ({ task, currencySymbol }: { task: UserAchievementTask, currencySymbol?: string }): UserAchievementTask => {\n if (task && task.task_public_meta && task.task_public_meta.name) {\n task.task_public_meta.name = MissionUtils.replaceTagsFavMissionTask({ task, valueToReplace: task.task_public_meta.name, currencySymbol });\n }\n\n return task;\n }\n\n public static determineBadgeState = (badge: UserAchievement): BadgesTimeLimitStates | null => {\n const now = Date.now();\n const { active_from_ts, active_till_ts, progress, isCompleted, complete_date_ts } = badge;\n\n // If badge is completed before active till date, return null\n if (isCompleted && (!active_till_ts || complete_date_ts < active_till_ts)) {\n return null;\n }\n \n // 1. BEFORE START\n if (active_from_ts > now) {\n return BadgesTimeLimitStates.BeforeStartDate;\n }\n \n // 2. AFTER START, NO END DATE (infinite badge)\n // → grey, no locked, no date chip\n if (!active_till_ts) {\n if (progress === 0) {\n return BadgesTimeLimitStates.AfterStartDateNoProgress;\n }\n // If infinite and with progress → this state does not exist in enum\n // (but if needed we can add one)\n }\n \n // 3. AFTER START, BEFORE END DATE\n if (now < active_till_ts) {\n if (progress === 0) {\n // now < end + has end date → must show chip\n return BadgesTimeLimitStates.AfterStartDateNoProgressAndEndDate;\n }\n \n return BadgesTimeLimitStates.AfterStartDateWithProgressAndEndDate;\n }\n \n // 4. AFTER END DATE\n if (progress === 0) {\n return BadgesTimeLimitStates.AfterEndDateNotStarted;\n }\n \n return BadgesTimeLimitStates.AfterEndDateWithProgress;\n }\n}\n","import { AchRelatedGame } from '../Base/AchRelatedGame';\nimport { IntUtils } from '../IntUtils';\nimport { TMissionOrBadge } from '../WSAPI/WSAPITypes';\nimport { AchievementPublicMeta } from './AchievementPublicMeta';\nimport { AchievementStatus } from './AchievementStatus';\nimport { AchievementTaskType } from './AchievementTaskType';\nimport { AchievementType } from './AchievementType';\nimport { MissionUtils } from './MissionsUtils';\nimport { ScheduledMissionType } from './ScheduledMissionType';\nimport { UserAchievementTask } from './UserAchievementTask';\nimport { BadgesTimeLimitStates } from './BadgesTimeLimitStates';\nimport { AchievementClaimPeriodTypeId } from './AchievementClaimTypeId';\n\nexport interface UserAchievement {\n\tach_id?: number;\n\tach_type_id?: AchievementType;\n\tach_public_meta?: AchievementPublicMeta;\n\tisCompleted?: boolean;\n\tisLocked?: boolean;\n\trequiresOptin?: boolean;\n\tisOptedIn?: boolean;\n\tstart_date?: string; // time when mission unlocked or opted-in. Needed to calculated \"remaining time\" in case time_limit_ms is set\n\tstart_date_ts?: number;\n\ttime_limit_ms?: number;\n\tprogress?: number;\n\tcomplete_date?: string;\n\tcomplete_date_ts?: number;\n\tunlock_date?: string;\n\tmilliseconds_till_available?: number;\n\tcompleted_tasks?: number;\n\tachievementTasks?: UserAchievementTask[];\n\tnext_recurrence_date_ts?: number;\n\tach_status_id?: AchievementStatus;\n\tscheduledMissionType?: ScheduledMissionType;\n\trelated_games?: AchRelatedGame[];\n\tactive_from_ts?: number; // indicates when 'scheduled' mission is active from,\n\tactive_till_ts?: number; // indicates when 'scheduled' mission is active till,\n\tach_categories?: number[];\n\trecurring_quantity?: number; // max completion count for Recurring upon completion\n\tcompleted_count?: number; // completion count for Recurring upon completion\n\n\tach_completed_id?: number; // ID of the completion fact from ach_completed or ach_completed_recurring tables\n\trequires_prize_claim?: boolean; // flag from achievement if the mission prize will be given only after user claims it\n\tprize_claimed_date_ts?: number; // the date/timestamp indicating when the prize was claimed by the user\n\n\tcompleted_today?: boolean;\n\tcompleted_this_week?: boolean;\n\tcompleted_this_month?: boolean;\n\tcustom_section_type_id?: number;\n\tbadgeTimeLimitState?: BadgesTimeLimitStates;\n\tprize_claim_expiration_date?: number;\n\tprize_claim_period_type_id?: AchievementClaimPeriodTypeId;\n}\n\nexport const enrichUserAchievementsWithBadgeState = (items: UserAchievement[]): UserAchievement[] => {\n\treturn items.map((item) => {\n\t\tif (item.ach_type_id === AchievementType.Badge && (item.active_from_ts || item.active_till_ts)) {\n\t\t\titem.badgeTimeLimitState = MissionUtils.determineBadgeState(item);\n\t\t}\n\t\treturn item;\n\t});\n};\n\nexport const UserAchievementTransform = (items: UserAchievement[]): TMissionOrBadge[] => {\n\treturn items\n\t\t.filter((r) => r.ach_id >= 1)\n\t\t.map((r) => {\n\t\t\tconst completedToday = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'today') : false;\n\t\t\tconst completedThisWeek = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'thisWeek') : false;\n\t\t\tconst completedThisMonth = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'thisMonth') : false;\n\n\t\t\tlet missionName = r.ach_public_meta.name;\n\t\t\tlet missionSubHeader = r.ach_public_meta.sub_header;\n\t\t\tlet missionDescription = r.ach_public_meta.description;\n\n\t\t\tif (missionName?.includes('{{suggested_') || missionSubHeader?.includes('{{suggested_') || missionDescription?.includes('{{suggested_')) {\n\t\t\t\tr.achievementTasks.forEach(t => {\n\t\t\t\t\tif (r.ach_public_meta.name?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionName = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.name });\n\t\t\t\t\t}\n\t\t\t\t\tif (r.ach_public_meta.sub_header?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionSubHeader = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.sub_header });\n\t\t\t\t\t}\n\t\t\t\t\tif (r.ach_public_meta.description?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionDescription = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.description });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst x: TMissionOrBadge = {\n\t\t\t\tid: r.ach_id,\n\t\t\t\tname: missionName,\n\t\t\t\tsub_header: missionSubHeader,\n\t\t\t\tdescription: missionDescription,\n\t\t\t\thint_text: r.ach_public_meta.hint_text,\n\t\t\t\tunlock_mission_description: r.ach_public_meta.unlock_mission_description,\n\t\t\t\timage: r.ach_public_meta.image_url,\n\t\t\t\tis_completed: r.isCompleted,\n\t\t\t\tis_locked: r.isLocked,\n\t\t\t\tis_requires_optin: r.requiresOptin,\n\t\t\t\tis_opted_in: r.isOptedIn,\n\t\t\t\ttime_limit_ms: r.time_limit_ms,\n\t\t\t\tactive_from_ts: r.active_from_ts,\n\t\t\t\tactive_till_ts: r.active_till_ts,\n\t\t\t\tdt_start: r.start_date_ts,\n\t\t\t\treward: r.ach_public_meta.reward,\n\t\t\t\tprogress: r.progress,\n\t\t\t\ttype: r.ach_type_id === AchievementType.Mission ? 'mission' : 'badge',\n\t\t\t\tcta_action: r.ach_public_meta.cta_action,\n\t\t\t\tcta_text: r.ach_public_meta.cta_text,\n\t\t\t\tcustom_section_id: r.ach_public_meta.custom_section_id,\n\t\t\t\tonly_in_custom_section: r.ach_public_meta.only_in_custom_section,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.ach_public_meta.custom_data),\n\t\t\t\tposition: r.ach_public_meta.position,\n\t\t\t\tribbon:\n\t\t\t\t\tr.ach_public_meta.label_tag === 'custom' ? r.ach_public_meta.custom_label_tag : r.ach_public_meta.label_tag,\n\t\t\t\ttasks: (r.achievementTasks || [])\n\t\t\t\t\t.filter((t) => t.task_type_id === AchievementTaskType.CompleteAchievement)\n\t\t\t\t\t.map((t) => {\n\t\t\t\t\t\tMissionUtils.replaceFavGameNameTag({ task: t });\n\n\t\t\t\t\t\treturn ({\n\t\t\t\t\t\t\tid: t.task_id,\n\t\t\t\t\t\t\tname: t.task_public_meta?.name,\n\t\t\t\t\t\t\tpoints_reward: t.points_reward,\n\t\t\t\t\t\t\tgems_reward: t.gems_reward,\n\t\t\t\t\t\t\tdiamonds_reward: t.diamonds_reward,\n\t\t\t\t\t\t\tis_completed: t.isCompleted,\n\t\t\t\t\t\t\tprogress: t.userProgress,\n\t\t\t\t\t\t\texecution_count_expected: t.executionCount,\n\t\t\t\t\t\t\texecution_count_actual: t.userExecutedCount,\n\t\t\t\t\t\t\tdisplay_progress_as_count: t.task_public_meta.display_progress_as_count,\n\t\t\t\t\t\t\tstage_image: t.task_public_meta.stage_image,\n\t\t\t\t\t\t})\n\t\t\t\t\t}),\n\t\t\t\trelated_games: (r.related_games || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t\tcategory_ids: r.ach_categories ?? [],\n\t\t\t\tach_completed_id: r.ach_completed_id,\n\t\t\t\trequires_prize_claim: r.requires_prize_claim,\n\t\t\t\tprize_claimed_date_ts: r.prize_claimed_date_ts,\n\t\t\t\tcomplete_date: r.complete_date,\n\t\t\t\tcomplete_date_ts: r.complete_date_ts,\n\t\t\t\tcompleted_today: completedToday,\n\t\t\t\tcompleted_this_week: completedThisWeek,\n\t\t\t\tcompleted_this_month: completedThisMonth,\n\t\t\t\tcustom_section_type_id: r.ach_public_meta.custom_section_type_id,\n\t\t\t\tavailability_status: MissionUtils.getAvailabilityStatus(r),\n\t\t\t\tclaim_button_title: r.ach_public_meta.claim_button_title,\n\t\t\t\tclaim_button_action: r.ach_public_meta.claim_button_action,\n\t\t\t\tbadgeTimeLimitState: r.badgeTimeLimitState,\n\t\t\t\thide_locked_mission: r.ach_public_meta.hide_locked_mission,\n\t\t\t\tprize_claim_expiration_date: r.prize_claim_expiration_date,\n\t\t\t\tprize_claim_period_type_id: r.prize_claim_period_type_id,\n\t\t\t};\n\n\t\t\tif (r.ach_status_id === AchievementStatus.Recurring) {\n\t\t\t\tx.next_recurrence_date_ts = Date.now() + r?.milliseconds_till_available;\n\t\t\t}\n\n\t\t\tif (r.ach_status_id === AchievementStatus.RecurringUponCompletion) {\n\t\t\t\tx.completion_count = r.completed_count;\n\t\t\t\tx.max_completion_count = r.recurring_quantity;\n\t\t\t}\n\t\t\treturn x;\n\t\t});\n};\n","export enum ScheduledMissionType {\n\tFuture = 1,\n\tPast = 2,\n\tPresent = 3,\n}\n","import { TAchCategory } from '../WSAPI/WSAPITypes';\nimport { AchCategoryPublicMeta } from './AchCategoryPublicMeta';\n\nexport interface AchCategory {\n\tid?: number;\n\tpublicMeta?: AchCategoryPublicMeta;\n}\n\nexport const AchCategoryTransform = (items: AchCategory[]): TAchCategory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TAchCategory = {\n\t\t\tid: r.id,\n\t\t\tname: r.publicMeta?.name,\n\t\t\torder: r.publicMeta?.order,\n\t\t};\n\t\treturn x;\n\t});\n};\n","export enum MissionCategory {\n\tOverview,\n\t// fake category for custom section overview missions, using in TSMap.to get correct missions\n\tCustomSectionOverview,\n\tAvailable,\n\tLocked,\n\tCompleted,\n\tMissed,\n}","export enum AchievementClaimPeriodTypeId {\n\tRelativePeriod = 0,\n\tExactPeriod = 1,\n}","import { ProtocolResponse } from '../Base/ProtocolResponse';\n\nexport interface ClanTournamentPlayerRaw {\n\tuserId: number;\n\tcleanExtUserId: string;\n\tuserAltName: string;\n\tavatar_id: string;\n\tavatar_real_id: number;\n\tposition: number;\n\tscores: number;\n\tisMe: boolean;\n\tregistration_status?: number;\n\tcrmBrandId?: number;\n\tavatar_url?: string;\n}\n\nexport interface GetClanTournamentPlayersResponse extends ProtocolResponse {\n\tclan_id: number;\n\tclan_public_meta: { name: string; image_url: string };\n\tplayers: ClanTournamentPlayerRaw[];\n}\n\nexport interface TClanTournamentPlayer {\n\tuser_id: number;\n\tclean_ext_user_id: string;\n\tpublic_username: string;\n\tavatar_id: string;\n\tavatar_real_id: number;\n\tavatar_url?: string;\n\tposition: number;\n\tscores: number;\n\tis_me: boolean;\n}\n\nexport interface TClanTournamentPlayersResult {\n\tclan_id: number;\n\tclan_public_meta: { name: string; image_url: string };\n\tplayers: TClanTournamentPlayer[];\n}\n\nexport const clanTournamentPlayersTransform = (response: GetClanTournamentPlayersResponse): TClanTournamentPlayersResult => {\n\treturn {\n\t\tclan_id: response.clan_id,\n\t\tclan_public_meta: {\n\t\t\tname: response.clan_public_meta.name,\n\t\t\timage_url: response.clan_public_meta.image_url,\n\t\t},\n\t\tplayers: (response.players || []).map((p) => ({\n\t\t\tuser_id: p.userId,\n\t\t\tclean_ext_user_id: p.cleanExtUserId,\n\t\t\tpublic_username: p.userAltName,\n\t\t\tavatar_id: p.avatar_id,\n\t\t\tavatar_real_id: p.avatar_real_id,\n\t\t\tavatar_url: p.avatar_url,\n\t\t\tposition: p.position,\n\t\t\tscores: p.scores,\n\t\t\tis_me: p.isMe,\n\t\t})),\n\t};\n};\n","export enum TournamentRegistrationType {\n\tAUTO = 1,\n\tOPT_IN = 2,\n\tBUY_IN_POINTS = 3,\n\tMANUAL_APPROVAL = 4,\n\tREQUIRES_QUALIFICATION = 5,\n\tBUY_IN_GEMS = 6,\n\tBUY_IN_DIAMONDS = 7,\n\t// BUY_IN_CASH = 5???,\n}\n\nexport type TournamentRegistrationTypeName =\n\t| 'AUTO'\n\t| 'OPT_IN'\n\t| 'BUY_IN_POINTS'\n\t| 'MANUAL_APPROVAL'\n\t| 'REQUIRES_QUALIFICATION'\n\t| 'BUY_IN_GEMS'\n\t| 'BUY_IN_DIAMONDS'\n\t| 'UNKNOWN';\n\n/** @hidden */\nexport const TournamentRegistrationTypeGetName = (type: TournamentRegistrationType): TournamentRegistrationTypeName => {\n\treturn ({\n\t\t[TournamentRegistrationType.AUTO]: 'AUTO',\n\t\t[TournamentRegistrationType.BUY_IN_POINTS]: 'BUY_IN_POINTS',\n\t\t[TournamentRegistrationType.MANUAL_APPROVAL]: 'MANUAL_APPROVAL',\n\t\t[TournamentRegistrationType.OPT_IN]: 'OPT_IN',\n\t\t[TournamentRegistrationType.REQUIRES_QUALIFICATION]: 'REQUIRES_QUALIFICATION',\n\t\t[TournamentRegistrationType.BUY_IN_GEMS]: 'BUY_IN_GEMS',\n\t\t[TournamentRegistrationType.BUY_IN_DIAMONDS]: 'BUY_IN_DIAMONDS',\n\t}[type] || 'UNKNOWN') as any as TournamentRegistrationTypeName;\n};\n","export enum TournamentRegistrationStatus {\n\tNOT_REGISTERED = 0,\n\tREGISTERED = 1,\n\tFINISHED = 2,\n\tPENDING = 3,\n\tCANCELLED = 4,\n\tREGISTERED_PENDING_QUALIFICATION = 5,\n\tQUALIFIED_PENDING_REGISTRATION = 6,\n}\n\nexport enum TournamentRegistrationStatusName {\n\tNOT_REGISTERED = 'NOT_REGISTERED',\n\tREGISTERED = 'REGISTERED',\n\tFINISHED = 'FINISHED',\n\tPENDING = 'PENDING',\n\tCANCELLED = 'CANCELLED',\n\tREGISTERED_PENDING_QUALIFICATION = 'REGISTERED_PENDING_QUALIFICATION',\n\tQUALIFIED_PENDING_REGISTRATION = 'QUALIFIED_PENDING_REGISTRATION',\n\tUNKNOWN = 'UNKNOWN',\n}\n\n/** @hidden */\nexport const TournamentRegistrationStatusNamed = (type: TournamentRegistrationStatus): TournamentRegistrationStatusName => {\n\treturn ({\n\t\t[TournamentRegistrationStatus.CANCELLED]: TournamentRegistrationStatusName.CANCELLED,\n\t\t[TournamentRegistrationStatus.FINISHED]: TournamentRegistrationStatusName.FINISHED,\n\t\t[TournamentRegistrationStatus.NOT_REGISTERED]: TournamentRegistrationStatusName.NOT_REGISTERED,\n\t\t[TournamentRegistrationStatus.PENDING]: TournamentRegistrationStatusName.PENDING,\n\t\t[TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION]:\n\t\t\tTournamentRegistrationStatusName.QUALIFIED_PENDING_REGISTRATION,\n\t\t[TournamentRegistrationStatus.REGISTERED]: TournamentRegistrationStatusName.REGISTERED,\n\t\t[TournamentRegistrationStatus.REGISTERED_PENDING_QUALIFICATION]:\n\t\t\tTournamentRegistrationStatusName.REGISTERED_PENDING_QUALIFICATION,\n\t}[type] || TournamentRegistrationStatusName.UNKNOWN) as TournamentRegistrationStatusName;\n};\n","export enum TournamentInstanceStatus {\n\tPUBLISHED = 1,\n\tREGISTER = 2,\n\tSTARTED = 3,\n\tFINISHED = 4,\n\tCANCELLED = 5,\n\tFAILED = 6,\n\tFINALIZING = 7,\n}\n\nexport const TournamentInstanceStatusName = (s: TournamentInstanceStatus): string => {\n\treturn {\n\t\t[TournamentInstanceStatus.PUBLISHED]: 'PUBLISHED',\n\t\t[TournamentInstanceStatus.REGISTER]: 'REGISTER',\n\t\t[TournamentInstanceStatus.STARTED]: 'STARTED',\n\t\t[TournamentInstanceStatus.FINISHED]: 'FINISHED',\n\t\t[TournamentInstanceStatus.CANCELLED]: 'CANCELLED',\n\t\t[TournamentInstanceStatus.FAILED]: 'FAILED',\n\t\t[TournamentInstanceStatus.FINALIZING]: 'FINALIZING',\n\t}[s];\n};\n","import { ActivityTypeLimited } from '../Core';\nimport { Tournament } from './Tournament';\nimport { TournamentInstanceStatus } from './TournamentInstanceStatus';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TournamentRegistrationStatus } from './TournamentRegistrationStatus';\nimport { TournamentRegistrationType } from './TournamentRegistrationType';\n\nconst tournamentPrizeTypeToPrizeName = (type: ActivityTypeLimited) => {\n\treturn {\n\t\t[ActivityTypeLimited.DoNothing]: 'TANGIBLE',\n\t\t[ActivityTypeLimited.Points]: 'POINTS_ADD',\n\t\t[ActivityTypeLimited.DeductPoints]: 'POINTS_DEDUCT',\n\t\t[ActivityTypeLimited.ResetPoints]: 'POINTS_RESET',\n\t\t[ActivityTypeLimited.MiniGameAttempt]: 'MINI_GAME_ATTEMPT',\n\t\t[ActivityTypeLimited.Bonus]: 'BONUS',\n\t\t[ActivityTypeLimited.AddGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_ADD',\n\t\t[ActivityTypeLimited.DeductGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_DEDUCT',\n\t\t[ActivityTypeLimited.ResetGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_RESET',\n\t}[type];\n};\n\nexport class TournamentUtils {\n\tpublic static isCanRegister = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\tif (tournament.tournamentRegistrationStatus === TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t!tournament.isUserRegistered && (\n\t\t\t\t\ttournament.playersMaxCount !== tournament.registrationCount ||\n\t\t\t\t\ttournament.playersMaxCount === null ||\n\t\t\t\t\ttournament.playersMaxCount === 0\n\t\t\t\t) &&\n\t\t\t\ttournament.registrationType !== TournamentRegistrationType.AUTO && (\n\t\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER || (\n\t\t\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED && tournament.allowLateRegistration\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isInProgress = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn tournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED;\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isActive = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.PUBLISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isFinished = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.FINISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.CANCELLED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.FINALIZING\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isCancelled = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn tournament.tournamentInstanceStatus === TournamentInstanceStatus.CANCELLED;\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isUpcoming = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.PUBLISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static getPlayerTransformed = (player: TournamentPlayer, isMe?: boolean) => {\n\t\tif (player) {\n\t\t\tconst playerTransformed = {\n\t\t\t\tpublic_username: player.userAltName,\n\t\t\t\tavatar_url: player.avatar_url,\n\t\t\t\tposition: player.position,\n\t\t\t\tscores: player.scores,\n\t\t\t\tis_me: player.isMe,\n\t\t\t\tuser_ext_id: player.cleanExtUserId,\n\t\t\t\tcrm_brand_id: player.crmBrandId,\n\t\t\t\tuser_id: player.userId,\n\t\t\t};\n\n\t\t\tif (isMe) {\n\t\t\t\tdelete playerTransformed.is_me;\n\t\t\t}\n\n\t\t\treturn playerTransformed;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tpublic static getPrizeTransformed = (prize: TournamentPrize) => {\n\t\tif (prize) {\n\t\t\treturn { ...prize, type: tournamentPrizeTypeToPrizeName(prize.type) };\n\t\t}\n\n\t\treturn null;\n\t};\n}\n","import { TournamentRegistrationType, TournamentRegistrationTypeGetName } from './TournamentRegistrationType';\nimport { TournamentInstanceStatus } from './TournamentInstanceStatus';\nimport {\n\tTournamentRegistrationStatus,\n\tTournamentRegistrationStatusName,\n\tTournamentRegistrationStatusNamed,\n} from './TournamentRegistrationStatus';\nimport { TournamentType } from './TournamentType';\nimport { TournamentPublicMeta } from './TournamentPublicMeta';\nimport { TTournament } from '../WSAPI/WSAPITypes';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TournamentUtils } from './TournamentUtils';\nimport { IntUtils } from '../IntUtils';\nimport { AchRelatedGame } from '../Base/AchRelatedGame';\n\nexport interface Tournament {\n\t/** ID of tournament template */\n\ttournamentId?: number;\n\t/** ID of tournament instance. Generated every time when tournament based on specific template is scheduled for run */\n\ttournamentInstanceId?: number;\n\t/** Type of the tournament. For now only SCHEDULED is support */\n\ttournamentType?: TournamentType;\n\t/** Meta information about tournament that should be used to build UI */\n\tpublicMeta?: TournamentPublicMeta;\n\t/** Cost of registration in the tournament in gamification points */\n\tbuyInAmount?: number;\n\t/** Not in use */\n\tprizePool?: number;\n\t/** The time when tournament is going to start */\n\tstartTime?: string;\n\t/** The time when tournament is going to finish */\n\tendTime?: string;\n\t/** The time when tournament is going to start, epoch */\n\tstartTimeTs?: number;\n\t/** The time when tournament is going to finish, epoch */\n\tendTimeTs?: number;\n\t/** Number of users registered in the tournament */\n\tregistrationCount?: number;\n\t/** Not in use */\n\ttotalCount?: number;\n\t/** Type of registration in the tournament */\n\tregistrationType?: TournamentRegistrationType;\n\t/** Status of registration in the tournament for current user */\n\ttournamentRegistrationStatus?: TournamentRegistrationStatus;\n\t/** Status of tournament instance */\n\ttournamentInstanceStatus?: TournamentInstanceStatus;\n\t/** flag indicating if current user is registered in the tournament */\n\tisUserRegistered?: boolean;\n\t/** Indicator if tournament allows later registration, when tournament is already started */\n\tallowLateRegistration?: boolean;\n\t/** Minimum number of participant for this tournament. If tournament doesnt have enough registrations, it will not start */\n\tplayersMinCount?: number;\n\t/** Maximum number of participant for this tournament. When reached, new users won't be able to register */\n\tplayersMaxCount?: number;\n\t/** Tournament duration in millisecnnds */\n\tdurationMs?: number;\n\t/** prizes structure */\n\tprizeStructure?: {\n\t\tprizes: TournamentPrize[];\n\t};\n\t/** Information about current user */\n\ttournamentPlayer?: TournamentPlayer;\n\n\t/** List of casino games (or other types of entities) related to the tournament */\n\trelated_games?: AchRelatedGame[];\n\t/** The minimum amount of score points that the user should get in order to be qualified for the prize */\n\tminScoreToWin?: number;\n\t/** When enabled, users who don't meet the minimum qualifying score will be hidden from the Leaderboard. */\n\thideLeaderboardsMinScores?: boolean;\n\t/** Total scores across all participants in the tournament */\n\ttotalScores?: number;\n\t/** Indicates if the tournament is clan-based */\n\tisClanBased?: boolean;\n}\n\nexport const TournamentItemsTransform = (items: Tournament[]): TTournament[] => {\n\treturn items\n\t\t.filter((r) => r != null && r.tournamentId >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TTournament = {\n\t\t\t\tinstance_id: r.tournamentInstanceId,\n\t\t\t\ttournament_id: r.tournamentId,\n\t\t\t\tname: r.publicMeta.name,\n\t\t\t\tdescription: r.publicMeta.description,\n\t\t\t\tsegment_dont_match_message: r.publicMeta.segment_dont_match_message,\n\t\t\t\timage1: r.publicMeta.image_url,\n\t\t\t\timage2: r.publicMeta.image_url2,\n\t\t\t\timage2_mobile: r.publicMeta.image_url2_mobile,\n\t\t\t\tprize_pool_short: r.publicMeta.prize_pool_short,\n\t\t\t\tcustom_price_text: r.publicMeta.custom_price_text,\n\t\t\t\tcustom_section_id: r.publicMeta.custom_section_id,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.publicMeta.custom_data),\n\t\t\t\tis_featured: r.publicMeta.featured,\n\t\t\t\tribbon: r.publicMeta.label_tag === 'custom' ? r.publicMeta.custom_label_tag : r.publicMeta.label_tag,\n\t\t\t\tpriority: r.publicMeta.position,\n\n\t\t\t\tstart_time: r.startTimeTs,\n\t\t\t\tend_time: r.endTimeTs,\n\t\t\t\tregistration_count: r.registrationCount,\n\t\t\t\tis_user_registered: r.isUserRegistered,\n\t\t\t\tplayers_min_count: r.playersMinCount,\n\t\t\t\tplayers_max_count: r.playersMaxCount,\n\t\t\t\tregistration_status: TournamentRegistrationStatusNamed(r.tournamentRegistrationStatus),\n\n\t\t\t\tregistration_type: TournamentRegistrationTypeGetName(r.registrationType),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_POINTS ? { registration_cost_points: r.buyInAmount } : {}),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_GEMS ? { registration_cost_gems: r.buyInAmount } : {}),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_DIAMONDS ? { registration_cost_diamonds: r.buyInAmount } : {}),\n\t\t\t\tduration_ms: r.durationMs,\n\n\t\t\t\tis_active: TournamentUtils.isActive(r),\n\t\t\t\tis_can_register: TournamentUtils.isCanRegister(r),\n\t\t\t\tis_cancelled: TournamentUtils.isCancelled(r),\n\t\t\t\tis_finished: TournamentUtils.isFinished(r),\n\t\t\t\tis_in_progress: TournamentUtils.isInProgress(r),\n\t\t\t\tis_upcoming: TournamentUtils.isUpcoming(r),\n\n\t\t\t\tmin_scores_win: r.minScoreToWin,\n\t\t\t\thide_leaderboard_min_scores: r.hideLeaderboardsMinScores,\n\t\t\t\ttotal_scores: r.totalScores,\n\t\t\t\tis_clan_based: r.isClanBased,\n\t\t\t};\n\n\t\t\tif (r.prizeStructure) {\n\t\t\t\tx.prizes = r.prizeStructure.prizes.map((p) => TournamentUtils.getPrizeTransformed(p));\n\t\t\t}\n\n\t\t\tif (r.tournamentPlayer) {\n\t\t\t\tx.me = TournamentUtils.getPlayerTransformed(r.tournamentPlayer, true);\n\t\t\t}\n\n\t\t\treturn x;\n\t\t});\n};\n","import { Tournament, TournamentItemsTransform } from './Tournament';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TTournamentDetailed } from '../WSAPI/WSAPITypes';\nimport { TournamentUtils } from './TournamentUtils';\nimport { ClanLeaderboardEntry, ClanPrizeStructureEntry } from './TournamentClan';\n\nexport interface GetTournamentInfoResponse extends ProtocolResponse {\n\t/** tournament info */\n\ttournamentInfo: {\n\t\t/** id of label, not in use */\n\t\tlabelId: number;\n\t\ttournamentLobbyInfo: Tournament;\n\t\t/** list of registered users */\n\t\tplayers: TournamentPlayer[];\n\t};\n\t/** information about current user position */\n\tuserPosition: TournamentPlayer;\n\t/** prizes structure */\n\tprizeStructure?: {\n\t\tprizes: TournamentPrize[];\n\t};\n\t/** Ranked list of clans in this tournament. Empty/null for non-clan tournaments. */\n\tclanLeaderboard?: ClanLeaderboardEntry[] | null;\n\t/**\n\t * The clan ID the current user belongs to.\n\t * null when the user has no clan or the tournament is not clan-based.\n\t * Match against clanLeaderboard[i].clan_id to highlight the user's clan row.\n\t */\n\tuserClanId?: number | null;\n\t/** Per-clan prize structure. Empty/null for non-clan tournaments. */\n\tclanPrizes?: ClanPrizeStructureEntry[] | null;\n}\n\nexport const tournamentInfoItemTransform = (t: GetTournamentInfoResponse): TTournamentDetailed => {\n\tconst response: TTournamentDetailed = {\n\t\t...TournamentItemsTransform([t.tournamentInfo?.tournamentLobbyInfo ?? null])?.[0],\n\t\trelated_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map((g, i) => ({\n\t\t\text_game_id: g.ext_game_id,\n\t\t\tgame_public_meta: {\n\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\tpriority: i + 1,\n\t\t\t},\n\t\t})),\n\t\tplayers: t.tournamentInfo.players.map((p) => TournamentUtils.getPlayerTransformed(p)),\n\t};\n\n\tif (t.prizeStructure) {\n\t\tresponse.prizes = t.prizeStructure.prizes.map((p) => TournamentUtils.getPrizeTransformed(p));\n\t}\n\n\tif (t.userPosition) {\n\t\tresponse.me = TournamentUtils.getPlayerTransformed(t.userPosition, true);\n\t}\n\n\tif (t.tournamentInfo?.tournamentLobbyInfo?.isClanBased) {\n\t\tresponse.is_clan_based = true;\n\t\tresponse.user_clan_id = t.userClanId ?? null;\n\t\tresponse.clan_leaderboard = t.clanLeaderboard\n\t\t\t? t.clanLeaderboard.map((entry) => ({\n\t\t\t\t\tclan_id: entry.clanId,\n\t\t\t\t\tpublic_meta: {\n\t\t\t\t\t\tname: entry.publicMeta.name,\n\t\t\t\t\t\tdescription: entry.publicMeta.description,\n\t\t\t\t\t\timage_url: entry.publicMeta.image_url,\n\t\t\t\t\t},\n\t\t\t\t\tposition: entry.rank,\n\t\t\t\t\ttotal_score: entry.totalScore,\n\t\t\t\t\tcontributing_members: entry.memberCount,\n\t\t\t }))\n\t\t\t: null;\n\t\tresponse.clan_prize_structure = t.clanPrizes\n\t\t\t? t.clanPrizes.map((entry) => ({\n\t\t\t\t\tclan_place: entry.clan_place,\n\t\t\t\t\tprize_type_id: entry.prize_type_id,\n\t\t\t\t\tprize_pool_amount: entry.prize_pool_amount,\n\t\t\t\t\tprize_pool_currency_code: entry.prize_pool_currency_code,\n\t\t\t\t\tactivity_type_id: entry.activity_type_id,\n\t\t\t\t\tdetails_json: entry.details_json,\n\t\t\t\t\tpublic_meta: entry.public_meta\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tname: entry.public_meta.name,\n\t\t\t\t\t\t\t\tdescription: entry.public_meta.description,\n\t\t\t\t\t\t\t\timage_url: entry.public_meta.image_url,\n\t\t\t\t\t\t\t\tprize_name: entry.public_meta.prize_name,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: null,\n\t\t\t\t\ttiers: (entry.player_tiers || []).map((tier) => ({\n\t\t\t\t\t\tplayer_place_from: tier.player_place_from,\n\t\t\t\t\t\tplayer_place_to: tier.player_place_to,\n\t\t\t\t\t\tpool_amount: tier.pool_amount,\n\t\t\t\t\t\tdistribution_type: tier.distribution_type,\n\t\t\t\t\t\tactivity_type_id: tier.activity_type_id,\n\t\t\t\t\t\tdetails_json: tier.details_json,\n\t\t\t\t\t\tpublic_meta: tier.public_meta\n\t\t\t\t\t\t\t? { name: tier.public_meta.name, description: tier.public_meta.description, image_url: tier.public_meta.image_url }\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t})),\n\t\t\t }))\n\t\t\t: null;\n\t}\n\n\treturn response;\n};\n","/**\n * Error codes returned in `err_code` by the `registerInTournament` method.\n *\n * These are terse value definitions for lookup. The full per-code narrative —\n * when each fires and how the consumer's UI should react — lives in the\n * `registerInTournament` method TSDoc, which owns the error table.\n *\n * Note the numbering break: the gems / diamonds codes are 6-digit\n * (`300010` / `300011`) while the rest of the tournament block is 5-digit;\n * they were appended after the original `30001`–`30009` range was occupied.\n * Branch on the exact numeric value, not on digit count.\n */\nexport enum TournamentRegistrationError {\n\t/** Success — registration persisted; buy-in (if any) deducted. */\n\tNO_ERROR = 0,\n\t/** Clan-based tournament and the user does not belong to a clan yet. */\n\tTOURNAMENT_USER_CANNOT_JOIN_WITHOUT_CLAN = 1010,\n\t/** Instance id is invalid or the tournament was deleted. */\n\tTOURNAMENT_INSTANCE_NOT_FOUND = 30001,\n\t/** Insufficient points balance for a points-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_POINTS = 30002,\n\t/** Tournament is no longer in a registerable state (finished, cancelled, finalizing, or not yet open). */\n\tTOURNAMENT_INSTANCE_NOT_IN_STATE = 30003,\n\t/** User is already registered; treat as an idempotent success. */\n\tTOURNAMENT_ALREADY_REGISTERED = 30004,\n\t/** User does not satisfy the tournament's segment / entry conditions. */\n\tTOURNAMENT_USER_DONT_MATCH_CONDITIONS = 30005,\n\t/** User is not registered; anomalous on a register call (usually a server-side race). */\n\tTOURNAMENT_USER_NOT_REGISTERED = 30006,\n\t/** Registration status transition is not allowed (e.g. re-registering a finished tournament). */\n\tTOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS = 30007,\n\t/** Tournament filled up — maximum registrations reached. */\n\tTOURNAMENT_MAX_REGISTRATIONS_REACHED = 30008,\n\t/**\n\t * The user's wallet currency could not be resolved. Emitted server-side\n\t * during tournament score processing, NOT during registration — it is\n\t * never returned by `registerInTournament`. Included for completeness.\n\t */\n\tTOURNAMENT_INVALID_USER_CURRENCY = 30009,\n\t/** Insufficient gems balance for a gems-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_GEMS = 300010,\n\t/** Insufficient diamonds balance for a diamonds-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_DIAMONDS = 300011,\n}\n","export enum TournamentType {\n\tSCHEDULED = 1,\n\tSNG = 2,\n\tTEST = 3,\n}\n","export enum LeaderBoardPeriodType {\n\tDAILY = 1,\n\tWEEKLY = 2,\n\tMONTHLY = 3,\n}\n","import { LeaderBoardDetailsT, LeaderBoardUserT, LeaderBoardsRewardsT } from '../WSAPI/WSAPITypes';\nimport { LeaderBoardDetails } from './LeaderBoardDetails';\nimport { LeaderBoardPeriodType } from './LeaderBoardPeriodType';\nimport { LeaderBoardPosition } from './LeaderBoardPosition';\n\nconst pointsRewardTransform = (reward_points: number[]): LeaderBoardsRewardsT[] => {\n\tif (reward_points && reward_points.length) {\n\t\treturn reward_points.map((r, i) => ({ place: i + 1, points: r }));\n\t}\n\n\treturn null;\n};\n\nconst getLeaderBoardPlayerTransformed = (user: LeaderBoardPosition, isMe?: boolean): LeaderBoardUserT => {\n\tif (user) {\n\t\treturn {\n\t\t\tpublic_username: user?.public_username || user.user_alt_name,\n\t\t\tavatar_url: user.avatar_url,\n\t\t\tlevel_id: user.level_id,\n\t\t\tposition: user.position_in_board,\n\t\t\tpoints: user.points_accumulated,\n\t\t\t// The `me` entry is the current user by definition, so force `true`\n\t\t\t// there; list rows carry the server-provided flag.\n\t\t\tis_me: isMe ? true : user.is_me,\n\t\t};\n\t}\n\n\treturn null;\n};\n\nexport const getLeaderBoardTransform = (board: LeaderBoardDetails): LeaderBoardDetailsT => {\n\tif (board) {\n\t\treturn {\n\t\t\tboard_id: board.board_id,\n\t\t\tname: board.board_public_meta.name,\n\t\t\tdescription: board.board_public_meta.description,\n\t\t\trules: board.board_public_meta.rules,\n\t\t\tperiod_type_id: board.period_type_id,\n\t\t\tversion_id: board.versiod_id,\n\t\t\tcreate_date: board.create_date,\n\t\t\trewards: pointsRewardTransform(board.reward_points),\n\t\t\tusers: (board.positions || []).map((p) => getLeaderBoardPlayerTransformed(p)),\n\t\t\tme: getLeaderBoardPlayerTransformed(board.userPosition, true),\n\t\t};\n\t}\n\n\treturn null;\n};\n","import { IntUtils } from '../IntUtils';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { TLevel } from '../WSAPI/WSAPITypes';\nimport { Level } from './Level';\n\nexport interface GetLevelMapResponse extends ProtocolResponse {\n\tlevels: Level[];\n}\n\nexport const GetLevelMapResponseTransform = (levels: GetLevelMapResponse): TLevel[] => {\n\tif (!levels?.levels) return [];\n\n\tconst mapped = levels.levels.map((l) => ({\n\t\tid: l.level_id,\n\t\tname: l.level_public_meta.name,\n\t\tdescription: l.level_public_meta.description,\n\t\timage: l.level_public_meta.image_url,\n\t\trequired_points: l.required_points,\n\t\tvisibility_points: l.level_public_meta.visibility_points ? parseInt(l.level_public_meta.visibility_points as any) : null,\n\t\trequired_level_counter_1: l.required_level_counter_1,\n\t\trequired_level_counter_2: l.required_level_counter_2,\n\t\tcustom_data: IntUtils.JsonOrText(l.level_public_meta?.custom_data),\n\t\tordinal_position: 0,\n\t}));\n\n\tconst ordinalById = new Map<number, number>();\n\t[...mapped]\n\t\t.sort((a, b) => a.required_points - b.required_points)\n\t\t.forEach((l, index) => ordinalById.set(l.id, index + 1));\n\n\treturn mapped.map((l) => ({ ...l, ordinal_position: ordinalById.get(l.id) }));\n};\n","import { ECacheContext, OCache } from '../OCache';\nimport { SmarticoAPI } from '../SmarticoAPI';\n\n/** @hidden */\nexport const CACHE_DATA_SEC = 30;\n\n/** @hidden */\nexport const JACKPOT_TEMPLATE_CACHE_SEC = 30;\n/** @hidden */\nexport const JACKPOT_POT_CACHE_SEC = 1;\n/** @hidden */\nexport const JACKPOT_WINNERS_CACHE_SEC = 30;\n/** @hidden */\nexport const JACKPOT_ELIGIBLE_GAMES_CACHE_SEC = 30;\n\n/** @hidden */\nexport enum onUpdateContextKey {\n\tSaw = 'saw',\n\tMissions = 'missions',\n\tTournamentList = 'tournamentList',\n\tInboxMessages = 'inboxMessages',\n\tBadges = 'badges',\n\tLevels = 'levels',\n\tStoreItems = 'storeItems',\n\tStoreCategories = 'storeCategories',\n\tAchCategories = 'achCategories',\n\tLeaderBoards = 'leaderBoards',\n\tLevelExtraCounters = 'levelExtraCounters',\n\tSegments = 'segments',\n\tStoreHistory = 'storeHistory',\n\tJackpots = 'jackpots',\n\tPots = 'Pots',\n\tCustomSections = 'customSections',\n\tBonuses = 'bonuses',\n\tClans = 'clans',\n\tSAWHistory = 'sawHistory',\n\tJackpotWinners = 'jackpotWinners',\n\tRaffles = 'raffles',\n\tJackpotEligibleGames = 'jackpotEligibleGames',\n\tCurrentLevel = 'currentLevel',\n\tInboxUnreadCount = 'inboxUnreadCount',\n\tActivityLog = 'activityLog',\n\tAvatarsList = 'avatarsList',\n\tAvatarsCustomized = 'avatarsCustomized',\n\tAvatarPrompts = 'avatarPrompts',\n}\n\n/**\n * Abstract base of the SDK's public surface. Holds the shared state\n * (`api`, `userExtId`, `onUpdateCallback` map) and the generic cache /\n * subscription helper (`updateEntity`). Domain-specific methods live on\n * subclasses; the terminator `WSAPI` class composes the whole chain.\n *\n * **Consumers should not instantiate this directly** — the SDK constructs\n * the concrete `WSAPI` via `_smartico.api`.\n *\n * @hidden\n */\nexport abstract class WSAPIBase {\n\t/** @hidden */\n\tprotected onUpdateCallback: Map<onUpdateContextKey, (data: any) => void> = new Map();\n\n\t/** @hidden */\n\tprotected userExtId: string = null;\n\n\t/** @private */\n\tconstructor(protected api: SmarticoAPI, userExtId: string = null) {\n\t\tthis.userExtId = userExtId;\n\t\tOCache.clearAll();\n\t}\n\n\t/** @private */\n\t// AA: this method is used from the _smartico script to clear cache when the context is changed,\n\t// e.g. when user is changed or language is changed\n\tpublic clearCaches() {\n\t\tOCache.clearAll();\n\t}\n\n\t/**\n\t * Generic cache-update + subscription-notify helper. Used by domain\n\t * classes' `update*` methods to refresh a context and fire any\n\t * registered `onUpdate` callback.\n\t * @hidden\n\t */\n\tprotected async updateEntity(contextKey: onUpdateContextKey, payload: any) {\n\t\tOCache.set(contextKey, payload, ECacheContext.WSAPI);\n\n\t\tconst onUpdate = this.onUpdateCallback.get(contextKey);\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tonUpdate(payload);\n\t\t}\n\t}\n}\n","import { TRaffle, TRaffleDraw, TRafflePrize, TRafflePrizeWinner, TRaffleTicket } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { Raffle } from './Raffle';\nimport { RaffleDraw } from './RaffleDraw';\nimport { RafflePrize } from './RafflePrize';\nimport { RafflePrizeWinner } from './RafflePrizeWinner';\nimport { RaffleTicket } from './RaffleTicket';\n\nexport interface GetRafflesResponse extends ProtocolResponse {\n\titems: Raffle[];\n}\n\n/** @hidden */\nexport const ticketsTransform = (items: RaffleTicket[]): TRaffleTicket[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tticekt_id: item.id,\n\t\t\tticket_id_string: item.s,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const winnersTransform = (items: RafflePrizeWinner[]): TRafflePrizeWinner[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.user_id,\n\t\t\tusername: item.public_username,\n\t\t\tavatar_url: item.avatar_url || item.avatar_id,\n\t\t\tticket: { ticekt_id: item.ticket.id, ticket_id_string: item.ticket.s },\n\t\t\traf_won_id: item.raf_won_id,\n\t\t\tclaimed_date: item.claimed_date,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const prizeTransform = (items: RafflePrize[]): TRafflePrize[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.prize_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\tcustom_data: item.public_meta.custom_data,\n\t\t\tprizes_per_run: item.prizes_per_run,\n\t\t\tprizes_per_run_actual: item.prizes_per_run_actual,\n\t\t\tchances_to_win_perc: item.chances_to_win_perc,\n\t\t\tmin_required_total_tickets: item.min_required_total_tickets,\n\t\t\tcap_prizes_per_run: item.cap_prizes_per_run,\n\t\t\tpriority: item.priority,\n\t\t\tstock_items_per_draw: item.stock_items_per_draw,\n\t\t\tshould_claim: item.should_claim,\n\t\t\twinners: winnersTransform(item.winners),\n\t\t\trequires_claim: item.requires_claim,\n\t\t\tmin_required_tickets_for_user: item.min_required_tickets_for_user,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const drawTransform = (items: RaffleDraw[]): TRaffleDraw[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.draw_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\timage_url_mobile: item.public_meta.image_url_mobile,\n\t\t\ticon_url: item.public_meta.icon_url,\n\t\t\tbackground_image_url: item.public_meta.background_image_url,\n\t\t\tbackground_image_url_mobile: item.public_meta.background_image_url_mobile,\n\t\t\tis_grand: item.public_meta.is_grand,\n\t\t\tprizes: prizeTransform(item.prizes),\n\t\t\tcurrent_state: item.current_state,\n\t\t\trun_id: item.run_id,\n\t\t\texecution_type: item.execution_type,\n\t\t\texecution_ts: item.execution_ts,\n\t\t\tprevious_run_ts: item.previous_run_ts,\n\t\t\tprevious_run_id: item.previous_run_id,\n\t\t\tticket_start_ts: item.ticket_start_ts,\n\t\t\tallow_multi_prize_per_ticket: item.allow_multi_prize_per_ticket,\n\t\t\ttotal_tickets_count: item.total_tickets_count,\n\t\t\tmy_tickets_count: item.my_tickets_count,\n\t\t\tmy_last_tickets: ticketsTransform(item.my_last_tickets),\n\t\t\tuser_opted_in: Boolean(item.user_opted_in),\n\t\t\trequires_optin: Boolean(item.requires_optin),\n\t\t\tis_active: Boolean(item.is_active),\n\t\t\twinners_limit: item.winners_limit,\n\t\t\twinners_offset: item.winners_offset,\n\t\t\twinners_total: item.winners_total,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const raffleTransform = (items: Raffle[]): TRaffle[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.raffle_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\tcustom_section_id: item.public_meta.custom_section_id,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\timage_url_mobile: item.public_meta.image_url_mobile,\n\t\t\tcustom_data: item.public_meta.custom_data,\n\t\t\tstart_date: item.start_date_ts,\n\t\t\tend_date: item.end_date_ts,\n\t\t\tmax_tickets_count: item.max_tickets_count,\n\t\t\tcurrent_tickets_count: item.current_tickets_count,\n\t\t\tdraws: drawTransform(item.draws),\n\t\t\tticket_cap_visualization: item.public_meta.ticket_cap_visualization,\n\t\t};\n\t});\n};\n","import { TRaffleDraw } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { RaffleDraw } from './RaffleDraw';\nimport { prizeTransform, ticketsTransform } from './GetRafflesResponse';\n\nexport interface GetDrawRunResponse extends ProtocolResponse {\n\tdraw: RaffleDraw;\n}\n\n/** @hidden */\nexport const drawRunTransform = (res: GetDrawRunResponse): TRaffleDraw => {\n\treturn {\n\t\tid: res.draw.draw_id,\n\t\tname: res.draw.public_meta.name,\n\t\tdescription: res.draw.public_meta.description,\n\t\timage_url:res.draw.public_meta.image_url,\n\t\timage_url_mobile:res.draw.public_meta.image_url_mobile,\n\t\ticon_url: res.draw.public_meta.icon_url,\n\t\tbackground_image_url: res.draw.public_meta.background_image_url,\n\t\tbackground_image_url_mobile: res.draw.public_meta.background_image_url_mobile,\n\t\tis_grand: res.draw.public_meta.is_grand,\n\t\tprizes: prizeTransform(res.draw.prizes),\n\t\tcurrent_state: res.draw.current_state,\n\t\trun_id: res.draw.run_id,\n\t\texecution_type: res.draw.execution_type,\n\t\texecution_ts: res.draw.execution_ts,\n\t\tprevious_run_ts: res.draw.previous_run_ts,\n\t\tprevious_run_id: res.draw.previous_run_id,\n\t\tticket_start_ts: res.draw.ticket_start_ts ?? res.draw['ticket_start_date'],\n\t\tallow_multi_prize_per_ticket: res.draw.allow_multi_prize_per_ticket,\n\t\ttotal_tickets_count: res.draw.total_tickets_count,\n\t\tmy_tickets_count: res.draw.my_tickets_count,\n\t\tmy_last_tickets: ticketsTransform(res.draw.my_last_tickets),\n\t\tuser_opted_in: Boolean(res.draw.user_opted_in),\n\t\trequires_optin: Boolean(res.draw.requires_optin),\n\t\tis_active: Boolean(res.draw.is_active),\n\t\twinners_limit: res.draw.winners_limit,\n\t\twinners_offset: res.draw.winners_offset,\n\t\twinners_total: res.draw.winners_total,\n\t} \t\n};","import { RaffleDraw } from \"./RaffleDraw\";\n\nexport enum RaffleTicketCapVisualization {\n\t/** Show nothing */\n\tEmpty = 0,\n\t/** Show ticket counter */\n\tCounter = 1,\n\t/** Show message when ticket cap is reached */\n\tMessage = 2,\n}\n\ninterface RafflePublicMeta {\n /** Name of the raffle */\n name: string;\n /** Description of the raffle */\n description: string;\n /** ID of the custom section that is linked to the raffle in the Gamification widget */\n custom_section_id: number;\n /** URL of the image that represents the raffle */\n image_url: string;\n /** URL of the mobile image that represents the raffle */\n image_url_mobile: string;\n /** Text for Terms and Conditions */\n hint_text:string;\n /** \n\t * Custom data as string or JSON string that can be used in API to build custom UI\n\t * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice\n\t * Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>\n */\n\tcustom_data: string;\n\n /**\n * - Value 1 (Counter): Shows a real-time \"Tickets Remaining\" display available during the whole Raffle activity.\n * - Value 2 (Message): Will show a specific message that triggers only when the cap is reached and inform users that tickets will be no longer be issued.\n */\n ticket_cap_visualization?: RaffleTicketCapVisualization;\n}\n\n\ninterface Raffle {\n /** ID of the Raffle template */\n raffle_id: number;\n /** Meta information about raffle for the presentation on UI */\n public_meta: RafflePublicMeta;\n /** Date of start */\n start_date_ts: number;\n /** Date of end */\n end_date_ts: number; \n /** Maximum numer of tickets that can be given to all users for the whole period of raffle */\n max_tickets_count: number;\n /** \n * Number of tickets that are already given to all users for this raffle\n */\n current_tickets_count: number;\n\n /** \n * List of draws that are available for this raffle.\n * For example, if the raffle is containg one hourly draw, one daily draw and one draw on fixed date like 01/01/2022,\n * Then the list will always return 3 draws, no matter if the draws are already executed or they are in the future.\n */\n draws: RaffleDraw[]\n\n}\n\nexport { Raffle, RafflePublicMeta };\n","import { RaffleDrawPublicMeta } from \"./RaffleDrawPublicMeta\";\nimport { RafflePrize } from \"./RafflePrize\";\nimport { RaffleTicket } from \"./RaffleTicket\";\n\nexport enum RaffleDrawInstanceState {\n /** Draw is open for the tickets collection */\n Open = 1,\n /** Winner selection is in progress */\n WinnerSelection = 2,\n /** Draw is executed and the winners are selected */\n Executed = 3,\n}\n\nexport enum RaffleDrawTypeExecution {\n /** Draw is executed only once */\n ExecDate = 0,\n /** Draw is executed on a recurring basis */\n Recurring = 1,\n /** \n * Draw is executed once and is marked as grand.\n * This means it is a special or significant draw,\n * often with larger prizes or more importance.\n */\n Grand = 2,\n}\n\n\ninterface RaffleDraw {\n /** \n * Id of the Draw definition, for the repetative draws (e.g. daily), this number will be the same for all draws that are repeating daily\n * (internal name: schedule_id)\n */\n draw_id: number;\n\n /** Meta information of the Draw for the presentaiton in UI */\n public_meta: RaffleDrawPublicMeta;\n\n /** Information about prizes in the draw */\n prizes: RafflePrize[];\n\n /** \n * State of current instance of Draw\n */\n current_state: RaffleDrawInstanceState;\n\n /** \n * Field indicates the ID of the latest instance/run of draw\n */\n run_id: number;\n\n /** \n * Type of the draw execution, indicating how and when the draw is executed.\n * \n * - ExecDate: Draw is executed only once at a specific date and time.\n * - Recurring: Draw is executed on a recurring basis (e.g., daily, weekly).\n * - Grand: Draw is executed once and is marked as grand, often with larger prizes or more importance.\n */\n execution_type: RaffleDrawTypeExecution;\n\n /** Date/time of the draw execution */\n execution_ts: number;\n \n /** Date of the previously executed draw (if there is such) */\n previous_run_ts?: number;\n\n /** Unique ID of the previusly executed draw (if there is such) */\n previous_run_id?: number; \n\n /** \n * Date/time starting from which the tickets will participate in the upcoming draw\n * This value need to be taken into account with next_execute_ts field value, for example\n * Next draw is at 10:00, ticket_start_date is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00\n * (internally this value is calculated as next_execute_ts - ticket_start_date)\n */\n ticket_start_ts: number;\n\n /** \n * Field is indicating if same ticket can win multiple prizes in the same draw\n * For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook\n * If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),\n * if false, then one ticket can win only one prize.\n * The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)\n * If specific prize has multiple values, e.g. we have 3 iPhones,\n * then the same ticket can win only one prize of a kind, but can win multiple prizes of different kind (if allow_multi_prize_per_ticket is true)\n */\n allow_multi_prize_per_ticket: boolean;\n\n\n /** \n * The number of tickets that are already given to all users for this instance of draw.\n * In other words tickets that are collected between ticket_start_date and current time (or till current_execution_ts is the instance is executed).\n */\n total_tickets_count: number;\n\n /** \n * The number of tickets collected by current user for this instance of draw.\n */\n my_tickets_count: number;\n\n /**\n * List of last 5 tickets are collected by current user for this instance of draw.\n */\n my_last_tickets: RaffleTicket[];\n\t/**\n\t * If true, the user has opted-in to the raffle.\n\t */\n\tuser_opted_in: boolean;\n\t/**\n\t * If true, the user needs to opt-in to the raffle before they can participate.\n\t */\n\trequires_optin: boolean;\n\n /**\n * If true, the draw is active and can be participated in.\n */\n is_active: boolean;\n /**\n * The number of winners to return\n */\n\twinners_limit?: number;\n\n /**\n * The offset of the winners to return\n */\n\twinners_offset?: number;\n\n /**\n * The total number of winners\n */\n\twinners_total?: number;\n}\n\nexport { RaffleDraw };\n","import { TRaffleDrawRun } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { RaffleDrawRun } from './RaffleDrawRun';\n\nexport interface GetRaffleDrawRunsHistoryResponse extends ProtocolResponse {\n\tdraw_runs: RaffleDrawRun[];\n}\n\n/** @hidden */\nexport const drawRunHistoryTransform = (res: GetRaffleDrawRunsHistoryResponse): TRaffleDrawRun[] => {\n\treturn res.draw_runs.map((item) => {\n\t\treturn {\n\t\t\tid: item.draw_id,\n\t\t\trun_id: item.run_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\timage_url_mobile: item.public_meta.image_url_mobile,\n\t\t\ticon_url: item.public_meta.icon_url,\n\t\t\tbackground_image_url: item.public_meta.background_image_url,\n\t\t\tbackground_image_url_mobile: item.public_meta.background_image_url_mobile,\n\t\t\tis_grand: item.public_meta.is_grand,\n\t\t\texecution_ts: item.execution_ts,\n\t\t\tactual_execution_ts:item.actual_execution_ts,\n\t\t\tticket_start_ts:item.ticket_start_ts,\n\t\t\tis_winner:item.is_winner,\n\t\t\thas_unclaimed_prize:item.has_unclaimed_prize\n\t\t};\n\t});\n};\n","import { TransformedRaffleClaimPrizeResponse } from \"../WSAPI/WSAPITypes\";\nimport { ProtocolResponse } from \"../Base/ProtocolResponse\";\n\nexport interface RaffleClaimPrizeResponse extends ProtocolResponse {\n errCode: number\n errMsg?: string\n}\n\n/** @hidden */\nexport const raffleClaimPrizeResponseTransform = (info: RaffleClaimPrizeResponse): TransformedRaffleClaimPrizeResponse => {\n return {\n errorCode: info.errCode,\n errorMessage: info.errMsg\n }\n}\n","import { CoreUtils } from '../Core';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tTActivityLog,\n\tTLevel,\n\tTLevelCurrent,\n\tTSegmentCheckResult,\n\tTUserProfile,\n\tUserLevelExtraCountersT,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIBase } from './WSAPIBase';\n\n/** @group User */\nexport class WSAPIUser extends WSAPIBase {\n\t/**\n\t * Returns the current user's public profile — the source of truth for\n\t * balances (points / gems / diamonds), the current level ID, the\n\t * display username + avatar, language, public tags, and the inbox\n\t * unread count. **This method is synchronous** (returns `TUserProfile`,\n\t * not a Promise): the SDK keeps a local snapshot of the user's public\n\t * properties that is initialised at identify time and kept live by a\n\t * server-driven update channel — every call returns the latest cached\n\t * values without a network round-trip.\n\t *\n\t * Subscribe to changes by registering a callback on `_smartico.on('props_change', ...)`\n\t * — the callback fires with the full snapshot at identify and with\n\t * partial-key updates on every subsequent server push (typically\n\t * under 1 second after the underlying state change).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * The tracker must be initialised — calling this before the identify\n\t * round-trip completes throws (`\"Tracker is not initialized, cannot\n\t * getUserProfile\"`). Safe ways to wait for readiness:\n\t * - register `_smartico.on('identify', (errCode, props) => ...)` —\n\t * fires once after a successful identify with the full props\n\t * - register `_smartico.on('props_change', () => ...)` — fires first\n\t * at identify with the full snapshot, then on every push update\n\t *\n\t * **What's kept live (push-updated)**\n\t * Balance fields (`ach_points_balance`, `ach_gems_balance`,\n\t * `ach_diamonds_balance`, `ach_points_ever`), `ach_level_current_id`,\n\t * `core_public_tags`, `core_inbox_unread_count`, `core_user_language`,\n\t * `avatar_url`, `public_username`, and the AI-driven recommended-amount\n\t * fields all flow over the SDK's user-properties update channel as\n\t * partial updates — the snapshot is patched in place when any of them\n\t * change server-side. Re-call `getUserProfile()` (or watch\n\t * `props_change`) to observe new values.\n\t *\n\t * **Reading state from the returned profile**\n\t * Balances (`ach_points_balance`, `ach_gems_balance`,\n\t * `ach_diamonds_balance`) are the canonical source for affordability\n\t * checks across the SDK — compare against `entry_fee_amount` (clans),\n\t * `registration_cost_points` / `_gems` / `_diamonds` (tournaments), and\n\t * `price` / `discounted_price` + `purchase_type` (store items).\n\t * `ach_points_ever` is monotonic — store purchases deduct from\n\t * `ach_points_balance` but NEVER from `ach_points_ever`, so it remains\n\t * useful for level-progress math (`required_points` on the next\n\t * {@link getLevels} entry minus `ach_points_ever`). `ach_level_current_id`\n\t * is the FK into the level ladder — resolve metadata via\n\t * {@link getCurrentLevel} (richer, includes progress %) or\n\t * {@link getLevels} (full ladder lookup table).\n\t *\n\t * **Inbox unread count** — `core_inbox_unread_count` on this profile\n\t * is push-updated in real time (under 1 second). For an inbox badge,\n\t * prefer this field over `getInboxUnreadCount` (which is cached\n\t * for 30 s) — same value, fresher signal.\n\t *\n\t * **Language**: `core_user_language` reflects the server's stored\n\t * language. If the consumer just called `_smartico.changeLanguage(...)`,\n\t * the field may briefly lag the local intent until the server push\n\t * arrives. Use `_smartico.getPublicProps()` for the\n\t * client-fallback-applied version if instant accuracy matters.\n\t *\n\t * **Idempotency / Side effects**: trivially safe — no network call,\n\t * no state mutation.\n\t *\n\t * **UI guidance**: see [UI Guide — `getUserProfile`](../../docs/ui/user/UIGuide_getUserProfile.md).\n\t *\n\t * **Visitor mode**: not supported — throws. Visitor sessions do not\n\t * have a public-profile snapshot.\n\t *\n\t * @returns The current cached `TUserProfile` snapshot. A shallow copy —\n\t * mutating it does not affect the SDK's internal state.\n\t * @throws `Error(\"Tracker is not initialized, cannot getUserProfile\")`\n\t * if called before identify completes or from a visitor session.\n\t *\n\t * @example\n\t * ```ts\n\t * // Wait for identify before calling.\n\t * window._smartico.on('identify', (errCode) => {\n\t * if (errCode !== 0) return;\n\t * const profile = window._smartico.api.getUserProfile();\n\t * console.log('[smartico] initial profile loaded — render the user widget:', profile);\n\t * });\n\t *\n\t * // Stay in sync with live updates.\n\t * window._smartico.on('props_change', (changed) => {\n\t * // `changed` is the partial keys for this push (full snapshot at identify).\n\t * const profile = window._smartico.api.getUserProfile();\n\t * console.log('[smartico] profile updated — re-render any widgets bound to:', Object.keys(changed),\n\t * '— balances now:', profile.ach_points_balance, profile.ach_gems_balance, profile.ach_diamonds_balance);\n\t *\n\t * // React to specific fields.\n\t * if ('ach_level_current_id' in changed) {\n\t * console.log('[smartico] level changed — call getCurrentLevel() for richer detail, animate the level badge');\n\t * }\n\t * if ('core_inbox_unread_count' in changed) {\n\t * console.log('[smartico] inbox unread count changed — update the badge to:', profile.core_inbox_unread_count);\n\t * }\n\t * });\n\t *\n\t * // Affordability gating example — used inside a clan / tournament / store CTA handler.\n\t * const profile = window._smartico.api.getUserProfile();\n\t * const item = await window._smartico.api.getStoreItems().then(items => items[0]);\n\t * const price = item.discounted_price ?? item.price;\n\t * const balance = {\n\t * points: profile.ach_points_balance,\n\t * gems: profile.ach_gems_balance,\n\t * diamonds: profile.ach_diamonds_balance,\n\t * }[item.purchase_type];\n\t * if (balance < price) {\n\t * console.log('[smartico] insufficient', item.purchase_type, '— disable Buy and show deficit', price - balance);\n\t * }\n\t * ```\n\t */\n\tpublic getUserProfile(): TUserProfile {\n\t\tif (this.api.tracker) {\n\t\t\tconst o: TUserProfile = Object.assign({}, this.api.tracker.userPublicProps);\n\t\t\to.avatar_url = CoreUtils.avatarUrl(this.api.tracker.userPublicProps.avatar_id, this.api.avatarDomain);\n\t\t\treturn o;\n\t\t} else {\n\t\t\tthrow new Error('Tracker is not initialized, cannot getUserProfile');\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether the current user matches a single segment, returning\n\t * `true` / `false` directly. Use this as a decision primitive to gate\n\t * UI surfaces (e.g. show a \"VIP lounge\" tab only when the user is in\n\t * the VIP segment), or to drive segment-specific CTA copy.\n\t *\n\t * Every call is a server round-trip — there is no SDK-side cache. For\n\t * checking multiple segments in one round-trip, use\n\t * {@link checkSegmentListMatch} instead.\n\t *\n\t * @remarks\n\t * **Refresh model**\n\t * - **No client cache.** Every call sends a request; the SDK does not\n\t * memoize results.\n\t * - **No push event** notifies the consumer when segment membership\n\t * flips (the user crosses a qualification threshold, or the\n\t * operator changes the segment definition). Membership changes\n\t * become visible only on the next `checkSegmentMatch` call.\n\t * - **Behavioral segments (configured against BigQuery) have batch\n\t * lag** — even if the user's activity has changed (deposit, wager,\n\t * etc.), the segment-membership result may not reflect that change\n\t * until the next batch evaluation run (typically up to several\n\t * hours).\n\t *\n\t * **Rate limit** (important)\n\t * The server caps `checkSegment*` calls at **10 requests per\n\t * 60-second window**, with a minimum gap of **~5 seconds between\n\t * consecutive calls**. Avoid calling on every render — cache the\n\t * result client-side for the session, or until you have a reason to\n\t * believe the user's state changed (e.g. after a deposit completes,\n\t * a level changes via {@link getUserProfile}'s `props_change`, or a\n\t * specific custom event fires).\n\t *\n\t * **`is_matching: false` is ambiguous on the server** — both \"the\n\t * segment doesn't exist for this label\" and \"the user doesn't\n\t * qualify\" return `false` with no distinguishing signal. Pass IDs\n\t * you've verified are valid for your label.\n\t *\n\t * **Idempotency**: safe. Read-only. No side effects (no analytics\n\t * events, no DB writes).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param segment_id The segment ID. Segment IDs are label-scoped;\n\t * the same numeric ID can refer to different\n\t * segments under different labels. Use the IDs\n\t * configured for your label.\n\t * @returns `true` if the user currently matches the\n\t * segment, `false` otherwise. `false` also covers\n\t * the \"segment doesn't exist for this label\"\n\t * case — these are not distinguishable.\n\t *\n\t * @example\n\t * ```ts\n\t * const isVip = await window._smartico.api.checkSegmentMatch(vipSegmentId);\n\t * if (isVip) {\n\t * console.log('[smartico] user is in VIP segment — render the VIP-only widget surface');\n\t * } else {\n\t * console.log('[smartico] user not in VIP segment (or segment id misconfigured) — hide the VIP surface');\n\t * }\n\t *\n\t * // Cache the result for the session; re-check after material user-state changes.\n\t * window._smartico.on('props_change', async (changed) => {\n\t * if ('ach_points_ever' in changed || 'ach_level_current_id' in changed) {\n\t * const fresh = await window._smartico.api.checkSegmentMatch(vipSegmentId);\n\t * console.log('[smartico] user state changed — VIP membership now:', fresh);\n\t * }\n\t * });\n\t * ```\n\t */\n\tpublic async checkSegmentMatch(segment_id: number): Promise<boolean> {\n\t\tconst r = await this.api.coreCheckSegments(this.userExtId, [segment_id]);\n\t\tif (r && r.find((s) => s.segment_id === segment_id && s.is_matching)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Checks the current user's membership in multiple segments in a\n\t * single server round-trip — returns a `TSegmentCheckResult[]` with\n\t * one entry per *unique* segment ID. Use this instead of looping\n\t * {@link checkSegmentMatch} when you need to evaluate several\n\t * segments at once (e.g. multi-segment composite gating, A/B-style\n\t * cohort detection).\n\t *\n\t * @remarks\n\t * **Response order is NOT guaranteed**\n\t * The server returns results in an unspecified order — different\n\t * from the input array. Always correlate by the `segment_id` field on\n\t * each `TSegmentCheckResult` rather than by array position. The\n\t * returned array length may also be smaller than the input array\n\t * (duplicate IDs are silently de-duplicated server-side).\n\t *\n\t * **Single round-trip**\n\t * The entire `segment_ids` array is sent in one request. Two segments\n\t * cost the same as one in terms of network latency and rate-limit\n\t * consumption (one call = one rate-limit slot, regardless of how many\n\t * segments).\n\t *\n\t * **Shared semantics with `checkSegmentMatch`**\n\t * Both methods wrap the same underlying server endpoint and share\n\t * the same caching, refresh, rate-limit, and ambiguity behavior. See\n\t * {@link checkSegmentMatch} for: no client cache · no push event for\n\t * membership changes · behavioral segments have batch lag · rate\n\t * limit (10 requests / 60 s, ~5 s minimum gap between calls) ·\n\t * `is_matching: false` doesn't distinguish \"not in segment\" from\n\t * \"segment doesn't exist for this label\".\n\t *\n\t * **Idempotency**: safe. Read-only. No side effects.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param segment_ids Array of segment IDs to check. Duplicates are\n\t * silently de-duplicated server-side. Segment IDs\n\t * are label-scoped — use the IDs configured for\n\t * your label.\n\t * @returns Array of `{ segment_id, is_matching }` results.\n\t * Order is NOT guaranteed; correlate by\n\t * `segment_id`. Length may be less than the input\n\t * when duplicate IDs were sent.\n\t *\n\t * @example\n\t * ```ts\n\t * const segmentIds = [vipSegmentId, newPlayerSegmentId, freeRollSegmentId];\n\t * const results = await window._smartico.api.checkSegmentListMatch(segmentIds);\n\t *\n\t * // Always correlate by segment_id — the response order is unspecified.\n\t * const byId = new Map(results.map(r => [r.segment_id, r.is_matching]));\n\t *\n\t * if (byId.get(vipSegmentId)) {\n\t * console.log('[smartico] user is in VIP segment — render VIP surface');\n\t * }\n\t * if (byId.get(newPlayerSegmentId) && byId.get(freeRollSegmentId)) {\n\t * console.log('[smartico] new player AND eligible for free roll — show the welcome promo');\n\t * }\n\t *\n\t * // Cache the result map for the session; refresh on material state changes.\n\t * ```\n\t */\n\tpublic async checkSegmentListMatch(segment_ids: number[]): Promise<TSegmentCheckResult[]> {\n\t\treturn await this.api.coreCheckSegments(this.userExtId, Array.isArray(segment_ids) ? segment_ids : [segment_ids]);\n\t}\n\n\t/**\n\t * Returns the full level ladder configured for the current label —\n\t * one `TLevel` per active level, server-sorted by `required_points`\n\t * ASC (lowest first; `ordinal_position` is a 1-based index into the\n\t * returned array). Use this to render a level map / progression\n\t * screen, or as a lookup table to resolve `ach_level_current_id` from\n\t * {@link getUserProfile} into a richer level object.\n\t *\n\t * @remarks\n\t * **Server-side filtering**\n\t * The server returns ALL active levels for the label. There is NO\n\t * per-user filtering on visibility, level-status, or anything else —\n\t * the response is identical across users of the same label. Apply\n\t * `visibility_points` filtering client-side if you want to hide\n\t * not-yet-reached levels (compare against\n\t * `getUserProfile().ach_points_ever` and exclude levels where\n\t * `visibility_points > ach_points_ever`).\n\t *\n\t * **Sort order**\n\t * The returned array is already sorted by `required_points` ASC, and\n\t * `ordinal_position` is a 1-based index into that same sort order —\n\t * client-side re-sorting is not required for the default rendering.\n\t * If your label uses sliding-window leveling logic\n\t * (see {@link getUserLevelExtraCounters}) and you want to sort by\n\t * a multi-criteria key (`required_points`, then\n\t * `required_level_counter_1`, then `required_level_counter_2`), do\n\t * that client-side.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout. Operator-driven level edits\n\t * surface on the next cache miss.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only metadata. Calls\n\t * within the cache window de-duplicate to the same cached array.\n\t *\n\t * **UI guidance**: see [UI Guide — `getLevels`](../../docs/ui/user/UIGuide_getLevels.md).\n\t *\n\t * **Visitor mode**: supported. Use `_smartico.vapi(lang).getLevels()`\n\t * to fetch the ladder for anonymous viewers; the level configuration\n\t * is label-scoped static data so the response is meaningful even\n\t * without an authenticated user. Per-user fields (the implicit\n\t * \"current level\" via {@link getCurrentLevel}, or the user's progress)\n\t * are not available in visitor mode.\n\t *\n\t * @returns Promise resolving to the ordered `TLevel[]` ladder. Empty\n\t * if no levels are configured for the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const [levels, profile] = await Promise.all([\n\t * window._smartico.api.getLevels(),\n\t * Promise.resolve(window._smartico.api.getUserProfile()),\n\t * ]);\n\t *\n\t * // Resolve the user's current level by ID.\n\t * const current = levels.find(l => l.id === profile.ach_level_current_id);\n\t * console.log('[smartico] render header badge — current level:', current?.name,\n\t * '(position', current?.ordinal_position, 'of', levels.length, ')');\n\t *\n\t * // Filter to levels the user has unlocked enough to see.\n\t * const visible = levels.filter(l =>\n\t * l.visibility_points == null || l.visibility_points <= profile.ach_points_ever\n\t * );\n\t * console.log('[smartico] render the level map with', visible.length, 'visible tiles');\n\t *\n\t * // Visitor-mode equivalent: returns the same ladder; no per-user state.\n\t * // const visitorLevels = await window._smartico.vapi('EN').getLevels();\n\t * ```\n\t */\n\tpublic async getLevels(): Promise<TLevel[]> {\n\t\treturn OCache.use(onUpdateContextKey.Levels, ECacheContext.WSAPI, () => this.api.levelsGetT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the user's current level — every `TLevel` field plus a\n\t * computed `progress` percentage toward the next level. Use this to\n\t * power a level badge with a progress bar.\n\t *\n\t * @remarks\n\t * **How `progress` is computed**\n\t * The SDK derives `progress` as the *delta-from-current-level-floor*:\n\t * `(ach_points_ever − current.required_points) / (next.required_points\n\t * − current.required_points) × 100`, clamped to `[0, 100]`. At the\n\t * highest level (no next level), `progress` is `100`. Reading the\n\t * source values directly from {@link getUserProfile}'s\n\t * `ach_points_ever` and {@link getLevels} would also work, but\n\t * `progress` saves the math.\n\t *\n\t * **Cache TTL & freshness**\n\t * The response is cached for 30 seconds, but the SDK automatically\n\t * drops that cache whenever a user-properties update arrives — the\n\t * same live channel that backs {@link getUserProfile}. The practical\n\t * effect depends on the label's leveling logic:\n\t * - **Points-based or operator-manual leveling**: a points or level\n\t * change flows through the user-properties channel, so the cache is\n\t * busted at that moment and the next `getCurrentLevel()` call\n\t * returns up-to-date data without waiting out the TTL.\n\t * - **Counter-based leveling** (level driven by sliding-window\n\t * counters such as deposit or wagering totals over a recent window —\n\t * see {@link getUserLevelExtraCounters}): ordinary progress changes\n\t * are recomputed by a periodic server job and do NOT emit a\n\t * user-properties update, so they become visible on this method only\n\t * after the 30 s TTL expires (or after `_smartico.api.clearCaches()`).\n\t *\n\t * Avoid calling `clearCaches()` on the points/manual path — it's\n\t * unnecessary there (the cache is already refreshed on the property\n\t * update) and forces a slower extra round-trip.\n\t *\n\t * **Leveling logic**\n\t * The semantics of how a user advances depends on the label's\n\t * leveling logic (configured per brand): points-only (the default),\n\t * sliding-window with extra counters (uses\n\t * {@link getUserLevelExtraCounters}), or fully-manual operator\n\t * assignment. The `progress` percentage on this method assumes the\n\t * points-only model — it's not meaningful for manual-only labels\n\t * where level changes are operator-driven rather than points-driven.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached value without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure read.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns Promise resolving to `TLevelCurrent` — the current level\n\t * plus `progress: number` (0–100).\n\t *\n\t * @example\n\t * ```ts\n\t * const level = await window._smartico.api.getCurrentLevel();\n\t * console.log('[smartico] render level badge — name:', level.name,\n\t * 'progress:', Math.round(level.progress), '%');\n\t *\n\t * // Detect level-up via getUserProfile's push channel. No clearCaches()\n\t * // needed — the SDK already drops the level cache on this update.\n\t * window._smartico.on('props_change', async (changed) => {\n\t * if ('ach_level_current_id' in changed) {\n\t * const fresh = await window._smartico.api.getCurrentLevel();\n\t * console.log('[smartico] user levelled up — animate badge to new level:', fresh.name);\n\t * }\n\t * });\n\t * ```\n\t */\n\tpublic async getCurrentLevel(): Promise<TLevelCurrent> {\n\t\treturn OCache.use(onUpdateContextKey.CurrentLevel, ECacheContext.WSAPI, () => this.api.getLevelCurrent(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the user's current values for the two label-defined \"extra\n\t * counters\" used by sliding-window leveling logic. Operators\n\t * configure what each counter means per label (e.g. `level_counter_1`\n\t * = total deposits in the last 30 days, `level_counter_2` = total\n\t * wagering in the last 30 days). Compare against\n\t * `required_level_counter_1` / `_2` on the next level from\n\t * {@link getLevels} to know how close the user is to advancing.\n\t *\n\t * @remarks\n\t * **When this matters**\n\t * Only labels configured for sliding-window leveling populate the\n\t * counter fields. On the default points-only leveling model, both\n\t * `level_counter_1` and `level_counter_2` are `undefined`. Detect\n\t * a points-only label by either counter being `undefined`.\n\t *\n\t * **Counter semantics — operator-defined**\n\t * The SDK exposes raw numeric values; the meaning of each counter\n\t * (deposit amount, wager amount, lifetime spend, etc.) is fully\n\t * operator-defined per label. Resolve labels for display via\n\t * `getTranslations` — the operator's display strings are\n\t * stored under the translation keys `levelsCounter1Name` and\n\t * `levelsCounter2Name`.\n\t *\n\t * **Refresh cadence**\n\t * Sliding-window counters are recomputed by a periodic server-side\n\t * job. Its rebuild cadence is operator-configured per brand —\n\t * commonly daily, though it can be set more frequent — so level\n\t * transitions driven by counter changes surface with a latency tied\n\t * to that rebuild schedule after the underlying activity (e.g. a\n\t * deposit), not in real time.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached value without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure read.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns Promise resolving to `UserLevelExtraCountersT`. Both\n\t * fields are `undefined` on labels not using sliding-window\n\t * leveling.\n\t *\n\t * @example\n\t * ```ts\n\t * const [counters, levels, profile] = await Promise.all([\n\t * window._smartico.api.getUserLevelExtraCounters(),\n\t * window._smartico.api.getLevels(),\n\t * Promise.resolve(window._smartico.api.getUserProfile()),\n\t * ]);\n\t *\n\t * // Quick detection: undefined means this label doesn't use sliding-window leveling.\n\t * if (counters.level_counter_1 === undefined) {\n\t * console.log('[smartico] points-only label — skip counter UI; show points progress only');\n\t * return;\n\t * }\n\t *\n\t * // Find the next level and render a 3-bar progress block.\n\t * const currentIdx = levels.findIndex(l => l.id === profile.ach_level_current_id);\n\t * const next = levels[currentIdx + 1];\n\t * if (next) {\n\t * console.log('[smartico] render points bar:', profile.ach_points_ever, '/', next.required_points);\n\t * if (next.required_level_counter_1) {\n\t * console.log('[smartico] render counter 1 bar:', counters.level_counter_1, '/', next.required_level_counter_1);\n\t * }\n\t * if (next.required_level_counter_2) {\n\t * console.log('[smartico] render counter 2 bar:', counters.level_counter_2, '/', next.required_level_counter_2);\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async getUserLevelExtraCounters(): Promise<UserLevelExtraCountersT> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.LevelExtraCounters,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getUserGamificationInfoT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the user's unified balance-change history — every points, gems, and\n\t * diamonds transaction within the requested time window, ordered newest-first.\n\t * Use to power an \"Activity\" / \"History\" tab showing wins, claims, purchases,\n\t * level-up rewards, and operator adjustments.\n\t *\n\t * The returned shape is the same regardless of currency type — `type` (see\n\t * {@link UserBalanceType}) distinguishes points / gems / diamonds and\n\t * `source_type_id` (see {@link PointChangeSourceType}) names the originating\n\t * event.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not guarded at the SDK level\n\t * but is not meaningful — activity is per-user.\n\t *\n\t * **Pagination — `from` / `to` are offset + ceiling, not timestamps**\n\t * The SDK derives `offset = from`, `limit = min(to - from, 50)` — the server\n\t * hard-caps a single response at 50 entries. For infinite scroll, advance\n\t * `from` by 50 between calls. Both `startTimeSeconds` and `endTimeSeconds`\n\t * are epoch seconds bounding the window the server scans.\n\t *\n\t * **Subscription model (`onUpdate`)**\n\t * The callback fires when the user's `ach_points_balance`,\n\t * `ach_gems_balance`, or `ach_diamonds_balance` changes (i.e. whenever a\n\t * wallet event lands). The pushed payload is a FIXED re-fetch of the\n\t * **last 10 minutes / first 50 entries** — it does NOT honor the original\n\t * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to`. Consumers\n\t * maintaining a long historical view must re-call `getActivityLog` with\n\t * their own params after receiving an `onUpdate` notification.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - Push triggers fire only on balance changes; transactions that don't\n\t * alter a balance (theoretical zero-amount entries) won't refresh.\n\t *\n\t * **Visitor mode**: not meaningful (no per-user history available).\n\t *\n\t * **UI guidance**: see [UI Guide — `getActivityLog`](../../docs/ui/user/UIGuide_getActivityLog.md).\n\t *\n\t * @returns Array of {@link TActivityLog} ordered newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const now = Math.floor(Date.now() / 1000);\n\t * const start = now - 86400 * 30; // 30 days\n\t *\n\t * const log = await window._smartico.api.getActivityLog({\n\t * startTimeSeconds: start,\n\t * endTimeSeconds: now,\n\t * from: 0,\n\t * to: 50,\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] wallet changed — refreshed payload is last 10 min / 50 entries:', refreshed.length, 'rows');\n\t * // If the consumer is showing a full 30-day view, re-call getActivityLog with the original params here.\n\t * },\n\t * });\n\t *\n\t * for (const row of log) {\n\t * const sign = row.amount >= 0 ? '+' : '';\n\t * console.log('[smartico] activity row — render with', row.type === 0 ? 'points' : row.type === 1 ? 'gems' : 'diamonds', 'icon, color by sign:', sign + row.amount, 'balance after:', row.balance, 'source:', row.source_type_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getActivityLog({\n\t\tstartTimeSeconds,\n\t\tendTimeSeconds,\n\t\tfrom,\n\t\tto,\n\t\tonUpdate,\n\t}: {\n\t\t/** Window start in epoch seconds. */\n\t\tstartTimeSeconds: number;\n\t\t/** Window end in epoch seconds. */\n\t\tendTimeSeconds: number;\n\t\t/** Pagination offset (0-based). */\n\t\tfrom: number;\n\t\t/** Pagination ceiling (exclusive); server caps `to - from` at 50. */\n\t\tto: number;\n\t\t/** Optional push callback; payload is a fixed 10-min / 50-entry refresh on every wallet change (see Subscription model). */\n\t\tonUpdate?: (data: TActivityLog[]) => void;\n\t}): Promise<TActivityLog[]> {\n\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.ActivityLog, onUpdate);\n\t\t}\n\n\t\treturn await OCache.use(\n\t\t\tonUpdateContextKey.ActivityLog,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getActivityLogT(this.userExtId, startTimeSeconds, endTimeSeconds, from, to),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\tprotected async notifyActivityLogUpdate() {\n\t\tconst startSeconds = Date.now() / 1000 - 600;\n\t\tconst endSeconds = Date.now() / 1000;\n\t\tconst payload = await this.api.getActivityLogT(this.userExtId, startSeconds, endSeconds, 0, 50);\n\n\t\tthis.updateEntity(onUpdateContextKey.ActivityLog, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTGetTranslations,\n\tTUICustomSection,\n} from './WSAPITypes';\nimport { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIUser } from './WSAPIUser';\n\n/** @group General */\nexport class WSAPIGeneral extends WSAPIUser {\n\t/**\n\t * Returns the operator-configured \"custom sections\" the current user is eligible\n\t * to see. Custom sections are nav-level entries the operator builds in the BO —\n\t * HTML pages, themed mission grids, store / raffle / tournament category pages,\n\t * lootbox calendars, redirect links, and Liquid-templated dashboards — each\n\t * surfaced with its own icon and label.\n\t *\n\t * Use the response to build the side menu / bottom-bar / nav grid of a\n\t * gamification widget. Each section's `section_type_id` (see\n\t * {@link AchCustomSectionType}) tells the consumer which page component to mount\n\t * when the user opens the section.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls. Typically fetched once at app boot to build the\n\t * navigation skeleton.\n\t *\n\t * **Server-side eligibility filtering**\n\t * Sections are filtered server-side by the user's segments / level / brand and\n\t * the section's `active_from_date` / `active_till_date` window. Sections the\n\t * user is ineligible for are omitted from the response entirely — there is no\n\t * \"locked\" state to render.\n\t *\n\t * **Ordering**\n\t * Response is server-ordered. Render in the order received; do NOT re-sort\n\t * client-side (the operator's order is the intended nav order).\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - No push subscription. Re-call after a segment / level change might\n\t * make new sections eligible, or just rely on the 30 s cache turnover.\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getCustomSections`](../../docs/ui/general/UIGuide_getCustomSections.md).\n\t *\n\t * @returns Array of {@link TUICustomSection} — empty if the label has no\n\t * active custom sections or the user is ineligible for all of them.\n\t *\n\t * @example\n\t * ```ts\n\t * const sections = await window._smartico.api.getCustomSections();\n\t *\n\t * for (const s of sections) {\n\t * console.log('[smartico] nav entry', s.menu_name, 'type', s.section_type_id, '→ mount the matching page component');\n\t * // Render s.menu_img (64x64) as the nav icon and s.menu_name as the label.\n\t * // For section_type_id === AchCustomSectionType.REDIRECT_LINK, do NOT mount a page —\n\t * // resolve s.url_or_dp on click (DP string or external URL).\n\t * }\n\t * ```\n\t */\n\tpublic async getCustomSections(): Promise<TUICustomSection[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.CustomSections,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.customSectionsGetT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full set of operator-defined translation key/value pairs for the\n\t * label, merged across the requested language and the English baseline.\n\t *\n\t * Translation keys are free-form strings defined by the operator in the BO. The\n\t * SDK consumer treats the result as a flat dictionary: `translations[key]`. If\n\t * the key is missing entirely, do NOT trust `undefined` semantics — defensively\n\t * fall back to the key string itself or a hardcoded literal.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls.\n\t * - `lang_code` is the ISO language code the operator uses in the BO\n\t * (e.g. `\"EN\"`, `\"FR\"`, `\"ES\"`). Case is not normalised — match what the\n\t * operator configured.\n\t *\n\t * **EN fallback**\n\t * The SDK issues an English-baseline fetch first, then overlays the\n\t * `lang_code` translations on top. Any key the operator has only defined in\n\t * English (i.e. missing in the requested language) is returned with the\n\t * English value. Keys missing in both are absent from the map — the consumer\n\t * must handle missing keys (the default Smartico UI returns the key string\n\t * itself as the fallback text).\n\t *\n\t * **What's included**\n\t * The SDK passes an empty `areas` filter to the server, which returns ALL\n\t * translation namespaces configured for the label (Gamification, Casino,\n\t * Trading, Affiliation, etc. — whichever are populated). For a Gamification-\n\t * only widget, the consumer can ignore unused namespaces — keys are flat\n\t * strings, not nested.\n\t *\n\t * **Refresh**\n\t * - Cached internally per `(lang_code, label, brand)` for ~30 seconds.\n\t * - No push subscription. Operators editing translations in the BO will see\n\t * the change after the cache window expires.\n\t *\n\t * **Visitor mode**: supported. Translations are label-scoped, not user-\n\t * scoped — `lang_code` is the sole language selector and is independent of\n\t * the `vapi(lang)` argument used elsewhere.\n\t *\n\t * @param lang_code ISO language code (e.g. `\"EN\"`, `\"FR\"`). Defaults to\n\t * `\"EN\"` server-side if empty.\n\t * @returns {@link TGetTranslations} — `{ translations: { [key]: string } }`.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.getTranslations('FR');\n\t *\n\t * // Defensive lookup: fall back to the key itself if the operator hasn't\n\t * // defined the string.\n\t * const t = (k: string) => r.translations[k] ?? k;\n\t *\n\t * console.log('[smartico] localized label \"missions_title\" →', t('missions_title'));\n\t * ```\n\t */\n\tpublic async getTranslations(lang_code: string): Promise<TGetTranslations> {\n\t\tconst r = await this.api.getTranslationsT(this.userExtId, lang_code, []);\n\n\t\treturn {\n\t\t\ttranslations: r.translations,\n\t\t};\n\t}\n\n\t/**\n\t * Returns the missions and tournaments associated with a casino / sportsbook\n\t * game in the operator's games catalog — the reverse of \"given this mission,\n\t * which games count for it\" — so you can surface \"play this game to progress\n\t * mission X\" / \"tournament Y features this game\" badges on game tiles or\n\t * detail screens.\n\t *\n\t * The shape mirrors `getMissions` (`UserAchievement[]`) and `getTournamentsList`\n\t * (`Tournament[]`) — same wire types, no reduced subset.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - `related_game_id` must be a Games Catalog ID (the same external string the\n\t * operator uses in the catalog at\n\t * {@link https://help.smartico.ai/welcome/technical-guides/games-catalog-api}).\n\t *\n\t * **Server-side eligibility filtering**\n\t * Missions and tournaments are filtered by the user's segments / level / brand\n\t * before being returned. A user who is ineligible for a mission segment will\n\t * NOT see that mission in the result even if it lists the game. The same\n\t * filtering applies to tournaments. Treat the response as \"what this user\n\t * should see\" — no client-side eligibility pass needed.\n\t *\n\t * **No cache**\n\t * Every call is a live server round-trip. Missions/tournaments are operator-\n\t * mutated state (opt-in, completion, expiry) that changes during a session;\n\t * caching staler than the user's last action would mis-render eligibility.\n\t * Avoid building a consumer-side cache for UI-critical paths.\n\t *\n\t * **Refresh**\n\t * - Re-call when the user navigates to a new game tile / detail surface.\n\t * - Re-call after the user opts into / completes a related mission to refresh\n\t * the \"play this game\" badge.\n\t *\n\t * **Visitor mode**: supported via `_smartico.vapi(lang).getRelatedItemsForGame(...)`.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRelatedItemsForGame`](../../docs/ui/general/UIGuide_getRelatedItemsForGame.md).\n\t *\n\t * @param related_game_id External Games Catalog ID of the game (e.g. `\"gold-slot2\"`).\n\t * @returns {@link GetRelatedAchTourResponse} — `{ achievements, tournaments? }`.\n\t * `tournaments` may be `undefined` (treat as empty); both arrays may be empty\n\t * when no eligible entities reference the game.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.getRelatedItemsForGame('gold-slot2');\n\t *\n\t * const missions = r.achievements ?? [];\n\t * const tournaments = r.tournaments ?? [];\n\t *\n\t * if (missions.length === 0 && tournaments.length === 0) {\n\t * console.log('[smartico] no related missions / tournaments — hide the related badge on the game tile');\n\t * } else {\n\t * console.log('[smartico] related entities:', missions.length, 'missions /', tournaments.length, 'tournaments — show a \"X missions / Y tournaments\" badge');\n\t * }\n\t * ```\n\t */\n\tpublic async getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse> {\n\t\tconst result = await this.api.getRelatedItemsForGame(this.userExtId, related_game_id);\n\t\treturn result;\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTAchCategory,\n\tTMissionClaimRewardResult,\n\tTMissionOptInResult,\n\tTMissionOrBadge,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIGeneral } from './WSAPIGeneral';\n\n/** @group Missions */\nexport class WSAPIMissions extends WSAPIGeneral {\n\t/**\n\t * Returns all missions visible to the current user, scoped server-side\n\t * to what the user is qualified to see. Optionally subscribes to live\n\t * updates via `onUpdate`: the callback is invoked with the full, refreshed\n\t * mission array whenever the server pushes a mission-state-changing event.\n\t *\n\t * The returned list is the canonical source of truth for mission state\n\t * (`is_opted_in`, `progress`, `is_completed`, `completion_count`, etc.).\n\t * Consumers should NEVER mutate it optimistically — always wait for the\n\t * `onUpdate` callback (or a fresh `getMissions()` call after the 30s cache\n\t * window expires) to observe the new state.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed mission array (never a\n\t * diff/patch). Each subsequent call to `getMissions({ onUpdate })`\n\t * REPLACES the prior callback — only one active subscriber at a time.\n\t * Pass `onUpdate: undefined` (or omit it) to keep the prior callback in\n\t * place; the callback is never auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t * 1. **Mutation responses**: `requestMissionOptIn(...)` or\n\t * `requestMissionClaimReward(...)` resolves (any `err_code`).\n\t * 2. **Asynchronous server pushes**: a user activity (deposit, bet,\n\t * login, etc.) advances task progress on a task configured to push\n\t * updates, or completes a mission.\n\t * 3. **Visibility changes**: the user's level changes, or other\n\t * gamification visibility tags change.\n\t *\n\t * Operator-side BO mission-config edits do NOT push to connected\n\t * clients — those changes surface only on the next cache miss (after\n\t * the 30 s TTL) or alongside the next trigger from (1)–(3).\n\t *\n\t * **What's in the returned list / what's filtered server-side**\n\t * The response is pre-filtered by the server. Missions EXCLUDED before\n\t * reaching the SDK:\n\t * - Missions in `DRAFT` or `ARCHIVED` status (see {@link AchievementStatus}).\n\t * - Missions where the user fails visibility conditions. Exception:\n\t * completed missions may remain visible after the user no longer\n\t * qualifies (configurable per-brand).\n\t * - `FEATURED_MANUALLY` missions that are still locked — they appear\n\t * only after the user unlocks them.\n\t * - Locked missions configured to hide while locked — UNLESS the\n\t * mission is configured to expose immediately on unlock (then the\n\t * locked mission is included as a teaser).\n\t * - `RECURRING` missions between cycles, until the next cycle starts.\n\t * - `RECURRING_QUANTITY` missions outside their `active_from_ts` /\n\t * `active_till_ts` window.\n\t *\n\t * Client-side filtering you may still want: missions with\n\t * `only_in_custom_section: true` are intended for their custom-section\n\t * view only and should be hidden from the main mission list.\n\t *\n\t * **Reading state from the returned mission**\n\t * Drive availability chips (\"missed\", \"coming soon\", \"needs opt-in\",\n\t * \"in progress\", \"expired\") from `availability_status` (enum\n\t * {@link AchievementAvailabilityStatus}) — it's the canonical derived\n\t * state and reflects all server-side timing/visibility rules in one\n\t * field. For time-limited and recurring missions, `dt_start` doubles\n\t * as the opt-in timestamp (for opt-in missions) or unlock timestamp\n\t * (for previously-locked missions); the expiration of a time-limited\n\t * mission is `dt_start + time_limit_ms`. `next_recurrence_date_ts`\n\t * is populated for `RECURRING` / `RECURRING_QUANTITY` missions but\n\t * is no longer meaningful once the mission's `active_till_ts` has\n\t * passed.\n\t *\n\t * **Refresh after a mutation**\n\t * After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`\n\t * resolves, the SDK auto-refreshes the mission cache; the `onUpdate`\n\t * callback fires with the new array shortly after. `is_opted_in`,\n\t * `progress`, and `is_completed` flip on the refreshed mission — do\n\t * NOT mutate them optimistically while the round-trip is pending.\n\t * Render any pending state from your own loading flag.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMissions`](../../docs/ui/missions/UIGuide_getMissions.md).\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * mission array on every server-pushed update\n\t * (after opt-in / claim-reward calls, or when\n\t * the server pushes an asynchronous\n\t * mission-state change). Each call to\n\t * `getMissions` overwrites the prior callback.\n\t * Never fires in visitor mode.\n\t * @returns Promise resolving to the current list of\n\t * missions visible to the user. Empty array if\n\t * the user has no missions (or if the visitor\n\t * proxy user has none configured).\n\t *\n\t * @example\n\t * ```ts\n\t * // 1. Initial fetch + subscribe to live updates\n\t * const missions = await window._smartico.api.getMissions({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] mission list refreshed — re-render the entire mission list UI from this array, do not merge with prior state:', refreshed);\n\t *\n\t * // 2. onUpdate fires for: opt-in/claim responses, task-progress\n\t * // pushes that complete a mission or move a \"pushToClient\" task,\n\t * // and user-level changes. Treat each call as authoritative.\n\t * const claimable = refreshed.filter(m =>\n\t * m.is_completed && m.requires_prize_claim && !m.prize_claimed_date_ts,\n\t * );\n\t * if (claimable.length > 0) {\n\t * console.log('[smartico] there are unclaimed mission prizes — surface a \"Claim\" CTA on each of these missions:', claimable.map(m => m.id));\n\t * }\n\t * },\n\t * });\n\t *\n\t * // 3. Filter/render from the returned list. The server already excludes\n\t * // DRAFT/ARCHIVED missions and ones the user can't see. You may need\n\t * // client-side filters for view-specific concerns (custom sections,\n\t * // completed/missed tabs).\n\t * const generalView = missions\n\t * .filter(m => !m.only_in_custom_section)\n\t * .sort((a, b) => (a.position ?? 0) - (b.position ?? 0));\n\t *\n\t * console.log('[smartico] initial mission list ready — render', generalView.length, 'missions sorted by position');\n\t *\n\t * // 4. Visitor-mode equivalent: onUpdate is accepted but never fires.\n\t * // Re-poll if you need fresh data.\n\t * // const visitorMissions = await window._smartico.vapi('EN').getMissions();\n\t * // console.log('[smartico] visitor missions are the brand proxy user\\'s — per-user fields are not meaningful');\n\t * ```\n\t */\n\tpublic async getMissions({ onUpdate }: { onUpdate?: (data: TMissionOrBadge[]) => void } = {}): Promise<TMissionOrBadge[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Missions, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.Missions,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.missionsGetItemsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns all the badges available to the current user.\n\t *\n\t * Badges are completion-tracked achievements that auto-unlock once the user\n\t * meets their criteria — there is no opt-in step, no claim step, and no\n\t * task-description reveal. Contrast with {@link getMissions}, which returns\n\t * the same `TMissionOrBadge[]` shape but represents explicit opt-in flows.\n\t *\n\t * @remarks\n\t * **Why no `onUpdate` callback?**\n\t * Unlike `getMissions({ onUpdate })`, this method does NOT accept an\n\t * `onUpdate` subscription. Internally the SDK never refreshes the `Badges`\n\t * cache from server pushes: the achievement-related push events\n\t * (mission opt-in / claim / reload) refresh the missions cache, NOT\n\t * the badges cache. The badges cache is flushed only by:\n\t * - its 30-second TTL\n\t * - a full SDK cache wipe at login / logout\n\t *\n\t * **How to refresh the badge list**\n\t * If you need near-live badge state, poll manually after the TTL expires.\n\t * The first call inside the 30 s window returns the cached payload; the\n\t * first call after the TTL triggers a fresh server round-trip. Example:\n\t * ```ts\n\t * setInterval(async () => {\n\t * const badges = await window._smartico.api.getBadges();\n\t * console.log('[smartico] badge list polled — re-render badge grid from this array', badges);\n\t * }, 30_000);\n\t * ```\n\t * Alternatively, re-fetch on a domain event your app already handles\n\t * (e.g. after the user finishes a game round or claims a bonus).\n\t *\n\t * **Differences from missions** (same `TMissionOrBadge` shape, different\n\t * feature)\n\t * The opt-in, claim, recurring-cycle, and unlock-description fields on\n\t * the returned objects are not populated for badges; treat their values\n\t * as undefined / default. Time windows are absolute calendar timestamps\n\t * (`active_from_ts` / `active_till_ts`), not opt-in-relative durations —\n\t * drive availability chips from the SDK-computed `badgeTimeLimitState`\n\t * (enum {@link BadgesTimeLimitStates}), not `time_limit_ms`. Locking for\n\t * badges is purely time-based: `is_locked` is `true` only when\n\t * `badgeTimeLimitState === BadgesTimeLimitStates.BeforeStartDate` (the\n\t * time window hasn't started yet). The primary navigation field is\n\t * `category_ids` — call {@link getAchCategories} to resolve category\n\t * metadata and group badges by category.\n\t *\n\t * **Idempotency / Side effects**: fetch-only; safe to call repeatedly.\n\t * The cache layer deduplicates concurrent calls within the TTL window.\n\t *\n\t * **Visitor mode**: not supported. Badges are an authenticated-only\n\t * feature; calling this on the visitor-mode handle (`_smartico.vapi`)\n\t * throws synchronously rather than silently returning an empty list.\n\t *\n\t * **UI guidance**: see [UI Guide — `getBadges`](../../docs/ui/missions/UIGuide_getBadges.md).\n\t *\n\t * @throws `Error(\"getBadges is not available in visitor mode\")` when\n\t * called from a visitor-mode session.\n\t * @returns Promise resolving to `TMissionOrBadge[]`. Every item has\n\t * `type === 'badge'`. Cached for 30 s under the `Badges` key.\n\t *\n\t * @example\n\t * ```ts\n\t * const [badges, categories] = await Promise.all([\n\t * window._smartico.api.getBadges(),\n\t * window._smartico.api.getAchCategories(),\n\t * ]);\n\t *\n\t * console.log('[smartico] badges fetched — render grouped grid with', badges.length, 'badges across', categories.length, 'categories');\n\t *\n\t * for (const category of categories) {\n\t * const inCategory = badges.filter(b => b.category_ids?.includes(category.id));\n\t * const completed = inCategory.filter(b => b.is_completed).length;\n\t * console.log(`[smartico] render category section \"${category.name}\" header showing ${completed}/${inCategory.length}`);\n\t *\n\t * for (const badge of inCategory) {\n\t * // Use badgeTimeLimitState (not time_limit_ms) for availability chip\n\t * if (badge.badgeTimeLimitState === 0) { // BadgesTimeLimitStates.BeforeStartDate\n\t * console.log('[smartico] badge not yet started — render grayscaled card with \"Starts on\" chip for badge', badge.id);\n\t * } else if (badge.is_completed) {\n\t * console.log('[smartico] badge completed — render with completed styling and check-mark for badge', badge.id);\n\t * } else {\n\t * console.log('[smartico] badge in progress — render with stage counter (completed_tasks / total) for badge', badge.id);\n\t * }\n\t * }\n\t * }\n\t *\n\t * // No onUpdate available — poll if live state matters\n\t * setInterval(async () => {\n\t * try {\n\t * const fresh = await window._smartico.api.getBadges();\n\t * console.log('[smartico] badge poll tick — diff against previous list and re-render any changed badge cards', fresh);\n\t * } catch (e) {\n\t * console.error('[smartico] badge poll failed — keep showing last known state, retry on next tick:', e);\n\t * }\n\t * }, 30_000);\n\t * ```\n\t */\n\tpublic async getBadges(): Promise<TMissionOrBadge[]> {\n\t\t// Badges are an authenticated-only feature. The visitor-mode WSAPI\n\t\t// instance (`_smartico.vapi`) is constructed without a tracker, so the\n\t\t// server would silently return nothing; throw a clear error instead.\n\t\tif (!this.api.tracker) {\n\t\t\tthrow new Error('getBadges is not available in visitor mode');\n\t\t}\n\t\treturn OCache.use(onUpdateContextKey.Badges, ECacheContext.WSAPI, () => this.api.badgetsGetItemsT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the list of active mission/badge categories configured for the current label.\n\t * Categories are operator-defined groupings used to organize missions and badges into\n\t * sections, tabs, or filter chips in the gamification UI. The same category list serves\n\t * BOTH missions and badges — there is no separate \"mission categories\" vs \"badge\n\t * categories\" split on the server.\n\t *\n\t * @remarks\n\t * **What categories are**\n\t * - Operator-defined groupings, configured per-label by the brand operator.\n\t * Only active categories are returned; inactive/deleted ones are filtered out.\n\t * - Each `TAchCategory` exposes `{ id, name, order }`. `name` is the display label;\n\t * `order` is the relative position (lower = appears first).\n\t * - The same array covers BOTH missions and badges — categories are not filtered by\n\t * entity type on the server.\n\t *\n\t * **Localization / translation**\n\t * - `name` is **pre-translated server-side** to the authenticated user's stored language.\n\t * In visitor mode, the language passed to `_smartico.vapi(lang)` drives the\n\t * translation. Consumers never need to translate `name` themselves.\n\t * - Fallback if no translation exists for the user's language: the brand's EN value\n\t * is returned. The field is never null.\n\t *\n\t * **Sort order**\n\t * The server does NOT pre-sort. Sort client-side before rendering:\n\t * `categories.sort((a, b) => a.order - b.order)`.\n\t *\n\t * **How missions/badges join to categories**\n\t * Each `TMissionOrBadge` exposes `category_ids: number[]` (zero-or-more,\n\t * many-to-many). A single mission/badge can belong to multiple categories\n\t * simultaneously, or to none. To render a \"category → items\" view:\n\t * `missions.filter(m => m.category_ids.includes(cat.id))`.\n\t *\n\t * **Uncategorized items**\n\t * Items with `category_ids: []` are NOT represented by a synthetic \"Other\" entry.\n\t * If your UI needs one, generate it client-side by checking\n\t * `item.category_ids.length === 0`.\n\t *\n\t * **Empty categories**\n\t * A category may be returned even if zero missions/badges reference it. Filter\n\t * out empty categories on the consumer side if you don't want to render section\n\t * headers for them.\n\t *\n\t * **Refresh cadence / cache**\n\t * - The SDK caches the response for 30 seconds. Subsequent calls within that\n\t * window return the cached array without a network round-trip.\n\t * - The cache is NOT invalidated by mission/badge push events — operator-driven\n\t * category changes propagate at the next 30 s cache miss.\n\t * - Cache is fully cleared on login / logout.\n\t * - In **visitor mode** additional server-side caching applies on top of the\n\t * SDK cache; worst-case staleness for an edited/added category is on the order\n\t * of a few minutes for anonymous viewers.\n\t *\n\t * **Idempotency**: safe. Read-only metadata fetch. Cache de-duplicates concurrent calls.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAchCategories`](../../docs/ui/missions/UIGuide_getAchCategories.md).\n\t *\n\t * @returns Array of `{ id, name, order }`. Empty array if no active categories are\n\t * configured for the label. `name` is pre-translated. Order is NOT applied — caller\n\t * must sort.\n\t *\n\t * @example\n\t * ```ts\n\t * const categories = await window._smartico.api.getAchCategories();\n\t *\n\t * if (categories.length === 0) {\n\t * console.log('[smartico] no categories configured — render missions/badges as a flat list without section headers');\n\t * } else {\n\t * const sorted = [...categories].sort((a, b) => a.order - b.order);\n\t * console.log('[smartico] categories loaded — render one tab/section per entry in this order:', sorted.map(c => c.name));\n\t *\n\t * // Join to missions: render each category as a section\n\t * const missions = await window._smartico.api.getMissions();\n\t * for (const cat of sorted) {\n\t * const items = missions.filter(m => m.category_ids.includes(cat.id));\n\t * if (items.length === 0) {\n\t * console.log('[smartico] category has no missions — skip rendering its section header:', cat.name);\n\t * continue;\n\t * }\n\t * console.log(`[smartico] render section \"${cat.name}\" with ${items.length} mission(s)`);\n\t * }\n\t *\n\t * // Uncategorized items: surface in a caller-provided \"Other\" bucket if needed\n\t * const uncategorized = missions.filter(m => m.category_ids.length === 0);\n\t * if (uncategorized.length > 0) {\n\t * console.log('[smartico] uncategorized missions exist — render a caller-provided \"Other\" section; server does NOT return id:-1:', uncategorized.length);\n\t * }\n\t * }\n\t *\n\t * // Visitor mode — same shape, language driven by vapi(lang) argument\n\t * const visitorCats = await window._smartico.vapi('DE').getAchCategories();\n\t * console.log('[smartico] visitor-mode categories (names translated to DE):', visitorCats);\n\t * ```\n\t */\n\tpublic async getAchCategories(): Promise<TAchCategory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AchCategories,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.achGetCategoriesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Opt the current user in to a mission. The mission must have\n\t * `is_requires_optin: true` (from `getMissions()`) and must not already\n\t * be opted-in or locked. After a successful opt-in, the user's task\n\t * progress starts counting toward this mission — events fired BEFORE\n\t * opt-in do not count retroactively (except `UNLOCK_ACHIEVEMENT` tasks,\n\t * which are exempt and can fire pre-opt-in).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Only call when the mission has `is_requires_optin === true`,\n\t * `is_opted_in === false`, and `is_locked === false`. Calling on a\n\t * mission that does not require opt-in is wasted; calling twice returns\n\t * `40010`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; task progress counting begins\n\t * - `105` — wrong mission id (different label) OR visibility conditions\n\t * not met. Same code covers both; use `err_message` to disambiguate.\n\t * - `40010` — already opted-in. Safe to treat as \"no-op success\"; usually\n\t * means local mission state was stale (e.g. user opted in from another\n\t * session/tab).\n\t * - `40013` — mission not opt-in-able: missing `requires_optin`, in\n\t * DRAFT/ARCHIVED state, or outside its `active_from_ts` /\n\t * `active_till_ts` window.\n\t * - `40014` — mission is locked; user has unlock-tasks remaining.\n\t * Surface the mission's `unlock_mission_description` to guide them.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Time-limited missions**\n\t * For missions with `time_limit_ms > 0`, the countdown begins at opt-in\n\t * time, not at mission creation. Server records expiration as\n\t * `optin_date + time_limit_ms`.\n\t *\n\t * **Refresh after success**\n\t * The SDK refreshes its mission cache automatically on opt-in response;\n\t * any `onUpdate` callback passed to a prior `getMissions({ onUpdate })`\n\t * fires with the new state shortly after. No manual re-fetch needed.\n\t *\n\t * **Idempotency**: not idempotent. A second call returns `40010`. Guard\n\t * the call site against double-clicks.\n\t *\n\t * **Side effects**: does NOT award points / badges / levels directly.\n\t * Rewards come from task completion, which is itself gated on opt-in.\n\t * May affect visibility of other missions whose visibility conditions\n\t * depend on this opt-in.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestMissionOptIn`](../../docs/ui/missions/UIGuide_requestMissionOptIn.md).\n\t *\n\t * **Visitor mode: not supported**\n\t *\n\t * @param mission_id The mission `id` (from `getMissions()`)\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t *\n\t * @example\n\t * ```ts\n\t * const missions = await window._smartico.api.getMissions({\n\t * onUpdate: (m) => console.log('[smartico] mission list updated — re-render mission UI from this new array', m),\n\t * });\n\t * const mission = missions.find(m => m.id === missionId);\n\t *\n\t * if (!mission || !mission.is_requires_optin || mission.is_opted_in || mission.is_locked) {\n\t * console.log('[smartico] opt-in not applicable — keep UI as-is');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] opt-in starting — show loading spinner on opt-in button and disable it to prevent double-clicks');\n\t * const r = await window._smartico.api.requestMissionOptIn(mission.id);\n\t * console.log('[smartico] opt-in response received — clear loading spinner');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 40010) {\n\t * console.log('[smartico] opt-in succeeded (or was already done) — onUpdate above will fire with refreshed mission state; no manual re-fetch needed');\n\t * } else if (r.err_code === 40014) {\n\t * console.error('[smartico] mission is locked — surface the unlock description as guidance:', mission.unlock_mission_description);\n\t * } else {\n\t * console.error('[smartico] opt-in failed — show an error toast with this message to the user:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestMissionOptIn(mission_id: number): Promise<TMissionOptInResult> {\n\t\tconst r = await this.api.missionOptIn(this.userExtId, mission_id);\n\n\t\tconst o: TMissionOptInResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Claim the prize for a completed mission. This is the step that runs\n\t * AFTER `requestMissionOptIn()` (when applicable) and AFTER the user has\n\t * completed all of the mission's tasks. Only call when the mission has\n\t * `requires_prize_claim === true`, `is_completed === true`, and the prize\n\t * has not already been claimed.\n\t *\n\t * The points / bonuses / badge grants associated with the mission are\n\t * awarded server-side synchronously inside this call (before the response\n\t * is returned), so a successful response (`err_code === 0`) means the\n\t * reward has already landed in the user's account.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Only call when, on the mission object from `getMissions()`:\n\t * - `is_completed === true`\n\t * - `requires_prize_claim === true`\n\t * - `prize_claimed_date_ts == null` (i.e. not already claimed)\n\t * - `prize_claim_expiration_date` is `null` OR still in the future\n\t *\n\t * The `ach_completed_id` argument must be passed straight from the same\n\t * mission object (`mission.ach_completed_id`). It is a server-side primary\n\t * key identifying the specific completion row; the SDK consumer should\n\t * never synthesise or cache it across sessions — always re-read it from a\n\t * fresh `getMissions()` result.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the prize was claimed and rewards have been credited.\n\t * - `1` — generic server error. Covers several distinct underlying\n\t * conditions, all collapsed into the same code: stale or wrong\n\t * `ach_completed_id` (does not match user / mission), the mission no\n\t * longer requiring a prize claim, the mission being archived/draft,\n\t * label mismatch, or the completion being too old (server enforces a\n\t * freshness window of several months). Recovery: re-fetch missions\n\t * with `getMissions()`; if the mission still appears claimable,\n\t * surface a generic error.\n\t * - `40015` — claim window expired (`prize_claim_expiration_date` has\n\t * passed). Show a \"claim period ended\" message; do not retry.\n\t * - `40016` — mission is not completed yet. Indicates a race or a stale\n\t * local cache. Re-fetch via `getMissions()`; if `is_completed` is still\n\t * false, the UI should hide the claim button.\n\t * - `40017` — prize already claimed. Treat as idempotent success: refresh\n\t * the mission list (auto-refresh will fire) and hide the claim button.\n\t * Usually means another tab/session already claimed it.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Recurring missions**\n\t * The server transparently handles both one-shot and recurring mission\n\t * completions. The SDK consumer passes a single `ach_completed_id`\n\t * regardless of mission type; the server resolves the correct completion.\n\t *\n\t * **Refresh after success**\n\t * On any claim response (success OR failure), the SDK automatically\n\t * re-fetches the mission list and fires any `onUpdate` callback\n\t * registered via `getMissions({ onUpdate })`. No manual re-fetch needed.\n\t * Note: points balance, badges, and level state arrive through their\n\t * own push channels — subscribe to them separately if your UI shows\n\t * those values.\n\t *\n\t * **Idempotency**: not idempotent at the row level. A second call on the\n\t * same `ach_completed_id` returns `40017` (already claimed). For a stale\n\t * `ach_completed_id` the second call returns `1`. Guard the call site\n\t * against double-clicks; the SDK does not enforce its own in-flight lock.\n\t *\n\t * **Side effects** (consumer-observable effects of a successful claim):\n\t * - Points credited to the user's balance.\n\t * - CRM-rule activities executed (may grant bonuses, badges; may unlock\n\t * follow-up missions, which arrive as a later mission auto-refresh).\n\t * - Analytics / automation events fired downstream; not directly observable\n\t * in the response, but visible via the mission auto-refresh and any\n\t * subsequent bonus / badge updates.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestMissionClaimReward`](../../docs/ui/missions/UIGuide_requestMissionClaimReward.md).\n\t *\n\t * @param mission_id The mission `ach_id` (from `getMissions()`).\n\t * @param ach_completed_id The completion-row identifier, read from\n\t * `mission.ach_completed_id` on the same mission\n\t * object fetched via `getMissions()`. Never\n\t * fabricate or cache across sessions.\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t * (or `40017` when treated as idempotent no-op).\n\t *\n\t * @example\n\t * ```ts\n\t * const missions = await window._smartico.api.getMissions({\n\t * onUpdate: (m) => console.log('[smartico] mission list updated — re-render mission UI from this new array', m),\n\t * });\n\t * const mission = missions.find(m => m.ach_id === missionId);\n\t *\n\t * if (\n\t * !mission ||\n\t * !mission.is_completed ||\n\t * !mission.requires_prize_claim ||\n\t * mission.prize_claimed_date_ts ||\n\t * (mission.prize_claim_expiration_date && Date.now() >= mission.prize_claim_expiration_date)\n\t * ) {\n\t * console.log('[smartico] claim not applicable — keep claim button hidden');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — show loading spinner on claim button and disable it to prevent double-clicks');\n\t * const r = await window._smartico.api.requestMissionClaimReward(mission.ach_id, mission.ach_completed_id);\n\t * console.log('[smartico] claim response received — clear loading spinner');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 40017) {\n\t * console.log('[smartico] claim succeeded (or was already claimed) — points/bonuses are credited; mission list auto-refresh will fire via the onUpdate above; hide the claim button');\n\t * } else if (r.err_code === 40015) {\n\t * console.error('[smartico] claim window expired — show a \"claim period ended\" message and remove the claim button:', mission.prize_claim_expiration_date);\n\t * } else if (r.err_code === 40016) {\n\t * console.error('[smartico] mission reported as not completed by server — local state was stale; auto-refresh will reconcile, do not retry');\n\t * } else {\n\t * console.error('[smartico] claim failed — show an error toast with this message to the user (and re-fetch missions to recover from a stale ach_completed_id):', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestMissionClaimReward(mission_id: number, ach_completed_id: number): Promise<TMissionClaimRewardResult> {\n\t\tconst r = await this.api.missionClaimPrize(this.userExtId, mission_id, ach_completed_id);\n\n\t\tconst o: TMissionClaimRewardResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateMissions() {\n\t\tconst payload = await this.api.missionsGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Missions, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTBonus,\n\tTClaimBonusResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIMissions } from './WSAPIMissions';\n\n/** @group Bonuses */\nexport class WSAPIBonuses extends WSAPIMissions {\n\t/**\n\t * Returns the bonuses awarded to the current user — both pending\n\t * (player-claim required) and already-redeemed. Each bonus carries\n\t * a `bonus_status_id` ({@link BonusStatus}) describing its lifecycle\n\t * stage and an `is_redeemable` flag that signals whether the\n\t * consumer must trigger a manual {@link claimBonus} call.\n\t *\n\t * Bonuses originate from many sources (CRM rules, mission/tournament\n\t * rewards, store redemptions, mini-game prizes, manual operator\n\t * awards) and all surface through this single list. The consumer\n\t * cannot distinguish the source server-side without operator\n\t * coordination.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed bonuses list (never a\n\t * diff/patch). Each subsequent call to `getBonuses({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires after every\n\t * {@link claimBonus} call resolves on this connection (success OR\n\t * failure). This is the ONLY trigger.\n\t *\n\t * Does NOT fire when: a new bonus is awarded server-side\n\t * (CRM rule, mission completion, store purchase, etc.), a bonus\n\t * expires, or an operator manually issues / cancels a bonus. Those\n\t * changes surface only on the next cache miss (after the 30 s TTL).\n\t * Re-call `getBonuses()` manually if your UI needs near-live state\n\t * for server-driven awards.\n\t *\n\t * **Reading state from the returned bonus**\n\t * Drive UI bucketing from `bonus_status_id` (enum {@link BonusStatus}):\n\t *\n\t * - `COUPON_ISSUED` (2) — actionable; player must claim. Pair with\n\t * `is_redeemable === true` to gate the Claim button.\n\t * - `REDEEM_FAILED` (4) — also actionable; the previous claim\n\t * attempt failed but the bonus is still valid. Surface a retry CTA\n\t * — the default Smartico UI treats this identically to\n\t * `COUPON_ISSUED` from the player's perspective.\n\t * - `REDEEMED` (3) — historical; show in a \"claimed\" tab.\n\t * - `New` (1), `COUPON_ISSUE_FAILED` (5), `EXPIRED` (6) — these\n\t * should not normally reach the client and are typically filtered\n\t * out by operator-side widget configuration; if they do appear,\n\t * they have no player-actionable state.\n\t *\n\t * `is_redeemable` is the authoritative gate for showing the Claim\n\t * button — it's `true` only when the bonus is in a claimable status\n\t * AND the operator's integration uses a coupon model (where the\n\t * player must explicitly trigger delivery). Auto-redeemed bonuses\n\t * arrive already in `REDEEMED` state with `is_redeemable: false`.\n\t *\n\t * **Field hierarchy — display amount**\n\t * Bonuses carry both template-level (`label_bonus_template_meta_map.description`)\n\t * and instance-level (`bonus_meta_map.uiAmount`) display strings.\n\t * Prefer `bonus_meta_map.uiAmount` when present — it's the dynamic\n\t * amount computed at issuance time (e.g. from a dynamic-bonus\n\t * formula). Fall back to `label_bonus_template_meta_map.description`\n\t * (which can include HTML; sanitize before injecting).\n\t *\n\t * **Date format**\n\t * `create_date` and `redeem_date` are ISO 8601 UTC strings WITHOUT\n\t * a timezone suffix (`\"YYYY-MM-DDTHH:MM:SS\"`). Parse as UTC and\n\t * display in the user's local timezone. `redeem_date` is absent\n\t * until the bonus reaches `REDEEMED` status.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getBonuses`](../../docs/ui/bonuses/UIGuide_getBonuses.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * bonuses list after every\n\t * {@link claimBonus} resolves. Each call\n\t * to `getBonuses` overwrites the prior\n\t * callback.\n\t * @returns Promise resolving to the bonuses list.\n\t * Empty array if no bonuses are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const bonuses = await window._smartico.api.getBonuses({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] bonuses refreshed (after claimBonus) — re-render the bonuses UI from this array:', refreshed);\n\t * },\n\t * });\n\t *\n\t * // Bucket into pending vs redeemed tabs. The default Smartico UI groups\n\t * // COUPON_ISSUED + REDEEM_FAILED into the same \"Pending\" tab.\n\t * const pending = bonuses.filter(b =>\n\t * b.bonus_status_id === 2 || b.bonus_status_id === 4 // COUPON_ISSUED or REDEEM_FAILED\n\t * );\n\t * const redeemed = bonuses.filter(b => b.bonus_status_id === 3); // REDEEMED\n\t *\n\t * console.log('[smartico] render bonus tabs: pending=', pending.length, 'redeemed=', redeemed.length);\n\t *\n\t * // Render each pending bonus card; show Claim button only when redeemable.\n\t * for (const b of pending) {\n\t * const amount = b.bonus_meta_map?.uiAmount || b.label_bonus_template_meta_map?.description;\n\t * if (b.is_redeemable) {\n\t * console.log('[smartico] render Claim button for bonus', b.bonus_id, '— amount:', amount);\n\t * } else {\n\t * console.log('[smartico] render bonus as informational (no Claim button) — amount:', amount);\n\t * }\n\t * }\n\t *\n\t * // Server-awarded bonuses (e.g. from a CRM campaign) do NOT push;\n\t * // poll if you need near-live awareness.\n\t * setInterval(async () => {\n\t * const fresh = await window._smartico.api.getBonuses();\n\t * const newCount = fresh.filter(b => b.bonus_status_id === 2 || b.bonus_status_id === 4).length;\n\t * console.log('[smartico] poll tick — pending bonuses now:', newCount);\n\t * }, 30_000);\n\t * ```\n\t */\n\tpublic async getBonuses({ onUpdate }: { onUpdate?: (data: TBonus[]) => void } = {}): Promise<TBonus[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Bonuses, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Bonuses, ECacheContext.WSAPI, () => this.api.bonusesGetItemsT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Triggers manual redemption of a coupon-model bonus the user has\n\t * been awarded. For bonuses with `is_redeemable === true` returned\n\t * by {@link getBonuses}, this is the call that asks the operator's\n\t * integration to actually credit the bonus to the player's account.\n\t * Bonuses on integrations that auto-redeem arrive already in\n\t * `REDEEMED` state and do not require this call.\n\t *\n\t * Use this for `bonus_status_id` of `COUPON_ISSUED` (2) as the\n\t * first-time claim, and for `REDEEM_FAILED` (4) as a retry after a\n\t * prior unsuccessful attempt.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate bonus from {@link getBonuses} and gate the\n\t * call on `is_redeemable === true`. The SDK forwards the request\n\t * unconditionally — calling on a non-claimable bonus returns\n\t * `err_code = -1`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t *\n\t * The SDK currently types `err_code` as {@link SAWSpinErrorCode} for\n\t * historical reasons, but the values returned by this method come\n\t * from the server's general error space and are NOT mini-game codes.\n\t * Branch on the numeric values:\n\t *\n\t * - `0` — success; the bonus has been redeemed and the operator's\n\t * integration has credited the player's account.\n\t * - `-1` — bonus not claimable: not found, already claimed by\n\t * another session, or its status is no longer `COUPON_ISSUED` /\n\t * `REDEEM_FAILED`. Treat as idempotent — refresh\n\t * {@link getBonuses} and reconcile.\n\t * - `1` — generic server error. Transient; allow retry after a brief\n\t * delay.\n\t * - `9999` — uncaught server exception. Treat as a transient failure;\n\t * surface a generic error and allow retry.\n\t * - other non-zero — generic server error. Surface `err_message` if\n\t * any.\n\t *\n\t * **`success` field is unreliable**: the wire response does not\n\t * carry a `success` boolean — the field on `TClaimBonusResult` will\n\t * be `undefined` in practice. Always branch on `err_code === 0`\n\t * for the success check.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the bonuses cache on every\n\t * response (success OR failure) and fires any `onUpdate` callback\n\t * registered via {@link getBonuses}'s `onUpdate`. After\n\t * `err_code === 0`, the redeemed bonus shifts from\n\t * `COUPON_ISSUED` / `REDEEM_FAILED` to `REDEEMED` on the refreshed\n\t * array, with `redeem_date` populated. After a failure, the bonus\n\t * typically lands in `REDEEM_FAILED` and remains claimable for a\n\t * retry.\n\t *\n\t * **Idempotency**: NOT idempotent at the SDK level. A second call\n\t * returns `err_code = -1` once the first has succeeded — treat that\n\t * as success in the UI rather than as a real error. Guard the call\n\t * site against double-clicks (set a local \"claiming\" flag on click,\n\t * clear it on response).\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - Bonus status transitions to `REDEEMED`; `redeem_date` is set.\n\t * - The operator's integration credits the player's account\n\t * externally. The SDK does not observe that credit directly —\n\t * balance updates flow over the user-properties channel from the\n\t * operator's side, not from this response.\n\t * - Server-side analytics events fire downstream (not directly\n\t * observable from the SDK).\n\t *\n\t * **UI guidance**: see [UI Guide — `claimBonus`](../../docs/ui/bonuses/UIGuide_claimBonus.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param bonus_id The `bonus_id` from a `TBonus` returned by\n\t * {@link getBonuses}.\n\t * @returns `{ err_code, err_message, success? }`; success when\n\t * `err_code === 0` (or `err_code === -1` when treated as\n\t * idempotent no-op). The `success` field is unreliable —\n\t * ignore it.\n\t *\n\t * @example\n\t * ```ts\n\t * const bonuses = await window._smartico.api.getBonuses({\n\t * onUpdate: (refreshed) => console.log('[smartico] bonuses refreshed — re-render from this array', refreshed),\n\t * });\n\t * const bonus = bonuses.find(b => b.bonus_id === bonusId);\n\t *\n\t * if (!bonus) {\n\t * console.log('[smartico] bonus no longer visible — refresh list and hide CTA');\n\t * return;\n\t * }\n\t * if (!bonus.is_redeemable) {\n\t * console.log('[smartico] bonus is not claimable (auto-redeemed or already finalised) — keep CTA hidden');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — set in-flight flag, show loading dots on the Claim button, keep the modal open');\n\t * const r = await window._smartico.api.claimBonus(bonus.bonus_id);\n\t * console.log('[smartico] claim response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0 || r.err_code === -1) {\n\t * console.log('[smartico] claim succeeded (or was already done) — show a success toast; the getBonuses onUpdate above will fire with the refreshed list');\n\t * } else if (r.err_code === 9999) {\n\t * console.error('[smartico] uncaught server exception — show a generic error toast and allow retry');\n\t * } else {\n\t * console.error('[smartico] claim failed — surface this error message to the user; the bonus will move to REDEEM_FAILED state and remain claimable for a retry:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async claimBonus(bonus_id: number): Promise<TClaimBonusResult> {\n\t\tconst r = await this.api.bonusClaimItem(this.userExtId, bonus_id);\n\n\t\tconst o: TClaimBonusResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t\tsuccess: r.success,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateBonuses() {\n\t\tconst payload = await this.api.bonusesGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Bonuses, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTBuyStoreItemResult,\n\tTStoreCategory,\n\tTStoreItem,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIBonuses } from './WSAPIBonuses';\n\n/** @group Store */\nexport class WSAPIStore extends WSAPIBonuses {\n\tprivate storeHistoryOnUpdateParams: { limit: number; offset: number } = { limit: 20, offset: 0 };\n\n\tprivate storeHistoryCacheKey(limit: number, offset: number): string {\n\t\treturn `${onUpdateContextKey.StoreHistory}:${limit}:${offset}`;\n\t}\n\n\t/**\n\t * Returns the catalog of buyable store items visible to the current user,\n\t * scoped server-side to what the user is qualified to see. Optionally\n\t * subscribes to live updates via `onUpdate`: the callback is invoked with\n\t * the full refreshed catalog after every purchase the user makes from this\n\t * device.\n\t *\n\t * The returned list is the canonical source of truth for store state\n\t * (`can_buy`, `pool`, `discounted_price`, `active_till_date`, etc.).\n\t * Consumers should NEVER mutate it optimistically — always re-fetch (or\n\t * wait for the `onUpdate` callback) to observe the new state.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * The catalog is per-user. Visitor mode is supported with caveats (see\n\t * \"Visitor mode\" below). For the authenticated path, the user's balances\n\t * (`ach_points_balance`, `ach_gems_balance`, `ach_diamonds_balance` from\n\t * {@link getUserProfile}) must be tracked client-side to drive the\n\t * affordability state of the Buy button — the SDK does not pre-compute\n\t * affordability into `can_buy`.\n\t *\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed catalog (never a diff/patch).\n\t * Each subsequent call to `getStoreItems({ onUpdate })` REPLACES the prior\n\t * callback — only one active subscriber at a time. Pass\n\t * `onUpdate: undefined` (or omit it) to keep the prior callback in place;\n\t * the callback is never auto-cleared.\n\t *\n\t * **Update triggers**\n\t *\n\t * Fires after: any `buyStoreItem(...)` call resolves on this connection\n\t * (success OR failure). This is the ONLY trigger. The refreshed array\n\t * reflects pool decrement on the just-bought item, per-period purchase\n\t * cap re-evaluation on `can_buy`, and any `purchased_today` /\n\t * `purchased_this_week` / `purchased_this_month` flips visible via\n\t * {@link getStorePurchasedItems}.\n\t *\n\t * Does NOT fire for:\n\t * - Operator-side BO catalog edits (price, ribbons, pool seed, segment\n\t * conditions, new/removed items) — surface only on the next cache miss.\n\t * - Concurrent purchases by OTHER users — the current user's view of\n\t * `pool` may be stale until they themselves refresh.\n\t * - User balance changes from gameplay — the catalog is independent of\n\t * balance; the consumer drives Buy-button affordability from a\n\t * separately-tracked balance source.\n\t * - Items going past their `active_till_date` while the page is open —\n\t * the item simply disappears on the next refresh.\n\t *\n\t * **Server-side filtering** (what's already excluded before the SDK sees it)\n\t * - Items outside the `[active_from_date, active_till_date]` window —\n\t * past the till-date, items are ALWAYS filtered out server-side.\n\t * - Items the user fails visibility-segment / visibility-condition\n\t * checks for.\n\t * - Items configured to hide-when-empty whose pool has reached 0\n\t * (per-item operator flag). Items without that flag are still returned\n\t * with `pool === 0` so a \"Sold out\" state can be rendered.\n\t * - Items where the per-period bought-count cap is reached (and the\n\t * operator chose to hide rather than just disable).\n\t *\n\t * **Reading state from the returned item**\n\t * The catalog row carries everything a Buy button needs except the user's\n\t * balance: `can_buy` already reflects segment / visibility / per-period\n\t * cap checks, but the SDK does NOT pre-compute balance affordability —\n\t * compare `discounted_price ?? price` against the user's balance for\n\t * `purchase_type` (`ach_points_balance` / `ach_gems_balance` /\n\t * `ach_diamonds_balance` from {@link getUserProfile}). `purchase_type` is\n\t * per-item (`'points'` / `'gems'` / `'diamonds'`); operators can mix\n\t * currencies within a single catalog. For sold-out display, `pool === 0`\n\t * means the operator chose to keep the item visible — render an \"Out of\n\t * stock\" overlay. When `discounted_price` is set, render `price` with a\n\t * strikethrough and `discounted_price` as the active price; the\n\t * accompanying `discount_price_ribbon` is either a percentage preset\n\t * (`'10'`, `'15'`, `'20'`, `'25'`, `'50'`) or the literal `'custom'`\n\t * (in which case `custom_ribbon_image` is the artwork at 250×300 px).\n\t * A live countdown for time-limited items is rendered only when the\n\t * operator has enabled the per-item `show_timer` flag.\n\t *\n\t * **Cross-references**\n\t * `category_ids` joins to `TStoreCategory.id` from\n\t * {@link getStoreCategories} (many-to-many — an item can belong to\n\t * multiple categories). Items with `only_in_custom_section: true` are\n\t * returned in the catalog but intended for their custom-section view\n\t * only — filter them client-side for the main store view. The\n\t * history-only fields (`purchase_ts`, `purchase_points_amount`, the\n\t * `purchased_*` booleans) are populated only by\n\t * {@link getStorePurchasedItems}, not by this method.\n\t *\n\t * **Idempotency**: yes. `getStoreItems` is a pure read. Calling it\n\t * repeatedly within the 30-second cache window resolves from the cache\n\t * without a network round-trip.\n\t *\n\t * **Side effects** (of a successful purchase that triggers `onUpdate`)\n\t * Documented here because the consumer's `onUpdate` handler will observe\n\t * the resulting state changes on the next refreshed array:\n\t * - Points / gems / diamonds balance deducted per `purchase_type`. The\n\t * new balance becomes visible on the user's gamification profile via\n\t * the SDK's user-properties update channel (`ach_points_balance` /\n\t * `ach_gems_balance` / `ach_diamonds_balance`).\n\t * - `pool` decremented for limited-stock items.\n\t * - `type = 'bonus'` → a CRM bonus is granted; surfaces via\n\t * {@link getBonuses}.\n\t * - `type = 'raffleticket'` → raffle tickets granted; surfaces via\n\t * `getRaffles`.\n\t * - `type = 'changelevel'` → user's level adjusted; surfaces via\n\t * {@link getCurrentLevel}.\n\t * - `type = 'minigamespin'` → SAW spin attempts granted; visible via the\n\t * mini-game APIs.\n\t * - `type = 'prizedrop'` → one prize-drop attempt granted.\n\t * - `type = 'tangible'` → no automatic gameplay effect; the purchase is\n\t * recorded for the operator's manual fulfillment (e.g. physical merch).\n\t *\n\t * **UI guidance**: see [UI Guide — `getStoreItems`](../../docs/ui/store/UIGuide_getStoreItems.md).\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * catalog after every {@link buyStoreItem}\n\t * round-trip on this connection. Each call to\n\t * `getStoreItems` overwrites the prior\n\t * callback. Never fires in visitor mode.\n\t * @returns Promise resolving to the catalog of store\n\t * items visible to the user. Empty array if\n\t * the user has no items (or if the visitor\n\t * proxy user has none configured).\n\t *\n\t * @example\n\t * ```ts\n\t * // 1. Initial fetch + subscribe to live updates\n\t * const items = await window._smartico.api.getStoreItems({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] store catalog refreshed after a purchase — re-render the entire store UI from this array, do not merge with prior state:', refreshed);\n\t *\n\t * // 2. onUpdate fires only after the current user's own purchase\n\t * // round-trip. Pool counts and can_buy flags are now current\n\t * // for this user.\n\t * const soldOut = refreshed.filter(i => i.pool === 0);\n\t * if (soldOut.length > 0) {\n\t * console.log('[smartico] these items are now sold out — render an \"Out of stock\" overlay on each:', soldOut.map(i => i.id));\n\t * }\n\t * },\n\t * });\n\t *\n\t * // 3. Live affordability per item. Compare each item's price against\n\t * // the user's balance for its purchase_type (read from\n\t * // getUserProfile(), kept live by the SDK's user-properties channel).\n\t * const profile = window._smartico.api.getUserProfile();\n\t * const balances = {\n\t * points: profile?.ach_points_balance ?? 0,\n\t * gems: profile?.ach_gems_balance ?? 0,\n\t * diamonds: profile?.ach_diamonds_balance ?? 0,\n\t * };\n\t *\n\t * // 4. Filter out items that are custom-section-only for the main view.\n\t * const mainViewItems = items.filter(i => !i.only_in_custom_section);\n\t *\n\t * // 5. Bucket each item's button state for rendering.\n\t * for (const i of mainViewItems) {\n\t * const activePrice = i.discounted_price ?? i.price;\n\t * const canAfford = balances[i.purchase_type] >= activePrice;\n\t * if (i.pool === 0) {\n\t * console.log('[smartico] item', i.id, 'is sold out — render disabled Buy with \"Out of stock\" overlay');\n\t * } else if (i.can_buy === false) {\n\t * console.log('[smartico] item', i.id, 'is not eligible — render disabled Buy and surface cant_buy_message on the popup:', i.cant_buy_message);\n\t * } else if (!canAfford) {\n\t * console.log('[smartico] item', i.id, 'is unaffordable — render disabled Buy and show \"short by\" line on popup; deficit =', activePrice - balances[i.purchase_type], i.purchase_type);\n\t * } else {\n\t * console.log('[smartico] item', i.id, 'is buyable — render enabled Buy at price', activePrice, i.purchase_type);\n\t * }\n\t * }\n\t *\n\t * // 6. Visitor-mode equivalent: onUpdate is accepted but never fires.\n\t * // Re-poll if you need fresh data; buyStoreItem is not supported.\n\t * // const visitorItems = await window._smartico.vapi('EN').getStoreItems();\n\t * // console.log('[smartico] visitor catalog is the brand proxy user\\'s — per-user fields are not meaningful');\n\t * ```\n\t */\n\tpublic async getStoreItems({ onUpdate }: { onUpdate?: (data: TStoreItem[]) => void } = {}): Promise<TStoreItem[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.StoreItems, onUpdate);\n\t\t}\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.StoreItems,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetItemsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Purchase a specific store item on behalf of the current user. Spends\n\t * the user's points / gems / diamonds (depending on the item's\n\t * `purchase_type`) and triggers reward delivery (bonus issuance, mini-game\n\t * spin grant, level change, prize-drop, raffle ticket, or tangible item).\n\t *\n\t * A successful response (`err_code === 0`) means the funds have already\n\t * been debited and the reward has been queued / granted server-side. The\n\t * user's balance change arrives over a separate push channel, not in this\n\t * response — see \"Refresh after success\" below.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate item from `getStoreItems()` first and gate the call\n\t * on these fields:\n\t * - `can_buy === true` — server-derived; combines segment / visibility\n\t * conditions and any operator-set restrictions.\n\t * - `pool == null || pool > 0` — `null` means unlimited stock; a positive\n\t * number means N units remain.\n\t * - User's balance for the item's `purchase_type`\n\t * (`'points'` / `'gems'` / `'diamonds'`) is `>= price` (or\n\t * `>= discounted_price` if set). Balances are not on `TStoreItem` —\n\t * read them from the user properties returned by `getUserState()`.\n\t * - If `active_till_date` is set, it is in the future.\n\t *\n\t * Calling without satisfying these will most likely return a non-zero\n\t * `err_code` (one of the codes below). The SDK does not pre-validate\n\t * — it forwards the request to the server unconditionally.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; funds debited and reward delivered.\n\t * - `1` — generic server error / control-group rejection. Treat as a\n\t * transient failure; show a \"try again later\" message.\n\t * - `106` — label mismatch detected before the purchase transaction\n\t * (e.g. cross-label item id). From a consumer perspective: the item is\n\t * not purchasable by this user.\n\t * - `11000` (`SHOP_NO_BALANCE`) — insufficient **points** balance.\n\t * Show an insufficient-balance message that names how many points are\n\t * missing (`price - current_points_balance`). The Buy button on the\n\t * item should already be disabled when this is the case; this code\n\t * normally fires only on a stale local balance.\n\t * - `11001` (`SHOP_WRONG_LABEL`) — user-vs-item label mismatch detected\n\t * inside the purchase transaction. Distinct from `106`; both mean\n\t * \"not purchasable by this user\" from the consumer's perspective.\n\t * Surface as a generic \"item not available\" message.\n\t * - `11002` (`SHOP_FAILED_TO_BUY_BONUS`) — the bonus configured on the\n\t * store item couldn't be issued (bad / disabled bonus config on the\n\t * operator side). Funds are NOT debited. Surface a generic error and\n\t * advise the user to contact support if it persists.\n\t * - `11003` (`SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION`) — the item's\n\t * **visibility** segment condition is not satisfied. Shouldn't be\n\t * reachable through a correctly-rendered UI (the item shouldn't be\n\t * shown in the first place); usually indicates a stale local store\n\t * list. Re-fetch via `getStoreItems()`.\n\t * - `11004` (`SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE`) — the\n\t * item's **purchase** segment condition is not satisfied (the item is\n\t * visible but the user is not in the buyable segment). Surface a\n\t * localized \"try again later\" / \"you're not eligible\" message; do not\n\t * retry automatically.\n\t * - `11005` (`SHOP_FAILED_TO_BUY_MATCHING_BONUS`) — matching-bonus\n\t * coupon issuance failed (variant of `11002` for matching-deposit\n\t * bonuses). Funds are NOT debited. Surface a generic error.\n\t * - `11006` (`SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED`) — per-user purchase\n\t * cap reached (e.g. \"max 1 per day\"). Surface the item's\n\t * `limit_message` if set, otherwise `err_message`. Do not retry.\n\t * - `11007` — bonus was issued but a follow-up redemption step failed\n\t * server-side. Funds **are** debited and the purchase event is recorded;\n\t * the consumer's UI should refresh the store list (auto-refresh will\n\t * fire) and surface a soft warning rather than a hard error.\n\t * - `11009` (`SHOP_FAILED_POOL_EMPTY`) — stock pool is empty / sold out.\n\t * Show a \"sold out\" message; auto-refresh will mark the item as such\n\t * in subsequent `getStoreItems()` updates.\n\t * - `11011` (`SHOP_NO_BALANCE_GEMS`) — insufficient **gems** balance.\n\t * Same handling as `11000` but for the gems currency.\n\t * - `11012` (`SHOP_NO_BALANCE_DIAMONDS`) — insufficient **diamonds**\n\t * balance. Same handling as `11000` but for the diamonds currency.\n\t * - `11014` (`SHOP_FAILED_PURCHASE_LIMITATION`) — outside the configured\n\t * purchase window (purchase weekday / time-of-day / window). Surface\n\t * the item's `purchase_limit_message` if set, otherwise `err_message`.\n\t * - `9999` — uncaught server exception. Treat as a transient failure;\n\t * surface a generic error and allow retry.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Idempotency**: NOT idempotent. The server performs no de-duplication —\n\t * a second successful call deducts funds again and grants the reward\n\t * again (subject to per-user purchase caps). The SDK itself does **not**\n\t * enforce a single in-flight call. The consumer MUST guard the call site\n\t * against double-clicks (set a local \"buying\" flag on click, clear it on\n\t * response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically re-fetches the store item list and the\n\t * purchased-items history on every response (success or error). Any\n\t * `onUpdate` callback registered via `getStoreItems({ onUpdate })` (or\n\t * the purchased-items equivalent) fires shortly after with the updated\n\t * arrays — reflecting the new `pool`, `can_buy`, and any `purchased_*`\n\t * flags. The user's balance (points / gems / diamonds) is exposed on the\n\t * user-properties channel and updates independently; if the UI displays\n\t * the balance, subscribe to user-property updates separately (it does\n\t * NOT flow through `getStoreItems`).\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - User's points / gems / diamonds balance decreases by `price`\n\t * (or `discounted_price` if set).\n\t * - Item's `pool` decrements by 1 (when `pool != null`).\n\t * - Per-user purchase counters update — `purchased_today`,\n\t * `purchased_this_week`, `purchased_this_month` on the next\n\t * `getStoreItems()` refresh.\n\t * - The reward is delivered: bonus issuance, mini-game spin grant,\n\t * level change, prize drop, raffle ticket, or tangible-item record.\n\t * Each reward type pushes its own follow-up update (e.g. a new\n\t * bonus appears in `getBonuses()`, the spin shows up in\n\t * `getMiniGames()`). Subscribe to each relevant channel separately.\n\t * - A purchase row is appended to the user's purchase history,\n\t * surfaced via the purchased-items list.\n\t *\n\t * **UI guidance**: see [UI Guide — `buyStoreItem`](../../docs/ui/store/UIGuide_buyStoreItem.md).\n\t *\n\t * @param item_id The store item `id` (from `getStoreItems()`).\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * const items = await window._smartico.api.getStoreItems({\n\t * onUpdate: (next) => console.log('[smartico] store items updated — re-render store grid with this fresh array', next),\n\t * });\n\t * const item = items.find(i => i.id === itemId);\n\t *\n\t * if (!item) {\n\t * console.log('[smartico] item not in current store list — keep UI as-is, possibly refresh getStoreItems');\n\t * return;\n\t * }\n\t *\n\t * // Local pre-checks: keep these aligned with the Buy-button decision matrix above.\n\t * const effectivePrice = item.discounted_price ?? item.price;\n\t * const inStock = item.pool == null || item.pool > 0;\n\t * const inWindow = !item.active_till_date || Date.now() < item.active_till_date;\n\t * if (!item.can_buy || !inStock || !inWindow) {\n\t * console.log('[smartico] buy not applicable — show disabled state with operator copy if any:', item.cant_buy_message);\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] buy starting — set in-flight flag, show loading dots on Buy button, keep detail modal open');\n\t * const r = await window._smartico.api.buyStoreItem(item.id);\n\t * console.log('[smartico] buy response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] purchase successful — close the detail modal, show a success toast; getStoreItems onUpdate above will fire with the refreshed list (do NOT manually re-fetch)');\n\t * } else if (r.err_code === 11000 || r.err_code === 11011 || r.err_code === 11012) {\n\t * console.error('[smartico] insufficient balance for this purchase_type — show insufficient-balance UI and how many units are missing:', item.purchase_type, effectivePrice);\n\t * } else if (r.err_code === 11009) {\n\t * console.error('[smartico] item sold out — show a dedicated \"Sold out\" message; the auto-refresh will mark the card as such shortly');\n\t * } else if (r.err_code === 11006) {\n\t * console.error('[smartico] per-user purchase cap reached — surface the operator-defined limit message:', item.limit_message || r.err_message);\n\t * } else if (r.err_code === 11014) {\n\t * console.error('[smartico] outside purchase window — surface the operator-defined purchase-limit message:', item.purchase_limit_message || r.err_message);\n\t * } else if (r.err_code === 11004 || r.err_code === 11003) {\n\t * console.error('[smartico] user not eligible / stale visibility — show a localized \"try again later\" message and let auto-refresh reconcile');\n\t * } else {\n\t * console.error('[smartico] buy failed — show a generic error toast/modal with this message:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async buyStoreItem(item_id: number): Promise<TBuyStoreItemResult> {\n\t\tconst r = await this.api.buyStoreItem(this.userExtId, item_id);\n\n\t\tconst o: TBuyStoreItemResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Returns the list of active store categories configured for the current label.\n\t * Categories are operator-defined groupings used to organize store items into tabs,\n\t * sections, or filter chips in the gamification store UI.\n\t *\n\t * @remarks\n\t * **What categories are**\n\t * - Operator-defined groupings, configured per-label by the brand operator.\n\t * Only active categories are returned; inactive / archived / deleted ones are\n\t * filtered out server-side.\n\t * - Each `TStoreCategory` exposes `{ id, name, order }`. `name` is the display label;\n\t * `order` is the relative position (lower = appears first).\n\t * - The same set of categories is returned to every user of the label — there is no\n\t * per-segment / per-currency / per-device filtering on the category list. Item-level\n\t * segment visibility happens on {@link getStoreItems}, not here.\n\t *\n\t * **Localization / translation**\n\t * - `name` is **pre-translated server-side** to the authenticated user's stored language.\n\t * In visitor mode, the language passed to `_smartico.vapi(lang)` drives the translation.\n\t * Consumers never need to translate `name` themselves.\n\t * - Fallback if no translation exists for the user's language: the operator-set default\n\t * (typically the brand's English) value is returned. The field is never null for an\n\t * active category.\n\t *\n\t * **Sort order**\n\t * The server does NOT pre-sort. Sort client-side before rendering:\n\t * `categories.sort((a, b) => a.order - b.order)`.\n\t *\n\t * **How store items join to categories**\n\t * Each `TStoreItem` exposes `category_ids: number[]` (zero-or-more, many-to-many).\n\t * A single store item can belong to multiple categories, or to none. To render a\n\t * \"category → items\" view:\n\t * `items.filter(i => i.category_ids.includes(cat.id))`.\n\t *\n\t * **Uncategorized items**\n\t * Items with `category_ids: []` are NOT represented by a synthetic \"Other\" entry\n\t * in the response. The convention used by the reference store UI is to synthesize\n\t * a client-side bucket (e.g. labelled \"General\") for items that have no category, OR\n\t * for items whose `category_ids` reference a category that is no longer returned by\n\t * this method (e.g. archived since the item was tagged). If you choose to render\n\t * such a synthetic bucket, place it first (the reference UI uses an `order: -1`\n\t * convention so it precedes all operator-defined categories).\n\t *\n\t * **Empty categories**\n\t * A category may be returned even if zero items currently reference it (since this\n\t * method does not join against items). The reference store UI hides such empty\n\t * categories from its tab strip — replicate that filter if you don't want to render\n\t * tabs that lead to empty content panels.\n\t *\n\t * **Refresh cadence / cache**\n\t * - The SDK caches the response for 30 seconds. Subsequent calls within that window\n\t * return the cached array without a network round-trip.\n\t * - The cache is NOT invalidated by store-item push events or purchases — operator-driven\n\t * category changes propagate at the next 30 s cache miss.\n\t * - Cache is fully cleared on login / logout.\n\t * - In **visitor mode**, additional server-side caching applies on top of the SDK cache;\n\t * worst-case staleness for an edited/added category is on the order of a few minutes\n\t * for anonymous viewers.\n\t *\n\t * **Idempotency**: safe. Read-only metadata fetch. Cache de-duplicates concurrent calls.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getStoreCategories`](../../docs/ui/store/UIGuide_getStoreCategories.md).\n\t *\n\t * @returns Array of `{ id, name, order }`. Empty array if no active categories are\n\t * configured for the label. `name` is pre-translated. Order is NOT applied — caller\n\t * must sort.\n\t *\n\t * @example\n\t * ```ts\n\t * const [categories, items] = await Promise.all([\n\t * window._smartico.api.getStoreCategories(),\n\t * window._smartico.api.getStoreItems(),\n\t * ]);\n\t *\n\t * if (categories.length === 0) {\n\t * console.log('[smartico] no store categories configured — render items as a flat grid without tabs:', items.length);\n\t * } else {\n\t * // Sort categories; build per-category item buckets; hide empty categories\n\t * const sorted = [...categories].sort((a, b) => a.order - b.order);\n\t * const tabs = sorted\n\t * .map(cat => ({ cat, items: items.filter(i => i.category_ids?.includes(cat.id)) }))\n\t * .filter(t => t.items.length > 0);\n\t *\n\t * // Optional: synthesize an \"Other\" bucket for items with no (or unknown) category\n\t * const knownIds = new Set(categories.map(c => c.id));\n\t * const orphans = items.filter(i => !i.category_ids?.length || !i.category_ids.some(id => knownIds.has(id)));\n\t * if (orphans.length > 0) {\n\t * console.log('[smartico] uncategorized store items — render a client-synthesized \"Other\" tab at the front of the tab strip:', orphans.length);\n\t * }\n\t *\n\t * console.log('[smartico] render store tabs in this order with these counts:', tabs.map(t => `${t.cat.name} (${t.items.length})`));\n\t * }\n\t *\n\t * // Visitor mode — same shape, language driven by vapi(lang) argument\n\t * const visitorCats = await window._smartico.vapi('DE').getStoreCategories();\n\t * console.log('[smartico] visitor-mode store categories (names translated to DE):', visitorCats);\n\t * ```\n\t */\n\tpublic async getStoreCategories(): Promise<TStoreCategory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.StoreCategories,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetCategoriesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Fetches the authenticated user's **store purchase history** — a paginated,\n\t * newest-first list of past store purchases (one row per redemption).\n\t *\n\t * Designed for a \"My Purchases\" / \"Order History\" screen. Each entry carries\n\t * the same descriptive fields as the catalog card plus three history-only\n\t * fields: `purchase_ts` (when the purchase happened), `purchase_points_amount`\n\t * (the amount actually paid at that time — a price snapshot, not the\n\t * current `price`), and `purchase_type` (`'points' | 'gems' | 'diamonds'`).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported (the SDK only\n\t * exposes this method on the authenticated `_smartico.api`, not on\n\t * `_smartico.vapi`).\n\t * - No prerequisite calls — calling without first fetching\n\t * {@link getStoreItems} or {@link getStoreCategories} is fine.\n\t *\n\t * **Pagination semantics**\n\t * - **Offset-based**, newest-first. The server orders rows by purchase\n\t * timestamp **descending** and the SDK does NOT re-sort — items arrive\n\t * ready to render in display order.\n\t * - `limit` — page size. **The SDK default is 20.** There is no server-side\n\t * hard cap, but 20 matches what the default Smartico UI uses end-to-end; the\n\t * protocol and storage layers were sized for this page size. Treat `20`\n\t * as the conventional/recommended value; passing a much larger limit will\n\t * return more rows but is not the supported integration pattern.\n\t * Avoid `limit <= 0` — the server peeks `limit + 1` rows internally, so\n\t * `limit = 0` returns 1 row with a misleading \"has more\" signal, and\n\t * negative values produce undefined results.\n\t * - `offset` — number of items to skip from the start. The SDK default is\n\t * `0` (first page). For load-more pagination, pass\n\t * `offset = (previously-loaded items).length` on each subsequent call.\n\t * - **No `hasMore` on the returned array.** `TStoreItem[]` is a flat list;\n\t * the underlying protocol response carries `hasMore` but it is not\n\t * surfaced through this method. Two ways for consumers to know they\n\t * reached the end:\n\t * 1. The returned array is shorter than `limit` (definitive end), or\n\t * 2. A subsequent call at `offset = previous.length` returns `[]`.\n\t * Either is reliable.\n\t * - No date-range / category / status filter parameters — pagination is the\n\t * only server-side slicing. Apply any further filtering client-side.\n\t *\n\t * **No per-item fulfillment status**\n\t * - History entries do NOT carry a `delivered` / `pending` / `cancelled` /\n\t * `refunded` field. The list contains rows for committed purchase\n\t * attempts; the server query does not filter by transaction-status, so in\n\t * practice the rows that appear are completed purchases (failed\n\t * transactions roll back and don't write a row). Treat every item as a\n\t * completed transaction unless a future SDK release adds an explicit\n\t * status field.\n\t *\n\t * **Bonus-type entries**\n\t * - When the user redeemed a bonus item, the entry's `type` field surfaces\n\t * as `'bonus'`. **Known limitation:** the SDK transform currently maps\n\t * both `Bonus` and `Tangible` server-side item types to the same string\n\t * `'bonus'` — so the `type` field on history rows cannot distinguish a\n\t * bonus redemption from a tangible-prize redemption. The actual bonus\n\t * payload (wallet credit, free spins, etc.) is dispatched by the server\n\t * asynchronously and is NOT embedded in the history entry — consumers\n\t * that need bonus details should subscribe to bonus push events\n\t * separately rather than reading them from this list.\n\t * - History rows render identically across types — there is no deep-link to\n\t * the bonus wallet or re-claim affordance on the row itself.\n\t *\n\t * **Per-row data**\n\t * Each row uses the `TStoreItem` shape but populates four history-only\n\t * fields not present on `getStoreItems` output. `purchase_ts` is the\n\t * Unix-ms timestamp of the purchase — format with\n\t * `new Date(purchase_ts).toLocaleString()` in the user's local timezone;\n\t * no relative labels (\"Today\" / \"Yesterday\") are produced by the SDK.\n\t * `purchase_points_amount` is the amount actually paid at the time of\n\t * purchase — a snapshot of the historical price, which may differ from\n\t * the item's current `price`. `purchase_type` is the currency actually\n\t * charged (`'points' | 'gems' | 'diamonds'`); render the matching\n\t * balance icon next to the amount. The convenience booleans\n\t * `purchased_today` / `purchased_this_week` / `purchased_this_month` are\n\t * computed client-side from the consumer's local clock — useful for\n\t * grouping rows under \"Today\" / \"This Week\" headers.\n\t *\n\t * **Catalog fields on a history row**\n\t * The promotional fields (`ribbon`, `discounted_price`,\n\t * `discount_price_ribbon`, `custom_ribbon_image`, `active_till_date`)\n\t * reflect the CURRENT catalog state of the item, NOT its state at\n\t * purchase time — the default Smartico UI hides them on history rows to\n\t * avoid implying that the historical purchase carried the current\n\t * promotional banner. Descriptive marketing fields (`description`,\n\t * `hint_text`, `related_games`) are typically suppressed on a compact\n\t * history row. The current-purchasability fields `can_buy` and `pool`\n\t * reflect now, not then — useful only if you render a \"Buy Again\"\n\t * affordance on the row. One implementation gotcha: unlike\n\t * `getStoreItems`, this method's transform does NOT auto-parse JSON\n\t * strings in `custom_data` — call `JSON.parse()` yourself if you store\n\t * JSON there.\n\t *\n\t * **Cache & refresh**\n\t * - The SDK caches each `(limit, offset)` page separately for 30 seconds.\n\t * Repeated calls within that window resolve from cache without a\n\t * network round-trip.\n\t * - The cache is invalidated and `onUpdate` (when registered) is invoked\n\t * automatically after a successful {@link buyStoreItem} call — the SDK\n\t * re-fetches the same page parameters that were registered together with\n\t * the current `onUpdate` callback and pushes the fresh array.\n\t * - Multi-tab caveat: if the user has the same brand open in multiple\n\t * tabs, **all open tabs** receive the `onUpdate` event on a purchase,\n\t * not only the tab that initiated the buy. The event is scoped to the\n\t * current authenticated user — a different user's purchase never fires\n\t * this callback.\n\t * - Only ONE `onUpdate` callback can be registered at a time. Each call to\n\t * `getStorePurchasedItems({ onUpdate })` overwrites the previous handler.\n\t *\n\t * **Idempotency**: safe. Pure read.\n\t *\n\t * **Side effects**: none — read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getStorePurchasedItems`](../../docs/ui/store/UIGuide_getStorePurchasedItems.md).\n\t *\n\t * @param params - Optional pagination + callback bag.\n\t * @param params.limit - Page size. Defaults to `20`. Use `20` as the\n\t * conventional value (matches the default Smartico UI end-to-end). Avoid\n\t * non-positive values.\n\t * @param params.offset - Number of rows to skip from the newest end.\n\t * Defaults to `0`. For load-more pagination pass the current array\n\t * length.\n\t * @param params.onUpdate - Optional callback invoked after a successful\n\t * {@link buyStoreItem} elsewhere in the session. Receives the refreshed\n\t * page for the same `(limit, offset)` used on the call that registered\n\t * this callback. Only ONE callback can be registered; each new call\n\t * overwrites the previous one. Pass a stable handler or\n\t * re-register intentionally on screen entry.\n\t *\n\t * @returns Promise resolving to an array of `TStoreItem` history entries\n\t * in newest-first order. Empty array if the user has no purchases (or\n\t * the requested `offset` is beyond the end). Each entry carries\n\t * `purchase_ts`, `purchase_points_amount`, `purchase_type`, and the\n\t * `purchased_today/this_week/this_month` convenience flags in addition\n\t * to the standard item fields.\n\t *\n\t * @example\n\t * ```ts\n\t * // Initial load + subscribe to refresh-on-purchase.\n\t * const handleHistoryUpdate = (items: TStoreItem[]) => {\n\t * console.log(\n\t * '[smartico] purchase history refreshed — re-render the history list with these',\n\t * items.length,\n\t * 'items (newest first):',\n\t * items,\n\t * );\n\t * };\n\t *\n\t * try {\n\t * const firstPage = await _smartico.api.getStorePurchasedItems({\n\t * limit: 20,\n\t * offset: 0,\n\t * onUpdate: handleHistoryUpdate,\n\t * });\n\t *\n\t * if (firstPage.length === 0) {\n\t * console.log('[smartico] no purchase history — render the empty state (\"No purchases yet\")');\n\t * } else {\n\t * console.log(\n\t * '[smartico] render',\n\t * firstPage.length,\n\t * 'history rows (newest first). Show \"Load more\" button if length === 20:',\n\t * firstPage,\n\t * );\n\t *\n\t * // Inspect the first entry's history-only fields.\n\t * const first = firstPage[0];\n\t * console.log(\n\t * '[smartico] most-recent purchase: name=', first.name,\n\t * 'paid', first.purchase_points_amount, first.purchase_type,\n\t * 'at', new Date(first.purchase_ts ?? 0).toLocaleString(),\n\t * '— format with toLocaleString (user-local time) on the row.',\n\t * );\n\t * }\n\t *\n\t * // Load-more pattern: fetch page 2 once the user scrolls / clicks \"Load more\".\n\t * if (firstPage.length === 20) {\n\t * const nextPage = await _smartico.api.getStorePurchasedItems({\n\t * limit: 20,\n\t * offset: firstPage.length,\n\t * });\n\t * const isLastPage = nextPage.length < 20;\n\t * console.log(\n\t * '[smartico] appended page 2 —',\n\t * nextPage.length,\n\t * 'rows.',\n\t * isLastPage ? 'Hide \"Load more\" — end reached.' : 'Keep \"Load more\" visible.',\n\t * );\n\t * }\n\t * } catch (e) {\n\t * console.error(\n\t * '[smartico] failed to load purchase history — show a generic error placeholder or retry with backoff:',\n\t * e,\n\t * );\n\t * }\n\t * ```\n\t */\n\tpublic async getStorePurchasedItems({\n\t\tlimit,\n\t\toffset,\n\t\tonUpdate,\n\t}: { limit?: number; offset?: number; onUpdate?: (data: TStoreItem[]) => void } = {}): Promise<TStoreItem[]> {\n\t\tconst requestLimit = limit === undefined ? 20 : limit;\n\t\tconst requestOffset = offset === undefined ? 0 : offset;\n\t\tconst cacheKey = this.storeHistoryCacheKey(requestLimit, requestOffset);\n\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.StoreHistory, onUpdate);\n\t\t\tthis.storeHistoryOnUpdateParams = { limit: requestLimit, offset: requestOffset };\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tcacheKey,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetPurchasedItemsT(this.userExtId, requestLimit, requestOffset),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\tprotected async updateStorePurchasedItems() {\n\t\tconst payload = await this.api.storeGetPurchasedItemsT(\n\t\t\tthis.userExtId,\n\t\t\tthis.storeHistoryOnUpdateParams.limit,\n\t\t\tthis.storeHistoryOnUpdateParams.offset,\n\t\t);\n\t\tconst cacheKey = this.storeHistoryCacheKey(this.storeHistoryOnUpdateParams.limit, this.storeHistoryOnUpdateParams.offset);\n\n\t\tOCache.set(cacheKey, payload, ECacheContext.WSAPI);\n\n\t\tconst onUpdate = this.onUpdateCallback.get(onUpdateContextKey.StoreHistory);\n\t\tif (onUpdate) {\n\t\t\tonUpdate(payload);\n\t\t}\n\t}\n\n\tprotected async updateStoreItems() {\n\t\tconst payload = await this.api.storeGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.StoreItems, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTTournament,\n\tTTournamentDetailed,\n\tTTournamentRegistrationResult,\n\tTClanTournamentPlayers,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIStore } from './WSAPIStore';\n\n/** @group Tournaments */\nexport class WSAPITournaments extends WSAPIStore {\n\t/**\n\t * Returns the list of tournaments currently visible to the user, scoped\n\t * server-side to what the user's segments qualify them to see. Optionally\n\t * subscribes to live updates via `onUpdate`: the callback is invoked with\n\t * the full refreshed list whenever the user registers in a tournament.\n\t *\n\t * The returned list is the canonical source of truth for tournament\n\t * lobby state (`is_user_registered`, `registration_status`,\n\t * `is_in_progress`, `is_can_register`, etc.). Consumers should NOT\n\t * mutate it optimistically — always wait for the `onUpdate` callback\n\t * (or a fresh fetch after the 30 s cache window) to observe new state.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed list (never a diff/patch).\n\t * Each subsequent call to `getTournamentsList({ onUpdate })` REPLACES\n\t * the prior callback — only one active subscriber at a time. Pass\n\t * `onUpdate: undefined` (or omit it) to keep the prior callback in\n\t * place; the callback is never auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. `registerInTournament(...)` resolves on this connection (any\n\t * `err_code`). The refreshed list reflects the new\n\t * `is_user_registered` / `registration_status` /\n\t * `registration_count` on the affected tournament.\n\t *\n\t * Does NOT fire for: tournament lifecycle transitions (start, finish,\n\t * cancellation), score updates, other users' registrations, or\n\t * operator-side BO edits. Those changes surface only on the next\n\t * cache miss (after the 30 s TTL) — poll manually if your UI needs\n\t * sub-30s lifecycle freshness.\n\t *\n\t * **Server-side filtering** (what's excluded before the SDK sees it)\n\t * The server filters by visibility segment and entry segment, removes\n\t * tournaments past their post-finish display window, and excludes\n\t * tournaments not yet published. SDK consumers receive only items\n\t * the user is eligible to see; no client-side gating is required.\n\t *\n\t * **Reading state from the returned item**\n\t * Drive list bucketing and CTA labels from the SDK-computed booleans\n\t * (`is_active`, `is_can_register`, `is_cancelled`, `is_finished`,\n\t * `is_in_progress`, `is_upcoming`), NOT from raw `start_time` /\n\t * `end_time` comparisons — the booleans encode the canonical\n\t * lifecycle states and already reflect server-side rules around\n\t * qualifying scores and late registration. `is_user_registered` is\n\t * independent of `is_can_register` — a registered user has\n\t * `is_user_registered: true` and `is_can_register: false`. The `me`\n\t * block (if present) carries the user's own leaderboard position and\n\t * score; it's undefined for unregistered users, users without any\n\t * recorded score, and visitor-mode sessions. The `prize_pool_short`\n\t * field carries the operator-supplied summary string (\"$10,000\",\n\t * \"Mixed prizes\") for compact card rendering; the full per-place\n\t * `prizes[]` breakdown is also populated here but is typically\n\t * rendered only in the detail view via\n\t * {@link getTournamentInstanceInfo}.\n\t *\n\t * **Cross-references**\n\t * Tournaments with `is_clan_based: true` group participants by clan —\n\t * see {@link getClanTournamentPlayers} for fetching the players list\n\t * of a specific clan within a clan tournament. The detailed lobby\n\t * view (with full player leaderboard and prize structure) comes from\n\t * {@link getTournamentInstanceInfo}. Tournaments with\n\t * `custom_section_id` belong to an operator-defined custom section\n\t * (resolve metadata via `getCustomSections()`).\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache is\n\t * fully cleared on login / logout.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached array without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getTournamentsList`](../../docs/ui/tournaments/UIGuide_getTournamentsList.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped to\n\t * the brand's public tournament list. Per-user fields (`me`,\n\t * `is_user_registered`, `registration_status`) are not meaningful.\n\t * The `onUpdate` callback is accepted but never fires (registration\n\t * mutations are not supported in visitor mode).\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * tournament list after every\n\t * {@link registerInTournament} round-trip on\n\t * this connection. Each call overwrites the\n\t * prior callback. Never fires in visitor mode.\n\t * @returns Promise resolving to the array of\n\t * tournaments visible to the user. Empty\n\t * array if no tournaments are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] tournament list refreshed — re-render the lobby UI from this array, do not merge with prior state:', refreshed);\n\t * const justRegistered = refreshed.filter(t => t.is_user_registered);\n\t * console.log('[smartico] user is now registered in these tournaments:', justRegistered.map(t => t.name));\n\t * },\n\t * });\n\t *\n\t * // Bucket items by lifecycle state for a tabbed UI.\n\t * const live = tournaments.filter(t => t.is_in_progress);\n\t * const upcoming = tournaments\n\t * .filter(t => t.is_upcoming && !t.is_user_registered)\n\t * .sort((a, b) => a.start_time - b.start_time);\n\t * const mine = tournaments.filter(t => t.is_user_registered);\n\t * const finished = tournaments.filter(t => t.is_finished);\n\t *\n\t * console.log('[smartico] render lobby tabs with these counts: live=', live.length,\n\t * 'upcoming=', upcoming.length, 'mine=', mine.length, 'finished=', finished.length);\n\t *\n\t * // Featured tournament: pin to position 0 of the Overview/Top tabs.\n\t * const featured = tournaments.find(t => t.is_featured && !t.is_cancelled);\n\t * if (featured) {\n\t * console.log('[smartico] featured tournament — pin to position 0 of the Overview tab:', featured.name);\n\t * }\n\t *\n\t * // Visitor mode: onUpdate accepted but never fires; re-poll if needed.\n\t * // const visitorList = await window._smartico.vapi('EN').getTournamentsList();\n\t * ```\n\t */\n\tpublic async getTournamentsList({ onUpdate }: { onUpdate?: (data: TTournament[]) => void } = {}): Promise<TTournament[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.TournamentList, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.TournamentList,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.tournamentsGetLobbyT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full detail of a single tournament instance — adds the\n\t * player leaderboard, the full prize structure, and (for clan\n\t * tournaments) the clan leaderboard and per-clan prize structure on\n\t * top of everything already in `TTournament`. Use this to power a\n\t * tournament detail / lobby screen after the user picks an item from\n\t * {@link getTournamentsList}.\n\t *\n\t * Live leaderboard updates require manual re-fetching — there is no\n\t * subscription model, no push event, and no client-side cache (each\n\t * call hits the server). The default Smartico UI polls every 3 seconds\n\t * while the detail view is open.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `tournamentInstanceId` read from `TTournament.instance_id`\n\t * on an item returned by {@link getTournamentsList}. The method works\n\t * standalone — calling `getTournamentsList()` first is not required by\n\t * the SDK, but is the only stable source of valid IDs.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** This is a one-shot promise; call again to\n\t * refresh.\n\t * - **No client cache.** Every call sends a network request and\n\t * returns the latest server snapshot. Safe to poll on an interval —\n\t * the default Smartico UI uses 3 s while the detail view is visible.\n\t * - **No push event** invalidates or refreshes detail state. Score\n\t * changes, registration count changes, lifecycle transitions — all\n\t * require a fresh `getTournamentInstanceInfo` call.\n\t *\n\t * **Returned shape — beyond `TTournament`**\n\t * `TTournamentDetailed` extends `TTournament` with the following\n\t * additional data: a `players[]` leaderboard sorted server-side by\n\t * score (only members with at least one recorded score); the user's\n\t * own `me` block carrying their rank and score (undefined when not\n\t * registered or when the user has no score yet); a full per-place\n\t * `prizes[]` array (place range, type, points / gems / diamonds\n\t * amounts, image, name); and `related_games[]` if the operator has\n\t * associated games with this tournament. For clan tournaments\n\t * (`is_clan_based === true`), the response also carries\n\t * `clan_leaderboard[]` (ranked clans with `total_score` and\n\t * `contributing_members`), `clan_prize_structure[]` (per-clan-place\n\t * prize tiers — Fixed vs Dynamic, with ScoreWeighted /\n\t * EqualSplit distribution for Dynamic prizes), `user_clan_id` (the\n\t * user's own clan), and the advisory `user_position_in_clan` /\n\t * `user_score_in_clan` fields.\n\t *\n\t * **Idempotency**: safe. Read-only. Each call returns the latest\n\t * server snapshot.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getTournamentInstanceInfo`](../../docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md).\n\t *\n\t * **Visitor mode**: not supported. Use {@link getTournamentsList} for\n\t * the public lobby list in visitor mode; the detail endpoint requires\n\t * an authenticated session.\n\t *\n\t * @param tournamentInstanceId The `instance_id` from a `TTournament`\n\t * returned by {@link getTournamentsList}.\n\t * @returns Promise resolving to `TTournamentDetailed`.\n\t * Rejects if the instance ID is invalid\n\t * or the user lacks visibility for it.\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList();\n\t * const tournament = tournaments[0];\n\t *\n\t * console.log('[smartico] loading detail view for tournament', tournament.instance_id);\n\t * const detail = await window._smartico.api.getTournamentInstanceInfo(tournament.instance_id);\n\t *\n\t * console.log('[smartico] render detail with', detail.players?.length ?? 0,\n\t * 'players,', detail.prizes?.length ?? 0, 'prize tiers');\n\t *\n\t * if (detail.is_clan_based && detail.clan_leaderboard) {\n\t * console.log('[smartico] clan tournament — render clan leaderboard tab with',\n\t * detail.clan_leaderboard.length, 'clans');\n\t * if (detail.user_clan_id != null) {\n\t * console.log('[smartico] user belongs to clan', detail.user_clan_id,\n\t * '— highlight that row in the clan leaderboard');\n\t * }\n\t * }\n\t *\n\t * // Live leaderboard updates — poll every 3 seconds while the detail view is open.\n\t * const pollId = setInterval(async () => {\n\t * try {\n\t * const fresh = await window._smartico.api.getTournamentInstanceInfo(tournament.instance_id);\n\t * console.log('[smartico] detail refreshed — re-render player + clan leaderboards from this new snapshot:', fresh);\n\t * } catch (e) {\n\t * console.error('[smartico] tournament detail poll failed — keep showing last snapshot, retry on next tick:', e);\n\t * }\n\t * }, 3_000);\n\t * // clearInterval(pollId) when the detail view closes.\n\t *\n\t * if (detail.me) {\n\t * console.log('[smartico] current user is rank', detail.me.position,\n\t * 'with', detail.me.scores, 'points — render the sticky \"me\" panel below the leaderboard');\n\t * }\n\t * ```\n\t */\n\tpublic async getTournamentInstanceInfo(tournamentInstanceId: number): Promise<TTournamentDetailed> {\n\t\treturn this.api.tournamentsGetInfoT(this.userExtId, tournamentInstanceId);\n\t}\n\n\t/**\n\t * Returns the ranked players of a specific clan within a clan-based\n\t * tournament instance. Used to drill down from the clan-leaderboard\n\t * tab on the tournament detail view into a single clan's member\n\t * roster.\n\t *\n\t * The server returns up to roughly 20 players (top-N by score\n\t * descending). Server-side ordering is already by `scores` DESC\n\t * (equivalent to `position` ASC) — no client-side re-sort is\n\t * required.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `tournamentInstanceId` (read from `TTournament.instance_id`\n\t * returned by {@link getTournamentsList}) and a `clanId` (read from\n\t * `TTournamentDetailed.clan_leaderboard[].clan_id` returned by\n\t * {@link getTournamentInstanceInfo}). The tournament should be\n\t * clan-based (`is_clan_based === true`); calling this against a\n\t * non-clan tournament typically returns an empty `players` array.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** This is a one-shot promise.\n\t * - **No client cache.** Every call hits the server.\n\t * - **No push event** refreshes the response. Live updates to clan\n\t * member rankings require a fresh call.\n\t * - The default Smartico UI fetches this once when the user opens the\n\t * clan-drill-down modal and does NOT refresh while the modal is\n\t * open. If your UI needs live updates, re-call on an interval; the\n\t * clan leaderboard at the parent level (via\n\t * {@link getTournamentInstanceInfo}) does refresh via its own\n\t * polling cadence.\n\t *\n\t * **Returned shape**\n\t * `TClanTournamentPlayers` carries the requested clan's identity\n\t * (`clan_id`, `clan_public_meta.name`, `clan_public_meta.image_url`)\n\t * alongside the `players[]` array — each entry has `position`,\n\t * `scores`, `public_username`, `clean_ext_user_id`, `avatar_id`,\n\t * `avatar_real_id`, the resolved `avatar_url`, `user_id`, and the\n\t * `is_me` flag identifying the current user's row. The `clan_id` and\n\t * `clan_public_meta` on the response echo the input clan — the\n\t * default Smartico UI ignores them and renders the header from the\n\t * caller-side `ClanLeaderboardEntry` object, but they're available\n\t * for consumers that don't already have that context.\n\t *\n\t * **Username display**: prefer `clean_ext_user_id` when set, falling\n\t * back to `public_username`. The default Smartico UI uses\n\t * `clean_ext_user_id || public_username || ''`.\n\t *\n\t * **Idempotency**: safe. Read-only. Each call returns the latest\n\t * server snapshot.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClanTournamentPlayers`](../../docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param tournamentInstanceId The tournament `instance_id` from a\n\t * clan-based `TTournament`.\n\t * @param clanId The clan ID from\n\t * `TTournamentDetailed.clan_leaderboard[].clan_id`.\n\t * @returns Promise resolving to\n\t * `TClanTournamentPlayers`. An invalid\n\t * ID combination typically yields an\n\t * empty `players` array; the SDK does\n\t * not distinguish \"no scores yet\" from\n\t * \"invalid IDs\" — both manifest as an\n\t * empty list.\n\t *\n\t * @example\n\t * ```ts\n\t * const detail = await window._smartico.api.getTournamentInstanceInfo(tournamentInstanceId);\n\t * if (!detail.is_clan_based || !detail.clan_leaderboard) {\n\t * console.log('[smartico] not a clan tournament — skip clan drill-down');\n\t * return;\n\t * }\n\t *\n\t * // User clicked a clan row in the leaderboard.\n\t * const clickedClan = detail.clan_leaderboard[0];\n\t *\n\t * console.log('[smartico] opening clan drill-down — show modal skeleton while loading');\n\t * const result = await window._smartico.api.getClanTournamentPlayers(\n\t * tournamentInstanceId,\n\t * clickedClan.clan_id,\n\t * );\n\t *\n\t * if (result.players.length === 0) {\n\t * console.log('[smartico] clan has no ranked players yet — render empty state (\"No leaders yet\")');\n\t * } else {\n\t * console.log('[smartico] render clan member rows with .is-me highlight on the current user;',\n\t * result.players.length, 'players ranked');\n\t * const me = result.players.find(p => p.is_me);\n\t * if (me) {\n\t * console.log('[smartico] current user rank in this clan:', me.position, 'score:', me.scores);\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async getClanTournamentPlayers(tournamentInstanceId: number, clanId: number): Promise<TClanTournamentPlayers> {\n\t\treturn this.api.clanTournamentGetPlayers(this.userExtId, tournamentInstanceId, clanId);\n\t}\n\n\t/**\n\t * Registers the authenticated user in the specified tournament instance.\n\t * For tournaments with a buy-in cost, the user's balance is debited\n\t * synchronously before the response is returned; for free tournaments\n\t * the call is a simple membership add.\n\t *\n\t * A successful response (`err_code === 0`) means the registration row\n\t * exists server-side, the buy-in (if any) has been deducted, and the\n\t * SDK has already triggered a refresh of the tournament lobby cache.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate from {@link getTournamentsList} and gate the call\n\t * on `is_can_register === true`. This composite flag already encodes:\n\t * not already registered, slot available\n\t * (`registration_count < players_max_count`), tournament status is\n\t * REGISTER (or STARTED with late-registration enabled), and the\n\t * registration type is not AUTO. The SDK forwards the call\n\t * unconditionally — calling without satisfying these will return one\n\t * of the error codes below.\n\t *\n\t * For clan tournaments (`is_clan_based === true`), the user must\n\t * already belong to a clan before calling. If they don't, prompt them\n\t * to pick a clan first via `joinClan`, then call\n\t * `registerInTournament` after the clan-join resolves. See \"Error\n\t * codes\" `1010` below for the server-side safety net.\n\t *\n\t * **Error codes** (in `err_code`, typed as {@link TournamentRegistrationError})\n\t * - `0` — success; the registration is persisted, buy-in deducted,\n\t * tournament lobby refresh fires.\n\t * - `1010` — `TOURNAMENT_USER_CANNOT_JOIN_WITHOUT_CLAN`: clan-based\n\t * tournament and the user has no clan. Surface the clan-pick flow\n\t * (e.g. open a clan-pick modal driven by `getClans` +\n\t * `joinClan`), then retry registration.\n\t * - `30001` — `TOURNAMENT_INSTANCE_NOT_FOUND`: instance ID is invalid\n\t * or the tournament was deleted. Refresh the lobby via\n\t * `getTournamentsList()` and hide the entry from the UI.\n\t * - `30002` — `TOURNAMENT_REGISTRATION_NOT_ENOUGH_POINTS`: insufficient\n\t * points balance for a points-cost tournament. Show an\n\t * insufficient-balance UI naming the deficit.\n\t * - `30003` — `TOURNAMENT_INSTANCE_NOT_IN_STATE`: tournament is no\n\t * longer in a registerable state (finished, cancelled, finalizing,\n\t * or not yet published with late registration disabled). Refresh\n\t * the lobby; the button should hide.\n\t * - `30004` — `TOURNAMENT_ALREADY_REGISTERED`: user is already\n\t * registered. Treat as idempotent success — hide the Register button\n\t * and refresh the lobby. Usually indicates a stale local state\n\t * (e.g. registered from another tab).\n\t * - `30005` — `TOURNAMENT_USER_DONT_MATCH_CONDITIONS`: user fails the\n\t * tournament's segment / entry conditions. Prefer\n\t * `tournament.segment_dont_match_message` (operator-supplied) over\n\t * `err_message` when both are available.\n\t * - `30006` — `TOURNAMENT_USER_NOT_REGISTERED`: anomalous on a fresh\n\t * register call; usually indicates a server-side race. Treat as a\n\t * generic transient error.\n\t * - `30007` — `TOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS`: status\n\t * transition not allowed (e.g. re-registering after a finished /\n\t * cancelled tournament). Show a generic error; do not retry.\n\t * - `30008` — `TOURNAMENT_MAX_REGISTRATIONS_REACHED`: the tournament\n\t * filled up between the lobby fetch and the registration click.\n\t * Refresh the lobby — the button will hide on the refreshed item.\n\t * - `300010` — insufficient **gems** balance (gems-cost tournament).\n\t * Same UI handling as `30002` but for the gems currency.\n\t * - `300011` — insufficient **diamonds** balance (diamonds-cost\n\t * tournament). Same as `300010` but for diamonds. \n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * Note: clan-tournament registration can occasionally surface error\n\t * codes from the clan-join domain (e.g. `1011` — joined-after-start)\n\t * via the same response path. These are members of `JoinClanErrorCode`,\n\t * not `TournamentRegistrationError`. Branch on the numeric value.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same instance\n\t * returns `30004` once the first call has succeeded. The SDK does NOT\n\t * enforce an in-flight lock. The consumer MUST guard the call site\n\t * against double-clicks (set a local \"registering\" flag on click, clear\n\t * it on response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the tournament lobby cache on every\n\t * response (success OR error) and fires any `onUpdate` callback\n\t * registered via `getTournamentsList({ onUpdate })`. After\n\t * `err_code === 0`, the affected item's `is_user_registered` /\n\t * `registration_status` / `registration_count` reflect the new\n\t * registered state on the refreshed array. Note that\n\t * {@link getTournamentInstanceInfo} is NOT auto-refreshed — if the\n\t * detail screen is open, call it again manually.\n\t *\n\t * The user's balance (points / gems / diamonds) is exposed on the\n\t * user-properties channel and updates independently of this call's\n\t * response — subscribe to user-property updates separately if your UI\n\t * shows the balance.\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - Balance debited synchronously by the buy-in amount in the\n\t * tournament's currency (`registration_cost_points`,\n\t * `registration_cost_gems`, or `registration_cost_diamonds`). For\n\t * free tournaments no deduction occurs.\n\t * - Server-side analytics events fire downstream\n\t * (`tournament_user_registered` for immediate-registration types;\n\t * `tournament_user_registration_pending` or\n\t * `tournament_registered_pending_qualification` for\n\t * manual-approval / qualification-based types).\n\t * - Any operator-configured on-join prizes are distributed (e.g.\n\t * welcome bonus). These surface via the relevant follow-up channels\n\t * (e.g. {@link getBonuses}).\n\t *\n\t * **UI guidance**: see [UI Guide — `registerInTournament`](../../docs/ui/tournaments/UIGuide_registerInTournament.md).\n\t *\n\t * **Visitor mode**: not supported. Calling from a visitor session\n\t * returns a generic error, not a typed `TournamentRegistrationError`.\n\t *\n\t * @param tournamentInstanceId The `instance_id` from `TTournament`\n\t * (NOT the template `tournament_id`).\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t * (or `30004` when treated as idempotent no-op).\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList({\n\t * onUpdate: (refreshed) => console.log('[smartico] tournament list updated — re-render lobby from this array', refreshed),\n\t * });\n\t * const tournament = tournaments.find(t => t.instance_id === instanceId);\n\t *\n\t * if (!tournament) {\n\t * console.log('[smartico] tournament not in current lobby — refresh getTournamentsList and retry');\n\t * return;\n\t * }\n\t * if (!tournament.is_can_register) {\n\t * console.log('[smartico] tournament not currently registerable — keep CTA disabled');\n\t * return;\n\t * }\n\t *\n\t * // Clan tournament + user has no clan → resolve clan first.\n\t * if (tournament.is_clan_based) {\n\t * const userProfile = window._smartico.api.getUserProfile();\n\t * const userClanId = userProfile?.clan_id;\n\t * if (userClanId == null) {\n\t * console.log('[smartico] clan tournament — open the clan-pick modal first; after joinClan resolves, call registerInTournament again');\n\t * return;\n\t * }\n\t * }\n\t *\n\t * console.log('[smartico] registration starting — set in-flight flag, show loading dots on the Join button, keep modal open');\n\t * const r = await window._smartico.api.registerInTournament(tournament.instance_id);\n\t * console.log('[smartico] registration response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 30004) {\n\t * console.log('[smartico] registered (or was already) — close any modal, show a success toast; getTournamentsList onUpdate above will fire with the refreshed array');\n\t * } else if (r.err_code === 1010) {\n\t * console.log('[smartico] clan required — open the clan-pick modal again (this is the server-side safety net for a clan-leave race)');\n\t * } else if (r.err_code === 30002) {\n\t * console.error('[smartico] insufficient points — show insufficient-balance UI; deficit:', tournament.registration_cost_points);\n\t * } else if (r.err_code === 300010) {\n\t * console.error('[smartico] insufficient gems — show insufficient-balance UI; deficit:', tournament.registration_cost_gems);\n\t * } else if (r.err_code === 300011) {\n\t * console.error('[smartico] insufficient diamonds — show insufficient-balance UI; deficit:', tournament.registration_cost_diamonds);\n\t * } else if (r.err_code === 30005) {\n\t * console.error('[smartico] segment mismatch — prefer the operator-supplied message:', tournament.segment_dont_match_message || r.err_message);\n\t * } else if (r.err_code === 30008) {\n\t * console.error('[smartico] tournament full — auto-refresh will hide the button on the refreshed lobby item');\n\t * } else {\n\t * console.error('[smartico] registration failed — show a generic error toast with this message:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async registerInTournament(tournamentInstanceId: number): Promise<TTournamentRegistrationResult> {\n\t\tconst r = await this.api.registerInTournament(this.userExtId, tournamentInstanceId);\n\n\t\tconst o: TTournamentRegistrationResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateTournaments() {\n\t\tconst payload = await this.api.tournamentsGetLobbyT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.TournamentList, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTClans,\n\tTClanInfo,\n\tTClanJoinResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPITournaments } from './WSAPITournaments';\n\n/** @group Clans */\nexport class WSAPIClans extends WSAPITournaments {\n\t/**\n\t * Returns the active clans visible to the current user along with the\n\t * user's own membership state (`user_clan_id`, `cooldown_until`,\n\t * `join_date`). Use this to power a clan-picker / clan-browser screen.\n\t *\n\t * The returned `clans[]` is server-sorted by `rating_position` ASC\n\t * (1 = highest-ranked). The server has already filtered out archived\n\t * clans, clans the user fails segment conditions for, and (when any\n\t * clan has a non-zero score) clans with a zero rating score.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed `TClans` payload (never a\n\t * diff/patch). Each subsequent call to `getClans({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — note that, unlike most other subscription\n\t * methods in the SDK, this callback is **poll-driven only**. There\n\t * is NO server push that refreshes the clans list. The callback\n\t * fires when:\n\t *\n\t * 1. The 30-second cache TTL expires and a subsequent `getClans()`\n\t * call (from the consumer) triggers a fresh fetch.\n\t *\n\t * Consequence: clan-membership changes (other users joining your\n\t * clan, an operator-driven kick, a clan being archived) surface\n\t * only on the next consumer-driven fetch. If your UI needs\n\t * near-live state, poll `getClans()` on an interval; or re-call\n\t * after a {@link joinClan} resolves to pick up the new\n\t * `user_clan_id` immediately.\n\t *\n\t * **Reading state from the returned payload**\n\t * Drive list rendering from `clans[]` (already sorted). Identify\n\t * the user's own clan via `clan.clan_id === user_clan_id`\n\t * (`null` for clanless users). Detect an active switch-cooldown\n\t * with `cooldown_until !== null` — when set, the user cannot join\n\t * any clan until the cooldown expires, even clans they could\n\t * normally join. The cooldown is **user-level**, not per-clan.\n\t *\n\t * `cooldown_until` is an ISO 8601 UTC datetime string with no\n\t * timezone suffix (`\"YYYY-MM-DDTHH:MM:SS\"`). Parse as UTC:\n\t * `new Date(cooldown_until + 'Z')` or `moment.utc(cooldown_until)`.\n\t * Display in the user's local time. The default cooldown period\n\t * is configured per label by the operator (typically 7 days).\n\t *\n\t * `rating_position` is a global rank computed server-side across\n\t * all active clans in the label (1 = highest-rated). Because some\n\t * clans may be hidden by per-user segment visibility, positions\n\t * the user sees may skip (e.g. 1, 3, 7) — don't assume the array\n\t * spans a contiguous range.\n\t *\n\t * The `entry_fee_currency_type_id` enum on each clan uses values\n\t * `0` = points, `1` = gems, `2` = diamonds, `3` = free. Compare\n\t * `entry_fee_amount` against the user's matching balance (from\n\t * {@link getUserProfile}) to drive Join button affordability.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the\n\t * cache window return a deep-cloned cached payload without a\n\t * network round-trip.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClans`](../../docs/ui/clans/UIGuide_getClans.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * `TClans` payload whenever the 30 s cache\n\t * expires and a subsequent fetch lands.\n\t * Each call to `getClans` overwrites the\n\t * prior callback.\n\t * @returns Promise resolving to `TClans`. Empty\n\t * `clans` array if no clans are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] clans payload refreshed (poll-driven; ~30 s cadence) — re-render the clan list from this payload:', refreshed);\n\t * },\n\t * });\n\t *\n\t * console.log('[smartico] user is', result.user_clan_id == null ? 'clanless' : 'in clan ' + result.user_clan_id);\n\t *\n\t * // Cooldown handling — affects ALL clans, not a specific one.\n\t * if (result.cooldown_until) {\n\t * const cooldownEndsUtc = new Date(result.cooldown_until + 'Z');\n\t * console.log('[smartico] switch-cooldown active — disable all Join buttons until', cooldownEndsUtc.toLocaleString(),\n\t * '(local). Render the cooldown end on the disabled button label.');\n\t * }\n\t *\n\t * // Render clans — already sorted by rating_position ASC.\n\t * for (const clan of result.clans) {\n\t * const isMine = clan.clan_id === result.user_clan_id;\n\t * const isFull = clan.member_count >= clan.capacity_limit;\n\t *\n\t * if (isMine) {\n\t * console.log('[smartico] highlight clan', clan.clan_id, 'as \"Your clan\"; CTA label \"Your clan\", no-op');\n\t * } else if (result.cooldown_until) {\n\t * console.log('[smartico] clan', clan.clan_id, '— Join blocked by user cooldown; show disabled button with cooldown end date');\n\t * } else if (isFull) {\n\t * console.log('[smartico] clan', clan.clan_id, '— Clan full; show disabled \"Clan is full\" button');\n\t * } else {\n\t * const label = clan.entry_fee_amount === 0 || clan.entry_fee_currency_type_id === 3\n\t * ? 'Join free'\n\t * : `Join (${clan.entry_fee_amount} ${['Points','Gems','Diamonds'][clan.entry_fee_currency_type_id]})`;\n\t * console.log('[smartico] clan', clan.clan_id, '— render enabled Join button labelled', label);\n\t * }\n\t * }\n\t *\n\t * // After a successful joinClan(), re-call getClans manually — no push refresh.\n\t * // const r = await window._smartico.api.joinClan(targetClanId);\n\t * // if (r.errCode === 0) await window._smartico.api.getClans();\n\t * ```\n\t */\n\tpublic async getClans({ onUpdate }: { onUpdate?: (data: TClans) => void } = {}): Promise<TClans> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Clans, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.Clans,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.clansGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full detail of a single clan — adds the ranked\n\t * `members[]` roster and a fresh `cooldown_until` on top of the same\n\t * fields exposed on a `TClan` list entry. Use this to power a clan\n\t * detail screen / popup after the user picks an item from\n\t * {@link getClans}.\n\t *\n\t * Each call is a fresh server round-trip — there is no client cache\n\t * and no push event refreshes detail state. Re-call to refresh.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `clanId` (typically read from\n\t * `TClans.clans[i].clan_id` returned by {@link getClans}). The\n\t * method works standalone — `getClans()` is not required first —\n\t * but is the only stable source of valid IDs.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call sends a network request.\n\t * - **No push event** refreshes the detail. Member-join, kick, or\n\t * contribution-score changes require a fresh `getClanInfo` call.\n\t *\n\t * **Returned shape — beyond `TClan`**\n\t * `TClanInfo` adds two things on top of the same identity / capacity\n\t * / fee / rating fields you'd see on a `TClan` list entry:\n\t * 1. A ranked `members[]` array — each entry carries `user_id`,\n\t * `public_username`, `avatar_id` / `avatar_real_id`, the resolved\n\t * `avatar_url`, the member's `position` (rank within this clan),\n\t * `contribution_score`, the `is_me` flag identifying the current\n\t * user's row, and the optional `clean_ext_user_id`. The server\n\t * orders members by score DESC (i.e. `position` ASC); no\n\t * client-side re-sort is required.\n\t * 2. A fresh `cooldown_until` on the clan info itself. This is the\n\t * SAME user-level cooldown as `TClans.cooldown_until` (the\n\t * cooldown is global to the user, not per clan) — but `getClans`\n\t * returns a value cached for up to 30 s while `getClanInfo`\n\t * always returns the current value. If the list-cached cooldown\n\t * has just expired, this detail call will reflect it first.\n\t *\n\t * **Username display**: in the default Smartico UI, member rows use\n\t * `public_username`. Some surfaces (e.g. the tournament clan\n\t * drill-down) prefer `clean_ext_user_id` as the primary display\n\t * with `public_username` as fallback — pick the convention that\n\t * matches your product's identity model.\n\t *\n\t * **Idempotency**: safe. Read-only.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClanInfo`](../../docs/ui/clans/UIGuide_getClanInfo.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param clanId The clan ID from `TClans.clans[i].clan_id`.\n\t * @returns Promise resolving to `TClanInfo`. Rejects if the\n\t * clan ID is invalid or the user lacks visibility\n\t * for it.\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans();\n\t * const clan = result.clans[0];\n\t *\n\t * console.log('[smartico] loading detail for clan', clan.clan_id);\n\t * const detail = await window._smartico.api.getClanInfo(clan.clan_id);\n\t *\n\t * console.log('[smartico] render detail with', detail.members.length, 'members');\n\t *\n\t * // Find current user's row to power a sticky \"me\" footer.\n\t * const meRow = detail.members.find(m => m.is_me);\n\t * if (meRow) {\n\t * console.log('[smartico] current user rank in this clan:', meRow.position,\n\t * 'contribution:', meRow.contribution_score, '— render sticky my-member footer');\n\t * }\n\t *\n\t * // Resolve Join CTA state using the detail's cooldown (always fresh).\n\t * const isMyClan = detail.clan_id === result.user_clan_id;\n\t * const inCooldown = detail.cooldown_until != null;\n\t * const isFull = detail.member_count >= detail.capacity_limit;\n\t * if (isMyClan) {\n\t * console.log('[smartico] this is the user\\'s clan — render disabled \"Your clan\" button');\n\t * } else if (inCooldown) {\n\t * const ends = new Date(detail.cooldown_until + 'Z');\n\t * console.log('[smartico] user is in clan-switch cooldown until', ends.toLocaleString(),\n\t * '— render disabled cooldown button');\n\t * } else if (isFull) {\n\t * console.log('[smartico] clan is full — render disabled \"Clan is full\" button');\n\t * } else {\n\t * console.log('[smartico] joinable — render enabled Join button');\n\t * }\n\t * ```\n\t */\n\tpublic async getClanInfo(clanId: number): Promise<TClanInfo> {\n\t\treturn this.api.clansGetInfoT(this.userExtId, clanId);\n\t}\n\n\t/**\n\t * Joins (or switches into) a clan on behalf of the current user. For\n\t * paid clans (`entry_fee_amount > 0`), the user's balance for the\n\t * matching currency is debited synchronously before the response\n\t * returns. If the user is already in a clan, this is treated as an\n\t * atomic clan-switch (deactivate old membership + insert new + debit\n\t * fee, all in one transaction — the user is never observably\n\t * clanless).\n\t *\n\t * A successful response (`errCode === 0`) means: membership is\n\t * persisted, the fee (if any) has been debited, the user's\n\t * switch-cooldown has restarted, and a clan-joined CRM event has\n\t * fired server-side.\n\t *\n\t * @remarks\n\t * **Result shape note**: `TClanJoinResult` uses `errCode` / `errMsg`\n\t * (camelCase) — different from most other SDK result types in this\n\t * library which use `err_code` / `err_message` (snake_case). Branch\n\t * on the camelCase keys when reading this method's result.\n\t *\n\t * **Preconditions**\n\t * Read the candidate from {@link getClans} and gate the call on\n\t * `clan.member_count < clan.capacity_limit`, `cooldown_until == null`\n\t * (on the `TClans` payload — the cooldown is user-level, not\n\t * per-clan), and the user's balance for `entry_fee_currency_type_id`\n\t * being at least `entry_fee_amount` (free clans bypass this check).\n\t * The SDK forwards the call unconditionally — calling without\n\t * satisfying these will most likely return one of the error codes\n\t * below.\n\t *\n\t * **Error codes** (in `errCode`, typed as {@link JoinClanErrorCode})\n\t * - `0` (`JOIN_CLAN_OK`) — success; membership persisted, fee\n\t * debited, cooldown restarted.\n\t * - `1000` (`JOIN_CLAN_INVALID_PARAMETERS`) — request body missing\n\t * `clan_id`. Should not occur via the SDK; treat as a programming\n\t * error.\n\t * - `1001` (`JOIN_CLAN_NOT_FOUND`) — clan doesn't exist for this\n\t * label, OR the clan is archived / in draft state. The server\n\t * merges \"missing\" and \"archived\" into this single code. Refresh\n\t * `getClans()` and remove the entry from the UI.\n\t * - `1002` (`JOIN_CLAN_FULL`) — capacity reached between the list\n\t * fetch and the join click (`member_count >= capacity_limit` at\n\t * the server's atomic check). Refresh the list — the button will\n\t * become \"Clan is full\".\n\t * - `1003` (`JOIN_CLAN_INSUFFICIENT_FUNDS`) — insufficient balance\n\t * for the clan's entry fee. A single code covers all three\n\t * currencies (points / gems / diamonds); read\n\t * `clan.entry_fee_currency_type_id` to identify which currency\n\t * the user is short on. Show an insufficient-balance UI naming\n\t * the deficit.\n\t * - `1004` (`JOIN_CLAN_SEGMENT_MISMATCH`) — user does not meet the\n\t * clan's entry segment or numeric conditions. There is no\n\t * client-side pre-guard for this — surface a gating message.\n\t * - `1005` (`JOIN_CLAN_USER_IS_NOT_IN_CLAN`) — this method NEVER\n\t * returns `1005`. The code is shared with the tournament\n\t * registration error space and fires only on\n\t * {@link registerInTournament} responses when a clan-based\n\t * tournament requires the user to be in a clan first.\n\t * - `1006` (`JOIN_CLAN_COOLDOWN_ACTIVE`) — user is inside the\n\t * switch-cooldown window from a previous clan join (default\n\t * 7 days, configurable per label). Only reachable when the user is\n\t * already in a *different* clan (this call is then a clan switch);\n\t * a first-time join never returns `1006`. Surface the\n\t * `TClans.cooldown_until` expiry in the disabled CTA.\n\t * - `1011` (`JOIN_CLAN_JOINED_AFTER_TOURNAMENT_START`) — this\n\t * method does NOT return `1011` directly. The code fires on\n\t * {@link registerInTournament} responses when the user joined\n\t * their current clan after the tournament started AND already\n\t * has tournament scores.\n\t * - other non-zero — generic server error. Surface `errMsg` if any.\n\t *\n\t * **Idempotency**: NOT safe — and notably dangerous. Calling\n\t * `joinClan` with the user's CURRENT `clanId` does NOT short-circuit\n\t * server-side; the call is treated as a clan-switch to the same\n\t * clan. If the label's cooldown is non-zero (the default), the\n\t * second call returns `1006`. If the cooldown is configured to\n\t * zero, the second call will deduct the entry fee AGAIN, deactivate\n\t * the membership, and re-insert it. The SDK does NOT enforce an\n\t * in-flight lock. Consumers MUST guard the call site against\n\t * double-clicks (set a local \"joining\" flag on click, clear it on\n\t * response) AND short-circuit when the user is already in the\n\t * target clan.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK does NOT automatically refresh the {@link getClans} cache\n\t * after a join. Manually re-call `getClans()` on success to pick up\n\t * the new `user_clan_id`, refreshed `member_count`, and the new\n\t * `cooldown_until` value. Until you do, the cached `TClans` payload\n\t * is stale.\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - Entry-fee currency balance decreases by `entry_fee_amount`\n\t * (visible on the next {@link getUserProfile} refresh / via the\n\t * user-properties update channel).\n\t * - The user's clan membership row is created (or replaced, on a\n\t * switch). `member_count` on the new clan increments by 1; on a\n\t * switch, the old clan's `member_count` decrements by 1 in the\n\t * same transaction.\n\t * - The user's switch-cooldown restarts at the join time (the\n\t * `TClans.cooldown_until` field on the next list fetch reflects\n\t * the new expiry).\n\t * - Server-side CRM analytics fire (clan-joined event, currency-\n\t * deducted event for paid clans). These surface only as\n\t * server-side traces; the SDK consumer observes them indirectly\n\t * via balance / membership refresh.\n\t *\n\t * **UI guidance**: see [UI Guide — `joinClan`](../../docs/ui/clans/UIGuide_joinClan.md).\n\t *\n\t * **Visitor mode**: not supported. The server rejects the request\n\t * for unauthenticated sessions.\n\t *\n\t * @param clanId The clan ID from `TClans.clans[i].clan_id` (or\n\t * `TClanInfo.clan_id`).\n\t * @returns `{ errCode, errMsg }`; success when `errCode === 0`.\n\t * Note camelCase keys (see \"Result shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans();\n\t * const target = result.clans.find(c => c.clan_id === clanId);\n\t *\n\t * if (!target) {\n\t * console.log('[smartico] clan not in current list — refresh getClans and retry');\n\t * return;\n\t * }\n\t * if (target.clan_id === result.user_clan_id) {\n\t * console.log('[smartico] user is already in this clan — short-circuit; do NOT call joinClan again, the server will treat it as a switch and may re-deduct the fee');\n\t * return;\n\t * }\n\t * if (result.cooldown_until) {\n\t * console.log('[smartico] user is in cooldown — disable Join until', new Date(result.cooldown_until + 'Z').toLocaleString());\n\t * return;\n\t * }\n\t * if (target.member_count >= target.capacity_limit) {\n\t * console.log('[smartico] clan is full — disable Join');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] join starting — set in-flight flag, show loading dots on Join button, keep modal open');\n\t * const r = await window._smartico.api.joinClan(target.clan_id);\n\t * console.log('[smartico] join response received — clear in-flight flag');\n\t *\n\t * if (r.errCode === 0) {\n\t * console.log('[smartico] joined successfully — refresh getClans to pick up the new user_clan_id, member_count, and cooldown_until');\n\t * await window._smartico.api.getClans();\n\t * } else if (r.errCode === 1002) {\n\t * console.error('[smartico] clan is full — refresh list, hide the Join CTA on the now-full clan');\n\t * } else if (r.errCode === 1003) {\n\t * const currencyLabel = ['points', 'gems', 'diamonds'][target.entry_fee_currency_type_id] ?? 'currency';\n\t * console.error('[smartico] insufficient', currencyLabel, '— need', target.entry_fee_amount);\n\t * } else if (r.errCode === 1004) {\n\t * console.error('[smartico] user does not meet segment / entry conditions — show a gating message');\n\t * } else if (r.errCode === 1006) {\n\t * console.error('[smartico] cooldown active — surface the cooldown_until from getClans:', result.cooldown_until);\n\t * } else if (r.errCode === 1001) {\n\t * console.error('[smartico] clan not found or archived — refresh list and remove from UI');\n\t * } else {\n\t * console.error('[smartico] join failed — show a generic error toast with this message:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async joinClan(clanId: number): Promise<TClanJoinResult> {\n\t\treturn this.api.clanJoin(this.userExtId, clanId);\n\t}\n\n\tprotected async updateClans() {\n\t\tconst payload = await this.api.clansGetListT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Clans, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tJackpotDetails,\n\tJackpotPot,\n\tJackpotWinnerHistory,\n\tJackpotsOptinResponse,\n\tJackpotsOptoutResponse,\n} from '../Jackpots';\nimport { IntUtils } from '../IntUtils';\nimport { TGetJackpotEligibleGamesResponse } from '../Jackpots/GetJackpotEligibleGamesResponse';\nimport {\n\tJACKPOT_TEMPLATE_CACHE_SEC,\n\tJACKPOT_POT_CACHE_SEC,\n\tJACKPOT_WINNERS_CACHE_SEC,\n\tJACKPOT_ELIGIBLE_GAMES_CACHE_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIClans } from './WSAPIClans';\n\n/** @group Jackpots */\nexport class WSAPIJackpots extends WSAPIClans {\n\n\t/** @hidden */\n\tprotected jackpotGetSignature: string = '';\n\tprotected async jackpotClearCache() {\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Jackpots);\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.JackpotWinners);\n\t}\n\n\t/**\n\t * Returns the user-eligible jackpots active for the label, fused with their live\n\t * pot values. Each entry carries the static template (name, description, opt-in\n\t * state, eligible games, currency) plus a freshly-fetched `pot` snapshot.\n\t *\n\t * Designed to be polled at high frequency (every 1 second is fine) — the SDK\n\t * splits the response into a 30-second template cache and a 1-second pot-value\n\t * cache so consumers can render a live-counting pot amount without hammering\n\t * the server for the static template data.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls.\n\t * - Visitor mode supported via `_smartico.vapi(lang).jackpotGet(...)`.\n\t *\n\t * **Server-side eligibility filtering**\n\t * Jackpots are filtered server-side by the user's segments before being\n\t * returned. Templates the user is ineligible for never appear in this\n\t * response — there is no \"locked\" state to render. An empty result for a\n\t * known-good user typically means none of the configured templates match\n\t * the user's segments / level / brand.\n\t *\n\t * **Filter behavior**\n\t * Passing `related_game_id` returns only jackpots linked to that game (from\n\t * the operator's games catalog). Passing `jp_template_id` returns just that\n\t * single template. With no filter, all active templates the user is\n\t * eligible for are returned. Changing the filter between calls flushes both\n\t * the template cache and the pot cache.\n\t *\n\t * **Two-tier cache**\n\t * - Template definitions: 30 s cache. Re-fetched on filter change or when\n\t * opt-in / opt-out / a jackpot-win push lands.\n\t * - Pot values: 1 s cache. Re-fetched on every call past the 1-second\n\t * window so a 1 Hz poll renders a smoothly counting pot.\n\t *\n\t * **`jp_public_meta.custom_data`**\n\t * Server returns this as a JSON-encoded string; the SDK parses it inline so\n\t * consumers always receive either a parsed object or the raw string.\n\t *\n\t * **Personal vs MultiUser jackpots** (see {@link JackpotType})\n\t * - `MultiUser` (1) — shared pot; `registration_count` reflects real opted-in\n\t * user count; temperature transitions fire push events.\n\t * - `Personal` (2) — independent per-user pot; `registration_count` is\n\t * always 1; temperature push events are suppressed.\n\t *\n\t * **Refresh**\n\t * - `jp_status_id`, segment changes, and operator template edits surface\n\t * after the 30 s template cache TTL.\n\t * - Opt-in / opt-out / jackpot-win push events all clear the template and\n\t * pot caches — the next call re-fetches.\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotGet`](../../docs/ui/jackpots/UIGuide_jackpotGet.md).\n\t *\n\t * @param filter Optional filter narrowing the result set.\n\t * @param filter.related_game_id Limit to jackpots linked to this game ID\n\t * (from the operator's games catalog).\n\t * @param filter.jp_template_id Limit to a single template.\n\t * @returns Array of {@link JackpotDetails} — empty if the user is eligible\n\t * for no active jackpots.\n\t *\n\t * @example\n\t * ```ts\n\t * // Poll every second for live pot counter\n\t * setInterval(async () => {\n\t * const jackpots = await window._smartico.api.jackpotGet();\n\t * for (const jp of jackpots) {\n\t * console.log('[smartico] update pot widget for', jp.jp_public_meta.name, '— amount:', jp.pot.current_pot_amount_user_currency, jp.user_currency, '— temperature:', jp.pot.current_pot_temperature);\n\t * }\n\t * }, 1000);\n\t *\n\t * // Filtered fetch for a specific game tile\n\t * const linked = await window._smartico.api.jackpotGet({ related_game_id: 'gold-slot2' });\n\t * console.log('[smartico] linked jackpots for game:', linked.length);\n\t * ```\n\t */\n\tpublic async jackpotGet(filter?: { related_game_id?: string; jp_template_id?: number }): Promise<JackpotDetails[]> {\n\t\tconst signature: string = `${filter?.jp_template_id}:${filter?.related_game_id}`;\n\n\t\tif (signature !== this.jackpotGetSignature) {\n\t\t\tthis.jackpotGetSignature = signature;\n\t\t\tthis.jackpotClearCache();\n\t\t}\n\n\t\tlet jackpots: JackpotDetails[] = [];\n\t\tlet pots: JackpotPot[] = [];\n\n\t\tjackpots = await OCache.use<JackpotDetails[]>(\n\t\t\tonUpdateContextKey.Jackpots,\n\t\t\tECacheContext.WSAPI,\n\t\t\tasync () => {\n\t\t\t\tconst _jackpots = await this.api.jackpotGet(this.userExtId, filter);\n\t\t\t\tif (!_jackpots?.items) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tconst _pots = _jackpots.items.map((jp) => jp.pot);\n\n\t\t\t\t_jackpots.items.forEach((jp) => {\n\t\t\t\t\tjp.jp_public_meta.custom_data = IntUtils.JsonOrText(jp.jp_public_meta.custom_data);\n\t\t\t\t});\n\n\t\t\t\tOCache.set(onUpdateContextKey.Pots, _pots, ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);\n\t\t\t\treturn _jackpots.items;\n\t\t\t},\n\t\t\tJACKPOT_TEMPLATE_CACHE_SEC,\n\t\t);\n\n\t\tif (jackpots.length > 0) {\n\t\t\tpots = await OCache.use<JackpotPot[]>(\n\t\t\t\tonUpdateContextKey.Pots,\n\t\t\t\tECacheContext.WSAPI,\n\t\t\t\tasync () => {\n\t\t\t\t\tconst jp_template_ids = jackpots.map((jp) => jp.jp_template_id);\n\t\t\t\t\treturn (await this.api.potGet(this.userExtId, { jp_template_ids })).items;\n\t\t\t\t},\n\t\t\t\tJACKPOT_POT_CACHE_SEC,\n\t\t\t);\n\t\t}\n\n\t\treturn jackpots.map((jp) => {\n\t\t\tlet _jp: JackpotDetails = {\n\t\t\t\t...jp,\n\t\t\t\tpot: pots.find((p) => p.jp_template_id === jp.jp_template_id),\n\t\t\t};\n\t\t\treturn _jp;\n\t\t});\n\t}\n\n\t/**\n\t * Opts the authenticated user into a jackpot. From this point on, the user\n\t * contributes to the pot (per the template's `contribution_type` and\n\t * `contribution_value`) and is eligible to win when the pot explodes.\n\t *\n\t * On success the SDK clears the jackpot caches — the next\n\t * {@link jackpotGet} call returns the updated `is_opted_in: true` and an\n\t * incremented `registration_count`.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t * - The jackpot must currently be active and the user must be in its\n\t * eligibility segment. Ineligible jackpots are filtered out of\n\t * {@link jackpotGet} entirely, so a card the user sees is opt-in-able.\n\t *\n\t * **Error handling**\n\t * The server returns a non-zero `errCode` with a human-readable `errMsg`\n\t * for any failure. Common causes:\n\t * - User is in a control group.\n\t * - Jackpot template is not active (status changed since the user opened\n\t * the card).\n\t * - User is already opted in (the SDK has no client-side guard against a\n\t * double-tap; the server enforces).\n\t * - DB race / generic server error.\n\t *\n\t * The SDK does NOT enumerate distinct numeric codes for each cause — branch\n\t * on `errCode === 0` for success and surface `errMsg` as-is for failures.\n\t *\n\t * **Idempotency / re-opt-in semantics**\n\t * - **Already opted in** → returns non-zero `errCode` (\"User already opted in\").\n\t * - **Previously opted in then opted out** → succeeds silently; the server\n\t * re-activates the registration. This is not an error path — a user can\n\t * freely cycle opt-in / opt-out.\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears the template, pot, and winners caches.\n\t * - The next {@link jackpotGet} call returns `is_opted_in: true` for this\n\t * template.\n\t *\n\t * **Side effects**\n\t * Fires a `JACKPOT_OPT_IN` engagement event (visible to operator-side\n\t * automation rules). Does NOT immediately move points / gems — contributions\n\t * happen per-bet via the user's gameplay, not on opt-in.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotOptIn`](../../docs/ui/jackpots/UIGuide_jackpotOptIn.md).\n\t *\n\t * @param filter.jp_template_id ID of the jackpot template to join.\n\t * @returns {@link JackpotsOptinResponse} — `errCode === 0` on success.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.jackpotOptIn({ jp_template_id: 42 });\n\t *\n\t * if (r.errCode === 0) {\n\t * console.log('[smartico] opted in — refresh jackpot card to show opt-out CTA');\n\t * } else {\n\t * console.error('[smartico] opt-in failed — show this message in an error toast:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async jackpotOptIn(filter: { jp_template_id: number }): Promise<JackpotsOptinResponse> {\n\t\tif (!filter.jp_template_id) {\n\t\t\tthrow new Error('jp_template_id is required in jackpotOptIn');\n\t\t}\n\n\t\tconst result = await this.api.jackpotOptIn(this.userExtId, filter);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Opts the authenticated user out of a jackpot. From this point on the user\n\t * no longer contributes to the pot and is not eligible to win.\n\t *\n\t * The user can re-join later via {@link jackpotOptIn} — opt-out is not\n\t * permanent.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t *\n\t * **Error handling**\n\t * The server returns a non-zero `errCode` with a human-readable `errMsg` for\n\t * any failure. Common causes:\n\t * - User has never opted in OR is already opted out — server returns\n\t * non-zero `errCode` for the \"already opted out\" case. Calling opt-out\n\t * on a jackpot the user has never registered for typically returns\n\t * success (the server finds no registration row to update).\n\t * - DB race / generic server error.\n\t *\n\t * Unlike {@link jackpotOptIn}, opt-out does NOT check the template's status\n\t * — the user can opt out of a jackpot that has been deactivated by the\n\t * operator.\n\t *\n\t * **Idempotency**\n\t * - First opt-out → success.\n\t * - Second opt-out → non-zero `errCode` (\"Already opted out\").\n\t * - Opt-out of a never-joined jackpot → typically succeeds silently\n\t * (no registration row to act on).\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears the template, pot, and winners caches.\n\t * - The next {@link jackpotGet} call returns `is_opted_in: false` for this\n\t * template and a decremented `registration_count`.\n\t *\n\t * **Side effects**\n\t * Fires a `JACKPOT_OPT_OUT` engagement event for operator-side automation\n\t * rules. The user's existing contributions to the current pot remain in\n\t * place — opt-out stops future contributions but does not refund past ones.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotOptOut`](../../docs/ui/jackpots/UIGuide_jackpotOptOut.md).\n\t *\n\t * @param filter.jp_template_id ID of the jackpot template to leave.\n\t * @returns {@link JackpotsOptoutResponse} — `errCode === 0` on success.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.jackpotOptOut({ jp_template_id: 42 });\n\t *\n\t * if (r.errCode === 0) {\n\t * console.log('[smartico] opted out — refresh jackpot card to show join CTA');\n\t * } else {\n\t * console.error('[smartico] opt-out failed — show this message in an error toast:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async jackpotOptOut(filter: { jp_template_id: number }): Promise<JackpotsOptoutResponse> {\n\t\tif (!filter.jp_template_id) {\n\t\t\tthrow new Error('jp_template_id is required in jackpotOptOut');\n\t\t}\n\n\t\tconst result = await this.api.jackpotOptOut(this.userExtId, filter);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns past winners of a specific jackpot template, paginated. Use to\n\t * power a \"Recent winners\" panel inside the jackpot detail modal.\n\t *\n\t * **Important**: respect the `expose_winners_over_api` flag on the jackpot's\n\t * {@link JackpotDetails} before calling this method. The server-side handler\n\t * does NOT enforce that flag — it is a UI-only gate. Custom UIs that ignore\n\t * the flag will display winners the operator intended to keep private.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t * - The consumer SHOULD check\n\t * {@link JackpotDetails.expose_winners_over_api} before calling, since\n\t * the server does not enforce it.\n\t *\n\t * **Pagination**\n\t * Server default page size is 20. Pass `limit` and `offset` to paginate\n\t * (e.g. infinite-scroll). The wire response carries a `has_more` flag, but\n\t * this SDK method returns only the `winners` array — detect end-of-list by\n\t * a returned array shorter than `limit`.\n\t *\n\t * **Currency caveat**\n\t * Winner amounts in the response (`winner.winning_amount_jp_currency`) are\n\t * in the jackpot's NATIVE currency, NOT the user's wallet currency. If a\n\t * user-currency display is needed, the consumer must convert client-side.\n\t *\n\t * **Refresh**\n\t * - The SDK caches per `jp_template_id` for 30 seconds.\n\t * - Caches clear on jackpot-win push events and on opt-in / opt-out.\n\t *\n\t * **Error handling**\n\t * Non-zero `errCode` on control-group users or generic server errors. The\n\t * SDK does NOT enumerate distinct codes — branch on `errCode === 0` and\n\t * surface `errMsg` on failure.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getJackpotWinners`](../../docs/ui/jackpots/UIGuide_getJackpotWinners.md).\n\t *\n\t * @returns Array of {@link JackpotWinnerHistory} entries newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const [jp] = await window._smartico.api.jackpotGet({ jp_template_id: 42 });\n\t *\n\t * if (!jp || !jp.expose_winners_over_api) {\n\t * console.log('[smartico] winners hidden by operator config — hide the winners tab');\n\t * return;\n\t * }\n\t *\n\t * const winners = await window._smartico.api.getJackpotWinners({\n\t * jp_template_id: 42,\n\t * limit: 20,\n\t * offset: 0,\n\t * });\n\t * console.log('[smartico] render', winners.length, 'recent winner rows (amounts in', jp.jp_currency + ')');\n\t * ```\n\t */\n\tpublic async getJackpotWinners({\n\t\tlimit,\n\t\toffset,\n\t\tjp_template_id,\n\t}: {\n\t\t/** Page size (default 20). */\n\t\tlimit?: number;\n\t\t/** Pagination offset (default 0). */\n\t\toffset?: number;\n\t\t/** Jackpot template ID (required). */\n\t\tjp_template_id?: number;\n\t}): Promise<JackpotWinnerHistory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.JackpotWinners + jp_template_id,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getJackpotWinnersT(this.userExtId, limit, offset, jp_template_id),\n\t\t\tJACKPOT_WINNERS_CACHE_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the casino games eligible to contribute to a specific jackpot —\n\t * the catalog the user must play to grow the pot. Use to power an\n\t * \"Eligible games\" carousel inside the jackpot detail modal.\n\t *\n\t * **Shortcut**: when the jackpot's\n\t * {@link JackpotDetails.ach_related_game_allow_all} flag is `true`, every\n\t * game in the operator catalog contributes — there's no point calling this\n\t * method (the result would be the full catalog). The default Smartico UI\n\t * hides the Eligible Games tab entirely in that case.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory.\n\t *\n\t * **`onUpdate` caveat**\n\t * The `onUpdate` callback is accepted to match the SDK's subscription\n\t * contract but is NOT auto-invoked by any current server push. It will only\n\t * fire if a consumer (or a future SDK version) explicitly pushes an update.\n\t * Treat it as a no-op for now.\n\t *\n\t * **Refresh**\n\t * - The SDK caches per `jp_template_id` for 30 seconds.\n\t * - Cache does NOT clear on opt-in / opt-out / jackpot-win — eligible-game\n\t * lists rarely change during a session. Wait for the 30 s TTL.\n\t *\n\t * **Error handling**\n\t * Non-zero `errCode` on control-group users or generic server errors.\n\t * Branch on `errCode === 0` and surface `errMsg` on failure.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getJackpotEligibleGames`](../../docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md).\n\t *\n\t * @returns {@link TGetJackpotEligibleGamesResponse} —\n\t * `{ eligible_games: JackpotEligibleGame[] }`.\n\t *\n\t * @example\n\t * ```ts\n\t * const [jp] = await window._smartico.api.jackpotGet({ jp_template_id: 42 });\n\t *\n\t * if (jp?.ach_related_game_allow_all) {\n\t * console.log('[smartico] all games eligible — hide the eligible-games tab');\n\t * return;\n\t * }\n\t *\n\t * const r = await window._smartico.api.getJackpotEligibleGames({ jp_template_id: 42 });\n\t * console.log('[smartico] render', r.eligible_games.length, 'eligible game tiles');\n\t * ```\n\t */\n\tpublic async getJackpotEligibleGames({ jp_template_id, onUpdate } : {\n\t\t/** Jackpot template ID (required). */\n\t\tjp_template_id: number,\n\t\t/** Optional callback; not auto-invoked today. */\n\t\tonUpdate?: () => void,\n\t}): Promise<TGetJackpotEligibleGamesResponse> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.JackpotEligibleGames + jp_template_id,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getJackpotEligibleGamesT(this.userExtId, { jp_template_id }),\n\t\t\tJACKPOT_ELIGIBLE_GAMES_CACHE_SEC,\n\t\t);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTRaffle,\n\tTRaffleDraw,\n\tTRaffleDrawRun,\n\tTransformedRaffleClaimPrizeResponse,\n\tTRaffleOptinResponse,\n} from './WSAPITypes';\nimport {\n\tdrawRunHistoryTransform,\n\traffleClaimPrizeResponseTransform,\n\tGetRaffleWonPrizesResponse,\n} from '../Raffle';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIJackpots } from './WSAPIJackpots';\n\n/** @group Raffles */\nexport class WSAPIRaffles extends WSAPIJackpots {\n\tprotected async updateRaffles() {\n\t\tconst payload = await this.api.getRafflesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Raffles, payload);\n\t}\n\n\t/**\n\t * Returns all raffles visible to the current user, each carrying an\n\t * embedded `draws[]` array with per-draw state (current state, ticket\n\t * counts, opt-in status, prize structure). Use this to power a\n\t * raffles lobby screen and to drive per-draw CTAs (opt-in, view\n\t * winners, claim).\n\t *\n\t * The embedded `draws[i]` objects are sufficient for rendering all\n\t * draw cards — winner details with usernames / avatars require a\n\t * follow-up {@link getRaffleDrawRun} call (the embedded form carries\n\t * only `winners_total` / `winners_limit` / `winners_offset` metadata,\n\t * not individual winner rows).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed raffle list (never a\n\t * diff/patch). Each subsequent call to `getRaffles({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. {@link claimRafflePrize} resolves on this connection (any\n\t * response code) — the refreshed list reflects the new\n\t * `has_unclaimed_prize` / `claimed_date` state.\n\t * 2. {@link requestRaffleOptin} resolves on this connection (any\n\t * response code) — the refreshed list reflects the new\n\t * `user_opted_in` state on the affected draw.\n\t *\n\t * Does NOT fire for: server-side draw executions, ticket increments\n\t * (other users earning tickets), or operator-side raffle/draw config\n\t * changes. Those changes surface only on the next cache miss (after\n\t * the 30 s TTL) — poll manually if your UI needs sub-30s freshness\n\t * during an in-progress draw.\n\t *\n\t * **Reading state from the returned raffle**\n\t * - `current_tickets_count` vs `max_tickets_count` drives the\n\t * `ticket_cap_visualization` banner (enum\n\t * {@link RaffleTicketCapVisualization}: `Empty` = no banner,\n\t * `Counter` = show \"X tickets remaining\", `Message` = show\n\t * sold-out message).\n\t * - Within each draw, `current_state`\n\t * ({@link RaffleDrawInstanceState}) buckets the draw into Open\n\t * (accepting tickets), WinnerSelection (currently drawing), or\n\t * Executed (winners selected).\n\t * - `execution_type` ({@link RaffleDrawTypeExecution}) distinguishes\n\t * one-shot (`ExecDate`), repeating (`Recurring`), or special\n\t * one-shot (`Grand`) draws. Recurring draws share a stable\n\t * `draws[i].id` (the schedule definition) across runs — `run_id`\n\t * is the per-execution instance.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout. The server also invalidates\n\t * the SDK cache when a draw executes on the server side.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffles`](../../docs/ui/raffles/UIGuide_getRaffles.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped\n\t * to the brand's public raffles. Per-user fields (`my_tickets_count`,\n\t * `my_last_tickets`, `user_opted_in`) are not meaningful for\n\t * visitors. The `onUpdate` callback is accepted but never fires\n\t * because the mutation methods that trigger it\n\t * ({@link claimRafflePrize}, {@link requestRaffleOptin}) are not\n\t * available / not effective in visitor mode.\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * raffles list after every\n\t * {@link claimRafflePrize} or\n\t * {@link requestRaffleOptin} round-trip\n\t * on this connection.\n\t * @returns Promise resolving to the raffles list.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] raffles refreshed (after claim/optin) — re-render from this array:', refreshed);\n\t * },\n\t * });\n\t *\n\t * for (const raffle of raffles) {\n\t * console.log('[smartico] render raffle', raffle.id, '—', raffle.name, ':', raffle.draws.length, 'draws');\n\t *\n\t * // Bucket draws: active/upcoming first (sorted by execution_ts ASC), then executed last.\n\t * const sorted = [...raffle.draws].sort((a, b) => {\n\t * const aDone = a.current_state === 3; // Executed\n\t * const bDone = b.current_state === 3;\n\t * if (aDone !== bDone) return aDone ? 1 : -1; // executed sink to the bottom\n\t * return a.execution_ts - b.execution_ts;\n\t * });\n\t *\n\t * for (const d of sorted) {\n\t * if (d.requires_optin && !d.user_opted_in && d.is_active && d.current_state !== 3) {\n\t * console.log('[smartico] draw', d.run_id, '— show OPT IN CTA (requires_optin + not yet opted in + still active)');\n\t * }\n\t * if (d.current_state === 3) {\n\t * console.log('[smartico] draw', d.run_id, 'executed — fetch winner details via getRaffleDrawRun');\n\t * }\n\t * }\n\t * }\n\t *\n\t * // For winner detail on an executed draw, call getRaffleDrawRun separately.\n\t * ```\n\t */\n\tpublic async getRaffles({ onUpdate }: { onUpdate?: (data: TRaffle[]) => void } = {}): Promise<TRaffle[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Raffles, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Raffles, ECacheContext.WSAPI, () => this.api.getRafflesT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the full detail of a single raffle draw run — same shape\n\t * as the embedded `TRaffleDraw` in {@link getRaffles}, but populated\n\t * with paginated `prizes[].winners[]` rows including usernames and\n\t * avatars. Use this to render a draw detail / winners screen, or to\n\t * page through the winner list of an executed draw.\n\t *\n\t * Each call is a fresh server round-trip — there is no client cache.\n\t * Re-call to refresh.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass `raffle_id` (the parent raffle's `id`) and `run_id` (the\n\t * specific run instance — `TRaffleDraw.run_id` from\n\t * {@link getRaffles}'s embedded draws). Note that\n\t * `TRaffleDraw.id` is the *schedule_id* (stable across runs of a\n\t * recurring draw) — that's NOT what this method takes; it takes the\n\t * per-instance `run_id`.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call sends a network request.\n\t * - **No push event** refreshes the response. Live winner-list\n\t * updates require a fresh call.\n\t * - The default Smartico UI polls this method on a variable cadence\n\t * while a draw is in flight: every 3 s during `WinnerSelection`,\n\t * every 10 s when the countdown is under 5 minutes, every 30 s\n\t * otherwise.\n\t *\n\t * **Winner pagination**\n\t * `winners_from` / `winners_to` define a half-open range of winner\n\t * indices. The default window is `0–20` (20 winners). The server\n\t * caps the window at 50 rows per call — passing a larger range\n\t * silently truncates. For \"load more\" pagination, advance\n\t * `winners_from` by the prior page size and pass the same\n\t * `winners_to` offset. `winners_total` on the returned\n\t * `TRaffleDraw` is the authoritative total count for pagination.\n\t *\n\t * The current user's own winning rows (if any) are server-sorted\n\t * to the top of the result.\n\t *\n\t * **Throws**\n\t * Both `raffle_id` and `run_id` are required — the SDK throws\n\t * synchronously when either is missing or falsy.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleDrawRun`](../../docs/ui/raffles/UIGuide_getRaffleDrawRun.md).\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * @param props.raffle_id The parent raffle's `id` (from `TRaffle.id`).\n\t * @param props.run_id The draw run instance ID (from\n\t * `TRaffleDraw.run_id`, not `TRaffleDraw.id`).\n\t * @param props.winners_from First winner index to return (0-based).\n\t * Defaults to `0`.\n\t * @param props.winners_to Last winner index (exclusive).\n\t * Defaults to `20`. Server caps the\n\t * window at 50 rows per call.\n\t * @returns Promise resolving to `TRaffleDraw`\n\t * with `prizes[].winners[]` populated\n\t * and `winners_total` set.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t * const draw = raffle.draws.find(d => d.current_state === 3); // Executed\n\t *\n\t * if (!draw) {\n\t * console.log('[smartico] no executed draw — skip detail view');\n\t * return;\n\t * }\n\t *\n\t * // First page of winners.\n\t * const detail = await window._smartico.api.getRaffleDrawRun({\n\t * raffle_id: raffle.id,\n\t * run_id: draw.run_id, // NOTE: run_id, NOT draw.id\n\t * winners_from: 0,\n\t * winners_to: 20,\n\t * });\n\t *\n\t * for (const prize of detail.prizes) {\n\t * console.log('[smartico] prize', prize.name, '— winners on this page:', prize.winners.length);\n\t * const myWin = prize.winners.find(w => w.username === currentUsername); // or another match\n\t * if (myWin) {\n\t * console.log('[smartico] current user won this prize — surface a Claim CTA if not yet claimed');\n\t * }\n\t * }\n\t *\n\t * // Load more — pagination via winners_from / winners_to.\n\t * if ((detail.winners_total ?? 0) > 20) {\n\t * const next = await window._smartico.api.getRaffleDrawRun({\n\t * raffle_id: raffle.id,\n\t * run_id: draw.run_id,\n\t * winners_from: 20,\n\t * winners_to: 40,\n\t * });\n\t * console.log('[smartico] page 2 loaded — append', next.prizes.flatMap(p => p.winners).length, 'winners');\n\t * }\n\t * ```\n\t */\n\tpublic async getRaffleDrawRun(props: { raffle_id: number; run_id: number; winners_from?: number; winners_to?: number }): Promise<TRaffleDraw> {\n\t\tif (!props.raffle_id || !props.run_id) {\n\t\t\tthrow new Error('both raffle_id and run_id are required');\n\t\t}\n\n\t\treturn await this.api.getRaffleDrawRunT(this.userExtId, props.raffle_id, props.run_id, props.winners_from, props.winners_to);\n\t}\n\n\t/**\n\t * Returns the history of past-executed draw runs for a raffle —\n\t * optionally scoped to a single recurring draw schedule. Each row\n\t * is a previously-executed run with its scheduled and\n\t * actual-execution timestamps, the user's win status, and an\n\t * unclaimed-prize flag for surfacing a Claim CTA on history rows.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * `raffle_id` is required. `draw_id` is optional — when omitted,\n\t * the response includes history for ALL draws of the raffle; when\n\t * supplied, it scopes to that one draw's recurring history. The\n\t * `draw_id` to pass is `TRaffleDraw.id` (the schedule_id, stable\n\t * across runs), not `run_id`.\n\t *\n\t * **Server-side filtering**\n\t * Draws configured by the operator to hide their history are\n\t * excluded from the response automatically. Cancelled runs are\n\t * also excluded.\n\t *\n\t * **Sort order**\n\t * Server returns rows by scheduled `execution_ts` descending\n\t * (newest first). No client-side sort required.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call hits the server.\n\t * - **No push event** refreshes the response. Re-call manually to\n\t * pick up newly-executed runs or `has_unclaimed_prize` flips\n\t * after a {@link claimRafflePrize} call.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleDrawRunsHistory`](../../docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned with\n\t * `is_winner` and `has_unclaimed_prize` always `false` for visitors.\n\t *\n\t * @param props.raffle_id The parent raffle's `id` (from `TRaffle.id`).\n\t * Required.\n\t * @param props.draw_id Optional — the draw's schedule_id\n\t * (`TRaffleDraw.id`). When set, scopes the\n\t * history to that one draw's runs. When\n\t * omitted, includes all draws of the raffle.\n\t * @returns Promise resolving to a `TRaffleDrawRun[]`\n\t * ordered newest-first. Empty if no executed\n\t * runs exist.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t *\n\t * // History across all draws of the raffle.\n\t * const allHistory = await window._smartico.api.getRaffleDrawRunsHistory({\n\t * raffle_id: raffle.id,\n\t * });\n\t *\n\t * // Highlight rows where the user has an unclaimed prize.\n\t * const unclaimed = allHistory.filter(r => r.has_unclaimed_prize);\n\t * if (unclaimed.length > 0) {\n\t * console.log('[smartico] surface a \"Claim\" CTA on these', unclaimed.length, 'history rows:', unclaimed.map(r => r.run_id));\n\t * }\n\t *\n\t * // Scoped history of one recurring draw (use draw.id, the schedule_id).\n\t * const oneDrawHistory = await window._smartico.api.getRaffleDrawRunsHistory({\n\t * raffle_id: raffle.id,\n\t * draw_id: raffle.draws[0].id, // schedule_id (stable across recurring runs)\n\t * });\n\t * console.log('[smartico] render history rows for the daily draw — newest first:', oneDrawHistory.length, 'rows');\n\t * ```\n\t */\n\tpublic async getRaffleDrawRunsHistory(props: { raffle_id: number; draw_id?: number }): Promise<TRaffleDrawRun[]> {\n\t\t\n\t\tconst res = await this.api.getRaffleDrawRunsHistory(this.userExtId, props);\n\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\n\t\treturn drawRunHistoryTransform(res);\n\t}\n\n\t/**\n\t * Claims a raffle prize the user has won. Call this when the user\n\t * has a winning row with `should_claim === true` and an unclaimed\n\t * `won_id` (read from a `TRafflePrizeWinner` on a\n\t * {@link getRaffleDrawRun} result, or surfaced by `has_unclaimed_prize`\n\t * on a {@link getRaffleDrawRunsHistory} row that the consumer drills\n\t * into).\n\t *\n\t * On success (`errorCode === 0`), the server records the claim and\n\t * triggers prize delivery through the operator's integration —\n\t * delivery is server-side, not part of this response.\n\t *\n\t * @remarks\n\t * **Result shape note**: this method returns\n\t * `TransformedRaffleClaimPrizeResponse` with `errorCode` /\n\t * `errorMessage` (camelCase full-word) — different from most other\n\t * SDK result types which use `err_code` / `err_message` (snake_case\n\t * short-word). Branch on the camelCase keys when reading this\n\t * method's result.\n\t *\n\t * **Preconditions**\n\t * Pass a `won_id` that identifies an unclaimed winning row for the\n\t * current user. The `won_id` comes from\n\t * `TRafflePrizeWinner.raf_won_id` returned by\n\t * {@link getRaffleDrawRun}.\n\t *\n\t * **Error codes** (in `errorCode`)\n\t * - `0` — success; the claim is recorded and prize delivery is\n\t * queued server-side.\n\t * - `1` — generic claim failure. The `errorMessage` distinguishes\n\t * the specific cause (the server uses one error code for several\n\t * distinct conditions): the prize has already been claimed, the\n\t * `won_id` doesn't match a winning row for this user, or the user\n\t * is in a control group for this raffle. Treat `1` as a retryable\n\t * error if the message suggests a transient condition; treat as\n\t * idempotent success if the message indicates already-claimed\n\t * (the underlying state is what the consumer wants either way —\n\t * the prize is claimed).\n\t * - other non-zero — generic server error. Surface `errorMessage`\n\t * if any.\n\t *\n\t * **Claim window**\n\t * There is no server-enforced claim deadline. Won prizes remain\n\t * claimable indefinitely until the operator archives them.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same\n\t * `won_id` returns `errorCode === 1` with `errorMessage` indicating\n\t * the prize has already been claimed. The SDK does NOT enforce an\n\t * in-flight lock. Guard the call site against double-clicks (set\n\t * a local \"claiming\" flag on click, clear it on response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the raffles cache on every\n\t * response — both success and failure paths fire the `onUpdate`\n\t * callback registered via {@link getRaffles}. After `errorCode === 0`,\n\t * the affected `TRaffleDrawRun.has_unclaimed_prize` (in history)\n\t * and the winner row's `claimed_date` reflect the claim on the next\n\t * refresh.\n\t *\n\t * **Side effects** (on `errorCode === 0`)\n\t * - The winner row's `claimed_date` is set server-side.\n\t * - Prize delivery is queued for the operator's integration to\n\t * process. Balance / bonus / inbox updates that result from the\n\t * delivery arrive through their own channels — not in this\n\t * response.\n\t *\n\t * **Throws**\n\t * `won_id` is required — the SDK throws synchronously when missing\n\t * or falsy.\n\t *\n\t * **UI guidance**: see [UI Guide — `claimRafflePrize`](../../docs/ui/raffles/UIGuide_claimRafflePrize.md).\n\t *\n\t * **Visitor mode**: not meaningfully supported. The SDK does not\n\t * block the call, but visitor sessions have no win history and the\n\t * server will reject it.\n\t *\n\t * @param props.won_id The winning row's `raf_won_id` (from\n\t * `TRafflePrizeWinner` returned by\n\t * {@link getRaffleDrawRun}).\n\t * @returns `{ errorCode, errorMessage? }`; success when\n\t * `errorCode === 0`. Note camelCase keys (see \"Result\n\t * shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const detail = await window._smartico.api.getRaffleDrawRun({\n\t * raffle_id: raffleId,\n\t * run_id: runId,\n\t * });\n\t * const myWin = detail.prizes.flatMap(p => p.winners).find(w => /* user match here *\\/ true);\n\t *\n\t * if (!myWin || !myWin.raf_won_id || myWin.claimed_date) {\n\t * console.log('[smartico] nothing to claim — keep CTA hidden');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — set in-flight flag, show loading dots on the Claim button, keep the modal open');\n\t * const r = await window._smartico.api.claimRafflePrize({ won_id: myWin.raf_won_id });\n\t * console.log('[smartico] claim response received — clear in-flight flag');\n\t *\n\t * if (r.errorCode === 0) {\n\t * console.log('[smartico] claim succeeded — show a success toast; getRaffles onUpdate above will fire with refreshed state; prize delivery happens server-side');\n\t * } else if (r.errorCode === 1 && r.errorMessage?.toLowerCase().includes('already claimed')) {\n\t * console.log('[smartico] prize was already claimed (perhaps from another tab) — treat as success, hide the Claim CTA');\n\t * } else {\n\t * console.error('[smartico] claim failed — surface this error message to the user and allow retry:', r.errorMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async claimRafflePrize(props: { won_id: number }): Promise<TransformedRaffleClaimPrizeResponse> {\n\t\tif (!props.won_id) {\n\t\t\tthrow new Error('won_id is required');\n\t\t}\n\n\t\tconst res = await this.api.claimRafflePrize(this.userExtId, { won_id: props.won_id });\n\t\treturn raffleClaimPrizeResponseTransform(res);\n\t}\n\n\t/**\n\t * Opts the current user into a specific raffle draw run. Required\n\t * for draws where `TRaffleDraw.requires_optin === true` — without\n\t * opt-in, the user's tickets do NOT participate in that run, even\n\t * if they hold tickets for the raffle.\n\t *\n\t * Opt-in is per-run: a recurring draw's next run requires a fresh\n\t * opt-in. The user's `TRaffleDraw.user_opted_in` flag reflects the\n\t * current state for the current run only.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate draw from {@link getRaffles}'s embedded\n\t * `draws[]` and gate the call on\n\t * `requires_optin === true && !user_opted_in && is_active &&\n\t * current_state !== Executed`. Calling without these guards may\n\t * return a non-zero `err_code`.\n\t *\n\t * **Argument mapping** — the three IDs come from different fields:\n\t * - `raffle_id` — the parent raffle's `TRaffle.id`\n\t * - `draw_id` — `TRaffleDraw.id` (schedule_id, stable across runs)\n\t * - `raffle_run_id` — `TRaffleDraw.run_id` (instance ID for this\n\t * specific run)\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the user is opted into this run. Tickets\n\t * collected after the run's `ticket_start_ts` will participate.\n\t * - `1` — generic opt-in failure. The `err_message` distinguishes\n\t * the specific cause: the draw doesn't require opt-in\n\t * (`requires_optin === false`), `raffle_id` doesn't match the\n\t * `draw_id`, the user is already opted in (or the draw has\n\t * completed), or the user is in a control group for this raffle.\n\t * - other non-zero — generic server error. Surface `err_message`.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same\n\t * `raffle_run_id` returns `err_code === 1` with `err_message`\n\t * indicating the user is already opted in. Treat as success in\n\t * the UI — the underlying state is what the consumer wants.\n\t * Guard the call site against double-clicks.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the raffles cache on every\n\t * response and fires the `onUpdate` callback registered via\n\t * {@link getRaffles}. After `err_code === 0`, the affected draw's\n\t * `user_opted_in` flips to `true` on the refreshed list.\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - The user is registered for this run. Tickets earned within\n\t * the run's eligibility window will participate in the draw.\n\t * - No balance change. No CRM-side rewards. Opt-in is a metadata\n\t * operation only.\n\t *\n\t * **Throws**\n\t * `raffle_id`, `draw_id`, and `raffle_run_id` are all required —\n\t * the SDK throws synchronously when any is missing or falsy.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestRaffleOptin`](../../docs/ui/raffles/UIGuide_requestRaffleOptin.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param props.raffle_id The parent raffle's `id`.\n\t * @param props.draw_id The draw's schedule_id (`TRaffleDraw.id`).\n\t * @param props.raffle_run_id The run instance ID (`TRaffleDraw.run_id`).\n\t * @returns `{ err_code, err_message? }`; success\n\t * when `err_code === 0` (treat\n\t * \"already opted in\" as idempotent\n\t * success).\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles({\n\t * onUpdate: (refreshed) => console.log('[smartico] raffles refreshed — re-render', refreshed),\n\t * });\n\t * const raffle = raffles[0];\n\t * const draw = raffle.draws.find(d =>\n\t * d.requires_optin && !d.user_opted_in && d.is_active && d.current_state !== 3\n\t * );\n\t *\n\t * if (!draw) {\n\t * console.log('[smartico] no opt-in-required draw available — keep CTA hidden');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] opt-in starting — set in-flight flag, show loading dots on the Opt-in button');\n\t * const r = await window._smartico.api.requestRaffleOptin({\n\t * raffle_id: raffle.id,\n\t * draw_id: draw.id, // schedule_id, NOT run_id\n\t * raffle_run_id: draw.run_id,\n\t * });\n\t * console.log('[smartico] opt-in response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] opted in successfully — show \"Fully opted in\" state on the draw card; onUpdate above will fire with user_opted_in: true');\n\t * } else if (r.err_code === 1 && r.err_message?.toLowerCase().includes('already opted in')) {\n\t * console.log('[smartico] already opted in (perhaps from another tab) — treat as success, show \"Fully opted in\"');\n\t * } else {\n\t * console.error('[smartico] opt-in failed — surface this error to the user:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestRaffleOptin(props: { raffle_id: number; draw_id: number; raffle_run_id: number }): Promise<TRaffleOptinResponse> {\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\t\tif (!props.draw_id) {\n\t\t\tthrow new Error('draw_id is required');\n\t\t}\n\t\tif (!props.raffle_run_id) {\n\t\t\tthrow new Error('raffle_run_id is required');\n\t\t}\n\n\t\tconst r = await this.api.raffleOptin(this.userExtId, props);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Returns every prize the current user has won within a single raffle —\n\t * across ALL of that raffle's draws, newest-won first — in one paginated\n\t * call. Use this to power a \"my prizes\" screen for a raffle (prize name,\n\t * prize image, the user's name/avatar) without walking\n\t * {@link getRaffleDrawRunsHistory} and then paging\n\t * {@link getRaffleDrawRun}'s per-draw winner lists.\n\t *\n\t * Each row carries its own `raf_won_id`, which IS the `won_id` to pass to\n\t * {@link claimRafflePrize}: a row with `requires_claim === true` and no\n\t * `claimed_date` is directly claimable.\n\t *\n\t * @remarks\n\t * **Authentication required**\n\t * Works only for an identified (logged-in) user. Visitor / anonymous\n\t * sessions are rejected — call this only after identify.\n\t *\n\t * **Preconditions**\n\t * `raffle_id` is required — the SDK throws synchronously when it is\n\t * missing or falsy.\n\t *\n\t * **Coverage & sort order**\n\t * Includes the user's wins from every draw of the raffle — recurring,\n\t * one-shot, and grand draws, across all historical runs. Rows are ordered\n\t * newest-win first; there is no \"unclaimed first\" ordering, so sort\n\t * client-side if you want claimable prizes at the top.\n\t *\n\t * **Pagination**\n\t * `offset` / `limit` page the `won_prizes[]` rows (the SDK defaults to\n\t * `0` / `20`). `total` is the authoritative full count of the user's wins\n\t * for this raffle across all draws — drive \"load more\" from it\n\t * (`offset + won_prizes.length < total`). An `offset` past the end returns\n\t * an empty `won_prizes[]` with the real `total` and `errCode 0` — not an\n\t * error. The server does NOT clamp `limit`, so always pass an explicit,\n\t * sane page size.\n\t *\n\t * **Rate limit**\n\t * The server caps this at roughly 30 calls per minute with a ~5-second\n\t * minimum gap between calls. Fetch on screen open and on explicit \"load\n\t * more\" — don't poll it on a timer.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success. Also returned with an empty `won_prizes[]` and\n\t * `total 0` when the user has no wins, or is not eligible to see this\n\t * raffle.\n\t * - `1` — generic server error; surface `errMsg` if present.\n\t *\n\t * There are no granular codes — an unknown raffle, an ineligible user,\n\t * and \"no wins\" all surface as `errCode 0` with an empty list.\n\t *\n\t * **Reading the result**\n\t * - Null-check `user` before reading it — it is `null` whenever\n\t * `won_prizes` is empty.\n\t * - For the avatar, use `user.avatar_id` (already a full URL for a system\n\t * avatar, otherwise an avatar token to resolve against the widget's\n\t * avatar domain); `user.avatar_url` is always `null`.\n\t * - Render `public_username` as-is (it is server-masked for privacy, e.g.\n\t * `\"32:r*****\"`) and substitute a \"You\" label for the current user.\n\t * - Treat `claimed_date` as the claim flag: `null` until claimed, then\n\t * epoch ms.\n\t *\n\t * **Idempotency / Side effects**: safe and read-only — one-shot promise,\n\t * no client cache, no subscription. The server caches the response\n\t * briefly; a successful {@link claimRafflePrize} invalidates that cache,\n\t * so a follow-up call reflects the new `claimed_date`. This method does\n\t * NOT refresh the {@link getRaffles} list or fire its `onUpdate` — re-call\n\t * manually to pick up newly-won prizes or a `claimed_date` flip.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleWonPrizes`](../../docs/ui/raffles/UIGuide_getRaffleWonPrizes.md).\n\t *\n\t * **Visitor mode**: not supported (see \"Authentication required\").\n\t *\n\t * @param props.raffle_id The parent raffle's `id` (from `TRaffle.id`). Required.\n\t * @param props.offset Zero-based index of the first row to return. Defaults to `0`.\n\t * @param props.limit Page size. Defaults to `20`.\n\t * @returns Promise resolving to {@link GetRaffleWonPrizesResponse}\n\t * (`user`, this page of `won_prizes`, and `total`;\n\t * `errCode 0` on success).\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t *\n\t * // First page of the user's won prizes for this raffle.\n\t * const page = await window._smartico.api.getRaffleWonPrizes({\n\t * raffle_id: raffle.id,\n\t * offset: 0,\n\t * limit: 20,\n\t * });\n\t *\n\t * if (page.errCode !== 0) {\n\t * console.error('[smartico] could not load won prizes — show a retry state:', page.errMsg);\n\t * return;\n\t * }\n\t * if (page.won_prizes.length === 0) {\n\t * console.log('[smartico] no wins in this raffle (or not eligible) — render the empty state');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico]', page.user?.public_username, 'won', page.total, 'prizes total');\n\t * for (const prize of page.won_prizes) {\n\t * console.log('[smartico] render prize card —', prize.public_meta.name, prize.public_meta.image_url);\n\t * if (prize.requires_claim && !prize.claimed_date) {\n\t * console.log('[smartico] show a Claim CTA — on click call claimRafflePrize({ won_id:', prize.raf_won_id, '})');\n\t * }\n\t * }\n\t *\n\t * // Load more.\n\t * if (page.offset + page.won_prizes.length < page.total) {\n\t * const next = await window._smartico.api.getRaffleWonPrizes({\n\t * raffle_id: raffle.id,\n\t * offset: page.offset + page.limit,\n\t * limit: 20,\n\t * });\n\t * console.log('[smartico] appended', next.won_prizes.length, 'more prizes');\n\t * }\n\t * ```\n\t */\n\tpublic async getRaffleWonPrizes(props: { raffle_id: number; offset?: number; limit?: number }): Promise<GetRaffleWonPrizesResponse> {\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\n\t\treturn await this.api.getRaffleWonPrizes(this.userExtId, {\n\t\t\traffle_id: props.raffle_id,\n\t\t\toffset: props.offset ?? 0,\n\t\t\tlimit: props.limit ?? 20,\n\t\t});\n\t}\n}\n","import { SAWSpinsCountPush } from '../MiniGames';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tTMiniGamePlayResult,\n\tTMiniGameTemplate,\n\tTMiniGamePlayBatchResult,\n\tTSawHistory,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIRaffles } from './WSAPIRaffles';\n\n/** @group MiniGames */\nexport class WSAPIMiniGames extends WSAPIRaffles {\n\t/**\n\t * Returns all mini-game templates (\"SAW\" = Spin And Win — the\n\t * umbrella term for wheel-spin, scratch-card, lootbox, gift-box,\n\t * treasure-hunt, plinko, coin-flip, quiz, and several other formats)\n\t * configured for the label. Optionally subscribes to live updates\n\t * via `onUpdate`: the callback fires whenever the user's\n\t * `spin_count` changes, jackpot grows, a manual spin is issued, or\n\t * a spin response lands.\n\t *\n\t * The list is NOT filtered by spin availability — every configured\n\t * template is returned, including ones the user cannot currently\n\t * play. The `visibile_when_can_spin` flag on each template hints\n\t * which to hide in a default lobby view (consumer-side filter).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed template list (never a\n\t * diff/patch). Each subsequent call to `getMiniGames({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. The server pushes a `spin_count` change (campaign award,\n\t * store purchase, BO manual issuance, mission reward).\n\t * 2. Any {@link playMiniGame} or {@link playMiniGameBatch}\n\t * resolves on this connection — the cached array refreshes\n\t * with updated `spin_count`, `jackpot_current`, and any new\n\t * `next_available_spin_ts`.\n\t * 3. Acknowledge responses land (via auto-acknowledge or\n\t * {@link miniGameWinAcknowledgeRequest}).\n\t *\n\t * Jackpot growth is observable on the refreshed `jackpot_current`\n\t * field — the SDK inlines the live value into template `name` /\n\t * `promo_text` / prize `name` via a `{{jackpot}}` template\n\t * substitution at fetch time.\n\t *\n\t * **Game-type variants**\n\t * All twelve `SAWGameType` values (`SpinAWheel`, `ScratchCard`,\n\t * `MatchX`, `GiftBox`, `PrizeDrop`, `Quiz`, `LootboxWeekdays`,\n\t * `LootboxCalendarDays`, `TreasureHunt`, `Voyager`, `Plinko`,\n\t * `CoinFlip`) surface through the same template shape. Most are\n\t * played via {@link playMiniGame}; the exceptions are:\n\t * - `PrizeDrop` — server-push only; the consumer does NOT call\n\t * `playMiniGame`. Prizes arrive via the prize-drop push channel.\n\t * - `MatchX` / `Quiz` — predictions are submitted via a separate\n\t * games server (not this SDK); the SAW spin is fired\n\t * server-internally to deduct the buy-in.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMiniGames`](../../docs/ui/minigames/UIGuide_getMiniGames.md).\n\t *\n\t * **Visitor mode**: supported. Only templates configured with\n\t * `is_visitor_mode = true` in the BO are returned for anonymous\n\t * sessions. Spins from these templates may also be played (visitor\n\t * mode is the one mini-game flow that does support play — see\n\t * {@link playMiniGame} for the visitor-stop semantics).\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * template array after any spin-count\n\t * change, spin response, or acknowledge\n\t * response on this connection.\n\t * @returns Promise resolving to the template\n\t * array. Empty if no templates are\n\t * visible to the user.\n\t *\n\t * @example\n\t * ```ts\n\t * const games = await window._smartico.api.getMiniGames({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] mini-game templates refreshed — re-render lobby from this array:', refreshed);\n\t * },\n\t * });\n\t *\n\t * // Filter the lobby view per the visibility flag.\n\t * const visible = games.filter(g =>\n\t * !g.visibile_when_can_spin || (g.spin_count && g.spin_count > 0)\n\t * );\n\t *\n\t * for (const g of visible) {\n\t * console.log('[smartico] render game card', g.id, '—', g.name,\n\t * '— type:', g.saw_game_type,\n\t * '— buy-in:', g.saw_buyin_type,\n\t * '— spins available:', g.spin_count ?? 0,\n\t * '— jackpot:', g.jackpot_current, g.jackpot_symbol);\n\t * }\n\t * ```\n\t */\n\tpublic async getMiniGames({ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {}): Promise<\n\t\tTMiniGameTemplate[]\n\t> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, () => this.api.sawGetTemplatesT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns a paginated, newest-first list of the user's past\n\t * mini-game spins — each row carries the won prize ID, the\n\t * client-side `request_id` used for the spin, and a\n\t * server-recorded `is_claimed` flag (`true` if the spin has been\n\t * acknowledged). Optionally filter to a single template via\n\t * `saw_template_id`.\n\t *\n\t * Use this to power a \"My prizes\" / win-history surface, or to\n\t * recover unacknowledged spins (rows with `is_claimed === false`\n\t * carry a `client_request_id` you can pass to\n\t * {@link miniGameWinAcknowledgeRequest}).\n\t *\n\t * @remarks\n\t * **Pagination**\n\t * `limit` defaults to 20, `offset` defaults to 0. Sort order is\n\t * `create_date` DESC (newest first) — no client-side re-sort\n\t * required. For \"load more\" pagination, advance `offset` by the\n\t * page size on each subsequent call.\n\t *\n\t * The underlying protocol carries a `hasMore` boolean on the\n\t * response, but the SDK strips it from the public surface —\n\t * detect end of list when the returned array length is less than\n\t * `limit`.\n\t *\n\t * **`is_claimed` semantics**\n\t * Maps directly to the server's \"acknowledge_date is non-null\"\n\t * state. A spin where the auto-acknowledge fire-and-forget\n\t * succeeded shows `is_claimed: true`; a spin where the\n\t * acknowledge was lost (network drop) or where the user is on an\n\t * explicit-acknowledge flow shows `is_claimed: false` with a\n\t * usable `client_request_id`. A server-side fallback job\n\t * auto-acknowledges stale rows every ~60 seconds — so even\n\t * \"lost\" prizes are eventually delivered without consumer action.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds.\n\t * Cache is invalidated implicitly when a new spin or acknowledge\n\t * response lands.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMiniGamesHistory`](../../docs/ui/minigames/UIGuide_getMiniGamesHistory.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional pagination + filter bag.\n\t * @param params.limit Page size. Defaults to 20.\n\t * @param params.offset Number of rows to skip. Defaults to 0.\n\t * @param params.saw_template_id When set, scopes the history to\n\t * a single template's spins.\n\t *\n\t * @returns Promise resolving to `TSawHistory[]` in newest-first\n\t * order. Empty when the user has no history.\n\t *\n\t * @example\n\t * ```ts\n\t * const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });\n\t *\n\t * // Show unacknowledged spins with a Claim CTA.\n\t * const unacknowledged = history.filter(h => !h.is_claimed);\n\t * console.log('[smartico] surface a \"Claim\" CTA on these', unacknowledged.length, 'history rows:',\n\t * unacknowledged.map(h => h.client_request_id));\n\t *\n\t * // Load-more pagination — advance offset by the prior page size.\n\t * const page2 = await window._smartico.api.getMiniGamesHistory({ limit: 20, offset: 20 });\n\t * console.log('[smartico] page 2 loaded —', page2.length, 'more rows;',\n\t * page2.length < 20 ? 'end of list reached, hide \"Load more\"' : 'keep \"Load more\" visible');\n\t * ```\n\t */\n\n\tpublic async getMiniGamesHistory({\n\t\tlimit,\n\t\toffset,\n\t\tsaw_template_id,\n\t}: {\n\t\tlimit?: number;\n\t\toffset?: number;\n\t\tsaw_template_id?: number;\n\t}): Promise<TSawHistory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.SAWHistory,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getSawWinningHistoryT(this.userExtId, limit, offset, saw_template_id),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Plays one round of a mini-game template — runs the server's\n\t * randomised prize selection, deducts the buy-in cost (if any),\n\t * and returns the won `prize_id`. After the play resolves, the SDK\n\t * automatically fires a server-side acknowledgement on a\n\t * fire-and-forget basis, marking the spin as \"delivered\" so the\n\t * prize takes effect.\n\t *\n\t * Works for all `SAWGameType` values EXCEPT:\n\t * - `PrizeDrop` — prizes arrive server-pushed; do NOT call\n\t * `playMiniGame` for this type.\n\t * - `MatchX` / `Quiz` — prediction submission goes through a\n\t * separate games server; `playMiniGame` is not the entry point.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate template from {@link getMiniGames} and check:\n\t * - `spin_count > 0` for spin-based templates\n\t * (`saw_buyin_type === 'spins'`).\n\t * - Sufficient balance for paid templates — points / gems /\n\t * diamonds from {@link getUserProfile} against\n\t * `buyin_cost_points` / `_gems` / `_diamonds`.\n\t * - `next_available_spin_ts` is in the past (or unset) — the\n\t * server enforces a per-period max-attempts cap.\n\t * - Template is currently in its active period\n\t * (operator-configured `activeFromDate` / `activeTillDate`).\n\t *\n\t * **Error codes** (in `err_code`, typed as {@link SAWSpinErrorCode})\n\t * - `0` (`SAW_OK`) — success; `prize_id` identifies the won prize\n\t * in `template.prizes`.\n\t * - `40001` (`SAW_NO_SPINS`) — user has no spin attempts for a\n\t * spin-based template.\n\t * - `40002` (`SAW_PRIZE_POOL_EMPTY`) — all prize slots in the\n\t * template are depleted.\n\t * - `40003` (`SAW_NOT_ENOUGH_POINTS`) — insufficient points for a\n\t * points-cost template.\n\t * - `40004` (`SAW_FAILED_MAX_SPINS_REACHED`) — per-period\n\t * max-attempts cap reached. The server's\n\t * `first_spin_in_period` value (exposed in\n\t * {@link TMiniGamePlayBatchResult}; not surfaced in the single\n\t * `TMiniGamePlayResult`) marks the period start.\n\t * - `40007` (`SAW_TEMPLATE_NOT_ACTIVE`) — template outside its\n\t * active time window.\n\t * - `40009` (`SAW_NOT_IN_SEGMENT`) — user fails the template's\n\t * visibility segment check, OR (for lootbox variants) the day's\n\t * prize pool is empty.\n\t * - `40011` (`SAW_NO_BALANCE_GEMS`) — insufficient gems.\n\t * - `40012` (`SAW_NO_BALANCE_DIAMONDS`) — insufficient diamonds.\n\t * - `-40001` (`SAW_VISITOR_STOP_SPIN_REQUEST`) — visitor session\n\t * tried to play a non-visitor-mode template. The default UI\n\t * silently stops the game; no prize awarded.\n\t * - other non-zero — generic server error. Surface `err_message`.\n\t *\n\t * **Prize handling**\n\t * On `err_code === 0`, `prize_id` matches an entry in\n\t * `template.prizes`. Look up the prize's `prize_type`\n\t * ({@link MiniGamePrizeTypeName}) to decide UI treatment:\n\t * - `'no-prize'` — the user spun but won nothing (an operator-\n\t * configured \"loss\" slot). Buy-in is still deducted.\n\t * - `'points'` / `'gems-and-diamonds'` / `'spin'` — value\n\t * credited to the user's profile / spin balance; visible on\n\t * the next refresh.\n\t * - `'bonus'` — surfaces via {@link getBonuses}.\n\t * - `'jackpot'` — drains the template's `jackpot_current` to the\n\t * user; resets the accumulator.\n\t * - `'raffle-ticket'` — adds tickets to the relevant raffle.\n\t * - `'mission'` / `'change-level'` — visible via the\n\t * corresponding domain methods.\n\t * - `'manual'` — operator delivers offline.\n\t *\n\t * **Auto-acknowledge**\n\t * The SDK calls the server's acknowledge endpoint immediately\n\t * after the spin response, on a fire-and-forget basis (not\n\t * awaited). This marks the spin as \"delivered\" so prize effects\n\t * take hold. If the auto-acknowledge fails (network drop), the\n\t * spin appears as `is_claimed: false` in\n\t * {@link getMiniGamesHistory}; the consumer can recover it by\n\t * passing the `client_request_id` to\n\t * {@link miniGameWinAcknowledgeRequest}. A server-side fallback\n\t * job auto-acknowledges stale spins every ~60 seconds, so prizes\n\t * are eventually delivered even without consumer action.\n\t *\n\t * **Idempotency**: NOT idempotent. A double-click sends two\n\t * spins and deducts the buy-in twice. The SDK does NOT guard\n\t * against rapid clicks at the public API level — guard the call\n\t * site with an in-flight flag. The server enforces a per-user\n\t * per-template lock that serialises concurrent requests, so two\n\t * simultaneous calls won't be processed in parallel, but they\n\t * will both be processed sequentially (i.e. both deduct).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the templates cache on every\n\t * spin response and fires any `onUpdate` callback registered via\n\t * {@link getMiniGames} or this method. After `err_code === 0`, the\n\t * affected template's `spin_count` / `jackpot_current` /\n\t * `next_available_spin_ts` reflect the new state on the\n\t * refreshed array.\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - Buy-in deducted from the user's balance (points / gems /\n\t * diamonds / spin tickets — depending on `saw_buyin_type`).\n\t * Balance updates flow via the user-properties channel\n\t * (subscribe to {@link getUserProfile} `props_change` to\n\t * observe).\n\t * - Prize value credited per the prize's type (see \"Prize\n\t * handling\" above).\n\t * - A `minigame_attempt` analytics event fires server-side with\n\t * the result status.\n\t *\n\t * **UI guidance**: see [UI Guide — `playMiniGame`](../../docs/ui/minigames/UIGuide_playMiniGame.md).\n\t *\n\t * **Visitor mode**: not supported. Visitor sessions trying to\n\t * spin receive `SAW_VISITOR_STOP_SPIN_REQUEST (-40001)`.\n\t *\n\t * @param template_id The mini-game template ID (from\n\t * `TMiniGameTemplate.id`).\n\t * @param params Optional. Pass an `onUpdate` callback to\n\t * subscribe to subsequent template refreshes.\n\t * @returns `{ err_code, err_message, prize_id }` — success when\n\t * `err_code === 0`. `prize_id` is always populated; look\n\t * it up in `template.prizes` to interpret the prize.\n\t *\n\t * @example\n\t * ```ts\n\t * const games = await window._smartico.api.getMiniGames({\n\t * onUpdate: (refreshed) => console.log('[smartico] templates refreshed — re-render lobby', refreshed),\n\t * });\n\t * const game = games.find(g => g.id === templateId);\n\t *\n\t * if (!game) {\n\t * console.log('[smartico] template not in current list — refresh getMiniGames');\n\t * return;\n\t * }\n\t * if (game.saw_buyin_type === 'spins' && (game.spin_count ?? 0) === 0) {\n\t * console.log('[smartico] no spins available — disable Play button, show \"No spins\" message');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] play starting — set in-flight flag, start game animation (wheel spin / scratch / lootbox open / etc.)');\n\t * const r = await window._smartico.api.playMiniGame(game.id);\n\t * console.log('[smartico] play response received');\n\t *\n\t * if (r.err_code === 0) {\n\t * const prize = game.prizes.find(p => p.id === r.prize_id);\n\t * if (prize?.prize_type === 'no-prize') {\n\t * console.log('[smartico] user lost — animate to the no-prize slot and show \"Better luck next time\" modal');\n\t * } else {\n\t * console.log('[smartico] user won — animate to prize', prize?.name,\n\t * '— show acknowledge modal per template.acknowledge_type;',\n\t * 'getMiniGames onUpdate fires shortly with refreshed spin_count / jackpot');\n\t * }\n\t * } else if (r.err_code === 40004) {\n\t * console.error('[smartico] max spins reached — show countdown to next available spin (use playMiniGameBatch for first_spin_in_period if needed)');\n\t * } else if (r.err_code === -40001) {\n\t * console.log('[smartico] visitor stopped — silently end the game, no prize modal');\n\t * } else {\n\t * console.error('[smartico] play failed — show generic error with this message:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async playMiniGame(\n\t\ttemplate_id: number,\n\t\t{ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {},\n\t): Promise<TMiniGamePlayResult> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\tconst r = await this.api.sawSpinRequest(this.userExtId, template_id);\n\t\tconst o: TMiniGamePlayResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t\tprize_id: r.saw_prize_id,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Manually acknowledges a mini-game spin — marks the spin as\n\t * \"delivered\" so the prize takes effect server-side. Most consumers\n\t * do NOT need to call this method directly; {@link playMiniGame}\n\t * and {@link playMiniGameBatch} auto-acknowledge on success. Use\n\t * this only for recovery scenarios.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - **Lost auto-acknowledge** — when the WebSocket dropped between\n\t * the spin response and the auto-acknowledge fire-and-forget,\n\t * the spin shows `is_claimed: false` in\n\t * {@link getMiniGamesHistory}. Pass that row's\n\t * `client_request_id` here to deliver the prize.\n\t * - **Explicit-acknowledge UI** — for templates configured with\n\t * the `ExplicitAcknowledge` acknowledge type (operator\n\t * decision), the consumer's UI shows a \"Claim\" CTA after the\n\t * prize animation. Click handler calls this method with the\n\t * spin's `client_request_id` rather than auto-acknowledging.\n\t *\n\t * **No-op on already-acknowledged spins**\n\t * The server's acknowledge SQL matches on `acknowledge_date IS\n\t * NULL` — a duplicate call returns successfully with no effect.\n\t *\n\t * **Server-side fallback**\n\t * Even without ever calling this method, a server-side job\n\t * auto-acknowledges stale spins every ~60 seconds — so prizes are\n\t * eventually delivered. The `is_claimed` flag flips on the next\n\t * `getMiniGamesHistory` call after the job runs.\n\t *\n\t * **Idempotency**: safe. Repeated calls have no effect after the\n\t * first.\n\t *\n\t * **Side effects** (on first successful call for an unacknowledged\n\t * spin)\n\t * - Prize value credited per the prize's type (see\n\t * {@link playMiniGame} \"Prize handling\").\n\t * - The spin's `is_claimed` flag flips to `true` on the next\n\t * {@link getMiniGamesHistory} call.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param request_id The `client_request_id` from a `TSawHistory`\n\t * row returned by {@link getMiniGamesHistory}.\n\t *\n\t * @example\n\t * ```ts\n\t * const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });\n\t * const unacknowledged = history.filter(h => !h.is_claimed);\n\t *\n\t * for (const row of unacknowledged) {\n\t * console.log('[smartico] re-acknowledging stale spin', row.client_request_id);\n\t * await window._smartico.api.miniGameWinAcknowledgeRequest(row.client_request_id);\n\t * }\n\t *\n\t * // Re-fetch history to see the updated is_claimed flags.\n\t * const fresh = await window._smartico.api.getMiniGamesHistory({ limit: 20 });\n\t * console.log('[smartico] history after recovery —', fresh.filter(h => !h.is_claimed).length, 'still unacknowledged');\n\t * ```\n\t */\n\tpublic async miniGameWinAcknowledgeRequest(request_id: string) {\n\t\treturn this.api.doAcknowledgeRequest(this.userExtId, request_id);\n\t}\n\n\t/**\n\t * Plays a mini-game template `spin_count` times in one round-trip.\n\t * Returns an array of per-spin results — each independent, each\n\t * with its own error code. Like {@link playMiniGame}, the SDK\n\t * auto-acknowledges every result on a fire-and-forget basis.\n\t *\n\t * Use this when a UI offers \"spin N times\" affordances\n\t * (multi-spin buttons, lootbox open-N flows). The server processes\n\t * each spin independently — there is no atomicity / rollback if\n\t * one fails.\n\t *\n\t * @remarks\n\t * **Result shape note** — `TMiniGamePlayBatchResult` uses\n\t * `errCode` / `errMessage` (camelCase) — DIFFERENT from\n\t * {@link TMiniGamePlayResult} which uses `err_code` / `err_message`\n\t * (snake_case). Branch on the camelCase keys when reading batch\n\t * results.\n\t *\n\t * **Per-spin independence**\n\t * The server iterates the requested spins and calls the prize\n\t * engine once per entry. If spin #2 fails with `SAW_NO_SPINS`,\n\t * spin #3 is still attempted — the server does NOT stop on first\n\t * error and does NOT roll back successful spins. Each\n\t * `results[i].errCode` is independent.\n\t *\n\t * Practical implication: if the user has 3 spins available and\n\t * requests 5, expect results 0-2 with `errCode === 0` and results\n\t * 3-4 with `errCode === SAW_NO_SPINS`.\n\t *\n\t * **Error codes**\n\t * Per-result `errCode` is from {@link SAWSpinErrorCode}. See\n\t * {@link playMiniGame} for the full table; the same codes apply\n\t * per spin.\n\t *\n\t * **`first_spin_in_period` field**\n\t * Populated on results where `errCode === SAW_FAILED_MAX_SPINS_REACHED`\n\t * (40004). The value is the epoch-ms timestamp of the user's\n\t * first spin in the current cooldown period. Compute the\n\t * countdown as:\n\t * `template.max_spins_period_ms - (Date.now() - first_spin_in_period)`.\n\t *\n\t * **`jackpot_amount` field**\n\t * Populated on results where the won prize is a jackpot\n\t * (`prize_type === 'jackpot'`). The amount the user just claimed\n\t * from the template's jackpot accumulator.\n\t *\n\t * **Auto-acknowledge**\n\t * The SDK fires a batch-acknowledge for all `request_id`s after\n\t * the batch response lands — fire-and-forget. Same recovery\n\t * semantics as {@link playMiniGame}: lost acknowledgements\n\t * become recoverable via {@link miniGameWinAcknowledgeRequest}\n\t * per row, and a server-side fallback job auto-acknowledges\n\t * stale spins every ~60 seconds.\n\t *\n\t * **Idempotency**: NOT idempotent. A double-click sends two\n\t * batches. Guard the call site with an in-flight flag.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * Same as {@link playMiniGame} — the templates cache refreshes\n\t * and any `onUpdate` callback registered via {@link getMiniGames}\n\t * fires with the updated `spin_count` / `jackpot_current`.\n\t *\n\t * **Side effects** (per-spin, on `errCode === 0`)\n\t * Same as {@link playMiniGame} — buy-in deducted, prize value\n\t * credited per prize type.\n\t *\n\t * **UI guidance**: see [UI Guide — `playMiniGameBatch`](../../docs/ui/minigames/UIGuide_playMiniGameBatch.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param template_id The mini-game template ID.\n\t * @param spin_count Number of spins to play. The server attempts\n\t * all `spin_count` spins — partial successes\n\t * are normal when the user runs out of\n\t * balance / spins mid-batch.\n\t * @param params Optional. Pass an `onUpdate` callback to\n\t * subscribe to subsequent template refreshes.\n\t * @returns `TMiniGamePlayBatchResult[]` — one entry per requested\n\t * spin, in request order. Note the camelCase `errCode` /\n\t * `errMessage` keys (see \"Result shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const game = (await window._smartico.api.getMiniGames()).find(g => g.id === templateId);\n\t * if (!game) return;\n\t *\n\t * console.log('[smartico] batch play starting — set in-flight flag, animate the chosen N spins sequentially in UI');\n\t * const results = await window._smartico.api.playMiniGameBatch(game.id, 5);\n\t * console.log('[smartico] batch response received — clear in-flight flag');\n\t *\n\t * for (const [i, r] of results.entries()) {\n\t * if (r.errCode === 0) {\n\t * const prize = game.prizes.find(p => p.id === r.saw_prize_id);\n\t * console.log('[smartico] spin', i, 'won:', prize?.name,\n\t * r.jackpot_amount ? '(jackpot: ' + r.jackpot_amount + ')' : '');\n\t * } else if (r.errCode === 40004) {\n\t * const msTillNext = game.max_spins_period_ms! - (Date.now() - (r.first_spin_in_period ?? 0));\n\t * console.log('[smartico] spin', i, 'capped — ' + Math.ceil(msTillNext / 1000) + ' s until next allowed');\n\t * } else {\n\t * console.error('[smartico] spin', i, 'failed —', r.errCode, r.errMessage);\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async playMiniGameBatch(\n\t\ttemplate_id: number,\n\t\tspin_count: number,\n\t\t{ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {},\n\t): Promise<TMiniGamePlayBatchResult[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\tconst response = await this.api.sawSpinBatchRequest(this.userExtId, template_id, spin_count);\n\n\t\tconst request_ids = response.results.map((result) => result.request_id);\n\t\tthis.api.doAcknowledgeBatchRequest(this.userExtId, request_ids);\n\n\t\tconst o: TMiniGamePlayBatchResult[] = response.results.map((result) => ({\n\t\t\terrCode: result.errCode,\n\t\t\terrMessage: result.errMsg,\n\t\t\tsaw_prize_id: result.saw_prize_id,\n\t\t\tjackpot_amount: result.jackpot_amount,\n\t\t\tfirst_spin_in_period: result.first_spin_in_period,\n\t\t}));\n\n\t\treturn o;\n\t}\n\n\tprotected async updateOnSpin(data: SAWSpinsCountPush) {\n\t\tconst templates: TMiniGameTemplate[] = await OCache.use(\n\t\t\tonUpdateContextKey.Saw,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.sawGetTemplatesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t\tconst index = templates.findIndex((t) => t.id === data.saw_template_id);\n\t\tif (index === -1) {\n\t\t\treturn;\n\t\t}\n\t\ttemplates[index].spin_count = data.spin_count;\n\t\tthis.updateEntity(onUpdateContextKey.Saw, templates);\n\t}\n\n\tprotected async reloadMiniGameTemplate() {\n\t\tconst updatedTemplates = await this.api.sawGetTemplatesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Saw, updatedTemplates);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTAvatarDefinition,\n\tTAvatarCustomized,\n\tTAvatarPrompt,\n\tTSetAvatarResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIMiniGames } from './WSAPIMiniGames';\nimport { AvatarCustomizeResponse } from '../Avatars/AvatarCustomizeResponse';\n\n/** @group Avatars */\nexport class WSAPIAvatars extends WSAPIMiniGames {\n\t/**\n\t * Returns the avatar catalog available to the current user — every pre-defined\n\t * avatar configured for the label, with per-user unlock flags (`is_given`, `is_in_use`)\n\t * applied server-side.\n\t *\n\t * The returned `avatar_url` is the absolute CDN URL (the SDK prefixes relative paths\n\t * with the configured avatar domain). AI-customized variants are NOT returned here —\n\t * those live in {@link getAvatarsCustomized}.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - No other prerequisite calls.\n\t *\n\t * **Visibility filter** (consumer-applied)\n\t * Avatars with `hide_until_achieved === true && is_given === false` should be filtered\n\t * out of the grid — they represent surprise unlocks that should remain hidden until\n\t * the user earns them. The default Smartico UI drops these before rendering.\n\t *\n\t * **Lock state** (consumer-applied)\n\t * Lock condition: `!is_given && avatar_source_type_id !== 0`. Free avatars\n\t * (`avatar_source_type_id === 0`) are always selectable; non-free avatars are locked\n\t * until `is_given` flips to true (operator grants via campaign, mission reward, store\n\t * purchase, etc.).\n\t *\n\t * **Sort order**\n\t * Server does NOT pre-sort. Caller must sort by `priority` ascending (lower = first).\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - {@link setAvatar} clears this cache on completion; the next call re-fetches.\n\t * - No push subscription — there is no `onUpdate` callback for avatar methods.\n\t * - When `is_given` flips server-side (e.g. the user earns a new avatar), the change\n\t * surfaces only on the next call after the 30-second cache window expires.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarsList`](../../docs/ui/avatars/UIGuide_getAvatarsList.md).\n\t *\n\t * @returns Array of {@link TAvatarDefinition} — empty array if the feature is disabled\n\t * on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const avatars = await window._smartico.api.getAvatarsList();\n\t *\n\t * // Apply the standard visibility filter and sort.\n\t * const visible = avatars\n\t * .filter((a) => !a.hide_until_achieved || a.is_given)\n\t * .sort((a, b) => a.priority - b.priority);\n\t *\n\t * console.log('[smartico] visible avatars:', visible.length, '— render as a grid');\n\t *\n\t * const active = visible.find((a) => a.is_in_use);\n\t * if (active) {\n\t * console.log('[smartico] currently in use — overlay a checkmark on this card:', active.avatar_real_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getAvatarsList(): Promise<TAvatarDefinition[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarsList,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the user's previously generated AI-customized avatar variants.\n\t *\n\t * Each entry is one AI-generated image derived from a base avatar in the catalog\n\t * (the base is identified by `avatar_real_id` and was originally a\n\t * {@link TAvatarDefinition} from {@link getAvatarsList}). These variants are stored\n\t * server-side under the user record and persist across sessions.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - Has meaning only after at least one successful AI customization run (see below).\n\t * New users get an empty array.\n\t *\n\t * **Where customized avatars come from**\n\t * AI customization is **not** a WebSocket method on this SDK. It is a separate HTTP\n\t * POST to the operator-configured `avatar-customize` endpoint that takes a base avatar\n\t * plus a style prompt from {@link getAvatarPrompts} and returns a generated CDN URL.\n\t * Once that POST resolves successfully, the new variant is persisted and surfaces in\n\t * the next `getAvatarsCustomized()` call. The variant URL can then be passed to\n\t * {@link setAvatar} to activate it.\n\t *\n\t * **Relation to `getAvatarsList`**\n\t * AI variants do NOT appear in {@link getAvatarsList}. Catalog and variants are two\n\t * separate collections — combine them client-side if the UI needs a unified view per\n\t * base avatar.\n\t *\n\t * **Sort order**\n\t * Server does NOT pre-sort. Caller typically sorts by `dt_created` descending to show\n\t * the newest variant first.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - {@link setAvatar} clears this cache on completion.\n\t * - After a successful AI customization POST, the consumer should re-call to surface\n\t * the new variant — the customization endpoint is outside the SDK so the SDK cannot\n\t * auto-invalidate.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarsCustomized`](../../docs/ui/avatars/UIGuide_getAvatarsCustomized.md).\n\t *\n\t * @returns Array of {@link TAvatarCustomized} — empty if the user has never run AI\n\t * customization, or if the feature is disabled on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const variants = await window._smartico.api.getAvatarsCustomized();\n\t *\n\t * // Group by the base avatar so the UI can show \"this base has 3 AI variants\".\n\t * const byBase = new Map<number, typeof variants>();\n\t * for (const v of variants) {\n\t * const list = byBase.get(v.avatar_real_id) ?? [];\n\t * list.push(v);\n\t * byBase.set(v.avatar_real_id, list);\n\t * }\n\t *\n\t * // Newest-first within each base.\n\t * for (const list of byBase.values()) {\n\t * list.sort((a, b) => b.dt_created.localeCompare(a.dt_created));\n\t * }\n\t *\n\t * console.log('[smartico] AI variants by base avatar — render as a carousel under each base');\n\t * ```\n\t */\n\tpublic async getAvatarsCustomized(): Promise<TAvatarCustomized[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarsCustomized,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetCustomizedT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the catalog of AI style prompts available for avatar customization.\n\t *\n\t * Each entry is a \"style\" the user can apply to a base avatar (e.g. \"Cartoon\",\n\t * \"Watercolor\", \"Cyberpunk\"). Prompts carry a cost expressed in points, gems, or\n\t * diamonds — applying a prompt deducts the cost server-side as part of the AI\n\t * generation request.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - No other prerequisite calls. The customization UI typically calls this on demand\n\t * when the user opens the style picker, not on app boot.\n\t *\n\t * **Cost handling**\n\t * Each prompt declares `cost_currency_type_id` (0 = points, 1 = gems, 2 = diamonds)\n\t * and `cost_value` (amount). The deduction happens server-side inside the\n\t * `avatar-customize` HTTP POST (the AI generation request, which is NOT part of this\n\t * SDK). The client should compare `cost_value` against the live balance from\n\t * {@link getUserProfile} to disable prompts the user cannot afford, but the server is\n\t * the source of truth and will reject under-funded requests authoritatively.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - Not invalidated by {@link setAvatar} (prompts are catalog metadata, independent\n\t * of the user's active avatar).\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarPrompts`](../../docs/ui/avatars/UIGuide_getAvatarPrompts.md).\n\t *\n\t * @returns Array of {@link TAvatarPrompt} — empty if the AI customization feature is\n\t * disabled on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const [prompts, profile] = await Promise.all([\n\t * window._smartico.api.getAvatarPrompts(),\n\t * window._smartico.api.getUserProfile(),\n\t * ]);\n\t *\n\t * for (const p of prompts) {\n\t * // The consumer reads the matching balance from profile based on\n\t * // p.cost_currency_type_id (0=points, 1=gems, 2=diamonds).\n\t * console.log('[smartico] prompt', p.name, '— cost', p.cost_value, 'currency_type', p.cost_currency_type_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getAvatarPrompts(): Promise<TAvatarPrompt[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarPrompts,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetPromptsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Activates the specified avatar for the current user. The chosen image becomes the\n\t * profile avatar — any subsequent {@link getUserProfile} call will reflect the new\n\t * `avatar_url`.\n\t *\n\t * Pass `avatar_url` (a {@link TAvatarDefinition.url} from the catalog or a\n\t * {@link TAvatarCustomized.url} from the AI-variant list) plus `avatar_real_id` of the\n\t * base avatar. The server validates ownership before applying — locked avatars are\n\t * rejected.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - `avatar_url` must be non-empty and `avatar_real_id` must be truthy — the SDK\n\t * throws synchronously otherwise (the request never reaches the server).\n\t * - The avatar must exist in the catalog from {@link getAvatarsList} (or be an AI\n\t * variant of a base avatar the user already owns). Free avatars\n\t * (`avatar_source_type_id === 0`) and the user's currently active avatar bypass the\n\t * ownership check; all others require `is_given === true`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; cache is cleared and the profile avatar updates immediately.\n\t * - `1` — avatar not found in the catalog. The `avatar_real_id` doesn't exist for\n\t * this label.\n\t * - `2` — avatar inactive (deactivated by the operator).\n\t * - `3` — outside the avatar's active time window\n\t * (`active_from_date` / `active_till_date`).\n\t * - `4` — user does not own this avatar (it isn't in their `is_given` set and isn't\n\t * a free / default avatar).\n\t * - other non-zero — generic server error; surface `err_message` if present.\n\t *\n\t * The default Smartico UI shows a hardcoded \"Failed to apply avatar\" toast on any\n\t * non-zero `err_code` and does not surface `err_message`. Custom UIs SHOULD branch\n\t * on the code and prefer `err_message` when present (it is the localized server\n\t * string).\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears both the `getAvatarsList` and `getAvatarsCustomized` caches —\n\t * the next call to either returns fresh data with the new `is_in_use` flag set on\n\t * the chosen avatar.\n\t * - The server persists the new avatar URL on the user record; {@link getUserProfile}\n\t * reflects it on the next read in this session.\n\t * - **No push to other open sessions.** A second device / tab the user is logged in\n\t * on will not see the new avatar until it next calls {@link getUserProfile} or\n\t * re-identifies. Plan UI accordingly.\n\t *\n\t * **Idempotency**: safe to retry. Re-applying the same `avatar_real_id` returns\n\t * `err_code: 0` and produces no double side effects (no double-deduction — this\n\t * method does not charge any currency — and no duplicate log entries).\n\t *\n\t * **Side effects**: updates the user's stored `avatar_id` / `avatar_real_id`. Does\n\t * NOT cost points, gems, or diamonds — the cost lives on the separate AI\n\t * customization HTTP flow ({@link getAvatarPrompts}). Does NOT write a user-visible\n\t * entry to {@link getActivityLog}.\n\t *\n\t * **UI guidance**: see [UI Guide — `setAvatar`](../../docs/ui/avatars/UIGuide_setAvatar.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param props.avatar_url Absolute CDN URL of the avatar image. Read from\n\t * {@link TAvatarDefinition.url} for catalog avatars or\n\t * {@link TAvatarCustomized.url} for AI variants.\n\t * @param props.avatar_real_id Numeric ID of the base avatar from\n\t * {@link TAvatarDefinition.avatar_real_id}. For AI\n\t * variants, this is the `avatar_real_id` of the base\n\t * they were derived from.\n\t * @returns {@link TSetAvatarResult} — check `err_code === 0` for success.\n\t *\n\t * @example\n\t * ```ts\n\t * const avatars = await window._smartico.api.getAvatarsList();\n\t * const target = avatars.find((a) => a.avatar_real_id === 7);\n\t *\n\t * if (!target) {\n\t * console.error('[smartico] avatar 7 not in catalog — hide the picker entry');\n\t * return;\n\t * }\n\t *\n\t * const isLocked = !target.is_given && target.avatar_source_type_id !== 0;\n\t * if (isLocked) {\n\t * console.log('[smartico] avatar is locked — show \"earn this first\" prompt instead of calling setAvatar');\n\t * return;\n\t * }\n\t *\n\t * const r = await window._smartico.api.setAvatar({\n\t * avatar_url: target.avatar_url,\n\t * avatar_real_id: target.avatar_real_id,\n\t * });\n\t *\n\t * switch (r.err_code) {\n\t * case 0:\n\t * console.log('[smartico] avatar applied — close picker, refresh header avatar');\n\t * break;\n\t * case 1:\n\t * console.error('[smartico] avatar not in catalog — refresh catalog and show error');\n\t * break;\n\t * case 2:\n\t * console.error('[smartico] avatar inactive — operator disabled it; hide from picker');\n\t * break;\n\t * case 3:\n\t * console.error('[smartico] outside time window — show \"available on X\" message');\n\t * break;\n\t * case 4:\n\t * console.error('[smartico] not owned — show unlock requirements');\n\t * break;\n\t * default:\n\t * console.error('[smartico] avatar apply failed — show generic error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async setAvatar(props: { avatar_url: string; avatar_real_id: number }): Promise<TSetAvatarResult> {\n\t\tif (!props.avatar_url) {\n\t\t\tthrow new Error('avatar_url is required');\n\t\t}\n\t\tif (!props.avatar_real_id) {\n\t\t\tthrow new Error('avatar_real_id is required');\n\t\t}\n\n\t\tconst r = await this.api.avatarSetAvatar(this.userExtId, props.avatar_url, props.avatar_real_id);\n\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsList);\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsCustomized);\n\n\t\treturn {\n\t\t\terr_code: r.errCode ?? 0,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Generates an AI-customized variant of a base avatar by applying an\n\t * operator-defined style prompt, returning the CDN URL of the result.\n\t * This is a paid, generate-only step: it does NOT change the user's\n\t * active avatar — pass the returned `cdn_url` to {@link setAvatar} to\n\t * activate it.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - Authenticated session required; not available in visitor mode (throws).\n\t * - All five fields are mandatory — the SDK throws synchronously\n\t * (`Error(\"<field> is required\")`) if any is missing or zero.\n\t * - `prompt_id` must be one of the prompts from {@link getAvatarPrompts};\n\t * `avatar_url` / `avatar_real_id` identify the base avatar to style.\n\t *\n\t * **Cost**\n\t * Each generation costs the currency the operator configured on the\n\t * chosen prompt (points, gems, or diamonds — some prompts are free; read\n\t * `cost_currency_type_id` / `cost_value` from the {@link getAvatarPrompts}\n\t * entry to gate the UI before calling). The cost is charged only on\n\t * success; if the user can't afford it the call fails with `errCode -1`\n\t * and nothing is generated or charged.\n\t *\n\t * **Latency**\n\t * Generation runs server-side AI image synthesis and is synchronous from\n\t * the caller's side — expect several seconds (roughly 5–20 s) before the\n\t * promise resolves. There is no SDK cache and no push/subscription; show\n\t * a loading state for the full duration and disable the trigger to\n\t * prevent duplicate submissions.\n\t *\n\t * **Result & error codes**\n\t * On success the result has `cdn_url` set; on failure it has `errCode` /\n\t * `errMessage` set and no `cdn_url`. Branch on `errCode` — the generic\n\t * message is fixed text, not cause-specific:\n\t * - `12001` (`AvatarCustomizeErrorCode.AVATAR_USER_LIMIT`) — the user hit\n\t * their monthly per-user generation cap. Nothing is generated or charged.\n\t * - `12002` (`AvatarCustomizeErrorCode.AVATAR_LABEL_LIMIT`) — the brand's\n\t * shared monthly pool is exhausted. Nothing is generated or charged;\n\t * surface a \"try again later\" message.\n\t * - `-1` — generic failure: insufficient balance, an unavailable prompt,\n\t * or a generation error. Nothing is charged. Allow the user to retry.\n\t *\n\t * Both monthly caps are operator-configured and reset at the start of\n\t * each calendar month.\n\t *\n\t * **Side effects (on success)**\n\t * The generated variant is persisted to the user's customization history\n\t * and counts toward the monthly caps **whether or not** it is later\n\t * activated — generation is not reversible. The SDK clears the\n\t * {@link getAvatarsCustomized} cache so the next call surfaces the new\n\t * variant. The user's active avatar is unchanged until you call\n\t * {@link setAvatar} with the returned `cdn_url`.\n\t *\n\t * **Idempotency**: not idempotent — each successful call generates (and\n\t * charges for) a new variant. Guard the call site against double-clicks.\n\t *\n\t * **UI guidance**: see [UI Guide — `avatarsCustomize`](../../docs/ui/avatars/UIGuide_avatarsCustomize.md).\n\t *\n\t * **Visitor mode**: not supported (throws).\n\t *\n\t * @param props.user_id Numeric Smartico user ID.\n\t * @param props.prompt_id Style-prompt ID (`prompt_id`) from {@link getAvatarPrompts}.\n\t * @param props.avatar_url CDN URL of the base avatar to customize.\n\t * @param props.avatar_real_id `avatar_real_id` of the base avatar.\n\t * @returns {@link AvatarCustomizeResponse} — `cdn_url` set on success;\n\t * `errCode` / `errMessage` set on failure.\n\t *\n\t * @example\n\t * ```ts\n\t * // user_id identifies the Smartico user being customized.\n\t * const prompts = await window._smartico.api.getAvatarPrompts();\n\t * const prompt = prompts[0];\n\t *\n\t * console.log('[smartico] generating avatar — show a spinner for ~5-20s and disable the Generate button');\n\t * const result = await window._smartico.api.avatarsCustomize({\n\t * user_id,\n\t * prompt_id: prompt.prompt_id,\n\t * avatar_url: baseAvatar.avatar_url,\n\t * avatar_real_id: baseAvatar.avatar_real_id,\n\t * });\n\t *\n\t * if (result.cdn_url) {\n\t * console.log('[smartico] generation succeeded — preview this URL, then call setAvatar to apply it:', result.cdn_url);\n\t * // await window._smartico.api.setAvatar({ avatar_url: result.cdn_url, avatar_real_id: baseAvatar.avatar_real_id });\n\t * } else if (result.errCode === 12001) {\n\t * console.error('[smartico] user monthly limit reached — show \"you have used all your custom avatars this month\"');\n\t * } else if (result.errCode === 12002) {\n\t * console.error('[smartico] brand monthly pool exhausted — show \"custom avatars are unavailable right now, try later\"');\n\t * } else {\n\t * console.error('[smartico] generation failed (e.g. not enough balance) — let the user retry:', result.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async avatarsCustomize(props: {\n\t\tuser_id: number;\n\t\tprompt_id: number;\n\t\tavatar_url: string;\n\t\tavatar_real_id: number;\n\t}): Promise<AvatarCustomizeResponse> {\n\t\tconst required: (keyof typeof props)[] = ['user_id', 'prompt_id', 'avatar_url', 'avatar_real_id'];\n\t\tfor (const field of required) {\n\t\t\tif (!props[field]) {\n\t\t\t\tthrow new Error(`${field} is required`);\n\t\t\t}\n\t\t}\n\n\t\tconst r = await this.api.avatarsCustomize(props);\n\n\t\t// On success a new variant is persisted server-side — drop the cached\n\t\t// list so the next getAvatarsCustomized() surfaces it.\n\t\tif (r.cdn_url) {\n\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsCustomized);\n\t\t}\n\n\t\treturn r;\n\t}\n}\n","import { GamePickGameInfo, GamePickRequestParams, GamePickRound, GamePickRoundBoard, GamePickRoundRequestParams, GamePickUserInfo, GamesApiResponse } from '../GamePick';\nimport { WSAPIAvatars } from './WSAPIAvatars';\n\n/** @group GamePick */\nexport class WSAPIGamePick extends WSAPIAvatars {\n\t/**\n\t * Returns every open round for a MatchX or Quiz game template, with the full\n\t * event list (matches / questions) and the current user's selections per event.\n\t *\n\t * Use to power the rounds-lobby screen — typically a list of round cards a user\n\t * can tap into to make predictions. For a single round, use\n\t * {@link gamePickGetActiveRound} (lighter payload when only one round is shown).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated.\n\t * - `saw_template_id` must reference a MatchX or Quiz game template. The SDK\n\t * throws synchronously if it's missing.\n\t *\n\t * **Transport**\n\t * Game Pick methods are HTTP REST calls to a separate Game Pick games server\n\t * (not the main WebSocket). One consequence: there is no SDK cache and no push\n\t * subscription — every call is a fresh server roundtrip.\n\t *\n\t * **Round status**\n\t * Each round's `round_status_id` is a {@link GPRoundStatus} value. Rounds with\n\t * status `NoEventsDefined` (1) are filtered out server-side and never appear\n\t * here. Other values: `Other` (-1, normally open), `NoMoreBetsAllowed` (2),\n\t * `AllEventsResolved_ButNotRound` (3), `RoundResolved` (4 — appears here only\n\t * briefly during transition; use {@link gamePickGetHistory} for resolved rounds).\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found (the `saw_template_id` doesn't reference a\n\t * MatchX/Quiz game).\n\t * - `100003` — no open rounds available for this template right now.\n\t * - `100000` — auth hash invalid; SDK session needs re-initialization.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache; every call is live.\n\t * - No push subscription. Poll while the user is on the screen if you need\n\t * live round-status changes (typically every 30–60 s is enough).\n\t *\n\t * **Visitor mode**: not supported. The SDK throws synchronously on visitor\n\t * sessions.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetActiveRounds({ saw_template_id: 1083 });\n\t *\n\t * if (r.errCode !== 0) {\n\t * console.error('[smartico] active rounds fetch failed — show empty rounds lobby:', r.errMessage);\n\t * return;\n\t * }\n\t *\n\t * for (const round of r.data ?? []) {\n\t * console.log('[smartico] render a round card:', round.round_name, '— events:', round.events.length, 'user has placed bet:', round.user_placed_bet);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetActiveRounds(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns a single round (events, user selections, scoring rules) for a\n\t * MatchX or Quiz game. Use to power the round-detail / prediction-input\n\t * screen the user lands on after picking a round from the lobby.\n\t *\n\t * Same shape as one entry of {@link gamePickGetActiveRounds}; cheaper when the\n\t * UI only shows one round at a time.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `round_id` are mandatory — the SDK throws if either\n\t * is missing.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `4` — round / event not found (e.g. round resolved after the last\n\t * `gamePickGetActiveRounds` poll); non-fatal — retry after a fresh active-\n\t * rounds fetch.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache; every call is live.\n\t * - Re-call after {@link gamePickSubmitSelection} or\n\t * {@link gamePickSubmitSelectionQuiz} to surface the persisted predictions.\n\t * - Poll while the user is on the prediction screen if event resolution\n\t * updates are needed (typically every 30–60 s).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetActiveRound`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @param props.round_id ID of the round to fetch.\n\t * @returns Wrapped {@link GamesApiResponse} of a single {@link GamePickRound}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetActiveRound({\n\t * saw_template_id: 1083,\n\t * round_id: 31652,\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * console.log('[smartico] render round detail page —', r.data.round_name, '— user has placed bet:', r.data.user_placed_bet, 'score so far:', r.data.user_score);\n\t * } else {\n\t * console.error('[smartico] round fetch failed — bounce back to the lobby and refresh:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\treturn this.api.gpGetActiveRound(props.saw_template_id, props.round_id);\n\t}\n\n\t/**\n\t * Returns the full round history (active + resolved) for a MatchX or Quiz game\n\t * template, newest-first. Each round carries the user's predictions plus the\n\t * server-resolved outcome on each event.\n\t *\n\t * Use to power a \"Past predictions\" / history tab. For just the open rounds,\n\t * use {@link gamePickGetActiveRounds} (faster — skips resolved data).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Sort order**\n\t * Server returns rounds newest-first. No client-side sort needed.\n\t *\n\t * **Per-event resolution**\n\t * Each event in the rounds carries `resolution_type_id` — values are from\n\t * {@link GamePickResolutionType}: `None` (0, not yet resolved), `Lost` (2),\n\t * `PartialWin` (3), `FullWin` (4). Use these to render result badges on\n\t * each event row.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Re-call when the user opens the history tab.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetHistory`](../../docs/ui/gamepick/UIGuide_gamePickGetHistory.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array,\n\t * newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetHistory({ saw_template_id: 1083 });\n\t *\n\t * for (const round of r.data ?? []) {\n\t * console.log('[smartico] history row —', round.round_name, 'score:', round.user_score, 'resolved:', round.is_resolved);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetGamesHistory(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns the leaderboard for a MatchX or Quiz game round — ranked list of\n\t * players plus the current user's entry (`my_user`). Pass `round_id: -1` for\n\t * the season / overall leaderboard across every round in the template.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **`round_id` semantics**\n\t * - Positive `round_id` — per-round leaderboard scoped to that round's events.\n\t * - `-1` — season / overall leaderboard aggregating scores across every round\n\t * of the template.\n\t *\n\t * **`my_user`**\n\t * The current user's entry is returned separately from the `users[]` array\n\t * — `my_user` may be `null` if the user has never made a prediction on this\n\t * round / template. Use it to render the user's rank in a sticky footer or\n\t * \"you are here\" highlight regardless of pagination.\n\t *\n\t * **Username masking**\n\t * `public_username` on other players may be masked / anonymized by operator\n\t * label settings. Always pair with `avatar_url` so the user can recognize\n\t * themselves in the ranking by avatar even when usernames are hidden.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Poll while the leaderboard is visible\n\t * (every 30–60 s) if you want live rank updates after match\n\t * resolution.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetBoard`](../../docs/ui/gamepick/UIGuide_gamePickGetBoard.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @param props.round_id Round ID, or `-1` for the season leaderboard.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRoundBoard}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetBoard({\n\t * saw_template_id: 1083,\n\t * round_id: -1, // season leaderboard\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * console.log('[smartico] render leaderboard rows for top', r.data.users.length, 'players');\n\t * if (r.data.my_user) {\n\t * console.log('[smartico] pin \"you are rank #' + r.data.my_user.gp_position + '\" footer to bottom');\n\t * } else {\n\t * console.log('[smartico] user not ranked — render \"Play a round to join the leaderboard\" CTA');\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\treturn this.api.gpGetGameBoard(props.saw_template_id, props.round_id);\n\t}\n\n\t/**\n\t * Submits all score predictions for a round in a MatchX game in one shot.\n\t * Each event in the round must carry `team1_user_selection` and\n\t * `team2_user_selection` (the predicted scores).\n\t *\n\t * On the user's FIRST submit for a round, the server charges one buy-in (one\n\t * \"spin\" / one currency deduction based on the template's `saw_buyin_type_id`).\n\t * Subsequent edits within the same round are free and only persist changed\n\t * selections.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if\n\t * either is missing.\n\t * - Each event passed must include `gp_event_id` and the two\n\t * `team{1,2}_user_selection` fields. Missing events default to \"no change\".\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success; the response `data` is the updated round with\n\t * `user_placed_bet === true` and `has_not_submitted_changes === false`.\n\t * - `3` (`NoBetsUpdatedOnSubmit`) — submit produced no changes, OR every event\n\t * is past its `last_bet_date` deadline. The buy-in is NOT consumed; the\n\t * current round is still returned in `data`.\n\t * - `4` — round / event not found; refresh state and retry.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * Buy-in failures pass through the {@link SAWSpinErrorCode} values on first\n\t * submit:\n\t * - `40001` — no spins left (when `saw_buyin_type_id` is Spins).\n\t * - `40003` — insufficient points.\n\t * - `40004` — global max-spins cap hit.\n\t * - `40007` — template outside its active date window.\n\t * - `40009` — user excluded by segment rule.\n\t * - `40011` — insufficient gems.\n\t * - `40012` — insufficient diamonds.\n\t *\n\t * **Idempotency**\n\t * Re-submitting identical selections returns `errCode: 3` (no changes); the\n\t * buy-in is consumed exactly once per round-per-user. Re-submitting after\n\t * `last_bet_date` also returns `errCode: 3` without consuming the buy-in.\n\t *\n\t * **Side effects**\n\t * - First successful submit deducts the buy-in (Points / Gems / Diamonds /\n\t * one Spin) per `saw_buyin_type_id`.\n\t * - Reports a `minigame_matchx_prediction` event to the operator's event log.\n\t * - Updates the round's participant counter (`users_cnt`) and per-event\n\t * counters (`num_users`).\n\t * - Score is awarded after the operator resolves the round\n\t * ({@link GPRoundStatus} = `RoundResolved`).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickSubmitSelection`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX game template.\n\t * @param props.round Round object with `round_id` + `events[]`\n\t * carrying the user's score predictions.\n\t * @returns Wrapped {@link GamesApiResponse} with the updated round.\n\t *\n\t * @example\n\t * ```ts\n\t * const ar = await window._smartico.api.gamePickGetActiveRound({\n\t * saw_template_id: 1190,\n\t * round_id: 38665,\n\t * });\n\t * if (ar.errCode !== 0 || !ar.data) {\n\t * console.error('[smartico] could not fetch round to submit — show error and bounce back');\n\t * return;\n\t * }\n\t *\n\t * const round = ar.data;\n\t * round.events = round.events.map(e => ({\n\t * gp_event_id: e.gp_event_id,\n\t * team1_user_selection: 1,\n\t * team2_user_selection: 0,\n\t * }));\n\t *\n\t * const r = await window._smartico.api.gamePickSubmitSelection({\n\t * saw_template_id: 1190,\n\t * round,\n\t * });\n\t *\n\t * switch (r.errCode) {\n\t * case 0:\n\t * console.log('[smartico] predictions saved — show confirmation, refresh leaderboard');\n\t * break;\n\t * case 3:\n\t * console.log('[smartico] nothing changed (or all events closed) — silent no-op');\n\t * break;\n\t * case 40001:\n\t * case 40003:\n\t * case 40011:\n\t * case 40012:\n\t * console.error('[smartico] insufficient balance / spins — show top-up CTA:', r.errMessage);\n\t * break;\n\t * default:\n\t * console.error('[smartico] submit failed — show generic error toast:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickSubmitSelection(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round?.round_id) {\n\t\t\tthrow new Error('round is required');\n\t\t}\n\t\treturn this.api.gpSubmitSelection(props.saw_template_id, props.round, false);\n\t}\n\n\t/**\n\t * Submits all quiz answers for a round in one shot. Each event in the round\n\t * must carry `user_selection` (the answer value — typically `\"1\"` / `\"2\"` /\n\t * `\"x\"` for 1×2 markets, `\"yes\"` / `\"no\"` for binary markets, or any\n\t * operator-defined string for custom markets).\n\t *\n\t * Same first-submit buy-in behavior as {@link gamePickSubmitSelection} — one\n\t * buy-in is charged on the first successful submit; subsequent edits within\n\t * the same round are free.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if\n\t * either is missing.\n\t * - Each event must include `gp_event_id` and `user_selection`. Missing\n\t * events default to \"no change\".\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `3` (`NoBetsUpdatedOnSubmit`) — no changes, OR every event past\n\t * `last_bet_date`. Buy-in NOT consumed; current round returned in `data`.\n\t * - `4` — round / event not found.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * Buy-in failures use the same {@link SAWSpinErrorCode} pass-through values\n\t * as {@link gamePickSubmitSelection} — see that method's TSDoc for the\n\t * `40001` / `40003` / `40004` / `40007` / `40009` / `40011` / `40012`\n\t * semantics.\n\t *\n\t * **Idempotency**: identical to {@link gamePickSubmitSelection} — re-submit\n\t * returns `errCode: 3` and never double-charges the buy-in.\n\t *\n\t * **Side effects**: identical to {@link gamePickSubmitSelection}, with the\n\t * reported event being `minigame_quiz_prediction` instead of\n\t * `minigame_matchx_prediction`.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickSubmitSelectionQuiz`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md).\n\t *\n\t * @param props.saw_template_id ID of the Quiz game template.\n\t * @param props.round Round object with `round_id` + `events[]`\n\t * carrying the user's answer selections.\n\t * @returns Wrapped {@link GamesApiResponse} with the updated round.\n\t *\n\t * @example\n\t * ```ts\n\t * const ar = await window._smartico.api.gamePickGetActiveRound({\n\t * saw_template_id: 1183,\n\t * round_id: 37974,\n\t * });\n\t * if (ar.errCode !== 0 || !ar.data) {\n\t * console.error('[smartico] could not fetch round to submit answers — show error');\n\t * return;\n\t * }\n\t *\n\t * const round = ar.data;\n\t * round.events = round.events.map(e => ({\n\t * gp_event_id: e.gp_event_id,\n\t * user_selection: 'x',\n\t * }));\n\t *\n\t * const r = await window._smartico.api.gamePickSubmitSelectionQuiz({\n\t * saw_template_id: 1183,\n\t * round,\n\t * });\n\t *\n\t * if (r.errCode === 0) {\n\t * console.log('[smartico] quiz answers saved — show confirmation');\n\t * } else if (r.errCode === 3) {\n\t * console.log('[smartico] nothing changed — silent no-op');\n\t * } else {\n\t * console.error('[smartico] quiz submit failed:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickSubmitSelectionQuiz(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round?.round_id) {\n\t\t\tthrow new Error('round is required');\n\t\t}\n\t\treturn this.api.gpSubmitSelection(props.saw_template_id, props.round, true);\n\t}\n\n\t/**\n\t * Returns the current user's profile within the Game Pick system — display\n\t * name, avatar, balances, and last wallet-sync timestamp. The Game Pick server\n\t * maintains its own user record that mirrors the user's Smartico balances; the\n\t * mirror is updated at most once per minute, so `last_wallet_sync_time` tells\n\t * the consumer how stale the balances on the response are.\n\t *\n\t * On the user's first call for a given game, the Game Pick server lazily\n\t * provisions a user record — so this method doubles as a \"register the user\n\t * with this game\" call.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Balance freshness**\n\t * The balances returned here are the cached mirror — at most ~1 minute stale.\n\t * For an up-to-the-second view of Points / Gems / Diamonds, read from\n\t * {@link getUserProfile} instead. Use this method's balances only for\n\t * in-Game-Pick display.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache. Server-side mirror refreshes at most every 60 s.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetUserInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickUserInfo}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetUserInfo({ saw_template_id: 1083 });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * console.log('[smartico] render Game Pick header — name:', r.data.public_username, '— points:', r.data.ach_points_balance, '— synced:', r.data.last_wallet_sync_time);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetUserInfo(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns the game template configuration plus a metadata listing of every\n\t * round (without events). Use to power the game's welcome / lobby screen —\n\t * shows the template name, buy-in cost, the user's remaining attempts, and\n\t * the full round list.\n\t *\n\t * The `allRounds[]` here is a lightweight metadata-only view — to render\n\t * predictions or leaderboards, call {@link gamePickGetActiveRound} /\n\t * {@link gamePickGetActiveRounds} / {@link gamePickGetBoard} for the rounds\n\t * the user actually opens.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Buy-in semantics**\n\t * The `sawTemplate.saw_buyin_type_id` value determines which currency is\n\t * deducted on the user's first prediction in any round:\n\t * - Free — no deduction.\n\t * - Points — `buyin_cost_points` deducted from the user's points balance.\n\t * - Gems — deducted from the user's gems balance.\n\t * - Diamonds — deducted from the user's diamonds balance.\n\t * - Spins — one spin counted from `spin_count`.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Re-call after a successful\n\t * {@link gamePickSubmitSelection} to refresh `spin_count`.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetGameInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickGameInfo}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetGameInfo({ saw_template_id: 1189 });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * console.log('[smartico] render Game Pick lobby — title:', r.data.sawTemplate.saw_template_ui_definition.name);\n\t * console.log('[smartico] rounds available:', r.data.allRounds.length, '— buy-in type:', r.data.sawTemplate.saw_buyin_type_id, 'cost:', r.data.sawTemplate.buyin_cost_points);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetGameInfo(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns a round with another player's predictions instead of the current\n\t * user's. The target player is identified by `int_user_id` (the Game Pick\n\t * system's internal user ID, obtained from {@link gamePickGetBoard}'s\n\t * `users[].int_user_id`).\n\t *\n\t * Use to power \"view this player's picks\" affordances opened from leaderboard\n\t * rows — community / social inspection of how a top-ranked user predicted.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id`, `round_id`, and `int_user_id` are all mandatory — SDK\n\t * throws synchronously if any is missing.\n\t * - `int_user_id` must come from a leaderboard fetch in the same game\n\t * template; it is stable within a template but not portable across\n\t * templates.\n\t *\n\t * **Shape vs `gamePickGetActiveRound`**\n\t * Same {@link GamePickRound} structure, but `user_selection` /\n\t * `team1_user_selection` / `team2_user_selection` reflect the TARGET user's\n\t * predictions instead of the caller's. Each event still carries its own\n\t * `resolution_type_id` (see {@link GamePickResolutionType}) so the UI can\n\t * render result badges per pick.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `4` — round / event / user not found.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache. Re-call when opening a different leaderboard row's\n\t * \"view picks\" modal.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetRoundInfoForUser`](../../docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @param props.round_id ID of the round to inspect.\n\t * @param props.int_user_id Internal user ID from\n\t * `gamePickGetBoard.users[].int_user_id`.\n\t * @returns Wrapped {@link GamesApiResponse} with the target user's\n\t * {@link GamePickRound}.\n\t *\n\t * @example\n\t * ```ts\n\t * const board = await window._smartico.api.gamePickGetBoard({\n\t * saw_template_id: 1083, round_id: 31652,\n\t * });\n\t * const topPlayer = board.data?.users?.[0];\n\t * if (!topPlayer) return;\n\t *\n\t * const r = await window._smartico.api.gamePickGetRoundInfoForUser({\n\t * saw_template_id: 1083,\n\t * round_id: 31652,\n\t * int_user_id: topPlayer.int_user_id,\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * for (const ev of r.data.events) {\n\t * console.log('[smartico] render row —', ev.event_meta.team1_name, 'vs', ev.event_meta.team2_name, '— picked:', ev.user_selection, '— resolution:', ev.resolution_type_id);\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & { int_user_id: number }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\tif (!props.int_user_id) {\n\t\t\tthrow new Error('int_user_id is required');\n\t\t}\n\t\treturn this.api.gpGetRoundInfoForUser(props.saw_template_id, props.round_id, props.int_user_id);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tLeaderBoardDetailsT,\n} from './WSAPITypes';\nimport { LeaderBoardPeriodType } from '../Leaderboard';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIGamePick } from './WSAPIGamePick';\n\n/** @group LeaderBoard */\nexport class WSAPILeaderBoard extends WSAPIGamePick {\n\t/**\n\t * Returns the operator-configured standalone leaderboard for the\n\t * given period type — top-20 ranked entries, the current user's\n\t * own entry (when authenticated), and the configured prize table.\n\t * Use this to power a leaderboard page with daily / weekly /\n\t * monthly tabs.\n\t *\n\t * The leaderboard for each period type is configured separately by\n\t * the operator. A label may have any combination of DAILY, WEEKLY,\n\t * and MONTHLY boards configured (or none). To discover which boards\n\t * exist before loading any standings, call {@link getLeaderBoards}\n\t * (metadata only) and drive the tab selector from its `period_type_id`s.\n\t *\n\t * @remarks\n\t * **Return value note** — the runtime may return `undefined` if no\n\t * board is configured for the requested `periodType`, despite the\n\t * static return type being `Promise<LeaderBoardDetailsT>`. Defend\n\t * against that case in consumer code.\n\t *\n\t * **Preconditions**\n\t * Pass a `periodType` from {@link LeaderBoardPeriodType}\n\t * (`DAILY = 1`, `WEEKLY = 2`, `MONTHLY = 3`). Pass\n\t * `getPreviousPeriod: true` to fetch the most-recently-ended\n\t * period's snapshot (yesterday's / last week's / last month's\n\t * results) instead of the current live period. To reach older\n\t * snapshots, pass a number instead of a boolean: `1` = previous\n\t * period, `2` = the one before that, and so on (`0` / `false` =\n\t * current). Use the snapshot's `create_date` / `version_id` to label\n\t * which historical run a previous-period board is. How far back\n\t * snapshots are retained is operator-configured.\n\t *\n\t * **Top-20 cap**\n\t * The server hard-caps `users[]` at 20 entries, ordered by\n\t * `position` ASC. Position values are server-computed (DENSE_RANK\n\t * over all participants); the truncation at 20 is for transport\n\t * size only — `position` may exceed 20 elsewhere.\n\t *\n\t * **The `me` field**\n\t * Always populated for authenticated users (even when they have\n\t * zero points in the period). `me.position === -1` is the signal\n\t * that the user is active but ranked outside the top 20 (or has no\n\t * activity yet). `me` is `undefined` for visitor-mode sessions.\n\t *\n\t * **Rewards are points only**\n\t * `rewards[].points` are gamification points credited to the user's\n\t * balance when the period finalizes. The leaderboard never awards\n\t * gems, diamonds, store items, or bonuses. The first element of\n\t * the array is the prize for place 1, the second for place 2, and\n\t * so on. The array length is the number of paid places.\n\t *\n\t * **Cache TTL**\n\t * The SDK caches each response for 30 seconds. \n\t *\n\t * **Period boundaries**\n\t * The server finalizes each period on a server-configurable\n\t * schedule: DAILY at midnight + operator-defined offset; WEEKLY\n\t * at the start of Monday; MONTHLY on the 1st of each month. At\n\t * finalization, the server distributes the configured `rewards[]`\n\t * points to the top placeholders and resets the live board. After\n\t * finalization, `getLeaderBoard(periodType, false)` returns the\n\t * NEW (empty) period's board; call with\n\t * `getPreviousPeriod: true` to see the just-ended standings.\n\t *\n\t * **Refresh model**\n\t * - One-shot fetch (no subscription).\n\t * - No push event refreshes the cache; finalization at the period\n\t * boundary is NOT pushed to the client.\n\t * - Poll manually if the consumer needs near-live state during an\n\t * in-progress period.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getLeaderBoard`](../../docs/ui/leaderboard/UIGuide_getLeaderBoard.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped\n\t * to the brand's public leaderboard. `me` is `undefined` for\n\t * visitors.\n\t *\n\t * @param periodType The board's period type\n\t * ({@link LeaderBoardPeriodType}).\n\t * Selects which pre-configured board to\n\t * fetch; the board itself is bound to one\n\t * period by the operator.\n\t * @param getPreviousPeriod Which period to fetch. `false` (default)\n\t * = current in-progress period; `true` =\n\t * the most recent finalized snapshot; a\n\t * number `n` = the n-th previous snapshot\n\t * (`1` = previous, `2` = the one before, …).\n\t * @returns Promise resolving to `LeaderBoardDetailsT`.\n\t * **At runtime, may resolve to `undefined`**\n\t * when no board is configured for the\n\t * requested period type — guard against it.\n\t *\n\t * @example\n\t * ```ts\n\t * import { LeaderBoardPeriodType } from '@smartico/public-api';\n\t *\n\t * const board = await window._smartico.api.getLeaderBoard(LeaderBoardPeriodType.WEEKLY);\n\t *\n\t * if (!board) {\n\t * console.log('[smartico] no weekly board configured for this label — hide the leaderboard surface');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] render leaderboard tab —', board.name, '—', board.users.length, 'ranked entries (top 20 max)');\n\t *\n\t * // Render prize table.\n\t * for (const reward of board.rewards) {\n\t * console.log('[smartico] prize row — place', reward.place, '→', reward.points, 'points');\n\t * }\n\t *\n\t * // \"Me\" panel — sticky row showing the current user's rank.\n\t * if (board.me) {\n\t * if (board.me.position === -1) {\n\t * console.log('[smartico] user is unranked — show \"You are unranked, earn points to enter the leaderboard\"');\n\t * } else if (board.me.position > 20) {\n\t * console.log('[smartico] user is ranked', board.me.position, 'but outside the visible top-20 — show sticky \"me\" row with', board.me.points, 'points');\n\t * } else {\n\t * console.log('[smartico] user is in the top 20 at position', board.me.position, '— highlight their row in the main list');\n\t * }\n\t * }\n\t *\n\t * // Switch to previous period view — cached separately from the current period.\n\t * const prev = await window._smartico.api.getLeaderBoard(LeaderBoardPeriodType.WEEKLY, true);\n\t * console.log('[smartico] previous-week standings — render with greyed-out \"ended\" treatment:', prev?.users.length, 'finalists');\n\t *\n\t * // Visitor-mode equivalent — me is always undefined.\n\t * // const visitorBoard = await window._smartico.vapi('EN').getLeaderBoard(LeaderBoardPeriodType.DAILY);\n\t * ```\n\t */\n\tpublic async getLeaderBoard(periodType: LeaderBoardPeriodType, getPreviousPeriod?: boolean | number): Promise<LeaderBoardDetailsT> {\n\t\t// Resolve the snapshot offset: false/omitted → 0 (current), true → 1\n\t\t// (previous), or an explicit number for older snapshots.\n\t\tconst offset = typeof getPreviousPeriod === 'number' ? getPreviousPeriod : getPreviousPeriod ? 1 : 0;\n\t\t// Cache per (periodType, offset) so switching tabs or period within the\n\t\t// TTL doesn't return a colliding board.\n\t\tconst cacheKey = `${onUpdateContextKey.LeaderBoards}:${periodType}:${offset}`;\n\t\treturn OCache.use(\n\t\t\tcacheKey,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.leaderboardsGetT(this.userExtId, periodType, offset),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the list of leaderboards the operator has configured for this\n\t * label — **metadata only, without participants**. Use it to discover\n\t * which boards exist (and their period types) so you can render the\n\t * board/tab selector, then load a specific board's standings on demand\n\t * with {@link getLeaderBoard}.\n\t *\n\t * This is the lightweight discovery counterpart to {@link getLeaderBoard}:\n\t * it issues one round-trip that returns every board's identity, name,\n\t * description, rules, `period_type_id`, and prize table, but **not** the\n\t * ranked players. Fetching the full standings for one board (the top-20\n\t * `users[]` and the caller's own `me` entry) is what {@link getLeaderBoard}\n\t * does per period.\n\t *\n\t * @remarks\n\t * **Returned shape**\n\t * An array of `LeaderBoardDetailsT`, one per configured board, ordered by\n\t * `period_type_id` ascending (DAILY, WEEKLY, MONTHLY, …). On every entry\n\t * `users` is an empty array and `me` is `undefined` — this call never\n\t * carries participant data. Read `period_type_id` from each entry and pass\n\t * it to {@link getLeaderBoard} to load that board's standings.\n\t *\n\t * **Empty result**\n\t * Resolves to an empty array when the label has no leaderboards configured\n\t * — treat that as \"hide the leaderboard surface\".\n\t *\n\t * **Cache TTL**\n\t * Cached for 30 seconds under a dedicated key (independent of\n\t * {@link getLeaderBoard}'s per-period cache). Repeated calls within the\n\t * window return the cached list without a round-trip.\n\t *\n\t * **Refresh model**: one-shot fetch — no subscription, no push. Board\n\t * configuration changes surface on the next cache miss.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **Visitor mode**: supported. Returns the brand's public board list.\n\t *\n\t * @returns Promise resolving to the array of configured boards\n\t * (metadata only). Empty array when none are configured.\n\t *\n\t * @example\n\t * ```ts\n\t * const boards = await window._smartico.api.getLeaderBoards();\n\t *\n\t * if (boards.length === 0) {\n\t * console.log('[smartico] no leaderboards configured — hide the leaderboard surface');\n\t * return;\n\t * }\n\t *\n\t * // Render one tab per board from the lightweight list (no players yet).\n\t * console.log('[smartico] render leaderboard tabs:', boards.map(b => b.name));\n\t *\n\t * // When the user opens a tab, load that board's standings on demand.\n\t * const first = boards[0];\n\t * const full = await window._smartico.api.getLeaderBoard(first.period_type_id);\n\t * console.log('[smartico] loaded standings for', first.name, '—', full?.users.length ?? 0, 'players');\n\t * ```\n\t */\n\tpublic async getLeaderBoards(): Promise<LeaderBoardDetailsT[]> {\n\t\treturn OCache.use(\n\t\t\t`${onUpdateContextKey.LeaderBoards}:list`,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.leaderboardsGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n}\n","import { ActivityTypeLimited } from '../Core';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tInboxMarkMessageAction,\n\tTInboxMessage,\n\tTInboxMessageBody,\n} from './WSAPITypes';\nimport { InboxCategories } from '../Inbox/InboxCategories';\nimport { InboxReadStatus } from '../Inbox/InboxReadStatus';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPILeaderBoard } from './WSAPILeaderBoard';\n\n/** @group Inbox */\nexport class WSAPIInbox extends WSAPILeaderBoard {\n\t/**\n\t * Records that an engagement (inbox message, popup) was displayed to\n\t * the user. Use this to drive engagement analytics — every visible\n\t * inbox message should fire one impression event per render\n\t * occurrence, and every popup display should fire one.\n\t *\n\t * **Fire-and-forget**: the call is asynchronous and one-way — there\n\t * is no response promise to await and no error reporting. The SDK\n\t * swallows transport failures silently. Returns `void`.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - Inbox: when a message becomes visible (the user opens / scrolls\n\t * it into view). The default Smartico UI fires this when the\n\t * message detail expands, alongside\n\t * {@link markInboxMessageAsRead}.\n\t * - Popup: when the popup content is shown to the user.\n\t *\n\t * **Activity types**\n\t * Pass {@link ActivityTypeLimited.Inbox} (`31`) for inbox messages,\n\t * {@link ActivityTypeLimited.Popup} (`30`) for popups. Other values\n\t * are not used by the engagement-impression channel.\n\t *\n\t * **Idempotency**: the server records every impression event —\n\t * repeated calls add to the impression count. Don't fire it on\n\t * every re-render; fire it once per logical \"display\" event\n\t * (modal open, list-row scroll-into-view, popup show).\n\t *\n\t * **Side effects**: server-side increments the engagement's\n\t * `impression_count` and updates `last_impression_date`. The\n\t * counter is observable via operator analytics; the SDK consumer\n\t * receives no signal back.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @example\n\t * ```ts\n\t * // When the user opens an inbox message in the detail view.\n\t * window._smartico.api.reportImpressionEvent({\n\t * engagement_uid: message.message_guid,\n\t * activityType: 31, // ActivityTypeLimited.Inbox\n\t * });\n\t * console.log('[smartico] inbox impression reported for', message.message_guid, '— no response to await, fire-and-forget');\n\t * ```\n\t */\n\tpublic reportImpressionEvent({\n\t\tengagement_uid,\n\t\tactivityType,\n\t}: {\n\t\t/** For inbox: the message's `message_guid` from `getInboxMessages`. For popups: the popup's GUID from the popup display callback. */\n\t\tengagement_uid: string;\n\t\t/** `ActivityTypeLimited.Inbox` (`31`) for inbox; `Popup` (`30`) for popups. */\n\t\tactivityType: ActivityTypeLimited | number;\n\t}): void {\n\t\tthis.api.reportEngagementImpression(this.userExtId, engagement_uid, activityType);\n\t}\n\n\t/**\n\t * Records that the user interacted with an engagement — typically\n\t * tapping a CTA button, following a deep-link, or clicking a popup\n\t * action. Use this to drive engagement analytics on what users\n\t * actually act on (vs what they merely see —\n\t * {@link reportImpressionEvent}).\n\t *\n\t * **Fire-and-forget**: the call is asynchronous and one-way — there\n\t * is no response promise to await and no error reporting. The SDK\n\t * swallows transport failures silently. Returns `void`.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - Inbox: when the user taps a CTA button on a message or follows\n\t * a deep-link inside the message body. Pass the deep-link or URL\n\t * as `action`.\n\t * - Popup: when the user clicks a popup action button.\n\t *\n\t * **Activity types**\n\t * Pass {@link ActivityTypeLimited.Inbox} (`31`) for inbox,\n\t * {@link ActivityTypeLimited.Popup} (`30`) for popups.\n\t *\n\t * **`action` payload**\n\t * Pass the deep-link or URL that the user triggered (e.g.\n\t * `'dp:gf_missions'`, `'https://example.com/promo'`). The SDK\n\t * forwards the string to the server for analytics — it does not\n\t * execute the deep-link. To execute deep-links safely, call\n\t * `_smartico.dp(action)` separately.\n\t *\n\t * **Idempotency**: the server records every click event —\n\t * repeated calls add to the count. Fire once per logical user\n\t * action.\n\t *\n\t * **Side effects**: server-side updates the engagement's\n\t * `last_action` field; observable via operator analytics. The SDK\n\t * consumer receives no signal back.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @example\n\t * ```ts\n\t * // When the user taps a CTA button in an inbox message.\n\t * window._smartico.api.reportClickEvent({\n\t * engagement_uid: message.message_guid,\n\t * activityType: 31, // ActivityTypeLimited.Inbox\n\t * action: 'dp:gf_missions',\n\t * });\n\t * window._smartico.dp('dp:gf_missions'); // separately execute the deep-link\n\t * ```\n\t */\n\tpublic reportClickEvent({\n\t\tengagement_uid,\n\t\tactivityType,\n\t\taction,\n\t}: {\n\t\t/** For inbox: the message's `message_guid` from `getInboxMessages`. */\n\t\tengagement_uid: string;\n\t\t/** `ActivityTypeLimited.Inbox` (`31`) for inbox; `Popup` (`30`) for popups. */\n\t\tactivityType: ActivityTypeLimited | number;\n\t\t/** The deep-link / URL the user triggered (optional but recommended for analytics fidelity). */\n\t\taction?: string;\n\t}): void {\n\t\tthis.api.reportEngagementAction(this.userExtId, engagement_uid, activityType, action);\n\t}\n\n\t/**\n\t * Returns the user's inbox messages — newest first — with optional\n\t * filtering by category, favorite status, and read state. Each\n\t * `TInboxMessage` is a lightweight envelope (`message_guid`,\n\t * `sent_date`, `read`, `favorite`, `category_id`, `expire_on_dt`);\n\t * fetch the rich body (title, preview, icon, html_body, buttons)\n\t * separately via {@link getInboxMessageBody}.\n\t *\n\t * Use this to power an inbox list screen. Subscribe via `onUpdate`\n\t * to react to newly-arrived messages pushed by the server (from\n\t * campaigns, automation rules, manual operator sends).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed message list (never a\n\t * diff/patch). Each subsequent call to `getInboxMessages({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires ONLY when:\n\t *\n\t * 1. A new message is pushed by the server (campaign / automation /\n\t * operator send). The refreshed list includes the new message\n\t * at the top.\n\t *\n\t * Does NOT fire for: `markInboxMessageAsRead`,\n\t * `markAllInboxMessagesAsRead`,\n\t * `markUnmarkInboxMessageAsFavorite`, `deleteInboxMessage`,\n\t * `deleteAllInboxMessages`. After a mutation, re-call\n\t * `getInboxMessages` manually if your UI needs the refreshed list\n\t * — or maintain optimistic state locally.\n\t *\n\t * **Pagination**\n\t * `from` (defaults to `0`) and `to` (defaults to `20`) define a\n\t * half-open range of message indices. The server caps the page at\n\t * **20 messages per request** — passing `to - from > 20` silently\n\t * truncates to 20. For \"load more\" pagination, advance `from` by\n\t * the prior page size on each subsequent call.\n\t *\n\t * **Filters**\n\t * All filters are ANDed server-side. Omitting a filter means \"no\n\t * constraint\" on that dimension:\n\t * - `categoryId` ({@link InboxCategories}): `General` (0),\n\t * `Platform` (1), `Personal` (2). Omit to get all categories.\n\t * - `onlyFavorite: true` returns only starred messages.\n\t * Omit / `false` returns all (starred and not).\n\t * - `read_status` ({@link InboxReadStatus}): `UnreadOnly` (1) or\n\t * `ReadOnly` (2). Omit to get both.\n\t *\n\t * **Server-side filtering** (always applied)\n\t * Expired messages (`expire_on_dt` in the past) and\n\t * soft-deleted messages are excluded server-side. Consumers do not\n\t * need to filter for these.\n\t *\n\t * **No client cache**: every call sends a fresh server round-trip.\n\t * To avoid redundant fetches in your UI, hold the result in\n\t * application state and re-fetch on `onUpdate` fires or explicit\n\t * user-driven refresh.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getInboxMessages`](../../docs/ui/inbox/UIGuide_getInboxMessages.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional filters + subscription.\n\t * @param params.from First message index (0-based). Defaults\n\t * to `0`.\n\t * @param params.to Last message index (exclusive).\n\t * Defaults to `20`. Server caps the page\n\t * at 20.\n\t * @param params.onlyFavorite When `true`, returns only favorite\n\t * (starred) messages.\n\t * @param params.categoryId When set, returns only messages in this\n\t * category ({@link InboxCategories}).\n\t * @param params.read_status When set, scopes to read or unread\n\t * only ({@link InboxReadStatus}).\n\t * @param params.onUpdate Callback invoked with the full\n\t * refreshed list when a new message\n\t * arrives.\n\t *\n\t * @returns Promise resolving to up to 20 `TInboxMessage` envelopes.\n\t * Empty array when the user has no messages matching the\n\t * filter.\n\t *\n\t * @example\n\t * ```ts\n\t * const messages = await window._smartico.api.getInboxMessages({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] new inbox message arrived — re-render the list from this array, new message is at index 0:', refreshed);\n\t * },\n\t * });\n\t *\n\t * // For each message, fetch its body for the list view (title, preview, icon).\n\t * for (const msg of messages) {\n\t * const body = await window._smartico.api.getInboxMessageBody(msg.message_guid);\n\t * console.log('[smartico] render message', msg.message_guid,\n\t * '— title:', body.title,\n\t * '— preview:', body.preview_body,\n\t * '— read:', msg.read,\n\t * '— favorite:', msg.favorite);\n\t * }\n\t *\n\t * // \"Load more\" pagination — advance from by the prior page size.\n\t * const page2 = await window._smartico.api.getInboxMessages({ from: 20, to: 40 });\n\t * console.log('[smartico] page 2:', page2.length, 'messages');\n\t *\n\t * // Filter examples.\n\t * const onlyStarred = await window._smartico.api.getInboxMessages({ onlyFavorite: true });\n\t * const onlyUnread = await window._smartico.api.getInboxMessages({ read_status: 1 }); // InboxReadStatus.UnreadOnly\n\t * ```\n\t */\n\tpublic async getInboxMessages({\n\t\tfrom,\n\t\tto,\n\t\tonlyFavorite,\n\t\tcategoryId,\n\t\tread_status,\n\t\tonUpdate,\n\t}: {\n\t\tfrom?: number;\n\t\tto?: number;\n\t\tonlyFavorite?: boolean;\n\t\tcategoryId?: InboxCategories;\n\t\tread_status?: InboxReadStatus;\n\t\tonUpdate?: (data: TInboxMessage[]) => void;\n\t} = {}): Promise<TInboxMessage[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.InboxMessages, onUpdate);\n\t\t}\n\t\treturn await this.api.getInboxMessagesT(this.userExtId, from, to, onlyFavorite, categoryId, read_status);\n\t}\n\n\t/**\n\t * Returns the user's current unread inbox message count — a single\n\t * integer suitable for driving a header badge. Optionally subscribe\n\t * to live updates via `onUpdate`.\n\t *\n\t * For most UIs, prefer `core_inbox_unread_count` from\n\t * {@link getUserProfile} instead: it carries the same value, is\n\t * push-updated in real time via the user-properties channel, and\n\t * doesn't require a separate cache. This method is useful when you\n\t * want a dedicated subscription tied to the inbox surface rather\n\t * than the broader user-properties channel.\n\t *\n\t * @remarks\n\t * **Subscription model**\n\t * `onUpdate` fires whenever the cached value changes — either on a\n\t * push from the user-properties channel (new message arrival,\n\t * mark-as-read, delete) or after an inbox-list fetch that returns\n\t * a fresh count.\n\t *\n\t * **Cache TTL**: 30 seconds. The cached value is patched in place\n\t * by push events (no full re-fetch on every push), so the\n\t * `onUpdate` callback reflects server state with sub-second latency\n\t * regardless of the TTL.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional subscription bag.\n\t * @param params.onUpdate Callback invoked with the new unread\n\t * count whenever it changes (push-driven).\n\t * @returns Promise resolving to the current unread\n\t * count (integer, includes `0`).\n\t *\n\t * @example\n\t * ```ts\n\t * // Static read for an initial badge render.\n\t * const count = await window._smartico.api.getInboxUnreadCount();\n\t * console.log('[smartico] inbox badge initial count:', count);\n\t *\n\t * // Live subscription for badge updates.\n\t * await window._smartico.api.getInboxUnreadCount({\n\t * onUpdate: (newCount) => {\n\t * console.log('[smartico] inbox count changed — update the badge to:', newCount,\n\t * '— hide badge entirely when 0, show raw integer otherwise (no \"99+\" cap in the default UI)');\n\t * },\n\t * });\n\t * ```\n\t */\n\tpublic async getInboxUnreadCount({ onUpdate }: { onUpdate?: (unread_count: number) => void } = {}): Promise<number> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.InboxUnreadCount, onUpdate);\n\t\t}\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.InboxUnreadCount,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getInboxUnreadCountT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the rich body of a single inbox message — title, preview\n\t * text, icon, click action, optional rich HTML body, and optional\n\t * buttons. Call this after fetching the envelope list via\n\t * {@link getInboxMessages} to render either a list-item preview or\n\t * a full detail view.\n\t *\n\t * The message body is served from a CDN — not over the WebSocket —\n\t * so latency depends on CDN proximity rather than WS round-trip\n\t * time. There is NO client-side cache; every call is a fresh\n\t * HTTP fetch. Browser HTTP caching applies (Cache-Control headers\n\t * from the CDN), but the SDK does not memoize the result.\n\t *\n\t * @remarks\n\t * **Rich vs simple messages**\n\t * The shape of the returned body branches on the `action` field:\n\t * - When `action === 'dp:inbox'`, the message has a rich HTML body\n\t * (`html_body`) and may have up to 2 action `buttons`. Use these\n\t * for a full-detail rendering.\n\t * - For any other `action` (deep-link like `'dp:deposit'` or a URL),\n\t * the message is a simple notification — `html_body` and\n\t * `buttons` will be `undefined` regardless of what's in the\n\t * underlying CDN payload. Render `title` + `preview_body` + a\n\t * single CTA driving the `action`.\n\t *\n\t * **The `action` field**\n\t * For both shapes, `action` carries either a deep-link\n\t * (`'dp:gf_missions'`) or a plain URL. Pass it to `_smartico.dp()`\n\t * for safe execution — that helper handles URL vs deep-link\n\t * routing.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only HTTP fetch.\n\t *\n\t * **UI guidance**: see [UI Guide — `getInboxMessageBody`](../../docs/ui/inbox/UIGuide_getInboxMessageBody.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid The `message_guid` from a `TInboxMessage`\n\t * returned by {@link getInboxMessages}.\n\t * @returns Promise resolving to `TInboxMessageBody`.\n\t *\n\t * @example\n\t * ```ts\n\t * const body = await window._smartico.api.getInboxMessageBody(messageGuid);\n\t *\n\t * console.log('[smartico] render message — title:', body.title,\n\t * '— preview:', body.preview_body,\n\t * '— icon:', body.icon);\n\t *\n\t * if (body.action === 'dp:inbox' && body.html_body) {\n\t * console.log('[smartico] rich message — render the html_body in a sandboxed iframe; render up to 2 action buttons:',\n\t * body.buttons?.length ?? 0);\n\t * } else {\n\t * console.log('[smartico] simple message — show preview_body + single CTA wired to:', body.action,\n\t * '— execute via _smartico.dp(body.action)');\n\t * }\n\t * ```\n\t */\n\tpublic async getInboxMessageBody(messageGuid: string): Promise<TInboxMessageBody> {\n\t\treturn await this.api.getInboxMessageBodyT(messageGuid);\n\t}\n\n\t/**\n\t * Marks a single inbox message as read. Server-side this flips the\n\t * message's `is_read` flag and decrements the user's unread count\n\t * (the change propagates back via the user-properties channel —\n\t * subscribers to {@link getInboxUnreadCount}'s `onUpdate` and\n\t * {@link getUserProfile}'s `core_inbox_unread_count` see it within\n\t * ~1 second).\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message is now marked read. Idempotent — a\n\t * second call on the same `messageGuid` also returns `0`.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages} (no\n\t * `onUpdate` callback fires after this mutation). The unread-count\n\t * channel ({@link getInboxUnreadCount}, `core_inbox_unread_count`)\n\t * DOES auto-update — subscribers to it see the new count\n\t * automatically. If your inbox list UI shows the `read` field, you\n\t * have two options: re-call `getInboxMessages` after the mutation,\n\t * or update the local copy optimistically.\n\t *\n\t * **Idempotency**: safe. Repeated calls return `err_code === 0`.\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_read` flag set to true.\n\t * - Server-side `core_inbox_unread_count` decremented (if the\n\t * message was previously unread).\n\t *\n\t * **UI guidance**: see [UI Guide — `markInboxMessageAsRead`](../../docs/ui/inbox/UIGuide_markInboxMessageAsRead.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid The `message_guid` from a `TInboxMessage`.\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.markInboxMessageAsRead(message.message_guid);\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] marked as read — optimistically flip the local read indicator; the inbox badge auto-decrements via the user-properties channel');\n\t * } else {\n\t * console.error('[smartico] mark-as-read failed — keep the local state as-is and show a non-blocking error if appropriate:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markInboxMessageAsRead(messageGuid: string): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markInboxMessageRead(this.userExtId, messageGuid);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Marks ALL of the user's inbox messages as read in one server\n\t * round-trip — typically wired to a \"Mark all as read\" CTA in the\n\t * inbox header.\n\t *\n\t * The operation is global to the user — NOT filtered by the\n\t * current view (active category tab, favorite filter, etc.). Every\n\t * unread message in the user's inbox flips to read.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; all currently-unread messages flipped to read.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Race condition note**: a new message arriving server-side\n\t * between the call and its processing remains unread (the\n\t * server's mark-all operation is a snapshot in time). Subsequent\n\t * `getInboxMessages` calls show the new message as unread.\n\t *\n\t * **Refresh after success**\n\t * Same as {@link markInboxMessageAsRead} — `getInboxMessages`\n\t * `onUpdate` does NOT fire automatically, but the unread-count\n\t * channel does (the badge will drop to 0, or to the count of any\n\t * new messages that arrived during processing).\n\t *\n\t * **Idempotency**: safe. A second call on an already-all-read\n\t * inbox returns `err_code === 0` with no-op effect.\n\t *\n\t * **Side effects** (on success)\n\t * - Every unread message flipped to read.\n\t * - `core_inbox_unread_count` drops to 0 (or near 0 if races).\n\t *\n\t * **UI guidance**: included in the\n\t * [UI Guide — `markInboxMessageAsRead`](../../docs/ui/inbox/UIGuide_markInboxMessageAsRead.md)\n\t * (Bulk variant section).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * console.log('[smartico] mark-all-read starting — set in-flight flag on the \"Mark all read\" button, show loading dots');\n\t * const r = await window._smartico.api.markAllInboxMessagesAsRead();\n\t * console.log('[smartico] mark-all-read response — clear in-flight flag');\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] all messages marked read — optimistically flip every local read indicator; badge auto-drops via user-properties channel');\n\t * } else {\n\t * console.error('[smartico] mark-all failed — surface a non-blocking error:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markAllInboxMessagesAsRead(): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markAllInboxMessageRead(this.userExtId);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Toggles a message's favorite (starred) state — pass `mark: true`\n\t * to favorite, `mark: false` to unfavorite. Use to power a star\n\t * icon click handler on the inbox list.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message's favorite state flipped to the\n\t * requested value.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages}. To\n\t * reflect the new state in the UI, update the local copy of the\n\t * affected `TInboxMessage` (set `favorite` to the new value) or\n\t * re-call `getInboxMessages`.\n\t *\n\t * **Idempotency**: safe. `mark: true` on an already-favorite\n\t * message returns `err_code === 0` (no-op). Same for `mark: false`\n\t * on a non-favorite.\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_starred` flag set to the requested value.\n\t * - No effect on read state, unread count, or other fields.\n\t *\n\t * **UI guidance**: see [UI Guide — `markUnmarkInboxMessageAsFavorite`](../../docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid The `message_guid` from a `TInboxMessage`.\n\t * @param mark `true` to favorite, `false` to unfavorite.\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // Toggle handler — flip the local state optimistically, then\n\t * // call the server, and revert if the call fails.\n\t * const target = !message.favorite;\n\t * console.log('[smartico] optimistically flip the star to', target, '— it will revert if the server rejects');\n\t *\n\t * const r = await window._smartico.api.markUnmarkInboxMessageAsFavorite(\n\t * message.message_guid,\n\t * target,\n\t * );\n\t *\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] favorite toggled — keep the local state and show a brief \"Added to favorites\" / \"Removed from favorites\" toast');\n\t * } else {\n\t * console.error('[smartico] favorite toggle failed — revert the local state and show an error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markUnmarkInboxMessageAsFavorite(messageGuid: string, mark: boolean): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markUnmarkInboxMessageAsFavorite(this.userExtId, messageGuid, mark);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Soft-deletes a single inbox message. After deletion, the message\n\t * is excluded from future {@link getInboxMessages} responses\n\t * server-side, but its row is retained for analytics — there is no\n\t * \"undelete\" path via the SDK.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message is now deleted from the user's\n\t * view.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages}. Drop the\n\t * deleted message from your local list, or re-call\n\t * `getInboxMessages` to reload. If the deleted message was unread,\n\t * the unread count drops automatically via the user-properties\n\t * channel.\n\t *\n\t * **Idempotency**: safe. A second call on an already-deleted\n\t * `messageGuid` returns `err_code === 0` (server treats it as a\n\t * no-op — already-deleted messages are filtered out).\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_deleted` flag set to true.\n\t * - If the message was unread, `core_inbox_unread_count`\n\t * decrements via the user-properties channel.\n\t *\n\t * **UI guidance**: see [UI Guide — `deleteInboxMessage`](../../docs/ui/inbox/UIGuide_deleteInboxMessage.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid The `message_guid` from a `TInboxMessage`.\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // Swipe-to-delete on mobile; trash-icon click on desktop.\n\t * console.log('[smartico] delete starting — animate the row out of the list (slide left/right by 100%)');\n\t * const r = await window._smartico.api.deleteInboxMessage(message.message_guid);\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] deleted — drop the message from the local list, fire a brief \"Message deleted\" toast (no undo affordance — there is no undelete via the SDK)');\n\t * } else {\n\t * console.error('[smartico] delete failed — animate the row back into place and show a non-blocking error:', r.err_message);\n\t * }\n\t * ```\n\t */\n\n\tpublic async deleteInboxMessage(messageGuid: string): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.deleteInboxMessage(this.userExtId, messageGuid);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Soft-deletes ALL of the user's inbox messages in one server\n\t * round-trip — typically wired to a \"Delete all\" CTA in the inbox\n\t * header (usually behind a confirm dialog given the destructive\n\t * nature).\n\t *\n\t * The operation is global to the user — NOT filtered by the\n\t * current view (active category tab, favorite filter, etc.). Every\n\t * non-deleted message in the user's inbox flips to deleted.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the entire inbox is now empty from the user's\n\t * view.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Race condition note**: a new message arriving server-side\n\t * between the call and its processing is NOT deleted (the\n\t * server's delete-all operation is a snapshot in time). Subsequent\n\t * `getInboxMessages` calls show the new message.\n\t *\n\t * **Refresh after success**\n\t * Same as {@link deleteInboxMessage} — `getInboxMessages` `onUpdate`\n\t * does not fire automatically. Replace the local list with `[]`\n\t * (or re-call `getInboxMessages`). The unread count drops to 0\n\t * (or near-0 if races) via the user-properties channel.\n\t *\n\t * **Idempotency**: safe. A second call on an already-empty inbox\n\t * returns `err_code === 0` with no-op effect.\n\t *\n\t * **Side effects** (on success)\n\t * - Every message flipped to deleted server-side.\n\t * - `core_inbox_unread_count` drops to 0.\n\t * - There is no SDK undelete path — recovery requires operator\n\t * intervention.\n\t *\n\t * **UI guidance**: included in the\n\t * [UI Guide — `deleteInboxMessage`](../../docs/ui/inbox/UIGuide_deleteInboxMessage.md)\n\t * (Bulk variant section).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // After a confirm dialog \"Are you sure you want to delete all messages?\"\n\t * console.log('[smartico] delete-all confirmed — show loading state on the \"Delete all\" button');\n\t * const r = await window._smartico.api.deleteAllInboxMessages();\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] inbox cleared — replace the local list with [], fire a \"All messages deleted\" toast, badge auto-drops to 0');\n\t * } else {\n\t * console.error('[smartico] delete-all failed — show a non-blocking error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\n\tpublic async deleteAllInboxMessages(): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.deleteAllInboxMessages(this.userExtId);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\tprotected async updateInboxUnreadCount(count: number) {\n\t\tthis.updateEntity(onUpdateContextKey.InboxUnreadCount, count);\n\t}\n\n\tprotected async updateInboxMessages() {\n\t\tconst payload = await this.api.getInboxMessagesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.InboxMessages, payload);\n\t}\n}\n","import { ClassId } from '../Base/ClassId';\nimport { SAWSpinsCountPush } from '../MiniGames';\nimport { ECacheContext, OCache } from '../OCache';\nimport { SmarticoAPI } from '../SmarticoAPI';\nimport { JackpotWinPush, JackpotsOptinResponse, JackpotsOptoutRequest } from '../Jackpots';\nimport { onUpdateContextKey } from './WSAPIBase';\nimport { WSAPIInbox } from './WSAPIInbox';\nimport { TUserProfile } from './WSAPITypes';\n\n/**\n * Public surface of the Smartico WebSocket API. The consumer reaches every\n * method on this class via `_smartico.api.X(...)`. The class is the\n * terminator of an inheritance chain that splits the surface into focused\n * domain classes (see `WSAPIBase` → `WSAPIUser` → ... → `WSAPIInbox` →\n * `WSAPI`); each domain class hosts its own subset of methods. Consumers\n * don't need to know about the chain — every method is reachable directly\n * on the `WSAPI` instance via prototype-chain lookup.\n *\n * @group General API\n */\nexport class WSAPI extends WSAPIInbox {\n\t/** @private */\n\tconstructor(api: SmarticoAPI, userExtId: string = null) {\n\t\tsuper(api, userExtId);\n\n\t\t// Push-subscription wiring. This block must live in the terminator\n\t\t// because it references `update*` helpers defined across multiple\n\t\t// domain classes; only the terminator has visibility into all of\n\t\t// them via the prototype chain.\n\t\tif (this.api.tracker) {\n\t\t\tconst on = this.api.tracker.on;\n\n\t\t\ton(ClassId.SAW_SPINS_COUNT_PUSH, (data: SAWSpinsCountPush) => this.updateOnSpin(data));\n\t\t\ton(ClassId.SAW_SHOW_SPIN_PUSH, () => this.reloadMiniGameTemplate());\n\t\t\ton(ClassId.SAW_AKNOWLEDGE_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.SAW_DO_SPIN_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.MISSION_OPTIN_RESPONSE, () => this.updateMissions());\n\t\t\ton(ClassId.ACHIEVEMENT_CLAIM_PRIZE_RESPONSE, () => this.updateMissions());\n\t\t\ton(ClassId.RELOAD_ACHIEVEMENTS_EVENT, () => this.updateMissions());\n\t\t\ton(ClassId.TOURNAMENT_REGISTER_RESPONSE, () => this.updateTournaments());\n\t\t\ton(ClassId.BUY_SHOP_ITEM_RESPONSE, () => {\n\t\t\t\tthis.updateStorePurchasedItems();\n\t\t\t\tthis.updateStoreItems();\n\t\t\t});\n\t\t\ton(ClassId.CLIENT_ENGAGEMENT_EVENT_NEW, () => this.updateInboxMessages());\n\t\t\ton(ClassId.LOGOUT_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));\n\t\t\ton(ClassId.IDENTIFY_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));\n\t\t\ton(ClassId.JP_WIN_PUSH, (_data: JackpotWinPush) => this.jackpotClearCache());\n\t\t\ton(ClassId.JP_OPTOUT_RESPONSE, (_data: JackpotsOptoutRequest) => this.jackpotClearCache());\n\t\t\ton(ClassId.JP_OPTIN_RESPONSE, (_data: JackpotsOptinResponse) => this.jackpotClearCache());\n\t\t\ton(ClassId.CLAIM_BONUS_RESPONSE, () => this.updateBonuses());\n\t\t\ton(ClassId.SAW_DO_SPIN_BATCH_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.RAF_CLAIM_PRIZE_RESPONSE, () => this.updateRaffles());\n\t\t\ton(ClassId.GET_INBOX_MESSAGES_RESPONSE, (res) => {\n\t\t\t\tif (res.unread_count !== undefined && res.unread_count !== null) {\n\t\t\t\t\tthis.updateInboxUnreadCount(res.unread_count);\n\t\t\t\t}\n\t\t\t});\n\t\t\ton(ClassId.CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT, (data: { props: TUserProfile }) => {\n\t\t\t\tif (data?.props?.core_inbox_unread_count !== undefined && data?.props?.core_inbox_unread_count !== null) {\n\t\t\t\t\tthis.updateInboxUnreadCount(data.props.core_inbox_unread_count);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tdata?.props?.ach_points_balance !== undefined ||\n\t\t\t\t\t\tdata?.props?.ach_gems_balance !== undefined ||\n\t\t\t\t\t\tdata?.props?.ach_diamonds_balance !== undefined\n\t\t\t\t\t) && this.onUpdateCallback.get(onUpdateContextKey.ActivityLog)) {\n\t\t\t\t\tthis.notifyActivityLogUpdate();\n\t\t\t\t}\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.CurrentLevel);\n\t\t\t});\n\t\t\ton(ClassId.RAF_OPTIN_RESPONSE, () => this.updateRaffles());\n\t\t}\n\t}\n}\n","export enum AchCustomSectionType {\n\tHTML_PAGE = 1,\n\tMISSIONS_CATEGORY = 2,\n\tTOURNAMENTS_CATEGORY = 3,\n\tLEVELS = 4,\n\tMINI_GAMES = 5,\n\tMISSION_CUSTOM_LAYOUT = 6,\n\tMATCH_X_AND_QUIZ = 7,\n\tREDIRECT_LINK = 9,\n\tLOOTBOX_WEEKLY = 10,\n\tLOOTBOX_CALENDAR_DAYS = 11,\n\tSTORE = 12,\n\tRAFFLE = 13,\n\tBADGES = 14,\n}\n\nexport enum AchCustomLayoutTheme {\n\tVALENTINES_LIGHT = 'valentines-light',\n\tVALENTINES_DARK = 'valentines-dark',\n\tEURO_2024 = 'euro-2024',\n\tGENERIC = 'generic',\n}\n\nexport enum AchMissionsTabsOptions {\n\tONLY_OVERVIEW = 1,\n\tNO_OVERVIEW = 2,\n\tALL = 3,\n}\n\nexport enum AchOverviewMissionsFilter {\n\tANY = 1,\n\tALL_MISSIONS = 2,\n\tALL_EXCEPT_COMPLETED = 3,\n\tALL_EXCEPT_LOCKED = 4,\n\tALL_EXCEPT_COMPLETED_AND_LOCKED = 5,\n}\n\nexport enum LiquidEntityData {\n\tMissions = 1,\n\tStore = 2,\n\tTournaments = 3,\n\tMiniGames = 4,\n\tLevels = 5,\n\tJackpots = 6,\n\tBonus = 7,\n\tLeaderboard = 8,\n\tBadges = 9,\n\tTournament = 10,\n\tRaffles = 11,\n\tSingleRaffle = 12,\n\tClans = 13,\n}","import { TUICustomSection } from '../WSAPI/WSAPITypes';\nimport {\n\tAchCustomLayoutTheme,\n\tAchCustomSectionType,\n\tAchMissionsTabsOptions,\n\tAchOverviewMissionsFilter,\n\tLiquidEntityData,\n} from './AchCustomSection';\nimport { GetCustomSectionsResponse } from './GetCustomSectionsResponse';\n\nexport interface UICustomSection {\n\tbody?: string;\n\tmenu_img?: string;\n\tmenu_name?: string;\n\tcustom_skin_images?: string;\n\tsection_type_id?: AchCustomSectionType;\n\ttheme?: AchCustomLayoutTheme;\n\tgeneric_custom_css?: string;\n\tmission_tabs_options?: AchMissionsTabsOptions;\n\toverview_missions_filter?: AchOverviewMissionsFilter;\n\toverview_missions_count?: number;\n\turl_or_dp?: string;\n\tliquid_entity_data?: LiquidEntityData[];\n\tach_tournament_id?: number;\n\traffle_id?: number;\n\tshow_raw_data?: boolean;\n\tliquid_template?: number;\n\tach_category_ids?: number[];\n\tshop_category_ids?: number[];\n}\n\nexport const UICustomSectionTransform = (response: GetCustomSectionsResponse): TUICustomSection[] => {\n\n\tconst items: TUICustomSection[] = [];\n\n\tObject.keys(response.customSections || []).forEach((key: string) => {\n\t\tconst r = response.customSections[key];\n\t\tconst id = parseInt(key);\n\t\tif (r.section_type_id !== undefined && r.section_type_id >= 1) {\n\t\t\tconst x: TUICustomSection = {\n\t\t\t\tid: id,\n\t\t\t\tbody: r.body,\n\t\t\t\tmenu_img: r.menu_img,\n\t\t\t\tmenu_name: r.menu_name,\n\t\t\t\tsection_type_id: r.section_type_id,\n\t\t\t\tcustom_skin_images: r.custom_skin_images,\n\t\t\t\tgeneric_custom_css: r.generic_custom_css,\n\t\t\t\tmission_tabs_options: r.mission_tabs_options,\n\t\t\t\toverview_missions_count: r.overview_missions_count,\n\t\t\t\toverview_missions_filter: r.overview_missions_filter,\n\t\t\t\turl_or_dp: r.url_or_dp,\n\t\t\t\ttheme: r.theme,\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.LEVELS\n\t\t\t\t\t? {\n\t\t\t\t\t\tliquid_entity_data: r.liquid_entity_data,\n\t\t\t\t\t\tach_tournament_id: r.ach_tournament_id,\n\t\t\t\t\t\traffle_id: r.raffle_id,\n\t\t\t\t\t\tshow_raw_data: r.show_raw_data,\n\t\t\t\t\t\tliquid_template: r.liquid_template,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.BADGES\n\t\t\t\t\t? {\n\t\t\t\t\t\tach_category_ids: r.ach_category_ids,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.STORE\n\t\t\t\t\t? {\n\t\t\t\t\t\tshop_category_ids: r.shop_category_ids,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t};\n\n\t\t\titems.push(x);\n\t\t}\n\t});\n\n\treturn items;\n};\n","import { BonusStatus } from './BonusStatus';\nimport { BonusTemplateMetaMap } from './BonusTemplateMetaMap';\nimport { BonusMetaMap } from './BonusMetaMap';\nimport { TBonus } from '../WSAPI/WSAPITypes';\n\nexport interface Bonus {\n\tid: number;\n\tredeemable?: boolean;\n\tcreateDate?: string;\n\tupdateDate?: string;\n\tredeemDate?: string;\n\tengagementUid?: string;\n\tlabelBonusTemplateId?: number;\n\tsourceProductRefId?: number;\n\tsourceProductId?: number;\n\tuserId?: number;\n\tbonusStatusId?: BonusStatus;\n\tlabelBonusTemplateMetaMap?: BonusTemplateMetaMap;\n\tbonusMetaMap?: BonusMetaMap;\n}\n\nexport const BonusItemsTransform = (items: Bonus[]): TBonus[] => {\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TBonus = {\n\n bonus_id: r.id,\n is_redeemable: r.redeemable,\n create_date: r.createDate,\n redeem_date: r.redeemDate,\n label_bonus_template_id: r.labelBonusTemplateId,\n bonus_status_id: r.bonusStatusId,\n label_bonus_template_meta_map: r.labelBonusTemplateMetaMap,\n bonus_meta_map: r.bonusMetaMap\n\t\t\t};\n\n\t\t\treturn x;\n\t\t});\n};","export enum BonusStatus {\n\tNew = 1,\n\tCOUPON_ISSUED = 2,\n\tREDEEMED = 3,\n\tREDEEM_FAILED = 4, \n\tCOUPON_ISSUE_FAILED = 5, \n\tEXPIRED = 6, \n}","export enum UserBalanceType {\n Points = 0,\n Gems = 1,\n Diamonds = 2\n}\n\n\n","import { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { ActivityLogEntry } from './ActivityLogEntry';\nimport { TActivityLog } from '../WSAPI/WSAPITypes';\nimport { UserBalanceType } from './UserBalanceType';\n\nexport interface GetActivityLogResponse extends ProtocolResponse {\n\tlogHistory: ActivityLogEntry[];\n}\n\nexport const ActivityLogTransform = (items: ActivityLogEntry[]): TActivityLog[] => {\n\tif (!items) {\n\t\treturn [];\n\t}\n\n\treturn items.map((item: any): TActivityLog => {\n\t\tconst itemTransformed: Partial<TActivityLog> = {\n\t\t\tcreate_date: item.create_date,\n\t\t\tuser_ext_id: item.user_ext_id,\n\t\t\tcrm_brand_id: item.crm_brand_id,\n\t\t\tsource_type_id: item.source_type_id,\n\t\t}\n\n\t\titem.type = item.type ?? UserBalanceType.Points;\n\n\t\tif (item.type === UserBalanceType.Diamonds || item.type === UserBalanceType.Gems) {\n\t\t\titemTransformed.type = item.type;\n\t\t\titemTransformed.amount = item.amount;\n\t\t\titemTransformed.balance = item.balance;\n\t\t}\n\n\t\tif (item.type === UserBalanceType.Points) {\n\t\t\titemTransformed.type = UserBalanceType.Points;\n\t\t\titemTransformed.amount = item.points_collected;\n\t\t\titemTransformed.balance = item.user_points_balance;\n\t\t\titemTransformed.total_ever = item.user_points_ever;\n\t\t}\n\n\t\treturn itemTransformed as TActivityLog;\n\t});\n};\n\n\n","export enum PointChangeSourceType {\n\tJourney = 1,\n\tAchievementTaskCompletion = 2,\n\tAchievementCompletion = 3,\n\tLevelsStructureChange = 4,\n\tStorePurchase = 5,\n\tManualAdjustment = 6,\n\tLeaderboard = 7,\n\tTournament = 11,\n\tAutomationRule = 12,\n\tTournamentRegistration = 13,\n\tTournamentRegistrationCancellation = 14,\n\tRefundPoints = 15,\n\tPlayMiniGame = 16,\n\tWinMiniGame = 17,\n\tAPI = 18,\n\tDynamicFormula = 19,\n\tRaffle = 21,\n\tAvatars = 22,\n}\n\n\n","import { TAvatarDefinition } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarDefinition } from './AvatarDefinition';\n\nexport interface GetAvatarsListResponse extends ProtocolResponse {\n\tavatars: AvatarDefinition[];\n}\n\nexport const avatarDefinitionTransform = (items: AvatarDefinition[], avatarDomain: string): TAvatarDefinition[] => {\n\treturn items.map((item) => ({\n\t\tavatar_real_id: item.avatar_real_id,\n\t\tis_default: item.is_default,\n\t\thide_until_achieved: item.hide_until_achieved,\n\t\tpriority: item.priority,\n\t\tdescription: item.public_meta.description,\n\t\turl: item.public_meta.url,\n\t\tavatar_url: item.public_meta.url && !item.public_meta.url.startsWith('http') ? `${avatarDomain}${item.public_meta.url}` : item.public_meta.url,\n\t\tavatar_source_type_id: item.avatar_source_type_id,\n\t\tactive_from_date: item.active_from_date,\n\t\tactive_till_date: item.active_till_date,\n\t\tis_given: item.is_given,\n\t\tis_in_use: item.is_in_use,\n\t}));\n};\n","import { TAvatarCustomized } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarCustomized } from './AvatarCustomized';\n\nexport interface GetAvatarsCustomizedResponse extends ProtocolResponse {\n\tavatars: AvatarCustomized[];\n}\n\nexport const avatarCustomizedTransform = (items: AvatarCustomized[], avatarDomain: string): TAvatarCustomized[] => {\n\treturn items.map((item) => ({\n\t\tavatar_real_id: item.avatar_real_id,\n\t\turl: item.url && !item.url.startsWith('http') ? `${avatarDomain}${item.url}` : item.url,\n\t\tdt_created: item.dt_created,\n\t}));\n};\n","import { TAvatarPrompt } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarPrompt } from './AvatarPrompt';\n\nexport interface GetAvatarPromptsResponse extends ProtocolResponse {\n\tprompts: AvatarPrompt[];\n}\n\nexport const avatarPromptTransform = (items: AvatarPrompt[], avatarDomain: string): TAvatarPrompt[] => {\n\treturn items.map((item) => ({\n\t\tprompt_id: item.prompt_id,\n\t\tname: item.public_meta.name,\n\t\ticon_url: item.public_meta.icon_url && !item.public_meta.icon_url.startsWith('http') ? `${avatarDomain}${item.public_meta.icon_url}` : item.public_meta.icon_url,\n\t\tcost_currency_type_id: item.cost_currency_type_id,\n\t\tcost_value: item.cost_value,\n\t}));\n};\n","import { ProtocolResponse } from \"../Base/ProtocolResponse\";\nimport { JackPotWinner } from \"./JackPotWinner\";\n\nexport interface GetJackpotWinnersResponse extends ProtocolResponse {\n\t/** The list of jackpot winners */\n\twinners: JackpotWinnerHistory[];\n\t/** Whether there are more winners to fetch */\n\thas_more: boolean;\n}\n\nexport interface JackpotWinnerHistory {\n\t/** Id of the jackpot pot */\n\tjp_pot_id: number;\n\t/** Date of winning in milliseconds */\n\twin_date_ts: number;\n\t/** Info about jackpot winner */\n\twinner: JackPotWinner;\n}\n\n/**\n * @ignore\n */\nexport const GetJackpotWinnersResponseTransform = (items: JackpotWinnerHistory[]): JackpotWinnerHistory[] => {\n\treturn items.map((item) => {\n\t\tconst winnerInfo: JackpotWinnerHistory = {\n\t\t\twinner: item.winner,\n\t\t\twin_date_ts: item.win_date_ts,\n\t\t\tjp_pot_id: item.jp_pot_id,\n\t\t};\n\n\t\treturn winnerInfo;\n\t});\n};\n","import { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AchRelatedGame } from '../Base/AchRelatedGame';\n\nexport interface GetJackpotEligibleGamesResponse extends ProtocolResponse {\n\teligible_games: AchRelatedGame[];\n}\n\nexport interface TGetJackpotEligibleGamesResponse {\n\teligible_games: JackpotEligibleGame[];\n}\n\nexport interface JackpotEligibleGame {\n /** ID of the game on Smartico side */\n\tgame_id: number;\n /** ID of the game on operator side */\n ext_game_id: string;\n /** Name of the game */\n name: string;\n /** Link to the game */\n link: string;\n /** Image of the game */\n image: string;\n /** Whether the game is enabled */\n enabled: boolean;\n /** Categories of the game */\n game_categories: string[];\n /** Provider of the game */\n game_provider: string;\n /** The link to the mobile game */\n mobile_spec_link: string;\n /** The priority of the game */\n priority: number;\n}\n\n/**\n * @ignore\n */\nexport const GetJackpotEligibleGamesResponseTransform = ({ eligible_games } : { eligible_games: AchRelatedGame[]}): TGetJackpotEligibleGamesResponse => {\n\tconst games = eligible_games.map((game: AchRelatedGame, i: number) => ({\n\t\tgame_id: game.ach_game_id,\n\t\text_game_id: game.ext_game_id,\n\t\tname: game.game_public_meta.name,\n\t\tlink: game.game_public_meta.link,\n\t\timage: game.game_public_meta.image,\n\t\tenabled: game.game_public_meta.enabled,\n\t\tgame_categories: game.game_public_meta.game_categories,\n\t\tgame_provider: game.game_public_meta.game_provider,\n\t\tmobile_spec_link: game.game_public_meta.mobile_spec_link,\n\t\tpriority: i + 1,\n\t}));\n\n\treturn { eligible_games: games };\n};\n","import { ClassId } from './Base/ClassId';\nimport { ProtocolRequest } from './Base/ProtocolRequest';\nimport { ProtocolResponse } from './Base/ProtocolResponse';\nimport { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';\nimport { SAWGetTemplatesRequest } from './MiniGames/SAWGetTemplatesRequest';\nimport { IntUtils } from './IntUtils';\nimport { ILogger } from './ILogger';\nimport {\n\tSAWDoAknowledgeRequest,\n\tSAWDoAknowledgeResponse,\n\tSAWDoSpinRequest,\n\tSAWDoSpinResponse,\n\tSAWHistoryTransform,\n\tSAWPrizesHistory,\n\tSAWSpinErrorCode,\n\tSAWTemplatesTransform,\n\tSAWWinningHistoryRequest,\n\tSAWWinningHistoryResponse,\n} from './MiniGames';\nimport { ECacheContext, OCache } from './OCache';\nimport {\n\tActivityTypeLimited,\n\tCoreUtils,\n\tGetTranslationsRequest,\n\tGetTranslationsResponse,\n\tPublicLabelSettings,\n\tResponseIdentify,\n\tTranslationArea,\n} from './Core';\nimport { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';\nimport { GetLabelInfoRequest } from './Core/GetLabelInfoRequest';\nimport {\n\tGetInboxMessagesRequest,\n\tGetInboxMessagesResponse,\n\tInboxMessageBody,\n\tInboxMessageBodyTransform,\n\tInboxMessagesTransform,\n\tInboxReadStatus,\n\tMarkInboxMessageDeletedRequest,\n\tMarkInboxMessageDeletedResponse,\n\tMarkInboxMessageReadRequest,\n\tMarkInboxMessageReadResponse,\n\tMarkInboxMessageStarredRequest,\n\tMarkInboxMessageStarredResponse,\n} from './Inbox';\nimport {\n\tBuyStoreItemRequest,\n\tBuyStoreItemResponse,\n\tGetCategoriesStoreResponse,\n\tGetStoreHistoryRequest,\n\tGetStoreHistoryResponse,\n\tGetStoreItemsResponse,\n\tStoreCategoryTransform,\n\tStoreItemPurchasedTransform,\n\tStoreItemTransform,\n} from './Store';\nimport {\n\tAchCategoryTransform,\n\tAchClaimPrizeRequest,\n\tAchClaimPrizeResponse,\n\tAchievementOptinRequest,\n\tAchievementOptinResponse,\n\tAchievementType,\n\tGetAchCategoriesResponse,\n\tGetAchievementMapRequest,\n\tGetAchievementMapResponse,\n\tUserAchievementTransform,\n\tenrichUserAchievementsWithBadgeState,\n} from './Missions';\nimport {\n\tGetClanTournamentPlayersRequest,\n\tGetClanTournamentPlayersResponse,\n\tGetTournamentInfoRequest,\n\tGetTournamentInfoResponse,\n\tGetTournamentsRequest,\n\tGetTournamentsResponse,\n\tTournamentItemsTransform,\n\tTournamentRegisterRequest,\n\tTournamentRegisterResponse,\n\tclanTournamentPlayersTransform,\n\ttournamentInfoItemTransform,\n} from './Tournaments';\nimport { GetLeaderBoardsRequest, GetLeaderBoardsResponse, LeaderBoardDetails, LeaderBoardPeriodType } from './Leaderboard';\nimport { GetLevelMapResponse, GetLevelMapResponseTransform } from './Level';\nimport { WSAPI } from './WSAPI/WSAPI';\nimport {\n\tTInboxMessage,\n\tTInboxMessageBody,\n\tTLevel,\n\tTMiniGameTemplate,\n\tTMissionOrBadge,\n\tTStoreCategory,\n\tTAchCategory,\n\tTStoreItem,\n\tTTournament,\n\tTTournamentDetailed,\n\tLeaderBoardDetailsT,\n\tUserLevelExtraCountersT,\n\tTSegmentCheckResult,\n\tTUICustomSection,\n\tTBonus,\n\tTRaffle,\n\tTLevelCurrent,\n\tTActivityLog,\n\tTRaffleDraw,\n\tTAvatarDefinition,\n\tTAvatarCustomized,\n\tTAvatarPrompt,\n\tTClans,\n\tTClanInfo,\n\tTClanJoinResult,\n\tTClanTournamentPlayers,\n} from './WSAPI/WSAPITypes';\nimport { getLeaderBoardTransform } from './Leaderboard/LeaderBoards';\nimport { GetAchievementsUserInfoResponse } from './Core/GetAchievementsUserInfoResponse';\nimport { CheckSegmentMatchResponse } from './Core/CheckSegmentMatchResponse';\nimport { CheckSegmentMatchRequest } from './Core/CheckSegmentMatchRequest';\nimport {\n\tGetJackpotsPotsRequest,\n\tGetJackpotsPotsResponse,\n\tGetJackpotsRequest,\n\tGetJackpotsResponse,\n\tJackpotsOptinRequest,\n\tJackpotsOptinResponse,\n\tJackpotsOptoutRequest,\n\tJackpotsOptoutResponse,\n} from './Jackpots';\nimport { GetCustomSectionsRequest, GetCustomSectionsResponse, UICustomSectionTransform } from './CustomSections';\nimport { BonusItemsTransform, ClaimBonusRequest, ClaimBonusResponse, GetBonusesResponse } from './Bonuses';\nimport { GetBonusesRequest } from './Bonuses/GetBonusesRequest';\nimport { SAWDoSpinBatchResponse } from './MiniGames/SAWDoSpinBatchResponse';\nimport { SAWDoSpinBatchRequest } from './MiniGames/SAWDoSpinBatchRequest';\nimport { SAWDoAcknowledgeBatchRequest } from './MiniGames/SAWDoAcknowledgeBatchRequest';\nimport { SAWDoAcknowledgeBatchResponse } from './MiniGames/SAWDoAcknowledgeBatchResponse';\nimport { GetRelatedAchTourRequest } from './Missions/GetRelatedAchTourRequest';\nimport { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse';\nimport { GetRafflesResponse, raffleTransform } from './Raffle/GetRafflesResponse';\nimport { GetRafflesRequest } from './Raffle/GetRafflesRequest';\nimport { GetActivityLogRequest, GetActivityLogResponse, ActivityLogTransform } from './ActivityLog';\nimport { GetClanListRequest, GetClanListResponse, GetClanInfoRequest, GetClanInfoResponse, JoinClanRequest, JoinClanResponse } from './Clans';\nimport { InboxCategories } from './Inbox/InboxCategories';\nimport { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse, RaffleClaimPrizeRequest, RaffleClaimPrizeResponse, RaffleOptinRequest, RaffleOptinResponse, drawRunTransform, GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse } from './Raffle';\nimport { GetAvatarsListResponse, avatarDefinitionTransform } from './Avatars/GetAvatarsListResponse';\nimport { GetAvatarsCustomizedResponse, avatarCustomizedTransform } from './Avatars/GetAvatarsCustomizedResponse';\nimport { GetAvatarPromptsResponse, avatarPromptTransform } from './Avatars/GetAvatarPromptsResponse';\nimport { SetAvatarRequest, SetAvatarResponse } from './Avatars';\nimport { AvatarCustomizeResponse } from './Avatars/AvatarCustomizeResponse';\nimport { GetJackpotWinnersResponse, GetJackpotWinnersResponseTransform, JackpotWinnerHistory } from './Jackpots/GetJackpotWinnersResponse';\nimport { GetJackpotWinnersRequest } from './Jackpots/GetJackpotWinnersRequest';\nimport { GetJackpotEligibleGamesRequest } from './Jackpots/GetJackpotEligibleGamesRequest';\nimport { GetJackpotEligibleGamesResponse, GetJackpotEligibleGamesResponseTransform, JackpotEligibleGame, TGetJackpotEligibleGamesResponse } from './Jackpots/GetJackpotEligibleGamesResponse';\nimport { GamePickGameInfo, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamesApiResponse } from './GamePick';\n\nconst PUBLIC_API_URL = 'https://papi{ENV_ID}.smartico.ai/services/public';\nconst C_SOCKET_PROD = 'wss://api{ENV_ID}.smartico.ai/websocket/services';\nconst GAMES_API_URL = 'https://r-games-api.smr.vc';\nconst AVATAR_DOMAIN = 'https://img{ENV_ID}.smr.vc';\nconst DEFAULT_LANG_EN = 'EN';\n\nconst SMR_TO_CLOUDFRONT_DOMAINS: { [key: string]: string } = {\n\t'img.smr.vc': 'd1am61onjxtys8.cloudfront.net',\n\t'img3.smr.vc': 'd3dubbodzd2q05.cloudfront.net',\n\t'img4.smr.vc': 'dvm0p9vsezqr2.cloudfront.net',\n\t'img5.smr.vc': 'd3gen1ksvxhac8.cloudfront.net',\n\t'img6.smr.vc': 'db1kmyg7iufeo.cloudfront.net',\n\t'img7.smr.vc': 'd36om2g86xefo6.cloudfront.net',\n\t'img8.smr.vc': 'd2zme31v54n5pb.cloudfront.net',\n\n\t'static.smr.vc': 'dtt380pweilws.cloudfront.net',\n\t'static3.smr.vc': 'd1qt8ake8g4imn.cloudfront.net',\n\t'static4.smr.vc': 'd146b4m7rkvjkw.cloudfront.net',\n\t'static5.smr.vc': 'd3l7suk1kl9rwh.cloudfront.net',\n\t'static6.smr.vc': 'd121pfj16xdfcq.cloudfront.net',\n\t'static7.smr.vc': 'd21deilz814qgl.cloudfront.net',\n\t'static8.smr.vc': 'd1uffsroxjy2ku.cloudfront.net',\n};\n\n// Single combined matcher built once, so a call is one pass instead of one per domain.\nconst SMR_DOMAIN_REGEX = new RegExp(\n\tObject.keys(SMR_TO_CLOUDFRONT_DOMAINS)\n\t\t.map((d) => d.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n\t\t.join('|'),\n\t'g',\n);\n\ninterface Tracker {\n\tlabel_api_key: string;\n\tuserPublicProps: any;\n\tparams?: { brand_key?: string };\n\ton: (callBackKey: ClassId, func: (data: any) => void) => void;\n\tgetLabelSetting: (key: PublicLabelSettings) => any;\n\ttriggerExternalCallBack: (callBackKey: string, payload: any) => void;\n\tgetExtUserId: () => string;\n}\ninterface IOptions {\n\tlogger?: ILogger;\n\tlogCIDs?: ClassId[];\n\tlogHTTPTiming?: boolean;\n\ttracker?: Tracker;\n\tbrand_api_key?: string;\n}\n\ntype MessageSender = (message: any, publicApuUrl?: string, expectCID?: ClassId) => Promise<any>;\n\nclass SmarticoAPI {\n\tprivate publicUrl: string;\n\tprivate wsUrl: string;\n\tprivate inboxCdnUrl: string;\n\tprivate partnerUrl: string;\n\tprivate gamesApiUrl: string;\n\tprivate baseRgApiParams: Record<string, string>;\n\tpublic avatarDomain: string;\n\tprivate avatarOriginDomain: string;\n\tprivate envId: number;\n\n\tprivate logger: ILogger;\n\tprivate logCIDs: ClassId[];\n\tprivate logHTTPTiming: boolean;\n\tpublic tracker?: Tracker;\n\n\tpublic constructor(\n\t\tprivate label_api_key: string,\n\t\tprivate brand_api_key: string,\n\t\tprivate messageSender: MessageSender,\n\t\toptions: IOptions = {},\n\t) {\n\t\tthis.logger = options.logger || (console as any);\n\n\t\tif (this.logger.always === undefined) {\n\t\t\tthis.logger.always = this.logger.info;\n\t\t}\n\n\t\tthis.logCIDs = options.logCIDs || [];\n\t\tthis.logHTTPTiming = options.logHTTPTiming || false;\n\t\tthis.tracker = options.tracker;\n\n\t\tthis.publicUrl = SmarticoAPI.getPublicUrl(label_api_key);\n\t\tthis.wsUrl = SmarticoAPI.getPublicWsUrl(label_api_key);\n\n\t\tif (this.tracker) {\n\t\t\t// available only for real users\n\t\t\tthis.baseRgApiParams = {\n\t\t\t\tenv_id: String(SmarticoAPI.getEnvId(label_api_key)),\n\t\t\t\tlabel_api_key: label_api_key,\n\t\t\t\tbrand_key: options.brand_api_key || this.tracker.params.brand_key,\n\t\t\t\thash: IntUtils.uuid(),\n\t\t\t}\n\t\t}\n\n\t\tthis.avatarDomain = SmarticoAPI.getAvatarUrl(label_api_key || options.tracker?.label_api_key);\n\t\tthis.avatarOriginDomain = SmarticoAPI.getAvatarOriginUrl(label_api_key || options.tracker?.label_api_key);\n\n\t\tthis.label_api_key = SmarticoAPI.getCleanLabelApiKey(label_api_key);\n\t}\n\n\tpublic static getEnvDnsSuffix(label_api_key: string): string {\n\t\tlet ENV_ID = label_api_key.length === 38 ? label_api_key.substring(37, 38) : '';\n\n\t\tif (ENV_ID === '1' || ENV_ID === '2') {\n\t\t\tENV_ID = '';\n\t\t}\n\t\treturn ENV_ID;\n\t}\n\n\tpublic static replaceSmrDomainsWithCloudfront<T>(value: string | { [key: string]: any }): T {\n\t\tif (!value) {\n\t\t\treturn value as T;\n\t\t}\n\n\t\tconst isString = typeof value === 'string';\n\t\tconst source = isString ? (value as string) : JSON.stringify(value);\n\t\tif (!source.includes('smr.vc')) return value as T; // ← skip even the regex\n\n\t\tconst replaced = source.replace(SMR_DOMAIN_REGEX, (match) => SMR_TO_CLOUDFRONT_DOMAINS[match]);\n\n\t\t// No domain matched: skip the JSON re-parse and return the input untouched.\n\t\tif (replaced === source) {\n\t\t\treturn value as T;\n\t\t}\n\n\t\tif (isString) {\n\t\t\treturn replaced as T;\n\t\t}\n\n\t\ttry {\n\t\t\treturn JSON.parse(replaced);\n\t\t} catch (err) {\n\t\t\treturn value as T;\n\t\t}\n\t}\n\n\tpublic static getEnvId(label_api_key: string): number {\n\t\treturn label_api_key.length === 38 ? parseInt(label_api_key.substring(37, 38), 10) : 2;\n\t}\n\n\tpublic static getCleanLabelApiKey(label_api_key: string): string {\n\t\treturn label_api_key.substring(0, 36);\n\t}\n\n\tpublic static getPublicUrl(label_api_key: string): string {\n\t\treturn PUBLIC_API_URL.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tpublic static getPublicWsUrl(label_api_key: string): string {\n\t\treturn C_SOCKET_PROD.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tpublic static getAvatarUrl(label_api_key: string): string {\n\t\tconst avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);\n\t}\n\n\tpublic static getAvatarOriginUrl(label_api_key: string): string {\n\t\treturn AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tprivate async send<T>(message: any, expectCID?: ClassId, force_language?: string): Promise<T> {\n\t\tif (this.logCIDs.includes(message.cid)) {\n\t\t\tthis.logger.info('REQ', message);\n\t\t}\n\n\t\tif (force_language) {\n\t\t\tmessage.force_language = force_language;\n\t\t}\n\n\t\tlet result: any;\n\n\t\ttry {\n\t\t\tconst timeStart = new Date().getTime();\n\t\t\tresult = await this.messageSender(message, this.publicUrl, expectCID);\n\n\t\t\tif (result.errCode && result.errSetup) {\n\t\t\t\tthrow new Error(result.errMessage);\n\t\t\t}\n\n\t\t\tresult = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);\n\t\t\tconst timeEnd = new Date().getTime();\n\n\t\t\tif (this.logHTTPTiming) {\n\t\t\t\tthis.logger.always('HTTP time, ms:' + (timeEnd - timeStart));\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(`Failed to make request to smartico channel, L2. ${e.message}`, {\n\t\t\t\turl: this.publicUrl,\n\t\t\t\trequest: message,\n\t\t\t\terror: e.message,\n\t\t\t});\n\t\t\tthrow new Error(`Failed to make request to smartico channel, L2 L1. ${e.message}`);\n\t\t}\n\n\t\tif (this.logCIDs.includes(message.cid)) {\n\t\t\tthis.logger.info('RES', result);\n\t\t}\n\n\t\tif (expectCID) {\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tfor (const str of result as string[]) {\n\t\t\t\t\tconst obj: ProtocolResponse = JSON.parse(str);\n\t\t\t\t\tif (this.logCIDs.includes(obj.cid)) {\n\t\t\t\t\t\tthis.logger.info('RES', result);\n\t\t\t\t\t}\n\t\t\t\t\tif (obj.cid === expectCID) {\n\t\t\t\t\t\treturn obj as any;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.logger.error(`Cant find proper response in array, expected CID ${expectCID}`, {\n\t\t\t\t\trequest: message,\n\t\t\t\t\tresponse: result,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} else {\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tif (result.length === 1) {\n\t\t\t\t\tconst obj = JSON.parse(result[0]);\n\t\t\t\t\tif (this.logCIDs.includes(obj.cid)) {\n\t\t\t\t\t\tthis.logger.info('RES', result);\n\t\t\t\t\t}\n\t\t\t\t\treturn obj;\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.error('Expected one response, but got array', { request: message, response: result });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tprivate buildMessage<TRequest, TResponse>(user_ext_id: string, cid: ClassId, payload: Partial<TRequest> = {}): TResponse {\n\t\tconst message: ProtocolRequest = {\n\t\t\t// AA: in fact we need api and brand keys and ext_user_id only in the context of HTTP\n\t\t\t// its not needed in WebSocket and can be deleted\n\t\t\tapi_key: this.label_api_key,\n\t\t\tbrand_key: this.brand_api_key,\n\t\t\text_user_id: user_ext_id,\n\t\t\tcid,\n\t\t\tuuid: IntUtils.uuid(),\n\t\t\tts: new Date().getTime(),\n\t\t\t...payload,\n\t\t};\n\n\t\tif (message.ext_user_id === undefined || message.ext_user_id === null) {\n\t\t\tdelete message.ext_user_id;\n\t\t}\n\n\t\tif (message.brand_key === undefined || message.brand_key === null) {\n\t\t\tdelete message.brand_key;\n\t\t}\n\n\t\treturn message as any;\n\t}\n\n\tpublic async coreReportCustomEvent(user_ext_id: string, eventType: string, payload: any = {}): Promise<any> {\n\t\tconst eventMessage = this.buildMessage<any, any>(user_ext_id, ClassId.EVENT, {\n\t\t\teventType,\n\t\t\tpayload,\n\t\t});\n\n\t\tconst eventResponse = await this.send<any>(eventMessage, ClassId.EVENT_RESPONSE);\n\t\treturn eventResponse;\n\t}\n\n\tpublic async coreGetTranslations(\n\t\tuser_ext_id: string,\n\t\tlang_code: string,\n\t\tareas: TranslationArea[],\n\t\tcacheSec: number = 60,\n\t): Promise<GetTranslationsResponse> {\n\t\tif (lang_code === undefined || lang_code === null || (lang_code.trim && lang_code.trim() === '')) {\n\t\t\tlang_code = DEFAULT_LANG_EN;\n\t\t}\n\n\t\tconst response = await OCache.use<GetTranslationsResponse>(\n\t\t\t`${lang_code}-${this.label_api_key}-${this.brand_api_key}`,\n\t\t\tECacheContext.Translations,\n\t\t\tasync () => {\n\t\t\t\tconst tsBaseRQ = this.buildMessage<GetTranslationsRequest, GetTranslationsResponse>(\n\t\t\t\t\tuser_ext_id,\n\t\t\t\t\tClassId.GET_TRANSLATIONS_REQUEST,\n\t\t\t\t\t{\n\t\t\t\t\t\tlang_code: DEFAULT_LANG_EN,\n\t\t\t\t\t\thash_code: null,\n\t\t\t\t\t\tareas,\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tconst trBase = await this.send<GetTranslationsResponse>(tsBaseRQ, ClassId.GET_TRANSLATIONS_RESPONSE);\n\n\t\t\t\tif (lang_code !== DEFAULT_LANG_EN) {\n\t\t\t\t\tconst trUserRQ = this.buildMessage<GetTranslationsRequest, GetTranslationsResponse>(\n\t\t\t\t\t\tuser_ext_id,\n\t\t\t\t\t\tClassId.GET_TRANSLATIONS_REQUEST,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlang_code,\n\t\t\t\t\t\t\thash_code: null,\n\t\t\t\t\t\t\tareas,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\tconst trUser = await this.send<GetTranslationsResponse>(trUserRQ, ClassId.GET_TRANSLATIONS_RESPONSE);\n\n\t\t\t\t\tObject.keys(trUser?.translations ?? {}).forEach((k) => {\n\t\t\t\t\t\ttrBase.translations[k] = trUser.translations[k];\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn trBase;\n\t\t\t},\n\t\t\tcacheSec,\n\t\t);\n\n\t\treturn response;\n\t}\n\n\tpublic async coreIdentifyLabel(user_ext_id: string, cacheSec: number = 60): Promise<GetLabelInfoResponse> {\n\t\treturn OCache.use<GetLabelInfoResponse>(\n\t\t\t`${this.label_api_key} - ${this.brand_api_key}`,\n\t\t\tECacheContext.LabelInfo,\n\t\t\tasync () => {\n\t\t\t\tconst message = this.buildMessage<GetLabelInfoRequest, GetLabelInfoResponse>(user_ext_id, ClassId.INIT);\n\n\t\t\t\treturn this.send<GetLabelInfoResponse>(message, ClassId.INIT_RESPONSE);\n\t\t\t},\n\t\t\tcacheSec,\n\t\t);\n\t}\n\n\tpublic async coreIdentifyUser(user_ext_id: string): Promise<ResponseIdentify> {\n\t\tconst message = this.buildMessage<any, ResponseIdentify>(user_ext_id, ClassId.IDENTIFY, {\n\t\t\trequest_id: IntUtils.uuid(), // AA: do we need request_id?\n\t\t});\n\n\t\tconst r = await this.send<ResponseIdentify>(message, ClassId.IDENTIFY_RESPONSE);\n\n\t\tr.avatar_id = CoreUtils.avatarUrl(r.avatar_id, this.avatarDomain);\n\n\t\treturn r;\n\t}\n\n\tpublic async coreChangeUsername(\n\t\tuser_ext_id: string,\n\t\tpublic_username_custom: string,\n\t): Promise<{ public_username_custom: string }> {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_SET_CUSTOM_USERNAME_REQUEST, {\n\t\t\tpublic_username_custom,\n\t\t});\n\n\t\treturn await this.send(message, ClassId.CLIENT_SET_CUSTOM_USERNAME_RESPONSE);\n\t}\n\n\tpublic async coreCheckSegments(user_ext_id: string, segment_id: number[]): Promise<TSegmentCheckResult[]> {\n\t\tconst message = this.buildMessage<CheckSegmentMatchRequest, any>(user_ext_id, ClassId.CHECK_SEGMENT_MATCH_REQUEST, {\n\t\t\tsegment_id,\n\t\t});\n\n\t\tconst results = await this.send<CheckSegmentMatchResponse>(message, ClassId.CHECK_SEGMENT_MATCH_RESPONSE);\n\n\t\treturn results.segments || [];\n\t}\n\n\t/**\n\t * Reports an engagement impression event (when engagement content is displayed to the user).\n\t */\n\tpublic reportEngagementImpression(\n\t\tuser_ext_id: string,\n\t\tengagement_uid: string,\n\t\tactivityType: ActivityTypeLimited | number,\n\t): void {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_ENGAGEMENT_IMPRESSION_REQUEST, {\n\t\t\tengagement_uid,\n\t\t\tactivityType,\n\t\t});\n\n\t\tthis.send(message).catch(() => { });\n\t}\n\n\t/**\n\t * Reports an engagement action event (when user clicks/interacts with engagement content).\n\t */\n\tpublic reportEngagementAction(\n\t\tuser_ext_id: string,\n\t\tengagement_uid: string,\n\t\tactivityType: ActivityTypeLimited | number,\n\t\taction?: string,\n\t): void {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_ENGAGEMENT_ACTION_REQUEST, {\n\t\t\tengagement_uid,\n\t\t\tactivityType,\n\t\t\t...(action && { action }),\n\t\t});\n\n\t\tthis.send(message).catch(() => { });\n\t}\n\n\tpublic async jackpotGet(\n\t\tuser_ext_id: string,\n\t\tfilter?: { related_game_id?: string; jp_template_id?: number },\n\t\tforce_language?: string,\n\t): Promise<GetJackpotsResponse> {\n\t\tconst message = this.buildMessage<GetJackpotsRequest, GetJackpotsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_JACKPOTS_REQUEST,\n\t\t\tfilter,\n\t\t);\n\t\treturn await this.send<GetJackpotsResponse>(message, ClassId.JP_GET_JACKPOTS_RESPONSE, force_language);\n\t}\n\n\tpublic async potGet(user_ext_id: string, filter: { jp_template_ids: number[] }): Promise<GetJackpotsPotsResponse> {\n\t\tconst message = this.buildMessage<GetJackpotsPotsRequest, GetJackpotsPotsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_LATEST_POTS_REQUEST,\n\t\t\tfilter,\n\t\t);\n\t\treturn await this.send<GetJackpotsPotsResponse>(message, ClassId.JP_GET_LATEST_POTS_RESPONSE);\n\t}\n\n\tpublic async jackpotOptIn(user_ext_id: string, payload: { jp_template_id: number }): Promise<JackpotsOptinResponse> {\n\t\tconst message = this.buildMessage<JackpotsOptinRequest, JackpotsOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_OPTIN_REQUEST,\n\t\t\tpayload,\n\t\t);\n\t\treturn await this.send<JackpotsOptinResponse>(message, ClassId.JP_OPTIN_RESPONSE);\n\t}\n\n\tpublic async jackpotOptOut(user_ext_id: string, payload: { jp_template_id: number }): Promise<JackpotsOptoutResponse> {\n\t\tconst message = this.buildMessage<JackpotsOptoutRequest, JackpotsOptoutResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_OPTOUT_REQUEST,\n\t\t\tpayload,\n\t\t);\n\t\treturn await this.send<JackpotsOptoutResponse>(message, ClassId.JP_OPTOUT_RESPONSE);\n\t}\n\n\tpublic async getJackpotWinners(user_ext_id: string, limit: number = 20, offset: number = 0, jp_template_id: number): Promise<GetJackpotWinnersResponse> {\n\t\tconst message = this.buildMessage<GetJackpotWinnersRequest, GetJackpotWinnersResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_WINNERS_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t\tjp_template_id,\n\t\t\t},\n\t\t);\n\t\treturn await this.send<GetJackpotWinnersResponse>(message, ClassId.JP_GET_WINNERS_RESPONSE);\n\t}\n\n\tpublic async getJackpotWinnersT(user_ext_id: string, limit: number = 20, offset: number = 0, jp_template_id: number): Promise<JackpotWinnerHistory[]> {\n\t\treturn GetJackpotWinnersResponseTransform((await this.getJackpotWinners(user_ext_id, limit, offset, jp_template_id)).winners);\n\t}\n\n\tpublic async getJackpotEligibleGames(user_ext_id: string, { jp_template_id }: { jp_template_id: number }): Promise<GetJackpotEligibleGamesResponse> {\n\t\tconst message = this.buildMessage<GetJackpotEligibleGamesRequest, GetJackpotEligibleGamesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_ELIGIBLE_GAMES_REQUEST,\n\t\t\t{ jp_template_id },\n\t\t);\n\n\t\treturn await this.send<GetJackpotEligibleGamesResponse>(message, ClassId.JP_GET_ELIGIBLE_GAMES_RESPONSE);\n\t}\n\n\tpublic async getJackpotEligibleGamesT(user_ext_id: string, { jp_template_id }: { jp_template_id: number }): Promise<TGetJackpotEligibleGamesResponse> {\n\t\treturn GetJackpotEligibleGamesResponseTransform(await this.getJackpotEligibleGames(user_ext_id, { jp_template_id }));\n\t}\n\n\tpublic async sawGetTemplates(\n\t\tuser_ext_id: string,\n\t\tforce_language?: string,\n\t\tis_visitor_mode: boolean = false,\n\t): Promise<SAWGetTemplatesResponse> {\n\t\tconst message = this.buildMessage<SAWGetTemplatesRequest, SAWGetTemplatesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_GET_SPINS_REQUEST,\n\t\t\t{ is_visitor_mode },\n\t\t);\n\n\t\tconst response = await this.send<SAWGetTemplatesResponse>(message, ClassId.SAW_GET_SPINS_RESPONSE, force_language);\n\n\t\tif (response && response.templates) {\n\t\t\tresponse.templates.forEach((t) => {\n\t\t\t\tif (t.jackpot_current !== undefined && t.jackpot_current !== null) {\n\t\t\t\t\tconst jackpotValue =\n\t\t\t\t\t\tt.jackpot_current +\n\t\t\t\t\t\t(t.saw_template_ui_definition?.jackpot_symbol ? ' ' + t.saw_template_ui_definition?.jackpot_symbol : '');\n\t\t\t\t\tt.saw_template_ui_definition.name = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.name,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.saw_template_ui_definition.description = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.description,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.saw_template_ui_definition.promo_text = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.promo_text,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.prizes.forEach((p) => {\n\t\t\t\t\t\tp.saw_prize_ui_definition.name = IntUtils.replaceAll(\n\t\t\t\t\t\t\tp.saw_prize_ui_definition.name,\n\t\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tp.saw_prize_ui_definition.aknowledge_message = IntUtils.replaceAll(\n\t\t\t\t\t\t\tp.saw_prize_ui_definition.aknowledge_message,\n\t\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn response;\n\t}\n\n\tpublic async sawGetTemplatesT(user_ext_id: string): Promise<TMiniGameTemplate[]> {\n\t\treturn SAWTemplatesTransform((await this.sawGetTemplates(user_ext_id)).templates);\n\t}\n\n\tpublic async doAcknowledgeRequest(user_ext_id: string, request_id: string): Promise<SAWDoAknowledgeResponse> {\n\t\tconst message = this.buildMessage<SAWDoAknowledgeRequest, SAWDoAknowledgeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_AKNOWLEDGE_REQUEST,\n\t\t\t{\n\t\t\t\trequest_id,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<SAWDoAknowledgeResponse>(message, ClassId.SAW_AKNOWLEDGE_RESPONSE);\n\t}\n\n\tpublic async sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id?: number): Promise<SAWDoSpinResponse> {\n\t\tif (!saw_template_id) {\n\t\t\tthrow new Error('Missing template id');\n\t\t}\n\n\t\tconst request_id = IntUtils.uuid();\n\n\t\tconst message = this.buildMessage<SAWDoSpinRequest, SAWDoSpinResponse>(user_ext_id, ClassId.SAW_DO_SPIN_REQUEST, {\n\t\t\tsaw_template_id,\n\t\t\trequest_id,\n\t\t});\n\n\t\tconst spinAttemptResponse = await this.send<SAWDoSpinResponse>(message, ClassId.SAW_DO_SPIN_RESPONSE);\n\n\t\t// to simulate fail\n\t\t// response.errCode = SAWSpinErrorCode.SAW_NO_SPINS;\n\n\t\tconst status: string =\n\t\t\t{\n\t\t\t\t[SAWSpinErrorCode.SAW_OK]: 'OK',\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_SPINS]: 'NO SPINS AVAILABLE',\n\t\t\t\t[SAWSpinErrorCode.SAW_PRIZE_POOL_EMPTY]: 'PRIZE POOL IS EMPTY',\n\t\t\t\t[SAWSpinErrorCode.SAW_NOT_ENOUGH_POINTS]: 'NOT ENOUGH POINTS',\n\t\t\t\t[SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED]: 'MAX SPIN ATTEMPTS REACHED',\n\t\t\t\t[SAWSpinErrorCode.SAW_TEMPLATE_NOT_ACTIVE]: \"MINIGAME IS NOT IN ACTIVE PERIOD\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NOT_IN_SEGMENT]: \"USER IS NOT IN SEGMENT\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_BALANCE_GEMS]: \"NOT ENOUGH GEMS\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_BALANCE_DIAMONDS]: \"NOT ENOUGH DIAMONDS\",\n\t\t\t}[spinAttemptResponse.errCode] || 'OTHER';\n\n\t\tawait this.coreReportCustomEvent(user_ext_id, 'minigame_attempt', {\n\t\t\tsaw_template_id,\n\t\t\tstatus,\n\t\t\tround_id,\n\t\t});\n\n\t\treturn { ...spinAttemptResponse, request_id };\n\t}\n\n\n\tpublic async doAcknowledgeBatchRequest(user_ext_id: string, request_ids: string[]): Promise<SAWDoAcknowledgeBatchResponse> {\n\t\tconst message = this.buildMessage<SAWDoAcknowledgeBatchRequest, SAWDoAcknowledgeBatchResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_AKNOWLEDGE_REQUEST,\n\t\t\t{\n\t\t\t\trequest_ids,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<SAWDoAcknowledgeBatchResponse>(message, ClassId.SAW_AKNOWLEDGE_BATCH_RESPONSE);\n\t}\n\n\tpublic async sawSpinBatchRequest(user_ext_id: string, saw_template_id: number, spins_count: number): Promise<SAWDoSpinBatchResponse> {\n\n\t\tconst spins = [];\n\t\tfor (let i = 0; i < spins_count; i++) {\n\t\t\tconst request_id = IntUtils.uuid();\n\t\t\tspins.push({ request_id, saw_template_id })\n\t\t}\n\n\t\tconst message = this.buildMessage<SAWDoSpinBatchRequest, SAWDoSpinBatchResponse>(user_ext_id, ClassId.SAW_DO_SPIN_BATCH_REQUEST, { spins });\n\t\tconst spinAttemptResponse = await this.send<SAWDoSpinBatchResponse>(message, ClassId.SAW_DO_SPIN_BATCH_RESPONSE);\n\n\t\t// If one response is 'OK' we consider that whole result is 'OK'\n\t\tconst result = spinAttemptResponse.results.find((res) => res.errCode === 0);\n\n\t\tlet status = 'OK';\n\t\tif (!result) {\n\t\t\tstatus = 'BATCH FAIL';\n\t\t}\n\n\t\tawait this.coreReportCustomEvent(user_ext_id, 'minigame_attempt', {\n\t\t\tsaw_template_id,\n\t\t\tstatus,\n\t\t\tspins_count,\n\t\t});\n\n\t\treturn { ...spinAttemptResponse };\n\t}\n\n\tpublic async getSawWinningHistory(user_ext_id: string, limit: number = 20, offset: number = 0, saw_template_id: number): Promise<SAWWinningHistoryResponse> {\n\t\tconst message = this.buildMessage<SAWWinningHistoryRequest, SAWWinningHistoryResponse>(user_ext_id, ClassId.GET_SAW_HISTORY_REQUEST, {\n\t\t\tlimit, offset, saw_template_id\n\t\t})\n\n\t\treturn await this.send<SAWWinningHistoryResponse>(message, ClassId.GET_SAW_HISTORY_RESPONSE);\n\t}\n\n\tpublic async getSawWinningHistoryT(user_ext_id: string, limit?: number, offset?: number, saw_template_id?: number): Promise<SAWPrizesHistory[]> {\n\t\tif (IntUtils.isNotNull(limit) && IntUtils.isNotNull(offset) && limit > 50) {\n\t\t\tlimit = 50;\n\t\t}\n\t\treturn SAWHistoryTransform((await this.getSawWinningHistory(user_ext_id, limit, offset, saw_template_id)).prizes);\n\t}\n\n\tpublic async missionOptIn(user_ext_id: string, mission_id: number) {\n\t\tif (!mission_id) {\n\t\t\tthrow new Error('Missing mission id');\n\t\t}\n\t\tconst message = this.buildMessage<AchievementOptinRequest, AchievementOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MISSION_OPTIN_REQUEST,\n\t\t\t{\n\t\t\t\tachievementId: mission_id,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<AchievementOptinResponse>(message, ClassId.MISSION_OPTIN_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async missionClaimPrize(user_ext_id: string, mission_id: number, ach_completed_id: number) {\n\t\tif (!mission_id) {\n\t\t\tthrow new Error('Missing mission id');\n\t\t}\n\n\t\tconst message = this.buildMessage<AchClaimPrizeRequest, AchClaimPrizeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.ACHIEVEMENT_CLAIM_PRIZE_REQUEST,\n\t\t\t{\n\t\t\t\tach_id: mission_id,\n\t\t\t\tach_completed_id: ach_completed_id,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<AchClaimPrizeResponse>(message, ClassId.ACHIEVEMENT_CLAIM_PRIZE_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async registerInTournament(user_ext_id: string, tournamentInstanceId: number) {\n\t\tif (!tournamentInstanceId) {\n\t\t\tthrow new Error('Missing tournament instance id');\n\t\t}\n\t\tconst message = this.buildMessage<TournamentRegisterRequest, TournamentRegisterResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.TOURNAMENT_REGISTER_REQUEST,\n\t\t\t{\n\t\t\t\ttournamentInstanceId,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<TournamentRegisterResponse>(message, ClassId.TOURNAMENT_REGISTER_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async buyStoreItem(user_ext_id: string, itemId: number) {\n\t\tif (!itemId) {\n\t\t\tthrow new Error('Missing store item id');\n\t\t}\n\t\tconst message = this.buildMessage<BuyStoreItemRequest, BuyStoreItemResponse>(user_ext_id, ClassId.BUY_SHOP_ITEM_REQUEST, {\n\t\t\titemId,\n\t\t});\n\n\t\tconst res = await this.send<BuyStoreItemResponse>(message, ClassId.BUY_SHOP_ITEM_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async inboxGetMessages(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 10,\n\t\toffset: number = 0,\n\t): Promise<GetInboxMessagesResponse> {\n\t\tconst message = this.buildMessage<GetInboxMessagesRequest, GetInboxMessagesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_INBOX_MESSAGES_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetInboxMessagesResponse>(message, ClassId.GET_INBOX_MESSAGES_RESPONSE);\n\t}\n\n\tpublic async storeGetItems(user_ext_id: string, force_language?: string): Promise<GetStoreItemsResponse> {\n\t\tconst message = this.buildMessage<any, GetStoreItemsResponse>(user_ext_id, ClassId.GET_SHOP_ITEMS_REQUEST);\n\t\treturn await this.send<GetStoreItemsResponse>(message, ClassId.GET_SHOP_ITEMS_RESPONSE, force_language);\n\t}\n\n\tpublic async storeGetItemsT(user_ext_id: string): Promise<TStoreItem[]> {\n\t\treturn StoreItemTransform((await this.storeGetItems(user_ext_id)).items);\n\t}\n\n\tpublic async storeGetCategories(user_ext_id: string, force_language?: string): Promise<GetCategoriesStoreResponse> {\n\t\tconst message = this.buildMessage<any, GetCategoriesStoreResponse>(user_ext_id, ClassId.GET_SHOP_CATEGORIES_REQUEST);\n\t\treturn await this.send<GetCategoriesStoreResponse>(message, ClassId.GET_SHOP_CATEGORIES_RESPONSE, force_language);\n\t}\n\n\tpublic async storeGetCategoriesT(user_ext_id: string): Promise<TStoreCategory[]> {\n\t\treturn StoreCategoryTransform((await this.storeGetCategories(user_ext_id)).categories);\n\t}\n\n\tpublic async storeGetPurchasedItems(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 20,\n\t\toffset: number = 0,\n\t): Promise<GetStoreHistoryResponse> {\n\t\tconst message = this.buildMessage<GetStoreHistoryRequest, GetStoreHistoryResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.ACH_SHOP_ITEM_HISTORY_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetStoreHistoryResponse>(message, ClassId.ACH_SHOP_ITEM_HISTORY_RESPONSE);\n\t}\n\n\tpublic async storeGetPurchasedItemsT(user_ext_id: string, limit?: number, offset?: number): Promise<TStoreItem[]> {\n\t\tif (IntUtils.isNotNull(limit) && IntUtils.isNotNull(offset) && limit > 50) {\n\t\t\tlimit = 50;\n\t\t}\n\t\treturn StoreItemPurchasedTransform((await this.storeGetPurchasedItems(user_ext_id, limit, offset)).items);\n\t}\n\n\tpublic async missionsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementMapResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetAchievementMapResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\t// we need to clone response to avoid changing original object,for cases when its called together with badgesGetItems (e.g. in Promise.all)\n\t\tconst responseClone = { ...response };\n\n\t\tif (responseClone.achievements) {\n\t\t\tresponseClone.achievements = responseClone.achievements.filter((a) => a.ach_type_id === AchievementType.Mission);\n\t\t}\n\t\treturn responseClone;\n\t}\n\n\tpublic async missionsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]> {\n\t\treturn UserAchievementTransform((await this.missionsGetItems(user_ext_id)).achievements);\n\t}\n\n\tpublic async getUserGamificationInfo(user_ext_id: string): Promise<GetAchievementsUserInfoResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementsUserInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_USER_REQUEST,\n\t\t);\n\n\t\treturn await this.send<GetAchievementsUserInfoResponse>(message, ClassId.GET_ACHIEVEMENT_USER_RESPONSE);\n\t}\n\n\tpublic async getUserGamificationInfoT(user_ext_id: string): Promise<UserLevelExtraCountersT> {\n\t\tconst response = await this.getUserGamificationInfo(user_ext_id);\n\n\t\treturn {\n\t\t\tlevel_counter_1: response.level_counter_1,\n\t\t\tlevel_counter_2: response.level_counter_2,\n\t\t};\n\t}\n\n\tpublic async achGetCategories(user_ext_id: string, force_language?: string): Promise<GetAchCategoriesResponse> {\n\t\tconst message = this.buildMessage<any, GetAchCategoriesResponse>(user_ext_id, ClassId.GET_ACH_CATEGORIES_REQUEST);\n\t\treturn await this.send<GetAchCategoriesResponse>(message, ClassId.GET_ACH_CATEGORIES_RESPONSE, force_language);\n\t}\n\n\tpublic async achGetCategoriesT(user_ext_id: string): Promise<TAchCategory[]> {\n\t\treturn AchCategoryTransform((await this.achGetCategories(user_ext_id)).categories);\n\t}\n\n\tpublic async badgetsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementMapResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetAchievementMapResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\t// we need to clone response to avoid changing original object,for cases when its called together with missionsGetItems (e.g. in Promise.all)\n\t\tconst responseClone = { ...response };\n\n\t\tif (responseClone.achievements) {\n\t\t\tresponseClone.achievements = responseClone.achievements.filter((a) => a.ach_type_id === AchievementType.Badge);\n\t\t\tresponseClone.achievements = enrichUserAchievementsWithBadgeState(responseClone.achievements);\n\t\t}\n\t\treturn responseClone;\n\t}\n\n\tpublic async bonusesGetItems(user_ext_id: string, force_language?: string): Promise<GetBonusesResponse> {\n\t\tconst message = this.buildMessage<GetBonusesRequest, GetBonusesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_BONUSES_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetBonusesResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_BONUSES_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\n\t\tconst responseClone = { ...response };\n\n\t\treturn responseClone;\n\t}\n\tpublic async bonusClaimItem(user_ext_id: string, bonus_id: number): Promise<ClaimBonusResponse> {\n\t\tconst message = this.buildMessage<ClaimBonusRequest, ClaimBonusResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.CLAIM_BONUS_REQUEST,\n\t\t\t{ bonusId: bonus_id }\n\n\t\t);\n\t\tconst response = await this.send<ClaimBonusResponse>(\n\t\t\tmessage,\n\t\t\tClassId.CLAIM_BONUS_RESPONSE,\n\n\t\t);\n\n\t\tconst responseClone = { ...response };\n\n\t\treturn responseClone;\n\t}\n\n\tpublic async bonusesGetItemsT(user_ext_id: string): Promise<TBonus[]> {\n\t\treturn BonusItemsTransform((await this.bonusesGetItems(user_ext_id)).bonuses);\n\t}\n\n\tpublic async badgetsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]> {\n\t\treturn UserAchievementTransform((await this.badgetsGetItems(user_ext_id)).achievements);\n\t}\n\n\tpublic async tournamentsGetLobby(user_ext_id: string, force_language?: string): Promise<GetTournamentsResponse> {\n\t\tconst message = this.buildMessage<GetTournamentsRequest, GetTournamentsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_TOURNAMENT_LOBBY_REQUEST,\n\t\t);\n\t\treturn await this.send<GetTournamentsResponse>(message, ClassId.GET_TOURNAMENT_LOBBY_RESPONSE, force_language);\n\t}\n\n\tpublic async tournamentsGetLobbyT(user_ext_id: string): Promise<TTournament[]> {\n\t\treturn TournamentItemsTransform((await this.tournamentsGetLobby(user_ext_id)).tournaments);\n\t}\n\n\tpublic async clansGetList(user_ext_id: string, force_language?: string): Promise<GetClanListResponse> {\n\t\tconst message = this.buildMessage<GetClanListRequest, GetClanListResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_LIST_REQUEST,\n\t\t);\n\t\treturn await this.send<GetClanListResponse>(message, ClassId.GET_CLAN_LIST_RESPONSE, force_language);\n\t}\n\n\tpublic async clansGetListT(user_ext_id: string): Promise<TClans> {\n\t\tconst response = await this.clansGetList(user_ext_id);\n\t\treturn {\n\t\t\tclans: response.clans,\n\t\t\tuser_clan_id: response.user_clan_id,\n\t\t\tcooldown_until: response.cooldown_until,\n\t\t\tjoin_date: response.join_date ?? null,\n\t\t};\n\t}\n\n\tpublic async clansGetInfo(user_ext_id: string, clanId: number, force_language?: string): Promise<GetClanInfoResponse> {\n\t\tconst message = this.buildMessage<GetClanInfoRequest, GetClanInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_INFO_REQUEST,\n\t\t\t{ clan_id: clanId },\n\t\t);\n\t\treturn await this.send<GetClanInfoResponse>(message, ClassId.GET_CLAN_INFO_RESPONSE, force_language);\n\t}\n\n\tpublic async clansGetInfoT(user_ext_id: string, clanId: number, force_language?: string): Promise<TClanInfo> {\n\t\tconst response = await this.clansGetInfo(user_ext_id, clanId, force_language);\n\t\tconst c = response.clanInfo;\n\t\treturn {\n\t\t\tclan_id: c.clan_id,\n\t\t\tpublic_meta: c.public_meta,\n\t\t\tmember_count: c.member_count,\n\t\t\tcapacity_limit: c.capacity_limit,\n\t\t\tentry_fee_currency_type_id: c.entry_fee_currency_type_id,\n\t\t\tentry_fee_amount: c.entry_fee_amount,\n\t\t\trating_position: c.rating_position,\n\t\t\trating_score: c.rating_score,\n\t\t\tcooldown_until: c.cooldown_until ?? null,\n\t\t\tmembers: (c.members || []).map((m) => ({\n\t\t\t\tuser_id: m.user_id,\n\t\t\t\tpublic_username: m.public_username,\n\t\t\t\tavatar_id: m.avatar_id,\n\t\t\t\tavatar_real_id: m.avatar_real_id,\n\t\t\t\tavatar_url: CoreUtils.avatarUrl(m.avatar_id, this.avatarDomain),\n\t\t\t\tposition: m.position,\n\t\t\t\tcontribution_score: m.contribution_score,\n\t\t\t\tis_me: m.is_me,\n\t\t\t\tclean_ext_user_id: m.clean_ext_user_id,\n\t\t\t})),\n\t\t};\n\t}\n\n\tpublic async clanJoin(user_ext_id: string, clanId: number, joinSourceId: number = 0): Promise<TClanJoinResult> {\n\t\tconst message = this.buildMessage<JoinClanRequest, JoinClanResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JOIN_CLAN_REQUEST,\n\t\t\t{ clan_id: clanId, join_source_id: joinSourceId },\n\t\t);\n\t\tconst response = await this.send<JoinClanResponse>(message, ClassId.JOIN_CLAN_RESPONSE);\n\t\treturn { errCode: response.errCode ?? 0, errMsg: response.errMsg ?? '' };\n\t}\n\n\tpublic async tournamentsGetInfo(\n\t\tuser_ext_id: string,\n\t\ttournamentInstanceId: number,\n\t\tforce_language?: string,\n\t): Promise<GetTournamentInfoResponse> {\n\t\tconst message = this.buildMessage<GetTournamentInfoRequest, GetTournamentInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_TOURNAMENT_INFO_REQUEST,\n\t\t\t{\n\t\t\t\ttournamentInstanceId,\n\t\t\t},\n\t\t);\n\t\tconst response = await this.send<GetTournamentInfoResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_TOURNAMENT_INFO_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\n\t\tif (response.userPosition?.avatar_id) {\n\t\t\tresponse.userPosition.avatar_url = CoreUtils.avatarUrl(response.userPosition.avatar_id, this.avatarDomain);\n\t\t}\n\n\t\tif (response.tournamentInfo?.players?.length) {\n\t\t\tresponse.tournamentInfo.players.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\n\t\treturn response;\n\t}\n\n\tpublic async tournamentsGetInfoT(user_ext_id: string, tournamentInstanceId: number): Promise<TTournamentDetailed> {\n\t\tif (!tournamentInstanceId) {\n\t\t\tthrow new Error('Missing tournament instance id');\n\t\t}\n\t\tconst response = await this.tournamentsGetInfo(user_ext_id, tournamentInstanceId);\n\t\treturn tournamentInfoItemTransform(response);\n\t}\n\n\tpublic async clanTournamentGetPlayers(\n\t\tuser_ext_id: string,\n\t\ttournament_instance_id: number,\n\t\tclan_id: number,\n\t\tforce_language?: string,\n\t): Promise<TClanTournamentPlayers> {\n\t\tconst message = this.buildMessage<GetClanTournamentPlayersRequest, GetClanTournamentPlayersResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_TOURNAMENT_PLAYERS_REQUEST,\n\t\t\t{ tournament_instance_id, clan_id, force_language },\n\t\t);\n\t\tconst response = await this.send<GetClanTournamentPlayersResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\tif (response.players?.length) {\n\t\t\tresponse.players.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\t\treturn clanTournamentPlayersTransform(response);\n\t}\n\n\tpublic async leaderboardGet(\n\t\tuser_ext_id: string,\n\t\tperiod_type_id?: LeaderBoardPeriodType,\n\t\tprevPeriod: boolean | number = false,\n\t\tforce_language?: string,\n\t): Promise<LeaderBoardDetails> {\n\t\t// boolean keeps back-compat (false → current, true → previous);\n\t\t// a number selects an arbitrary snapshot offset (1 = previous, 2 = the one before, …).\n\t\tconst snapshot_offset = typeof prevPeriod === 'number' ? prevPeriod : prevPeriod ? 1 : 0;\n\t\tconst message = this.buildMessage<GetLeaderBoardsRequest, GetLeaderBoardsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_LEADERS_BOARD_REQUEST,\n\t\t\t{\n\t\t\t\tperiod_type_id,\n\t\t\t\tsnapshot_offset,\n\t\t\t\tinclude_users: true,\n\t\t\t},\n\t\t);\n\n\t\tconst response = await this.send<GetLeaderBoardsResponse>(message, ClassId.GET_LEADERS_BOARD_RESPONSE, force_language);\n\n\t\tconst boardKey = Object.keys(response.map || {}).find((k) => period_type_id === undefined || k === period_type_id?.toString());\n\n\t\tif (boardKey === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (response.map[boardKey]?.userPosition?.avatar_id) {\n\t\t\tresponse.map[boardKey].userPosition.avatar_url = CoreUtils.avatarUrl(\n\t\t\t\tresponse.map[boardKey].userPosition.avatar_id,\n\t\t\t\tthis.avatarDomain,\n\t\t\t);\n\t\t}\n\n\t\tif (response.map[boardKey]?.positions?.length) {\n\t\t\tresponse.map[boardKey].positions.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\n\t\treturn response.map[boardKey];\n\t}\n\n\tpublic async leaderboardsGetT(\n\t\tuser_ext_id: string,\n\t\tperiod_type_id: LeaderBoardPeriodType = LeaderBoardPeriodType.DAILY,\n\t\tprevPeriod: boolean | number = false,\n\t): Promise<LeaderBoardDetailsT> {\n\t\treturn getLeaderBoardTransform(await this.leaderboardGet(user_ext_id, period_type_id, prevPeriod));\n\t}\n\n\tpublic async leaderboardsGetList(\n\t\tuser_ext_id: string,\n\t\tforce_language?: string,\n\t): Promise<LeaderBoardDetails[]> {\n\t\tconst message = this.buildMessage<GetLeaderBoardsRequest, GetLeaderBoardsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_LEADERS_BOARD_REQUEST,\n\t\t\t{\n\t\t\t\t// No period_type_id → the server returns every configured board.\n\t\t\t\t// include_users: false → board metadata only (no positions / userPosition).\n\t\t\t\tsnapshot_offset: 0,\n\t\t\t\tinclude_users: false,\n\t\t\t},\n\t\t);\n\n\t\tconst response = await this.send<GetLeaderBoardsResponse>(message, ClassId.GET_LEADERS_BOARD_RESPONSE, force_language);\n\n\t\t// map is keyed by period_type_id; integer-like keys iterate in ascending order.\n\t\treturn Object.values(response.map || {});\n\t}\n\n\tpublic async leaderboardsGetListT(user_ext_id: string): Promise<LeaderBoardDetailsT[]> {\n\t\treturn (await this.leaderboardsGetList(user_ext_id)).map(getLeaderBoardTransform);\n\t}\n\n\tpublic async levelsGet(user_ext_id: string, force_language?: string): Promise<GetLevelMapResponse> {\n\t\tconst message = this.buildMessage<any, GetLevelMapResponse>(user_ext_id, ClassId.GET_LEVEL_MAP_REQUEST);\n\t\treturn await this.send<GetLevelMapResponse>(message, ClassId.GET_LEVEL_MAP_RESPONSE, force_language);\n\t}\n\n\tpublic async levelsGetT(user_ext_id: string): Promise<TLevel[]> {\n\t\treturn GetLevelMapResponseTransform(await this.levelsGet(user_ext_id));\n\t}\n\n\tpublic async getLevelCurrent(user_ext_id: string): Promise<TLevelCurrent> {\n\t\tconst levels = await this.levelsGetT(user_ext_id);\n\t\tconst userInfo = await this.getUserGamificationInfo(user_ext_id);\n\t\tif (!levels || levels.length === 0) return null;\n\n\t\tconst sortedLevels = [...levels].sort((a, b) => a.required_points - b.required_points);\n\n\t\tlet currentLevelIndex = sortedLevels.findIndex((level) => level.id === userInfo.current_level);\n\n\t\tif (currentLevelIndex === -1) {\n\t\t\tconst userPointsEver = userInfo.points_ever ?? 0;\n\t\t\tcurrentLevelIndex = sortedLevels.findIndex((level, index) => {\n\t\t\t\tconst nextLevel = sortedLevels[index + 1];\n\t\t\t\treturn userPointsEver >= level.required_points && (!nextLevel || userPointsEver < nextLevel.required_points);\n\t\t\t});\n\t\t\tif (currentLevelIndex === -1) {\n\t\t\t\tcurrentLevelIndex = sortedLevels.length - 1;\n\t\t\t}\n\t\t}\n\n\t\tconst currentLevel = sortedLevels[currentLevelIndex];\n\t\tconst nextLevel = sortedLevels[currentLevelIndex + 1];\n\t\tconst userPointsEver = userInfo.points_ever ?? 0;\n\t\tconst progress = nextLevel\n\t\t\t? ((userPointsEver - currentLevel.required_points) / (nextLevel.required_points - currentLevel.required_points)) * 100\n\t\t\t: 100;\n\n\t\treturn {\n\t\t\t...currentLevel,\n\t\t\tprogress: Math.min(Math.max(progress, 0), 100),\n\t\t};\n\t}\n\n\tpublic async customSectionsGet(user_ext_id: string, force_language?: string): Promise<GetCustomSectionsResponse> {\n\t\tconst message = this.buildMessage<GetCustomSectionsRequest, GetCustomSectionsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CUSTOM_SECTIONS_REQUEST,\n\t\t);\n\t\treturn await this.send<GetCustomSectionsResponse>(message, ClassId.GET_CUSTOM_SECTIONS_RESPONSE, force_language);\n\t}\n\n\tpublic async customSectionsGetT(user_ext_id: string): Promise<TUICustomSection[]> {\n\t\treturn UICustomSectionTransform(await this.customSectionsGet(user_ext_id));\n\t}\n\n\tpublic async getTranslationsT(\n\t\tuser_ext_id: string,\n\t\tlang_code: string,\n\t\tareas: TranslationArea[],\n\t\tcacheSec: number = 60,\n\t): Promise<GetTranslationsResponse> {\n\t\treturn await this.coreGetTranslations(user_ext_id, lang_code, areas, 30);\n\t}\n\n\tpublic async getInboxMessages(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 20,\n\t\toffset: number = 0,\n\t\tstarred_only: boolean,\n\t\tcategory_id?: InboxCategories,\n\t\tread_status?: InboxReadStatus,\n\t): Promise<GetInboxMessagesResponse> {\n\t\tconst message = this.buildMessage<GetInboxMessagesRequest, GetInboxMessagesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_INBOX_MESSAGES_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t\tstarred_only,\n\t\t\t\tcategory_id,\n\t\t\t\tread_status,\n\t\t\t},\n\t\t);\n\t\treturn await this.send<GetInboxMessagesResponse>(message, ClassId.GET_INBOX_MESSAGES_RESPONSE);\n\t}\n\n\tpublic async getInboxMessagesT(\n\t\tuser_ext_id: string,\n\t\tfrom: number = 0,\n\t\tto: number = 20,\n\t\tfavoriteOnly: boolean = false,\n\t\tcategoryId?: InboxCategories,\n\t\tread_status?: InboxReadStatus,\n\t): Promise<TInboxMessage[]> {\n\t\tconst limit = to - from > 20 ? 20 : to - from;\n\t\tconst offset = from;\n\n\t\treturn InboxMessagesTransform((await this.getInboxMessages(user_ext_id, limit, offset, favoriteOnly, categoryId, read_status)).log);\n\t}\n\n\tpublic async getInboxUnreadCountT(\n\t\tuser_ext_id: string,\n\t): Promise<number> {\n\t\tconst limit = 1;\n\t\tconst offset = 0;\n\n\t\treturn (await this.getInboxMessages(user_ext_id, limit, offset, false, null)).unread_count;\n\t}\n\n\tpublic async getInboxMessageBody(messageGuid: string): Promise<InboxMessageBody> {\n\t\tconst getMessageBody = async (messageGuid: string): Promise<InboxMessageBody> => {\n\t\t\tconst inboxCdnUrl = this.tracker.getLabelSetting(PublicLabelSettings.INBOX_PUBLIC_CDN);\n\n\t\t\ttry {\n\t\t\t\tconst url = `${inboxCdnUrl}${messageGuid}.json`;\n\n\t\t\t\tconst response = await fetch(url, {\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t'Access-Control-Allow-Origin': '*',\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tconst data = await response.json();\n\t\t\t\treturn data || {};\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.error('Error fetching inbox message body:', error);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\n\t\treturn await getMessageBody(messageGuid);\n\t}\n\n\tpublic async getInboxMessageBodyT(messageGuid: string): Promise<TInboxMessageBody> {\n\t\tconst message = await this.getInboxMessageBody(messageGuid);\n\t\treturn InboxMessageBodyTransform(message);\n\t}\n\n\tpublic async markInboxMessageRead(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageReadResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageReadRequest, MarkInboxMessageReadResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_READ_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageReadResponse>(message, ClassId.MARK_INBOX_READ_RESPONSE);\n\t}\n\n\tpublic async markAllInboxMessageRead(user_ext_id: string): Promise<MarkInboxMessageReadResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageReadRequest, MarkInboxMessageReadResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_READ_REQUEST,\n\t\t\t{\n\t\t\t\tall_read: true,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageReadResponse>(message, ClassId.MARK_INBOX_READ_RESPONSE);\n\t}\n\n\tpublic async markUnmarkInboxMessageAsFavorite(\n\t\tuser_ext_id: string,\n\t\tmessageGuid: string,\n\t\tmark: boolean,\n\t): Promise<MarkInboxMessageStarredResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageStarredRequest, MarkInboxMessageStarredResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_STARRED_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t\tis_starred: mark,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageStarredResponse>(message, ClassId.MARK_INBOX_STARRED_RESPONSE);\n\t}\n\n\tpublic async deleteInboxMessage(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageDeletedResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageDeletedRequest, MarkInboxMessageDeletedResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_DELETED_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageDeletedResponse>(message, ClassId.MARK_INBOX_DELETED_RESPONSE);\n\t}\n\n\tpublic async deleteAllInboxMessages(user_ext_id: string): Promise<MarkInboxMessageDeletedResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageDeletedRequest, MarkInboxMessageDeletedResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_DELETED_REQUEST,\n\t\t\t{\n\t\t\t\tall_deleted: true,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageDeletedResponse>(message, ClassId.MARK_INBOX_DELETED_RESPONSE);\n\t}\n\n\tprivate buildGamesApiParams(): Record<string, string> {\n\t\tconst params: Record<string, string> = Object.assign({}, this.baseRgApiParams, {\n\t\t\text_user_id: this.tracker.userPublicProps?.user_id,\n\t\t\tsmartico_ext_user_id: this.tracker.getExtUserId(),\n\t\t\tlang: this.tracker.userPublicProps?.core_user_language,\n\t\t});\n\n\t\treturn params;\n\t}\n\n\tprivate async sendGamesApi<T>({ method, params, usePost = false }: { method: string, params: Record<string, any>, usePost?: boolean }): Promise<GamesApiResponse<T>> {\n\n\t\tif (!this.tracker) {\n\t\t\tthrow new Error(`MatchX and Quiz APIs are not available in the visitor mode`);\n\t\t}\n\n\t\tconst baseParams = this.buildGamesApiParams();\n\t\tconst queryString = Object.entries(baseParams).map(([k, v]) => `${k}=${encodeURIComponent(v)}`).join('&');\n\t\tlet url = `${GAMES_API_URL}/${method}?${queryString}`;\n\n\t\tlet fetchOptions: RequestInit = {\n\t\t\tmethod: 'GET',\n\t\t\theaders: { 'Accept': 'application/json' },\n\t\t};\n\n\t\tif (usePost && params) {\n\t\t\tfetchOptions = {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify(params),\n\t\t\t};\n\t\t} else if (params) {\n\t\t\tconst extraQuery = Object.entries(params)\n\t\t\t\t.map(([k, v]) => `${k}=${encodeURIComponent(JSON.stringify(v))}`)\n\t\t\t\t.join('&');\n\t\t\turl += `&${extraQuery}`;\n\t\t}\n\n\t\ttry {\n\t\t\tconst response = await fetch(url, fetchOptions);\n\n\t\t\tconst data = await response.json();\n\t\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront<GamesApiResponse<T>>(data);\n\t\t} catch (e) {\n\t\t\tthis.logger.error(`Failed to call games API: ${method}`, { url, error: e.message });\n\t\t\tthrow new Error(`Failed to call games API: ${method}. ${e.message}`);\n\t\t}\n\t}\n\n\tprivate async sendAvatarApi<T>({ method, body }: { method: string, body: Record<string, any> }): Promise<T> {\n\t\tif (!this.tracker) {\n\t\t\tthrow new Error(`Avatar APIs are not available in the visitor mode`);\n\t\t}\n\n\t\tconst url = `${this.avatarOriginDomain}/${method}`;\n\n\t\ttry {\n\t\t\tconst response = await fetch(url, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify(body),\n\t\t\t});\n\n\t\t\tconst data = await response.json();\n\t\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront<T>(data);\n\t\t} catch (e) {\n\t\t\tthis.logger.error(`Failed to call avatar API: ${method}`, { url, error: e.message });\n\t\t\tthrow new Error(`Failed to call avatar API: ${method}. ${e.message}`);\n\t\t}\n\t}\n\n\tpublic async gpGetActiveRounds(saw_template_id: number): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound[]>({ method: 'active-rounds', params });\n\t}\n\n\tpublic async gpGetActiveRound(saw_template_id: number, round_id?: number): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t};\t\n\t\t\n\t\treturn this.sendGamesApi<GamePickRound>({ method: 'active-round', params });\n\t}\n\n\tpublic async gpGetGamesHistory(saw_template_id: number): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound[]>({ method: 'games-history', params });\n\t}\n\n\tpublic async gpGetGameBoard(saw_template_id: number, round_id: number): Promise<GamesApiResponse<GamePickRoundBoard>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRoundBoard>({ method: 'game-board', params });\n\t}\n\n\tpublic async gpSubmitSelection(saw_template_id: number, round: any, isQuiz: boolean): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst method = isQuiz ? 'submit-selection-quiz' : 'submit-selection';\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround: round,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound>({ method, params, usePost: true });\n\t}\n\n\tpublic async gpGetUserInfo(saw_template_id: number): Promise<GamesApiResponse<GamePickUserInfo>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickUserInfo>({ method: 'user-info', params });\n\t}\n\n\tpublic async gpGetGameInfo(saw_template_id: number): Promise<GamesApiResponse<GamePickGameInfo>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickGameInfo>({ method: 'game-info', params });\n\t}\n\n\tpublic async gpGetTranslations(saw_template_id: number): Promise<GamesApiResponse<any>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<any>({ method: 'translations', params });\n\t}\n\n\tpublic async gpGetRoundInfoForUser(saw_template_id: number, round_id: number, int_user_id: number): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t\tint_user_id: int_user_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound>({ method: 'game-round-info-for-user', params });\n\t}\n\n\tpublic async avatarsGetList(user_ext_id: string): Promise<GetAvatarsListResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarsListResponse>(user_ext_id, ClassId.GET_AVATARS_LIST_REQUEST);\n\t\treturn await this.send<GetAvatarsListResponse>(message, ClassId.GET_AVATARS_LIST_RESPONSE);\n\t}\n\n\tpublic async avatarsGetCustomized(user_ext_id: string): Promise<GetAvatarsCustomizedResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarsCustomizedResponse>(user_ext_id, ClassId.GET_AVATARS_CUSTOMIZED_REQUEST);\n\t\treturn await this.send<GetAvatarsCustomizedResponse>(message, ClassId.GET_AVATARS_CUSTOMIZED_RESPONSE);\n\t}\n\n\tpublic async avatarsGetPrompts(user_ext_id: string): Promise<GetAvatarPromptsResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarPromptsResponse>(user_ext_id, ClassId.GET_AVATAR_PROMPTS_REQUEST);\n\t\treturn await this.send<GetAvatarPromptsResponse>(message, ClassId.GET_AVATAR_PROMPTS_RESPONSE);\n\t}\n\n\tpublic async avatarSetAvatar(user_ext_id: string, avatar_id: string, avatar_real_id: number): Promise<SetAvatarResponse> {\n\t\tconst message = this.buildMessage<SetAvatarRequest, SetAvatarResponse>(user_ext_id, ClassId.CLIENT_SET_AVATAR_REQUEST, {\n\t\t\tavatar_id,\n\t\t\tavatar_real_id,\n\t\t});\n\t\treturn await this.send<SetAvatarResponse>(message, ClassId.CLIENT_SET_AVATAR_RESPONSE);\n\t}\n\n\tpublic async avatarsCustomize(params: {\n\t\tuser_id: number;\n\t\tprompt_id: number;\n\t\tavatar_url: string;\n\t\tavatar_real_id: number;\n\t}): Promise<AvatarCustomizeResponse> {\n\t\treturn this.sendAvatarApi<AvatarCustomizeResponse>({\n\t\t\tmethod: 'avatar-customize',\n\t\t\tbody: {\n\t\t\t\t// The server resolves label_id from label_api_key.\n\t\t\t\tlabel_api_key: this.label_api_key,\n\t\t\t\tuser_id: params.user_id,\n\t\t\t\tuser_ext_id: this.tracker?.getExtUserId(),\n\t\t\t\tbrand_key: this.brand_api_key || this.tracker?.params?.brand_key,\n\t\t\t\tprompt_id: params.prompt_id,\n\t\t\t\tavatar_url: params.avatar_url,\n\t\t\t\tavatar_real_id: params.avatar_real_id,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async avatarsGetListT(user_ext_id: string): Promise<TAvatarDefinition[]> {\n\t\treturn avatarDefinitionTransform((await this.avatarsGetList(user_ext_id)).avatars ?? [], this.avatarDomain);\n\t}\n\n\tpublic async avatarsGetCustomizedT(user_ext_id: string): Promise<TAvatarCustomized[]> {\n\t\treturn avatarCustomizedTransform((await this.avatarsGetCustomized(user_ext_id)).avatars ?? [], this.avatarDomain);\n\t}\n\n\tpublic async avatarsGetPromptsT(user_ext_id: string): Promise<TAvatarPrompt[]> {\n\t\treturn avatarPromptTransform((await this.avatarsGetPrompts(user_ext_id)).prompts ?? [], this.avatarDomain);\n\t}\n\n\tpublic getWSCalls(): WSAPI {\n\t\treturn new WSAPI(this);\n\t}\n\n\tpublic async getRelatedItemsForGame(user_ext_id: string, related_game_id: string,): Promise<GetRelatedAchTourResponse> {\n\t\tconst message = this.buildMessage<GetRelatedAchTourRequest, GetRelatedAchTourResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_RELATED_ACH_N_TOURNAMENTS_REQUEST,\n\t\t\t{\n\t\t\t\trelated_game_id: related_game_id\n\t\t\t}\n\t\t);\n\n\t\treturn await this.send<GetRelatedAchTourResponse>(message, ClassId.GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE);\n\t}\n\n\tpublic async getRafflesT(user_ext_id: string): Promise<TRaffle[]> {\n\t\treturn raffleTransform((await this.getRaffles(user_ext_id)).items);\n\t}\n\n\tpublic async getRaffles(user_ext_id: string): Promise<GetRafflesResponse> {\n\t\tconst message = this.buildMessage<GetRafflesRequest, GetRafflesResponse>(user_ext_id, ClassId.RAF_GET_RAFFLES_REQUEST);\n\n\t\treturn await this.send<GetRafflesResponse>(message, ClassId.RAF_GET_RAFFLES_RESPONSE);\n\t}\n\n\tpublic async getRaffleDrawRun(user_ext_id: string, payload: { raffle_id: number; run_id: number; winners_limit?: number; winners_offset?: number }): Promise<GetDrawRunResponse> {\n\t\tconst message = this.buildMessage<GetDrawRunRequest, GetDrawRunResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_DRAW_RUN_REQUEST,\n\t\t\tpayload,\n\t\t);\n\n\t\treturn await this.send<GetDrawRunResponse>(message, ClassId.RAF_GET_DRAW_RUN_RESPONSE);\n\t}\n\n\tpublic async getRaffleDrawRunT(\n\t\tuser_ext_id: string,\n\t\traffle_id: number,\n\t\trun_id: number,\n\t\twinners_from: number = 0,\n\t\twinners_to: number = 20,\n\t): Promise<TRaffleDraw> {\n\t\tconst winners_limit = winners_to - winners_from > 50 ? 50 : winners_to - winners_from;\n\t\tconst winners_offset = winners_from;\n\n\t\treturn drawRunTransform(await this.getRaffleDrawRun(user_ext_id, { raffle_id, run_id, winners_limit, winners_offset }),);\n\t}\n\n\tpublic async getRaffleDrawRunsHistory(\n\t\tuser_ext_id: string,\n\t\tprops: { raffle_id: number; draw_id?: number },\n\t): Promise<GetRaffleDrawRunsHistoryResponse> {\n\t\tconst message = this.buildMessage<GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_DRAW_HISTORY_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<GetRaffleDrawRunsHistoryResponse>(message, ClassId.RAF_GET_DRAW_HISTORY_RESPONSE);\n\t}\n\n\tpublic async claimRafflePrize(user_ext_id: string, props: { won_id: number }): Promise<RaffleClaimPrizeResponse> {\n\t\tconst message = this.buildMessage<RaffleClaimPrizeRequest, RaffleClaimPrizeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_CLAIM_PRIZE_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<RaffleClaimPrizeResponse>(message, ClassId.RAF_CLAIM_PRIZE_RESPONSE);\n\n\t}\n\n\tpublic async raffleOptin(user_ext_id: string, props: { raffle_id: number; draw_id: number; raffle_run_id: number }): Promise<RaffleOptinResponse> {\n\t\tconst message = this.buildMessage<RaffleOptinRequest, RaffleOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_OPTIN_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<RaffleOptinResponse>(message, ClassId.RAF_OPTIN_RESPONSE);\n\n\t}\n\n\tpublic async getRaffleWonPrizes(\n\t\tuser_ext_id: string,\n\t\tprops: { raffle_id: number; offset: number; limit: number },\n\t): Promise<GetRaffleWonPrizesResponse> {\n\t\tconst message = this.buildMessage<GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_WON_PRIZES_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<GetRaffleWonPrizesResponse>(message, ClassId.RAF_GET_WON_PRIZES_RESPONSE);\n\t}\n\n\tpublic async getActivityLog(\n\t\tuser_ext_id: string,\n\t\tstartTimeSeconds: number,\n\t\tendTimeSeconds: number,\n\t\tlimit: number,\n\t\toffset: number,\n\t): Promise<GetActivityLogResponse> {\n\t\tconst message = this.buildMessage<GetActivityLogRequest, GetActivityLogResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_POINT_HISTORY_REQUEST,\n\t\t\t{\n\t\t\t\tstartTimeSeconds: Math.floor(startTimeSeconds),\n\t\t\t\tendTimeSeconds: Math.floor(endTimeSeconds),\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetActivityLogResponse>(message, ClassId.GET_POINT_HISTORY_RESPONSE);\n\t}\n\n\tpublic async getActivityLogT(\n\t\tuser_ext_id: string,\n\t\tstartTimeSeconds: number,\n\t\tendTimeSeconds: number,\n\t\tfrom: number = 0,\n\t\tto: number = 50,\n\t): Promise<TActivityLog[]> {\n\t\tconst limit = to - from > 50 ? 50 : to - from;\n\t\tconst offset = from;\n\n\t\treturn ActivityLogTransform(\n\t\t\t(await this.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset)).logHistory,\n\t\t);\n\t}\n}\n\nexport { SmarticoAPI, MessageSender };\n","import { TSMap } from 'typescript-map';\n\nclass CookieStore {\n\tprivate static cookieStore = new TSMap<string, string[]>();\n\n\tpublic static get(key: string): string[] | undefined {\n\t\treturn CookieStore.cookieStore.get(key);\n\t}\n\n\tpublic static set(key: string, value: string[]) {\n\t\tconst v = value.map((v) => v.split(';')[0]);\n\t\tCookieStore.cookieStore.set(key, v);\n\t}\n}\n\nexport { CookieStore };\n","\nexport enum AnalyticsInterfaceType {\n\tMobile = 0,\n\tDesktop = 1,\n}\n\nexport enum AnalyticsScreenNameId {\n\tOverview = 1,\n\tMissions = 2,\n\tLeaderboards = 3,\n\tTournaments = 4,\n\tTournamentLobby = 5,\n\tLevels = 6,\n\tLevelsMap = 7,\n\tBadges = 8,\n\tBonuses = 9,\n\tSpinAWheel = 10,\n\tStore = 11,\n\tStoreHistory = 12,\n\tInbox = 13,\n\tMatchX = 14,\n\tQuiz = 15,\n\tJackpots = 16,\n\tLootbox = 17,\n\tCustomSection = 18,\n\tShortInbox = 19,\n\tLootboxWeekdays = 20,\n\tLootboxCalendarDays = 21,\n\tTreasureHunt = 22,\n\tLiquidSection = 23,\n\tActivityLog = 24,\n\n\tModalMission = 31,\n\tModalLevel = 32,\n\tModalBadge = 33,\n\tModalStore = 34,\n\tModalBonus = 35,\n\tModalJackpot = 36,\n\tModalUsername = 37,\n\tModalAvatar = 38,\n\tModalQR = 39,\n}\n\nexport enum AnalyticsTournamentsLobbySubScreenNameId {\n\tGeneral = 1,\n\tPrizes = 2,\n\tPlayers = 3,\n\tRelatedGames = 4,\n}\n\nexport enum AnalyticsInboxSubScreenNameId {\n\tAll = 1,\n\tFavorite = 2,\n}\n","export enum QuizSportType {\n\tSoccer = 1,\n\tBasketball = 2,\n\tTennis = 5,\n}\n\nexport const quizSupportedSports = [QuizSportType.Basketball, QuizSportType.Soccer, QuizSportType.Tennis];\n","export enum SAWGPMarketType {\n\tTwoTeamsWithScore = 1,\n\tRedCard = 2,\n\tOneXTwo = 3,\n\tOneXTwoHalftime = 4,\n\t// HalftimeFulltime = 5,\n\tFirstGoal = 6,\n\tDoubleChance = 7,\n\tOverUnder2_5 = 8,\n\tOverUnder1_5Halftime = 9,\n\tOverUnder1_5__2ndHalf = 10,\n\tTotalCorners8_5 = 11,\n\tTotalCorners9_5 = 12,\n\tCorners1x2 = 13,\n\tOne_Two = 14,\n\tOvertime = 15,\n\tOddEven = 16,\n\tOddEvenHomeAway = 17,\n\tFirstSet = 18,\n\tSecondSet = 19,\n\tThirdSet = 20,\n\tFourthSet = 21,\n\tFifthSet = 22,\n\tPlayerOneWinsOneSet = 23,\n\tPlayerTwoWinsOneSet = 24,\n\tLastGoal = 25,\n\n\tCustomSport = 26,\n\tCustomNonSport = 27,\n}\n","export enum QuizAnswersValueType {\n\tHomeTeam = '1',\n\tAwayTeam = '2',\n\tDraw = 'x',\n\tHomeTeamHomeTeam = '1/1',\n\tHomeTeamDraw = '1/x',\n\tHomeTeamAwayTeam = '1/2',\n\tDrawHomeTeam = 'x/1',\n\tDrawDraw = 'x/x',\n\tDrawAwayTeam = 'x/2',\n\tAwayTeamHomeTeam = '2/1',\n\tAwayTeamDraw = '2/x',\n\tAwayTeamAwayTeam = '2/2',\n\tYes = 'yes',\n\tNo = 'no',\n\tOdd = 'odd',\n\tEven = 'even',\n\tHomeOdd = '1/odd',\n\tHomeEven = '1/even',\n\tAwayOdd = '2/odd',\n\tAwayEven = '2/even',\n}\n\nexport const quizAnswerHomeTeamReplacementText = '{quiz_home_team}';\nexport const quizAnswerAwayTeamReplacementText = '{quiz_away_team}';\nexport const quizDrawReplacementText = '{quiz_draw}';\nexport const quizYesReplacementText = '{yes}';\nexport const quizNoReplacementText = '{no}';\nexport const quizOddReplacementText = '{odd}';\nexport const quizEvenReplacementText = '{even}';\nexport const quizOrReplacementText = '{or}';\nexport const quizNoGoalsReplacementText = '{quiz_no_goals}';\n\nexport const quizAnswersTrKeys = {\n\t[quizDrawReplacementText]: 'quizAnswer_draw',\n\t[quizYesReplacementText]: 'quizAnswer_yes',\n\t[quizNoReplacementText]: 'quizAnswer_no',\n\t[quizOddReplacementText]: 'quizAnswer_odd',\n\t[quizEvenReplacementText]: 'quizAnswer_even',\n\t[quizOrReplacementText]: 'quizAnswer_or',\n\t[quizNoGoalsReplacementText]: 'quizAnswer_no_goals',\n};\n","import {\n\tQuizAnswersValueType,\n\tquizAnswerAwayTeamReplacementText,\n\tquizAnswerHomeTeamReplacementText,\n\tquizDrawReplacementText,\n\tquizEvenReplacementText,\n\tquizNoGoalsReplacementText,\n\tquizNoReplacementText,\n\tquizOddReplacementText,\n\tquizOrReplacementText,\n\tquizYesReplacementText,\n} from './MarketsAnswers';\nimport { SAWGPMarketType } from './MarketsType';\n\nconst yesNoAnswers = [\n\t{ text: quizYesReplacementText, value: QuizAnswersValueType.Yes },\n\t{ text: quizNoReplacementText, value: QuizAnswersValueType.No },\n];\n\nconst homeAwayAnswers = [\n\t{ text: quizAnswerHomeTeamReplacementText, value: QuizAnswersValueType.HomeTeam },\n\t{ text: quizAnswerAwayTeamReplacementText, value: QuizAnswersValueType.AwayTeam },\n];\n\nconst homeAwayDrawAnswers = [...homeAwayAnswers, { text: quizDrawReplacementText, value: QuizAnswersValueType.Draw }];\nconst homeAwayNoGoalsAnswers = [...homeAwayAnswers, { text: quizNoGoalsReplacementText, value: QuizAnswersValueType.Draw }];\n\nexport const marketsInfo = [\n\t{\n\t\ttype: SAWGPMarketType.OneXTwo,\n\t\tname: '1x2',\n\t\tquestion: { text: 'Who will win the match ?', trKey: 'quizQuestion_1x2' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OneXTwoHalftime,\n\t\tname: '1x2 Halftime',\n\t\tquestion: { text: 'Who will lead the first half of the match ?', trKey: 'quizQuestion_x2half' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t// {\n\t// \ttype: SAWGPMarketType.HalftimeFulltime,\n\t// \tname: 'Halftime / Fulltime',\n\t// \tquestion: { text: 'Who will lead the first half and who will win the match ?', trKey: 'quizQuestion__HalftimeFulltime' },\n\t// \tanswers: [\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamHomeTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizDrawReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamDraw,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamAwayTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizDrawReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.DrawHomeTeam,\n\t// \t\t},\n\t// \t\t{ text: `${quizDrawReplacementText} / ${quizDrawReplacementText}`, value: QuizAnswersValueType.DrawDraw },\n\t// \t\t{\n\t// \t\t\ttext: `${quizDrawReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.DrawAwayTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamHomeTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizDrawReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamDraw,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamAwayTeam,\n\t// \t\t},\n\t// \t],\n\t// },\n\t{\n\t\ttype: SAWGPMarketType.FirstGoal,\n\t\tname: 'First Goal',\n\t\tquestion: { text: 'Who will score the first goal ?', trKey: 'quizQuestion_firstGoal' },\n\t\tanswers: homeAwayNoGoalsAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.LastGoal,\n\t\tname: 'Last Goal',\n\t\tquestion: { text: 'Who will score the last goal ?', trKey: 'quizQuestion_lastGoal' },\n\t\tanswers: homeAwayNoGoalsAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.DoubleChance,\n\t\tname: 'Double Chance',\n\t\tquestion: { text: 'Who will win the match? Choose a combination:', trKey: 'quizQuestion_doubleChance' },\n\t\tanswers: [\n\t\t\t{\n\t\t\t\ttext: `${quizDrawReplacementText} ${quizOrReplacementText} ${quizAnswerHomeTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.HomeTeamDraw,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: `${quizAnswerHomeTeamReplacementText} ${quizOrReplacementText} ${quizAnswerAwayTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.HomeTeamAwayTeam,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: `${quizDrawReplacementText} ${quizOrReplacementText} ${quizAnswerAwayTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.AwayTeamDraw,\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder2_5,\n\t\tname: 'Over/Under 2.5',\n\t\tquestion: { text: 'Will there be 3 or more goals in the match?', trKey: 'quizQuestion_overUnder2_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder1_5Halftime,\n\t\tname: 'Over/Under 1.5 Halftime',\n\t\tquestion: { text: 'Will there be 2 or more goals in the first half?', trKey: 'quizQuestion_overUnder1_5Halftime' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder1_5__2ndHalf,\n\t\tname: 'Over/Under 1.5 2nd Half',\n\t\tquestion: { text: 'Will there be 2 or more goals in the second half?', trKey: 'quizQuestion_overUnder1_5__2ndHalf' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.RedCard,\n\t\tname: 'Red Card',\n\t\tquestion: { text: 'Will there be a red card in the match?', trKey: 'quizQuestion_redCard' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.TotalCorners8_5,\n\t\tname: 'Total Corners 8.5',\n\t\tquestion: { text: 'Will there be 9 or more corners in the match?', trKey: 'quizQuestion_totalCorners8_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.TotalCorners9_5,\n\t\tname: 'Total Corners 9.5',\n\t\tquestion: { text: 'Will there be 10 or more corners in the match?', trKey: 'quizQuestion_totalCorners9_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.Corners1x2,\n\t\tname: 'Corners 1x2',\n\t\tquestion: { text: 'Which team will have more corners in the match?', trKey: 'quizQuestion_corners1x2' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.One_Two,\n\t\tname: '1-2',\n\t\tquestion: { text: 'Who will win the match ?', trKey: 'quizQuestion_1-2' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.Overtime,\n\t\tname: 'Overtime',\n\t\tquestion: { text: 'Will there be overtime in the match?', trKey: 'quizQuestion_overtime' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OddEven,\n\t\tname: 'Odd/Even',\n\t\tquestion: {\n\t\t\ttext: 'Is the sum of all points scored in the game going to be an odd number or even?',\n\t\t\ttrKey: 'quizQuestion_oddEven',\n\t\t},\n\t\tanswers: [\n\t\t\t{ text: quizOddReplacementText, value: QuizAnswersValueType.Odd },\n\t\t\t{ text: quizEvenReplacementText, value: QuizAnswersValueType.Even },\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OddEvenHomeAway,\n\t\tname: 'Odd/Even Home/Away',\n\t\tquestion: {\n\t\t\ttext: 'Which team will win and what will be the sum of the points (Odd or Even)?',\n\t\t\ttrKey: 'quizQuestion_oddEvenHomeAway',\n\t\t},\n\t\tanswers: [\n\t\t\t{ text: `${quizAnswerHomeTeamReplacementText} - ${quizOddReplacementText}`, value: QuizAnswersValueType.HomeOdd },\n\t\t\t{ text: `${quizAnswerHomeTeamReplacementText} - ${quizEvenReplacementText}`, value: QuizAnswersValueType.HomeEven },\n\t\t\t{ text: `${quizAnswerAwayTeamReplacementText} - ${quizOddReplacementText}`, value: QuizAnswersValueType.AwayOdd },\n\t\t\t{ text: `${quizAnswerAwayTeamReplacementText} - ${quizEvenReplacementText}`, value: QuizAnswersValueType.AwayEven },\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FirstSet,\n\t\tname: 'First Set',\n\t\tquestion: { text: 'Who will win the first set ?', trKey: 'quizQuestion_firstSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.SecondSet,\n\t\tname: 'Second Set',\n\t\tquestion: { text: 'Who will win the second set ?', trKey: 'quizQuestion_secondSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.ThirdSet,\n\t\tname: 'Third Set',\n\t\tquestion: { text: 'Who will win the third set ?', trKey: 'quizQuestion_thirdSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FourthSet,\n\t\tname: 'Fourth Set',\n\t\tquestion: { text: 'Who will win the fourth set ?', trKey: 'quizQuestion_fourthSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FifthSet,\n\t\tname: 'Fifth Set',\n\t\tquestion: { text: 'Who will win the fifth set ?', trKey: 'quizQuestion_fifthSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.PlayerOneWinsOneSet,\n\t\tname: 'Player One Wins One Set',\n\t\tquestion: { text: 'Will Player One win at least one set?', trKey: 'quizQuestion_playerOneWinsOneSet' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.PlayerTwoWinsOneSet,\n\t\tname: 'Player Two Wins One Set',\n\t\tquestion: { text: 'Will Player Two win at least one set?', trKey: 'quizQuestion_playerTwoWinsOneSet' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.CustomNonSport,\n\t\tname: 'Custom question (non sport)',\n\t\tquestion: null,\n\t\tanswers: null,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.CustomSport,\n\t\tname: 'Custom question (sport)',\n\t\tquestion: null,\n\t\tanswers: null,\n\t},\n];\n","import { SAWGPMarketType } from './MarketsType';\nimport { QuizSportType } from './SportTypes';\n\nexport const QuizMarketPerSport = {\n\t[QuizSportType.Basketball]: [\n\t\tSAWGPMarketType.One_Two,\n\t\tSAWGPMarketType.Overtime,\n\t\tSAWGPMarketType.OneXTwo,\n\t\tSAWGPMarketType.OddEven,\n\t\tSAWGPMarketType.OddEvenHomeAway,\n\t\tSAWGPMarketType.DoubleChance,\n\t],\n\t[QuizSportType.Soccer]: [\n\t\tSAWGPMarketType.OneXTwo,\n\t\tSAWGPMarketType.OneXTwoHalftime,\n\t\t// SAWGPMarketType.HalftimeFulltime,\n\t\tSAWGPMarketType.FirstGoal,\n\t\tSAWGPMarketType.LastGoal,\n\t\tSAWGPMarketType.DoubleChance,\n\t\tSAWGPMarketType.OverUnder2_5,\n\t\tSAWGPMarketType.OverUnder1_5Halftime,\n\t\tSAWGPMarketType.OverUnder1_5__2ndHalf,\n\t\tSAWGPMarketType.RedCard,\n\t\tSAWGPMarketType.TotalCorners8_5,\n\t\tSAWGPMarketType.TotalCorners9_5,\n\t\tSAWGPMarketType.Corners1x2,\n\t],\n\t[QuizSportType.Tennis]: [\n\t\tSAWGPMarketType.One_Two,\n\t\tSAWGPMarketType.FirstSet,\n\t\tSAWGPMarketType.SecondSet,\n\t\tSAWGPMarketType.ThirdSet,\n\t\tSAWGPMarketType.FourthSet,\n\t\tSAWGPMarketType.FifthSet,\n\t\tSAWGPMarketType.PlayerOneWinsOneSet,\n\t\tSAWGPMarketType.PlayerTwoWinsOneSet,\n\t\tSAWGPMarketType.OddEven,\n\t],\n};\n","import { SAWTemplate } from \"../MiniGames\";\nimport { QuizAnswersValueType } from \"./MarketsAnswers\";\nimport { SAWGPMarketType } from \"./MarketsType\";\n\n/**\n * GamePickMarketType defines legacy market categories for MatchX events\n */\nexport enum GamePickMarketType {\n\t/** Predict the number of goals */\n\tGoals = 1,\n\t/** Predict the winner */\n\tWinner = 2,\n}\n\n/**\n * GamePickResolutionType defines how a user's prediction was scored after event resolution\n */\nexport enum GamePickResolutionType {\n\t/** Event not yet resolved */\n\tNone = 0,\n\t/** Prediction was wrong */\n\tLost = 2,\n\t/** Prediction was partially correct (e.g. correct winner but wrong score) */\n\tPartialWin = 3,\n\t/** Prediction was fully correct */\n\tFullWin = 4,\n}\n\n/**\n * GPRoundStatus defines the lifecycle stage of a game round\n */\nexport enum GPRoundStatus {\n\t/** Round is in an active/other state */\n\tOther = -1,\n\t/** Round exists but has no events defined yet */\n\tNoEventsDefined = 1,\n\t/** Betting deadline has passed, no more bets allowed */\n\tNoMoreBetsAllowed = 2,\n\t/** All events in the round are resolved, but the round itself is not finalized */\n\tAllEventsResolved_ButNotRound = 3,\n\t/** Round is fully resolved and scored */\n\tRoundResolved = 4,\n}\n\n/**\n * GamePickScoreType defines how scores are calculated for predictions\n */\nexport enum GamePickScoreType {\n\t/** Score based on exact match of predicted result */\n\tExactScore = 1,\n\t/** Score based on closeness (difference) of predicted result */\n\tPointsDifference = 2,\n}\n\n/**\n * GamePickSportType defines supported sport types for events, using Betradar sport IDs\n */\nexport enum GamePickSportType {\n\tSoccer = 1,\n\tBasketball = 2,\n\tBaseball = 3,\n\tIceHockey = 4,\n\tTennis = 5,\n\tHandball = 6,\n\tFloorball = 7,\n\tGolf = 9,\n\tBoxing = 10,\n\tMotorsport = 11,\n\tRugby = 12,\n\tAussieRules = 13,\n\tBandy = 15,\n\tAmericanFootball = 16,\n\tCycling = 17,\n\tSpecials = 18,\n\tSnooker = 19,\n\tTableTennis = 20,\n\tCricket = 21,\n\tDarts = 22,\n\tVolleyball = 23,\n\tFieldHockey = 24,\n\tWaterpolo = 26,\n\tCurling = 28,\n\tFutsal = 29,\n\tBadminton = 31,\n\tBowls = 32,\n\tChess = 33,\n\tBeachVolley = 34,\n\tNetball = 35,\n\tAthletics = 36,\n\tSquash = 37,\n\tLacrosse = 39,\n\tFormula1 = 40,\n\tAlpineSkiing = 43,\n\tBiathlon = 44,\n\tCrossCountry = 46,\n\tNordicCombined = 47,\n\tSkiJumping = 48,\n\tSchwingen = 56,\n\tBeachSoccer = 60,\n\tPesapallo = 61,\n\tESportCounterStrike = 109,\n\tESportLeagueofLegends = 110,\n\tESportDota = 111,\n\tStarCraft = 112,\n\tMMA = 117,\n\tCallOfDuty = 118,\n\tESportOverwatch = 121,\n\tESportRocketLeague = 128,\n\tIndyRacing = 129,\n\tSpeedway = 131,\n\tGaelicFootball = 135,\n\tGaelicHurling = 136,\n\tESporteSoccer = 137,\n\tKabaddi = 138,\n\tESporteBasketball = 153,\n\tBasketball3x3 = 155,\n\tESportArenaofValor = 158,\n\tTouringCarRacing = 188,\n\tMotorcycleRacing = 190,\n\tStockCarRacing = 191,\n}\n\n/**\n * GameRoundOrderType defines how events within a round are ordered for display\n */\nexport enum GameRoundOrderType {\n\t/** Display in the order events were added */\n\tHowAdded = 1,\n\t/** Display in reverse of the order events were added */\n\tHowAddedReversed = 2,\n\t/** Display ordered by event/match date ascending (earliest first) */\n\tEventDateAscending = 3,\n\t/** Display ordered by event/match date descending (latest first) */\n\tEventDateDescending = 4,\n}\n\n/** Round ID constant used to request the overall/seasonal leaderboard across all rounds */\nexport const AllRoundsGameBoardID = -1;\n\n/**\n * QuizEventMeta describes metadata for a quiz-type event (custom question with answer options)\n */\nexport interface QuizEventMeta {\n\t/** List of possible answer options for the quiz question */\n\tanswers?: {\n\t\t/** Answer identifier value sent on submission */\n\t\tvalue: string;\n\t\t/** Localized display text of the answer */\n\t\ttext: string;\n\t\t/** Per-language overrides for the answer text */\n\t\t_translations: {\n\t\t\t[key: string]: {\n\t\t\t\ttext: string;\n\t\t\t};\n\t\t};\n\t}[];\n\t/** URL of an image associated with the question */\n\tquestion_image?: string;\n\t/** Correct answer value after resolution */\n\tresult?: QuizAnswersValueType;\n\t/** Custom question text displayed to the user */\n\tcustom_question: string;\n}\n\n/**\n * GamePickEventMeta describes metadata for a MatchX or Quiz event, including team info and sport context\n */\nexport interface GamePickEventMeta extends QuizEventMeta {\n\t/** Display name of the event/match */\n\tevent_name?: string;\n\t/** Name of the first team (home) */\n\tteam1_name: string;\n\t/** URL of the first team's logo image */\n\tteam1_image: string;\n\t/** Name of the second team (away) */\n\tteam2_name: string;\n\t/** URL of the second team's logo image */\n\tteam2_image: string;\n\t/** Actual result score for team 1 after resolution */\n\tteam1_result?: number;\n\t/** Actual result score for team 2 after resolution */\n\tteam2_result?: number;\n\t/** Betradar sport type ID for the event */\n\tsport_type_id?: number;\n\t/** Whether the event has been canceled */\n\tis_canceled?: boolean;\n\t/** Whether auto-resolution from live data feed is enabled */\n\tauto_resolve_enabled?: boolean;\n\t/** ISO date string for when auto-resolution is expected */\n\tauto_resolve_date?: string;\n\t/** Auto-resolved score for team 1 from live data feed */\n\tteam1_auto_result?: number;\n\t/** Auto-resolved score for team 2 from live data feed */\n\tteam2_auto_result?: number;\n\t/** Auto-resolved answer value from live data feed (for quiz events) */\n\tauto_result?: string;\n\t/** Per-language overrides for team names, event name, and custom question */\n\t_translations: {\n\t\t[key: string]: {\n\t\t\tteam1_name: string;\n\t\t\tteam2_name: string;\n\t\t\tevent_name: string;\n\t\t\tcustom_question: string;\n\t\t};\n\t};\n}\n\n/**\n * GamePickEvent describes a single event (match or question) within a round, including the user's prediction and resolution\n */\nexport interface GamePickEvent {\n\t/** Unique identifier of the event */\n\tgp_event_id: number;\n\t/** Timestamp (ms) when the event was resolved, null if not yet resolved */\n\tevent_resolution_date: number;\n\t/** Timestamp (ms) of the match/event start time */\n\tmatch_date: number;\n\t/** Market type defining the prediction format (e.g. two-team score, quiz question, custom) */\n\tmarket_type_id: SAWGPMarketType;\n\t/** Event metadata containing team names, images, sport type, and question details */\n\tevent_meta: GamePickEventMeta;\n\t/** Whether the current user has submitted a prediction for this event */\n\tuser_placed_bet: boolean;\n\t/** User's predicted score for team 1 (MatchX only). Can be a number or a range object */\n\tteam1_user_selection?: number | { from: number; to: number };\n\t/** User's predicted score for team 2 (MatchX only). Can be a number or a range object */\n\tteam2_user_selection?: number | { from: number; to: number };\n\t/** User's selected answer (Quiz only). Value depends on market type (e.g. '1', '2', 'x', 'yes', 'no') */\n\tuser_selection?: QuizAnswersValueType;\n\t/** How the user's prediction was scored after resolution */\n\tresolution_type_id: GamePickResolutionType;\n\t/** Points awarded for this event based on prediction accuracy */\n\tresolution_score?: number;\n\t/** Whether this event is still accepting predictions */\n\tis_open_for_bets?: boolean;\n\t/** Betting odds details for the event outcomes */\n\todds_details?: { odd_value: { [key: string]: number } };\n\t/** URL of a question-specific image (quiz events) */\n\tquestion_image?: string;\n}\n\n/**\n * GamePickRoundPublicMeta describes the public-facing metadata and translations for a round, configured in the BackOffice\n */\nexport interface GamePickRoundPublicMeta {\n\t/** Localized round name */\n\tround_name: string;\n\t/** Localized round description */\n\tround_description: string;\n\t/** URL of the promotional image for the round */\n\tpromo_image: string;\n\t/** Promotional text displayed with the round */\n\tpromo_text: string;\n\t/** Whether to hide the round from the UI after it has been resolved */\n\thide_resolved_round: boolean;\n\t/** URL of the final screen image for desktop */\n\tfinal_screen_image_desktop: string;\n\t/** URL of the final screen image for mobile */\n\tfinal_screen_image_mobile: string;\n\t/** Message displayed on the final/results screen */\n\tfinal_screen_message: string;\n\t/** Label for the CTA button on the final screen */\n\tfinal_screen_cta_button_title: string;\n\t/** Deep link triggered by the CTA button on the final screen */\n\tfinal_screen_cta_dp: string;\n\t/** Whether users can edit their answers after initial submission (within betting window) */\n\tallow_edit_answers?: boolean;\n\t/** Per-language overrides for round display content */\n\t_translations: {\n\t\t[key: string]: {\n\t\t\tround_name: string;\n\t\t\tround_description: string;\n\t\t\tpromo_image: string;\n\t\t\tpromo_text: string;\n\t\t\tfinal_screen_image_desktop: string;\n\t\t\tfinal_screen_image_mobile: string;\n\t\t\tfinal_screen_message: string;\n\t\t\tfinal_screen_cta_button_title: string;\n\t\t};\n\t};\n}\n\n/**\n * GamePickRoundBase describes a game round's metadata (without events or user-specific data)\n */\nexport interface GamePickRoundBase {\n\t/** Unique round identifier */\n\tround_id: number;\n\t/** Sequential row ID used for ordering rounds */\n\tround_row_id: number;\n\t/** Localized display name of the round */\n\tround_name: string;\n\t/** Localized description of the round */\n\tround_description: string;\n\t/** Label for the CTA button on the final/results screen */\n\tfinal_screen_cta_button_title: string;\n\t/** Message displayed on the final/results screen */\n\tfinal_screen_message: string;\n\t/** URL of the final screen image (desktop) */\n\tfinal_screen_image_desktop: string;\n\t/** URL of the final screen image (mobile) */\n\tfinal_screen_image_mobile: string;\n\t/** URL of the promotional image for the round */\n\tpromo_image: string;\n\t/** Promotional text displayed with the round */\n\tpromo_text: string;\n\t/** Timestamp (ms) when the round opens for participation */\n\topen_date: number;\n\t/** Timestamp (ms) of the last moment bets are accepted */\n\tlast_bet_date: number;\n\t/** Timestamp (ms) when the round is expected to be resolved */\n\tresolution_date: number;\n\t/** Points awarded for a fully correct prediction */\n\tscore_full_win: number;\n\t/** Points awarded for a partially correct prediction */\n\tscore_part_win: number;\n\t/** Points awarded (or deducted) for an incorrect prediction */\n\tscore_lost: number;\n\t/** Whether the round is currently active for participation */\n\tis_active_now: boolean;\n\t/** Whether the round has been fully resolved and scored */\n\tis_resolved: boolean;\n\t/** Current lifecycle status of the round */\n\tround_status_id: GPRoundStatus;\n\t/** Total number of events in the round */\n\tevents_total: number;\n\t/** Number of events that have been resolved */\n\tevents_resolved: number;\n\t/** Scoring method used for this round */\n\tscore_type_id: GamePickScoreType;\n\t/** How events are ordered for display */\n\torder_events: GameRoundOrderType;\n\t/** Maximum number of users shown on the leaderboard */\n\tboard_users_count: number;\n\t/** Whether other users' predictions are hidden until resolution */\n\thide_users_predictions: boolean;\n\t/** Public metadata including translations and display settings from the BackOffice */\n\tpublic_meta: GamePickRoundPublicMeta;\n\t/** Timestamp (ms) when the next round opens, if available */\n\tnext_round_open_date: number;\n\t/** Whether to show aggregated user preference percentages for each outcome */\n\tshow_users_preference: boolean;\n}\n\n/**\n * GamePickRound describes a round with its events and the current user's prediction data\n */\nexport interface GamePickRound extends GamePickRoundBase {\n\t/** List of events (matches/questions) in this round */\n\tevents: GamePickEvent[];\n\t/** Current user's total score in this round */\n\tuser_score: number;\n\t/** Whether the current user has submitted any predictions in this round */\n\tuser_placed_bet: boolean;\n\t/** Whether there are events still open for betting */\n\thas_open_for_bet_events?: boolean;\n\t/** Whether the user has unsaved changes to their predictions */\n\thas_not_submitted_changes?: boolean;\n}\n\n/**\n * GamePickRoundBoard describes a round's leaderboard with ranked users\n */\nexport interface GamePickRoundBoard extends GamePickRoundBase {\n\t/** Current user's leaderboard entry, or null if user hasn't participated */\n\tmy_user: GamePickBoardUser;\n\t/** Ranked list of users on the leaderboard */\n\tusers: GamePickBoardUser[];\n}\n\n/**\n * GamePickBoardUser describes a user's entry on the round leaderboard\n */\nexport interface GamePickBoardUser {\n\t/** External user ID (Smartico numeric user ID) */\n\text_user_id: string;\n\t/** Internal user ID within the games system */\n\tint_user_id: number;\n\t/** Display name shown on the leaderboard */\n\tpublic_username: string;\n\t/** URL of the user's avatar image */\n\tavatar_url: string;\n\t/** User's rank position on the leaderboard, null if not yet ranked */\n\tgp_position: number;\n\t/** User's total score in this round/season */\n\tresolution_score: number;\n\t/** Number of fully correct predictions */\n\tfull_wins_count: number;\n\t/** Number of partially correct predictions */\n\tpart_wins_count: number;\n\t/** Number of incorrect predictions */\n\tlost_count: number;\n}\n\n/**\n * GamePickUserInfo describes the current user's profile in the games system\n */\nexport interface GamePickUserInfo {\n\t/** External user ID (Smartico numeric user ID) */\n\text_user_id: string;\n\t/** Internal user ID within the games system */\n\tint_user_id: number;\n\t/** Display name */\n\tpublic_username: string;\n\t/** URL of the user's avatar image */\n\tavatar_url: string;\n\t/** User's leaderboard rank position */\n\tgp_position?: number;\n\t/** Number of fully correct predictions */\n\tfull_wins_count?: number;\n\t/** Number of partially correct predictions */\n\tpart_wins_count?: number;\n\t/** User's total score */\n\tresolution_score?: number;\n\t/** Last time the user's balance was synced from the Smartico platform */\n\tlast_wallet_sync_time?: Date;\n\t/** User's current points balance */\n\tach_points_balance?: number;\n\t/** User's current gems balance */\n\tach_gems_balance?: number;\n\t/** User's current diamonds balance */\n\tach_diamonds_balance?: number;\n\t/** Whether the user has set a custom public username */\n\tpubic_username_set?: boolean;\n}\n\n/**\n * GamePickGameInfo describes the game configuration including SAW template, rounds list, and label settings\n */\nexport interface GamePickGameInfo {\n\t/** Game template configuration (SAW template) with UI settings, buy-in type, cost, and spin count */\n\tsawTemplate: SAWTemplate;\n\t/** List of all rounds (metadata only, no events) */\n\tallRounds: GamePickRoundBase[];\n\t/** Label/brand configuration and settings */\n\tlabelInfo: any;\n}\n\n/**\n * GamesApiResponse is the standard response wrapper for all GamePick/Quiz API calls\n */\nexport interface GamesApiResponse<T> {\n\t/** Error code: 0 on success, non-zero on failure */\n\terrCode: number;\n\t/** Human-readable error message when errCode is non-zero */\n\terrMessage?: string;\n\t/** Response payload, present on success */\n\tdata?: T;\n}\n\n/**\n * GamePickRequestParams describes the base parameters required for GamePick API calls\n */\nexport interface GamePickRequestParams {\n\t/** ID of the MatchX or Quiz game template */\n\tsaw_template_id: number;\n\t/** External user ID */\n\text_user_id: string;\n\t/** Smartico external user ID used for platform API calls */\n\tsmartico_ext_user_id: string;\n\t/** Language code for translations (e.g. 'EN', 'DE') */\n\tlang?: string;\n}\n\n/**\n * GamePickRoundRequestParams extends base params with a specific round ID\n */\nexport interface GamePickRoundRequestParams extends GamePickRequestParams {\n\t/** ID of the specific round */\n\tround_id: number;\n}\n","enum JackpotContributionType {\n\tFixed = 1,\n\tPercentage = 2,\n}\n\nexport { JackpotContributionType };\n","enum JackPotTemparature {\n\t/** cold, seed amount < current pot < (min amount - seed amount)/2 */\n\tCOLD = 0,\n\t/** warm, (min amount - seed amount)/2 < current pot < min amount */\n\tWARM = 1,\n\t/** hot, current pot > min amount, entered explosion range */\n\tHOT = 2,\n\t/** burning, current pot > min amount + 0.5 * (max amount - min amount). E.g. mid of allowed explosion range */\n\tBURNING = 3,\n}\n\n/**\n * Live snapshot of one jackpot pot's value and temperature.\n * Embedded on `JackpotDetails.pot`; refreshed at the 1 s SDK cache TTL.\n */\ninterface JackpotPot {\n\t/** Template ID this pot belongs to. */\n\tjp_template_id: number;\n\t/** Stable numeric ID of the current pot instance (rotates when the pot explodes). */\n\tjp_pot_id: number;\n\t/** Current pot amount in the jackpot's native currency (`jp_currency`). */\n\tcurrent_pot_amount: number;\n\t/** Current pot amount converted to the user's wallet currency (`user_currency`). */\n\tcurrent_pot_amount_user_currency: number;\n\t/** Unix ms timestamp of when this pot last exploded; `0` if it has never exploded. */\n\texplode_date_ts: number;\n\t/** Heat band of the pot relative to its explosion range; see {@link JackPotTemparature}. */\n\tcurrent_pot_temperature: JackPotTemparature;\n}\n\nexport { JackpotPot, JackPotTemparature };\n","enum JackpotType {\n\tMultiUser = 1,\n\tPersonal = 2,\n}\n\nexport { JackpotType };\n","/**\n * Limit error codes returned in `errCode` by the `avatarsCustomize` method.\n * See the `avatarsCustomize` TSDoc for the full table (including the generic\n * `-1` failure, which has no named member here).\n */\nexport enum AvatarCustomizeErrorCode {\n\t/** The user has reached the operator-configured per-user monthly cap on custom-avatar generations. */\n\tAVATAR_USER_LIMIT = 12001,\n\t/** The brand's operator-configured shared monthly pool of custom-avatar generations is exhausted. */\n\tAVATAR_LABEL_LIMIT = 12002,\n}\n","/**\n * Error codes returned in `errCode` by the `joinClan` method (also carried\n * on `TClanJoinResult`). These are terse value definitions for lookup; the\n * full per-code narrative and UI handling lives in the `joinClan` method\n * TSDoc, which owns the error table.\n */\nexport enum JoinClanErrorCode {\n\t/** Success — join completed; entry fee (if any) deducted. */\n\tJOIN_CLAN_OK = 0,\n\t/** Request was malformed (missing or invalid parameters). */\n\tJOIN_CLAN_INVALID_PARAMETERS = 1000,\n\t/** Clan doesn't exist for this label. Archived clans are also reported as `1001`. */\n\tJOIN_CLAN_NOT_FOUND = 1001,\n\t/** Clan is full — member capacity reached. */\n\tJOIN_CLAN_FULL = 1002,\n\t/** Insufficient balance for the entry fee (points / gems / diamonds). */\n\tJOIN_CLAN_INSUFFICIENT_FUNDS = 1003,\n\t/** User doesn't meet the clan's entry segment or conditions. */\n\tJOIN_CLAN_SEGMENT_MISMATCH = 1004,\n\t/**\n\t * User is not in a clan. Note: a `registerInTournament` response code\n\t * that shares this enum — never returned by `joinClan`.\n\t */\n\tJOIN_CLAN_USER_IS_NOT_IN_CLAN = 1005,\n\t/** User is within the clan-switch cooldown window (switch only). */\n\tJOIN_CLAN_COOLDOWN_ACTIVE = 1006,\n\t/**\n\t * Clan joined after tournament start. Note: a `registerInTournament`\n\t * response code that shares this enum — never returned by `joinClan`.\n\t */\n\tJOIN_CLAN_JOINED_AFTER_TOURNAMENT_START = 1011,\n}\n"],"names":["ClassId","IntUtils","uuid","a","b","Math","random","toString","isNotNull","val","isNotEmpty","length","replaceAll","value","regex","replacement","replace","RegExp","escapeRegExp","v","JsonOrText","str","includes","JSON","parse","e","isWithinPeriod","timestamp","period","now","Date","completedDate","getFullYear","getMonth","getDate","startOfWeek","setDate","getDay","setHours","endOfWeek","SAWBuyInType","SAWBuyInTypeName","SAWBuyInTypeNamed","type","_SAWBuyInType$Free$SA","Free","Points","Spins","Gems","Diamonds","Unknown","SAWUtils","canPlay","t","user_balances","undefined","saw_buyin_type_id","spin_count","balance","ach_points_balance","ach_gems_balance","ach_diamonds_balance","buyin_cost_points","console","error","SAWAcknowledgeType","SAWAcknowledgeTypeName","SAWAcknowledgeTypeNamed","_SAWAcknowledgeType$S","Silent","QuickMessage","FullMessage","ExplicityAcknowledge","SAWAskForUsername","SAWGameType","SAWGameTypeName","SAWGameTypeNamed","_SAWGameType$SpinAWhe","SpinAWheel","ScratchCard","MatchX","GiftBox","PrizeDrop","Quiz","LootboxWeekdays","LootboxCalendarDays","TreasureHunt","Voyager","Plinko","CoinFlip","CustomMinigame","SAWExposeUserSpinId","SAWExposeUserSpinIdName","SAWExposeUserSpinIdNamed","id","_SAWExposeUserSpinId$","UserId","SpinId","SAWGameLayout","SAWGameLayoutName","SAWGameLayoutNamed","layout","_SAWGameLayout$Horizo","Horizontal","VerticalMap","SAWPrizeType","MiniGamePrizeTypeName","MiniGamePrizeTypeNamed","_SAWPrizeType$NO_PRIZ","NO_PRIZE","POINTS","BONUS","MANUAL","SPIN","JACKPOT","CHANGE_LEVEL","MISSION","RAFFLE_TICKET","GEMS_AND_DIAMONDS","UNKNOWN","SAWTemplatesTransform","items","map","r","_r$saw_skin_ui_defini","x","_extends","saw_template_id","name","saw_template_ui_definition","description","thumbnail","saw_skin_ui_definition","skin_folder","saw_skin_key","visibile_when_can_spin","over_limit_message","no_attempts_message","jackpot_symbol","saw_game_type","saw_game_type_id","saw_buyin_type","buyin_cost_gems","buyin_cost_diamonds","jackpot_add_on_attempt","jackpot_current","promo_image","promo_text","custom_data","expose_game_stat_on_api","relative_period_timezone","activeFromDate","activeTillDate","next_available_spin_ts","steps_to_finish_game","custom_section_id","game_layout","show_prize_history","max_number_of_attempts","maxSpinsCount","max_spins_period_ms","maxSpinsPediodMs","expose_user_spin_id","prizes","p","_p$saw_prize_ui_defin","y","saw_prize_id","saw_prize_ui_definition","prize_type","prize_type_id","prize_value","font_size","font_size_mobile","icon","position","sectors","acknowledge_type","aknowledge_message","acknowledge_dp","acknowledge_action_title","acknowledge_dp_additional","acknowledge_action_title_additional","out_of_stock_message","pool","pool_initial","wins_count","weekdays","active_from_ts","active_till_ts","is_surcharge","is_deleted","prize_modifiers","allow_split_decimal","hide_prize_from_history","requirements_to_get_prize","max_give_period_type_id","SAWSpinErrorCode","SAWWinSoundType","SAWWinSoundFiles","_SAWWinSoundFiles","NoSound","Disappointing","Positive","HighlyPositive","SAWHistoryTransform","template","prize_amount","client_request_id","is_claimed","create_date_ts","acknowledge_date_ts","PrizeModifiers","PrizeModifiersKeysNames","_PrizeModifiersKeysNa","SAWWheelLayout","SAWGameDifficultyType","SAWGameDifficultyTypeName","SawGameDifficultyTypeNamed","_SAWGameDifficultyTyp","EASY","MEDIUM","HARD","AttemptPeriodType","NodeCache","_this","ttlChecker","cache","setInterval","getTime","key","hasOwnProperty","o","ttl","_proto","prototype","get","set","ttlSeconds","remove","flushAll","clearInterval","ECacheContext","OCache","init","cacheContext","oKey","stringify","deepClone","use","f","Promise","resolve","_temp","then","_f2","reject","clear","clearContext","_this2","clearAll","_this3","ActivityTypeLimited","CoreUtils","currencySymbol","currency","_USD$EUR$JPY$GBP$AUD$","toUpperCase","USD","EUR","JPY","GBP","AUD","CAD","CHF","CNY","SEK","NZD","MXN","SGD","HKD","NOK","KRW","TRY","INR","RUB","BRL","ZAR","avatarUrl","avatar_id","avatarDomain","startsWith","endsWith","slice","PublicLabelSettings","TranslationArea","InboxMessagesTransform","item","sent_date","createDate","message_guid","engagement_uid","read","is_read","favorite","is_starred","category_id","expire_on_dt","InboxMessageBodyTransform","action","image","title","preview_body","body","additional_buttons","buttons","text","inbox_cta_text","html_body","InboxMessageType","OpenLinksType","InboxCategories","InboxReadStatus","BuyStoreItemErrorCode","StoreCategoryTransform","_r$publicMeta","_r$publicMeta2","publicMeta","order","StoreItemPurchaseType","StoreItemType","StoreItemTypeName","StoreItemTypeNamed","_StoreItemType$Bonus$","Bonus","Tangible","MiniGameSpin","ChangeLevel","RaffleTicket","mapPurchaseType","purchaseType","StoreItemTransform","filter","_r$itemPublicMeta$pri","_r$categoryIds","_r$relatedGames","itemPublicMeta","purchase_type","price","image_url","ribbon","label_tag","custom_label_tag","limit_message","purchase_limit_message","priority","related_item_ids","related_items","hint_text","itemTypeId","can_buy","canBuy","category_ids","categoryIds","shopPool","active_till_date","show_timer","discounted_price","discount_prize","discount_price_ribbon","discount_prize_ribbon","custom_ribbon_image","only_in_custom_section","custom_section_type_id","cant_buy_message","related_games","relatedGames","g","game_public_meta","enabled","i","ext_game_id","link","game_categories","game_provider","mobile_spec_link","StoreItemPurchasedTransform","purchasedToday","purchase_ts","purchasedThisWeek","purchasedThisMonth","purchase_points_amount","purchased_today","purchased_this_week","purchased_this_month","AchievementStatus","AchievementTaskType","AchievementType","AchievementAvailabilityStatus","BadgesTimeLimitStates","USER_STATE_PARAMS_KEYS_GAMES","USER_STATE_PARAMS_KEYS_BET_AMOUNT","MINOR_WORDS","Set","toGameTitleCase","raw","tokens","toLowerCase","split","wordTokens","test","lastWordIdx","wordIndex","token","isFirst","isLast","has","charAt","join","MissionUtils","getAvailabilityStatus","mission","activeFrom","getMs","activeTill","startDate","start_date_ts","timeLimit","time_limit_ms","requiresOptIn","requiresOptin","optedIn","isOptedIn","isLockedMission","ach_status_id","AvailableLocked","isLocked","AvailableActive","AvailableInactive","Available","UnavailableWithActiveFrom","AvailableWithActiveTillActive","AvailableWithActiveTillInactive","AvailableWithActiveTill","MissedByActiveTill","endDate","AvailableLimitedActive","MissedByLimitInTime","AvailableLimitedInactive","AvailableLimited","AvailableFullyLimitedActive","AvailableFullyLimitedInactive","AvailableFullyLimited","ts","replaceTagsFavMissionTask","_ref","_task$task_public_met","task","valueToReplace","result","userStateParams","user_state_params","userStateOperator","task_public_meta","user_state_operations","userStateParamsKeys","Object","keys","operatorsMulti","operatorsPos","suggestedGames","suggestedValue","forEach","k","_userStateOperator$k","operator","op","_userStateParams$k","Boolean","cleaned","pos","Number","currencyFromTheTask","core_wallet_currency","replaceFavGameNameTag","_ref2","determineBadgeState","badge","progress","isCompleted","complete_date_ts","BeforeStartDate","AfterStartDateNoProgress","AfterStartDateNoProgressAndEndDate","AfterStartDateWithProgressAndEndDate","AfterEndDateNotStarted","AfterEndDateWithProgress","enrichUserAchievementsWithBadgeState","ach_type_id","Badge","badgeTimeLimitState","UserAchievementTransform","ach_id","_missionName","_missionSubHeader","_missionDescription","_r$ach_categories","completedToday","completedThisWeek","completedThisMonth","missionName","ach_public_meta","missionSubHeader","sub_header","missionDescription","achievementTasks","_r$ach_public_meta$na","_r$ach_public_meta$su","_r$ach_public_meta$de","unlock_mission_description","is_completed","is_locked","is_requires_optin","is_opted_in","dt_start","reward","Mission","cta_action","cta_text","tasks","task_type_id","CompleteAchievement","_t$task_public_meta","task_id","points_reward","gems_reward","diamonds_reward","userProgress","execution_count_expected","executionCount","execution_count_actual","userExecutedCount","display_progress_as_count","stage_image","ach_categories","ach_completed_id","requires_prize_claim","prize_claimed_date_ts","complete_date","completed_today","completed_this_week","completed_this_month","availability_status","claim_button_title","claim_button_action","hide_locked_mission","prize_claim_expiration_date","prize_claim_period_type_id","Recurring","next_recurrence_date_ts","milliseconds_till_available","RecurringUponCompletion","completion_count","completed_count","max_completion_count","recurring_quantity","ScheduledMissionType","AchCategoryTransform","MissionCategory","AchievementClaimPeriodTypeId","clanTournamentPlayersTransform","response","clan_id","clan_public_meta","players","user_id","userId","clean_ext_user_id","cleanExtUserId","public_username","userAltName","avatar_real_id","avatar_url","scores","is_me","isMe","TournamentRegistrationType","TournamentRegistrationTypeGetName","_TournamentRegistrati","AUTO","BUY_IN_POINTS","MANUAL_APPROVAL","OPT_IN","REQUIRES_QUALIFICATION","BUY_IN_GEMS","BUY_IN_DIAMONDS","TournamentRegistrationStatus","TournamentRegistrationStatusName","TournamentRegistrationStatusNamed","CANCELLED","FINISHED","NOT_REGISTERED","PENDING","QUALIFIED_PENDING_REGISTRATION","REGISTERED","REGISTERED_PENDING_QUALIFICATION","TournamentInstanceStatus","TournamentInstanceStatusName","s","_TournamentInstanceSt","PUBLISHED","REGISTER","STARTED","FAILED","FINALIZING","tournamentPrizeTypeToPrizeName","_ActivityTypeLimited$","DoNothing","DeductPoints","ResetPoints","MiniGameAttempt","AddGemsAndDiamonds","DeductGemsAndDiamonds","ResetGemsAndDiamonds","TournamentUtils","isCanRegister","tournament","tournamentRegistrationStatus","isUserRegistered","playersMaxCount","registrationCount","registrationType","tournamentInstanceStatus","allowLateRegistration","isInProgress","isActive","isFinished","isCancelled","isUpcoming","getPlayerTransformed","player","playerTransformed","user_ext_id","crm_brand_id","crmBrandId","getPrizeTransformed","prize","TournamentItemsTransform","tournamentId","instance_id","tournamentInstanceId","tournament_id","segment_dont_match_message","image1","image2","image_url2","image2_mobile","image_url2_mobile","prize_pool_short","custom_price_text","is_featured","featured","start_time","startTimeTs","end_time","endTimeTs","registration_count","is_user_registered","players_min_count","playersMinCount","players_max_count","registration_status","registration_type","registration_cost_points","buyInAmount","registration_cost_gems","registration_cost_diamonds","duration_ms","durationMs","is_active","is_can_register","is_cancelled","is_finished","is_in_progress","is_upcoming","min_scores_win","minScoreToWin","hide_leaderboard_min_scores","hideLeaderboardsMinScores","total_scores","totalScores","is_clan_based","isClanBased","prizeStructure","tournamentPlayer","me","tournamentInfoItemTransform","_TournamentItemsTrans","_t$tournamentInfo$tou","_t$tournamentInfo","_t$tournamentInfo2","tournamentInfo","tournamentLobbyInfo","userPosition","_t$userClanId","user_clan_id","userClanId","clan_leaderboard","clanLeaderboard","entry","clanId","public_meta","rank","total_score","totalScore","contributing_members","memberCount","clan_prize_structure","clanPrizes","clan_place","prize_pool_amount","prize_pool_currency_code","activity_type_id","details_json","prize_name","tiers","player_tiers","tier","player_place_from","player_place_to","pool_amount","distribution_type","TournamentRegistrationError","TournamentType","LeaderBoardPeriodType","pointsRewardTransform","reward_points","place","points","getLeaderBoardPlayerTransformed","user","user_alt_name","level_id","position_in_board","points_accumulated","getLeaderBoardTransform","board","board_id","board_public_meta","rules","period_type_id","version_id","versiod_id","create_date","rewards","users","positions","GetLevelMapResponseTransform","levels","mapped","l","_l$level_public_meta","level_public_meta","required_points","visibility_points","parseInt","required_level_counter_1","required_level_counter_2","ordinal_position","ordinalById","Map","concat","sort","index","CACHE_DATA_SEC","JACKPOT_TEMPLATE_CACHE_SEC","JACKPOT_POT_CACHE_SEC","JACKPOT_WINNERS_CACHE_SEC","JACKPOT_ELIGIBLE_GAMES_CACHE_SEC","onUpdateContextKey","WSAPIBase","api","userExtId","onUpdateCallback","clearCaches","updateEntity","contextKey","payload","WSAPI","onUpdate","ticketsTransform","ticekt_id","ticket_id_string","winnersTransform","username","ticket","raf_won_id","claimed_date","prizeTransform","prize_id","prizes_per_run","prizes_per_run_actual","chances_to_win_perc","min_required_total_tickets","cap_prizes_per_run","stock_items_per_draw","should_claim","winners","requires_claim","min_required_tickets_for_user","drawTransform","draw_id","image_url_mobile","icon_url","background_image_url","background_image_url_mobile","is_grand","current_state","run_id","execution_type","execution_ts","previous_run_ts","previous_run_id","ticket_start_ts","allow_multi_prize_per_ticket","total_tickets_count","my_tickets_count","my_last_tickets","user_opted_in","requires_optin","winners_limit","winners_offset","winners_total","raffleTransform","raffle_id","start_date","end_date","end_date_ts","max_tickets_count","current_tickets_count","draws","ticket_cap_visualization","drawRunTransform","res","_res$draw$ticket_star","draw","RaffleTicketCapVisualization","RaffleDrawInstanceState","RaffleDrawTypeExecution","drawRunHistoryTransform","draw_runs","actual_execution_ts","is_winner","has_unclaimed_prize","raffleClaimPrizeResponseTransform","info","errorCode","errCode","errorMessage","errMsg","WSAPIUser","_WSAPIBase","apply","arguments","_inheritsLoose","getUserProfile","tracker","assign","userPublicProps","Error","checkSegmentMatch","segment_id","coreCheckSegments","find","is_matching","checkSegmentListMatch","segment_ids","Array","isArray","getLevels","Levels","levelsGetT","getCurrentLevel","_this4","CurrentLevel","getLevelCurrent","getUserLevelExtraCounters","_this5","LevelExtraCounters","getUserGamificationInfoT","getActivityLog","startTimeSeconds","endTimeSeconds","from","to","_this6","ActivityLog","getActivityLogT","notifyActivityLogUpdate","_this7","startSeconds","endSeconds","WSAPIGeneral","_WSAPIUser","getCustomSections","CustomSections","customSectionsGetT","getTranslations","lang_code","getTranslationsT","translations","getRelatedItemsForGame","related_game_id","WSAPIMissions","_WSAPIGeneral","getMissions","Missions","missionsGetItemsT","getBadges","Badges","badgetsGetItemsT","getAchCategories","AchCategories","achGetCategoriesT","requestMissionOptIn","mission_id","missionOptIn","err_code","err_message","requestMissionClaimReward","missionClaimPrize","updateMissions","WSAPIBonuses","_WSAPIMissions","getBonuses","Bonuses","bonusesGetItemsT","claimBonus","bonus_id","bonusClaimItem","success","updateBonuses","WSAPIStore","_WSAPIBonuses","_len","args","_key","call","storeHistoryOnUpdateParams","limit","offset","storeHistoryCacheKey","StoreHistory","getStoreItems","StoreItems","storeGetItemsT","buyStoreItem","item_id","getStoreCategories","StoreCategories","storeGetCategoriesT","getStorePurchasedItems","_temp2","requestLimit","requestOffset","cacheKey","storeGetPurchasedItemsT","updateStorePurchasedItems","updateStoreItems","WSAPITournaments","_WSAPIStore","getTournamentsList","TournamentList","tournamentsGetLobbyT","getTournamentInstanceInfo","tournamentsGetInfoT","getClanTournamentPlayers","clanTournamentGetPlayers","registerInTournament","updateTournaments","WSAPIClans","_WSAPITournaments","getClans","Clans","clansGetListT","getClanInfo","clansGetInfoT","joinClan","clanJoin","updateClans","WSAPIJackpots","_WSAPIClans","jackpotGetSignature","jackpotClearCache","Jackpots","Pots","JackpotWinners","jackpotGet","signature","jp_template_id","jackpots","pots","_jackpots","_pots","jp","pot","jp_public_meta","_OCache$use","_jp","jp_template_ids","potGet","_this2$api$potGet","_OCache$use2","jackpotOptIn","jackpotOptOut","getJackpotWinners","getJackpotWinnersT","getJackpotEligibleGames","JackpotEligibleGames","getJackpotEligibleGamesT","WSAPIRaffles","_WSAPIJackpots","updateRaffles","getRafflesT","Raffles","getRaffles","getRaffleDrawRun","props","getRaffleDrawRunT","winners_from","winners_to","getRaffleDrawRunsHistory","claimRafflePrize","won_id","requestRaffleOptin","raffle_run_id","raffleOptin","getRaffleWonPrizes","_props$offset","_props$limit","WSAPIMiniGames","_WSAPIRaffles","getMiniGames","Saw","sawGetTemplatesT","getMiniGamesHistory","SAWHistory","getSawWinningHistoryT","playMiniGame","template_id","_ref3","sawSpinRequest","miniGameWinAcknowledgeRequest","request_id","doAcknowledgeRequest","playMiniGameBatch","_temp3","_ref4","sawSpinBatchRequest","request_ids","results","doAcknowledgeBatchRequest","errMessage","jackpot_amount","first_spin_in_period","updateOnSpin","data","templates","findIndex","reloadMiniGameTemplate","updatedTemplates","WSAPIAvatars","_WSAPIMiniGames","getAvatarsList","AvatarsList","avatarsGetListT","getAvatarsCustomized","AvatarsCustomized","avatarsGetCustomizedT","getAvatarPrompts","AvatarPrompts","avatarsGetPromptsT","setAvatar","avatarSetAvatar","_r$errCode","avatarsCustomize","required","_i","_required","field","cdn_url","WSAPIGamePick","_WSAPIAvatars","gamePickGetActiveRounds","gpGetActiveRounds","gamePickGetActiveRound","round_id","gpGetActiveRound","gamePickGetHistory","gpGetGamesHistory","gamePickGetBoard","gpGetGameBoard","gamePickSubmitSelection","_props$round","round","gpSubmitSelection","gamePickSubmitSelectionQuiz","_props$round2","gamePickGetUserInfo","gpGetUserInfo","gamePickGetGameInfo","_this8","gpGetGameInfo","gamePickGetRoundInfoForUser","_this9","int_user_id","gpGetRoundInfoForUser","WSAPILeaderBoard","_WSAPIGamePick","getLeaderBoard","periodType","getPreviousPeriod","LeaderBoards","leaderboardsGetT","getLeaderBoards","leaderboardsGetListT","WSAPIInbox","_WSAPILeaderBoard","reportImpressionEvent","activityType","reportEngagementImpression","reportClickEvent","reportEngagementAction","getInboxMessages","onlyFavorite","categoryId","read_status","InboxMessages","getInboxMessagesT","getInboxUnreadCount","InboxUnreadCount","getInboxUnreadCountT","getInboxMessageBody","messageGuid","getInboxMessageBodyT","markInboxMessageAsRead","markInboxMessageRead","markAllInboxMessagesAsRead","markAllInboxMessageRead","markUnmarkInboxMessageAsFavorite","mark","deleteInboxMessage","deleteAllInboxMessages","updateInboxUnreadCount","count","updateInboxMessages","_this0","_WSAPIInbox","on","SAW_SPINS_COUNT_PUSH","SAW_SHOW_SPIN_PUSH","SAW_AKNOWLEDGE_RESPONSE","SAW_DO_SPIN_RESPONSE","MISSION_OPTIN_RESPONSE","ACHIEVEMENT_CLAIM_PRIZE_RESPONSE","RELOAD_ACHIEVEMENTS_EVENT","TOURNAMENT_REGISTER_RESPONSE","BUY_SHOP_ITEM_RESPONSE","CLIENT_ENGAGEMENT_EVENT_NEW","LOGOUT_RESPONSE","IDENTIFY_RESPONSE","JP_WIN_PUSH","_data","JP_OPTOUT_RESPONSE","JP_OPTIN_RESPONSE","CLAIM_BONUS_RESPONSE","SAW_DO_SPIN_BATCH_RESPONSE","RAF_CLAIM_PRIZE_RESPONSE","GET_INBOX_MESSAGES_RESPONSE","unread_count","CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT","_data$props","_data$props2","_data$props3","_data$props4","_data$props5","core_inbox_unread_count","RAF_OPTIN_RESPONSE","AchCustomSectionType","AchCustomLayoutTheme","AchMissionsTabsOptions","AchOverviewMissionsFilter","LiquidEntityData","UICustomSectionTransform","customSections","section_type_id","menu_img","menu_name","custom_skin_images","generic_custom_css","mission_tabs_options","overview_missions_count","overview_missions_filter","url_or_dp","theme","LEVELS","liquid_entity_data","ach_tournament_id","show_raw_data","liquid_template","BADGES","ach_category_ids","STORE","shop_category_ids","push","BonusItemsTransform","is_redeemable","redeemable","redeem_date","redeemDate","label_bonus_template_id","labelBonusTemplateId","bonus_status_id","bonusStatusId","label_bonus_template_meta_map","labelBonusTemplateMetaMap","bonus_meta_map","bonusMetaMap","BonusStatus","UserBalanceType","ActivityLogTransform","_item$type","itemTransformed","source_type_id","amount","points_collected","user_points_balance","total_ever","user_points_ever","PointChangeSourceType","avatarDefinitionTransform","is_default","hide_until_achieved","url","avatar_source_type_id","active_from_date","is_given","is_in_use","avatarCustomizedTransform","dt_created","avatarPromptTransform","prompt_id","cost_currency_type_id","cost_value","GetJackpotWinnersResponseTransform","winnerInfo","winner","win_date_ts","jp_pot_id","GetJackpotEligibleGamesResponseTransform","eligible_games","games","game","game_id","ach_game_id","recover","PUBLIC_API_URL","C_SOCKET_PROD","GAMES_API_URL","AVATAR_DOMAIN","DEFAULT_LANG_EN","SMR_TO_CLOUDFRONT_DOMAINS","SMR_DOMAIN_REGEX","d","SmarticoAPI","label_api_key","brand_api_key","messageSender","options","_options$tracker","_options$tracker2","publicUrl","wsUrl","inboxCdnUrl","partnerUrl","gamesApiUrl","baseRgApiParams","avatarOriginDomain","envId","logger","logCIDs","logHTTPTiming","always","getPublicUrl","getPublicWsUrl","env_id","String","getEnvId","brand_key","params","hash","getAvatarUrl","getAvatarOriginUrl","getCleanLabelApiKey","getEnvDnsSuffix","ENV_ID","substring","replaceSmrDomainsWithCloudfront","isString","source","replaced","match","err","send","message","expectCID","force_language","_result","_exit","cid","_iterator","_createForOfIteratorHelperLoose","_step","done","obj","request","_catch","timeStart","_this$messageSender","errSetup","timeEnd","warn","buildMessage","api_key","ext_user_id","coreReportCustomEvent","eventType","eventMessage","EVENT","EVENT_RESPONSE","coreGetTranslations","areas","cacheSec","trim","Translations","tsBaseRQ","GET_TRANSLATIONS_REQUEST","hash_code","GET_TRANSLATIONS_RESPONSE","trBase","trUserRQ","trUser","_trUser$translations","coreIdentifyLabel","LabelInfo","INIT","INIT_RESPONSE","coreIdentifyUser","IDENTIFY","coreChangeUsername","public_username_custom","CLIENT_SET_CUSTOM_USERNAME_REQUEST","CLIENT_SET_CUSTOM_USERNAME_RESPONSE","CHECK_SEGMENT_MATCH_REQUEST","CHECK_SEGMENT_MATCH_RESPONSE","segments","CLIENT_ENGAGEMENT_IMPRESSION_REQUEST","CLIENT_ENGAGEMENT_ACTION_REQUEST","JP_GET_JACKPOTS_REQUEST","JP_GET_JACKPOTS_RESPONSE","JP_GET_LATEST_POTS_REQUEST","JP_GET_LATEST_POTS_RESPONSE","JP_OPTIN_REQUEST","_this1","JP_OPTOUT_REQUEST","_this10","JP_GET_WINNERS_REQUEST","JP_GET_WINNERS_RESPONSE","_this11","_this11$getJackpotWin","_this12","JP_GET_ELIGIBLE_GAMES_REQUEST","JP_GET_ELIGIBLE_GAMES_RESPONSE","_this13","sawGetTemplates","is_visitor_mode","_this14","SAW_GET_SPINS_REQUEST","SAW_GET_SPINS_RESPONSE","_t$saw_template_ui_de","_t$saw_template_ui_de2","jackpotValue","_this15","_this15$sawGetTemplat","_this16","SAW_AKNOWLEDGE_REQUEST","_this17","SAW_DO_SPIN_REQUEST","spinAttemptResponse","_SAWSpinErrorCode$SAW","status","SAW_OK","SAW_NO_SPINS","SAW_PRIZE_POOL_EMPTY","SAW_NOT_ENOUGH_POINTS","SAW_FAILED_MAX_SPINS_REACHED","SAW_TEMPLATE_NOT_ACTIVE","SAW_NOT_IN_SEGMENT","SAW_NO_BALANCE_GEMS","SAW_NO_BALANCE_DIAMONDS","_this18","SAW_AKNOWLEDGE_BATCH_RESPONSE","spins_count","_this19","spins","SAW_DO_SPIN_BATCH_REQUEST","getSawWinningHistory","_this20","GET_SAW_HISTORY_REQUEST","GET_SAW_HISTORY_RESPONSE","_this21","_this21$getSawWinning","_this22","MISSION_OPTIN_REQUEST","achievementId","_this23","ACHIEVEMENT_CLAIM_PRIZE_REQUEST","_this24","TOURNAMENT_REGISTER_REQUEST","itemId","_this25","BUY_SHOP_ITEM_REQUEST","inboxGetMessages","_this26","GET_INBOX_MESSAGES_REQUEST","storeGetItems","_this27","GET_SHOP_ITEMS_REQUEST","GET_SHOP_ITEMS_RESPONSE","_this28","_this28$storeGetItems","storeGetCategories","_this29","GET_SHOP_CATEGORIES_REQUEST","GET_SHOP_CATEGORIES_RESPONSE","_this30","_this30$storeGetCateg","categories","storeGetPurchasedItems","_this31","ACH_SHOP_ITEM_HISTORY_REQUEST","ACH_SHOP_ITEM_HISTORY_RESPONSE","_this32","_this32$storeGetPurch","missionsGetItems","_this33","GET_ACHIEVEMENT_MAP_REQUEST","GET_ACHIEVEMENT_MAP_RESPONSE","responseClone","achievements","_this34","_this34$missionsGetIt","getUserGamificationInfo","_this35","GET_ACHIEVEMENT_USER_REQUEST","GET_ACHIEVEMENT_USER_RESPONSE","_this36","level_counter_1","level_counter_2","achGetCategories","_this37","GET_ACH_CATEGORIES_REQUEST","GET_ACH_CATEGORIES_RESPONSE","_this38","_this38$achGetCategor","badgetsGetItems","_this39","bonusesGetItems","_this40","GET_BONUSES_REQUEST","GET_BONUSES_RESPONSE","_this41","CLAIM_BONUS_REQUEST","bonusId","_this42","_this42$bonusesGetIte","bonuses","_this43","_this43$badgetsGetIte","tournamentsGetLobby","_this44","GET_TOURNAMENT_LOBBY_REQUEST","GET_TOURNAMENT_LOBBY_RESPONSE","_this45","_this45$tournamentsGe","tournaments","clansGetList","_this46","GET_CLAN_LIST_REQUEST","GET_CLAN_LIST_RESPONSE","_this47","_response$join_date","clans","cooldown_until","join_date","clansGetInfo","_this48","GET_CLAN_INFO_REQUEST","GET_CLAN_INFO_RESPONSE","_this49","_c$cooldown_until","c","clanInfo","member_count","capacity_limit","entry_fee_currency_type_id","entry_fee_amount","rating_position","rating_score","members","m","contribution_score","joinSourceId","_this50","JOIN_CLAN_REQUEST","join_source_id","JOIN_CLAN_RESPONSE","_response$errCode","_response$errMsg","tournamentsGetInfo","_this51","GET_TOURNAMENT_INFO_REQUEST","GET_TOURNAMENT_INFO_RESPONSE","_response$userPositio","_response$tournamentI","_this52","tournament_instance_id","_this53","GET_CLAN_TOURNAMENT_PLAYERS_REQUEST","GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE","_response$players","leaderboardGet","prevPeriod","_this54","snapshot_offset","GET_LEADERS_BOARD_REQUEST","include_users","GET_LEADERS_BOARD_RESPONSE","_response$map$boardKe","_response$map$boardKe2","boardKey","_this55","DAILY","leaderboardsGetList","_this56","values","_this57","_this57$leaderboardsG","levelsGet","_this58","GET_LEVEL_MAP_REQUEST","GET_LEVEL_MAP_RESPONSE","_this59","_this60","userInfo","_userInfo$points_ever2","sortedLevels","currentLevelIndex","level","current_level","_userInfo$points_ever","userPointsEver","points_ever","nextLevel","currentLevel","min","max","customSectionsGet","_this61","GET_CUSTOM_SECTIONS_REQUEST","GET_CUSTOM_SECTIONS_RESPONSE","_this62","_this63","starred_only","_this64","favoriteOnly","_this65","_this65$getInboxMessa","log","_this66","_this66$getInboxMessa","_this67","getMessageBody","getLabelSetting","INBOX_PUBLIC_CDN","fetch","method","headers","json","_this68","_this69","MARK_INBOX_READ_REQUEST","MARK_INBOX_READ_RESPONSE","_this70","all_read","_this71","MARK_INBOX_STARRED_REQUEST","MARK_INBOX_STARRED_RESPONSE","_this72","MARK_INBOX_DELETED_REQUEST","MARK_INBOX_DELETED_RESPONSE","_this73","all_deleted","buildGamesApiParams","_this$tracker$userPub","_this$tracker$userPub2","smartico_ext_user_id","getExtUserId","lang","core_user_language","sendGamesApi","_ref3$usePost","usePost","_this74","baseParams","queryString","entries","encodeURIComponent","fetchOptions","extraQuery","_ref5","sendAvatarApi","_ref6","_this75","_this76","_this77","_this78","_this79","isQuiz","_this80","_this81","_this82","gpGetTranslations","_this83","_this84","avatarsGetList","_this85","GET_AVATARS_LIST_REQUEST","GET_AVATARS_LIST_RESPONSE","avatarsGetCustomized","_this86","GET_AVATARS_CUSTOMIZED_REQUEST","GET_AVATARS_CUSTOMIZED_RESPONSE","avatarsGetPrompts","_this87","GET_AVATAR_PROMPTS_REQUEST","GET_AVATAR_PROMPTS_RESPONSE","_this88","CLIENT_SET_AVATAR_REQUEST","CLIENT_SET_AVATAR_RESPONSE","_this89$tracker","_this89$tracker2","_this89","_this90","_this90$avatarsGetLis","_this90$avatarsGetLis2","avatars","_this91","_this91$avatarsGetCus","_this91$avatarsGetCus2","_this92","_this92$avatarsGetPro","_this92$avatarsGetPro2","prompts","getWSCalls","_this93","GET_RELATED_ACH_N_TOURNAMENTS_REQUEST","GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE","_this94","_this94$getRaffles","_this95","RAF_GET_RAFFLES_REQUEST","RAF_GET_RAFFLES_RESPONSE","_this96","RAF_GET_DRAW_RUN_REQUEST","RAF_GET_DRAW_RUN_RESPONSE","_this97","_this98","RAF_GET_DRAW_HISTORY_REQUEST","RAF_GET_DRAW_HISTORY_RESPONSE","_this99","RAF_CLAIM_PRIZE_REQUEST","_this100","RAF_OPTIN_REQUEST","_this101","RAF_GET_WON_PRIZES_REQUEST","RAF_GET_WON_PRIZES_RESPONSE","_this102","GET_POINT_HISTORY_REQUEST","floor","GET_POINT_HISTORY_RESPONSE","_this103","_this103$getActivityL","logHistory","CookieStore","cookieStore","TSMap","AnalyticsInterfaceType","AnalyticsScreenNameId","AnalyticsTournamentsLobbySubScreenNameId","AnalyticsInboxSubScreenNameId","QuizSportType","quizSupportedSports","Basketball","Soccer","Tennis","SAWGPMarketType","QuizAnswersValueType","quizAnswerHomeTeamReplacementText","quizAnswerAwayTeamReplacementText","quizDrawReplacementText","quizYesReplacementText","quizNoReplacementText","quizOddReplacementText","quizEvenReplacementText","quizOrReplacementText","quizNoGoalsReplacementText","quizAnswersTrKeys","_quizAnswersTrKeys","yesNoAnswers","Yes","No","homeAwayAnswers","HomeTeam","AwayTeam","homeAwayDrawAnswers","Draw","homeAwayNoGoalsAnswers","marketsInfo","OneXTwo","question","trKey","answers","OneXTwoHalftime","FirstGoal","LastGoal","DoubleChance","HomeTeamDraw","HomeTeamAwayTeam","AwayTeamDraw","OverUnder2_5","OverUnder1_5Halftime","OverUnder1_5__2ndHalf","RedCard","TotalCorners8_5","TotalCorners9_5","Corners1x2","One_Two","Overtime","OddEven","Odd","Even","OddEvenHomeAway","HomeOdd","HomeEven","AwayOdd","AwayEven","FirstSet","SecondSet","ThirdSet","FourthSet","FifthSet","PlayerOneWinsOneSet","PlayerTwoWinsOneSet","CustomNonSport","CustomSport","QuizMarketPerSport","_QuizMarketPerSport","GamePickMarketType","GamePickResolutionType","GPRoundStatus","GamePickScoreType","GamePickSportType","GameRoundOrderType","AllRoundsGameBoardID","JackpotContributionType","JackPotTemparature","JackpotType","AvatarCustomizeErrorCode","JoinClanErrorCode"],"mappings":";;AAAYA,yBAyNX;AAzND,CAAA,UAAYA,OAAO,EAAA;EAClBA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EACRA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EAERA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EACRA,OAAA,CAAAA,OAAA,CAAA,eAAA,CAAA,GAAA,CAAA,CAAA,GAAA,eAAiB,CAAA;EACjBA,OAAA,CAAAA,OAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAY,CAAA;EACZA,OAAA,CAAAA,OAAA,CAAA,mBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,mBAAqB,CAAA;EACrBA,OAAA,CAAAA,OAAA,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AWUtils.ts","../src/MiniGames/SAWAcknowledgeType.ts","../src/MiniGames/SAWAskForUsername.ts","../src/MiniGames/SAWGameType.ts","../src/MiniGames/SAWExposeUserSpinId.ts","../src/MiniGames/SAWGameLayout.ts","../src/MiniGames/SAWPrizeType.ts","../src/MiniGames/SAWGetTemplatesResponse.ts","../src/MiniGames/SAWSpinErrorCode.ts","../src/MiniGames/SAWWinSoundType.ts","../src/MiniGames/SAWWinningHistoryResponse.ts","../src/MiniGames/PrizeModifiers.ts","../src/MiniGames/SAWWheelLayout.ts","../src/MiniGames/SAWGameDifficulty.ts","../src/MiniGames/AttemptPeriodType.ts","../src/NodeCache.ts","../src/OCache.ts","../src/Core/ActivityTypeLimited.ts","../src/Core/CoreUtils.ts","../src/Core/PublicLabelSettings.ts","../src/Core/TranslationArea.ts","../src/Inbox/GetInboxMessagesResponse.ts","../src/Inbox/InboxMessage.ts","../src/Inbox/InboxMessageType.ts","../src/Inbox/OpenLinksType.ts","../src/Inbox/InboxCategories.ts","../src/Inbox/InboxReadStatus.ts","../src/Store/BuyStoreItemErrorCode.ts","../src/Store/StoreCategory.ts","../src/Store/StoreItemPurchaseType.ts","../src/Store/StoreItemType.ts","../src/Store/StoreItem.ts","../src/Store/StoreItemPurchased.ts","../src/Missions/AchievementStatus.ts","../src/Missions/AchievementTaskType.ts","../src/Missions/AchievementType.ts","../src/Missions/AchievementAvailabilityStatus.ts","../src/Missions/BadgesTimeLimitStates.ts","../src/Missions/MissionsUtils.ts","../src/Missions/UserAchievement.ts","../src/Missions/ScheduledMissionType.ts","../src/Missions/AchievementCategory.ts","../src/Missions/MissionCategory.ts","../src/Missions/AchievementClaimTypeId.ts","../src/Tournaments/GetClanTournamentPlayersResponse.ts","../src/Tournaments/TournamentRegistrationType.ts","../src/Tournaments/TournamentRegistrationStatus.ts","../src/Tournaments/TournamentInstanceStatus.ts","../src/Tournaments/TournamentUtils.ts","../src/Tournaments/Tournament.ts","../src/Tournaments/GetTournamentInfoResponse.ts","../src/Tournaments/TournamentRegistrationError.ts","../src/Tournaments/TournamentType.ts","../src/Leaderboard/LeaderBoardPeriodType.ts","../src/Leaderboard/LeaderBoards.ts","../src/Level/GetLevelMapResponse.ts","../src/WSAPI/WSAPIBase.ts","../src/Raffle/GetRafflesResponse.ts","../src/Raffle/GetDrawRunResponse.ts","../src/Raffle/Raffle.ts","../src/Raffle/RaffleDraw.ts","../src/Raffle/GetRaffleDrawRunsHistoryResponse.ts","../src/Raffle/RaffleClaimPrizeResponse.ts","../src/WSAPI/WSAPIUser.ts","../src/WSAPI/WSAPIGeneral.ts","../src/WSAPI/WSAPIMissions.ts","../src/WSAPI/WSAPIBonuses.ts","../src/WSAPI/WSAPIStore.ts","../src/WSAPI/WSAPITournaments.ts","../src/WSAPI/WSAPIClans.ts","../src/WSAPI/WSAPIJackpots.ts","../src/WSAPI/WSAPIRaffles.ts","../src/WSAPI/WSAPIMiniGames.ts","../src/WSAPI/WSAPIAvatars.ts","../src/WSAPI/WSAPIGamePick.ts","../src/WSAPI/WSAPILeaderBoard.ts","../src/WSAPI/WSAPIInbox.ts","../src/WSAPI/WSAPI.ts","../src/CustomSections/AchCustomSection.ts","../src/CustomSections/UICustomSection.ts","../src/Bonuses/Bonus.ts","../src/Bonuses/BonusStatus.ts","../src/ActivityLog/UserBalanceType.ts","../src/ActivityLog/GetActivityLogResponse.ts","../src/ActivityLog/PointChangeSourceType.ts","../src/Avatars/GetAvatarsListResponse.ts","../src/Avatars/GetAvatarsCustomizedResponse.ts","../src/Avatars/GetAvatarPromptsResponse.ts","../src/Jackpots/GetJackpotWinnersResponse.ts","../src/Jackpots/GetJackpotEligibleGamesResponse.ts","../src/SmarticoAPI.ts","../src/CookieStore.ts","../src/Analytics/AnalyticStoreData.ts","../src/GamePick/SportTypes.ts","../src/GamePick/MarketsType.ts","../src/GamePick/MarketsAnswers.ts","../src/GamePick/MarketsInfo.ts","../src/GamePick/MarketsPerSport.ts","../src/GamePick/GamePickTypes.ts","../src/Jackpots/JackpotContributionType.ts","../src/Jackpots/JackpotPot.ts","../src/Jackpots/JackpotType.ts","../src/Avatars/AvatarCustomizeErrorCode.ts","../src/Clans/JoinClanErrorCode.ts"],"sourcesContent":["export enum ClassId {\n\tPING = 1,\n\tPONG = 2,\n\n\tINIT = 3,\n\tINIT_RESPONSE = 4,\n\tIDENTIFY = 5,\n\tIDENTIFY_RESPONSE = 6,\n\tLOGIN = 7,\n\tLOGOUT = 8,\n\tEVENT = 9,\n\tEVENT_RESPONSE = 10,\n\n\tLOGIN_RESPONSE = 11,\n\tLOGOUT_RESPONSE = 12,\n\n\tGET_TRANSLATIONS_REQUEST = 13,\n\tGET_TRANSLATIONS_RESPONSE = 14,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tCLIENT_ENGAGEMENT_IMPRESSION_REQUEST = 103,\n\tCLIENT_ENGAGEMENT_ACTION_REQUEST = 104,\n\tCLIENT_EXECUTE_DEEPLINK_EVENT = 105,\n\tCLIENT_ENGAGEMENT_FAILED_REQUEST = 106,\n\tCLIENT_EXECUTE_JS_EVENT = 107,\n\tCLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT = 108,\n\tCLIENT_ENGAGEMENT_EVENT_NEW = 110,\n\n\tCLIENT_TRACK_ACTIVITY_REQUEST = 155,\n\tCLIENT_SET_AVATAR_REQUEST = 157,\n\tCLIENT_SET_AVATAR_RESPONSE = 158,\n\n\tCLIENT_SET_CUSTOM_USERNAME_REQUEST = 159,\n\tCLIENT_SET_CUSTOM_USERNAME_RESPONSE = 160,\n\n\tCHECK_SEGMENT_MATCH_REQUEST = 161,\n\tCHECK_SEGMENT_MATCH_RESPONSE = 162,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\t// 500-1000 - Achievements\n\tGET_LEVEL_MAP_REQUEST = 500,\n\tGET_LEVEL_MAP_RESPONSE = 501,\n\tGET_ACHIEVEMENT_MAP_REQUEST = 502,\n\tGET_ACHIEVEMENT_MAP_RESPONSE = 503,\n\tRELOAD_ACHIEVEMENTS_EVENT = 504,\n\tGET_LEADERS_BOARD_REQUEST = 505,\n\tGET_LEADERS_BOARD_RESPONSE = 506,\n\tGET_SHOP_ITEMS_REQUEST = 509,\n\tGET_SHOP_ITEMS_RESPONSE = 510,\n\tBUY_SHOP_ITEM_REQUEST = 511,\n\tBUY_SHOP_ITEM_RESPONSE = 512,\n\tGET_INBOX_MESSAGES_REQUEST = 513,\n\tGET_INBOX_MESSAGES_RESPONSE = 514,\n\tGET_SHOP_CATEGORIES_REQUEST = 515,\n\tGET_SHOP_CATEGORIES_RESPONSE = 516,\n\tGET_TOURNAMENT_LOBBY_REQUEST = 517,\n\tGET_TOURNAMENT_LOBBY_RESPONSE = 518,\n\tGET_TOURNAMENT_INFO_REQUEST = 519,\n\tGET_TOURNAMENT_INFO_RESPONSE = 520,\n\tTOURNAMENT_REGISTER_REQUEST = 521,\n\tTOURNAMENT_REGISTER_RESPONSE = 522,\n\tGET_CUSTOM_SECTIONS_REQUEST = 523,\n\tGET_CUSTOM_SECTIONS_RESPONSE = 524,\n\tMISSION_OPTIN_REQUEST = 525,\n\tMISSION_OPTIN_RESPONSE = 526,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tGET_ACHIEVEMENT_USER_REQUEST = 527,\n\tGET_ACHIEVEMENT_USER_RESPONSE = 528,\n\n\tMARK_INBOX_READ_REQUEST = 529,\n\tMARK_INBOX_READ_RESPONSE = 530,\n\tMARK_INBOX_STARRED_REQUEST = 531,\n\tMARK_INBOX_STARRED_RESPONSE = 532,\n\tMARK_INBOX_DELETED_REQUEST = 535,\n\tMARK_INBOX_DELETED_RESPONSE = 536,\n\n\tGET_ACH_CATEGORIES_REQUEST = 537,\n\tGET_ACH_CATEGORIES_RESPONSE = 538,\n\n\tACHIEVEMENT_CLAIM_PRIZE_REQUEST = 539,\n\tACHIEVEMENT_CLAIM_PRIZE_RESPONSE = 540,\n\n\tACH_SHOP_ITEM_HISTORY_REQUEST = 541,\n\tACH_SHOP_ITEM_HISTORY_RESPONSE = 542,\n\n\tGET_RELATED_ACH_N_TOURNAMENTS_REQUEST = 543,\n\tGET_RELATED_ACH_N_TOURNAMENTS_RESPONSE = 544,\n\n\tGET_POINT_HISTORY_REQUEST = 545,\n\tGET_POINT_HISTORY_RESPONSE = 546,\n\n\tGET_AVATARS_LIST_REQUEST = 560,\n\tGET_AVATARS_LIST_RESPONSE = 561,\n\tGET_AVATARS_CUSTOMIZED_REQUEST = 562,\n\tGET_AVATARS_CUSTOMIZED_RESPONSE = 563,\n\tGET_AVATAR_PROMPTS_REQUEST = 564,\n\tGET_AVATAR_PROMPTS_RESPONSE = 565,\n\n\tGET_CLAN_LIST_REQUEST = 570,\n\tGET_CLAN_LIST_RESPONSE = 571,\n\n\tGET_CLAN_INFO_REQUEST = 572,\n\tGET_CLAN_INFO_RESPONSE = 573,\n\n\tJOIN_CLAN_REQUEST = 574,\n\tJOIN_CLAN_RESPONSE = 575,\n\n\tGET_CLAN_TOURNAMENT_PLAYERS_REQUEST = 576,\n\tGET_CLAN_TOURNAMENT_PLAYERS_RESPONSE = 577,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tGET_BONUSES_REQUEST = 600,\n\tGET_BONUSES_RESPONSE = 601,\n\tCLAIM_BONUS_REQUEST = 602,\n\tCLAIM_BONUS_RESPONSE = 603,\n\n\tSAW_GET_SPINS_REQUEST = 700,\n\tSAW_GET_SPINS_RESPONSE = 701,\n\tSAW_DO_SPIN_REQUEST = 702,\n\tSAW_DO_SPIN_RESPONSE = 703,\n\tSAW_AKNOWLEDGE_REQUEST = 704,\n\tSAW_AKNOWLEDGE_RESPONSE = 705,\n\tSAW_SPINS_COUNT_PUSH = 706,\n\tSAW_SHOW_SPIN_PUSH = 707,\n\tSAW_PRIZE_DROP_WIN_PUSH = 708,\n\tSAW_PRIZE_DROP_WIN_AKNOWLEDGE_REQUEST = 709,\n\tSAW_PRIZE_DROP_WIN_AKNOWLEDGE_RESPONSE = 710,\n\tSAW_AKNOWLEDGE_SPIN_PUSH = 711,\n\tSAW_DO_SPIN_BATCH_REQUEST = 712,\n\tSAW_DO_SPIN_BATCH_RESPONSE = 713,\n\tSAW_AKNOWLEDGE_BATCH_REQUEST = 714,\n\tSAW_AKNOWLEDGE_BATCH_RESPONSE = 715,\n\n\tGET_SAW_HISTORY_REQUEST = 716,\n\tGET_SAW_HISTORY_RESPONSE = 717,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tJP_GET_JACKPOTS_REQUEST = 800,\n\tJP_GET_JACKPOTS_RESPONSE = 801,\n\n\tJP_GET_LATEST_POTS_REQUEST = 802,\n\tJP_GET_LATEST_POTS_RESPONSE = 803,\n\n\tJP_OPTIN_REQUEST = 804,\n\tJP_OPTIN_RESPONSE = 805,\n\n\tJP_OPTOUT_REQUEST = 806,\n\tJP_OPTOUT_RESPONSE = 807,\n\n\tJP_WIN_PUSH = 808,\n\tJP_GET_WINNERS_REQUEST = 809,\n\tJP_GET_WINNERS_RESPONSE = 810,\n\n\tJP_GET_ELIGIBLE_GAMES_REQUEST = 811,\n\tJP_GET_ELIGIBLE_GAMES_RESPONSE = 812,\n\n\tRAF_GET_RAFFLES_REQUEST = 902,\n\tRAF_GET_RAFFLES_RESPONSE = 903,\n\tRAF_GET_DRAW_RUN_REQUEST = 904,\n\tRAF_GET_DRAW_RUN_RESPONSE = 905,\n\tRAF_GET_DRAW_HISTORY_REQUEST = 906,\n\tRAF_GET_DRAW_HISTORY_RESPONSE = 907,\n\tRAF_CLAIM_PRIZE_REQUEST = 908,\n\tRAF_CLAIM_PRIZE_RESPONSE = 909,\n\tRAF_OPTIN_REQUEST = 916,\n\tRAF_OPTIN_RESPONSE = 917,\n\tRAF_GET_WON_PRIZES_REQUEST = 920,\n\tRAF_GET_WON_PRIZES_RESPONSE = 921,\n\t/*\n\tRAF_GET_TICKETS_REQUEST = 902,\n\tRAF_GET_TICKETS_RESPONSE = 903,\n\n\tRAF_CLAIM_PRIZE_REQUEST = 906,\n\t*/\n\n\tBNR_GET_BANNER_PLACEMENTS_REQUEST = 950,\n\tBNR_GET_BANNER_PLACEMENTS_RESPONSE = 951,\n\tBNR_GET_BANNER_CONTENT_REQUEST = 952,\n\tBNR_GET_BANNER_CONTENT_RESPONSE = 953,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tREGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,\n\tREGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,\n\n\tCLIENT_DEBUG_REQUEST = 77777,\n\n\t/*\n !Important, if adding new messages that are 'acting' on behalf of the client,\n you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n */\n\n\tUNSUPPORTED_COMMAND = 99999,\n}\n","class IntUtils {\n\tpublic static uuid(): string {\n\t\tlet a: any;\n\t\tlet b: any;\n\t\tfor (\n\t\t\tb = a = '';\n\t\t\ta++ < 36;\n\t\t\tb += (a * 51) & 52 ? (a ^ 15 ? 8 ^ (Math.random() * (a ^ 20 ? 16 : 4)) : 4).toString(16) : '-'\n\t\t) {}\n\t\treturn b;\n\t}\n\n\tpublic static isNotNull(val: any): boolean {\n\t\treturn typeof val !== 'undefined' && val !== null;\n\t}\n\n\tpublic static isNotEmpty(val: string): boolean {\n\t\treturn typeof val !== 'undefined' && val !== null && val.length > 0;\n\t}\n\n\tpublic static replaceAll(value: string, regex: string, replacement: string | number): string {\n\t\tif (IntUtils.isNotNull(value)) {\n\t\t\treturn value.replace(new RegExp(IntUtils.escapeRegExp(regex), 'g'), replacement?.toString());\n\t\t}\n\t\treturn value;\n\t}\n\n\tpublic static escapeRegExp(v: string): string {\n\t\tif (IntUtils.isNotEmpty(v)) {\n\t\t\treturn v.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\t\t}\n\t\treturn v;\n\t}\n\n\tpublic static JsonOrText = (str: string): any => {\n\t\tif (str && str.includes && (str.includes('{') || str.includes('['))) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(str);\n\t\t\t} catch (e) {\n\t\t\t\treturn str;\n\t\t\t}\n\t\t}\n\t\treturn str || {};\n\t};\n\n\t// public static wsTimeToEpoch = (time: string): number => {\n\t// if (time) {\n\t// return moment.utc(time, \"DD/MM/YYYY HH:mm:ss\").valueOf()\n\t// } else {\n\t// return null\n\t// }\n\t// }\n\n\tpublic static isWithinPeriod = (timestamp: number, period: 'today' | 'thisWeek' | 'thisMonth'): boolean => {\n\t\tconst now = new Date();\n\t\tconst completedDate = new Date(timestamp);\n\n\t\tswitch (period) {\n\t\t\tcase 'today':\n\t\t\t\treturn (\n\t\t\t\t\tnow.getFullYear() === completedDate.getFullYear() &&\n\t\t\t\t\tnow.getMonth() === completedDate.getMonth() &&\n\t\t\t\t\tnow.getDate() === completedDate.getDate()\n\t\t\t\t);\n\t\t\tcase 'thisWeek':\n\t\t\t\tconst startOfWeek = new Date(now);\n\t\t\t\tstartOfWeek.setDate(now.getDate() - now.getDay());\n\t\t\t\tstartOfWeek.setHours(0, 0, 0, 0);\n\n\t\t\t\tconst endOfWeek = new Date(startOfWeek);\n\t\t\t\tendOfWeek.setDate(startOfWeek.getDate() + 6);\n\t\t\t\tendOfWeek.setHours(23, 59, 59, 999);\n\n\t\t\t\treturn completedDate >= startOfWeek && completedDate <= endOfWeek;\n\t\t\tcase 'thisMonth':\n\t\t\t\treturn now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth();\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t};\n}\n\nexport { IntUtils };\n","export enum SAWBuyInType {\n\tFree = 1,\n\tPoints = 2,\n\tSpins = 3,\n\tGems = 4,\n\tDiamonds = 5,\n}\n\nexport enum SAWBuyInTypeName {\n\tFree = 'free',\n\tPoints = 'points',\n\tSpins = 'spins',\n\tUnknown = 'unknown',\n\tGems = 'gems',\n\tDiamonds = 'diamonds',\n}\n\n/** @hidden */\nexport const SAWBuyInTypeNamed = (type: SAWBuyInType): SAWBuyInTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWBuyInType.Free]: SAWBuyInTypeName.Free,\n\t\t\t[SAWBuyInType.Points]: SAWBuyInTypeName.Points,\n\t\t\t[SAWBuyInType.Spins]: SAWBuyInTypeName.Spins,\n\t\t\t[SAWBuyInType.Gems]: SAWBuyInTypeName.Gems,\n\t\t\t[SAWBuyInType.Diamonds]: SAWBuyInTypeName.Diamonds,\n\t\t}[type] || SAWBuyInTypeName.Unknown\n\t);\n};\n","import { SAWBuyInType } from './SAWBuyInType';\nimport { SAWTemplate } from './SAWTemplate';\n\nclass SAWUtils {\n\tpublic static canPlay = (t: SAWTemplate, user_balances: {ach_points_balance: number, ach_gems_balance: number, ach_diamonds_balance: number}): boolean => {\n\t\tif (t === null || t === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (t.saw_buyin_type_id) {\n\t\t\tcase SAWBuyInType.Free: {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcase SAWBuyInType.Spins: {\n\t\t\t\treturn t.spin_count !== null && t.spin_count > 0;\n\t\t\t}\n\t\t\tcase SAWBuyInType.Points:\n\t\t\tcase SAWBuyInType.Gems:\n\t\t\tcase SAWBuyInType.Diamonds: {\n\t\t\t\tlet balance = user_balances.ach_points_balance;\n\t\t\t\tif (t.saw_buyin_type_id === SAWBuyInType.Gems) {\n\t\t\t\t\tbalance = user_balances.ach_gems_balance;\n\t\t\t\t} else if (t.saw_buyin_type_id === SAWBuyInType.Diamonds) {\n\t\t\t\t\tbalance = user_balances.ach_diamonds_balance;\n\t\t\t\t}\n\t\t\t\treturn t.buyin_cost_points <= balance;\n\t\t\t}\n\t\t\t\n\t\t\tdefault: {\n\t\t\t\tconsole.error('MiniGamesUtils.canPlay: Unknwon SAW buyin type ' + t.saw_buyin_type_id);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport { SAWUtils };\n","export enum SAWAcknowledgeType {\n\tSilent = 1,\n\tQuickMessage = 2,\n\tFullMessage = 3,\n\tExplicityAcknowledge = 4\n}\n\nexport enum SAWAcknowledgeTypeName {\n\tSilent = 'silent',\n\tQuickMessage = 'quick-message',\n\tFullMessage = 'full-message',\n\tExplicityAcknowledge = 'explicity-acknowledge'\n}\n\n/** @hidden */\nexport const SAWAcknowledgeTypeNamed = (type: SAWAcknowledgeType): SAWAcknowledgeTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWAcknowledgeType.Silent]: SAWAcknowledgeTypeName.Silent,\n\t\t\t[SAWAcknowledgeType.QuickMessage]: SAWAcknowledgeTypeName.QuickMessage,\n\t\t\t[SAWAcknowledgeType.FullMessage]: SAWAcknowledgeTypeName.FullMessage,\n\t\t\t[SAWAcknowledgeType.ExplicityAcknowledge]: SAWAcknowledgeTypeName.ExplicityAcknowledge\n\t\t}[type]\n\t);\n};\n","export enum SAWAskForUsername {\n\tNOASK = 'no-ask',\n\tONSUMBIT = 'on-submit',\n}\n","export enum SAWGameType {\n\tSpinAWheel = 1,\n\tScratchCard = 2,\n\tMatchX = 3,\n\tGiftBox = 4,\n\tPrizeDrop = 5,\n\tQuiz = 6,\n\tLootboxWeekdays = 7,\n\tLootboxCalendarDays = 8,\n\tTreasureHunt = 9,\n\tVoyager = 10,\n\tPlinko = 11,\n\tCoinFlip = 12,\n\tCustomMinigame = 13,\n}\n\nexport enum SAWGameTypeName {\n\tSpinAWheel = 'wheel',\n\tScratchCard = 'scratch',\n\tMatchX = 'matchx',\n\tGiftBox = 'giftbox',\n\tPrizeDrop = 'prizedrop',\n\tQuiz = 'quiz',\n\tLootboxWeekdays = 'lootbox_weekdays',\n\tLootboxCalendarDays = 'lootbox_calendar_days',\n\tTreasureHunt = 'treasure_hunt',\n\tVoyager = 'voyager',\n\tPlinko = 'plinko',\n\tCoinFlip = 'coin_flip',\n\tCustomMinigame = 'custom_minigame',\n\tUnknown = 'unknown',\n}\n\n/** @hidden */\nexport const SAWGameTypeNamed = (type: SAWGameType): SAWGameTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWGameType.SpinAWheel]: SAWGameTypeName.SpinAWheel,\n\t\t\t[SAWGameType.ScratchCard]: SAWGameTypeName.ScratchCard,\n\t\t\t[SAWGameType.MatchX]: SAWGameTypeName.MatchX,\n\t\t\t[SAWGameType.GiftBox]: SAWGameTypeName.GiftBox,\n\t\t\t[SAWGameType.PrizeDrop]: SAWGameTypeName.PrizeDrop,\n\t\t\t[SAWGameType.Quiz]: SAWGameTypeName.Quiz,\n\t\t\t[SAWGameType.LootboxWeekdays]: SAWGameTypeName.LootboxWeekdays,\n\t\t\t[SAWGameType.LootboxCalendarDays]: SAWGameTypeName.LootboxCalendarDays,\n\t\t\t[SAWGameType.TreasureHunt]: SAWGameTypeName.TreasureHunt,\n\t\t\t[SAWGameType.Voyager]: SAWGameTypeName.Voyager,\n\t\t\t[SAWGameType.Plinko]: SAWGameTypeName.Plinko,\n\t\t\t[SAWGameType.CoinFlip]: SAWGameTypeName.CoinFlip,\n\t\t\t[SAWGameType.CustomMinigame]: SAWGameTypeName.CustomMinigame,\n\t\t}[type] || SAWGameTypeName.Unknown\n\t);\n};\n","export enum SAWExposeUserSpinId {\n UserId = 1,\n SpinId = 2,\n}\n\nexport enum SAWExposeUserSpinIdName {\n UserId = 'userId',\n SpinId = 'spinId',\n}\n\n/** @hidden */\nexport const SAWExposeUserSpinIdNamed = (id: SAWExposeUserSpinId): SAWExposeUserSpinIdName => {\n return (\n {\n [SAWExposeUserSpinId.UserId]: SAWExposeUserSpinIdName.UserId,\n [SAWExposeUserSpinId.SpinId]: SAWExposeUserSpinIdName.SpinId,\n }[id]\n );\n};","export enum SAWGameLayout {\n Horizontal = 1,\n VerticalMap = 2,\n}\n\nexport enum SAWGameLayoutName {\n Horizontal = 'horizontal',\n VerticalMap = 'vertical-map',\n}\n\n/** @hidden */\nexport const SAWGameLayoutNamed = (layout: SAWGameLayout): SAWGameLayoutName => {\n return (\n {\n [SAWGameLayout.Horizontal]: SAWGameLayoutName.Horizontal,\n [SAWGameLayout.VerticalMap]: SAWGameLayoutName.VerticalMap,\n }[layout]\n );\n};","export enum SAWPrizeType {\n\tNO_PRIZE = 1,\n\tPOINTS = 2,\n\tBONUS = 3,\n\tMANUAL = 4,\n\tSPIN = 5,\n\tJACKPOT = 6,\n\tCHANGE_LEVEL = 7,\n\tMISSION = 8,\n\tRAFFLE_TICKET = 9,\n\tGEMS_AND_DIAMONDS = 10,\n}\n\nexport enum MiniGamePrizeTypeName {\n\tNO_PRIZE = 'no-prize',\n\tPOINTS = 'points',\n\tBONUS = 'bonus',\n\tMANUAL = 'manual',\n\tSPIN = 'spin',\n\tJACKPOT = 'jackpot',\n\tCHANGE_LEVEL = 'change-level',\n\tMISSION = 'mission',\n\tRAFFLE_TICKET = 'raffle-ticket',\n\tGEMS_AND_DIAMONDS = 'gems-and-diamonds',\n\tUNKNOWN = 'unknown',\n}\n\n/** @hidden */\nexport const MiniGamePrizeTypeNamed = (type: SAWPrizeType): MiniGamePrizeTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWPrizeType.NO_PRIZE]: MiniGamePrizeTypeName.NO_PRIZE,\n\t\t\t[SAWPrizeType.POINTS]: MiniGamePrizeTypeName.POINTS,\n\t\t\t[SAWPrizeType.BONUS]: MiniGamePrizeTypeName.BONUS,\n\t\t\t[SAWPrizeType.MANUAL]: MiniGamePrizeTypeName.MANUAL,\n\t\t\t[SAWPrizeType.SPIN]: MiniGamePrizeTypeName.SPIN,\n\t\t\t[SAWPrizeType.JACKPOT]: MiniGamePrizeTypeName.JACKPOT,\n\t\t\t[SAWPrizeType.CHANGE_LEVEL]: MiniGamePrizeTypeName.CHANGE_LEVEL,\n\t\t\t[SAWPrizeType.MISSION]: MiniGamePrizeTypeName.MISSION,\n\t\t\t[SAWPrizeType.RAFFLE_TICKET]: MiniGamePrizeTypeName.RAFFLE_TICKET,\n\t\t\t[SAWPrizeType.GEMS_AND_DIAMONDS]: MiniGamePrizeTypeName.GEMS_AND_DIAMONDS,\n\t\t}[type] || MiniGamePrizeTypeName.UNKNOWN\n\t);\n};\n","import { IntUtils } from '../IntUtils';\nimport { TMiniGamePrize, TMiniGameTemplate } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from './../Base/ProtocolResponse';\nimport { SAWAcknowledgeTypeNamed } from './SAWAcknowledgeType';\nimport { SAWBuyInType, SAWBuyInTypeNamed } from './SAWBuyInType';\nimport { SAWExposeUserSpinIdNamed } from './SAWExposeUserSpinId';\nimport { SAWGameLayoutNamed } from './SAWGameLayout';\nimport { SAWGameType, SAWGameTypeNamed } from './SAWGameType';\nimport { MiniGamePrizeTypeNamed } from './SAWPrizeType';\nimport { SAWTemplate } from './SAWTemplate';\n\nexport interface SAWGetTemplatesResponse extends ProtocolResponse {\n\ttemplates: SAWTemplate[];\n}\n\nexport const SAWTemplatesTransform = (items: SAWTemplate[]): TMiniGameTemplate[] => {\n\treturn items.map((r) => {\n\t\tconst x: TMiniGameTemplate = {\n\t\t\tid: r.saw_template_id,\n\t\t\tname: r.saw_template_ui_definition.name,\n\t\t\tdescription: r.saw_template_ui_definition.description,\n\t\t\tthumbnail: r.saw_template_ui_definition.thumbnail\n\t\t\t? r.saw_template_ui_definition.thumbnail\n\t\t\t: r.saw_skin_ui_definition?.skin_folder\n\t\t\t\t? `${r.saw_skin_ui_definition.skin_folder}/ico.png`\n\t\t\t\t: `https://d312ucx3huj7iy.cloudfront.net/gf/images/saw/${r.saw_skin_key}/ico.png`,\n\t\t\tvisibile_when_can_spin: r.visibile_when_can_spin,\n\t\t\tover_limit_message: r.saw_template_ui_definition.over_limit_message,\n\t\t\tno_attempts_message: r.saw_template_ui_definition.no_attempts_message,\n\t\t\tjackpot_symbol: r.saw_template_ui_definition.jackpot_symbol,\n\t\t\tsaw_game_type: SAWGameTypeNamed(r.saw_game_type_id),\n\t\t\tsaw_buyin_type: SAWBuyInTypeNamed(r.saw_buyin_type_id),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Points ? { buyin_cost_points: r.buyin_cost_points } : {}),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Gems ? { buyin_cost_gems: r.buyin_cost_points } : {}),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Diamonds ? { buyin_cost_diamonds: r.buyin_cost_points } : {}),\n\t\t\tjackpot_add_on_attempt: r.jackpot_add_on_attempt,\n\t\t\tjackpot_current: r.jackpot_current,\n\t\t\tspin_count: r.spin_count,\n\t\t\tpromo_image: r.saw_template_ui_definition.promo_image,\n\t\t\tpromo_text: r.saw_template_ui_definition.promo_text,\n\t\t\tcustom_data: IntUtils.JsonOrText(r.saw_template_ui_definition.custom_data),\n\t\t\texpose_game_stat_on_api: r.expose_game_stat_on_api,\n\t\t\trelative_period_timezone: r.relative_period_timezone,\n\t\t\tactiveFromDate: r.activeFromDate,\n\t\t\tactiveTillDate: r.activeTillDate,\n\t\t\tnext_available_spin_ts: r.next_available_spin_ts,\n\t\t\tsteps_to_finish_game: r.saw_template_ui_definition.steps_to_finish_game,\n\t\t\tcustom_section_id: r.saw_template_ui_definition.custom_section_id,\n\t\t\tsaw_template_ui_definition: r.saw_template_ui_definition,\n\t\t\t...(r.saw_game_type_id === SAWGameType.LootboxCalendarDays || r.saw_game_type_id === SAWGameType.LootboxWeekdays\n\t\t\t\t? { game_layout: SAWGameLayoutNamed(r.saw_template_ui_definition.game_layout) }\n\t\t\t\t: {}\n\t\t\t),\n\t\t\tshow_prize_history: r.show_prize_history,\n\t\t\tmax_number_of_attempts: r.maxSpinsCount,\n\t\t\tmax_spins_period_ms: r.maxSpinsPediodMs,\n\t\t\t...(r.saw_template_ui_definition.expose_user_spin_id\n\t\t\t\t? { expose_user_spin_id: SAWExposeUserSpinIdNamed(r.saw_template_ui_definition.expose_user_spin_id) } \n\t\t\t\t: {}),\n\n\t\t\tprizes: r.prizes.map((p) => {\n\t\t\t\tconst y: TMiniGamePrize = {\n\t\t\t\t\tid: p.saw_prize_id,\n\t\t\t\t\tname: p.saw_prize_ui_definition.name,\n\t\t\t\t\tprize_type: MiniGamePrizeTypeNamed(p.prize_type_id),\n\t\t\t\t\tprize_value: p.prize_value,\n\t\t\t\t\tfont_size: p.saw_prize_ui_definition.font_size,\n\t\t\t\t\tfont_size_mobile: p.saw_prize_ui_definition.font_size_mobile,\n\t\t\t\t\ticon: p.saw_prize_ui_definition.icon,\n\t\t\t\t\tposition: p.saw_prize_ui_definition.position,\n\t\t\t\t\tsectors: p.saw_prize_ui_definition.sectors,\n\t\t\t\t\tacknowledge_type: SAWAcknowledgeTypeNamed(p.saw_prize_ui_definition.acknowledge_type),\n\t\t\t\t\taknowledge_message: p.saw_prize_ui_definition.aknowledge_message,\n\t\t\t\t\tacknowledge_dp: p.saw_prize_ui_definition.acknowledge_dp,\n\t\t\t\t\tacknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,\n\t\t\t\t\tacknowledge_dp_additional: p.saw_prize_ui_definition.acknowledge_dp_additional,\n\t\t\t\t\tacknowledge_action_title_additional: p.saw_prize_ui_definition.acknowledge_action_title_additional,\n\t\t\t\t\tout_of_stock_message: p.saw_prize_ui_definition.out_of_stock_message,\n\t\t\t\t\tpool: p.pool,\n\t\t\t\t\tpool_initial: p.pool_initial,\n\t\t\t\t\twins_count: p.wins_count,\n\t\t\t\t\tweekdays: p.weekdays,\n\t\t\t\t\tactive_from_ts: p.active_from_ts,\n\t\t\t\t\tactive_till_ts: p.active_till_ts,\n\t\t\t\t\trelative_period_timezone: p.relative_period_timezone,\n\t\t\t\t\tis_surcharge: p.is_surcharge,\n\t\t\t\t\tis_deleted: p.is_deleted,\n\t\t\t\t\tcustom_data: IntUtils.JsonOrText(p.saw_prize_ui_definition?.custom_data),\n\t\t\t\t\tprize_modifiers: p.saw_prize_ui_definition.prize_modifiers,\n\t\t\t\t\tallow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,\n\t\t\t\t\thide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history,\n\t\t\t\t\trequirements_to_get_prize: p.saw_prize_ui_definition.requirements_to_get_prize,\n\t\t\t\t\tmax_give_period_type_id: p.max_give_period_type_id,\n\t\t\t\t};\n\t\t\t\treturn y;\n\t\t\t}),\n\t\t};\n\t\treturn x;\n\t});\n};\n","/*\n * Possible error codes for the mini-games attempts\n */\nexport enum SAWSpinErrorCode {\n\t/** No error */\n\tSAW_OK = 0,\n\t/** User doesn't have 'spin attempts' to play. In case buy in type for the game is 'spins' based */\n\tSAW_NO_SPINS = 40001,\n\t/** The are no prizes left to play the game */\n\tSAW_PRIZE_POOL_EMPTY = 40002,\n\t/** User doesn't have enough points to play. In case buy in type for the game is 'points' based */\n\tSAW_NOT_ENOUGH_POINTS = 40003,\n\t/** User reached max number of game attempts defined in the BackOffice */\n\tSAW_FAILED_MAX_SPINS_REACHED = 40004,\n\t/** User tries to play a template that is restricted by date */\n\tSAW_TEMPLATE_NOT_ACTIVE = 40007,\n\t/** Special code for the 'visitor' mode */\n\tSAW_VISITOR_STOP_SPIN_REQUEST = -40001,\n\t/** User is not in the segment */\n\tSAW_NOT_IN_SEGMENT = 40009,\n\t/** User doesn't have enough gems to play. In case buy in type for the game is 'gems' based */\n\tSAW_NO_BALANCE_GEMS = 40011,\n\t/** User doesn't have enough diamonds to play. In case buy in type for the game is 'diamonds' based */\n\tSAW_NO_BALANCE_DIAMONDS = 40012,\n}\n","export enum SAWWinSoundType {\n\tDisappointing = 1,\n\tPositive = 2,\n\tHighlyPositive = 3,\n\tNoSound = 4,\n\tCustom = 5,\n}\n\nexport const SAWWinSoundFiles = {\n\t[SAWWinSoundType.NoSound]: null,\n\t[SAWWinSoundType.Disappointing]: 'saw-disappointed.m4a',\n\t[SAWWinSoundType.Positive]: 'saw-positive.m4a',\n\t[SAWWinSoundType.HighlyPositive]: 'saw-highly-positive.m4a',\n};\n","import { ProtocolResponse } from \"../SmarticoLib\";\nimport { TSawHistory } from \"../WSAPI/WSAPITypes\";\nimport { SAWTemplate } from \"./SAWTemplate\";\n\nexport interface SAWWinningHistoryResponse extends ProtocolResponse {\n\tprizes: SAWPrizesHistory[];\n\thasMore: boolean;\n}\n\nexport interface SAWPrizesHistory {\n\ttemplate: SAWTemplate,\n\tsaw_template_id: number,\n\tsaw_prize_id: number,\n\tprize_amount: number,\n\tclient_request_id: string,\n\tis_claimed: boolean,\n\tcreate_date_ts: number;\n\tacknowledge_date_ts: number;\n}\n\nexport const SAWHistoryTransform = (items: SAWPrizesHistory[]): TSawHistory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TSawHistory = {\n\t\t\ttemplate: r.template,\n\t\t\tsaw_template_id: r.saw_template_id,\n\t\t\tsaw_prize_id: r.saw_prize_id,\n\t\t\tprize_amount: r.prize_amount,\n\t\t\tclient_request_id: r.client_request_id,\n\t\t\tis_claimed: r.is_claimed,\n\t\t\tcreate_date_ts: r.create_date_ts,\n\t\t\tacknowledge_date_ts: r.acknowledge_date_ts,\n\t\t}\n\t\treturn x;\n\t})\n}\n\n","export enum PrizeModifiers {\n '2x' = 1,\n '5x' = 2,\n '10x' = 3,\n '/2' = 4,\n '/5' = 5,\n '/10' = 6,\n '0x' = 7,\n \"reset\" = 8,\n}\n\nexport const PrizeModifiersKeysNames = {\n [PrizeModifiers['2x']]: '2x',\n [PrizeModifiers['5x']]: '5x',\n [PrizeModifiers['10x']]: '10x',\n [PrizeModifiers['/2']]: '/2',\n [PrizeModifiers['/5']]: '/5',\n [PrizeModifiers['/10']]: '/10',\n [PrizeModifiers['0x']]: '0',\n [PrizeModifiers['reset']]: 'Reset to 0',\n};","export enum SAWWheelLayout {\n Centered = 1,\n LeftAligned = 2,\n RightAligned = 3,\n BottomAligned = 4,\n}","export enum SAWGameDifficultyType {\n\tEASY = 1,\n\tMEDIUM = 2,\n\tHARD = 3,\n}\n\nexport enum SAWGameDifficultyTypeName {\n\tEASY = 'easy',\n\tMEDIUM = 'medium',\n\tHARD = 'hard',\n}\n\n/** @hidden */\nexport const SawGameDifficultyTypeNamed = (type: SAWGameDifficultyType): SAWGameDifficultyTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWGameDifficultyType.EASY]: SAWGameDifficultyTypeName.EASY,\n\t\t\t[SAWGameDifficultyType.MEDIUM]: SAWGameDifficultyTypeName.MEDIUM,\n\t\t\t[SAWGameDifficultyType.HARD]: SAWGameDifficultyTypeName.HARD,\n\t\t}[type]\n\t);\n};\n","export enum AttemptPeriodType {\n\tFromLastAttempt = 1,\n\tCalendarDaysUTC = 2,\n\tCalendarDaysUserTimeZone = 3,\n\tLifetime = 4,\n}","class NodeCache {\n\tprivate ttlChecker: NodeJS.Timeout;\n\n\tprivate cache: { [key: string]: any } = {};\n\n\tconstructor() {\t\t\n\t\tif (this.ttlChecker === undefined) {\n\t\t\tthis.ttlChecker = setInterval(() => {\n\t\t\t\tconst now = new Date().getTime();\n\t\t\t\tfor (const key in this.cache) {\n\t\t\t\t\tif (this.cache.hasOwnProperty(key)) {\n\t\t\t\t\t\tconst o = this.cache[key];\n\t\t\t\t\t\tif (o.ttl < now) {\n\t\t\t\t\t\t\tdelete this.cache[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\n\tpublic get(key: string): any {\n\t\tconst o = this.cache[key];\n\t\tif (o !== undefined && o.ttl > new Date().getTime()) {\n\t\t\treturn o.value;\n\t\t}\n\t}\n\n\tpublic set(key: string, value: any, ttlSeconds: number = 60) {\n\t\tthis.cache[key] = {\n\t\t\tvalue,\n\t\t\tttl: new Date().getTime() + ttlSeconds * 1000,\n\t\t};\n\t}\n\n\tpublic remove(key: string) {\n\t\tif (this.cache.hasOwnProperty(key)) {\n\t\t\tdelete this.cache[key];\n\t\t}\n\t}\n\n\tpublic flushAll() {\n\t\tthis.cache = {};\n\t\tif (this.ttlChecker) {\n\t\t\tclearInterval(this.ttlChecker);\n\t\t\tthis.ttlChecker = undefined\n\t\t}\n\t}\n}\n\nexport { NodeCache };\n","import { NodeCache } from './NodeCache';\n\nexport enum ECacheContext {\n\tTranslations,\n\tLabelInfo,\n\tWSAPI,\n}\n\nconst WITH_REF_CACHE = [ECacheContext.Translations];\n\nexport class OCache {\n\tprivate static cache: { [key: string]: NodeCache } = {};\n\n\tprivate static init(cacheContext: ECacheContext) {\n\t\tif (this.cache[cacheContext] === undefined) {\n\t\t\tthis.cache[cacheContext] = new NodeCache();\n\t\t}\n\t}\n\n\tpublic static get<T>(oKey: any, cacheContext: ECacheContext): T | undefined {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tthis.init(cacheContext);\n\n\t\treturn deepClone(this.cache[cacheContext].get(key));\n\t}\n\n\tpublic static set(oKey: any, o: any, cacheContext: ECacheContext, ttlSeconds: number = 60) {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tthis.init(cacheContext);\n\n\t\tthis.cache[cacheContext].set(key, deepClone(o), ttlSeconds);\n\t}\n\n\tpublic static async use<T>(oKey: any, cacheContext: ECacheContext, f: () => Promise<T>, ttlSeconds: number = 60) {\n\t\tif (ttlSeconds <= 0) {\n\t\t\treturn await f();\n\t\t} else {\n\t\t\tlet o: T = OCache.get(oKey, cacheContext);\n\n\t\t\tif (o === undefined) {\n\t\t\t\to = await f();\n\t\t\t\tOCache.set(oKey, o, cacheContext, ttlSeconds);\n\t\t\t}\n\n\t\t\treturn o;\n\t\t}\n\t}\n\n\tpublic static async clear(cacheContext: ECacheContext, oKey: any) {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tif (this.cache[cacheContext]) {\n\t\t\tthis.cache[cacheContext].remove(key);\n\t\t}\n\t}\n\n\tpublic static async clearContext(cacheContext: ECacheContext) {\n\t\tif (this.cache[cacheContext]) {\n\t\t\tthis.cache[cacheContext].flushAll();\n\t\t}\n\t}\n\n\tpublic static async clearAll() {\n\t\tfor (const cacheContext in this.cache) {\n\t\t\tif (this.cache.hasOwnProperty(cacheContext)) {\n\t\t\t\tthis.cache[cacheContext].flushAll();\n\t\t\t}\n\t\t}\n\t\tthis.cache = {};\n\t}\n}\n\nconst deepClone = (o: any) => {\n\tif (o) {\n\t\treturn JSON.parse(JSON.stringify(o));\n\t}\n\n\treturn o;\n};\n","export enum ActivityTypeLimited {\n\tDoNothing = 8,\n\tPoints = 12,\n\tGiveMission = 14,\n\tStartAnotherCampaign = 15,\n\tMiniGameAttempt = 16,\n\tDeductPoints = 21,\n\tResetPoints = 22,\n\tAddGemsAndDiamonds = 25,\n\tDeductGemsAndDiamonds = 26,\n\tResetGemsAndDiamonds = 27,\n\tPopup = 30,\n\tInbox = 31,\n\tSlack = 70,\n\tEmail_To_Customer_Support = 80,\n\tEmail_To_Risk_Operator = 90,\n\tBonus = 100,\n\tWebHook = 200,\n\tTagCustomer = 504,\n\tUnTagCustomer = 505,\n}\n","class CoreUtils {\n\tpublic static avatarUrl = (avatar_id: string, avatarDomain: string): string => {\n\t\tif (\n\t\t\tavatarDomain &&\n\t\t\tavatar_id !== null &&\n\t\t\tavatar_id !== undefined &&\n\t\t\t!(avatar_id.startsWith && avatar_id.startsWith('http'))\n\t\t) {\n\t\t\tif (avatarDomain.endsWith('/')) {\n\t\t\t\treturn avatarDomain.slice(0, -1) + '/avatar/' + avatar_id;\n\t\t\t} else {\n\t\t\t\treturn avatarDomain + '/avatar/' + avatar_id;\n\t\t\t}\n\t\t} else {\n\t\t\treturn avatar_id;\n\t\t}\n\t};\n\n\tpublic static currencySymbol(currency: string) {\n\t\treturn {\n\t\t\t[currency?.toUpperCase()]: currency?.toUpperCase(),\n\t\t\tUSD: '$', // United States Dollar\n\t\t\tEUR: '\\u20AC', // Euro\n\t\t\tJPY: '\\u00A5', // Japanese Yen\n\t\t\tGBP: '\\u00A3', // British Pound Sterling\n\t\t\tAUD: 'A$', // Australian Dollar\n\t\t\tCAD: 'C$', // Canadian Dollar\n\t\t\tCHF: 'CHF', // Swiss Franc\n\t\t\tCNY: '\\u00A5', // Chinese Yuan\n\t\t\tSEK: 'kr', // Swedish Krona\n\t\t\tNZD: 'NZ$', // New Zealand Dollar\n\t\t\tMXN: 'MX$', // Mexican Peso\n\t\t\tSGD: 'S$', // Singapore Dollar\n\t\t\tHKD: 'HK$', // Hong Kong Dollar\n\t\t\tNOK: 'kr', // Norwegian Krone\n\t\t\tKRW: '\\u20A9', // South Korean Won\n\t\t\tTRY: '\\u20BA', // Turkish Lira\n\t\t\tINR: '\\u20B9', // Indian Rupee\n\t\t\tRUB: '\\u20BD', // Russian Ruble\n\t\t\tBRL: 'R$', // Brazilian Real\n\t\t\tZAR: 'R', // South African Rand\n\t\t}[currency?.toUpperCase()];\n\t}\n}\n\nexport { CoreUtils };\n","export enum PublicLabelSettings {\n\tPUBLIC_API_URL = 'PUBLIC_API_URL',\n\tRECORDING_ENABLED_FOR_ALL_USERS = 'RECORDING_ENABLED_FOR_ALL_USERS',\n\tJS_INJECTION = 'JS_INJECTION',\n\tGAMIFICATION_UI_MAIN = 'GAMIFICATION_UI_MAIN',\n\tGAMIFICATION_UI_WIDGET = 'GAMIFICATION_UI_WIDGET',\n\tGAMIFICATION_UI_MINI_GAME = 'GAMIFICATION_UI_MINI_GAME',\n\tGAMIFICATION_UI_SETTINGS = 'GAMIFICATION_UI_SETTINGS',\n\tGAMIFICATION_UI_MAIN_TEST = 'GAMIFICATION_UI_MAIN_TEST',\n\tGAMIFICATION_UI_WIDGET_TEST = 'GAMIFICATION_UI_WIDGET_TEST',\n\tGAMIFICATION_UI_SETTINGS_TEST = 'GAMIFICATION_UI_SETTINGS_TEST',\n\tFRONT_END_ALLOWED_LANGUAGES = 'FRONT_END_ALLOWED_LANGUAGES',\n\tFRONT_END_ALLOW_DOMAINS = 'FRONT_END_ALLOW_DOMAINS',\n\tDELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS = 'DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS',\n\tSHADOW_LABEL_PUBLIC_KEY = 'SHADOW_LABEL_PUBLIC_KEY',\n\tDYNAMIC_IMAGE_DOMAIN = 'DYNAMIC_IMAGE_DOMAIN',\n\n\tGAMIFICATION_LEVELS_LOGIC2 = 'GAMIFICATION_LEVELS_LOGIC2',\n\tGAMIFICATION_LEVELS_LOGIC3 = 'GAMIFICATION_LEVELS_LOGIC2',\n\n\tAVATAR_CUSTOM_IMAGE_MAX_ID = 'AVATAR_CUSTOM_IMAGE_MAX_ID',\n\tAVATAR_CUSTOM_IMAGE_FOLDER = 'AVATAR_CUSTOM_IMAGE_FOLDER',\n\n\tGAMIFICATION_SHOW_POWERED_BY = 'GAMIFICATION_SHOW_POWERED_BY',\n\t_system_leader_board_mask_username = '_system_leader_board_mask_username',\n\t_system_gamification_mask_username = '_system_gamification_mask_username',\n\n\tINBOX_PUBLIC_CDN = 'INBOX_PUBLIC_CDN',\n}\n","enum TranslationArea {\n\tCasino = 1,\n\tGamification = 2,\n\tTrading = 3,\n\tArchived = 4,\n\tAffiliation = 5,\n\tRetentionGames = 6,\n\tAffIliateAdminNew = 7,\n\tAcademy = 8,\n}\n\nexport { TranslationArea };\n","import { TInboxMessage } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { InboxMessage } from './InboxMessage';\n\nexport interface GetInboxMessagesResponse extends ProtocolResponse {\n\tlog: InboxMessage[];\n\tunread_count: number;\n}\n\nexport const InboxMessagesTransform = (items: InboxMessage[]): TInboxMessage[] => {\n\treturn items.map((item) => {\n\t\tconst x: TInboxMessage = {\n\t\t\tsent_date: item.createDate,\n\t\t\tmessage_guid: item.engagement_uid,\n\t\t\tread: item.is_read,\n\t\t\tfavorite: item.is_starred,\n\t\t\tcategory_id: item.category_id,\n\t\t\texpire_on_dt: item.expire_on_dt,\n\t\t};\n\t\treturn x;\n\t});\n};\n","import { IntUtils } from '../IntUtils';\nimport { TInboxMessageBody } from '../WSAPI/WSAPITypes';\nimport { InboxCategories } from './InboxCategories';\nimport { InboxMessageType } from './InboxMessageType';\nimport { OpenLinksType } from './OpenLinksType';\n\nexport interface InboxMessageBody {\n\t// URL or deep-link that neeed to be executed when user clicks on the message\n\taction: string;\n\t// the body of the message in case it's 'simple' inbox message\n\tbody: string;\n\t// type of message, deprecated\n\ttype: InboxMessageType;\n\t// image of the icon\n\timage: string;\n\t// title of the message\n\ttitle: string;\n\t// HTML body of the message in case it's 'rich' inbox message\n\thtml_body: string;\n\t// set of the buttons with text on the button and action that could be URL or deep-link\n\tadditional_buttons?: { inbox_cta_text: string; action: string }[];\n\t// indicator if the message need to be shown when sent and overlay or it should be shown only in the inbox, when user open 'inbox' interface explicitly\n\t// default is 'true'\n\tshow_preview?: boolean;\n\t// duration in seconds for how long to show preview, default is 7 seconds\n\tshow_duration_sec?: number;\n\t// indicator if the image in html_body can be zoomed out\n\t// default is 'false'\n\tenable_zoom_mode?: boolean;\n\t// options that allows to open links in buttons either in new window or in the current one\n\topen_links?: OpenLinksType;\n\t// The custom data of the inbox message defined by operator. Can be a JSON object, string or number\n\tcustom_data?: string;\n}\n\nexport interface InboxMessage {\n\t// date when the message was created\n\tcreateDate: string;\n\t// body of the message according to the interface\n\tbody: InboxMessageBody;\n\t// unique identifier of the message that connects it to the campaign from which it was sent\n\tengagement_uid: string;\n\t// flag that indicates if the message was read by the user\n\tis_read: boolean;\n\t// flag that indicates if the message was marked as favorite by the user\n\tis_starred: boolean;\n\t// flag that indicates if the message was deleted by the user. Such messages are not returned in the response and property is used only internaly in Smartico\n\tis_deleted?: boolean;\n\t// category id of the inbox message, could be categorized as System/Personal/General messages in mentioned tabs\n\tcategory_id?: InboxCategories;\n\t// The epoch timestamp, with milliseconds, when the message is going to be expired \n\texpire_on_dt?: number;\n}\n\nexport const InboxMessageBodyTransform = (item: InboxMessageBody): TInboxMessageBody => {\n\tif (!item) {\n\t\treturn null;\n\t}\n\tconst x: TInboxMessageBody = {\n\t\taction: item.action,\n\t\ticon: item.image,\n\t\ttitle: item.title,\n\t\tpreview_body: item.body,\n\t\tcustom_data: IntUtils.JsonOrText(item?.custom_data),\n\t};\n\n\tif (item.action === 'dp:inbox') {\n\t\tif (item.additional_buttons && item.additional_buttons.length) {\n\t\t\tx.buttons = item.additional_buttons.map((b) => ({\n\t\t\t\taction: b.action,\n\t\t\t\ttext: b.inbox_cta_text,\n\t\t\t}));\n\t\t}\n\n\t\tx.html_body = item?.html_body || null;\n\t}\n\n\treturn x;\n};\n","export enum InboxMessageType {\n\tCustom = 0,\n\tMissionCompleted = 1,\n\tMissionUnlocked = 2,\n\tLeaderboardWon = 3,\n\tLevelChanged = 4,\n\tBonusGiven = 5,\n\tPointsAdded = 6,\n\tPointsUsed = 7,\n\tPersonalMessage = 8,\n}\n\n// keep in sync with BO enum\n","export enum OpenLinksType {\n\tNewWindow = 1,\n\tCurrentWindow = 2\n}","export enum InboxCategories {\n General = 0,\n\tPlatform = 1,\n\tPersonal = 2,\n}","export enum InboxReadStatus {\n\tUnreadOnly = 1,\n\tReadOnly = 2,\n}","export enum BuyStoreItemErrorCode {\n\t/** Generic server error / control-group rejection */\n\tSHOP_FAILED_GENERIC = 1,\n\t/** Label mismatch detected before purchase transaction */\n\tSHOP_WRONG_LABEL_PRECHECK = 106,\n\t/** User don't have enough points on balance */\n\tSHOP_NO_BALANCE = 11000,\n\t/** Wrong shop item id */\n\tSHOP_WRONG_LABEL = 11001,\n\t/** Failed to buy bonus item, probably something wrong with the bonus configuration. */\n\tSHOP_FAILED_TO_BUY_BONUS = 11002, // remote product restriction\n\t/** Failed to buy store item because segment conditions are set by operator for specific CRM item */\n\tSHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003, // when not visible but trying to buy. shouldn't happen\n\t/** Segment conditions are set by operator for specific CRM item and user not matching to this conditions */\n\tSHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004, // when visible but not matching to purchase segment\n\t/** Failed to buy matching bonus item */\n\tSHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,\n\t/** Failed to buy item because of limit of max items is reached */\n\tSHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006,\n\t/** Bonus was issued but a follow-up redemption step failed */\n\tSHOP_FAILED_BONUS_REDEMPTION = 11007,\n\t/** Failed to buy item because no more items are available */\n\tSHOP_FAILED_POOL_EMPTY = 11009,\n\t/** User doesn't have enough gems on balance */\n\tSHOP_NO_BALANCE_GEMS = 11011,\n\t/** User doesn't have enough diamonds on balance */\n\tSHOP_NO_BALANCE_DIAMONDS = 11012,\n\t/** Failed to buy item because of purchase limitation */\n\tSHOP_FAILED_PURCHASE_LIMITATION = 11014,\n\t/** Uncaught server exception */\n\tSHOP_UNEXPECTED_EXCEPTION = 9999,\n}\n","import { TStoreCategory } from '../WSAPI/WSAPITypes';\nimport { StoreCategoryPublicMeta } from './StoreCategoryPublicMeta';\n\nexport interface StoreCategory {\n\tid?: number;\n\tpublicMeta?: StoreCategoryPublicMeta;\n}\n\nexport const StoreCategoryTransform = (items: StoreCategory[]): TStoreCategory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TStoreCategory = {\n\t\t\tid: r.id,\n\t\t\tname: r.publicMeta?.name,\n\t\t\torder: r.publicMeta?.order,\n\t\t};\n\t\treturn x;\n\t});\n};\n","export enum StoreItemPurchaseType {\n Points = 0,\n Gems = 1,\n Diamonds = 2,\n}","export enum StoreItemType {\n\tBonus = 1,\n\tTangible = 2,\n\tMiniGameSpin = 3,\n\tChangeLevel = 4,\n\tPrizeDrop = 5,\n\tRaffleTicket = 6,\n}\n\nexport enum StoreItemTypeName {\n\tBonus = 'bonus',\n\tTangible = 'tangible',\n\tMiniGameSpin = 'minigamespin',\n\tChangeLevel = 'changelevel',\n\tPrizeDrop = 'prizedrop',\n\tRaffleTicket = 'raffleticket',\n\tUnknown = 'unknown',\n}\n\nexport const StoreItemTypeNamed = (type: StoreItemType): StoreItemTypeName => {\n\treturn (\n\t\t{\n\t\t\t[StoreItemType.Bonus]: StoreItemTypeName.Bonus,\n\t\t\t[StoreItemType.Tangible]: StoreItemTypeName.Tangible,\n\t\t\t[StoreItemType.MiniGameSpin]: StoreItemTypeName.MiniGameSpin,\n\t\t\t[StoreItemType.ChangeLevel]: StoreItemTypeName.ChangeLevel,\n\t\t\t[StoreItemType.PrizeDrop]: StoreItemTypeName.PrizeDrop,\n\t\t\t[StoreItemType.RaffleTicket]: StoreItemTypeName.RaffleTicket,\n\t\t}[type] || StoreItemTypeName.Unknown\n\t);\n};\n","import { AchRelatedGame } from '../Base/AchRelatedGame';\nimport { IntUtils } from '../IntUtils';\nimport { TStoreItem } from '../WSAPI/WSAPITypes';\nimport { StoreItemPublicMeta } from './StoreItemPublicMeta';\nimport { StoreItemPurchaseType } from './StoreItemPurchaseType';\nimport { StoreItemType, StoreItemTypeNamed } from './StoreItemType';\n\nexport interface StoreItem {\n\tid: number;\n\titemTypeId: StoreItemType;\n\titemPublicMeta: StoreItemPublicMeta;\n\tcategoryIds?: number[];\n\tcanBuy?: boolean;\n\tshopPool: number;\n\tactiveTillDate?: number;\n\trelatedGames?: AchRelatedGame[];\n}\n\nconst mapPurchaseType = (purchaseType: StoreItemPurchaseType) => {\n\tif (purchaseType === StoreItemPurchaseType.Points) {\n\t\treturn 'points';\n\t} else if (purchaseType === StoreItemPurchaseType.Gems) {\n\t\treturn 'gems';\n\t} else if (purchaseType === StoreItemPurchaseType.Diamonds) {\n\t\treturn 'diamonds';\n\t}\n\n\treturn 'points';\n};\n\nexport const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {\n\t\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TStoreItem = {\n\t\t\t\tid: r.id,\n\t\t\t\tname: r.itemPublicMeta.name,\n\t\t\t\tpurchase_type: mapPurchaseType(r.itemPublicMeta.purchase_type),\n\t\t\t\tprice: r.itemPublicMeta.price as any as number, // AA: strange why it's string\n\t\t\t\timage: r.itemPublicMeta.image_url,\n\t\t\t\tdescription: r.itemPublicMeta.description,\n\t\t\t\tribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,\n\t\t\t\tlimit_message: r.itemPublicMeta.limit_message,\n\t\t\t\tpurchase_limit_message: r.itemPublicMeta.purchase_limit_message,\n\t\t\t\tpriority: r.itemPublicMeta.priority ?? 0,\n\t\t\t\trelated_item_ids: r.itemPublicMeta.related_items,\n\t\t\t\thint_text: r.itemPublicMeta.hint_text,\n\t\t\t\ttype: StoreItemTypeNamed(r.itemTypeId),\n\t\t\t\tcan_buy: r.canBuy,\n\t\t\t\tcategory_ids: r.categoryIds ?? [],\n\t\t\t\tpool: r.shopPool,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.itemPublicMeta.custom_data),\n\t\t\t\tactive_till_date: r.activeTillDate,\n\t\t\t\tshow_timer: r.itemPublicMeta.show_timer,\n\t\t\t\tdiscounted_price: r.itemPublicMeta.discount_prize,\n\t\t\t\tdiscount_price_ribbon: r.itemPublicMeta.discount_prize_ribbon,\n\t\t\t\tcustom_ribbon_image: r.itemPublicMeta.custom_ribbon_image,\n\t\t\t\tcustom_section_id: r.itemPublicMeta.custom_section_id,\n\t\t\t\tonly_in_custom_section: r.itemPublicMeta.only_in_custom_section,\n\t\t\t\tcustom_section_type_id: r.itemPublicMeta.custom_section_type_id,\n\t\t\t\t...(r.itemPublicMeta.cant_buy_message ? { cant_buy_message: r.itemPublicMeta.cant_buy_message } : {}),\n\t\t\t\trelated_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t};\n\t\t\treturn x;\n\t\t});\n};\n","import { IntUtils } from '../IntUtils';\nimport { TStoreItem } from '../WSAPI/WSAPITypes';\nimport { StoreItem } from './StoreItem';\nimport { StoreItemPurchaseType } from './StoreItemPurchaseType';\nimport { StoreItemTypeNamed } from './StoreItemType';\n\ninterface StoreItemPurchased extends StoreItem {\n\tpurchase_ts: number;\n\tpurchase_points_amount: number;\n\tpurchased_today?: boolean;\n\tpurchased_this_week?: boolean;\n\tpurchased_this_month?: boolean;\n}\n\nconst mapPurchaseType = (purchaseType: StoreItemPurchaseType) => {\n\tif (purchaseType === StoreItemPurchaseType.Points) {\n\t\treturn 'points';\n\t} else if (purchaseType === StoreItemPurchaseType.Gems) {\n\t\treturn 'gems';\n\t} else if (purchaseType === StoreItemPurchaseType.Diamonds) {\n\t\treturn 'diamonds';\n\t}\n\n\treturn 'points';\n};\n\nexport const StoreItemPurchasedTransform = (items: StoreItemPurchased[]): TStoreItem[] => {\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst purchasedToday = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'today') : false;\n\t\t\tconst purchasedThisWeek = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisWeek') : false;\n\t\t\tconst purchasedThisMonth = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisMonth') : false;\n\n\t\t\tconst x: TStoreItem = {\n\t\t\t\tid: r.id,\n\t\t\t\tname: r.itemPublicMeta.name,\n\t\t\t\tprice: r.itemPublicMeta.price as any as number, // AA: strange why it's string\n\t\t\t\tpurchase_type: mapPurchaseType(r.itemPublicMeta.purchase_type),\n\t\t\t\timage: r.itemPublicMeta.image_url,\n\t\t\t\tdescription: r.itemPublicMeta.description,\n\t\t\t\tribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,\n\t\t\t\tlimit_message: r.itemPublicMeta.limit_message,\n\t\t\t\tpurchase_limit_message: r.itemPublicMeta.purchase_limit_message,\n\t\t\t\tpriority: r.itemPublicMeta.priority ?? 0,\n\t\t\t\trelated_item_ids: r.itemPublicMeta.related_items,\n\t\t\t\thint_text: r.itemPublicMeta.hint_text,\n\t\t\t\ttype: StoreItemTypeNamed(r.itemTypeId),\n\t\t\t\tcan_buy: r.canBuy,\n\t\t\t\tcategory_ids: r.categoryIds ?? [],\n\t\t\t\tpool: r.shopPool,\n\t\t\t\tpurchase_ts: r.purchase_ts,\n\t\t\t\tpurchase_points_amount: r.purchase_points_amount,\n\t\t\t\tpurchased_today: purchasedToday,\n\t\t\t\tpurchased_this_week: purchasedThisWeek,\n\t\t\t\tpurchased_this_month: purchasedThisMonth,\n\t\t\t\tcustom_data: r.itemPublicMeta.custom_data,\n\t\t\t\tshow_timer: r.itemPublicMeta.show_timer,\n\t\t\t\trelated_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t};\n\n\t\t\treturn x;\n\t\t});\n};\n\nexport { StoreItemPurchased };\n","export enum AchievementStatus {\n\tDraft = 1,\n\tAvailableUnlocked = 2,\n\tAvailableLocked = 3,\n\tArchived = 4,\n\tFeaturedManually = 5,\n\tFeaturedAI = 6,\n\tRecurring = 7,\n\tRecurringUponCompletion = 8\n}\n","export enum AchievementTaskType {\n\tCompleteAchievement = 1,\n\tUnlockAchievement = 2,\n}\n","export enum AchievementType {\n\tMission = 1,\n\tBadge = 2,\n}\n","/** Possible statuses of the mission availability. \n * Notes:\n * - Recurring missions have a special field next_recurrence_date_ts, but it's only relevant if the mission has no active till date or the next recurrence date is before the active till date.\n * - For a locked mission or mission that requires opt-in, the time limit should be calculated as dt_start + time_limit_ms. For a mission that does not require opt-in or type is not Locked, it should be the highest value of dt_start and active_from_ts (if defined) + time_limit_ms.\n * */\n\nexport enum AchievementAvailabilityStatus {\n /** Mission without date/time restrictions or with passed active from date and no opt-in required and mission is unlocked */\n Available = 0,\n\n /** Mission without date/time restrictions or with passed active from date, opt-in is required, user is not opted-in or mission is locked */\n AvailableInactive = 1,\n\n /** Mission without date/time restrictions or with passed active from date, opt-in is required, user is opted-in or mission is unlocked*/\n AvailableActive = 2,\n\n /** Mission with active from date defined, date is in future.\n * Field: active_from_ts\n */\n UnavailableWithActiveFrom = 3,\n\n /** Mission with active till date defined, date is in future, and no opt-in required and mission is unlocked.\n * Field: active_till_ts\n */\n AvailableWithActiveTill = 4,\n\n /** Mission with active till date defined, date is in future, and opt-in is required, user is not opted in or mission is locked.\n * Fields: active_till_ts, is_requires_optin, is_opted_in, is_locked.\n */\n AvailableWithActiveTillInactive = 5,\n\n /** Mission with active till date defined, date is in future, and opt-in is required, user is opted in or mission is unlocked.\n * Fields: active_till_ts, is_requires_optin, is_opted_in, is_locked.\n */\n AvailableWithActiveTillActive = 6,\n\n /** Available mission with time limit, and opt-in is required or mission is unlocked.\n * The time limit is calculated as the sum of two properties: (highest value from dt_start and active_from_ts) + time_limit_ms.\n * \n */\n AvailableLimited = 7,\n\n /** Available mission with time limit, opt-in is required, user is not opted-in or mission is locked.\n * Time limit at this stage is not relevant, user should be opted-in or mission should be unlocked.\n */\n AvailableLimitedInactive = 8,\n\n /** Available mission with time limit, opt-in is required, user is opted-in or mission unlocked.\n * The time limit is calculated as the sum of two properties: dt_start + time_limit_ms.\n */\n AvailableLimitedActive = 9,\n\n /** Available mission with time limit and active till date, opt-in is not required and mission is unlocked.\n * Fields: active_till_ts, time_limit_ms, dt_start, active_from_ts;\n * The time limit is calculated as the sum of two properties: (highest value from dt_start and active_from_ts) + time_limit_ms.\n */\n AvailableFullyLimited = 10,\n\n /** Available mission with time limit and active till date, opt-in is required, user is not opted in or mission is locked.\n * Fields: active_till_ts, time_limit_ms, dt_start, active_from_ts, is_requires_optin, is_opted_in, is_locked.\n * On this stage only active_till_ts is relevant. time_limit_ms is ignored because user should be opted in.\n */\n AvailableFullyLimitedInactive = 11,\n\n /** Available mission with time limit and active till date, opt-in is required, user is opted in or mission is unlocked.\n * Fields: active_till_ts, time_limit_ms, dt_start, is_requires_optin, is_opted_in, is_locked.\n * The time limit is calculated as the sum of two properties: dt_start + time_limit_ms.\n */\n AvailableFullyLimitedActive = 12,\n\n /** Missed mission when active till date is already passed. is_completed field indicating if mission is completed or just missed */\n MissedByActiveTill = 13,\n\n /** Missed mission when start_date + time_limit_ms is already passed. is_completed field indicating if mission is completed or just missed */\n MissedByLimitInTime = 14,\n}","export enum BadgesTimeLimitStates {\n\t/** Before Start Date */\n\tBeforeStartDate = 0,\n\t/** After Start Date but before earned */\n\tAfterStartDateNoProgress = 1,\n\t/** After Start Date but before started (no progress) + End date */\n\tAfterStartDateNoProgressAndEndDate = 2,\n\t/** After Start Date, but with some progress + End date */\n\tAfterStartDateWithProgressAndEndDate = 3,\n\t/** After End Date (not started) */\n\tAfterEndDateNotStarted = 4,\n\t/** After End Date (player has some progress, but not completed) */\n\tAfterEndDateWithProgress = 5,\n}\n\n","import { IntUtils } from \"../IntUtils\";\nimport { AchievementAvailabilityStatus } from \"./AchievementAvailabilityStatus\";\nimport { AchievementStatus } from \"./AchievementStatus\";\nimport { UserAchievement } from \"./UserAchievement\";\nimport { UserAchievementTask } from \"./UserAchievementTask\";\nimport { BadgesTimeLimitStates } from \"./BadgesTimeLimitStates\";\n\ntype UserStateParamsKeys = 'core_fav_game_top3' | 'core_fav_game_type_top3' | 'core_fav_game_provider_top3' | 'core_recommended_deposit_amount' | 'core_recommended_casino_bet_amount';\nconst USER_STATE_PARAMS_KEYS_GAMES: UserStateParamsKeys[] = ['core_fav_game_top3', 'core_fav_game_type_top3', 'core_fav_game_provider_top3'];\nconst USER_STATE_PARAMS_KEYS_BET_AMOUNT: UserStateParamsKeys[] = [\n 'core_recommended_deposit_amount',\n 'core_recommended_casino_bet_amount',\n];\n\nconst MINOR_WORDS = new Set([\n 'of', 'at', 'in', 'on', 'to', 'up', 'as', 'by', 'for',\n 'from', 'into', 'onto', 'with', 'upon', 'via',\n 'and', 'but', 'or', 'nor', 'so', 'yet',\n 'vs', 'v',\n 'a', 'an', 'the',\n]);\n\nfunction toGameTitleCase(raw: string): string {\n if (!raw) return raw;\n const tokens = raw.toLowerCase().split(/(\\b\\w+\\b)/);\n const wordTokens = tokens.filter((t) => /^\\w+$/.test(t));\n const lastWordIdx = wordTokens.length - 1;\n let wordIndex = 0;\n return tokens\n .map((token) => {\n if (!/^\\w+$/.test(token)) return token;\n const isFirst = wordIndex === 0;\n const isLast = wordIndex === lastWordIdx;\n wordIndex++;\n if (isFirst || isLast || !MINOR_WORDS.has(token)) {\n return token.charAt(0).toUpperCase() + token.slice(1);\n }\n return token;\n })\n .join('');\n}\n\nexport class MissionUtils {\n\n public static getAvailabilityStatus = (mission: UserAchievement) => {\n\n if (!mission) {\n return null;\n }\n\n const activeFrom = mission.active_from_ts ? MissionUtils.getMs(mission.active_from_ts) : null\n const activeTill = mission.active_till_ts ? MissionUtils.getMs(mission.active_till_ts) : null;\n const startDate = mission.start_date_ts ? MissionUtils.getMs(mission.start_date_ts) : null;\n const timeLimit = mission.time_limit_ms;\n const requiresOptIn = mission.requiresOptin;\n const optedIn = mission.isOptedIn;\n const isLockedMission = mission.ach_status_id === AchievementStatus.AvailableLocked;\n const isLocked = mission.isLocked;\n\n if (!activeFrom && !activeTill && !timeLimit) {\n if (requiresOptIn) {\n if (optedIn) {\n return AchievementAvailabilityStatus.AvailableActive;\n } else {\n return AchievementAvailabilityStatus.AvailableInactive;\n }\n } else if (isLockedMission) {\n if (!isLocked) {\n return AchievementAvailabilityStatus.AvailableActive;\n } else {\n return AchievementAvailabilityStatus.AvailableInactive;\n }\n } else {\n return AchievementAvailabilityStatus.Available;\n }\n }\n\n if (activeFrom && activeFrom > Date.now()) {\n return AchievementAvailabilityStatus.UnavailableWithActiveFrom;\n }\n\n if ((activeFrom && activeFrom < Date.now()) || !activeFrom) {\n if (!activeTill && !timeLimit) {\n if (requiresOptIn) {\n if (optedIn) {\n return AchievementAvailabilityStatus.AvailableActive;\n } else {\n return AchievementAvailabilityStatus.AvailableInactive;\n }\n } else if (isLockedMission) {\n if (!isLocked) {\n return AchievementAvailabilityStatus.AvailableActive;\n } else {\n return AchievementAvailabilityStatus.AvailableInactive;\n }\n } else {\n return AchievementAvailabilityStatus.Available;\n }\n }\n\n if (activeTill && !timeLimit) {\n if (activeTill > Date.now()) {\n if (requiresOptIn) {\n if (optedIn) {\n return AchievementAvailabilityStatus.AvailableWithActiveTillActive;\n } else {\n return AchievementAvailabilityStatus.AvailableWithActiveTillInactive;\n }\n } else if (isLockedMission) {\n if (!isLocked) {\n return AchievementAvailabilityStatus.AvailableWithActiveTillActive;\n } else {\n return AchievementAvailabilityStatus.AvailableWithActiveTillInactive;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableWithActiveTill;\n }\n } else {\n return AchievementAvailabilityStatus.MissedByActiveTill;\n }\n }\n\n if (timeLimit && !activeTill) {\n if (requiresOptIn) {\n const endDate = startDate + timeLimit;\n\n if (optedIn) {\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableLimitedActive;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableLimitedInactive;\n }\n } else if (isLockedMission) {\n const endDate = startDate + timeLimit;\n\n if (!isLocked) {\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableLimitedActive;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableLimitedInactive;\n }\n } else {\n const endDate = activeFrom && activeFrom > startDate ? activeFrom + timeLimit : startDate + timeLimit;\n\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableLimited;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n }\n }\n\n if (timeLimit && activeTill) {\n if (activeTill > Date.now()) {\n if (requiresOptIn) {\n if (optedIn) {\n const endDate = startDate + timeLimit;\n\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableFullyLimitedActive;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableFullyLimitedInactive;\n }\n } else if (isLockedMission) {\n if (!isLocked) {\n const endDate = startDate + timeLimit;\n\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableFullyLimitedActive;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n } else {\n return AchievementAvailabilityStatus.AvailableFullyLimitedInactive;\n }\n } else {\n const endDate = activeFrom && activeFrom > startDate ? activeFrom + timeLimit : startDate + timeLimit;\n\n if (endDate > Date.now()) {\n return AchievementAvailabilityStatus.AvailableFullyLimited;\n } else {\n return AchievementAvailabilityStatus.MissedByLimitInTime;\n }\n }\n } else {\n return AchievementAvailabilityStatus.MissedByActiveTill;\n }\n }\n }\n }\n\n public static getMs = (ts: number): number => {\n return new Date(ts).getTime();\n }\n\n public static replaceTagsFavMissionTask = ({ task, valueToReplace, currencySymbol }: { task: UserAchievementTask, valueToReplace: string, currencySymbol?: string }): string => {\n let result = valueToReplace || '';\n\n if (!task) {\n return result;\n }\n\n const userStateParams = (task.user_state_params || {});\n const userStateOperator = task.task_public_meta?.user_state_operations;\n const userStateParamsKeys = Object.keys(userStateParams);\n\n if (userStateParamsKeys.length === 0 || !userStateOperator) {\n return result;\n }\n\n const operatorsMulti = ['has', '!has'];\n const operatorsPos = ['pos1', 'pos2', 'pos3'];\n\n let suggestedGames: string = '';\n let suggestedValue: string = '';\n\n userStateParamsKeys.forEach((k: UserStateParamsKeys) => {\n const operator = userStateOperator[k]?.op;\n\n if (USER_STATE_PARAMS_KEYS_GAMES.includes(k)) {\n if (operatorsMulti.includes(operator)) {\n const value = userStateParams[k]?.filter(v => Boolean(v));\n if (value && value.length > 0) {\n suggestedGames = value.map((v: string) => {\n const cleaned = v.replace(/_/g, ' ');\n return toGameTitleCase(cleaned);\n }).join(', ');\n }\n }\n\n if (operatorsPos.includes(operator)) {\n const value = userStateParams[k];\n const pos = Number(operator.replace('pos', '')) - 1;\n\n if (IntUtils.isNotNull(pos) && value && value[pos]) {\n suggestedGames = value[pos];\n\n if (suggestedGames) {\n suggestedGames = toGameTitleCase(suggestedGames.replace(/_/g, ' '));\n }\n\n }\n }\n }\n\n if (USER_STATE_PARAMS_KEYS_BET_AMOUNT.includes(k)) { \n suggestedValue = userStateParams[k];\n\n if (suggestedValue) {\n const currencyFromTheTask = userStateParams?.core_wallet_currency;\n\n suggestedValue = `${suggestedValue} ${currencySymbol || currencyFromTheTask || ''}`;\n }\n }\n });\n\n if (suggestedGames && result) {\n result = result.replace('{{suggested_games}}', suggestedGames);\n }\n\n if (suggestedValue && result) {\n result = result.replace('{{suggested_value}}', suggestedValue);\n }\n\n return result;\n }\n\n public static replaceFavGameNameTag = ({ task, currencySymbol }: { task: UserAchievementTask, currencySymbol?: string }): UserAchievementTask => {\n if (task && task.task_public_meta && task.task_public_meta.name) {\n task.task_public_meta.name = MissionUtils.replaceTagsFavMissionTask({ task, valueToReplace: task.task_public_meta.name, currencySymbol });\n }\n\n return task;\n }\n\n public static determineBadgeState = (badge: UserAchievement): BadgesTimeLimitStates | null => {\n const now = Date.now();\n const { active_from_ts, active_till_ts, progress, isCompleted, complete_date_ts } = badge;\n\n // If badge is completed before active till date, return null\n if (isCompleted && (!active_till_ts || complete_date_ts < active_till_ts)) {\n return null;\n }\n \n // 1. BEFORE START\n if (active_from_ts > now) {\n return BadgesTimeLimitStates.BeforeStartDate;\n }\n \n // 2. AFTER START, NO END DATE (infinite badge)\n // → grey, no locked, no date chip\n if (!active_till_ts) {\n if (progress === 0) {\n return BadgesTimeLimitStates.AfterStartDateNoProgress;\n }\n // If infinite and with progress → this state does not exist in enum\n // (but if needed we can add one)\n }\n \n // 3. AFTER START, BEFORE END DATE\n if (now < active_till_ts) {\n if (progress === 0) {\n // now < end + has end date → must show chip\n return BadgesTimeLimitStates.AfterStartDateNoProgressAndEndDate;\n }\n \n return BadgesTimeLimitStates.AfterStartDateWithProgressAndEndDate;\n }\n \n // 4. AFTER END DATE\n if (progress === 0) {\n return BadgesTimeLimitStates.AfterEndDateNotStarted;\n }\n \n return BadgesTimeLimitStates.AfterEndDateWithProgress;\n }\n}\n","import { AchRelatedGame } from '../Base/AchRelatedGame';\nimport { IntUtils } from '../IntUtils';\nimport { TMissionOrBadge } from '../WSAPI/WSAPITypes';\nimport { AchievementPublicMeta } from './AchievementPublicMeta';\nimport { AchievementStatus } from './AchievementStatus';\nimport { AchievementTaskType } from './AchievementTaskType';\nimport { AchievementType } from './AchievementType';\nimport { MissionUtils } from './MissionsUtils';\nimport { ScheduledMissionType } from './ScheduledMissionType';\nimport { UserAchievementTask } from './UserAchievementTask';\nimport { BadgesTimeLimitStates } from './BadgesTimeLimitStates';\nimport { AchievementClaimPeriodTypeId } from './AchievementClaimTypeId';\n\nexport interface UserAchievement {\n\tach_id?: number;\n\tach_type_id?: AchievementType;\n\tach_public_meta?: AchievementPublicMeta;\n\tisCompleted?: boolean;\n\tisLocked?: boolean;\n\trequiresOptin?: boolean;\n\tisOptedIn?: boolean;\n\tstart_date?: string; // time when mission unlocked or opted-in. Needed to calculated \"remaining time\" in case time_limit_ms is set\n\tstart_date_ts?: number;\n\ttime_limit_ms?: number;\n\tprogress?: number;\n\tcomplete_date?: string;\n\tcomplete_date_ts?: number;\n\tunlock_date?: string;\n\tmilliseconds_till_available?: number;\n\tcompleted_tasks?: number;\n\tachievementTasks?: UserAchievementTask[];\n\tnext_recurrence_date_ts?: number;\n\tach_status_id?: AchievementStatus;\n\tscheduledMissionType?: ScheduledMissionType;\n\trelated_games?: AchRelatedGame[];\n\tactive_from_ts?: number; // indicates when 'scheduled' mission is active from,\n\tactive_till_ts?: number; // indicates when 'scheduled' mission is active till,\n\tach_categories?: number[];\n\trecurring_quantity?: number; // max completion count for Recurring upon completion\n\tcompleted_count?: number; // completion count for Recurring upon completion\n\n\tach_completed_id?: number; // ID of the completion fact from ach_completed or ach_completed_recurring tables\n\trequires_prize_claim?: boolean; // flag from achievement if the mission prize will be given only after user claims it\n\tprize_claimed_date_ts?: number; // the date/timestamp indicating when the prize was claimed by the user\n\n\tcompleted_today?: boolean;\n\tcompleted_this_week?: boolean;\n\tcompleted_this_month?: boolean;\n\tcustom_section_type_id?: number;\n\tbadgeTimeLimitState?: BadgesTimeLimitStates;\n\tprize_claim_expiration_date?: number;\n\tprize_claim_period_type_id?: AchievementClaimPeriodTypeId;\n}\n\nexport const enrichUserAchievementsWithBadgeState = (items: UserAchievement[]): UserAchievement[] => {\n\treturn items.map((item) => {\n\t\tif (item.ach_type_id === AchievementType.Badge && (item.active_from_ts || item.active_till_ts)) {\n\t\t\titem.badgeTimeLimitState = MissionUtils.determineBadgeState(item);\n\t\t}\n\t\treturn item;\n\t});\n};\n\nexport const UserAchievementTransform = (items: UserAchievement[]): TMissionOrBadge[] => {\n\treturn items\n\t\t.filter((r) => r.ach_id >= 1)\n\t\t.map((r) => {\n\t\t\tconst completedToday = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'today') : false;\n\t\t\tconst completedThisWeek = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'thisWeek') : false;\n\t\t\tconst completedThisMonth = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'thisMonth') : false;\n\n\t\t\tlet missionName = r.ach_public_meta.name;\n\t\t\tlet missionSubHeader = r.ach_public_meta.sub_header;\n\t\t\tlet missionDescription = r.ach_public_meta.description;\n\n\t\t\tif (missionName?.includes('{{suggested_') || missionSubHeader?.includes('{{suggested_') || missionDescription?.includes('{{suggested_')) {\n\t\t\t\tr.achievementTasks.forEach(t => {\n\t\t\t\t\tif (r.ach_public_meta.name?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionName = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.name });\n\t\t\t\t\t}\n\t\t\t\t\tif (r.ach_public_meta.sub_header?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionSubHeader = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.sub_header });\n\t\t\t\t\t}\n\t\t\t\t\tif (r.ach_public_meta.description?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionDescription = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.description });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst x: TMissionOrBadge = {\n\t\t\t\tid: r.ach_id,\n\t\t\t\tname: missionName,\n\t\t\t\tsub_header: missionSubHeader,\n\t\t\t\tdescription: missionDescription,\n\t\t\t\thint_text: r.ach_public_meta.hint_text,\n\t\t\t\tunlock_mission_description: r.ach_public_meta.unlock_mission_description,\n\t\t\t\timage: r.ach_public_meta.image_url,\n\t\t\t\tis_completed: r.isCompleted,\n\t\t\t\tis_locked: r.isLocked,\n\t\t\t\tis_requires_optin: r.requiresOptin,\n\t\t\t\tis_opted_in: r.isOptedIn,\n\t\t\t\ttime_limit_ms: r.time_limit_ms,\n\t\t\t\tactive_from_ts: r.active_from_ts,\n\t\t\t\tactive_till_ts: r.active_till_ts,\n\t\t\t\tdt_start: r.start_date_ts,\n\t\t\t\treward: r.ach_public_meta.reward,\n\t\t\t\tprogress: r.progress,\n\t\t\t\ttype: r.ach_type_id === AchievementType.Mission ? 'mission' : 'badge',\n\t\t\t\tcta_action: r.ach_public_meta.cta_action,\n\t\t\t\tcta_text: r.ach_public_meta.cta_text,\n\t\t\t\tcustom_section_id: r.ach_public_meta.custom_section_id,\n\t\t\t\tonly_in_custom_section: r.ach_public_meta.only_in_custom_section,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.ach_public_meta.custom_data),\n\t\t\t\tposition: r.ach_public_meta.position,\n\t\t\t\tribbon:\n\t\t\t\t\tr.ach_public_meta.label_tag === 'custom' ? r.ach_public_meta.custom_label_tag : r.ach_public_meta.label_tag,\n\t\t\t\ttasks: (r.achievementTasks || [])\n\t\t\t\t\t.filter((t) => t.task_type_id === AchievementTaskType.CompleteAchievement)\n\t\t\t\t\t.map((t) => {\n\t\t\t\t\t\tMissionUtils.replaceFavGameNameTag({ task: t });\n\n\t\t\t\t\t\treturn ({\n\t\t\t\t\t\t\tid: t.task_id,\n\t\t\t\t\t\t\tname: t.task_public_meta?.name,\n\t\t\t\t\t\t\tpoints_reward: t.points_reward,\n\t\t\t\t\t\t\tgems_reward: t.gems_reward,\n\t\t\t\t\t\t\tdiamonds_reward: t.diamonds_reward,\n\t\t\t\t\t\t\tis_completed: t.isCompleted,\n\t\t\t\t\t\t\tprogress: t.userProgress,\n\t\t\t\t\t\t\texecution_count_expected: t.executionCount,\n\t\t\t\t\t\t\texecution_count_actual: t.userExecutedCount,\n\t\t\t\t\t\t\tdisplay_progress_as_count: t.task_public_meta.display_progress_as_count,\n\t\t\t\t\t\t\tstage_image: t.task_public_meta.stage_image,\n\t\t\t\t\t\t})\n\t\t\t\t\t}),\n\t\t\t\trelated_games: (r.related_games || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t\tcategory_ids: r.ach_categories ?? [],\n\t\t\t\tach_completed_id: r.ach_completed_id,\n\t\t\t\trequires_prize_claim: r.requires_prize_claim,\n\t\t\t\tprize_claimed_date_ts: r.prize_claimed_date_ts,\n\t\t\t\tcomplete_date: r.complete_date,\n\t\t\t\tcomplete_date_ts: r.complete_date_ts,\n\t\t\t\tcompleted_today: completedToday,\n\t\t\t\tcompleted_this_week: completedThisWeek,\n\t\t\t\tcompleted_this_month: completedThisMonth,\n\t\t\t\tcustom_section_type_id: r.ach_public_meta.custom_section_type_id,\n\t\t\t\tavailability_status: MissionUtils.getAvailabilityStatus(r),\n\t\t\t\tclaim_button_title: r.ach_public_meta.claim_button_title,\n\t\t\t\tclaim_button_action: r.ach_public_meta.claim_button_action,\n\t\t\t\tbadgeTimeLimitState: r.badgeTimeLimitState,\n\t\t\t\thide_locked_mission: r.ach_public_meta.hide_locked_mission,\n\t\t\t\tprize_claim_expiration_date: r.prize_claim_expiration_date,\n\t\t\t\tprize_claim_period_type_id: r.prize_claim_period_type_id,\n\t\t\t};\n\n\t\t\tif (r.ach_status_id === AchievementStatus.Recurring) {\n\t\t\t\tx.next_recurrence_date_ts = Date.now() + r?.milliseconds_till_available;\n\t\t\t}\n\n\t\t\tif (r.ach_status_id === AchievementStatus.RecurringUponCompletion) {\n\t\t\t\tx.completion_count = r.completed_count;\n\t\t\t\tx.max_completion_count = r.recurring_quantity;\n\t\t\t}\n\t\t\treturn x;\n\t\t});\n};\n","export enum ScheduledMissionType {\n\tFuture = 1,\n\tPast = 2,\n\tPresent = 3,\n}\n","import { TAchCategory } from '../WSAPI/WSAPITypes';\nimport { AchCategoryPublicMeta } from './AchCategoryPublicMeta';\n\nexport interface AchCategory {\n\tid?: number;\n\tpublicMeta?: AchCategoryPublicMeta;\n}\n\nexport const AchCategoryTransform = (items: AchCategory[]): TAchCategory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TAchCategory = {\n\t\t\tid: r.id,\n\t\t\tname: r.publicMeta?.name,\n\t\t\torder: r.publicMeta?.order,\n\t\t};\n\t\treturn x;\n\t});\n};\n","export enum MissionCategory {\n\tOverview,\n\t// fake category for custom section overview missions, using in TSMap.to get correct missions\n\tCustomSectionOverview,\n\tAvailable,\n\tLocked,\n\tCompleted,\n\tMissed,\n}","export enum AchievementClaimPeriodTypeId {\n\tRelativePeriod = 0,\n\tExactPeriod = 1,\n}","import { ProtocolResponse } from '../Base/ProtocolResponse';\n\nexport interface ClanTournamentPlayerRaw {\n\tuserId: number;\n\tcleanExtUserId: string;\n\tuserAltName: string;\n\tavatar_id: string;\n\tavatar_real_id: number;\n\tposition: number;\n\tscores: number;\n\tisMe: boolean;\n\tregistration_status?: number;\n\tcrmBrandId?: number;\n\tavatar_url?: string;\n}\n\nexport interface GetClanTournamentPlayersResponse extends ProtocolResponse {\n\tclan_id: number;\n\tclan_public_meta: { name: string; image_url: string };\n\tplayers: ClanTournamentPlayerRaw[];\n}\n\nexport interface TClanTournamentPlayer {\n\tuser_id: number;\n\tclean_ext_user_id: string;\n\tpublic_username: string;\n\tavatar_id: string;\n\tavatar_real_id: number;\n\tavatar_url?: string;\n\tposition: number;\n\tscores: number;\n\tis_me: boolean;\n}\n\nexport interface TClanTournamentPlayersResult {\n\tclan_id: number;\n\tclan_public_meta: { name: string; image_url: string };\n\tplayers: TClanTournamentPlayer[];\n}\n\nexport const clanTournamentPlayersTransform = (response: GetClanTournamentPlayersResponse): TClanTournamentPlayersResult => {\n\treturn {\n\t\tclan_id: response.clan_id,\n\t\tclan_public_meta: {\n\t\t\tname: response.clan_public_meta.name,\n\t\t\timage_url: response.clan_public_meta.image_url,\n\t\t},\n\t\tplayers: (response.players || []).map((p) => ({\n\t\t\tuser_id: p.userId,\n\t\t\tclean_ext_user_id: p.cleanExtUserId,\n\t\t\tpublic_username: p.userAltName,\n\t\t\tavatar_id: p.avatar_id,\n\t\t\tavatar_real_id: p.avatar_real_id,\n\t\t\tavatar_url: p.avatar_url,\n\t\t\tposition: p.position,\n\t\t\tscores: p.scores,\n\t\t\tis_me: p.isMe,\n\t\t})),\n\t};\n};\n","export enum TournamentRegistrationType {\n\tAUTO = 1,\n\tOPT_IN = 2,\n\tBUY_IN_POINTS = 3,\n\tMANUAL_APPROVAL = 4,\n\tREQUIRES_QUALIFICATION = 5,\n\tBUY_IN_GEMS = 6,\n\tBUY_IN_DIAMONDS = 7,\n\t// BUY_IN_CASH = 5???,\n}\n\nexport type TournamentRegistrationTypeName =\n\t| 'AUTO'\n\t| 'OPT_IN'\n\t| 'BUY_IN_POINTS'\n\t| 'MANUAL_APPROVAL'\n\t| 'REQUIRES_QUALIFICATION'\n\t| 'BUY_IN_GEMS'\n\t| 'BUY_IN_DIAMONDS'\n\t| 'UNKNOWN';\n\n/** @hidden */\nexport const TournamentRegistrationTypeGetName = (type: TournamentRegistrationType): TournamentRegistrationTypeName => {\n\treturn ({\n\t\t[TournamentRegistrationType.AUTO]: 'AUTO',\n\t\t[TournamentRegistrationType.BUY_IN_POINTS]: 'BUY_IN_POINTS',\n\t\t[TournamentRegistrationType.MANUAL_APPROVAL]: 'MANUAL_APPROVAL',\n\t\t[TournamentRegistrationType.OPT_IN]: 'OPT_IN',\n\t\t[TournamentRegistrationType.REQUIRES_QUALIFICATION]: 'REQUIRES_QUALIFICATION',\n\t\t[TournamentRegistrationType.BUY_IN_GEMS]: 'BUY_IN_GEMS',\n\t\t[TournamentRegistrationType.BUY_IN_DIAMONDS]: 'BUY_IN_DIAMONDS',\n\t}[type] || 'UNKNOWN') as any as TournamentRegistrationTypeName;\n};\n","export enum TournamentRegistrationStatus {\n\tNOT_REGISTERED = 0,\n\tREGISTERED = 1,\n\tFINISHED = 2,\n\tPENDING = 3,\n\tCANCELLED = 4,\n\tREGISTERED_PENDING_QUALIFICATION = 5,\n\tQUALIFIED_PENDING_REGISTRATION = 6,\n}\n\nexport enum TournamentRegistrationStatusName {\n\tNOT_REGISTERED = 'NOT_REGISTERED',\n\tREGISTERED = 'REGISTERED',\n\tFINISHED = 'FINISHED',\n\tPENDING = 'PENDING',\n\tCANCELLED = 'CANCELLED',\n\tREGISTERED_PENDING_QUALIFICATION = 'REGISTERED_PENDING_QUALIFICATION',\n\tQUALIFIED_PENDING_REGISTRATION = 'QUALIFIED_PENDING_REGISTRATION',\n\tUNKNOWN = 'UNKNOWN',\n}\n\n/** @hidden */\nexport const TournamentRegistrationStatusNamed = (type: TournamentRegistrationStatus): TournamentRegistrationStatusName => {\n\treturn ({\n\t\t[TournamentRegistrationStatus.CANCELLED]: TournamentRegistrationStatusName.CANCELLED,\n\t\t[TournamentRegistrationStatus.FINISHED]: TournamentRegistrationStatusName.FINISHED,\n\t\t[TournamentRegistrationStatus.NOT_REGISTERED]: TournamentRegistrationStatusName.NOT_REGISTERED,\n\t\t[TournamentRegistrationStatus.PENDING]: TournamentRegistrationStatusName.PENDING,\n\t\t[TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION]:\n\t\t\tTournamentRegistrationStatusName.QUALIFIED_PENDING_REGISTRATION,\n\t\t[TournamentRegistrationStatus.REGISTERED]: TournamentRegistrationStatusName.REGISTERED,\n\t\t[TournamentRegistrationStatus.REGISTERED_PENDING_QUALIFICATION]:\n\t\t\tTournamentRegistrationStatusName.REGISTERED_PENDING_QUALIFICATION,\n\t}[type] || TournamentRegistrationStatusName.UNKNOWN) as TournamentRegistrationStatusName;\n};\n","export enum TournamentInstanceStatus {\n\tPUBLISHED = 1,\n\tREGISTER = 2,\n\tSTARTED = 3,\n\tFINISHED = 4,\n\tCANCELLED = 5,\n\tFAILED = 6,\n\tFINALIZING = 7,\n}\n\nexport const TournamentInstanceStatusName = (s: TournamentInstanceStatus): string => {\n\treturn {\n\t\t[TournamentInstanceStatus.PUBLISHED]: 'PUBLISHED',\n\t\t[TournamentInstanceStatus.REGISTER]: 'REGISTER',\n\t\t[TournamentInstanceStatus.STARTED]: 'STARTED',\n\t\t[TournamentInstanceStatus.FINISHED]: 'FINISHED',\n\t\t[TournamentInstanceStatus.CANCELLED]: 'CANCELLED',\n\t\t[TournamentInstanceStatus.FAILED]: 'FAILED',\n\t\t[TournamentInstanceStatus.FINALIZING]: 'FINALIZING',\n\t}[s];\n};\n","import { ActivityTypeLimited } from '../Core';\nimport { Tournament } from './Tournament';\nimport { TournamentInstanceStatus } from './TournamentInstanceStatus';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TournamentRegistrationStatus } from './TournamentRegistrationStatus';\nimport { TournamentRegistrationType } from './TournamentRegistrationType';\n\nconst tournamentPrizeTypeToPrizeName = (type: ActivityTypeLimited) => {\n\treturn {\n\t\t[ActivityTypeLimited.DoNothing]: 'TANGIBLE',\n\t\t[ActivityTypeLimited.Points]: 'POINTS_ADD',\n\t\t[ActivityTypeLimited.DeductPoints]: 'POINTS_DEDUCT',\n\t\t[ActivityTypeLimited.ResetPoints]: 'POINTS_RESET',\n\t\t[ActivityTypeLimited.MiniGameAttempt]: 'MINI_GAME_ATTEMPT',\n\t\t[ActivityTypeLimited.Bonus]: 'BONUS',\n\t\t[ActivityTypeLimited.AddGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_ADD',\n\t\t[ActivityTypeLimited.DeductGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_DEDUCT',\n\t\t[ActivityTypeLimited.ResetGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_RESET',\n\t}[type];\n};\n\nexport class TournamentUtils {\n\tpublic static isCanRegister = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\tif (tournament.tournamentRegistrationStatus === TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t!tournament.isUserRegistered && (\n\t\t\t\t\ttournament.playersMaxCount !== tournament.registrationCount ||\n\t\t\t\t\ttournament.playersMaxCount === null ||\n\t\t\t\t\ttournament.playersMaxCount === 0\n\t\t\t\t) &&\n\t\t\t\ttournament.registrationType !== TournamentRegistrationType.AUTO && (\n\t\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER || (\n\t\t\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED && tournament.allowLateRegistration\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isInProgress = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn tournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED;\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isActive = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.PUBLISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isFinished = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.FINISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.CANCELLED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.FINALIZING\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isCancelled = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn tournament.tournamentInstanceStatus === TournamentInstanceStatus.CANCELLED;\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isUpcoming = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.PUBLISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static getPlayerTransformed = (player: TournamentPlayer, isMe?: boolean) => {\n\t\tif (player) {\n\t\t\tconst playerTransformed = {\n\t\t\t\tpublic_username: player.userAltName,\n\t\t\t\tavatar_url: player.avatar_url,\n\t\t\t\tposition: player.position,\n\t\t\t\tscores: player.scores,\n\t\t\t\tis_me: player.isMe,\n\t\t\t\tuser_ext_id: player.cleanExtUserId,\n\t\t\t\tcrm_brand_id: player.crmBrandId,\n\t\t\t\tuser_id: player.userId,\n\t\t\t};\n\n\t\t\tif (isMe) {\n\t\t\t\tdelete playerTransformed.is_me;\n\t\t\t}\n\n\t\t\treturn playerTransformed;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tpublic static getPrizeTransformed = (prize: TournamentPrize) => {\n\t\tif (prize) {\n\t\t\treturn { ...prize, type: tournamentPrizeTypeToPrizeName(prize.type) };\n\t\t}\n\n\t\treturn null;\n\t};\n}\n","import { TournamentRegistrationType, TournamentRegistrationTypeGetName } from './TournamentRegistrationType';\nimport { TournamentInstanceStatus } from './TournamentInstanceStatus';\nimport {\n\tTournamentRegistrationStatus,\n\tTournamentRegistrationStatusName,\n\tTournamentRegistrationStatusNamed,\n} from './TournamentRegistrationStatus';\nimport { TournamentType } from './TournamentType';\nimport { TournamentPublicMeta } from './TournamentPublicMeta';\nimport { TTournament } from '../WSAPI/WSAPITypes';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TournamentUtils } from './TournamentUtils';\nimport { IntUtils } from '../IntUtils';\nimport { AchRelatedGame } from '../Base/AchRelatedGame';\n\nexport interface Tournament {\n\t/** ID of tournament template */\n\ttournamentId?: number;\n\t/** ID of tournament instance. Generated every time when tournament based on specific template is scheduled for run */\n\ttournamentInstanceId?: number;\n\t/** Type of the tournament. For now only SCHEDULED is support */\n\ttournamentType?: TournamentType;\n\t/** Meta information about tournament that should be used to build UI */\n\tpublicMeta?: TournamentPublicMeta;\n\t/** Cost of registration in the tournament in gamification points */\n\tbuyInAmount?: number;\n\t/** Not in use */\n\tprizePool?: number;\n\t/** The time when tournament is going to start */\n\tstartTime?: string;\n\t/** The time when tournament is going to finish */\n\tendTime?: string;\n\t/** The time when tournament is going to start, epoch */\n\tstartTimeTs?: number;\n\t/** The time when tournament is going to finish, epoch */\n\tendTimeTs?: number;\n\t/** Number of users registered in the tournament */\n\tregistrationCount?: number;\n\t/** Not in use */\n\ttotalCount?: number;\n\t/** Type of registration in the tournament */\n\tregistrationType?: TournamentRegistrationType;\n\t/** Status of registration in the tournament for current user */\n\ttournamentRegistrationStatus?: TournamentRegistrationStatus;\n\t/** Status of tournament instance */\n\ttournamentInstanceStatus?: TournamentInstanceStatus;\n\t/** flag indicating if current user is registered in the tournament */\n\tisUserRegistered?: boolean;\n\t/** Indicator if tournament allows later registration, when tournament is already started */\n\tallowLateRegistration?: boolean;\n\t/** Minimum number of participant for this tournament. If tournament doesnt have enough registrations, it will not start */\n\tplayersMinCount?: number;\n\t/** Maximum number of participant for this tournament. When reached, new users won't be able to register */\n\tplayersMaxCount?: number;\n\t/** Tournament duration in millisecnnds */\n\tdurationMs?: number;\n\t/** prizes structure */\n\tprizeStructure?: {\n\t\tprizes: TournamentPrize[];\n\t};\n\t/** Information about current user */\n\ttournamentPlayer?: TournamentPlayer;\n\n\t/** List of casino games (or other types of entities) related to the tournament */\n\trelated_games?: AchRelatedGame[];\n\t/** The minimum amount of score points that the user should get in order to be qualified for the prize */\n\tminScoreToWin?: number;\n\t/** When enabled, users who don't meet the minimum qualifying score will be hidden from the Leaderboard. */\n\thideLeaderboardsMinScores?: boolean;\n\t/** Total scores across all participants in the tournament */\n\ttotalScores?: number;\n\t/** Indicates if the tournament is clan-based */\n\tisClanBased?: boolean;\n}\n\nexport const TournamentItemsTransform = (items: Tournament[]): TTournament[] => {\n\treturn items\n\t\t.filter((r) => r != null && r.tournamentId >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TTournament = {\n\t\t\t\tinstance_id: r.tournamentInstanceId,\n\t\t\t\ttournament_id: r.tournamentId,\n\t\t\t\tname: r.publicMeta.name,\n\t\t\t\tdescription: r.publicMeta.description,\n\t\t\t\tsegment_dont_match_message: r.publicMeta.segment_dont_match_message,\n\t\t\t\timage1: r.publicMeta.image_url,\n\t\t\t\timage2: r.publicMeta.image_url2,\n\t\t\t\timage2_mobile: r.publicMeta.image_url2_mobile,\n\t\t\t\tprize_pool_short: r.publicMeta.prize_pool_short,\n\t\t\t\tcustom_price_text: r.publicMeta.custom_price_text,\n\t\t\t\tcustom_section_id: r.publicMeta.custom_section_id,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.publicMeta.custom_data),\n\t\t\t\tis_featured: r.publicMeta.featured,\n\t\t\t\tribbon: r.publicMeta.label_tag === 'custom' ? r.publicMeta.custom_label_tag : r.publicMeta.label_tag,\n\t\t\t\tpriority: r.publicMeta.position,\n\n\t\t\t\tstart_time: r.startTimeTs,\n\t\t\t\tend_time: r.endTimeTs,\n\t\t\t\tregistration_count: r.registrationCount,\n\t\t\t\tis_user_registered: r.isUserRegistered,\n\t\t\t\tplayers_min_count: r.playersMinCount,\n\t\t\t\tplayers_max_count: r.playersMaxCount,\n\t\t\t\tregistration_status: TournamentRegistrationStatusNamed(r.tournamentRegistrationStatus),\n\n\t\t\t\tregistration_type: TournamentRegistrationTypeGetName(r.registrationType),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_POINTS ? { registration_cost_points: r.buyInAmount } : {}),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_GEMS ? { registration_cost_gems: r.buyInAmount } : {}),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_DIAMONDS ? { registration_cost_diamonds: r.buyInAmount } : {}),\n\t\t\t\tduration_ms: r.durationMs,\n\n\t\t\t\tis_active: TournamentUtils.isActive(r),\n\t\t\t\tis_can_register: TournamentUtils.isCanRegister(r),\n\t\t\t\tis_cancelled: TournamentUtils.isCancelled(r),\n\t\t\t\tis_finished: TournamentUtils.isFinished(r),\n\t\t\t\tis_in_progress: TournamentUtils.isInProgress(r),\n\t\t\t\tis_upcoming: TournamentUtils.isUpcoming(r),\n\n\t\t\t\tmin_scores_win: r.minScoreToWin,\n\t\t\t\thide_leaderboard_min_scores: r.hideLeaderboardsMinScores,\n\t\t\t\ttotal_scores: r.totalScores,\n\t\t\t\tis_clan_based: r.isClanBased,\n\t\t\t};\n\n\t\t\tif (r.prizeStructure) {\n\t\t\t\tx.prizes = r.prizeStructure.prizes.map((p) => TournamentUtils.getPrizeTransformed(p));\n\t\t\t}\n\n\t\t\tif (r.tournamentPlayer) {\n\t\t\t\tx.me = TournamentUtils.getPlayerTransformed(r.tournamentPlayer, true);\n\t\t\t}\n\n\t\t\treturn x;\n\t\t});\n};\n","import { Tournament, TournamentItemsTransform } from './Tournament';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TTournamentDetailed } from '../WSAPI/WSAPITypes';\nimport { TournamentUtils } from './TournamentUtils';\nimport { ClanLeaderboardEntry, ClanPrizeStructureEntry } from './TournamentClan';\n\nexport interface GetTournamentInfoResponse extends ProtocolResponse {\n\t/** tournament info */\n\ttournamentInfo: {\n\t\t/** id of label, not in use */\n\t\tlabelId: number;\n\t\ttournamentLobbyInfo: Tournament;\n\t\t/** list of registered users */\n\t\tplayers: TournamentPlayer[];\n\t};\n\t/** information about current user position */\n\tuserPosition: TournamentPlayer;\n\t/** prizes structure */\n\tprizeStructure?: {\n\t\tprizes: TournamentPrize[];\n\t};\n\t/** Ranked list of clans in this tournament. Empty/null for non-clan tournaments. */\n\tclanLeaderboard?: ClanLeaderboardEntry[] | null;\n\t/**\n\t * The clan ID the current user belongs to.\n\t * null when the user has no clan or the tournament is not clan-based.\n\t * Match against clanLeaderboard[i].clan_id to highlight the user's clan row.\n\t */\n\tuserClanId?: number | null;\n\t/** Per-clan prize structure. Empty/null for non-clan tournaments. */\n\tclanPrizes?: ClanPrizeStructureEntry[] | null;\n}\n\nexport const tournamentInfoItemTransform = (t: GetTournamentInfoResponse): TTournamentDetailed => {\n\tconst response: TTournamentDetailed = {\n\t\t...TournamentItemsTransform([t.tournamentInfo?.tournamentLobbyInfo ?? null])?.[0],\n\t\trelated_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map((g, i) => ({\n\t\t\text_game_id: g.ext_game_id,\n\t\t\tgame_public_meta: {\n\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\tpriority: i + 1,\n\t\t\t},\n\t\t})),\n\t\tplayers: t.tournamentInfo.players.map((p) => TournamentUtils.getPlayerTransformed(p)),\n\t};\n\n\tif (t.prizeStructure) {\n\t\tresponse.prizes = t.prizeStructure.prizes.map((p) => TournamentUtils.getPrizeTransformed(p));\n\t}\n\n\tif (t.userPosition) {\n\t\tresponse.me = TournamentUtils.getPlayerTransformed(t.userPosition, true);\n\t}\n\n\tif (t.tournamentInfo?.tournamentLobbyInfo?.isClanBased) {\n\t\tresponse.is_clan_based = true;\n\t\tresponse.user_clan_id = t.userClanId ?? null;\n\t\tresponse.clan_leaderboard = t.clanLeaderboard\n\t\t\t? t.clanLeaderboard.map((entry) => ({\n\t\t\t\t\tclan_id: entry.clanId,\n\t\t\t\t\tpublic_meta: {\n\t\t\t\t\t\tname: entry.publicMeta.name,\n\t\t\t\t\t\tdescription: entry.publicMeta.description,\n\t\t\t\t\t\timage_url: entry.publicMeta.image_url,\n\t\t\t\t\t},\n\t\t\t\t\tposition: entry.rank,\n\t\t\t\t\ttotal_score: entry.totalScore,\n\t\t\t\t\tcontributing_members: entry.memberCount,\n\t\t\t }))\n\t\t\t: null;\n\t\tresponse.clan_prize_structure = t.clanPrizes\n\t\t\t? t.clanPrizes.map((entry) => ({\n\t\t\t\t\tclan_place: entry.clan_place,\n\t\t\t\t\tprize_type_id: entry.prize_type_id,\n\t\t\t\t\tprize_pool_amount: entry.prize_pool_amount,\n\t\t\t\t\tprize_pool_currency_code: entry.prize_pool_currency_code,\n\t\t\t\t\tactivity_type_id: entry.activity_type_id,\n\t\t\t\t\tdetails_json: entry.details_json,\n\t\t\t\t\tpublic_meta: entry.public_meta\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tname: entry.public_meta.name,\n\t\t\t\t\t\t\t\tdescription: entry.public_meta.description,\n\t\t\t\t\t\t\t\timage_url: entry.public_meta.image_url,\n\t\t\t\t\t\t\t\tprize_name: entry.public_meta.prize_name,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: null,\n\t\t\t\t\ttiers: (entry.player_tiers || []).map((tier) => ({\n\t\t\t\t\t\tplayer_place_from: tier.player_place_from,\n\t\t\t\t\t\tplayer_place_to: tier.player_place_to,\n\t\t\t\t\t\tpool_amount: tier.pool_amount,\n\t\t\t\t\t\tdistribution_type: tier.distribution_type,\n\t\t\t\t\t\tactivity_type_id: tier.activity_type_id,\n\t\t\t\t\t\tdetails_json: tier.details_json,\n\t\t\t\t\t\tpublic_meta: tier.public_meta\n\t\t\t\t\t\t\t? { name: tier.public_meta.name, description: tier.public_meta.description, image_url: tier.public_meta.image_url }\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t})),\n\t\t\t }))\n\t\t\t: null;\n\t}\n\n\treturn response;\n};\n","/**\n * Error codes returned in `err_code` by the `registerInTournament` method.\n *\n * These are terse value definitions for lookup. The full per-code narrative —\n * when each fires and how the consumer's UI should react — lives in the\n * `registerInTournament` method TSDoc, which owns the error table.\n *\n * Note the numbering break: the gems / diamonds codes are 6-digit\n * (`300010` / `300011`) while the rest of the tournament block is 5-digit;\n * they were appended after the original `30001`–`30009` range was occupied.\n * Branch on the exact numeric value, not on digit count.\n */\nexport enum TournamentRegistrationError {\n\t/** Success — registration persisted; buy-in (if any) deducted. */\n\tNO_ERROR = 0,\n\t/** Clan-based tournament and the user does not belong to a clan yet. */\n\tTOURNAMENT_USER_CANNOT_JOIN_WITHOUT_CLAN = 1010,\n\t/** Instance id is invalid or the tournament was deleted. */\n\tTOURNAMENT_INSTANCE_NOT_FOUND = 30001,\n\t/** Insufficient points balance for a points-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_POINTS = 30002,\n\t/** Tournament is no longer in a registerable state (finished, cancelled, finalizing, or not yet open). */\n\tTOURNAMENT_INSTANCE_NOT_IN_STATE = 30003,\n\t/** User is already registered; treat as an idempotent success. */\n\tTOURNAMENT_ALREADY_REGISTERED = 30004,\n\t/** User does not satisfy the tournament's segment / entry conditions. */\n\tTOURNAMENT_USER_DONT_MATCH_CONDITIONS = 30005,\n\t/** User is not registered; anomalous on a register call (usually a server-side race). */\n\tTOURNAMENT_USER_NOT_REGISTERED = 30006,\n\t/** Registration status transition is not allowed (e.g. re-registering a finished tournament). */\n\tTOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS = 30007,\n\t/** Tournament filled up — maximum registrations reached. */\n\tTOURNAMENT_MAX_REGISTRATIONS_REACHED = 30008,\n\t/**\n\t * The user's wallet currency could not be resolved. Emitted server-side\n\t * during tournament score processing, NOT during registration — it is\n\t * never returned by `registerInTournament`. Included for completeness.\n\t */\n\tTOURNAMENT_INVALID_USER_CURRENCY = 30009,\n\t/** Insufficient gems balance for a gems-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_GEMS = 300010,\n\t/** Insufficient diamonds balance for a diamonds-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_DIAMONDS = 300011,\n}\n","export enum TournamentType {\n\tSCHEDULED = 1,\n\tSNG = 2,\n\tTEST = 3,\n}\n","export enum LeaderBoardPeriodType {\n\tDAILY = 1,\n\tWEEKLY = 2,\n\tMONTHLY = 3,\n}\n","import { LeaderBoardDetailsT, LeaderBoardUserT, LeaderBoardsRewardsT } from '../WSAPI/WSAPITypes';\nimport { LeaderBoardDetails } from './LeaderBoardDetails';\nimport { LeaderBoardPeriodType } from './LeaderBoardPeriodType';\nimport { LeaderBoardPosition } from './LeaderBoardPosition';\n\nconst pointsRewardTransform = (reward_points: number[]): LeaderBoardsRewardsT[] => {\n\tif (reward_points && reward_points.length) {\n\t\treturn reward_points.map((r, i) => ({ place: i + 1, points: r }));\n\t}\n\n\treturn null;\n};\n\nconst getLeaderBoardPlayerTransformed = (user: LeaderBoardPosition, isMe?: boolean): LeaderBoardUserT => {\n\tif (user) {\n\t\treturn {\n\t\t\tpublic_username: user?.public_username || user.user_alt_name,\n\t\t\tavatar_url: user.avatar_url,\n\t\t\tlevel_id: user.level_id,\n\t\t\tposition: user.position_in_board,\n\t\t\tpoints: user.points_accumulated,\n\t\t\t// The `me` entry is the current user by definition, so force `true`\n\t\t\t// there; list rows carry the server-provided flag.\n\t\t\tis_me: isMe ? true : user.is_me,\n\t\t};\n\t}\n\n\treturn null;\n};\n\nexport const getLeaderBoardTransform = (board: LeaderBoardDetails): LeaderBoardDetailsT => {\n\tif (board) {\n\t\treturn {\n\t\t\tboard_id: board.board_id,\n\t\t\tname: board.board_public_meta.name,\n\t\t\tdescription: board.board_public_meta.description,\n\t\t\trules: board.board_public_meta.rules,\n\t\t\tperiod_type_id: board.period_type_id,\n\t\t\tversion_id: board.versiod_id,\n\t\t\tcreate_date: board.create_date,\n\t\t\trewards: pointsRewardTransform(board.reward_points),\n\t\t\tusers: (board.positions || []).map((p) => getLeaderBoardPlayerTransformed(p)),\n\t\t\tme: getLeaderBoardPlayerTransformed(board.userPosition, true),\n\t\t};\n\t}\n\n\treturn null;\n};\n","import { IntUtils } from '../IntUtils';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { TLevel } from '../WSAPI/WSAPITypes';\nimport { Level } from './Level';\n\nexport interface GetLevelMapResponse extends ProtocolResponse {\n\tlevels: Level[];\n}\n\nexport const GetLevelMapResponseTransform = (levels: GetLevelMapResponse): TLevel[] => {\n\tif (!levels?.levels) return [];\n\n\tconst mapped = levels.levels.map((l) => ({\n\t\tid: l.level_id,\n\t\tname: l.level_public_meta.name,\n\t\tdescription: l.level_public_meta.description,\n\t\timage: l.level_public_meta.image_url,\n\t\trequired_points: l.required_points,\n\t\tvisibility_points: l.level_public_meta.visibility_points ? parseInt(l.level_public_meta.visibility_points as any) : null,\n\t\trequired_level_counter_1: l.required_level_counter_1,\n\t\trequired_level_counter_2: l.required_level_counter_2,\n\t\tcustom_data: IntUtils.JsonOrText(l.level_public_meta?.custom_data),\n\t\tordinal_position: 0,\n\t}));\n\n\tconst ordinalById = new Map<number, number>();\n\t[...mapped]\n\t\t.sort((a, b) => a.required_points - b.required_points)\n\t\t.forEach((l, index) => ordinalById.set(l.id, index + 1));\n\n\treturn mapped.map((l) => ({ ...l, ordinal_position: ordinalById.get(l.id) }));\n};\n","import { ECacheContext, OCache } from '../OCache';\nimport { SmarticoAPI } from '../SmarticoAPI';\n\n/** @hidden */\nexport const CACHE_DATA_SEC = 30;\n\n/** @hidden */\nexport const JACKPOT_TEMPLATE_CACHE_SEC = 30;\n/** @hidden */\nexport const JACKPOT_POT_CACHE_SEC = 1;\n/** @hidden */\nexport const JACKPOT_WINNERS_CACHE_SEC = 30;\n/** @hidden */\nexport const JACKPOT_ELIGIBLE_GAMES_CACHE_SEC = 30;\n\n/** @hidden */\nexport enum onUpdateContextKey {\n\tSaw = 'saw',\n\tMissions = 'missions',\n\tTournamentList = 'tournamentList',\n\tInboxMessages = 'inboxMessages',\n\tBadges = 'badges',\n\tLevels = 'levels',\n\tStoreItems = 'storeItems',\n\tStoreCategories = 'storeCategories',\n\tAchCategories = 'achCategories',\n\tLeaderBoards = 'leaderBoards',\n\tLevelExtraCounters = 'levelExtraCounters',\n\tSegments = 'segments',\n\tStoreHistory = 'storeHistory',\n\tJackpots = 'jackpots',\n\tPots = 'Pots',\n\tCustomSections = 'customSections',\n\tBonuses = 'bonuses',\n\tClans = 'clans',\n\tSAWHistory = 'sawHistory',\n\tJackpotWinners = 'jackpotWinners',\n\tRaffles = 'raffles',\n\tJackpotEligibleGames = 'jackpotEligibleGames',\n\tCurrentLevel = 'currentLevel',\n\tInboxUnreadCount = 'inboxUnreadCount',\n\tActivityLog = 'activityLog',\n\tAvatarsList = 'avatarsList',\n\tAvatarsCustomized = 'avatarsCustomized',\n\tAvatarPrompts = 'avatarPrompts',\n}\n\n/**\n * Abstract base of the SDK's public surface. Holds the shared state\n * (`api`, `userExtId`, `onUpdateCallback` map) and the generic cache /\n * subscription helper (`updateEntity`). Domain-specific methods live on\n * subclasses; the terminator `WSAPI` class composes the whole chain.\n *\n * **Consumers should not instantiate this directly** — the SDK constructs\n * the concrete `WSAPI` via `_smartico.api`.\n *\n * @hidden\n */\nexport abstract class WSAPIBase {\n\t/** @hidden */\n\tprotected onUpdateCallback: Map<onUpdateContextKey, (data: any) => void> = new Map();\n\n\t/** @hidden */\n\tprotected userExtId: string = null;\n\n\t/** @private */\n\tconstructor(protected api: SmarticoAPI, userExtId: string = null) {\n\t\tthis.userExtId = userExtId;\n\t\tOCache.clearAll();\n\t}\n\n\t/** @private */\n\t// AA: this method is used from the _smartico script to clear cache when the context is changed,\n\t// e.g. when user is changed or language is changed\n\tpublic clearCaches() {\n\t\tOCache.clearAll();\n\t}\n\n\t/**\n\t * Generic cache-update + subscription-notify helper. Used by domain\n\t * classes' `update*` methods to refresh a context and fire any\n\t * registered `onUpdate` callback.\n\t * @hidden\n\t */\n\tprotected async updateEntity(contextKey: onUpdateContextKey, payload: any) {\n\t\tOCache.set(contextKey, payload, ECacheContext.WSAPI);\n\n\t\tconst onUpdate = this.onUpdateCallback.get(contextKey);\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tonUpdate(payload);\n\t\t}\n\t}\n}\n","import { TRaffle, TRaffleDraw, TRafflePrize, TRafflePrizeWinner, TRaffleTicket } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { Raffle } from './Raffle';\nimport { RaffleDraw } from './RaffleDraw';\nimport { RafflePrize } from './RafflePrize';\nimport { RafflePrizeWinner } from './RafflePrizeWinner';\nimport { RaffleTicket } from './RaffleTicket';\n\nexport interface GetRafflesResponse extends ProtocolResponse {\n\titems: Raffle[];\n}\n\n/** @hidden */\nexport const ticketsTransform = (items: RaffleTicket[]): TRaffleTicket[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tticekt_id: item.id,\n\t\t\tticket_id_string: item.s,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const winnersTransform = (items: RafflePrizeWinner[]): TRafflePrizeWinner[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.user_id,\n\t\t\tusername: item.public_username,\n\t\t\tavatar_url: item.avatar_url || item.avatar_id,\n\t\t\tticket: { ticekt_id: item.ticket.id, ticket_id_string: item.ticket.s },\n\t\t\traf_won_id: item.raf_won_id,\n\t\t\tclaimed_date: item.claimed_date,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const prizeTransform = (items: RafflePrize[]): TRafflePrize[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.prize_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\tcustom_data: item.public_meta.custom_data,\n\t\t\tprizes_per_run: item.prizes_per_run,\n\t\t\tprizes_per_run_actual: item.prizes_per_run_actual,\n\t\t\tchances_to_win_perc: item.chances_to_win_perc,\n\t\t\tmin_required_total_tickets: item.min_required_total_tickets,\n\t\t\tcap_prizes_per_run: item.cap_prizes_per_run,\n\t\t\tpriority: item.priority,\n\t\t\tstock_items_per_draw: item.stock_items_per_draw,\n\t\t\tshould_claim: item.should_claim,\n\t\t\twinners: winnersTransform(item.winners),\n\t\t\trequires_claim: item.requires_claim,\n\t\t\tmin_required_tickets_for_user: item.min_required_tickets_for_user,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const drawTransform = (items: RaffleDraw[]): TRaffleDraw[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.draw_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\timage_url_mobile: item.public_meta.image_url_mobile,\n\t\t\ticon_url: item.public_meta.icon_url,\n\t\t\tbackground_image_url: item.public_meta.background_image_url,\n\t\t\tbackground_image_url_mobile: item.public_meta.background_image_url_mobile,\n\t\t\tis_grand: item.public_meta.is_grand,\n\t\t\tprizes: prizeTransform(item.prizes),\n\t\t\tcurrent_state: item.current_state,\n\t\t\trun_id: item.run_id,\n\t\t\texecution_type: item.execution_type,\n\t\t\texecution_ts: item.execution_ts,\n\t\t\tprevious_run_ts: item.previous_run_ts,\n\t\t\tprevious_run_id: item.previous_run_id,\n\t\t\tticket_start_ts: item.ticket_start_ts,\n\t\t\tallow_multi_prize_per_ticket: item.allow_multi_prize_per_ticket,\n\t\t\ttotal_tickets_count: item.total_tickets_count,\n\t\t\tmy_tickets_count: item.my_tickets_count,\n\t\t\tmy_last_tickets: ticketsTransform(item.my_last_tickets),\n\t\t\tuser_opted_in: Boolean(item.user_opted_in),\n\t\t\trequires_optin: Boolean(item.requires_optin),\n\t\t\tis_active: Boolean(item.is_active),\n\t\t\twinners_limit: item.winners_limit,\n\t\t\twinners_offset: item.winners_offset,\n\t\t\twinners_total: item.winners_total,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const raffleTransform = (items: Raffle[]): TRaffle[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.raffle_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\tcustom_section_id: item.public_meta.custom_section_id,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\timage_url_mobile: item.public_meta.image_url_mobile,\n\t\t\tcustom_data: item.public_meta.custom_data,\n\t\t\tstart_date: item.start_date_ts,\n\t\t\tend_date: item.end_date_ts,\n\t\t\tmax_tickets_count: item.max_tickets_count,\n\t\t\tcurrent_tickets_count: item.current_tickets_count,\n\t\t\tdraws: drawTransform(item.draws),\n\t\t\tticket_cap_visualization: item.public_meta.ticket_cap_visualization,\n\t\t};\n\t});\n};\n","import { TRaffleDraw } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { RaffleDraw } from './RaffleDraw';\nimport { prizeTransform, ticketsTransform } from './GetRafflesResponse';\n\nexport interface GetDrawRunResponse extends ProtocolResponse {\n\tdraw: RaffleDraw;\n}\n\n/** @hidden */\nexport const drawRunTransform = (res: GetDrawRunResponse): TRaffleDraw => {\n\treturn {\n\t\tid: res.draw.draw_id,\n\t\tname: res.draw.public_meta.name,\n\t\tdescription: res.draw.public_meta.description,\n\t\timage_url:res.draw.public_meta.image_url,\n\t\timage_url_mobile:res.draw.public_meta.image_url_mobile,\n\t\ticon_url: res.draw.public_meta.icon_url,\n\t\tbackground_image_url: res.draw.public_meta.background_image_url,\n\t\tbackground_image_url_mobile: res.draw.public_meta.background_image_url_mobile,\n\t\tis_grand: res.draw.public_meta.is_grand,\n\t\tprizes: prizeTransform(res.draw.prizes),\n\t\tcurrent_state: res.draw.current_state,\n\t\trun_id: res.draw.run_id,\n\t\texecution_type: res.draw.execution_type,\n\t\texecution_ts: res.draw.execution_ts,\n\t\tprevious_run_ts: res.draw.previous_run_ts,\n\t\tprevious_run_id: res.draw.previous_run_id,\n\t\tticket_start_ts: res.draw.ticket_start_ts ?? res.draw['ticket_start_date'],\n\t\tallow_multi_prize_per_ticket: res.draw.allow_multi_prize_per_ticket,\n\t\ttotal_tickets_count: res.draw.total_tickets_count,\n\t\tmy_tickets_count: res.draw.my_tickets_count,\n\t\tmy_last_tickets: ticketsTransform(res.draw.my_last_tickets),\n\t\tuser_opted_in: Boolean(res.draw.user_opted_in),\n\t\trequires_optin: Boolean(res.draw.requires_optin),\n\t\tis_active: Boolean(res.draw.is_active),\n\t\twinners_limit: res.draw.winners_limit,\n\t\twinners_offset: res.draw.winners_offset,\n\t\twinners_total: res.draw.winners_total,\n\t} \t\n};","import { RaffleDraw } from \"./RaffleDraw\";\n\nexport enum RaffleTicketCapVisualization {\n\t/** Show nothing */\n\tEmpty = 0,\n\t/** Show ticket counter */\n\tCounter = 1,\n\t/** Show message when ticket cap is reached */\n\tMessage = 2,\n}\n\ninterface RafflePublicMeta {\n /** Name of the raffle */\n name: string;\n /** Description of the raffle */\n description: string;\n /** ID of the custom section that is linked to the raffle in the Gamification widget */\n custom_section_id: number;\n /** URL of the image that represents the raffle */\n image_url: string;\n /** URL of the mobile image that represents the raffle */\n image_url_mobile: string;\n /** Text for Terms and Conditions */\n hint_text:string;\n /** \n\t * Custom data as string or JSON string that can be used in API to build custom UI\n\t * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice\n\t * Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>\n */\n\tcustom_data: string;\n\n /**\n * - Value 1 (Counter): Shows a real-time \"Tickets Remaining\" display available during the whole Raffle activity.\n * - Value 2 (Message): Will show a specific message that triggers only when the cap is reached and inform users that tickets will be no longer be issued.\n */\n ticket_cap_visualization?: RaffleTicketCapVisualization;\n}\n\n\ninterface Raffle {\n /** ID of the Raffle template */\n raffle_id: number;\n /** Meta information about raffle for the presentation on UI */\n public_meta: RafflePublicMeta;\n /** Date of start */\n start_date_ts: number;\n /** Date of end */\n end_date_ts: number; \n /** Maximum numer of tickets that can be given to all users for the whole period of raffle */\n max_tickets_count: number;\n /** \n * Number of tickets that are already given to all users for this raffle\n */\n current_tickets_count: number;\n\n /** \n * List of draws that are available for this raffle.\n * For example, if the raffle is containg one hourly draw, one daily draw and one draw on fixed date like 01/01/2022,\n * Then the list will always return 3 draws, no matter if the draws are already executed or they are in the future.\n */\n draws: RaffleDraw[]\n\n}\n\nexport { Raffle, RafflePublicMeta };\n","import { RaffleDrawPublicMeta } from \"./RaffleDrawPublicMeta\";\nimport { RafflePrize } from \"./RafflePrize\";\nimport { RaffleTicket } from \"./RaffleTicket\";\n\nexport enum RaffleDrawInstanceState {\n /** Draw is open for the tickets collection */\n Open = 1,\n /** Winner selection is in progress */\n WinnerSelection = 2,\n /** Draw is executed and the winners are selected */\n Executed = 3,\n}\n\nexport enum RaffleDrawTypeExecution {\n /** Draw is executed only once */\n ExecDate = 0,\n /** Draw is executed on a recurring basis */\n Recurring = 1,\n /** \n * Draw is executed once and is marked as grand.\n * This means it is a special or significant draw,\n * often with larger prizes or more importance.\n */\n Grand = 2,\n}\n\n\ninterface RaffleDraw {\n /** \n * Id of the Draw definition, for the repetative draws (e.g. daily), this number will be the same for all draws that are repeating daily\n * (internal name: schedule_id)\n */\n draw_id: number;\n\n /** Meta information of the Draw for the presentaiton in UI */\n public_meta: RaffleDrawPublicMeta;\n\n /** Information about prizes in the draw */\n prizes: RafflePrize[];\n\n /** \n * State of current instance of Draw\n */\n current_state: RaffleDrawInstanceState;\n\n /** \n * Field indicates the ID of the latest instance/run of draw\n */\n run_id: number;\n\n /** \n * Type of the draw execution, indicating how and when the draw is executed.\n * \n * - ExecDate: Draw is executed only once at a specific date and time.\n * - Recurring: Draw is executed on a recurring basis (e.g., daily, weekly).\n * - Grand: Draw is executed once and is marked as grand, often with larger prizes or more importance.\n */\n execution_type: RaffleDrawTypeExecution;\n\n /** Date/time of the draw execution */\n execution_ts: number;\n \n /** Date of the previously executed draw (if there is such) */\n previous_run_ts?: number;\n\n /** Unique ID of the previusly executed draw (if there is such) */\n previous_run_id?: number; \n\n /** \n * Date/time starting from which the tickets will participate in the upcoming draw\n * This value need to be taken into account with next_execute_ts field value, for example\n * Next draw is at 10:00, ticket_start_date is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00\n * (internally this value is calculated as next_execute_ts - ticket_start_date)\n */\n ticket_start_ts: number;\n\n /** \n * Field is indicating if same ticket can win multiple prizes in the same draw\n * For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook\n * If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),\n * if false, then one ticket can win only one prize.\n * The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)\n * If specific prize has multiple values, e.g. we have 3 iPhones,\n * then the same ticket can win only one prize of a kind, but can win multiple prizes of different kind (if allow_multi_prize_per_ticket is true)\n */\n allow_multi_prize_per_ticket: boolean;\n\n\n /** \n * The number of tickets that are already given to all users for this instance of draw.\n * In other words tickets that are collected between ticket_start_date and current time (or till current_execution_ts is the instance is executed).\n */\n total_tickets_count: number;\n\n /** \n * The number of tickets collected by current user for this instance of draw.\n */\n my_tickets_count: number;\n\n /**\n * List of last 5 tickets are collected by current user for this instance of draw.\n */\n my_last_tickets: RaffleTicket[];\n\t/**\n\t * If true, the user has opted-in to the raffle.\n\t */\n\tuser_opted_in: boolean;\n\t/**\n\t * If true, the user needs to opt-in to the raffle before they can participate.\n\t */\n\trequires_optin: boolean;\n\n /**\n * If true, the draw is active and can be participated in.\n */\n is_active: boolean;\n /**\n * The number of winners to return\n */\n\twinners_limit?: number;\n\n /**\n * The offset of the winners to return\n */\n\twinners_offset?: number;\n\n /**\n * The total number of winners\n */\n\twinners_total?: number;\n}\n\nexport { RaffleDraw };\n","import { TRaffleDrawRun } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { RaffleDrawRun } from './RaffleDrawRun';\n\nexport interface GetRaffleDrawRunsHistoryResponse extends ProtocolResponse {\n\tdraw_runs: RaffleDrawRun[];\n}\n\n/** @hidden */\nexport const drawRunHistoryTransform = (res: GetRaffleDrawRunsHistoryResponse): TRaffleDrawRun[] => {\n\treturn res.draw_runs.map((item) => {\n\t\treturn {\n\t\t\tid: item.draw_id,\n\t\t\trun_id: item.run_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\timage_url_mobile: item.public_meta.image_url_mobile,\n\t\t\ticon_url: item.public_meta.icon_url,\n\t\t\tbackground_image_url: item.public_meta.background_image_url,\n\t\t\tbackground_image_url_mobile: item.public_meta.background_image_url_mobile,\n\t\t\tis_grand: item.public_meta.is_grand,\n\t\t\texecution_ts: item.execution_ts,\n\t\t\tactual_execution_ts:item.actual_execution_ts,\n\t\t\tticket_start_ts:item.ticket_start_ts,\n\t\t\tis_winner:item.is_winner,\n\t\t\thas_unclaimed_prize:item.has_unclaimed_prize\n\t\t};\n\t});\n};\n","import { TransformedRaffleClaimPrizeResponse } from \"../WSAPI/WSAPITypes\";\nimport { ProtocolResponse } from \"../Base/ProtocolResponse\";\n\nexport interface RaffleClaimPrizeResponse extends ProtocolResponse {\n errCode: number\n errMsg?: string\n}\n\n/** @hidden */\nexport const raffleClaimPrizeResponseTransform = (info: RaffleClaimPrizeResponse): TransformedRaffleClaimPrizeResponse => {\n return {\n errorCode: info.errCode,\n errorMessage: info.errMsg\n }\n}\n","import { CoreUtils } from '../Core';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tTActivityLog,\n\tTLevel,\n\tTLevelCurrent,\n\tTSegmentCheckResult,\n\tTUserProfile,\n\tUserLevelExtraCountersT,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIBase } from './WSAPIBase';\n\n/** @group User */\nexport class WSAPIUser extends WSAPIBase {\n\t/**\n\t * Returns the current user's public profile — the source of truth for\n\t * balances (points / gems / diamonds), the current level ID, the\n\t * display username + avatar, language, public tags, and the inbox\n\t * unread count. **This method is synchronous** (returns `TUserProfile`,\n\t * not a Promise): the SDK keeps a local snapshot of the user's public\n\t * properties that is initialised at identify time and kept live by a\n\t * server-driven update channel — every call returns the latest cached\n\t * values without a network round-trip.\n\t *\n\t * Subscribe to changes by registering a callback on `_smartico.on('props_change', ...)`\n\t * — the callback fires with the full snapshot at identify and with\n\t * partial-key updates on every subsequent server push (typically\n\t * under 1 second after the underlying state change).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * The tracker must be initialised — calling this before the identify\n\t * round-trip completes throws (`\"Tracker is not initialized, cannot\n\t * getUserProfile\"`). Safe ways to wait for readiness:\n\t * - register `_smartico.on('identify', (errCode, props) => ...)` —\n\t * fires once after a successful identify with the full props\n\t * - register `_smartico.on('props_change', () => ...)` — fires first\n\t * at identify with the full snapshot, then on every push update\n\t *\n\t * **What's kept live (push-updated)**\n\t * Balance fields (`ach_points_balance`, `ach_gems_balance`,\n\t * `ach_diamonds_balance`, `ach_points_ever`), `ach_level_current_id`,\n\t * `core_public_tags`, `core_inbox_unread_count`, `core_user_language`,\n\t * `avatar_url`, `public_username`, and the AI-driven recommended-amount\n\t * fields all flow over the SDK's user-properties update channel as\n\t * partial updates — the snapshot is patched in place when any of them\n\t * change server-side. Re-call `getUserProfile()` (or watch\n\t * `props_change`) to observe new values.\n\t *\n\t * **Reading state from the returned profile**\n\t * Balances (`ach_points_balance`, `ach_gems_balance`,\n\t * `ach_diamonds_balance`) are the canonical source for affordability\n\t * checks across the SDK — compare against `entry_fee_amount` (clans),\n\t * `registration_cost_points` / `_gems` / `_diamonds` (tournaments), and\n\t * `price` / `discounted_price` + `purchase_type` (store items).\n\t * `ach_points_ever` is monotonic — store purchases deduct from\n\t * `ach_points_balance` but NEVER from `ach_points_ever`, so it remains\n\t * useful for level-progress math (`required_points` on the next\n\t * {@link getLevels} entry minus `ach_points_ever`). `ach_level_current_id`\n\t * is the FK into the level ladder — resolve metadata via\n\t * {@link getCurrentLevel} (richer, includes progress %) or\n\t * {@link getLevels} (full ladder lookup table).\n\t *\n\t * **Inbox unread count** — `core_inbox_unread_count` on this profile\n\t * is push-updated in real time (under 1 second). For an inbox badge,\n\t * prefer this field over `getInboxUnreadCount` (which is cached\n\t * for 30 s) — same value, fresher signal.\n\t *\n\t * **Language**: `core_user_language` reflects the server's stored\n\t * language. If the consumer just called `_smartico.changeLanguage(...)`,\n\t * the field may briefly lag the local intent until the server push\n\t * arrives. Use `_smartico.getPublicProps()` for the\n\t * client-fallback-applied version if instant accuracy matters.\n\t *\n\t * **Idempotency / Side effects**: trivially safe — no network call,\n\t * no state mutation.\n\t *\n\t * **UI guidance**: see [UI Guide — `getUserProfile`](../../docs/ui/user/UIGuide_getUserProfile.md).\n\t *\n\t * **Visitor mode**: not supported — throws. Visitor sessions do not\n\t * have a public-profile snapshot.\n\t *\n\t * @returns The current cached `TUserProfile` snapshot. A shallow copy —\n\t * mutating it does not affect the SDK's internal state.\n\t * @throws `Error(\"Tracker is not initialized, cannot getUserProfile\")`\n\t * if called before identify completes or from a visitor session.\n\t *\n\t * @example\n\t * ```ts\n\t * // Wait for identify before calling.\n\t * window._smartico.on('identify', (errCode) => {\n\t * if (errCode !== 0) return;\n\t * const profile = window._smartico.api.getUserProfile();\n\t * console.log('[smartico] initial profile loaded — render the user widget:', profile);\n\t * });\n\t *\n\t * // Stay in sync with live updates.\n\t * window._smartico.on('props_change', (changed) => {\n\t * // `changed` is the partial keys for this push (full snapshot at identify).\n\t * const profile = window._smartico.api.getUserProfile();\n\t * console.log('[smartico] profile updated — re-render any widgets bound to:', Object.keys(changed),\n\t * '— balances now:', profile.ach_points_balance, profile.ach_gems_balance, profile.ach_diamonds_balance);\n\t *\n\t * // React to specific fields.\n\t * if ('ach_level_current_id' in changed) {\n\t * console.log('[smartico] level changed — call getCurrentLevel() for richer detail, animate the level badge');\n\t * }\n\t * if ('core_inbox_unread_count' in changed) {\n\t * console.log('[smartico] inbox unread count changed — update the badge to:', profile.core_inbox_unread_count);\n\t * }\n\t * });\n\t *\n\t * // Affordability gating example — used inside a clan / tournament / store CTA handler.\n\t * const profile = window._smartico.api.getUserProfile();\n\t * const item = await window._smartico.api.getStoreItems().then(items => items[0]);\n\t * const price = item.discounted_price ?? item.price;\n\t * const balance = {\n\t * points: profile.ach_points_balance,\n\t * gems: profile.ach_gems_balance,\n\t * diamonds: profile.ach_diamonds_balance,\n\t * }[item.purchase_type];\n\t * if (balance < price) {\n\t * console.log('[smartico] insufficient', item.purchase_type, '— disable Buy and show deficit', price - balance);\n\t * }\n\t * ```\n\t */\n\tpublic getUserProfile(): TUserProfile {\n\t\tif (this.api.tracker) {\n\t\t\tconst o: TUserProfile = Object.assign({}, this.api.tracker.userPublicProps);\n\t\t\to.avatar_url = CoreUtils.avatarUrl(this.api.tracker.userPublicProps.avatar_id, this.api.avatarDomain);\n\t\t\treturn o;\n\t\t} else {\n\t\t\tthrow new Error('Tracker is not initialized, cannot getUserProfile');\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether the current user matches a single segment, returning\n\t * `true` / `false` directly. Use this as a decision primitive to gate\n\t * UI surfaces (e.g. show a \"VIP lounge\" tab only when the user is in\n\t * the VIP segment), or to drive segment-specific CTA copy.\n\t *\n\t * Every call is a server round-trip — there is no SDK-side cache. For\n\t * checking multiple segments in one round-trip, use\n\t * {@link checkSegmentListMatch} instead.\n\t *\n\t * @remarks\n\t * **Refresh model**\n\t * - **No client cache.** Every call sends a request; the SDK does not\n\t * memoize results.\n\t * - **No push event** notifies the consumer when segment membership\n\t * flips (the user crosses a qualification threshold, or the\n\t * operator changes the segment definition). Membership changes\n\t * become visible only on the next `checkSegmentMatch` call.\n\t * - **Behavioral segments (configured against BigQuery) have batch\n\t * lag** — even if the user's activity has changed (deposit, wager,\n\t * etc.), the segment-membership result may not reflect that change\n\t * until the next batch evaluation run (typically up to several\n\t * hours).\n\t *\n\t * **Rate limit** (important)\n\t * The server caps `checkSegment*` calls at **10 requests per\n\t * 60-second window**, with a minimum gap of **~5 seconds between\n\t * consecutive calls**. Avoid calling on every render — cache the\n\t * result client-side for the session, or until you have a reason to\n\t * believe the user's state changed (e.g. after a deposit completes,\n\t * a level changes via {@link getUserProfile}'s `props_change`, or a\n\t * specific custom event fires).\n\t *\n\t * **`is_matching: false` is ambiguous on the server** — both \"the\n\t * segment doesn't exist for this label\" and \"the user doesn't\n\t * qualify\" return `false` with no distinguishing signal. Pass IDs\n\t * you've verified are valid for your label.\n\t *\n\t * **Idempotency**: safe. Read-only. No side effects (no analytics\n\t * events, no DB writes).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param segment_id The segment ID. Segment IDs are label-scoped;\n\t * the same numeric ID can refer to different\n\t * segments under different labels. Use the IDs\n\t * configured for your label.\n\t * @returns `true` if the user currently matches the\n\t * segment, `false` otherwise. `false` also covers\n\t * the \"segment doesn't exist for this label\"\n\t * case — these are not distinguishable.\n\t *\n\t * @example\n\t * ```ts\n\t * const isVip = await window._smartico.api.checkSegmentMatch(vipSegmentId);\n\t * if (isVip) {\n\t * console.log('[smartico] user is in VIP segment — render the VIP-only widget surface');\n\t * } else {\n\t * console.log('[smartico] user not in VIP segment (or segment id misconfigured) — hide the VIP surface');\n\t * }\n\t *\n\t * // Cache the result for the session; re-check after material user-state changes.\n\t * window._smartico.on('props_change', async (changed) => {\n\t * if ('ach_points_ever' in changed || 'ach_level_current_id' in changed) {\n\t * const fresh = await window._smartico.api.checkSegmentMatch(vipSegmentId);\n\t * console.log('[smartico] user state changed — VIP membership now:', fresh);\n\t * }\n\t * });\n\t * ```\n\t */\n\tpublic async checkSegmentMatch(segment_id: number): Promise<boolean> {\n\t\tconst r = await this.api.coreCheckSegments(this.userExtId, [segment_id]);\n\t\tif (r && r.find((s) => s.segment_id === segment_id && s.is_matching)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Checks the current user's membership in multiple segments in a\n\t * single server round-trip — returns a `TSegmentCheckResult[]` with\n\t * one entry per *unique* segment ID. Use this instead of looping\n\t * {@link checkSegmentMatch} when you need to evaluate several\n\t * segments at once (e.g. multi-segment composite gating, A/B-style\n\t * cohort detection).\n\t *\n\t * @remarks\n\t * **Response order is NOT guaranteed**\n\t * The server returns results in an unspecified order — different\n\t * from the input array. Always correlate by the `segment_id` field on\n\t * each `TSegmentCheckResult` rather than by array position. The\n\t * returned array length may also be smaller than the input array\n\t * (duplicate IDs are silently de-duplicated server-side).\n\t *\n\t * **Single round-trip**\n\t * The entire `segment_ids` array is sent in one request. Two segments\n\t * cost the same as one in terms of network latency and rate-limit\n\t * consumption (one call = one rate-limit slot, regardless of how many\n\t * segments).\n\t *\n\t * **Shared semantics with `checkSegmentMatch`**\n\t * Both methods wrap the same underlying server endpoint and share\n\t * the same caching, refresh, rate-limit, and ambiguity behavior. See\n\t * {@link checkSegmentMatch} for: no client cache · no push event for\n\t * membership changes · behavioral segments have batch lag · rate\n\t * limit (10 requests / 60 s, ~5 s minimum gap between calls) ·\n\t * `is_matching: false` doesn't distinguish \"not in segment\" from\n\t * \"segment doesn't exist for this label\".\n\t *\n\t * **Idempotency**: safe. Read-only. No side effects.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param segment_ids Array of segment IDs to check. Duplicates are\n\t * silently de-duplicated server-side. Segment IDs\n\t * are label-scoped — use the IDs configured for\n\t * your label.\n\t * @returns Array of `{ segment_id, is_matching }` results.\n\t * Order is NOT guaranteed; correlate by\n\t * `segment_id`. Length may be less than the input\n\t * when duplicate IDs were sent.\n\t *\n\t * @example\n\t * ```ts\n\t * const segmentIds = [vipSegmentId, newPlayerSegmentId, freeRollSegmentId];\n\t * const results = await window._smartico.api.checkSegmentListMatch(segmentIds);\n\t *\n\t * // Always correlate by segment_id — the response order is unspecified.\n\t * const byId = new Map(results.map(r => [r.segment_id, r.is_matching]));\n\t *\n\t * if (byId.get(vipSegmentId)) {\n\t * console.log('[smartico] user is in VIP segment — render VIP surface');\n\t * }\n\t * if (byId.get(newPlayerSegmentId) && byId.get(freeRollSegmentId)) {\n\t * console.log('[smartico] new player AND eligible for free roll — show the welcome promo');\n\t * }\n\t *\n\t * // Cache the result map for the session; refresh on material state changes.\n\t * ```\n\t */\n\tpublic async checkSegmentListMatch(segment_ids: number[]): Promise<TSegmentCheckResult[]> {\n\t\treturn await this.api.coreCheckSegments(this.userExtId, Array.isArray(segment_ids) ? segment_ids : [segment_ids]);\n\t}\n\n\t/**\n\t * Returns the full level ladder configured for the current label —\n\t * one `TLevel` per active level, server-sorted by `required_points`\n\t * ASC (lowest first; `ordinal_position` is a 1-based index into the\n\t * returned array). Use this to render a level map / progression\n\t * screen, or as a lookup table to resolve `ach_level_current_id` from\n\t * {@link getUserProfile} into a richer level object.\n\t *\n\t * @remarks\n\t * **Server-side filtering**\n\t * The server returns ALL active levels for the label. There is NO\n\t * per-user filtering on visibility, level-status, or anything else —\n\t * the response is identical across users of the same label. Apply\n\t * `visibility_points` filtering client-side if you want to hide\n\t * not-yet-reached levels (compare against\n\t * `getUserProfile().ach_points_ever` and exclude levels where\n\t * `visibility_points > ach_points_ever`).\n\t *\n\t * **Sort order**\n\t * The returned array is already sorted by `required_points` ASC, and\n\t * `ordinal_position` is a 1-based index into that same sort order —\n\t * client-side re-sorting is not required for the default rendering.\n\t * If your label uses sliding-window leveling logic\n\t * (see {@link getUserLevelExtraCounters}) and you want to sort by\n\t * a multi-criteria key (`required_points`, then\n\t * `required_level_counter_1`, then `required_level_counter_2`), do\n\t * that client-side.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout. Operator-driven level edits\n\t * surface on the next cache miss.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only metadata. Calls\n\t * within the cache window de-duplicate to the same cached array.\n\t *\n\t * **UI guidance**: see [UI Guide — `getLevels`](../../docs/ui/user/UIGuide_getLevels.md).\n\t *\n\t * **Visitor mode**: supported. Use `_smartico.vapi(lang).getLevels()`\n\t * to fetch the ladder for anonymous viewers; the level configuration\n\t * is label-scoped static data so the response is meaningful even\n\t * without an authenticated user. Per-user fields (the implicit\n\t * \"current level\" via {@link getCurrentLevel}, or the user's progress)\n\t * are not available in visitor mode.\n\t *\n\t * @returns Promise resolving to the ordered `TLevel[]` ladder. Empty\n\t * if no levels are configured for the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const [levels, profile] = await Promise.all([\n\t * window._smartico.api.getLevels(),\n\t * Promise.resolve(window._smartico.api.getUserProfile()),\n\t * ]);\n\t *\n\t * // Resolve the user's current level by ID.\n\t * const current = levels.find(l => l.id === profile.ach_level_current_id);\n\t * console.log('[smartico] render header badge — current level:', current?.name,\n\t * '(position', current?.ordinal_position, 'of', levels.length, ')');\n\t *\n\t * // Filter to levels the user has unlocked enough to see.\n\t * const visible = levels.filter(l =>\n\t * l.visibility_points == null || l.visibility_points <= profile.ach_points_ever\n\t * );\n\t * console.log('[smartico] render the level map with', visible.length, 'visible tiles');\n\t *\n\t * // Visitor-mode equivalent: returns the same ladder; no per-user state.\n\t * // const visitorLevels = await window._smartico.vapi('EN').getLevels();\n\t * ```\n\t */\n\tpublic async getLevels(): Promise<TLevel[]> {\n\t\treturn OCache.use(onUpdateContextKey.Levels, ECacheContext.WSAPI, () => this.api.levelsGetT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the user's current level — every `TLevel` field plus a\n\t * computed `progress` percentage toward the next level. Use this to\n\t * power a level badge with a progress bar.\n\t *\n\t * @remarks\n\t * **How `progress` is computed**\n\t * The SDK derives `progress` as the *delta-from-current-level-floor*:\n\t * `(ach_points_ever − current.required_points) / (next.required_points\n\t * − current.required_points) × 100`, clamped to `[0, 100]`. At the\n\t * highest level (no next level), `progress` is `100`. Reading the\n\t * source values directly from {@link getUserProfile}'s\n\t * `ach_points_ever` and {@link getLevels} would also work, but\n\t * `progress` saves the math.\n\t *\n\t * **Cache TTL & freshness**\n\t * The response is cached for 30 seconds, but the SDK automatically\n\t * drops that cache whenever a user-properties update arrives — the\n\t * same live channel that backs {@link getUserProfile}. The practical\n\t * effect depends on the label's leveling logic:\n\t * - **Points-based or operator-manual leveling**: a points or level\n\t * change flows through the user-properties channel, so the cache is\n\t * busted at that moment and the next `getCurrentLevel()` call\n\t * returns up-to-date data without waiting out the TTL.\n\t * - **Counter-based leveling** (level driven by sliding-window\n\t * counters such as deposit or wagering totals over a recent window —\n\t * see {@link getUserLevelExtraCounters}): ordinary progress changes\n\t * are recomputed by a periodic server job and do NOT emit a\n\t * user-properties update, so they become visible on this method only\n\t * after the 30 s TTL expires (or after `_smartico.api.clearCaches()`).\n\t *\n\t * Avoid calling `clearCaches()` on the points/manual path — it's\n\t * unnecessary there (the cache is already refreshed on the property\n\t * update) and forces a slower extra round-trip.\n\t *\n\t * **Leveling logic**\n\t * The semantics of how a user advances depends on the label's\n\t * leveling logic (configured per brand): points-only (the default),\n\t * sliding-window with extra counters (uses\n\t * {@link getUserLevelExtraCounters}), or fully-manual operator\n\t * assignment. The `progress` percentage on this method assumes the\n\t * points-only model — it's not meaningful for manual-only labels\n\t * where level changes are operator-driven rather than points-driven.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached value without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure read.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns Promise resolving to `TLevelCurrent` — the current level\n\t * plus `progress: number` (0–100).\n\t *\n\t * @example\n\t * ```ts\n\t * const level = await window._smartico.api.getCurrentLevel();\n\t * console.log('[smartico] render level badge — name:', level.name,\n\t * 'progress:', Math.round(level.progress), '%');\n\t *\n\t * // Detect level-up via getUserProfile's push channel. No clearCaches()\n\t * // needed — the SDK already drops the level cache on this update.\n\t * window._smartico.on('props_change', async (changed) => {\n\t * if ('ach_level_current_id' in changed) {\n\t * const fresh = await window._smartico.api.getCurrentLevel();\n\t * console.log('[smartico] user levelled up — animate badge to new level:', fresh.name);\n\t * }\n\t * });\n\t * ```\n\t */\n\tpublic async getCurrentLevel(): Promise<TLevelCurrent> {\n\t\treturn OCache.use(onUpdateContextKey.CurrentLevel, ECacheContext.WSAPI, () => this.api.getLevelCurrent(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the user's current values for the two label-defined \"extra\n\t * counters\" used by sliding-window leveling logic. Operators\n\t * configure what each counter means per label (e.g. `level_counter_1`\n\t * = total deposits in the last 30 days, `level_counter_2` = total\n\t * wagering in the last 30 days). Compare against\n\t * `required_level_counter_1` / `_2` on the next level from\n\t * {@link getLevels} to know how close the user is to advancing.\n\t *\n\t * @remarks\n\t * **When this matters**\n\t * Only labels configured for sliding-window leveling populate the\n\t * counter fields. On the default points-only leveling model, both\n\t * `level_counter_1` and `level_counter_2` are `undefined`. Detect\n\t * a points-only label by either counter being `undefined`.\n\t *\n\t * **Counter semantics — operator-defined**\n\t * The SDK exposes raw numeric values; the meaning of each counter\n\t * (deposit amount, wager amount, lifetime spend, etc.) is fully\n\t * operator-defined per label. Resolve labels for display via\n\t * `getTranslations` — the operator's display strings are\n\t * stored under the translation keys `levelsCounter1Name` and\n\t * `levelsCounter2Name`.\n\t *\n\t * **Refresh cadence**\n\t * Sliding-window counters are recomputed by a periodic server-side\n\t * job. Its rebuild cadence is operator-configured per brand —\n\t * commonly daily, though it can be set more frequent — so level\n\t * transitions driven by counter changes surface with a latency tied\n\t * to that rebuild schedule after the underlying activity (e.g. a\n\t * deposit), not in real time.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached value without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure read.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns Promise resolving to `UserLevelExtraCountersT`. Both\n\t * fields are `undefined` on labels not using sliding-window\n\t * leveling.\n\t *\n\t * @example\n\t * ```ts\n\t * const [counters, levels, profile] = await Promise.all([\n\t * window._smartico.api.getUserLevelExtraCounters(),\n\t * window._smartico.api.getLevels(),\n\t * Promise.resolve(window._smartico.api.getUserProfile()),\n\t * ]);\n\t *\n\t * // Quick detection: undefined means this label doesn't use sliding-window leveling.\n\t * if (counters.level_counter_1 === undefined) {\n\t * console.log('[smartico] points-only label — skip counter UI; show points progress only');\n\t * return;\n\t * }\n\t *\n\t * // Find the next level and render a 3-bar progress block.\n\t * const currentIdx = levels.findIndex(l => l.id === profile.ach_level_current_id);\n\t * const next = levels[currentIdx + 1];\n\t * if (next) {\n\t * console.log('[smartico] render points bar:', profile.ach_points_ever, '/', next.required_points);\n\t * if (next.required_level_counter_1) {\n\t * console.log('[smartico] render counter 1 bar:', counters.level_counter_1, '/', next.required_level_counter_1);\n\t * }\n\t * if (next.required_level_counter_2) {\n\t * console.log('[smartico] render counter 2 bar:', counters.level_counter_2, '/', next.required_level_counter_2);\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async getUserLevelExtraCounters(): Promise<UserLevelExtraCountersT> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.LevelExtraCounters,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getUserGamificationInfoT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the user's unified balance-change history — every points, gems, and\n\t * diamonds transaction within the requested time window, ordered newest-first.\n\t * Use to power an \"Activity\" / \"History\" tab showing wins, claims, purchases,\n\t * level-up rewards, and operator adjustments.\n\t *\n\t * The returned shape is the same regardless of currency type — `type` (see\n\t * {@link UserBalanceType}) distinguishes points / gems / diamonds and\n\t * `source_type_id` (see {@link PointChangeSourceType}) names the originating\n\t * event.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not guarded at the SDK level\n\t * but is not meaningful — activity is per-user.\n\t *\n\t * **Pagination — `from` / `to` are offset + ceiling, not timestamps**\n\t * The SDK derives `offset = from`, `limit = min(to - from, 50)` — the server\n\t * hard-caps a single response at 50 entries. For infinite scroll, advance\n\t * `from` by 50 between calls. Both `startTimeSeconds` and `endTimeSeconds`\n\t * are epoch seconds bounding the window the server scans.\n\t *\n\t * **Subscription model (`onUpdate`)**\n\t * The callback fires when the user's `ach_points_balance`,\n\t * `ach_gems_balance`, or `ach_diamonds_balance` changes (i.e. whenever a\n\t * wallet event lands). The pushed payload is a FIXED re-fetch of the\n\t * **last 10 minutes / first 50 entries** — it does NOT honor the original\n\t * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to`. Consumers\n\t * maintaining a long historical view must re-call `getActivityLog` with\n\t * their own params after receiving an `onUpdate` notification.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - Push triggers fire only on balance changes; transactions that don't\n\t * alter a balance (theoretical zero-amount entries) won't refresh.\n\t *\n\t * **Visitor mode**: not meaningful (no per-user history available).\n\t *\n\t * **UI guidance**: see [UI Guide — `getActivityLog`](../../docs/ui/user/UIGuide_getActivityLog.md).\n\t *\n\t * @returns Array of {@link TActivityLog} ordered newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const now = Math.floor(Date.now() / 1000);\n\t * const start = now - 86400 * 30; // 30 days\n\t *\n\t * const log = await window._smartico.api.getActivityLog({\n\t * startTimeSeconds: start,\n\t * endTimeSeconds: now,\n\t * from: 0,\n\t * to: 50,\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] wallet changed — refreshed payload is last 10 min / 50 entries:', refreshed.length, 'rows');\n\t * // If the consumer is showing a full 30-day view, re-call getActivityLog with the original params here.\n\t * },\n\t * });\n\t *\n\t * for (const row of log) {\n\t * const sign = row.amount >= 0 ? '+' : '';\n\t * console.log('[smartico] activity row — render with', row.type === 0 ? 'points' : row.type === 1 ? 'gems' : 'diamonds', 'icon, color by sign:', sign + row.amount, 'balance after:', row.balance, 'source:', row.source_type_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getActivityLog({\n\t\tstartTimeSeconds,\n\t\tendTimeSeconds,\n\t\tfrom,\n\t\tto,\n\t\tonUpdate,\n\t}: {\n\t\t/** Window start in epoch seconds. */\n\t\tstartTimeSeconds: number;\n\t\t/** Window end in epoch seconds. */\n\t\tendTimeSeconds: number;\n\t\t/** Pagination offset (0-based). */\n\t\tfrom: number;\n\t\t/** Pagination ceiling (exclusive); server caps `to - from` at 50. */\n\t\tto: number;\n\t\t/** Optional push callback; payload is a fixed 10-min / 50-entry refresh on every wallet change (see Subscription model). */\n\t\tonUpdate?: (data: TActivityLog[]) => void;\n\t}): Promise<TActivityLog[]> {\n\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.ActivityLog, onUpdate);\n\t\t}\n\n\t\treturn await OCache.use(\n\t\t\tonUpdateContextKey.ActivityLog,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getActivityLogT(this.userExtId, startTimeSeconds, endTimeSeconds, from, to),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\tprotected async notifyActivityLogUpdate() {\n\t\tconst startSeconds = Date.now() / 1000 - 600;\n\t\tconst endSeconds = Date.now() / 1000;\n\t\tconst payload = await this.api.getActivityLogT(this.userExtId, startSeconds, endSeconds, 0, 50);\n\n\t\tthis.updateEntity(onUpdateContextKey.ActivityLog, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTGetTranslations,\n\tTUICustomSection,\n} from './WSAPITypes';\nimport { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIUser } from './WSAPIUser';\n\n/** @group General */\nexport class WSAPIGeneral extends WSAPIUser {\n\t/**\n\t * Returns the operator-configured \"custom sections\" the current user is eligible\n\t * to see. Custom sections are nav-level entries the operator builds in the BO —\n\t * HTML pages, themed mission grids, store / raffle / tournament category pages,\n\t * lootbox calendars, redirect links, and Liquid-templated dashboards — each\n\t * surfaced with its own icon and label.\n\t *\n\t * Use the response to build the side menu / bottom-bar / nav grid of a\n\t * gamification widget. Each section's `section_type_id` (see\n\t * {@link AchCustomSectionType}) tells the consumer which page component to mount\n\t * when the user opens the section.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls. Typically fetched once at app boot to build the\n\t * navigation skeleton.\n\t *\n\t * **Server-side eligibility filtering**\n\t * Sections are filtered server-side by the user's segments / level / brand and\n\t * the section's `active_from_date` / `active_till_date` window. Sections the\n\t * user is ineligible for are omitted from the response entirely — there is no\n\t * \"locked\" state to render.\n\t *\n\t * **Ordering**\n\t * Response is server-ordered. Render in the order received; do NOT re-sort\n\t * client-side (the operator's order is the intended nav order).\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - No push subscription. Re-call after a segment / level change might\n\t * make new sections eligible, or just rely on the 30 s cache turnover.\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getCustomSections`](../../docs/ui/general/UIGuide_getCustomSections.md).\n\t *\n\t * @returns Array of {@link TUICustomSection} — empty if the label has no\n\t * active custom sections or the user is ineligible for all of them.\n\t *\n\t * @example\n\t * ```ts\n\t * const sections = await window._smartico.api.getCustomSections();\n\t *\n\t * for (const s of sections) {\n\t * console.log('[smartico] nav entry', s.menu_name, 'type', s.section_type_id, '→ mount the matching page component');\n\t * // Render s.menu_img (64x64) as the nav icon and s.menu_name as the label.\n\t * // For section_type_id === AchCustomSectionType.REDIRECT_LINK, do NOT mount a page —\n\t * // resolve s.url_or_dp on click (DP string or external URL).\n\t * }\n\t * ```\n\t */\n\tpublic async getCustomSections(): Promise<TUICustomSection[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.CustomSections,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.customSectionsGetT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full set of operator-defined translation key/value pairs for the\n\t * label, merged across the requested language and the English baseline.\n\t *\n\t * Translation keys are free-form strings defined by the operator in the BO. The\n\t * SDK consumer treats the result as a flat dictionary: `translations[key]`. If\n\t * the key is missing entirely, do NOT trust `undefined` semantics — defensively\n\t * fall back to the key string itself or a hardcoded literal.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls.\n\t * - `lang_code` is the ISO language code the operator uses in the BO\n\t * (e.g. `\"EN\"`, `\"FR\"`, `\"ES\"`). Case is not normalised — match what the\n\t * operator configured.\n\t *\n\t * **EN fallback**\n\t * The SDK issues an English-baseline fetch first, then overlays the\n\t * `lang_code` translations on top. Any key the operator has only defined in\n\t * English (i.e. missing in the requested language) is returned with the\n\t * English value. Keys missing in both are absent from the map — the consumer\n\t * must handle missing keys (the default Smartico UI returns the key string\n\t * itself as the fallback text).\n\t *\n\t * **What's included**\n\t * The SDK passes an empty `areas` filter to the server, which returns ALL\n\t * translation namespaces configured for the label (Gamification, Casino,\n\t * Trading, Affiliation, etc. — whichever are populated). For a Gamification-\n\t * only widget, the consumer can ignore unused namespaces — keys are flat\n\t * strings, not nested.\n\t *\n\t * **Refresh**\n\t * - Cached internally per `(lang_code, label, brand)` for ~30 seconds.\n\t * - No push subscription. Operators editing translations in the BO will see\n\t * the change after the cache window expires.\n\t *\n\t * **Visitor mode**: supported. Translations are label-scoped, not user-\n\t * scoped — `lang_code` is the sole language selector and is independent of\n\t * the `vapi(lang)` argument used elsewhere.\n\t *\n\t * @param lang_code ISO language code (e.g. `\"EN\"`, `\"FR\"`). Defaults to\n\t * `\"EN\"` server-side if empty.\n\t * @returns {@link TGetTranslations} — `{ translations: { [key]: string } }`.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.getTranslations('FR');\n\t *\n\t * // Defensive lookup: fall back to the key itself if the operator hasn't\n\t * // defined the string.\n\t * const t = (k: string) => r.translations[k] ?? k;\n\t *\n\t * console.log('[smartico] localized label \"missions_title\" →', t('missions_title'));\n\t * ```\n\t */\n\tpublic async getTranslations(lang_code: string): Promise<TGetTranslations> {\n\t\tconst r = await this.api.getTranslationsT(this.userExtId, lang_code, []);\n\n\t\treturn {\n\t\t\ttranslations: r.translations,\n\t\t};\n\t}\n\n\t/**\n\t * Returns the missions and tournaments associated with a casino / sportsbook\n\t * game in the operator's games catalog — the reverse of \"given this mission,\n\t * which games count for it\" — so you can surface \"play this game to progress\n\t * mission X\" / \"tournament Y features this game\" badges on game tiles or\n\t * detail screens.\n\t *\n\t * The shape mirrors `getMissions` (`UserAchievement[]`) and `getTournamentsList`\n\t * (`Tournament[]`) — same wire types, no reduced subset.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - `related_game_id` must be a Games Catalog ID (the same external string the\n\t * operator uses in the catalog at\n\t * {@link https://help.smartico.ai/welcome/technical-guides/games-catalog-api}).\n\t *\n\t * **Server-side eligibility filtering**\n\t * Missions and tournaments are filtered by the user's segments / level / brand\n\t * before being returned. A user who is ineligible for a mission segment will\n\t * NOT see that mission in the result even if it lists the game. The same\n\t * filtering applies to tournaments. Treat the response as \"what this user\n\t * should see\" — no client-side eligibility pass needed.\n\t *\n\t * **No cache**\n\t * Every call is a live server round-trip. Missions/tournaments are operator-\n\t * mutated state (opt-in, completion, expiry) that changes during a session;\n\t * caching staler than the user's last action would mis-render eligibility.\n\t * Avoid building a consumer-side cache for UI-critical paths.\n\t *\n\t * **Refresh**\n\t * - Re-call when the user navigates to a new game tile / detail surface.\n\t * - Re-call after the user opts into / completes a related mission to refresh\n\t * the \"play this game\" badge.\n\t *\n\t * **Visitor mode**: supported via `_smartico.vapi(lang).getRelatedItemsForGame(...)`.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRelatedItemsForGame`](../../docs/ui/general/UIGuide_getRelatedItemsForGame.md).\n\t *\n\t * @param related_game_id External Games Catalog ID of the game (e.g. `\"gold-slot2\"`).\n\t * @returns {@link GetRelatedAchTourResponse} — `{ achievements, tournaments? }`.\n\t * `tournaments` may be `undefined` (treat as empty); both arrays may be empty\n\t * when no eligible entities reference the game.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.getRelatedItemsForGame('gold-slot2');\n\t *\n\t * const missions = r.achievements ?? [];\n\t * const tournaments = r.tournaments ?? [];\n\t *\n\t * if (missions.length === 0 && tournaments.length === 0) {\n\t * console.log('[smartico] no related missions / tournaments — hide the related badge on the game tile');\n\t * } else {\n\t * console.log('[smartico] related entities:', missions.length, 'missions /', tournaments.length, 'tournaments — show a \"X missions / Y tournaments\" badge');\n\t * }\n\t * ```\n\t */\n\tpublic async getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse> {\n\t\tconst result = await this.api.getRelatedItemsForGame(this.userExtId, related_game_id);\n\t\treturn result;\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTAchCategory,\n\tTMissionClaimRewardResult,\n\tTMissionOptInResult,\n\tTMissionOrBadge,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIGeneral } from './WSAPIGeneral';\n\n/** @group Missions */\nexport class WSAPIMissions extends WSAPIGeneral {\n\t/**\n\t * Returns all missions visible to the current user, scoped server-side\n\t * to what the user is qualified to see. Optionally subscribes to live\n\t * updates via `onUpdate`: the callback is invoked with the full, refreshed\n\t * mission array whenever the server pushes a mission-state-changing event.\n\t *\n\t * The returned list is the canonical source of truth for mission state\n\t * (`is_opted_in`, `progress`, `is_completed`, `completion_count`, etc.).\n\t * Consumers should NEVER mutate it optimistically — always wait for the\n\t * `onUpdate` callback (or a fresh `getMissions()` call after the 30s cache\n\t * window expires) to observe the new state.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed mission array (never a\n\t * diff/patch). Each subsequent call to `getMissions({ onUpdate })`\n\t * REPLACES the prior callback — only one active subscriber at a time.\n\t * Pass `onUpdate: undefined` (or omit it) to keep the prior callback in\n\t * place; the callback is never auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t * 1. **Mutation responses**: `requestMissionOptIn(...)` or\n\t * `requestMissionClaimReward(...)` resolves (any `err_code`).\n\t * 2. **Asynchronous server pushes**: a user activity (deposit, bet,\n\t * login, etc.) advances task progress on a task configured to push\n\t * updates, or completes a mission.\n\t * 3. **Visibility changes**: the user's level changes, or other\n\t * gamification visibility tags change.\n\t *\n\t * Operator-side BO mission-config edits do NOT push to connected\n\t * clients — those changes surface only on the next cache miss (after\n\t * the 30 s TTL) or alongside the next trigger from (1)–(3).\n\t *\n\t * **What's in the returned list / what's filtered server-side**\n\t * The response is pre-filtered by the server. Missions EXCLUDED before\n\t * reaching the SDK:\n\t * - Missions in `DRAFT` or `ARCHIVED` status (see {@link AchievementStatus}).\n\t * - Missions where the user fails visibility conditions. Exception:\n\t * completed missions may remain visible after the user no longer\n\t * qualifies (configurable per-brand).\n\t * - `FEATURED_MANUALLY` missions that are still locked — they appear\n\t * only after the user unlocks them.\n\t * - Locked missions configured to hide while locked — UNLESS the\n\t * mission is configured to expose immediately on unlock (then the\n\t * locked mission is included as a teaser).\n\t * - `RECURRING` missions between cycles, until the next cycle starts.\n\t * - `RECURRING_QUANTITY` missions outside their `active_from_ts` /\n\t * `active_till_ts` window.\n\t *\n\t * Client-side filtering you may still want: missions with\n\t * `only_in_custom_section: true` are intended for their custom-section\n\t * view only and should be hidden from the main mission list.\n\t *\n\t * **Reading state from the returned mission**\n\t * Drive availability chips (\"missed\", \"coming soon\", \"needs opt-in\",\n\t * \"in progress\", \"expired\") from `availability_status` (enum\n\t * {@link AchievementAvailabilityStatus}) — it's the canonical derived\n\t * state and reflects all server-side timing/visibility rules in one\n\t * field. For time-limited and recurring missions, `dt_start` doubles\n\t * as the opt-in timestamp (for opt-in missions) or unlock timestamp\n\t * (for previously-locked missions); the expiration of a time-limited\n\t * mission is `dt_start + time_limit_ms`. `next_recurrence_date_ts`\n\t * is populated for `RECURRING` / `RECURRING_QUANTITY` missions but\n\t * is no longer meaningful once the mission's `active_till_ts` has\n\t * passed.\n\t *\n\t * **Refresh after a mutation**\n\t * After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`\n\t * resolves, the SDK auto-refreshes the mission cache; the `onUpdate`\n\t * callback fires with the new array shortly after. `is_opted_in`,\n\t * `progress`, and `is_completed` flip on the refreshed mission — do\n\t * NOT mutate them optimistically while the round-trip is pending.\n\t * Render any pending state from your own loading flag.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMissions`](../../docs/ui/missions/UIGuide_getMissions.md).\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * mission array on every server-pushed update\n\t * (after opt-in / claim-reward calls, or when\n\t * the server pushes an asynchronous\n\t * mission-state change). Each call to\n\t * `getMissions` overwrites the prior callback.\n\t * Never fires in visitor mode.\n\t * @returns Promise resolving to the current list of\n\t * missions visible to the user. Empty array if\n\t * the user has no missions (or if the visitor\n\t * proxy user has none configured).\n\t *\n\t * @example\n\t * ```ts\n\t * // 1. Initial fetch + subscribe to live updates\n\t * const missions = await window._smartico.api.getMissions({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] mission list refreshed — re-render the entire mission list UI from this array, do not merge with prior state:', refreshed);\n\t *\n\t * // 2. onUpdate fires for: opt-in/claim responses, task-progress\n\t * // pushes that complete a mission or move a \"pushToClient\" task,\n\t * // and user-level changes. Treat each call as authoritative.\n\t * const claimable = refreshed.filter(m =>\n\t * m.is_completed && m.requires_prize_claim && !m.prize_claimed_date_ts,\n\t * );\n\t * if (claimable.length > 0) {\n\t * console.log('[smartico] there are unclaimed mission prizes — surface a \"Claim\" CTA on each of these missions:', claimable.map(m => m.id));\n\t * }\n\t * },\n\t * });\n\t *\n\t * // 3. Filter/render from the returned list. The server already excludes\n\t * // DRAFT/ARCHIVED missions and ones the user can't see. You may need\n\t * // client-side filters for view-specific concerns (custom sections,\n\t * // completed/missed tabs).\n\t * const generalView = missions\n\t * .filter(m => !m.only_in_custom_section)\n\t * .sort((a, b) => (a.position ?? 0) - (b.position ?? 0));\n\t *\n\t * console.log('[smartico] initial mission list ready — render', generalView.length, 'missions sorted by position');\n\t *\n\t * // 4. Visitor-mode equivalent: onUpdate is accepted but never fires.\n\t * // Re-poll if you need fresh data.\n\t * // const visitorMissions = await window._smartico.vapi('EN').getMissions();\n\t * // console.log('[smartico] visitor missions are the brand proxy user\\'s — per-user fields are not meaningful');\n\t * ```\n\t */\n\tpublic async getMissions({ onUpdate }: { onUpdate?: (data: TMissionOrBadge[]) => void } = {}): Promise<TMissionOrBadge[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Missions, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.Missions,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.missionsGetItemsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns all the badges available to the current user.\n\t *\n\t * Badges are completion-tracked achievements that auto-unlock once the user\n\t * meets their criteria — there is no opt-in step, no claim step, and no\n\t * task-description reveal. Contrast with {@link getMissions}, which returns\n\t * the same `TMissionOrBadge[]` shape but represents explicit opt-in flows.\n\t *\n\t * @remarks\n\t * **Why no `onUpdate` callback?**\n\t * Unlike `getMissions({ onUpdate })`, this method does NOT accept an\n\t * `onUpdate` subscription. Internally the SDK never refreshes the `Badges`\n\t * cache from server pushes: the achievement-related push events\n\t * (mission opt-in / claim / reload) refresh the missions cache, NOT\n\t * the badges cache. The badges cache is flushed only by:\n\t * - its 30-second TTL\n\t * - a full SDK cache wipe at login / logout\n\t *\n\t * **How to refresh the badge list**\n\t * If you need near-live badge state, poll manually after the TTL expires.\n\t * The first call inside the 30 s window returns the cached payload; the\n\t * first call after the TTL triggers a fresh server round-trip. Example:\n\t * ```ts\n\t * setInterval(async () => {\n\t * const badges = await window._smartico.api.getBadges();\n\t * console.log('[smartico] badge list polled — re-render badge grid from this array', badges);\n\t * }, 30_000);\n\t * ```\n\t * Alternatively, re-fetch on a domain event your app already handles\n\t * (e.g. after the user finishes a game round or claims a bonus).\n\t *\n\t * **Differences from missions** (same `TMissionOrBadge` shape, different\n\t * feature)\n\t * The opt-in, claim, recurring-cycle, and unlock-description fields on\n\t * the returned objects are not populated for badges; treat their values\n\t * as undefined / default. Time windows are absolute calendar timestamps\n\t * (`active_from_ts` / `active_till_ts`), not opt-in-relative durations —\n\t * drive availability chips from the SDK-computed `badgeTimeLimitState`\n\t * (enum {@link BadgesTimeLimitStates}), not `time_limit_ms`. Locking for\n\t * badges is purely time-based: `is_locked` is `true` only when\n\t * `badgeTimeLimitState === BadgesTimeLimitStates.BeforeStartDate` (the\n\t * time window hasn't started yet). The primary navigation field is\n\t * `category_ids` — call {@link getAchCategories} to resolve category\n\t * metadata and group badges by category.\n\t *\n\t * **Idempotency / Side effects**: fetch-only; safe to call repeatedly.\n\t * The cache layer deduplicates concurrent calls within the TTL window.\n\t *\n\t * **Visitor mode**: not supported. Badges are an authenticated-only\n\t * feature; calling this on the visitor-mode handle (`_smartico.vapi`)\n\t * throws synchronously rather than silently returning an empty list.\n\t *\n\t * **UI guidance**: see [UI Guide — `getBadges`](../../docs/ui/missions/UIGuide_getBadges.md).\n\t *\n\t * @throws `Error(\"getBadges is not available in visitor mode\")` when\n\t * called from a visitor-mode session.\n\t * @returns Promise resolving to `TMissionOrBadge[]`. Every item has\n\t * `type === 'badge'`. Cached for 30 s under the `Badges` key.\n\t *\n\t * @example\n\t * ```ts\n\t * const [badges, categories] = await Promise.all([\n\t * window._smartico.api.getBadges(),\n\t * window._smartico.api.getAchCategories(),\n\t * ]);\n\t *\n\t * console.log('[smartico] badges fetched — render grouped grid with', badges.length, 'badges across', categories.length, 'categories');\n\t *\n\t * for (const category of categories) {\n\t * const inCategory = badges.filter(b => b.category_ids?.includes(category.id));\n\t * const completed = inCategory.filter(b => b.is_completed).length;\n\t * console.log(`[smartico] render category section \"${category.name}\" header showing ${completed}/${inCategory.length}`);\n\t *\n\t * for (const badge of inCategory) {\n\t * // Use badgeTimeLimitState (not time_limit_ms) for availability chip\n\t * if (badge.badgeTimeLimitState === 0) { // BadgesTimeLimitStates.BeforeStartDate\n\t * console.log('[smartico] badge not yet started — render grayscaled card with \"Starts on\" chip for badge', badge.id);\n\t * } else if (badge.is_completed) {\n\t * console.log('[smartico] badge completed — render with completed styling and check-mark for badge', badge.id);\n\t * } else {\n\t * console.log('[smartico] badge in progress — render with stage counter (completed_tasks / total) for badge', badge.id);\n\t * }\n\t * }\n\t * }\n\t *\n\t * // No onUpdate available — poll if live state matters\n\t * setInterval(async () => {\n\t * try {\n\t * const fresh = await window._smartico.api.getBadges();\n\t * console.log('[smartico] badge poll tick — diff against previous list and re-render any changed badge cards', fresh);\n\t * } catch (e) {\n\t * console.error('[smartico] badge poll failed — keep showing last known state, retry on next tick:', e);\n\t * }\n\t * }, 30_000);\n\t * ```\n\t */\n\tpublic async getBadges(): Promise<TMissionOrBadge[]> {\n\t\t// Badges are an authenticated-only feature. The visitor-mode WSAPI\n\t\t// instance (`_smartico.vapi`) is constructed without a tracker, so the\n\t\t// server would silently return nothing; throw a clear error instead.\n\t\tif (!this.api.tracker) {\n\t\t\tthrow new Error('getBadges is not available in visitor mode');\n\t\t}\n\t\treturn OCache.use(onUpdateContextKey.Badges, ECacheContext.WSAPI, () => this.api.badgetsGetItemsT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the list of active mission/badge categories configured for the current label.\n\t * Categories are operator-defined groupings used to organize missions and badges into\n\t * sections, tabs, or filter chips in the gamification UI. The same category list serves\n\t * BOTH missions and badges — there is no separate \"mission categories\" vs \"badge\n\t * categories\" split on the server.\n\t *\n\t * @remarks\n\t * **What categories are**\n\t * - Operator-defined groupings, configured per-label by the brand operator.\n\t * Only active categories are returned; inactive/deleted ones are filtered out.\n\t * - Each `TAchCategory` exposes `{ id, name, order }`. `name` is the display label;\n\t * `order` is the relative position (lower = appears first).\n\t * - The same array covers BOTH missions and badges — categories are not filtered by\n\t * entity type on the server.\n\t *\n\t * **Localization / translation**\n\t * - `name` is **pre-translated server-side** to the authenticated user's stored language.\n\t * In visitor mode, the language passed to `_smartico.vapi(lang)` drives the\n\t * translation. Consumers never need to translate `name` themselves.\n\t * - Fallback if no translation exists for the user's language: the brand's EN value\n\t * is returned. The field is never null.\n\t *\n\t * **Sort order**\n\t * The server does NOT pre-sort. Sort client-side before rendering:\n\t * `categories.sort((a, b) => a.order - b.order)`.\n\t *\n\t * **How missions/badges join to categories**\n\t * Each `TMissionOrBadge` exposes `category_ids: number[]` (zero-or-more,\n\t * many-to-many). A single mission/badge can belong to multiple categories\n\t * simultaneously, or to none. To render a \"category → items\" view:\n\t * `missions.filter(m => m.category_ids.includes(cat.id))`.\n\t *\n\t * **Uncategorized items**\n\t * Items with `category_ids: []` are NOT represented by a synthetic \"Other\" entry.\n\t * If your UI needs one, generate it client-side by checking\n\t * `item.category_ids.length === 0`.\n\t *\n\t * **Empty categories**\n\t * A category may be returned even if zero missions/badges reference it. Filter\n\t * out empty categories on the consumer side if you don't want to render section\n\t * headers for them.\n\t *\n\t * **Refresh cadence / cache**\n\t * - The SDK caches the response for 30 seconds. Subsequent calls within that\n\t * window return the cached array without a network round-trip.\n\t * - The cache is NOT invalidated by mission/badge push events — operator-driven\n\t * category changes propagate at the next 30 s cache miss.\n\t * - Cache is fully cleared on login / logout.\n\t * - In **visitor mode** additional server-side caching applies on top of the\n\t * SDK cache; worst-case staleness for an edited/added category is on the order\n\t * of a few minutes for anonymous viewers.\n\t *\n\t * **Idempotency**: safe. Read-only metadata fetch. Cache de-duplicates concurrent calls.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAchCategories`](../../docs/ui/missions/UIGuide_getAchCategories.md).\n\t *\n\t * @returns Array of `{ id, name, order }`. Empty array if no active categories are\n\t * configured for the label. `name` is pre-translated. Order is NOT applied — caller\n\t * must sort.\n\t *\n\t * @example\n\t * ```ts\n\t * const categories = await window._smartico.api.getAchCategories();\n\t *\n\t * if (categories.length === 0) {\n\t * console.log('[smartico] no categories configured — render missions/badges as a flat list without section headers');\n\t * } else {\n\t * const sorted = [...categories].sort((a, b) => a.order - b.order);\n\t * console.log('[smartico] categories loaded — render one tab/section per entry in this order:', sorted.map(c => c.name));\n\t *\n\t * // Join to missions: render each category as a section\n\t * const missions = await window._smartico.api.getMissions();\n\t * for (const cat of sorted) {\n\t * const items = missions.filter(m => m.category_ids.includes(cat.id));\n\t * if (items.length === 0) {\n\t * console.log('[smartico] category has no missions — skip rendering its section header:', cat.name);\n\t * continue;\n\t * }\n\t * console.log(`[smartico] render section \"${cat.name}\" with ${items.length} mission(s)`);\n\t * }\n\t *\n\t * // Uncategorized items: surface in a caller-provided \"Other\" bucket if needed\n\t * const uncategorized = missions.filter(m => m.category_ids.length === 0);\n\t * if (uncategorized.length > 0) {\n\t * console.log('[smartico] uncategorized missions exist — render a caller-provided \"Other\" section; server does NOT return id:-1:', uncategorized.length);\n\t * }\n\t * }\n\t *\n\t * // Visitor mode — same shape, language driven by vapi(lang) argument\n\t * const visitorCats = await window._smartico.vapi('DE').getAchCategories();\n\t * console.log('[smartico] visitor-mode categories (names translated to DE):', visitorCats);\n\t * ```\n\t */\n\tpublic async getAchCategories(): Promise<TAchCategory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AchCategories,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.achGetCategoriesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Opt the current user in to a mission. The mission must have\n\t * `is_requires_optin: true` (from `getMissions()`) and must not already\n\t * be opted-in or locked. After a successful opt-in, the user's task\n\t * progress starts counting toward this mission — events fired BEFORE\n\t * opt-in do not count retroactively (except `UNLOCK_ACHIEVEMENT` tasks,\n\t * which are exempt and can fire pre-opt-in).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Only call when the mission has `is_requires_optin === true`,\n\t * `is_opted_in === false`, and `is_locked === false`. Calling on a\n\t * mission that does not require opt-in is wasted; calling twice returns\n\t * `40010`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; task progress counting begins\n\t * - `105` — wrong mission id (different label) OR visibility conditions\n\t * not met. Same code covers both; use `err_message` to disambiguate.\n\t * - `40010` — already opted-in. Safe to treat as \"no-op success\"; usually\n\t * means local mission state was stale (e.g. user opted in from another\n\t * session/tab).\n\t * - `40013` — mission not opt-in-able: missing `requires_optin`, in\n\t * DRAFT/ARCHIVED state, or outside its `active_from_ts` /\n\t * `active_till_ts` window.\n\t * - `40014` — mission is locked; user has unlock-tasks remaining.\n\t * Surface the mission's `unlock_mission_description` to guide them.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Time-limited missions**\n\t * For missions with `time_limit_ms > 0`, the countdown begins at opt-in\n\t * time, not at mission creation. Server records expiration as\n\t * `optin_date + time_limit_ms`.\n\t *\n\t * **Refresh after success**\n\t * The SDK refreshes its mission cache automatically on opt-in response;\n\t * any `onUpdate` callback passed to a prior `getMissions({ onUpdate })`\n\t * fires with the new state shortly after. No manual re-fetch needed.\n\t *\n\t * **Idempotency**: not idempotent. A second call returns `40010`. Guard\n\t * the call site against double-clicks.\n\t *\n\t * **Side effects**: does NOT award points / badges / levels directly.\n\t * Rewards come from task completion, which is itself gated on opt-in.\n\t * May affect visibility of other missions whose visibility conditions\n\t * depend on this opt-in.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestMissionOptIn`](../../docs/ui/missions/UIGuide_requestMissionOptIn.md).\n\t *\n\t * **Visitor mode: not supported**\n\t *\n\t * @param mission_id The mission `id` (from `getMissions()`)\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t *\n\t * @example\n\t * ```ts\n\t * const missions = await window._smartico.api.getMissions({\n\t * onUpdate: (m) => console.log('[smartico] mission list updated — re-render mission UI from this new array', m),\n\t * });\n\t * const mission = missions.find(m => m.id === missionId);\n\t *\n\t * if (!mission || !mission.is_requires_optin || mission.is_opted_in || mission.is_locked) {\n\t * console.log('[smartico] opt-in not applicable — keep UI as-is');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] opt-in starting — show loading spinner on opt-in button and disable it to prevent double-clicks');\n\t * const r = await window._smartico.api.requestMissionOptIn(mission.id);\n\t * console.log('[smartico] opt-in response received — clear loading spinner');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 40010) {\n\t * console.log('[smartico] opt-in succeeded (or was already done) — onUpdate above will fire with refreshed mission state; no manual re-fetch needed');\n\t * } else if (r.err_code === 40014) {\n\t * console.error('[smartico] mission is locked — surface the unlock description as guidance:', mission.unlock_mission_description);\n\t * } else {\n\t * console.error('[smartico] opt-in failed — show an error toast with this message to the user:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestMissionOptIn(mission_id: number): Promise<TMissionOptInResult> {\n\t\tconst r = await this.api.missionOptIn(this.userExtId, mission_id);\n\n\t\tconst o: TMissionOptInResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Claim the prize for a completed mission. This is the step that runs\n\t * AFTER `requestMissionOptIn()` (when applicable) and AFTER the user has\n\t * completed all of the mission's tasks. Only call when the mission has\n\t * `requires_prize_claim === true`, `is_completed === true`, and the prize\n\t * has not already been claimed.\n\t *\n\t * The points / bonuses / badge grants associated with the mission are\n\t * awarded server-side synchronously inside this call (before the response\n\t * is returned), so a successful response (`err_code === 0`) means the\n\t * reward has already landed in the user's account.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Only call when, on the mission object from `getMissions()`:\n\t * - `is_completed === true`\n\t * - `requires_prize_claim === true`\n\t * - `prize_claimed_date_ts == null` (i.e. not already claimed)\n\t * - `prize_claim_expiration_date` is `null` OR still in the future\n\t *\n\t * The `ach_completed_id` argument must be passed straight from the same\n\t * mission object (`mission.ach_completed_id`). It is a server-side primary\n\t * key identifying the specific completion row; the SDK consumer should\n\t * never synthesise or cache it across sessions — always re-read it from a\n\t * fresh `getMissions()` result.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the prize was claimed and rewards have been credited.\n\t * - `1` — generic server error. Covers several distinct underlying\n\t * conditions, all collapsed into the same code: stale or wrong\n\t * `ach_completed_id` (does not match user / mission), the mission no\n\t * longer requiring a prize claim, the mission being archived/draft,\n\t * label mismatch, or the completion being too old (server enforces a\n\t * freshness window of several months). Recovery: re-fetch missions\n\t * with `getMissions()`; if the mission still appears claimable,\n\t * surface a generic error.\n\t * - `40015` — claim window expired (`prize_claim_expiration_date` has\n\t * passed). Show a \"claim period ended\" message; do not retry.\n\t * - `40016` — mission is not completed yet. Indicates a race or a stale\n\t * local cache. Re-fetch via `getMissions()`; if `is_completed` is still\n\t * false, the UI should hide the claim button.\n\t * - `40017` — prize already claimed. Treat as idempotent success: refresh\n\t * the mission list (auto-refresh will fire) and hide the claim button.\n\t * Usually means another tab/session already claimed it.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Recurring missions**\n\t * The server transparently handles both one-shot and recurring mission\n\t * completions. The SDK consumer passes a single `ach_completed_id`\n\t * regardless of mission type; the server resolves the correct completion.\n\t *\n\t * **Refresh after success**\n\t * On any claim response (success OR failure), the SDK automatically\n\t * re-fetches the mission list and fires any `onUpdate` callback\n\t * registered via `getMissions({ onUpdate })`. No manual re-fetch needed.\n\t * Note: points balance, badges, and level state arrive through their\n\t * own push channels — subscribe to them separately if your UI shows\n\t * those values.\n\t *\n\t * **Idempotency**: not idempotent at the row level. A second call on the\n\t * same `ach_completed_id` returns `40017` (already claimed). For a stale\n\t * `ach_completed_id` the second call returns `1`. Guard the call site\n\t * against double-clicks; the SDK does not enforce its own in-flight lock.\n\t *\n\t * **Side effects** (consumer-observable effects of a successful claim):\n\t * - Points credited to the user's balance.\n\t * - CRM-rule activities executed (may grant bonuses, badges; may unlock\n\t * follow-up missions, which arrive as a later mission auto-refresh).\n\t * - Analytics / automation events fired downstream; not directly observable\n\t * in the response, but visible via the mission auto-refresh and any\n\t * subsequent bonus / badge updates.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestMissionClaimReward`](../../docs/ui/missions/UIGuide_requestMissionClaimReward.md).\n\t *\n\t * @param mission_id The mission `ach_id` (from `getMissions()`).\n\t * @param ach_completed_id The completion-row identifier, read from\n\t * `mission.ach_completed_id` on the same mission\n\t * object fetched via `getMissions()`. Never\n\t * fabricate or cache across sessions.\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t * (or `40017` when treated as idempotent no-op).\n\t *\n\t * @example\n\t * ```ts\n\t * const missions = await window._smartico.api.getMissions({\n\t * onUpdate: (m) => console.log('[smartico] mission list updated — re-render mission UI from this new array', m),\n\t * });\n\t * const mission = missions.find(m => m.ach_id === missionId);\n\t *\n\t * if (\n\t * !mission ||\n\t * !mission.is_completed ||\n\t * !mission.requires_prize_claim ||\n\t * mission.prize_claimed_date_ts ||\n\t * (mission.prize_claim_expiration_date && Date.now() >= mission.prize_claim_expiration_date)\n\t * ) {\n\t * console.log('[smartico] claim not applicable — keep claim button hidden');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — show loading spinner on claim button and disable it to prevent double-clicks');\n\t * const r = await window._smartico.api.requestMissionClaimReward(mission.ach_id, mission.ach_completed_id);\n\t * console.log('[smartico] claim response received — clear loading spinner');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 40017) {\n\t * console.log('[smartico] claim succeeded (or was already claimed) — points/bonuses are credited; mission list auto-refresh will fire via the onUpdate above; hide the claim button');\n\t * } else if (r.err_code === 40015) {\n\t * console.error('[smartico] claim window expired — show a \"claim period ended\" message and remove the claim button:', mission.prize_claim_expiration_date);\n\t * } else if (r.err_code === 40016) {\n\t * console.error('[smartico] mission reported as not completed by server — local state was stale; auto-refresh will reconcile, do not retry');\n\t * } else {\n\t * console.error('[smartico] claim failed — show an error toast with this message to the user (and re-fetch missions to recover from a stale ach_completed_id):', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestMissionClaimReward(mission_id: number, ach_completed_id: number): Promise<TMissionClaimRewardResult> {\n\t\tconst r = await this.api.missionClaimPrize(this.userExtId, mission_id, ach_completed_id);\n\n\t\tconst o: TMissionClaimRewardResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateMissions() {\n\t\tconst payload = await this.api.missionsGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Missions, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTBonus,\n\tTClaimBonusResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIMissions } from './WSAPIMissions';\n\n/** @group Bonuses */\nexport class WSAPIBonuses extends WSAPIMissions {\n\t/**\n\t * Returns the bonuses awarded to the current user — both pending\n\t * (player-claim required) and already-redeemed. Each bonus carries\n\t * a `bonus_status_id` ({@link BonusStatus}) describing its lifecycle\n\t * stage and an `is_redeemable` flag that signals whether the\n\t * consumer must trigger a manual {@link claimBonus} call.\n\t *\n\t * Bonuses originate from many sources (CRM rules, mission/tournament\n\t * rewards, store redemptions, mini-game prizes, manual operator\n\t * awards) and all surface through this single list. The consumer\n\t * cannot distinguish the source server-side without operator\n\t * coordination.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed bonuses list (never a\n\t * diff/patch). Each subsequent call to `getBonuses({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires after every\n\t * {@link claimBonus} call resolves on this connection (success OR\n\t * failure). This is the ONLY trigger.\n\t *\n\t * Does NOT fire when: a new bonus is awarded server-side\n\t * (CRM rule, mission completion, store purchase, etc.), a bonus\n\t * expires, or an operator manually issues / cancels a bonus. Those\n\t * changes surface only on the next cache miss (after the 30 s TTL).\n\t * Re-call `getBonuses()` manually if your UI needs near-live state\n\t * for server-driven awards.\n\t *\n\t * **Reading state from the returned bonus**\n\t * Drive UI bucketing from `bonus_status_id` (enum {@link BonusStatus}):\n\t *\n\t * - `COUPON_ISSUED` (2) — actionable; player must claim. Pair with\n\t * `is_redeemable === true` to gate the Claim button.\n\t * - `REDEEM_FAILED` (4) — also actionable; the previous claim\n\t * attempt failed but the bonus is still valid. Surface a retry CTA\n\t * — the default Smartico UI treats this identically to\n\t * `COUPON_ISSUED` from the player's perspective.\n\t * - `REDEEMED` (3) — historical; show in a \"claimed\" tab.\n\t * - `New` (1), `COUPON_ISSUE_FAILED` (5), `EXPIRED` (6) — these\n\t * should not normally reach the client and are typically filtered\n\t * out by operator-side widget configuration; if they do appear,\n\t * they have no player-actionable state.\n\t *\n\t * `is_redeemable` is the authoritative gate for showing the Claim\n\t * button — it's `true` only when the bonus is in a claimable status\n\t * AND the operator's integration uses a coupon model (where the\n\t * player must explicitly trigger delivery). Auto-redeemed bonuses\n\t * arrive already in `REDEEMED` state with `is_redeemable: false`.\n\t *\n\t * **Field hierarchy — display amount**\n\t * Bonuses carry both template-level (`label_bonus_template_meta_map.description`)\n\t * and instance-level (`bonus_meta_map.uiAmount`) display strings.\n\t * Prefer `bonus_meta_map.uiAmount` when present — it's the dynamic\n\t * amount computed at issuance time (e.g. from a dynamic-bonus\n\t * formula). Fall back to `label_bonus_template_meta_map.description`\n\t * (which can include HTML; sanitize before injecting).\n\t *\n\t * **Date format**\n\t * `create_date` and `redeem_date` are ISO 8601 UTC strings WITHOUT\n\t * a timezone suffix (`\"YYYY-MM-DDTHH:MM:SS\"`). Parse as UTC and\n\t * display in the user's local timezone. `redeem_date` is absent\n\t * until the bonus reaches `REDEEMED` status.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getBonuses`](../../docs/ui/bonuses/UIGuide_getBonuses.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * bonuses list after every\n\t * {@link claimBonus} resolves. Each call\n\t * to `getBonuses` overwrites the prior\n\t * callback.\n\t * @returns Promise resolving to the bonuses list.\n\t * Empty array if no bonuses are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const bonuses = await window._smartico.api.getBonuses({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] bonuses refreshed (after claimBonus) — re-render the bonuses UI from this array:', refreshed);\n\t * },\n\t * });\n\t *\n\t * // Bucket into pending vs redeemed tabs. The default Smartico UI groups\n\t * // COUPON_ISSUED + REDEEM_FAILED into the same \"Pending\" tab.\n\t * const pending = bonuses.filter(b =>\n\t * b.bonus_status_id === 2 || b.bonus_status_id === 4 // COUPON_ISSUED or REDEEM_FAILED\n\t * );\n\t * const redeemed = bonuses.filter(b => b.bonus_status_id === 3); // REDEEMED\n\t *\n\t * console.log('[smartico] render bonus tabs: pending=', pending.length, 'redeemed=', redeemed.length);\n\t *\n\t * // Render each pending bonus card; show Claim button only when redeemable.\n\t * for (const b of pending) {\n\t * const amount = b.bonus_meta_map?.uiAmount || b.label_bonus_template_meta_map?.description;\n\t * if (b.is_redeemable) {\n\t * console.log('[smartico] render Claim button for bonus', b.bonus_id, '— amount:', amount);\n\t * } else {\n\t * console.log('[smartico] render bonus as informational (no Claim button) — amount:', amount);\n\t * }\n\t * }\n\t *\n\t * // Server-awarded bonuses (e.g. from a CRM campaign) do NOT push;\n\t * // poll if you need near-live awareness.\n\t * setInterval(async () => {\n\t * const fresh = await window._smartico.api.getBonuses();\n\t * const newCount = fresh.filter(b => b.bonus_status_id === 2 || b.bonus_status_id === 4).length;\n\t * console.log('[smartico] poll tick — pending bonuses now:', newCount);\n\t * }, 30_000);\n\t * ```\n\t */\n\tpublic async getBonuses({ onUpdate }: { onUpdate?: (data: TBonus[]) => void } = {}): Promise<TBonus[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Bonuses, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Bonuses, ECacheContext.WSAPI, () => this.api.bonusesGetItemsT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Triggers manual redemption of a coupon-model bonus the user has\n\t * been awarded. For bonuses with `is_redeemable === true` returned\n\t * by {@link getBonuses}, this is the call that asks the operator's\n\t * integration to actually credit the bonus to the player's account.\n\t * Bonuses on integrations that auto-redeem arrive already in\n\t * `REDEEMED` state and do not require this call.\n\t *\n\t * Use this for `bonus_status_id` of `COUPON_ISSUED` (2) as the\n\t * first-time claim, and for `REDEEM_FAILED` (4) as a retry after a\n\t * prior unsuccessful attempt.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate bonus from {@link getBonuses} and gate the\n\t * call on `is_redeemable === true`. The SDK forwards the request\n\t * unconditionally — calling on a non-claimable bonus returns\n\t * `err_code = -1`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t *\n\t * The SDK currently types `err_code` as {@link SAWSpinErrorCode} for\n\t * historical reasons, but the values returned by this method come\n\t * from the server's general error space and are NOT mini-game codes.\n\t * Branch on the numeric values:\n\t *\n\t * - `0` — success; the bonus has been redeemed and the operator's\n\t * integration has credited the player's account.\n\t * - `-1` — bonus not claimable: not found, already claimed by\n\t * another session, or its status is no longer `COUPON_ISSUED` /\n\t * `REDEEM_FAILED`. Treat as idempotent — refresh\n\t * {@link getBonuses} and reconcile.\n\t * - `1` — generic server error. Transient; allow retry after a brief\n\t * delay.\n\t * - `9999` — uncaught server exception. Treat as a transient failure;\n\t * surface a generic error and allow retry.\n\t * - other non-zero — generic server error. Surface `err_message` if\n\t * any.\n\t *\n\t * **`success` field is unreliable**: the wire response does not\n\t * carry a `success` boolean — the field on `TClaimBonusResult` will\n\t * be `undefined` in practice. Always branch on `err_code === 0`\n\t * for the success check.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the bonuses cache on every\n\t * response (success OR failure) and fires any `onUpdate` callback\n\t * registered via {@link getBonuses}'s `onUpdate`. After\n\t * `err_code === 0`, the redeemed bonus shifts from\n\t * `COUPON_ISSUED` / `REDEEM_FAILED` to `REDEEMED` on the refreshed\n\t * array, with `redeem_date` populated. After a failure, the bonus\n\t * typically lands in `REDEEM_FAILED` and remains claimable for a\n\t * retry.\n\t *\n\t * **Idempotency**: NOT idempotent at the SDK level. A second call\n\t * returns `err_code = -1` once the first has succeeded — treat that\n\t * as success in the UI rather than as a real error. Guard the call\n\t * site against double-clicks (set a local \"claiming\" flag on click,\n\t * clear it on response).\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - Bonus status transitions to `REDEEMED`; `redeem_date` is set.\n\t * - The operator's integration credits the player's account\n\t * externally. The SDK does not observe that credit directly —\n\t * balance updates flow over the user-properties channel from the\n\t * operator's side, not from this response.\n\t * - Server-side analytics events fire downstream (not directly\n\t * observable from the SDK).\n\t *\n\t * **UI guidance**: see [UI Guide — `claimBonus`](../../docs/ui/bonuses/UIGuide_claimBonus.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param bonus_id The `bonus_id` from a `TBonus` returned by\n\t * {@link getBonuses}.\n\t * @returns `{ err_code, err_message, success? }`; success when\n\t * `err_code === 0` (or `err_code === -1` when treated as\n\t * idempotent no-op). The `success` field is unreliable —\n\t * ignore it.\n\t *\n\t * @example\n\t * ```ts\n\t * const bonuses = await window._smartico.api.getBonuses({\n\t * onUpdate: (refreshed) => console.log('[smartico] bonuses refreshed — re-render from this array', refreshed),\n\t * });\n\t * const bonus = bonuses.find(b => b.bonus_id === bonusId);\n\t *\n\t * if (!bonus) {\n\t * console.log('[smartico] bonus no longer visible — refresh list and hide CTA');\n\t * return;\n\t * }\n\t * if (!bonus.is_redeemable) {\n\t * console.log('[smartico] bonus is not claimable (auto-redeemed or already finalised) — keep CTA hidden');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — set in-flight flag, show loading dots on the Claim button, keep the modal open');\n\t * const r = await window._smartico.api.claimBonus(bonus.bonus_id);\n\t * console.log('[smartico] claim response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0 || r.err_code === -1) {\n\t * console.log('[smartico] claim succeeded (or was already done) — show a success toast; the getBonuses onUpdate above will fire with the refreshed list');\n\t * } else if (r.err_code === 9999) {\n\t * console.error('[smartico] uncaught server exception — show a generic error toast and allow retry');\n\t * } else {\n\t * console.error('[smartico] claim failed — surface this error message to the user; the bonus will move to REDEEM_FAILED state and remain claimable for a retry:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async claimBonus(bonus_id: number): Promise<TClaimBonusResult> {\n\t\tconst r = await this.api.bonusClaimItem(this.userExtId, bonus_id);\n\n\t\tconst o: TClaimBonusResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t\tsuccess: r.success,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateBonuses() {\n\t\tconst payload = await this.api.bonusesGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Bonuses, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTBuyStoreItemResult,\n\tTStoreCategory,\n\tTStoreItem,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIBonuses } from './WSAPIBonuses';\n\n/** @group Store */\nexport class WSAPIStore extends WSAPIBonuses {\n\tprivate storeHistoryOnUpdateParams: { limit: number; offset: number } = { limit: 20, offset: 0 };\n\n\tprivate storeHistoryCacheKey(limit: number, offset: number): string {\n\t\treturn `${onUpdateContextKey.StoreHistory}:${limit}:${offset}`;\n\t}\n\n\t/**\n\t * Returns the catalog of buyable store items visible to the current user,\n\t * scoped server-side to what the user is qualified to see. Optionally\n\t * subscribes to live updates via `onUpdate`: the callback is invoked with\n\t * the full refreshed catalog after every purchase the user makes from this\n\t * device.\n\t *\n\t * The returned list is the canonical source of truth for store state\n\t * (`can_buy`, `pool`, `discounted_price`, `active_till_date`, etc.).\n\t * Consumers should NEVER mutate it optimistically — always re-fetch (or\n\t * wait for the `onUpdate` callback) to observe the new state.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * The catalog is per-user. Visitor mode is supported with caveats (see\n\t * \"Visitor mode\" below). For the authenticated path, the user's balances\n\t * (`ach_points_balance`, `ach_gems_balance`, `ach_diamonds_balance` from\n\t * {@link getUserProfile}) must be tracked client-side to drive the\n\t * affordability state of the Buy button — the SDK does not pre-compute\n\t * affordability into `can_buy`.\n\t *\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed catalog (never a diff/patch).\n\t * Each subsequent call to `getStoreItems({ onUpdate })` REPLACES the prior\n\t * callback — only one active subscriber at a time. Pass\n\t * `onUpdate: undefined` (or omit it) to keep the prior callback in place;\n\t * the callback is never auto-cleared.\n\t *\n\t * **Update triggers**\n\t *\n\t * Fires after: any `buyStoreItem(...)` call resolves on this connection\n\t * (success OR failure). This is the ONLY trigger. The refreshed array\n\t * reflects pool decrement on the just-bought item, per-period purchase\n\t * cap re-evaluation on `can_buy`, and any `purchased_today` /\n\t * `purchased_this_week` / `purchased_this_month` flips visible via\n\t * {@link getStorePurchasedItems}.\n\t *\n\t * Does NOT fire for:\n\t * - Operator-side BO catalog edits (price, ribbons, pool seed, segment\n\t * conditions, new/removed items) — surface only on the next cache miss.\n\t * - Concurrent purchases by OTHER users — the current user's view of\n\t * `pool` may be stale until they themselves refresh.\n\t * - User balance changes from gameplay — the catalog is independent of\n\t * balance; the consumer drives Buy-button affordability from a\n\t * separately-tracked balance source.\n\t * - Items going past their `active_till_date` while the page is open —\n\t * the item simply disappears on the next refresh.\n\t *\n\t * **Server-side filtering** (what's already excluded before the SDK sees it)\n\t * - Items outside the `[active_from_date, active_till_date]` window —\n\t * past the till-date, items are ALWAYS filtered out server-side.\n\t * - Items the user fails visibility-segment / visibility-condition\n\t * checks for.\n\t * - Items configured to hide-when-empty whose pool has reached 0\n\t * (per-item operator flag). Items without that flag are still returned\n\t * with `pool === 0` so a \"Sold out\" state can be rendered.\n\t * - Items where the per-period bought-count cap is reached (and the\n\t * operator chose to hide rather than just disable).\n\t *\n\t * **Reading state from the returned item**\n\t * The catalog row carries everything a Buy button needs except the user's\n\t * balance: `can_buy` already reflects segment / visibility / per-period\n\t * cap checks, but the SDK does NOT pre-compute balance affordability —\n\t * compare `discounted_price ?? price` against the user's balance for\n\t * `purchase_type` (`ach_points_balance` / `ach_gems_balance` /\n\t * `ach_diamonds_balance` from {@link getUserProfile}). `purchase_type` is\n\t * per-item (`'points'` / `'gems'` / `'diamonds'`); operators can mix\n\t * currencies within a single catalog. For sold-out display, `pool === 0`\n\t * means the operator chose to keep the item visible — render an \"Out of\n\t * stock\" overlay. When `discounted_price` is set, render `price` with a\n\t * strikethrough and `discounted_price` as the active price; the\n\t * accompanying `discount_price_ribbon` is either a percentage preset\n\t * (`'10'`, `'15'`, `'20'`, `'25'`, `'50'`) or the literal `'custom'`\n\t * (in which case `custom_ribbon_image` is the artwork at 250×300 px).\n\t * A live countdown for time-limited items is rendered only when the\n\t * operator has enabled the per-item `show_timer` flag.\n\t *\n\t * **Cross-references**\n\t * `category_ids` joins to `TStoreCategory.id` from\n\t * {@link getStoreCategories} (many-to-many — an item can belong to\n\t * multiple categories). Items with `only_in_custom_section: true` are\n\t * returned in the catalog but intended for their custom-section view\n\t * only — filter them client-side for the main store view. The\n\t * history-only fields (`purchase_ts`, `purchase_points_amount`, the\n\t * `purchased_*` booleans) are populated only by\n\t * {@link getStorePurchasedItems}, not by this method.\n\t *\n\t * **Idempotency**: yes. `getStoreItems` is a pure read. Calling it\n\t * repeatedly within the 30-second cache window resolves from the cache\n\t * without a network round-trip.\n\t *\n\t * **Side effects** (of a successful purchase that triggers `onUpdate`)\n\t * Documented here because the consumer's `onUpdate` handler will observe\n\t * the resulting state changes on the next refreshed array:\n\t * - Points / gems / diamonds balance deducted per `purchase_type`. The\n\t * new balance becomes visible on the user's gamification profile via\n\t * the SDK's user-properties update channel (`ach_points_balance` /\n\t * `ach_gems_balance` / `ach_diamonds_balance`).\n\t * - `pool` decremented for limited-stock items.\n\t * - `type = 'bonus'` → a CRM bonus is granted; surfaces via\n\t * {@link getBonuses}.\n\t * - `type = 'raffleticket'` → raffle tickets granted; surfaces via\n\t * `getRaffles`.\n\t * - `type = 'changelevel'` → user's level adjusted; surfaces via\n\t * {@link getCurrentLevel}.\n\t * - `type = 'minigamespin'` → SAW spin attempts granted; visible via the\n\t * mini-game APIs.\n\t * - `type = 'prizedrop'` → one prize-drop attempt granted.\n\t * - `type = 'tangible'` → no automatic gameplay effect; the purchase is\n\t * recorded for the operator's manual fulfillment (e.g. physical merch).\n\t *\n\t * **UI guidance**: see [UI Guide — `getStoreItems`](../../docs/ui/store/UIGuide_getStoreItems.md).\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * catalog after every {@link buyStoreItem}\n\t * round-trip on this connection. Each call to\n\t * `getStoreItems` overwrites the prior\n\t * callback. Never fires in visitor mode.\n\t * @returns Promise resolving to the catalog of store\n\t * items visible to the user. Empty array if\n\t * the user has no items (or if the visitor\n\t * proxy user has none configured).\n\t *\n\t * @example\n\t * ```ts\n\t * // 1. Initial fetch + subscribe to live updates\n\t * const items = await window._smartico.api.getStoreItems({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] store catalog refreshed after a purchase — re-render the entire store UI from this array, do not merge with prior state:', refreshed);\n\t *\n\t * // 2. onUpdate fires only after the current user's own purchase\n\t * // round-trip. Pool counts and can_buy flags are now current\n\t * // for this user.\n\t * const soldOut = refreshed.filter(i => i.pool === 0);\n\t * if (soldOut.length > 0) {\n\t * console.log('[smartico] these items are now sold out — render an \"Out of stock\" overlay on each:', soldOut.map(i => i.id));\n\t * }\n\t * },\n\t * });\n\t *\n\t * // 3. Live affordability per item. Compare each item's price against\n\t * // the user's balance for its purchase_type (read from\n\t * // getUserProfile(), kept live by the SDK's user-properties channel).\n\t * const profile = window._smartico.api.getUserProfile();\n\t * const balances = {\n\t * points: profile?.ach_points_balance ?? 0,\n\t * gems: profile?.ach_gems_balance ?? 0,\n\t * diamonds: profile?.ach_diamonds_balance ?? 0,\n\t * };\n\t *\n\t * // 4. Filter out items that are custom-section-only for the main view.\n\t * const mainViewItems = items.filter(i => !i.only_in_custom_section);\n\t *\n\t * // 5. Bucket each item's button state for rendering.\n\t * for (const i of mainViewItems) {\n\t * const activePrice = i.discounted_price ?? i.price;\n\t * const canAfford = balances[i.purchase_type] >= activePrice;\n\t * if (i.pool === 0) {\n\t * console.log('[smartico] item', i.id, 'is sold out — render disabled Buy with \"Out of stock\" overlay');\n\t * } else if (i.can_buy === false) {\n\t * console.log('[smartico] item', i.id, 'is not eligible — render disabled Buy and surface cant_buy_message on the popup:', i.cant_buy_message);\n\t * } else if (!canAfford) {\n\t * console.log('[smartico] item', i.id, 'is unaffordable — render disabled Buy and show \"short by\" line on popup; deficit =', activePrice - balances[i.purchase_type], i.purchase_type);\n\t * } else {\n\t * console.log('[smartico] item', i.id, 'is buyable — render enabled Buy at price', activePrice, i.purchase_type);\n\t * }\n\t * }\n\t *\n\t * // 6. Visitor-mode equivalent: onUpdate is accepted but never fires.\n\t * // Re-poll if you need fresh data; buyStoreItem is not supported.\n\t * // const visitorItems = await window._smartico.vapi('EN').getStoreItems();\n\t * // console.log('[smartico] visitor catalog is the brand proxy user\\'s — per-user fields are not meaningful');\n\t * ```\n\t */\n\tpublic async getStoreItems({ onUpdate }: { onUpdate?: (data: TStoreItem[]) => void } = {}): Promise<TStoreItem[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.StoreItems, onUpdate);\n\t\t}\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.StoreItems,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetItemsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Purchase a specific store item on behalf of the current user. Spends\n\t * the user's points / gems / diamonds (depending on the item's\n\t * `purchase_type`) and triggers reward delivery (bonus issuance, mini-game\n\t * spin grant, level change, prize-drop, raffle ticket, or tangible item).\n\t *\n\t * A successful response (`err_code === 0`) means the funds have already\n\t * been debited and the reward has been queued / granted server-side. The\n\t * user's balance change arrives over a separate push channel, not in this\n\t * response — see \"Refresh after success\" below.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate item from `getStoreItems()` first and gate the call\n\t * on these fields:\n\t * - `can_buy === true` — server-derived; combines segment / visibility\n\t * conditions and any operator-set restrictions.\n\t * - `pool == null || pool > 0` — `null` means unlimited stock; a positive\n\t * number means N units remain.\n\t * - User's balance for the item's `purchase_type`\n\t * (`'points'` / `'gems'` / `'diamonds'`) is `>= price` (or\n\t * `>= discounted_price` if set). Balances are not on `TStoreItem` —\n\t * read them from the user properties returned by `getUserState()`.\n\t * - If `active_till_date` is set, it is in the future.\n\t *\n\t * Calling without satisfying these will most likely return a non-zero\n\t * `err_code` (one of the codes below). The SDK does not pre-validate\n\t * — it forwards the request to the server unconditionally.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; funds debited and reward delivered.\n\t * - `1` — generic server error / control-group rejection. Treat as a\n\t * transient failure; show a \"try again later\" message.\n\t * - `106` — label mismatch detected before the purchase transaction\n\t * (e.g. cross-label item id). From a consumer perspective: the item is\n\t * not purchasable by this user.\n\t * - `11000` (`SHOP_NO_BALANCE`) — insufficient **points** balance.\n\t * Show an insufficient-balance message that names how many points are\n\t * missing (`price - current_points_balance`). The Buy button on the\n\t * item should already be disabled when this is the case; this code\n\t * normally fires only on a stale local balance.\n\t * - `11001` (`SHOP_WRONG_LABEL`) — user-vs-item label mismatch detected\n\t * inside the purchase transaction. Distinct from `106`; both mean\n\t * \"not purchasable by this user\" from the consumer's perspective.\n\t * Surface as a generic \"item not available\" message.\n\t * - `11002` (`SHOP_FAILED_TO_BUY_BONUS`) — the bonus configured on the\n\t * store item couldn't be issued (bad / disabled bonus config on the\n\t * operator side). Funds are NOT debited. Surface a generic error and\n\t * advise the user to contact support if it persists.\n\t * - `11003` (`SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION`) — the item's\n\t * **visibility** segment condition is not satisfied. Shouldn't be\n\t * reachable through a correctly-rendered UI (the item shouldn't be\n\t * shown in the first place); usually indicates a stale local store\n\t * list. Re-fetch via `getStoreItems()`.\n\t * - `11004` (`SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE`) — the\n\t * item's **purchase** segment condition is not satisfied (the item is\n\t * visible but the user is not in the buyable segment). Surface a\n\t * localized \"try again later\" / \"you're not eligible\" message; do not\n\t * retry automatically.\n\t * - `11005` (`SHOP_FAILED_TO_BUY_MATCHING_BONUS`) — matching-bonus\n\t * coupon issuance failed (variant of `11002` for matching-deposit\n\t * bonuses). Funds are NOT debited. Surface a generic error.\n\t * - `11006` (`SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED`) — per-user purchase\n\t * cap reached (e.g. \"max 1 per day\"). Surface the item's\n\t * `limit_message` if set, otherwise `err_message`. Do not retry.\n\t * - `11007` — bonus was issued but a follow-up redemption step failed\n\t * server-side. Funds **are** debited and the purchase event is recorded;\n\t * the consumer's UI should refresh the store list (auto-refresh will\n\t * fire) and surface a soft warning rather than a hard error.\n\t * - `11009` (`SHOP_FAILED_POOL_EMPTY`) — stock pool is empty / sold out.\n\t * Show a \"sold out\" message; auto-refresh will mark the item as such\n\t * in subsequent `getStoreItems()` updates.\n\t * - `11011` (`SHOP_NO_BALANCE_GEMS`) — insufficient **gems** balance.\n\t * Same handling as `11000` but for the gems currency.\n\t * - `11012` (`SHOP_NO_BALANCE_DIAMONDS`) — insufficient **diamonds**\n\t * balance. Same handling as `11000` but for the diamonds currency.\n\t * - `11014` (`SHOP_FAILED_PURCHASE_LIMITATION`) — outside the configured\n\t * purchase window (purchase weekday / time-of-day / window). Surface\n\t * the item's `purchase_limit_message` if set, otherwise `err_message`.\n\t * - `9999` — uncaught server exception. Treat as a transient failure;\n\t * surface a generic error and allow retry.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Idempotency**: NOT idempotent. The server performs no de-duplication —\n\t * a second successful call deducts funds again and grants the reward\n\t * again (subject to per-user purchase caps). The SDK itself does **not**\n\t * enforce a single in-flight call. The consumer MUST guard the call site\n\t * against double-clicks (set a local \"buying\" flag on click, clear it on\n\t * response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically re-fetches the store item list and the\n\t * purchased-items history on every response (success or error). Any\n\t * `onUpdate` callback registered via `getStoreItems({ onUpdate })` (or\n\t * the purchased-items equivalent) fires shortly after with the updated\n\t * arrays — reflecting the new `pool`, `can_buy`, and any `purchased_*`\n\t * flags. The user's balance (points / gems / diamonds) is exposed on the\n\t * user-properties channel and updates independently; if the UI displays\n\t * the balance, subscribe to user-property updates separately (it does\n\t * NOT flow through `getStoreItems`).\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - User's points / gems / diamonds balance decreases by `price`\n\t * (or `discounted_price` if set).\n\t * - Item's `pool` decrements by 1 (when `pool != null`).\n\t * - Per-user purchase counters update — `purchased_today`,\n\t * `purchased_this_week`, `purchased_this_month` on the next\n\t * `getStoreItems()` refresh.\n\t * - The reward is delivered: bonus issuance, mini-game spin grant,\n\t * level change, prize drop, raffle ticket, or tangible-item record.\n\t * Each reward type pushes its own follow-up update (e.g. a new\n\t * bonus appears in `getBonuses()`, the spin shows up in\n\t * `getMiniGames()`). Subscribe to each relevant channel separately.\n\t * - A purchase row is appended to the user's purchase history,\n\t * surfaced via the purchased-items list.\n\t *\n\t * **UI guidance**: see [UI Guide — `buyStoreItem`](../../docs/ui/store/UIGuide_buyStoreItem.md).\n\t *\n\t * @param item_id The store item `id` (from `getStoreItems()`).\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * const items = await window._smartico.api.getStoreItems({\n\t * onUpdate: (next) => console.log('[smartico] store items updated — re-render store grid with this fresh array', next),\n\t * });\n\t * const item = items.find(i => i.id === itemId);\n\t *\n\t * if (!item) {\n\t * console.log('[smartico] item not in current store list — keep UI as-is, possibly refresh getStoreItems');\n\t * return;\n\t * }\n\t *\n\t * // Local pre-checks: keep these aligned with the Buy-button decision matrix above.\n\t * const effectivePrice = item.discounted_price ?? item.price;\n\t * const inStock = item.pool == null || item.pool > 0;\n\t * const inWindow = !item.active_till_date || Date.now() < item.active_till_date;\n\t * if (!item.can_buy || !inStock || !inWindow) {\n\t * console.log('[smartico] buy not applicable — show disabled state with operator copy if any:', item.cant_buy_message);\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] buy starting — set in-flight flag, show loading dots on Buy button, keep detail modal open');\n\t * const r = await window._smartico.api.buyStoreItem(item.id);\n\t * console.log('[smartico] buy response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] purchase successful — close the detail modal, show a success toast; getStoreItems onUpdate above will fire with the refreshed list (do NOT manually re-fetch)');\n\t * } else if (r.err_code === 11000 || r.err_code === 11011 || r.err_code === 11012) {\n\t * console.error('[smartico] insufficient balance for this purchase_type — show insufficient-balance UI and how many units are missing:', item.purchase_type, effectivePrice);\n\t * } else if (r.err_code === 11009) {\n\t * console.error('[smartico] item sold out — show a dedicated \"Sold out\" message; the auto-refresh will mark the card as such shortly');\n\t * } else if (r.err_code === 11006) {\n\t * console.error('[smartico] per-user purchase cap reached — surface the operator-defined limit message:', item.limit_message || r.err_message);\n\t * } else if (r.err_code === 11014) {\n\t * console.error('[smartico] outside purchase window — surface the operator-defined purchase-limit message:', item.purchase_limit_message || r.err_message);\n\t * } else if (r.err_code === 11004 || r.err_code === 11003) {\n\t * console.error('[smartico] user not eligible / stale visibility — show a localized \"try again later\" message and let auto-refresh reconcile');\n\t * } else {\n\t * console.error('[smartico] buy failed — show a generic error toast/modal with this message:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async buyStoreItem(item_id: number): Promise<TBuyStoreItemResult> {\n\t\tconst r = await this.api.buyStoreItem(this.userExtId, item_id);\n\n\t\tconst o: TBuyStoreItemResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Returns the list of active store categories configured for the current label.\n\t * Categories are operator-defined groupings used to organize store items into tabs,\n\t * sections, or filter chips in the gamification store UI.\n\t *\n\t * @remarks\n\t * **What categories are**\n\t * - Operator-defined groupings, configured per-label by the brand operator.\n\t * Only active categories are returned; inactive / archived / deleted ones are\n\t * filtered out server-side.\n\t * - Each `TStoreCategory` exposes `{ id, name, order }`. `name` is the display label;\n\t * `order` is the relative position (lower = appears first).\n\t * - The same set of categories is returned to every user of the label — there is no\n\t * per-segment / per-currency / per-device filtering on the category list. Item-level\n\t * segment visibility happens on {@link getStoreItems}, not here.\n\t *\n\t * **Localization / translation**\n\t * - `name` is **pre-translated server-side** to the authenticated user's stored language.\n\t * In visitor mode, the language passed to `_smartico.vapi(lang)` drives the translation.\n\t * Consumers never need to translate `name` themselves.\n\t * - Fallback if no translation exists for the user's language: the operator-set default\n\t * (typically the brand's English) value is returned. The field is never null for an\n\t * active category.\n\t *\n\t * **Sort order**\n\t * The server does NOT pre-sort. Sort client-side before rendering:\n\t * `categories.sort((a, b) => a.order - b.order)`.\n\t *\n\t * **How store items join to categories**\n\t * Each `TStoreItem` exposes `category_ids: number[]` (zero-or-more, many-to-many).\n\t * A single store item can belong to multiple categories, or to none. To render a\n\t * \"category → items\" view:\n\t * `items.filter(i => i.category_ids.includes(cat.id))`.\n\t *\n\t * **Uncategorized items**\n\t * Items with `category_ids: []` are NOT represented by a synthetic \"Other\" entry\n\t * in the response. The convention used by the reference store UI is to synthesize\n\t * a client-side bucket (e.g. labelled \"General\") for items that have no category, OR\n\t * for items whose `category_ids` reference a category that is no longer returned by\n\t * this method (e.g. archived since the item was tagged). If you choose to render\n\t * such a synthetic bucket, place it first (the reference UI uses an `order: -1`\n\t * convention so it precedes all operator-defined categories).\n\t *\n\t * **Empty categories**\n\t * A category may be returned even if zero items currently reference it (since this\n\t * method does not join against items). The reference store UI hides such empty\n\t * categories from its tab strip — replicate that filter if you don't want to render\n\t * tabs that lead to empty content panels.\n\t *\n\t * **Refresh cadence / cache**\n\t * - The SDK caches the response for 30 seconds. Subsequent calls within that window\n\t * return the cached array without a network round-trip.\n\t * - The cache is NOT invalidated by store-item push events or purchases — operator-driven\n\t * category changes propagate at the next 30 s cache miss.\n\t * - Cache is fully cleared on login / logout.\n\t * - In **visitor mode**, additional server-side caching applies on top of the SDK cache;\n\t * worst-case staleness for an edited/added category is on the order of a few minutes\n\t * for anonymous viewers.\n\t *\n\t * **Idempotency**: safe. Read-only metadata fetch. Cache de-duplicates concurrent calls.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getStoreCategories`](../../docs/ui/store/UIGuide_getStoreCategories.md).\n\t *\n\t * @returns Array of `{ id, name, order }`. Empty array if no active categories are\n\t * configured for the label. `name` is pre-translated. Order is NOT applied — caller\n\t * must sort.\n\t *\n\t * @example\n\t * ```ts\n\t * const [categories, items] = await Promise.all([\n\t * window._smartico.api.getStoreCategories(),\n\t * window._smartico.api.getStoreItems(),\n\t * ]);\n\t *\n\t * if (categories.length === 0) {\n\t * console.log('[smartico] no store categories configured — render items as a flat grid without tabs:', items.length);\n\t * } else {\n\t * // Sort categories; build per-category item buckets; hide empty categories\n\t * const sorted = [...categories].sort((a, b) => a.order - b.order);\n\t * const tabs = sorted\n\t * .map(cat => ({ cat, items: items.filter(i => i.category_ids?.includes(cat.id)) }))\n\t * .filter(t => t.items.length > 0);\n\t *\n\t * // Optional: synthesize an \"Other\" bucket for items with no (or unknown) category\n\t * const knownIds = new Set(categories.map(c => c.id));\n\t * const orphans = items.filter(i => !i.category_ids?.length || !i.category_ids.some(id => knownIds.has(id)));\n\t * if (orphans.length > 0) {\n\t * console.log('[smartico] uncategorized store items — render a client-synthesized \"Other\" tab at the front of the tab strip:', orphans.length);\n\t * }\n\t *\n\t * console.log('[smartico] render store tabs in this order with these counts:', tabs.map(t => `${t.cat.name} (${t.items.length})`));\n\t * }\n\t *\n\t * // Visitor mode — same shape, language driven by vapi(lang) argument\n\t * const visitorCats = await window._smartico.vapi('DE').getStoreCategories();\n\t * console.log('[smartico] visitor-mode store categories (names translated to DE):', visitorCats);\n\t * ```\n\t */\n\tpublic async getStoreCategories(): Promise<TStoreCategory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.StoreCategories,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetCategoriesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Fetches the authenticated user's **store purchase history** — a paginated,\n\t * newest-first list of past store purchases (one row per redemption).\n\t *\n\t * Designed for a \"My Purchases\" / \"Order History\" screen. Each entry carries\n\t * the same descriptive fields as the catalog card plus three history-only\n\t * fields: `purchase_ts` (when the purchase happened), `purchase_points_amount`\n\t * (the amount actually paid at that time — a price snapshot, not the\n\t * current `price`), and `purchase_type` (`'points' | 'gems' | 'diamonds'`).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported (the SDK only\n\t * exposes this method on the authenticated `_smartico.api`, not on\n\t * `_smartico.vapi`).\n\t * - No prerequisite calls — calling without first fetching\n\t * {@link getStoreItems} or {@link getStoreCategories} is fine.\n\t *\n\t * **Pagination semantics**\n\t * - **Offset-based**, newest-first. The server orders rows by purchase\n\t * timestamp **descending** and the SDK does NOT re-sort — items arrive\n\t * ready to render in display order.\n\t * - `limit` — page size. **The SDK default is 20.** There is no server-side\n\t * hard cap, but 20 matches what the default Smartico UI uses end-to-end; the\n\t * protocol and storage layers were sized for this page size. Treat `20`\n\t * as the conventional/recommended value; passing a much larger limit will\n\t * return more rows but is not the supported integration pattern.\n\t * Avoid `limit <= 0` — the server peeks `limit + 1` rows internally, so\n\t * `limit = 0` returns 1 row with a misleading \"has more\" signal, and\n\t * negative values produce undefined results.\n\t * - `offset` — number of items to skip from the start. The SDK default is\n\t * `0` (first page). For load-more pagination, pass\n\t * `offset = (previously-loaded items).length` on each subsequent call.\n\t * - **No `hasMore` on the returned array.** `TStoreItem[]` is a flat list;\n\t * the underlying protocol response carries `hasMore` but it is not\n\t * surfaced through this method. Two ways for consumers to know they\n\t * reached the end:\n\t * 1. The returned array is shorter than `limit` (definitive end), or\n\t * 2. A subsequent call at `offset = previous.length` returns `[]`.\n\t * Either is reliable.\n\t * - No date-range / category / status filter parameters — pagination is the\n\t * only server-side slicing. Apply any further filtering client-side.\n\t *\n\t * **No per-item fulfillment status**\n\t * - History entries do NOT carry a `delivered` / `pending` / `cancelled` /\n\t * `refunded` field. The list contains rows for committed purchase\n\t * attempts; the server query does not filter by transaction-status, so in\n\t * practice the rows that appear are completed purchases (failed\n\t * transactions roll back and don't write a row). Treat every item as a\n\t * completed transaction unless a future SDK release adds an explicit\n\t * status field.\n\t *\n\t * **Bonus-type entries**\n\t * - When the user redeemed a bonus item, the entry's `type` field surfaces\n\t * as `'bonus'`. **Known limitation:** the SDK transform currently maps\n\t * both `Bonus` and `Tangible` server-side item types to the same string\n\t * `'bonus'` — so the `type` field on history rows cannot distinguish a\n\t * bonus redemption from a tangible-prize redemption. The actual bonus\n\t * payload (wallet credit, free spins, etc.) is dispatched by the server\n\t * asynchronously and is NOT embedded in the history entry — consumers\n\t * that need bonus details should subscribe to bonus push events\n\t * separately rather than reading them from this list.\n\t * - History rows render identically across types — there is no deep-link to\n\t * the bonus wallet or re-claim affordance on the row itself.\n\t *\n\t * **Per-row data**\n\t * Each row uses the `TStoreItem` shape but populates four history-only\n\t * fields not present on `getStoreItems` output. `purchase_ts` is the\n\t * Unix-ms timestamp of the purchase — format with\n\t * `new Date(purchase_ts).toLocaleString()` in the user's local timezone;\n\t * no relative labels (\"Today\" / \"Yesterday\") are produced by the SDK.\n\t * `purchase_points_amount` is the amount actually paid at the time of\n\t * purchase — a snapshot of the historical price, which may differ from\n\t * the item's current `price`. `purchase_type` is the currency actually\n\t * charged (`'points' | 'gems' | 'diamonds'`); render the matching\n\t * balance icon next to the amount. The convenience booleans\n\t * `purchased_today` / `purchased_this_week` / `purchased_this_month` are\n\t * computed client-side from the consumer's local clock — useful for\n\t * grouping rows under \"Today\" / \"This Week\" headers.\n\t *\n\t * **Catalog fields on a history row**\n\t * The promotional fields (`ribbon`, `discounted_price`,\n\t * `discount_price_ribbon`, `custom_ribbon_image`, `active_till_date`)\n\t * reflect the CURRENT catalog state of the item, NOT its state at\n\t * purchase time — the default Smartico UI hides them on history rows to\n\t * avoid implying that the historical purchase carried the current\n\t * promotional banner. Descriptive marketing fields (`description`,\n\t * `hint_text`, `related_games`) are typically suppressed on a compact\n\t * history row. The current-purchasability fields `can_buy` and `pool`\n\t * reflect now, not then — useful only if you render a \"Buy Again\"\n\t * affordance on the row. One implementation gotcha: unlike\n\t * `getStoreItems`, this method's transform does NOT auto-parse JSON\n\t * strings in `custom_data` — call `JSON.parse()` yourself if you store\n\t * JSON there.\n\t *\n\t * **Cache & refresh**\n\t * - The SDK caches each `(limit, offset)` page separately for 30 seconds.\n\t * Repeated calls within that window resolve from cache without a\n\t * network round-trip.\n\t * - The cache is invalidated and `onUpdate` (when registered) is invoked\n\t * automatically after a successful {@link buyStoreItem} call — the SDK\n\t * re-fetches the same page parameters that were registered together with\n\t * the current `onUpdate` callback and pushes the fresh array.\n\t * - Multi-tab caveat: if the user has the same brand open in multiple\n\t * tabs, **all open tabs** receive the `onUpdate` event on a purchase,\n\t * not only the tab that initiated the buy. The event is scoped to the\n\t * current authenticated user — a different user's purchase never fires\n\t * this callback.\n\t * - Only ONE `onUpdate` callback can be registered at a time. Each call to\n\t * `getStorePurchasedItems({ onUpdate })` overwrites the previous handler.\n\t *\n\t * **Idempotency**: safe. Pure read.\n\t *\n\t * **Side effects**: none — read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getStorePurchasedItems`](../../docs/ui/store/UIGuide_getStorePurchasedItems.md).\n\t *\n\t * @param params - Optional pagination + callback bag.\n\t * @param params.limit - Page size. Defaults to `20`. Use `20` as the\n\t * conventional value (matches the default Smartico UI end-to-end). Avoid\n\t * non-positive values.\n\t * @param params.offset - Number of rows to skip from the newest end.\n\t * Defaults to `0`. For load-more pagination pass the current array\n\t * length.\n\t * @param params.onUpdate - Optional callback invoked after a successful\n\t * {@link buyStoreItem} elsewhere in the session. Receives the refreshed\n\t * page for the same `(limit, offset)` used on the call that registered\n\t * this callback. Only ONE callback can be registered; each new call\n\t * overwrites the previous one. Pass a stable handler or\n\t * re-register intentionally on screen entry.\n\t *\n\t * @returns Promise resolving to an array of `TStoreItem` history entries\n\t * in newest-first order. Empty array if the user has no purchases (or\n\t * the requested `offset` is beyond the end). Each entry carries\n\t * `purchase_ts`, `purchase_points_amount`, `purchase_type`, and the\n\t * `purchased_today/this_week/this_month` convenience flags in addition\n\t * to the standard item fields.\n\t *\n\t * @example\n\t * ```ts\n\t * // Initial load + subscribe to refresh-on-purchase.\n\t * const handleHistoryUpdate = (items: TStoreItem[]) => {\n\t * console.log(\n\t * '[smartico] purchase history refreshed — re-render the history list with these',\n\t * items.length,\n\t * 'items (newest first):',\n\t * items,\n\t * );\n\t * };\n\t *\n\t * try {\n\t * const firstPage = await _smartico.api.getStorePurchasedItems({\n\t * limit: 20,\n\t * offset: 0,\n\t * onUpdate: handleHistoryUpdate,\n\t * });\n\t *\n\t * if (firstPage.length === 0) {\n\t * console.log('[smartico] no purchase history — render the empty state (\"No purchases yet\")');\n\t * } else {\n\t * console.log(\n\t * '[smartico] render',\n\t * firstPage.length,\n\t * 'history rows (newest first). Show \"Load more\" button if length === 20:',\n\t * firstPage,\n\t * );\n\t *\n\t * // Inspect the first entry's history-only fields.\n\t * const first = firstPage[0];\n\t * console.log(\n\t * '[smartico] most-recent purchase: name=', first.name,\n\t * 'paid', first.purchase_points_amount, first.purchase_type,\n\t * 'at', new Date(first.purchase_ts ?? 0).toLocaleString(),\n\t * '— format with toLocaleString (user-local time) on the row.',\n\t * );\n\t * }\n\t *\n\t * // Load-more pattern: fetch page 2 once the user scrolls / clicks \"Load more\".\n\t * if (firstPage.length === 20) {\n\t * const nextPage = await _smartico.api.getStorePurchasedItems({\n\t * limit: 20,\n\t * offset: firstPage.length,\n\t * });\n\t * const isLastPage = nextPage.length < 20;\n\t * console.log(\n\t * '[smartico] appended page 2 —',\n\t * nextPage.length,\n\t * 'rows.',\n\t * isLastPage ? 'Hide \"Load more\" — end reached.' : 'Keep \"Load more\" visible.',\n\t * );\n\t * }\n\t * } catch (e) {\n\t * console.error(\n\t * '[smartico] failed to load purchase history — show a generic error placeholder or retry with backoff:',\n\t * e,\n\t * );\n\t * }\n\t * ```\n\t */\n\tpublic async getStorePurchasedItems({\n\t\tlimit,\n\t\toffset,\n\t\tonUpdate,\n\t}: { limit?: number; offset?: number; onUpdate?: (data: TStoreItem[]) => void } = {}): Promise<TStoreItem[]> {\n\t\tconst requestLimit = limit === undefined ? 20 : limit;\n\t\tconst requestOffset = offset === undefined ? 0 : offset;\n\t\tconst cacheKey = this.storeHistoryCacheKey(requestLimit, requestOffset);\n\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.StoreHistory, onUpdate);\n\t\t\tthis.storeHistoryOnUpdateParams = { limit: requestLimit, offset: requestOffset };\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tcacheKey,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetPurchasedItemsT(this.userExtId, requestLimit, requestOffset),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\tprotected async updateStorePurchasedItems() {\n\t\tconst payload = await this.api.storeGetPurchasedItemsT(\n\t\t\tthis.userExtId,\n\t\t\tthis.storeHistoryOnUpdateParams.limit,\n\t\t\tthis.storeHistoryOnUpdateParams.offset,\n\t\t);\n\t\tconst cacheKey = this.storeHistoryCacheKey(this.storeHistoryOnUpdateParams.limit, this.storeHistoryOnUpdateParams.offset);\n\n\t\tOCache.set(cacheKey, payload, ECacheContext.WSAPI);\n\n\t\tconst onUpdate = this.onUpdateCallback.get(onUpdateContextKey.StoreHistory);\n\t\tif (onUpdate) {\n\t\t\tonUpdate(payload);\n\t\t}\n\t}\n\n\tprotected async updateStoreItems() {\n\t\tconst payload = await this.api.storeGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.StoreItems, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTTournament,\n\tTTournamentDetailed,\n\tTTournamentRegistrationResult,\n\tTClanTournamentPlayers,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIStore } from './WSAPIStore';\n\n/** @group Tournaments */\nexport class WSAPITournaments extends WSAPIStore {\n\t/**\n\t * Returns the list of tournaments currently visible to the user, scoped\n\t * server-side to what the user's segments qualify them to see. Optionally\n\t * subscribes to live updates via `onUpdate`: the callback is invoked with\n\t * the full refreshed list whenever the user registers in a tournament.\n\t *\n\t * The returned list is the canonical source of truth for tournament\n\t * lobby state (`is_user_registered`, `registration_status`,\n\t * `is_in_progress`, `is_can_register`, etc.). Consumers should NOT\n\t * mutate it optimistically — always wait for the `onUpdate` callback\n\t * (or a fresh fetch after the 30 s cache window) to observe new state.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed list (never a diff/patch).\n\t * Each subsequent call to `getTournamentsList({ onUpdate })` REPLACES\n\t * the prior callback — only one active subscriber at a time. Pass\n\t * `onUpdate: undefined` (or omit it) to keep the prior callback in\n\t * place; the callback is never auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. `registerInTournament(...)` resolves on this connection (any\n\t * `err_code`). The refreshed list reflects the new\n\t * `is_user_registered` / `registration_status` /\n\t * `registration_count` on the affected tournament.\n\t *\n\t * Does NOT fire for: tournament lifecycle transitions (start, finish,\n\t * cancellation), score updates, other users' registrations, or\n\t * operator-side BO edits. Those changes surface only on the next\n\t * cache miss (after the 30 s TTL) — poll manually if your UI needs\n\t * sub-30s lifecycle freshness.\n\t *\n\t * **Server-side filtering** (what's excluded before the SDK sees it)\n\t * The server filters by visibility segment and entry segment, removes\n\t * tournaments past their post-finish display window, and excludes\n\t * tournaments not yet published. SDK consumers receive only items\n\t * the user is eligible to see; no client-side gating is required.\n\t *\n\t * **Reading state from the returned item**\n\t * Drive list bucketing and CTA labels from the SDK-computed booleans\n\t * (`is_active`, `is_can_register`, `is_cancelled`, `is_finished`,\n\t * `is_in_progress`, `is_upcoming`), NOT from raw `start_time` /\n\t * `end_time` comparisons — the booleans encode the canonical\n\t * lifecycle states and already reflect server-side rules around\n\t * qualifying scores and late registration. `is_user_registered` is\n\t * independent of `is_can_register` — a registered user has\n\t * `is_user_registered: true` and `is_can_register: false`. The `me`\n\t * block (if present) carries the user's own leaderboard position and\n\t * score; it's undefined for unregistered users, users without any\n\t * recorded score, and visitor-mode sessions. The `prize_pool_short`\n\t * field carries the operator-supplied summary string (\"$10,000\",\n\t * \"Mixed prizes\") for compact card rendering; the full per-place\n\t * `prizes[]` breakdown is also populated here but is typically\n\t * rendered only in the detail view via\n\t * {@link getTournamentInstanceInfo}.\n\t *\n\t * **Cross-references**\n\t * Tournaments with `is_clan_based: true` group participants by clan —\n\t * see {@link getClanTournamentPlayers} for fetching the players list\n\t * of a specific clan within a clan tournament. The detailed lobby\n\t * view (with full player leaderboard and prize structure) comes from\n\t * {@link getTournamentInstanceInfo}. Tournaments with\n\t * `custom_section_id` belong to an operator-defined custom section\n\t * (resolve metadata via `getCustomSections()`).\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache is\n\t * fully cleared on login / logout.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached array without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getTournamentsList`](../../docs/ui/tournaments/UIGuide_getTournamentsList.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped to\n\t * the brand's public tournament list. Per-user fields (`me`,\n\t * `is_user_registered`, `registration_status`) are not meaningful.\n\t * The `onUpdate` callback is accepted but never fires (registration\n\t * mutations are not supported in visitor mode).\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * tournament list after every\n\t * {@link registerInTournament} round-trip on\n\t * this connection. Each call overwrites the\n\t * prior callback. Never fires in visitor mode.\n\t * @returns Promise resolving to the array of\n\t * tournaments visible to the user. Empty\n\t * array if no tournaments are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] tournament list refreshed — re-render the lobby UI from this array, do not merge with prior state:', refreshed);\n\t * const justRegistered = refreshed.filter(t => t.is_user_registered);\n\t * console.log('[smartico] user is now registered in these tournaments:', justRegistered.map(t => t.name));\n\t * },\n\t * });\n\t *\n\t * // Bucket items by lifecycle state for a tabbed UI.\n\t * const live = tournaments.filter(t => t.is_in_progress);\n\t * const upcoming = tournaments\n\t * .filter(t => t.is_upcoming && !t.is_user_registered)\n\t * .sort((a, b) => a.start_time - b.start_time);\n\t * const mine = tournaments.filter(t => t.is_user_registered);\n\t * const finished = tournaments.filter(t => t.is_finished);\n\t *\n\t * console.log('[smartico] render lobby tabs with these counts: live=', live.length,\n\t * 'upcoming=', upcoming.length, 'mine=', mine.length, 'finished=', finished.length);\n\t *\n\t * // Featured tournament: pin to position 0 of the Overview/Top tabs.\n\t * const featured = tournaments.find(t => t.is_featured && !t.is_cancelled);\n\t * if (featured) {\n\t * console.log('[smartico] featured tournament — pin to position 0 of the Overview tab:', featured.name);\n\t * }\n\t *\n\t * // Visitor mode: onUpdate accepted but never fires; re-poll if needed.\n\t * // const visitorList = await window._smartico.vapi('EN').getTournamentsList();\n\t * ```\n\t */\n\tpublic async getTournamentsList({ onUpdate }: { onUpdate?: (data: TTournament[]) => void } = {}): Promise<TTournament[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.TournamentList, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.TournamentList,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.tournamentsGetLobbyT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full detail of a single tournament instance — adds the\n\t * player leaderboard, the full prize structure, and (for clan\n\t * tournaments) the clan leaderboard and per-clan prize structure on\n\t * top of everything already in `TTournament`. Use this to power a\n\t * tournament detail / lobby screen after the user picks an item from\n\t * {@link getTournamentsList}.\n\t *\n\t * Live leaderboard updates require manual re-fetching — there is no\n\t * subscription model, no push event, and no client-side cache (each\n\t * call hits the server). The default Smartico UI polls every 3 seconds\n\t * while the detail view is open.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `tournamentInstanceId` read from `TTournament.instance_id`\n\t * on an item returned by {@link getTournamentsList}. The method works\n\t * standalone — calling `getTournamentsList()` first is not required by\n\t * the SDK, but is the only stable source of valid IDs.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** This is a one-shot promise; call again to\n\t * refresh.\n\t * - **No client cache.** Every call sends a network request and\n\t * returns the latest server snapshot. Safe to poll on an interval —\n\t * the default Smartico UI uses 3 s while the detail view is visible.\n\t * - **No push event** invalidates or refreshes detail state. Score\n\t * changes, registration count changes, lifecycle transitions — all\n\t * require a fresh `getTournamentInstanceInfo` call.\n\t *\n\t * **Returned shape — beyond `TTournament`**\n\t * `TTournamentDetailed` extends `TTournament` with the following\n\t * additional data: a `players[]` leaderboard sorted server-side by\n\t * score (only members with at least one recorded score); the user's\n\t * own `me` block carrying their rank and score (undefined when not\n\t * registered or when the user has no score yet); a full per-place\n\t * `prizes[]` array (place range, type, points / gems / diamonds\n\t * amounts, image, name); and `related_games[]` if the operator has\n\t * associated games with this tournament. For clan tournaments\n\t * (`is_clan_based === true`), the response also carries\n\t * `clan_leaderboard[]` (ranked clans with `total_score` and\n\t * `contributing_members`), `clan_prize_structure[]` (per-clan-place\n\t * prize tiers — Fixed vs Dynamic, with ScoreWeighted /\n\t * EqualSplit distribution for Dynamic prizes), `user_clan_id` (the\n\t * user's own clan), and the advisory `user_position_in_clan` /\n\t * `user_score_in_clan` fields.\n\t *\n\t * **Idempotency**: safe. Read-only. Each call returns the latest\n\t * server snapshot.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getTournamentInstanceInfo`](../../docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md).\n\t *\n\t * **Visitor mode**: not supported. Use {@link getTournamentsList} for\n\t * the public lobby list in visitor mode; the detail endpoint requires\n\t * an authenticated session.\n\t *\n\t * @param tournamentInstanceId The `instance_id` from a `TTournament`\n\t * returned by {@link getTournamentsList}.\n\t * @returns Promise resolving to `TTournamentDetailed`.\n\t * Rejects if the instance ID is invalid\n\t * or the user lacks visibility for it.\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList();\n\t * const tournament = tournaments[0];\n\t *\n\t * console.log('[smartico] loading detail view for tournament', tournament.instance_id);\n\t * const detail = await window._smartico.api.getTournamentInstanceInfo(tournament.instance_id);\n\t *\n\t * console.log('[smartico] render detail with', detail.players?.length ?? 0,\n\t * 'players,', detail.prizes?.length ?? 0, 'prize tiers');\n\t *\n\t * if (detail.is_clan_based && detail.clan_leaderboard) {\n\t * console.log('[smartico] clan tournament — render clan leaderboard tab with',\n\t * detail.clan_leaderboard.length, 'clans');\n\t * if (detail.user_clan_id != null) {\n\t * console.log('[smartico] user belongs to clan', detail.user_clan_id,\n\t * '— highlight that row in the clan leaderboard');\n\t * }\n\t * }\n\t *\n\t * // Live leaderboard updates — poll every 3 seconds while the detail view is open.\n\t * const pollId = setInterval(async () => {\n\t * try {\n\t * const fresh = await window._smartico.api.getTournamentInstanceInfo(tournament.instance_id);\n\t * console.log('[smartico] detail refreshed — re-render player + clan leaderboards from this new snapshot:', fresh);\n\t * } catch (e) {\n\t * console.error('[smartico] tournament detail poll failed — keep showing last snapshot, retry on next tick:', e);\n\t * }\n\t * }, 3_000);\n\t * // clearInterval(pollId) when the detail view closes.\n\t *\n\t * if (detail.me) {\n\t * console.log('[smartico] current user is rank', detail.me.position,\n\t * 'with', detail.me.scores, 'points — render the sticky \"me\" panel below the leaderboard');\n\t * }\n\t * ```\n\t */\n\tpublic async getTournamentInstanceInfo(tournamentInstanceId: number): Promise<TTournamentDetailed> {\n\t\treturn this.api.tournamentsGetInfoT(this.userExtId, tournamentInstanceId);\n\t}\n\n\t/**\n\t * Returns the ranked players of a specific clan within a clan-based\n\t * tournament instance. Used to drill down from the clan-leaderboard\n\t * tab on the tournament detail view into a single clan's member\n\t * roster.\n\t *\n\t * The server returns up to roughly 20 players (top-N by score\n\t * descending). Server-side ordering is already by `scores` DESC\n\t * (equivalent to `position` ASC) — no client-side re-sort is\n\t * required.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `tournamentInstanceId` (read from `TTournament.instance_id`\n\t * returned by {@link getTournamentsList}) and a `clanId` (read from\n\t * `TTournamentDetailed.clan_leaderboard[].clan_id` returned by\n\t * {@link getTournamentInstanceInfo}). The tournament should be\n\t * clan-based (`is_clan_based === true`); calling this against a\n\t * non-clan tournament typically returns an empty `players` array.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** This is a one-shot promise.\n\t * - **No client cache.** Every call hits the server.\n\t * - **No push event** refreshes the response. Live updates to clan\n\t * member rankings require a fresh call.\n\t * - The default Smartico UI fetches this once when the user opens the\n\t * clan-drill-down modal and does NOT refresh while the modal is\n\t * open. If your UI needs live updates, re-call on an interval; the\n\t * clan leaderboard at the parent level (via\n\t * {@link getTournamentInstanceInfo}) does refresh via its own\n\t * polling cadence.\n\t *\n\t * **Returned shape**\n\t * `TClanTournamentPlayers` carries the requested clan's identity\n\t * (`clan_id`, `clan_public_meta.name`, `clan_public_meta.image_url`)\n\t * alongside the `players[]` array — each entry has `position`,\n\t * `scores`, `public_username`, `clean_ext_user_id`, `avatar_id`,\n\t * `avatar_real_id`, the resolved `avatar_url`, `user_id`, and the\n\t * `is_me` flag identifying the current user's row. The `clan_id` and\n\t * `clan_public_meta` on the response echo the input clan — the\n\t * default Smartico UI ignores them and renders the header from the\n\t * caller-side `ClanLeaderboardEntry` object, but they're available\n\t * for consumers that don't already have that context.\n\t *\n\t * **Username display**: prefer `clean_ext_user_id` when set, falling\n\t * back to `public_username`. The default Smartico UI uses\n\t * `clean_ext_user_id || public_username || ''`.\n\t *\n\t * **Idempotency**: safe. Read-only. Each call returns the latest\n\t * server snapshot.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClanTournamentPlayers`](../../docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param tournamentInstanceId The tournament `instance_id` from a\n\t * clan-based `TTournament`.\n\t * @param clanId The clan ID from\n\t * `TTournamentDetailed.clan_leaderboard[].clan_id`.\n\t * @returns Promise resolving to\n\t * `TClanTournamentPlayers`. An invalid\n\t * ID combination typically yields an\n\t * empty `players` array; the SDK does\n\t * not distinguish \"no scores yet\" from\n\t * \"invalid IDs\" — both manifest as an\n\t * empty list.\n\t *\n\t * @example\n\t * ```ts\n\t * const detail = await window._smartico.api.getTournamentInstanceInfo(tournamentInstanceId);\n\t * if (!detail.is_clan_based || !detail.clan_leaderboard) {\n\t * console.log('[smartico] not a clan tournament — skip clan drill-down');\n\t * return;\n\t * }\n\t *\n\t * // User clicked a clan row in the leaderboard.\n\t * const clickedClan = detail.clan_leaderboard[0];\n\t *\n\t * console.log('[smartico] opening clan drill-down — show modal skeleton while loading');\n\t * const result = await window._smartico.api.getClanTournamentPlayers(\n\t * tournamentInstanceId,\n\t * clickedClan.clan_id,\n\t * );\n\t *\n\t * if (result.players.length === 0) {\n\t * console.log('[smartico] clan has no ranked players yet — render empty state (\"No leaders yet\")');\n\t * } else {\n\t * console.log('[smartico] render clan member rows with .is-me highlight on the current user;',\n\t * result.players.length, 'players ranked');\n\t * const me = result.players.find(p => p.is_me);\n\t * if (me) {\n\t * console.log('[smartico] current user rank in this clan:', me.position, 'score:', me.scores);\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async getClanTournamentPlayers(tournamentInstanceId: number, clanId: number): Promise<TClanTournamentPlayers> {\n\t\treturn this.api.clanTournamentGetPlayers(this.userExtId, tournamentInstanceId, clanId);\n\t}\n\n\t/**\n\t * Registers the authenticated user in the specified tournament instance.\n\t * For tournaments with a buy-in cost, the user's balance is debited\n\t * synchronously before the response is returned; for free tournaments\n\t * the call is a simple membership add.\n\t *\n\t * A successful response (`err_code === 0`) means the registration row\n\t * exists server-side, the buy-in (if any) has been deducted, and the\n\t * SDK has already triggered a refresh of the tournament lobby cache.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate from {@link getTournamentsList} and gate the call\n\t * on `is_can_register === true`. This composite flag already encodes:\n\t * not already registered, slot available\n\t * (`registration_count < players_max_count`), tournament status is\n\t * REGISTER (or STARTED with late-registration enabled), and the\n\t * registration type is not AUTO. The SDK forwards the call\n\t * unconditionally — calling without satisfying these will return one\n\t * of the error codes below.\n\t *\n\t * For clan tournaments (`is_clan_based === true`), the user must\n\t * already belong to a clan before calling. If they don't, prompt them\n\t * to pick a clan first via `joinClan`, then call\n\t * `registerInTournament` after the clan-join resolves. See \"Error\n\t * codes\" `1010` below for the server-side safety net.\n\t *\n\t * **Error codes** (in `err_code`, typed as {@link TournamentRegistrationError})\n\t * - `0` — success; the registration is persisted, buy-in deducted,\n\t * tournament lobby refresh fires.\n\t * - `1010` — `TOURNAMENT_USER_CANNOT_JOIN_WITHOUT_CLAN`: clan-based\n\t * tournament and the user has no clan. Surface the clan-pick flow\n\t * (e.g. open a clan-pick modal driven by `getClans` +\n\t * `joinClan`), then retry registration.\n\t * - `30001` — `TOURNAMENT_INSTANCE_NOT_FOUND`: instance ID is invalid\n\t * or the tournament was deleted. Refresh the lobby via\n\t * `getTournamentsList()` and hide the entry from the UI.\n\t * - `30002` — `TOURNAMENT_REGISTRATION_NOT_ENOUGH_POINTS`: insufficient\n\t * points balance for a points-cost tournament. Show an\n\t * insufficient-balance UI naming the deficit.\n\t * - `30003` — `TOURNAMENT_INSTANCE_NOT_IN_STATE`: tournament is no\n\t * longer in a registerable state (finished, cancelled, finalizing,\n\t * or not yet published with late registration disabled). Refresh\n\t * the lobby; the button should hide.\n\t * - `30004` — `TOURNAMENT_ALREADY_REGISTERED`: user is already\n\t * registered. Treat as idempotent success — hide the Register button\n\t * and refresh the lobby. Usually indicates a stale local state\n\t * (e.g. registered from another tab).\n\t * - `30005` — `TOURNAMENT_USER_DONT_MATCH_CONDITIONS`: user fails the\n\t * tournament's segment / entry conditions. Prefer\n\t * `tournament.segment_dont_match_message` (operator-supplied) over\n\t * `err_message` when both are available.\n\t * - `30006` — `TOURNAMENT_USER_NOT_REGISTERED`: anomalous on a fresh\n\t * register call; usually indicates a server-side race. Treat as a\n\t * generic transient error.\n\t * - `30007` — `TOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS`: status\n\t * transition not allowed (e.g. re-registering after a finished /\n\t * cancelled tournament). Show a generic error; do not retry.\n\t * - `30008` — `TOURNAMENT_MAX_REGISTRATIONS_REACHED`: the tournament\n\t * filled up between the lobby fetch and the registration click.\n\t * Refresh the lobby — the button will hide on the refreshed item.\n\t * - `300010` — insufficient **gems** balance (gems-cost tournament).\n\t * Same UI handling as `30002` but for the gems currency.\n\t * - `300011` — insufficient **diamonds** balance (diamonds-cost\n\t * tournament). Same as `300010` but for diamonds. \n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * Note: clan-tournament registration can occasionally surface error\n\t * codes from the clan-join domain (e.g. `1011` — joined-after-start)\n\t * via the same response path. These are members of `JoinClanErrorCode`,\n\t * not `TournamentRegistrationError`. Branch on the numeric value.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same instance\n\t * returns `30004` once the first call has succeeded. The SDK does NOT\n\t * enforce an in-flight lock. The consumer MUST guard the call site\n\t * against double-clicks (set a local \"registering\" flag on click, clear\n\t * it on response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the tournament lobby cache on every\n\t * response (success OR error) and fires any `onUpdate` callback\n\t * registered via `getTournamentsList({ onUpdate })`. After\n\t * `err_code === 0`, the affected item's `is_user_registered` /\n\t * `registration_status` / `registration_count` reflect the new\n\t * registered state on the refreshed array. Note that\n\t * {@link getTournamentInstanceInfo} is NOT auto-refreshed — if the\n\t * detail screen is open, call it again manually.\n\t *\n\t * The user's balance (points / gems / diamonds) is exposed on the\n\t * user-properties channel and updates independently of this call's\n\t * response — subscribe to user-property updates separately if your UI\n\t * shows the balance.\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - Balance debited synchronously by the buy-in amount in the\n\t * tournament's currency (`registration_cost_points`,\n\t * `registration_cost_gems`, or `registration_cost_diamonds`). For\n\t * free tournaments no deduction occurs.\n\t * - Server-side analytics events fire downstream\n\t * (`tournament_user_registered` for immediate-registration types;\n\t * `tournament_user_registration_pending` or\n\t * `tournament_registered_pending_qualification` for\n\t * manual-approval / qualification-based types).\n\t * - Any operator-configured on-join prizes are distributed (e.g.\n\t * welcome bonus). These surface via the relevant follow-up channels\n\t * (e.g. {@link getBonuses}).\n\t *\n\t * **UI guidance**: see [UI Guide — `registerInTournament`](../../docs/ui/tournaments/UIGuide_registerInTournament.md).\n\t *\n\t * **Visitor mode**: not supported. Calling from a visitor session\n\t * returns a generic error, not a typed `TournamentRegistrationError`.\n\t *\n\t * @param tournamentInstanceId The `instance_id` from `TTournament`\n\t * (NOT the template `tournament_id`).\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t * (or `30004` when treated as idempotent no-op).\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList({\n\t * onUpdate: (refreshed) => console.log('[smartico] tournament list updated — re-render lobby from this array', refreshed),\n\t * });\n\t * const tournament = tournaments.find(t => t.instance_id === instanceId);\n\t *\n\t * if (!tournament) {\n\t * console.log('[smartico] tournament not in current lobby — refresh getTournamentsList and retry');\n\t * return;\n\t * }\n\t * if (!tournament.is_can_register) {\n\t * console.log('[smartico] tournament not currently registerable — keep CTA disabled');\n\t * return;\n\t * }\n\t *\n\t * // Clan tournament + user has no clan → resolve clan first.\n\t * if (tournament.is_clan_based) {\n\t * const userProfile = window._smartico.api.getUserProfile();\n\t * const userClanId = userProfile?.clan_id;\n\t * if (userClanId == null) {\n\t * console.log('[smartico] clan tournament — open the clan-pick modal first; after joinClan resolves, call registerInTournament again');\n\t * return;\n\t * }\n\t * }\n\t *\n\t * console.log('[smartico] registration starting — set in-flight flag, show loading dots on the Join button, keep modal open');\n\t * const r = await window._smartico.api.registerInTournament(tournament.instance_id);\n\t * console.log('[smartico] registration response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 30004) {\n\t * console.log('[smartico] registered (or was already) — close any modal, show a success toast; getTournamentsList onUpdate above will fire with the refreshed array');\n\t * } else if (r.err_code === 1010) {\n\t * console.log('[smartico] clan required — open the clan-pick modal again (this is the server-side safety net for a clan-leave race)');\n\t * } else if (r.err_code === 30002) {\n\t * console.error('[smartico] insufficient points — show insufficient-balance UI; deficit:', tournament.registration_cost_points);\n\t * } else if (r.err_code === 300010) {\n\t * console.error('[smartico] insufficient gems — show insufficient-balance UI; deficit:', tournament.registration_cost_gems);\n\t * } else if (r.err_code === 300011) {\n\t * console.error('[smartico] insufficient diamonds — show insufficient-balance UI; deficit:', tournament.registration_cost_diamonds);\n\t * } else if (r.err_code === 30005) {\n\t * console.error('[smartico] segment mismatch — prefer the operator-supplied message:', tournament.segment_dont_match_message || r.err_message);\n\t * } else if (r.err_code === 30008) {\n\t * console.error('[smartico] tournament full — auto-refresh will hide the button on the refreshed lobby item');\n\t * } else {\n\t * console.error('[smartico] registration failed — show a generic error toast with this message:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async registerInTournament(tournamentInstanceId: number): Promise<TTournamentRegistrationResult> {\n\t\tconst r = await this.api.registerInTournament(this.userExtId, tournamentInstanceId);\n\n\t\tconst o: TTournamentRegistrationResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateTournaments() {\n\t\tconst payload = await this.api.tournamentsGetLobbyT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.TournamentList, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTClans,\n\tTClanInfo,\n\tTClanJoinResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPITournaments } from './WSAPITournaments';\n\n/** @group Clans */\nexport class WSAPIClans extends WSAPITournaments {\n\t/**\n\t * Returns the active clans visible to the current user along with the\n\t * user's own membership state (`user_clan_id`, `cooldown_until`,\n\t * `join_date`). Use this to power a clan-picker / clan-browser screen.\n\t *\n\t * The returned `clans[]` is server-sorted by `rating_position` ASC\n\t * (1 = highest-ranked). The server has already filtered out archived\n\t * clans, clans the user fails segment conditions for, and (when any\n\t * clan has a non-zero score) clans with a zero rating score.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed `TClans` payload (never a\n\t * diff/patch). Each subsequent call to `getClans({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — note that, unlike most other subscription\n\t * methods in the SDK, this callback is **poll-driven only**. There\n\t * is NO server push that refreshes the clans list. The callback\n\t * fires when:\n\t *\n\t * 1. The 30-second cache TTL expires and a subsequent `getClans()`\n\t * call (from the consumer) triggers a fresh fetch.\n\t *\n\t * Consequence: clan-membership changes (other users joining your\n\t * clan, an operator-driven kick, a clan being archived) surface\n\t * only on the next consumer-driven fetch. If your UI needs\n\t * near-live state, poll `getClans()` on an interval; or re-call\n\t * after a {@link joinClan} resolves to pick up the new\n\t * `user_clan_id` immediately.\n\t *\n\t * **Reading state from the returned payload**\n\t * Drive list rendering from `clans[]` (already sorted). Identify\n\t * the user's own clan via `clan.clan_id === user_clan_id`\n\t * (`null` for clanless users). Detect an active switch-cooldown\n\t * with `cooldown_until !== null` — when set, the user cannot join\n\t * any clan until the cooldown expires, even clans they could\n\t * normally join. The cooldown is **user-level**, not per-clan.\n\t *\n\t * `cooldown_until` is an ISO 8601 UTC datetime string with no\n\t * timezone suffix (`\"YYYY-MM-DDTHH:MM:SS\"`). Parse as UTC:\n\t * `new Date(cooldown_until + 'Z')` or `moment.utc(cooldown_until)`.\n\t * Display in the user's local time. The default cooldown period\n\t * is configured per label by the operator (typically 7 days).\n\t *\n\t * `rating_position` is a global rank computed server-side across\n\t * all active clans in the label (1 = highest-rated). Because some\n\t * clans may be hidden by per-user segment visibility, positions\n\t * the user sees may skip (e.g. 1, 3, 7) — don't assume the array\n\t * spans a contiguous range.\n\t *\n\t * The `entry_fee_currency_type_id` enum on each clan uses values\n\t * `0` = points, `1` = gems, `2` = diamonds, `3` = free. Compare\n\t * `entry_fee_amount` against the user's matching balance (from\n\t * {@link getUserProfile}) to drive Join button affordability.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the\n\t * cache window return a deep-cloned cached payload without a\n\t * network round-trip.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClans`](../../docs/ui/clans/UIGuide_getClans.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * `TClans` payload whenever the 30 s cache\n\t * expires and a subsequent fetch lands.\n\t * Each call to `getClans` overwrites the\n\t * prior callback.\n\t * @returns Promise resolving to `TClans`. Empty\n\t * `clans` array if no clans are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] clans payload refreshed (poll-driven; ~30 s cadence) — re-render the clan list from this payload:', refreshed);\n\t * },\n\t * });\n\t *\n\t * console.log('[smartico] user is', result.user_clan_id == null ? 'clanless' : 'in clan ' + result.user_clan_id);\n\t *\n\t * // Cooldown handling — affects ALL clans, not a specific one.\n\t * if (result.cooldown_until) {\n\t * const cooldownEndsUtc = new Date(result.cooldown_until + 'Z');\n\t * console.log('[smartico] switch-cooldown active — disable all Join buttons until', cooldownEndsUtc.toLocaleString(),\n\t * '(local). Render the cooldown end on the disabled button label.');\n\t * }\n\t *\n\t * // Render clans — already sorted by rating_position ASC.\n\t * for (const clan of result.clans) {\n\t * const isMine = clan.clan_id === result.user_clan_id;\n\t * const isFull = clan.member_count >= clan.capacity_limit;\n\t *\n\t * if (isMine) {\n\t * console.log('[smartico] highlight clan', clan.clan_id, 'as \"Your clan\"; CTA label \"Your clan\", no-op');\n\t * } else if (result.cooldown_until) {\n\t * console.log('[smartico] clan', clan.clan_id, '— Join blocked by user cooldown; show disabled button with cooldown end date');\n\t * } else if (isFull) {\n\t * console.log('[smartico] clan', clan.clan_id, '— Clan full; show disabled \"Clan is full\" button');\n\t * } else {\n\t * const label = clan.entry_fee_amount === 0 || clan.entry_fee_currency_type_id === 3\n\t * ? 'Join free'\n\t * : `Join (${clan.entry_fee_amount} ${['Points','Gems','Diamonds'][clan.entry_fee_currency_type_id]})`;\n\t * console.log('[smartico] clan', clan.clan_id, '— render enabled Join button labelled', label);\n\t * }\n\t * }\n\t *\n\t * // After a successful joinClan(), re-call getClans manually — no push refresh.\n\t * // const r = await window._smartico.api.joinClan(targetClanId);\n\t * // if (r.errCode === 0) await window._smartico.api.getClans();\n\t * ```\n\t */\n\tpublic async getClans({ onUpdate }: { onUpdate?: (data: TClans) => void } = {}): Promise<TClans> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Clans, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.Clans,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.clansGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full detail of a single clan — adds the ranked\n\t * `members[]` roster and a fresh `cooldown_until` on top of the same\n\t * fields exposed on a `TClan` list entry. Use this to power a clan\n\t * detail screen / popup after the user picks an item from\n\t * {@link getClans}.\n\t *\n\t * Each call is a fresh server round-trip — there is no client cache\n\t * and no push event refreshes detail state. Re-call to refresh.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `clanId` (typically read from\n\t * `TClans.clans[i].clan_id` returned by {@link getClans}). The\n\t * method works standalone — `getClans()` is not required first —\n\t * but is the only stable source of valid IDs.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call sends a network request.\n\t * - **No push event** refreshes the detail. Member-join, kick, or\n\t * contribution-score changes require a fresh `getClanInfo` call.\n\t *\n\t * **Returned shape — beyond `TClan`**\n\t * `TClanInfo` adds two things on top of the same identity / capacity\n\t * / fee / rating fields you'd see on a `TClan` list entry:\n\t * 1. A ranked `members[]` array — each entry carries `user_id`,\n\t * `public_username`, `avatar_id` / `avatar_real_id`, the resolved\n\t * `avatar_url`, the member's `position` (rank within this clan),\n\t * `contribution_score`, the `is_me` flag identifying the current\n\t * user's row, and the optional `clean_ext_user_id`. The server\n\t * orders members by score DESC (i.e. `position` ASC); no\n\t * client-side re-sort is required.\n\t * 2. A fresh `cooldown_until` on the clan info itself. This is the\n\t * SAME user-level cooldown as `TClans.cooldown_until` (the\n\t * cooldown is global to the user, not per clan) — but `getClans`\n\t * returns a value cached for up to 30 s while `getClanInfo`\n\t * always returns the current value. If the list-cached cooldown\n\t * has just expired, this detail call will reflect it first.\n\t *\n\t * **Username display**: in the default Smartico UI, member rows use\n\t * `public_username`. Some surfaces (e.g. the tournament clan\n\t * drill-down) prefer `clean_ext_user_id` as the primary display\n\t * with `public_username` as fallback — pick the convention that\n\t * matches your product's identity model.\n\t *\n\t * **Idempotency**: safe. Read-only.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClanInfo`](../../docs/ui/clans/UIGuide_getClanInfo.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param clanId The clan ID from `TClans.clans[i].clan_id`.\n\t * @returns Promise resolving to `TClanInfo`. Rejects if the\n\t * clan ID is invalid or the user lacks visibility\n\t * for it.\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans();\n\t * const clan = result.clans[0];\n\t *\n\t * console.log('[smartico] loading detail for clan', clan.clan_id);\n\t * const detail = await window._smartico.api.getClanInfo(clan.clan_id);\n\t *\n\t * console.log('[smartico] render detail with', detail.members.length, 'members');\n\t *\n\t * // Find current user's row to power a sticky \"me\" footer.\n\t * const meRow = detail.members.find(m => m.is_me);\n\t * if (meRow) {\n\t * console.log('[smartico] current user rank in this clan:', meRow.position,\n\t * 'contribution:', meRow.contribution_score, '— render sticky my-member footer');\n\t * }\n\t *\n\t * // Resolve Join CTA state using the detail's cooldown (always fresh).\n\t * const isMyClan = detail.clan_id === result.user_clan_id;\n\t * const inCooldown = detail.cooldown_until != null;\n\t * const isFull = detail.member_count >= detail.capacity_limit;\n\t * if (isMyClan) {\n\t * console.log('[smartico] this is the user\\'s clan — render disabled \"Your clan\" button');\n\t * } else if (inCooldown) {\n\t * const ends = new Date(detail.cooldown_until + 'Z');\n\t * console.log('[smartico] user is in clan-switch cooldown until', ends.toLocaleString(),\n\t * '— render disabled cooldown button');\n\t * } else if (isFull) {\n\t * console.log('[smartico] clan is full — render disabled \"Clan is full\" button');\n\t * } else {\n\t * console.log('[smartico] joinable — render enabled Join button');\n\t * }\n\t * ```\n\t */\n\tpublic async getClanInfo(clanId: number): Promise<TClanInfo> {\n\t\treturn this.api.clansGetInfoT(this.userExtId, clanId);\n\t}\n\n\t/**\n\t * Joins (or switches into) a clan on behalf of the current user. For\n\t * paid clans (`entry_fee_amount > 0`), the user's balance for the\n\t * matching currency is debited synchronously before the response\n\t * returns. If the user is already in a clan, this is treated as an\n\t * atomic clan-switch (deactivate old membership + insert new + debit\n\t * fee, all in one transaction — the user is never observably\n\t * clanless).\n\t *\n\t * A successful response (`errCode === 0`) means: membership is\n\t * persisted, the fee (if any) has been debited, the user's\n\t * switch-cooldown has restarted, and a clan-joined CRM event has\n\t * fired server-side.\n\t *\n\t * @remarks\n\t * **Result shape note**: `TClanJoinResult` uses `errCode` / `errMsg`\n\t * (camelCase) — different from most other SDK result types in this\n\t * library which use `err_code` / `err_message` (snake_case). Branch\n\t * on the camelCase keys when reading this method's result.\n\t *\n\t * **Preconditions**\n\t * Read the candidate from {@link getClans} and gate the call on\n\t * `clan.member_count < clan.capacity_limit`, `cooldown_until == null`\n\t * (on the `TClans` payload — the cooldown is user-level, not\n\t * per-clan), and the user's balance for `entry_fee_currency_type_id`\n\t * being at least `entry_fee_amount` (free clans bypass this check).\n\t * The SDK forwards the call unconditionally — calling without\n\t * satisfying these will most likely return one of the error codes\n\t * below.\n\t *\n\t * **Error codes** (in `errCode`, typed as {@link JoinClanErrorCode})\n\t * - `0` (`JOIN_CLAN_OK`) — success; membership persisted, fee\n\t * debited, cooldown restarted.\n\t * - `1000` (`JOIN_CLAN_INVALID_PARAMETERS`) — request body missing\n\t * `clan_id`. Should not occur via the SDK; treat as a programming\n\t * error.\n\t * - `1001` (`JOIN_CLAN_NOT_FOUND`) — clan doesn't exist for this\n\t * label, OR the clan is archived / in draft state. The server\n\t * merges \"missing\" and \"archived\" into this single code. Refresh\n\t * `getClans()` and remove the entry from the UI.\n\t * - `1002` (`JOIN_CLAN_FULL`) — capacity reached between the list\n\t * fetch and the join click (`member_count >= capacity_limit` at\n\t * the server's atomic check). Refresh the list — the button will\n\t * become \"Clan is full\".\n\t * - `1003` (`JOIN_CLAN_INSUFFICIENT_FUNDS`) — insufficient balance\n\t * for the clan's entry fee. A single code covers all three\n\t * currencies (points / gems / diamonds); read\n\t * `clan.entry_fee_currency_type_id` to identify which currency\n\t * the user is short on. Show an insufficient-balance UI naming\n\t * the deficit.\n\t * - `1004` (`JOIN_CLAN_SEGMENT_MISMATCH`) — user does not meet the\n\t * clan's entry segment or numeric conditions. There is no\n\t * client-side pre-guard for this — surface a gating message.\n\t * - `1005` (`JOIN_CLAN_USER_IS_NOT_IN_CLAN`) — this method NEVER\n\t * returns `1005`. The code is shared with the tournament\n\t * registration error space and fires only on\n\t * {@link registerInTournament} responses when a clan-based\n\t * tournament requires the user to be in a clan first.\n\t * - `1006` (`JOIN_CLAN_COOLDOWN_ACTIVE`) — user is inside the\n\t * switch-cooldown window from a previous clan join (default\n\t * 7 days, configurable per label). Only reachable when the user is\n\t * already in a *different* clan (this call is then a clan switch);\n\t * a first-time join never returns `1006`. Surface the\n\t * `TClans.cooldown_until` expiry in the disabled CTA.\n\t * - `1011` (`JOIN_CLAN_JOINED_AFTER_TOURNAMENT_START`) — this\n\t * method does NOT return `1011` directly. The code fires on\n\t * {@link registerInTournament} responses when the user joined\n\t * their current clan after the tournament started AND already\n\t * has tournament scores.\n\t * - other non-zero — generic server error. Surface `errMsg` if any.\n\t *\n\t * **Idempotency**: NOT safe — and notably dangerous. Calling\n\t * `joinClan` with the user's CURRENT `clanId` does NOT short-circuit\n\t * server-side; the call is treated as a clan-switch to the same\n\t * clan. If the label's cooldown is non-zero (the default), the\n\t * second call returns `1006`. If the cooldown is configured to\n\t * zero, the second call will deduct the entry fee AGAIN, deactivate\n\t * the membership, and re-insert it. The SDK does NOT enforce an\n\t * in-flight lock. Consumers MUST guard the call site against\n\t * double-clicks (set a local \"joining\" flag on click, clear it on\n\t * response) AND short-circuit when the user is already in the\n\t * target clan.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK does NOT automatically refresh the {@link getClans} cache\n\t * after a join. Manually re-call `getClans()` on success to pick up\n\t * the new `user_clan_id`, refreshed `member_count`, and the new\n\t * `cooldown_until` value. Until you do, the cached `TClans` payload\n\t * is stale.\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - Entry-fee currency balance decreases by `entry_fee_amount`\n\t * (visible on the next {@link getUserProfile} refresh / via the\n\t * user-properties update channel).\n\t * - The user's clan membership row is created (or replaced, on a\n\t * switch). `member_count` on the new clan increments by 1; on a\n\t * switch, the old clan's `member_count` decrements by 1 in the\n\t * same transaction.\n\t * - The user's switch-cooldown restarts at the join time (the\n\t * `TClans.cooldown_until` field on the next list fetch reflects\n\t * the new expiry).\n\t * - Server-side CRM analytics fire (clan-joined event, currency-\n\t * deducted event for paid clans). These surface only as\n\t * server-side traces; the SDK consumer observes them indirectly\n\t * via balance / membership refresh.\n\t *\n\t * **UI guidance**: see [UI Guide — `joinClan`](../../docs/ui/clans/UIGuide_joinClan.md).\n\t *\n\t * **Visitor mode**: not supported. The server rejects the request\n\t * for unauthenticated sessions.\n\t *\n\t * @param clanId The clan ID from `TClans.clans[i].clan_id` (or\n\t * `TClanInfo.clan_id`).\n\t * @returns `{ errCode, errMsg }`; success when `errCode === 0`.\n\t * Note camelCase keys (see \"Result shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans();\n\t * const target = result.clans.find(c => c.clan_id === clanId);\n\t *\n\t * if (!target) {\n\t * console.log('[smartico] clan not in current list — refresh getClans and retry');\n\t * return;\n\t * }\n\t * if (target.clan_id === result.user_clan_id) {\n\t * console.log('[smartico] user is already in this clan — short-circuit; do NOT call joinClan again, the server will treat it as a switch and may re-deduct the fee');\n\t * return;\n\t * }\n\t * if (result.cooldown_until) {\n\t * console.log('[smartico] user is in cooldown — disable Join until', new Date(result.cooldown_until + 'Z').toLocaleString());\n\t * return;\n\t * }\n\t * if (target.member_count >= target.capacity_limit) {\n\t * console.log('[smartico] clan is full — disable Join');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] join starting — set in-flight flag, show loading dots on Join button, keep modal open');\n\t * const r = await window._smartico.api.joinClan(target.clan_id);\n\t * console.log('[smartico] join response received — clear in-flight flag');\n\t *\n\t * if (r.errCode === 0) {\n\t * console.log('[smartico] joined successfully — refresh getClans to pick up the new user_clan_id, member_count, and cooldown_until');\n\t * await window._smartico.api.getClans();\n\t * } else if (r.errCode === 1002) {\n\t * console.error('[smartico] clan is full — refresh list, hide the Join CTA on the now-full clan');\n\t * } else if (r.errCode === 1003) {\n\t * const currencyLabel = ['points', 'gems', 'diamonds'][target.entry_fee_currency_type_id] ?? 'currency';\n\t * console.error('[smartico] insufficient', currencyLabel, '— need', target.entry_fee_amount);\n\t * } else if (r.errCode === 1004) {\n\t * console.error('[smartico] user does not meet segment / entry conditions — show a gating message');\n\t * } else if (r.errCode === 1006) {\n\t * console.error('[smartico] cooldown active — surface the cooldown_until from getClans:', result.cooldown_until);\n\t * } else if (r.errCode === 1001) {\n\t * console.error('[smartico] clan not found or archived — refresh list and remove from UI');\n\t * } else {\n\t * console.error('[smartico] join failed — show a generic error toast with this message:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async joinClan(clanId: number): Promise<TClanJoinResult> {\n\t\treturn this.api.clanJoin(this.userExtId, clanId);\n\t}\n\n\tprotected async updateClans() {\n\t\tconst payload = await this.api.clansGetListT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Clans, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tJackpotDetails,\n\tJackpotPot,\n\tJackpotWinnerHistory,\n\tJackpotsOptinResponse,\n\tJackpotsOptoutResponse,\n} from '../Jackpots';\nimport { IntUtils } from '../IntUtils';\nimport { TGetJackpotEligibleGamesResponse } from '../Jackpots/GetJackpotEligibleGamesResponse';\nimport {\n\tJACKPOT_TEMPLATE_CACHE_SEC,\n\tJACKPOT_POT_CACHE_SEC,\n\tJACKPOT_WINNERS_CACHE_SEC,\n\tJACKPOT_ELIGIBLE_GAMES_CACHE_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIClans } from './WSAPIClans';\n\n/** @group Jackpots */\nexport class WSAPIJackpots extends WSAPIClans {\n\n\t/** @hidden */\n\tprotected jackpotGetSignature: string = '';\n\tprotected async jackpotClearCache() {\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Jackpots);\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.JackpotWinners);\n\t}\n\n\t/**\n\t * Returns the user-eligible jackpots active for the label, fused with their live\n\t * pot values. Each entry carries the static template (name, description, opt-in\n\t * state, eligible games, currency) plus a freshly-fetched `pot` snapshot.\n\t *\n\t * Designed to be polled at high frequency (every 1 second is fine) — the SDK\n\t * splits the response into a 30-second template cache and a 1-second pot-value\n\t * cache so consumers can render a live-counting pot amount without hammering\n\t * the server for the static template data.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls.\n\t * - Visitor mode supported via `_smartico.vapi(lang).jackpotGet(...)`.\n\t *\n\t * **Server-side eligibility filtering**\n\t * Jackpots are filtered server-side by the user's segments before being\n\t * returned. Templates the user is ineligible for never appear in this\n\t * response — there is no \"locked\" state to render. An empty result for a\n\t * known-good user typically means none of the configured templates match\n\t * the user's segments / level / brand.\n\t *\n\t * **Filter behavior**\n\t * Passing `related_game_id` returns only jackpots linked to that game (from\n\t * the operator's games catalog). Passing `jp_template_id` returns just that\n\t * single template. With no filter, all active templates the user is\n\t * eligible for are returned. Changing the filter between calls flushes both\n\t * the template cache and the pot cache.\n\t *\n\t * **Two-tier cache**\n\t * - Template definitions: 30 s cache. Re-fetched on filter change or when\n\t * opt-in / opt-out / a jackpot-win push lands.\n\t * - Pot values: 1 s cache. Re-fetched on every call past the 1-second\n\t * window so a 1 Hz poll renders a smoothly counting pot.\n\t *\n\t * **`jp_public_meta.custom_data`**\n\t * Server returns this as a JSON-encoded string; the SDK parses it inline so\n\t * consumers always receive either a parsed object or the raw string.\n\t *\n\t * **Personal vs MultiUser jackpots** (see {@link JackpotType})\n\t * - `MultiUser` (1) — shared pot; `registration_count` reflects real opted-in\n\t * user count; temperature transitions fire push events.\n\t * - `Personal` (2) — independent per-user pot; `registration_count` is\n\t * always 1; temperature push events are suppressed.\n\t *\n\t * **Refresh**\n\t * - `jp_status_id`, segment changes, and operator template edits surface\n\t * after the 30 s template cache TTL.\n\t * - Opt-in / opt-out / jackpot-win push events all clear the template and\n\t * pot caches — the next call re-fetches.\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotGet`](../../docs/ui/jackpots/UIGuide_jackpotGet.md).\n\t *\n\t * @param filter Optional filter narrowing the result set.\n\t * @param filter.related_game_id Limit to jackpots linked to this game ID\n\t * (from the operator's games catalog).\n\t * @param filter.jp_template_id Limit to a single template.\n\t * @returns Array of {@link JackpotDetails} — empty if the user is eligible\n\t * for no active jackpots.\n\t *\n\t * @example\n\t * ```ts\n\t * // Poll every second for live pot counter\n\t * setInterval(async () => {\n\t * const jackpots = await window._smartico.api.jackpotGet();\n\t * for (const jp of jackpots) {\n\t * console.log('[smartico] update pot widget for', jp.jp_public_meta.name, '— amount:', jp.pot.current_pot_amount_user_currency, jp.user_currency, '— temperature:', jp.pot.current_pot_temperature);\n\t * }\n\t * }, 1000);\n\t *\n\t * // Filtered fetch for a specific game tile\n\t * const linked = await window._smartico.api.jackpotGet({ related_game_id: 'gold-slot2' });\n\t * console.log('[smartico] linked jackpots for game:', linked.length);\n\t * ```\n\t */\n\tpublic async jackpotGet(filter?: { related_game_id?: string; jp_template_id?: number }): Promise<JackpotDetails[]> {\n\t\tconst signature: string = `${filter?.jp_template_id}:${filter?.related_game_id}`;\n\n\t\tif (signature !== this.jackpotGetSignature) {\n\t\t\tthis.jackpotGetSignature = signature;\n\t\t\tthis.jackpotClearCache();\n\t\t}\n\n\t\tlet jackpots: JackpotDetails[] = [];\n\t\tlet pots: JackpotPot[] = [];\n\n\t\tjackpots = await OCache.use<JackpotDetails[]>(\n\t\t\tonUpdateContextKey.Jackpots,\n\t\t\tECacheContext.WSAPI,\n\t\t\tasync () => {\n\t\t\t\tconst _jackpots = await this.api.jackpotGet(this.userExtId, filter);\n\t\t\t\tif (!_jackpots?.items) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tconst _pots = _jackpots.items.map((jp) => jp.pot);\n\n\t\t\t\t_jackpots.items.forEach((jp) => {\n\t\t\t\t\tjp.jp_public_meta.custom_data = IntUtils.JsonOrText(jp.jp_public_meta.custom_data);\n\t\t\t\t});\n\n\t\t\t\tOCache.set(onUpdateContextKey.Pots, _pots, ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);\n\t\t\t\treturn _jackpots.items;\n\t\t\t},\n\t\t\tJACKPOT_TEMPLATE_CACHE_SEC,\n\t\t);\n\n\t\tif (jackpots.length > 0) {\n\t\t\tpots = await OCache.use<JackpotPot[]>(\n\t\t\t\tonUpdateContextKey.Pots,\n\t\t\t\tECacheContext.WSAPI,\n\t\t\t\tasync () => {\n\t\t\t\t\tconst jp_template_ids = jackpots.map((jp) => jp.jp_template_id);\n\t\t\t\t\treturn (await this.api.potGet(this.userExtId, { jp_template_ids })).items;\n\t\t\t\t},\n\t\t\t\tJACKPOT_POT_CACHE_SEC,\n\t\t\t);\n\t\t}\n\n\t\treturn jackpots.map((jp) => {\n\t\t\tlet _jp: JackpotDetails = {\n\t\t\t\t...jp,\n\t\t\t\tpot: pots.find((p) => p.jp_template_id === jp.jp_template_id),\n\t\t\t};\n\t\t\treturn _jp;\n\t\t});\n\t}\n\n\t/**\n\t * Opts the authenticated user into a jackpot. From this point on, the user\n\t * contributes to the pot (per the template's `contribution_type` and\n\t * `contribution_value`) and is eligible to win when the pot explodes.\n\t *\n\t * On success the SDK clears the jackpot caches — the next\n\t * {@link jackpotGet} call returns the updated `is_opted_in: true` and an\n\t * incremented `registration_count`.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t * - The jackpot must currently be active and the user must be in its\n\t * eligibility segment. Ineligible jackpots are filtered out of\n\t * {@link jackpotGet} entirely, so a card the user sees is opt-in-able.\n\t *\n\t * **Error handling**\n\t * The server returns a non-zero `errCode` with a human-readable `errMsg`\n\t * for any failure. Common causes:\n\t * - User is in a control group.\n\t * - Jackpot template is not active (status changed since the user opened\n\t * the card).\n\t * - User is already opted in (the SDK has no client-side guard against a\n\t * double-tap; the server enforces).\n\t * - DB race / generic server error.\n\t *\n\t * The SDK does NOT enumerate distinct numeric codes for each cause — branch\n\t * on `errCode === 0` for success and surface `errMsg` as-is for failures.\n\t *\n\t * **Idempotency / re-opt-in semantics**\n\t * - **Already opted in** → returns non-zero `errCode` (\"User already opted in\").\n\t * - **Previously opted in then opted out** → succeeds silently; the server\n\t * re-activates the registration. This is not an error path — a user can\n\t * freely cycle opt-in / opt-out.\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears the template, pot, and winners caches.\n\t * - The next {@link jackpotGet} call returns `is_opted_in: true` for this\n\t * template.\n\t *\n\t * **Side effects**\n\t * Fires a `JACKPOT_OPT_IN` engagement event (visible to operator-side\n\t * automation rules). Does NOT immediately move points / gems — contributions\n\t * happen per-bet via the user's gameplay, not on opt-in.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotOptIn`](../../docs/ui/jackpots/UIGuide_jackpotOptIn.md).\n\t *\n\t * @param filter.jp_template_id ID of the jackpot template to join.\n\t * @returns {@link JackpotsOptinResponse} — `errCode === 0` on success.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.jackpotOptIn({ jp_template_id: 42 });\n\t *\n\t * if (r.errCode === 0) {\n\t * console.log('[smartico] opted in — refresh jackpot card to show opt-out CTA');\n\t * } else {\n\t * console.error('[smartico] opt-in failed — show this message in an error toast:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async jackpotOptIn(filter: { jp_template_id: number }): Promise<JackpotsOptinResponse> {\n\t\tif (!filter.jp_template_id) {\n\t\t\tthrow new Error('jp_template_id is required in jackpotOptIn');\n\t\t}\n\n\t\tconst result = await this.api.jackpotOptIn(this.userExtId, filter);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Opts the authenticated user out of a jackpot. From this point on the user\n\t * no longer contributes to the pot and is not eligible to win.\n\t *\n\t * The user can re-join later via {@link jackpotOptIn} — opt-out is not\n\t * permanent.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t *\n\t * **Error handling**\n\t * The server returns a non-zero `errCode` with a human-readable `errMsg` for\n\t * any failure. Common causes:\n\t * - User has never opted in OR is already opted out — server returns\n\t * non-zero `errCode` for the \"already opted out\" case. Calling opt-out\n\t * on a jackpot the user has never registered for typically returns\n\t * success (the server finds no registration row to update).\n\t * - DB race / generic server error.\n\t *\n\t * Unlike {@link jackpotOptIn}, opt-out does NOT check the template's status\n\t * — the user can opt out of a jackpot that has been deactivated by the\n\t * operator.\n\t *\n\t * **Idempotency**\n\t * - First opt-out → success.\n\t * - Second opt-out → non-zero `errCode` (\"Already opted out\").\n\t * - Opt-out of a never-joined jackpot → typically succeeds silently\n\t * (no registration row to act on).\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears the template, pot, and winners caches.\n\t * - The next {@link jackpotGet} call returns `is_opted_in: false` for this\n\t * template and a decremented `registration_count`.\n\t *\n\t * **Side effects**\n\t * Fires a `JACKPOT_OPT_OUT` engagement event for operator-side automation\n\t * rules. The user's existing contributions to the current pot remain in\n\t * place — opt-out stops future contributions but does not refund past ones.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotOptOut`](../../docs/ui/jackpots/UIGuide_jackpotOptOut.md).\n\t *\n\t * @param filter.jp_template_id ID of the jackpot template to leave.\n\t * @returns {@link JackpotsOptoutResponse} — `errCode === 0` on success.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.jackpotOptOut({ jp_template_id: 42 });\n\t *\n\t * if (r.errCode === 0) {\n\t * console.log('[smartico] opted out — refresh jackpot card to show join CTA');\n\t * } else {\n\t * console.error('[smartico] opt-out failed — show this message in an error toast:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async jackpotOptOut(filter: { jp_template_id: number }): Promise<JackpotsOptoutResponse> {\n\t\tif (!filter.jp_template_id) {\n\t\t\tthrow new Error('jp_template_id is required in jackpotOptOut');\n\t\t}\n\n\t\tconst result = await this.api.jackpotOptOut(this.userExtId, filter);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns past winners of a specific jackpot template, paginated. Use to\n\t * power a \"Recent winners\" panel inside the jackpot detail modal.\n\t *\n\t * **Important**: respect the `expose_winners_over_api` flag on the jackpot's\n\t * {@link JackpotDetails} before calling this method. The server-side handler\n\t * does NOT enforce that flag — it is a UI-only gate. Custom UIs that ignore\n\t * the flag will display winners the operator intended to keep private.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t * - The consumer SHOULD check\n\t * {@link JackpotDetails.expose_winners_over_api} before calling, since\n\t * the server does not enforce it.\n\t *\n\t * **Pagination**\n\t * Server default page size is 20. Pass `limit` and `offset` to paginate\n\t * (e.g. infinite-scroll). The wire response carries a `has_more` flag, but\n\t * this SDK method returns only the `winners` array — detect end-of-list by\n\t * a returned array shorter than `limit`.\n\t *\n\t * **Currency caveat**\n\t * Winner amounts in the response (`winner.winning_amount_jp_currency`) are\n\t * in the jackpot's NATIVE currency, NOT the user's wallet currency. If a\n\t * user-currency display is needed, the consumer must convert client-side.\n\t *\n\t * **Refresh**\n\t * - The SDK caches per `jp_template_id` for 30 seconds.\n\t * - Caches clear on jackpot-win push events and on opt-in / opt-out.\n\t *\n\t * **Error handling**\n\t * Non-zero `errCode` on control-group users or generic server errors. The\n\t * SDK does NOT enumerate distinct codes — branch on `errCode === 0` and\n\t * surface `errMsg` on failure.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getJackpotWinners`](../../docs/ui/jackpots/UIGuide_getJackpotWinners.md).\n\t *\n\t * @returns Array of {@link JackpotWinnerHistory} entries newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const [jp] = await window._smartico.api.jackpotGet({ jp_template_id: 42 });\n\t *\n\t * if (!jp || !jp.expose_winners_over_api) {\n\t * console.log('[smartico] winners hidden by operator config — hide the winners tab');\n\t * return;\n\t * }\n\t *\n\t * const winners = await window._smartico.api.getJackpotWinners({\n\t * jp_template_id: 42,\n\t * limit: 20,\n\t * offset: 0,\n\t * });\n\t * console.log('[smartico] render', winners.length, 'recent winner rows (amounts in', jp.jp_currency + ')');\n\t * ```\n\t */\n\tpublic async getJackpotWinners({\n\t\tlimit,\n\t\toffset,\n\t\tjp_template_id,\n\t}: {\n\t\t/** Page size (default 20). */\n\t\tlimit?: number;\n\t\t/** Pagination offset (default 0). */\n\t\toffset?: number;\n\t\t/** Jackpot template ID (required). */\n\t\tjp_template_id?: number;\n\t}): Promise<JackpotWinnerHistory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.JackpotWinners + jp_template_id,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getJackpotWinnersT(this.userExtId, limit, offset, jp_template_id),\n\t\t\tJACKPOT_WINNERS_CACHE_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the casino games eligible to contribute to a specific jackpot —\n\t * the catalog the user must play to grow the pot. Use to power an\n\t * \"Eligible games\" carousel inside the jackpot detail modal.\n\t *\n\t * **Shortcut**: when the jackpot's\n\t * {@link JackpotDetails.ach_related_game_allow_all} flag is `true`, every\n\t * game in the operator catalog contributes — there's no point calling this\n\t * method (the result would be the full catalog). The default Smartico UI\n\t * hides the Eligible Games tab entirely in that case.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory.\n\t *\n\t * **`onUpdate` caveat**\n\t * The `onUpdate` callback is accepted to match the SDK's subscription\n\t * contract but is NOT auto-invoked by any current server push. It will only\n\t * fire if a consumer (or a future SDK version) explicitly pushes an update.\n\t * Treat it as a no-op for now.\n\t *\n\t * **Refresh**\n\t * - The SDK caches per `jp_template_id` for 30 seconds.\n\t * - Cache does NOT clear on opt-in / opt-out / jackpot-win — eligible-game\n\t * lists rarely change during a session. Wait for the 30 s TTL.\n\t *\n\t * **Error handling**\n\t * Non-zero `errCode` on control-group users or generic server errors.\n\t * Branch on `errCode === 0` and surface `errMsg` on failure.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getJackpotEligibleGames`](../../docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md).\n\t *\n\t * @returns {@link TGetJackpotEligibleGamesResponse} —\n\t * `{ eligible_games: JackpotEligibleGame[] }`.\n\t *\n\t * @example\n\t * ```ts\n\t * const [jp] = await window._smartico.api.jackpotGet({ jp_template_id: 42 });\n\t *\n\t * if (jp?.ach_related_game_allow_all) {\n\t * console.log('[smartico] all games eligible — hide the eligible-games tab');\n\t * return;\n\t * }\n\t *\n\t * const r = await window._smartico.api.getJackpotEligibleGames({ jp_template_id: 42 });\n\t * console.log('[smartico] render', r.eligible_games.length, 'eligible game tiles');\n\t * ```\n\t */\n\tpublic async getJackpotEligibleGames({ jp_template_id, onUpdate } : {\n\t\t/** Jackpot template ID (required). */\n\t\tjp_template_id: number,\n\t\t/** Optional callback; not auto-invoked today. */\n\t\tonUpdate?: () => void,\n\t}): Promise<TGetJackpotEligibleGamesResponse> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.JackpotEligibleGames + jp_template_id,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getJackpotEligibleGamesT(this.userExtId, { jp_template_id }),\n\t\t\tJACKPOT_ELIGIBLE_GAMES_CACHE_SEC,\n\t\t);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTRaffle,\n\tTRaffleDraw,\n\tTRaffleDrawRun,\n\tTransformedRaffleClaimPrizeResponse,\n\tTRaffleOptinResponse,\n} from './WSAPITypes';\nimport {\n\tdrawRunHistoryTransform,\n\traffleClaimPrizeResponseTransform,\n\tGetRaffleWonPrizesResponse,\n} from '../Raffle';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIJackpots } from './WSAPIJackpots';\n\n/** @group Raffles */\nexport class WSAPIRaffles extends WSAPIJackpots {\n\tprotected async updateRaffles() {\n\t\tconst payload = await this.api.getRafflesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Raffles, payload);\n\t}\n\n\t/**\n\t * Returns all raffles visible to the current user, each carrying an\n\t * embedded `draws[]` array with per-draw state (current state, ticket\n\t * counts, opt-in status, prize structure). Use this to power a\n\t * raffles lobby screen and to drive per-draw CTAs (opt-in, view\n\t * winners, claim).\n\t *\n\t * The embedded `draws[i]` objects are sufficient for rendering all\n\t * draw cards — winner details with usernames / avatars require a\n\t * follow-up {@link getRaffleDrawRun} call (the embedded form carries\n\t * only `winners_total` / `winners_limit` / `winners_offset` metadata,\n\t * not individual winner rows).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed raffle list (never a\n\t * diff/patch). Each subsequent call to `getRaffles({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. {@link claimRafflePrize} resolves on this connection (any\n\t * response code) — the refreshed list reflects the new\n\t * `has_unclaimed_prize` / `claimed_date` state.\n\t * 2. {@link requestRaffleOptin} resolves on this connection (any\n\t * response code) — the refreshed list reflects the new\n\t * `user_opted_in` state on the affected draw.\n\t *\n\t * Does NOT fire for: server-side draw executions, ticket increments\n\t * (other users earning tickets), or operator-side raffle/draw config\n\t * changes. Those changes surface only on the next cache miss (after\n\t * the 30 s TTL) — poll manually if your UI needs sub-30s freshness\n\t * during an in-progress draw.\n\t *\n\t * **Reading state from the returned raffle**\n\t * - `current_tickets_count` vs `max_tickets_count` drives the\n\t * `ticket_cap_visualization` banner (enum\n\t * {@link RaffleTicketCapVisualization}: `Empty` = no banner,\n\t * `Counter` = show \"X tickets remaining\", `Message` = show\n\t * sold-out message).\n\t * - Within each draw, `current_state`\n\t * ({@link RaffleDrawInstanceState}) buckets the draw into Open\n\t * (accepting tickets), WinnerSelection (currently drawing), or\n\t * Executed (winners selected).\n\t * - `execution_type` ({@link RaffleDrawTypeExecution}) distinguishes\n\t * one-shot (`ExecDate`), repeating (`Recurring`), or special\n\t * one-shot (`Grand`) draws. Recurring draws share a stable\n\t * `draws[i].id` (the schedule definition) across runs — `run_id`\n\t * is the per-execution instance.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout. The server also invalidates\n\t * the SDK cache when a draw executes on the server side.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffles`](../../docs/ui/raffles/UIGuide_getRaffles.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped\n\t * to the brand's public raffles. Per-user fields (`my_tickets_count`,\n\t * `my_last_tickets`, `user_opted_in`) are not meaningful for\n\t * visitors. The `onUpdate` callback is accepted but never fires\n\t * because the mutation methods that trigger it\n\t * ({@link claimRafflePrize}, {@link requestRaffleOptin}) are not\n\t * available / not effective in visitor mode.\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * raffles list after every\n\t * {@link claimRafflePrize} or\n\t * {@link requestRaffleOptin} round-trip\n\t * on this connection.\n\t * @returns Promise resolving to the raffles list.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] raffles refreshed (after claim/optin) — re-render from this array:', refreshed);\n\t * },\n\t * });\n\t *\n\t * for (const raffle of raffles) {\n\t * console.log('[smartico] render raffle', raffle.id, '—', raffle.name, ':', raffle.draws.length, 'draws');\n\t *\n\t * // Bucket draws: active/upcoming first (sorted by execution_ts ASC), then executed last.\n\t * const sorted = [...raffle.draws].sort((a, b) => {\n\t * const aDone = a.current_state === 3; // Executed\n\t * const bDone = b.current_state === 3;\n\t * if (aDone !== bDone) return aDone ? 1 : -1; // executed sink to the bottom\n\t * return a.execution_ts - b.execution_ts;\n\t * });\n\t *\n\t * for (const d of sorted) {\n\t * if (d.requires_optin && !d.user_opted_in && d.is_active && d.current_state !== 3) {\n\t * console.log('[smartico] draw', d.run_id, '— show OPT IN CTA (requires_optin + not yet opted in + still active)');\n\t * }\n\t * if (d.current_state === 3) {\n\t * console.log('[smartico] draw', d.run_id, 'executed — fetch winner details via getRaffleDrawRun');\n\t * }\n\t * }\n\t * }\n\t *\n\t * // For winner detail on an executed draw, call getRaffleDrawRun separately.\n\t * ```\n\t */\n\tpublic async getRaffles({ onUpdate }: { onUpdate?: (data: TRaffle[]) => void } = {}): Promise<TRaffle[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Raffles, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Raffles, ECacheContext.WSAPI, () => this.api.getRafflesT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the full detail of a single raffle draw run — same shape\n\t * as the embedded `TRaffleDraw` in {@link getRaffles}, but populated\n\t * with paginated `prizes[].winners[]` rows including usernames and\n\t * avatars. Use this to render a draw detail / winners screen, or to\n\t * page through the winner list of an executed draw.\n\t *\n\t * Each call is a fresh server round-trip — there is no client cache.\n\t * Re-call to refresh.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass `raffle_id` (the parent raffle's `id`) and `run_id` (the\n\t * specific run instance — `TRaffleDraw.run_id` from\n\t * {@link getRaffles}'s embedded draws). Note that\n\t * `TRaffleDraw.id` is the *schedule_id* (stable across runs of a\n\t * recurring draw) — that's NOT what this method takes; it takes the\n\t * per-instance `run_id`.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call sends a network request.\n\t * - **No push event** refreshes the response. Live winner-list\n\t * updates require a fresh call.\n\t * - The default Smartico UI polls this method on a variable cadence\n\t * while a draw is in flight: every 3 s during `WinnerSelection`,\n\t * every 10 s when the countdown is under 5 minutes, every 30 s\n\t * otherwise.\n\t *\n\t * **Winner pagination**\n\t * `winners_from` / `winners_to` define a half-open range of winner\n\t * indices. The default window is `0–20` (20 winners). The server\n\t * caps the window at 50 rows per call — passing a larger range\n\t * silently truncates. For \"load more\" pagination, advance\n\t * `winners_from` by the prior page size and pass the same\n\t * `winners_to` offset. `winners_total` on the returned\n\t * `TRaffleDraw` is the authoritative total count for pagination.\n\t *\n\t * The current user's own winning rows (if any) are server-sorted\n\t * to the top of the result.\n\t *\n\t * **Throws**\n\t * Both `raffle_id` and `run_id` are required — the SDK throws\n\t * synchronously when either is missing or falsy.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleDrawRun`](../../docs/ui/raffles/UIGuide_getRaffleDrawRun.md).\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * @param props.raffle_id The parent raffle's `id` (from `TRaffle.id`).\n\t * @param props.run_id The draw run instance ID (from\n\t * `TRaffleDraw.run_id`, not `TRaffleDraw.id`).\n\t * @param props.winners_from First winner index to return (0-based).\n\t * Defaults to `0`.\n\t * @param props.winners_to Last winner index (exclusive).\n\t * Defaults to `20`. Server caps the\n\t * window at 50 rows per call.\n\t * @returns Promise resolving to `TRaffleDraw`\n\t * with `prizes[].winners[]` populated\n\t * and `winners_total` set.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t * const draw = raffle.draws.find(d => d.current_state === 3); // Executed\n\t *\n\t * if (!draw) {\n\t * console.log('[smartico] no executed draw — skip detail view');\n\t * return;\n\t * }\n\t *\n\t * // First page of winners.\n\t * const detail = await window._smartico.api.getRaffleDrawRun({\n\t * raffle_id: raffle.id,\n\t * run_id: draw.run_id, // NOTE: run_id, NOT draw.id\n\t * winners_from: 0,\n\t * winners_to: 20,\n\t * });\n\t *\n\t * for (const prize of detail.prizes) {\n\t * console.log('[smartico] prize', prize.name, '— winners on this page:', prize.winners.length);\n\t * const myWin = prize.winners.find(w => w.username === currentUsername); // or another match\n\t * if (myWin) {\n\t * console.log('[smartico] current user won this prize — surface a Claim CTA if not yet claimed');\n\t * }\n\t * }\n\t *\n\t * // Load more — pagination via winners_from / winners_to.\n\t * if ((detail.winners_total ?? 0) > 20) {\n\t * const next = await window._smartico.api.getRaffleDrawRun({\n\t * raffle_id: raffle.id,\n\t * run_id: draw.run_id,\n\t * winners_from: 20,\n\t * winners_to: 40,\n\t * });\n\t * console.log('[smartico] page 2 loaded — append', next.prizes.flatMap(p => p.winners).length, 'winners');\n\t * }\n\t * ```\n\t */\n\tpublic async getRaffleDrawRun(props: { raffle_id: number; run_id: number; winners_from?: number; winners_to?: number }): Promise<TRaffleDraw> {\n\t\tif (!props.raffle_id || !props.run_id) {\n\t\t\tthrow new Error('both raffle_id and run_id are required');\n\t\t}\n\n\t\treturn await this.api.getRaffleDrawRunT(this.userExtId, props.raffle_id, props.run_id, props.winners_from, props.winners_to);\n\t}\n\n\t/**\n\t * Returns the history of past-executed draw runs for a raffle —\n\t * optionally scoped to a single recurring draw schedule. Each row\n\t * is a previously-executed run with its scheduled and\n\t * actual-execution timestamps, the user's win status, and an\n\t * unclaimed-prize flag for surfacing a Claim CTA on history rows.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * `raffle_id` is required. `draw_id` is optional — when omitted,\n\t * the response includes history for ALL draws of the raffle; when\n\t * supplied, it scopes to that one draw's recurring history. The\n\t * `draw_id` to pass is `TRaffleDraw.id` (the schedule_id, stable\n\t * across runs), not `run_id`.\n\t *\n\t * **Server-side filtering**\n\t * Draws configured by the operator to hide their history are\n\t * excluded from the response automatically. Cancelled runs are\n\t * also excluded.\n\t *\n\t * **Sort order**\n\t * Server returns rows by scheduled `execution_ts` descending\n\t * (newest first). No client-side sort required.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call hits the server.\n\t * - **No push event** refreshes the response. Re-call manually to\n\t * pick up newly-executed runs or `has_unclaimed_prize` flips\n\t * after a {@link claimRafflePrize} call.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleDrawRunsHistory`](../../docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned with\n\t * `is_winner` and `has_unclaimed_prize` always `false` for visitors.\n\t *\n\t * @param props.raffle_id The parent raffle's `id` (from `TRaffle.id`).\n\t * Required.\n\t * @param props.draw_id Optional — the draw's schedule_id\n\t * (`TRaffleDraw.id`). When set, scopes the\n\t * history to that one draw's runs. When\n\t * omitted, includes all draws of the raffle.\n\t * @returns Promise resolving to a `TRaffleDrawRun[]`\n\t * ordered newest-first. Empty if no executed\n\t * runs exist.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t *\n\t * // History across all draws of the raffle.\n\t * const allHistory = await window._smartico.api.getRaffleDrawRunsHistory({\n\t * raffle_id: raffle.id,\n\t * });\n\t *\n\t * // Highlight rows where the user has an unclaimed prize.\n\t * const unclaimed = allHistory.filter(r => r.has_unclaimed_prize);\n\t * if (unclaimed.length > 0) {\n\t * console.log('[smartico] surface a \"Claim\" CTA on these', unclaimed.length, 'history rows:', unclaimed.map(r => r.run_id));\n\t * }\n\t *\n\t * // Scoped history of one recurring draw (use draw.id, the schedule_id).\n\t * const oneDrawHistory = await window._smartico.api.getRaffleDrawRunsHistory({\n\t * raffle_id: raffle.id,\n\t * draw_id: raffle.draws[0].id, // schedule_id (stable across recurring runs)\n\t * });\n\t * console.log('[smartico] render history rows for the daily draw — newest first:', oneDrawHistory.length, 'rows');\n\t * ```\n\t */\n\tpublic async getRaffleDrawRunsHistory(props: { raffle_id: number; draw_id?: number }): Promise<TRaffleDrawRun[]> {\n\t\t\n\t\tconst res = await this.api.getRaffleDrawRunsHistory(this.userExtId, props);\n\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\n\t\treturn drawRunHistoryTransform(res);\n\t}\n\n\t/**\n\t * Claims a raffle prize the user has won. Call this when the user\n\t * has a winning row with `should_claim === true` and an unclaimed\n\t * `won_id` (read from a `TRafflePrizeWinner` on a\n\t * {@link getRaffleDrawRun} result, or surfaced by `has_unclaimed_prize`\n\t * on a {@link getRaffleDrawRunsHistory} row that the consumer drills\n\t * into).\n\t *\n\t * On success (`errorCode === 0`), the server records the claim and\n\t * triggers prize delivery through the operator's integration —\n\t * delivery is server-side, not part of this response.\n\t *\n\t * @remarks\n\t * **Result shape note**: this method returns\n\t * `TransformedRaffleClaimPrizeResponse` with `errorCode` /\n\t * `errorMessage` (camelCase full-word) — different from most other\n\t * SDK result types which use `err_code` / `err_message` (snake_case\n\t * short-word). Branch on the camelCase keys when reading this\n\t * method's result.\n\t *\n\t * **Preconditions**\n\t * Pass a `won_id` that identifies an unclaimed winning row for the\n\t * current user. The `won_id` comes from\n\t * `TRafflePrizeWinner.raf_won_id` returned by\n\t * {@link getRaffleDrawRun}.\n\t *\n\t * **Error codes** (in `errorCode`)\n\t * - `0` — success; the claim is recorded and prize delivery is\n\t * queued server-side.\n\t * - `1` — generic claim failure. The `errorMessage` distinguishes\n\t * the specific cause (the server uses one error code for several\n\t * distinct conditions): the prize has already been claimed, the\n\t * `won_id` doesn't match a winning row for this user, or the user\n\t * is in a control group for this raffle. Treat `1` as a retryable\n\t * error if the message suggests a transient condition; treat as\n\t * idempotent success if the message indicates already-claimed\n\t * (the underlying state is what the consumer wants either way —\n\t * the prize is claimed).\n\t * - other non-zero — generic server error. Surface `errorMessage`\n\t * if any.\n\t *\n\t * **Claim window**\n\t * There is no server-enforced claim deadline. Won prizes remain\n\t * claimable indefinitely until the operator archives them.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same\n\t * `won_id` returns `errorCode === 1` with `errorMessage` indicating\n\t * the prize has already been claimed. The SDK does NOT enforce an\n\t * in-flight lock. Guard the call site against double-clicks (set\n\t * a local \"claiming\" flag on click, clear it on response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the raffles cache on every\n\t * response — both success and failure paths fire the `onUpdate`\n\t * callback registered via {@link getRaffles}. After `errorCode === 0`,\n\t * the affected `TRaffleDrawRun.has_unclaimed_prize` (in history)\n\t * and the winner row's `claimed_date` reflect the claim on the next\n\t * refresh.\n\t *\n\t * **Side effects** (on `errorCode === 0`)\n\t * - The winner row's `claimed_date` is set server-side.\n\t * - Prize delivery is queued for the operator's integration to\n\t * process. Balance / bonus / inbox updates that result from the\n\t * delivery arrive through their own channels — not in this\n\t * response.\n\t *\n\t * **Throws**\n\t * `won_id` is required — the SDK throws synchronously when missing\n\t * or falsy.\n\t *\n\t * **UI guidance**: see [UI Guide — `claimRafflePrize`](../../docs/ui/raffles/UIGuide_claimRafflePrize.md).\n\t *\n\t * **Visitor mode**: not meaningfully supported. The SDK does not\n\t * block the call, but visitor sessions have no win history and the\n\t * server will reject it.\n\t *\n\t * @param props.won_id The winning row's `raf_won_id` (from\n\t * `TRafflePrizeWinner` returned by\n\t * {@link getRaffleDrawRun}).\n\t * @returns `{ errorCode, errorMessage? }`; success when\n\t * `errorCode === 0`. Note camelCase keys (see \"Result\n\t * shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const detail = await window._smartico.api.getRaffleDrawRun({\n\t * raffle_id: raffleId,\n\t * run_id: runId,\n\t * });\n\t * const myWin = detail.prizes.flatMap(p => p.winners).find(w => /* user match here *\\/ true);\n\t *\n\t * if (!myWin || !myWin.raf_won_id || myWin.claimed_date) {\n\t * console.log('[smartico] nothing to claim — keep CTA hidden');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — set in-flight flag, show loading dots on the Claim button, keep the modal open');\n\t * const r = await window._smartico.api.claimRafflePrize({ won_id: myWin.raf_won_id });\n\t * console.log('[smartico] claim response received — clear in-flight flag');\n\t *\n\t * if (r.errorCode === 0) {\n\t * console.log('[smartico] claim succeeded — show a success toast; getRaffles onUpdate above will fire with refreshed state; prize delivery happens server-side');\n\t * } else if (r.errorCode === 1 && r.errorMessage?.toLowerCase().includes('already claimed')) {\n\t * console.log('[smartico] prize was already claimed (perhaps from another tab) — treat as success, hide the Claim CTA');\n\t * } else {\n\t * console.error('[smartico] claim failed — surface this error message to the user and allow retry:', r.errorMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async claimRafflePrize(props: { won_id: number }): Promise<TransformedRaffleClaimPrizeResponse> {\n\t\tif (!props.won_id) {\n\t\t\tthrow new Error('won_id is required');\n\t\t}\n\n\t\tconst res = await this.api.claimRafflePrize(this.userExtId, { won_id: props.won_id });\n\t\treturn raffleClaimPrizeResponseTransform(res);\n\t}\n\n\t/**\n\t * Opts the current user into a specific raffle draw run. Required\n\t * for draws where `TRaffleDraw.requires_optin === true` — without\n\t * opt-in, the user's tickets do NOT participate in that run, even\n\t * if they hold tickets for the raffle.\n\t *\n\t * Opt-in is per-run: a recurring draw's next run requires a fresh\n\t * opt-in. The user's `TRaffleDraw.user_opted_in` flag reflects the\n\t * current state for the current run only.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate draw from {@link getRaffles}'s embedded\n\t * `draws[]` and gate the call on\n\t * `requires_optin === true && !user_opted_in && is_active &&\n\t * current_state !== Executed`. Calling without these guards may\n\t * return a non-zero `err_code`.\n\t *\n\t * **Argument mapping** — the three IDs come from different fields:\n\t * - `raffle_id` — the parent raffle's `TRaffle.id`\n\t * - `draw_id` — `TRaffleDraw.id` (schedule_id, stable across runs)\n\t * - `raffle_run_id` — `TRaffleDraw.run_id` (instance ID for this\n\t * specific run)\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the user is opted into this run. Tickets\n\t * collected after the run's `ticket_start_ts` will participate.\n\t * - `1` — generic opt-in failure. The `err_message` distinguishes\n\t * the specific cause: the draw doesn't require opt-in\n\t * (`requires_optin === false`), `raffle_id` doesn't match the\n\t * `draw_id`, the user is already opted in (or the draw has\n\t * completed), or the user is in a control group for this raffle.\n\t * - other non-zero — generic server error. Surface `err_message`.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same\n\t * `raffle_run_id` returns `err_code === 1` with `err_message`\n\t * indicating the user is already opted in. Treat as success in\n\t * the UI — the underlying state is what the consumer wants.\n\t * Guard the call site against double-clicks.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the raffles cache on every\n\t * response and fires the `onUpdate` callback registered via\n\t * {@link getRaffles}. After `err_code === 0`, the affected draw's\n\t * `user_opted_in` flips to `true` on the refreshed list.\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - The user is registered for this run. Tickets earned within\n\t * the run's eligibility window will participate in the draw.\n\t * - No balance change. No CRM-side rewards. Opt-in is a metadata\n\t * operation only.\n\t *\n\t * **Throws**\n\t * `raffle_id`, `draw_id`, and `raffle_run_id` are all required —\n\t * the SDK throws synchronously when any is missing or falsy.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestRaffleOptin`](../../docs/ui/raffles/UIGuide_requestRaffleOptin.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param props.raffle_id The parent raffle's `id`.\n\t * @param props.draw_id The draw's schedule_id (`TRaffleDraw.id`).\n\t * @param props.raffle_run_id The run instance ID (`TRaffleDraw.run_id`).\n\t * @returns `{ err_code, err_message? }`; success\n\t * when `err_code === 0` (treat\n\t * \"already opted in\" as idempotent\n\t * success).\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles({\n\t * onUpdate: (refreshed) => console.log('[smartico] raffles refreshed — re-render', refreshed),\n\t * });\n\t * const raffle = raffles[0];\n\t * const draw = raffle.draws.find(d =>\n\t * d.requires_optin && !d.user_opted_in && d.is_active && d.current_state !== 3\n\t * );\n\t *\n\t * if (!draw) {\n\t * console.log('[smartico] no opt-in-required draw available — keep CTA hidden');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] opt-in starting — set in-flight flag, show loading dots on the Opt-in button');\n\t * const r = await window._smartico.api.requestRaffleOptin({\n\t * raffle_id: raffle.id,\n\t * draw_id: draw.id, // schedule_id, NOT run_id\n\t * raffle_run_id: draw.run_id,\n\t * });\n\t * console.log('[smartico] opt-in response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] opted in successfully — show \"Fully opted in\" state on the draw card; onUpdate above will fire with user_opted_in: true');\n\t * } else if (r.err_code === 1 && r.err_message?.toLowerCase().includes('already opted in')) {\n\t * console.log('[smartico] already opted in (perhaps from another tab) — treat as success, show \"Fully opted in\"');\n\t * } else {\n\t * console.error('[smartico] opt-in failed — surface this error to the user:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestRaffleOptin(props: { raffle_id: number; draw_id: number; raffle_run_id: number }): Promise<TRaffleOptinResponse> {\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\t\tif (!props.draw_id) {\n\t\t\tthrow new Error('draw_id is required');\n\t\t}\n\t\tif (!props.raffle_run_id) {\n\t\t\tthrow new Error('raffle_run_id is required');\n\t\t}\n\n\t\tconst r = await this.api.raffleOptin(this.userExtId, props);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Returns every prize the current user has won within a single raffle —\n\t * across ALL of that raffle's draws, newest-won first — in one paginated\n\t * call. Use this to power a \"my prizes\" screen for a raffle (prize name,\n\t * prize image, the user's name/avatar) without walking\n\t * {@link getRaffleDrawRunsHistory} and then paging\n\t * {@link getRaffleDrawRun}'s per-draw winner lists.\n\t *\n\t * Each row carries its own `raf_won_id`, which IS the `won_id` to pass to\n\t * {@link claimRafflePrize}: a row with `requires_claim === true` and no\n\t * `claimed_date` is directly claimable.\n\t *\n\t * @remarks\n\t * **Authentication required**\n\t * Works only for an identified (logged-in) user. Visitor / anonymous\n\t * sessions are rejected — call this only after identify.\n\t *\n\t * **Preconditions**\n\t * `raffle_id` is required — the SDK throws synchronously when it is\n\t * missing or falsy.\n\t *\n\t * **Coverage & sort order**\n\t * Includes the user's wins from every draw of the raffle — recurring,\n\t * one-shot, and grand draws, across all historical runs. Rows are ordered\n\t * newest-win first; there is no \"unclaimed first\" ordering, so sort\n\t * client-side if you want claimable prizes at the top.\n\t *\n\t * **Pagination**\n\t * `offset` / `limit` page the `won_prizes[]` rows (the SDK defaults to\n\t * `0` / `20`). `total` is the authoritative full count of the user's wins\n\t * for this raffle across all draws — drive \"load more\" from it\n\t * (`offset + won_prizes.length < total`). An `offset` past the end returns\n\t * an empty `won_prizes[]` with the real `total` and `errCode 0` — not an\n\t * error. The server does NOT clamp `limit`, so always pass an explicit,\n\t * sane page size.\n\t *\n\t * **Rate limit**\n\t * The server caps this at roughly 30 calls per minute with a ~5-second\n\t * minimum gap between calls. Fetch on screen open and on explicit \"load\n\t * more\" — don't poll it on a timer.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success. Also returned with an empty `won_prizes[]` and\n\t * `total 0` when the user has no wins, or is not eligible to see this\n\t * raffle.\n\t * - `1` — generic server error; surface `errMsg` if present.\n\t *\n\t * There are no granular codes — an unknown raffle, an ineligible user,\n\t * and \"no wins\" all surface as `errCode 0` with an empty list.\n\t *\n\t * **Reading the result**\n\t * - Null-check `user` before reading it — it is `null` whenever\n\t * `won_prizes` is empty.\n\t * - For the avatar, use `user.avatar_id` (already a full URL for a system\n\t * avatar, otherwise an avatar token to resolve against the widget's\n\t * avatar domain); `user.avatar_url` is always `null`.\n\t * - Render `public_username` as-is (it is server-masked for privacy, e.g.\n\t * `\"32:r*****\"`) and substitute a \"You\" label for the current user.\n\t * - Treat `claimed_date` as the claim flag: `null` until claimed, then\n\t * epoch ms.\n\t *\n\t * **Idempotency / Side effects**: safe and read-only — one-shot promise,\n\t * no client cache, no subscription. The server caches the response\n\t * briefly; a successful {@link claimRafflePrize} invalidates that cache,\n\t * so a follow-up call reflects the new `claimed_date`. This method does\n\t * NOT refresh the {@link getRaffles} list or fire its `onUpdate` — re-call\n\t * manually to pick up newly-won prizes or a `claimed_date` flip.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleWonPrizes`](../../docs/ui/raffles/UIGuide_getRaffleWonPrizes.md).\n\t *\n\t * **Visitor mode**: not supported (see \"Authentication required\").\n\t *\n\t * @param props.raffle_id The parent raffle's `id` (from `TRaffle.id`). Required.\n\t * @param props.offset Zero-based index of the first row to return. Defaults to `0`.\n\t * @param props.limit Page size. Defaults to `20`.\n\t * @returns Promise resolving to {@link GetRaffleWonPrizesResponse}\n\t * (`user`, this page of `won_prizes`, and `total`;\n\t * `errCode 0` on success).\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t *\n\t * // First page of the user's won prizes for this raffle.\n\t * const page = await window._smartico.api.getRaffleWonPrizes({\n\t * raffle_id: raffle.id,\n\t * offset: 0,\n\t * limit: 20,\n\t * });\n\t *\n\t * if (page.errCode !== 0) {\n\t * console.error('[smartico] could not load won prizes — show a retry state:', page.errMsg);\n\t * return;\n\t * }\n\t * if (page.won_prizes.length === 0) {\n\t * console.log('[smartico] no wins in this raffle (or not eligible) — render the empty state');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico]', page.user?.public_username, 'won', page.total, 'prizes total');\n\t * for (const prize of page.won_prizes) {\n\t * console.log('[smartico] render prize card —', prize.public_meta.name, prize.public_meta.image_url);\n\t * if (prize.requires_claim && !prize.claimed_date) {\n\t * console.log('[smartico] show a Claim CTA — on click call claimRafflePrize({ won_id:', prize.raf_won_id, '})');\n\t * }\n\t * }\n\t *\n\t * // Load more.\n\t * if (page.offset + page.won_prizes.length < page.total) {\n\t * const next = await window._smartico.api.getRaffleWonPrizes({\n\t * raffle_id: raffle.id,\n\t * offset: page.offset + page.limit,\n\t * limit: 20,\n\t * });\n\t * console.log('[smartico] appended', next.won_prizes.length, 'more prizes');\n\t * }\n\t * ```\n\t */\n\tpublic async getRaffleWonPrizes(props: { raffle_id: number; offset?: number; limit?: number }): Promise<GetRaffleWonPrizesResponse> {\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\n\t\treturn await this.api.getRaffleWonPrizes(this.userExtId, {\n\t\t\traffle_id: props.raffle_id,\n\t\t\toffset: props.offset ?? 0,\n\t\t\tlimit: props.limit ?? 20,\n\t\t});\n\t}\n}\n","import { SAWSpinsCountPush } from '../MiniGames';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tTMiniGamePlayResult,\n\tTMiniGameTemplate,\n\tTMiniGamePlayBatchResult,\n\tTSawHistory,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIRaffles } from './WSAPIRaffles';\n\n/** @group MiniGames */\nexport class WSAPIMiniGames extends WSAPIRaffles {\n\t/**\n\t * Returns all mini-game templates (\"SAW\" = Spin And Win — the\n\t * umbrella term for wheel-spin, scratch-card, lootbox, gift-box,\n\t * treasure-hunt, plinko, coin-flip, quiz, and several other formats)\n\t * configured for the label. Optionally subscribes to live updates\n\t * via `onUpdate`: the callback fires whenever the user's\n\t * `spin_count` changes, jackpot grows, a manual spin is issued, or\n\t * a spin response lands.\n\t *\n\t * The list is NOT filtered by spin availability — every configured\n\t * template is returned, including ones the user cannot currently\n\t * play. The `visibile_when_can_spin` flag on each template hints\n\t * which to hide in a default lobby view (consumer-side filter).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed template list (never a\n\t * diff/patch). Each subsequent call to `getMiniGames({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. The server pushes a `spin_count` change (campaign award,\n\t * store purchase, BO manual issuance, mission reward).\n\t * 2. Any {@link playMiniGame} or {@link playMiniGameBatch}\n\t * resolves on this connection — the cached array refreshes\n\t * with updated `spin_count`, `jackpot_current`, and any new\n\t * `next_available_spin_ts`.\n\t * 3. Acknowledge responses land (via auto-acknowledge or\n\t * {@link miniGameWinAcknowledgeRequest}).\n\t *\n\t * Jackpot growth is observable on the refreshed `jackpot_current`\n\t * field — the SDK inlines the live value into template `name` /\n\t * `promo_text` / prize `name` via a `{{jackpot}}` template\n\t * substitution at fetch time.\n\t *\n\t * **Game-type variants**\n\t * All twelve `SAWGameType` values (`SpinAWheel`, `ScratchCard`,\n\t * `MatchX`, `GiftBox`, `PrizeDrop`, `Quiz`, `LootboxWeekdays`,\n\t * `LootboxCalendarDays`, `TreasureHunt`, `Voyager`, `Plinko`,\n\t * `CoinFlip`) surface through the same template shape. Most are\n\t * played via {@link playMiniGame}; the exceptions are:\n\t * - `PrizeDrop` — server-push only; the consumer does NOT call\n\t * `playMiniGame`. Prizes arrive via the prize-drop push channel.\n\t * - `MatchX` / `Quiz` — predictions are submitted via a separate\n\t * games server (not this SDK); the SAW spin is fired\n\t * server-internally to deduct the buy-in.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMiniGames`](../../docs/ui/minigames/UIGuide_getMiniGames.md).\n\t *\n\t * **Visitor mode**: supported. Only templates configured with\n\t * `is_visitor_mode = true` in the BO are returned for anonymous\n\t * sessions. Spins from these templates may also be played (visitor\n\t * mode is the one mini-game flow that does support play — see\n\t * {@link playMiniGame} for the visitor-stop semantics).\n\t *\n\t * @param params Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate Callback invoked with the full refreshed\n\t * template array after any spin-count\n\t * change, spin response, or acknowledge\n\t * response on this connection.\n\t * @returns Promise resolving to the template\n\t * array. Empty if no templates are\n\t * visible to the user.\n\t *\n\t * @example\n\t * ```ts\n\t * const games = await window._smartico.api.getMiniGames({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] mini-game templates refreshed — re-render lobby from this array:', refreshed);\n\t * },\n\t * });\n\t *\n\t * // Filter the lobby view per the visibility flag.\n\t * const visible = games.filter(g =>\n\t * !g.visibile_when_can_spin || (g.spin_count && g.spin_count > 0)\n\t * );\n\t *\n\t * for (const g of visible) {\n\t * console.log('[smartico] render game card', g.id, '—', g.name,\n\t * '— type:', g.saw_game_type,\n\t * '— buy-in:', g.saw_buyin_type,\n\t * '— spins available:', g.spin_count ?? 0,\n\t * '— jackpot:', g.jackpot_current, g.jackpot_symbol);\n\t * }\n\t * ```\n\t */\n\tpublic async getMiniGames({ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {}): Promise<\n\t\tTMiniGameTemplate[]\n\t> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, () => this.api.sawGetTemplatesT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns a paginated, newest-first list of the user's past\n\t * mini-game spins — each row carries the won prize ID, the\n\t * client-side `request_id` used for the spin, and a\n\t * server-recorded `is_claimed` flag (`true` if the spin has been\n\t * acknowledged). Optionally filter to a single template via\n\t * `saw_template_id`.\n\t *\n\t * Use this to power a \"My prizes\" / win-history surface, or to\n\t * recover unacknowledged spins (rows with `is_claimed === false`\n\t * carry a `client_request_id` you can pass to\n\t * {@link miniGameWinAcknowledgeRequest}).\n\t *\n\t * @remarks\n\t * **Pagination**\n\t * `limit` defaults to 20, `offset` defaults to 0. Sort order is\n\t * `create_date` DESC (newest first) — no client-side re-sort\n\t * required. For \"load more\" pagination, advance `offset` by the\n\t * page size on each subsequent call.\n\t *\n\t * The underlying protocol carries a `hasMore` boolean on the\n\t * response, but the SDK strips it from the public surface —\n\t * detect end of list when the returned array length is less than\n\t * `limit`.\n\t *\n\t * **`is_claimed` semantics**\n\t * Maps directly to the server's \"acknowledge_date is non-null\"\n\t * state. A spin where the auto-acknowledge fire-and-forget\n\t * succeeded shows `is_claimed: true`; a spin where the\n\t * acknowledge was lost (network drop) or where the user is on an\n\t * explicit-acknowledge flow shows `is_claimed: false` with a\n\t * usable `client_request_id`. A server-side fallback job\n\t * auto-acknowledges stale rows every ~60 seconds — so even\n\t * \"lost\" prizes are eventually delivered without consumer action.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds.\n\t * Cache is invalidated implicitly when a new spin or acknowledge\n\t * response lands.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMiniGamesHistory`](../../docs/ui/minigames/UIGuide_getMiniGamesHistory.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional pagination + filter bag.\n\t * @param params.limit Page size. Defaults to 20.\n\t * @param params.offset Number of rows to skip. Defaults to 0.\n\t * @param params.saw_template_id When set, scopes the history to\n\t * a single template's spins.\n\t *\n\t * @returns Promise resolving to `TSawHistory[]` in newest-first\n\t * order. Empty when the user has no history.\n\t *\n\t * @example\n\t * ```ts\n\t * const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });\n\t *\n\t * // Show unacknowledged spins with a Claim CTA.\n\t * const unacknowledged = history.filter(h => !h.is_claimed);\n\t * console.log('[smartico] surface a \"Claim\" CTA on these', unacknowledged.length, 'history rows:',\n\t * unacknowledged.map(h => h.client_request_id));\n\t *\n\t * // Load-more pagination — advance offset by the prior page size.\n\t * const page2 = await window._smartico.api.getMiniGamesHistory({ limit: 20, offset: 20 });\n\t * console.log('[smartico] page 2 loaded —', page2.length, 'more rows;',\n\t * page2.length < 20 ? 'end of list reached, hide \"Load more\"' : 'keep \"Load more\" visible');\n\t * ```\n\t */\n\n\tpublic async getMiniGamesHistory({\n\t\tlimit,\n\t\toffset,\n\t\tsaw_template_id,\n\t}: {\n\t\tlimit?: number;\n\t\toffset?: number;\n\t\tsaw_template_id?: number;\n\t}): Promise<TSawHistory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.SAWHistory,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getSawWinningHistoryT(this.userExtId, limit, offset, saw_template_id),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Plays one round of a mini-game template — runs the server's\n\t * randomised prize selection, deducts the buy-in cost (if any),\n\t * and returns the won `prize_id`. After the play resolves, the SDK\n\t * automatically fires a server-side acknowledgement on a\n\t * fire-and-forget basis, marking the spin as \"delivered\" so the\n\t * prize takes effect.\n\t *\n\t * Works for all `SAWGameType` values EXCEPT:\n\t * - `PrizeDrop` — prizes arrive server-pushed; do NOT call\n\t * `playMiniGame` for this type.\n\t * - `MatchX` / `Quiz` — prediction submission goes through a\n\t * separate games server; `playMiniGame` is not the entry point.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate template from {@link getMiniGames} and check:\n\t * - `spin_count > 0` for spin-based templates\n\t * (`saw_buyin_type === 'spins'`).\n\t * - Sufficient balance for paid templates — points / gems /\n\t * diamonds from {@link getUserProfile} against\n\t * `buyin_cost_points` / `_gems` / `_diamonds`.\n\t * - `next_available_spin_ts` is in the past (or unset) — the\n\t * server enforces a per-period max-attempts cap.\n\t * - Template is currently in its active period\n\t * (operator-configured `activeFromDate` / `activeTillDate`).\n\t *\n\t * **Error codes** (in `err_code`, typed as {@link SAWSpinErrorCode})\n\t * - `0` (`SAW_OK`) — success; `prize_id` identifies the won prize\n\t * in `template.prizes`.\n\t * - `40001` (`SAW_NO_SPINS`) — user has no spin attempts for a\n\t * spin-based template.\n\t * - `40002` (`SAW_PRIZE_POOL_EMPTY`) — all prize slots in the\n\t * template are depleted.\n\t * - `40003` (`SAW_NOT_ENOUGH_POINTS`) — insufficient points for a\n\t * points-cost template.\n\t * - `40004` (`SAW_FAILED_MAX_SPINS_REACHED`) — per-period\n\t * max-attempts cap reached. The server's\n\t * `first_spin_in_period` value (exposed in\n\t * {@link TMiniGamePlayBatchResult}; not surfaced in the single\n\t * `TMiniGamePlayResult`) marks the period start.\n\t * - `40007` (`SAW_TEMPLATE_NOT_ACTIVE`) — template outside its\n\t * active time window.\n\t * - `40009` (`SAW_NOT_IN_SEGMENT`) — user fails the template's\n\t * visibility segment check, OR (for lootbox variants) the day's\n\t * prize pool is empty.\n\t * - `40011` (`SAW_NO_BALANCE_GEMS`) — insufficient gems.\n\t * - `40012` (`SAW_NO_BALANCE_DIAMONDS`) — insufficient diamonds.\n\t * - `-40001` (`SAW_VISITOR_STOP_SPIN_REQUEST`) — visitor session\n\t * tried to play a non-visitor-mode template. The default UI\n\t * silently stops the game; no prize awarded.\n\t * - other non-zero — generic server error. Surface `err_message`.\n\t *\n\t * **Prize handling**\n\t * On `err_code === 0`, `prize_id` matches an entry in\n\t * `template.prizes`. Look up the prize's `prize_type`\n\t * ({@link MiniGamePrizeTypeName}) to decide UI treatment:\n\t * - `'no-prize'` — the user spun but won nothing (an operator-\n\t * configured \"loss\" slot). Buy-in is still deducted.\n\t * - `'points'` / `'gems-and-diamonds'` / `'spin'` — value\n\t * credited to the user's profile / spin balance; visible on\n\t * the next refresh.\n\t * - `'bonus'` — surfaces via {@link getBonuses}.\n\t * - `'jackpot'` — drains the template's `jackpot_current` to the\n\t * user; resets the accumulator.\n\t * - `'raffle-ticket'` — adds tickets to the relevant raffle.\n\t * - `'mission'` / `'change-level'` — visible via the\n\t * corresponding domain methods.\n\t * - `'manual'` — operator delivers offline.\n\t *\n\t * **Auto-acknowledge**\n\t * The SDK calls the server's acknowledge endpoint immediately\n\t * after the spin response, on a fire-and-forget basis (not\n\t * awaited). This marks the spin as \"delivered\" so prize effects\n\t * take hold. If the auto-acknowledge fails (network drop), the\n\t * spin appears as `is_claimed: false` in\n\t * {@link getMiniGamesHistory}; the consumer can recover it by\n\t * passing the `client_request_id` to\n\t * {@link miniGameWinAcknowledgeRequest}. A server-side fallback\n\t * job auto-acknowledges stale spins every ~60 seconds, so prizes\n\t * are eventually delivered even without consumer action.\n\t *\n\t * **Idempotency**: NOT idempotent. A double-click sends two\n\t * spins and deducts the buy-in twice. The SDK does NOT guard\n\t * against rapid clicks at the public API level — guard the call\n\t * site with an in-flight flag. The server enforces a per-user\n\t * per-template lock that serialises concurrent requests, so two\n\t * simultaneous calls won't be processed in parallel, but they\n\t * will both be processed sequentially (i.e. both deduct).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the templates cache on every\n\t * spin response and fires any `onUpdate` callback registered via\n\t * {@link getMiniGames} or this method. After `err_code === 0`, the\n\t * affected template's `spin_count` / `jackpot_current` /\n\t * `next_available_spin_ts` reflect the new state on the\n\t * refreshed array.\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - Buy-in deducted from the user's balance (points / gems /\n\t * diamonds / spin tickets — depending on `saw_buyin_type`).\n\t * Balance updates flow via the user-properties channel\n\t * (subscribe to {@link getUserProfile} `props_change` to\n\t * observe).\n\t * - Prize value credited per the prize's type (see \"Prize\n\t * handling\" above).\n\t * - A `minigame_attempt` analytics event fires server-side with\n\t * the result status.\n\t *\n\t * **UI guidance**: see [UI Guide — `playMiniGame`](../../docs/ui/minigames/UIGuide_playMiniGame.md).\n\t *\n\t * **Visitor mode**: not supported. Visitor sessions trying to\n\t * spin receive `SAW_VISITOR_STOP_SPIN_REQUEST (-40001)`.\n\t *\n\t * @param template_id The mini-game template ID (from\n\t * `TMiniGameTemplate.id`).\n\t * @param params Optional. Pass an `onUpdate` callback to\n\t * subscribe to subsequent template refreshes.\n\t * @returns `{ err_code, err_message, prize_id }` — success when\n\t * `err_code === 0`. `prize_id` is always populated; look\n\t * it up in `template.prizes` to interpret the prize.\n\t *\n\t * @example\n\t * ```ts\n\t * const games = await window._smartico.api.getMiniGames({\n\t * onUpdate: (refreshed) => console.log('[smartico] templates refreshed — re-render lobby', refreshed),\n\t * });\n\t * const game = games.find(g => g.id === templateId);\n\t *\n\t * if (!game) {\n\t * console.log('[smartico] template not in current list — refresh getMiniGames');\n\t * return;\n\t * }\n\t * if (game.saw_buyin_type === 'spins' && (game.spin_count ?? 0) === 0) {\n\t * console.log('[smartico] no spins available — disable Play button, show \"No spins\" message');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] play starting — set in-flight flag, start game animation (wheel spin / scratch / lootbox open / etc.)');\n\t * const r = await window._smartico.api.playMiniGame(game.id);\n\t * console.log('[smartico] play response received');\n\t *\n\t * if (r.err_code === 0) {\n\t * const prize = game.prizes.find(p => p.id === r.prize_id);\n\t * if (prize?.prize_type === 'no-prize') {\n\t * console.log('[smartico] user lost — animate to the no-prize slot and show \"Better luck next time\" modal');\n\t * } else {\n\t * console.log('[smartico] user won — animate to prize', prize?.name,\n\t * '— show acknowledge modal per template.acknowledge_type;',\n\t * 'getMiniGames onUpdate fires shortly with refreshed spin_count / jackpot');\n\t * }\n\t * } else if (r.err_code === 40004) {\n\t * console.error('[smartico] max spins reached — show countdown to next available spin (use playMiniGameBatch for first_spin_in_period if needed)');\n\t * } else if (r.err_code === -40001) {\n\t * console.log('[smartico] visitor stopped — silently end the game, no prize modal');\n\t * } else {\n\t * console.error('[smartico] play failed — show generic error with this message:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async playMiniGame(\n\t\ttemplate_id: number,\n\t\t{ onUpdate, acknowledge = true }: { onUpdate?: (data: TMiniGameTemplate[]) => void, acknowledge?: boolean } = {},\n\t): Promise<TMiniGamePlayResult> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\tconst r = await this.api.sawSpinRequest(this.userExtId, template_id);\n\t\tif (acknowledge) {\n\t\t\tawait this.api.doAcknowledgeRequest(this.userExtId, r.request_id);\n\t\t}\n\t\tconst o: TMiniGamePlayResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t\tprize_id: r.saw_prize_id,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Manually acknowledges a mini-game spin — marks the spin as\n\t * \"delivered\" so the prize takes effect server-side. Most consumers\n\t * do NOT need to call this method directly; {@link playMiniGame}\n\t * and {@link playMiniGameBatch} auto-acknowledge on success. Use\n\t * this only for recovery scenarios.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - **Lost auto-acknowledge** — when the WebSocket dropped between\n\t * the spin response and the auto-acknowledge fire-and-forget,\n\t * the spin shows `is_claimed: false` in\n\t * {@link getMiniGamesHistory}. Pass that row's\n\t * `client_request_id` here to deliver the prize.\n\t * - **Explicit-acknowledge UI** — for templates configured with\n\t * the `ExplicitAcknowledge` acknowledge type (operator\n\t * decision), the consumer's UI shows a \"Claim\" CTA after the\n\t * prize animation. Click handler calls this method with the\n\t * spin's `client_request_id` rather than auto-acknowledging.\n\t *\n\t * **No-op on already-acknowledged spins**\n\t * The server's acknowledge SQL matches on `acknowledge_date IS\n\t * NULL` — a duplicate call returns successfully with no effect.\n\t *\n\t * **Server-side fallback**\n\t * Even without ever calling this method, a server-side job\n\t * auto-acknowledges stale spins every ~60 seconds — so prizes are\n\t * eventually delivered. The `is_claimed` flag flips on the next\n\t * `getMiniGamesHistory` call after the job runs.\n\t *\n\t * **Idempotency**: safe. Repeated calls have no effect after the\n\t * first.\n\t *\n\t * **Side effects** (on first successful call for an unacknowledged\n\t * spin)\n\t * - Prize value credited per the prize's type (see\n\t * {@link playMiniGame} \"Prize handling\").\n\t * - The spin's `is_claimed` flag flips to `true` on the next\n\t * {@link getMiniGamesHistory} call.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param request_id The `client_request_id` from a `TSawHistory`\n\t * row returned by {@link getMiniGamesHistory}.\n\t *\n\t * @example\n\t * ```ts\n\t * const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });\n\t * const unacknowledged = history.filter(h => !h.is_claimed);\n\t *\n\t * for (const row of unacknowledged) {\n\t * console.log('[smartico] re-acknowledging stale spin', row.client_request_id);\n\t * await window._smartico.api.miniGameWinAcknowledgeRequest(row.client_request_id);\n\t * }\n\t *\n\t * // Re-fetch history to see the updated is_claimed flags.\n\t * const fresh = await window._smartico.api.getMiniGamesHistory({ limit: 20 });\n\t * console.log('[smartico] history after recovery —', fresh.filter(h => !h.is_claimed).length, 'still unacknowledged');\n\t * ```\n\t */\n\tpublic async miniGameWinAcknowledgeRequest(request_id: string) {\n\t\treturn this.api.doAcknowledgeRequest(this.userExtId, request_id);\n\t}\n\n\t/**\n\t * Plays a mini-game template `spin_count` times in one round-trip.\n\t * Returns an array of per-spin results — each independent, each\n\t * with its own error code. Like {@link playMiniGame}, the SDK\n\t * auto-acknowledges every result on a fire-and-forget basis.\n\t *\n\t * Use this when a UI offers \"spin N times\" affordances\n\t * (multi-spin buttons, lootbox open-N flows). The server processes\n\t * each spin independently — there is no atomicity / rollback if\n\t * one fails.\n\t *\n\t * @remarks\n\t * **Result shape note** — `TMiniGamePlayBatchResult` uses\n\t * `errCode` / `errMessage` (camelCase) — DIFFERENT from\n\t * {@link TMiniGamePlayResult} which uses `err_code` / `err_message`\n\t * (snake_case). Branch on the camelCase keys when reading batch\n\t * results.\n\t *\n\t * **Per-spin independence**\n\t * The server iterates the requested spins and calls the prize\n\t * engine once per entry. If spin #2 fails with `SAW_NO_SPINS`,\n\t * spin #3 is still attempted — the server does NOT stop on first\n\t * error and does NOT roll back successful spins. Each\n\t * `results[i].errCode` is independent.\n\t *\n\t * Practical implication: if the user has 3 spins available and\n\t * requests 5, expect results 0-2 with `errCode === 0` and results\n\t * 3-4 with `errCode === SAW_NO_SPINS`.\n\t *\n\t * **Error codes**\n\t * Per-result `errCode` is from {@link SAWSpinErrorCode}. See\n\t * {@link playMiniGame} for the full table; the same codes apply\n\t * per spin.\n\t *\n\t * **`first_spin_in_period` field**\n\t * Populated on results where `errCode === SAW_FAILED_MAX_SPINS_REACHED`\n\t * (40004). The value is the epoch-ms timestamp of the user's\n\t * first spin in the current cooldown period. Compute the\n\t * countdown as:\n\t * `template.max_spins_period_ms - (Date.now() - first_spin_in_period)`.\n\t *\n\t * **`jackpot_amount` field**\n\t * Populated on results where the won prize is a jackpot\n\t * (`prize_type === 'jackpot'`). The amount the user just claimed\n\t * from the template's jackpot accumulator.\n\t *\n\t * **Auto-acknowledge**\n\t * The SDK fires a batch-acknowledge for all `request_id`s after\n\t * the batch response lands — fire-and-forget. Same recovery\n\t * semantics as {@link playMiniGame}: lost acknowledgements\n\t * become recoverable via {@link miniGameWinAcknowledgeRequest}\n\t * per row, and a server-side fallback job auto-acknowledges\n\t * stale spins every ~60 seconds.\n\t *\n\t * **Idempotency**: NOT idempotent. A double-click sends two\n\t * batches. Guard the call site with an in-flight flag.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * Same as {@link playMiniGame} — the templates cache refreshes\n\t * and any `onUpdate` callback registered via {@link getMiniGames}\n\t * fires with the updated `spin_count` / `jackpot_current`.\n\t *\n\t * **Side effects** (per-spin, on `errCode === 0`)\n\t * Same as {@link playMiniGame} — buy-in deducted, prize value\n\t * credited per prize type.\n\t *\n\t * **UI guidance**: see [UI Guide — `playMiniGameBatch`](../../docs/ui/minigames/UIGuide_playMiniGameBatch.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param template_id The mini-game template ID.\n\t * @param spin_count Number of spins to play. The server attempts\n\t * all `spin_count` spins — partial successes\n\t * are normal when the user runs out of\n\t * balance / spins mid-batch.\n\t * @param params Optional. Pass an `onUpdate` callback to\n\t * subscribe to subsequent template refreshes.\n\t * @returns `TMiniGamePlayBatchResult[]` — one entry per requested\n\t * spin, in request order. Note the camelCase `errCode` /\n\t * `errMessage` keys (see \"Result shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const game = (await window._smartico.api.getMiniGames()).find(g => g.id === templateId);\n\t * if (!game) return;\n\t *\n\t * console.log('[smartico] batch play starting — set in-flight flag, animate the chosen N spins sequentially in UI');\n\t * const results = await window._smartico.api.playMiniGameBatch(game.id, 5);\n\t * console.log('[smartico] batch response received — clear in-flight flag');\n\t *\n\t * for (const [i, r] of results.entries()) {\n\t * if (r.errCode === 0) {\n\t * const prize = game.prizes.find(p => p.id === r.saw_prize_id);\n\t * console.log('[smartico] spin', i, 'won:', prize?.name,\n\t * r.jackpot_amount ? '(jackpot: ' + r.jackpot_amount + ')' : '');\n\t * } else if (r.errCode === 40004) {\n\t * const msTillNext = game.max_spins_period_ms! - (Date.now() - (r.first_spin_in_period ?? 0));\n\t * console.log('[smartico] spin', i, 'capped — ' + Math.ceil(msTillNext / 1000) + ' s until next allowed');\n\t * } else {\n\t * console.error('[smartico] spin', i, 'failed —', r.errCode, r.errMessage);\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async playMiniGameBatch(\n\t\ttemplate_id: number,\n\t\tspin_count: number,\n\t\t{ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {},\n\t): Promise<TMiniGamePlayBatchResult[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\tconst response = await this.api.sawSpinBatchRequest(this.userExtId, template_id, spin_count);\n\n\t\tconst request_ids = response.results.map((result) => result.request_id);\n\t\tthis.api.doAcknowledgeBatchRequest(this.userExtId, request_ids);\n\n\t\tconst o: TMiniGamePlayBatchResult[] = response.results.map((result) => ({\n\t\t\terrCode: result.errCode,\n\t\t\terrMessage: result.errMsg,\n\t\t\tsaw_prize_id: result.saw_prize_id,\n\t\t\tjackpot_amount: result.jackpot_amount,\n\t\t\tfirst_spin_in_period: result.first_spin_in_period,\n\t\t}));\n\n\t\treturn o;\n\t}\n\n\tprotected async updateOnSpin(data: SAWSpinsCountPush) {\n\t\tconst templates: TMiniGameTemplate[] = await OCache.use(\n\t\t\tonUpdateContextKey.Saw,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.sawGetTemplatesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t\tconst index = templates.findIndex((t) => t.id === data.saw_template_id);\n\t\tif (index === -1) {\n\t\t\treturn;\n\t\t}\n\t\ttemplates[index].spin_count = data.spin_count;\n\t\tthis.updateEntity(onUpdateContextKey.Saw, templates);\n\t}\n\n\tprotected async reloadMiniGameTemplate() {\n\t\tconst updatedTemplates = await this.api.sawGetTemplatesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Saw, updatedTemplates);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTAvatarDefinition,\n\tTAvatarCustomized,\n\tTAvatarPrompt,\n\tTSetAvatarResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIMiniGames } from './WSAPIMiniGames';\nimport { AvatarCustomizeResponse } from '../Avatars/AvatarCustomizeResponse';\n\n/** @group Avatars */\nexport class WSAPIAvatars extends WSAPIMiniGames {\n\t/**\n\t * Returns the avatar catalog available to the current user — every pre-defined\n\t * avatar configured for the label, with per-user unlock flags (`is_given`, `is_in_use`)\n\t * applied server-side.\n\t *\n\t * The returned `avatar_url` is the absolute CDN URL (the SDK prefixes relative paths\n\t * with the configured avatar domain). AI-customized variants are NOT returned here —\n\t * those live in {@link getAvatarsCustomized}.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - No other prerequisite calls.\n\t *\n\t * **Visibility filter** (consumer-applied)\n\t * Avatars with `hide_until_achieved === true && is_given === false` should be filtered\n\t * out of the grid — they represent surprise unlocks that should remain hidden until\n\t * the user earns them. The default Smartico UI drops these before rendering.\n\t *\n\t * **Lock state** (consumer-applied)\n\t * Lock condition: `!is_given && avatar_source_type_id !== 0`. Free avatars\n\t * (`avatar_source_type_id === 0`) are always selectable; non-free avatars are locked\n\t * until `is_given` flips to true (operator grants via campaign, mission reward, store\n\t * purchase, etc.).\n\t *\n\t * **Sort order**\n\t * Server does NOT pre-sort. Caller must sort by `priority` ascending (lower = first).\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - {@link setAvatar} clears this cache on completion; the next call re-fetches.\n\t * - No push subscription — there is no `onUpdate` callback for avatar methods.\n\t * - When `is_given` flips server-side (e.g. the user earns a new avatar), the change\n\t * surfaces only on the next call after the 30-second cache window expires.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarsList`](../../docs/ui/avatars/UIGuide_getAvatarsList.md).\n\t *\n\t * @returns Array of {@link TAvatarDefinition} — empty array if the feature is disabled\n\t * on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const avatars = await window._smartico.api.getAvatarsList();\n\t *\n\t * // Apply the standard visibility filter and sort.\n\t * const visible = avatars\n\t * .filter((a) => !a.hide_until_achieved || a.is_given)\n\t * .sort((a, b) => a.priority - b.priority);\n\t *\n\t * console.log('[smartico] visible avatars:', visible.length, '— render as a grid');\n\t *\n\t * const active = visible.find((a) => a.is_in_use);\n\t * if (active) {\n\t * console.log('[smartico] currently in use — overlay a checkmark on this card:', active.avatar_real_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getAvatarsList(): Promise<TAvatarDefinition[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarsList,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the user's previously generated AI-customized avatar variants.\n\t *\n\t * Each entry is one AI-generated image derived from a base avatar in the catalog\n\t * (the base is identified by `avatar_real_id` and was originally a\n\t * {@link TAvatarDefinition} from {@link getAvatarsList}). These variants are stored\n\t * server-side under the user record and persist across sessions.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - Has meaning only after at least one successful AI customization run (see below).\n\t * New users get an empty array.\n\t *\n\t * **Where customized avatars come from**\n\t * AI customization is **not** a WebSocket method on this SDK. It is a separate HTTP\n\t * POST to the operator-configured `avatar-customize` endpoint that takes a base avatar\n\t * plus a style prompt from {@link getAvatarPrompts} and returns a generated CDN URL.\n\t * Once that POST resolves successfully, the new variant is persisted and surfaces in\n\t * the next `getAvatarsCustomized()` call. The variant URL can then be passed to\n\t * {@link setAvatar} to activate it.\n\t *\n\t * **Relation to `getAvatarsList`**\n\t * AI variants do NOT appear in {@link getAvatarsList}. Catalog and variants are two\n\t * separate collections — combine them client-side if the UI needs a unified view per\n\t * base avatar.\n\t *\n\t * **Sort order**\n\t * Server does NOT pre-sort. Caller typically sorts by `dt_created` descending to show\n\t * the newest variant first.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - {@link setAvatar} clears this cache on completion.\n\t * - After a successful AI customization POST, the consumer should re-call to surface\n\t * the new variant — the customization endpoint is outside the SDK so the SDK cannot\n\t * auto-invalidate.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarsCustomized`](../../docs/ui/avatars/UIGuide_getAvatarsCustomized.md).\n\t *\n\t * @returns Array of {@link TAvatarCustomized} — empty if the user has never run AI\n\t * customization, or if the feature is disabled on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const variants = await window._smartico.api.getAvatarsCustomized();\n\t *\n\t * // Group by the base avatar so the UI can show \"this base has 3 AI variants\".\n\t * const byBase = new Map<number, typeof variants>();\n\t * for (const v of variants) {\n\t * const list = byBase.get(v.avatar_real_id) ?? [];\n\t * list.push(v);\n\t * byBase.set(v.avatar_real_id, list);\n\t * }\n\t *\n\t * // Newest-first within each base.\n\t * for (const list of byBase.values()) {\n\t * list.sort((a, b) => b.dt_created.localeCompare(a.dt_created));\n\t * }\n\t *\n\t * console.log('[smartico] AI variants by base avatar — render as a carousel under each base');\n\t * ```\n\t */\n\tpublic async getAvatarsCustomized(): Promise<TAvatarCustomized[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarsCustomized,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetCustomizedT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the catalog of AI style prompts available for avatar customization.\n\t *\n\t * Each entry is a \"style\" the user can apply to a base avatar (e.g. \"Cartoon\",\n\t * \"Watercolor\", \"Cyberpunk\"). Prompts carry a cost expressed in points, gems, or\n\t * diamonds — applying a prompt deducts the cost server-side as part of the AI\n\t * generation request.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - No other prerequisite calls. The customization UI typically calls this on demand\n\t * when the user opens the style picker, not on app boot.\n\t *\n\t * **Cost handling**\n\t * Each prompt declares `cost_currency_type_id` (0 = points, 1 = gems, 2 = diamonds)\n\t * and `cost_value` (amount). The deduction happens server-side inside the\n\t * `avatar-customize` HTTP POST (the AI generation request, which is NOT part of this\n\t * SDK). The client should compare `cost_value` against the live balance from\n\t * {@link getUserProfile} to disable prompts the user cannot afford, but the server is\n\t * the source of truth and will reject under-funded requests authoritatively.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - Not invalidated by {@link setAvatar} (prompts are catalog metadata, independent\n\t * of the user's active avatar).\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarPrompts`](../../docs/ui/avatars/UIGuide_getAvatarPrompts.md).\n\t *\n\t * @returns Array of {@link TAvatarPrompt} — empty if the AI customization feature is\n\t * disabled on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const [prompts, profile] = await Promise.all([\n\t * window._smartico.api.getAvatarPrompts(),\n\t * window._smartico.api.getUserProfile(),\n\t * ]);\n\t *\n\t * for (const p of prompts) {\n\t * // The consumer reads the matching balance from profile based on\n\t * // p.cost_currency_type_id (0=points, 1=gems, 2=diamonds).\n\t * console.log('[smartico] prompt', p.name, '— cost', p.cost_value, 'currency_type', p.cost_currency_type_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getAvatarPrompts(): Promise<TAvatarPrompt[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarPrompts,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetPromptsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Activates the specified avatar for the current user. The chosen image becomes the\n\t * profile avatar — any subsequent {@link getUserProfile} call will reflect the new\n\t * `avatar_url`.\n\t *\n\t * Pass `avatar_url` (a {@link TAvatarDefinition.url} from the catalog or a\n\t * {@link TAvatarCustomized.url} from the AI-variant list) plus `avatar_real_id` of the\n\t * base avatar. The server validates ownership before applying — locked avatars are\n\t * rejected.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - `avatar_url` must be non-empty and `avatar_real_id` must be truthy — the SDK\n\t * throws synchronously otherwise (the request never reaches the server).\n\t * - The avatar must exist in the catalog from {@link getAvatarsList} (or be an AI\n\t * variant of a base avatar the user already owns). Free avatars\n\t * (`avatar_source_type_id === 0`) and the user's currently active avatar bypass the\n\t * ownership check; all others require `is_given === true`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; cache is cleared and the profile avatar updates immediately.\n\t * - `1` — avatar not found in the catalog. The `avatar_real_id` doesn't exist for\n\t * this label.\n\t * - `2` — avatar inactive (deactivated by the operator).\n\t * - `3` — outside the avatar's active time window\n\t * (`active_from_date` / `active_till_date`).\n\t * - `4` — user does not own this avatar (it isn't in their `is_given` set and isn't\n\t * a free / default avatar).\n\t * - other non-zero — generic server error; surface `err_message` if present.\n\t *\n\t * The default Smartico UI shows a hardcoded \"Failed to apply avatar\" toast on any\n\t * non-zero `err_code` and does not surface `err_message`. Custom UIs SHOULD branch\n\t * on the code and prefer `err_message` when present (it is the localized server\n\t * string).\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears both the `getAvatarsList` and `getAvatarsCustomized` caches —\n\t * the next call to either returns fresh data with the new `is_in_use` flag set on\n\t * the chosen avatar.\n\t * - The server persists the new avatar URL on the user record; {@link getUserProfile}\n\t * reflects it on the next read in this session.\n\t * - **No push to other open sessions.** A second device / tab the user is logged in\n\t * on will not see the new avatar until it next calls {@link getUserProfile} or\n\t * re-identifies. Plan UI accordingly.\n\t *\n\t * **Idempotency**: safe to retry. Re-applying the same `avatar_real_id` returns\n\t * `err_code: 0` and produces no double side effects (no double-deduction — this\n\t * method does not charge any currency — and no duplicate log entries).\n\t *\n\t * **Side effects**: updates the user's stored `avatar_id` / `avatar_real_id`. Does\n\t * NOT cost points, gems, or diamonds — the cost lives on the separate AI\n\t * customization HTTP flow ({@link getAvatarPrompts}). Does NOT write a user-visible\n\t * entry to {@link getActivityLog}.\n\t *\n\t * **UI guidance**: see [UI Guide — `setAvatar`](../../docs/ui/avatars/UIGuide_setAvatar.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param props.avatar_url Absolute CDN URL of the avatar image. Read from\n\t * {@link TAvatarDefinition.url} for catalog avatars or\n\t * {@link TAvatarCustomized.url} for AI variants.\n\t * @param props.avatar_real_id Numeric ID of the base avatar from\n\t * {@link TAvatarDefinition.avatar_real_id}. For AI\n\t * variants, this is the `avatar_real_id` of the base\n\t * they were derived from.\n\t * @returns {@link TSetAvatarResult} — check `err_code === 0` for success.\n\t *\n\t * @example\n\t * ```ts\n\t * const avatars = await window._smartico.api.getAvatarsList();\n\t * const target = avatars.find((a) => a.avatar_real_id === 7);\n\t *\n\t * if (!target) {\n\t * console.error('[smartico] avatar 7 not in catalog — hide the picker entry');\n\t * return;\n\t * }\n\t *\n\t * const isLocked = !target.is_given && target.avatar_source_type_id !== 0;\n\t * if (isLocked) {\n\t * console.log('[smartico] avatar is locked — show \"earn this first\" prompt instead of calling setAvatar');\n\t * return;\n\t * }\n\t *\n\t * const r = await window._smartico.api.setAvatar({\n\t * avatar_url: target.avatar_url,\n\t * avatar_real_id: target.avatar_real_id,\n\t * });\n\t *\n\t * switch (r.err_code) {\n\t * case 0:\n\t * console.log('[smartico] avatar applied — close picker, refresh header avatar');\n\t * break;\n\t * case 1:\n\t * console.error('[smartico] avatar not in catalog — refresh catalog and show error');\n\t * break;\n\t * case 2:\n\t * console.error('[smartico] avatar inactive — operator disabled it; hide from picker');\n\t * break;\n\t * case 3:\n\t * console.error('[smartico] outside time window — show \"available on X\" message');\n\t * break;\n\t * case 4:\n\t * console.error('[smartico] not owned — show unlock requirements');\n\t * break;\n\t * default:\n\t * console.error('[smartico] avatar apply failed — show generic error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async setAvatar(props: { avatar_url: string; avatar_real_id: number }): Promise<TSetAvatarResult> {\n\t\tif (!props.avatar_url) {\n\t\t\tthrow new Error('avatar_url is required');\n\t\t}\n\t\tif (!props.avatar_real_id) {\n\t\t\tthrow new Error('avatar_real_id is required');\n\t\t}\n\n\t\tconst r = await this.api.avatarSetAvatar(this.userExtId, props.avatar_url, props.avatar_real_id);\n\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsList);\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsCustomized);\n\n\t\treturn {\n\t\t\terr_code: r.errCode ?? 0,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Generates an AI-customized variant of a base avatar by applying an\n\t * operator-defined style prompt, returning the CDN URL of the result.\n\t * This is a paid, generate-only step: it does NOT change the user's\n\t * active avatar — pass the returned `cdn_url` to {@link setAvatar} to\n\t * activate it.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - Authenticated session required; not available in visitor mode (throws).\n\t * - All five fields are mandatory — the SDK throws synchronously\n\t * (`Error(\"<field> is required\")`) if any is missing or zero.\n\t * - `prompt_id` must be one of the prompts from {@link getAvatarPrompts};\n\t * `avatar_url` / `avatar_real_id` identify the base avatar to style.\n\t *\n\t * **Cost**\n\t * Each generation costs the currency the operator configured on the\n\t * chosen prompt (points, gems, or diamonds — some prompts are free; read\n\t * `cost_currency_type_id` / `cost_value` from the {@link getAvatarPrompts}\n\t * entry to gate the UI before calling). The cost is charged only on\n\t * success; if the user can't afford it the call fails with `errCode -1`\n\t * and nothing is generated or charged.\n\t *\n\t * **Latency**\n\t * Generation runs server-side AI image synthesis and is synchronous from\n\t * the caller's side — expect several seconds (roughly 5–20 s) before the\n\t * promise resolves. There is no SDK cache and no push/subscription; show\n\t * a loading state for the full duration and disable the trigger to\n\t * prevent duplicate submissions.\n\t *\n\t * **Result & error codes**\n\t * On success the result has `cdn_url` set; on failure it has `errCode` /\n\t * `errMessage` set and no `cdn_url`. Branch on `errCode` — the generic\n\t * message is fixed text, not cause-specific:\n\t * - `12001` (`AvatarCustomizeErrorCode.AVATAR_USER_LIMIT`) — the user hit\n\t * their monthly per-user generation cap. Nothing is generated or charged.\n\t * - `12002` (`AvatarCustomizeErrorCode.AVATAR_LABEL_LIMIT`) — the brand's\n\t * shared monthly pool is exhausted. Nothing is generated or charged;\n\t * surface a \"try again later\" message.\n\t * - `-1` — generic failure: insufficient balance, an unavailable prompt,\n\t * or a generation error. Nothing is charged. Allow the user to retry.\n\t *\n\t * Both monthly caps are operator-configured and reset at the start of\n\t * each calendar month.\n\t *\n\t * **Side effects (on success)**\n\t * The generated variant is persisted to the user's customization history\n\t * and counts toward the monthly caps **whether or not** it is later\n\t * activated — generation is not reversible. The SDK clears the\n\t * {@link getAvatarsCustomized} cache so the next call surfaces the new\n\t * variant. The user's active avatar is unchanged until you call\n\t * {@link setAvatar} with the returned `cdn_url`.\n\t *\n\t * **Idempotency**: not idempotent — each successful call generates (and\n\t * charges for) a new variant. Guard the call site against double-clicks.\n\t *\n\t * **UI guidance**: see [UI Guide — `avatarsCustomize`](../../docs/ui/avatars/UIGuide_avatarsCustomize.md).\n\t *\n\t * **Visitor mode**: not supported (throws).\n\t *\n\t * @param props.user_id Numeric Smartico user ID.\n\t * @param props.prompt_id Style-prompt ID (`prompt_id`) from {@link getAvatarPrompts}.\n\t * @param props.avatar_url CDN URL of the base avatar to customize.\n\t * @param props.avatar_real_id `avatar_real_id` of the base avatar.\n\t * @returns {@link AvatarCustomizeResponse} — `cdn_url` set on success;\n\t * `errCode` / `errMessage` set on failure.\n\t *\n\t * @example\n\t * ```ts\n\t * // user_id identifies the Smartico user being customized.\n\t * const prompts = await window._smartico.api.getAvatarPrompts();\n\t * const prompt = prompts[0];\n\t *\n\t * console.log('[smartico] generating avatar — show a spinner for ~5-20s and disable the Generate button');\n\t * const result = await window._smartico.api.avatarsCustomize({\n\t * user_id,\n\t * prompt_id: prompt.prompt_id,\n\t * avatar_url: baseAvatar.avatar_url,\n\t * avatar_real_id: baseAvatar.avatar_real_id,\n\t * });\n\t *\n\t * if (result.cdn_url) {\n\t * console.log('[smartico] generation succeeded — preview this URL, then call setAvatar to apply it:', result.cdn_url);\n\t * // await window._smartico.api.setAvatar({ avatar_url: result.cdn_url, avatar_real_id: baseAvatar.avatar_real_id });\n\t * } else if (result.errCode === 12001) {\n\t * console.error('[smartico] user monthly limit reached — show \"you have used all your custom avatars this month\"');\n\t * } else if (result.errCode === 12002) {\n\t * console.error('[smartico] brand monthly pool exhausted — show \"custom avatars are unavailable right now, try later\"');\n\t * } else {\n\t * console.error('[smartico] generation failed (e.g. not enough balance) — let the user retry:', result.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async avatarsCustomize(props: {\n\t\tuser_id: number;\n\t\tprompt_id: number;\n\t\tavatar_url: string;\n\t\tavatar_real_id: number;\n\t}): Promise<AvatarCustomizeResponse> {\n\t\tconst required: (keyof typeof props)[] = ['user_id', 'prompt_id', 'avatar_url', 'avatar_real_id'];\n\t\tfor (const field of required) {\n\t\t\tif (!props[field]) {\n\t\t\t\tthrow new Error(`${field} is required`);\n\t\t\t}\n\t\t}\n\n\t\tconst r = await this.api.avatarsCustomize(props);\n\n\t\t// On success a new variant is persisted server-side — drop the cached\n\t\t// list so the next getAvatarsCustomized() surfaces it.\n\t\tif (r.cdn_url) {\n\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsCustomized);\n\t\t}\n\n\t\treturn r;\n\t}\n}\n","import { GamePickGameInfo, GamePickRequestParams, GamePickRound, GamePickRoundBoard, GamePickRoundRequestParams, GamePickUserInfo, GamesApiResponse } from '../GamePick';\nimport { WSAPIAvatars } from './WSAPIAvatars';\n\n/** @group GamePick */\nexport class WSAPIGamePick extends WSAPIAvatars {\n\t/**\n\t * Returns every open round for a MatchX or Quiz game template, with the full\n\t * event list (matches / questions) and the current user's selections per event.\n\t *\n\t * Use to power the rounds-lobby screen — typically a list of round cards a user\n\t * can tap into to make predictions. For a single round, use\n\t * {@link gamePickGetActiveRound} (lighter payload when only one round is shown).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated.\n\t * - `saw_template_id` must reference a MatchX or Quiz game template. The SDK\n\t * throws synchronously if it's missing.\n\t *\n\t * **Transport**\n\t * Game Pick methods are HTTP REST calls to a separate Game Pick games server\n\t * (not the main WebSocket). One consequence: there is no SDK cache and no push\n\t * subscription — every call is a fresh server roundtrip.\n\t *\n\t * **Round status**\n\t * Each round's `round_status_id` is a {@link GPRoundStatus} value. Rounds with\n\t * status `NoEventsDefined` (1) are filtered out server-side and never appear\n\t * here. Other values: `Other` (-1, normally open), `NoMoreBetsAllowed` (2),\n\t * `AllEventsResolved_ButNotRound` (3), `RoundResolved` (4 — appears here only\n\t * briefly during transition; use {@link gamePickGetHistory} for resolved rounds).\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found (the `saw_template_id` doesn't reference a\n\t * MatchX/Quiz game).\n\t * - `100003` — no open rounds available for this template right now.\n\t * - `100000` — auth hash invalid; SDK session needs re-initialization.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache; every call is live.\n\t * - No push subscription. Poll while the user is on the screen if you need\n\t * live round-status changes (typically every 30–60 s is enough).\n\t *\n\t * **Visitor mode**: not supported. The SDK throws synchronously on visitor\n\t * sessions.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetActiveRounds({ saw_template_id: 1083 });\n\t *\n\t * if (r.errCode !== 0) {\n\t * console.error('[smartico] active rounds fetch failed — show empty rounds lobby:', r.errMessage);\n\t * return;\n\t * }\n\t *\n\t * for (const round of r.data ?? []) {\n\t * console.log('[smartico] render a round card:', round.round_name, '— events:', round.events.length, 'user has placed bet:', round.user_placed_bet);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetActiveRounds(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns a single round (events, user selections, scoring rules) for a\n\t * MatchX or Quiz game. Use to power the round-detail / prediction-input\n\t * screen the user lands on after picking a round from the lobby.\n\t *\n\t * Same shape as one entry of {@link gamePickGetActiveRounds}; cheaper when the\n\t * UI only shows one round at a time.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `round_id` are mandatory — the SDK throws if either\n\t * is missing.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `4` — round / event not found (e.g. round resolved after the last\n\t * `gamePickGetActiveRounds` poll); non-fatal — retry after a fresh active-\n\t * rounds fetch.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache; every call is live.\n\t * - Re-call after {@link gamePickSubmitSelection} or\n\t * {@link gamePickSubmitSelectionQuiz} to surface the persisted predictions.\n\t * - Poll while the user is on the prediction screen if event resolution\n\t * updates are needed (typically every 30–60 s).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetActiveRound`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @param props.round_id ID of the round to fetch.\n\t * @returns Wrapped {@link GamesApiResponse} of a single {@link GamePickRound}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetActiveRound({\n\t * saw_template_id: 1083,\n\t * round_id: 31652,\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * console.log('[smartico] render round detail page —', r.data.round_name, '— user has placed bet:', r.data.user_placed_bet, 'score so far:', r.data.user_score);\n\t * } else {\n\t * console.error('[smartico] round fetch failed — bounce back to the lobby and refresh:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\treturn this.api.gpGetActiveRound(props.saw_template_id, props.round_id);\n\t}\n\n\t/**\n\t * Returns the full round history (active + resolved) for a MatchX or Quiz game\n\t * template, newest-first. Each round carries the user's predictions plus the\n\t * server-resolved outcome on each event.\n\t *\n\t * Use to power a \"Past predictions\" / history tab. For just the open rounds,\n\t * use {@link gamePickGetActiveRounds} (faster — skips resolved data).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Sort order**\n\t * Server returns rounds newest-first. No client-side sort needed.\n\t *\n\t * **Per-event resolution**\n\t * Each event in the rounds carries `resolution_type_id` — values are from\n\t * {@link GamePickResolutionType}: `None` (0, not yet resolved), `Lost` (2),\n\t * `PartialWin` (3), `FullWin` (4). Use these to render result badges on\n\t * each event row.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Re-call when the user opens the history tab.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetHistory`](../../docs/ui/gamepick/UIGuide_gamePickGetHistory.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array,\n\t * newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetHistory({ saw_template_id: 1083 });\n\t *\n\t * for (const round of r.data ?? []) {\n\t * console.log('[smartico] history row —', round.round_name, 'score:', round.user_score, 'resolved:', round.is_resolved);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetGamesHistory(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns the leaderboard for a MatchX or Quiz game round — ranked list of\n\t * players plus the current user's entry (`my_user`). Pass `round_id: -1` for\n\t * the season / overall leaderboard across every round in the template.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **`round_id` semantics**\n\t * - Positive `round_id` — per-round leaderboard scoped to that round's events.\n\t * - `-1` — season / overall leaderboard aggregating scores across every round\n\t * of the template.\n\t *\n\t * **`my_user`**\n\t * The current user's entry is returned separately from the `users[]` array\n\t * — `my_user` may be `null` if the user has never made a prediction on this\n\t * round / template. Use it to render the user's rank in a sticky footer or\n\t * \"you are here\" highlight regardless of pagination.\n\t *\n\t * **Username masking**\n\t * `public_username` on other players may be masked / anonymized by operator\n\t * label settings. Always pair with `avatar_url` so the user can recognize\n\t * themselves in the ranking by avatar even when usernames are hidden.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Poll while the leaderboard is visible\n\t * (every 30–60 s) if you want live rank updates after match\n\t * resolution.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetBoard`](../../docs/ui/gamepick/UIGuide_gamePickGetBoard.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @param props.round_id Round ID, or `-1` for the season leaderboard.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRoundBoard}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetBoard({\n\t * saw_template_id: 1083,\n\t * round_id: -1, // season leaderboard\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * console.log('[smartico] render leaderboard rows for top', r.data.users.length, 'players');\n\t * if (r.data.my_user) {\n\t * console.log('[smartico] pin \"you are rank #' + r.data.my_user.gp_position + '\" footer to bottom');\n\t * } else {\n\t * console.log('[smartico] user not ranked — render \"Play a round to join the leaderboard\" CTA');\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\treturn this.api.gpGetGameBoard(props.saw_template_id, props.round_id);\n\t}\n\n\t/**\n\t * Submits all score predictions for a round in a MatchX game in one shot.\n\t * Each event in the round must carry `team1_user_selection` and\n\t * `team2_user_selection` (the predicted scores).\n\t *\n\t * On the user's FIRST submit for a round, the server charges one buy-in (one\n\t * \"spin\" / one currency deduction based on the template's `saw_buyin_type_id`).\n\t * Subsequent edits within the same round are free and only persist changed\n\t * selections.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if\n\t * either is missing.\n\t * - Each event passed must include `gp_event_id` and the two\n\t * `team{1,2}_user_selection` fields. Missing events default to \"no change\".\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success; the response `data` is the updated round with\n\t * `user_placed_bet === true` and `has_not_submitted_changes === false`.\n\t * - `3` (`NoBetsUpdatedOnSubmit`) — submit produced no changes, OR every event\n\t * is past its `last_bet_date` deadline. The buy-in is NOT consumed; the\n\t * current round is still returned in `data`.\n\t * - `4` — round / event not found; refresh state and retry.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * Buy-in failures pass through the {@link SAWSpinErrorCode} values on first\n\t * submit:\n\t * - `40001` — no spins left (when `saw_buyin_type_id` is Spins).\n\t * - `40003` — insufficient points.\n\t * - `40004` — global max-spins cap hit.\n\t * - `40007` — template outside its active date window.\n\t * - `40009` — user excluded by segment rule.\n\t * - `40011` — insufficient gems.\n\t * - `40012` — insufficient diamonds.\n\t *\n\t * **Idempotency**\n\t * Re-submitting identical selections returns `errCode: 3` (no changes); the\n\t * buy-in is consumed exactly once per round-per-user. Re-submitting after\n\t * `last_bet_date` also returns `errCode: 3` without consuming the buy-in.\n\t *\n\t * **Side effects**\n\t * - First successful submit deducts the buy-in (Points / Gems / Diamonds /\n\t * one Spin) per `saw_buyin_type_id`.\n\t * - Reports a `minigame_matchx_prediction` event to the operator's event log.\n\t * - Updates the round's participant counter (`users_cnt`) and per-event\n\t * counters (`num_users`).\n\t * - Score is awarded after the operator resolves the round\n\t * ({@link GPRoundStatus} = `RoundResolved`).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickSubmitSelection`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX game template.\n\t * @param props.round Round object with `round_id` + `events[]`\n\t * carrying the user's score predictions.\n\t * @returns Wrapped {@link GamesApiResponse} with the updated round.\n\t *\n\t * @example\n\t * ```ts\n\t * const ar = await window._smartico.api.gamePickGetActiveRound({\n\t * saw_template_id: 1190,\n\t * round_id: 38665,\n\t * });\n\t * if (ar.errCode !== 0 || !ar.data) {\n\t * console.error('[smartico] could not fetch round to submit — show error and bounce back');\n\t * return;\n\t * }\n\t *\n\t * const round = ar.data;\n\t * round.events = round.events.map(e => ({\n\t * gp_event_id: e.gp_event_id,\n\t * team1_user_selection: 1,\n\t * team2_user_selection: 0,\n\t * }));\n\t *\n\t * const r = await window._smartico.api.gamePickSubmitSelection({\n\t * saw_template_id: 1190,\n\t * round,\n\t * });\n\t *\n\t * switch (r.errCode) {\n\t * case 0:\n\t * console.log('[smartico] predictions saved — show confirmation, refresh leaderboard');\n\t * break;\n\t * case 3:\n\t * console.log('[smartico] nothing changed (or all events closed) — silent no-op');\n\t * break;\n\t * case 40001:\n\t * case 40003:\n\t * case 40011:\n\t * case 40012:\n\t * console.error('[smartico] insufficient balance / spins — show top-up CTA:', r.errMessage);\n\t * break;\n\t * default:\n\t * console.error('[smartico] submit failed — show generic error toast:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickSubmitSelection(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round?.round_id) {\n\t\t\tthrow new Error('round is required');\n\t\t}\n\t\treturn this.api.gpSubmitSelection(props.saw_template_id, props.round, false);\n\t}\n\n\t/**\n\t * Submits all quiz answers for a round in one shot. Each event in the round\n\t * must carry `user_selection` (the answer value — typically `\"1\"` / `\"2\"` /\n\t * `\"x\"` for 1×2 markets, `\"yes\"` / `\"no\"` for binary markets, or any\n\t * operator-defined string for custom markets).\n\t *\n\t * Same first-submit buy-in behavior as {@link gamePickSubmitSelection} — one\n\t * buy-in is charged on the first successful submit; subsequent edits within\n\t * the same round are free.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if\n\t * either is missing.\n\t * - Each event must include `gp_event_id` and `user_selection`. Missing\n\t * events default to \"no change\".\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `3` (`NoBetsUpdatedOnSubmit`) — no changes, OR every event past\n\t * `last_bet_date`. Buy-in NOT consumed; current round returned in `data`.\n\t * - `4` — round / event not found.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * Buy-in failures use the same {@link SAWSpinErrorCode} pass-through values\n\t * as {@link gamePickSubmitSelection} — see that method's TSDoc for the\n\t * `40001` / `40003` / `40004` / `40007` / `40009` / `40011` / `40012`\n\t * semantics.\n\t *\n\t * **Idempotency**: identical to {@link gamePickSubmitSelection} — re-submit\n\t * returns `errCode: 3` and never double-charges the buy-in.\n\t *\n\t * **Side effects**: identical to {@link gamePickSubmitSelection}, with the\n\t * reported event being `minigame_quiz_prediction` instead of\n\t * `minigame_matchx_prediction`.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickSubmitSelectionQuiz`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md).\n\t *\n\t * @param props.saw_template_id ID of the Quiz game template.\n\t * @param props.round Round object with `round_id` + `events[]`\n\t * carrying the user's answer selections.\n\t * @returns Wrapped {@link GamesApiResponse} with the updated round.\n\t *\n\t * @example\n\t * ```ts\n\t * const ar = await window._smartico.api.gamePickGetActiveRound({\n\t * saw_template_id: 1183,\n\t * round_id: 37974,\n\t * });\n\t * if (ar.errCode !== 0 || !ar.data) {\n\t * console.error('[smartico] could not fetch round to submit answers — show error');\n\t * return;\n\t * }\n\t *\n\t * const round = ar.data;\n\t * round.events = round.events.map(e => ({\n\t * gp_event_id: e.gp_event_id,\n\t * user_selection: 'x',\n\t * }));\n\t *\n\t * const r = await window._smartico.api.gamePickSubmitSelectionQuiz({\n\t * saw_template_id: 1183,\n\t * round,\n\t * });\n\t *\n\t * if (r.errCode === 0) {\n\t * console.log('[smartico] quiz answers saved — show confirmation');\n\t * } else if (r.errCode === 3) {\n\t * console.log('[smartico] nothing changed — silent no-op');\n\t * } else {\n\t * console.error('[smartico] quiz submit failed:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickSubmitSelectionQuiz(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round?.round_id) {\n\t\t\tthrow new Error('round is required');\n\t\t}\n\t\treturn this.api.gpSubmitSelection(props.saw_template_id, props.round, true);\n\t}\n\n\t/**\n\t * Returns the current user's profile within the Game Pick system — display\n\t * name, avatar, balances, and last wallet-sync timestamp. The Game Pick server\n\t * maintains its own user record that mirrors the user's Smartico balances; the\n\t * mirror is updated at most once per minute, so `last_wallet_sync_time` tells\n\t * the consumer how stale the balances on the response are.\n\t *\n\t * On the user's first call for a given game, the Game Pick server lazily\n\t * provisions a user record — so this method doubles as a \"register the user\n\t * with this game\" call.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Balance freshness**\n\t * The balances returned here are the cached mirror — at most ~1 minute stale.\n\t * For an up-to-the-second view of Points / Gems / Diamonds, read from\n\t * {@link getUserProfile} instead. Use this method's balances only for\n\t * in-Game-Pick display.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache. Server-side mirror refreshes at most every 60 s.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetUserInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickUserInfo}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetUserInfo({ saw_template_id: 1083 });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * console.log('[smartico] render Game Pick header — name:', r.data.public_username, '— points:', r.data.ach_points_balance, '— synced:', r.data.last_wallet_sync_time);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetUserInfo(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns the game template configuration plus a metadata listing of every\n\t * round (without events). Use to power the game's welcome / lobby screen —\n\t * shows the template name, buy-in cost, the user's remaining attempts, and\n\t * the full round list.\n\t *\n\t * The `allRounds[]` here is a lightweight metadata-only view — to render\n\t * predictions or leaderboards, call {@link gamePickGetActiveRound} /\n\t * {@link gamePickGetActiveRounds} / {@link gamePickGetBoard} for the rounds\n\t * the user actually opens.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Buy-in semantics**\n\t * The `sawTemplate.saw_buyin_type_id` value determines which currency is\n\t * deducted on the user's first prediction in any round:\n\t * - Free — no deduction.\n\t * - Points — `buyin_cost_points` deducted from the user's points balance.\n\t * - Gems — deducted from the user's gems balance.\n\t * - Diamonds — deducted from the user's diamonds balance.\n\t * - Spins — one spin counted from `spin_count`.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Re-call after a successful\n\t * {@link gamePickSubmitSelection} to refresh `spin_count`.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetGameInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickGameInfo}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetGameInfo({ saw_template_id: 1189 });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * console.log('[smartico] render Game Pick lobby — title:', r.data.sawTemplate.saw_template_ui_definition.name);\n\t * console.log('[smartico] rounds available:', r.data.allRounds.length, '— buy-in type:', r.data.sawTemplate.saw_buyin_type_id, 'cost:', r.data.sawTemplate.buyin_cost_points);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetGameInfo(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns a round with another player's predictions instead of the current\n\t * user's. The target player is identified by `int_user_id` (the Game Pick\n\t * system's internal user ID, obtained from {@link gamePickGetBoard}'s\n\t * `users[].int_user_id`).\n\t *\n\t * Use to power \"view this player's picks\" affordances opened from leaderboard\n\t * rows — community / social inspection of how a top-ranked user predicted.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id`, `round_id`, and `int_user_id` are all mandatory — SDK\n\t * throws synchronously if any is missing.\n\t * - `int_user_id` must come from a leaderboard fetch in the same game\n\t * template; it is stable within a template but not portable across\n\t * templates.\n\t *\n\t * **Shape vs `gamePickGetActiveRound`**\n\t * Same {@link GamePickRound} structure, but `user_selection` /\n\t * `team1_user_selection` / `team2_user_selection` reflect the TARGET user's\n\t * predictions instead of the caller's. Each event still carries its own\n\t * `resolution_type_id` (see {@link GamePickResolutionType}) so the UI can\n\t * render result badges per pick.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `4` — round / event / user not found.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache. Re-call when opening a different leaderboard row's\n\t * \"view picks\" modal.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetRoundInfoForUser`](../../docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md).\n\t *\n\t * @param props.saw_template_id ID of the MatchX or Quiz game template.\n\t * @param props.round_id ID of the round to inspect.\n\t * @param props.int_user_id Internal user ID from\n\t * `gamePickGetBoard.users[].int_user_id`.\n\t * @returns Wrapped {@link GamesApiResponse} with the target user's\n\t * {@link GamePickRound}.\n\t *\n\t * @example\n\t * ```ts\n\t * const board = await window._smartico.api.gamePickGetBoard({\n\t * saw_template_id: 1083, round_id: 31652,\n\t * });\n\t * const topPlayer = board.data?.users?.[0];\n\t * if (!topPlayer) return;\n\t *\n\t * const r = await window._smartico.api.gamePickGetRoundInfoForUser({\n\t * saw_template_id: 1083,\n\t * round_id: 31652,\n\t * int_user_id: topPlayer.int_user_id,\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t * for (const ev of r.data.events) {\n\t * console.log('[smartico] render row —', ev.event_meta.team1_name, 'vs', ev.event_meta.team2_name, '— picked:', ev.user_selection, '— resolution:', ev.resolution_type_id);\n\t * }\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & { int_user_id: number }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\tif (!props.int_user_id) {\n\t\t\tthrow new Error('int_user_id is required');\n\t\t}\n\t\treturn this.api.gpGetRoundInfoForUser(props.saw_template_id, props.round_id, props.int_user_id);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tLeaderBoardDetailsT,\n} from './WSAPITypes';\nimport { LeaderBoardPeriodType } from '../Leaderboard';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIGamePick } from './WSAPIGamePick';\n\n/** @group LeaderBoard */\nexport class WSAPILeaderBoard extends WSAPIGamePick {\n\t/**\n\t * Returns the operator-configured standalone leaderboard for the\n\t * given period type — top-20 ranked entries, the current user's\n\t * own entry (when authenticated), and the configured prize table.\n\t * Use this to power a leaderboard page with daily / weekly /\n\t * monthly tabs.\n\t *\n\t * The leaderboard for each period type is configured separately by\n\t * the operator. A label may have any combination of DAILY, WEEKLY,\n\t * and MONTHLY boards configured (or none). To discover which boards\n\t * exist before loading any standings, call {@link getLeaderBoards}\n\t * (metadata only) and drive the tab selector from its `period_type_id`s.\n\t *\n\t * @remarks\n\t * **Return value note** — the runtime may return `undefined` if no\n\t * board is configured for the requested `periodType`, despite the\n\t * static return type being `Promise<LeaderBoardDetailsT>`. Defend\n\t * against that case in consumer code.\n\t *\n\t * **Preconditions**\n\t * Pass a `periodType` from {@link LeaderBoardPeriodType}\n\t * (`DAILY = 1`, `WEEKLY = 2`, `MONTHLY = 3`). Pass\n\t * `getPreviousPeriod: true` to fetch the most-recently-ended\n\t * period's snapshot (yesterday's / last week's / last month's\n\t * results) instead of the current live period. To reach older\n\t * snapshots, pass a number instead of a boolean: `1` = previous\n\t * period, `2` = the one before that, and so on (`0` / `false` =\n\t * current). Use the snapshot's `create_date` / `version_id` to label\n\t * which historical run a previous-period board is. How far back\n\t * snapshots are retained is operator-configured.\n\t *\n\t * **Top-20 cap**\n\t * The server hard-caps `users[]` at 20 entries, ordered by\n\t * `position` ASC. Position values are server-computed (DENSE_RANK\n\t * over all participants); the truncation at 20 is for transport\n\t * size only — `position` may exceed 20 elsewhere.\n\t *\n\t * **The `me` field**\n\t * Always populated for authenticated users (even when they have\n\t * zero points in the period). `me.position === -1` is the signal\n\t * that the user is active but ranked outside the top 20 (or has no\n\t * activity yet). `me` is `undefined` for visitor-mode sessions.\n\t *\n\t * **Rewards are points only**\n\t * `rewards[].points` are gamification points credited to the user's\n\t * balance when the period finalizes. The leaderboard never awards\n\t * gems, diamonds, store items, or bonuses. The first element of\n\t * the array is the prize for place 1, the second for place 2, and\n\t * so on. The array length is the number of paid places.\n\t *\n\t * **Cache TTL**\n\t * The SDK caches each response for 30 seconds. \n\t *\n\t * **Period boundaries**\n\t * The server finalizes each period on a server-configurable\n\t * schedule: DAILY at midnight + operator-defined offset; WEEKLY\n\t * at the start of Monday; MONTHLY on the 1st of each month. At\n\t * finalization, the server distributes the configured `rewards[]`\n\t * points to the top placeholders and resets the live board. After\n\t * finalization, `getLeaderBoard(periodType, false)` returns the\n\t * NEW (empty) period's board; call with\n\t * `getPreviousPeriod: true` to see the just-ended standings.\n\t *\n\t * **Refresh model**\n\t * - One-shot fetch (no subscription).\n\t * - No push event refreshes the cache; finalization at the period\n\t * boundary is NOT pushed to the client.\n\t * - Poll manually if the consumer needs near-live state during an\n\t * in-progress period.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getLeaderBoard`](../../docs/ui/leaderboard/UIGuide_getLeaderBoard.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped\n\t * to the brand's public leaderboard. `me` is `undefined` for\n\t * visitors.\n\t *\n\t * @param periodType The board's period type\n\t * ({@link LeaderBoardPeriodType}).\n\t * Selects which pre-configured board to\n\t * fetch; the board itself is bound to one\n\t * period by the operator.\n\t * @param getPreviousPeriod Which period to fetch. `false` (default)\n\t * = current in-progress period; `true` =\n\t * the most recent finalized snapshot; a\n\t * number `n` = the n-th previous snapshot\n\t * (`1` = previous, `2` = the one before, …).\n\t * @returns Promise resolving to `LeaderBoardDetailsT`.\n\t * **At runtime, may resolve to `undefined`**\n\t * when no board is configured for the\n\t * requested period type — guard against it.\n\t *\n\t * @example\n\t * ```ts\n\t * import { LeaderBoardPeriodType } from '@smartico/public-api';\n\t *\n\t * const board = await window._smartico.api.getLeaderBoard(LeaderBoardPeriodType.WEEKLY);\n\t *\n\t * if (!board) {\n\t * console.log('[smartico] no weekly board configured for this label — hide the leaderboard surface');\n\t * return;\n\t * }\n\t *\n\t * console.log('[smartico] render leaderboard tab —', board.name, '—', board.users.length, 'ranked entries (top 20 max)');\n\t *\n\t * // Render prize table.\n\t * for (const reward of board.rewards) {\n\t * console.log('[smartico] prize row — place', reward.place, '→', reward.points, 'points');\n\t * }\n\t *\n\t * // \"Me\" panel — sticky row showing the current user's rank.\n\t * if (board.me) {\n\t * if (board.me.position === -1) {\n\t * console.log('[smartico] user is unranked — show \"You are unranked, earn points to enter the leaderboard\"');\n\t * } else if (board.me.position > 20) {\n\t * console.log('[smartico] user is ranked', board.me.position, 'but outside the visible top-20 — show sticky \"me\" row with', board.me.points, 'points');\n\t * } else {\n\t * console.log('[smartico] user is in the top 20 at position', board.me.position, '— highlight their row in the main list');\n\t * }\n\t * }\n\t *\n\t * // Switch to previous period view — cached separately from the current period.\n\t * const prev = await window._smartico.api.getLeaderBoard(LeaderBoardPeriodType.WEEKLY, true);\n\t * console.log('[smartico] previous-week standings — render with greyed-out \"ended\" treatment:', prev?.users.length, 'finalists');\n\t *\n\t * // Visitor-mode equivalent — me is always undefined.\n\t * // const visitorBoard = await window._smartico.vapi('EN').getLeaderBoard(LeaderBoardPeriodType.DAILY);\n\t * ```\n\t */\n\tpublic async getLeaderBoard(periodType: LeaderBoardPeriodType, getPreviousPeriod?: boolean | number): Promise<LeaderBoardDetailsT> {\n\t\t// Resolve the snapshot offset: false/omitted → 0 (current), true → 1\n\t\t// (previous), or an explicit number for older snapshots.\n\t\tconst offset = typeof getPreviousPeriod === 'number' ? getPreviousPeriod : getPreviousPeriod ? 1 : 0;\n\t\t// Cache per (periodType, offset) so switching tabs or period within the\n\t\t// TTL doesn't return a colliding board.\n\t\tconst cacheKey = `${onUpdateContextKey.LeaderBoards}:${periodType}:${offset}`;\n\t\treturn OCache.use(\n\t\t\tcacheKey,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.leaderboardsGetT(this.userExtId, periodType, offset),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the list of leaderboards the operator has configured for this\n\t * label — **metadata only, without participants**. Use it to discover\n\t * which boards exist (and their period types) so you can render the\n\t * board/tab selector, then load a specific board's standings on demand\n\t * with {@link getLeaderBoard}.\n\t *\n\t * This is the lightweight discovery counterpart to {@link getLeaderBoard}:\n\t * it issues one round-trip that returns every board's identity, name,\n\t * description, rules, `period_type_id`, and prize table, but **not** the\n\t * ranked players. Fetching the full standings for one board (the top-20\n\t * `users[]` and the caller's own `me` entry) is what {@link getLeaderBoard}\n\t * does per period.\n\t *\n\t * @remarks\n\t * **Returned shape**\n\t * An array of `LeaderBoardDetailsT`, one per configured board, ordered by\n\t * `period_type_id` ascending (DAILY, WEEKLY, MONTHLY, …). On every entry\n\t * `users` is an empty array and `me` is `undefined` — this call never\n\t * carries participant data. Read `period_type_id` from each entry and pass\n\t * it to {@link getLeaderBoard} to load that board's standings.\n\t *\n\t * **Empty result**\n\t * Resolves to an empty array when the label has no leaderboards configured\n\t * — treat that as \"hide the leaderboard surface\".\n\t *\n\t * **Cache TTL**\n\t * Cached for 30 seconds under a dedicated key (independent of\n\t * {@link getLeaderBoard}'s per-period cache). Repeated calls within the\n\t * window return the cached list without a round-trip.\n\t *\n\t * **Refresh model**: one-shot fetch — no subscription, no push. Board\n\t * configuration changes surface on the next cache miss.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **Visitor mode**: supported. Returns the brand's public board list.\n\t *\n\t * @returns Promise resolving to the array of configured boards\n\t * (metadata only). Empty array when none are configured.\n\t *\n\t * @example\n\t * ```ts\n\t * const boards = await window._smartico.api.getLeaderBoards();\n\t *\n\t * if (boards.length === 0) {\n\t * console.log('[smartico] no leaderboards configured — hide the leaderboard surface');\n\t * return;\n\t * }\n\t *\n\t * // Render one tab per board from the lightweight list (no players yet).\n\t * console.log('[smartico] render leaderboard tabs:', boards.map(b => b.name));\n\t *\n\t * // When the user opens a tab, load that board's standings on demand.\n\t * const first = boards[0];\n\t * const full = await window._smartico.api.getLeaderBoard(first.period_type_id);\n\t * console.log('[smartico] loaded standings for', first.name, '—', full?.users.length ?? 0, 'players');\n\t * ```\n\t */\n\tpublic async getLeaderBoards(): Promise<LeaderBoardDetailsT[]> {\n\t\treturn OCache.use(\n\t\t\t`${onUpdateContextKey.LeaderBoards}:list`,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.leaderboardsGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n}\n","import { ActivityTypeLimited } from '../Core';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tInboxMarkMessageAction,\n\tTInboxMessage,\n\tTInboxMessageBody,\n} from './WSAPITypes';\nimport { InboxCategories } from '../Inbox/InboxCategories';\nimport { InboxReadStatus } from '../Inbox/InboxReadStatus';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPILeaderBoard } from './WSAPILeaderBoard';\n\n/** @group Inbox */\nexport class WSAPIInbox extends WSAPILeaderBoard {\n\t/**\n\t * Records that an engagement (inbox message, popup) was displayed to\n\t * the user. Use this to drive engagement analytics — every visible\n\t * inbox message should fire one impression event per render\n\t * occurrence, and every popup display should fire one.\n\t *\n\t * **Fire-and-forget**: the call is asynchronous and one-way — there\n\t * is no response promise to await and no error reporting. The SDK\n\t * swallows transport failures silently. Returns `void`.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - Inbox: when a message becomes visible (the user opens / scrolls\n\t * it into view). The default Smartico UI fires this when the\n\t * message detail expands, alongside\n\t * {@link markInboxMessageAsRead}.\n\t * - Popup: when the popup content is shown to the user.\n\t *\n\t * **Activity types**\n\t * Pass {@link ActivityTypeLimited.Inbox} (`31`) for inbox messages,\n\t * {@link ActivityTypeLimited.Popup} (`30`) for popups. Other values\n\t * are not used by the engagement-impression channel.\n\t *\n\t * **Idempotency**: the server records every impression event —\n\t * repeated calls add to the impression count. Don't fire it on\n\t * every re-render; fire it once per logical \"display\" event\n\t * (modal open, list-row scroll-into-view, popup show).\n\t *\n\t * **Side effects**: server-side increments the engagement's\n\t * `impression_count` and updates `last_impression_date`. The\n\t * counter is observable via operator analytics; the SDK consumer\n\t * receives no signal back.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @example\n\t * ```ts\n\t * // When the user opens an inbox message in the detail view.\n\t * window._smartico.api.reportImpressionEvent({\n\t * engagement_uid: message.message_guid,\n\t * activityType: 31, // ActivityTypeLimited.Inbox\n\t * });\n\t * console.log('[smartico] inbox impression reported for', message.message_guid, '— no response to await, fire-and-forget');\n\t * ```\n\t */\n\tpublic reportImpressionEvent({\n\t\tengagement_uid,\n\t\tactivityType,\n\t}: {\n\t\t/** For inbox: the message's `message_guid` from `getInboxMessages`. For popups: the popup's GUID from the popup display callback. */\n\t\tengagement_uid: string;\n\t\t/** `ActivityTypeLimited.Inbox` (`31`) for inbox; `Popup` (`30`) for popups. */\n\t\tactivityType: ActivityTypeLimited | number;\n\t}): void {\n\t\tthis.api.reportEngagementImpression(this.userExtId, engagement_uid, activityType);\n\t}\n\n\t/**\n\t * Records that the user interacted with an engagement — typically\n\t * tapping a CTA button, following a deep-link, or clicking a popup\n\t * action. Use this to drive engagement analytics on what users\n\t * actually act on (vs what they merely see —\n\t * {@link reportImpressionEvent}).\n\t *\n\t * **Fire-and-forget**: the call is asynchronous and one-way — there\n\t * is no response promise to await and no error reporting. The SDK\n\t * swallows transport failures silently. Returns `void`.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - Inbox: when the user taps a CTA button on a message or follows\n\t * a deep-link inside the message body. Pass the deep-link or URL\n\t * as `action`.\n\t * - Popup: when the user clicks a popup action button.\n\t *\n\t * **Activity types**\n\t * Pass {@link ActivityTypeLimited.Inbox} (`31`) for inbox,\n\t * {@link ActivityTypeLimited.Popup} (`30`) for popups.\n\t *\n\t * **`action` payload**\n\t * Pass the deep-link or URL that the user triggered (e.g.\n\t * `'dp:gf_missions'`, `'https://example.com/promo'`). The SDK\n\t * forwards the string to the server for analytics — it does not\n\t * execute the deep-link. To execute deep-links safely, call\n\t * `_smartico.dp(action)` separately.\n\t *\n\t * **Idempotency**: the server records every click event —\n\t * repeated calls add to the count. Fire once per logical user\n\t * action.\n\t *\n\t * **Side effects**: server-side updates the engagement's\n\t * `last_action` field; observable via operator analytics. The SDK\n\t * consumer receives no signal back.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @example\n\t * ```ts\n\t * // When the user taps a CTA button in an inbox message.\n\t * window._smartico.api.reportClickEvent({\n\t * engagement_uid: message.message_guid,\n\t * activityType: 31, // ActivityTypeLimited.Inbox\n\t * action: 'dp:gf_missions',\n\t * });\n\t * window._smartico.dp('dp:gf_missions'); // separately execute the deep-link\n\t * ```\n\t */\n\tpublic reportClickEvent({\n\t\tengagement_uid,\n\t\tactivityType,\n\t\taction,\n\t}: {\n\t\t/** For inbox: the message's `message_guid` from `getInboxMessages`. */\n\t\tengagement_uid: string;\n\t\t/** `ActivityTypeLimited.Inbox` (`31`) for inbox; `Popup` (`30`) for popups. */\n\t\tactivityType: ActivityTypeLimited | number;\n\t\t/** The deep-link / URL the user triggered (optional but recommended for analytics fidelity). */\n\t\taction?: string;\n\t}): void {\n\t\tthis.api.reportEngagementAction(this.userExtId, engagement_uid, activityType, action);\n\t}\n\n\t/**\n\t * Returns the user's inbox messages — newest first — with optional\n\t * filtering by category, favorite status, and read state. Each\n\t * `TInboxMessage` is a lightweight envelope (`message_guid`,\n\t * `sent_date`, `read`, `favorite`, `category_id`, `expire_on_dt`);\n\t * fetch the rich body (title, preview, icon, html_body, buttons)\n\t * separately via {@link getInboxMessageBody}.\n\t *\n\t * Use this to power an inbox list screen. Subscribe via `onUpdate`\n\t * to react to newly-arrived messages pushed by the server (from\n\t * campaigns, automation rules, manual operator sends).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed message list (never a\n\t * diff/patch). Each subsequent call to `getInboxMessages({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires ONLY when:\n\t *\n\t * 1. A new message is pushed by the server (campaign / automation /\n\t * operator send). The refreshed list includes the new message\n\t * at the top.\n\t *\n\t * Does NOT fire for: `markInboxMessageAsRead`,\n\t * `markAllInboxMessagesAsRead`,\n\t * `markUnmarkInboxMessageAsFavorite`, `deleteInboxMessage`,\n\t * `deleteAllInboxMessages`. After a mutation, re-call\n\t * `getInboxMessages` manually if your UI needs the refreshed list\n\t * — or maintain optimistic state locally.\n\t *\n\t * **Pagination**\n\t * `from` (defaults to `0`) and `to` (defaults to `20`) define a\n\t * half-open range of message indices. The server caps the page at\n\t * **20 messages per request** — passing `to - from > 20` silently\n\t * truncates to 20. For \"load more\" pagination, advance `from` by\n\t * the prior page size on each subsequent call.\n\t *\n\t * **Filters**\n\t * All filters are ANDed server-side. Omitting a filter means \"no\n\t * constraint\" on that dimension:\n\t * - `categoryId` ({@link InboxCategories}): `General` (0),\n\t * `Platform` (1), `Personal` (2). Omit to get all categories.\n\t * - `onlyFavorite: true` returns only starred messages.\n\t * Omit / `false` returns all (starred and not).\n\t * - `read_status` ({@link InboxReadStatus}): `UnreadOnly` (1) or\n\t * `ReadOnly` (2). Omit to get both.\n\t *\n\t * **Server-side filtering** (always applied)\n\t * Expired messages (`expire_on_dt` in the past) and\n\t * soft-deleted messages are excluded server-side. Consumers do not\n\t * need to filter for these.\n\t *\n\t * **No client cache**: every call sends a fresh server round-trip.\n\t * To avoid redundant fetches in your UI, hold the result in\n\t * application state and re-fetch on `onUpdate` fires or explicit\n\t * user-driven refresh.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getInboxMessages`](../../docs/ui/inbox/UIGuide_getInboxMessages.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional filters + subscription.\n\t * @param params.from First message index (0-based). Defaults\n\t * to `0`.\n\t * @param params.to Last message index (exclusive).\n\t * Defaults to `20`. Server caps the page\n\t * at 20.\n\t * @param params.onlyFavorite When `true`, returns only favorite\n\t * (starred) messages.\n\t * @param params.categoryId When set, returns only messages in this\n\t * category ({@link InboxCategories}).\n\t * @param params.read_status When set, scopes to read or unread\n\t * only ({@link InboxReadStatus}).\n\t * @param params.onUpdate Callback invoked with the full\n\t * refreshed list when a new message\n\t * arrives.\n\t *\n\t * @returns Promise resolving to up to 20 `TInboxMessage` envelopes.\n\t * Empty array when the user has no messages matching the\n\t * filter.\n\t *\n\t * @example\n\t * ```ts\n\t * const messages = await window._smartico.api.getInboxMessages({\n\t * onUpdate: (refreshed) => {\n\t * console.log('[smartico] new inbox message arrived — re-render the list from this array, new message is at index 0:', refreshed);\n\t * },\n\t * });\n\t *\n\t * // For each message, fetch its body for the list view (title, preview, icon).\n\t * for (const msg of messages) {\n\t * const body = await window._smartico.api.getInboxMessageBody(msg.message_guid);\n\t * console.log('[smartico] render message', msg.message_guid,\n\t * '— title:', body.title,\n\t * '— preview:', body.preview_body,\n\t * '— read:', msg.read,\n\t * '— favorite:', msg.favorite);\n\t * }\n\t *\n\t * // \"Load more\" pagination — advance from by the prior page size.\n\t * const page2 = await window._smartico.api.getInboxMessages({ from: 20, to: 40 });\n\t * console.log('[smartico] page 2:', page2.length, 'messages');\n\t *\n\t * // Filter examples.\n\t * const onlyStarred = await window._smartico.api.getInboxMessages({ onlyFavorite: true });\n\t * const onlyUnread = await window._smartico.api.getInboxMessages({ read_status: 1 }); // InboxReadStatus.UnreadOnly\n\t * ```\n\t */\n\tpublic async getInboxMessages({\n\t\tfrom,\n\t\tto,\n\t\tonlyFavorite,\n\t\tcategoryId,\n\t\tread_status,\n\t\tonUpdate,\n\t}: {\n\t\tfrom?: number;\n\t\tto?: number;\n\t\tonlyFavorite?: boolean;\n\t\tcategoryId?: InboxCategories;\n\t\tread_status?: InboxReadStatus;\n\t\tonUpdate?: (data: TInboxMessage[]) => void;\n\t} = {}): Promise<TInboxMessage[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.InboxMessages, onUpdate);\n\t\t}\n\t\treturn await this.api.getInboxMessagesT(this.userExtId, from, to, onlyFavorite, categoryId, read_status);\n\t}\n\n\t/**\n\t * Returns the user's current unread inbox message count — a single\n\t * integer suitable for driving a header badge. Optionally subscribe\n\t * to live updates via `onUpdate`.\n\t *\n\t * For most UIs, prefer `core_inbox_unread_count` from\n\t * {@link getUserProfile} instead: it carries the same value, is\n\t * push-updated in real time via the user-properties channel, and\n\t * doesn't require a separate cache. This method is useful when you\n\t * want a dedicated subscription tied to the inbox surface rather\n\t * than the broader user-properties channel.\n\t *\n\t * @remarks\n\t * **Subscription model**\n\t * `onUpdate` fires whenever the cached value changes — either on a\n\t * push from the user-properties channel (new message arrival,\n\t * mark-as-read, delete) or after an inbox-list fetch that returns\n\t * a fresh count.\n\t *\n\t * **Cache TTL**: 30 seconds. The cached value is patched in place\n\t * by push events (no full re-fetch on every push), so the\n\t * `onUpdate` callback reflects server state with sub-second latency\n\t * regardless of the TTL.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params Optional subscription bag.\n\t * @param params.onUpdate Callback invoked with the new unread\n\t * count whenever it changes (push-driven).\n\t * @returns Promise resolving to the current unread\n\t * count (integer, includes `0`).\n\t *\n\t * @example\n\t * ```ts\n\t * // Static read for an initial badge render.\n\t * const count = await window._smartico.api.getInboxUnreadCount();\n\t * console.log('[smartico] inbox badge initial count:', count);\n\t *\n\t * // Live subscription for badge updates.\n\t * await window._smartico.api.getInboxUnreadCount({\n\t * onUpdate: (newCount) => {\n\t * console.log('[smartico] inbox count changed — update the badge to:', newCount,\n\t * '— hide badge entirely when 0, show raw integer otherwise (no \"99+\" cap in the default UI)');\n\t * },\n\t * });\n\t * ```\n\t */\n\tpublic async getInboxUnreadCount({ onUpdate }: { onUpdate?: (unread_count: number) => void } = {}): Promise<number> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.InboxUnreadCount, onUpdate);\n\t\t}\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.InboxUnreadCount,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getInboxUnreadCountT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the rich body of a single inbox message — title, preview\n\t * text, icon, click action, optional rich HTML body, and optional\n\t * buttons. Call this after fetching the envelope list via\n\t * {@link getInboxMessages} to render either a list-item preview or\n\t * a full detail view.\n\t *\n\t * The message body is served from a CDN — not over the WebSocket —\n\t * so latency depends on CDN proximity rather than WS round-trip\n\t * time. There is NO client-side cache; every call is a fresh\n\t * HTTP fetch. Browser HTTP caching applies (Cache-Control headers\n\t * from the CDN), but the SDK does not memoize the result.\n\t *\n\t * @remarks\n\t * **Rich vs simple messages**\n\t * The shape of the returned body branches on the `action` field:\n\t * - When `action === 'dp:inbox'`, the message has a rich HTML body\n\t * (`html_body`) and may have up to 2 action `buttons`. Use these\n\t * for a full-detail rendering.\n\t * - For any other `action` (deep-link like `'dp:deposit'` or a URL),\n\t * the message is a simple notification — `html_body` and\n\t * `buttons` will be `undefined` regardless of what's in the\n\t * underlying CDN payload. Render `title` + `preview_body` + a\n\t * single CTA driving the `action`.\n\t *\n\t * **The `action` field**\n\t * For both shapes, `action` carries either a deep-link\n\t * (`'dp:gf_missions'`) or a plain URL. Pass it to `_smartico.dp()`\n\t * for safe execution — that helper handles URL vs deep-link\n\t * routing.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only HTTP fetch.\n\t *\n\t * **UI guidance**: see [UI Guide — `getInboxMessageBody`](../../docs/ui/inbox/UIGuide_getInboxMessageBody.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid The `message_guid` from a `TInboxMessage`\n\t * returned by {@link getInboxMessages}.\n\t * @returns Promise resolving to `TInboxMessageBody`.\n\t *\n\t * @example\n\t * ```ts\n\t * const body = await window._smartico.api.getInboxMessageBody(messageGuid);\n\t *\n\t * console.log('[smartico] render message — title:', body.title,\n\t * '— preview:', body.preview_body,\n\t * '— icon:', body.icon);\n\t *\n\t * if (body.action === 'dp:inbox' && body.html_body) {\n\t * console.log('[smartico] rich message — render the html_body in a sandboxed iframe; render up to 2 action buttons:',\n\t * body.buttons?.length ?? 0);\n\t * } else {\n\t * console.log('[smartico] simple message — show preview_body + single CTA wired to:', body.action,\n\t * '— execute via _smartico.dp(body.action)');\n\t * }\n\t * ```\n\t */\n\tpublic async getInboxMessageBody(messageGuid: string): Promise<TInboxMessageBody> {\n\t\treturn await this.api.getInboxMessageBodyT(messageGuid);\n\t}\n\n\t/**\n\t * Marks a single inbox message as read. Server-side this flips the\n\t * message's `is_read` flag and decrements the user's unread count\n\t * (the change propagates back via the user-properties channel —\n\t * subscribers to {@link getInboxUnreadCount}'s `onUpdate` and\n\t * {@link getUserProfile}'s `core_inbox_unread_count` see it within\n\t * ~1 second).\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message is now marked read. Idempotent — a\n\t * second call on the same `messageGuid` also returns `0`.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages} (no\n\t * `onUpdate` callback fires after this mutation). The unread-count\n\t * channel ({@link getInboxUnreadCount}, `core_inbox_unread_count`)\n\t * DOES auto-update — subscribers to it see the new count\n\t * automatically. If your inbox list UI shows the `read` field, you\n\t * have two options: re-call `getInboxMessages` after the mutation,\n\t * or update the local copy optimistically.\n\t *\n\t * **Idempotency**: safe. Repeated calls return `err_code === 0`.\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_read` flag set to true.\n\t * - Server-side `core_inbox_unread_count` decremented (if the\n\t * message was previously unread).\n\t *\n\t * **UI guidance**: see [UI Guide — `markInboxMessageAsRead`](../../docs/ui/inbox/UIGuide_markInboxMessageAsRead.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid The `message_guid` from a `TInboxMessage`.\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.markInboxMessageAsRead(message.message_guid);\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] marked as read — optimistically flip the local read indicator; the inbox badge auto-decrements via the user-properties channel');\n\t * } else {\n\t * console.error('[smartico] mark-as-read failed — keep the local state as-is and show a non-blocking error if appropriate:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markInboxMessageAsRead(messageGuid: string): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markInboxMessageRead(this.userExtId, messageGuid);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Marks ALL of the user's inbox messages as read in one server\n\t * round-trip — typically wired to a \"Mark all as read\" CTA in the\n\t * inbox header.\n\t *\n\t * The operation is global to the user — NOT filtered by the\n\t * current view (active category tab, favorite filter, etc.). Every\n\t * unread message in the user's inbox flips to read.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; all currently-unread messages flipped to read.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Race condition note**: a new message arriving server-side\n\t * between the call and its processing remains unread (the\n\t * server's mark-all operation is a snapshot in time). Subsequent\n\t * `getInboxMessages` calls show the new message as unread.\n\t *\n\t * **Refresh after success**\n\t * Same as {@link markInboxMessageAsRead} — `getInboxMessages`\n\t * `onUpdate` does NOT fire automatically, but the unread-count\n\t * channel does (the badge will drop to 0, or to the count of any\n\t * new messages that arrived during processing).\n\t *\n\t * **Idempotency**: safe. A second call on an already-all-read\n\t * inbox returns `err_code === 0` with no-op effect.\n\t *\n\t * **Side effects** (on success)\n\t * - Every unread message flipped to read.\n\t * - `core_inbox_unread_count` drops to 0 (or near 0 if races).\n\t *\n\t * **UI guidance**: included in the\n\t * [UI Guide — `markInboxMessageAsRead`](../../docs/ui/inbox/UIGuide_markInboxMessageAsRead.md)\n\t * (Bulk variant section).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * console.log('[smartico] mark-all-read starting — set in-flight flag on the \"Mark all read\" button, show loading dots');\n\t * const r = await window._smartico.api.markAllInboxMessagesAsRead();\n\t * console.log('[smartico] mark-all-read response — clear in-flight flag');\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] all messages marked read — optimistically flip every local read indicator; badge auto-drops via user-properties channel');\n\t * } else {\n\t * console.error('[smartico] mark-all failed — surface a non-blocking error:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markAllInboxMessagesAsRead(): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markAllInboxMessageRead(this.userExtId);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Toggles a message's favorite (starred) state — pass `mark: true`\n\t * to favorite, `mark: false` to unfavorite. Use to power a star\n\t * icon click handler on the inbox list.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message's favorite state flipped to the\n\t * requested value.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages}. To\n\t * reflect the new state in the UI, update the local copy of the\n\t * affected `TInboxMessage` (set `favorite` to the new value) or\n\t * re-call `getInboxMessages`.\n\t *\n\t * **Idempotency**: safe. `mark: true` on an already-favorite\n\t * message returns `err_code === 0` (no-op). Same for `mark: false`\n\t * on a non-favorite.\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_starred` flag set to the requested value.\n\t * - No effect on read state, unread count, or other fields.\n\t *\n\t * **UI guidance**: see [UI Guide — `markUnmarkInboxMessageAsFavorite`](../../docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid The `message_guid` from a `TInboxMessage`.\n\t * @param mark `true` to favorite, `false` to unfavorite.\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // Toggle handler — flip the local state optimistically, then\n\t * // call the server, and revert if the call fails.\n\t * const target = !message.favorite;\n\t * console.log('[smartico] optimistically flip the star to', target, '— it will revert if the server rejects');\n\t *\n\t * const r = await window._smartico.api.markUnmarkInboxMessageAsFavorite(\n\t * message.message_guid,\n\t * target,\n\t * );\n\t *\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] favorite toggled — keep the local state and show a brief \"Added to favorites\" / \"Removed from favorites\" toast');\n\t * } else {\n\t * console.error('[smartico] favorite toggle failed — revert the local state and show an error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markUnmarkInboxMessageAsFavorite(messageGuid: string, mark: boolean): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markUnmarkInboxMessageAsFavorite(this.userExtId, messageGuid, mark);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Soft-deletes a single inbox message. After deletion, the message\n\t * is excluded from future {@link getInboxMessages} responses\n\t * server-side, but its row is retained for analytics — there is no\n\t * \"undelete\" path via the SDK.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message is now deleted from the user's\n\t * view.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages}. Drop the\n\t * deleted message from your local list, or re-call\n\t * `getInboxMessages` to reload. If the deleted message was unread,\n\t * the unread count drops automatically via the user-properties\n\t * channel.\n\t *\n\t * **Idempotency**: safe. A second call on an already-deleted\n\t * `messageGuid` returns `err_code === 0` (server treats it as a\n\t * no-op — already-deleted messages are filtered out).\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_deleted` flag set to true.\n\t * - If the message was unread, `core_inbox_unread_count`\n\t * decrements via the user-properties channel.\n\t *\n\t * **UI guidance**: see [UI Guide — `deleteInboxMessage`](../../docs/ui/inbox/UIGuide_deleteInboxMessage.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid The `message_guid` from a `TInboxMessage`.\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // Swipe-to-delete on mobile; trash-icon click on desktop.\n\t * console.log('[smartico] delete starting — animate the row out of the list (slide left/right by 100%)');\n\t * const r = await window._smartico.api.deleteInboxMessage(message.message_guid);\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] deleted — drop the message from the local list, fire a brief \"Message deleted\" toast (no undo affordance — there is no undelete via the SDK)');\n\t * } else {\n\t * console.error('[smartico] delete failed — animate the row back into place and show a non-blocking error:', r.err_message);\n\t * }\n\t * ```\n\t */\n\n\tpublic async deleteInboxMessage(messageGuid: string): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.deleteInboxMessage(this.userExtId, messageGuid);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Soft-deletes ALL of the user's inbox messages in one server\n\t * round-trip — typically wired to a \"Delete all\" CTA in the inbox\n\t * header (usually behind a confirm dialog given the destructive\n\t * nature).\n\t *\n\t * The operation is global to the user — NOT filtered by the\n\t * current view (active category tab, favorite filter, etc.). Every\n\t * non-deleted message in the user's inbox flips to deleted.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the entire inbox is now empty from the user's\n\t * view.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Race condition note**: a new message arriving server-side\n\t * between the call and its processing is NOT deleted (the\n\t * server's delete-all operation is a snapshot in time). Subsequent\n\t * `getInboxMessages` calls show the new message.\n\t *\n\t * **Refresh after success**\n\t * Same as {@link deleteInboxMessage} — `getInboxMessages` `onUpdate`\n\t * does not fire automatically. Replace the local list with `[]`\n\t * (or re-call `getInboxMessages`). The unread count drops to 0\n\t * (or near-0 if races) via the user-properties channel.\n\t *\n\t * **Idempotency**: safe. A second call on an already-empty inbox\n\t * returns `err_code === 0` with no-op effect.\n\t *\n\t * **Side effects** (on success)\n\t * - Every message flipped to deleted server-side.\n\t * - `core_inbox_unread_count` drops to 0.\n\t * - There is no SDK undelete path — recovery requires operator\n\t * intervention.\n\t *\n\t * **UI guidance**: included in the\n\t * [UI Guide — `deleteInboxMessage`](../../docs/ui/inbox/UIGuide_deleteInboxMessage.md)\n\t * (Bulk variant section).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns `{ err_code, err_message }`; success when\n\t * `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // After a confirm dialog \"Are you sure you want to delete all messages?\"\n\t * console.log('[smartico] delete-all confirmed — show loading state on the \"Delete all\" button');\n\t * const r = await window._smartico.api.deleteAllInboxMessages();\n\t * if (r.err_code === 0) {\n\t * console.log('[smartico] inbox cleared — replace the local list with [], fire a \"All messages deleted\" toast, badge auto-drops to 0');\n\t * } else {\n\t * console.error('[smartico] delete-all failed — show a non-blocking error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\n\tpublic async deleteAllInboxMessages(): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.deleteAllInboxMessages(this.userExtId);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\tprotected async updateInboxUnreadCount(count: number) {\n\t\tthis.updateEntity(onUpdateContextKey.InboxUnreadCount, count);\n\t}\n\n\tprotected async updateInboxMessages() {\n\t\tconst payload = await this.api.getInboxMessagesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.InboxMessages, payload);\n\t}\n}\n","import { ClassId } from '../Base/ClassId';\nimport { SAWSpinsCountPush } from '../MiniGames';\nimport { ECacheContext, OCache } from '../OCache';\nimport { SmarticoAPI } from '../SmarticoAPI';\nimport { JackpotWinPush, JackpotsOptinResponse, JackpotsOptoutRequest } from '../Jackpots';\nimport { onUpdateContextKey } from './WSAPIBase';\nimport { WSAPIInbox } from './WSAPIInbox';\nimport { TUserProfile } from './WSAPITypes';\n\n/**\n * Public surface of the Smartico WebSocket API. The consumer reaches every\n * method on this class via `_smartico.api.X(...)`. The class is the\n * terminator of an inheritance chain that splits the surface into focused\n * domain classes (see `WSAPIBase` → `WSAPIUser` → ... → `WSAPIInbox` →\n * `WSAPI`); each domain class hosts its own subset of methods. Consumers\n * don't need to know about the chain — every method is reachable directly\n * on the `WSAPI` instance via prototype-chain lookup.\n *\n * @group General API\n */\nexport class WSAPI extends WSAPIInbox {\n\t/** @private */\n\tconstructor(api: SmarticoAPI, userExtId: string = null) {\n\t\tsuper(api, userExtId);\n\n\t\t// Push-subscription wiring. This block must live in the terminator\n\t\t// because it references `update*` helpers defined across multiple\n\t\t// domain classes; only the terminator has visibility into all of\n\t\t// them via the prototype chain.\n\t\tif (this.api.tracker) {\n\t\t\tconst on = this.api.tracker.on;\n\n\t\t\ton(ClassId.SAW_SPINS_COUNT_PUSH, (data: SAWSpinsCountPush) => this.updateOnSpin(data));\n\t\t\ton(ClassId.SAW_SHOW_SPIN_PUSH, () => this.reloadMiniGameTemplate());\n\t\t\ton(ClassId.SAW_AKNOWLEDGE_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.SAW_DO_SPIN_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.MISSION_OPTIN_RESPONSE, () => this.updateMissions());\n\t\t\ton(ClassId.ACHIEVEMENT_CLAIM_PRIZE_RESPONSE, () => this.updateMissions());\n\t\t\ton(ClassId.RELOAD_ACHIEVEMENTS_EVENT, () => this.updateMissions());\n\t\t\ton(ClassId.TOURNAMENT_REGISTER_RESPONSE, () => this.updateTournaments());\n\t\t\ton(ClassId.BUY_SHOP_ITEM_RESPONSE, () => {\n\t\t\t\tthis.updateStorePurchasedItems();\n\t\t\t\tthis.updateStoreItems();\n\t\t\t});\n\t\t\ton(ClassId.CLIENT_ENGAGEMENT_EVENT_NEW, () => this.updateInboxMessages());\n\t\t\ton(ClassId.LOGOUT_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));\n\t\t\ton(ClassId.IDENTIFY_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));\n\t\t\ton(ClassId.JP_WIN_PUSH, (_data: JackpotWinPush) => this.jackpotClearCache());\n\t\t\ton(ClassId.JP_OPTOUT_RESPONSE, (_data: JackpotsOptoutRequest) => this.jackpotClearCache());\n\t\t\ton(ClassId.JP_OPTIN_RESPONSE, (_data: JackpotsOptinResponse) => this.jackpotClearCache());\n\t\t\ton(ClassId.CLAIM_BONUS_RESPONSE, () => this.updateBonuses());\n\t\t\ton(ClassId.SAW_DO_SPIN_BATCH_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.RAF_CLAIM_PRIZE_RESPONSE, () => this.updateRaffles());\n\t\t\ton(ClassId.GET_INBOX_MESSAGES_RESPONSE, (res) => {\n\t\t\t\tif (res.unread_count !== undefined && res.unread_count !== null) {\n\t\t\t\t\tthis.updateInboxUnreadCount(res.unread_count);\n\t\t\t\t}\n\t\t\t});\n\t\t\ton(ClassId.CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT, (data: { props: TUserProfile }) => {\n\t\t\t\tif (data?.props?.core_inbox_unread_count !== undefined && data?.props?.core_inbox_unread_count !== null) {\n\t\t\t\t\tthis.updateInboxUnreadCount(data.props.core_inbox_unread_count);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tdata?.props?.ach_points_balance !== undefined ||\n\t\t\t\t\t\tdata?.props?.ach_gems_balance !== undefined ||\n\t\t\t\t\t\tdata?.props?.ach_diamonds_balance !== undefined\n\t\t\t\t\t) && this.onUpdateCallback.get(onUpdateContextKey.ActivityLog)) {\n\t\t\t\t\tthis.notifyActivityLogUpdate();\n\t\t\t\t}\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.CurrentLevel);\n\t\t\t});\n\t\t\ton(ClassId.RAF_OPTIN_RESPONSE, () => this.updateRaffles());\n\t\t}\n\t}\n}\n","export enum AchCustomSectionType {\n\tHTML_PAGE = 1,\n\tMISSIONS_CATEGORY = 2,\n\tTOURNAMENTS_CATEGORY = 3,\n\tLEVELS = 4,\n\tMINI_GAMES = 5,\n\tMISSION_CUSTOM_LAYOUT = 6,\n\tMATCH_X_AND_QUIZ = 7,\n\tREDIRECT_LINK = 9,\n\tLOOTBOX_WEEKLY = 10,\n\tLOOTBOX_CALENDAR_DAYS = 11,\n\tSTORE = 12,\n\tRAFFLE = 13,\n\tBADGES = 14,\n}\n\nexport enum AchCustomLayoutTheme {\n\tVALENTINES_LIGHT = 'valentines-light',\n\tVALENTINES_DARK = 'valentines-dark',\n\tEURO_2024 = 'euro-2024',\n\tGENERIC = 'generic',\n}\n\nexport enum AchMissionsTabsOptions {\n\tONLY_OVERVIEW = 1,\n\tNO_OVERVIEW = 2,\n\tALL = 3,\n}\n\nexport enum AchOverviewMissionsFilter {\n\tANY = 1,\n\tALL_MISSIONS = 2,\n\tALL_EXCEPT_COMPLETED = 3,\n\tALL_EXCEPT_LOCKED = 4,\n\tALL_EXCEPT_COMPLETED_AND_LOCKED = 5,\n}\n\nexport enum LiquidEntityData {\n\tMissions = 1,\n\tStore = 2,\n\tTournaments = 3,\n\tMiniGames = 4,\n\tLevels = 5,\n\tJackpots = 6,\n\tBonus = 7,\n\tLeaderboard = 8,\n\tBadges = 9,\n\tTournament = 10,\n\tRaffles = 11,\n\tSingleRaffle = 12,\n\tClans = 13,\n}","import { TUICustomSection } from '../WSAPI/WSAPITypes';\nimport {\n\tAchCustomLayoutTheme,\n\tAchCustomSectionType,\n\tAchMissionsTabsOptions,\n\tAchOverviewMissionsFilter,\n\tLiquidEntityData,\n} from './AchCustomSection';\nimport { GetCustomSectionsResponse } from './GetCustomSectionsResponse';\n\nexport interface UICustomSection {\n\tbody?: string;\n\tmenu_img?: string;\n\tmenu_name?: string;\n\tcustom_skin_images?: string;\n\tsection_type_id?: AchCustomSectionType;\n\ttheme?: AchCustomLayoutTheme;\n\tgeneric_custom_css?: string;\n\tmission_tabs_options?: AchMissionsTabsOptions;\n\toverview_missions_filter?: AchOverviewMissionsFilter;\n\toverview_missions_count?: number;\n\turl_or_dp?: string;\n\tliquid_entity_data?: LiquidEntityData[];\n\tach_tournament_id?: number;\n\traffle_id?: number;\n\tshow_raw_data?: boolean;\n\tliquid_template?: number;\n\tach_category_ids?: number[];\n\tshop_category_ids?: number[];\n}\n\nexport const UICustomSectionTransform = (response: GetCustomSectionsResponse): TUICustomSection[] => {\n\n\tconst items: TUICustomSection[] = [];\n\n\tObject.keys(response.customSections || []).forEach((key: string) => {\n\t\tconst r = response.customSections[key];\n\t\tconst id = parseInt(key);\n\t\tif (r.section_type_id !== undefined && r.section_type_id >= 1) {\n\t\t\tconst x: TUICustomSection = {\n\t\t\t\tid: id,\n\t\t\t\tbody: r.body,\n\t\t\t\tmenu_img: r.menu_img,\n\t\t\t\tmenu_name: r.menu_name,\n\t\t\t\tsection_type_id: r.section_type_id,\n\t\t\t\tcustom_skin_images: r.custom_skin_images,\n\t\t\t\tgeneric_custom_css: r.generic_custom_css,\n\t\t\t\tmission_tabs_options: r.mission_tabs_options,\n\t\t\t\toverview_missions_count: r.overview_missions_count,\n\t\t\t\toverview_missions_filter: r.overview_missions_filter,\n\t\t\t\turl_or_dp: r.url_or_dp,\n\t\t\t\ttheme: r.theme,\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.LEVELS\n\t\t\t\t\t? {\n\t\t\t\t\t\tliquid_entity_data: r.liquid_entity_data,\n\t\t\t\t\t\tach_tournament_id: r.ach_tournament_id,\n\t\t\t\t\t\traffle_id: r.raffle_id,\n\t\t\t\t\t\tshow_raw_data: r.show_raw_data,\n\t\t\t\t\t\tliquid_template: r.liquid_template,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.BADGES\n\t\t\t\t\t? {\n\t\t\t\t\t\tach_category_ids: r.ach_category_ids,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.STORE\n\t\t\t\t\t? {\n\t\t\t\t\t\tshop_category_ids: r.shop_category_ids,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t};\n\n\t\t\titems.push(x);\n\t\t}\n\t});\n\n\treturn items;\n};\n","import { BonusStatus } from './BonusStatus';\nimport { BonusTemplateMetaMap } from './BonusTemplateMetaMap';\nimport { BonusMetaMap } from './BonusMetaMap';\nimport { TBonus } from '../WSAPI/WSAPITypes';\n\nexport interface Bonus {\n\tid: number;\n\tredeemable?: boolean;\n\tcreateDate?: string;\n\tupdateDate?: string;\n\tredeemDate?: string;\n\tengagementUid?: string;\n\tlabelBonusTemplateId?: number;\n\tsourceProductRefId?: number;\n\tsourceProductId?: number;\n\tuserId?: number;\n\tbonusStatusId?: BonusStatus;\n\tlabelBonusTemplateMetaMap?: BonusTemplateMetaMap;\n\tbonusMetaMap?: BonusMetaMap;\n}\n\nexport const BonusItemsTransform = (items: Bonus[]): TBonus[] => {\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TBonus = {\n\n bonus_id: r.id,\n is_redeemable: r.redeemable,\n create_date: r.createDate,\n redeem_date: r.redeemDate,\n label_bonus_template_id: r.labelBonusTemplateId,\n bonus_status_id: r.bonusStatusId,\n label_bonus_template_meta_map: r.labelBonusTemplateMetaMap,\n bonus_meta_map: r.bonusMetaMap\n\t\t\t};\n\n\t\t\treturn x;\n\t\t});\n};","export enum BonusStatus {\n\tNew = 1,\n\tCOUPON_ISSUED = 2,\n\tREDEEMED = 3,\n\tREDEEM_FAILED = 4, \n\tCOUPON_ISSUE_FAILED = 5, \n\tEXPIRED = 6, \n}","export enum UserBalanceType {\n Points = 0,\n Gems = 1,\n Diamonds = 2\n}\n\n\n","import { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { ActivityLogEntry } from './ActivityLogEntry';\nimport { TActivityLog } from '../WSAPI/WSAPITypes';\nimport { UserBalanceType } from './UserBalanceType';\n\nexport interface GetActivityLogResponse extends ProtocolResponse {\n\tlogHistory: ActivityLogEntry[];\n}\n\nexport const ActivityLogTransform = (items: ActivityLogEntry[]): TActivityLog[] => {\n\tif (!items) {\n\t\treturn [];\n\t}\n\n\treturn items.map((item: any): TActivityLog => {\n\t\tconst itemTransformed: Partial<TActivityLog> = {\n\t\t\tcreate_date: item.create_date,\n\t\t\tuser_ext_id: item.user_ext_id,\n\t\t\tcrm_brand_id: item.crm_brand_id,\n\t\t\tsource_type_id: item.source_type_id,\n\t\t}\n\n\t\titem.type = item.type ?? UserBalanceType.Points;\n\n\t\tif (item.type === UserBalanceType.Diamonds || item.type === UserBalanceType.Gems) {\n\t\t\titemTransformed.type = item.type;\n\t\t\titemTransformed.amount = item.amount;\n\t\t\titemTransformed.balance = item.balance;\n\t\t}\n\n\t\tif (item.type === UserBalanceType.Points) {\n\t\t\titemTransformed.type = UserBalanceType.Points;\n\t\t\titemTransformed.amount = item.points_collected;\n\t\t\titemTransformed.balance = item.user_points_balance;\n\t\t\titemTransformed.total_ever = item.user_points_ever;\n\t\t}\n\n\t\treturn itemTransformed as TActivityLog;\n\t});\n};\n\n\n","export enum PointChangeSourceType {\n\tJourney = 1,\n\tAchievementTaskCompletion = 2,\n\tAchievementCompletion = 3,\n\tLevelsStructureChange = 4,\n\tStorePurchase = 5,\n\tManualAdjustment = 6,\n\tLeaderboard = 7,\n\tTournament = 11,\n\tAutomationRule = 12,\n\tTournamentRegistration = 13,\n\tTournamentRegistrationCancellation = 14,\n\tRefundPoints = 15,\n\tPlayMiniGame = 16,\n\tWinMiniGame = 17,\n\tAPI = 18,\n\tDynamicFormula = 19,\n\tRaffle = 21,\n\tAvatars = 22,\n}\n\n\n","import { TAvatarDefinition } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarDefinition } from './AvatarDefinition';\n\nexport interface GetAvatarsListResponse extends ProtocolResponse {\n\tavatars: AvatarDefinition[];\n}\n\nexport const avatarDefinitionTransform = (items: AvatarDefinition[], avatarDomain: string): TAvatarDefinition[] => {\n\treturn items.map((item) => ({\n\t\tavatar_real_id: item.avatar_real_id,\n\t\tis_default: item.is_default,\n\t\thide_until_achieved: item.hide_until_achieved,\n\t\tpriority: item.priority,\n\t\tdescription: item.public_meta.description,\n\t\turl: item.public_meta.url,\n\t\tavatar_url: item.public_meta.url && !item.public_meta.url.startsWith('http') ? `${avatarDomain}${item.public_meta.url}` : item.public_meta.url,\n\t\tavatar_source_type_id: item.avatar_source_type_id,\n\t\tactive_from_date: item.active_from_date,\n\t\tactive_till_date: item.active_till_date,\n\t\tis_given: item.is_given,\n\t\tis_in_use: item.is_in_use,\n\t}));\n};\n","import { TAvatarCustomized } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarCustomized } from './AvatarCustomized';\n\nexport interface GetAvatarsCustomizedResponse extends ProtocolResponse {\n\tavatars: AvatarCustomized[];\n}\n\nexport const avatarCustomizedTransform = (items: AvatarCustomized[], avatarDomain: string): TAvatarCustomized[] => {\n\treturn items.map((item) => ({\n\t\tavatar_real_id: item.avatar_real_id,\n\t\turl: item.url && !item.url.startsWith('http') ? `${avatarDomain}${item.url}` : item.url,\n\t\tdt_created: item.dt_created,\n\t}));\n};\n","import { TAvatarPrompt } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarPrompt } from './AvatarPrompt';\n\nexport interface GetAvatarPromptsResponse extends ProtocolResponse {\n\tprompts: AvatarPrompt[];\n}\n\nexport const avatarPromptTransform = (items: AvatarPrompt[], avatarDomain: string): TAvatarPrompt[] => {\n\treturn items.map((item) => ({\n\t\tprompt_id: item.prompt_id,\n\t\tname: item.public_meta.name,\n\t\ticon_url: item.public_meta.icon_url && !item.public_meta.icon_url.startsWith('http') ? `${avatarDomain}${item.public_meta.icon_url}` : item.public_meta.icon_url,\n\t\tcost_currency_type_id: item.cost_currency_type_id,\n\t\tcost_value: item.cost_value,\n\t}));\n};\n","import { ProtocolResponse } from \"../Base/ProtocolResponse\";\nimport { JackPotWinner } from \"./JackPotWinner\";\n\nexport interface GetJackpotWinnersResponse extends ProtocolResponse {\n\t/** The list of jackpot winners */\n\twinners: JackpotWinnerHistory[];\n\t/** Whether there are more winners to fetch */\n\thas_more: boolean;\n}\n\nexport interface JackpotWinnerHistory {\n\t/** Id of the jackpot pot */\n\tjp_pot_id: number;\n\t/** Date of winning in milliseconds */\n\twin_date_ts: number;\n\t/** Info about jackpot winner */\n\twinner: JackPotWinner;\n}\n\n/**\n * @ignore\n */\nexport const GetJackpotWinnersResponseTransform = (items: JackpotWinnerHistory[]): JackpotWinnerHistory[] => {\n\treturn items.map((item) => {\n\t\tconst winnerInfo: JackpotWinnerHistory = {\n\t\t\twinner: item.winner,\n\t\t\twin_date_ts: item.win_date_ts,\n\t\t\tjp_pot_id: item.jp_pot_id,\n\t\t};\n\n\t\treturn winnerInfo;\n\t});\n};\n","import { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AchRelatedGame } from '../Base/AchRelatedGame';\n\nexport interface GetJackpotEligibleGamesResponse extends ProtocolResponse {\n\teligible_games: AchRelatedGame[];\n}\n\nexport interface TGetJackpotEligibleGamesResponse {\n\teligible_games: JackpotEligibleGame[];\n}\n\nexport interface JackpotEligibleGame {\n /** ID of the game on Smartico side */\n\tgame_id: number;\n /** ID of the game on operator side */\n ext_game_id: string;\n /** Name of the game */\n name: string;\n /** Link to the game */\n link: string;\n /** Image of the game */\n image: string;\n /** Whether the game is enabled */\n enabled: boolean;\n /** Categories of the game */\n game_categories: string[];\n /** Provider of the game */\n game_provider: string;\n /** The link to the mobile game */\n mobile_spec_link: string;\n /** The priority of the game */\n priority: number;\n}\n\n/**\n * @ignore\n */\nexport const GetJackpotEligibleGamesResponseTransform = ({ eligible_games } : { eligible_games: AchRelatedGame[]}): TGetJackpotEligibleGamesResponse => {\n\tconst games = eligible_games.map((game: AchRelatedGame, i: number) => ({\n\t\tgame_id: game.ach_game_id,\n\t\text_game_id: game.ext_game_id,\n\t\tname: game.game_public_meta.name,\n\t\tlink: game.game_public_meta.link,\n\t\timage: game.game_public_meta.image,\n\t\tenabled: game.game_public_meta.enabled,\n\t\tgame_categories: game.game_public_meta.game_categories,\n\t\tgame_provider: game.game_public_meta.game_provider,\n\t\tmobile_spec_link: game.game_public_meta.mobile_spec_link,\n\t\tpriority: i + 1,\n\t}));\n\n\treturn { eligible_games: games };\n};\n","import { ClassId } from './Base/ClassId';\nimport { ProtocolRequest } from './Base/ProtocolRequest';\nimport { ProtocolResponse } from './Base/ProtocolResponse';\nimport { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';\nimport { SAWGetTemplatesRequest } from './MiniGames/SAWGetTemplatesRequest';\nimport { IntUtils } from './IntUtils';\nimport { ILogger } from './ILogger';\nimport {\n\tSAWDoAknowledgeRequest,\n\tSAWDoAknowledgeResponse,\n\tSAWDoSpinRequest,\n\tSAWDoSpinResponse,\n\tSAWHistoryTransform,\n\tSAWPrizesHistory,\n\tSAWSpinErrorCode,\n\tSAWTemplatesTransform,\n\tSAWWinningHistoryRequest,\n\tSAWWinningHistoryResponse,\n} from './MiniGames';\nimport { ECacheContext, OCache } from './OCache';\nimport {\n\tActivityTypeLimited,\n\tCoreUtils,\n\tGetTranslationsRequest,\n\tGetTranslationsResponse,\n\tPublicLabelSettings,\n\tResponseIdentify,\n\tTranslationArea,\n} from './Core';\nimport { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';\nimport { GetLabelInfoRequest } from './Core/GetLabelInfoRequest';\nimport {\n\tGetInboxMessagesRequest,\n\tGetInboxMessagesResponse,\n\tInboxMessageBody,\n\tInboxMessageBodyTransform,\n\tInboxMessagesTransform,\n\tInboxReadStatus,\n\tMarkInboxMessageDeletedRequest,\n\tMarkInboxMessageDeletedResponse,\n\tMarkInboxMessageReadRequest,\n\tMarkInboxMessageReadResponse,\n\tMarkInboxMessageStarredRequest,\n\tMarkInboxMessageStarredResponse,\n} from './Inbox';\nimport {\n\tBuyStoreItemRequest,\n\tBuyStoreItemResponse,\n\tGetCategoriesStoreResponse,\n\tGetStoreHistoryRequest,\n\tGetStoreHistoryResponse,\n\tGetStoreItemsResponse,\n\tStoreCategoryTransform,\n\tStoreItemPurchasedTransform,\n\tStoreItemTransform,\n} from './Store';\nimport {\n\tAchCategoryTransform,\n\tAchClaimPrizeRequest,\n\tAchClaimPrizeResponse,\n\tAchievementOptinRequest,\n\tAchievementOptinResponse,\n\tAchievementType,\n\tGetAchCategoriesResponse,\n\tGetAchievementMapRequest,\n\tGetAchievementMapResponse,\n\tUserAchievementTransform,\n\tenrichUserAchievementsWithBadgeState,\n} from './Missions';\nimport {\n\tGetClanTournamentPlayersRequest,\n\tGetClanTournamentPlayersResponse,\n\tGetTournamentInfoRequest,\n\tGetTournamentInfoResponse,\n\tGetTournamentsRequest,\n\tGetTournamentsResponse,\n\tTournamentItemsTransform,\n\tTournamentRegisterRequest,\n\tTournamentRegisterResponse,\n\tclanTournamentPlayersTransform,\n\ttournamentInfoItemTransform,\n} from './Tournaments';\nimport { GetLeaderBoardsRequest, GetLeaderBoardsResponse, LeaderBoardDetails, LeaderBoardPeriodType } from './Leaderboard';\nimport { GetLevelMapResponse, GetLevelMapResponseTransform } from './Level';\nimport { WSAPI } from './WSAPI/WSAPI';\nimport {\n\tTInboxMessage,\n\tTInboxMessageBody,\n\tTLevel,\n\tTMiniGameTemplate,\n\tTMissionOrBadge,\n\tTStoreCategory,\n\tTAchCategory,\n\tTStoreItem,\n\tTTournament,\n\tTTournamentDetailed,\n\tLeaderBoardDetailsT,\n\tUserLevelExtraCountersT,\n\tTSegmentCheckResult,\n\tTUICustomSection,\n\tTBonus,\n\tTRaffle,\n\tTLevelCurrent,\n\tTActivityLog,\n\tTRaffleDraw,\n\tTAvatarDefinition,\n\tTAvatarCustomized,\n\tTAvatarPrompt,\n\tTClans,\n\tTClanInfo,\n\tTClanJoinResult,\n\tTClanTournamentPlayers,\n} from './WSAPI/WSAPITypes';\nimport { getLeaderBoardTransform } from './Leaderboard/LeaderBoards';\nimport { GetAchievementsUserInfoResponse } from './Core/GetAchievementsUserInfoResponse';\nimport { CheckSegmentMatchResponse } from './Core/CheckSegmentMatchResponse';\nimport { CheckSegmentMatchRequest } from './Core/CheckSegmentMatchRequest';\nimport {\n\tGetJackpotsPotsRequest,\n\tGetJackpotsPotsResponse,\n\tGetJackpotsRequest,\n\tGetJackpotsResponse,\n\tJackpotsOptinRequest,\n\tJackpotsOptinResponse,\n\tJackpotsOptoutRequest,\n\tJackpotsOptoutResponse,\n} from './Jackpots';\nimport { GetCustomSectionsRequest, GetCustomSectionsResponse, UICustomSectionTransform } from './CustomSections';\nimport { BonusItemsTransform, ClaimBonusRequest, ClaimBonusResponse, GetBonusesResponse } from './Bonuses';\nimport { GetBonusesRequest } from './Bonuses/GetBonusesRequest';\nimport { SAWDoSpinBatchResponse } from './MiniGames/SAWDoSpinBatchResponse';\nimport { SAWDoSpinBatchRequest } from './MiniGames/SAWDoSpinBatchRequest';\nimport { SAWDoAcknowledgeBatchRequest } from './MiniGames/SAWDoAcknowledgeBatchRequest';\nimport { SAWDoAcknowledgeBatchResponse } from './MiniGames/SAWDoAcknowledgeBatchResponse';\nimport { GetRelatedAchTourRequest } from './Missions/GetRelatedAchTourRequest';\nimport { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse';\nimport { GetRafflesResponse, raffleTransform } from './Raffle/GetRafflesResponse';\nimport { GetRafflesRequest } from './Raffle/GetRafflesRequest';\nimport { GetActivityLogRequest, GetActivityLogResponse, ActivityLogTransform } from './ActivityLog';\nimport { GetClanListRequest, GetClanListResponse, GetClanInfoRequest, GetClanInfoResponse, JoinClanRequest, JoinClanResponse } from './Clans';\nimport { InboxCategories } from './Inbox/InboxCategories';\nimport { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse, RaffleClaimPrizeRequest, RaffleClaimPrizeResponse, RaffleOptinRequest, RaffleOptinResponse, drawRunTransform, GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse } from './Raffle';\nimport { GetAvatarsListResponse, avatarDefinitionTransform } from './Avatars/GetAvatarsListResponse';\nimport { GetAvatarsCustomizedResponse, avatarCustomizedTransform } from './Avatars/GetAvatarsCustomizedResponse';\nimport { GetAvatarPromptsResponse, avatarPromptTransform } from './Avatars/GetAvatarPromptsResponse';\nimport { SetAvatarRequest, SetAvatarResponse } from './Avatars';\nimport { AvatarCustomizeResponse } from './Avatars/AvatarCustomizeResponse';\nimport { GetJackpotWinnersResponse, GetJackpotWinnersResponseTransform, JackpotWinnerHistory } from './Jackpots/GetJackpotWinnersResponse';\nimport { GetJackpotWinnersRequest } from './Jackpots/GetJackpotWinnersRequest';\nimport { GetJackpotEligibleGamesRequest } from './Jackpots/GetJackpotEligibleGamesRequest';\nimport { GetJackpotEligibleGamesResponse, GetJackpotEligibleGamesResponseTransform, JackpotEligibleGame, TGetJackpotEligibleGamesResponse } from './Jackpots/GetJackpotEligibleGamesResponse';\nimport { GamePickGameInfo, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamesApiResponse } from './GamePick';\n\nconst PUBLIC_API_URL = 'https://papi{ENV_ID}.smartico.ai/services/public';\nconst C_SOCKET_PROD = 'wss://api{ENV_ID}.smartico.ai/websocket/services';\nconst GAMES_API_URL = 'https://r-games-api.smr.vc';\nconst AVATAR_DOMAIN = 'https://img{ENV_ID}.smr.vc';\nconst DEFAULT_LANG_EN = 'EN';\n\nconst SMR_TO_CLOUDFRONT_DOMAINS: { [key: string]: string } = {\n\t'img.smr.vc': 'd1am61onjxtys8.cloudfront.net',\n\t'img3.smr.vc': 'd3dubbodzd2q05.cloudfront.net',\n\t'img4.smr.vc': 'dvm0p9vsezqr2.cloudfront.net',\n\t'img5.smr.vc': 'd3gen1ksvxhac8.cloudfront.net',\n\t'img6.smr.vc': 'db1kmyg7iufeo.cloudfront.net',\n\t'img7.smr.vc': 'd36om2g86xefo6.cloudfront.net',\n\t'img8.smr.vc': 'd2zme31v54n5pb.cloudfront.net',\n\n\t'static.smr.vc': 'dtt380pweilws.cloudfront.net',\n\t'static3.smr.vc': 'd1qt8ake8g4imn.cloudfront.net',\n\t'static4.smr.vc': 'd146b4m7rkvjkw.cloudfront.net',\n\t'static5.smr.vc': 'd3l7suk1kl9rwh.cloudfront.net',\n\t'static6.smr.vc': 'd121pfj16xdfcq.cloudfront.net',\n\t'static7.smr.vc': 'd21deilz814qgl.cloudfront.net',\n\t'static8.smr.vc': 'd1uffsroxjy2ku.cloudfront.net',\n};\n\n// Single combined matcher built once, so a call is one pass instead of one per domain.\nconst SMR_DOMAIN_REGEX = new RegExp(\n\tObject.keys(SMR_TO_CLOUDFRONT_DOMAINS)\n\t\t.map((d) => d.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n\t\t.join('|'),\n\t'g',\n);\n\ninterface Tracker {\n\tlabel_api_key: string;\n\tuserPublicProps: any;\n\tparams?: { brand_key?: string };\n\ton: (callBackKey: ClassId, func: (data: any) => void) => void;\n\tgetLabelSetting: (key: PublicLabelSettings) => any;\n\ttriggerExternalCallBack: (callBackKey: string, payload: any) => void;\n\tgetExtUserId: () => string;\n}\ninterface IOptions {\n\tlogger?: ILogger;\n\tlogCIDs?: ClassId[];\n\tlogHTTPTiming?: boolean;\n\ttracker?: Tracker;\n\tbrand_api_key?: string;\n}\n\ntype MessageSender = (message: any, publicApuUrl?: string, expectCID?: ClassId) => Promise<any>;\n\nclass SmarticoAPI {\n\tprivate publicUrl: string;\n\tprivate wsUrl: string;\n\tprivate inboxCdnUrl: string;\n\tprivate partnerUrl: string;\n\tprivate gamesApiUrl: string;\n\tprivate baseRgApiParams: Record<string, string>;\n\tpublic avatarDomain: string;\n\tprivate avatarOriginDomain: string;\n\tprivate envId: number;\n\n\tprivate logger: ILogger;\n\tprivate logCIDs: ClassId[];\n\tprivate logHTTPTiming: boolean;\n\tpublic tracker?: Tracker;\n\n\tpublic constructor(\n\t\tprivate label_api_key: string,\n\t\tprivate brand_api_key: string,\n\t\tprivate messageSender: MessageSender,\n\t\toptions: IOptions = {},\n\t) {\n\t\tthis.logger = options.logger || (console as any);\n\n\t\tif (this.logger.always === undefined) {\n\t\t\tthis.logger.always = this.logger.info;\n\t\t}\n\n\t\tthis.logCIDs = options.logCIDs || [];\n\t\tthis.logHTTPTiming = options.logHTTPTiming || false;\n\t\tthis.tracker = options.tracker;\n\n\t\tthis.publicUrl = SmarticoAPI.getPublicUrl(label_api_key);\n\t\tthis.wsUrl = SmarticoAPI.getPublicWsUrl(label_api_key);\n\n\t\tif (this.tracker) {\n\t\t\t// available only for real users\n\t\t\tthis.baseRgApiParams = {\n\t\t\t\tenv_id: String(SmarticoAPI.getEnvId(label_api_key)),\n\t\t\t\tlabel_api_key: label_api_key,\n\t\t\t\tbrand_key: options.brand_api_key || this.tracker.params.brand_key,\n\t\t\t\thash: IntUtils.uuid(),\n\t\t\t}\n\t\t}\n\n\t\tthis.avatarDomain = SmarticoAPI.getAvatarUrl(label_api_key || options.tracker?.label_api_key);\n\t\tthis.avatarOriginDomain = SmarticoAPI.getAvatarOriginUrl(label_api_key || options.tracker?.label_api_key);\n\n\t\tthis.label_api_key = SmarticoAPI.getCleanLabelApiKey(label_api_key);\n\t}\n\n\tpublic static getEnvDnsSuffix(label_api_key: string): string {\n\t\tlet ENV_ID = label_api_key.length === 38 ? label_api_key.substring(37, 38) : '';\n\n\t\tif (ENV_ID === '1' || ENV_ID === '2') {\n\t\t\tENV_ID = '';\n\t\t}\n\t\treturn ENV_ID;\n\t}\n\n\tpublic static replaceSmrDomainsWithCloudfront<T>(value: string | { [key: string]: any }): T {\n\t\tif (!value) {\n\t\t\treturn value as T;\n\t\t}\n\n\t\tconst isString = typeof value === 'string';\n\t\tconst source = isString ? (value as string) : JSON.stringify(value);\n\t\tif (!source.includes('smr.vc')) return value as T; // ← skip even the regex\n\n\t\tconst replaced = source.replace(SMR_DOMAIN_REGEX, (match) => SMR_TO_CLOUDFRONT_DOMAINS[match]);\n\n\t\t// No domain matched: skip the JSON re-parse and return the input untouched.\n\t\tif (replaced === source) {\n\t\t\treturn value as T;\n\t\t}\n\n\t\tif (isString) {\n\t\t\treturn replaced as T;\n\t\t}\n\n\t\ttry {\n\t\t\treturn JSON.parse(replaced);\n\t\t} catch (err) {\n\t\t\treturn value as T;\n\t\t}\n\t}\n\n\tpublic static getEnvId(label_api_key: string): number {\n\t\treturn label_api_key.length === 38 ? parseInt(label_api_key.substring(37, 38), 10) : 2;\n\t}\n\n\tpublic static getCleanLabelApiKey(label_api_key: string): string {\n\t\treturn label_api_key.substring(0, 36);\n\t}\n\n\tpublic static getPublicUrl(label_api_key: string): string {\n\t\treturn PUBLIC_API_URL.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tpublic static getPublicWsUrl(label_api_key: string): string {\n\t\treturn C_SOCKET_PROD.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tpublic static getAvatarUrl(label_api_key: string): string {\n\t\tconst avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);\n\t}\n\n\tpublic static getAvatarOriginUrl(label_api_key: string): string {\n\t\treturn AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tprivate async send<T>(message: any, expectCID?: ClassId, force_language?: string): Promise<T> {\n\t\tif (this.logCIDs.includes(message.cid)) {\n\t\t\tthis.logger.info('REQ', message);\n\t\t}\n\n\t\tif (force_language) {\n\t\t\tmessage.force_language = force_language;\n\t\t}\n\n\t\tlet result: any;\n\n\t\ttry {\n\t\t\tconst timeStart = new Date().getTime();\n\t\t\tresult = await this.messageSender(message, this.publicUrl, expectCID);\n\n\t\t\tif (result.errCode && result.errSetup) {\n\t\t\t\tthrow new Error(result.errMessage);\n\t\t\t}\n\n\t\t\tresult = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);\n\t\t\tconst timeEnd = new Date().getTime();\n\n\t\t\tif (this.logHTTPTiming) {\n\t\t\t\tthis.logger.always('HTTP time, ms:' + (timeEnd - timeStart));\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(`Failed to make request to smartico channel, L2. ${e.message}`, {\n\t\t\t\turl: this.publicUrl,\n\t\t\t\trequest: message,\n\t\t\t\terror: e.message,\n\t\t\t});\n\t\t\tthrow new Error(`Failed to make request to smartico channel, L2 L1. ${e.message}`);\n\t\t}\n\n\t\tif (this.logCIDs.includes(message.cid)) {\n\t\t\tthis.logger.info('RES', result);\n\t\t}\n\n\t\tif (expectCID) {\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tfor (const str of result as string[]) {\n\t\t\t\t\tconst obj: ProtocolResponse = JSON.parse(str);\n\t\t\t\t\tif (this.logCIDs.includes(obj.cid)) {\n\t\t\t\t\t\tthis.logger.info('RES', result);\n\t\t\t\t\t}\n\t\t\t\t\tif (obj.cid === expectCID) {\n\t\t\t\t\t\treturn obj as any;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.logger.error(`Cant find proper response in array, expected CID ${expectCID}`, {\n\t\t\t\t\trequest: message,\n\t\t\t\t\tresponse: result,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} else {\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tif (result.length === 1) {\n\t\t\t\t\tconst obj = JSON.parse(result[0]);\n\t\t\t\t\tif (this.logCIDs.includes(obj.cid)) {\n\t\t\t\t\t\tthis.logger.info('RES', result);\n\t\t\t\t\t}\n\t\t\t\t\treturn obj;\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.error('Expected one response, but got array', { request: message, response: result });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tprivate buildMessage<TRequest, TResponse>(user_ext_id: string, cid: ClassId, payload: Partial<TRequest> = {}): TResponse {\n\t\tconst message: ProtocolRequest = {\n\t\t\t// AA: in fact we need api and brand keys and ext_user_id only in the context of HTTP\n\t\t\t// its not needed in WebSocket and can be deleted\n\t\t\tapi_key: this.label_api_key,\n\t\t\tbrand_key: this.brand_api_key,\n\t\t\text_user_id: user_ext_id,\n\t\t\tcid,\n\t\t\tuuid: IntUtils.uuid(),\n\t\t\tts: new Date().getTime(),\n\t\t\t...payload,\n\t\t};\n\n\t\tif (message.ext_user_id === undefined || message.ext_user_id === null) {\n\t\t\tdelete message.ext_user_id;\n\t\t}\n\n\t\tif (message.brand_key === undefined || message.brand_key === null) {\n\t\t\tdelete message.brand_key;\n\t\t}\n\n\t\treturn message as any;\n\t}\n\n\tpublic async coreReportCustomEvent(user_ext_id: string, eventType: string, payload: any = {}): Promise<any> {\n\t\tconst eventMessage = this.buildMessage<any, any>(user_ext_id, ClassId.EVENT, {\n\t\t\teventType,\n\t\t\tpayload,\n\t\t});\n\n\t\tconst eventResponse = await this.send<any>(eventMessage, ClassId.EVENT_RESPONSE);\n\t\treturn eventResponse;\n\t}\n\n\tpublic async coreGetTranslations(\n\t\tuser_ext_id: string,\n\t\tlang_code: string,\n\t\tareas: TranslationArea[],\n\t\tcacheSec: number = 60,\n\t): Promise<GetTranslationsResponse> {\n\t\tif (lang_code === undefined || lang_code === null || (lang_code.trim && lang_code.trim() === '')) {\n\t\t\tlang_code = DEFAULT_LANG_EN;\n\t\t}\n\n\t\tconst response = await OCache.use<GetTranslationsResponse>(\n\t\t\t`${lang_code}-${this.label_api_key}-${this.brand_api_key}`,\n\t\t\tECacheContext.Translations,\n\t\t\tasync () => {\n\t\t\t\tconst tsBaseRQ = this.buildMessage<GetTranslationsRequest, GetTranslationsResponse>(\n\t\t\t\t\tuser_ext_id,\n\t\t\t\t\tClassId.GET_TRANSLATIONS_REQUEST,\n\t\t\t\t\t{\n\t\t\t\t\t\tlang_code: DEFAULT_LANG_EN,\n\t\t\t\t\t\thash_code: null,\n\t\t\t\t\t\tareas,\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tconst trBase = await this.send<GetTranslationsResponse>(tsBaseRQ, ClassId.GET_TRANSLATIONS_RESPONSE);\n\n\t\t\t\tif (lang_code !== DEFAULT_LANG_EN) {\n\t\t\t\t\tconst trUserRQ = this.buildMessage<GetTranslationsRequest, GetTranslationsResponse>(\n\t\t\t\t\t\tuser_ext_id,\n\t\t\t\t\t\tClassId.GET_TRANSLATIONS_REQUEST,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlang_code,\n\t\t\t\t\t\t\thash_code: null,\n\t\t\t\t\t\t\tareas,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\tconst trUser = await this.send<GetTranslationsResponse>(trUserRQ, ClassId.GET_TRANSLATIONS_RESPONSE);\n\n\t\t\t\t\tObject.keys(trUser?.translations ?? {}).forEach((k) => {\n\t\t\t\t\t\ttrBase.translations[k] = trUser.translations[k];\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn trBase;\n\t\t\t},\n\t\t\tcacheSec,\n\t\t);\n\n\t\treturn response;\n\t}\n\n\tpublic async coreIdentifyLabel(user_ext_id: string, cacheSec: number = 60): Promise<GetLabelInfoResponse> {\n\t\treturn OCache.use<GetLabelInfoResponse>(\n\t\t\t`${this.label_api_key} - ${this.brand_api_key}`,\n\t\t\tECacheContext.LabelInfo,\n\t\t\tasync () => {\n\t\t\t\tconst message = this.buildMessage<GetLabelInfoRequest, GetLabelInfoResponse>(user_ext_id, ClassId.INIT);\n\n\t\t\t\treturn this.send<GetLabelInfoResponse>(message, ClassId.INIT_RESPONSE);\n\t\t\t},\n\t\t\tcacheSec,\n\t\t);\n\t}\n\n\tpublic async coreIdentifyUser(user_ext_id: string): Promise<ResponseIdentify> {\n\t\tconst message = this.buildMessage<any, ResponseIdentify>(user_ext_id, ClassId.IDENTIFY, {\n\t\t\trequest_id: IntUtils.uuid(), // AA: do we need request_id?\n\t\t});\n\n\t\tconst r = await this.send<ResponseIdentify>(message, ClassId.IDENTIFY_RESPONSE);\n\n\t\tr.avatar_id = CoreUtils.avatarUrl(r.avatar_id, this.avatarDomain);\n\n\t\treturn r;\n\t}\n\n\tpublic async coreChangeUsername(\n\t\tuser_ext_id: string,\n\t\tpublic_username_custom: string,\n\t): Promise<{ public_username_custom: string }> {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_SET_CUSTOM_USERNAME_REQUEST, {\n\t\t\tpublic_username_custom,\n\t\t});\n\n\t\treturn await this.send(message, ClassId.CLIENT_SET_CUSTOM_USERNAME_RESPONSE);\n\t}\n\n\tpublic async coreCheckSegments(user_ext_id: string, segment_id: number[]): Promise<TSegmentCheckResult[]> {\n\t\tconst message = this.buildMessage<CheckSegmentMatchRequest, any>(user_ext_id, ClassId.CHECK_SEGMENT_MATCH_REQUEST, {\n\t\t\tsegment_id,\n\t\t});\n\n\t\tconst results = await this.send<CheckSegmentMatchResponse>(message, ClassId.CHECK_SEGMENT_MATCH_RESPONSE);\n\n\t\treturn results.segments || [];\n\t}\n\n\t/**\n\t * Reports an engagement impression event (when engagement content is displayed to the user).\n\t */\n\tpublic reportEngagementImpression(\n\t\tuser_ext_id: string,\n\t\tengagement_uid: string,\n\t\tactivityType: ActivityTypeLimited | number,\n\t): void {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_ENGAGEMENT_IMPRESSION_REQUEST, {\n\t\t\tengagement_uid,\n\t\t\tactivityType,\n\t\t});\n\n\t\tthis.send(message).catch(() => { });\n\t}\n\n\t/**\n\t * Reports an engagement action event (when user clicks/interacts with engagement content).\n\t */\n\tpublic reportEngagementAction(\n\t\tuser_ext_id: string,\n\t\tengagement_uid: string,\n\t\tactivityType: ActivityTypeLimited | number,\n\t\taction?: string,\n\t): void {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_ENGAGEMENT_ACTION_REQUEST, {\n\t\t\tengagement_uid,\n\t\t\tactivityType,\n\t\t\t...(action && { action }),\n\t\t});\n\n\t\tthis.send(message).catch(() => { });\n\t}\n\n\tpublic async jackpotGet(\n\t\tuser_ext_id: string,\n\t\tfilter?: { related_game_id?: string; jp_template_id?: number },\n\t\tforce_language?: string,\n\t): Promise<GetJackpotsResponse> {\n\t\tconst message = this.buildMessage<GetJackpotsRequest, GetJackpotsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_JACKPOTS_REQUEST,\n\t\t\tfilter,\n\t\t);\n\t\treturn await this.send<GetJackpotsResponse>(message, ClassId.JP_GET_JACKPOTS_RESPONSE, force_language);\n\t}\n\n\tpublic async potGet(user_ext_id: string, filter: { jp_template_ids: number[] }): Promise<GetJackpotsPotsResponse> {\n\t\tconst message = this.buildMessage<GetJackpotsPotsRequest, GetJackpotsPotsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_LATEST_POTS_REQUEST,\n\t\t\tfilter,\n\t\t);\n\t\treturn await this.send<GetJackpotsPotsResponse>(message, ClassId.JP_GET_LATEST_POTS_RESPONSE);\n\t}\n\n\tpublic async jackpotOptIn(user_ext_id: string, payload: { jp_template_id: number }): Promise<JackpotsOptinResponse> {\n\t\tconst message = this.buildMessage<JackpotsOptinRequest, JackpotsOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_OPTIN_REQUEST,\n\t\t\tpayload,\n\t\t);\n\t\treturn await this.send<JackpotsOptinResponse>(message, ClassId.JP_OPTIN_RESPONSE);\n\t}\n\n\tpublic async jackpotOptOut(user_ext_id: string, payload: { jp_template_id: number }): Promise<JackpotsOptoutResponse> {\n\t\tconst message = this.buildMessage<JackpotsOptoutRequest, JackpotsOptoutResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_OPTOUT_REQUEST,\n\t\t\tpayload,\n\t\t);\n\t\treturn await this.send<JackpotsOptoutResponse>(message, ClassId.JP_OPTOUT_RESPONSE);\n\t}\n\n\tpublic async getJackpotWinners(user_ext_id: string, limit: number = 20, offset: number = 0, jp_template_id: number): Promise<GetJackpotWinnersResponse> {\n\t\tconst message = this.buildMessage<GetJackpotWinnersRequest, GetJackpotWinnersResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_WINNERS_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t\tjp_template_id,\n\t\t\t},\n\t\t);\n\t\treturn await this.send<GetJackpotWinnersResponse>(message, ClassId.JP_GET_WINNERS_RESPONSE);\n\t}\n\n\tpublic async getJackpotWinnersT(user_ext_id: string, limit: number = 20, offset: number = 0, jp_template_id: number): Promise<JackpotWinnerHistory[]> {\n\t\treturn GetJackpotWinnersResponseTransform((await this.getJackpotWinners(user_ext_id, limit, offset, jp_template_id)).winners);\n\t}\n\n\tpublic async getJackpotEligibleGames(user_ext_id: string, { jp_template_id }: { jp_template_id: number }): Promise<GetJackpotEligibleGamesResponse> {\n\t\tconst message = this.buildMessage<GetJackpotEligibleGamesRequest, GetJackpotEligibleGamesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_ELIGIBLE_GAMES_REQUEST,\n\t\t\t{ jp_template_id },\n\t\t);\n\n\t\treturn await this.send<GetJackpotEligibleGamesResponse>(message, ClassId.JP_GET_ELIGIBLE_GAMES_RESPONSE);\n\t}\n\n\tpublic async getJackpotEligibleGamesT(user_ext_id: string, { jp_template_id }: { jp_template_id: number }): Promise<TGetJackpotEligibleGamesResponse> {\n\t\treturn GetJackpotEligibleGamesResponseTransform(await this.getJackpotEligibleGames(user_ext_id, { jp_template_id }));\n\t}\n\n\tpublic async sawGetTemplates(\n\t\tuser_ext_id: string,\n\t\tforce_language?: string,\n\t\tis_visitor_mode: boolean = false,\n\t): Promise<SAWGetTemplatesResponse> {\n\t\tconst message = this.buildMessage<SAWGetTemplatesRequest, SAWGetTemplatesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_GET_SPINS_REQUEST,\n\t\t\t{ is_visitor_mode },\n\t\t);\n\n\t\tconst response = await this.send<SAWGetTemplatesResponse>(message, ClassId.SAW_GET_SPINS_RESPONSE, force_language);\n\n\t\tif (response && response.templates) {\n\t\t\tresponse.templates.forEach((t) => {\n\t\t\t\tif (t.jackpot_current !== undefined && t.jackpot_current !== null) {\n\t\t\t\t\tconst jackpotValue =\n\t\t\t\t\t\tt.jackpot_current +\n\t\t\t\t\t\t(t.saw_template_ui_definition?.jackpot_symbol ? ' ' + t.saw_template_ui_definition?.jackpot_symbol : '');\n\t\t\t\t\tt.saw_template_ui_definition.name = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.name,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.saw_template_ui_definition.description = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.description,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.saw_template_ui_definition.promo_text = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.promo_text,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.prizes.forEach((p) => {\n\t\t\t\t\t\tp.saw_prize_ui_definition.name = IntUtils.replaceAll(\n\t\t\t\t\t\t\tp.saw_prize_ui_definition.name,\n\t\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tp.saw_prize_ui_definition.aknowledge_message = IntUtils.replaceAll(\n\t\t\t\t\t\t\tp.saw_prize_ui_definition.aknowledge_message,\n\t\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn response;\n\t}\n\n\tpublic async sawGetTemplatesT(user_ext_id: string): Promise<TMiniGameTemplate[]> {\n\t\treturn SAWTemplatesTransform((await this.sawGetTemplates(user_ext_id)).templates);\n\t}\n\n\tpublic async doAcknowledgeRequest(user_ext_id: string, request_id: string): Promise<SAWDoAknowledgeResponse> {\n\t\tconst message = this.buildMessage<SAWDoAknowledgeRequest, SAWDoAknowledgeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_AKNOWLEDGE_REQUEST,\n\t\t\t{\n\t\t\t\trequest_id,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<SAWDoAknowledgeResponse>(message, ClassId.SAW_AKNOWLEDGE_RESPONSE);\n\t}\n\n\tpublic async sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id?: number): Promise<SAWDoSpinResponse> {\n\t\tif (!saw_template_id) {\n\t\t\tthrow new Error('Missing template id');\n\t\t}\n\n\t\tconst request_id = IntUtils.uuid();\n\n\t\tconst message = this.buildMessage<SAWDoSpinRequest, SAWDoSpinResponse>(user_ext_id, ClassId.SAW_DO_SPIN_REQUEST, {\n\t\t\tsaw_template_id,\n\t\t\trequest_id,\n\t\t});\n\n\t\tconst spinAttemptResponse = await this.send<SAWDoSpinResponse>(message, ClassId.SAW_DO_SPIN_RESPONSE);\n\n\t\t// to simulate fail\n\t\t// response.errCode = SAWSpinErrorCode.SAW_NO_SPINS;\n\n\t\tconst status: string =\n\t\t\t{\n\t\t\t\t[SAWSpinErrorCode.SAW_OK]: 'OK',\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_SPINS]: 'NO SPINS AVAILABLE',\n\t\t\t\t[SAWSpinErrorCode.SAW_PRIZE_POOL_EMPTY]: 'PRIZE POOL IS EMPTY',\n\t\t\t\t[SAWSpinErrorCode.SAW_NOT_ENOUGH_POINTS]: 'NOT ENOUGH POINTS',\n\t\t\t\t[SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED]: 'MAX SPIN ATTEMPTS REACHED',\n\t\t\t\t[SAWSpinErrorCode.SAW_TEMPLATE_NOT_ACTIVE]: \"MINIGAME IS NOT IN ACTIVE PERIOD\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NOT_IN_SEGMENT]: \"USER IS NOT IN SEGMENT\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_BALANCE_GEMS]: \"NOT ENOUGH GEMS\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_BALANCE_DIAMONDS]: \"NOT ENOUGH DIAMONDS\",\n\t\t\t}[spinAttemptResponse.errCode] || 'OTHER';\n\n\t\tawait this.coreReportCustomEvent(user_ext_id, 'minigame_attempt', {\n\t\t\tsaw_template_id,\n\t\t\tstatus,\n\t\t\tround_id,\n\t\t});\n\n\t\treturn { ...spinAttemptResponse, request_id };\n\t}\n\n\n\tpublic async doAcknowledgeBatchRequest(user_ext_id: string, request_ids: string[]): Promise<SAWDoAcknowledgeBatchResponse> {\n\t\tconst message = this.buildMessage<SAWDoAcknowledgeBatchRequest, SAWDoAcknowledgeBatchResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_AKNOWLEDGE_REQUEST,\n\t\t\t{\n\t\t\t\trequest_ids,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<SAWDoAcknowledgeBatchResponse>(message, ClassId.SAW_AKNOWLEDGE_BATCH_RESPONSE);\n\t}\n\n\tpublic async sawSpinBatchRequest(user_ext_id: string, saw_template_id: number, spins_count: number): Promise<SAWDoSpinBatchResponse> {\n\n\t\tconst spins = [];\n\t\tfor (let i = 0; i < spins_count; i++) {\n\t\t\tconst request_id = IntUtils.uuid();\n\t\t\tspins.push({ request_id, saw_template_id })\n\t\t}\n\n\t\tconst message = this.buildMessage<SAWDoSpinBatchRequest, SAWDoSpinBatchResponse>(user_ext_id, ClassId.SAW_DO_SPIN_BATCH_REQUEST, { spins });\n\t\tconst spinAttemptResponse = await this.send<SAWDoSpinBatchResponse>(message, ClassId.SAW_DO_SPIN_BATCH_RESPONSE);\n\n\t\t// If one response is 'OK' we consider that whole result is 'OK'\n\t\tconst result = spinAttemptResponse.results.find((res) => res.errCode === 0);\n\n\t\tlet status = 'OK';\n\t\tif (!result) {\n\t\t\tstatus = 'BATCH FAIL';\n\t\t}\n\n\t\tawait this.coreReportCustomEvent(user_ext_id, 'minigame_attempt', {\n\t\t\tsaw_template_id,\n\t\t\tstatus,\n\t\t\tspins_count,\n\t\t});\n\n\t\treturn { ...spinAttemptResponse };\n\t}\n\n\tpublic async getSawWinningHistory(user_ext_id: string, limit: number = 20, offset: number = 0, saw_template_id: number): Promise<SAWWinningHistoryResponse> {\n\t\tconst message = this.buildMessage<SAWWinningHistoryRequest, SAWWinningHistoryResponse>(user_ext_id, ClassId.GET_SAW_HISTORY_REQUEST, {\n\t\t\tlimit, offset, saw_template_id\n\t\t})\n\n\t\treturn await this.send<SAWWinningHistoryResponse>(message, ClassId.GET_SAW_HISTORY_RESPONSE);\n\t}\n\n\tpublic async getSawWinningHistoryT(user_ext_id: string, limit?: number, offset?: number, saw_template_id?: number): Promise<SAWPrizesHistory[]> {\n\t\tif (IntUtils.isNotNull(limit) && IntUtils.isNotNull(offset) && limit > 50) {\n\t\t\tlimit = 50;\n\t\t}\n\t\treturn SAWHistoryTransform((await this.getSawWinningHistory(user_ext_id, limit, offset, saw_template_id)).prizes);\n\t}\n\n\tpublic async missionOptIn(user_ext_id: string, mission_id: number) {\n\t\tif (!mission_id) {\n\t\t\tthrow new Error('Missing mission id');\n\t\t}\n\t\tconst message = this.buildMessage<AchievementOptinRequest, AchievementOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MISSION_OPTIN_REQUEST,\n\t\t\t{\n\t\t\t\tachievementId: mission_id,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<AchievementOptinResponse>(message, ClassId.MISSION_OPTIN_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async missionClaimPrize(user_ext_id: string, mission_id: number, ach_completed_id: number) {\n\t\tif (!mission_id) {\n\t\t\tthrow new Error('Missing mission id');\n\t\t}\n\n\t\tconst message = this.buildMessage<AchClaimPrizeRequest, AchClaimPrizeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.ACHIEVEMENT_CLAIM_PRIZE_REQUEST,\n\t\t\t{\n\t\t\t\tach_id: mission_id,\n\t\t\t\tach_completed_id: ach_completed_id,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<AchClaimPrizeResponse>(message, ClassId.ACHIEVEMENT_CLAIM_PRIZE_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async registerInTournament(user_ext_id: string, tournamentInstanceId: number) {\n\t\tif (!tournamentInstanceId) {\n\t\t\tthrow new Error('Missing tournament instance id');\n\t\t}\n\t\tconst message = this.buildMessage<TournamentRegisterRequest, TournamentRegisterResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.TOURNAMENT_REGISTER_REQUEST,\n\t\t\t{\n\t\t\t\ttournamentInstanceId,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<TournamentRegisterResponse>(message, ClassId.TOURNAMENT_REGISTER_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async buyStoreItem(user_ext_id: string, itemId: number) {\n\t\tif (!itemId) {\n\t\t\tthrow new Error('Missing store item id');\n\t\t}\n\t\tconst message = this.buildMessage<BuyStoreItemRequest, BuyStoreItemResponse>(user_ext_id, ClassId.BUY_SHOP_ITEM_REQUEST, {\n\t\t\titemId,\n\t\t});\n\n\t\tconst res = await this.send<BuyStoreItemResponse>(message, ClassId.BUY_SHOP_ITEM_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async inboxGetMessages(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 10,\n\t\toffset: number = 0,\n\t): Promise<GetInboxMessagesResponse> {\n\t\tconst message = this.buildMessage<GetInboxMessagesRequest, GetInboxMessagesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_INBOX_MESSAGES_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetInboxMessagesResponse>(message, ClassId.GET_INBOX_MESSAGES_RESPONSE);\n\t}\n\n\tpublic async storeGetItems(user_ext_id: string, force_language?: string): Promise<GetStoreItemsResponse> {\n\t\tconst message = this.buildMessage<any, GetStoreItemsResponse>(user_ext_id, ClassId.GET_SHOP_ITEMS_REQUEST);\n\t\treturn await this.send<GetStoreItemsResponse>(message, ClassId.GET_SHOP_ITEMS_RESPONSE, force_language);\n\t}\n\n\tpublic async storeGetItemsT(user_ext_id: string): Promise<TStoreItem[]> {\n\t\treturn StoreItemTransform((await this.storeGetItems(user_ext_id)).items);\n\t}\n\n\tpublic async storeGetCategories(user_ext_id: string, force_language?: string): Promise<GetCategoriesStoreResponse> {\n\t\tconst message = this.buildMessage<any, GetCategoriesStoreResponse>(user_ext_id, ClassId.GET_SHOP_CATEGORIES_REQUEST);\n\t\treturn await this.send<GetCategoriesStoreResponse>(message, ClassId.GET_SHOP_CATEGORIES_RESPONSE, force_language);\n\t}\n\n\tpublic async storeGetCategoriesT(user_ext_id: string): Promise<TStoreCategory[]> {\n\t\treturn StoreCategoryTransform((await this.storeGetCategories(user_ext_id)).categories);\n\t}\n\n\tpublic async storeGetPurchasedItems(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 20,\n\t\toffset: number = 0,\n\t): Promise<GetStoreHistoryResponse> {\n\t\tconst message = this.buildMessage<GetStoreHistoryRequest, GetStoreHistoryResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.ACH_SHOP_ITEM_HISTORY_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetStoreHistoryResponse>(message, ClassId.ACH_SHOP_ITEM_HISTORY_RESPONSE);\n\t}\n\n\tpublic async storeGetPurchasedItemsT(user_ext_id: string, limit?: number, offset?: number): Promise<TStoreItem[]> {\n\t\tif (IntUtils.isNotNull(limit) && IntUtils.isNotNull(offset) && limit > 50) {\n\t\t\tlimit = 50;\n\t\t}\n\t\treturn StoreItemPurchasedTransform((await this.storeGetPurchasedItems(user_ext_id, limit, offset)).items);\n\t}\n\n\tpublic async missionsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementMapResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetAchievementMapResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\t// we need to clone response to avoid changing original object,for cases when its called together with badgesGetItems (e.g. in Promise.all)\n\t\tconst responseClone = { ...response };\n\n\t\tif (responseClone.achievements) {\n\t\t\tresponseClone.achievements = responseClone.achievements.filter((a) => a.ach_type_id === AchievementType.Mission);\n\t\t}\n\t\treturn responseClone;\n\t}\n\n\tpublic async missionsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]> {\n\t\treturn UserAchievementTransform((await this.missionsGetItems(user_ext_id)).achievements);\n\t}\n\n\tpublic async getUserGamificationInfo(user_ext_id: string): Promise<GetAchievementsUserInfoResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementsUserInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_USER_REQUEST,\n\t\t);\n\n\t\treturn await this.send<GetAchievementsUserInfoResponse>(message, ClassId.GET_ACHIEVEMENT_USER_RESPONSE);\n\t}\n\n\tpublic async getUserGamificationInfoT(user_ext_id: string): Promise<UserLevelExtraCountersT> {\n\t\tconst response = await this.getUserGamificationInfo(user_ext_id);\n\n\t\treturn {\n\t\t\tlevel_counter_1: response.level_counter_1,\n\t\t\tlevel_counter_2: response.level_counter_2,\n\t\t};\n\t}\n\n\tpublic async achGetCategories(user_ext_id: string, force_language?: string): Promise<GetAchCategoriesResponse> {\n\t\tconst message = this.buildMessage<any, GetAchCategoriesResponse>(user_ext_id, ClassId.GET_ACH_CATEGORIES_REQUEST);\n\t\treturn await this.send<GetAchCategoriesResponse>(message, ClassId.GET_ACH_CATEGORIES_RESPONSE, force_language);\n\t}\n\n\tpublic async achGetCategoriesT(user_ext_id: string): Promise<TAchCategory[]> {\n\t\treturn AchCategoryTransform((await this.achGetCategories(user_ext_id)).categories);\n\t}\n\n\tpublic async badgetsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementMapResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetAchievementMapResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\t// we need to clone response to avoid changing original object,for cases when its called together with missionsGetItems (e.g. in Promise.all)\n\t\tconst responseClone = { ...response };\n\n\t\tif (responseClone.achievements) {\n\t\t\tresponseClone.achievements = responseClone.achievements.filter((a) => a.ach_type_id === AchievementType.Badge);\n\t\t\tresponseClone.achievements = enrichUserAchievementsWithBadgeState(responseClone.achievements);\n\t\t}\n\t\treturn responseClone;\n\t}\n\n\tpublic async bonusesGetItems(user_ext_id: string, force_language?: string): Promise<GetBonusesResponse> {\n\t\tconst message = this.buildMessage<GetBonusesRequest, GetBonusesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_BONUSES_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetBonusesResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_BONUSES_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\n\t\tconst responseClone = { ...response };\n\n\t\treturn responseClone;\n\t}\n\tpublic async bonusClaimItem(user_ext_id: string, bonus_id: number): Promise<ClaimBonusResponse> {\n\t\tconst message = this.buildMessage<ClaimBonusRequest, ClaimBonusResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.CLAIM_BONUS_REQUEST,\n\t\t\t{ bonusId: bonus_id }\n\n\t\t);\n\t\tconst response = await this.send<ClaimBonusResponse>(\n\t\t\tmessage,\n\t\t\tClassId.CLAIM_BONUS_RESPONSE,\n\n\t\t);\n\n\t\tconst responseClone = { ...response };\n\n\t\treturn responseClone;\n\t}\n\n\tpublic async bonusesGetItemsT(user_ext_id: string): Promise<TBonus[]> {\n\t\treturn BonusItemsTransform((await this.bonusesGetItems(user_ext_id)).bonuses);\n\t}\n\n\tpublic async badgetsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]> {\n\t\treturn UserAchievementTransform((await this.badgetsGetItems(user_ext_id)).achievements);\n\t}\n\n\tpublic async tournamentsGetLobby(user_ext_id: string, force_language?: string): Promise<GetTournamentsResponse> {\n\t\tconst message = this.buildMessage<GetTournamentsRequest, GetTournamentsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_TOURNAMENT_LOBBY_REQUEST,\n\t\t);\n\t\treturn await this.send<GetTournamentsResponse>(message, ClassId.GET_TOURNAMENT_LOBBY_RESPONSE, force_language);\n\t}\n\n\tpublic async tournamentsGetLobbyT(user_ext_id: string): Promise<TTournament[]> {\n\t\treturn TournamentItemsTransform((await this.tournamentsGetLobby(user_ext_id)).tournaments);\n\t}\n\n\tpublic async clansGetList(user_ext_id: string, force_language?: string): Promise<GetClanListResponse> {\n\t\tconst message = this.buildMessage<GetClanListRequest, GetClanListResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_LIST_REQUEST,\n\t\t);\n\t\treturn await this.send<GetClanListResponse>(message, ClassId.GET_CLAN_LIST_RESPONSE, force_language);\n\t}\n\n\tpublic async clansGetListT(user_ext_id: string): Promise<TClans> {\n\t\tconst response = await this.clansGetList(user_ext_id);\n\t\treturn {\n\t\t\tclans: response.clans,\n\t\t\tuser_clan_id: response.user_clan_id,\n\t\t\tcooldown_until: response.cooldown_until,\n\t\t\tjoin_date: response.join_date ?? null,\n\t\t};\n\t}\n\n\tpublic async clansGetInfo(user_ext_id: string, clanId: number, force_language?: string): Promise<GetClanInfoResponse> {\n\t\tconst message = this.buildMessage<GetClanInfoRequest, GetClanInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_INFO_REQUEST,\n\t\t\t{ clan_id: clanId },\n\t\t);\n\t\treturn await this.send<GetClanInfoResponse>(message, ClassId.GET_CLAN_INFO_RESPONSE, force_language);\n\t}\n\n\tpublic async clansGetInfoT(user_ext_id: string, clanId: number, force_language?: string): Promise<TClanInfo> {\n\t\tconst response = await this.clansGetInfo(user_ext_id, clanId, force_language);\n\t\tconst c = response.clanInfo;\n\t\treturn {\n\t\t\tclan_id: c.clan_id,\n\t\t\tpublic_meta: c.public_meta,\n\t\t\tmember_count: c.member_count,\n\t\t\tcapacity_limit: c.capacity_limit,\n\t\t\tentry_fee_currency_type_id: c.entry_fee_currency_type_id,\n\t\t\tentry_fee_amount: c.entry_fee_amount,\n\t\t\trating_position: c.rating_position,\n\t\t\trating_score: c.rating_score,\n\t\t\tcooldown_until: c.cooldown_until ?? null,\n\t\t\tmembers: (c.members || []).map((m) => ({\n\t\t\t\tuser_id: m.user_id,\n\t\t\t\tpublic_username: m.public_username,\n\t\t\t\tavatar_id: m.avatar_id,\n\t\t\t\tavatar_real_id: m.avatar_real_id,\n\t\t\t\tavatar_url: CoreUtils.avatarUrl(m.avatar_id, this.avatarDomain),\n\t\t\t\tposition: m.position,\n\t\t\t\tcontribution_score: m.contribution_score,\n\t\t\t\tis_me: m.is_me,\n\t\t\t\tclean_ext_user_id: m.clean_ext_user_id,\n\t\t\t})),\n\t\t};\n\t}\n\n\tpublic async clanJoin(user_ext_id: string, clanId: number, joinSourceId: number = 0): Promise<TClanJoinResult> {\n\t\tconst message = this.buildMessage<JoinClanRequest, JoinClanResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JOIN_CLAN_REQUEST,\n\t\t\t{ clan_id: clanId, join_source_id: joinSourceId },\n\t\t);\n\t\tconst response = await this.send<JoinClanResponse>(message, ClassId.JOIN_CLAN_RESPONSE);\n\t\treturn { errCode: response.errCode ?? 0, errMsg: response.errMsg ?? '' };\n\t}\n\n\tpublic async tournamentsGetInfo(\n\t\tuser_ext_id: string,\n\t\ttournamentInstanceId: number,\n\t\tforce_language?: string,\n\t): Promise<GetTournamentInfoResponse> {\n\t\tconst message = this.buildMessage<GetTournamentInfoRequest, GetTournamentInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_TOURNAMENT_INFO_REQUEST,\n\t\t\t{\n\t\t\t\ttournamentInstanceId,\n\t\t\t},\n\t\t);\n\t\tconst response = await this.send<GetTournamentInfoResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_TOURNAMENT_INFO_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\n\t\tif (response.userPosition?.avatar_id) {\n\t\t\tresponse.userPosition.avatar_url = CoreUtils.avatarUrl(response.userPosition.avatar_id, this.avatarDomain);\n\t\t}\n\n\t\tif (response.tournamentInfo?.players?.length) {\n\t\t\tresponse.tournamentInfo.players.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\n\t\treturn response;\n\t}\n\n\tpublic async tournamentsGetInfoT(user_ext_id: string, tournamentInstanceId: number): Promise<TTournamentDetailed> {\n\t\tif (!tournamentInstanceId) {\n\t\t\tthrow new Error('Missing tournament instance id');\n\t\t}\n\t\tconst response = await this.tournamentsGetInfo(user_ext_id, tournamentInstanceId);\n\t\treturn tournamentInfoItemTransform(response);\n\t}\n\n\tpublic async clanTournamentGetPlayers(\n\t\tuser_ext_id: string,\n\t\ttournament_instance_id: number,\n\t\tclan_id: number,\n\t\tforce_language?: string,\n\t): Promise<TClanTournamentPlayers> {\n\t\tconst message = this.buildMessage<GetClanTournamentPlayersRequest, GetClanTournamentPlayersResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_TOURNAMENT_PLAYERS_REQUEST,\n\t\t\t{ tournament_instance_id, clan_id, force_language },\n\t\t);\n\t\tconst response = await this.send<GetClanTournamentPlayersResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\tif (response.players?.length) {\n\t\t\tresponse.players.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\t\treturn clanTournamentPlayersTransform(response);\n\t}\n\n\tpublic async leaderboardGet(\n\t\tuser_ext_id: string,\n\t\tperiod_type_id?: LeaderBoardPeriodType,\n\t\tprevPeriod: boolean | number = false,\n\t\tforce_language?: string,\n\t): Promise<LeaderBoardDetails> {\n\t\t// boolean keeps back-compat (false → current, true → previous);\n\t\t// a number selects an arbitrary snapshot offset (1 = previous, 2 = the one before, …).\n\t\tconst snapshot_offset = typeof prevPeriod === 'number' ? prevPeriod : prevPeriod ? 1 : 0;\n\t\tconst message = this.buildMessage<GetLeaderBoardsRequest, GetLeaderBoardsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_LEADERS_BOARD_REQUEST,\n\t\t\t{\n\t\t\t\tperiod_type_id,\n\t\t\t\tsnapshot_offset,\n\t\t\t\tinclude_users: true,\n\t\t\t},\n\t\t);\n\n\t\tconst response = await this.send<GetLeaderBoardsResponse>(message, ClassId.GET_LEADERS_BOARD_RESPONSE, force_language);\n\n\t\tconst boardKey = Object.keys(response.map || {}).find((k) => period_type_id === undefined || k === period_type_id?.toString());\n\n\t\tif (boardKey === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (response.map[boardKey]?.userPosition?.avatar_id) {\n\t\t\tresponse.map[boardKey].userPosition.avatar_url = CoreUtils.avatarUrl(\n\t\t\t\tresponse.map[boardKey].userPosition.avatar_id,\n\t\t\t\tthis.avatarDomain,\n\t\t\t);\n\t\t}\n\n\t\tif (response.map[boardKey]?.positions?.length) {\n\t\t\tresponse.map[boardKey].positions.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\n\t\treturn response.map[boardKey];\n\t}\n\n\tpublic async leaderboardsGetT(\n\t\tuser_ext_id: string,\n\t\tperiod_type_id: LeaderBoardPeriodType = LeaderBoardPeriodType.DAILY,\n\t\tprevPeriod: boolean | number = false,\n\t): Promise<LeaderBoardDetailsT> {\n\t\treturn getLeaderBoardTransform(await this.leaderboardGet(user_ext_id, period_type_id, prevPeriod));\n\t}\n\n\tpublic async leaderboardsGetList(\n\t\tuser_ext_id: string,\n\t\tforce_language?: string,\n\t): Promise<LeaderBoardDetails[]> {\n\t\tconst message = this.buildMessage<GetLeaderBoardsRequest, GetLeaderBoardsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_LEADERS_BOARD_REQUEST,\n\t\t\t{\n\t\t\t\t// No period_type_id → the server returns every configured board.\n\t\t\t\t// include_users: false → board metadata only (no positions / userPosition).\n\t\t\t\tsnapshot_offset: 0,\n\t\t\t\tinclude_users: false,\n\t\t\t},\n\t\t);\n\n\t\tconst response = await this.send<GetLeaderBoardsResponse>(message, ClassId.GET_LEADERS_BOARD_RESPONSE, force_language);\n\n\t\t// map is keyed by period_type_id; integer-like keys iterate in ascending order.\n\t\treturn Object.values(response.map || {});\n\t}\n\n\tpublic async leaderboardsGetListT(user_ext_id: string): Promise<LeaderBoardDetailsT[]> {\n\t\treturn (await this.leaderboardsGetList(user_ext_id)).map(getLeaderBoardTransform);\n\t}\n\n\tpublic async levelsGet(user_ext_id: string, force_language?: string): Promise<GetLevelMapResponse> {\n\t\tconst message = this.buildMessage<any, GetLevelMapResponse>(user_ext_id, ClassId.GET_LEVEL_MAP_REQUEST);\n\t\treturn await this.send<GetLevelMapResponse>(message, ClassId.GET_LEVEL_MAP_RESPONSE, force_language);\n\t}\n\n\tpublic async levelsGetT(user_ext_id: string): Promise<TLevel[]> {\n\t\treturn GetLevelMapResponseTransform(await this.levelsGet(user_ext_id));\n\t}\n\n\tpublic async getLevelCurrent(user_ext_id: string): Promise<TLevelCurrent> {\n\t\tconst levels = await this.levelsGetT(user_ext_id);\n\t\tconst userInfo = await this.getUserGamificationInfo(user_ext_id);\n\t\tif (!levels || levels.length === 0) return null;\n\n\t\tconst sortedLevels = [...levels].sort((a, b) => a.required_points - b.required_points);\n\n\t\tlet currentLevelIndex = sortedLevels.findIndex((level) => level.id === userInfo.current_level);\n\n\t\tif (currentLevelIndex === -1) {\n\t\t\tconst userPointsEver = userInfo.points_ever ?? 0;\n\t\t\tcurrentLevelIndex = sortedLevels.findIndex((level, index) => {\n\t\t\t\tconst nextLevel = sortedLevels[index + 1];\n\t\t\t\treturn userPointsEver >= level.required_points && (!nextLevel || userPointsEver < nextLevel.required_points);\n\t\t\t});\n\t\t\tif (currentLevelIndex === -1) {\n\t\t\t\tcurrentLevelIndex = sortedLevels.length - 1;\n\t\t\t}\n\t\t}\n\n\t\tconst currentLevel = sortedLevels[currentLevelIndex];\n\t\tconst nextLevel = sortedLevels[currentLevelIndex + 1];\n\t\tconst userPointsEver = userInfo.points_ever ?? 0;\n\t\tconst progress = nextLevel\n\t\t\t? ((userPointsEver - currentLevel.required_points) / (nextLevel.required_points - currentLevel.required_points)) * 100\n\t\t\t: 100;\n\n\t\treturn {\n\t\t\t...currentLevel,\n\t\t\tprogress: Math.min(Math.max(progress, 0), 100),\n\t\t};\n\t}\n\n\tpublic async customSectionsGet(user_ext_id: string, force_language?: string): Promise<GetCustomSectionsResponse> {\n\t\tconst message = this.buildMessage<GetCustomSectionsRequest, GetCustomSectionsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CUSTOM_SECTIONS_REQUEST,\n\t\t);\n\t\treturn await this.send<GetCustomSectionsResponse>(message, ClassId.GET_CUSTOM_SECTIONS_RESPONSE, force_language);\n\t}\n\n\tpublic async customSectionsGetT(user_ext_id: string): Promise<TUICustomSection[]> {\n\t\treturn UICustomSectionTransform(await this.customSectionsGet(user_ext_id));\n\t}\n\n\tpublic async getTranslationsT(\n\t\tuser_ext_id: string,\n\t\tlang_code: string,\n\t\tareas: TranslationArea[],\n\t\tcacheSec: number = 60,\n\t): Promise<GetTranslationsResponse> {\n\t\treturn await this.coreGetTranslations(user_ext_id, lang_code, areas, 30);\n\t}\n\n\tpublic async getInboxMessages(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 20,\n\t\toffset: number = 0,\n\t\tstarred_only: boolean,\n\t\tcategory_id?: InboxCategories,\n\t\tread_status?: InboxReadStatus,\n\t): Promise<GetInboxMessagesResponse> {\n\t\tconst message = this.buildMessage<GetInboxMessagesRequest, GetInboxMessagesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_INBOX_MESSAGES_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t\tstarred_only,\n\t\t\t\tcategory_id,\n\t\t\t\tread_status,\n\t\t\t},\n\t\t);\n\t\treturn await this.send<GetInboxMessagesResponse>(message, ClassId.GET_INBOX_MESSAGES_RESPONSE);\n\t}\n\n\tpublic async getInboxMessagesT(\n\t\tuser_ext_id: string,\n\t\tfrom: number = 0,\n\t\tto: number = 20,\n\t\tfavoriteOnly: boolean = false,\n\t\tcategoryId?: InboxCategories,\n\t\tread_status?: InboxReadStatus,\n\t): Promise<TInboxMessage[]> {\n\t\tconst limit = to - from > 20 ? 20 : to - from;\n\t\tconst offset = from;\n\n\t\treturn InboxMessagesTransform((await this.getInboxMessages(user_ext_id, limit, offset, favoriteOnly, categoryId, read_status)).log);\n\t}\n\n\tpublic async getInboxUnreadCountT(\n\t\tuser_ext_id: string,\n\t): Promise<number> {\n\t\tconst limit = 1;\n\t\tconst offset = 0;\n\n\t\treturn (await this.getInboxMessages(user_ext_id, limit, offset, false, null)).unread_count;\n\t}\n\n\tpublic async getInboxMessageBody(messageGuid: string): Promise<InboxMessageBody> {\n\t\tconst getMessageBody = async (messageGuid: string): Promise<InboxMessageBody> => {\n\t\t\tconst inboxCdnUrl = this.tracker.getLabelSetting(PublicLabelSettings.INBOX_PUBLIC_CDN);\n\n\t\t\ttry {\n\t\t\t\tconst url = `${inboxCdnUrl}${messageGuid}.json`;\n\n\t\t\t\tconst response = await fetch(url, {\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t'Access-Control-Allow-Origin': '*',\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tconst data = await response.json();\n\t\t\t\treturn data || {};\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.error('Error fetching inbox message body:', error);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\n\t\treturn await getMessageBody(messageGuid);\n\t}\n\n\tpublic async getInboxMessageBodyT(messageGuid: string): Promise<TInboxMessageBody> {\n\t\tconst message = await this.getInboxMessageBody(messageGuid);\n\t\treturn InboxMessageBodyTransform(message);\n\t}\n\n\tpublic async markInboxMessageRead(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageReadResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageReadRequest, MarkInboxMessageReadResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_READ_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageReadResponse>(message, ClassId.MARK_INBOX_READ_RESPONSE);\n\t}\n\n\tpublic async markAllInboxMessageRead(user_ext_id: string): Promise<MarkInboxMessageReadResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageReadRequest, MarkInboxMessageReadResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_READ_REQUEST,\n\t\t\t{\n\t\t\t\tall_read: true,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageReadResponse>(message, ClassId.MARK_INBOX_READ_RESPONSE);\n\t}\n\n\tpublic async markUnmarkInboxMessageAsFavorite(\n\t\tuser_ext_id: string,\n\t\tmessageGuid: string,\n\t\tmark: boolean,\n\t): Promise<MarkInboxMessageStarredResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageStarredRequest, MarkInboxMessageStarredResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_STARRED_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t\tis_starred: mark,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageStarredResponse>(message, ClassId.MARK_INBOX_STARRED_RESPONSE);\n\t}\n\n\tpublic async deleteInboxMessage(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageDeletedResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageDeletedRequest, MarkInboxMessageDeletedResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_DELETED_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageDeletedResponse>(message, ClassId.MARK_INBOX_DELETED_RESPONSE);\n\t}\n\n\tpublic async deleteAllInboxMessages(user_ext_id: string): Promise<MarkInboxMessageDeletedResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageDeletedRequest, MarkInboxMessageDeletedResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_DELETED_REQUEST,\n\t\t\t{\n\t\t\t\tall_deleted: true,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageDeletedResponse>(message, ClassId.MARK_INBOX_DELETED_RESPONSE);\n\t}\n\n\tprivate buildGamesApiParams(): Record<string, string> {\n\t\tconst params: Record<string, string> = Object.assign({}, this.baseRgApiParams, {\n\t\t\text_user_id: this.tracker.userPublicProps?.user_id,\n\t\t\tsmartico_ext_user_id: this.tracker.getExtUserId(),\n\t\t\tlang: this.tracker.userPublicProps?.core_user_language,\n\t\t});\n\n\t\treturn params;\n\t}\n\n\tprivate async sendGamesApi<T>({ method, params, usePost = false }: { method: string, params: Record<string, any>, usePost?: boolean }): Promise<GamesApiResponse<T>> {\n\n\t\tif (!this.tracker) {\n\t\t\tthrow new Error(`MatchX and Quiz APIs are not available in the visitor mode`);\n\t\t}\n\n\t\tconst baseParams = this.buildGamesApiParams();\n\t\tconst queryString = Object.entries(baseParams).map(([k, v]) => `${k}=${encodeURIComponent(v)}`).join('&');\n\t\tlet url = `${GAMES_API_URL}/${method}?${queryString}`;\n\n\t\tlet fetchOptions: RequestInit = {\n\t\t\tmethod: 'GET',\n\t\t\theaders: { 'Accept': 'application/json' },\n\t\t};\n\n\t\tif (usePost && params) {\n\t\t\tfetchOptions = {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify(params),\n\t\t\t};\n\t\t} else if (params) {\n\t\t\tconst extraQuery = Object.entries(params)\n\t\t\t\t.map(([k, v]) => `${k}=${encodeURIComponent(JSON.stringify(v))}`)\n\t\t\t\t.join('&');\n\t\t\turl += `&${extraQuery}`;\n\t\t}\n\n\t\ttry {\n\t\t\tconst response = await fetch(url, fetchOptions);\n\n\t\t\tconst data = await response.json();\n\t\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront<GamesApiResponse<T>>(data);\n\t\t} catch (e) {\n\t\t\tthis.logger.error(`Failed to call games API: ${method}`, { url, error: e.message });\n\t\t\tthrow new Error(`Failed to call games API: ${method}. ${e.message}`);\n\t\t}\n\t}\n\n\tprivate async sendAvatarApi<T>({ method, body }: { method: string, body: Record<string, any> }): Promise<T> {\n\t\tif (!this.tracker) {\n\t\t\tthrow new Error(`Avatar APIs are not available in the visitor mode`);\n\t\t}\n\n\t\tconst url = `${this.avatarOriginDomain}/${method}`;\n\n\t\ttry {\n\t\t\tconst response = await fetch(url, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify(body),\n\t\t\t});\n\n\t\t\tconst data = await response.json();\n\t\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront<T>(data);\n\t\t} catch (e) {\n\t\t\tthis.logger.error(`Failed to call avatar API: ${method}`, { url, error: e.message });\n\t\t\tthrow new Error(`Failed to call avatar API: ${method}. ${e.message}`);\n\t\t}\n\t}\n\n\tpublic async gpGetActiveRounds(saw_template_id: number): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound[]>({ method: 'active-rounds', params });\n\t}\n\n\tpublic async gpGetActiveRound(saw_template_id: number, round_id?: number): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t};\t\n\t\t\n\t\treturn this.sendGamesApi<GamePickRound>({ method: 'active-round', params });\n\t}\n\n\tpublic async gpGetGamesHistory(saw_template_id: number): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound[]>({ method: 'games-history', params });\n\t}\n\n\tpublic async gpGetGameBoard(saw_template_id: number, round_id: number): Promise<GamesApiResponse<GamePickRoundBoard>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRoundBoard>({ method: 'game-board', params });\n\t}\n\n\tpublic async gpSubmitSelection(saw_template_id: number, round: any, isQuiz: boolean): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst method = isQuiz ? 'submit-selection-quiz' : 'submit-selection';\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround: round,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound>({ method, params, usePost: true });\n\t}\n\n\tpublic async gpGetUserInfo(saw_template_id: number): Promise<GamesApiResponse<GamePickUserInfo>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickUserInfo>({ method: 'user-info', params });\n\t}\n\n\tpublic async gpGetGameInfo(saw_template_id: number): Promise<GamesApiResponse<GamePickGameInfo>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickGameInfo>({ method: 'game-info', params });\n\t}\n\n\tpublic async gpGetTranslations(saw_template_id: number): Promise<GamesApiResponse<any>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<any>({ method: 'translations', params });\n\t}\n\n\tpublic async gpGetRoundInfoForUser(saw_template_id: number, round_id: number, int_user_id: number): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t\tint_user_id: int_user_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound>({ method: 'game-round-info-for-user', params });\n\t}\n\n\tpublic async avatarsGetList(user_ext_id: string): Promise<GetAvatarsListResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarsListResponse>(user_ext_id, ClassId.GET_AVATARS_LIST_REQUEST);\n\t\treturn await this.send<GetAvatarsListResponse>(message, ClassId.GET_AVATARS_LIST_RESPONSE);\n\t}\n\n\tpublic async avatarsGetCustomized(user_ext_id: string): Promise<GetAvatarsCustomizedResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarsCustomizedResponse>(user_ext_id, ClassId.GET_AVATARS_CUSTOMIZED_REQUEST);\n\t\treturn await this.send<GetAvatarsCustomizedResponse>(message, ClassId.GET_AVATARS_CUSTOMIZED_RESPONSE);\n\t}\n\n\tpublic async avatarsGetPrompts(user_ext_id: string): Promise<GetAvatarPromptsResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarPromptsResponse>(user_ext_id, ClassId.GET_AVATAR_PROMPTS_REQUEST);\n\t\treturn await this.send<GetAvatarPromptsResponse>(message, ClassId.GET_AVATAR_PROMPTS_RESPONSE);\n\t}\n\n\tpublic async avatarSetAvatar(user_ext_id: string, avatar_id: string, avatar_real_id: number): Promise<SetAvatarResponse> {\n\t\tconst message = this.buildMessage<SetAvatarRequest, SetAvatarResponse>(user_ext_id, ClassId.CLIENT_SET_AVATAR_REQUEST, {\n\t\t\tavatar_id,\n\t\t\tavatar_real_id,\n\t\t});\n\t\treturn await this.send<SetAvatarResponse>(message, ClassId.CLIENT_SET_AVATAR_RESPONSE);\n\t}\n\n\tpublic async avatarsCustomize(params: {\n\t\tuser_id: number;\n\t\tprompt_id: number;\n\t\tavatar_url: string;\n\t\tavatar_real_id: number;\n\t}): Promise<AvatarCustomizeResponse> {\n\t\treturn this.sendAvatarApi<AvatarCustomizeResponse>({\n\t\t\tmethod: 'avatar-customize',\n\t\t\tbody: {\n\t\t\t\t// The server resolves label_id from label_api_key.\n\t\t\t\tlabel_api_key: this.label_api_key,\n\t\t\t\tuser_id: params.user_id,\n\t\t\t\tuser_ext_id: this.tracker?.getExtUserId(),\n\t\t\t\tbrand_key: this.brand_api_key || this.tracker?.params?.brand_key,\n\t\t\t\tprompt_id: params.prompt_id,\n\t\t\t\tavatar_url: params.avatar_url,\n\t\t\t\tavatar_real_id: params.avatar_real_id,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async avatarsGetListT(user_ext_id: string): Promise<TAvatarDefinition[]> {\n\t\treturn avatarDefinitionTransform((await this.avatarsGetList(user_ext_id)).avatars ?? [], this.avatarDomain);\n\t}\n\n\tpublic async avatarsGetCustomizedT(user_ext_id: string): Promise<TAvatarCustomized[]> {\n\t\treturn avatarCustomizedTransform((await this.avatarsGetCustomized(user_ext_id)).avatars ?? [], this.avatarDomain);\n\t}\n\n\tpublic async avatarsGetPromptsT(user_ext_id: string): Promise<TAvatarPrompt[]> {\n\t\treturn avatarPromptTransform((await this.avatarsGetPrompts(user_ext_id)).prompts ?? [], this.avatarDomain);\n\t}\n\n\tpublic getWSCalls(): WSAPI {\n\t\treturn new WSAPI(this);\n\t}\n\n\tpublic async getRelatedItemsForGame(user_ext_id: string, related_game_id: string,): Promise<GetRelatedAchTourResponse> {\n\t\tconst message = this.buildMessage<GetRelatedAchTourRequest, GetRelatedAchTourResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_RELATED_ACH_N_TOURNAMENTS_REQUEST,\n\t\t\t{\n\t\t\t\trelated_game_id: related_game_id\n\t\t\t}\n\t\t);\n\n\t\treturn await this.send<GetRelatedAchTourResponse>(message, ClassId.GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE);\n\t}\n\n\tpublic async getRafflesT(user_ext_id: string): Promise<TRaffle[]> {\n\t\treturn raffleTransform((await this.getRaffles(user_ext_id)).items);\n\t}\n\n\tpublic async getRaffles(user_ext_id: string): Promise<GetRafflesResponse> {\n\t\tconst message = this.buildMessage<GetRafflesRequest, GetRafflesResponse>(user_ext_id, ClassId.RAF_GET_RAFFLES_REQUEST);\n\n\t\treturn await this.send<GetRafflesResponse>(message, ClassId.RAF_GET_RAFFLES_RESPONSE);\n\t}\n\n\tpublic async getRaffleDrawRun(user_ext_id: string, payload: { raffle_id: number; run_id: number; winners_limit?: number; winners_offset?: number }): Promise<GetDrawRunResponse> {\n\t\tconst message = this.buildMessage<GetDrawRunRequest, GetDrawRunResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_DRAW_RUN_REQUEST,\n\t\t\tpayload,\n\t\t);\n\n\t\treturn await this.send<GetDrawRunResponse>(message, ClassId.RAF_GET_DRAW_RUN_RESPONSE);\n\t}\n\n\tpublic async getRaffleDrawRunT(\n\t\tuser_ext_id: string,\n\t\traffle_id: number,\n\t\trun_id: number,\n\t\twinners_from: number = 0,\n\t\twinners_to: number = 20,\n\t): Promise<TRaffleDraw> {\n\t\tconst winners_limit = winners_to - winners_from > 50 ? 50 : winners_to - winners_from;\n\t\tconst winners_offset = winners_from;\n\n\t\treturn drawRunTransform(await this.getRaffleDrawRun(user_ext_id, { raffle_id, run_id, winners_limit, winners_offset }),);\n\t}\n\n\tpublic async getRaffleDrawRunsHistory(\n\t\tuser_ext_id: string,\n\t\tprops: { raffle_id: number; draw_id?: number },\n\t): Promise<GetRaffleDrawRunsHistoryResponse> {\n\t\tconst message = this.buildMessage<GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_DRAW_HISTORY_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<GetRaffleDrawRunsHistoryResponse>(message, ClassId.RAF_GET_DRAW_HISTORY_RESPONSE);\n\t}\n\n\tpublic async claimRafflePrize(user_ext_id: string, props: { won_id: number }): Promise<RaffleClaimPrizeResponse> {\n\t\tconst message = this.buildMessage<RaffleClaimPrizeRequest, RaffleClaimPrizeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_CLAIM_PRIZE_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<RaffleClaimPrizeResponse>(message, ClassId.RAF_CLAIM_PRIZE_RESPONSE);\n\n\t}\n\n\tpublic async raffleOptin(user_ext_id: string, props: { raffle_id: number; draw_id: number; raffle_run_id: number }): Promise<RaffleOptinResponse> {\n\t\tconst message = this.buildMessage<RaffleOptinRequest, RaffleOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_OPTIN_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<RaffleOptinResponse>(message, ClassId.RAF_OPTIN_RESPONSE);\n\n\t}\n\n\tpublic async getRaffleWonPrizes(\n\t\tuser_ext_id: string,\n\t\tprops: { raffle_id: number; offset: number; limit: number },\n\t): Promise<GetRaffleWonPrizesResponse> {\n\t\tconst message = this.buildMessage<GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_WON_PRIZES_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<GetRaffleWonPrizesResponse>(message, ClassId.RAF_GET_WON_PRIZES_RESPONSE);\n\t}\n\n\tpublic async getActivityLog(\n\t\tuser_ext_id: string,\n\t\tstartTimeSeconds: number,\n\t\tendTimeSeconds: number,\n\t\tlimit: number,\n\t\toffset: number,\n\t): Promise<GetActivityLogResponse> {\n\t\tconst message = this.buildMessage<GetActivityLogRequest, GetActivityLogResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_POINT_HISTORY_REQUEST,\n\t\t\t{\n\t\t\t\tstartTimeSeconds: Math.floor(startTimeSeconds),\n\t\t\t\tendTimeSeconds: Math.floor(endTimeSeconds),\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetActivityLogResponse>(message, ClassId.GET_POINT_HISTORY_RESPONSE);\n\t}\n\n\tpublic async getActivityLogT(\n\t\tuser_ext_id: string,\n\t\tstartTimeSeconds: number,\n\t\tendTimeSeconds: number,\n\t\tfrom: number = 0,\n\t\tto: number = 50,\n\t): Promise<TActivityLog[]> {\n\t\tconst limit = to - from > 50 ? 50 : to - from;\n\t\tconst offset = from;\n\n\t\treturn ActivityLogTransform(\n\t\t\t(await this.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset)).logHistory,\n\t\t);\n\t}\n}\n\nexport { SmarticoAPI, MessageSender };\n","import { TSMap } from 'typescript-map';\n\nclass CookieStore {\n\tprivate static cookieStore = new TSMap<string, string[]>();\n\n\tpublic static get(key: string): string[] | undefined {\n\t\treturn CookieStore.cookieStore.get(key);\n\t}\n\n\tpublic static set(key: string, value: string[]) {\n\t\tconst v = value.map((v) => v.split(';')[0]);\n\t\tCookieStore.cookieStore.set(key, v);\n\t}\n}\n\nexport { CookieStore };\n","\nexport enum AnalyticsInterfaceType {\n\tMobile = 0,\n\tDesktop = 1,\n}\n\nexport enum AnalyticsScreenNameId {\n\tOverview = 1,\n\tMissions = 2,\n\tLeaderboards = 3,\n\tTournaments = 4,\n\tTournamentLobby = 5,\n\tLevels = 6,\n\tLevelsMap = 7,\n\tBadges = 8,\n\tBonuses = 9,\n\tSpinAWheel = 10,\n\tStore = 11,\n\tStoreHistory = 12,\n\tInbox = 13,\n\tMatchX = 14,\n\tQuiz = 15,\n\tJackpots = 16,\n\tLootbox = 17,\n\tCustomSection = 18,\n\tShortInbox = 19,\n\tLootboxWeekdays = 20,\n\tLootboxCalendarDays = 21,\n\tTreasureHunt = 22,\n\tLiquidSection = 23,\n\tActivityLog = 24,\n\n\tModalMission = 31,\n\tModalLevel = 32,\n\tModalBadge = 33,\n\tModalStore = 34,\n\tModalBonus = 35,\n\tModalJackpot = 36,\n\tModalUsername = 37,\n\tModalAvatar = 38,\n\tModalQR = 39,\n}\n\nexport enum AnalyticsTournamentsLobbySubScreenNameId {\n\tGeneral = 1,\n\tPrizes = 2,\n\tPlayers = 3,\n\tRelatedGames = 4,\n}\n\nexport enum AnalyticsInboxSubScreenNameId {\n\tAll = 1,\n\tFavorite = 2,\n}\n","export enum QuizSportType {\n\tSoccer = 1,\n\tBasketball = 2,\n\tTennis = 5,\n}\n\nexport const quizSupportedSports = [QuizSportType.Basketball, QuizSportType.Soccer, QuizSportType.Tennis];\n","export enum SAWGPMarketType {\n\tTwoTeamsWithScore = 1,\n\tRedCard = 2,\n\tOneXTwo = 3,\n\tOneXTwoHalftime = 4,\n\t// HalftimeFulltime = 5,\n\tFirstGoal = 6,\n\tDoubleChance = 7,\n\tOverUnder2_5 = 8,\n\tOverUnder1_5Halftime = 9,\n\tOverUnder1_5__2ndHalf = 10,\n\tTotalCorners8_5 = 11,\n\tTotalCorners9_5 = 12,\n\tCorners1x2 = 13,\n\tOne_Two = 14,\n\tOvertime = 15,\n\tOddEven = 16,\n\tOddEvenHomeAway = 17,\n\tFirstSet = 18,\n\tSecondSet = 19,\n\tThirdSet = 20,\n\tFourthSet = 21,\n\tFifthSet = 22,\n\tPlayerOneWinsOneSet = 23,\n\tPlayerTwoWinsOneSet = 24,\n\tLastGoal = 25,\n\n\tCustomSport = 26,\n\tCustomNonSport = 27,\n}\n","export enum QuizAnswersValueType {\n\tHomeTeam = '1',\n\tAwayTeam = '2',\n\tDraw = 'x',\n\tHomeTeamHomeTeam = '1/1',\n\tHomeTeamDraw = '1/x',\n\tHomeTeamAwayTeam = '1/2',\n\tDrawHomeTeam = 'x/1',\n\tDrawDraw = 'x/x',\n\tDrawAwayTeam = 'x/2',\n\tAwayTeamHomeTeam = '2/1',\n\tAwayTeamDraw = '2/x',\n\tAwayTeamAwayTeam = '2/2',\n\tYes = 'yes',\n\tNo = 'no',\n\tOdd = 'odd',\n\tEven = 'even',\n\tHomeOdd = '1/odd',\n\tHomeEven = '1/even',\n\tAwayOdd = '2/odd',\n\tAwayEven = '2/even',\n}\n\nexport const quizAnswerHomeTeamReplacementText = '{quiz_home_team}';\nexport const quizAnswerAwayTeamReplacementText = '{quiz_away_team}';\nexport const quizDrawReplacementText = '{quiz_draw}';\nexport const quizYesReplacementText = '{yes}';\nexport const quizNoReplacementText = '{no}';\nexport const quizOddReplacementText = '{odd}';\nexport const quizEvenReplacementText = '{even}';\nexport const quizOrReplacementText = '{or}';\nexport const quizNoGoalsReplacementText = '{quiz_no_goals}';\n\nexport const quizAnswersTrKeys = {\n\t[quizDrawReplacementText]: 'quizAnswer_draw',\n\t[quizYesReplacementText]: 'quizAnswer_yes',\n\t[quizNoReplacementText]: 'quizAnswer_no',\n\t[quizOddReplacementText]: 'quizAnswer_odd',\n\t[quizEvenReplacementText]: 'quizAnswer_even',\n\t[quizOrReplacementText]: 'quizAnswer_or',\n\t[quizNoGoalsReplacementText]: 'quizAnswer_no_goals',\n};\n","import {\n\tQuizAnswersValueType,\n\tquizAnswerAwayTeamReplacementText,\n\tquizAnswerHomeTeamReplacementText,\n\tquizDrawReplacementText,\n\tquizEvenReplacementText,\n\tquizNoGoalsReplacementText,\n\tquizNoReplacementText,\n\tquizOddReplacementText,\n\tquizOrReplacementText,\n\tquizYesReplacementText,\n} from './MarketsAnswers';\nimport { SAWGPMarketType } from './MarketsType';\n\nconst yesNoAnswers = [\n\t{ text: quizYesReplacementText, value: QuizAnswersValueType.Yes },\n\t{ text: quizNoReplacementText, value: QuizAnswersValueType.No },\n];\n\nconst homeAwayAnswers = [\n\t{ text: quizAnswerHomeTeamReplacementText, value: QuizAnswersValueType.HomeTeam },\n\t{ text: quizAnswerAwayTeamReplacementText, value: QuizAnswersValueType.AwayTeam },\n];\n\nconst homeAwayDrawAnswers = [...homeAwayAnswers, { text: quizDrawReplacementText, value: QuizAnswersValueType.Draw }];\nconst homeAwayNoGoalsAnswers = [...homeAwayAnswers, { text: quizNoGoalsReplacementText, value: QuizAnswersValueType.Draw }];\n\nexport const marketsInfo = [\n\t{\n\t\ttype: SAWGPMarketType.OneXTwo,\n\t\tname: '1x2',\n\t\tquestion: { text: 'Who will win the match ?', trKey: 'quizQuestion_1x2' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OneXTwoHalftime,\n\t\tname: '1x2 Halftime',\n\t\tquestion: { text: 'Who will lead the first half of the match ?', trKey: 'quizQuestion_x2half' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t// {\n\t// \ttype: SAWGPMarketType.HalftimeFulltime,\n\t// \tname: 'Halftime / Fulltime',\n\t// \tquestion: { text: 'Who will lead the first half and who will win the match ?', trKey: 'quizQuestion__HalftimeFulltime' },\n\t// \tanswers: [\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamHomeTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizDrawReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamDraw,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamAwayTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizDrawReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.DrawHomeTeam,\n\t// \t\t},\n\t// \t\t{ text: `${quizDrawReplacementText} / ${quizDrawReplacementText}`, value: QuizAnswersValueType.DrawDraw },\n\t// \t\t{\n\t// \t\t\ttext: `${quizDrawReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.DrawAwayTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamHomeTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizDrawReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamDraw,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamAwayTeam,\n\t// \t\t},\n\t// \t],\n\t// },\n\t{\n\t\ttype: SAWGPMarketType.FirstGoal,\n\t\tname: 'First Goal',\n\t\tquestion: { text: 'Who will score the first goal ?', trKey: 'quizQuestion_firstGoal' },\n\t\tanswers: homeAwayNoGoalsAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.LastGoal,\n\t\tname: 'Last Goal',\n\t\tquestion: { text: 'Who will score the last goal ?', trKey: 'quizQuestion_lastGoal' },\n\t\tanswers: homeAwayNoGoalsAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.DoubleChance,\n\t\tname: 'Double Chance',\n\t\tquestion: { text: 'Who will win the match? Choose a combination:', trKey: 'quizQuestion_doubleChance' },\n\t\tanswers: [\n\t\t\t{\n\t\t\t\ttext: `${quizDrawReplacementText} ${quizOrReplacementText} ${quizAnswerHomeTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.HomeTeamDraw,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: `${quizAnswerHomeTeamReplacementText} ${quizOrReplacementText} ${quizAnswerAwayTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.HomeTeamAwayTeam,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: `${quizDrawReplacementText} ${quizOrReplacementText} ${quizAnswerAwayTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.AwayTeamDraw,\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder2_5,\n\t\tname: 'Over/Under 2.5',\n\t\tquestion: { text: 'Will there be 3 or more goals in the match?', trKey: 'quizQuestion_overUnder2_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder1_5Halftime,\n\t\tname: 'Over/Under 1.5 Halftime',\n\t\tquestion: { text: 'Will there be 2 or more goals in the first half?', trKey: 'quizQuestion_overUnder1_5Halftime' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder1_5__2ndHalf,\n\t\tname: 'Over/Under 1.5 2nd Half',\n\t\tquestion: { text: 'Will there be 2 or more goals in the second half?', trKey: 'quizQuestion_overUnder1_5__2ndHalf' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.RedCard,\n\t\tname: 'Red Card',\n\t\tquestion: { text: 'Will there be a red card in the match?', trKey: 'quizQuestion_redCard' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.TotalCorners8_5,\n\t\tname: 'Total Corners 8.5',\n\t\tquestion: { text: 'Will there be 9 or more corners in the match?', trKey: 'quizQuestion_totalCorners8_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.TotalCorners9_5,\n\t\tname: 'Total Corners 9.5',\n\t\tquestion: { text: 'Will there be 10 or more corners in the match?', trKey: 'quizQuestion_totalCorners9_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.Corners1x2,\n\t\tname: 'Corners 1x2',\n\t\tquestion: { text: 'Which team will have more corners in the match?', trKey: 'quizQuestion_corners1x2' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.One_Two,\n\t\tname: '1-2',\n\t\tquestion: { text: 'Who will win the match ?', trKey: 'quizQuestion_1-2' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.Overtime,\n\t\tname: 'Overtime',\n\t\tquestion: { text: 'Will there be overtime in the match?', trKey: 'quizQuestion_overtime' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OddEven,\n\t\tname: 'Odd/Even',\n\t\tquestion: {\n\t\t\ttext: 'Is the sum of all points scored in the game going to be an odd number or even?',\n\t\t\ttrKey: 'quizQuestion_oddEven',\n\t\t},\n\t\tanswers: [\n\t\t\t{ text: quizOddReplacementText, value: QuizAnswersValueType.Odd },\n\t\t\t{ text: quizEvenReplacementText, value: QuizAnswersValueType.Even },\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OddEvenHomeAway,\n\t\tname: 'Odd/Even Home/Away',\n\t\tquestion: {\n\t\t\ttext: 'Which team will win and what will be the sum of the points (Odd or Even)?',\n\t\t\ttrKey: 'quizQuestion_oddEvenHomeAway',\n\t\t},\n\t\tanswers: [\n\t\t\t{ text: `${quizAnswerHomeTeamReplacementText} - ${quizOddReplacementText}`, value: QuizAnswersValueType.HomeOdd },\n\t\t\t{ text: `${quizAnswerHomeTeamReplacementText} - ${quizEvenReplacementText}`, value: QuizAnswersValueType.HomeEven },\n\t\t\t{ text: `${quizAnswerAwayTeamReplacementText} - ${quizOddReplacementText}`, value: QuizAnswersValueType.AwayOdd },\n\t\t\t{ text: `${quizAnswerAwayTeamReplacementText} - ${quizEvenReplacementText}`, value: QuizAnswersValueType.AwayEven },\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FirstSet,\n\t\tname: 'First Set',\n\t\tquestion: { text: 'Who will win the first set ?', trKey: 'quizQuestion_firstSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.SecondSet,\n\t\tname: 'Second Set',\n\t\tquestion: { text: 'Who will win the second set ?', trKey: 'quizQuestion_secondSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.ThirdSet,\n\t\tname: 'Third Set',\n\t\tquestion: { text: 'Who will win the third set ?', trKey: 'quizQuestion_thirdSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FourthSet,\n\t\tname: 'Fourth Set',\n\t\tquestion: { text: 'Who will win the fourth set ?', trKey: 'quizQuestion_fourthSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FifthSet,\n\t\tname: 'Fifth Set',\n\t\tquestion: { text: 'Who will win the fifth set ?', trKey: 'quizQuestion_fifthSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.PlayerOneWinsOneSet,\n\t\tname: 'Player One Wins One Set',\n\t\tquestion: { text: 'Will Player One win at least one set?', trKey: 'quizQuestion_playerOneWinsOneSet' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.PlayerTwoWinsOneSet,\n\t\tname: 'Player Two Wins One Set',\n\t\tquestion: { text: 'Will Player Two win at least one set?', trKey: 'quizQuestion_playerTwoWinsOneSet' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.CustomNonSport,\n\t\tname: 'Custom question (non sport)',\n\t\tquestion: null,\n\t\tanswers: null,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.CustomSport,\n\t\tname: 'Custom question (sport)',\n\t\tquestion: null,\n\t\tanswers: null,\n\t},\n];\n","import { SAWGPMarketType } from './MarketsType';\nimport { QuizSportType } from './SportTypes';\n\nexport const QuizMarketPerSport = {\n\t[QuizSportType.Basketball]: [\n\t\tSAWGPMarketType.One_Two,\n\t\tSAWGPMarketType.Overtime,\n\t\tSAWGPMarketType.OneXTwo,\n\t\tSAWGPMarketType.OddEven,\n\t\tSAWGPMarketType.OddEvenHomeAway,\n\t\tSAWGPMarketType.DoubleChance,\n\t],\n\t[QuizSportType.Soccer]: [\n\t\tSAWGPMarketType.OneXTwo,\n\t\tSAWGPMarketType.OneXTwoHalftime,\n\t\t// SAWGPMarketType.HalftimeFulltime,\n\t\tSAWGPMarketType.FirstGoal,\n\t\tSAWGPMarketType.LastGoal,\n\t\tSAWGPMarketType.DoubleChance,\n\t\tSAWGPMarketType.OverUnder2_5,\n\t\tSAWGPMarketType.OverUnder1_5Halftime,\n\t\tSAWGPMarketType.OverUnder1_5__2ndHalf,\n\t\tSAWGPMarketType.RedCard,\n\t\tSAWGPMarketType.TotalCorners8_5,\n\t\tSAWGPMarketType.TotalCorners9_5,\n\t\tSAWGPMarketType.Corners1x2,\n\t],\n\t[QuizSportType.Tennis]: [\n\t\tSAWGPMarketType.One_Two,\n\t\tSAWGPMarketType.FirstSet,\n\t\tSAWGPMarketType.SecondSet,\n\t\tSAWGPMarketType.ThirdSet,\n\t\tSAWGPMarketType.FourthSet,\n\t\tSAWGPMarketType.FifthSet,\n\t\tSAWGPMarketType.PlayerOneWinsOneSet,\n\t\tSAWGPMarketType.PlayerTwoWinsOneSet,\n\t\tSAWGPMarketType.OddEven,\n\t],\n};\n","import { SAWTemplate } from \"../MiniGames\";\nimport { QuizAnswersValueType } from \"./MarketsAnswers\";\nimport { SAWGPMarketType } from \"./MarketsType\";\n\n/**\n * GamePickMarketType defines legacy market categories for MatchX events\n */\nexport enum GamePickMarketType {\n\t/** Predict the number of goals */\n\tGoals = 1,\n\t/** Predict the winner */\n\tWinner = 2,\n}\n\n/**\n * GamePickResolutionType defines how a user's prediction was scored after event resolution\n */\nexport enum GamePickResolutionType {\n\t/** Event not yet resolved */\n\tNone = 0,\n\t/** Prediction was wrong */\n\tLost = 2,\n\t/** Prediction was partially correct (e.g. correct winner but wrong score) */\n\tPartialWin = 3,\n\t/** Prediction was fully correct */\n\tFullWin = 4,\n}\n\n/**\n * GPRoundStatus defines the lifecycle stage of a game round\n */\nexport enum GPRoundStatus {\n\t/** Round is in an active/other state */\n\tOther = -1,\n\t/** Round exists but has no events defined yet */\n\tNoEventsDefined = 1,\n\t/** Betting deadline has passed, no more bets allowed */\n\tNoMoreBetsAllowed = 2,\n\t/** All events in the round are resolved, but the round itself is not finalized */\n\tAllEventsResolved_ButNotRound = 3,\n\t/** Round is fully resolved and scored */\n\tRoundResolved = 4,\n}\n\n/**\n * GamePickScoreType defines how scores are calculated for predictions\n */\nexport enum GamePickScoreType {\n\t/** Score based on exact match of predicted result */\n\tExactScore = 1,\n\t/** Score based on closeness (difference) of predicted result */\n\tPointsDifference = 2,\n}\n\n/**\n * GamePickSportType defines supported sport types for events, using Betradar sport IDs\n */\nexport enum GamePickSportType {\n\tSoccer = 1,\n\tBasketball = 2,\n\tBaseball = 3,\n\tIceHockey = 4,\n\tTennis = 5,\n\tHandball = 6,\n\tFloorball = 7,\n\tGolf = 9,\n\tBoxing = 10,\n\tMotorsport = 11,\n\tRugby = 12,\n\tAussieRules = 13,\n\tBandy = 15,\n\tAmericanFootball = 16,\n\tCycling = 17,\n\tSpecials = 18,\n\tSnooker = 19,\n\tTableTennis = 20,\n\tCricket = 21,\n\tDarts = 22,\n\tVolleyball = 23,\n\tFieldHockey = 24,\n\tWaterpolo = 26,\n\tCurling = 28,\n\tFutsal = 29,\n\tBadminton = 31,\n\tBowls = 32,\n\tChess = 33,\n\tBeachVolley = 34,\n\tNetball = 35,\n\tAthletics = 36,\n\tSquash = 37,\n\tLacrosse = 39,\n\tFormula1 = 40,\n\tAlpineSkiing = 43,\n\tBiathlon = 44,\n\tCrossCountry = 46,\n\tNordicCombined = 47,\n\tSkiJumping = 48,\n\tSchwingen = 56,\n\tBeachSoccer = 60,\n\tPesapallo = 61,\n\tESportCounterStrike = 109,\n\tESportLeagueofLegends = 110,\n\tESportDota = 111,\n\tStarCraft = 112,\n\tMMA = 117,\n\tCallOfDuty = 118,\n\tESportOverwatch = 121,\n\tESportRocketLeague = 128,\n\tIndyRacing = 129,\n\tSpeedway = 131,\n\tGaelicFootball = 135,\n\tGaelicHurling = 136,\n\tESporteSoccer = 137,\n\tKabaddi = 138,\n\tESporteBasketball = 153,\n\tBasketball3x3 = 155,\n\tESportArenaofValor = 158,\n\tTouringCarRacing = 188,\n\tMotorcycleRacing = 190,\n\tStockCarRacing = 191,\n}\n\n/**\n * GameRoundOrderType defines how events within a round are ordered for display\n */\nexport enum GameRoundOrderType {\n\t/** Display in the order events were added */\n\tHowAdded = 1,\n\t/** Display in reverse of the order events were added */\n\tHowAddedReversed = 2,\n\t/** Display ordered by event/match date ascending (earliest first) */\n\tEventDateAscending = 3,\n\t/** Display ordered by event/match date descending (latest first) */\n\tEventDateDescending = 4,\n}\n\n/** Round ID constant used to request the overall/seasonal leaderboard across all rounds */\nexport const AllRoundsGameBoardID = -1;\n\n/**\n * QuizEventMeta describes metadata for a quiz-type event (custom question with answer options)\n */\nexport interface QuizEventMeta {\n\t/** List of possible answer options for the quiz question */\n\tanswers?: {\n\t\t/** Answer identifier value sent on submission */\n\t\tvalue: string;\n\t\t/** Localized display text of the answer */\n\t\ttext: string;\n\t\t/** Per-language overrides for the answer text */\n\t\t_translations: {\n\t\t\t[key: string]: {\n\t\t\t\ttext: string;\n\t\t\t};\n\t\t};\n\t}[];\n\t/** URL of an image associated with the question */\n\tquestion_image?: string;\n\t/** Correct answer value after resolution */\n\tresult?: QuizAnswersValueType;\n\t/** Custom question text displayed to the user */\n\tcustom_question: string;\n}\n\n/**\n * GamePickEventMeta describes metadata for a MatchX or Quiz event, including team info and sport context\n */\nexport interface GamePickEventMeta extends QuizEventMeta {\n\t/** Display name of the event/match */\n\tevent_name?: string;\n\t/** Name of the first team (home) */\n\tteam1_name: string;\n\t/** URL of the first team's logo image */\n\tteam1_image: string;\n\t/** Name of the second team (away) */\n\tteam2_name: string;\n\t/** URL of the second team's logo image */\n\tteam2_image: string;\n\t/** Actual result score for team 1 after resolution */\n\tteam1_result?: number;\n\t/** Actual result score for team 2 after resolution */\n\tteam2_result?: number;\n\t/** Betradar sport type ID for the event */\n\tsport_type_id?: number;\n\t/** Whether the event has been canceled */\n\tis_canceled?: boolean;\n\t/** Whether auto-resolution from live data feed is enabled */\n\tauto_resolve_enabled?: boolean;\n\t/** ISO date string for when auto-resolution is expected */\n\tauto_resolve_date?: string;\n\t/** Auto-resolved score for team 1 from live data feed */\n\tteam1_auto_result?: number;\n\t/** Auto-resolved score for team 2 from live data feed */\n\tteam2_auto_result?: number;\n\t/** Auto-resolved answer value from live data feed (for quiz events) */\n\tauto_result?: string;\n\t/** Per-language overrides for team names, event name, and custom question */\n\t_translations: {\n\t\t[key: string]: {\n\t\t\tteam1_name: string;\n\t\t\tteam2_name: string;\n\t\t\tevent_name: string;\n\t\t\tcustom_question: string;\n\t\t};\n\t};\n}\n\n/**\n * GamePickEvent describes a single event (match or question) within a round, including the user's prediction and resolution\n */\nexport interface GamePickEvent {\n\t/** Unique identifier of the event */\n\tgp_event_id: number;\n\t/** Timestamp (ms) when the event was resolved, null if not yet resolved */\n\tevent_resolution_date: number;\n\t/** Timestamp (ms) of the match/event start time */\n\tmatch_date: number;\n\t/** Market type defining the prediction format (e.g. two-team score, quiz question, custom) */\n\tmarket_type_id: SAWGPMarketType;\n\t/** Event metadata containing team names, images, sport type, and question details */\n\tevent_meta: GamePickEventMeta;\n\t/** Whether the current user has submitted a prediction for this event */\n\tuser_placed_bet: boolean;\n\t/** User's predicted score for team 1 (MatchX only). Can be a number or a range object */\n\tteam1_user_selection?: number | { from: number; to: number };\n\t/** User's predicted score for team 2 (MatchX only). Can be a number or a range object */\n\tteam2_user_selection?: number | { from: number; to: number };\n\t/** User's selected answer (Quiz only). Value depends on market type (e.g. '1', '2', 'x', 'yes', 'no') */\n\tuser_selection?: QuizAnswersValueType;\n\t/** How the user's prediction was scored after resolution */\n\tresolution_type_id: GamePickResolutionType;\n\t/** Points awarded for this event based on prediction accuracy */\n\tresolution_score?: number;\n\t/** Whether this event is still accepting predictions */\n\tis_open_for_bets?: boolean;\n\t/** Betting odds details for the event outcomes */\n\todds_details?: { odd_value: { [key: string]: number } };\n\t/** URL of a question-specific image (quiz events) */\n\tquestion_image?: string;\n}\n\n/**\n * GamePickRoundPublicMeta describes the public-facing metadata and translations for a round, configured in the BackOffice\n */\nexport interface GamePickRoundPublicMeta {\n\t/** Localized round name */\n\tround_name: string;\n\t/** Localized round description */\n\tround_description: string;\n\t/** URL of the promotional image for the round */\n\tpromo_image: string;\n\t/** Promotional text displayed with the round */\n\tpromo_text: string;\n\t/** Whether to hide the round from the UI after it has been resolved */\n\thide_resolved_round: boolean;\n\t/** URL of the final screen image for desktop */\n\tfinal_screen_image_desktop: string;\n\t/** URL of the final screen image for mobile */\n\tfinal_screen_image_mobile: string;\n\t/** Message displayed on the final/results screen */\n\tfinal_screen_message: string;\n\t/** Label for the CTA button on the final screen */\n\tfinal_screen_cta_button_title: string;\n\t/** Deep link triggered by the CTA button on the final screen */\n\tfinal_screen_cta_dp: string;\n\t/** Whether users can edit their answers after initial submission (within betting window) */\n\tallow_edit_answers?: boolean;\n\t/** Per-language overrides for round display content */\n\t_translations: {\n\t\t[key: string]: {\n\t\t\tround_name: string;\n\t\t\tround_description: string;\n\t\t\tpromo_image: string;\n\t\t\tpromo_text: string;\n\t\t\tfinal_screen_image_desktop: string;\n\t\t\tfinal_screen_image_mobile: string;\n\t\t\tfinal_screen_message: string;\n\t\t\tfinal_screen_cta_button_title: string;\n\t\t};\n\t};\n}\n\n/**\n * GamePickRoundBase describes a game round's metadata (without events or user-specific data)\n */\nexport interface GamePickRoundBase {\n\t/** Unique round identifier */\n\tround_id: number;\n\t/** Sequential row ID used for ordering rounds */\n\tround_row_id: number;\n\t/** Localized display name of the round */\n\tround_name: string;\n\t/** Localized description of the round */\n\tround_description: string;\n\t/** Label for the CTA button on the final/results screen */\n\tfinal_screen_cta_button_title: string;\n\t/** Message displayed on the final/results screen */\n\tfinal_screen_message: string;\n\t/** URL of the final screen image (desktop) */\n\tfinal_screen_image_desktop: string;\n\t/** URL of the final screen image (mobile) */\n\tfinal_screen_image_mobile: string;\n\t/** URL of the promotional image for the round */\n\tpromo_image: string;\n\t/** Promotional text displayed with the round */\n\tpromo_text: string;\n\t/** Timestamp (ms) when the round opens for participation */\n\topen_date: number;\n\t/** Timestamp (ms) of the last moment bets are accepted */\n\tlast_bet_date: number;\n\t/** Timestamp (ms) when the round is expected to be resolved */\n\tresolution_date: number;\n\t/** Points awarded for a fully correct prediction */\n\tscore_full_win: number;\n\t/** Points awarded for a partially correct prediction */\n\tscore_part_win: number;\n\t/** Points awarded (or deducted) for an incorrect prediction */\n\tscore_lost: number;\n\t/** Whether the round is currently active for participation */\n\tis_active_now: boolean;\n\t/** Whether the round has been fully resolved and scored */\n\tis_resolved: boolean;\n\t/** Current lifecycle status of the round */\n\tround_status_id: GPRoundStatus;\n\t/** Total number of events in the round */\n\tevents_total: number;\n\t/** Number of events that have been resolved */\n\tevents_resolved: number;\n\t/** Scoring method used for this round */\n\tscore_type_id: GamePickScoreType;\n\t/** How events are ordered for display */\n\torder_events: GameRoundOrderType;\n\t/** Maximum number of users shown on the leaderboard */\n\tboard_users_count: number;\n\t/** Whether other users' predictions are hidden until resolution */\n\thide_users_predictions: boolean;\n\t/** Public metadata including translations and display settings from the BackOffice */\n\tpublic_meta: GamePickRoundPublicMeta;\n\t/** Timestamp (ms) when the next round opens, if available */\n\tnext_round_open_date: number;\n\t/** Whether to show aggregated user preference percentages for each outcome */\n\tshow_users_preference: boolean;\n}\n\n/**\n * GamePickRound describes a round with its events and the current user's prediction data\n */\nexport interface GamePickRound extends GamePickRoundBase {\n\t/** List of events (matches/questions) in this round */\n\tevents: GamePickEvent[];\n\t/** Current user's total score in this round */\n\tuser_score: number;\n\t/** Whether the current user has submitted any predictions in this round */\n\tuser_placed_bet: boolean;\n\t/** Whether there are events still open for betting */\n\thas_open_for_bet_events?: boolean;\n\t/** Whether the user has unsaved changes to their predictions */\n\thas_not_submitted_changes?: boolean;\n}\n\n/**\n * GamePickRoundBoard describes a round's leaderboard with ranked users\n */\nexport interface GamePickRoundBoard extends GamePickRoundBase {\n\t/** Current user's leaderboard entry, or null if user hasn't participated */\n\tmy_user: GamePickBoardUser;\n\t/** Ranked list of users on the leaderboard */\n\tusers: GamePickBoardUser[];\n}\n\n/**\n * GamePickBoardUser describes a user's entry on the round leaderboard\n */\nexport interface GamePickBoardUser {\n\t/** External user ID (Smartico numeric user ID) */\n\text_user_id: string;\n\t/** Internal user ID within the games system */\n\tint_user_id: number;\n\t/** Display name shown on the leaderboard */\n\tpublic_username: string;\n\t/** URL of the user's avatar image */\n\tavatar_url: string;\n\t/** User's rank position on the leaderboard, null if not yet ranked */\n\tgp_position: number;\n\t/** User's total score in this round/season */\n\tresolution_score: number;\n\t/** Number of fully correct predictions */\n\tfull_wins_count: number;\n\t/** Number of partially correct predictions */\n\tpart_wins_count: number;\n\t/** Number of incorrect predictions */\n\tlost_count: number;\n}\n\n/**\n * GamePickUserInfo describes the current user's profile in the games system\n */\nexport interface GamePickUserInfo {\n\t/** External user ID (Smartico numeric user ID) */\n\text_user_id: string;\n\t/** Internal user ID within the games system */\n\tint_user_id: number;\n\t/** Display name */\n\tpublic_username: string;\n\t/** URL of the user's avatar image */\n\tavatar_url: string;\n\t/** User's leaderboard rank position */\n\tgp_position?: number;\n\t/** Number of fully correct predictions */\n\tfull_wins_count?: number;\n\t/** Number of partially correct predictions */\n\tpart_wins_count?: number;\n\t/** User's total score */\n\tresolution_score?: number;\n\t/** Last time the user's balance was synced from the Smartico platform */\n\tlast_wallet_sync_time?: Date;\n\t/** User's current points balance */\n\tach_points_balance?: number;\n\t/** User's current gems balance */\n\tach_gems_balance?: number;\n\t/** User's current diamonds balance */\n\tach_diamonds_balance?: number;\n\t/** Whether the user has set a custom public username */\n\tpubic_username_set?: boolean;\n}\n\n/**\n * GamePickGameInfo describes the game configuration including SAW template, rounds list, and label settings\n */\nexport interface GamePickGameInfo {\n\t/** Game template configuration (SAW template) with UI settings, buy-in type, cost, and spin count */\n\tsawTemplate: SAWTemplate;\n\t/** List of all rounds (metadata only, no events) */\n\tallRounds: GamePickRoundBase[];\n\t/** Label/brand configuration and settings */\n\tlabelInfo: any;\n}\n\n/**\n * GamesApiResponse is the standard response wrapper for all GamePick/Quiz API calls\n */\nexport interface GamesApiResponse<T> {\n\t/** Error code: 0 on success, non-zero on failure */\n\terrCode: number;\n\t/** Human-readable error message when errCode is non-zero */\n\terrMessage?: string;\n\t/** Response payload, present on success */\n\tdata?: T;\n}\n\n/**\n * GamePickRequestParams describes the base parameters required for GamePick API calls\n */\nexport interface GamePickRequestParams {\n\t/** ID of the MatchX or Quiz game template */\n\tsaw_template_id: number;\n\t/** External user ID */\n\text_user_id: string;\n\t/** Smartico external user ID used for platform API calls */\n\tsmartico_ext_user_id: string;\n\t/** Language code for translations (e.g. 'EN', 'DE') */\n\tlang?: string;\n}\n\n/**\n * GamePickRoundRequestParams extends base params with a specific round ID\n */\nexport interface GamePickRoundRequestParams extends GamePickRequestParams {\n\t/** ID of the specific round */\n\tround_id: number;\n}\n","enum JackpotContributionType {\n\tFixed = 1,\n\tPercentage = 2,\n}\n\nexport { JackpotContributionType };\n","enum JackPotTemparature {\n\t/** cold, seed amount < current pot < (min amount - seed amount)/2 */\n\tCOLD = 0,\n\t/** warm, (min amount - seed amount)/2 < current pot < min amount */\n\tWARM = 1,\n\t/** hot, current pot > min amount, entered explosion range */\n\tHOT = 2,\n\t/** burning, current pot > min amount + 0.5 * (max amount - min amount). E.g. mid of allowed explosion range */\n\tBURNING = 3,\n}\n\n/**\n * Live snapshot of one jackpot pot's value and temperature.\n * Embedded on `JackpotDetails.pot`; refreshed at the 1 s SDK cache TTL.\n */\ninterface JackpotPot {\n\t/** Template ID this pot belongs to. */\n\tjp_template_id: number;\n\t/** Stable numeric ID of the current pot instance (rotates when the pot explodes). */\n\tjp_pot_id: number;\n\t/** Current pot amount in the jackpot's native currency (`jp_currency`). */\n\tcurrent_pot_amount: number;\n\t/** Current pot amount converted to the user's wallet currency (`user_currency`). */\n\tcurrent_pot_amount_user_currency: number;\n\t/** Unix ms timestamp of when this pot last exploded; `0` if it has never exploded. */\n\texplode_date_ts: number;\n\t/** Heat band of the pot relative to its explosion range; see {@link JackPotTemparature}. */\n\tcurrent_pot_temperature: JackPotTemparature;\n}\n\nexport { JackpotPot, JackPotTemparature };\n","enum JackpotType {\n\tMultiUser = 1,\n\tPersonal = 2,\n}\n\nexport { JackpotType };\n","/**\n * Limit error codes returned in `errCode` by the `avatarsCustomize` method.\n * See the `avatarsCustomize` TSDoc for the full table (including the generic\n * `-1` failure, which has no named member here).\n */\nexport enum AvatarCustomizeErrorCode {\n\t/** The user has reached the operator-configured per-user monthly cap on custom-avatar generations. */\n\tAVATAR_USER_LIMIT = 12001,\n\t/** The brand's operator-configured shared monthly pool of custom-avatar generations is exhausted. */\n\tAVATAR_LABEL_LIMIT = 12002,\n}\n","/**\n * Error codes returned in `errCode` by the `joinClan` method (also carried\n * on `TClanJoinResult`). These are terse value definitions for lookup; the\n * full per-code narrative and UI handling lives in the `joinClan` method\n * TSDoc, which owns the error table.\n */\nexport enum JoinClanErrorCode {\n\t/** Success — join completed; entry fee (if any) deducted. */\n\tJOIN_CLAN_OK = 0,\n\t/** Request was malformed (missing or invalid parameters). */\n\tJOIN_CLAN_INVALID_PARAMETERS = 1000,\n\t/** Clan doesn't exist for this label. Archived clans are also reported as `1001`. */\n\tJOIN_CLAN_NOT_FOUND = 1001,\n\t/** Clan is full — member capacity reached. */\n\tJOIN_CLAN_FULL = 1002,\n\t/** Insufficient balance for the entry fee (points / gems / diamonds). */\n\tJOIN_CLAN_INSUFFICIENT_FUNDS = 1003,\n\t/** User doesn't meet the clan's entry segment or conditions. */\n\tJOIN_CLAN_SEGMENT_MISMATCH = 1004,\n\t/**\n\t * User is not in a clan. Note: a `registerInTournament` response code\n\t * that shares this enum — never returned by `joinClan`.\n\t */\n\tJOIN_CLAN_USER_IS_NOT_IN_CLAN = 1005,\n\t/** User is within the clan-switch cooldown window (switch only). */\n\tJOIN_CLAN_COOLDOWN_ACTIVE = 1006,\n\t/**\n\t * Clan joined after tournament start. Note: a `registerInTournament`\n\t * response code that shares this enum — never returned by `joinClan`.\n\t */\n\tJOIN_CLAN_JOINED_AFTER_TOURNAMENT_START = 1011,\n}\n"],"names":["ClassId","IntUtils","uuid","a","b","Math","random","toString","isNotNull","val","isNotEmpty","length","replaceAll","value","regex","replacement","replace","RegExp","escapeRegExp","v","JsonOrText","str","includes","JSON","parse","e","isWithinPeriod","timestamp","period","now","Date","completedDate","getFullYear","getMonth","getDate","startOfWeek","setDate","getDay","setHours","endOfWeek","SAWBuyInType","SAWBuyInTypeName","SAWBuyInTypeNamed","type","_SAWBuyInType$Free$SA","Free","Points","Spins","Gems","Diamonds","Unknown","SAWUtils","canPlay","t","user_balances","undefined","saw_buyin_type_id","spin_count","balance","ach_points_balance","ach_gems_balance","ach_diamonds_balance","buyin_cost_points","console","error","SAWAcknowledgeType","SAWAcknowledgeTypeName","SAWAcknowledgeTypeNamed","_SAWAcknowledgeType$S","Silent","QuickMessage","FullMessage","ExplicityAcknowledge","SAWAskForUsername","SAWGameType","SAWGameTypeName","SAWGameTypeNamed","_SAWGameType$SpinAWhe","SpinAWheel","ScratchCard","MatchX","GiftBox","PrizeDrop","Quiz","LootboxWeekdays","LootboxCalendarDays","TreasureHunt","Voyager","Plinko","CoinFlip","CustomMinigame","SAWExposeUserSpinId","SAWExposeUserSpinIdName","SAWExposeUserSpinIdNamed","id","_SAWExposeUserSpinId$","UserId","SpinId","SAWGameLayout","SAWGameLayoutName","SAWGameLayoutNamed","layout","_SAWGameLayout$Horizo","Horizontal","VerticalMap","SAWPrizeType","MiniGamePrizeTypeName","MiniGamePrizeTypeNamed","_SAWPrizeType$NO_PRIZ","NO_PRIZE","POINTS","BONUS","MANUAL","SPIN","JACKPOT","CHANGE_LEVEL","MISSION","RAFFLE_TICKET","GEMS_AND_DIAMONDS","UNKNOWN","SAWTemplatesTransform","items","map","r","_r$saw_skin_ui_defini","x","_extends","saw_template_id","name","saw_template_ui_definition","description","thumbnail","saw_skin_ui_definition","skin_folder","saw_skin_key","visibile_when_can_spin","over_limit_message","no_attempts_message","jackpot_symbol","saw_game_type","saw_game_type_id","saw_buyin_type","buyin_cost_gems","buyin_cost_diamonds","jackpot_add_on_attempt","jackpot_current","promo_image","promo_text","custom_data","expose_game_stat_on_api","relative_period_timezone","activeFromDate","activeTillDate","next_available_spin_ts","steps_to_finish_game","custom_section_id","game_layout","show_prize_history","max_number_of_attempts","maxSpinsCount","max_spins_period_ms","maxSpinsPediodMs","expose_user_spin_id","prizes","p","_p$saw_prize_ui_defin","y","saw_prize_id","saw_prize_ui_definition","prize_type","prize_type_id","prize_value","font_size","font_size_mobile","icon","position","sectors","acknowledge_type","aknowledge_message","acknowledge_dp","acknowledge_action_title","acknowledge_dp_additional","acknowledge_action_title_additional","out_of_stock_message","pool","pool_initial","wins_count","weekdays","active_from_ts","active_till_ts","is_surcharge","is_deleted","prize_modifiers","allow_split_decimal","hide_prize_from_history","requirements_to_get_prize","max_give_period_type_id","SAWSpinErrorCode","SAWWinSoundType","SAWWinSoundFiles","_SAWWinSoundFiles","NoSound","Disappointing","Positive","HighlyPositive","SAWHistoryTransform","template","prize_amount","client_request_id","is_claimed","create_date_ts","acknowledge_date_ts","PrizeModifiers","PrizeModifiersKeysNames","_PrizeModifiersKeysNa","SAWWheelLayout","SAWGameDifficultyType","SAWGameDifficultyTypeName","SawGameDifficultyTypeNamed","_SAWGameDifficultyTyp","EASY","MEDIUM","HARD","AttemptPeriodType","NodeCache","_this","ttlChecker","cache","setInterval","getTime","key","hasOwnProperty","o","ttl","_proto","prototype","get","set","ttlSeconds","remove","flushAll","clearInterval","ECacheContext","OCache","init","cacheContext","oKey","stringify","deepClone","use","f","Promise","resolve","_temp","then","_f2","reject","clear","clearContext","_this2","clearAll","_this3","ActivityTypeLimited","CoreUtils","currencySymbol","currency","_USD$EUR$JPY$GBP$AUD$","toUpperCase","USD","EUR","JPY","GBP","AUD","CAD","CHF","CNY","SEK","NZD","MXN","SGD","HKD","NOK","KRW","TRY","INR","RUB","BRL","ZAR","avatarUrl","avatar_id","avatarDomain","startsWith","endsWith","slice","PublicLabelSettings","TranslationArea","InboxMessagesTransform","item","sent_date","createDate","message_guid","engagement_uid","read","is_read","favorite","is_starred","category_id","expire_on_dt","InboxMessageBodyTransform","action","image","title","preview_body","body","additional_buttons","buttons","text","inbox_cta_text","html_body","InboxMessageType","OpenLinksType","InboxCategories","InboxReadStatus","BuyStoreItemErrorCode","StoreCategoryTransform","_r$publicMeta","_r$publicMeta2","publicMeta","order","StoreItemPurchaseType","StoreItemType","StoreItemTypeName","StoreItemTypeNamed","_StoreItemType$Bonus$","Bonus","Tangible","MiniGameSpin","ChangeLevel","RaffleTicket","mapPurchaseType","purchaseType","StoreItemTransform","filter","_r$itemPublicMeta$pri","_r$categoryIds","_r$relatedGames","itemPublicMeta","purchase_type","price","image_url","ribbon","label_tag","custom_label_tag","limit_message","purchase_limit_message","priority","related_item_ids","related_items","hint_text","itemTypeId","can_buy","canBuy","category_ids","categoryIds","shopPool","active_till_date","show_timer","discounted_price","discount_prize","discount_price_ribbon","discount_prize_ribbon","custom_ribbon_image","only_in_custom_section","custom_section_type_id","cant_buy_message","related_games","relatedGames","g","game_public_meta","enabled","i","ext_game_id","link","game_categories","game_provider","mobile_spec_link","StoreItemPurchasedTransform","purchasedToday","purchase_ts","purchasedThisWeek","purchasedThisMonth","purchase_points_amount","purchased_today","purchased_this_week","purchased_this_month","AchievementStatus","AchievementTaskType","AchievementType","AchievementAvailabilityStatus","BadgesTimeLimitStates","USER_STATE_PARAMS_KEYS_GAMES","USER_STATE_PARAMS_KEYS_BET_AMOUNT","MINOR_WORDS","Set","toGameTitleCase","raw","tokens","toLowerCase","split","wordTokens","test","lastWordIdx","wordIndex","token","isFirst","isLast","has","charAt","join","MissionUtils","getAvailabilityStatus","mission","activeFrom","getMs","activeTill","startDate","start_date_ts","timeLimit","time_limit_ms","requiresOptIn","requiresOptin","optedIn","isOptedIn","isLockedMission","ach_status_id","AvailableLocked","isLocked","AvailableActive","AvailableInactive","Available","UnavailableWithActiveFrom","AvailableWithActiveTillActive","AvailableWithActiveTillInactive","AvailableWithActiveTill","MissedByActiveTill","endDate","AvailableLimitedActive","MissedByLimitInTime","AvailableLimitedInactive","AvailableLimited","AvailableFullyLimitedActive","AvailableFullyLimitedInactive","AvailableFullyLimited","ts","replaceTagsFavMissionTask","_ref","_task$task_public_met","task","valueToReplace","result","userStateParams","user_state_params","userStateOperator","task_public_meta","user_state_operations","userStateParamsKeys","Object","keys","operatorsMulti","operatorsPos","suggestedGames","suggestedValue","forEach","k","_userStateOperator$k","operator","op","_userStateParams$k","Boolean","cleaned","pos","Number","currencyFromTheTask","core_wallet_currency","replaceFavGameNameTag","_ref2","determineBadgeState","badge","progress","isCompleted","complete_date_ts","BeforeStartDate","AfterStartDateNoProgress","AfterStartDateNoProgressAndEndDate","AfterStartDateWithProgressAndEndDate","AfterEndDateNotStarted","AfterEndDateWithProgress","enrichUserAchievementsWithBadgeState","ach_type_id","Badge","badgeTimeLimitState","UserAchievementTransform","ach_id","_missionName","_missionSubHeader","_missionDescription","_r$ach_categories","completedToday","completedThisWeek","completedThisMonth","missionName","ach_public_meta","missionSubHeader","sub_header","missionDescription","achievementTasks","_r$ach_public_meta$na","_r$ach_public_meta$su","_r$ach_public_meta$de","unlock_mission_description","is_completed","is_locked","is_requires_optin","is_opted_in","dt_start","reward","Mission","cta_action","cta_text","tasks","task_type_id","CompleteAchievement","_t$task_public_meta","task_id","points_reward","gems_reward","diamonds_reward","userProgress","execution_count_expected","executionCount","execution_count_actual","userExecutedCount","display_progress_as_count","stage_image","ach_categories","ach_completed_id","requires_prize_claim","prize_claimed_date_ts","complete_date","completed_today","completed_this_week","completed_this_month","availability_status","claim_button_title","claim_button_action","hide_locked_mission","prize_claim_expiration_date","prize_claim_period_type_id","Recurring","next_recurrence_date_ts","milliseconds_till_available","RecurringUponCompletion","completion_count","completed_count","max_completion_count","recurring_quantity","ScheduledMissionType","AchCategoryTransform","MissionCategory","AchievementClaimPeriodTypeId","clanTournamentPlayersTransform","response","clan_id","clan_public_meta","players","user_id","userId","clean_ext_user_id","cleanExtUserId","public_username","userAltName","avatar_real_id","avatar_url","scores","is_me","isMe","TournamentRegistrationType","TournamentRegistrationTypeGetName","_TournamentRegistrati","AUTO","BUY_IN_POINTS","MANUAL_APPROVAL","OPT_IN","REQUIRES_QUALIFICATION","BUY_IN_GEMS","BUY_IN_DIAMONDS","TournamentRegistrationStatus","TournamentRegistrationStatusName","TournamentRegistrationStatusNamed","CANCELLED","FINISHED","NOT_REGISTERED","PENDING","QUALIFIED_PENDING_REGISTRATION","REGISTERED","REGISTERED_PENDING_QUALIFICATION","TournamentInstanceStatus","TournamentInstanceStatusName","s","_TournamentInstanceSt","PUBLISHED","REGISTER","STARTED","FAILED","FINALIZING","tournamentPrizeTypeToPrizeName","_ActivityTypeLimited$","DoNothing","DeductPoints","ResetPoints","MiniGameAttempt","AddGemsAndDiamonds","DeductGemsAndDiamonds","ResetGemsAndDiamonds","TournamentUtils","isCanRegister","tournament","tournamentRegistrationStatus","isUserRegistered","playersMaxCount","registrationCount","registrationType","tournamentInstanceStatus","allowLateRegistration","isInProgress","isActive","isFinished","isCancelled","isUpcoming","getPlayerTransformed","player","playerTransformed","user_ext_id","crm_brand_id","crmBrandId","getPrizeTransformed","prize","TournamentItemsTransform","tournamentId","instance_id","tournamentInstanceId","tournament_id","segment_dont_match_message","image1","image2","image_url2","image2_mobile","image_url2_mobile","prize_pool_short","custom_price_text","is_featured","featured","start_time","startTimeTs","end_time","endTimeTs","registration_count","is_user_registered","players_min_count","playersMinCount","players_max_count","registration_status","registration_type","registration_cost_points","buyInAmount","registration_cost_gems","registration_cost_diamonds","duration_ms","durationMs","is_active","is_can_register","is_cancelled","is_finished","is_in_progress","is_upcoming","min_scores_win","minScoreToWin","hide_leaderboard_min_scores","hideLeaderboardsMinScores","total_scores","totalScores","is_clan_based","isClanBased","prizeStructure","tournamentPlayer","me","tournamentInfoItemTransform","_TournamentItemsTrans","_t$tournamentInfo$tou","_t$tournamentInfo","_t$tournamentInfo2","tournamentInfo","tournamentLobbyInfo","userPosition","_t$userClanId","user_clan_id","userClanId","clan_leaderboard","clanLeaderboard","entry","clanId","public_meta","rank","total_score","totalScore","contributing_members","memberCount","clan_prize_structure","clanPrizes","clan_place","prize_pool_amount","prize_pool_currency_code","activity_type_id","details_json","prize_name","tiers","player_tiers","tier","player_place_from","player_place_to","pool_amount","distribution_type","TournamentRegistrationError","TournamentType","LeaderBoardPeriodType","pointsRewardTransform","reward_points","place","points","getLeaderBoardPlayerTransformed","user","user_alt_name","level_id","position_in_board","points_accumulated","getLeaderBoardTransform","board","board_id","board_public_meta","rules","period_type_id","version_id","versiod_id","create_date","rewards","users","positions","GetLevelMapResponseTransform","levels","mapped","l","_l$level_public_meta","level_public_meta","required_points","visibility_points","parseInt","required_level_counter_1","required_level_counter_2","ordinal_position","ordinalById","Map","concat","sort","index","CACHE_DATA_SEC","JACKPOT_TEMPLATE_CACHE_SEC","JACKPOT_POT_CACHE_SEC","JACKPOT_WINNERS_CACHE_SEC","JACKPOT_ELIGIBLE_GAMES_CACHE_SEC","onUpdateContextKey","WSAPIBase","api","userExtId","onUpdateCallback","clearCaches","updateEntity","contextKey","payload","WSAPI","onUpdate","ticketsTransform","ticekt_id","ticket_id_string","winnersTransform","username","ticket","raf_won_id","claimed_date","prizeTransform","prize_id","prizes_per_run","prizes_per_run_actual","chances_to_win_perc","min_required_total_tickets","cap_prizes_per_run","stock_items_per_draw","should_claim","winners","requires_claim","min_required_tickets_for_user","drawTransform","draw_id","image_url_mobile","icon_url","background_image_url","background_image_url_mobile","is_grand","current_state","run_id","execution_type","execution_ts","previous_run_ts","previous_run_id","ticket_start_ts","allow_multi_prize_per_ticket","total_tickets_count","my_tickets_count","my_last_tickets","user_opted_in","requires_optin","winners_limit","winners_offset","winners_total","raffleTransform","raffle_id","start_date","end_date","end_date_ts","max_tickets_count","current_tickets_count","draws","ticket_cap_visualization","drawRunTransform","res","_res$draw$ticket_star","draw","RaffleTicketCapVisualization","RaffleDrawInstanceState","RaffleDrawTypeExecution","drawRunHistoryTransform","draw_runs","actual_execution_ts","is_winner","has_unclaimed_prize","raffleClaimPrizeResponseTransform","info","errorCode","errCode","errorMessage","errMsg","WSAPIUser","_WSAPIBase","apply","arguments","_inheritsLoose","getUserProfile","tracker","assign","userPublicProps","Error","checkSegmentMatch","segment_id","coreCheckSegments","find","is_matching","checkSegmentListMatch","segment_ids","Array","isArray","getLevels","Levels","levelsGetT","getCurrentLevel","_this4","CurrentLevel","getLevelCurrent","getUserLevelExtraCounters","_this5","LevelExtraCounters","getUserGamificationInfoT","getActivityLog","startTimeSeconds","endTimeSeconds","from","to","_this6","ActivityLog","getActivityLogT","notifyActivityLogUpdate","_this7","startSeconds","endSeconds","WSAPIGeneral","_WSAPIUser","getCustomSections","CustomSections","customSectionsGetT","getTranslations","lang_code","getTranslationsT","translations","getRelatedItemsForGame","related_game_id","WSAPIMissions","_WSAPIGeneral","getMissions","Missions","missionsGetItemsT","getBadges","Badges","badgetsGetItemsT","getAchCategories","AchCategories","achGetCategoriesT","requestMissionOptIn","mission_id","missionOptIn","err_code","err_message","requestMissionClaimReward","missionClaimPrize","updateMissions","WSAPIBonuses","_WSAPIMissions","getBonuses","Bonuses","bonusesGetItemsT","claimBonus","bonus_id","bonusClaimItem","success","updateBonuses","WSAPIStore","_WSAPIBonuses","_len","args","_key","call","storeHistoryOnUpdateParams","limit","offset","storeHistoryCacheKey","StoreHistory","getStoreItems","StoreItems","storeGetItemsT","buyStoreItem","item_id","getStoreCategories","StoreCategories","storeGetCategoriesT","getStorePurchasedItems","_temp2","requestLimit","requestOffset","cacheKey","storeGetPurchasedItemsT","updateStorePurchasedItems","updateStoreItems","WSAPITournaments","_WSAPIStore","getTournamentsList","TournamentList","tournamentsGetLobbyT","getTournamentInstanceInfo","tournamentsGetInfoT","getClanTournamentPlayers","clanTournamentGetPlayers","registerInTournament","updateTournaments","WSAPIClans","_WSAPITournaments","getClans","Clans","clansGetListT","getClanInfo","clansGetInfoT","joinClan","clanJoin","updateClans","WSAPIJackpots","_WSAPIClans","jackpotGetSignature","jackpotClearCache","Jackpots","Pots","JackpotWinners","jackpotGet","signature","jp_template_id","jackpots","pots","_jackpots","_pots","jp","pot","jp_public_meta","_OCache$use","_jp","jp_template_ids","potGet","_this2$api$potGet","_OCache$use2","jackpotOptIn","jackpotOptOut","getJackpotWinners","getJackpotWinnersT","getJackpotEligibleGames","JackpotEligibleGames","getJackpotEligibleGamesT","WSAPIRaffles","_WSAPIJackpots","updateRaffles","getRafflesT","Raffles","getRaffles","getRaffleDrawRun","props","getRaffleDrawRunT","winners_from","winners_to","getRaffleDrawRunsHistory","claimRafflePrize","won_id","requestRaffleOptin","raffle_run_id","raffleOptin","getRaffleWonPrizes","_props$offset","_props$limit","WSAPIMiniGames","_WSAPIRaffles","getMiniGames","Saw","sawGetTemplatesT","getMiniGamesHistory","SAWHistory","getSawWinningHistoryT","playMiniGame","template_id","_temp4","_ref3","_ref3$acknowledge","acknowledge","sawSpinRequest","_temp3","doAcknowledgeRequest","request_id","miniGameWinAcknowledgeRequest","playMiniGameBatch","_temp5","_ref4","sawSpinBatchRequest","request_ids","results","doAcknowledgeBatchRequest","errMessage","jackpot_amount","first_spin_in_period","updateOnSpin","data","templates","findIndex","reloadMiniGameTemplate","updatedTemplates","WSAPIAvatars","_WSAPIMiniGames","getAvatarsList","AvatarsList","avatarsGetListT","getAvatarsCustomized","AvatarsCustomized","avatarsGetCustomizedT","getAvatarPrompts","AvatarPrompts","avatarsGetPromptsT","setAvatar","avatarSetAvatar","_r$errCode","avatarsCustomize","required","_i","_required","field","cdn_url","WSAPIGamePick","_WSAPIAvatars","gamePickGetActiveRounds","gpGetActiveRounds","gamePickGetActiveRound","round_id","gpGetActiveRound","gamePickGetHistory","gpGetGamesHistory","gamePickGetBoard","gpGetGameBoard","gamePickSubmitSelection","_props$round","round","gpSubmitSelection","gamePickSubmitSelectionQuiz","_props$round2","gamePickGetUserInfo","gpGetUserInfo","gamePickGetGameInfo","_this8","gpGetGameInfo","gamePickGetRoundInfoForUser","_this9","int_user_id","gpGetRoundInfoForUser","WSAPILeaderBoard","_WSAPIGamePick","getLeaderBoard","periodType","getPreviousPeriod","LeaderBoards","leaderboardsGetT","getLeaderBoards","leaderboardsGetListT","WSAPIInbox","_WSAPILeaderBoard","reportImpressionEvent","activityType","reportEngagementImpression","reportClickEvent","reportEngagementAction","getInboxMessages","onlyFavorite","categoryId","read_status","InboxMessages","getInboxMessagesT","getInboxUnreadCount","InboxUnreadCount","getInboxUnreadCountT","getInboxMessageBody","messageGuid","getInboxMessageBodyT","markInboxMessageAsRead","markInboxMessageRead","markAllInboxMessagesAsRead","markAllInboxMessageRead","markUnmarkInboxMessageAsFavorite","mark","deleteInboxMessage","deleteAllInboxMessages","updateInboxUnreadCount","count","updateInboxMessages","_this0","_WSAPIInbox","on","SAW_SPINS_COUNT_PUSH","SAW_SHOW_SPIN_PUSH","SAW_AKNOWLEDGE_RESPONSE","SAW_DO_SPIN_RESPONSE","MISSION_OPTIN_RESPONSE","ACHIEVEMENT_CLAIM_PRIZE_RESPONSE","RELOAD_ACHIEVEMENTS_EVENT","TOURNAMENT_REGISTER_RESPONSE","BUY_SHOP_ITEM_RESPONSE","CLIENT_ENGAGEMENT_EVENT_NEW","LOGOUT_RESPONSE","IDENTIFY_RESPONSE","JP_WIN_PUSH","_data","JP_OPTOUT_RESPONSE","JP_OPTIN_RESPONSE","CLAIM_BONUS_RESPONSE","SAW_DO_SPIN_BATCH_RESPONSE","RAF_CLAIM_PRIZE_RESPONSE","GET_INBOX_MESSAGES_RESPONSE","unread_count","CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT","_data$props","_data$props2","_data$props3","_data$props4","_data$props5","core_inbox_unread_count","RAF_OPTIN_RESPONSE","AchCustomSectionType","AchCustomLayoutTheme","AchMissionsTabsOptions","AchOverviewMissionsFilter","LiquidEntityData","UICustomSectionTransform","customSections","section_type_id","menu_img","menu_name","custom_skin_images","generic_custom_css","mission_tabs_options","overview_missions_count","overview_missions_filter","url_or_dp","theme","LEVELS","liquid_entity_data","ach_tournament_id","show_raw_data","liquid_template","BADGES","ach_category_ids","STORE","shop_category_ids","push","BonusItemsTransform","is_redeemable","redeemable","redeem_date","redeemDate","label_bonus_template_id","labelBonusTemplateId","bonus_status_id","bonusStatusId","label_bonus_template_meta_map","labelBonusTemplateMetaMap","bonus_meta_map","bonusMetaMap","BonusStatus","UserBalanceType","ActivityLogTransform","_item$type","itemTransformed","source_type_id","amount","points_collected","user_points_balance","total_ever","user_points_ever","PointChangeSourceType","avatarDefinitionTransform","is_default","hide_until_achieved","url","avatar_source_type_id","active_from_date","is_given","is_in_use","avatarCustomizedTransform","dt_created","avatarPromptTransform","prompt_id","cost_currency_type_id","cost_value","GetJackpotWinnersResponseTransform","winnerInfo","winner","win_date_ts","jp_pot_id","GetJackpotEligibleGamesResponseTransform","eligible_games","games","game","game_id","ach_game_id","recover","PUBLIC_API_URL","C_SOCKET_PROD","GAMES_API_URL","AVATAR_DOMAIN","DEFAULT_LANG_EN","SMR_TO_CLOUDFRONT_DOMAINS","SMR_DOMAIN_REGEX","d","SmarticoAPI","label_api_key","brand_api_key","messageSender","options","_options$tracker","_options$tracker2","publicUrl","wsUrl","inboxCdnUrl","partnerUrl","gamesApiUrl","baseRgApiParams","avatarOriginDomain","envId","logger","logCIDs","logHTTPTiming","always","getPublicUrl","getPublicWsUrl","env_id","String","getEnvId","brand_key","params","hash","getAvatarUrl","getAvatarOriginUrl","getCleanLabelApiKey","getEnvDnsSuffix","ENV_ID","substring","replaceSmrDomainsWithCloudfront","isString","source","replaced","match","err","send","message","expectCID","force_language","_result","_exit","cid","_iterator","_createForOfIteratorHelperLoose","_step","done","obj","request","_catch","timeStart","_this$messageSender","errSetup","timeEnd","warn","buildMessage","api_key","ext_user_id","coreReportCustomEvent","eventType","eventMessage","EVENT","EVENT_RESPONSE","coreGetTranslations","areas","cacheSec","trim","Translations","tsBaseRQ","GET_TRANSLATIONS_REQUEST","hash_code","GET_TRANSLATIONS_RESPONSE","trBase","trUserRQ","trUser","_trUser$translations","coreIdentifyLabel","LabelInfo","INIT","INIT_RESPONSE","coreIdentifyUser","IDENTIFY","coreChangeUsername","public_username_custom","CLIENT_SET_CUSTOM_USERNAME_REQUEST","CLIENT_SET_CUSTOM_USERNAME_RESPONSE","CHECK_SEGMENT_MATCH_REQUEST","CHECK_SEGMENT_MATCH_RESPONSE","segments","CLIENT_ENGAGEMENT_IMPRESSION_REQUEST","CLIENT_ENGAGEMENT_ACTION_REQUEST","JP_GET_JACKPOTS_REQUEST","JP_GET_JACKPOTS_RESPONSE","JP_GET_LATEST_POTS_REQUEST","JP_GET_LATEST_POTS_RESPONSE","JP_OPTIN_REQUEST","_this1","JP_OPTOUT_REQUEST","_this10","JP_GET_WINNERS_REQUEST","JP_GET_WINNERS_RESPONSE","_this11","_this11$getJackpotWin","_this12","JP_GET_ELIGIBLE_GAMES_REQUEST","JP_GET_ELIGIBLE_GAMES_RESPONSE","_this13","sawGetTemplates","is_visitor_mode","_this14","SAW_GET_SPINS_REQUEST","SAW_GET_SPINS_RESPONSE","_t$saw_template_ui_de","_t$saw_template_ui_de2","jackpotValue","_this15","_this15$sawGetTemplat","_this16","SAW_AKNOWLEDGE_REQUEST","_this17","SAW_DO_SPIN_REQUEST","spinAttemptResponse","_SAWSpinErrorCode$SAW","status","SAW_OK","SAW_NO_SPINS","SAW_PRIZE_POOL_EMPTY","SAW_NOT_ENOUGH_POINTS","SAW_FAILED_MAX_SPINS_REACHED","SAW_TEMPLATE_NOT_ACTIVE","SAW_NOT_IN_SEGMENT","SAW_NO_BALANCE_GEMS","SAW_NO_BALANCE_DIAMONDS","_this18","SAW_AKNOWLEDGE_BATCH_RESPONSE","spins_count","_this19","spins","SAW_DO_SPIN_BATCH_REQUEST","getSawWinningHistory","_this20","GET_SAW_HISTORY_REQUEST","GET_SAW_HISTORY_RESPONSE","_this21","_this21$getSawWinning","_this22","MISSION_OPTIN_REQUEST","achievementId","_this23","ACHIEVEMENT_CLAIM_PRIZE_REQUEST","_this24","TOURNAMENT_REGISTER_REQUEST","itemId","_this25","BUY_SHOP_ITEM_REQUEST","inboxGetMessages","_this26","GET_INBOX_MESSAGES_REQUEST","storeGetItems","_this27","GET_SHOP_ITEMS_REQUEST","GET_SHOP_ITEMS_RESPONSE","_this28","_this28$storeGetItems","storeGetCategories","_this29","GET_SHOP_CATEGORIES_REQUEST","GET_SHOP_CATEGORIES_RESPONSE","_this30","_this30$storeGetCateg","categories","storeGetPurchasedItems","_this31","ACH_SHOP_ITEM_HISTORY_REQUEST","ACH_SHOP_ITEM_HISTORY_RESPONSE","_this32","_this32$storeGetPurch","missionsGetItems","_this33","GET_ACHIEVEMENT_MAP_REQUEST","GET_ACHIEVEMENT_MAP_RESPONSE","responseClone","achievements","_this34","_this34$missionsGetIt","getUserGamificationInfo","_this35","GET_ACHIEVEMENT_USER_REQUEST","GET_ACHIEVEMENT_USER_RESPONSE","_this36","level_counter_1","level_counter_2","achGetCategories","_this37","GET_ACH_CATEGORIES_REQUEST","GET_ACH_CATEGORIES_RESPONSE","_this38","_this38$achGetCategor","badgetsGetItems","_this39","bonusesGetItems","_this40","GET_BONUSES_REQUEST","GET_BONUSES_RESPONSE","_this41","CLAIM_BONUS_REQUEST","bonusId","_this42","_this42$bonusesGetIte","bonuses","_this43","_this43$badgetsGetIte","tournamentsGetLobby","_this44","GET_TOURNAMENT_LOBBY_REQUEST","GET_TOURNAMENT_LOBBY_RESPONSE","_this45","_this45$tournamentsGe","tournaments","clansGetList","_this46","GET_CLAN_LIST_REQUEST","GET_CLAN_LIST_RESPONSE","_this47","_response$join_date","clans","cooldown_until","join_date","clansGetInfo","_this48","GET_CLAN_INFO_REQUEST","GET_CLAN_INFO_RESPONSE","_this49","_c$cooldown_until","c","clanInfo","member_count","capacity_limit","entry_fee_currency_type_id","entry_fee_amount","rating_position","rating_score","members","m","contribution_score","joinSourceId","_this50","JOIN_CLAN_REQUEST","join_source_id","JOIN_CLAN_RESPONSE","_response$errCode","_response$errMsg","tournamentsGetInfo","_this51","GET_TOURNAMENT_INFO_REQUEST","GET_TOURNAMENT_INFO_RESPONSE","_response$userPositio","_response$tournamentI","_this52","tournament_instance_id","_this53","GET_CLAN_TOURNAMENT_PLAYERS_REQUEST","GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE","_response$players","leaderboardGet","prevPeriod","_this54","snapshot_offset","GET_LEADERS_BOARD_REQUEST","include_users","GET_LEADERS_BOARD_RESPONSE","_response$map$boardKe","_response$map$boardKe2","boardKey","_this55","DAILY","leaderboardsGetList","_this56","values","_this57","_this57$leaderboardsG","levelsGet","_this58","GET_LEVEL_MAP_REQUEST","GET_LEVEL_MAP_RESPONSE","_this59","_this60","userInfo","_userInfo$points_ever2","sortedLevels","currentLevelIndex","level","current_level","_userInfo$points_ever","userPointsEver","points_ever","nextLevel","currentLevel","min","max","customSectionsGet","_this61","GET_CUSTOM_SECTIONS_REQUEST","GET_CUSTOM_SECTIONS_RESPONSE","_this62","_this63","starred_only","_this64","favoriteOnly","_this65","_this65$getInboxMessa","log","_this66","_this66$getInboxMessa","_this67","getMessageBody","getLabelSetting","INBOX_PUBLIC_CDN","fetch","method","headers","json","_this68","_this69","MARK_INBOX_READ_REQUEST","MARK_INBOX_READ_RESPONSE","_this70","all_read","_this71","MARK_INBOX_STARRED_REQUEST","MARK_INBOX_STARRED_RESPONSE","_this72","MARK_INBOX_DELETED_REQUEST","MARK_INBOX_DELETED_RESPONSE","_this73","all_deleted","buildGamesApiParams","_this$tracker$userPub","_this$tracker$userPub2","smartico_ext_user_id","getExtUserId","lang","core_user_language","sendGamesApi","_ref3$usePost","usePost","_this74","baseParams","queryString","entries","encodeURIComponent","fetchOptions","extraQuery","_ref5","sendAvatarApi","_ref6","_this75","_this76","_this77","_this78","_this79","isQuiz","_this80","_this81","_this82","gpGetTranslations","_this83","_this84","avatarsGetList","_this85","GET_AVATARS_LIST_REQUEST","GET_AVATARS_LIST_RESPONSE","avatarsGetCustomized","_this86","GET_AVATARS_CUSTOMIZED_REQUEST","GET_AVATARS_CUSTOMIZED_RESPONSE","avatarsGetPrompts","_this87","GET_AVATAR_PROMPTS_REQUEST","GET_AVATAR_PROMPTS_RESPONSE","_this88","CLIENT_SET_AVATAR_REQUEST","CLIENT_SET_AVATAR_RESPONSE","_this89$tracker","_this89$tracker2","_this89","_this90","_this90$avatarsGetLis","_this90$avatarsGetLis2","avatars","_this91","_this91$avatarsGetCus","_this91$avatarsGetCus2","_this92","_this92$avatarsGetPro","_this92$avatarsGetPro2","prompts","getWSCalls","_this93","GET_RELATED_ACH_N_TOURNAMENTS_REQUEST","GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE","_this94","_this94$getRaffles","_this95","RAF_GET_RAFFLES_REQUEST","RAF_GET_RAFFLES_RESPONSE","_this96","RAF_GET_DRAW_RUN_REQUEST","RAF_GET_DRAW_RUN_RESPONSE","_this97","_this98","RAF_GET_DRAW_HISTORY_REQUEST","RAF_GET_DRAW_HISTORY_RESPONSE","_this99","RAF_CLAIM_PRIZE_REQUEST","_this100","RAF_OPTIN_REQUEST","_this101","RAF_GET_WON_PRIZES_REQUEST","RAF_GET_WON_PRIZES_RESPONSE","_this102","GET_POINT_HISTORY_REQUEST","floor","GET_POINT_HISTORY_RESPONSE","_this103","_this103$getActivityL","logHistory","CookieStore","cookieStore","TSMap","AnalyticsInterfaceType","AnalyticsScreenNameId","AnalyticsTournamentsLobbySubScreenNameId","AnalyticsInboxSubScreenNameId","QuizSportType","quizSupportedSports","Basketball","Soccer","Tennis","SAWGPMarketType","QuizAnswersValueType","quizAnswerHomeTeamReplacementText","quizAnswerAwayTeamReplacementText","quizDrawReplacementText","quizYesReplacementText","quizNoReplacementText","quizOddReplacementText","quizEvenReplacementText","quizOrReplacementText","quizNoGoalsReplacementText","quizAnswersTrKeys","_quizAnswersTrKeys","yesNoAnswers","Yes","No","homeAwayAnswers","HomeTeam","AwayTeam","homeAwayDrawAnswers","Draw","homeAwayNoGoalsAnswers","marketsInfo","OneXTwo","question","trKey","answers","OneXTwoHalftime","FirstGoal","LastGoal","DoubleChance","HomeTeamDraw","HomeTeamAwayTeam","AwayTeamDraw","OverUnder2_5","OverUnder1_5Halftime","OverUnder1_5__2ndHalf","RedCard","TotalCorners8_5","TotalCorners9_5","Corners1x2","One_Two","Overtime","OddEven","Odd","Even","OddEvenHomeAway","HomeOdd","HomeEven","AwayOdd","AwayEven","FirstSet","SecondSet","ThirdSet","FourthSet","FifthSet","PlayerOneWinsOneSet","PlayerTwoWinsOneSet","CustomNonSport","CustomSport","QuizMarketPerSport","_QuizMarketPerSport","GamePickMarketType","GamePickResolutionType","GPRoundStatus","GamePickScoreType","GamePickSportType","GameRoundOrderType","AllRoundsGameBoardID","JackpotContributionType","JackPotTemparature","JackpotType","AvatarCustomizeErrorCode","JoinClanErrorCode"],"mappings":";;AAAYA,yBAyNX;AAzND,CAAA,UAAYA,OAAO,EAAA;EAClBA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EACRA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EAERA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EACRA,OAAA,CAAAA,OAAA,CAAA,eAAA,CAAA,GAAA,CAAA,CAAA,GAAA,eAAiB,CAAA;EACjBA,OAAA,CAAAA,OAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAY,CAAA;EACZA,OAAA,CAAAA,OAAA,CAAA,mBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,mBAAqB,CAAA;EACrBA,OAAA,CAAAA,OAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAS,CAAA;EACTA,OAAA,CAAAA,OAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QA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