import { T as TokenFunctions } from './locale-CuC8Xae4.js';
export { O as AnalyticsContext, N as AnalyticsContextType, L as AnalyticsEventParams, M as AnalyticsPageViewParams, S as AnalyticsProvider, R as AnalyticsProviderProps, H as AuthContext, K as AuthContextType, I as AuthProvider, P as PurchaseItemInfo, D as PurchaseItemStatus, h as addBlake2OtpSignatureInterceptor, i as addDefaultHeaderInterceptor, B as analytics, j as avatarUrl, g as campaignInterfaceType, f as campaignPointType, e as campaignType, k as createCartUrl, l as createInterfaceToken, m as eventEmitter, n as fetchImage, G as findBestLocaleFromString, o as generateBlake2bSignatureHex, p as generateShortLivedId, q as getOtpSignatureHeaders, E as getPurchaseItemStatus, z as initializeAnalytics, r as interfaceWebsite, C as isValidEmail, s as largeImage, F as localeToLCIDMap, x as trackCommonEvents, v as useAnalytics, Q as useAnalyticsContext, w as useAnalyticsState, J as useAuthContext, t as usePageTracking, y as withPageTracking } from './locale-CuC8Xae4.js';
import { ProfileResponse, UpdatedPoints, Badge, Trace, ErrorResponse, ServiceResponse, ExpiringPoints, CartCountResponse, StatusResponse, ConfirmOtpResponse, Address, BzbsService, RedeemResponse, UseCampaignResponse, CampaignDetail, Style, Campaign, Category, Consent, CouponResponse, Dashboard, Maintenance, Notification, PointLog, Purchase, OtpResponse, ValidateOtpResponse, RegistrationResponse, ZipCode } from '@bzbs/react-api-client';
import React, { ReactNode } from 'react';
import 'emittery';
import 'axios';
import 'zustand';
import 'matomo-tracker-react-native';

type UserContextType = {
    user: ProfileResponse | null;
    points: number;
    recentPoints: number;
    expiringPoints: UpdatedPoints[];
    recentBadge: Badge | null;
    recentTrace: Trace | null;
    cartCount: number;
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        fetchUser: () => Promise<ServiceResponse<ProfileResponse>>;
        fetchPoint: () => Promise<ServiceResponse<UpdatedPoints>>;
        fetchExpiringPoints: () => Promise<ServiceResponse<ExpiringPoints>>;
        fetchCartCount: () => Promise<ServiceResponse<CartCountResponse>>;
        editUser: (data: UpdateProfileParams) => Promise<ServiceResponse<ProfileResponse>>;
        changePassword: (oldPassword: string, newPassword: string) => Promise<ServiceResponse<StatusResponse>>;
        changeContactNumber: (contactNumber: string, otp: string, refCode: string) => Promise<ServiceResponse<ConfirmOtpResponse>>;
        changeAvatar: (avatar: File) => Promise<ServiceResponse<ProfileResponse>>;
        consumeRecentPoints: () => void;
        consumeRecentBadge: () => void;
        consumeRecentTrace: () => void;
        deleteUser: () => Promise<ServiceResponse<any>>;
        setError: (error: ErrorResponse | null) => void;
        clearData: () => void;
    };
};
type UpdateProfileParams = {
    profileImage?: File | {
        uri: string;
        name: string;
        type: string;
    };
    firstName?: string;
    lastName?: string;
    contactNumber?: string;
    email?: string;
    notification?: boolean;
    locale?: number;
    title?: string;
    gender?: string;
    birthDate?: number;
    address?: string;
    subdistrictCode?: number;
    subdistrictName?: string;
    districtCode?: number;
    districtName?: string;
    provinceCode?: number;
    provinceName?: string;
    countryCode?: string;
    countryName?: string;
    zipCode?: string;
    idCard?: string;
    passport?: string;
    maritalStatus?: string;
    village?: string;
    building?: string;
    number?: string;
    moo?: string;
    room?: string;
    floor?: string;
    soi?: string;
    city?: string;
    road?: string;
    landmark?: string;
    alternateContactNumber?: string;
    homeContactNumber?: string;
    nationality?: string;
    religion?: string;
    location?: string;
    latitude?: number;
    longitude?: number;
    income?: string;
    interests?: string;
    region?: string;
    phonepurchase?: number;
    highestEducation?: string;
    occupation?: string;
    remark?: string;
    displayName?: string;
    options?: {
        [key: string]: any;
    };
};
declare const UserContext: React.Context<UserContextType>;
declare function useUserContext(): UserContextType;
declare function UserProvider({ children }: {
    children: ReactNode;
}): React.JSX.Element;

