/**
 * useObjectViewedBuffer — accessor for the Object Viewed buffer.
 *
 * Phase 2b V4 pivot (SCRUM-259). Sibling of `useSearchImpressionBuffer`
 * for the non-search-attributed visibility case (recommendation widget,
 * PDP related-products rail, browse pages). Accumulates entries within
 * a debounce window (default 250 ms) and emits ONE `Object Viewed` event
 * with parallel `object_ids[]` / `object_positions[]` / `object_data[]`
 * arrays.
 *
 * Returns a no-op buffer when no `<BufferProvider>` is above.
 */
import { useMemo } from "react";
import { useBufferTrio, } from "../components/buffers/BufferProvider";
const NOOP = {
    record: () => undefined,
    flush: () => undefined,
};
export function useObjectViewedBuffer() {
    const trio = useBufferTrio();
    return useMemo(() => trio?.viewed ?? NOOP, [trio]);
}
