import { LitElement, PropertyValues } from 'lit';
import '../poi-layer-stack/poi-layer-stack.js';
/**
 * `<obc-poi-controller>` - Detection-to-overlay controller that maps points to POI markers (pins/targets) over media.
 *
 * Coordinates media metrics, detection input, and layer output to keep marker placement in sync with the current frame.
 * Use this when you need runtime mapping from detection data to rendered POI targets.
 *
 * ### Overview
 * - Keywords: POI, point-of-interest, marker, pin, target, detection, overlay, tracker.
 * - Contrast:
 *   - `obc-poi-controller` handles data ingestion, projection, filtering, and target lifecycle.
 *   - `obc-poi-layer` handles overlap/group behavior for targets already placed in a layer.
 *   - `obc-poi-data` / `obc-poi` are target-level components and do not manage detection streams.
 *
 * ### Features/Variants
 * - Detection source selection:
 *   - `detections` (array) is used directly when provided.
 *   - `frames` + `frameIndex` supports frame/timestamp-driven playback when `detections` is not provided.
 * - Projection config:
 *   - `fit` (`contain` default, `cover` optional) controls scale mode from media space to rendered space.
 * - Target shaping:
 *   - Uses mapped `box_width`/`box_height` to resolve POI button type.
 * - Filtering:
 *   - `confidenceMin` and `classFilter` remove detections before render.
 * - Stable identity:
 *   - Key resolution order is `det.id`, then `keyFn(det, index)`, then index fallback.
 *
 * ### Usage Guidelines
 * - Required inputs:
 *   - Provide a media element in slot `media`.
 *   - Provide an `obc-poi-layer-stack` in slot `stack`.
 * - Data flow:
 *   - Use `detections` for direct, current-frame updates.
 *   - Use `frames` for timeline/video synchronization.
 *   - Use `frameIndex` to force a specific frame; default `null` selects by nearest video timestamp (or first frame for non-video media).
 * - Identity:
 *   - Provide stable `id` in detections or set `keyFn` to avoid marker churn when ordering changes.
 *
 * ### Slots/Content
 * - `media` (required): Video or image source used for measurement and timing.
 * - `stack` (required): `obc-poi-layer-stack` container where controller-managed targets are appended.
 *
 * ### Events
 * - None. This component does not emit custom events.
 *
 * ### Best Practices
 * - Keep detection arrays compact to reduce DOM churn.
 * - Prefer one selected layer in the stack and use `data-controller-layer="background"` when routing output to a specific layer.
 *
 * ### Example
 * ```html
 * <obc-poi-controller fit="contain">
 *   <video slot="media" src="media.mp4"></video>
 *   <obc-poi-layer-stack slot="stack" selection-mode="multi">
 *     <obc-poi-layer label="Selected" is-selected></obc-poi-layer>
 *     <obc-poi-layer label="Background" data-controller-layer="background">
 *     </obc-poi-layer>
 *   </obc-poi-layer-stack>
 * </obc-poi-controller>
 * ```
 *
 * @slot media - Required media element (video or image).
 * @slot stack - Required layer stack.
 */
export type PoiDetection = {
    x: number;
    y: number;
    box_width?: number;
    box_height?: number;
    id?: string;
    confidence?: number;
    class?: string;
    class_id?: number;
};
export type PoiKeyFn = (det: PoiDetection, index: number) => string;
export type PoiFrame = {
    frame?: number;
    timestamp?: number;
    detections: PoiDetection[];
};
export declare enum PoiFitMode {
    Contain = "contain",
    Cover = "cover"
}
export declare class ObcPoiController extends LitElement {
    fit: PoiFitMode;
    frames: PoiFrame[] | null;
    detections: PoiDetection[] | null;
    frameIndex: number | null;
    confidenceMin: number | null;
    classFilter: string[] | null;
    keyFn: PoiKeyFn | null;
    private mediaWidth;
    private mediaHeight;
    private renderWidth;
    private renderHeight;
    private mediaElements;
    private stackElements;
    private resizeObserver?;
    private handleMediaSlotChange;
    private handleStackSlotChange;
    private controllerTargets;
    private currentMedia;
    private mediaHandlers;
    firstUpdated(): void;
    updated(_changed: PropertyValues): void;
    disconnectedCallback(): void;
    private setupMediaObservers;
    private detachMediaListeners;
    private getMediaElement;
    private getStackElement;
    private updateMediaMetrics;
    private getActiveDetections;
    private filterDetections;
    private pickFrame;
    private mapDetection;
    private syncTargetsToCustomStack;
    render(): import('lit-html').TemplateResult<1>;
    static styles: import('lit').CSSResult;
}
declare global {
    interface HTMLElementTagNameMap {
        'obc-poi-controller': ObcPoiController;
    }
}
//# sourceMappingURL=poi-controller.d.ts.map