"use client"; import { createPendingChatPromotion as createPromotion, NavigationStorage, type PendingChatUnlock, type PendingChatUnlockKind, type PendingChatPromotion, type PendingChatPromotionType, type PendingChatUnlockStage, } from "@/data/storage/navigation"; export type { PendingChatUnlock, PendingChatUnlockKind, PendingChatPromotion, PendingChatPromotionType, PendingChatUnlockStage, }; export function createPendingChatPromotion( promotionType: PendingChatPromotionType, characterId: string, ): PendingChatPromotion { return createPromotion(promotionType, characterId); } export async function savePendingChatUnlock(input: { characterId: string; displayMessageId?: string; messageId?: string; kind: PendingChatUnlockKind; lockType?: PendingChatUnlock["lockType"]; clientLockId?: string; promotion?: PendingChatPromotion; returnUrl: string; stage: PendingChatUnlockStage; }): Promise { await NavigationStorage.savePendingChatUnlock(input); } export async function consumePendingChatUnlock( characterId: string, ): Promise { return NavigationStorage.consumePendingChatUnlock(characterId); } export async function peekPendingChatUnlock( characterId: string, ): Promise { return NavigationStorage.peekPendingChatUnlock(characterId); } export async function hasPendingChatUnlock(characterId: string): Promise { return NavigationStorage.hasPendingChatUnlock(characterId); } export async function clearPendingChatUnlock(): Promise { await NavigationStorage.clearPendingChatUnlock(); } export async function savePendingChatPromotion( promotionType: PendingChatPromotionType, characterId: string, ): Promise { return NavigationStorage.savePendingChatPromotion(promotionType, characterId); } export async function consumePendingChatPromotion( characterId: string, ): Promise { return NavigationStorage.consumePendingChatPromotion(characterId); } export async function clearPendingChatPromotion(): Promise { await NavigationStorage.clearPendingChatPromotion(); } export async function clearPendingChatNavigation(): Promise { await Promise.all([ NavigationStorage.clearPendingChatUnlock(), NavigationStorage.clearPendingChatPromotion(), NavigationStorage.clearPendingChatImageReturn(), ]); }