import * as lodash from 'lodash'; import { M as MemoizedLast, d as TCart } from './utils-BPcZ5h8J.esm.js'; import { B as BeamCartAPIConfig, a as BeamCartValues } from './update-cart-B5Tr9N3V.esm.js'; type BeamShopifyCartIntegrationConfig = BeamCartAPIConfig & { storeId: number; chainId?: number; }; /** * @main registerCartIntegration - set up event listeners to integrate Beam with Shopify cart * @return {boolean} returns true if NEW listeners were created, false if setup was already done */ declare function registerCartIntegration(config: BeamShopifyCartIntegrationConfig, autoUpdateShopifyCartAttributes?: boolean): Promise; /** * @main unregisterCartIntegration - tear down listeners set up by registerCartIntegration. * Pass { clearStorage: true } to also wipe Beam's localStorage/cookies in the same call * (clearBeamStorage from src/utils, which is also callable on its own — for cases that want * storage cleared without touching listeners, or independently of this integration entirely). * @return {boolean} true if this page load's listeners were torn down, false if * registerCartIntegration never ran this session (storage still clears if requested, either way) */ declare function unregisterCartIntegration(config: BeamShopifyCartIntegrationConfig, { clearStorage }?: { clearStorage?: boolean; }): Promise; declare function appendToShopifyCartBeamAttribute(config: BeamShopifyCartIntegrationConfig): Promise; /** * Gathers the base Beam data needed for updating a Shopify cart's metadata */ declare function getBeamAttributesForCart(config: BeamShopifyCartIntegrationConfig): Promise<{ showBeam: boolean | undefined; remoteSessionId: any; beamCartId: string | undefined; cartId: string | undefined; chainId: number | undefined; storeId: number; }>; /** * Adds Statsig data to a Shopify cart */ declare const appendStatsigToShopifyCartAttributes: typeof appendToShopifyCartBeamAttribute; /** * Detects change in cart since last page load, * by calling GET /cart.js, and returns cart values. * Used for: * - Form-based carts where the page refreshes to modify cart instead of using AJAX calls * - Hydrogen/GraphQL based carts (needs to be integrated manually) */ declare function getCurrentCart(config: BeamShopifyCartIntegrationConfig, signal?: AbortSignal): Promise<{ changed: boolean; cart: { cartId: string; subtotal: number; itemCount: number; currencyCode: string; } & TCart; }>; /** * trackCart - Backwards-compatible alias for updateCart */ declare const trackCart: lodash.DebouncedFuncLeading Promise>>; /** * Helper function to get the Shopify cart attributes */ declare const getShopifyCart: () => Promise; /** * Sends Beam data to Shopify to integrate with order as custom attributes. * Memoized so that calls with the same data as the previous don't create additional API calls to Shopify. * This will do an append, not a full overwrite of the attributes in the beam property */ declare const appendBeamAttributesToCart: MemoizedLast<(args_0: { selectedNonprofitId?: number | null; selectionId?: string; beamCartId?: string; cartId?: string; chainId?: number; storeId?: number; showBeam?: boolean; remoteSessionId?: string; }) => Promise>; /** * Sends Beam data to Shopify to integrate with order as custom attributes. * Memoized so that calls with the same data as the previous don't create additional API calls to Shopify. * This method force-updates the "beam" attribute with the values passed in */ declare const addBeamAttributesToCart: MemoizedLast<(args_0: { selectedNonprofitId?: number | null; selectionId?: string; beamCartId?: string; cartId?: string; chainId?: number; storeId?: number; }) => Promise>; declare global { interface Window { statsig?: any; Shopify?: any; } } export { addBeamAttributesToCart as a, appendBeamAttributesToCart as b, appendStatsigToShopifyCartAttributes as c, appendToShopifyCartBeamAttribute as d, getCurrentCart as e, getShopifyCart as f, getBeamAttributesForCart as g, registerCartIntegration as r, trackCart as t, unregisterCartIntegration as u }; export type { BeamShopifyCartIntegrationConfig as B };