type CartContextType = {
    count: number;
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        getCartUrl: (returnUrl: string) => Promise<string | null>;
        addToCart: (id: string, mode: string, qty: number, data?: string) => Promise<ServiceResponse<CartCountResponse>>;
        getCount: () => Promise<ServiceResponse<CartCountResponse>>;
    };
};
declare function useCartContext(): CartContextType;
declare function CartProvider({ children }: {
    children: React.ReactNode;
}): React.JSX.Element;

type AlertRequest = {
    title: string;
    content: string;
    closeText?: string;
    onClose: () => void;
};
type AlertContextType = {
    isOpen: boolean;
    alertRequest: AlertRequest;
    openAlert: (request: AlertRequest) => void;
    closeAlert: () => void;
};
declare const AlertContext: React.Context<AlertContextType>;
declare const useAlertContext: () => AlertContextType;
declare const AlertProvider: ({ children }: {
    children: ReactNode;
}) => React.JSX.Element;

type LoadingContextType = {
    loading: boolean;
    show: () => void;
    hide: () => void;
};
declare const useLoadingContext: () => LoadingContextType;
declare const LoadingProvider: ({ children }: {
    children: React.ReactNode;
}) => React.JSX.Element;
declare const useLoading: (isLoading: boolean) => void;

type AppLocale = {
    locale: string;
    localeId: number;
};
declare const EN: {
    locale: string;
    localeId: number;
};
declare const TH: {
    locale: string;
    localeId: number;
};
type LocaleContextType = {
    appLocale: AppLocale;
    locale: string;
    localeId: number;
    setAppLocale: (locale: AppLocale | string) => void;
};
declare const LocaleContext: React.Context<LocaleContextType>;
declare const useAppLocaleContext: () => LocaleContextType;
declare const AppLocaleProvider: ({ initLocale, children }: {
    initLocale: AppLocale;
    children: ReactNode;
}) => React.JSX.Element;

type ConfirmRequest = {
    title: string;
    content: string;
    confirmText?: string;
    cancelText?: string;
    onConfirm?: () => void;
    onCancel?: () => void;
};
type ConfirmContextType = {
    isOpen: boolean;
    confirmRequest: ConfirmRequest;
    openConfirm: (request: ConfirmRequest) => void;
    closeConfirm: () => void;
};
declare const ConfirmContext: React.Context<ConfirmContextType>;
declare const useConfirmContext: () => ConfirmContextType;
declare const ConfirmProvider: ({ children }: {
    children: React.ReactNode;
}) => React.JSX.Element;

declare const PopupProvider: ({ children }: {
    children: ReactNode;
}) => React.JSX.Element;

type AddressContextType = {
    addresses: Address[];
    taxAddresses: Address[];
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        fetchAddresses: () => Promise<ServiceResponse<Address[]>>;
        addAddress: (address: AddressFormData) => Promise<ServiceResponse<Address>>;
        editAddress: (address: AddressFormData) => Promise<ServiceResponse<Address>>;
        deleteAddress: (rowKey: string) => Promise<ServiceResponse<any>>;
        fetchTaxAddresses: () => Promise<ServiceResponse<Address[]>>;
        addTaxAddress: (address: AddressFormData) => Promise<ServiceResponse<Address>>;
        editTaxAddress: (address: AddressFormData) => Promise<ServiceResponse<Address>>;
        deleteTaxAddress: (rowKey: string) => Promise<ServiceResponse<any>>;
    };
};
type AddressFormData = {
    addressName?: string;
    firstName?: string;
    lastName?: string;
    address?: string;
    zipcode?: string;
    provinceCode?: string;
    provinceName?: string;
    districtCode?: string;
    districtName?: string;
    subDistrictCode?: string;
    subDistrictName?: string;
    contactNumber?: string;
    countryCode?: string;
    countryName?: string;
    isDefault?: boolean;
    rowKey?: string;
};
declare function useAddressContext(): AddressContextType;
declare function AddressProvider({ children }: {
    children: React.ReactNode;
}): React.JSX.Element;

type BuzzebeesServiceContextType = {
    appId: string;
    appName: string;
    bzbsService: BzbsService;
    urls: {
        webCallback: string;
        cart: string;
    };
};
declare const BuzzebeesServiceContext: React.Context<BuzzebeesServiceContextType>;
declare function useBuzzebeesServiceContext(): BuzzebeesServiceContextType;
type BuzzebeesServiceProviderProps = {
    appId: string;
    appName: string;
    bzbsService: BzbsService;
    urls: {
        webCallback: string;
        cart: string;
    };
    children: React.ReactNode;
};
declare function BuzzebeesServiceProvider({ appId, appName, bzbsService, urls, children, }: BuzzebeesServiceProviderProps): React.JSX.Element;

