export declare const FIND_ALL_MEDIA_FUNCTION = "\n function findAllMedia(rootNode, mediaArray) {\n const media = mediaArray || [];\n if (rootNode.nodeType === Node.ELEMENT_NODE && !mediaArray) {\n const tagName = rootNode.tagName;\n if (tagName === 'AUDIO' || tagName === 'VIDEO') {\n media.push(rootNode);\n }\n }\n const walker = document.createTreeWalker(rootNode, NodeFilter.SHOW_ELEMENT);\n while (walker.nextNode()) {\n const node = walker.currentNode;\n if (node.tagName === 'AUDIO' || node.tagName === 'VIDEO') {\n media.push(node);\n }\n if (node.shadowRoot) {\n findAllMedia(node.shadowRoot, media);\n }\n }\n return media;\n }\n"; export declare const FIND_ALL_IMAGES_FUNCTION = "\n function findAllImages(root, imagesArray) {\n const images = imagesArray || [];\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);\n while (walker.nextNode()) {\n const node = walker.currentNode;\n if (node.tagName === 'IMG') {\n images.push(node);\n }\n // Check for VIDEO poster\n if (node.tagName === 'VIDEO' && node.poster) {\n const img = new Image();\n img.src = node.poster;\n images.push(img);\n }\n // Check for SVG IMAGE\n if (node.tagName === 'image' || node.tagName === 'IMAGE') {\n const href = node.getAttribute('href') || node.getAttribute('xlink:href');\n if (href) {\n const img = new Image();\n img.src = href;\n images.push(img);\n }\n }\n if (node.shadowRoot) {\n findAllImages(node.shadowRoot, images);\n }\n }\n return images;\n }\n"; export declare const FIND_ALL_ELEMENTS_WITH_PSEUDO_FUNCTION = "\n function findAllElements(root, elements) {\n elements = elements || [];\n if (root.nodeType === Node.ELEMENT_NODE) {\n elements.push(root);\n }\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);\n while (walker.nextNode()) {\n const node = walker.currentNode;\n elements.push(node);\n if (node.shadowRoot) {\n findAllElements(node.shadowRoot, elements);\n }\n }\n return elements;\n }\n"; export declare const FIND_ALL_SCOPES_FUNCTION = "\n function findAllScopes(rootNode, scopesArray) {\n const scopes = scopesArray || [];\n if (!scopesArray) {\n scopes.push(rootNode);\n }\n const walker = document.createTreeWalker(rootNode, NodeFilter.SHOW_ELEMENT);\n while (walker.nextNode()) {\n const node = walker.currentNode;\n if (node.shadowRoot) {\n scopes.push(node.shadowRoot);\n findAllScopes(node.shadowRoot, scopes);\n }\n }\n return scopes;\n }\n"; export declare const PARSE_MEDIA_ATTRIBUTES_FUNCTION = "\n function parseMediaAttributes(el) {\n if (el.__helios_attrs) return el.__helios_attrs;\n const offset = el.dataset.heliosOffset ? parseFloat(el.dataset.heliosOffset) : 0;\n const seek = el.dataset.heliosSeek ? parseFloat(el.dataset.heliosSeek) : 0;\n const fadeIn = el.dataset.heliosFadeIn ? parseFloat(el.dataset.heliosFadeIn) : 0;\n const fadeOut = el.dataset.heliosFadeOut ? parseFloat(el.dataset.heliosFadeOut) : 0;\n const volume = el.muted ? 0 : el.volume;\n const loop = el.loop;\n const duration = el.duration;\n\n let rate = el.playbackRate;\n if (rate === 1.0) {\n const rateAttr = el.getAttribute('playbackRate');\n if (rateAttr) {\n const parsed = parseFloat(rateAttr);\n if (!isNaN(parsed)) {\n rate = parsed;\n }\n }\n }\n if (isNaN(rate) || rate <= 0) {\n rate = 1.0;\n }\n\n el.__helios_attrs = {\n offset: isNaN(offset) ? 0 : offset,\n seek: isNaN(seek) ? 0 : seek,\n fadeIn: isNaN(fadeIn) ? 0 : fadeIn,\n fadeOut: isNaN(fadeOut) ? 0 : fadeOut,\n volume,\n loop,\n playbackRate: rate,\n duration: (Number.isFinite(duration) && duration > 0) ? duration : undefined\n };\n return el.__helios_attrs;\n }\n"; export declare const SYNC_MEDIA_FUNCTION = "\n function syncMedia(el, globalTime) {\n const attrs = parseMediaAttributes(el);\n\n // Calculate target time\n // Formula: (GlobalTime - Offset) * Rate + Seek\n let targetTime = Math.max(0, (globalTime - attrs.offset) * attrs.playbackRate + attrs.seek);\n\n // Handle Looping\n if (attrs.loop && attrs.duration && targetTime > attrs.duration) {\n targetTime = targetTime % attrs.duration;\n }\n\n if (!el.paused) {\n el.pause();\n }\n el.currentTime = targetTime;\n }\n";