//#region src/preview/previewTypes.ts
/**
* Type guard to check if an element has temporal properties.
*/
function isTemporal(el) {
	return "startTimeMs" in el && "endTimeMs" in el;
}
/**
* Get temporal bounds for an element, treating invalid ranges as unbounded.
* Invalid range (end <= start) means element hasn't computed its duration yet.
*
* NOTE: No caching - bounds are computed dynamically by timegroups based on
* composition mode (sequence/contain/fit) and may change between frames.
*/
function getTemporalBounds(el) {
	if (!isTemporal(el)) return {
		startMs: -Infinity,
		endMs: Infinity
	};
	const temporal = el;
	let startMs = temporal.startTimeMs ?? -Infinity;
	let endMs = temporal.endTimeMs ?? Infinity;
	if (endMs <= startMs) {
		startMs = -Infinity;
		endMs = Infinity;
	}
	return {
		startMs,
		endMs
	};
}
/**
* Check if an element is temporally visible at the given time.
*/
function isVisibleAtTime(element, timeMs) {
	const { startMs, endMs } = getTemporalBounds(element);
	return timeMs >= startMs && timeMs <= endMs;
}
/** Default timegroup dimensions when not measurable */
const DEFAULT_WIDTH = 1920;
const DEFAULT_HEIGHT = 1080;
/** Default scale for capture operations */
const DEFAULT_CAPTURE_SCALE = .25;
/** Default timeout for blocking content readiness mode (ms) */
const DEFAULT_BLOCKING_TIMEOUT_MS = 5e3;
/**
* Create a preview container with standard styling.
* Consolidates the repeated container creation pattern across preview functions.
*/
function createPreviewContainer(options) {
	const { width, height, background = "#000", position = "relative" } = options;
	const container = document.createElement("div");
	container.style.cssText = `
    width: ${width}px;
    height: ${height}px;
    position: ${position};
    overflow: hidden;
    background: ${background};
  `;
	return container;
}

//#endregion
export { DEFAULT_BLOCKING_TIMEOUT_MS, DEFAULT_CAPTURE_SCALE, DEFAULT_HEIGHT, DEFAULT_WIDTH, createPreviewContainer, isTemporal, isVisibleAtTime };
//# sourceMappingURL=previewTypes.js.map