type CampaignButtonType = 'redeem' | 'get_points' | 'add_to_cart' | 'survey' | 'website' | 'draw' | 'donate' | 'delivery';
type CampaignDetailButtonState = {
    enabled: boolean;
    type: CampaignButtonType;
    display: boolean;
};
type CampaignState = 'redeemable' | 'point_not_enough' | 'expired' | 'cool_down' | 'fail_in_condition' | 'sold_out' | 'redeemed';
type AfterRedeemDestination = 'delivery' | 'draw' | 'code' | 'get_points';
type AfterRedeem = {
    destination: AfterRedeemDestination;
    redeemData: RedeemResponse;
    clear: () => void;
};
type AfterUse = {
    useData: UseCampaignResponse;
    clear: () => void;
};
type CampaignDetailContextType = {
    data: CampaignDetail | null;
    style: Style | null;
    subStyle: Style | null;
    quantity: number;
    totalPrice: number;
    deliveryAddress: Address | null;
    afterRedeem: AfterRedeem | null;
    afterUse: AfterUse | null;
    buttonState: CampaignDetailButtonState;
    campaignState: CampaignState;
    interfaceWebsite: string | null;
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        setError: (error: ErrorResponse) => void;
        fetchData: (id: string) => Promise<ServiceResponse<CampaignDetail>>;
        redeem: (addressOverride?: Address, options?: {
            [key: string]: unknown;
        }) => Promise<ServiceResponse<RedeemResponse>>;
        use: () => Promise<ServiceResponse<UseCampaignResponse>>;
        addToFavorite(): Promise<ServiceResponse<unknown>>;
        removeFromFavorite(): Promise<ServiceResponse<unknown>>;
        setStyle: (style: Style) => void;
        setSubStyle: (style: Style) => void;
        setQuantity: (quantity: number) => void;
        setDeliveryAddress: (address: Address) => void;
        addToCart: () => Promise<ServiceResponse<CartCountResponse>>;
        clear: () => void;
    };
};
declare const CampaignDetailContext: React.Context<CampaignDetailContextType>;
declare function useCampaignDetailContext(): CampaignDetailContextType;
declare function CampaignDetailProvider({ children }: {
    children: React.ReactNode;
}): React.JSX.Element;

type CampaignContextType = {
    items: Campaign[];
    fetchData: (top: number, categoryId?: string, options?: CampaignListParams) => Promise<ServiceResponse<Campaign[]>>;
    loadMore: () => Promise<ServiceResponse<Campaign[]>>;
    isLoading: boolean;
    canLoadMore: boolean;
    error: ErrorResponse | null;
};
type CampaignListParams = {
    startDate?: string;
    keyword?: string;
    sponsorId?: string;
    maxPoints?: number;
    minPoints?: number;
    sortBy?: string;
    hashTags?: string;
    locationAgencyId?: string;
    options?: {
        [key: string]: string;
    };
};
declare const CampaignContext: React.Context<CampaignContextType>;
declare function useCampaignContext(): CampaignContextType;
declare function CampaignProvider({ children, config }: {
    children: React.ReactNode;
    config: string;
}): React.JSX.Element;

type CategoriesContextType = {
    items: Category[];
    fetchData: () => Promise<ServiceResponse<Category[]>>;
    isLoading: boolean;
    error: ErrorResponse | null;
};
declare function useCategoriesContext(): CategoriesContextType;
declare function CategoriesProvider({ children, config }: {
    children: React.ReactNode;
    config: string;
}): React.JSX.Element;

type ConsentContextType = {
    consentData: Consent | null;
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        fetchConsent: () => Promise<ServiceResponse<Consent>>;
        updateConsent: (data: Consent) => Promise<ServiceResponse<Consent>>;
        unconsent: () => Promise<ServiceResponse<any>>;
    };
};
declare const ConsentContext: React.Context<ConsentContextType>;
declare const useConsentContext: () => ConsentContextType;
declare const ConsentProvider: ({ children }: {
    children: React.ReactNode;
}) => React.JSX.Element;

type CouponContextType = {
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        process: (codes: string[]) => Promise<ServiceResponse<CouponResponse>>;
    };
};
declare function useCouponContext(): CouponContextType;
declare function CouponProvider({ children }: {
    children: React.ReactNode;
}): React.JSX.Element;

