@filip.mazev/blocks 1.4.15 → 1.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/styles/_a11y.scss +5 -0
- package/core/styles/_field-actions.scss +36 -0
- package/core/styles/_field-state.scss +12 -3
- package/core/styles/_helpers.scss +3 -0
- package/core/styles/_index.scss +1 -0
- package/core/styles/_slider-rail.scss +11 -0
- package/core/styles/_slider.scss +119 -11
- package/core/styles/_text-overflow.scss +7 -0
- package/core/styles/_text.scss +5 -0
- package/core/styles/_validation.scss +48 -0
- package/fesm2022/filip.mazev-blocks-core.mjs +83 -18
- package/fesm2022/filip.mazev-blocks-core.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks-effects-runtime.mjs +14 -3
- package/fesm2022/filip.mazev-blocks-effects-runtime.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks-effects.mjs +16 -8
- package/fesm2022/filip.mazev-blocks-effects.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks-forms.mjs +5282 -1093
- package/fesm2022/filip.mazev-blocks-forms.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks-primitives.mjs +2373 -1294
- package/fesm2022/filip.mazev-blocks-primitives.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks.mjs +1 -1
- package/fesm2022/filip.mazev-blocks.mjs.map +1 -1
- package/forms/README.md +80 -0
- package/package.json +1 -1
- package/types/filip.mazev-blocks-core.d.ts +22 -2
- package/types/filip.mazev-blocks-effects.d.ts +1 -1
- package/types/filip.mazev-blocks-forms.d.ts +1290 -76
- package/types/filip.mazev-blocks-primitives.d.ts +304 -6
- package/types/filip.mazev-blocks.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filip.mazev-blocks-effects-runtime.mjs","names":[],"sources":["../../../projects/blocks/effects/runtime/dom.ts","../../../projects/blocks/effects/runtime/configuration.ts","../../../projects/blocks/effects/runtime/scheduler.ts","../../../projects/blocks/effects/runtime/visibility.ts","../../../projects/blocks/effects/runtime/ambient.ts","../../../projects/blocks/effects/runtime/scene.ts","../../../projects/blocks/effects/runtime/spring.ts","../../../projects/blocks/effects/runtime/surface.ts","../../../projects/blocks/effects/runtime/transition.ts"],"sourcesContent":["/** Only the properties owned by a controller are restored, leaving application changes intact. */\nexport function rememberStyles(element: HTMLElement, properties: readonly string[]): () => void {\n const values = properties.map((property) => ({\n property,\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property)\n }));\n return () => {\n for (const item of values) {\n if (item.value) element.style.setProperty(item.property, item.value, item.priority);\n else element.style.removeProperty(item.property);\n }\n };\n}\n\nexport function rememberAttributes(element: HTMLElement, attributes: readonly string[]): () => void {\n const values = attributes.map((attribute) => [attribute, element.getAttribute(attribute)] as const);\n return () => {\n for (const [attribute, value] of values) {\n if (value === null) element.removeAttribute(attribute);\n else element.setAttribute(attribute, value);\n }\n };\n}\n\nexport function finiteClamp(value: number | undefined, low: number, high: number, fallback: number): number {\n return value === undefined || !Number.isFinite(value) ? fallback : Math.min(high, Math.max(low, value));\n}\n\nexport function smoothstep(low: number, high: number, value: number): number {\n const t = Math.min(1, Math.max(0, (value - low) / (high - low)));\n return t * t * (3 - 2 * t);\n}\n","import { finiteClamp, rememberAttributes, rememberStyles } from './dom';\nimport type { AppearanceConfiguration, AppearanceConfigurationController } from './types';\n\nexport const configurationEvent = 'bx-glass-config-change';\nconst attributes = ['data-bx-glass-quality', 'data-bx-reduced-motion', 'data-bx-reduced-transparency'];\nconst properties = ['--bx-glassiness'];\nconst configured = new WeakSet<HTMLElement>();\n\n/** Configure one inherited application scope. Use document.documentElement to include overlays. */\nexport function configureAppearance(root: HTMLElement, initial: AppearanceConfiguration = {}): AppearanceConfigurationController {\n if (configured.has(root)) throw new Error('A glass configuration is already mounted on this root.');\n configured.add(root);\n const restoreAttributes = rememberAttributes(root, attributes);\n const originalAttributes = new Map(attributes.map((name) => [name, root.getAttribute(name)]));\n const restoreStyles = rememberStyles(root, properties);\n let options = { ...initial };\n let disposed = false;\n const notify = () => {\n const viewEvent = root.ownerDocument.defaultView?.CustomEvent;\n if (viewEvent) root.ownerDocument.dispatchEvent(new viewEvent(configurationEvent, { detail: root }));\n };\n const paint = (sync = true) => {\n const values: [string, unknown][] = [\n ['data-bx-glass-quality', options.quality],\n ['data-bx-reduced-motion', options.reducedMotion],\n ['data-bx-reduced-transparency', options.reducedTransparency]\n ];\n for (const [name, value] of values) {\n const next = value === undefined ? (originalAttributes.get(name) ?? null) : String(value);\n if (root.getAttribute(name) === next) continue;\n if (next === null) root.removeAttribute(name);\n else root.setAttribute(name, next);\n }\n if (options.glassiness !== undefined) {\n const next = String(finiteClamp(options.glassiness, 0, 1, 0.5));\n if (root.style.getPropertyValue('--bx-glassiness') !== next) root.style.setProperty('--bx-glassiness', next);\n } else restoreStyles();\n // Tint and blur inherit directly in CSS. Only renderer/accessibility changes\n // need to synchronously revisit every mounted surface.\n if (sync) notify();\n };\n paint();\n return {\n update(next) {\n if (!disposed) {\n const previous = options;\n options = { ...options, ...next };\n paint(\n previous.quality !== options.quality ||\n previous.reducedMotion !== options.reducedMotion ||\n previous.reducedTransparency !== options.reducedTransparency\n );\n }\n },\n destroy() {\n if (disposed) return;\n disposed = true;\n restoreAttributes();\n restoreStyles();\n configured.delete(root);\n notify();\n }\n };\n}\n\nexport function inheritedAttribute(element: HTMLElement, name: string): string | null {\n let current: HTMLElement | null = element;\n while (current) {\n const value = current.getAttribute(name);\n if (value !== null) return value;\n current = current.parentElement;\n }\n return null;\n}\n","export type FrameCallback = (deltaSeconds: number, timestamp: number) => boolean;\n\ninterface FrameEntry {\n callback: FrameCallback;\n}\nconst entries = new Set<FrameEntry>();\nlet frame: number | undefined;\nlet previousTime: number | undefined;\nlet ticking = false;\n\nfunction tick(timestamp: number): void {\n frame = undefined;\n ticking = true;\n const delta = previousTime === undefined ? 1 / 60 : Math.min(0.064, Math.max(0, (timestamp - previousTime) / 1000));\n previousTime = timestamp;\n for (const entry of Array.from(entries)) {\n if (!entries.has(entry)) continue;\n try {\n if (!entry.callback(delta, timestamp)) entries.delete(entry);\n } catch (error) {\n entries.delete(entry);\n // Keep unrelated surfaces running; report the failed callback separately.\n queueMicrotask(() => {\n throw error;\n });\n }\n }\n ticking = false;\n if (entries.size > 0) frame = requestAnimationFrame(tick);\n else previousTime = undefined;\n}\n\n/** All effects share one lazy clock. Returning false removes the callback. */\nexport function subscribeFrame(callback: FrameCallback): () => void {\n if (typeof requestAnimationFrame !== 'function') return () => {};\n const entry: FrameEntry = { callback };\n entries.add(entry);\n if (frame === undefined && !ticking) frame = requestAnimationFrame(tick);\n return () => {\n entries.delete(entry);\n if (entries.size === 0) {\n if (frame !== undefined) cancelAnimationFrame(frame);\n frame = undefined;\n previousTime = undefined;\n }\n };\n}\n","/** Structural overlay boundaries are independent of numeric z-index values in nested contexts. */\nexport const lightBoundarySelector =\n '[data-bx-light-scope], dialog, [role=\"dialog\"], [role=\"alertdialog\"], [popover], .cdk-overlay-pane, .toast-container, bx-modal';\n\nconst lightingOrigins = new WeakMap<HTMLElement, HTMLElement>();\n\n/** Let a passive overlay receive light from its trigger's context. Register before mounting its surfaces. */\nexport function inheritGlassLighting(overlay: HTMLElement, origin: HTMLElement): () => void {\n if (overlay.contains(origin)) throw new Error('A lighting origin must be outside its overlay.');\n lightingOrigins.set(overlay, origin);\n return () => lightingOrigins.delete(overlay);\n}\n\nexport function lightingOrigin(element: Element): Element {\n let current: Element | null = element;\n while (current) {\n const origin = lightingOrigins.get(current as HTMLElement);\n if (origin) return origin;\n current = current.parentElement;\n }\n return element;\n}\n\n/** A short-lived snapshot: caches style reads within a lighting batch, never tracks pointer motion. */\nexport function lightingVisibility(doc: Document, view: Window) {\n const styles = new Map<Element, CSSStyleDeclaration>();\n const boundaries = new Map<HTMLElement, HTMLElement>();\n const layers = new Map<HTMLElement, HTMLElement>();\n const ambientBoundaries = new Map<Element, HTMLElement>();\n const hitStacks = new Map<string, Element[]>();\n const style = (element: Element) => {\n let value = styles.get(element);\n if (!value) {\n value = view.getComputedStyle(element);\n styles.set(element, value);\n }\n return value;\n };\n const elementsAt = (x: number, y: number): Element[] => {\n const key = `${Math.round(x)},${Math.round(y)}`;\n const cached = hitStacks.get(key);\n if (cached) return cached;\n const elements = [...doc.elementsFromPoint(x, y)];\n for (let index = 0; index < elements.length; index++) {\n const root = elements[index].shadowRoot;\n if (!root) continue;\n const shadowElements = root.elementsFromPoint(x, y);\n if (!shadowElements.length) continue;\n elements.splice(index, 0, ...shadowElements);\n index += shadowElements.length;\n }\n hitStacks.set(key, elements);\n return elements;\n };\n const ambientBoundary = (element: Element): HTMLElement => {\n const cached = ambientBoundaries.get(element);\n if (cached) return cached;\n const origin = lightingOrigin(element);\n if (origin !== element) {\n const result = ambientBoundary(origin);\n ambientBoundaries.set(element, result);\n return result;\n }\n let current: Element | null = element;\n const visited: Element[] = [];\n while (current) {\n visited.push(current);\n const boundary = ambientBoundaries.get(current) ?? current.closest<HTMLElement>(lightBoundarySelector);\n if (boundary) {\n for (const ancestor of visited) ambientBoundaries.set(ancestor, boundary);\n return boundary;\n }\n const root = current.getRootNode() as ShadowRoot;\n current = current.parentElement ?? root.host ?? null;\n }\n for (const ancestor of visited) ambientBoundaries.set(ancestor, doc.documentElement);\n return doc.documentElement;\n };\n const boundary = (element: HTMLElement): HTMLElement => {\n const cached = boundaries.get(element);\n if (cached) return cached;\n const origin = lightingOrigin(element);\n if (origin !== element) {\n const result = boundary(origin as HTMLElement);\n boundaries.set(element, result);\n return result;\n }\n const css = style(element);\n const result =\n element.matches(lightBoundarySelector) || css.position === 'fixed' || css.position === 'sticky'\n ? element\n : element.parentElement\n ? boundary(element.parentElement)\n : element;\n boundaries.set(element, result);\n return result;\n };\n const layer = (element: HTMLElement): HTMLElement => {\n const cached = layers.get(element);\n if (cached) return cached;\n const css = style(element);\n const positionedLayer = css.position !== 'static' && css.zIndex !== 'auto';\n const result =\n element.matches(lightBoundarySelector) || css.position === 'fixed' || css.position === 'sticky' || positionedLayer\n ? element\n : element.parentElement\n ? layer(element.parentElement)\n : element;\n layers.set(element, result);\n return result;\n };\n const exposed = (element: HTMLElement, x: number, y: number, bounds: DOMRect): boolean => {\n if (!element.isConnected || bounds.width <= 0 || bounds.height <= 0) return false;\n // Stay inside rounded corners: their bounding-box corners are not painted pixels.\n const css = style(element);\n const radius = Math.min(\n bounds.width / 2,\n bounds.height / 2,\n Math.max(\n ...[css.borderTopLeftRadius, css.borderTopRightRadius, css.borderBottomLeftRadius, css.borderBottomRightRadius].map((value) => parseFloat(value) || 0)\n )\n );\n const inset = Math.min(bounds.width / 2, bounds.height / 2, 1 + radius * (1 - Math.SQRT1_2));\n const px = Math.max(bounds.left + inset, Math.min(x, bounds.right - inset));\n const py = Math.max(bounds.top + inset, Math.min(y, bounds.bottom - inset));\n if (px < 0 || py < 0 || px >= view.innerWidth || py >= view.innerHeight) return false;\n // Passive help bubbles are intentionally absent from pointer hit testing.\n if (css.pointerEvents === 'none' && element.closest('bx-tooltip, [role=\"tooltip\"]')) {\n if (css.visibility !== 'visible' || css.display === 'none' || Number(css.opacity) === 0) return false;\n const origin = lightingOrigin(element);\n if (origin !== element) {\n const rect = origin.getBoundingClientRect();\n return exposed(origin as HTMLElement, rect.left + rect.width / 2, rect.top + rect.height / 2, rect);\n }\n const behind = doc.elementFromPoint(px, py);\n return !!behind && ambientBoundary(behind) === ambientBoundary(element);\n }\n const hit = doc.elementFromPoint(px, py);\n return !!hit && (hit === element || element.contains(hit));\n };\n return { boundary, layer, exposed, style, elementsAt, ambientBoundary };\n}\n","import { subscribeFrame } from './scheduler';\nimport { inheritedAttribute } from './configuration';\nimport { lightingVisibility } from './visibility';\nimport type { PointLight } from './scene';\n\nexport interface AmbientReceiver {\n id: number;\n element: HTMLElement;\n visible: boolean;\n bounds?: DOMRect;\n}\ninterface VisualSource {\n element: Element;\n color: string;\n}\ninterface Sample {\n bounds?: DOMRect;\n lights: PointLight[];\n media: Set<Element>;\n rects: Map<Element, DOMRect>;\n}\ninterface RasterSample {\n data: ImageData | null;\n stamp?: number;\n}\n\nconst sampleInterval = 180;\nconst liveInterval = 16;\nconst rasterSize = 32;\n\n/** Shared environmental sampling; geometry changes bypass the visual-source cooldown. */\nexport class AmbientSampler {\n private samples = new Map<AmbientReceiver, Sample>();\n private dirty = new Set<AmbientReceiver>();\n private pending = new Set<AmbientReceiver>();\n private urgent = new Set<AmbientReceiver>();\n private sources = new Set<Element>();\n private initialized = false;\n private media = new WeakMap<Element, RasterSample>();\n private dependencies?: Set<Element>;\n private sampleCanvas: HTMLCanvasElement;\n private sampleContext: CanvasRenderingContext2D | null;\n private timer?: number;\n private liveTimer?: number;\n private stopFrame?: () => void;\n private nextSample = 0;\n private liveDelay = liveInterval;\n private motion: MediaQueryList;\n\n constructor(\n private doc: Document,\n private view: Window,\n private changed: (entry: AmbientReceiver) => void,\n private observeRoot: (root: ShadowRoot) => void\n ) {\n this.sampleCanvas = doc.createElement('canvas');\n this.sampleCanvas.width = this.sampleCanvas.height = rasterSize;\n this.sampleContext = this.sampleCanvas.getContext('2d', { willReadFrequently: true });\n this.motion = view.matchMedia('(prefers-reduced-motion: reduce)');\n }\n\n public add(entry: AmbientReceiver): void {\n if (!this.initialized) {\n this.scan(this.doc);\n this.initialized = true;\n }\n const root = entry.element.getRootNode();\n if ('host' in root) this.scan(root as ShadowRoot);\n this.samples.set(entry, { lights: [], media: new Set(), rects: new Map() });\n this.invalidate(entry);\n }\n\n public remove(entry: AmbientReceiver): void {\n this.samples.delete(entry);\n this.dirty.delete(entry);\n this.pending.delete(entry);\n this.urgent.delete(entry);\n this.syncLive();\n }\n\n public lights(entry: AmbientReceiver): PointLight[] {\n const sample = this.samples.get(entry);\n if (!sample) return [];\n const dx = entry.bounds && sample.bounds ? entry.bounds.left - sample.bounds.left : 0;\n const dy = entry.bounds && sample.bounds ? entry.bounds.top - sample.bounds.top : 0;\n // Keep cached taps attached to a moving receiver until its next sample.\n return dx || dy ? sample.lights.map((light) => ({ ...light, x: light.x + dx, y: light.y + dy })) : sample.lights;\n }\n\n public invalidate(entry?: AmbientReceiver | AmbientReceiver[], immediate = false): void {\n for (const receiver of entry ? (Array.isArray(entry) ? entry : [entry]) : this.samples.keys()) {\n if (!receiver.visible || !receiver.element.isConnected) continue;\n if (!this.pending.has(receiver)) this.dirty.add(receiver);\n if (immediate) this.urgent.add(receiver);\n }\n this.resume();\n }\n\n /** Viewport re-entry waits for a current sample before replacing the cached paint. */\n public isPending(entry: AmbientReceiver): boolean {\n return this.urgent.has(entry);\n }\n\n public assetChanged(element: Element): void {\n this.media.delete(element);\n this.invalidate();\n }\n\n public sourcesChanged(record: MutationRecord): void {\n for (const node of record.addedNodes) {\n if (node.nodeType === 1) this.scan(node as Element);\n }\n for (const source of this.sources) if (!source.isConnected) this.sources.delete(source);\n }\n\n public resume(): void {\n if (this.doc.hidden) {\n if (this.timer !== undefined) this.view.clearTimeout(this.timer);\n if (this.liveTimer !== undefined) this.view.clearTimeout(this.liveTimer);\n this.timer = this.liveTimer = undefined;\n this.stopFrame?.();\n this.stopFrame = undefined;\n for (const entry of this.pending) this.dirty.add(entry);\n this.pending.clear();\n return;\n }\n if (this.urgent.size) {\n if (this.timer !== undefined) this.view.clearTimeout(this.timer);\n this.timer = undefined;\n for (const entry of this.dirty) this.pending.add(entry);\n this.dirty.clear();\n this.stopFrame ??= subscribeFrame(() => this.sampleBatch());\n }\n if (this.dirty.size && this.timer === undefined && !this.stopFrame) {\n this.timer = this.view.setTimeout(\n () => {\n this.timer = undefined;\n this.nextSample = this.view.performance.now() + sampleInterval;\n this.pending = this.dirty;\n this.dirty = new Set();\n this.stopFrame = subscribeFrame(() => this.sampleBatch());\n },\n Math.max(0, this.nextSample - this.view.performance.now())\n );\n }\n this.syncLive();\n }\n\n public destroy(): void {\n if (this.timer !== undefined) this.view.clearTimeout(this.timer);\n if (this.liveTimer !== undefined) this.view.clearTimeout(this.liveTimer);\n this.stopFrame?.();\n this.stopFrame = undefined;\n this.timer = this.liveTimer = undefined;\n this.samples.clear();\n this.dirty.clear();\n this.pending.clear();\n this.urgent.clear();\n this.sources.clear();\n this.media = new WeakMap();\n this.initialized = false;\n this.nextSample = 0;\n this.liveDelay = liveInterval;\n }\n\n private scan(root: ParentNode): void {\n if ('host' in root) this.observeRoot(root as ShadowRoot);\n if ('tagName' in root && /^(IMG|VIDEO|CANVAS)$/.test(String(root.tagName))) this.sources.add(root as Element);\n const shadow = 'shadowRoot' in root ? (root as Element).shadowRoot : null;\n if (shadow) this.scan(shadow);\n for (const element of root.querySelectorAll('*')) {\n if (/^(IMG|VIDEO|CANVAS)$/.test(element.tagName)) this.sources.add(element);\n if (element.shadowRoot) this.scan(element.shadowRoot);\n }\n }\n\n private sampleBatch(): boolean {\n const start = this.view.performance.now();\n const visibility = lightingVisibility(this.doc, this.view);\n const rects = new Map<Element, DOMRect>();\n const rasterSamples = new Map<Element, ImageData | null>();\n const sources = [...this.sources];\n const completed: AmbientReceiver[] = [];\n // Scroll receivers stay ahead of deferred work even while new scroll events\n // keep arriving. Set order rotates completed receivers behind waiting peers.\n for (const entry of new Set([...this.urgent, ...this.pending])) {\n this.pending.delete(entry);\n this.urgent.delete(entry);\n if (!entry.visible || !entry.element.isConnected || !this.samples.has(entry)) continue;\n entry.bounds = entry.element.getBoundingClientRect();\n const bounds = entry.bounds;\n // IntersectionObserver's margin keeps receivers warm, but hit tests outside\n // the viewport have no pixels. Keep their last lighting until they return.\n if (bounds.bottom <= 0 || bounds.right <= 0 || bounds.top >= this.view.innerHeight || bounds.left >= this.view.innerWidth) continue;\n this.dependencies = new Set();\n const lights = this.environmentLights(entry, sources, rasterSamples, rects, visibility);\n const mediaRects = new Map<Element, DOMRect>();\n for (const source of this.dependencies) mediaRects.set(source, this.rectFor(source, rects));\n this.samples.set(entry, { bounds, lights, media: this.dependencies, rects: mediaRects });\n completed.push(entry);\n // A receiver is atomic. Yield between receivers rather than block a frame with a whole page.\n if (completed.length >= 4 || this.view.performance.now() - start >= 4) break;\n }\n this.dependencies = undefined;\n for (const entry of completed) this.changed(entry);\n if (this.pending.size) return true;\n this.stopFrame = undefined;\n this.nextSample = this.view.performance.now() + sampleInterval;\n this.resume();\n return false;\n }\n\n private liveSources(): Map<Element, AmbientReceiver[]> {\n const sources = new Map<Element, AmbientReceiver[]>();\n for (const [entry, sample] of this.samples) {\n const motion = inheritedAttribute(entry.element, 'data-bx-reduced-motion');\n if (!entry.visible || !entry.element.isConnected || (motion === null ? this.motion.matches : motion === 'true')) continue;\n const bounds = entry.bounds;\n if (bounds && (bounds.bottom <= 0 || bounds.right <= 0 || bounds.top >= this.view.innerHeight || bounds.left >= this.view.innerWidth)) continue;\n for (const source of sample.media) {\n if (!source.isConnected || !/^(CANVAS|VIDEO)$/.test(source.tagName) || this.media.get(source)?.data === null) continue;\n if (source.tagName === 'VIDEO' && (source as HTMLVideoElement).paused) continue;\n const entries = sources.get(source) ?? [];\n entries.push(entry);\n sources.set(source, entries);\n }\n }\n return sources;\n }\n\n private syncLive(): void {\n const active = !this.doc.hidden && this.liveSources().size > 0;\n if (!active && this.liveTimer !== undefined) {\n this.view.clearTimeout(this.liveTimer);\n this.liveTimer = undefined;\n }\n if (!active || this.liveTimer !== undefined) return;\n this.liveTimer = this.view.setTimeout(() => {\n this.liveTimer = undefined;\n let changed = false;\n const recolored = new Set<AmbientReceiver>();\n const visibility = lightingVisibility(this.doc, this.view);\n for (const [source, entries] of this.liveSources()) {\n const previous = this.media.get(source);\n const next = this.readRaster(source, true);\n // Compare quantized pixels, not just the fact that a canvas/video exists.\n if (previous?.data && next?.data && this.samePixels(previous.data, next.data)) continue;\n if (previous?.data === next?.data) continue;\n changed = true;\n const coverageChanged = !previous?.data || !next?.data || !this.samePixels(previous.data, next.data, true);\n for (const entry of entries) {\n const sample = this.samples.get(entry);\n if (!sample || coverageChanged || this.dirty.has(entry) || this.pending.has(entry)) {\n this.dirty.add(entry);\n this.urgent.add(entry);\n continue;\n }\n // Animation changes pixels, not the hit-test stack. Reuse the source bindings and\n // geometry until a real layout/visibility invalidation, and repaint only changed taps.\n const pixels = new Map([[source, next?.data ?? null]]);\n sample.lights = sample.lights.map((light) => {\n if (light.source !== source) return light;\n const color = this.rasterColorAt(source, light.x, light.y, pixels, sample.rects, visibility);\n if (!color || color === light.color) return light;\n recolored.add(entry);\n return { ...light, color };\n });\n }\n }\n for (const entry of recolored) this.changed(entry);\n this.liveDelay = changed ? liveInterval : Math.min(250, this.liveDelay * 2);\n this.resume();\n }, this.liveDelay);\n }\n\n private samePixels(first: ImageData, second: ImageData, alphaOnly = false): boolean {\n for (let index = alphaOnly ? 3 : 0; index < first.data.length; index += alphaOnly ? 4 : 1) {\n if (alphaOnly ? first.data[index] >> 3 !== second.data[index] >> 3 : Math.abs(first.data[index] - second.data[index]) >= 2) return false;\n }\n return true;\n }\n\n private readRaster(element: Element, refresh = false): RasterSample | undefined {\n const cached = this.media.get(element);\n if (cached && !refresh) return cached;\n const tag = element.tagName;\n let source: CanvasImageSource;\n let stamp: number | undefined;\n if (tag === 'IMG') {\n const image = element as HTMLImageElement;\n if (!image.complete || !image.naturalWidth) return undefined;\n source = image;\n } else if (tag === 'VIDEO') {\n const video = element as HTMLVideoElement;\n if (video.readyState < 2 || !video.videoWidth) return undefined;\n stamp = video.currentTime;\n if (cached?.stamp === stamp) return cached;\n source = video;\n } else {\n const canvas = element as HTMLCanvasElement;\n if (!canvas.width || !canvas.height) return undefined;\n source = canvas;\n }\n if (!this.sampleContext) return undefined;\n let data: ImageData | null = null;\n try {\n this.sampleContext.clearRect(0, 0, rasterSize, rasterSize);\n this.sampleContext.drawImage(source, 0, 0, rasterSize, rasterSize);\n data = this.sampleContext.getImageData(0, 0, rasterSize, rasterSize);\n } catch {\n // Cache failures too, and recover the shared buffer after a cross-origin source taints it.\n this.sampleCanvas.width = rasterSize;\n this.sampleContext = this.sampleCanvas.getContext('2d', { willReadFrequently: true });\n }\n const result = { data, stamp };\n this.media.set(element, result);\n return result;\n }\n\n private environmentLights(\n entry: AmbientReceiver,\n rasterSources: Element[],\n rasterSamples: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>,\n visibility: ReturnType<typeof lightingVisibility>\n ): PointLight[] {\n const bounds = entry.bounds;\n if (\n !bounds ||\n bounds.width <= 0 ||\n bounds.height <= 0 ||\n entry.element.getAttribute('data-bx-surface') === 'solid' ||\n entry.element.getAttribute('data-bx-reduced-transparency') === 'true'\n )\n return [];\n const insetX = Math.min(3, bounds.width * 0.1);\n const insetY = Math.min(3, bounds.height * 0.1);\n const points = [\n { x: bounds.left + bounds.width * 0.24, y: bounds.top + insetY, side: 'inside' as const, edge: 0 },\n { x: bounds.left + bounds.width * 0.76, y: bounds.top + insetY, side: 'inside' as const, edge: 0 },\n { x: bounds.right - insetX, y: bounds.top + bounds.height * 0.24, side: 'inside' as const, edge: 1 },\n { x: bounds.right - insetX, y: bounds.top + bounds.height * 0.76, side: 'inside' as const, edge: 1 },\n { x: bounds.left + bounds.width * 0.76, y: bounds.bottom - insetY, side: 'inside' as const, edge: 2 },\n { x: bounds.left + bounds.width * 0.24, y: bounds.bottom - insetY, side: 'inside' as const, edge: 2 },\n { x: bounds.left + insetX, y: bounds.top + bounds.height * 0.76, side: 'inside' as const, edge: 3 },\n { x: bounds.left + insetX, y: bounds.top + bounds.height * 0.24, side: 'inside' as const, edge: 3 },\n ...[24, 96].flatMap((gap) => [\n { x: bounds.left + bounds.width / 2, y: bounds.top - gap, side: 'outside' as const, edge: 0 },\n { x: bounds.right + gap, y: bounds.top + bounds.height / 2, side: 'outside' as const, edge: 1 },\n { x: bounds.left + bounds.width / 2, y: bounds.bottom + gap, side: 'outside' as const, edge: 2 },\n { x: bounds.left - gap, y: bounds.top + bounds.height / 2, side: 'outside' as const, edge: 3 }\n ])\n ];\n const visibleX = Math.max(1, Math.min(this.view.innerWidth - 1, bounds.left + bounds.width / 2));\n const visibleY = Math.max(1, Math.min(this.view.innerHeight - 1, bounds.top + bounds.height / 2));\n if (!visibility.exposed(entry.element, visibleX, visibleY, bounds)) return [];\n const targetBoundary = visibility.ambientBoundary(entry.element);\n const passiveTooltip = visibility.style(entry.element).pointerEvents === 'none' && !!entry.element.closest('bx-tooltip, [role=\"tooltip\"]');\n // Cull once per receiver, rather than walking every media element at every edge probe.\n rasterSources = rasterSources.filter((source) => {\n const rect = this.rectFor(source, rects);\n return (\n rect.width > 0 &&\n rect.height > 0 &&\n rect.right >= bounds.left - 96 &&\n rect.left <= bounds.right + 96 &&\n rect.bottom >= bounds.top - 96 &&\n rect.top <= bounds.bottom + 96 &&\n visibility.ambientBoundary(source) === targetBoundary\n );\n });\n const lights: PointLight[] = [];\n const sourcesByEdge = new Map<number, Set<Element>>();\n const colorsByEdge = new Map<number, Map<Element, Set<string>>>();\n\n points.forEach((point, index) => {\n if (point.x < 0 || point.y < 0 || point.x >= this.view.innerWidth || point.y >= this.view.innerHeight) return;\n const stack = visibility.elementsAt(point.x, point.y);\n const receiverIndex = stack.findIndex((element) => this.isInside(element, entry.element));\n let source: VisualSource | undefined;\n let foreground = false;\n\n if (point.side === 'inside' && receiverIndex >= 0) {\n source = this.findVisualSource(stack.slice(0, receiverIndex), entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: true,\n skipRoot: true\n });\n if (source) foreground = true;\n source ??= this.findRasterSource(rasterSources, entry, point.x, point.y, visibility, rasterSamples, rects, stack, receiverIndex, true, targetBoundary);\n source ??= this.findVisualSource(stack.slice(receiverIndex + 1), entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: true,\n skipRoot: true\n });\n source ??= this.findRasterSource(rasterSources, entry, point.x, point.y, visibility, rasterSamples, rects, stack, receiverIndex, false, targetBoundary);\n source ??= this.findVisualSource(stack.slice(receiverIndex + 1), entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: false,\n skipRoot: true\n });\n source ??= this.findVisualSource(stack.slice(receiverIndex + 1), entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: false,\n skipRoot: false\n });\n } else if (point.side === 'outside' || (receiverIndex < 0 && passiveTooltip)) {\n source = this.findVisualSource(stack, entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: true,\n skipRoot: true\n });\n source ??= this.findRasterSource(rasterSources, entry, point.x, point.y, visibility, rasterSamples, rects, stack, -1, undefined, targetBoundary);\n source ??= this.findVisualSource(stack, entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: false,\n skipRoot: true\n });\n source ??= this.findVisualSource(stack, entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: false,\n skipRoot: false\n });\n }\n\n if (!source || visibility.ambientBoundary(source.element) !== targetBoundary) return;\n const sourceRect = this.rectFor(source.element, rects);\n const gapX = Math.max(bounds.left - sourceRect.right, sourceRect.left - bounds.right, 0);\n const gapY = Math.max(bounds.top - sourceRect.bottom, sourceRect.top - bounds.bottom, 0);\n if (point.side === 'outside' && Math.hypot(gapX, gapY) > 160) return;\n if (source.element === entry.element || this.isInside(source.element, entry.element)) return;\n const edgeSources = sourcesByEdge.get(point.edge) ?? new Set<Element>();\n if (point.side === 'outside' && edgeSources.has(source.element)) return;\n const edgeColors = colorsByEdge.get(point.edge) ?? new Map<Element, Set<string>>();\n const sourceColors = edgeColors.get(source.element) ?? new Set<string>();\n if (point.side === 'outside' && sourceColors.has(source.color)) return;\n sourceColors.add(source.color);\n edgeColors.set(source.element, sourceColors);\n colorsByEdge.set(point.edge, edgeColors);\n if (point.side === 'inside') {\n edgeSources.add(source.element);\n sourcesByEdge.set(point.edge, edgeSources);\n }\n\n if (point.side === 'outside') {\n foreground = this.isAmbientForeground(source.element, entry.element, stack, -1, visibility);\n }\n const depth = foreground ? 24 : 52;\n const gap = Math.hypot(gapX, gapY);\n const edgeLength = point.edge % 2 === 0 ? bounds.width : bounds.height;\n lights.push({\n key: `environment:${entry.id}:${index}`,\n source: source.element.namespaceURI === 'http://www.w3.org/1999/xhtml' ? (source.element as HTMLElement) : undefined,\n ambient: true,\n x: point.x,\n y: point.y,\n z: depth,\n color: source.color,\n intensity: (point.side === 'inside' ? 0.38 : 0.48) * Math.pow(Math.max(0, 1 - gap / 160), 2),\n radius: 240,\n spread: Math.max(48, Math.min(240, edgeLength * 0.65))\n });\n });\n\n return lights;\n }\n\n private findVisualSource(\n elements: Element[],\n entry: AmbientReceiver,\n x: number,\n y: number,\n visibility: ReturnType<typeof lightingVisibility>,\n rasterSamples: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>,\n options: { skipAncestors: boolean; skipRoot: boolean }\n ): VisualSource | undefined {\n for (const element of elements) {\n if (element === entry.element || this.isInside(element, entry.element)) continue;\n if (options.skipAncestors && this.isInside(entry.element, element)) continue;\n if (options.skipRoot && (element === this.doc.documentElement || element === this.doc.body)) continue;\n if (visibility.ambientBoundary(element) !== visibility.ambientBoundary(entry.element)) continue;\n const color = this.visualColorAt(element, x, y, visibility, rasterSamples, rects);\n if (color) return { element, color };\n }\n return undefined;\n }\n\n private findRasterSource(\n sources: Element[],\n entry: AmbientReceiver,\n x: number,\n y: number,\n visibility: ReturnType<typeof lightingVisibility>,\n rasterSamples: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>,\n stack: Element[],\n receiverIndex: number,\n foreground: boolean | undefined,\n targetBoundary: HTMLElement\n ): VisualSource | undefined {\n const matches = sources\n .filter((element) => {\n if (this.isInside(element, entry.element) || visibility.ambientBoundary(element) !== targetBoundary) return false;\n const bounds = this.rectFor(element, rects);\n if (x < bounds.left || x >= bounds.right || y < bounds.top || y >= bounds.bottom) return false;\n return foreground === undefined || this.isAmbientForeground(element, entry.element, stack, receiverIndex, visibility) === foreground;\n })\n .sort((first, second) => this.rasterOrder(second, stack, entry.element, visibility) - this.rasterOrder(first, stack, entry.element, visibility));\n\n for (const element of matches) {\n const color = this.rasterColorAt(element, x, y, rasterSamples, rects, visibility);\n if (color) return { element, color };\n }\n return undefined;\n }\n\n private visualColorAt(\n element: Element,\n x: number,\n y: number,\n visibility: ReturnType<typeof lightingVisibility>,\n rasterSamples: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>\n ): string | undefined {\n const raster = this.rasterColorAt(element, x, y, rasterSamples, rects, visibility);\n if (raster) return raster;\n const style = visibility.style(element);\n const gradient = this.gradientColorAt(style.backgroundImage, this.rectFor(element, rects), x, y);\n if (gradient) return gradient;\n if (!this.isTransparent(style.backgroundColor)) return style.backgroundColor;\n for (const side of ['top', 'right', 'bottom', 'left']) {\n const color = style.getPropertyValue(`border-${side}-color`);\n if (parseFloat(style.getPropertyValue(`border-${side}-width`)) > 0 && !this.isTransparent(color)) return color;\n }\n return undefined;\n }\n\n private rasterColorAt(\n element: Element,\n x: number,\n y: number,\n cache: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>,\n visibility: ReturnType<typeof lightingVisibility>\n ): string | undefined {\n const tag = element.tagName;\n if (!/^(IMG|CANVAS|VIDEO)$/.test(tag)) return undefined;\n const bounds = this.rectFor(element, rects);\n if (bounds.width <= 0 || bounds.height <= 0) return undefined;\n const css = visibility.style(element);\n if (css.visibility !== 'visible' || Number(css.opacity) === 0) return undefined;\n this.dependencies?.add(element);\n let data = cache.get(element);\n if (data === undefined) {\n data = this.readRaster(element)?.data ?? null;\n cache.set(element, data);\n }\n if (!data) return undefined;\n\n let u = Math.max(0, Math.min(1, (x - bounds.left) / bounds.width));\n let v = Math.max(0, Math.min(1, (y - bounds.top) / bounds.height));\n if ((tag === 'IMG' || tag === 'VIDEO') && css.objectFit !== 'fill') {\n const width = tag === 'IMG' ? (element as HTMLImageElement).naturalWidth : (element as HTMLVideoElement).videoWidth;\n const height = tag === 'IMG' ? (element as HTMLImageElement).naturalHeight : (element as HTMLVideoElement).videoHeight;\n if (!width || !height) return undefined;\n const contain = Math.min(bounds.width / width, bounds.height / height);\n const scale =\n css.objectFit === 'cover'\n ? Math.max(bounds.width / width, bounds.height / height)\n : css.objectFit === 'none'\n ? 1\n : css.objectFit === 'scale-down'\n ? Math.min(1, contain)\n : contain;\n const [positionX = '50%', positionY = '50%'] = css.objectPosition.split(' ');\n const offset = (position: string, space: number) => {\n if (position.endsWith('%')) return (parseFloat(position) / 100) * space;\n if (position.endsWith('px')) return parseFloat(position);\n return position === 'left' || position === 'top' ? 0 : position === 'right' || position === 'bottom' ? space : space / 2;\n };\n u = (x - bounds.left - offset(positionX, bounds.width - width * scale)) / (width * scale);\n v = (y - bounds.top - offset(positionY, bounds.height - height * scale)) / (height * scale);\n // A letterbox is the element's CSS background, not a stretched image edge.\n if (u < 0 || u > 1 || v < 0 || v > 1) return undefined;\n }\n // Interpolate between texel centers. Nearest-neighbor taps on the shared\n // downsample jumped between whole color blocks as an image scrolled.\n const px = Math.max(0, Math.min(data.width - 1, u * data.width - 0.5));\n const py = Math.max(0, Math.min(data.height - 1, v * data.height - 0.5));\n const left = Math.floor(px),\n top = Math.floor(py);\n const right = Math.min(data.width - 1, left + 1),\n bottom = Math.min(data.height - 1, top + 1);\n const taps = [\n [left, top, (1 - (px - left)) * (1 - (py - top))],\n [right, top, (px - left) * (1 - (py - top))],\n [left, bottom, (1 - (px - left)) * (py - top)],\n [right, bottom, (px - left) * (py - top)]\n ];\n const channels = [0, 0, 0];\n let alpha = 0;\n for (const [x, y, weight] of taps) {\n const offset = (y * data.width + x) * 4;\n const coverage = (data.data[offset + 3] / 255) * weight;\n alpha += coverage;\n for (let channel = 0; channel < 3; channel++) channels[channel] += data.data[offset + channel] * coverage;\n }\n if (alpha < 0.08) return undefined;\n return `rgb(${channels.map((channel) => Math.round(channel / alpha)).join(' ')} / ${alpha.toFixed(2)})`;\n }\n\n private gradientColorAt(image: string, bounds: DOMRect, x: number, y: number): string | undefined {\n if (!image.includes('gradient(')) return undefined;\n const matches = image.match(\n /#[\\da-f]{3,8}\\b|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\\([^)]*\\)|\\b(?:transparent|black|white|red|green|blue|orange|yellow|purple|gray|grey|teal|cyan|magenta)\\b/gi\n );\n const colors = (matches ?? []).filter((color) => !this.isTransparent(color));\n if (!colors.length) return undefined;\n\n let amount = 0.5;\n if (image.includes('linear-gradient(')) {\n const prelude =\n image\n .match(/linear-gradient\\(\\s*([^,]+)/i)?.[1]\n ?.trim()\n .toLowerCase() ?? '';\n let dx = 0,\n dy = 1;\n const angle = prelude.match(/^(-?[\\d.]+)deg$/);\n if (angle) {\n const radians = (Number(angle[1]) * Math.PI) / 180;\n dx = Math.sin(radians);\n dy = -Math.cos(radians);\n } else if (prelude.startsWith('to ')) {\n dx = prelude.includes('right') ? 1 : prelude.includes('left') ? -1 : 0;\n dy = prelude.includes('bottom') ? 1 : prelude.includes('top') ? -1 : 0;\n }\n const range = Math.max(0.01, Math.abs(dx) + Math.abs(dy));\n const u = (x - bounds.left) / Math.max(1, bounds.width) - 0.5;\n const v = (y - bounds.top) / Math.max(1, bounds.height) - 0.5;\n amount = Math.max(0, Math.min(1, 0.5 + (u * dx + v * dy) / range));\n } else {\n const u = (x - (bounds.left + bounds.width / 2)) / Math.max(1, bounds.width / 2);\n const v = (y - (bounds.top + bounds.height / 2)) / Math.max(1, bounds.height / 2);\n amount = Math.max(0, Math.min(1, Math.hypot(u, v) / Math.SQRT2));\n }\n const position = amount * (colors.length - 1);\n const index = Math.min(colors.length - 1, Math.floor(position));\n if (index === colors.length - 1 || position === index) return colors[index];\n return `color-mix(in srgb, ${colors[index]} ${((1 - (position - index)) * 100).toFixed(2)}%, ${colors[index + 1]})`;\n }\n\n private isTransparent(color: string): boolean {\n const value = color.trim().toLowerCase();\n if (!value || value === 'transparent') return true;\n const alpha = value.match(/\\/\\s*([\\d.]+)%?\\s*\\)$/) ?? (/^rgba\\(|^hsla\\(/.test(value) ? value.match(/,\\s*([\\d.]+)\\s*\\)$/) : null);\n return !!alpha && Number(alpha[1]) <= 0.02;\n }\n\n private isInside(element: Element, ancestor: Element): boolean {\n let current: Element | null = element;\n while (current) {\n if (current === ancestor) return true;\n const root = current.getRootNode() as ShadowRoot;\n current = current.parentElement ?? root.host ?? null;\n }\n return false;\n }\n\n private layerElement(element: Element, visibility: ReturnType<typeof lightingVisibility>): HTMLElement {\n let current: Element | null = element;\n while (current && current.namespaceURI !== 'http://www.w3.org/1999/xhtml') {\n const root = current.getRootNode() as ShadowRoot;\n current = current.parentElement ?? root.host ?? null;\n }\n return current ? visibility.layer(current as HTMLElement) : this.doc.documentElement;\n }\n\n private zIndex(element: HTMLElement, visibility: ReturnType<typeof lightingVisibility>): number {\n const value = Number.parseFloat(visibility.style(element).zIndex);\n return Number.isFinite(value) ? value : 0;\n }\n\n private isAmbientForeground(\n source: Element,\n receiver: HTMLElement,\n stack: Element[],\n receiverIndex: number,\n visibility: ReturnType<typeof lightingVisibility>\n ): boolean {\n const sourceIndex = stack.indexOf(source);\n if (sourceIndex >= 0 && receiverIndex >= 0) return sourceIndex < receiverIndex;\n const sourceLayer = this.layerElement(source, visibility);\n const receiverLayer = visibility.layer(receiver);\n const depth = this.zIndex(sourceLayer, visibility) - this.zIndex(receiverLayer, visibility);\n if (depth !== 0) return depth > 0;\n return !!(source.compareDocumentPosition(receiver) & 2);\n }\n\n private rasterOrder(element: Element, stack: Element[], receiver: HTMLElement, visibility: ReturnType<typeof lightingVisibility>): number {\n const index = stack.indexOf(element);\n if (index >= 0) return 10000 - index;\n return this.zIndex(this.layerElement(element, visibility), visibility) - this.zIndex(visibility.layer(receiver), visibility);\n }\n\n private rectFor(element: Element, rects: Map<Element, DOMRect>): DOMRect {\n let rect = rects.get(element);\n if (!rect) {\n rect = element.getBoundingClientRect();\n rects.set(element, rect);\n }\n return rect;\n }\n}\n","import { AmbientSampler } from './ambient';\nimport { configurationEvent } from './configuration';\nimport { finiteClamp } from './dom';\nimport { subscribeFrame } from './scheduler';\nimport { lightBoundarySelector, lightingOrigin, lightingVisibility } from './visibility';\nimport type { GlassLight, GlassReflector, GlassScene, GlassSceneOptions } from './types';\n\nexport interface LightContribution {\n key: string;\n x: number;\n y: number;\n color: string;\n strength: number;\n edgeStrength: number;\n ambient?: boolean;\n spread?: number;\n}\nexport interface Lighting {\n /** First paint and viewport re-entry already have a current sample and must not fade in. */\n immediate?: boolean;\n x: number;\n y: number;\n strength: number;\n color: string;\n rim: string;\n contributions: LightContribution[];\n reflection: string;\n reflectionStrength: number;\n reflectionX: number;\n reflectionY: number;\n}\ninterface SurfaceHooks {\n hitTarget?: HTMLElement;\n light(value: Lighting): void;\n interactive(): boolean;\n emission?(): string | undefined;\n focusEmission?(): string | undefined;\n emit?(active: boolean, color?: string): void;\n press(): void;\n release(): void;\n sync(): void;\n}\ninterface Entry {\n id: number;\n element: HTMLElement;\n hooks: SurfaceHooks;\n visible: boolean;\n bounds?: DOMRect;\n lastLighting?: Lighting;\n resuming?: boolean;\n painted?: boolean;\n}\ninterface SceneEntry {\n id: number;\n root: HTMLElement;\n options: GlassSceneOptions;\n}\nexport interface PointLight {\n key: string;\n bounds?: DOMRect;\n source?: HTMLElement;\n ambient?: boolean;\n spread?: number;\n excludeSource?: boolean;\n excludeElement?: HTMLElement;\n x: number;\n y: number;\n z: number;\n color: string;\n intensity: number;\n radius: number;\n}\ninterface Reflection {\n source: HTMLElement;\n x: number;\n y: number;\n depth: number;\n color: string;\n intensity: number;\n radius: number;\n}\nconst runtimes = new WeakMap<Document, SceneRuntime>();\nconst activeStateSelector =\n ':checked, [aria-checked=\"true\"], [aria-pressed=\"true\"], [aria-selected=\"true\"], [aria-expanded=\"true\"], [aria-current]:not([aria-current=\"false\"]):not([aria-current=\"\"])';\nconst disabledSelector = ':disabled, [aria-disabled=\"true\"], .is-disabled, [inert]';\n\nfunction runtimeFor(doc: Document): SceneRuntime {\n let runtime = runtimes.get(doc);\n if (!runtime) {\n runtime = new SceneRuntime(doc);\n runtimes.set(doc, runtime);\n }\n return runtime;\n}\n\n/** One delegated pointer stream and visibility observer per document, never per control. */\nexport function registerSurface(element: HTMLElement, hooks: SurfaceHooks): () => void {\n return runtimeFor(element.ownerDocument).register(element, hooks);\n}\n\n/** Receive scene lighting for a native pseudo-element without inserting decoration into its host. */\nexport function observeGlassLighting(element: HTMLElement, light: (value: Lighting) => void, hitTarget: HTMLElement = element): () => void {\n return registerSurface(element, { light, hitTarget, interactive: () => false, press() {}, release() {}, sync() {} });\n}\n\n/** Invalidate a receiver after an application changes its geometry. */\nexport function refreshGlassLighting(element: HTMLElement): void {\n runtimeFor(element.ownerDocument).refreshElement(element);\n}\n\n/** Light fields are explicit; surfaces also sample nearby visual sources for ambient edge color. */\nexport function mountGlassScene(root: HTMLElement, options: GlassSceneOptions = {}): GlassScene {\n return runtimeFor(root.ownerDocument).scene(root, options);\n}\n\nclass SceneRuntime {\n private entries = new Map<HTMLElement, Entry>();\n private scenes = new Set<SceneEntry>();\n private observer?: IntersectionObserver;\n private stateObserver?: MutationObserver;\n private selected = new Set<Entry>();\n private pressed?: Entry;\n private hovered?: Entry;\n private focused?: Entry;\n private focusedTarget?: Element;\n private emitting = new Map<Entry, string>();\n private nextId = 0;\n private lightIds = new WeakMap<HTMLElement, number>();\n private queue = new Set<Entry>();\n private stopFrame?: () => void;\n private connected = false;\n private motion: MediaQueryList;\n private transparency: MediaQueryList;\n private view: Window;\n private ambient: AmbientSampler;\n private renderedStyles = new WeakMap<HTMLElement, string | null>();\n private assetLoad = (event: Event) => {\n const target = event.target as Element | null;\n if (target && /^(IMG|VIDEO)$/.test(target.tagName)) this.ambient.assetChanged(target);\n };\n\n private visibilityChange = () => {\n if (!this.doc.hidden) this.refresh();\n this.ambient.resume();\n };\n\n private down = (event: PointerEvent) => {\n this.pressed = this.find(event);\n this.pressed?.hooks.press();\n this.updateEmitter();\n };\n\n private up = () => {\n this.pressed?.hooks.release();\n this.pressed = undefined;\n this.updateEmitter();\n };\n\n private leave = () => {\n this.up();\n this.hovered = undefined;\n this.updateEmitter();\n };\n\n private blur = () => {\n this.up();\n this.hovered = this.focused = undefined;\n this.focusedTarget = undefined;\n this.updateEmitter();\n };\n\n private over = (event: Event) => {\n const found = this.find(event);\n const next = found?.hooks.emission?.() ? found : undefined;\n if (next !== this.hovered) {\n this.hovered = next;\n this.updateEmitter();\n }\n };\n\n private out = (event: PointerEvent) => {\n const target = this.hovered?.element.closest('label') ?? this.hovered?.element;\n if (target && !target.contains(event.relatedTarget as Node | null)) {\n this.hovered = undefined;\n this.updateEmitter();\n }\n };\n\n private focus = (event: Event) => {\n const target = event.target as Element;\n const visual = target.matches('input[type=\"checkbox\"], input[type=\"radio\"]')\n ? target.closest('label')?.querySelector<HTMLElement>('[data-bx-surface]')\n : undefined;\n this.focused = visual ? this.entries.get(visual) : this.find(event);\n this.focusedTarget = target;\n this.updateEmitter();\n };\n\n private unfocus = () => {\n this.focused = undefined;\n this.focusedTarget = undefined;\n this.updateEmitter();\n };\n\n private change = () => {\n for (const entry of this.entries.values()) this.updateSelected(entry);\n this.updateEmitter();\n };\n\n private sync = () => {\n for (const entry of this.entries.values()) {\n entry.hooks.sync();\n this.updateSelected(entry);\n }\n this.updateEmitter();\n this.refresh();\n };\n\n private refresh = () => {\n this.refreshEntries([...this.entries.values()]);\n };\n\n private scroll = (event: Event) => {\n const root = event.target as HTMLElement | null;\n if (root?.nodeType !== 1) {\n this.refresh();\n return;\n }\n const area = root.getBoundingClientRect();\n const nearby: Entry[] = [];\n this.refreshEntries(\n [...this.entries.values()].filter((entry) => {\n if (!entry.visible) return false;\n if (root.contains(entry.element)) return true;\n const bounds = (entry.bounds ??= entry.element.getBoundingClientRect());\n // Prioritize controls over the scrolling pixels. Nearby surfaces still\n // refresh, but must not crowd those controls out of every sample batch.\n if (bounds.right > area.left && bounds.left < area.right && bounds.bottom > area.top && bounds.top < area.bottom) return true;\n if (bounds.right >= area.left - 160 && bounds.left <= area.right + 160 && bounds.bottom >= area.top - 160 && bounds.top <= area.bottom + 160)\n nearby.push(entry);\n return false;\n })\n );\n this.ambient.invalidate(nearby);\n };\n\n constructor(private doc: Document) {\n const view = doc.defaultView;\n if (!view) throw new Error('Glass scenes require a browser document.');\n this.view = view;\n this.ambient = new AmbientSampler(\n doc,\n view,\n (entry) => {\n if (this.entries.get(entry.element) !== entry) return;\n this.queue.add(entry as Entry);\n this.schedule();\n },\n (root) => this.observeState(root)\n );\n this.motion = view.matchMedia('(prefers-reduced-motion: reduce)');\n this.transparency = view.matchMedia('(prefers-reduced-transparency: reduce)');\n if (typeof view.IntersectionObserver === 'function')\n this.observer = new view.IntersectionObserver(\n (records) => {\n for (const record of records) {\n const entry = this.entries.get(record.target as HTMLElement);\n if (!entry) continue;\n if (record.isIntersecting && !entry.visible) entry.resuming = true;\n entry.visible = record.isIntersecting;\n this.ambient.invalidate(entry, true);\n if (entry.visible) {\n entry.bounds = undefined;\n this.queue.add(entry);\n }\n }\n this.schedule();\n },\n { rootMargin: '64px' }\n );\n // Watch semantic and visual source changes once per document. Lighting's\n // own decoration writes are excluded so sampling cannot trigger a loop.\n if (typeof view.MutationObserver === 'function')\n this.stateObserver = new view.MutationObserver((records) => {\n const changed = new Set<Entry>();\n let visualChanged = false;\n for (const record of records) {\n if (record.type === 'childList') {\n if (record.target.nodeType === 1 && this.isLightingDecoration(record.target)) continue;\n if ([...record.addedNodes, ...record.removedNodes].some((node) => !this.isLightingDecoration(node))) {\n visualChanged = true;\n this.ambient.sourcesChanged(record);\n }\n continue;\n }\n const target = record.target as HTMLElement;\n if (record.attributeName === 'style' && this.renderedStyles.get(target) === target.getAttribute('style')) continue;\n if (record.attributeName === 'class') {\n const entry = this.entries.get(target);\n if (entry) changed.add(entry);\n }\n if (\n record.attributeName === 'class' ||\n record.attributeName === 'style' ||\n record.attributeName === 'hidden' ||\n /^(role|data-bx-light-scope|data-bx-surface|data-bx-reduced-transparency|data-bx-reduced-motion|src|srcset|width|height)$/.test(\n record.attributeName ?? ''\n )\n ) {\n if (!this.isLightingDecoration(target)) {\n visualChanged = true;\n if (/^(src|srcset|width|height)$/.test(record.attributeName ?? '')) this.ambient.assetChanged(target);\n }\n continue;\n }\n const visual = target.matches('input[type=\"checkbox\"], input[type=\"radio\"]')\n ? target.closest('label')?.querySelector<HTMLElement>('[data-bx-surface]')\n : undefined;\n const entry = this.entries.get(target) ?? (visual ? this.entries.get(visual) : undefined);\n if (entry) changed.add(entry);\n if (record.attributeName === 'data-bx-field-invalid') {\n for (const surface of target.querySelectorAll<HTMLElement>('[data-bx-surface]')) {\n const child = this.entries.get(surface);\n if (child) changed.add(child);\n }\n }\n }\n if (visualChanged) {\n for (const entry of this.entries.values()) {\n entry.bounds = undefined;\n entry.lastLighting = undefined;\n }\n this.ambient.invalidate();\n }\n if (!changed.size && !visualChanged) return;\n for (const entry of changed) this.updateSelected(entry);\n this.updateEmitter();\n });\n }\n\n public register(element: HTMLElement, hooks: SurfaceHooks): () => void {\n this.connect();\n const entry: Entry = { id: this.nextId++, element, hooks, visible: true };\n const overlay = lightingVisibility(this.doc, this.view).boundary(element) !== this.doc.documentElement;\n this.entries.set(element, entry);\n this.ambient.add(entry);\n this.observer?.observe(element);\n this.updateSelected(entry);\n this.updateEmitter();\n this.queue.add(entry);\n this.schedule();\n // New overlays can cover receivers which already have highlights. Re-evaluate those as well.\n if (overlay) this.refresh();\n return () => {\n this.observer?.unobserve(element);\n this.entries.delete(element);\n this.ambient.remove(entry);\n this.queue.delete(entry);\n this.selected.delete(entry);\n if (this.pressed === entry) this.pressed = undefined;\n if (this.hovered === entry || this.focused === entry || this.emitting.has(entry)) {\n if (this.hovered === entry) this.hovered = undefined;\n if (this.focused === entry) this.focused = undefined;\n this.updateEmitter();\n }\n if (overlay) this.refresh();\n this.disconnectIfEmpty();\n };\n }\n\n public refreshElement(element: HTMLElement): void {\n const entry = this.entries.get(element);\n if (entry) this.updateSelected(entry);\n this.updateEmitter();\n if (entry) {\n this.ambient.invalidate(entry, true);\n entry.bounds = undefined;\n entry.lastLighting = undefined;\n this.queue.add(entry);\n this.schedule();\n }\n }\n\n public scene(root: HTMLElement, options: GlassSceneOptions): GlassScene {\n this.connect();\n const entry = { id: this.nextId++, root, options };\n this.scenes.add(entry);\n this.refreshRoot(root);\n let disposed = false;\n return {\n update: (next) => {\n if (!disposed) {\n entry.options = next;\n this.refreshRoot(root, next.reuseGeometry !== true);\n }\n },\n refresh: () => {\n if (!disposed) {\n this.ambient.invalidate();\n this.refreshRoot(root);\n }\n },\n destroy: () => {\n if (disposed) return;\n disposed = true;\n this.scenes.delete(entry);\n this.refreshRoot(root);\n this.disconnectIfEmpty();\n }\n };\n }\n\n private refreshEntries(entries: Entry[]): void {\n this.ambient.invalidate(entries, true);\n for (const entry of entries) {\n entry.bounds = undefined;\n if (entry.visible) this.queue.add(entry);\n }\n this.schedule();\n }\n\n private isLightingDecoration(node: Node): boolean {\n if (node.nodeType !== node.ELEMENT_NODE) return true;\n const element = node as Element;\n return element.matches('.bx-glass-decoration, .bx-glass-rim') || !!element.closest('.bx-glass-decoration, .bx-glass-rim');\n }\n\n private find(event: Event): Entry | undefined {\n for (const node of event.composedPath()) {\n const found = this.entries.get(node as HTMLElement);\n if (!found) continue;\n if (found.element.closest(disabledSelector)) return undefined;\n // A decorative surface inside a button/link is still part of that action.\n if (found.hooks.interactive()) return found;\n }\n const target = event.target as Element;\n const label = target.closest('label');\n const visual = label?.control?.matches('input[type=\"checkbox\"], input[type=\"radio\"]') ? label.querySelector<HTMLElement>('[data-bx-surface]') : undefined;\n const found = visual ? this.entries.get(visual) : undefined;\n if (found && !found.element.closest(disabledSelector) && !label?.control?.matches(disabledSelector) && found.hooks.interactive()) return found;\n return undefined;\n }\n\n private scope(element: HTMLElement): HTMLElement {\n return lightingOrigin(element).closest<HTMLElement>(`${lightBoundarySelector}, main, aside, nav`) ?? this.doc.body;\n }\n\n private updateEmitter(): void {\n const next = new Map<Entry, string>();\n const enabled = (entry: Entry) =>\n entry.hooks.interactive() && !entry.element.closest(disabledSelector) && !entry.element.closest('label')?.control?.matches(disabledSelector);\n for (const entry of [...this.selected, this.hovered, this.pressed]) {\n const color = entry && enabled(entry) ? entry.hooks.emission?.() : undefined;\n if (entry && color) next.set(entry, color);\n }\n const focusColor = this.focused?.hooks.focusEmission?.() ?? (this.focusedTarget?.matches(':focus-visible') ? this.focused?.hooks.emission?.() : undefined);\n if (this.focused && enabled(this.focused) && focusColor) next.set(this.focused, focusColor);\n const previous = this.emitting;\n if (previous.size === next.size && [...next].every(([entry, color]) => previous.get(entry) === color)) return;\n for (const entry of previous.keys()) if (!next.has(entry)) entry.hooks.emit?.(false);\n this.emitting = next;\n for (const [entry, color] of next) entry.hooks.emit?.(true, color);\n const sources = [...new Set([...previous.keys(), ...next.keys()])];\n for (const entry of this.entries.values()) {\n if (!entry.visible) continue;\n const affected = sources.some((source) => this.scope(source.element) === this.scope(entry.element));\n // A panel may have finished its opening animation since its surfaces were registered.\n if (affected) {\n entry.bounds = undefined;\n entry.lastLighting = undefined;\n this.queue.add(entry);\n }\n }\n this.schedule();\n }\n\n private updateSelected(entry: Entry): void {\n const control = entry.element.closest('label')?.control;\n const checked = control?.matches('input[type=\"checkbox\"]:checked, input[type=\"radio\"]:checked');\n if (entry.hooks.emission?.() && (entry.element.matches(activeStateSelector) || checked)) this.selected.add(entry);\n else this.selected.delete(entry);\n }\n\n private refreshRoot(root: HTMLElement, measure = true): void {\n for (const entry of this.entries.values()) {\n if (!root.contains(lightingOrigin(entry.element))) continue;\n if (measure) {\n entry.bounds = undefined;\n entry.lastLighting = undefined;\n }\n if (entry.visible) this.queue.add(entry);\n }\n this.schedule();\n }\n\n private observeState(root: Node): void {\n this.stateObserver?.observe(root, {\n subtree: true,\n attributes: true,\n childList: true,\n attributeFilter: [\n 'aria-pressed',\n 'aria-checked',\n 'checked',\n 'aria-selected',\n 'aria-expanded',\n 'aria-current',\n 'disabled',\n 'aria-disabled',\n 'aria-invalid',\n 'data-bx-field-invalid',\n 'class',\n 'style',\n 'hidden',\n 'role',\n 'data-bx-light-scope',\n 'data-bx-surface',\n 'data-bx-reduced-transparency',\n 'data-bx-reduced-motion',\n 'src',\n 'srcset',\n 'width',\n 'height'\n ]\n });\n }\n\n private connect(): void {\n if (this.connected) return;\n this.connected = true;\n this.observeState(this.doc.documentElement);\n this.doc.addEventListener('pointerdown', this.down, { passive: true });\n this.doc.addEventListener('pointerover', this.over, { passive: true });\n this.doc.addEventListener('pointerout', this.out, { passive: true });\n this.doc.addEventListener('focusin', this.focus);\n this.doc.addEventListener('focusout', this.unfocus);\n this.doc.addEventListener('change', this.change);\n this.view.addEventListener('pointerup', this.up, { passive: true });\n this.view.addEventListener('pointercancel', this.up, { passive: true });\n this.doc.addEventListener('pointerleave', this.leave, { passive: true });\n this.view.addEventListener('blur', this.blur);\n this.view.addEventListener('resize', this.refresh, { passive: true });\n this.doc.addEventListener('scroll', this.scroll, { passive: true, capture: true });\n this.doc.addEventListener('load', this.assetLoad, true);\n this.doc.addEventListener('loadeddata', this.assetLoad, true);\n this.doc.addEventListener('play', this.assetLoad, true);\n this.doc.addEventListener('pause', this.assetLoad, true);\n this.doc.addEventListener('seeked', this.assetLoad, true);\n this.doc.addEventListener('visibilitychange', this.visibilityChange);\n this.doc.addEventListener(configurationEvent, this.sync);\n this.motion.addEventListener('change', this.sync);\n this.transparency.addEventListener('change', this.sync);\n }\n\n private disconnectIfEmpty(): void {\n if (this.entries.size || this.scenes.size) return;\n this.ambient.destroy();\n this.stopFrame?.();\n this.stopFrame = undefined;\n this.queue.clear();\n this.observer?.disconnect();\n this.connected = false;\n this.stateObserver?.disconnect();\n this.selected.clear();\n this.doc.removeEventListener('pointerdown', this.down);\n this.doc.removeEventListener('pointerover', this.over);\n this.doc.removeEventListener('pointerout', this.out);\n this.doc.removeEventListener('focusin', this.focus);\n this.doc.removeEventListener('focusout', this.unfocus);\n this.doc.removeEventListener('change', this.change);\n this.view.removeEventListener('pointerup', this.up);\n this.view.removeEventListener('pointercancel', this.up);\n this.doc.removeEventListener('pointerleave', this.leave);\n this.view.removeEventListener('blur', this.blur);\n this.view.removeEventListener('resize', this.refresh);\n this.doc.removeEventListener('scroll', this.scroll, true);\n this.doc.removeEventListener('load', this.assetLoad, true);\n this.doc.removeEventListener('loadeddata', this.assetLoad, true);\n this.doc.removeEventListener('play', this.assetLoad, true);\n this.doc.removeEventListener('pause', this.assetLoad, true);\n this.doc.removeEventListener('seeked', this.assetLoad, true);\n this.doc.removeEventListener('visibilitychange', this.visibilityChange);\n this.doc.removeEventListener(configurationEvent, this.sync);\n this.motion.removeEventListener('change', this.sync);\n this.transparency.removeEventListener('change', this.sync);\n }\n\n private schedule(): void {\n if (this.stopFrame || !this.queue.size) return;\n this.stopFrame = subscribeFrame(() => {\n // Bound lighting work when hundreds of components become visible or a global setting changes.\n const batch = Array.from(this.queue).slice(0, 24);\n const visibility = lightingVisibility(this.doc, this.view);\n const emissions = [...this.emitting].map(([emitter, color]) => {\n const bounds = emitter.element.getBoundingClientRect();\n const exposed =\n visibility.exposed(emitter.element, bounds.x + bounds.width / 2, bounds.y + bounds.height / 2, bounds) && !emitter.element.closest(disabledSelector);\n return { emitter, color, exposed };\n });\n const activeLights = emissions\n .filter((source) => source.exposed)\n .map(({ emitter, color }) => ({\n emitter,\n light: this.lightPoint({ element: emitter.element, color, excludeSource: true, z: 24, intensity: 0.85, radius: 120 }, `hover:${emitter.id}`, true)\n }));\n const sceneData = new Map<SceneEntry, { lights: PointLight[]; reflections: Reflection[] }>();\n // Read only scenes used by this batch; avoid measuring offscreen or unrelated objects.\n const projections = batch\n .filter((entry) => {\n if (!entry.visible || !entry.element.isConnected || (entry.resuming && this.ambient.isPending(entry))) return false;\n const bounds = (entry.bounds ??= entry.element.getBoundingClientRect());\n const visible = bounds.bottom > 0 && bounds.right > 0 && bounds.top < this.view.innerHeight && bounds.left < this.view.innerWidth;\n if (!visible) entry.resuming = true;\n return visible;\n })\n .map((entry) => {\n entry.bounds ??= entry.element.getBoundingClientRect();\n const origin = lightingOrigin(entry.element) as HTMLElement;\n let nearest: SceneEntry | undefined;\n for (const candidate of this.scenes) if (candidate.root.contains(origin) && (!nearest || nearest.root.contains(candidate.root))) nearest = candidate;\n if (nearest && !sceneData.has(nearest)) {\n const scene = nearest;\n sceneData.set(scene, {\n lights: (scene.options.lights ?? []).slice(0, 4).map((light, index) => this.lightPoint(light, `${scene.id}:${index}`)),\n reflections: (scene.options.reflectors ?? []).slice(0, 4).map((reflection) => this.reflectionPoint(reflection))\n });\n }\n const data = nearest ? sceneData.get(nearest) : undefined;\n const sceneRoot = nearest?.root ?? entry.element;\n // Explicit scene lights and an active semantic element share the same spatial model.\n const boundary = visibility.boundary(entry.element);\n const lights = (data?.lights ?? []).filter((light) => visibility.boundary(light.source ?? sceneRoot) === boundary);\n for (const { emitter, light } of activeLights) {\n if (\n this.scope(emitter.element) === this.scope(entry.element) &&\n visibility.layer(lightingOrigin(emitter.element) as HTMLElement) === visibility.layer(origin) &&\n !emitter.element.contains(entry.element) &&\n (!entry.element.contains(emitter.element) || entry.element.matches('[role=\"menu\"], [role=\"tablist\"]'))\n )\n lights.push(light);\n }\n lights.push(...this.ambient.lights(entry));\n const reflections = (data?.reflections ?? []).filter((reflection) => visibility.boundary(reflection.source) === boundary);\n const lighting = this.project(entry, lights, reflections, visibility);\n lighting.immediate = entry.resuming || !entry.painted;\n entry.resuming = false;\n return [entry, lighting] as const;\n });\n for (const entry of batch) this.queue.delete(entry);\n for (const { emitter, color, exposed } of emissions) emitter.hooks.emit?.(exposed, color);\n for (const [entry, lighting] of projections) {\n if (this.sameLighting(entry.lastLighting, lighting)) continue;\n entry.lastLighting = lighting;\n entry.painted = true;\n const before = entry.element.getAttribute('style');\n entry.hooks.light(lighting);\n const after = entry.element.getAttribute('style');\n // Native receivers (e.g. the slider thumb) paint on their host, not a decoration child.\n if (before !== after) this.renderedStyles.set(entry.element, after);\n }\n if (!this.queue.size) this.stopFrame = undefined;\n return this.queue.size > 0;\n });\n }\n\n private sameLighting(previous: Lighting | undefined, next: Lighting): boolean {\n if (\n !previous ||\n previous.x !== next.x ||\n previous.y !== next.y ||\n previous.color !== next.color ||\n previous.strength !== next.strength ||\n previous.rim !== next.rim ||\n previous.reflection !== next.reflection ||\n previous.reflectionStrength !== next.reflectionStrength ||\n previous.reflectionX !== next.reflectionX ||\n previous.reflectionY !== next.reflectionY ||\n previous.contributions.length !== next.contributions.length\n )\n return false;\n return previous.contributions.every((light, index) => {\n const other = next.contributions[index];\n return (\n light.key === other.key &&\n light.x === other.x &&\n light.y === other.y &&\n light.color === other.color &&\n light.strength === other.strength &&\n light.edgeStrength === other.edgeStrength &&\n light.ambient === other.ambient &&\n light.spread === other.spread\n );\n });\n }\n\n private lightPoint(light: GlassLight, key: string, border = false): PointLight {\n const rect = light.element?.getBoundingClientRect();\n if (light.element && !border) {\n if (!this.lightIds.has(light.element)) this.lightIds.set(light.element, this.nextId++);\n key = `scene:${this.lightIds.get(light.element)}`;\n }\n return {\n key,\n bounds: rect && light.edge === 'bottom' ? new DOMRect(rect.left, rect.bottom, rect.width, 0) : border ? rect : undefined,\n source: light.element,\n excludeSource: light.excludeSource,\n excludeElement: light.excludeElement,\n x: rect ? rect.left + rect.width * finiteClamp(light.offsetX, 0, 1, 0.5) : finiteClamp(light.x, -1e6, 1e6, this.view.innerWidth * 0.25),\n y: rect ? rect.top + rect.height * finiteClamp(light.offsetY, 0, 1, 0.5) : finiteClamp(light.y, -1e6, 1e6, 0),\n z: finiteClamp(light.z, 1, 4000, 180),\n color: light.color ?? 'var(--bx-text-inverse, Canvas)',\n intensity: finiteClamp(light.intensity, 0, 4, 1),\n radius: finiteClamp(light.radius, 1, 4000, 640)\n };\n }\n\n private reflectionPoint(reflector: GlassReflector): Reflection {\n const rect = reflector.element.getBoundingClientRect();\n return {\n source: reflector.element,\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n depth: finiteClamp(reflector.depth, -2000, 2000, 80),\n color: reflector.color ?? this.view.getComputedStyle(reflector.element).backgroundColor,\n intensity: finiteClamp(reflector.intensity, 0, 1, 0.28),\n radius: Math.max(rect.width, rect.height, 160)\n };\n }\n\n private project(entry: Entry, lights: PointLight[], reflectors: Reflection[], visibility: ReturnType<typeof lightingVisibility>): Lighting {\n const b = (entry.bounds ??= entry.element.getBoundingClientRect());\n const cx = b.left + b.width / 2,\n cy = b.top + b.height / 2;\n let x = 25,\n y = 0,\n strength = 0.04,\n color = 'white';\n let strongest = 0,\n weightedX = 0,\n weightedY = 0,\n totalWeight = 0;\n const rims: string[] = [];\n const contributions: LightContribution[] = [];\n for (const light of lights) {\n if ((light.excludeSource && light.source === entry.element) || light.excludeElement === entry.element) continue;\n // Semantic borders emit from their closest edge, so large buttons still have a short reach.\n const lx = light.bounds ? Math.max(light.bounds.left, Math.min(cx, light.bounds.right)) : light.x;\n const ly = light.bounds ? Math.max(light.bounds.top, Math.min(cy, light.bounds.bottom)) : light.y;\n const dx = lx - cx,\n dy = ly - cy;\n const distance = Math.hypot(dx, dy, light.z);\n const weight = light.intensity * Math.pow(Math.max(0, 1 - distance / light.radius), 2) * (light.z / distance);\n // Project actual viewport coordinates into this surface, without a perspective speed-up.\n const localX = Math.max(0, Math.min(100, ((lx - b.left) / Math.max(1, b.width)) * 100));\n const localY = Math.max(0, Math.min(100, ((ly - b.top) / Math.max(1, b.height)) * 100));\n const edgeDistance = Math.hypot(Math.max(b.left - lx, 0, lx - b.right), Math.max(b.top - ly, 0, ly - b.bottom), light.z);\n const edgeWeight = Math.min(0.85, light.intensity * Math.pow(Math.max(0, 1 - edgeDistance / light.radius), 2));\n if (edgeWeight <= 0.01 && weight <= 0.001) continue;\n if (!light.ambient && !visibility.exposed(entry.hooks.hitTarget ?? entry.element, lx, ly, b)) continue;\n if (!light.ambient && light.source) {\n const source = light.source.closest<HTMLElement>('[data-bx-surface]') ?? light.source;\n if (!visibility.exposed(source, lx, ly, source.getBoundingClientRect())) continue;\n }\n if (edgeWeight > 0.01)\n rims.push(\n `radial-gradient(${light.spread ? `circle ${light.spread}px` : 'ellipse farthest-side'} at ${localX.toFixed(2)}% ${localY.toFixed(2)}%, color-mix(in srgb, ${light.color} ${(edgeWeight * 100).toFixed(2)}%, transparent), transparent 75%)`\n );\n if (edgeWeight > 0.01 || weight > 0.001)\n contributions.push({\n key: light.key,\n x: localX,\n y: localY,\n color: light.color,\n strength: light.ambient ? 0 : Math.min(0.25, weight * 0.4),\n edgeStrength: edgeWeight,\n ambient: light.ambient,\n spread: light.spread\n });\n if (!light.ambient) {\n weightedX += localX * weight;\n weightedY += localY * weight;\n totalWeight += weight;\n if (weight > strongest) {\n strongest = weight;\n color = light.color;\n }\n }\n }\n if (totalWeight > 0.001) {\n x = weightedX / totalWeight;\n y = weightedY / totalWeight;\n strength = Math.min(0.4, 0.04 + totalWeight * 0.4);\n }\n let reflectionStrength = 0,\n reflection = 'transparent',\n reflectionX = 50,\n reflectionY = 50;\n for (const reflector of reflectors) {\n if (!visibility.exposed(entry.hooks.hitTarget ?? entry.element, reflector.x, reflector.y, b)) continue;\n const distance = Math.hypot(reflector.x - cx, reflector.y - cy, reflector.depth);\n const weight = reflector.intensity * Math.max(0, 1 - distance / (reflector.radius * 2));\n if (weight > reflectionStrength) {\n reflectionStrength = weight;\n reflection = reflector.color;\n // Signed depth gives background and foreground proxies opposite parallax around the surface normal.\n const direction = reflector.depth < 0 ? 1 : -1;\n const perspective = Math.max(80, Math.abs(reflector.depth) + reflector.radius * 0.5);\n reflectionX = Math.max(0, Math.min(100, 50 + ((reflector.x - cx) / perspective) * 45 * direction));\n reflectionY = Math.max(0, Math.min(100, 50 + ((reflector.y - cy) / perspective) * 45 * direction));\n }\n }\n return { x, y, strength, color, rim: rims.join(', ') || 'none', contributions, reflection, reflectionStrength, reflectionX, reflectionY };\n }\n}\n","/** A scalar spring whose target can change without resetting its velocity. */\nexport interface SpringOptions {\n stiffness?: number;\n damping?: number;\n mass?: number;\n}\n\nexport class Spring {\n private readonly stiffness: number;\n private readonly damping: number;\n private readonly mass: number;\n public value: number;\n\n public velocity = 0;\n\n public target: number;\n\n constructor(value = 0, options: SpringOptions = {}) {\n if (!Number.isFinite(value)) throw new RangeError('Spring value must be finite.');\n this.value = this.target = value;\n this.stiffness = options.stiffness ?? 380;\n this.damping = options.damping ?? 32;\n this.mass = options.mass ?? 1;\n if (\n !Number.isFinite(this.stiffness) ||\n this.stiffness <= 0 ||\n !Number.isFinite(this.damping) ||\n this.damping < 0 ||\n !Number.isFinite(this.mass) ||\n this.mass <= 0\n ) {\n throw new RangeError('Spring stiffness and mass must be positive; damping must be nonnegative.');\n }\n }\n\n /** Advances the exact damped harmonic solution. Returns true while moving. */\n public step(deltaSeconds: number): boolean {\n if (!Number.isFinite(this.target)) throw new RangeError('Spring target must be finite.');\n if (!Number.isFinite(deltaSeconds) || deltaSeconds < 0) {\n throw new RangeError('Spring delta must be finite and nonnegative.');\n }\n const displacement = this.value - this.target;\n if (Math.abs(displacement) < 0.001 && Math.abs(this.velocity) < 0.001) {\n this.snap(this.target);\n return false;\n }\n if (deltaSeconds === 0) return true;\n\n const decay = this.damping / (2 * this.mass);\n const frequencySquared = this.stiffness / this.mass;\n const discriminant = decay * decay - frequencySquared;\n const velocity = this.velocity;\n const time = deltaSeconds;\n let nextDisplacement: number;\n let nextVelocity: number;\n\n if (Math.abs(discriminant) < 0.000001 * frequencySquared) {\n const coefficient = velocity + decay * displacement;\n const exponential = Math.exp(-decay * time);\n nextDisplacement = exponential * (displacement + coefficient * time);\n nextVelocity = exponential * (velocity - decay * coefficient * time);\n } else if (discriminant < 0) {\n const frequency = Math.sqrt(-discriminant);\n const coefficient = (velocity + decay * displacement) / frequency;\n const exponential = Math.exp(-decay * time);\n const cosine = Math.cos(frequency * time);\n const sine = Math.sin(frequency * time);\n nextDisplacement = exponential * (displacement * cosine + coefficient * sine);\n nextVelocity = exponential * ((coefficient * frequency - decay * displacement) * cosine - (displacement * frequency + decay * coefficient) * sine);\n } else {\n const root = Math.sqrt(discriminant);\n const firstRoot = -decay + root;\n const secondRoot = -decay - root;\n const first = (velocity - secondRoot * displacement) / (firstRoot - secondRoot);\n const second = displacement - first;\n const firstTerm = first * Math.exp(firstRoot * time);\n const secondTerm = second * Math.exp(secondRoot * time);\n nextDisplacement = firstTerm + secondTerm;\n nextVelocity = firstRoot * firstTerm + secondRoot * secondTerm;\n }\n this.value = this.target + nextDisplacement;\n this.velocity = nextVelocity;\n if (Math.abs(nextDisplacement) < 0.001 && Math.abs(nextVelocity) < 0.001) {\n this.snap(this.target);\n return false;\n }\n return true;\n }\n\n public snap(value: number): void {\n if (!Number.isFinite(value)) throw new RangeError('Spring value must be finite.');\n this.value = this.target = value;\n this.velocity = 0;\n }\n}\n","import { rememberAttributes, rememberStyles, finiteClamp } from './dom';\nimport { inheritedAttribute } from './configuration';\nimport { registerSurface, refreshGlassLighting } from './scene';\nimport type { Lighting, LightContribution } from './scene';\nimport { subscribeFrame } from './scheduler';\nimport { Spring } from './spring';\nimport type { GlassSurface, SurfaceOptions } from './types';\n\nconst mounted = new WeakMap<HTMLElement, GlassSurface>();\n\n/** Structural surfaces receive light; controls and actionable surfaces also emit it. */\nfunction isActionSurface(element: HTMLElement): boolean {\n if (\n element.matches(\n 'button, bx-button, [bx-button], a[href], summary, input:not([type=\"hidden\"]), select, textarea, [role=\"button\"], [role=\"link\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"switch\"], [role=\"tab\"], [role=\"menuitem\"], [role=\"combobox\"], [role=\"textbox\"], [role=\"searchbox\"], [role=\"slider\"], [role=\"spinbutton\"], [onclick]'\n ) ||\n typeof element.onclick === 'function'\n )\n return true;\n\n if (element.closest('label')?.control) return true;\n if (!element.closest('bx-form-field')) return false;\n const controls = element.querySelectorAll('input:not([type=\"hidden\"]), select, textarea');\n return controls.length === 1 && controls[0].closest('[data-bx-surface]') === element;\n}\n\n/** Enhance a native DOM element. Omitted options inherit configureAppearance() and Blocks theme tokens. */\nexport function mountSurface(element: HTMLElement, initial: SurfaceOptions = {}): GlassSurface {\n if (mounted.has(element)) throw new Error('A glass surface is already mounted on this element.');\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n if (!view) throw new Error('Glass surfaces must be mounted in a browser document.');\n const ownProperties = [\n 'position',\n '--bx-glassiness',\n '--bx-glass-lit-edge',\n '--bx-glass-lit-edge-top',\n '--bx-glass-lit-edge-right',\n '--bx-glass-lit-edge-bottom',\n '--bx-glass-lit-edge-left'\n ];\n const restoreStyles = rememberStyles(element, ownProperties);\n const attributes = ['data-bx-surface', 'data-bx-reduced-transparency', 'data-bx-reduced-motion', 'data-bx-glass-renderer'];\n const originalAttributes = new Map(attributes.map((name) => [name, element.getAttribute(name)]));\n const restoreAttributes = rememberAttributes(element, attributes);\n const originals = new Map(\n ownProperties.map((property) => [\n property,\n {\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property)\n }\n ])\n );\n\n const decoration = doc.createElement('span');\n decoration.className = 'bx-glass-decoration';\n decoration.setAttribute('aria-hidden', 'true');\n\n const light = doc.createElement('span');\n light.className = 'bx-glass-light';\n\n const rim = doc.createElement('span');\n rim.className = 'bx-glass-rim';\n rim.setAttribute('aria-hidden', 'true');\n element.append(rim);\n\n const environment = doc.createElement('span');\n environment.className = 'bx-glass-contribution bx-glass-environment';\n rim.append(environment);\n let environmentImage = 'none';\n const environmentLayers = new Map<number, string>();\n const environmentColors = new Map<number, string>();\n\n const ambient = doc.createElement('span');\n ambient.className = 'bx-glass-ambient';\n decoration.append(light);\n element.append(decoration);\n decoration.append(ambient);\n\n const motion = view.matchMedia('(prefers-reduced-motion: reduce)');\n const transparency = view.matchMedia('(prefers-reduced-transparency: reduce)');\n\n let options = { ...initial };\n let disposed = false;\n let unsubscribe: (() => void) | undefined;\n let reducedMotion = false;\n let unifiedLighting = false;\n\n const interactive = () => options.interactive ?? isActionSurface(element);\n let emitting = false;\n let emittingColor: string | undefined;\n\n type Layer = { edge: HTMLElement; glow: HTMLElement; animations: Animation[]; leaving: boolean };\n\n const layers = new Map<string, Layer>();\n\n const removeLayer = (key: string, layer: Layer) => {\n layer.animations.forEach((animation) => animation.cancel());\n layer.edge.remove();\n layer.glow.remove();\n layers.delete(key);\n };\n\n const fadeLayer = (key: string, layer: Layer, visible: boolean) => {\n const opacity = view.getComputedStyle(layer.edge).opacity;\n layer.animations.forEach((animation) => animation.cancel());\n layer.leaving = !visible;\n for (const node of [layer.edge, layer.glow]) node.style.opacity = visible ? '1' : '0';\n if (reducedMotion) {\n if (!visible) removeLayer(key, layer);\n return;\n }\n layer.animations = [layer.edge, layer.glow].map((node) => node.animate([{ opacity }, { opacity: visible ? 1 : 0 }], { duration: 200, easing: 'ease-out' }));\n void Promise.all(layer.animations.map((animation) => animation.finished))\n .then(() => {\n if (layer.leaving && layers.get(key) === layer) removeLayer(key, layer);\n })\n .catch(() => {\n /* Interrupted fades continue from their rendered opacity. */\n });\n };\n\n const setLayer = (value: LightContribution, source = false) => {\n let layer = layers.get(value.key);\n const fresh = !layer;\n if (!layer) {\n const edge = doc.createElement('span'),\n glow = doc.createElement('span');\n edge.className = glow.className = 'bx-glass-contribution';\n edge.dataset['bxLightSource'] = glow.dataset['bxLightSource'] = value.key;\n edge.style.opacity = glow.style.opacity = '0';\n rim.append(edge);\n ambient.append(glow);\n layer = { edge, glow, animations: [], leaving: false };\n layers.set(value.key, layer);\n }\n const at = `${value.x.toFixed(2)}% ${value.y.toFixed(2)}%`;\n\n const edgeColor = `color-mix(in srgb, ${value.color} ${(value.edgeStrength * 100).toFixed(2)}%, transparent)`;\n layer.edge.style.backgroundImage = source\n ? `linear-gradient(${edgeColor}, ${edgeColor})`\n : `radial-gradient(ellipse farthest-side at ${at}, ${edgeColor}, transparent 75%)`;\n layer.glow.style.backgroundImage = `radial-gradient(ellipse at ${at}, color-mix(in srgb, ${value.color} ${(value.strength * 100).toFixed(2)}%, transparent), transparent 68%)`;\n if (fresh || layer.leaving) fadeLayer(value.key, layer, true);\n if (layers.size > 8)\n for (const [key, old] of layers) {\n if (old.leaving) removeLayer(key, old);\n if (layers.size <= 8) break;\n }\n };\n\n const emissionColor = () =>\n options.emission ??\n options.focusEmission ??\n (element.closest('[data-bx-field-invalid=\"true\"]') || element.matches('[aria-invalid=\"true\"]') ? 'var(--bx-text-danger)' : 'var(--bx-primary)');\n\n const emit = (active: boolean, color = emissionColor()) => {\n emitting = active;\n emittingColor = color;\n if (active && color) setLayer({ key: 'emitter', color, x: 50, y: 50, strength: 0, edgeStrength: 0.8 }, true);\n else {\n const layer = layers.get('emitter');\n if (layer && !layer.leaving) fadeLayer('emitter', layer, false);\n }\n };\n\n const x = new Spring(25, { stiffness: 300, damping: 30 });\n const y = new Spring(0, { stiffness: 300, damping: 30 });\n const strength = new Spring(0.04, { stiffness: 300, damping: 30 });\n const pressure = new Spring(0, { stiffness: 440, damping: 25 });\n const globalValue = (name: string) => inheritedAttribute(element.parentElement ?? element, name);\n\n const paint = () => {\n decoration.style.setProperty('--bx-glass-light-x', `${x.value.toFixed(2)}%`);\n decoration.style.setProperty('--bx-glass-light-y', `${y.value.toFixed(2)}%`);\n decoration.style.setProperty('--bx-glass-light-strength', strength.value.toFixed(3));\n decoration.style.setProperty('--bx-glass-press', pressure.value.toFixed(4));\n };\n\n const animate = () => {\n if (disposed || unsubscribe) return;\n if (reducedMotion || typeof requestAnimationFrame !== 'function') {\n x.snap(x.target);\n y.snap(y.target);\n strength.snap(strength.target);\n pressure.snap(0);\n paint();\n return;\n }\n unsubscribe = subscribeFrame((dt) => {\n if (disposed) return false;\n const moving = [x.step(dt), y.step(dt), strength.step(dt), pressure.step(dt)].some(Boolean);\n paint();\n if (!moving) unsubscribe = undefined;\n return moving;\n });\n };\n\n const lighting = (value: Lighting) => {\n x.snap(value.x);\n y.snap(value.y);\n strength.target = value.strength;\n\n if (unifiedLighting) {\n const sources = [...value.contributions].sort((a, b) => a.edgeStrength - b.edgeStrength).slice(-4);\n // Sample the same localized falloff used by the rim, rather than tinting\n // the entire silhouette. Small attached shapes can share a facing edge.\n const edgeAt = (x: number, y: number) => {\n let edge = 'var(--bx-border-default, GrayText)';\n for (const source of sources) {\n const distance = Math.hypot((x - source.x) / Math.max(1, source.x, 100 - source.x), (y - source.y) / Math.max(1, source.y, 100 - source.y));\n const strength = finiteClamp(source.edgeStrength, 0, 0.85, 0) * 0.35 * Math.max(0, 1 - distance / 0.75);\n if (strength > 0.001) edge = `color-mix(in srgb, ${source.color} ${(strength * 100).toFixed(2)}%, ${edge})`;\n }\n return edge;\n };\n element.style.setProperty('--bx-glass-lit-edge', edgeAt(50, 50));\n element.style.setProperty('--bx-glass-lit-edge-top', edgeAt(50, 0));\n element.style.setProperty('--bx-glass-lit-edge-right', edgeAt(100, 50));\n element.style.setProperty('--bx-glass-lit-edge-bottom', edgeAt(50, 100));\n element.style.setProperty('--bx-glass-lit-edge-left', edgeAt(0, 50));\n }\n\n const activeEnvironment = new Set<number>();\n for (const contribution of value.contributions) {\n if (!contribution.ambient) continue;\n const slot = Number(contribution.key.split(':').pop());\n if (!Number.isInteger(slot) || slot < 0 || slot >= 16) continue;\n activeEnvironment.add(slot);\n const property = `--bx-glass-environment-color-${slot}`;\n const color = `color-mix(in srgb, ${contribution.color} ${(contribution.edgeStrength * 100).toFixed(2)}%, transparent)`;\n if (environmentColors.get(slot) !== color) {\n environment.style.setProperty(property, color);\n environmentColors.set(slot, color);\n }\n environmentLayers.set(\n slot,\n `radial-gradient(circle ${contribution.spread}px at ${contribution.x.toFixed(2)}% ${contribution.y.toFixed(2)}%, var(${property}), transparent 75%)`\n );\n }\n for (const slot of environmentColors.keys()) {\n if (!activeEnvironment.has(slot) && environmentColors.get(slot) !== 'transparent') {\n environment.style.setProperty(`--bx-glass-environment-color-${slot}`, 'transparent');\n environmentColors.set(slot, 'transparent');\n }\n }\n const ambientImage = [...environmentLayers.values()].join(', ') || 'none';\n\n if (ambientImage !== environmentImage) {\n environmentImage = ambientImage;\n environment.style.backgroundImage = ambientImage;\n }\n // Finish only environmental transitions when an already-lit element returns.\n // During motion, typed colors retarget continuously from their rendered value.\n if (value.immediate || reducedMotion) for (const animation of environment.getAnimations()) animation.finish();\n\n const contributions = value.contributions.filter((contribution) => !contribution.ambient);\n const active = new Set(contributions.map((contribution) => contribution.key));\n\n for (const contribution of contributions) setLayer(contribution);\n for (const [key, layer] of layers) if (key !== 'emitter' && !active.has(key) && !layer.leaving) fadeLayer(key, layer, false);\n decoration.style.setProperty('--bx-glass-light-color', value.color);\n decoration.style.setProperty('--bx-glass-reflection-color', value.reflection);\n decoration.style.setProperty('--bx-glass-reflection-strength', String(value.reflectionStrength));\n decoration.style.setProperty('--bx-glass-reflection-x', `${value.reflectionX.toFixed(2)}%`);\n decoration.style.setProperty('--bx-glass-reflection-y', `${value.reflectionY.toFixed(2)}%`);\n animate();\n };\n const sync = () => {\n element.setAttribute('data-bx-surface', 'glass');\n const inheritedMotion = globalValue('data-bx-reduced-motion') ?? originalAttributes.get('data-bx-reduced-motion');\n const inheritedTransparency = globalValue('data-bx-reduced-transparency') ?? originalAttributes.get('data-bx-reduced-transparency');\n reducedMotion = options.reducedMotion ?? (inheritedMotion === null || inheritedMotion === undefined ? motion.matches : inheritedMotion === 'true');\n const reducedTransparency = options.reducedTransparency ?? (inheritedTransparency === 'true' || transparency.matches);\n element.setAttribute('data-bx-reduced-transparency', String(reducedTransparency));\n element.setAttribute('data-bx-reduced-motion', String(reducedMotion));\n const quality = inheritedAttribute(element, 'data-bx-glass-quality') ?? 'auto';\n const supported =\n typeof CSS !== 'undefined' &&\n CSS.supports('background', 'color-mix(in srgb, white, black)') &&\n (CSS.supports('backdrop-filter', 'blur(1px)') || CSS.supports('-webkit-backdrop-filter', 'blur(1px)'));\n const connection = (view.navigator as Navigator & { connection?: { saveData?: boolean } }).connection;\n const economical =\n connection?.saveData ||\n (view.navigator.hardwareConcurrency > 0 && view.navigator.hardwareConcurrency <= 4) ||\n view.matchMedia('(pointer: coarse)').matches;\n const enhanced = quality !== 'baseline' && supported && (quality === 'enhanced' || !economical);\n element.setAttribute('data-bx-glass-renderer', enhanced ? 'enhanced' : 'baseline');\n if (options.glassiness !== undefined) element.style.setProperty('--bx-glassiness', String(finiteClamp(options.glassiness, 0, 1, 0.5)));\n else restoreProperty('--bx-glassiness');\n\n // Absolutely positioned children use the padding box. Extend only across the\n // host's real border so their inherited outer radius describes the same curve.\n // Borderless and one-sided surfaces must never grow beyond their border box.\n const style = view.getComputedStyle(element);\n unifiedLighting = style.getPropertyValue('--bx-glass-unified-lighting').trim() === '1';\n\n for (const side of ['top', 'right', 'bottom', 'left']) {\n const width = style.getPropertyValue(`border-${side}-width`);\n const inset = `${-parseFloat(width || '0')}px`;\n for (const layer of [decoration, rim]) {\n if (layer.style.getPropertyValue(side) !== inset) layer.style.setProperty(side, inset);\n }\n }\n if (reducedMotion || !interactive()) {\n unsubscribe?.();\n unsubscribe = undefined;\n x.snap(x.target);\n y.snap(y.target);\n strength.snap(strength.target);\n pressure.snap(0);\n paint();\n }\n if (reducedMotion)\n for (const [key, layer] of layers) {\n if (layer.leaving) removeLayer(key, layer);\n else layer.animations.forEach((animation) => animation.cancel());\n }\n if (emitting) emit(true, emittingColor);\n };\n function restoreProperty(property: string): void {\n const original = originals.get(property);\n if (original?.value) element.style.setProperty(property, original.value, original.priority);\n else element.style.removeProperty(property);\n }\n sync();\n // Apply the material before the first style read to avoid transitioning from legacy colors.\n if (view.getComputedStyle(element).position === 'static') element.style.position = 'relative';\n const unregister = registerSurface(element, {\n light: lighting,\n sync,\n interactive,\n emission: emissionColor,\n focusEmission: () => options.focusEmission ?? emissionColor(),\n emit,\n press() {\n if (interactive() && !reducedMotion) {\n pressure.target = 1;\n animate();\n }\n },\n release() {\n pressure.target = 0;\n animate();\n }\n });\n const controller: GlassSurface = {\n update(next) {\n if (!disposed) {\n options = { ...next };\n sync();\n refreshGlassLighting(element);\n }\n },\n destroy() {\n if (disposed) return;\n disposed = true;\n unsubscribe?.();\n unregister();\n decoration.remove();\n rim.remove();\n for (const [key, layer] of layers) removeLayer(key, layer);\n restoreStyles();\n restoreAttributes();\n mounted.delete(element);\n }\n };\n mounted.set(element, controller);\n return controller;\n}\n","import { rememberStyles } from './dom';\nimport { configurationEvent, inheritedAttribute } from './configuration';\nimport { subscribeFrame } from './scheduler';\nimport type { GlassTransition, GlassTransitionOptions, MotionResult } from './types';\n\n/** Fade a positioned overlay without changing the geometry of its content. */\nexport function createGlassTransition(origin: HTMLElement, target: HTMLElement, options: GlassTransitionOptions = {}): GlassTransition {\n const doc = target.ownerDocument;\n const view = doc.defaultView;\n if (!view) throw new Error('Glass transitions must be mounted in a browser document.');\n if (origin.ownerDocument !== doc) throw new Error('Glass transition endpoints must share a document.');\n const skin = target.matches('[data-bx-surface]') ? target : (target.querySelector<HTMLElement>('[data-bx-surface]') ?? target);\n const restoreVisibility = rememberStyles(target, ['visibility']);\n const opacity = Number(view.getComputedStyle(skin).opacity);\n const readOpacity = () => Number(view.getComputedStyle(skin).opacity);\n const preference = view.matchMedia('(prefers-reduced-motion: reduce)');\n let disposed = false;\n let active = false;\n let value = 0;\n let destination = 0;\n let animation: Animation | undefined;\n let unsubscribe: (() => void) | undefined;\n let resolvePending: ((result: MotionResult) => void) | undefined;\n const reduced = () => {\n const inherited = inheritedAttribute(origin, 'data-bx-reduced-motion');\n return options.reducedMotion ?? (inherited === null ? preference.matches : inherited === 'true');\n };\n function settle(): void {\n active = false;\n value = destination;\n unsubscribe?.();\n unsubscribe = undefined;\n animation?.cancel();\n animation = undefined;\n restoreVisibility();\n if (destination === 0) target.style.visibility = 'hidden';\n const resolve = resolvePending;\n resolvePending = undefined;\n resolve?.('finished');\n }\n function move(open: boolean): Promise<MotionResult> {\n if (disposed) return Promise.resolve('cancelled');\n // Read the interpolated value only when reversing an in-flight fade.\n const from = animation && opacity > 0 ? readOpacity() / opacity : value;\n resolvePending?.('cancelled');\n animation?.cancel();\n animation = undefined;\n unsubscribe?.();\n unsubscribe = undefined;\n destination = open ? 1 : 0;\n active = true;\n restoreVisibility();\n const finished = new Promise<MotionResult>((resolve) => {\n resolvePending = resolve;\n });\n if (reduced() || from === destination) settle();\n else {\n // Animate the surface itself to preserve backdrop-root behavior. Native\n // animation avoids style mutations that invalidate scene lighting each frame.\n const current = skin.animate([{ opacity: from * opacity }, { opacity: destination * opacity }], {\n duration: (open ? 180 : 140) * Math.abs(destination - from),\n easing: 'ease-in-out',\n fill: 'both'\n });\n animation = current;\n void current.finished\n .then(() => {\n if (animation === current && !disposed) settle();\n })\n .catch(() => {\n /* Reversing or destroying a fade cancels its animation. */\n });\n if (options.onUpdate)\n unsubscribe = subscribeFrame(() => {\n options.onUpdate?.();\n return active && !disposed;\n });\n }\n return finished;\n }\n const onPreference = () => {\n if (active && reduced()) settle();\n };\n preference.addEventListener('change', onPreference);\n doc.addEventListener(configurationEvent, onPreference);\n return {\n enter: () => move(true),\n exit: () => move(false),\n refresh() {},\n destroy() {\n if (disposed) return;\n disposed = true;\n active = false;\n unsubscribe?.();\n unsubscribe = undefined;\n resolvePending?.('cancelled');\n resolvePending = undefined;\n preference.removeEventListener('change', onPreference);\n doc.removeEventListener(configurationEvent, onPreference);\n animation?.cancel();\n animation = undefined;\n restoreVisibility();\n }\n };\n}\n\n/** @deprecated Use createGlassTransition. */\nexport const createLiquidTransition = createGlassTransition;\n"],"mappings":"AACA,SAAgB,eAAe,SAAsB,YAA6B;CAChF,MAAM,SAAS,WAAW,KAAK,cAAc;EAC3C;EACA,OAAO,QAAQ,MAAM,iBAAiB,QAAQ;EAC9C,UAAU,QAAQ,MAAM,oBAAoB,QAAQ;CACrD,EAAC;CACF,aAAY;EACV,KAAK,MAAM,QAAQ,QACjB,IAAI,KAAK,OAAO,QAAQ,MAAM,YAAY,KAAK,UAAU,KAAK,OAAO,KAAK,QAAQ;OAC7E,QAAQ,MAAM,eAAe,KAAK,QAAQ;CAEnD;AACF;AAEA,SAAgB,mBAAmB,SAAsB,YAA6B;CACpF,MAAM,SAAS,WAAW,KAAK,cAAc,CAAC,WAAW,QAAQ,aAAa,SAAS,CAAC,CAAU;CAClG,aAAY;EACV,KAAK,MAAM,CAAC,WAAW,UAAU,QAC/B,IAAI,UAAU,MAAM,QAAQ,gBAAgB,SAAS;OAChD,QAAQ,aAAa,WAAW,KAAK;CAE9C;AACF;AAEA,SAAgB,YAAY,OAA2B,KAA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;IAC9F,WAAW,OAAO,MAAM,OAAO,KAAK,IAAI,cAAc,IAAI;IAC1D,QAAQ;IACR,MAAM;GACP,CAAA;GACD,YAAY;GACZ,AAAK,QAAQ,SACV,WAAU;IACT,IAAI,cAAc,WAAW,CAAC,UAAU,OAAM;GAChD,CAAC,CAAC,CACD,YAAW,CAEZ,CAAC;GACH,IAAI,QAAQ,UACV,cAAc,qBAAoB;IAChC,QAAQ,WAAU;IAClB,OAAO,UAAU,CAAC;GACpB,CAAC;EACL;EACA,OAAO;CACT;CACA,MAAM,qBAAoB;EACxB,IAAI,UAAU,QAAO,GAAI,OAAM;CACjC;CACA,WAAW,iBAAiB,UAAU,YAAY;CAClD,IAAI,iBAAiB,oBAAoB,YAAY;CACrD,OAAO;EACL,aAAa,KAAK,IAAI;EACtB,YAAY,KAAK,KAAK;EACtB,UAAO,CAAI;EACX,UAAO;GACL,IAAI,UAAU;GACd,WAAW;GACX,SAAS;GACT,cAAa;GACb,cAAc;GACd,iBAAiB,WAAW;GAC5B,iBAAiB;GACjB,WAAW,oBAAoB,UAAU,YAAY;GACrD,IAAI,oBAAoB,oBAAoB,YAAY;GACxD,WAAW,OAAM;GACjB,YAAY;GACZ,kBAAiB;EACnB;CACD;AACH;AAGA,MAAa,yBAAyB"}
|
|
1
|
+
{"version":3,"file":"filip.mazev-blocks-effects-runtime.mjs","names":[],"sources":["../../../projects/blocks/effects/runtime/dom.ts","../../../projects/blocks/effects/runtime/constants/surface-interaction.constants.ts","../../../projects/blocks/effects/runtime/helpers/surface-interaction.helpers.ts","../../../projects/blocks/effects/runtime/configuration.ts","../../../projects/blocks/effects/runtime/scheduler.ts","../../../projects/blocks/effects/runtime/visibility.ts","../../../projects/blocks/effects/runtime/ambient.ts","../../../projects/blocks/effects/runtime/scene.ts","../../../projects/blocks/effects/runtime/spring.ts","../../../projects/blocks/effects/runtime/surface.ts","../../../projects/blocks/effects/runtime/transition.ts"],"sourcesContent":["/** Only the properties owned by a controller are restored, leaving application changes intact. */\nexport function rememberStyles(element: HTMLElement, properties: readonly string[]): () => void {\n const values = properties.map((property) => ({\n property,\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property)\n }));\n return () => {\n for (const item of values) {\n if (item.value) element.style.setProperty(item.property, item.value, item.priority);\n else element.style.removeProperty(item.property);\n }\n };\n}\n\nexport function rememberAttributes(element: HTMLElement, attributes: readonly string[]): () => void {\n const values = attributes.map((attribute) => [attribute, element.getAttribute(attribute)] as const);\n return () => {\n for (const [attribute, value] of values) {\n if (value === null) element.removeAttribute(attribute);\n else element.setAttribute(attribute, value);\n }\n };\n}\n\nexport function finiteClamp(value: number | undefined, low: number, high: number, fallback: number): number {\n return value === undefined || !Number.isFinite(value) ? fallback : Math.min(high, Math.max(low, value));\n}\n\nexport function smoothstep(low: number, high: number, value: number): number {\n const t = Math.min(1, Math.max(0, (value - low) / (high - low)));\n return t * t * (3 - 2 * t);\n}\n","/** Form state that suppresses interactive glass lighting and press effects while preserving focus styling. */\nexport const NONINTERACTIVE_SURFACE_SELECTOR =\n ':disabled, [aria-disabled=\"true\"], .is-disabled, [inert], [readonly], [aria-readonly=\"true\"], .bx-readonly, .is-readonly';\n","import { NONINTERACTIVE_SURFACE_SELECTOR } from '../constants/surface-interaction.constants';\n\n/** Resolves state for a surface, its owning label, or a native control within a projected field. */\nexport function isSurfaceInteractionBlocked(element: HTMLElement): boolean {\n if (element.closest(NONINTERACTIVE_SURFACE_SELECTOR) || element.closest('label')?.control?.matches(NONINTERACTIVE_SURFACE_SELECTOR)) return true;\n\n const control = element.querySelector('input:not([type=\"hidden\"]), select, textarea');\n\n return !!control && control.closest('[data-bx-surface]') === element && control.matches(NONINTERACTIVE_SURFACE_SELECTOR);\n}\n","import { finiteClamp, rememberAttributes, rememberStyles } from './dom';\nimport type { AppearanceConfiguration, AppearanceConfigurationController } from './types';\n\nexport const configurationEvent = 'bx-glass-config-change';\nconst attributes = ['data-bx-glass-quality', 'data-bx-reduced-motion', 'data-bx-reduced-transparency'];\nconst properties = ['--bx-glassiness'];\nconst configured = new WeakSet<HTMLElement>();\n\n/** Configure one inherited application scope. Use document.documentElement to include overlays. */\nexport function configureAppearance(root: HTMLElement, initial: AppearanceConfiguration = {}): AppearanceConfigurationController {\n if (configured.has(root)) throw new Error('A glass configuration is already mounted on this root.');\n configured.add(root);\n const restoreAttributes = rememberAttributes(root, attributes);\n const originalAttributes = new Map(attributes.map((name) => [name, root.getAttribute(name)]));\n const restoreStyles = rememberStyles(root, properties);\n let options = { ...initial };\n let disposed = false;\n const notify = () => {\n const viewEvent = root.ownerDocument.defaultView?.CustomEvent;\n if (viewEvent) root.ownerDocument.dispatchEvent(new viewEvent(configurationEvent, { detail: root }));\n };\n const paint = (sync = true) => {\n const values: [string, unknown][] = [\n ['data-bx-glass-quality', options.quality],\n ['data-bx-reduced-motion', options.reducedMotion],\n ['data-bx-reduced-transparency', options.reducedTransparency]\n ];\n for (const [name, value] of values) {\n const next = value === undefined ? (originalAttributes.get(name) ?? null) : String(value);\n if (root.getAttribute(name) === next) continue;\n if (next === null) root.removeAttribute(name);\n else root.setAttribute(name, next);\n }\n if (options.glassiness !== undefined) {\n const next = String(finiteClamp(options.glassiness, 0, 1, 0.5));\n if (root.style.getPropertyValue('--bx-glassiness') !== next) root.style.setProperty('--bx-glassiness', next);\n } else restoreStyles();\n // Tint and blur inherit directly in CSS. Only renderer/accessibility changes\n // need to synchronously revisit every mounted surface.\n if (sync) notify();\n };\n paint();\n return {\n update(next) {\n if (!disposed) {\n const previous = options;\n options = { ...options, ...next };\n paint(\n previous.quality !== options.quality ||\n previous.reducedMotion !== options.reducedMotion ||\n previous.reducedTransparency !== options.reducedTransparency\n );\n }\n },\n destroy() {\n if (disposed) return;\n disposed = true;\n restoreAttributes();\n restoreStyles();\n configured.delete(root);\n notify();\n }\n };\n}\n\nexport function inheritedAttribute(element: HTMLElement, name: string): string | null {\n let current: HTMLElement | null = element;\n while (current) {\n const value = current.getAttribute(name);\n if (value !== null) return value;\n current = current.parentElement;\n }\n return null;\n}\n","export type FrameCallback = (deltaSeconds: number, timestamp: number) => boolean;\n\ninterface FrameEntry {\n callback: FrameCallback;\n}\nconst entries = new Set<FrameEntry>();\nlet frame: number | undefined;\nlet previousTime: number | undefined;\nlet ticking = false;\n\nfunction tick(timestamp: number): void {\n frame = undefined;\n ticking = true;\n const delta = previousTime === undefined ? 1 / 60 : Math.min(0.064, Math.max(0, (timestamp - previousTime) / 1000));\n previousTime = timestamp;\n for (const entry of Array.from(entries)) {\n if (!entries.has(entry)) continue;\n try {\n if (!entry.callback(delta, timestamp)) entries.delete(entry);\n } catch (error) {\n entries.delete(entry);\n // Keep unrelated surfaces running; report the failed callback separately.\n queueMicrotask(() => {\n throw error;\n });\n }\n }\n ticking = false;\n if (entries.size > 0) frame = requestAnimationFrame(tick);\n else previousTime = undefined;\n}\n\n/** All effects share one lazy clock. Returning false removes the callback. */\nexport function subscribeFrame(callback: FrameCallback): () => void {\n if (typeof requestAnimationFrame !== 'function') return () => {};\n const entry: FrameEntry = { callback };\n entries.add(entry);\n if (frame === undefined && !ticking) frame = requestAnimationFrame(tick);\n return () => {\n entries.delete(entry);\n if (entries.size === 0) {\n if (frame !== undefined) cancelAnimationFrame(frame);\n frame = undefined;\n previousTime = undefined;\n }\n };\n}\n","/** Structural overlay boundaries are independent of numeric z-index values in nested contexts. */\nexport const lightBoundarySelector =\n '[data-bx-light-scope], dialog, [role=\"dialog\"], [role=\"alertdialog\"], [popover], .cdk-overlay-pane, .toast-container, bx-modal';\n\nconst lightingOrigins = new WeakMap<HTMLElement, HTMLElement>();\n\n/** Let a passive overlay receive light from its trigger's context. Register before mounting its surfaces. */\nexport function inheritGlassLighting(overlay: HTMLElement, origin: HTMLElement): () => void {\n if (overlay.contains(origin)) throw new Error('A lighting origin must be outside its overlay.');\n lightingOrigins.set(overlay, origin);\n return () => lightingOrigins.delete(overlay);\n}\n\nexport function lightingOrigin(element: Element): Element {\n let current: Element | null = element;\n while (current) {\n const origin = lightingOrigins.get(current as HTMLElement);\n if (origin) return origin;\n current = current.parentElement;\n }\n return element;\n}\n\n/** A short-lived snapshot: caches style reads within a lighting batch, never tracks pointer motion. */\nexport function lightingVisibility(doc: Document, view: Window) {\n const styles = new Map<Element, CSSStyleDeclaration>();\n const boundaries = new Map<HTMLElement, HTMLElement>();\n const layers = new Map<HTMLElement, HTMLElement>();\n const ambientBoundaries = new Map<Element, HTMLElement>();\n const hitStacks = new Map<string, Element[]>();\n const style = (element: Element) => {\n let value = styles.get(element);\n if (!value) {\n value = view.getComputedStyle(element);\n styles.set(element, value);\n }\n return value;\n };\n const elementsAt = (x: number, y: number): Element[] => {\n const key = `${Math.round(x)},${Math.round(y)}`;\n const cached = hitStacks.get(key);\n if (cached) return cached;\n const elements = [...doc.elementsFromPoint(x, y)];\n for (let index = 0; index < elements.length; index++) {\n const root = elements[index].shadowRoot;\n if (!root) continue;\n const shadowElements = root.elementsFromPoint(x, y);\n if (!shadowElements.length) continue;\n elements.splice(index, 0, ...shadowElements);\n index += shadowElements.length;\n }\n hitStacks.set(key, elements);\n return elements;\n };\n const ambientBoundary = (element: Element): HTMLElement => {\n const cached = ambientBoundaries.get(element);\n if (cached) return cached;\n const origin = lightingOrigin(element);\n if (origin !== element) {\n const result = ambientBoundary(origin);\n ambientBoundaries.set(element, result);\n return result;\n }\n let current: Element | null = element;\n const visited: Element[] = [];\n while (current) {\n visited.push(current);\n const boundary = ambientBoundaries.get(current) ?? current.closest<HTMLElement>(lightBoundarySelector);\n if (boundary) {\n for (const ancestor of visited) ambientBoundaries.set(ancestor, boundary);\n return boundary;\n }\n const root = current.getRootNode() as ShadowRoot;\n current = current.parentElement ?? root.host ?? null;\n }\n for (const ancestor of visited) ambientBoundaries.set(ancestor, doc.documentElement);\n return doc.documentElement;\n };\n const boundary = (element: HTMLElement): HTMLElement => {\n const cached = boundaries.get(element);\n if (cached) return cached;\n const origin = lightingOrigin(element);\n if (origin !== element) {\n const result = boundary(origin as HTMLElement);\n boundaries.set(element, result);\n return result;\n }\n const css = style(element);\n const result =\n element.matches(lightBoundarySelector) || css.position === 'fixed' || css.position === 'sticky'\n ? element\n : element.parentElement\n ? boundary(element.parentElement)\n : element;\n boundaries.set(element, result);\n return result;\n };\n const layer = (element: HTMLElement): HTMLElement => {\n const cached = layers.get(element);\n if (cached) return cached;\n const css = style(element);\n const positionedLayer = css.position !== 'static' && css.zIndex !== 'auto';\n const result =\n element.matches(lightBoundarySelector) || css.position === 'fixed' || css.position === 'sticky' || positionedLayer\n ? element\n : element.parentElement\n ? layer(element.parentElement)\n : element;\n layers.set(element, result);\n return result;\n };\n const exposed = (element: HTMLElement, x: number, y: number, bounds: DOMRect): boolean => {\n if (!element.isConnected || bounds.width <= 0 || bounds.height <= 0) return false;\n // Stay inside rounded corners: their bounding-box corners are not painted pixels.\n const css = style(element);\n const radius = Math.min(\n bounds.width / 2,\n bounds.height / 2,\n Math.max(\n ...[css.borderTopLeftRadius, css.borderTopRightRadius, css.borderBottomLeftRadius, css.borderBottomRightRadius].map((value) => parseFloat(value) || 0)\n )\n );\n const inset = Math.min(bounds.width / 2, bounds.height / 2, 1 + radius * (1 - Math.SQRT1_2));\n const px = Math.max(bounds.left + inset, Math.min(x, bounds.right - inset));\n const py = Math.max(bounds.top + inset, Math.min(y, bounds.bottom - inset));\n if (px < 0 || py < 0 || px >= view.innerWidth || py >= view.innerHeight) return false;\n // Passive help bubbles are intentionally absent from pointer hit testing.\n if (css.pointerEvents === 'none' && element.closest('bx-tooltip, [role=\"tooltip\"]')) {\n if (css.visibility !== 'visible' || css.display === 'none' || Number(css.opacity) === 0) return false;\n const origin = lightingOrigin(element);\n if (origin !== element) {\n const rect = origin.getBoundingClientRect();\n return exposed(origin as HTMLElement, rect.left + rect.width / 2, rect.top + rect.height / 2, rect);\n }\n const behind = doc.elementFromPoint(px, py);\n return !!behind && ambientBoundary(behind) === ambientBoundary(element);\n }\n const hit = doc.elementFromPoint(px, py);\n return !!hit && (hit === element || element.contains(hit));\n };\n return { boundary, layer, exposed, style, elementsAt, ambientBoundary };\n}\n","import { subscribeFrame } from './scheduler';\nimport { inheritedAttribute } from './configuration';\nimport { lightingVisibility } from './visibility';\nimport type { PointLight } from './scene';\n\nexport interface AmbientReceiver {\n id: number;\n element: HTMLElement;\n visible: boolean;\n bounds?: DOMRect;\n}\ninterface VisualSource {\n element: Element;\n color: string;\n}\ninterface Sample {\n bounds?: DOMRect;\n lights: PointLight[];\n media: Set<Element>;\n rects: Map<Element, DOMRect>;\n}\ninterface RasterSample {\n data: ImageData | null;\n stamp?: number;\n}\n\nconst sampleInterval = 180;\nconst liveInterval = 16;\nconst rasterSize = 32;\n\n/** Shared environmental sampling; geometry changes bypass the visual-source cooldown. */\nexport class AmbientSampler {\n private samples = new Map<AmbientReceiver, Sample>();\n private dirty = new Set<AmbientReceiver>();\n private pending = new Set<AmbientReceiver>();\n private urgent = new Set<AmbientReceiver>();\n private sources = new Set<Element>();\n private initialized = false;\n private media = new WeakMap<Element, RasterSample>();\n private dependencies?: Set<Element>;\n private sampleCanvas: HTMLCanvasElement;\n private sampleContext: CanvasRenderingContext2D | null;\n private timer?: number;\n private liveTimer?: number;\n private stopFrame?: () => void;\n private nextSample = 0;\n private liveDelay = liveInterval;\n private motion: MediaQueryList;\n\n constructor(\n private doc: Document,\n private view: Window,\n private changed: (entry: AmbientReceiver) => void,\n private observeRoot: (root: ShadowRoot) => void\n ) {\n this.sampleCanvas = doc.createElement('canvas');\n this.sampleCanvas.width = this.sampleCanvas.height = rasterSize;\n this.sampleContext = this.sampleCanvas.getContext('2d', { willReadFrequently: true });\n this.motion = view.matchMedia('(prefers-reduced-motion: reduce)');\n }\n\n public add(entry: AmbientReceiver): void {\n if (!this.initialized) {\n this.scan(this.doc);\n this.initialized = true;\n }\n const root = entry.element.getRootNode();\n if ('host' in root) this.scan(root as ShadowRoot);\n this.samples.set(entry, { lights: [], media: new Set(), rects: new Map() });\n this.invalidate(entry);\n }\n\n public remove(entry: AmbientReceiver): void {\n this.samples.delete(entry);\n this.dirty.delete(entry);\n this.pending.delete(entry);\n this.urgent.delete(entry);\n this.syncLive();\n }\n\n public lights(entry: AmbientReceiver): PointLight[] {\n const sample = this.samples.get(entry);\n if (!sample) return [];\n const dx = entry.bounds && sample.bounds ? entry.bounds.left - sample.bounds.left : 0;\n const dy = entry.bounds && sample.bounds ? entry.bounds.top - sample.bounds.top : 0;\n // Keep cached taps attached to a moving receiver until its next sample.\n return dx || dy ? sample.lights.map((light) => ({ ...light, x: light.x + dx, y: light.y + dy })) : sample.lights;\n }\n\n public invalidate(entry?: AmbientReceiver | AmbientReceiver[], immediate = false): void {\n for (const receiver of entry ? (Array.isArray(entry) ? entry : [entry]) : this.samples.keys()) {\n if (!receiver.visible || !receiver.element.isConnected) continue;\n if (!this.pending.has(receiver)) this.dirty.add(receiver);\n if (immediate) this.urgent.add(receiver);\n }\n this.resume();\n }\n\n /** Viewport re-entry waits for a current sample before replacing the cached paint. */\n public isPending(entry: AmbientReceiver): boolean {\n return this.urgent.has(entry);\n }\n\n public assetChanged(element: Element): void {\n this.media.delete(element);\n this.invalidate();\n }\n\n public sourcesChanged(record: MutationRecord): void {\n for (const node of record.addedNodes) {\n if (node.nodeType === 1) this.scan(node as Element);\n }\n for (const source of this.sources) if (!source.isConnected) this.sources.delete(source);\n }\n\n public resume(): void {\n if (this.doc.hidden) {\n if (this.timer !== undefined) this.view.clearTimeout(this.timer);\n if (this.liveTimer !== undefined) this.view.clearTimeout(this.liveTimer);\n this.timer = this.liveTimer = undefined;\n this.stopFrame?.();\n this.stopFrame = undefined;\n for (const entry of this.pending) this.dirty.add(entry);\n this.pending.clear();\n return;\n }\n if (this.urgent.size) {\n if (this.timer !== undefined) this.view.clearTimeout(this.timer);\n this.timer = undefined;\n for (const entry of this.dirty) this.pending.add(entry);\n this.dirty.clear();\n this.stopFrame ??= subscribeFrame(() => this.sampleBatch());\n }\n if (this.dirty.size && this.timer === undefined && !this.stopFrame) {\n this.timer = this.view.setTimeout(\n () => {\n this.timer = undefined;\n this.nextSample = this.view.performance.now() + sampleInterval;\n this.pending = this.dirty;\n this.dirty = new Set();\n this.stopFrame = subscribeFrame(() => this.sampleBatch());\n },\n Math.max(0, this.nextSample - this.view.performance.now())\n );\n }\n this.syncLive();\n }\n\n public destroy(): void {\n if (this.timer !== undefined) this.view.clearTimeout(this.timer);\n if (this.liveTimer !== undefined) this.view.clearTimeout(this.liveTimer);\n this.stopFrame?.();\n this.stopFrame = undefined;\n this.timer = this.liveTimer = undefined;\n this.samples.clear();\n this.dirty.clear();\n this.pending.clear();\n this.urgent.clear();\n this.sources.clear();\n this.media = new WeakMap();\n this.initialized = false;\n this.nextSample = 0;\n this.liveDelay = liveInterval;\n }\n\n private scan(root: ParentNode): void {\n if ('host' in root) this.observeRoot(root as ShadowRoot);\n if ('tagName' in root && /^(IMG|VIDEO|CANVAS)$/.test(String(root.tagName))) this.sources.add(root as Element);\n const shadow = 'shadowRoot' in root ? (root as Element).shadowRoot : null;\n if (shadow) this.scan(shadow);\n for (const element of root.querySelectorAll('*')) {\n if (/^(IMG|VIDEO|CANVAS)$/.test(element.tagName)) this.sources.add(element);\n if (element.shadowRoot) this.scan(element.shadowRoot);\n }\n }\n\n private sampleBatch(): boolean {\n const start = this.view.performance.now();\n const visibility = lightingVisibility(this.doc, this.view);\n const rects = new Map<Element, DOMRect>();\n const rasterSamples = new Map<Element, ImageData | null>();\n const sources = [...this.sources];\n const completed: AmbientReceiver[] = [];\n // Scroll receivers stay ahead of deferred work even while new scroll events\n // keep arriving. Set order rotates completed receivers behind waiting peers.\n for (const entry of new Set([...this.urgent, ...this.pending])) {\n this.pending.delete(entry);\n this.urgent.delete(entry);\n if (!entry.visible || !entry.element.isConnected || !this.samples.has(entry)) continue;\n entry.bounds = entry.element.getBoundingClientRect();\n const bounds = entry.bounds;\n // IntersectionObserver's margin keeps receivers warm, but hit tests outside\n // the viewport have no pixels. Keep their last lighting until they return.\n if (bounds.bottom <= 0 || bounds.right <= 0 || bounds.top >= this.view.innerHeight || bounds.left >= this.view.innerWidth) continue;\n this.dependencies = new Set();\n const lights = this.environmentLights(entry, sources, rasterSamples, rects, visibility);\n const mediaRects = new Map<Element, DOMRect>();\n for (const source of this.dependencies) mediaRects.set(source, this.rectFor(source, rects));\n this.samples.set(entry, { bounds, lights, media: this.dependencies, rects: mediaRects });\n completed.push(entry);\n // A receiver is atomic. Yield between receivers rather than block a frame with a whole page.\n if (completed.length >= 4 || this.view.performance.now() - start >= 4) break;\n }\n this.dependencies = undefined;\n for (const entry of completed) this.changed(entry);\n if (this.pending.size) return true;\n this.stopFrame = undefined;\n this.nextSample = this.view.performance.now() + sampleInterval;\n this.resume();\n return false;\n }\n\n private liveSources(): Map<Element, AmbientReceiver[]> {\n const sources = new Map<Element, AmbientReceiver[]>();\n for (const [entry, sample] of this.samples) {\n const motion = inheritedAttribute(entry.element, 'data-bx-reduced-motion');\n if (!entry.visible || !entry.element.isConnected || (motion === null ? this.motion.matches : motion === 'true')) continue;\n const bounds = entry.bounds;\n if (bounds && (bounds.bottom <= 0 || bounds.right <= 0 || bounds.top >= this.view.innerHeight || bounds.left >= this.view.innerWidth)) continue;\n for (const source of sample.media) {\n if (!source.isConnected || !/^(CANVAS|VIDEO)$/.test(source.tagName) || this.media.get(source)?.data === null) continue;\n if (source.tagName === 'VIDEO' && (source as HTMLVideoElement).paused) continue;\n const entries = sources.get(source) ?? [];\n entries.push(entry);\n sources.set(source, entries);\n }\n }\n return sources;\n }\n\n private syncLive(): void {\n const active = !this.doc.hidden && this.liveSources().size > 0;\n if (!active && this.liveTimer !== undefined) {\n this.view.clearTimeout(this.liveTimer);\n this.liveTimer = undefined;\n }\n if (!active || this.liveTimer !== undefined) return;\n this.liveTimer = this.view.setTimeout(() => {\n this.liveTimer = undefined;\n let changed = false;\n const recolored = new Set<AmbientReceiver>();\n const visibility = lightingVisibility(this.doc, this.view);\n for (const [source, entries] of this.liveSources()) {\n const previous = this.media.get(source);\n const next = this.readRaster(source, true);\n // Compare quantized pixels, not just the fact that a canvas/video exists.\n if (previous?.data && next?.data && this.samePixels(previous.data, next.data)) continue;\n if (previous?.data === next?.data) continue;\n changed = true;\n const coverageChanged = !previous?.data || !next?.data || !this.samePixels(previous.data, next.data, true);\n for (const entry of entries) {\n const sample = this.samples.get(entry);\n if (!sample || coverageChanged || this.dirty.has(entry) || this.pending.has(entry)) {\n this.dirty.add(entry);\n this.urgent.add(entry);\n continue;\n }\n // Animation changes pixels, not the hit-test stack. Reuse the source bindings and\n // geometry until a real layout/visibility invalidation, and repaint only changed taps.\n const pixels = new Map([[source, next?.data ?? null]]);\n sample.lights = sample.lights.map((light) => {\n if (light.source !== source) return light;\n const color = this.rasterColorAt(source, light.x, light.y, pixels, sample.rects, visibility);\n if (!color || color === light.color) return light;\n recolored.add(entry);\n return { ...light, color };\n });\n }\n }\n for (const entry of recolored) this.changed(entry);\n this.liveDelay = changed ? liveInterval : Math.min(250, this.liveDelay * 2);\n this.resume();\n }, this.liveDelay);\n }\n\n private samePixels(first: ImageData, second: ImageData, alphaOnly = false): boolean {\n for (let index = alphaOnly ? 3 : 0; index < first.data.length; index += alphaOnly ? 4 : 1) {\n if (alphaOnly ? first.data[index] >> 3 !== second.data[index] >> 3 : Math.abs(first.data[index] - second.data[index]) >= 2) return false;\n }\n return true;\n }\n\n private readRaster(element: Element, refresh = false): RasterSample | undefined {\n const cached = this.media.get(element);\n if (cached && !refresh) return cached;\n const tag = element.tagName;\n let source: CanvasImageSource;\n let stamp: number | undefined;\n if (tag === 'IMG') {\n const image = element as HTMLImageElement;\n if (!image.complete || !image.naturalWidth) return undefined;\n source = image;\n } else if (tag === 'VIDEO') {\n const video = element as HTMLVideoElement;\n if (video.readyState < 2 || !video.videoWidth) return undefined;\n stamp = video.currentTime;\n if (cached?.stamp === stamp) return cached;\n source = video;\n } else {\n const canvas = element as HTMLCanvasElement;\n if (!canvas.width || !canvas.height) return undefined;\n source = canvas;\n }\n if (!this.sampleContext) return undefined;\n let data: ImageData | null = null;\n try {\n this.sampleContext.clearRect(0, 0, rasterSize, rasterSize);\n this.sampleContext.drawImage(source, 0, 0, rasterSize, rasterSize);\n data = this.sampleContext.getImageData(0, 0, rasterSize, rasterSize);\n } catch {\n // Cache failures too, and recover the shared buffer after a cross-origin source taints it.\n this.sampleCanvas.width = rasterSize;\n this.sampleContext = this.sampleCanvas.getContext('2d', { willReadFrequently: true });\n }\n const result = { data, stamp };\n this.media.set(element, result);\n return result;\n }\n\n private environmentLights(\n entry: AmbientReceiver,\n rasterSources: Element[],\n rasterSamples: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>,\n visibility: ReturnType<typeof lightingVisibility>\n ): PointLight[] {\n const bounds = entry.bounds;\n if (\n !bounds ||\n bounds.width <= 0 ||\n bounds.height <= 0 ||\n entry.element.getAttribute('data-bx-surface') === 'solid' ||\n entry.element.getAttribute('data-bx-reduced-transparency') === 'true'\n )\n return [];\n const insetX = Math.min(3, bounds.width * 0.1);\n const insetY = Math.min(3, bounds.height * 0.1);\n const points = [\n { x: bounds.left + bounds.width * 0.24, y: bounds.top + insetY, side: 'inside' as const, edge: 0 },\n { x: bounds.left + bounds.width * 0.76, y: bounds.top + insetY, side: 'inside' as const, edge: 0 },\n { x: bounds.right - insetX, y: bounds.top + bounds.height * 0.24, side: 'inside' as const, edge: 1 },\n { x: bounds.right - insetX, y: bounds.top + bounds.height * 0.76, side: 'inside' as const, edge: 1 },\n { x: bounds.left + bounds.width * 0.76, y: bounds.bottom - insetY, side: 'inside' as const, edge: 2 },\n { x: bounds.left + bounds.width * 0.24, y: bounds.bottom - insetY, side: 'inside' as const, edge: 2 },\n { x: bounds.left + insetX, y: bounds.top + bounds.height * 0.76, side: 'inside' as const, edge: 3 },\n { x: bounds.left + insetX, y: bounds.top + bounds.height * 0.24, side: 'inside' as const, edge: 3 },\n ...[24, 96].flatMap((gap) => [\n { x: bounds.left + bounds.width / 2, y: bounds.top - gap, side: 'outside' as const, edge: 0 },\n { x: bounds.right + gap, y: bounds.top + bounds.height / 2, side: 'outside' as const, edge: 1 },\n { x: bounds.left + bounds.width / 2, y: bounds.bottom + gap, side: 'outside' as const, edge: 2 },\n { x: bounds.left - gap, y: bounds.top + bounds.height / 2, side: 'outside' as const, edge: 3 }\n ])\n ];\n const visibleX = Math.max(1, Math.min(this.view.innerWidth - 1, bounds.left + bounds.width / 2));\n const visibleY = Math.max(1, Math.min(this.view.innerHeight - 1, bounds.top + bounds.height / 2));\n if (!visibility.exposed(entry.element, visibleX, visibleY, bounds)) return [];\n const targetBoundary = visibility.ambientBoundary(entry.element);\n const passiveTooltip = visibility.style(entry.element).pointerEvents === 'none' && !!entry.element.closest('bx-tooltip, [role=\"tooltip\"]');\n // Cull once per receiver, rather than walking every media element at every edge probe.\n rasterSources = rasterSources.filter((source) => {\n const rect = this.rectFor(source, rects);\n return (\n rect.width > 0 &&\n rect.height > 0 &&\n rect.right >= bounds.left - 96 &&\n rect.left <= bounds.right + 96 &&\n rect.bottom >= bounds.top - 96 &&\n rect.top <= bounds.bottom + 96 &&\n visibility.ambientBoundary(source) === targetBoundary\n );\n });\n const lights: PointLight[] = [];\n const sourcesByEdge = new Map<number, Set<Element>>();\n const colorsByEdge = new Map<number, Map<Element, Set<string>>>();\n\n points.forEach((point, index) => {\n if (point.x < 0 || point.y < 0 || point.x >= this.view.innerWidth || point.y >= this.view.innerHeight) return;\n const stack = visibility.elementsAt(point.x, point.y);\n const receiverIndex = stack.findIndex((element) => this.isInside(element, entry.element));\n let source: VisualSource | undefined;\n let foreground = false;\n\n if (point.side === 'inside' && receiverIndex >= 0) {\n source = this.findVisualSource(stack.slice(0, receiverIndex), entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: true,\n skipRoot: true\n });\n if (source) foreground = true;\n source ??= this.findRasterSource(rasterSources, entry, point.x, point.y, visibility, rasterSamples, rects, stack, receiverIndex, true, targetBoundary);\n source ??= this.findVisualSource(stack.slice(receiverIndex + 1), entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: true,\n skipRoot: true\n });\n source ??= this.findRasterSource(rasterSources, entry, point.x, point.y, visibility, rasterSamples, rects, stack, receiverIndex, false, targetBoundary);\n source ??= this.findVisualSource(stack.slice(receiverIndex + 1), entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: false,\n skipRoot: true\n });\n source ??= this.findVisualSource(stack.slice(receiverIndex + 1), entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: false,\n skipRoot: false\n });\n } else if (point.side === 'outside' || (receiverIndex < 0 && passiveTooltip)) {\n source = this.findVisualSource(stack, entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: true,\n skipRoot: true\n });\n source ??= this.findRasterSource(rasterSources, entry, point.x, point.y, visibility, rasterSamples, rects, stack, -1, undefined, targetBoundary);\n source ??= this.findVisualSource(stack, entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: false,\n skipRoot: true\n });\n source ??= this.findVisualSource(stack, entry, point.x, point.y, visibility, rasterSamples, rects, {\n skipAncestors: false,\n skipRoot: false\n });\n }\n\n if (!source || visibility.ambientBoundary(source.element) !== targetBoundary) return;\n const sourceRect = this.rectFor(source.element, rects);\n const gapX = Math.max(bounds.left - sourceRect.right, sourceRect.left - bounds.right, 0);\n const gapY = Math.max(bounds.top - sourceRect.bottom, sourceRect.top - bounds.bottom, 0);\n if (point.side === 'outside' && Math.hypot(gapX, gapY) > 160) return;\n if (source.element === entry.element || this.isInside(source.element, entry.element)) return;\n const edgeSources = sourcesByEdge.get(point.edge) ?? new Set<Element>();\n if (point.side === 'outside' && edgeSources.has(source.element)) return;\n const edgeColors = colorsByEdge.get(point.edge) ?? new Map<Element, Set<string>>();\n const sourceColors = edgeColors.get(source.element) ?? new Set<string>();\n if (point.side === 'outside' && sourceColors.has(source.color)) return;\n sourceColors.add(source.color);\n edgeColors.set(source.element, sourceColors);\n colorsByEdge.set(point.edge, edgeColors);\n if (point.side === 'inside') {\n edgeSources.add(source.element);\n sourcesByEdge.set(point.edge, edgeSources);\n }\n\n if (point.side === 'outside') {\n foreground = this.isAmbientForeground(source.element, entry.element, stack, -1, visibility);\n }\n const depth = foreground ? 24 : 52;\n const gap = Math.hypot(gapX, gapY);\n const edgeLength = point.edge % 2 === 0 ? bounds.width : bounds.height;\n lights.push({\n key: `environment:${entry.id}:${index}`,\n source: source.element.namespaceURI === 'http://www.w3.org/1999/xhtml' ? (source.element as HTMLElement) : undefined,\n ambient: true,\n x: point.x,\n y: point.y,\n z: depth,\n color: source.color,\n intensity: (point.side === 'inside' ? 0.38 : 0.48) * Math.pow(Math.max(0, 1 - gap / 160), 2),\n radius: 240,\n spread: Math.max(48, Math.min(240, edgeLength * 0.65))\n });\n });\n\n return lights;\n }\n\n private findVisualSource(\n elements: Element[],\n entry: AmbientReceiver,\n x: number,\n y: number,\n visibility: ReturnType<typeof lightingVisibility>,\n rasterSamples: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>,\n options: { skipAncestors: boolean; skipRoot: boolean }\n ): VisualSource | undefined {\n for (const element of elements) {\n if (element === entry.element || this.isInside(element, entry.element)) continue;\n if (options.skipAncestors && this.isInside(entry.element, element)) continue;\n if (options.skipRoot && (element === this.doc.documentElement || element === this.doc.body)) continue;\n if (visibility.ambientBoundary(element) !== visibility.ambientBoundary(entry.element)) continue;\n const color = this.visualColorAt(element, x, y, visibility, rasterSamples, rects);\n if (color) return { element, color };\n }\n return undefined;\n }\n\n private findRasterSource(\n sources: Element[],\n entry: AmbientReceiver,\n x: number,\n y: number,\n visibility: ReturnType<typeof lightingVisibility>,\n rasterSamples: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>,\n stack: Element[],\n receiverIndex: number,\n foreground: boolean | undefined,\n targetBoundary: HTMLElement\n ): VisualSource | undefined {\n const matches = sources\n .filter((element) => {\n if (this.isInside(element, entry.element) || visibility.ambientBoundary(element) !== targetBoundary) return false;\n const bounds = this.rectFor(element, rects);\n if (x < bounds.left || x >= bounds.right || y < bounds.top || y >= bounds.bottom) return false;\n return foreground === undefined || this.isAmbientForeground(element, entry.element, stack, receiverIndex, visibility) === foreground;\n })\n .sort((first, second) => this.rasterOrder(second, stack, entry.element, visibility) - this.rasterOrder(first, stack, entry.element, visibility));\n\n for (const element of matches) {\n const color = this.rasterColorAt(element, x, y, rasterSamples, rects, visibility);\n if (color) return { element, color };\n }\n return undefined;\n }\n\n private visualColorAt(\n element: Element,\n x: number,\n y: number,\n visibility: ReturnType<typeof lightingVisibility>,\n rasterSamples: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>\n ): string | undefined {\n const raster = this.rasterColorAt(element, x, y, rasterSamples, rects, visibility);\n if (raster) return raster;\n const style = visibility.style(element);\n const gradient = this.gradientColorAt(style.backgroundImage, this.rectFor(element, rects), x, y);\n if (gradient) return gradient;\n if (!this.isTransparent(style.backgroundColor)) return style.backgroundColor;\n for (const side of ['top', 'right', 'bottom', 'left']) {\n const color = style.getPropertyValue(`border-${side}-color`);\n if (parseFloat(style.getPropertyValue(`border-${side}-width`)) > 0 && !this.isTransparent(color)) return color;\n }\n return undefined;\n }\n\n private rasterColorAt(\n element: Element,\n x: number,\n y: number,\n cache: Map<Element, ImageData | null>,\n rects: Map<Element, DOMRect>,\n visibility: ReturnType<typeof lightingVisibility>\n ): string | undefined {\n const tag = element.tagName;\n if (!/^(IMG|CANVAS|VIDEO)$/.test(tag)) return undefined;\n const bounds = this.rectFor(element, rects);\n if (bounds.width <= 0 || bounds.height <= 0) return undefined;\n const css = visibility.style(element);\n if (css.visibility !== 'visible' || Number(css.opacity) === 0) return undefined;\n this.dependencies?.add(element);\n let data = cache.get(element);\n if (data === undefined) {\n data = this.readRaster(element)?.data ?? null;\n cache.set(element, data);\n }\n if (!data) return undefined;\n\n let u = Math.max(0, Math.min(1, (x - bounds.left) / bounds.width));\n let v = Math.max(0, Math.min(1, (y - bounds.top) / bounds.height));\n if ((tag === 'IMG' || tag === 'VIDEO') && css.objectFit !== 'fill') {\n const width = tag === 'IMG' ? (element as HTMLImageElement).naturalWidth : (element as HTMLVideoElement).videoWidth;\n const height = tag === 'IMG' ? (element as HTMLImageElement).naturalHeight : (element as HTMLVideoElement).videoHeight;\n if (!width || !height) return undefined;\n const contain = Math.min(bounds.width / width, bounds.height / height);\n const scale =\n css.objectFit === 'cover'\n ? Math.max(bounds.width / width, bounds.height / height)\n : css.objectFit === 'none'\n ? 1\n : css.objectFit === 'scale-down'\n ? Math.min(1, contain)\n : contain;\n const [positionX = '50%', positionY = '50%'] = css.objectPosition.split(' ');\n const offset = (position: string, space: number) => {\n if (position.endsWith('%')) return (parseFloat(position) / 100) * space;\n if (position.endsWith('px')) return parseFloat(position);\n return position === 'left' || position === 'top' ? 0 : position === 'right' || position === 'bottom' ? space : space / 2;\n };\n u = (x - bounds.left - offset(positionX, bounds.width - width * scale)) / (width * scale);\n v = (y - bounds.top - offset(positionY, bounds.height - height * scale)) / (height * scale);\n // A letterbox is the element's CSS background, not a stretched image edge.\n if (u < 0 || u > 1 || v < 0 || v > 1) return undefined;\n }\n // Interpolate between texel centers. Nearest-neighbor taps on the shared\n // downsample jumped between whole color blocks as an image scrolled.\n const px = Math.max(0, Math.min(data.width - 1, u * data.width - 0.5));\n const py = Math.max(0, Math.min(data.height - 1, v * data.height - 0.5));\n const left = Math.floor(px),\n top = Math.floor(py);\n const right = Math.min(data.width - 1, left + 1),\n bottom = Math.min(data.height - 1, top + 1);\n const taps = [\n [left, top, (1 - (px - left)) * (1 - (py - top))],\n [right, top, (px - left) * (1 - (py - top))],\n [left, bottom, (1 - (px - left)) * (py - top)],\n [right, bottom, (px - left) * (py - top)]\n ];\n const channels = [0, 0, 0];\n let alpha = 0;\n for (const [x, y, weight] of taps) {\n const offset = (y * data.width + x) * 4;\n const coverage = (data.data[offset + 3] / 255) * weight;\n alpha += coverage;\n for (let channel = 0; channel < 3; channel++) channels[channel] += data.data[offset + channel] * coverage;\n }\n if (alpha < 0.08) return undefined;\n return `rgb(${channels.map((channel) => Math.round(channel / alpha)).join(' ')} / ${alpha.toFixed(2)})`;\n }\n\n private gradientColorAt(image: string, bounds: DOMRect, x: number, y: number): string | undefined {\n if (!image.includes('gradient(')) return undefined;\n const matches = image.match(\n /#[\\da-f]{3,8}\\b|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\\([^)]*\\)|\\b(?:transparent|black|white|red|green|blue|orange|yellow|purple|gray|grey|teal|cyan|magenta)\\b/gi\n );\n const colors = (matches ?? []).filter((color) => !this.isTransparent(color));\n if (!colors.length) return undefined;\n\n let amount = 0.5;\n if (image.includes('linear-gradient(')) {\n const prelude =\n image\n .match(/linear-gradient\\(\\s*([^,]+)/i)?.[1]\n ?.trim()\n .toLowerCase() ?? '';\n let dx = 0,\n dy = 1;\n const angle = prelude.match(/^(-?[\\d.]+)deg$/);\n if (angle) {\n const radians = (Number(angle[1]) * Math.PI) / 180;\n dx = Math.sin(radians);\n dy = -Math.cos(radians);\n } else if (prelude.startsWith('to ')) {\n dx = prelude.includes('right') ? 1 : prelude.includes('left') ? -1 : 0;\n dy = prelude.includes('bottom') ? 1 : prelude.includes('top') ? -1 : 0;\n }\n const range = Math.max(0.01, Math.abs(dx) + Math.abs(dy));\n const u = (x - bounds.left) / Math.max(1, bounds.width) - 0.5;\n const v = (y - bounds.top) / Math.max(1, bounds.height) - 0.5;\n amount = Math.max(0, Math.min(1, 0.5 + (u * dx + v * dy) / range));\n } else {\n const u = (x - (bounds.left + bounds.width / 2)) / Math.max(1, bounds.width / 2);\n const v = (y - (bounds.top + bounds.height / 2)) / Math.max(1, bounds.height / 2);\n amount = Math.max(0, Math.min(1, Math.hypot(u, v) / Math.SQRT2));\n }\n const position = amount * (colors.length - 1);\n const index = Math.min(colors.length - 1, Math.floor(position));\n if (index === colors.length - 1 || position === index) return colors[index];\n return `color-mix(in srgb, ${colors[index]} ${((1 - (position - index)) * 100).toFixed(2)}%, ${colors[index + 1]})`;\n }\n\n private isTransparent(color: string): boolean {\n const value = color.trim().toLowerCase();\n if (!value || value === 'transparent') return true;\n const alpha = value.match(/\\/\\s*([\\d.]+)%?\\s*\\)$/) ?? (/^rgba\\(|^hsla\\(/.test(value) ? value.match(/,\\s*([\\d.]+)\\s*\\)$/) : null);\n return !!alpha && Number(alpha[1]) <= 0.02;\n }\n\n private isInside(element: Element, ancestor: Element): boolean {\n let current: Element | null = element;\n while (current) {\n if (current === ancestor) return true;\n const root = current.getRootNode() as ShadowRoot;\n current = current.parentElement ?? root.host ?? null;\n }\n return false;\n }\n\n private layerElement(element: Element, visibility: ReturnType<typeof lightingVisibility>): HTMLElement {\n let current: Element | null = element;\n while (current && current.namespaceURI !== 'http://www.w3.org/1999/xhtml') {\n const root = current.getRootNode() as ShadowRoot;\n current = current.parentElement ?? root.host ?? null;\n }\n return current ? visibility.layer(current as HTMLElement) : this.doc.documentElement;\n }\n\n private zIndex(element: HTMLElement, visibility: ReturnType<typeof lightingVisibility>): number {\n const value = Number.parseFloat(visibility.style(element).zIndex);\n return Number.isFinite(value) ? value : 0;\n }\n\n private isAmbientForeground(\n source: Element,\n receiver: HTMLElement,\n stack: Element[],\n receiverIndex: number,\n visibility: ReturnType<typeof lightingVisibility>\n ): boolean {\n const sourceIndex = stack.indexOf(source);\n if (sourceIndex >= 0 && receiverIndex >= 0) return sourceIndex < receiverIndex;\n const sourceLayer = this.layerElement(source, visibility);\n const receiverLayer = visibility.layer(receiver);\n const depth = this.zIndex(sourceLayer, visibility) - this.zIndex(receiverLayer, visibility);\n if (depth !== 0) return depth > 0;\n return !!(source.compareDocumentPosition(receiver) & 2);\n }\n\n private rasterOrder(element: Element, stack: Element[], receiver: HTMLElement, visibility: ReturnType<typeof lightingVisibility>): number {\n const index = stack.indexOf(element);\n if (index >= 0) return 10000 - index;\n return this.zIndex(this.layerElement(element, visibility), visibility) - this.zIndex(visibility.layer(receiver), visibility);\n }\n\n private rectFor(element: Element, rects: Map<Element, DOMRect>): DOMRect {\n let rect = rects.get(element);\n if (!rect) {\n rect = element.getBoundingClientRect();\n rects.set(element, rect);\n }\n return rect;\n }\n}\n","import { AmbientSampler } from './ambient';\nimport { configurationEvent } from './configuration';\nimport { finiteClamp } from './dom';\nimport { subscribeFrame } from './scheduler';\nimport { lightBoundarySelector, lightingOrigin, lightingVisibility } from './visibility';\nimport type { GlassLight, GlassReflector, GlassScene, GlassSceneOptions } from './types';\n\nexport interface LightContribution {\n key: string;\n x: number;\n y: number;\n color: string;\n strength: number;\n edgeStrength: number;\n ambient?: boolean;\n spread?: number;\n}\nexport interface Lighting {\n /** First paint and viewport re-entry already have a current sample and must not fade in. */\n immediate?: boolean;\n x: number;\n y: number;\n strength: number;\n color: string;\n rim: string;\n contributions: LightContribution[];\n reflection: string;\n reflectionStrength: number;\n reflectionX: number;\n reflectionY: number;\n}\ninterface SurfaceHooks {\n hitTarget?: HTMLElement;\n light(value: Lighting): void;\n interactive(): boolean;\n emission?(): string | undefined;\n focusEmission?(): string | undefined;\n emit?(active: boolean, color?: string): void;\n press(): void;\n release(): void;\n sync(): void;\n}\ninterface Entry {\n id: number;\n element: HTMLElement;\n hooks: SurfaceHooks;\n visible: boolean;\n bounds?: DOMRect;\n lastLighting?: Lighting;\n resuming?: boolean;\n painted?: boolean;\n}\ninterface SceneEntry {\n id: number;\n root: HTMLElement;\n options: GlassSceneOptions;\n}\nexport interface PointLight {\n key: string;\n bounds?: DOMRect;\n source?: HTMLElement;\n ambient?: boolean;\n spread?: number;\n excludeSource?: boolean;\n excludeElement?: HTMLElement;\n x: number;\n y: number;\n z: number;\n color: string;\n intensity: number;\n radius: number;\n}\ninterface Reflection {\n source: HTMLElement;\n x: number;\n y: number;\n depth: number;\n color: string;\n intensity: number;\n radius: number;\n}\nconst runtimes = new WeakMap<Document, SceneRuntime>();\nconst activeStateSelector =\n ':checked, [aria-checked=\"true\"], [aria-pressed=\"true\"], [aria-selected=\"true\"], [aria-expanded=\"true\"], [aria-current]:not([aria-current=\"false\"]):not([aria-current=\"\"])';\nconst disabledSelector = ':disabled, [aria-disabled=\"true\"], .is-disabled, [inert]';\n\nfunction runtimeFor(doc: Document): SceneRuntime {\n let runtime = runtimes.get(doc);\n if (!runtime) {\n runtime = new SceneRuntime(doc);\n runtimes.set(doc, runtime);\n }\n return runtime;\n}\n\n/** One delegated pointer stream and visibility observer per document, never per control. */\nexport function registerSurface(element: HTMLElement, hooks: SurfaceHooks): () => void {\n return runtimeFor(element.ownerDocument).register(element, hooks);\n}\n\n/** Receive scene lighting for a native pseudo-element without inserting decoration into its host. */\nexport function observeGlassLighting(element: HTMLElement, light: (value: Lighting) => void, hitTarget: HTMLElement = element): () => void {\n return registerSurface(element, { light, hitTarget, interactive: () => false, press() {}, release() {}, sync() {} });\n}\n\n/** Invalidate a receiver after an application changes its geometry. */\nexport function refreshGlassLighting(element: HTMLElement): void {\n runtimeFor(element.ownerDocument).refreshElement(element);\n}\n\n/** Light fields are explicit; surfaces also sample nearby visual sources for ambient edge color. */\nexport function mountGlassScene(root: HTMLElement, options: GlassSceneOptions = {}): GlassScene {\n return runtimeFor(root.ownerDocument).scene(root, options);\n}\n\nclass SceneRuntime {\n private entries = new Map<HTMLElement, Entry>();\n private scenes = new Set<SceneEntry>();\n private observer?: IntersectionObserver;\n private stateObserver?: MutationObserver;\n private selected = new Set<Entry>();\n private pressed?: Entry;\n private hovered?: Entry;\n private focused?: Entry;\n private focusedTarget?: Element;\n private emitting = new Map<Entry, string>();\n private nextId = 0;\n private lightIds = new WeakMap<HTMLElement, number>();\n private queue = new Set<Entry>();\n private stopFrame?: () => void;\n private connected = false;\n private motion: MediaQueryList;\n private transparency: MediaQueryList;\n private view: Window;\n private ambient: AmbientSampler;\n private renderedStyles = new WeakMap<HTMLElement, string | null>();\n private assetLoad = (event: Event) => {\n const target = event.target as Element | null;\n if (target && /^(IMG|VIDEO)$/.test(target.tagName)) this.ambient.assetChanged(target);\n };\n\n private visibilityChange = () => {\n if (!this.doc.hidden) this.refresh();\n this.ambient.resume();\n };\n\n private down = (event: PointerEvent) => {\n this.pressed = this.find(event);\n this.pressed?.hooks.press();\n this.updateEmitter();\n };\n\n private up = () => {\n this.pressed?.hooks.release();\n this.pressed = undefined;\n this.updateEmitter();\n };\n\n private leave = () => {\n this.up();\n this.hovered = undefined;\n this.updateEmitter();\n };\n\n private blur = () => {\n this.up();\n this.hovered = this.focused = undefined;\n this.focusedTarget = undefined;\n this.updateEmitter();\n };\n\n private over = (event: Event) => {\n const found = this.find(event);\n const next = found?.hooks.emission?.() ? found : undefined;\n if (next !== this.hovered) {\n this.hovered = next;\n this.updateEmitter();\n }\n };\n\n private out = (event: PointerEvent) => {\n const target = this.hovered?.element.closest('label') ?? this.hovered?.element;\n if (target && !target.contains(event.relatedTarget as Node | null)) {\n this.hovered = undefined;\n this.updateEmitter();\n }\n };\n\n private focus = (event: Event) => {\n const target = event.target as Element;\n const visual = target.matches('input[type=\"checkbox\"], input[type=\"radio\"]')\n ? target.closest('label')?.querySelector<HTMLElement>('[data-bx-surface]')\n : undefined;\n this.focused = visual ? this.entries.get(visual) : this.find(event);\n this.focusedTarget = target;\n this.updateEmitter();\n };\n\n private unfocus = () => {\n this.focused = undefined;\n this.focusedTarget = undefined;\n this.updateEmitter();\n };\n\n private change = () => {\n for (const entry of this.entries.values()) this.updateSelected(entry);\n this.updateEmitter();\n };\n\n private sync = () => {\n // Children inherit resolved material preferences from their nearest surface.\n // Angular mounts child surfaces first, so registration order is insufficient.\n const ordered = [...this.entries.values()].sort((a, b) => {\n const position = a.element.compareDocumentPosition(b.element);\n\n return position === 0 ? 0 : position & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n });\n\n for (const entry of ordered) {\n entry.hooks.sync();\n this.updateSelected(entry);\n }\n this.updateEmitter();\n this.refresh();\n };\n\n private refresh = () => {\n this.refreshEntries([...this.entries.values()]);\n };\n\n private scroll = (event: Event) => {\n const root = event.target as HTMLElement | null;\n if (root?.nodeType !== 1) {\n this.refresh();\n return;\n }\n const area = root.getBoundingClientRect();\n const nearby: Entry[] = [];\n this.refreshEntries(\n [...this.entries.values()].filter((entry) => {\n if (!entry.visible) return false;\n if (root.contains(entry.element)) return true;\n const bounds = (entry.bounds ??= entry.element.getBoundingClientRect());\n // Prioritize controls over the scrolling pixels. Nearby surfaces still\n // refresh, but must not crowd those controls out of every sample batch.\n if (bounds.right > area.left && bounds.left < area.right && bounds.bottom > area.top && bounds.top < area.bottom) return true;\n if (bounds.right >= area.left - 160 && bounds.left <= area.right + 160 && bounds.bottom >= area.top - 160 && bounds.top <= area.bottom + 160)\n nearby.push(entry);\n return false;\n })\n );\n this.ambient.invalidate(nearby);\n };\n\n constructor(private doc: Document) {\n const view = doc.defaultView;\n if (!view) throw new Error('Glass scenes require a browser document.');\n this.view = view;\n this.ambient = new AmbientSampler(\n doc,\n view,\n (entry) => {\n if (this.entries.get(entry.element) !== entry) return;\n this.queue.add(entry as Entry);\n this.schedule();\n },\n (root) => this.observeState(root)\n );\n this.motion = view.matchMedia('(prefers-reduced-motion: reduce)');\n this.transparency = view.matchMedia('(prefers-reduced-transparency: reduce)');\n if (typeof view.IntersectionObserver === 'function')\n this.observer = new view.IntersectionObserver(\n (records) => {\n for (const record of records) {\n const entry = this.entries.get(record.target as HTMLElement);\n if (!entry) continue;\n if (record.isIntersecting && !entry.visible) entry.resuming = true;\n entry.visible = record.isIntersecting;\n this.ambient.invalidate(entry, true);\n if (entry.visible) {\n entry.bounds = undefined;\n this.queue.add(entry);\n }\n }\n this.schedule();\n },\n { rootMargin: '64px' }\n );\n // Watch semantic and visual source changes once per document. Lighting's\n // own decoration writes are excluded so sampling cannot trigger a loop.\n if (typeof view.MutationObserver === 'function')\n this.stateObserver = new view.MutationObserver((records) => {\n const changed = new Set<Entry>();\n let visualChanged = false;\n for (const record of records) {\n if (record.type === 'childList') {\n if (record.target.nodeType === 1 && this.isLightingDecoration(record.target)) continue;\n if ([...record.addedNodes, ...record.removedNodes].some((node) => !this.isLightingDecoration(node))) {\n visualChanged = true;\n this.ambient.sourcesChanged(record);\n }\n continue;\n }\n const target = record.target as HTMLElement;\n if (record.attributeName === 'style' && this.renderedStyles.get(target) === target.getAttribute('style')) continue;\n if (record.attributeName === 'class') {\n const entry = this.entries.get(target);\n if (entry) changed.add(entry);\n }\n if (\n record.attributeName === 'class' ||\n record.attributeName === 'style' ||\n record.attributeName === 'hidden' ||\n record.attributeName === 'readonly' ||\n record.attributeName === 'aria-readonly' ||\n /^(role|data-bx-light-scope|data-bx-surface|data-bx-reduced-transparency|data-bx-reduced-motion|src|srcset|width|height)$/.test(\n record.attributeName ?? ''\n )\n ) {\n if (!this.isLightingDecoration(target)) {\n visualChanged = true;\n if (/^(src|srcset|width|height)$/.test(record.attributeName ?? '')) this.ambient.assetChanged(target);\n }\n continue;\n }\n const visual = target.matches('input[type=\"checkbox\"], input[type=\"radio\"]')\n ? target.closest('label')?.querySelector<HTMLElement>('[data-bx-surface]')\n : undefined;\n const entry = this.entries.get(target) ?? (visual ? this.entries.get(visual) : undefined);\n if (entry) changed.add(entry);\n if (record.attributeName === 'data-bx-field-invalid') {\n for (const surface of target.querySelectorAll<HTMLElement>('[data-bx-surface]')) {\n const child = this.entries.get(surface);\n if (child) changed.add(child);\n }\n }\n }\n if (visualChanged) {\n for (const entry of this.entries.values()) {\n entry.bounds = undefined;\n entry.lastLighting = undefined;\n }\n this.ambient.invalidate();\n }\n if (!changed.size && !visualChanged) return;\n for (const entry of changed) this.updateSelected(entry);\n this.updateEmitter();\n });\n }\n\n public register(element: HTMLElement, hooks: SurfaceHooks): () => void {\n this.connect();\n const entry: Entry = { id: this.nextId++, element, hooks, visible: true };\n const overlay = lightingVisibility(this.doc, this.view).boundary(element) !== this.doc.documentElement;\n this.entries.set(element, entry);\n this.ambient.add(entry);\n this.observer?.observe(element);\n this.updateSelected(entry);\n this.updateEmitter();\n this.queue.add(entry);\n this.schedule();\n // New overlays can cover receivers which already have highlights. Re-evaluate those as well.\n if (overlay) this.refresh();\n return () => {\n this.observer?.unobserve(element);\n this.entries.delete(element);\n this.ambient.remove(entry);\n this.queue.delete(entry);\n this.selected.delete(entry);\n if (this.pressed === entry) this.pressed = undefined;\n if (this.hovered === entry || this.focused === entry || this.emitting.has(entry)) {\n if (this.hovered === entry) this.hovered = undefined;\n if (this.focused === entry) this.focused = undefined;\n this.updateEmitter();\n }\n if (overlay) this.refresh();\n this.disconnectIfEmpty();\n };\n }\n\n public refreshElement(element: HTMLElement): void {\n const entry = this.entries.get(element);\n if (entry) this.updateSelected(entry);\n this.updateEmitter();\n if (entry) {\n this.ambient.invalidate(entry, true);\n entry.bounds = undefined;\n entry.lastLighting = undefined;\n this.queue.add(entry);\n this.schedule();\n }\n }\n\n public scene(root: HTMLElement, options: GlassSceneOptions): GlassScene {\n this.connect();\n const entry = { id: this.nextId++, root, options };\n this.scenes.add(entry);\n this.refreshRoot(root);\n let disposed = false;\n return {\n update: (next) => {\n if (!disposed) {\n entry.options = next;\n this.refreshRoot(root, next.reuseGeometry !== true);\n }\n },\n refresh: () => {\n if (!disposed) {\n this.ambient.invalidate();\n this.refreshRoot(root);\n }\n },\n destroy: () => {\n if (disposed) return;\n disposed = true;\n this.scenes.delete(entry);\n this.refreshRoot(root);\n this.disconnectIfEmpty();\n }\n };\n }\n\n private refreshEntries(entries: Entry[]): void {\n this.ambient.invalidate(entries, true);\n for (const entry of entries) {\n entry.bounds = undefined;\n if (entry.visible) this.queue.add(entry);\n }\n this.schedule();\n }\n\n private isLightingDecoration(node: Node): boolean {\n if (node.nodeType !== node.ELEMENT_NODE) return true;\n const element = node as Element;\n return element.matches('.bx-glass-decoration, .bx-glass-rim') || !!element.closest('.bx-glass-decoration, .bx-glass-rim');\n }\n\n private find(event: Event): Entry | undefined {\n for (const node of event.composedPath()) {\n const found = this.entries.get(node as HTMLElement);\n if (!found) continue;\n if (found.element.closest(disabledSelector)) return undefined;\n // A decorative surface inside a button/link is still part of that action.\n if (found.hooks.interactive()) return found;\n }\n const target = event.target as Element;\n const label = target.closest('label');\n const visual = label?.control?.matches('input[type=\"checkbox\"], input[type=\"radio\"]') ? label.querySelector<HTMLElement>('[data-bx-surface]') : undefined;\n const found = visual ? this.entries.get(visual) : undefined;\n if (found && !found.element.closest(disabledSelector) && !label?.control?.matches(disabledSelector) && found.hooks.interactive()) return found;\n return undefined;\n }\n\n private scope(element: HTMLElement): HTMLElement {\n return lightingOrigin(element).closest<HTMLElement>(`${lightBoundarySelector}, main, aside, nav`) ?? this.doc.body;\n }\n\n private updateEmitter(): void {\n const next = new Map<Entry, string>();\n const enabled = (entry: Entry) =>\n entry.hooks.interactive() && !entry.element.closest(disabledSelector) && !entry.element.closest('label')?.control?.matches(disabledSelector);\n for (const entry of [...this.selected, this.hovered, this.pressed]) {\n const color = entry && enabled(entry) ? entry.hooks.emission?.() : undefined;\n if (entry && color) next.set(entry, color);\n }\n const focusColor = this.focused?.hooks.focusEmission?.() ?? (this.focusedTarget?.matches(':focus-visible') ? this.focused?.hooks.emission?.() : undefined);\n if (this.focused && enabled(this.focused) && focusColor) next.set(this.focused, focusColor);\n const previous = this.emitting;\n if (previous.size === next.size && [...next].every(([entry, color]) => previous.get(entry) === color)) return;\n for (const entry of previous.keys()) if (!next.has(entry)) entry.hooks.emit?.(false);\n this.emitting = next;\n for (const [entry, color] of next) entry.hooks.emit?.(true, color);\n const sources = [...new Set([...previous.keys(), ...next.keys()])];\n for (const entry of this.entries.values()) {\n if (!entry.visible) continue;\n const affected = sources.some((source) => this.scope(source.element) === this.scope(entry.element));\n // A panel may have finished its opening animation since its surfaces were registered.\n if (affected) {\n entry.bounds = undefined;\n entry.lastLighting = undefined;\n this.queue.add(entry);\n }\n }\n this.schedule();\n }\n\n private updateSelected(entry: Entry): void {\n const control = entry.element.closest('label')?.control;\n const checked = control?.matches('input[type=\"checkbox\"]:checked, input[type=\"radio\"]:checked');\n if (entry.hooks.emission?.() && (entry.element.matches(activeStateSelector) || checked)) this.selected.add(entry);\n else this.selected.delete(entry);\n }\n\n private refreshRoot(root: HTMLElement, measure = true): void {\n for (const entry of this.entries.values()) {\n if (!root.contains(lightingOrigin(entry.element))) continue;\n if (measure) {\n entry.bounds = undefined;\n entry.lastLighting = undefined;\n }\n if (entry.visible) this.queue.add(entry);\n }\n this.schedule();\n }\n\n private observeState(root: Node): void {\n this.stateObserver?.observe(root, {\n subtree: true,\n attributes: true,\n childList: true,\n attributeFilter: [\n 'aria-pressed',\n 'aria-checked',\n 'checked',\n 'aria-selected',\n 'aria-expanded',\n 'aria-current',\n 'disabled',\n 'aria-disabled',\n 'readonly',\n 'aria-readonly',\n 'aria-invalid',\n 'data-bx-field-invalid',\n 'class',\n 'style',\n 'hidden',\n 'role',\n 'data-bx-light-scope',\n 'data-bx-surface',\n 'data-bx-reduced-transparency',\n 'data-bx-reduced-motion',\n 'src',\n 'srcset',\n 'width',\n 'height'\n ]\n });\n }\n\n private connect(): void {\n if (this.connected) return;\n this.connected = true;\n this.observeState(this.doc.documentElement);\n this.doc.addEventListener('pointerdown', this.down, { passive: true });\n this.doc.addEventListener('pointerover', this.over, { passive: true });\n this.doc.addEventListener('pointerout', this.out, { passive: true });\n this.doc.addEventListener('focusin', this.focus);\n this.doc.addEventListener('focusout', this.unfocus);\n this.doc.addEventListener('change', this.change);\n this.view.addEventListener('pointerup', this.up, { passive: true });\n this.view.addEventListener('pointercancel', this.up, { passive: true });\n this.doc.addEventListener('pointerleave', this.leave, { passive: true });\n this.view.addEventListener('blur', this.blur);\n this.view.addEventListener('resize', this.refresh, { passive: true });\n this.doc.addEventListener('scroll', this.scroll, { passive: true, capture: true });\n this.doc.addEventListener('load', this.assetLoad, true);\n this.doc.addEventListener('loadeddata', this.assetLoad, true);\n this.doc.addEventListener('play', this.assetLoad, true);\n this.doc.addEventListener('pause', this.assetLoad, true);\n this.doc.addEventListener('seeked', this.assetLoad, true);\n this.doc.addEventListener('visibilitychange', this.visibilityChange);\n this.doc.addEventListener(configurationEvent, this.sync);\n this.motion.addEventListener('change', this.sync);\n this.transparency.addEventListener('change', this.sync);\n }\n\n private disconnectIfEmpty(): void {\n if (this.entries.size || this.scenes.size) return;\n this.ambient.destroy();\n this.stopFrame?.();\n this.stopFrame = undefined;\n this.queue.clear();\n this.observer?.disconnect();\n this.connected = false;\n this.stateObserver?.disconnect();\n this.selected.clear();\n this.doc.removeEventListener('pointerdown', this.down);\n this.doc.removeEventListener('pointerover', this.over);\n this.doc.removeEventListener('pointerout', this.out);\n this.doc.removeEventListener('focusin', this.focus);\n this.doc.removeEventListener('focusout', this.unfocus);\n this.doc.removeEventListener('change', this.change);\n this.view.removeEventListener('pointerup', this.up);\n this.view.removeEventListener('pointercancel', this.up);\n this.doc.removeEventListener('pointerleave', this.leave);\n this.view.removeEventListener('blur', this.blur);\n this.view.removeEventListener('resize', this.refresh);\n this.doc.removeEventListener('scroll', this.scroll, true);\n this.doc.removeEventListener('load', this.assetLoad, true);\n this.doc.removeEventListener('loadeddata', this.assetLoad, true);\n this.doc.removeEventListener('play', this.assetLoad, true);\n this.doc.removeEventListener('pause', this.assetLoad, true);\n this.doc.removeEventListener('seeked', this.assetLoad, true);\n this.doc.removeEventListener('visibilitychange', this.visibilityChange);\n this.doc.removeEventListener(configurationEvent, this.sync);\n this.motion.removeEventListener('change', this.sync);\n this.transparency.removeEventListener('change', this.sync);\n }\n\n private schedule(): void {\n if (this.stopFrame || !this.queue.size) return;\n this.stopFrame = subscribeFrame(() => {\n // Bound lighting work when hundreds of components become visible or a global setting changes.\n const batch = Array.from(this.queue).slice(0, 24);\n const visibility = lightingVisibility(this.doc, this.view);\n const emissions = [...this.emitting].map(([emitter, color]) => {\n const bounds = emitter.element.getBoundingClientRect();\n const exposed =\n visibility.exposed(emitter.element, bounds.x + bounds.width / 2, bounds.y + bounds.height / 2, bounds) && !emitter.element.closest(disabledSelector);\n return { emitter, color, exposed };\n });\n const activeLights = emissions\n .filter((source) => source.exposed)\n .map(({ emitter, color }) => ({\n emitter,\n light: this.lightPoint({ element: emitter.element, color, excludeSource: true, z: 24, intensity: 0.85, radius: 120 }, `hover:${emitter.id}`, true)\n }));\n const sceneData = new Map<SceneEntry, { lights: PointLight[]; reflections: Reflection[] }>();\n // Read only scenes used by this batch; avoid measuring offscreen or unrelated objects.\n const projections = batch\n .filter((entry) => {\n if (!entry.visible || !entry.element.isConnected || (entry.resuming && this.ambient.isPending(entry))) return false;\n const bounds = (entry.bounds ??= entry.element.getBoundingClientRect());\n const visible = bounds.bottom > 0 && bounds.right > 0 && bounds.top < this.view.innerHeight && bounds.left < this.view.innerWidth;\n if (!visible) entry.resuming = true;\n return visible;\n })\n .map((entry) => {\n entry.bounds ??= entry.element.getBoundingClientRect();\n const origin = lightingOrigin(entry.element) as HTMLElement;\n let nearest: SceneEntry | undefined;\n for (const candidate of this.scenes) if (candidate.root.contains(origin) && (!nearest || nearest.root.contains(candidate.root))) nearest = candidate;\n if (nearest && !sceneData.has(nearest)) {\n const scene = nearest;\n sceneData.set(scene, {\n lights: (scene.options.lights ?? []).slice(0, 4).map((light, index) => this.lightPoint(light, `${scene.id}:${index}`)),\n reflections: (scene.options.reflectors ?? []).slice(0, 4).map((reflection) => this.reflectionPoint(reflection))\n });\n }\n const data = nearest ? sceneData.get(nearest) : undefined;\n const sceneRoot = nearest?.root ?? entry.element;\n // Explicit scene lights and an active semantic element share the same spatial model.\n const boundary = visibility.boundary(entry.element);\n const lights = (data?.lights ?? []).filter((light) => visibility.boundary(light.source ?? sceneRoot) === boundary);\n for (const { emitter, light } of activeLights) {\n if (\n this.scope(emitter.element) === this.scope(entry.element) &&\n visibility.layer(lightingOrigin(emitter.element) as HTMLElement) === visibility.layer(origin) &&\n !emitter.element.contains(entry.element) &&\n (!entry.element.contains(emitter.element) || entry.element.matches('[role=\"menu\"], [role=\"tablist\"]'))\n )\n lights.push(light);\n }\n lights.push(...this.ambient.lights(entry));\n const reflections = (data?.reflections ?? []).filter((reflection) => visibility.boundary(reflection.source) === boundary);\n const lighting = this.project(entry, lights, reflections, visibility);\n lighting.immediate = entry.resuming || !entry.painted;\n entry.resuming = false;\n return [entry, lighting] as const;\n });\n for (const entry of batch) this.queue.delete(entry);\n for (const { emitter, color, exposed } of emissions) emitter.hooks.emit?.(exposed, color);\n for (const [entry, lighting] of projections) {\n if (this.sameLighting(entry.lastLighting, lighting)) continue;\n entry.lastLighting = lighting;\n entry.painted = true;\n const before = entry.element.getAttribute('style');\n entry.hooks.light(lighting);\n const after = entry.element.getAttribute('style');\n // Native receivers (e.g. the slider thumb) paint on their host, not a decoration child.\n if (before !== after) this.renderedStyles.set(entry.element, after);\n }\n if (!this.queue.size) this.stopFrame = undefined;\n return this.queue.size > 0;\n });\n }\n\n private sameLighting(previous: Lighting | undefined, next: Lighting): boolean {\n if (\n !previous ||\n previous.x !== next.x ||\n previous.y !== next.y ||\n previous.color !== next.color ||\n previous.strength !== next.strength ||\n previous.rim !== next.rim ||\n previous.reflection !== next.reflection ||\n previous.reflectionStrength !== next.reflectionStrength ||\n previous.reflectionX !== next.reflectionX ||\n previous.reflectionY !== next.reflectionY ||\n previous.contributions.length !== next.contributions.length\n )\n return false;\n return previous.contributions.every((light, index) => {\n const other = next.contributions[index];\n return (\n light.key === other.key &&\n light.x === other.x &&\n light.y === other.y &&\n light.color === other.color &&\n light.strength === other.strength &&\n light.edgeStrength === other.edgeStrength &&\n light.ambient === other.ambient &&\n light.spread === other.spread\n );\n });\n }\n\n private lightPoint(light: GlassLight, key: string, border = false): PointLight {\n const rect = light.element?.getBoundingClientRect();\n if (light.element && !border) {\n if (!this.lightIds.has(light.element)) this.lightIds.set(light.element, this.nextId++);\n key = `scene:${this.lightIds.get(light.element)}`;\n }\n return {\n key,\n bounds: rect && light.edge === 'bottom' ? new DOMRect(rect.left, rect.bottom, rect.width, 0) : border ? rect : undefined,\n source: light.element,\n excludeSource: light.excludeSource,\n excludeElement: light.excludeElement,\n x: rect ? rect.left + rect.width * finiteClamp(light.offsetX, 0, 1, 0.5) : finiteClamp(light.x, -1e6, 1e6, this.view.innerWidth * 0.25),\n y: rect ? rect.top + rect.height * finiteClamp(light.offsetY, 0, 1, 0.5) : finiteClamp(light.y, -1e6, 1e6, 0),\n z: finiteClamp(light.z, 1, 4000, 180),\n color: light.color ?? 'var(--bx-text-inverse, Canvas)',\n intensity: finiteClamp(light.intensity, 0, 4, 1),\n radius: finiteClamp(light.radius, 1, 4000, 640)\n };\n }\n\n private reflectionPoint(reflector: GlassReflector): Reflection {\n const rect = reflector.element.getBoundingClientRect();\n return {\n source: reflector.element,\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n depth: finiteClamp(reflector.depth, -2000, 2000, 80),\n color: reflector.color ?? this.view.getComputedStyle(reflector.element).backgroundColor,\n intensity: finiteClamp(reflector.intensity, 0, 1, 0.28),\n radius: Math.max(rect.width, rect.height, 160)\n };\n }\n\n private project(entry: Entry, lights: PointLight[], reflectors: Reflection[], visibility: ReturnType<typeof lightingVisibility>): Lighting {\n const b = (entry.bounds ??= entry.element.getBoundingClientRect());\n const cx = b.left + b.width / 2,\n cy = b.top + b.height / 2;\n let x = 25,\n y = 0,\n strength = 0.04,\n color = 'white';\n let strongest = 0,\n weightedX = 0,\n weightedY = 0,\n totalWeight = 0;\n const rims: string[] = [];\n const contributions: LightContribution[] = [];\n for (const light of lights) {\n if ((light.excludeSource && light.source === entry.element) || light.excludeElement === entry.element) continue;\n // Semantic borders emit from their closest edge, so large buttons still have a short reach.\n const lx = light.bounds ? Math.max(light.bounds.left, Math.min(cx, light.bounds.right)) : light.x;\n const ly = light.bounds ? Math.max(light.bounds.top, Math.min(cy, light.bounds.bottom)) : light.y;\n const dx = lx - cx,\n dy = ly - cy;\n const distance = Math.hypot(dx, dy, light.z);\n const weight = light.intensity * Math.pow(Math.max(0, 1 - distance / light.radius), 2) * (light.z / distance);\n // Project actual viewport coordinates into this surface, without a perspective speed-up.\n const localX = Math.max(0, Math.min(100, ((lx - b.left) / Math.max(1, b.width)) * 100));\n const localY = Math.max(0, Math.min(100, ((ly - b.top) / Math.max(1, b.height)) * 100));\n const edgeDistance = Math.hypot(Math.max(b.left - lx, 0, lx - b.right), Math.max(b.top - ly, 0, ly - b.bottom), light.z);\n const edgeWeight = Math.min(0.85, light.intensity * Math.pow(Math.max(0, 1 - edgeDistance / light.radius), 2));\n if (edgeWeight <= 0.01 && weight <= 0.001) continue;\n if (!light.ambient && !visibility.exposed(entry.hooks.hitTarget ?? entry.element, lx, ly, b)) continue;\n if (!light.ambient && light.source) {\n const source = light.source.closest<HTMLElement>('[data-bx-surface]') ?? light.source;\n if (!visibility.exposed(source, lx, ly, source.getBoundingClientRect())) continue;\n }\n if (edgeWeight > 0.01)\n rims.push(\n `radial-gradient(${light.spread ? `circle ${light.spread}px` : 'ellipse farthest-side'} at ${localX.toFixed(2)}% ${localY.toFixed(2)}%, color-mix(in srgb, ${light.color} ${(edgeWeight * 100).toFixed(2)}%, transparent), transparent 75%)`\n );\n if (edgeWeight > 0.01 || weight > 0.001)\n contributions.push({\n key: light.key,\n x: localX,\n y: localY,\n color: light.color,\n strength: light.ambient ? 0 : Math.min(0.25, weight * 0.4),\n edgeStrength: edgeWeight,\n ambient: light.ambient,\n spread: light.spread\n });\n if (!light.ambient) {\n weightedX += localX * weight;\n weightedY += localY * weight;\n totalWeight += weight;\n if (weight > strongest) {\n strongest = weight;\n color = light.color;\n }\n }\n }\n if (totalWeight > 0.001) {\n x = weightedX / totalWeight;\n y = weightedY / totalWeight;\n strength = Math.min(0.4, 0.04 + totalWeight * 0.4);\n }\n let reflectionStrength = 0,\n reflection = 'transparent',\n reflectionX = 50,\n reflectionY = 50;\n for (const reflector of reflectors) {\n if (!visibility.exposed(entry.hooks.hitTarget ?? entry.element, reflector.x, reflector.y, b)) continue;\n const distance = Math.hypot(reflector.x - cx, reflector.y - cy, reflector.depth);\n const weight = reflector.intensity * Math.max(0, 1 - distance / (reflector.radius * 2));\n if (weight > reflectionStrength) {\n reflectionStrength = weight;\n reflection = reflector.color;\n // Signed depth gives background and foreground proxies opposite parallax around the surface normal.\n const direction = reflector.depth < 0 ? 1 : -1;\n const perspective = Math.max(80, Math.abs(reflector.depth) + reflector.radius * 0.5);\n reflectionX = Math.max(0, Math.min(100, 50 + ((reflector.x - cx) / perspective) * 45 * direction));\n reflectionY = Math.max(0, Math.min(100, 50 + ((reflector.y - cy) / perspective) * 45 * direction));\n }\n }\n return { x, y, strength, color, rim: rims.join(', ') || 'none', contributions, reflection, reflectionStrength, reflectionX, reflectionY };\n }\n}\n","/** A scalar spring whose target can change without resetting its velocity. */\nexport interface SpringOptions {\n stiffness?: number;\n damping?: number;\n mass?: number;\n}\n\nexport class Spring {\n private readonly stiffness: number;\n private readonly damping: number;\n private readonly mass: number;\n public value: number;\n\n public velocity = 0;\n\n public target: number;\n\n constructor(value = 0, options: SpringOptions = {}) {\n if (!Number.isFinite(value)) throw new RangeError('Spring value must be finite.');\n this.value = this.target = value;\n this.stiffness = options.stiffness ?? 380;\n this.damping = options.damping ?? 32;\n this.mass = options.mass ?? 1;\n if (\n !Number.isFinite(this.stiffness) ||\n this.stiffness <= 0 ||\n !Number.isFinite(this.damping) ||\n this.damping < 0 ||\n !Number.isFinite(this.mass) ||\n this.mass <= 0\n ) {\n throw new RangeError('Spring stiffness and mass must be positive; damping must be nonnegative.');\n }\n }\n\n /** Advances the exact damped harmonic solution. Returns true while moving. */\n public step(deltaSeconds: number): boolean {\n if (!Number.isFinite(this.target)) throw new RangeError('Spring target must be finite.');\n if (!Number.isFinite(deltaSeconds) || deltaSeconds < 0) {\n throw new RangeError('Spring delta must be finite and nonnegative.');\n }\n const displacement = this.value - this.target;\n if (Math.abs(displacement) < 0.001 && Math.abs(this.velocity) < 0.001) {\n this.snap(this.target);\n return false;\n }\n if (deltaSeconds === 0) return true;\n\n const decay = this.damping / (2 * this.mass);\n const frequencySquared = this.stiffness / this.mass;\n const discriminant = decay * decay - frequencySquared;\n const velocity = this.velocity;\n const time = deltaSeconds;\n let nextDisplacement: number;\n let nextVelocity: number;\n\n if (Math.abs(discriminant) < 0.000001 * frequencySquared) {\n const coefficient = velocity + decay * displacement;\n const exponential = Math.exp(-decay * time);\n nextDisplacement = exponential * (displacement + coefficient * time);\n nextVelocity = exponential * (velocity - decay * coefficient * time);\n } else if (discriminant < 0) {\n const frequency = Math.sqrt(-discriminant);\n const coefficient = (velocity + decay * displacement) / frequency;\n const exponential = Math.exp(-decay * time);\n const cosine = Math.cos(frequency * time);\n const sine = Math.sin(frequency * time);\n nextDisplacement = exponential * (displacement * cosine + coefficient * sine);\n nextVelocity = exponential * ((coefficient * frequency - decay * displacement) * cosine - (displacement * frequency + decay * coefficient) * sine);\n } else {\n const root = Math.sqrt(discriminant);\n const firstRoot = -decay + root;\n const secondRoot = -decay - root;\n const first = (velocity - secondRoot * displacement) / (firstRoot - secondRoot);\n const second = displacement - first;\n const firstTerm = first * Math.exp(firstRoot * time);\n const secondTerm = second * Math.exp(secondRoot * time);\n nextDisplacement = firstTerm + secondTerm;\n nextVelocity = firstRoot * firstTerm + secondRoot * secondTerm;\n }\n this.value = this.target + nextDisplacement;\n this.velocity = nextVelocity;\n if (Math.abs(nextDisplacement) < 0.001 && Math.abs(nextVelocity) < 0.001) {\n this.snap(this.target);\n return false;\n }\n return true;\n }\n\n public snap(value: number): void {\n if (!Number.isFinite(value)) throw new RangeError('Spring value must be finite.');\n this.value = this.target = value;\n this.velocity = 0;\n }\n}\n","import { rememberAttributes, rememberStyles, finiteClamp } from './dom';\nimport { isSurfaceInteractionBlocked } from './helpers/surface-interaction.helpers';\nimport { inheritedAttribute } from './configuration';\nimport { registerSurface, refreshGlassLighting } from './scene';\nimport type { Lighting, LightContribution } from './scene';\nimport { subscribeFrame } from './scheduler';\nimport { Spring } from './spring';\nimport type { GlassSurface, SurfaceOptions } from './types';\n\nconst mounted = new WeakMap<HTMLElement, GlassSurface>();\n\n/** Structural surfaces receive light; controls and actionable surfaces also emit it. */\nfunction isActionSurface(element: HTMLElement): boolean {\n if (\n element.matches(\n 'button, bx-button, [bx-button], a[href], summary, input:not([type=\"hidden\"]), select, textarea, [role=\"button\"], [role=\"link\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"switch\"], [role=\"tab\"], [role=\"menuitem\"], [role=\"combobox\"], [role=\"textbox\"], [role=\"searchbox\"], [role=\"slider\"], [role=\"spinbutton\"], [onclick]'\n ) ||\n typeof element.onclick === 'function'\n )\n return true;\n\n if (element.closest('label')?.control) return true;\n if (!element.closest('bx-form-field')) return false;\n const controls = element.querySelectorAll('input:not([type=\"hidden\"]), select, textarea');\n return controls.length === 1 && controls[0].closest('[data-bx-surface]') === element;\n}\n\n/** Enhance a native DOM element. Omitted options inherit configureAppearance() and Blocks theme tokens. */\nexport function mountSurface(element: HTMLElement, initial: SurfaceOptions = {}): GlassSurface {\n if (mounted.has(element)) throw new Error('A glass surface is already mounted on this element.');\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n if (!view) throw new Error('Glass surfaces must be mounted in a browser document.');\n const ownProperties = [\n 'position',\n '--bx-glassiness',\n '--bx-glass-lit-edge',\n '--bx-glass-lit-edge-top',\n '--bx-glass-lit-edge-right',\n '--bx-glass-lit-edge-bottom',\n '--bx-glass-lit-edge-left'\n ];\n const restoreStyles = rememberStyles(element, ownProperties);\n const attributes = ['data-bx-surface', 'data-bx-reduced-transparency', 'data-bx-reduced-motion', 'data-bx-glass-renderer'];\n const originalAttributes = new Map(attributes.map((name) => [name, element.getAttribute(name)]));\n const restoreAttributes = rememberAttributes(element, attributes);\n const originals = new Map(\n ownProperties.map((property) => [\n property,\n {\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property)\n }\n ])\n );\n\n const decoration = doc.createElement('span');\n decoration.className = 'bx-glass-decoration';\n decoration.setAttribute('aria-hidden', 'true');\n\n const light = doc.createElement('span');\n light.className = 'bx-glass-light';\n\n const rim = doc.createElement('span');\n rim.className = 'bx-glass-rim';\n rim.setAttribute('aria-hidden', 'true');\n element.append(rim);\n\n const environment = doc.createElement('span');\n environment.className = 'bx-glass-contribution bx-glass-environment';\n rim.append(environment);\n let environmentImage = 'none';\n const environmentLayers = new Map<number, string>();\n const environmentColors = new Map<number, string>();\n\n const ambient = doc.createElement('span');\n ambient.className = 'bx-glass-ambient';\n decoration.append(light);\n element.append(decoration);\n decoration.append(ambient);\n\n const motion = view.matchMedia('(prefers-reduced-motion: reduce)');\n const transparency = view.matchMedia('(prefers-reduced-transparency: reduce)');\n\n let options = { ...initial };\n let disposed = false;\n let unsubscribe: (() => void) | undefined;\n let reducedMotion = false;\n let unifiedLighting = false;\n\n const interactive = () => (options.interactive ?? isActionSurface(element)) && !isSurfaceInteractionBlocked(element);\n let emitting = false;\n let emittingColor: string | undefined;\n\n type Layer = { edge: HTMLElement; glow: HTMLElement; animations: Animation[]; leaving: boolean };\n\n const layers = new Map<string, Layer>();\n\n const removeLayer = (key: string, layer: Layer) => {\n layer.animations.forEach((animation) => animation.cancel());\n layer.edge.remove();\n layer.glow.remove();\n layers.delete(key);\n };\n\n const fadeLayer = (key: string, layer: Layer, visible: boolean) => {\n const opacity = view.getComputedStyle(layer.edge).opacity;\n layer.animations.forEach((animation) => animation.cancel());\n layer.leaving = !visible;\n for (const node of [layer.edge, layer.glow]) node.style.opacity = visible ? '1' : '0';\n if (reducedMotion) {\n if (!visible) removeLayer(key, layer);\n return;\n }\n layer.animations = [layer.edge, layer.glow].map((node) => node.animate([{ opacity }, { opacity: visible ? 1 : 0 }], { duration: 200, easing: 'ease-out' }));\n void Promise.all(layer.animations.map((animation) => animation.finished))\n .then(() => {\n if (layer.leaving && layers.get(key) === layer) removeLayer(key, layer);\n })\n .catch(() => {\n /* Interrupted fades continue from their rendered opacity. */\n });\n };\n\n const setLayer = (value: LightContribution, source = false) => {\n let layer = layers.get(value.key);\n const fresh = !layer;\n if (!layer) {\n const edge = doc.createElement('span'),\n glow = doc.createElement('span');\n edge.className = glow.className = 'bx-glass-contribution';\n edge.dataset['bxLightSource'] = glow.dataset['bxLightSource'] = value.key;\n edge.style.opacity = glow.style.opacity = '0';\n rim.append(edge);\n ambient.append(glow);\n layer = { edge, glow, animations: [], leaving: false };\n layers.set(value.key, layer);\n }\n const at = `${value.x.toFixed(2)}% ${value.y.toFixed(2)}%`;\n\n const edgeColor = `color-mix(in srgb, ${value.color} ${(value.edgeStrength * 100).toFixed(2)}%, transparent)`;\n layer.edge.style.backgroundImage = source\n ? `linear-gradient(${edgeColor}, ${edgeColor})`\n : `radial-gradient(ellipse farthest-side at ${at}, ${edgeColor}, transparent 75%)`;\n layer.glow.style.backgroundImage = `radial-gradient(ellipse at ${at}, color-mix(in srgb, ${value.color} ${(value.strength * 100).toFixed(2)}%, transparent), transparent 68%)`;\n if (fresh || layer.leaving) fadeLayer(value.key, layer, true);\n if (layers.size > 8)\n for (const [key, old] of layers) {\n if (old.leaving) removeLayer(key, old);\n if (layers.size <= 8) break;\n }\n };\n\n const emissionColor = () =>\n options.emission ??\n options.focusEmission ??\n (element.closest('[data-bx-field-invalid=\"true\"]') || element.matches('[aria-invalid=\"true\"]') ? 'var(--bx-text-danger)' : 'var(--bx-primary)');\n\n const emit = (active: boolean, color = emissionColor()) => {\n emitting = active;\n emittingColor = color;\n if (active && color) setLayer({ key: 'emitter', color, x: 50, y: 50, strength: 0, edgeStrength: 0.8 }, true);\n else {\n const layer = layers.get('emitter');\n if (layer && !layer.leaving) fadeLayer('emitter', layer, false);\n }\n };\n\n const x = new Spring(25, { stiffness: 300, damping: 30 });\n const y = new Spring(0, { stiffness: 300, damping: 30 });\n const strength = new Spring(0.04, { stiffness: 300, damping: 30 });\n const pressure = new Spring(0, { stiffness: 440, damping: 25 });\n const globalValue = (name: string) => inheritedAttribute(element.parentElement ?? element, name);\n\n const paint = () => {\n decoration.style.setProperty('--bx-glass-light-x', `${x.value.toFixed(2)}%`);\n decoration.style.setProperty('--bx-glass-light-y', `${y.value.toFixed(2)}%`);\n decoration.style.setProperty('--bx-glass-light-strength', strength.value.toFixed(3));\n decoration.style.setProperty('--bx-glass-press', pressure.value.toFixed(4));\n };\n\n const animate = () => {\n if (disposed || unsubscribe) return;\n if (reducedMotion || typeof requestAnimationFrame !== 'function') {\n x.snap(x.target);\n y.snap(y.target);\n strength.snap(strength.target);\n pressure.snap(0);\n paint();\n return;\n }\n unsubscribe = subscribeFrame((dt) => {\n if (disposed) return false;\n const moving = [x.step(dt), y.step(dt), strength.step(dt), pressure.step(dt)].some(Boolean);\n paint();\n if (!moving) unsubscribe = undefined;\n return moving;\n });\n };\n\n const lighting = (value: Lighting) => {\n x.snap(value.x);\n y.snap(value.y);\n strength.target = value.strength;\n\n if (unifiedLighting) {\n const sources = [...value.contributions].sort((a, b) => a.edgeStrength - b.edgeStrength).slice(-4);\n // Sample the same localized falloff used by the rim, rather than tinting\n // the entire silhouette. Small attached shapes can share a facing edge.\n const edgeAt = (x: number, y: number) => {\n let edge = 'var(--bx-border-default, GrayText)';\n for (const source of sources) {\n const distance = Math.hypot((x - source.x) / Math.max(1, source.x, 100 - source.x), (y - source.y) / Math.max(1, source.y, 100 - source.y));\n const strength = finiteClamp(source.edgeStrength, 0, 0.85, 0) * 0.35 * Math.max(0, 1 - distance / 0.75);\n if (strength > 0.001) edge = `color-mix(in srgb, ${source.color} ${(strength * 100).toFixed(2)}%, ${edge})`;\n }\n return edge;\n };\n element.style.setProperty('--bx-glass-lit-edge', edgeAt(50, 50));\n element.style.setProperty('--bx-glass-lit-edge-top', edgeAt(50, 0));\n element.style.setProperty('--bx-glass-lit-edge-right', edgeAt(100, 50));\n element.style.setProperty('--bx-glass-lit-edge-bottom', edgeAt(50, 100));\n element.style.setProperty('--bx-glass-lit-edge-left', edgeAt(0, 50));\n }\n\n const activeEnvironment = new Set<number>();\n for (const contribution of value.contributions) {\n if (!contribution.ambient) continue;\n const slot = Number(contribution.key.split(':').pop());\n if (!Number.isInteger(slot) || slot < 0 || slot >= 16) continue;\n activeEnvironment.add(slot);\n const property = `--bx-glass-environment-color-${slot}`;\n const color = `color-mix(in srgb, ${contribution.color} ${(contribution.edgeStrength * 100).toFixed(2)}%, transparent)`;\n if (environmentColors.get(slot) !== color) {\n environment.style.setProperty(property, color);\n environmentColors.set(slot, color);\n }\n environmentLayers.set(\n slot,\n `radial-gradient(circle ${contribution.spread}px at ${contribution.x.toFixed(2)}% ${contribution.y.toFixed(2)}%, var(${property}), transparent 75%)`\n );\n }\n for (const slot of environmentColors.keys()) {\n if (!activeEnvironment.has(slot) && environmentColors.get(slot) !== 'transparent') {\n environment.style.setProperty(`--bx-glass-environment-color-${slot}`, 'transparent');\n environmentColors.set(slot, 'transparent');\n }\n }\n const ambientImage = [...environmentLayers.values()].join(', ') || 'none';\n\n if (ambientImage !== environmentImage) {\n environmentImage = ambientImage;\n environment.style.backgroundImage = ambientImage;\n }\n // Finish only environmental transitions when an already-lit element returns.\n // During motion, typed colors retarget continuously from their rendered value.\n if (value.immediate || reducedMotion) for (const animation of environment.getAnimations()) animation.finish();\n\n const contributions = value.contributions.filter((contribution) => !contribution.ambient);\n const active = new Set(contributions.map((contribution) => contribution.key));\n\n for (const contribution of contributions) setLayer(contribution);\n for (const [key, layer] of layers) if (key !== 'emitter' && !active.has(key) && !layer.leaving) fadeLayer(key, layer, false);\n decoration.style.setProperty('--bx-glass-light-color', value.color);\n decoration.style.setProperty('--bx-glass-reflection-color', value.reflection);\n decoration.style.setProperty('--bx-glass-reflection-strength', String(value.reflectionStrength));\n decoration.style.setProperty('--bx-glass-reflection-x', `${value.reflectionX.toFixed(2)}%`);\n decoration.style.setProperty('--bx-glass-reflection-y', `${value.reflectionY.toFixed(2)}%`);\n animate();\n };\n const sync = () => {\n element.setAttribute('data-bx-surface', 'glass');\n const inheritedMotion = globalValue('data-bx-reduced-motion') ?? originalAttributes.get('data-bx-reduced-motion');\n const inheritedTransparency = globalValue('data-bx-reduced-transparency') ?? originalAttributes.get('data-bx-reduced-transparency');\n reducedMotion = options.reducedMotion ?? (inheritedMotion === null || inheritedMotion === undefined ? motion.matches : inheritedMotion === 'true');\n const reducedTransparency = options.reducedTransparency ?? (inheritedTransparency === 'true' || transparency.matches);\n element.setAttribute('data-bx-reduced-transparency', String(reducedTransparency));\n element.setAttribute('data-bx-reduced-motion', String(reducedMotion));\n const quality = inheritedAttribute(element, 'data-bx-glass-quality') ?? 'auto';\n const supported =\n typeof CSS !== 'undefined' &&\n CSS.supports('background', 'color-mix(in srgb, white, black)') &&\n (CSS.supports('backdrop-filter', 'blur(1px)') || CSS.supports('-webkit-backdrop-filter', 'blur(1px)'));\n const connection = (view.navigator as Navigator & { connection?: { saveData?: boolean } }).connection;\n const economical =\n connection?.saveData ||\n (view.navigator.hardwareConcurrency > 0 && view.navigator.hardwareConcurrency <= 4) ||\n view.matchMedia('(pointer: coarse)').matches;\n const enhanced = quality !== 'baseline' && supported && (quality === 'enhanced' || !economical);\n element.setAttribute('data-bx-glass-renderer', enhanced ? 'enhanced' : 'baseline');\n if (options.glassiness !== undefined) element.style.setProperty('--bx-glassiness', String(finiteClamp(options.glassiness, 0, 1, 0.5)));\n else restoreProperty('--bx-glassiness');\n\n // Absolutely positioned children use the padding box. Extend only across the\n // host's real border so their inherited outer radius describes the same curve.\n // Borderless and one-sided surfaces must never grow beyond their border box.\n const style = view.getComputedStyle(element);\n unifiedLighting = style.getPropertyValue('--bx-glass-unified-lighting').trim() === '1';\n\n for (const side of ['top', 'right', 'bottom', 'left']) {\n const width = style.getPropertyValue(`border-${side}-width`);\n const inset = `${-parseFloat(width || '0')}px`;\n for (const layer of [decoration, rim]) {\n if (layer.style.getPropertyValue(side) !== inset) layer.style.setProperty(side, inset);\n }\n }\n if (reducedMotion || !interactive()) {\n unsubscribe?.();\n unsubscribe = undefined;\n x.snap(x.target);\n y.snap(y.target);\n strength.snap(strength.target);\n pressure.snap(0);\n paint();\n }\n if (reducedMotion)\n for (const [key, layer] of layers) {\n if (layer.leaving) removeLayer(key, layer);\n else layer.animations.forEach((animation) => animation.cancel());\n }\n if (emitting) emit(true, emittingColor);\n };\n function restoreProperty(property: string): void {\n const original = originals.get(property);\n if (original?.value) element.style.setProperty(property, original.value, original.priority);\n else element.style.removeProperty(property);\n }\n sync();\n // Apply the material before the first style read to avoid transitioning from legacy colors.\n if (view.getComputedStyle(element).position === 'static') element.style.position = 'relative';\n const unregister = registerSurface(element, {\n light: lighting,\n sync,\n interactive,\n emission: emissionColor,\n focusEmission: () => options.focusEmission ?? emissionColor(),\n emit,\n press() {\n if (interactive() && !reducedMotion) {\n pressure.target = 1;\n animate();\n }\n },\n release() {\n pressure.target = 0;\n animate();\n }\n });\n const controller: GlassSurface = {\n update(next) {\n if (!disposed) {\n options = { ...next };\n sync();\n refreshGlassLighting(element);\n }\n },\n destroy() {\n if (disposed) return;\n disposed = true;\n unsubscribe?.();\n unregister();\n decoration.remove();\n rim.remove();\n for (const [key, layer] of layers) removeLayer(key, layer);\n restoreStyles();\n restoreAttributes();\n mounted.delete(element);\n }\n };\n mounted.set(element, controller);\n return controller;\n}\n","import { rememberStyles } from './dom';\nimport { configurationEvent, inheritedAttribute } from './configuration';\nimport { subscribeFrame } from './scheduler';\nimport type { GlassTransition, GlassTransitionOptions, MotionResult } from './types';\n\n/** Fade a positioned overlay without changing the geometry of its content. */\nexport function createGlassTransition(origin: HTMLElement, target: HTMLElement, options: GlassTransitionOptions = {}): GlassTransition {\n const doc = target.ownerDocument;\n const view = doc.defaultView;\n if (!view) throw new Error('Glass transitions must be mounted in a browser document.');\n if (origin.ownerDocument !== doc) throw new Error('Glass transition endpoints must share a document.');\n const skin = target.matches('[data-bx-surface]') ? target : (target.querySelector<HTMLElement>('[data-bx-surface]') ?? target);\n const restoreVisibility = rememberStyles(target, ['visibility']);\n const opacity = Number(view.getComputedStyle(skin).opacity);\n const readOpacity = () => Number(view.getComputedStyle(skin).opacity);\n const preference = view.matchMedia('(prefers-reduced-motion: reduce)');\n let disposed = false;\n let active = false;\n let value = 0;\n let destination = 0;\n let animation: Animation | undefined;\n let unsubscribe: (() => void) | undefined;\n let resolvePending: ((result: MotionResult) => void) | undefined;\n const reduced = () => {\n const inherited = inheritedAttribute(origin, 'data-bx-reduced-motion');\n return options.reducedMotion ?? (inherited === null ? preference.matches : inherited === 'true');\n };\n function settle(): void {\n active = false;\n value = destination;\n unsubscribe?.();\n unsubscribe = undefined;\n animation?.cancel();\n animation = undefined;\n restoreVisibility();\n if (destination === 0) target.style.visibility = 'hidden';\n const resolve = resolvePending;\n resolvePending = undefined;\n resolve?.('finished');\n }\n function move(open: boolean): Promise<MotionResult> {\n if (disposed) return Promise.resolve('cancelled');\n // Read the interpolated value only when reversing an in-flight fade.\n const from = animation && opacity > 0 ? readOpacity() / opacity : value;\n resolvePending?.('cancelled');\n animation?.cancel();\n animation = undefined;\n unsubscribe?.();\n unsubscribe = undefined;\n destination = open ? 1 : 0;\n active = true;\n restoreVisibility();\n const finished = new Promise<MotionResult>((resolve) => {\n resolvePending = resolve;\n });\n if (reduced() || from === destination) settle();\n else {\n // Animate the surface itself to preserve backdrop-root behavior. Native\n // animation avoids style mutations that invalidate scene lighting each frame.\n const current = skin.animate([{ opacity: from * opacity }, { opacity: destination * opacity }], {\n duration: (open ? 180 : 140) * Math.abs(destination - from),\n easing: 'ease-in-out',\n fill: 'both'\n });\n animation = current;\n void current.finished\n .then(() => {\n if (animation === current && !disposed) settle();\n })\n .catch(() => {\n /* Reversing or destroying a fade cancels its animation. */\n });\n if (options.onUpdate)\n unsubscribe = subscribeFrame(() => {\n options.onUpdate?.();\n return active && !disposed;\n });\n }\n return finished;\n }\n const onPreference = () => {\n if (active && reduced()) settle();\n };\n preference.addEventListener('change', onPreference);\n doc.addEventListener(configurationEvent, onPreference);\n return {\n enter: () => move(true),\n exit: () => move(false),\n refresh() {},\n destroy() {\n if (disposed) return;\n disposed = true;\n active = false;\n unsubscribe?.();\n unsubscribe = undefined;\n resolvePending?.('cancelled');\n resolvePending = undefined;\n preference.removeEventListener('change', onPreference);\n doc.removeEventListener(configurationEvent, onPreference);\n animation?.cancel();\n animation = undefined;\n restoreVisibility();\n }\n };\n}\n\n/** @deprecated Use createGlassTransition. */\nexport const createLiquidTransition = createGlassTransition;\n"],"mappings":"AACA,SAA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