type DashboardContextType = {
    items: Dashboard[];
    fetchData: () => Promise<ServiceResponse<Dashboard[]>>;
    isLoading: boolean;
    error: ErrorResponse | null;
};
declare function useDashboardContext(): DashboardContextType;
declare function DashboardProvider({ children, config, mode, }: {
    children: React.ReactNode;
    config: string;
    mode: 'main' | 'sub';
}): React.JSX.Element;

type DefaultMainAppProviderProps = {
    tokenFunctions: TokenFunctions;
    defaultDashboardConfig: string;
    defaultDashboardMode: 'main' | 'sub';
    defaultMenuConfig: string;
    defaultCampaignConfig: string;
    language: string;
    matomoConfig?: MatomoConfig;
    children: React.ReactNode;
} & Omit<BuzzebeesServiceProviderProps, 'children'>;
type MatomoConfig = {
    siteId: number;
    urlBase: string;
    trackerUrl?: string;
    userId?: string;
    disabled?: boolean;
    log?: boolean;
};
declare const DefaultMainAppProvider: ({ appId, appName, bzbsService, urls, tokenFunctions, defaultDashboardConfig, defaultDashboardMode, defaultMenuConfig, defaultCampaignConfig, language, matomoConfig, children, }: DefaultMainAppProviderProps) => React.JSX.Element;

type MaintenanceContextType = {
    isMaintenance: boolean | null;
    maintenanceData: Maintenance | null;
};
declare const MaintenanceContext: React.Context<MaintenanceContextType>;
declare const useMaintenanceContext: () => MaintenanceContextType;
declare const MaintenanceProvider: ({ children }: {
    children: React.ReactNode;
}) => React.JSX.Element;

type NotificationContextType = {
    notifications: Notification[];
    unreadCount: number;
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        fetchNotifications: (mode?: string) => Promise<ServiceResponse<Notification[]>>;
        readNotification: (ids: string[]) => Promise<ServiceResponse<any>>;
    };
};
declare const NotificationContext: React.Context<NotificationContextType>;
declare const useNotificationContext: () => NotificationContextType;
declare const NotificationProvider: ({ children }: {
    children: React.ReactNode;
}) => React.JSX.Element;

type PointLogContextType = {
    pointLogs: PointLog[];
    isLoading: boolean;
    error: ErrorResponse | null;
    canLoadMore: boolean;
    actions: {
        fetchPointLogs: (month: string, type: 'earn' | 'burn', top: number) => Promise<ServiceResponse<PointLog[]>>;
        loadMore: () => Promise<ServiceResponse<PointLog[]>>;
    };
};
declare function usePointLogContext(): PointLogContextType;
declare const PointLogProvider: ({ children }: {
    children: React.ReactNode;
}) => React.JSX.Element;

type PurchaseContextType = {
    purchases: Purchase[];
    isLoading: boolean;
    error: ErrorResponse | null;
    canLoadMore: boolean;
    actions: {
        fetchPurchases: (config: string, top: number, startDate?: string, endDate?: string) => Promise<ServiceResponse<Purchase[]>>;
        use: (redeemKey: string) => Promise<ServiceResponse<UseCampaignResponse>>;
        loadMore: () => Promise<ServiceResponse<Purchase[]>>;
    };
};
declare function usePurchaseContext(): PurchaseContextType;
declare function PurchaseProvider({ children }: {
    children: React.ReactNode;
}): React.JSX.Element;

type RegisterContextType = {
    username: string;
    password: string;
    confirmPassword: string;
    contactNumber: string;
    firstName: string;
    lastName: string;
    otp: string;
    refCode: string;
    address: string | undefined;
    gender: string | undefined;
    birthDate: number | undefined;
    email: string | undefined;
    refUserCode: string | undefined;
    consentVersion: {
        termAndCondition: string;
        dataPrivacy: string;
        marketingOptions: string;
    } | null;
    termAndConditionAccepted: boolean;
    dataPrivacyAccepted: boolean;
    marketingAccepted: boolean;
    emailMarketingAccepted: boolean;
    smsMarketingAccepted: boolean;
    notificationMarketingAccepted: boolean;
    lineMarketingAccepted: boolean;
    phoneMarketingAccepted: boolean;
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        setUUID(value: string): void;
        setAppId(value: string): void;
        setDeviceToken(value: string): void;
        setClientVersion(value: string): void;
        setUsername(value: string): void;
        setPassword(value: string): void;
        setConfirmPassword(value: string): void;
        setContactNumber(value: string): void;
        setFirstName(value: string): void;
        setLastName(value: string): void;
        setOtp(value: string): void;
        setRefCode(value: string): void;
        setAddress(value: string): void;
        setGender(value: string): void;
        setBirthDate(value: number): void;
        setEmail(value: string): void;
        setRefUserCode(value: string): void;
        setTermAndConditionAccepted(value: boolean): void;
        setDataPrivacyAccepted(value: boolean): void;
        setMarketingAccepted(value: boolean): void;
        setEmailMarketingAccepted(value: boolean): void;
        setSmsMarketingAccepted(value: boolean): void;
        setNotificationMarketingAccepted(value: boolean): void;
        setLineMarketingAccepted(value: boolean): void;
        setPhoneMarketingAccepted(value: boolean): void;
        setError(value: ErrorResponse | null): void;
        setLatestConsentVersion(termAndCondition: string, dataPrivacy: string, marketingOptions: string): void;
        clearData: () => void;
        sendOtp: () => Promise<ServiceResponse<OtpResponse>>;
        validateOtp: () => Promise<ServiceResponse<ValidateOtpResponse>>;
        register: () => Promise<ServiceResponse<RegistrationResponse>>;
    };
};
declare function useRegisterContext(): RegisterContextType;
declare function RegisterProvider({ children }: {
    children: React.ReactNode;
}): React.JSX.Element;

type ZipCodeDropDownItem = {
    name: string;
    id: string;
};
type ZipCodeContextType = {
    zipCodes: ZipCode[];
    provinceDropDownItems: ZipCodeDropDownItem[];
    districtDropDownItems: ZipCodeDropDownItem[];
    subDistrictDropDownItems: ZipCodeDropDownItem[];
    selectedProvinceDropDownItem: ZipCodeDropDownItem | null;
    selectedDistrictDropDownItem: ZipCodeDropDownItem | null;
    selectedSubDistrictDropDownItem: ZipCodeDropDownItem | null;
    isLoading: boolean;
    error: ErrorResponse | null;
    actions: {
        fetchZipCodes: (zipCode: string) => Promise<ServiceResponse<ZipCode[]>>;
        setSelectedProvinceDropDownItem: (item: ZipCodeDropDownItem | null) => void;
        setSelectedDistrictDropDownItem: (item: ZipCodeDropDownItem | null) => void;
        setSelectedSubDistrictDropDownItem: (item: ZipCodeDropDownItem | null) => void;
        clear(): void;
    };
};
declare function useZipCodeContext(): ZipCodeContextType;
declare function ZipCodeProvider({ children }: {
    children: React.ReactNode;
}): React.JSX.Element;

export { type AddressContextType, type AddressFormData, AddressProvider, type AfterRedeem, type AfterRedeemDestination, type AfterUse, AlertContext, type AlertContextType, AlertProvider, type AlertRequest, type AppLocale, AppLocaleProvider, BuzzebeesServiceContext, type BuzzebeesServiceContextType, BuzzebeesServiceProvider, type BuzzebeesServiceProviderProps, type CampaignButtonType, CampaignContext, type CampaignContextType, type CampaignDetailButtonState, CampaignDetailContext, type CampaignDetailContextType, CampaignDetailProvider, type CampaignListParams, CampaignProvider, type CampaignState, CartProvider, CategoriesProvider, ConfirmContext, ConfirmProvider, ConsentContext, ConsentProvider, CouponProvider, DashboardProvider, DefaultMainAppProvider, type DefaultMainAppProviderProps, EN, LoadingProvider, LocaleContext, type LocaleContextType, MaintenanceContext, type MaintenanceContextType, MaintenanceProvider, type MatomoConfig, NotificationContext, type NotificationContextType, NotificationProvider, PointLogProvider, PopupProvider, PurchaseProvider, RegisterProvider, TH, TokenFunctions, type UpdateProfileParams, UserContext, UserProvider, type ZipCodeContextType, type ZipCodeDropDownItem, ZipCodeProvider, useAddressContext, useAlertContext, useAppLocaleContext, useBuzzebeesServiceContext, useCampaignContext, useCampaignDetailContext, useCartContext, useCategoriesContext, useConfirmContext, useConsentContext, useCouponContext, useDashboardContext, useLoading, useLoadingContext, useMaintenanceContext, useNotificationContext, usePointLogContext, usePurchaseContext, useRegisterContext, useUserContext, useZipCodeContext };
