ngwr 15.2.0 → 15.4.0

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.
Files changed (127) hide show
  1. package/alert/styles/_index.scss +13 -5
  2. package/bits/border-glow/styles/_rules.scss +60 -49
  3. package/bits/click-spark/click-spark.scss +5 -1
  4. package/bits/click-spark/styles/_index.scss +10 -15
  5. package/bits/click-spark/styles/_rules.scss +20 -0
  6. package/fesm2022/ngwr-alert.mjs +2 -2
  7. package/fesm2022/ngwr-alert.mjs.map +1 -1
  8. package/fesm2022/ngwr-bits-aurora.mjs +108 -52
  9. package/fesm2022/ngwr-bits-aurora.mjs.map +1 -1
  10. package/fesm2022/ngwr-bits-border-glow-testing.mjs +8 -8
  11. package/fesm2022/ngwr-bits-border-glow-testing.mjs.map +1 -1
  12. package/fesm2022/ngwr-bits-border-glow.mjs +29 -26
  13. package/fesm2022/ngwr-bits-border-glow.mjs.map +1 -1
  14. package/fesm2022/ngwr-bits-dot-grid.mjs +11 -14
  15. package/fesm2022/ngwr-bits-dot-grid.mjs.map +1 -1
  16. package/fesm2022/ngwr-bits-fuzzy-text.mjs +18 -4
  17. package/fesm2022/ngwr-bits-fuzzy-text.mjs.map +1 -1
  18. package/fesm2022/ngwr-bits-ripple-grid.mjs +14 -13
  19. package/fesm2022/ngwr-bits-ripple-grid.mjs.map +1 -1
  20. package/fesm2022/ngwr-bits-splash-cursor.mjs +21 -10
  21. package/fesm2022/ngwr-bits-splash-cursor.mjs.map +1 -1
  22. package/fesm2022/ngwr-bits-waves.mjs +10 -15
  23. package/fesm2022/ngwr-bits-waves.mjs.map +1 -1
  24. package/fesm2022/ngwr-breadcrumbs.mjs +18 -2
  25. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  26. package/fesm2022/ngwr-hotkey.mjs +23 -1
  27. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  28. package/fesm2022/ngwr-i18n-ar.mjs +2 -0
  29. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  30. package/fesm2022/ngwr-i18n-cs.mjs +2 -0
  31. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  32. package/fesm2022/ngwr-i18n-de.mjs +2 -0
  33. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  34. package/fesm2022/ngwr-i18n-en.mjs +2 -0
  35. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  36. package/fesm2022/ngwr-i18n-es.mjs +2 -0
  37. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  38. package/fesm2022/ngwr-i18n-fr.mjs +2 -0
  39. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  40. package/fesm2022/ngwr-i18n-he.mjs +2 -0
  41. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  42. package/fesm2022/ngwr-i18n-hi.mjs +2 -0
  43. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  44. package/fesm2022/ngwr-i18n-id.mjs +2 -0
  45. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  46. package/fesm2022/ngwr-i18n-it.mjs +2 -0
  47. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  48. package/fesm2022/ngwr-i18n-ja.mjs +2 -0
  49. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  50. package/fesm2022/ngwr-i18n-ko.mjs +2 -0
  51. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  52. package/fesm2022/ngwr-i18n-nl.mjs +2 -0
  53. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  54. package/fesm2022/ngwr-i18n-pl.mjs +2 -0
  55. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  56. package/fesm2022/ngwr-i18n-pt.mjs +2 -0
  57. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  58. package/fesm2022/ngwr-i18n-ru.mjs +2 -0
  59. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  60. package/fesm2022/ngwr-i18n-sv.mjs +2 -0
  61. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  62. package/fesm2022/ngwr-i18n-tr.mjs +2 -0
  63. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  64. package/fesm2022/ngwr-i18n-uk.mjs +2 -0
  65. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  66. package/fesm2022/ngwr-i18n-vi.mjs +2 -0
  67. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  68. package/fesm2022/ngwr-i18n-zh-tw.mjs +2 -0
  69. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  70. package/fesm2022/ngwr-i18n-zh.mjs +2 -0
  71. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  72. package/fesm2022/ngwr-pagination.mjs +3 -0
  73. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  74. package/fesm2022/ngwr-pipes.mjs +163 -49
  75. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  76. package/fesm2022/ngwr-schema-form.mjs +3 -0
  77. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  78. package/fesm2022/ngwr-select-testing.mjs +16 -0
  79. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-select.mjs +218 -38
  81. package/fesm2022/ngwr-select.mjs.map +1 -1
  82. package/fesm2022/ngwr-statistic.mjs +20 -21
  83. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  84. package/fesm2022/ngwr-version.mjs +1 -1
  85. package/fesm2022/ngwr-version.mjs.map +1 -1
  86. package/i18n/ar.json +2 -0
  87. package/i18n/cs.json +2 -0
  88. package/i18n/de.json +2 -0
  89. package/i18n/en.json +2 -0
  90. package/i18n/es.json +2 -0
  91. package/i18n/fr.json +2 -0
  92. package/i18n/he.json +2 -0
  93. package/i18n/hi.json +2 -0
  94. package/i18n/id.json +2 -0
  95. package/i18n/it.json +2 -0
  96. package/i18n/ja.json +2 -0
  97. package/i18n/ko.json +2 -0
  98. package/i18n/nl.json +2 -0
  99. package/i18n/pl.json +2 -0
  100. package/i18n/pt.json +2 -0
  101. package/i18n/ru.json +2 -0
  102. package/i18n/sv.json +2 -0
  103. package/i18n/tr.json +2 -0
  104. package/i18n/uk.json +2 -0
  105. package/i18n/vi.json +2 -0
  106. package/i18n/zh-TW.json +2 -0
  107. package/i18n/zh.json +2 -0
  108. package/llms-full.txt +5 -5
  109. package/package.json +1 -1
  110. package/schematics/use/symbol-map.json +2 -0
  111. package/select/styles/_index.scss +23 -1
  112. package/skills/ngwr/SKILL.md +3 -1
  113. package/skills/ngwr/references/catalog.md +1 -1
  114. package/types/ngwr-alert.d.ts +3 -1
  115. package/types/ngwr-bits-aurora.d.ts +24 -2
  116. package/types/ngwr-bits-border-glow-testing.d.ts +9 -5
  117. package/types/ngwr-bits-border-glow.d.ts +10 -4
  118. package/types/ngwr-bits-fuzzy-text.d.ts +2 -1
  119. package/types/ngwr-bits-ripple-grid.d.ts +7 -2
  120. package/types/ngwr-bits-splash-cursor.d.ts +2 -1
  121. package/types/ngwr-breadcrumbs.d.ts +15 -0
  122. package/types/ngwr-hotkey.d.ts +14 -2
  123. package/types/ngwr-pipes.d.ts +142 -32
  124. package/types/ngwr-select-testing.d.ts +9 -0
  125. package/types/ngwr-select.d.ts +133 -2
  126. package/types/ngwr-sidebar.d.ts +1 -1
  127. package/types/ngwr-version.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-bits-aurora.mjs","names":[],"sources":["../../../projects/lib/bits/aurora/aurora.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the Aurora background by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/backgrounds/aurora\n *\n * The reactbits version renders through the OGL library; this port talks\n * to WebGL2 directly — same vertex/fragment shaders, zero dependencies.\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n NgZone,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr, resolveCssColorChannels, watchColorScheme } from 'ngwr/utils';\n\nconst VERT = `#version 300 es\nin vec2 position;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n}\n`;\n\nconst FRAG = `#version 300 es\nprecision highp float;\n\nuniform float uTime;\nuniform float uAmplitude;\nuniform vec3 uColorStops[3];\nuniform vec2 uResolution;\nuniform float uBlend;\n\nout vec4 fragColor;\n\nvec3 permute(vec3 x) {\n return mod(((x * 34.0) + 1.0) * x, 289.0);\n}\n\nfloat snoise(vec2 v){\n const vec4 C = vec4(\n 0.211324865405187, 0.366025403784439,\n -0.577350269189626, 0.024390243902439\n );\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod(i, 289.0);\n\n vec3 p = permute(\n permute(i.y + vec3(0.0, i1.y, 1.0))\n + i.x + vec3(0.0, i1.x, 1.0)\n );\n\n vec3 m = max(\n 0.5 - vec3(\n dot(x0, x0),\n dot(x12.xy, x12.xy),\n dot(x12.zw, x12.zw)\n ),\n 0.0\n );\n m = m * m;\n m = m * m;\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nstruct ColorStop {\n vec3 color;\n float position;\n};\n\n#define COLOR_RAMP(colors, factor, finalColor) { \\\\\n int index = 0; \\\\\n for (int i = 0; i < 2; i++) { \\\\\n ColorStop currentColor = colors[i]; \\\\\n bool isInBetween = currentColor.position <= factor; \\\\\n index = int(mix(float(index), float(i), float(isInBetween))); \\\\\n } \\\\\n ColorStop currentColor = colors[index]; \\\\\n ColorStop nextColor = colors[index + 1]; \\\\\n float range = nextColor.position - currentColor.position; \\\\\n float lerpFactor = (factor - currentColor.position) / range; \\\\\n finalColor = mix(currentColor.color, nextColor.color, lerpFactor); \\\\\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / uResolution;\n\n ColorStop colors[3];\n colors[0] = ColorStop(uColorStops[0], 0.0);\n colors[1] = ColorStop(uColorStops[1], 0.5);\n colors[2] = ColorStop(uColorStops[2], 1.0);\n\n vec3 rampColor;\n COLOR_RAMP(colors, uv.x, rampColor);\n\n float height = snoise(vec2(uv.x * 2.0 + uTime * 0.1, uTime * 0.25)) * 0.5 * uAmplitude;\n height = exp(height);\n height = (uv.y * 2.0 - height + 0.2);\n float intensity = 0.6 * height;\n\n float midPoint = 0.20;\n float auroraAlpha = smoothstep(midPoint - uBlend * 0.5, midPoint + uBlend * 0.5, intensity);\n\n // Clamp the brightness floor: the upstream shader multiplies colour by\n // raw intensity, which fades the ribbon to BLACK while still opaque —\n // invisible on dark pages, a dirty gray halo on light ones. Keeping the\n // hue saturated and letting alpha alone do the fading works on both.\n vec3 auroraColor = rampColor * max(intensity, 0.85);\n\n fragColor = vec4(auroraColor * auroraAlpha, auroraAlpha);\n}\n`;\n\n/** What a stop falls back to when it cannot be read: the reactbits palette. */\nconst DEFAULT_STOPS = ['#5227ff', '#7cff67', '#5227ff'] as const;\n\n/**\n * The theme's stop hooks, written out in full: `gen:css-vars` finds a read by\n * its literal name, and a name built from a template string is invisible to it.\n */\nconst STOP_HOOKS = ['var(--wr-aurora-stop-1)', 'var(--wr-aurora-stop-2)', 'var(--wr-aurora-stop-3)'] as const;\n\n/**\n * Aurora background — flowing northern-lights ribbons rendered with a\n * WebGL2 simplex-noise shader, ramped across three colour stops. Fills\n * its nearest positioned ancestor; renders nothing without WebGL2.\n *\n * Under `prefers-reduced-motion` a single static frame is drawn, and drawn\n * again in the new colours when the page's colour scheme switches.\n *\n * Under forced colours the canvas is hidden and its loop stops with it, leaving the\n * box on the palette's own ground, which is what forced text and marks are chosen\n * against. The loop also stops off screen and with no box to draw on.\n *\n * @example\n * ```html\n * <div style=\"position: relative; min-height: 24rem; overflow: hidden\">\n * <wr-aurora />\n * <h1 style=\"position: relative\">Welcome aboard</h1>\n * </div>\n * ```\n *\n * @see https://ngwr.dev/bits/aurora\n */\n@Component({\n selector: 'wr-aurora',\n template: '<canvas #canvas class=\"wr-aurora__canvas\" aria-hidden=\"true\"></canvas>',\n styleUrl: './aurora.scss',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-aurora' },\n})\nexport class WrAurora {\n /**\n * Exactly three colour stops, ramped left → right — any CSS colour each, a\n * `var()` token or a `light-dark()` pair included. Alpha is ignored; the\n * ribbon fades through its own. When unset, the theme decides: deep\n * violet/emerald on light, the neon reactbits palette on dark.\n */\n readonly colorStops = input<readonly string[] | null>(null);\n\n /** Wave height multiplier. @default 1 */\n readonly amplitude = input(1, { transform: numAttr(1) });\n\n /** Softness of the aurora's lower edge, 0..1. @default 0.5 */\n readonly blend = input(0.5, { transform: numAttr(0.5) });\n\n /** Time multiplier. @default 1 */\n readonly speed = input(1, { transform: numAttr(1) });\n\n private readonly canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n private readonly platform = inject(WrPlatform);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private gl: WebGL2RenderingContext | null = null;\n private uniforms: Record<string, WebGLUniformLocation | null> = {};\n private rafId = 0;\n /** The shader time last drawn, so a resize can repaint the frame it just cleared. */\n private time = 0;\n\n /** Flips once `boot()` has a context and a program — the loop waits for it. */\n private readonly booted = signal(false);\n /** Whether the host is in the viewport; stays `true` without an observer. */\n private readonly onScreen = signal(true);\n /**\n * Whether the box has an area. The intersection observer calls a zero-area canvas\n * intersecting and sends no entry when it gains a size, so this reads the box instead.\n */\n private readonly hasBox = signal(false);\n\n constructor() {\n if (!this.isBrowser) return;\n\n afterNextRender(() => this.zone.runOutsideAngular(() => this.boot()));\n\n // Push input changes into uniforms without restarting the loop. Under\n // reduced motion this also repaints the static frame.\n effect(() => {\n this.colorStops();\n this.amplitude();\n this.blend();\n if (!this.gl) return;\n this.pushUniforms();\n if (this.platform.prefersReducedMotion()) this.draw(0);\n });\n\n // A still frame keeps the colours it was drawn with, so a scheme switch\n // under reduced motion re-resolves the stops and paints it again. The loop\n // needs no help: it re-resolves on every frame it draws.\n watchColorScheme(() => {\n if (!this.gl || !this.platform.prefersReducedMotion()) return;\n this.pushUniforms();\n this.draw(0);\n });\n\n // The frame loop runs only while there is something to see: never under\n // `prefers-reduced-motion`, read live (the effect above paints the static\n // frame when it switches on), and not while the host is off screen or has no\n // box — a background redrawn out of sight still costs a frame every frame.\n effect(onCleanup => {\n if (!this.booted() || !this.onScreen() || !this.hasBox() || this.platform.prefersReducedMotion()) return;\n const loop = (t: number): void => {\n this.rafId = requestAnimationFrame(loop);\n this.pushUniforms();\n this.draw(t * 0.01 * this.speed() * 0.1);\n };\n this.zone.runOutsideAngular(() => (this.rafId = requestAnimationFrame(loop)));\n onCleanup(() => cancelAnimationFrame(this.rafId));\n });\n }\n\n private boot(): void {\n const canvas = this.canvasRef().nativeElement;\n const gl = canvas.getContext('webgl2', { alpha: true, premultipliedAlpha: true, antialias: true });\n if (!gl) return;\n this.gl = gl;\n\n gl.clearColor(0, 0, 0, 0);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n const compile = (type: number, source: string): WebGLShader => {\n const shader = gl.createShader(type)!;\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n // eslint-disable-next-line no-console -- GPU shader failures are otherwise invisible\n console.error('wr-aurora shader error:', gl.getShaderInfoLog(shader));\n }\n return shader;\n };\n\n const program = gl.createProgram();\n gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));\n gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));\n gl.linkProgram(program);\n gl.useProgram(program);\n\n for (const name of ['uTime', 'uAmplitude', 'uColorStops', 'uResolution', 'uBlend']) {\n this.uniforms[name] = gl.getUniformLocation(program, name);\n }\n\n // One oversized triangle covers the viewport — no index buffer needed.\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n const position = gl.getAttribLocation(program, 'position');\n gl.enableVertexAttribArray(position);\n gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);\n\n const hostEl = this.host.nativeElement;\n const fit = (): void => {\n // The layout box and not `getBoundingClientRect()`, which is the box after\n // transforms: no observer hears of a transform, so a host booted under a\n // `scale(0)` would count as having no box for good.\n const width = hostEl.clientWidth;\n const height = hostEl.clientHeight;\n this.hasBox.set(width > 0 && height > 0);\n canvas.width = Math.max(1, width);\n canvas.height = Math.max(1, height);\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(this.uniforms['uResolution'], canvas.width, canvas.height);\n };\n // Sizing the bitmap clears it, and observer entries arrive after the frame's own\n // callbacks and before its paint, so a repaint left to the loop would leave this\n // frame empty.\n const resize = (): void => {\n fit();\n this.draw(this.platform.prefersReducedMotion() ? 0 : this.time);\n };\n\n window.addEventListener('resize', resize);\n const ro = new ResizeObserver(resize);\n ro.observe(hostEl);\n\n fit();\n this.pushUniforms();\n\n // Static frame — the ribbons hold their t=0 shape. Painted under reduced\n // motion, and as the first frame either way; the loop takes over from here.\n this.draw(0);\n\n // Without an observer (jsdom) the host simply counts as visible. The canvas\n // rather than the host, which fills the same box, so a canvas hidden under forced\n // colours stops the loop too. A box flush against a zero-height clip intersects with\n // nothing showing, and only a second threshold reports the clip moving. It sits below\n // any real ratio, or a clip closing on a transition steps from under it to 0 without\n // crossing anything.\n const io =\n typeof IntersectionObserver === 'undefined'\n ? null\n : new IntersectionObserver(\n entries => {\n const { isIntersecting, intersectionRatio } = entries[entries.length - 1];\n this.onScreen.set(isIntersecting && intersectionRatio > 0);\n },\n { threshold: [0, 1e-9] }\n );\n io?.observe(canvas);\n\n this.destroyRef.onDestroy(() => {\n window.removeEventListener('resize', resize);\n ro.disconnect();\n io?.disconnect();\n });\n this.booted.set(true);\n }\n\n private pushUniforms(): void {\n const gl = this.gl;\n if (!gl) return;\n const flat = new Float32Array(9);\n for (let i = 0; i < 3; i++) flat.set(this.resolveStop(i), i * 3);\n gl.uniform3fv(this.uniforms['uColorStops'], flat);\n gl.uniform1f(this.uniforms['uAmplitude'], this.amplitude());\n gl.uniform1f(this.uniforms['uBlend'], this.blend());\n }\n\n /**\n * Stop `index` as shader channels. Explicit input wins; otherwise the theme's\n * `--wr-aurora-stop-*` hook, which holds a `light-dark()` pair no uniform can\n * take, so either is resolved through the cascade first. Read every frame, so\n * a colour-scheme change reaches the ribbon on the next one.\n */\n private resolveStop(index: number): [number, number, number] {\n const explicit = this.colorStops();\n const fallback = DEFAULT_STOPS[index];\n const expression =\n explicit === null ? STOP_HOOKS[index] : (explicit[Math.min(index, explicit.length - 1)] ?? fallback);\n return resolveCssColorChannels(this.canvasRef().nativeElement, expression, fallback);\n }\n\n private draw(time: number): void {\n const gl = this.gl;\n if (!gl || !this.hasBox()) return;\n this.time = time;\n gl.uniform1f(this.uniforms['uTime'], time);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAM,OAAO;;;;;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AAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-bits-aurora.mjs","names":[],"sources":["../../../projects/lib/bits/aurora/aurora.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the Aurora background by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/backgrounds/aurora\n *\n * The reactbits version renders through the OGL library; this port talks\n * to WebGL2 directly — same vertex/fragment shaders, zero dependencies.\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n NgZone,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n afterRenderEffect,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr, resolveCssColorChannels, watchColorScheme } from 'ngwr/utils';\n\nconst VERT = `#version 300 es\nin vec2 position;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n}\n`;\n\nconst FRAG = `#version 300 es\nprecision highp float;\n\nuniform float uTime;\nuniform float uAmplitude;\nuniform vec3 uColorStops[3];\nuniform vec2 uResolution;\nuniform float uBlend;\n\nout vec4 fragColor;\n\nvec3 permute(vec3 x) {\n return mod(((x * 34.0) + 1.0) * x, 289.0);\n}\n\nfloat snoise(vec2 v){\n const vec4 C = vec4(\n 0.211324865405187, 0.366025403784439,\n -0.577350269189626, 0.024390243902439\n );\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod(i, 289.0);\n\n vec3 p = permute(\n permute(i.y + vec3(0.0, i1.y, 1.0))\n + i.x + vec3(0.0, i1.x, 1.0)\n );\n\n vec3 m = max(\n 0.5 - vec3(\n dot(x0, x0),\n dot(x12.xy, x12.xy),\n dot(x12.zw, x12.zw)\n ),\n 0.0\n );\n m = m * m;\n m = m * m;\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nstruct ColorStop {\n vec3 color;\n float position;\n};\n\n#define COLOR_RAMP(colors, factor, finalColor) { \\\\\n int index = 0; \\\\\n for (int i = 0; i < 2; i++) { \\\\\n ColorStop currentColor = colors[i]; \\\\\n bool isInBetween = currentColor.position <= factor; \\\\\n index = int(mix(float(index), float(i), float(isInBetween))); \\\\\n } \\\\\n ColorStop currentColor = colors[index]; \\\\\n ColorStop nextColor = colors[index + 1]; \\\\\n float range = nextColor.position - currentColor.position; \\\\\n float lerpFactor = (factor - currentColor.position) / range; \\\\\n finalColor = mix(currentColor.color, nextColor.color, lerpFactor); \\\\\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / uResolution;\n\n ColorStop colors[3];\n colors[0] = ColorStop(uColorStops[0], 0.0);\n colors[1] = ColorStop(uColorStops[1], 0.5);\n colors[2] = ColorStop(uColorStops[2], 1.0);\n\n vec3 rampColor;\n COLOR_RAMP(colors, uv.x, rampColor);\n\n float height = snoise(vec2(uv.x * 2.0 + uTime * 0.1, uTime * 0.25)) * 0.5 * uAmplitude;\n height = exp(height);\n height = (uv.y * 2.0 - height + 0.2);\n float intensity = 0.6 * height;\n\n float midPoint = 0.20;\n float auroraAlpha = smoothstep(midPoint - uBlend * 0.5, midPoint + uBlend * 0.5, intensity);\n\n // Clamp the brightness floor: the upstream shader multiplies colour by\n // raw intensity, which fades the ribbon to BLACK while still opaque —\n // invisible on dark pages, a dirty gray halo on light ones. Keeping the\n // hue saturated and letting alpha alone do the fading works on both.\n vec3 auroraColor = rampColor * max(intensity, 0.85);\n\n fragColor = vec4(auroraColor * auroraAlpha, auroraAlpha);\n}\n`;\n\n/** What the GPU holds for one context. A lost context takes all of it, so a restored one builds it again. */\ninterface Gpu {\n readonly program: WebGLProgram;\n readonly buffer: WebGLBuffer | null;\n readonly uniforms: Readonly<Record<string, WebGLUniformLocation | null>>;\n}\n\n/** What a stop falls back to when it cannot be read: the reactbits palette. */\nconst DEFAULT_STOPS = ['#5227ff', '#7cff67', '#5227ff'] as const;\n\n/**\n * The theme's stop hooks, written out in full: `gen:css-vars` finds a read by\n * its literal name, and a name built from a template string is invisible to it.\n */\nconst STOP_HOOKS = ['var(--wr-aurora-stop-1)', 'var(--wr-aurora-stop-2)', 'var(--wr-aurora-stop-3)'] as const;\n\n/**\n * Aurora background — flowing northern-lights ribbons rendered with a\n * WebGL2 simplex-noise shader, ramped across three colour stops. Fills\n * its nearest positioned ancestor; renders nothing without WebGL2.\n *\n * Under `prefers-reduced-motion` a single static frame is drawn, and drawn\n * again in the new colours when the page's colour scheme switches.\n *\n * Under forced colours the canvas is hidden and its loop stops with it, leaving the\n * box on the palette's own ground, which is what forced text and marks are chosen\n * against. The loop also stops off screen and with no box to draw on.\n *\n * With no WebGL2 context, or a shader the driver refuses, nothing is thrown and\n * the canvas stays empty. A context the browser takes away is rebuilt if it offers\n * one back. A destroyed host hands its GPU resources back at once. Browsers keep a\n * small number of live contexts and kill the oldest: Chromium frees the slot at that\n * point, while WebKit frees it only when the context is collected and offers an\n * evicted one no restore, so there a host that is not drawing can stay empty for good.\n *\n * @example\n * ```html\n * <div style=\"position: relative; min-height: 24rem; overflow: hidden\">\n * <wr-aurora />\n * <h1 style=\"position: relative\">Welcome aboard</h1>\n * </div>\n * ```\n *\n * @see https://ngwr.dev/bits/aurora\n */\n@Component({\n selector: 'wr-aurora',\n template: '<canvas #canvas class=\"wr-aurora__canvas\" aria-hidden=\"true\"></canvas>',\n styleUrl: './aurora.scss',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-aurora' },\n})\nexport class WrAurora {\n /**\n * Exactly three colour stops, ramped left → right — any CSS colour each, a\n * `var()` token or a `light-dark()` pair included. Alpha is ignored; the\n * ribbon fades through its own. When unset, the theme decides: deep\n * violet/emerald on light, the neon reactbits palette on dark.\n */\n readonly colorStops = input<readonly string[] | null>(null);\n\n /** Wave height multiplier. @default 1 */\n readonly amplitude = input(1, { transform: numAttr(1) });\n\n /** Softness of the aurora's lower edge, 0..1. @default 0.5 */\n readonly blend = input(0.5, { transform: numAttr(0.5) });\n\n /** Time multiplier. @default 1 */\n readonly speed = input(1, { transform: numAttr(1) });\n\n private readonly canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n private readonly platform = inject(WrPlatform);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private gl: WebGL2RenderingContext | null = null;\n private gpu: Gpu | null = null;\n private rafId = 0;\n /** The shader time last drawn, so a resize can repaint the frame it just cleared. */\n private time = 0;\n\n /** Flips once a program is built, and back when the context goes — everything that draws waits for it. */\n private readonly booted = signal(false);\n /** Whether the host is in the viewport; stays `true` without an observer. */\n private readonly onScreen = signal(true);\n /**\n * Whether the box has an area. The intersection observer calls a zero-area canvas\n * intersecting and sends no entry when it gains a size, so this reads the box instead.\n */\n private readonly hasBox = signal(false);\n\n constructor() {\n if (!this.isBrowser) return;\n\n afterNextRender(() => this.zone.runOutsideAngular(() => this.boot()));\n\n // Push input changes into uniforms without restarting the loop. Under\n // reduced motion this also repaints the static frame — and so does the\n // moment motion stops. After render rather than an `effect`, which runs\n // before a directive's host binding: a still frame drawn then would miss a\n // hook it changes in the same pass.\n afterRenderEffect(() => {\n if (!this.booted()) return;\n const still = this.platform.prefersReducedMotion();\n this.colorStops();\n this.amplitude();\n this.blend();\n untracked(() => {\n this.pushUniforms();\n if (still) this.draw(0);\n });\n });\n\n // A still frame keeps the colours it was drawn with, so a scheme switch\n // under reduced motion re-resolves the stops and paints it again. The loop\n // needs no help: it re-resolves on every frame it draws.\n watchColorScheme(() => {\n if (!this.gpu || !this.platform.prefersReducedMotion()) return;\n this.pushUniforms();\n this.draw(0);\n });\n\n // The frame loop runs only while there is something to see: never under\n // `prefers-reduced-motion`, read live (the effect above paints the static\n // frame when it switches on), and not while the host is off screen or has no\n // box — a background redrawn out of sight still costs a frame every frame.\n effect(onCleanup => {\n if (!this.booted() || !this.onScreen() || !this.hasBox() || this.platform.prefersReducedMotion()) return;\n const loop = (t: number): void => {\n this.rafId = requestAnimationFrame(loop);\n this.pushUniforms();\n this.draw(t * 0.01 * this.speed() * 0.1);\n };\n this.zone.runOutsideAngular(() => (this.rafId = requestAnimationFrame(loop)));\n onCleanup(() => cancelAnimationFrame(this.rafId));\n });\n }\n\n private boot(): void {\n const canvas = this.canvasRef().nativeElement;\n const gl = canvas.getContext('webgl2', { alpha: true, premultipliedAlpha: true, antialias: true });\n if (!gl) return;\n this.gl = gl;\n\n // A context can arrive already lost, past the browser's limit on live ones.\n // That is not a broken shader: the restore below builds it. A shader the\n // driver really refused has logged, and nothing will ever draw on this one.\n this.gpu = this.build(gl);\n if (!this.gpu && !gl.isContextLost()) {\n this.release(gl);\n return;\n }\n\n const hostEl = this.host.nativeElement;\n const fit = (): void => {\n // The layout box and not `getBoundingClientRect()`, which is the box after\n // transforms: no observer hears of a transform, so a host booted under a\n // `scale(0)` would count as having no box for good.\n const width = hostEl.clientWidth;\n const height = hostEl.clientHeight;\n this.hasBox.set(width > 0 && height > 0);\n canvas.width = Math.max(1, width);\n canvas.height = Math.max(1, height);\n gl.viewport(0, 0, canvas.width, canvas.height);\n if (this.gpu) gl.uniform2f(this.gpu.uniforms['uResolution'], canvas.width, canvas.height);\n };\n\n const onLost = (event: Event): void => {\n // Without this the browser never offers the context back.\n event.preventDefault();\n this.gpu = null;\n this.booted.set(false);\n };\n const onRestored = (): void => {\n this.gpu = this.build(gl);\n if (!this.gpu) return;\n // The resolution went with the old program; the effects redraw the rest.\n fit();\n this.booted.set(true);\n };\n canvas.addEventListener('webglcontextlost', onLost);\n canvas.addEventListener('webglcontextrestored', onRestored);\n\n // Sizing the bitmap clears it, and observer entries arrive after the frame's own\n // callbacks and before its paint, so a repaint left to the loop would leave this\n // frame empty.\n const resize = (): void => {\n fit();\n this.draw(this.platform.prefersReducedMotion() ? 0 : this.time);\n };\n\n window.addEventListener('resize', resize);\n const ro = new ResizeObserver(resize);\n ro.observe(hostEl);\n\n fit();\n this.pushUniforms();\n\n // Static frame — the ribbons hold their t=0 shape. Painted under reduced\n // motion, and as the first frame either way; the loop takes over from here.\n this.draw(0);\n\n // Without an observer (jsdom) the host simply counts as visible. The canvas\n // rather than the host, which fills the same box, so a canvas hidden under forced\n // colours stops the loop too. A box flush against a zero-height clip intersects with\n // nothing showing, and only a second threshold reports the clip moving. It sits below\n // any real ratio, or a clip closing on a transition steps from under it to 0 without\n // crossing anything.\n const io =\n typeof IntersectionObserver === 'undefined'\n ? null\n : new IntersectionObserver(\n entries => {\n const { isIntersecting, intersectionRatio } = entries[entries.length - 1];\n this.onScreen.set(isIntersecting && intersectionRatio > 0);\n },\n { threshold: [0, 1e-9] }\n );\n io?.observe(canvas);\n\n this.destroyRef.onDestroy(() => {\n window.removeEventListener('resize', resize);\n ro.disconnect();\n io?.disconnect();\n // These first: losing the context below fires the event they listen for.\n canvas.removeEventListener('webglcontextlost', onLost);\n canvas.removeEventListener('webglcontextrestored', onRestored);\n this.release(gl);\n });\n if (this.gpu) this.booted.set(true);\n }\n\n /**\n * Compile, link and upload what one context needs, and make it current. Returns\n * `null` when it cannot: on a lost context, where every call answers no and\n * nothing is wrong with the shader, it says nothing.\n */\n private build(gl: WebGL2RenderingContext): Gpu | null {\n const vert = this.compile(gl, gl.VERTEX_SHADER, VERT);\n const frag = this.compile(gl, gl.FRAGMENT_SHADER, FRAG);\n const program = vert && frag ? gl.createProgram() : null;\n if (vert && frag && program) {\n gl.attachShader(program, vert);\n gl.attachShader(program, frag);\n gl.linkProgram(program);\n }\n // Only flagged: a shader stays alive as long as a program it is attached to.\n gl.deleteShader(vert);\n gl.deleteShader(frag);\n if (!program) return null;\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n if (!gl.isContextLost()) {\n // eslint-disable-next-line no-console -- GPU shader failures are otherwise invisible\n console.error('wr-aurora program error:', gl.getProgramInfoLog(program));\n }\n gl.deleteProgram(program);\n return null;\n }\n gl.useProgram(program);\n\n gl.clearColor(0, 0, 0, 0);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n const uniforms: Record<string, WebGLUniformLocation | null> = {};\n for (const name of ['uTime', 'uAmplitude', 'uColorStops', 'uResolution', 'uBlend']) {\n uniforms[name] = gl.getUniformLocation(program, name);\n }\n\n // One oversized triangle covers the viewport — no index buffer needed.\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n const position = gl.getAttribLocation(program, 'position');\n gl.enableVertexAttribArray(position);\n gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);\n\n return { program, buffer, uniforms };\n }\n\n private compile(gl: WebGL2RenderingContext, type: number, source: string): WebGLShader | null {\n const shader = gl.createShader(type);\n if (!shader) return null;\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (gl.getShaderParameter(shader, gl.COMPILE_STATUS)) return shader;\n if (!gl.isContextLost()) {\n // eslint-disable-next-line no-console -- GPU shader failures are otherwise invisible\n console.error('wr-aurora shader error:', gl.getShaderInfoLog(shader));\n }\n gl.deleteShader(shader);\n return null;\n }\n\n /**\n * Give the GPU resources back at once rather than to the garbage collector:\n * browsers keep a small number of live contexts and kill the oldest, so a\n * navigating single-page app would lose the context of a page still on screen.\n * Chromium frees the slot here too. WebKit holds it until the context is collected,\n * and no API frees it sooner, so a still or parked host can still be evicted there.\n */\n private release(gl: WebGL2RenderingContext): void {\n if (this.gpu) {\n gl.deleteProgram(this.gpu.program);\n gl.deleteBuffer(this.gpu.buffer);\n }\n gl.getExtension('WEBGL_lose_context')?.loseContext();\n this.gpu = null;\n this.gl = null;\n }\n\n private pushUniforms(): void {\n const { gl, gpu } = this;\n if (!gl || !gpu) return;\n const flat = new Float32Array(9);\n for (let i = 0; i < 3; i++) flat.set(this.resolveStop(i), i * 3);\n gl.uniform3fv(gpu.uniforms['uColorStops'], flat);\n gl.uniform1f(gpu.uniforms['uAmplitude'], this.amplitude());\n gl.uniform1f(gpu.uniforms['uBlend'], this.blend());\n }\n\n /**\n * Stop `index` as shader channels. Explicit input wins; otherwise the theme's\n * `--wr-aurora-stop-*` hook, which holds a `light-dark()` pair no uniform can\n * take, so either is resolved through the cascade first. Read every frame, so\n * a colour-scheme change reaches the ribbon on the next one.\n */\n private resolveStop(index: number): [number, number, number] {\n const explicit = this.colorStops();\n const fallback = DEFAULT_STOPS[index];\n const expression =\n explicit === null ? STOP_HOOKS[index] : (explicit[Math.min(index, explicit.length - 1)] ?? fallback);\n return resolveCssColorChannels(this.canvasRef().nativeElement, expression, fallback);\n }\n\n private draw(time: number): void {\n const { gl, gpu } = this;\n if (!gl || !gpu || !this.hasBox()) return;\n this.time = time;\n gl.uniform1f(gpu.uniforms['uTime'], time);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,MAAM,OAAO;;;;;;AAOb,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Gb,MAAM,gBAAgB;CAAC;CAAW;CAAW;AAAS;AAMtD,MAAM,aAAa;CAAC;CAA2B;CAA2B;AAAyB;AAsCnG,IAAa,WAAb,MAAa,SAAQ;CAOV,aAAa,MAAgC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAGlD,YAAY,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW,QAAQ,CAAC;CAAC,CAAA;CAG5C,QAAQ,MAAM,IAAG;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW,QAAQ,EAAG;CAAC,CAAA;CAG5C,QAAQ,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW,QAAQ,CAAC;CAAC,CAAA;CAEhC,YAAY,UAAU,SAAwC,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAEvE,OAAO,OAAgC,UAAU;CACjD,OAAO,OAAO,MAAM;CACpB,aAAa,OAAO,UAAU;CAC9B,WAAW,OAAO,UAAU;CAC5B,Y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AAA,CAAA;GAAA,cAAA;GAAA,OAAA;GAAA,WAAA,CAAA,QAAA;GAAA,aAAA;GAAA,UAAA;EAAA,CAAA;EAAA,UAAA;EAAA,UALT;EAAwE,UAAA;EAAA,QAAA,CAAA,uYAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAKvE,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAPpB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAW,UACX;GAAwE,eAEnE,kBAAkB;GAAI,MAC/B,EAAE,OAAO,YAAW;GAAE,QAAA,CAAA,uYAAA;EAAA,CAAA;CAoBmD,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -59,18 +59,18 @@ var WrBorderGlowHarness = class WrBorderGlowHarness extends ComponentHarness {
59
59
  return this.readNumberVar("--wr-border-glow-fill-opacity", "getFillOpacity");
60
60
  }
61
61
  async getBackgroundColor() {
62
- return this.readVar("--wr-border-glow-bg");
62
+ return this.readVar("--wr-border-glow-input-bg");
63
63
  }
64
64
  async getGlowColor() {
65
- return this.readVar("--wr-border-glow-color");
65
+ return this.readVar("--wr-border-glow-input-color");
66
66
  }
67
67
  async getGlowAlphaRamp() {
68
68
  const declarations = await this.declarations();
69
- const first = declarations.get("--wr-border-glow-color");
69
+ const first = declarations.get("--wr-border-glow-input-color");
70
70
  if (first === void 0) return null;
71
71
  const form = first.startsWith("color-mix(") ? GLOW_MIX_ALPHA : GLOW_ALPHA;
72
72
  return GLOW_VAR_SUFFIXES.map((suffix) => {
73
- const name = `--wr-border-glow-color${suffix}`;
73
+ const name = `--wr-border-glow-input-color${suffix}`;
74
74
  const raw = declarations.get(name);
75
75
  const alpha = raw === void 0 ? null : form.exec(raw);
76
76
  if (!alpha) throw new Error(`WrBorderGlowHarness.getGlowAlphaRamp(): \`${name}\` reads "${raw ?? "(absent)"}". The seven halo steps are written together from one glow colour, so a step that is missing, carries no alpha, or is not the same \`${form === GLOW_ALPHA ? "hsl(… / N%)" : "color-mix(in srgb, … N%, transparent)"}\` as the first means the ramp stopped being built — the halo would fade in bands the stylesheet cannot use.`);
@@ -79,9 +79,9 @@ var WrBorderGlowHarness = class WrBorderGlowHarness extends ComponentHarness {
79
79
  }
80
80
  async getGradientColors() {
81
81
  const declarations = await this.declarations();
82
- if (!declarations.has("--wr-border-glow-gradient-one")) return null;
82
+ if (!declarations.has("--wr-border-glow-input-gradient-one")) return null;
83
83
  return GRADIENT_VAR_SLOTS.map((slot) => {
84
- const name = `--wr-border-glow-gradient-${slot}`;
84
+ const name = `--wr-border-glow-input-gradient-${slot}`;
85
85
  const raw = declarations.get(name);
86
86
  const colour = raw === void 0 ? null : RADIAL_GRADIENT_COLOR.exec(raw);
87
87
  if (!colour) throw new Error(`WrBorderGlowHarness.getGradientColors(): \`${name}\` reads "${raw ?? "(absent)"}", which is not the \`radial-gradient(at X% Y%, <colour> 0px, …)\` the component builds. All seven slots are written from one palette, so one of them being different means the mapping broke, not the palette.`);
@@ -89,10 +89,10 @@ var WrBorderGlowHarness = class WrBorderGlowHarness extends ComponentHarness {
89
89
  });
90
90
  }
91
91
  async getBaseGradientColor() {
92
- const raw = await this.readVar("--wr-border-glow-gradient-base");
92
+ const raw = await this.readVar("--wr-border-glow-input-gradient-base");
93
93
  if (raw === null) return null;
94
94
  const colour = LINEAR_GRADIENT_COLOR.exec(raw);
95
- if (!colour) throw new Error(`WrBorderGlowHarness.getBaseGradientColor(): \`--wr-border-glow-gradient-base\` reads "${raw}", which is not the \`linear-gradient(<colour> 0 100%)\` the component builds from the palette.`);
95
+ if (!colour) throw new Error(`WrBorderGlowHarness.getBaseGradientColor(): \`--wr-border-glow-input-gradient-base\` reads "${raw}", which is not the \`linear-gradient(<colour> 0 100%)\` the component builds from the palette.`);
96
96
  return colour[1];
97
97
  }
98
98
  async getPointerAngle() {
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-bits-border-glow-testing.mjs","names":[],"sources":["../../../projects/lib/bits/border-glow/testing/wr-border-glow-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrBorderGlowHarnessFilters } from './types';\n\n/** The seven halo steps, in the order the component writes them: 100%, 60%, 50%, 40%, 30%, 20%, 10%. */\nconst GLOW_VAR_SUFFIXES = ['', '-60', '-50', '-40', '-30', '-20', '-10'] as const;\n\n/** The seven mesh-gradient slots, spelled out rather than numbered — as the component names them. */\nconst GRADIENT_VAR_SLOTS = ['one', 'two', 'three', 'four', 'five', 'six', 'seven'] as const;\n\n/** `hsl(40deg 80% 80% / 65%)` — the alpha, which is the only part `glowIntensity` moves. */\nconst GLOW_ALPHA = /\\/\\s*(-?[\\d.]+)%\\s*\\)\\s*$/;\n\n/** `color-mix(in srgb, var(--wr-color-primary) 65%, transparent)` — the same alpha, for a CSS colour. */\nconst GLOW_MIX_ALPHA = /^color-mix\\(in srgb,\\s*.+\\s+(-?[\\d.]+)%\\s*,\\s*transparent\\s*\\)$/;\n\n/** `radial-gradient(at 80% 55%, #c084fc 0px, transparent 50%)` — the colour, not the position. */\nconst RADIAL_GRADIENT_COLOR = /^radial-gradient\\(\\s*at\\s+[^,]+,\\s*(.+?)\\s+0px\\s*,/;\n\n/** `linear-gradient(#c084fc 0 100%)` — the flat base slice. */\nconst LINEAR_GRADIENT_COLOR = /^linear-gradient\\(\\s*(.+?)\\s+0\\s+100%\\s*\\)$/;\n\n/**\n * Split an inline `style` attribute into its declarations.\n *\n * Read from the attribute rather than through `getCssValue()` on purpose. jsdom echoes\n * an inline custom property back through `getComputedStyle`, so the computed read passes\n * here and would answer something else entirely in a browser — where the stylesheet's\n * own per-theme default resolves and \"the author left this to the theme\" quietly becomes\n * a colour. The attribute holds what the component itself wrote, and nothing else.\n */\nfunction parseInlineDeclarations(style: string): Map<string, string> {\n const declarations = new Map<string, string>();\n for (const declaration of style.split(';')) {\n const colon = declaration.indexOf(':');\n if (colon === -1) continue;\n const name = declaration.slice(0, colon).trim();\n if (name !== '') declarations.set(name, declaration.slice(colon + 1).trim());\n }\n return declarations;\n}\n\n/**\n * Test harness for `<wr-border-glow>` — a card whose border lights up under the cursor.\n *\n * **Nearly all of this component is a bag of custom properties written onto the host,\n * and that is what the harness reads.** The paint itself — the conic mask, the stacked\n * `box-shadow` halo, the soft-light bloom — lives in the stylesheet, so a unit test can\n * never see it. What it CAN see is the arithmetic that feeds it, and that is where the\n * breakages are: the seven-step alpha ramp {@link getGlowAlphaRamp} derives from\n * `glowIntensity`, the `[0,1,2,0,1,2,1]` palette mapping in {@link getGradientColors}\n * with its clamp for short palettes, and the pointer maths behind\n * {@link getPointerAngle} / {@link getEdgeProximity}.\n *\n * **Every custom-property getter reads the inline declaration** — see\n * {@link parseInlineDeclarations} for why a computed read would be a different, and\n * wrong, question.\n *\n * **A colour getter answering `null` means that variable is not on the host now**, which\n * is the contract when the input is unset or its value was refused: the stylesheet's\n * per-theme default takes over. An input set and then put back to `null` comes off the\n * host, so `null` says nothing about whether it was ever set.\n *\n * There is deliberately no `getGlowOpacity()`, `isGlowVisible()` or `isHovered()`: the\n * visible strength is a `calc()` in the stylesheet gated behind `:not(:hover)`, and\n * jsdom loads no stylesheet and matches no `:hover`, so any number would be invented.\n * There is no measured halo extent either — `.wr-border-glow__edge` is 0×0 in a test,\n * and {@link getGlowRadius} reads what the component asked for instead. And there is no\n * `getSweepProgress()` / `waitForSweep()`: the mount sweep is a four-second chain of\n * `requestAnimationFrame` tweens, so awaiting it either hangs the spec or samples one\n * frame and reports a value that was never settled. {@link isSweeping} answers the one\n * durable fact — that the sweep started. Nor is there a `getLoopAngle()` or a wait for\n * the loop: `[loop]` writes a new angle on every frame for as long as it is on, so the\n * angle never settles and any sample is one frame of an endless animation.\n * {@link isLooping} answers that it is on.\n *\n * @example\n * ```ts\n * const card = await loader.getHarness(WrBorderGlowHarness.with({ text: /Hover me/ }));\n *\n * expect(await card.getBorderRadius()).toBe(28);\n * expect(await card.getPointerAngle()).toBeNull(); // no pointer, sweep or loop has written one yet\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrBorderGlowHarness extends ComponentHarness {\n static hostSelector = 'wr-border-glow';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrBorderGlowHarnessFilters = {}): HarnessPredicate<WrBorderGlowHarness> {\n return new HarnessPredicate(WrBorderGlowHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getContentText(), text)\n )\n .addOption('sweeping', options.sweeping, async (harness, sweeping) => (await harness.isSweeping()) === sweeping)\n .addOption('looping', options.looping, async (harness, looping) => (await harness.isLooping()) === looping);\n }\n\n private readonly edge = this.locatorFor('.wr-border-glow__edge');\n\n /** The corner radius the stylesheet is told to round to, in pixels. */\n async getBorderRadius(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-radius', 'getBorderRadius');\n }\n\n /** How far past the card edge the halo is told to reach, in pixels. */\n async getGlowRadius(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-padding', 'getGlowRadius');\n }\n\n /**\n * The width of the lit cone, as a share of the perimeter.\n *\n * Unitless by contract — the stylesheet multiplies it — so a `px` creeping in here is\n * a real regression that leaves the mask with a length where it wants a number.\n */\n async getConeSpread(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-cone-spread', 'getConeSpread');\n }\n\n /** How sharply the halo fades as the cursor leaves an edge; lower is a wider falloff. */\n async getEdgeSensitivity(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-edge-sensitivity', 'getEdgeSensitivity');\n }\n\n /** Strength of the interior soft-light bloom, again unitless. */\n async getFillOpacity(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-fill-opacity', 'getFillOpacity');\n }\n\n /**\n * The card fill the author asked for, or `null` when they left it to the theme.\n *\n * The distinction is the whole point: an unset `[backgroundColor]` means the surface\n * token decides, light or dark, and a card that starts declaring its own fill has\n * stopped following the theme.\n */\n async getBackgroundColor(): Promise<string | null> {\n return this.readVar('--wr-border-glow-bg');\n }\n\n /**\n * The halo colour at full strength, or `null` when the theme decides.\n *\n * Comes back as written, in one of two forms, so this also pins the assembly: the\n * `hsl(H deg S% L% / A%)` built from bare `'H S L'` parts, or\n * `color-mix(in srgb, <colour> 100%, transparent)` for any other value. Be aware the\n * second form is a containment check and not a colour parser — `'banana'` is written\n * just as faithfully as `'#3567ff'`, and the browser then drops every halo declaration\n * that reads it — so a plausible-looking value here does not mean it paints. A value\n * that could escape the `color-mix()` is never written, and reads `null`.\n */\n async getGlowColor(): Promise<string | null> {\n return this.readVar('--wr-border-glow-color');\n }\n\n /**\n * The seven halo alphas in percent, brightest first, or `null` when no glow colour\n * is set.\n *\n * This is the whole of `[glowIntensity]`: the steps are `[100, 60, 50, 40, 30, 20,\n * 10]` multiplied by the intensity and clamped at 100, so `0.5` gives\n * `[50, 30, 25, 20, 15, 10, 5]` and anything above 1 saturates from the top down. The\n * clamp is one-sided — a negative intensity produces negative percentages, which a\n * browser drops as invalid declarations and the halo vanishes — so the numbers are\n * returned as written rather than corrected, which is how a spec can see it.\n *\n * Read from either form {@link getGlowColor} describes: the `/ A%` of an `hsl()`, or\n * the colour's share in a `color-mix()`. All seven steps must be in the form the first\n * one is — they are written together from one value, so a mix of the two is a ramp\n * that broke half way.\n */\n async getGlowAlphaRamp(): Promise<number[] | null> {\n const declarations = await this.declarations();\n const first = declarations.get('--wr-border-glow-color');\n if (first === undefined) return null;\n const form = first.startsWith('color-mix(') ? GLOW_MIX_ALPHA : GLOW_ALPHA;\n\n return GLOW_VAR_SUFFIXES.map(suffix => {\n const name = `--wr-border-glow-color${suffix}`;\n const raw = declarations.get(name);\n const alpha = raw === undefined ? null : form.exec(raw);\n if (!alpha) {\n throw new Error(\n `WrBorderGlowHarness.getGlowAlphaRamp(): \\`${name}\\` reads \"${raw ?? '(absent)'}\". The seven halo steps ` +\n 'are written together from one glow colour, so a step that is missing, carries no alpha, or is not ' +\n `the same \\`${form === GLOW_ALPHA ? 'hsl(… / N%)' : 'color-mix(in srgb, … N%, transparent)'}\\` as the ` +\n 'first means the ramp stopped being built — the halo would fade in bands the stylesheet cannot use.'\n );\n }\n return Number.parseFloat(alpha[1]);\n });\n }\n\n /**\n * The seven mesh-gradient colours, in slot order, or `null` when no palette was set.\n *\n * The slots do not map one-to-one onto the palette: they take colours\n * `[0, 1, 2, 0, 1, 2, 1]`, each index clamped to the last entry the palette actually\n * has. So a two-colour palette repeats the second colour rather than reading past the\n * end — which is the case worth a spec, since `undefined` in a `radial-gradient()`\n * kills the whole declaration silently.\n */\n async getGradientColors(): Promise<string[] | null> {\n const declarations = await this.declarations();\n if (!declarations.has('--wr-border-glow-gradient-one')) return null;\n\n return GRADIENT_VAR_SLOTS.map(slot => {\n const name = `--wr-border-glow-gradient-${slot}`;\n const raw = declarations.get(name);\n const colour = raw === undefined ? null : RADIAL_GRADIENT_COLOR.exec(raw);\n if (!colour) {\n throw new Error(\n `WrBorderGlowHarness.getGradientColors(): \\`${name}\\` reads \"${raw ?? '(absent)'}\", which is not the ` +\n '`radial-gradient(at X% Y%, <colour> 0px, …)` the component builds. All seven slots are written from ' +\n 'one palette, so one of them being different means the mapping broke, not the palette.'\n );\n }\n return colour[1];\n });\n }\n\n /**\n * The flat colour behind the mesh, or `null` when no palette was set.\n *\n * Always the palette's FIRST entry. Worth its own method because the base slice is the\n * one that shows where the gradients are transparent, and it drifting to the last\n * colour changes the card's whole cast without touching a gradient.\n */\n async getBaseGradientColor(): Promise<string | null> {\n const raw = await this.readVar('--wr-border-glow-gradient-base');\n if (raw === null) return null;\n\n const colour = LINEAR_GRADIENT_COLOR.exec(raw);\n if (!colour) {\n throw new Error(\n `WrBorderGlowHarness.getBaseGradientColor(): \\`--wr-border-glow-gradient-base\\` reads \"${raw}\", which is ` +\n 'not the `linear-gradient(<colour> 0 100%)` the component builds from the palette.'\n );\n }\n return colour[1];\n }\n\n /**\n * Where the lit cone points, in degrees: `0` is straight up and the angle grows\n * clockwise. Three things write it — the pointer, from where it sits; the mount sweep;\n * and `[loop]`, on every frame, or once at a resting 45 under reduced motion — so a\n * looping card answers with no pointer at all. `null` means nothing has written it yet.\n *\n * `null` is a state of its own rather than a stand-in for zero — the stylesheet's own\n * default applies until the first write, and a pointer at dead centre legitimately\n * reports `0`, so a harness that folded the two together could not tell an untouched\n * card from one being pointed at from the middle.\n */\n async getPointerAngle(): Promise<number | null> {\n const raw = await this.readVar('--wr-border-glow-angle');\n return raw === null ? null : Number.parseFloat(raw);\n }\n\n /**\n * How lit the edge is told to be: `0` at dead centre, `100` at the edge. The pointer\n * writes it from where it sits, the mount sweep as it lights and fades, and `[loop]` holds it at\n * 100 for as long as it is on, re-lighting it when a pointer leaves. `null` means\n * nothing has written it yet.\n *\n * For a pointer on a diagonal the NEARER axis wins rather than the two averaging, so a\n * cursor level with the bottom edge reads 100 wherever it is along it.\n */\n async getEdgeProximity(): Promise<number | null> {\n const raw = await this.readVar('--wr-border-glow-edge-proximity');\n return raw === null ? null : Number.parseFloat(raw);\n }\n\n /**\n * Point at the card, in client coordinates.\n *\n * **Refuses on a card with no box, which in a unit test is every card.** The component\n * measures the pointer against its own centre, and with a 0×0 rect that maths\n * degenerates: the centre is the top-left corner, and `1 / Math.min(0, 0)` pins the\n * proximity at 100 for every position on the page. Both would come back as confident\n * numbers describing nothing. Give the host a box first, exactly as the component's own\n * spec does:\n *\n * ```ts\n * const card = fixture.nativeElement.querySelector('wr-border-glow');\n * card.getBoundingClientRect = () => ({ left: 0, top: 0, width: 200, height: 100 }) as DOMRect;\n * ```\n *\n * A `pointermove` is dispatched on the host itself, so it needs no hit test and cannot\n * miss — the coordinates only ever reach the component's own arithmetic.\n */\n async movePointerTo(clientX: number, clientY: number): Promise<void> {\n const host = await this.host();\n const { width, height } = await host.getDimensions();\n if (!width || !height) {\n throw new Error(\n `WrBorderGlowHarness.movePointerTo(${clientX}, ${clientY}): this card measures ${width}×${height}, so a ` +\n 'pointer position over it means nothing — the component reads the cursor against the card centre, and ' +\n 'with no box the centre is the top-left corner and the proximity saturates for every coordinate. Stub ' +\n '`getBoundingClientRect` on the host first.'\n );\n }\n await host.dispatchEvent('pointermove', { clientX, clientY, pointerId: 1, isPrimary: true });\n }\n\n /**\n * Whether the one-shot mount sweep is running.\n *\n * The class is added synchronously when the sweep starts and removed when it ends\n * about four seconds later, or when the component is torn down — so a spec asserts\n * that it STARTED, and leaves the angle alone while it does. This is also the\n * reduced-motion assertion: `[animated]=\"true\"` for someone who asked for less motion\n * must leave this `false`, and no angle written at all.\n */\n async isSweeping(): Promise<boolean> {\n return (await this.host()).hasClass('wr-border-glow--sweeping');\n }\n\n /**\n * Whether the endless loop holds the card.\n *\n * The class is added when `[loop]` turns on, under reduced motion too — there the edge\n * stays lit and still, so the glow layers must stay visible — and removed when it turns\n * off. Like {@link isSweeping}, it answers that the loop is ON, not where the cone is:\n * the angle moves on every `requestAnimationFrame` and never settles, which is why the\n * class JSDoc lists no wait for it.\n */\n async isLooping(): Promise<boolean> {\n return (await this.host()).hasClass('wr-border-glow--looping');\n }\n\n /** Whether the halo layer is in the markup — the element the whole outer glow paints on. */\n async hasHaloLayer(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-border-glow__edge')()) !== null;\n }\n\n /**\n * Whether the decoration stays out of the accessibility tree.\n *\n * The halo layer is the component's only decorative NODE — every other layer is a\n * pseudo-element and so was never in the tree to begin with. It carries no text and no\n * name, so losing its `aria-hidden` puts an anonymous element between the reader and\n * the card's content.\n */\n async isDecorationHiddenFromAssistiveTech(): Promise<boolean> {\n return (await (await this.edge()).getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * The projected content's text, trimmed.\n *\n * Read from `.wr-border-glow__inner` rather than the host, which is the assertion:\n * content that lands as a bare host child instead of inside the wrapper renders\n * underneath the interior bloom, and reading the host would report the same string\n * either way.\n */\n async getContentText(): Promise<string> {\n return (await this.locatorFor('.wr-border-glow__inner')()).text();\n }\n\n /** The host's inline declarations — the component's whole written output. */\n private async declarations(): Promise<Map<string, string>> {\n return parseInlineDeclarations((await (await this.host()).getAttribute('style')) ?? '');\n }\n\n /** One inline custom property, or `null` when the component has not written it. */\n private async readVar(name: string): Promise<string | null> {\n return (await this.declarations()).get(name) ?? null;\n }\n\n /** One inline custom property that is always written, as a number. */\n private async readNumberVar(name: string, method: string): Promise<number> {\n const raw = await this.readVar(name);\n const value = raw === null ? Number.NaN : Number.parseFloat(raw);\n if (Number.isNaN(value)) {\n throw new Error(\n `WrBorderGlowHarness.${method}(): \\`${name}\\` reads \"${raw ?? '(absent)'}\" on the host. The component ` +\n 'writes this one on every input change whatever the inputs say, so a missing or unreadable value means ' +\n 'the variable bag stopped reaching the element at all.'\n );\n }\n return value;\n }\n}\n"],"mappings":";;;;;;;AAYA,MAAM,oBAAoB;CAAC;CAAI;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK;AAGvE,MAAM,qBAAqB;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MAAM,cAAc,MAAc,QAAc;EACtD,MAAM,MAAM,MAAM,KAAK,QAAQ,IAAI;EACnC,MAAM,QAAQ,QAAQ,OAAO,MAAa,OAAO,WAAW,GAAG;EAC/D,IAAI,OAAO,MAAM,KAAK,GACpB,MAAM,IAAI,MACR,uBAAuB,OAAM,QAAS,KAAI,YAAa,OAAO,WAAU,yLAEf;EAG7D,OAAO;CACT"}
1
+ {"version":3,"file":"ngwr-bits-border-glow-testing.mjs","names":[],"sources":["../../../projects/lib/bits/border-glow/testing/wr-border-glow-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrBorderGlowHarnessFilters } from './types';\n\n/** The seven halo steps, in the order the component writes them: 100%, 60%, 50%, 40%, 30%, 20%, 10%. */\nconst GLOW_VAR_SUFFIXES = ['', '-60', '-50', '-40', '-30', '-20', '-10'] as const;\n\n/** The seven mesh-gradient slots, spelled out rather than numbered — as the component names them. */\nconst GRADIENT_VAR_SLOTS = ['one', 'two', 'three', 'four', 'five', 'six', 'seven'] as const;\n\n/** `hsl(40deg 80% 80% / 65%)` — the alpha, which is the only part `glowIntensity` moves. */\nconst GLOW_ALPHA = /\\/\\s*(-?[\\d.]+)%\\s*\\)\\s*$/;\n\n/** `color-mix(in srgb, var(--wr-color-primary) 65%, transparent)` — the same alpha, for a CSS colour. */\nconst GLOW_MIX_ALPHA = /^color-mix\\(in srgb,\\s*.+\\s+(-?[\\d.]+)%\\s*,\\s*transparent\\s*\\)$/;\n\n/** `radial-gradient(at 80% 55%, #c084fc 0px, transparent 50%)` — the colour, not the position. */\nconst RADIAL_GRADIENT_COLOR = /^radial-gradient\\(\\s*at\\s+[^,]+,\\s*(.+?)\\s+0px\\s*,/;\n\n/** `linear-gradient(#c084fc 0 100%)` — the flat base slice. */\nconst LINEAR_GRADIENT_COLOR = /^linear-gradient\\(\\s*(.+?)\\s+0\\s+100%\\s*\\)$/;\n\n/**\n * Split an inline `style` attribute into its declarations.\n *\n * Read from the attribute rather than through `getCssValue()` on purpose. jsdom echoes\n * an inline custom property back through `getComputedStyle`, so the computed read passes\n * here and would answer something else entirely in a browser — where the stylesheet's\n * own per-theme default resolves and \"the author left this to the theme\" quietly becomes\n * a colour. The attribute holds what the component itself wrote, and nothing else.\n */\nfunction parseInlineDeclarations(style: string): Map<string, string> {\n const declarations = new Map<string, string>();\n for (const declaration of style.split(';')) {\n const colon = declaration.indexOf(':');\n if (colon === -1) continue;\n const name = declaration.slice(0, colon).trim();\n if (name !== '') declarations.set(name, declaration.slice(colon + 1).trim());\n }\n return declarations;\n}\n\n/**\n * Test harness for `<wr-border-glow>` — a card whose border lights up under the cursor.\n *\n * **Nearly all of this component is a bag of custom properties written onto the host,\n * and that is what the harness reads.** The paint itself — the conic mask, the stacked\n * `box-shadow` halo, the soft-light bloom — lives in the stylesheet, so a unit test can\n * never see it. What it CAN see is the arithmetic that feeds it, and that is where the\n * breakages are: the seven-step alpha ramp {@link getGlowAlphaRamp} derives from\n * `glowIntensity`, the `[0,1,2,0,1,2,1]` palette mapping in {@link getGradientColors}\n * with its clamp for short palettes, and the pointer maths behind\n * {@link getPointerAngle} / {@link getEdgeProximity}.\n *\n * **Every custom-property getter reads the inline declaration** — see\n * {@link parseInlineDeclarations} for why a computed read would be a different, and\n * wrong, question.\n *\n * **A colour getter answering `null` means the input is not on the host now**, which is\n * the contract when it is unset or its value was refused: the stylesheet's per-theme\n * default takes over. An input set and then put back to `null` comes off the host, so\n * `null` says nothing about whether it was ever set. Each colour input writes its own\n * `--wr-border-glow-input-*` twin, and that twin is what these read — never the hook it\n * stands in for (`--wr-border-glow-bg`, `-color`, `-gradient-*`), which stays the\n * author's, so a value an author put there is not what a getter reports.\n *\n * There is deliberately no `getGlowOpacity()`, `isGlowVisible()` or `isHovered()`: the\n * visible strength is a `calc()` in the stylesheet gated behind `:not(:hover)`, and\n * jsdom loads no stylesheet and matches no `:hover`, so any number would be invented.\n * There is no measured halo extent either — `.wr-border-glow__edge` is 0×0 in a test,\n * and {@link getGlowRadius} reads what the component asked for instead. And there is no\n * `getSweepProgress()` / `waitForSweep()`: the mount sweep is a four-second chain of\n * `requestAnimationFrame` tweens, so awaiting it either hangs the spec or samples one\n * frame and reports a value that was never settled. {@link isSweeping} answers the one\n * durable fact — that the sweep started. Nor is there a `getLoopAngle()` or a wait for\n * the loop: `[loop]` writes a new angle on every frame for as long as it is on, so the\n * angle never settles and any sample is one frame of an endless animation.\n * {@link isLooping} answers that it is on.\n *\n * @example\n * ```ts\n * const card = await loader.getHarness(WrBorderGlowHarness.with({ text: /Hover me/ }));\n *\n * expect(await card.getBorderRadius()).toBe(28);\n * expect(await card.getPointerAngle()).toBeNull(); // no pointer, sweep or loop has written one yet\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrBorderGlowHarness extends ComponentHarness {\n static hostSelector = 'wr-border-glow';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrBorderGlowHarnessFilters = {}): HarnessPredicate<WrBorderGlowHarness> {\n return new HarnessPredicate(WrBorderGlowHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getContentText(), text)\n )\n .addOption('sweeping', options.sweeping, async (harness, sweeping) => (await harness.isSweeping()) === sweeping)\n .addOption('looping', options.looping, async (harness, looping) => (await harness.isLooping()) === looping);\n }\n\n private readonly edge = this.locatorFor('.wr-border-glow__edge');\n\n /** The corner radius the stylesheet is told to round to, in pixels. */\n async getBorderRadius(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-radius', 'getBorderRadius');\n }\n\n /** How far past the card edge the halo is told to reach, in pixels. */\n async getGlowRadius(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-padding', 'getGlowRadius');\n }\n\n /**\n * The width of the lit cone, as a share of the perimeter.\n *\n * Unitless by contract — the stylesheet multiplies it — so a `px` creeping in here is\n * a real regression that leaves the mask with a length where it wants a number.\n */\n async getConeSpread(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-cone-spread', 'getConeSpread');\n }\n\n /** How sharply the halo fades as the cursor leaves an edge; lower is a wider falloff. */\n async getEdgeSensitivity(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-edge-sensitivity', 'getEdgeSensitivity');\n }\n\n /** Strength of the interior soft-light bloom, again unitless. */\n async getFillOpacity(): Promise<number> {\n return this.readNumberVar('--wr-border-glow-fill-opacity', 'getFillOpacity');\n }\n\n /**\n * The card fill `[backgroundColor]` asked for, or `null` when it left the fill to the\n * `--wr-border-glow-bg` hook, and so to the theme.\n *\n * The distinction is the whole point: an unset `[backgroundColor]` means the surface\n * token decides, light or dark, and a card that starts declaring its own fill has\n * stopped following the theme.\n */\n async getBackgroundColor(): Promise<string | null> {\n return this.readVar('--wr-border-glow-input-bg');\n }\n\n /**\n * The halo colour at full strength, or `null` when the theme decides.\n *\n * Comes back as written, in one of two forms, so this also pins the assembly: the\n * `hsl(H deg S% L% / A%)` built from bare `'H S L'` parts, or\n * `color-mix(in srgb, <colour> 100%, transparent)` for any other value. Be aware the\n * second form is a containment check and not a colour parser — `'banana'` is written\n * just as faithfully as `'#3567ff'`, and the browser then drops every halo declaration\n * that reads it — so a plausible-looking value here does not mean it paints. A value\n * that could escape the `color-mix()` is never written, and reads `null`.\n */\n async getGlowColor(): Promise<string | null> {\n return this.readVar('--wr-border-glow-input-color');\n }\n\n /**\n * The seven halo alphas in percent, brightest first, or `null` when no glow colour\n * is set.\n *\n * This is the whole of `[glowIntensity]`: the steps are `[100, 60, 50, 40, 30, 20,\n * 10]` multiplied by the intensity and clamped at 100, so `0.5` gives\n * `[50, 30, 25, 20, 15, 10, 5]` and anything above 1 saturates from the top down. The\n * clamp is one-sided — a negative intensity produces negative percentages, which a\n * browser drops as invalid declarations and the halo vanishes — so the numbers are\n * returned as written rather than corrected, which is how a spec can see it.\n *\n * Read from either form {@link getGlowColor} describes: the `/ A%` of an `hsl()`, or\n * the colour's share in a `color-mix()`. All seven steps must be in the form the first\n * one is — they are written together from one value, so a mix of the two is a ramp\n * that broke half way.\n */\n async getGlowAlphaRamp(): Promise<number[] | null> {\n const declarations = await this.declarations();\n const first = declarations.get('--wr-border-glow-input-color');\n if (first === undefined) return null;\n const form = first.startsWith('color-mix(') ? GLOW_MIX_ALPHA : GLOW_ALPHA;\n\n return GLOW_VAR_SUFFIXES.map(suffix => {\n const name = `--wr-border-glow-input-color${suffix}`;\n const raw = declarations.get(name);\n const alpha = raw === undefined ? null : form.exec(raw);\n if (!alpha) {\n throw new Error(\n `WrBorderGlowHarness.getGlowAlphaRamp(): \\`${name}\\` reads \"${raw ?? '(absent)'}\". The seven halo steps ` +\n 'are written together from one glow colour, so a step that is missing, carries no alpha, or is not ' +\n `the same \\`${form === GLOW_ALPHA ? 'hsl(… / N%)' : 'color-mix(in srgb, … N%, transparent)'}\\` as the ` +\n 'first means the ramp stopped being built — the halo would fade in bands the stylesheet cannot use.'\n );\n }\n return Number.parseFloat(alpha[1]);\n });\n }\n\n /**\n * The seven mesh-gradient colours, in slot order, or `null` when no palette was set.\n *\n * The slots do not map one-to-one onto the palette: they take colours\n * `[0, 1, 2, 0, 1, 2, 1]`, each index clamped to the last entry the palette actually\n * has. So a two-colour palette repeats the second colour rather than reading past the\n * end — which is the case worth a spec, since `undefined` in a `radial-gradient()`\n * kills the whole declaration silently.\n */\n async getGradientColors(): Promise<string[] | null> {\n const declarations = await this.declarations();\n if (!declarations.has('--wr-border-glow-input-gradient-one')) return null;\n\n return GRADIENT_VAR_SLOTS.map(slot => {\n const name = `--wr-border-glow-input-gradient-${slot}`;\n const raw = declarations.get(name);\n const colour = raw === undefined ? null : RADIAL_GRADIENT_COLOR.exec(raw);\n if (!colour) {\n throw new Error(\n `WrBorderGlowHarness.getGradientColors(): \\`${name}\\` reads \"${raw ?? '(absent)'}\", which is not the ` +\n '`radial-gradient(at X% Y%, <colour> 0px, …)` the component builds. All seven slots are written from ' +\n 'one palette, so one of them being different means the mapping broke, not the palette.'\n );\n }\n return colour[1];\n });\n }\n\n /**\n * The flat colour behind the mesh, or `null` when no palette was set.\n *\n * Always the palette's FIRST entry. Worth its own method because the base slice is the\n * one that shows where the gradients are transparent, and it drifting to the last\n * colour changes the card's whole cast without touching a gradient.\n */\n async getBaseGradientColor(): Promise<string | null> {\n const raw = await this.readVar('--wr-border-glow-input-gradient-base');\n if (raw === null) return null;\n\n const colour = LINEAR_GRADIENT_COLOR.exec(raw);\n if (!colour) {\n throw new Error(\n `WrBorderGlowHarness.getBaseGradientColor(): \\`--wr-border-glow-input-gradient-base\\` reads \"${raw}\", which is ` +\n 'not the `linear-gradient(<colour> 0 100%)` the component builds from the palette.'\n );\n }\n return colour[1];\n }\n\n /**\n * Where the lit cone points, in degrees: `0` is straight up and the angle grows\n * clockwise. Three things write it — the pointer, from where it sits; the mount sweep;\n * and `[loop]`, on every frame, or once at a resting 45 under reduced motion — so a\n * looping card answers with no pointer at all. `null` means nothing has written it yet.\n *\n * `null` is a state of its own rather than a stand-in for zero — the stylesheet's own\n * default applies until the first write, and a pointer at dead centre legitimately\n * reports `0`, so a harness that folded the two together could not tell an untouched\n * card from one being pointed at from the middle.\n */\n async getPointerAngle(): Promise<number | null> {\n const raw = await this.readVar('--wr-border-glow-angle');\n return raw === null ? null : Number.parseFloat(raw);\n }\n\n /**\n * How lit the edge is told to be: `0` at dead centre, `100` at the edge. The pointer\n * writes it from where it sits, the mount sweep as it lights and fades, and `[loop]` holds it at\n * 100 for as long as it is on, re-lighting it when a pointer leaves. `null` means\n * nothing has written it yet.\n *\n * For a pointer on a diagonal the NEARER axis wins rather than the two averaging, so a\n * cursor level with the bottom edge reads 100 wherever it is along it.\n */\n async getEdgeProximity(): Promise<number | null> {\n const raw = await this.readVar('--wr-border-glow-edge-proximity');\n return raw === null ? null : Number.parseFloat(raw);\n }\n\n /**\n * Point at the card, in client coordinates.\n *\n * **Refuses on a card with no box, which in a unit test is every card.** The component\n * measures the pointer against its own centre, and with a 0×0 rect that maths\n * degenerates: the centre is the top-left corner, and `1 / Math.min(0, 0)` pins the\n * proximity at 100 for every position on the page. Both would come back as confident\n * numbers describing nothing. Give the host a box first, exactly as the component's own\n * spec does:\n *\n * ```ts\n * const card = fixture.nativeElement.querySelector('wr-border-glow');\n * card.getBoundingClientRect = () => ({ left: 0, top: 0, width: 200, height: 100 }) as DOMRect;\n * ```\n *\n * A `pointermove` is dispatched on the host itself, so it needs no hit test and cannot\n * miss — the coordinates only ever reach the component's own arithmetic.\n */\n async movePointerTo(clientX: number, clientY: number): Promise<void> {\n const host = await this.host();\n const { width, height } = await host.getDimensions();\n if (!width || !height) {\n throw new Error(\n `WrBorderGlowHarness.movePointerTo(${clientX}, ${clientY}): this card measures ${width}×${height}, so a ` +\n 'pointer position over it means nothing — the component reads the cursor against the card centre, and ' +\n 'with no box the centre is the top-left corner and the proximity saturates for every coordinate. Stub ' +\n '`getBoundingClientRect` on the host first.'\n );\n }\n await host.dispatchEvent('pointermove', { clientX, clientY, pointerId: 1, isPrimary: true });\n }\n\n /**\n * Whether the one-shot mount sweep is running.\n *\n * The class is added synchronously when the sweep starts and removed when it ends\n * about four seconds later, or when the component is torn down — so a spec asserts\n * that it STARTED, and leaves the angle alone while it does. This is also the\n * reduced-motion assertion: `[animated]=\"true\"` for someone who asked for less motion\n * must leave this `false`, and no angle written at all.\n */\n async isSweeping(): Promise<boolean> {\n return (await this.host()).hasClass('wr-border-glow--sweeping');\n }\n\n /**\n * Whether the endless loop holds the card.\n *\n * The class is added when `[loop]` turns on, under reduced motion too — there the edge\n * stays lit and still, so the glow layers must stay visible — and removed when it turns\n * off. Like {@link isSweeping}, it answers that the loop is ON, not where the cone is:\n * the angle moves on every `requestAnimationFrame` and never settles, which is why the\n * class JSDoc lists no wait for it.\n */\n async isLooping(): Promise<boolean> {\n return (await this.host()).hasClass('wr-border-glow--looping');\n }\n\n /** Whether the halo layer is in the markup — the element the whole outer glow paints on. */\n async hasHaloLayer(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-border-glow__edge')()) !== null;\n }\n\n /**\n * Whether the decoration stays out of the accessibility tree.\n *\n * The halo layer is the component's only decorative NODE — every other layer is a\n * pseudo-element and so was never in the tree to begin with. It carries no text and no\n * name, so losing its `aria-hidden` puts an anonymous element between the reader and\n * the card's content.\n */\n async isDecorationHiddenFromAssistiveTech(): Promise<boolean> {\n return (await (await this.edge()).getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * The projected content's text, trimmed.\n *\n * Read from `.wr-border-glow__inner` rather than the host, which is the assertion:\n * content that lands as a bare host child instead of inside the wrapper renders\n * underneath the interior bloom, and reading the host would report the same string\n * either way.\n */\n async getContentText(): Promise<string> {\n return (await this.locatorFor('.wr-border-glow__inner')()).text();\n }\n\n /** The host's inline declarations — the component's whole written output. */\n private async declarations(): Promise<Map<string, string>> {\n return parseInlineDeclarations((await (await this.host()).getAttribute('style')) ?? '');\n }\n\n /** One inline custom property, or `null` when the component has not written it. */\n private async readVar(name: string): Promise<string | null> {\n return (await this.declarations()).get(name) ?? null;\n }\n\n /** One inline custom property that is always written, as a number. */\n private async readNumberVar(name: string, method: string): Promise<number> {\n const raw = await this.readVar(name);\n const value = raw === null ? Number.NaN : Number.parseFloat(raw);\n if (Number.isNaN(value)) {\n throw new Error(\n `WrBorderGlowHarness.${method}(): \\`${name}\\` reads \"${raw ?? '(absent)'}\" on the host. The component ` +\n 'writes this one on every input change whatever the inputs say, so a missing or unreadable value means ' +\n 'the variable bag stopped reaching the element at all.'\n );\n }\n return value;\n }\n}\n"],"mappings":";;;;;;;AAYA,MAAM,oBAAoB;CAAC;CAAI;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK;AAGvE,MAAM,qBAAqB;CAAC;CAAO;CAAO;CAAS;CAAQ;CAAQ;CAAO;AAAO;AAGjF,MAAM,aAAa;AAGnB,MAAM,iBAAiB;AAGvB,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AAa,OAAO,WAAW,GAAG;EAC/D,IAAI,OAAO,MAAM,KAAK,GACpB,MAAM,IAAI,MACR,uBAAuB,OAAM,QAAS,KAAI,YAAa,OAAO,WAAU,yLAEf;EAG7D,OAAO;CACT"}
@@ -47,13 +47,13 @@ const GRADIENT_POSITIONS = [
47
47
  "51% 4%"
48
48
  ];
49
49
  const GRADIENT_VAR_NAMES = [
50
- "--wr-border-glow-gradient-one",
51
- "--wr-border-glow-gradient-two",
52
- "--wr-border-glow-gradient-three",
53
- "--wr-border-glow-gradient-four",
54
- "--wr-border-glow-gradient-five",
55
- "--wr-border-glow-gradient-six",
56
- "--wr-border-glow-gradient-seven"
50
+ "--wr-border-glow-input-gradient-one",
51
+ "--wr-border-glow-input-gradient-two",
52
+ "--wr-border-glow-input-gradient-three",
53
+ "--wr-border-glow-input-gradient-four",
54
+ "--wr-border-glow-input-gradient-five",
55
+ "--wr-border-glow-input-gradient-six",
56
+ "--wr-border-glow-input-gradient-seven"
57
57
  ];
58
58
  const GRADIENT_COLOR_INDEX = [
59
59
  0,
@@ -76,7 +76,7 @@ function buildGlowVars(glowColor, intensity) {
76
76
  const out = {};
77
77
  for (let i = 0; i < GLOW_OPACITY_STEPS.length; i++) {
78
78
  const alpha = Math.min(GLOW_OPACITY_STEPS[i] * intensity, 100);
79
- out[`--wr-border-glow-color${GLOW_VAR_SUFFIXES[i]}`] = parts ? `hsl(${base} / ${alpha}%)` : `color-mix(in srgb, ${base} ${alpha}%, transparent)`;
79
+ out[`--wr-border-glow-input-color${GLOW_VAR_SUFFIXES[i]}`] = parts ? `hsl(${base} / ${alpha}%)` : `color-mix(in srgb, ${base} ${alpha}%, transparent)`;
80
80
  }
81
81
  return out;
82
82
  }
@@ -87,7 +87,7 @@ function buildGradientVars(colors) {
87
87
  const colour = palette[Math.min(GRADIENT_COLOR_INDEX[i], palette.length - 1)];
88
88
  out[GRADIENT_VAR_NAMES[i]] = `radial-gradient(at ${GRADIENT_POSITIONS[i]}, ${colour} 0px, transparent 50%)`;
89
89
  }
90
- out["--wr-border-glow-gradient-base"] = `linear-gradient(${palette[0]} 0 100%)`;
90
+ out["--wr-border-glow-input-gradient-base"] = `linear-gradient(${palette[0]} 0 100%)`;
91
91
  return out;
92
92
  }
93
93
  function animateValue(opts) {
@@ -157,33 +157,24 @@ var WrBorderGlow = class WrBorderGlow {
157
157
  isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
158
158
  pointerInside = false;
159
159
  cssVars = computed(() => {
160
- const vars = {
161
- "--wr-border-glow-radius": `${this.borderRadius()}px`,
162
- "--wr-border-glow-padding": `${this.glowRadius()}px`,
163
- "--wr-border-glow-cone-spread": String(this.coneSpread()),
164
- "--wr-border-glow-edge-sensitivity": String(this.edgeSensitivity()),
165
- "--wr-border-glow-fill-opacity": String(this.fillOpacity())
166
- };
160
+ const vars = {};
167
161
  const colors = this.colors();
168
162
  if (colors !== null) Object.assign(vars, buildGradientVars(colors));
169
163
  const bg = this.backgroundColor();
170
- if (bg !== null && isSafeCssValue(bg)) vars["--wr-border-glow-bg"] = bg;
164
+ if (bg !== null && isSafeCssValue(bg)) vars["--wr-border-glow-input-bg"] = bg;
171
165
  const glow = this.glowColor();
172
166
  const glowVars = glow === null ? null : buildGlowVars(glow, this.glowIntensity());
173
167
  if (glowVars !== null) Object.assign(vars, glowVars);
174
168
  return vars;
175
169
  }, ...ngDevMode ? [{ debugName: "cssVars" }] : /* istanbul ignore next */ []);
176
170
  constructor() {
177
- let written = {};
171
+ let written = [];
178
172
  effect(() => {
179
173
  const { style } = this.el.nativeElement;
180
174
  const vars = this.cssVars();
181
- for (const [k, held] of Object.entries(written)) if (!Object.hasOwn(vars, k) && style.getPropertyValue(k) === held) style.removeProperty(k);
182
- written = {};
183
- for (const [k, v] of Object.entries(vars)) {
184
- style.setProperty(k, v);
185
- written[k] = style.getPropertyValue(k);
186
- }
175
+ for (const k of written) if (!Object.hasOwn(vars, k)) style.removeProperty(k);
176
+ written = Object.keys(vars);
177
+ for (const k of written) style.setProperty(k, vars[k]);
187
178
  });
188
179
  if (!this.isBrowser) return;
189
180
  effect((onCleanup) => {
@@ -425,11 +416,18 @@ var WrBorderGlow = class WrBorderGlow {
425
416
  "pointermove": "onPointerMove($event)",
426
417
  "pointerleave": "onPointerLeave()"
427
418
  },
419
+ properties: {
420
+ "style.--wr-border-glow-radius.px": "borderRadius()",
421
+ "style.--wr-border-glow-padding.px": "glowRadius()",
422
+ "style.--wr-border-glow-cone-spread": "coneSpread()",
423
+ "style.--wr-border-glow-edge-sensitivity": "edgeSensitivity()",
424
+ "style.--wr-border-glow-fill-opacity": "fillOpacity()"
425
+ },
428
426
  classAttribute: "wr-border-glow"
429
427
  },
430
428
  ngImport: i0,
431
429
  template: "<span class=\"wr-border-glow__edge\" aria-hidden=\"true\"></span>\n<div class=\"wr-border-glow__inner\">\n <ng-content />\n</div>\n",
432
- styles: [".wr-border-glow{--wr-border-glow-edge-proximity: 0;--wr-border-glow-angle: 45deg;--wr-border-glow-color: light-dark(hsl(40deg 90% 45% / 100%), hsl(40deg 80% 80% / 100%));--wr-border-glow-color-60: light-dark(hsl(40deg 90% 45% / 60%), hsl(40deg 80% 80% / 60%));--wr-border-glow-color-50: light-dark(hsl(40deg 90% 45% / 50%), hsl(40deg 80% 80% / 50%));--wr-border-glow-color-40: light-dark(hsl(40deg 90% 45% / 40%), hsl(40deg 80% 80% / 40%));--wr-border-glow-color-30: light-dark(hsl(40deg 90% 45% / 30%), hsl(40deg 80% 80% / 30%));--wr-border-glow-color-20: light-dark(hsl(40deg 90% 45% / 20%), hsl(40deg 80% 80% / 20%));--wr-border-glow-color-10: light-dark(hsl(40deg 90% 45% / 10%), hsl(40deg 80% 80% / 10%));--wr-border-glow-gradient-one: radial-gradient( at 80% 55%, light-dark(hsl(268deg 80% 50%), hsl(268deg 100% 76%)) 0px, transparent 50% );--wr-border-glow-gradient-two: radial-gradient( at 69% 34%, light-dark(hsl(349deg 85% 52%), hsl(349deg 100% 74%)) 0px, transparent 50% );--wr-border-glow-gradient-three: radial-gradient( at 8% 6%, light-dark(hsl(136deg 70% 38%), hsl(136deg 100% 78%)) 0px, transparent 50% );--wr-border-glow-gradient-four: radial-gradient( at 41% 38%, light-dark(hsl(192deg 90% 40%), hsl(192deg 100% 64%)) 0px, transparent 50% );--wr-border-glow-gradient-five: radial-gradient( at 86% 85%, light-dark(hsl(186deg 90% 38%), hsl(186deg 100% 74%)) 0px, transparent 50% );--wr-border-glow-gradient-six: radial-gradient( at 82% 18%, light-dark(hsl(40deg 95% 45%), hsl(52deg 100% 65%)) 0px, transparent 50% );--wr-border-glow-gradient-seven: radial-gradient( at 51% 4%, light-dark(hsl(12deg 90% 50%), hsl(12deg 100% 72%)) 0px, transparent 50% );--wr-border-glow-gradient-base: linear-gradient(light-dark(hsl(262deg 70% 50%), #c299ff) 0 100%);--wr-border-glow-outline: light-dark(var(--wr-border-base), rgb(255 255 255 / 15%));--wr-border-glow-edge-shadow: inset 0 0 0 1px var(--wr-border-glow-color), inset 0 0 1px 0 light-dark(transparent, var(--wr-border-glow-color-60)), inset 0 0 3px 0 light-dark(transparent, var(--wr-border-glow-color-50)), inset 0 0 6px 0 light-dark(transparent, var(--wr-border-glow-color-40)), inset 0 0 15px 0 light-dark(transparent, var(--wr-border-glow-color-30)), inset 0 0 25px 2px light-dark(transparent, var(--wr-border-glow-color-20)), inset 0 0 50px 2px light-dark(transparent, var(--wr-border-glow-color-10)), 0 0 1px 0 var(--wr-border-glow-color-60), 0 0 3px 0 var(--wr-border-glow-color-50), 0 0 6px 0 var(--wr-border-glow-color-40), 0 0 15px 0 var(--wr-border-glow-color-30), 0 0 25px 2px var(--wr-border-glow-color-20), 0 0 50px 2px var(--wr-border-glow-color-10);--wr-border-glow-halo-blend: normal;--wr-border-glow-fill-blend: normal;--wr-border-glow-fill-scale: .25;--wr-border-glow-edge-sensitivity: 30;--wr-border-glow-color-sensitivity: calc(var(--wr-border-glow-edge-sensitivity) + 20);--wr-border-glow-radius: 28px;--wr-border-glow-padding: 40px;--wr-border-glow-cone-spread: 25;position:relative;display:grid;border-radius:var(--wr-border-glow-radius);background:var(--wr-border-glow-bg, var(--wr-color-surface, #fff));overflow:visible;isolation:isolate;transform:translateZ(.01px);box-shadow:inset 0 0 0 1px var(--wr-border-glow-outline)}.wr-border-glow:before,.wr-border-glow:after,.wr-border-glow>.wr-border-glow__edge{content:\"\";position:absolute;inset:0;border-radius:inherit;transition:opacity .25s ease-out;z-index:-1}.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping):before,.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping):after,.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping)>.wr-border-glow__edge{opacity:0;transition:opacity .75s ease-in-out}.wr-border-glow:before{border:1px solid transparent;background:linear-gradient(var(--wr-border-glow-bg, var(--wr-color-surface, #fff)) 0 100%) padding-box,linear-gradient(#fff0 0 100%) border-box,var(--wr-border-glow-gradient-one, radial-gradient(at 80% 55%, hsl(268, 100%, 76%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-two, radial-gradient(at 69% 34%, hsl(349, 100%, 74%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-three, radial-gradient(at 8% 6%, hsl(136, 100%, 78%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-four, radial-gradient(at 41% 38%, hsl(192, 100%, 64%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-five, radial-gradient(at 86% 85%, hsl(186, 100%, 74%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-six, radial-gradient(at 82% 18%, hsl(52, 100%, 65%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-seven, radial-gradient(at 51% 4%, hsl(12, 100%, 72%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-base, linear-gradient(#c299ff 0 100%)) border-box;opacity:calc((var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-color-sensitivity)) / (100 - var(--wr-border-glow-color-sensitivity)));-webkit-mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black calc(var(--wr-border-glow-cone-spread) * 1%),transparent calc((var(--wr-border-glow-cone-spread) + 15) * 1%),transparent calc((100 - var(--wr-border-glow-cone-spread) - 15) * 1%),black calc((100 - var(--wr-border-glow-cone-spread)) * 1%));mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black calc(var(--wr-border-glow-cone-spread) * 1%),transparent calc((var(--wr-border-glow-cone-spread) + 15) * 1%),transparent calc((100 - var(--wr-border-glow-cone-spread) - 15) * 1%),black calc((100 - var(--wr-border-glow-cone-spread)) * 1%))}.wr-border-glow:after{border:1px solid transparent;background:var(--wr-border-glow-gradient-one, radial-gradient(at 80% 55%, hsl(268, 100%, 76%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-two, radial-gradient(at 69% 34%, hsl(349, 100%, 74%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-three, radial-gradient(at 8% 6%, hsl(136, 100%, 78%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-four, radial-gradient(at 41% 38%, hsl(192, 100%, 64%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-five, radial-gradient(at 86% 85%, hsl(186, 100%, 74%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-six, radial-gradient(at 82% 18%, hsl(52, 100%, 65%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-seven, radial-gradient(at 51% 4%, hsl(12, 100%, 72%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-base, linear-gradient(#c299ff 0 100%)) padding-box;-webkit-mask-image:linear-gradient(to bottom,#000,#000),radial-gradient(ellipse at 50% 50%,black 40%,transparent 65%),radial-gradient(ellipse at 66% 66%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 66% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 66%,black 5%,transparent 40%),conic-gradient(from var(--wr-border-glow-angle) at center,transparent 5%,black 15%,black 85%,transparent 95%);mask-image:linear-gradient(to bottom,#000,#000),radial-gradient(ellipse at 50% 50%,black 40%,transparent 65%),radial-gradient(ellipse at 66% 66%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 66% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 66%,black 5%,transparent 40%),conic-gradient(from var(--wr-border-glow-angle) at center,transparent 5%,black 15%,black 85%,transparent 95%);-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mask-composite:subtract,add,add,add,add,add;opacity:calc(var(--wr-border-glow-fill-opacity, .5) * var(--wr-border-glow-fill-scale) * (var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-color-sensitivity)) / (100 - var(--wr-border-glow-color-sensitivity)));mix-blend-mode:var(--wr-border-glow-fill-blend)}.wr-border-glow>.wr-border-glow__edge{inset:calc(var(--wr-border-glow-padding) * -1);pointer-events:none;z-index:1;-webkit-mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black 2.5%,transparent 10%,transparent 90%,black 97.5%);mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black 2.5%,transparent 10%,transparent 90%,black 97.5%);opacity:calc((var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-edge-sensitivity)) / (100 - var(--wr-border-glow-edge-sensitivity)));mix-blend-mode:var(--wr-border-glow-halo-blend)}.wr-border-glow>.wr-border-glow__edge:before{content:\"\";position:absolute;inset:var(--wr-border-glow-padding);border-radius:inherit;box-shadow:var(--wr-border-glow-edge-shadow)}.wr-border-glow__inner{position:relative;z-index:1;display:flex;flex-direction:column}\n"],
430
+ styles: [".wr-border-glow{--wr-border-glow-edge-proximity: 0;--wr-border-glow-angle: 45deg;--wr-border-glow-bg: var(--wr-color-surface);--wr-border-glow-input-bg: initial;--wr-border-glow-input-color: initial;--wr-border-glow-input-color-60: initial;--wr-border-glow-input-color-50: initial;--wr-border-glow-input-color-40: initial;--wr-border-glow-input-color-30: initial;--wr-border-glow-input-color-20: initial;--wr-border-glow-input-color-10: initial;--wr-border-glow-input-gradient-one: initial;--wr-border-glow-input-gradient-two: initial;--wr-border-glow-input-gradient-three: initial;--wr-border-glow-input-gradient-four: initial;--wr-border-glow-input-gradient-five: initial;--wr-border-glow-input-gradient-six: initial;--wr-border-glow-input-gradient-seven: initial;--wr-border-glow-input-gradient-base: initial;--wr-border-glow-color: light-dark(hsl(40deg 90% 45% / 100%), hsl(40deg 80% 80% / 100%));--wr-border-glow-color-60: light-dark(hsl(40deg 90% 45% / 60%), hsl(40deg 80% 80% / 60%));--wr-border-glow-color-50: light-dark(hsl(40deg 90% 45% / 50%), hsl(40deg 80% 80% / 50%));--wr-border-glow-color-40: light-dark(hsl(40deg 90% 45% / 40%), hsl(40deg 80% 80% / 40%));--wr-border-glow-color-30: light-dark(hsl(40deg 90% 45% / 30%), hsl(40deg 80% 80% / 30%));--wr-border-glow-color-20: light-dark(hsl(40deg 90% 45% / 20%), hsl(40deg 80% 80% / 20%));--wr-border-glow-color-10: light-dark(hsl(40deg 90% 45% / 10%), hsl(40deg 80% 80% / 10%));--wr-border-glow-gradient-one: radial-gradient( at 80% 55%, light-dark(hsl(268deg 80% 50%), hsl(268deg 100% 76%)) 0px, transparent 50% );--wr-border-glow-gradient-two: radial-gradient( at 69% 34%, light-dark(hsl(349deg 85% 52%), hsl(349deg 100% 74%)) 0px, transparent 50% );--wr-border-glow-gradient-three: radial-gradient( at 8% 6%, light-dark(hsl(136deg 70% 38%), hsl(136deg 100% 78%)) 0px, transparent 50% );--wr-border-glow-gradient-four: radial-gradient( at 41% 38%, light-dark(hsl(192deg 90% 40%), hsl(192deg 100% 64%)) 0px, transparent 50% );--wr-border-glow-gradient-five: radial-gradient( at 86% 85%, light-dark(hsl(186deg 90% 38%), hsl(186deg 100% 74%)) 0px, transparent 50% );--wr-border-glow-gradient-six: radial-gradient( at 82% 18%, light-dark(hsl(40deg 95% 45%), hsl(52deg 100% 65%)) 0px, transparent 50% );--wr-border-glow-gradient-seven: radial-gradient( at 51% 4%, light-dark(hsl(12deg 90% 50%), hsl(12deg 100% 72%)) 0px, transparent 50% );--wr-border-glow-gradient-base: linear-gradient(light-dark(hsl(262deg 70% 50%), #c299ff) 0 100%);--wr-border-glow-outline: light-dark(var(--wr-border-base), rgb(255 255 255 / 15%));--wr-border-glow-edge-shadow: inset 0 0 0 1px var(--wr-border-glow-input-color, var(--wr-border-glow-color)), inset 0 0 1px 0 light-dark(transparent, var(--wr-border-glow-input-color-60, var(--wr-border-glow-color-60))), inset 0 0 3px 0 light-dark(transparent, var(--wr-border-glow-input-color-50, var(--wr-border-glow-color-50))), inset 0 0 6px 0 light-dark(transparent, var(--wr-border-glow-input-color-40, var(--wr-border-glow-color-40))), inset 0 0 15px 0 light-dark(transparent, var(--wr-border-glow-input-color-30, var(--wr-border-glow-color-30))), inset 0 0 25px 2px light-dark(transparent, var(--wr-border-glow-input-color-20, var(--wr-border-glow-color-20))), inset 0 0 50px 2px light-dark(transparent, var(--wr-border-glow-input-color-10, var(--wr-border-glow-color-10))), 0 0 1px 0 var(--wr-border-glow-input-color-60, var(--wr-border-glow-color-60)), 0 0 3px 0 var(--wr-border-glow-input-color-50, var(--wr-border-glow-color-50)), 0 0 6px 0 var(--wr-border-glow-input-color-40, var(--wr-border-glow-color-40)), 0 0 15px 0 var(--wr-border-glow-input-color-30, var(--wr-border-glow-color-30)), 0 0 25px 2px var(--wr-border-glow-input-color-20, var(--wr-border-glow-color-20)), 0 0 50px 2px var(--wr-border-glow-input-color-10, var(--wr-border-glow-color-10));--wr-border-glow-halo-blend: normal;--wr-border-glow-fill-blend: normal;--wr-border-glow-fill-scale: .25;--wr-border-glow-edge-sensitivity: 30;--wr-border-glow-color-sensitivity: calc(var(--wr-border-glow-edge-sensitivity) + 20);--wr-border-glow-radius: 28px;--wr-border-glow-padding: 40px;--wr-border-glow-cone-spread: 25;position:relative;display:grid;border-radius:var(--wr-border-glow-radius);background:var(--wr-border-glow-input-bg, var(--wr-border-glow-bg));overflow:visible;isolation:isolate;transform:translateZ(.01px);box-shadow:inset 0 0 0 1px var(--wr-border-glow-outline)}.wr-border-glow:before,.wr-border-glow:after,.wr-border-glow>.wr-border-glow__edge{content:\"\";position:absolute;inset:0;border-radius:inherit;transition:opacity .25s ease-out;z-index:-1}.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping):before,.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping):after,.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping)>.wr-border-glow__edge{opacity:0;transition:opacity .75s ease-in-out}.wr-border-glow:before{border:1px solid transparent;background:linear-gradient(var(--wr-border-glow-input-bg, var(--wr-border-glow-bg)) 0 100%) padding-box,linear-gradient(#fff0 0 100%) border-box,var(--wr-border-glow-input-gradient-one, var(--wr-border-glow-gradient-one)) border-box,var(--wr-border-glow-input-gradient-two, var(--wr-border-glow-gradient-two)) border-box,var(--wr-border-glow-input-gradient-three, var(--wr-border-glow-gradient-three)) border-box,var(--wr-border-glow-input-gradient-four, var(--wr-border-glow-gradient-four)) border-box,var(--wr-border-glow-input-gradient-five, var(--wr-border-glow-gradient-five)) border-box,var(--wr-border-glow-input-gradient-six, var(--wr-border-glow-gradient-six)) border-box,var(--wr-border-glow-input-gradient-seven, var(--wr-border-glow-gradient-seven)) border-box,var(--wr-border-glow-input-gradient-base, var(--wr-border-glow-gradient-base)) border-box;opacity:calc((var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-color-sensitivity)) / (100 - var(--wr-border-glow-color-sensitivity)));-webkit-mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black calc(var(--wr-border-glow-cone-spread) * 1%),transparent calc((var(--wr-border-glow-cone-spread) + 15) * 1%),transparent calc((100 - var(--wr-border-glow-cone-spread) - 15) * 1%),black calc((100 - var(--wr-border-glow-cone-spread)) * 1%));mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black calc(var(--wr-border-glow-cone-spread) * 1%),transparent calc((var(--wr-border-glow-cone-spread) + 15) * 1%),transparent calc((100 - var(--wr-border-glow-cone-spread) - 15) * 1%),black calc((100 - var(--wr-border-glow-cone-spread)) * 1%))}.wr-border-glow:after{border:1px solid transparent;background:var(--wr-border-glow-input-gradient-one, var(--wr-border-glow-gradient-one)) padding-box,var(--wr-border-glow-input-gradient-two, var(--wr-border-glow-gradient-two)) padding-box,var(--wr-border-glow-input-gradient-three, var(--wr-border-glow-gradient-three)) padding-box,var(--wr-border-glow-input-gradient-four, var(--wr-border-glow-gradient-four)) padding-box,var(--wr-border-glow-input-gradient-five, var(--wr-border-glow-gradient-five)) padding-box,var(--wr-border-glow-input-gradient-six, var(--wr-border-glow-gradient-six)) padding-box,var(--wr-border-glow-input-gradient-seven, var(--wr-border-glow-gradient-seven)) padding-box,var(--wr-border-glow-input-gradient-base, var(--wr-border-glow-gradient-base)) padding-box;-webkit-mask-image:linear-gradient(to bottom,#000,#000),radial-gradient(ellipse at 50% 50%,black 40%,transparent 65%),radial-gradient(ellipse at 66% 66%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 66% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 66%,black 5%,transparent 40%),conic-gradient(from var(--wr-border-glow-angle) at center,transparent 5%,black 15%,black 85%,transparent 95%);mask-image:linear-gradient(to bottom,#000,#000),radial-gradient(ellipse at 50% 50%,black 40%,transparent 65%),radial-gradient(ellipse at 66% 66%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 66% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 66%,black 5%,transparent 40%),conic-gradient(from var(--wr-border-glow-angle) at center,transparent 5%,black 15%,black 85%,transparent 95%);-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mask-composite:subtract,add,add,add,add,add;opacity:calc(var(--wr-border-glow-fill-opacity, .5) * var(--wr-border-glow-fill-scale) * (var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-color-sensitivity)) / (100 - var(--wr-border-glow-color-sensitivity)));mix-blend-mode:var(--wr-border-glow-fill-blend)}.wr-border-glow>.wr-border-glow__edge{inset:calc(var(--wr-border-glow-padding) * -1);pointer-events:none;z-index:1;-webkit-mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black 2.5%,transparent 10%,transparent 90%,black 97.5%);mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black 2.5%,transparent 10%,transparent 90%,black 97.5%);opacity:calc((var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-edge-sensitivity)) / (100 - var(--wr-border-glow-edge-sensitivity)));mix-blend-mode:var(--wr-border-glow-halo-blend)}.wr-border-glow>.wr-border-glow__edge:before{content:\"\";position:absolute;inset:var(--wr-border-glow-padding);border-radius:inherit;box-shadow:var(--wr-border-glow-edge-shadow)}.wr-border-glow__inner{position:relative;z-index:1;display:flex;flex-direction:column}\n"],
433
431
  encapsulation: i0.ViewEncapsulation.None
434
432
  });
435
433
  };
@@ -445,12 +443,17 @@ i0.ɵɵngDeclareClassMetadata({
445
443
  encapsulation: ViewEncapsulation.None,
446
444
  host: {
447
445
  class: "wr-border-glow",
446
+ "[style.--wr-border-glow-radius.px]": "borderRadius()",
447
+ "[style.--wr-border-glow-padding.px]": "glowRadius()",
448
+ "[style.--wr-border-glow-cone-spread]": "coneSpread()",
449
+ "[style.--wr-border-glow-edge-sensitivity]": "edgeSensitivity()",
450
+ "[style.--wr-border-glow-fill-opacity]": "fillOpacity()",
448
451
  "(pointerenter)": "onPointerEnter()",
449
452
  "(pointermove)": "onPointerMove($event)",
450
453
  "(pointerleave)": "onPointerLeave()"
451
454
  },
452
455
  template: "<span class=\"wr-border-glow__edge\" aria-hidden=\"true\"></span>\n<div class=\"wr-border-glow__inner\">\n <ng-content />\n</div>\n",
453
- styles: [".wr-border-glow{--wr-border-glow-edge-proximity: 0;--wr-border-glow-angle: 45deg;--wr-border-glow-color: light-dark(hsl(40deg 90% 45% / 100%), hsl(40deg 80% 80% / 100%));--wr-border-glow-color-60: light-dark(hsl(40deg 90% 45% / 60%), hsl(40deg 80% 80% / 60%));--wr-border-glow-color-50: light-dark(hsl(40deg 90% 45% / 50%), hsl(40deg 80% 80% / 50%));--wr-border-glow-color-40: light-dark(hsl(40deg 90% 45% / 40%), hsl(40deg 80% 80% / 40%));--wr-border-glow-color-30: light-dark(hsl(40deg 90% 45% / 30%), hsl(40deg 80% 80% / 30%));--wr-border-glow-color-20: light-dark(hsl(40deg 90% 45% / 20%), hsl(40deg 80% 80% / 20%));--wr-border-glow-color-10: light-dark(hsl(40deg 90% 45% / 10%), hsl(40deg 80% 80% / 10%));--wr-border-glow-gradient-one: radial-gradient( at 80% 55%, light-dark(hsl(268deg 80% 50%), hsl(268deg 100% 76%)) 0px, transparent 50% );--wr-border-glow-gradient-two: radial-gradient( at 69% 34%, light-dark(hsl(349deg 85% 52%), hsl(349deg 100% 74%)) 0px, transparent 50% );--wr-border-glow-gradient-three: radial-gradient( at 8% 6%, light-dark(hsl(136deg 70% 38%), hsl(136deg 100% 78%)) 0px, transparent 50% );--wr-border-glow-gradient-four: radial-gradient( at 41% 38%, light-dark(hsl(192deg 90% 40%), hsl(192deg 100% 64%)) 0px, transparent 50% );--wr-border-glow-gradient-five: radial-gradient( at 86% 85%, light-dark(hsl(186deg 90% 38%), hsl(186deg 100% 74%)) 0px, transparent 50% );--wr-border-glow-gradient-six: radial-gradient( at 82% 18%, light-dark(hsl(40deg 95% 45%), hsl(52deg 100% 65%)) 0px, transparent 50% );--wr-border-glow-gradient-seven: radial-gradient( at 51% 4%, light-dark(hsl(12deg 90% 50%), hsl(12deg 100% 72%)) 0px, transparent 50% );--wr-border-glow-gradient-base: linear-gradient(light-dark(hsl(262deg 70% 50%), #c299ff) 0 100%);--wr-border-glow-outline: light-dark(var(--wr-border-base), rgb(255 255 255 / 15%));--wr-border-glow-edge-shadow: inset 0 0 0 1px var(--wr-border-glow-color), inset 0 0 1px 0 light-dark(transparent, var(--wr-border-glow-color-60)), inset 0 0 3px 0 light-dark(transparent, var(--wr-border-glow-color-50)), inset 0 0 6px 0 light-dark(transparent, var(--wr-border-glow-color-40)), inset 0 0 15px 0 light-dark(transparent, var(--wr-border-glow-color-30)), inset 0 0 25px 2px light-dark(transparent, var(--wr-border-glow-color-20)), inset 0 0 50px 2px light-dark(transparent, var(--wr-border-glow-color-10)), 0 0 1px 0 var(--wr-border-glow-color-60), 0 0 3px 0 var(--wr-border-glow-color-50), 0 0 6px 0 var(--wr-border-glow-color-40), 0 0 15px 0 var(--wr-border-glow-color-30), 0 0 25px 2px var(--wr-border-glow-color-20), 0 0 50px 2px var(--wr-border-glow-color-10);--wr-border-glow-halo-blend: normal;--wr-border-glow-fill-blend: normal;--wr-border-glow-fill-scale: .25;--wr-border-glow-edge-sensitivity: 30;--wr-border-glow-color-sensitivity: calc(var(--wr-border-glow-edge-sensitivity) + 20);--wr-border-glow-radius: 28px;--wr-border-glow-padding: 40px;--wr-border-glow-cone-spread: 25;position:relative;display:grid;border-radius:var(--wr-border-glow-radius);background:var(--wr-border-glow-bg, var(--wr-color-surface, #fff));overflow:visible;isolation:isolate;transform:translateZ(.01px);box-shadow:inset 0 0 0 1px var(--wr-border-glow-outline)}.wr-border-glow:before,.wr-border-glow:after,.wr-border-glow>.wr-border-glow__edge{content:\"\";position:absolute;inset:0;border-radius:inherit;transition:opacity .25s ease-out;z-index:-1}.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping):before,.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping):after,.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping)>.wr-border-glow__edge{opacity:0;transition:opacity .75s ease-in-out}.wr-border-glow:before{border:1px solid transparent;background:linear-gradient(var(--wr-border-glow-bg, var(--wr-color-surface, #fff)) 0 100%) padding-box,linear-gradient(#fff0 0 100%) border-box,var(--wr-border-glow-gradient-one, radial-gradient(at 80% 55%, hsl(268, 100%, 76%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-two, radial-gradient(at 69% 34%, hsl(349, 100%, 74%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-three, radial-gradient(at 8% 6%, hsl(136, 100%, 78%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-four, radial-gradient(at 41% 38%, hsl(192, 100%, 64%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-five, radial-gradient(at 86% 85%, hsl(186, 100%, 74%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-six, radial-gradient(at 82% 18%, hsl(52, 100%, 65%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-seven, radial-gradient(at 51% 4%, hsl(12, 100%, 72%) 0px, transparent 50%)) border-box,var(--wr-border-glow-gradient-base, linear-gradient(#c299ff 0 100%)) border-box;opacity:calc((var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-color-sensitivity)) / (100 - var(--wr-border-glow-color-sensitivity)));-webkit-mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black calc(var(--wr-border-glow-cone-spread) * 1%),transparent calc((var(--wr-border-glow-cone-spread) + 15) * 1%),transparent calc((100 - var(--wr-border-glow-cone-spread) - 15) * 1%),black calc((100 - var(--wr-border-glow-cone-spread)) * 1%));mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black calc(var(--wr-border-glow-cone-spread) * 1%),transparent calc((var(--wr-border-glow-cone-spread) + 15) * 1%),transparent calc((100 - var(--wr-border-glow-cone-spread) - 15) * 1%),black calc((100 - var(--wr-border-glow-cone-spread)) * 1%))}.wr-border-glow:after{border:1px solid transparent;background:var(--wr-border-glow-gradient-one, radial-gradient(at 80% 55%, hsl(268, 100%, 76%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-two, radial-gradient(at 69% 34%, hsl(349, 100%, 74%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-three, radial-gradient(at 8% 6%, hsl(136, 100%, 78%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-four, radial-gradient(at 41% 38%, hsl(192, 100%, 64%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-five, radial-gradient(at 86% 85%, hsl(186, 100%, 74%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-six, radial-gradient(at 82% 18%, hsl(52, 100%, 65%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-seven, radial-gradient(at 51% 4%, hsl(12, 100%, 72%) 0px, transparent 50%)) padding-box,var(--wr-border-glow-gradient-base, linear-gradient(#c299ff 0 100%)) padding-box;-webkit-mask-image:linear-gradient(to bottom,#000,#000),radial-gradient(ellipse at 50% 50%,black 40%,transparent 65%),radial-gradient(ellipse at 66% 66%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 66% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 66%,black 5%,transparent 40%),conic-gradient(from var(--wr-border-glow-angle) at center,transparent 5%,black 15%,black 85%,transparent 95%);mask-image:linear-gradient(to bottom,#000,#000),radial-gradient(ellipse at 50% 50%,black 40%,transparent 65%),radial-gradient(ellipse at 66% 66%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 66% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 66%,black 5%,transparent 40%),conic-gradient(from var(--wr-border-glow-angle) at center,transparent 5%,black 15%,black 85%,transparent 95%);-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mask-composite:subtract,add,add,add,add,add;opacity:calc(var(--wr-border-glow-fill-opacity, .5) * var(--wr-border-glow-fill-scale) * (var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-color-sensitivity)) / (100 - var(--wr-border-glow-color-sensitivity)));mix-blend-mode:var(--wr-border-glow-fill-blend)}.wr-border-glow>.wr-border-glow__edge{inset:calc(var(--wr-border-glow-padding) * -1);pointer-events:none;z-index:1;-webkit-mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black 2.5%,transparent 10%,transparent 90%,black 97.5%);mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black 2.5%,transparent 10%,transparent 90%,black 97.5%);opacity:calc((var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-edge-sensitivity)) / (100 - var(--wr-border-glow-edge-sensitivity)));mix-blend-mode:var(--wr-border-glow-halo-blend)}.wr-border-glow>.wr-border-glow__edge:before{content:\"\";position:absolute;inset:var(--wr-border-glow-padding);border-radius:inherit;box-shadow:var(--wr-border-glow-edge-shadow)}.wr-border-glow__inner{position:relative;z-index:1;display:flex;flex-direction:column}\n"]
456
+ styles: [".wr-border-glow{--wr-border-glow-edge-proximity: 0;--wr-border-glow-angle: 45deg;--wr-border-glow-bg: var(--wr-color-surface);--wr-border-glow-input-bg: initial;--wr-border-glow-input-color: initial;--wr-border-glow-input-color-60: initial;--wr-border-glow-input-color-50: initial;--wr-border-glow-input-color-40: initial;--wr-border-glow-input-color-30: initial;--wr-border-glow-input-color-20: initial;--wr-border-glow-input-color-10: initial;--wr-border-glow-input-gradient-one: initial;--wr-border-glow-input-gradient-two: initial;--wr-border-glow-input-gradient-three: initial;--wr-border-glow-input-gradient-four: initial;--wr-border-glow-input-gradient-five: initial;--wr-border-glow-input-gradient-six: initial;--wr-border-glow-input-gradient-seven: initial;--wr-border-glow-input-gradient-base: initial;--wr-border-glow-color: light-dark(hsl(40deg 90% 45% / 100%), hsl(40deg 80% 80% / 100%));--wr-border-glow-color-60: light-dark(hsl(40deg 90% 45% / 60%), hsl(40deg 80% 80% / 60%));--wr-border-glow-color-50: light-dark(hsl(40deg 90% 45% / 50%), hsl(40deg 80% 80% / 50%));--wr-border-glow-color-40: light-dark(hsl(40deg 90% 45% / 40%), hsl(40deg 80% 80% / 40%));--wr-border-glow-color-30: light-dark(hsl(40deg 90% 45% / 30%), hsl(40deg 80% 80% / 30%));--wr-border-glow-color-20: light-dark(hsl(40deg 90% 45% / 20%), hsl(40deg 80% 80% / 20%));--wr-border-glow-color-10: light-dark(hsl(40deg 90% 45% / 10%), hsl(40deg 80% 80% / 10%));--wr-border-glow-gradient-one: radial-gradient( at 80% 55%, light-dark(hsl(268deg 80% 50%), hsl(268deg 100% 76%)) 0px, transparent 50% );--wr-border-glow-gradient-two: radial-gradient( at 69% 34%, light-dark(hsl(349deg 85% 52%), hsl(349deg 100% 74%)) 0px, transparent 50% );--wr-border-glow-gradient-three: radial-gradient( at 8% 6%, light-dark(hsl(136deg 70% 38%), hsl(136deg 100% 78%)) 0px, transparent 50% );--wr-border-glow-gradient-four: radial-gradient( at 41% 38%, light-dark(hsl(192deg 90% 40%), hsl(192deg 100% 64%)) 0px, transparent 50% );--wr-border-glow-gradient-five: radial-gradient( at 86% 85%, light-dark(hsl(186deg 90% 38%), hsl(186deg 100% 74%)) 0px, transparent 50% );--wr-border-glow-gradient-six: radial-gradient( at 82% 18%, light-dark(hsl(40deg 95% 45%), hsl(52deg 100% 65%)) 0px, transparent 50% );--wr-border-glow-gradient-seven: radial-gradient( at 51% 4%, light-dark(hsl(12deg 90% 50%), hsl(12deg 100% 72%)) 0px, transparent 50% );--wr-border-glow-gradient-base: linear-gradient(light-dark(hsl(262deg 70% 50%), #c299ff) 0 100%);--wr-border-glow-outline: light-dark(var(--wr-border-base), rgb(255 255 255 / 15%));--wr-border-glow-edge-shadow: inset 0 0 0 1px var(--wr-border-glow-input-color, var(--wr-border-glow-color)), inset 0 0 1px 0 light-dark(transparent, var(--wr-border-glow-input-color-60, var(--wr-border-glow-color-60))), inset 0 0 3px 0 light-dark(transparent, var(--wr-border-glow-input-color-50, var(--wr-border-glow-color-50))), inset 0 0 6px 0 light-dark(transparent, var(--wr-border-glow-input-color-40, var(--wr-border-glow-color-40))), inset 0 0 15px 0 light-dark(transparent, var(--wr-border-glow-input-color-30, var(--wr-border-glow-color-30))), inset 0 0 25px 2px light-dark(transparent, var(--wr-border-glow-input-color-20, var(--wr-border-glow-color-20))), inset 0 0 50px 2px light-dark(transparent, var(--wr-border-glow-input-color-10, var(--wr-border-glow-color-10))), 0 0 1px 0 var(--wr-border-glow-input-color-60, var(--wr-border-glow-color-60)), 0 0 3px 0 var(--wr-border-glow-input-color-50, var(--wr-border-glow-color-50)), 0 0 6px 0 var(--wr-border-glow-input-color-40, var(--wr-border-glow-color-40)), 0 0 15px 0 var(--wr-border-glow-input-color-30, var(--wr-border-glow-color-30)), 0 0 25px 2px var(--wr-border-glow-input-color-20, var(--wr-border-glow-color-20)), 0 0 50px 2px var(--wr-border-glow-input-color-10, var(--wr-border-glow-color-10));--wr-border-glow-halo-blend: normal;--wr-border-glow-fill-blend: normal;--wr-border-glow-fill-scale: .25;--wr-border-glow-edge-sensitivity: 30;--wr-border-glow-color-sensitivity: calc(var(--wr-border-glow-edge-sensitivity) + 20);--wr-border-glow-radius: 28px;--wr-border-glow-padding: 40px;--wr-border-glow-cone-spread: 25;position:relative;display:grid;border-radius:var(--wr-border-glow-radius);background:var(--wr-border-glow-input-bg, var(--wr-border-glow-bg));overflow:visible;isolation:isolate;transform:translateZ(.01px);box-shadow:inset 0 0 0 1px var(--wr-border-glow-outline)}.wr-border-glow:before,.wr-border-glow:after,.wr-border-glow>.wr-border-glow__edge{content:\"\";position:absolute;inset:0;border-radius:inherit;transition:opacity .25s ease-out;z-index:-1}.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping):before,.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping):after,.wr-border-glow:not(:hover):not(.wr-border-glow--sweeping):not(.wr-border-glow--looping)>.wr-border-glow__edge{opacity:0;transition:opacity .75s ease-in-out}.wr-border-glow:before{border:1px solid transparent;background:linear-gradient(var(--wr-border-glow-input-bg, var(--wr-border-glow-bg)) 0 100%) padding-box,linear-gradient(#fff0 0 100%) border-box,var(--wr-border-glow-input-gradient-one, var(--wr-border-glow-gradient-one)) border-box,var(--wr-border-glow-input-gradient-two, var(--wr-border-glow-gradient-two)) border-box,var(--wr-border-glow-input-gradient-three, var(--wr-border-glow-gradient-three)) border-box,var(--wr-border-glow-input-gradient-four, var(--wr-border-glow-gradient-four)) border-box,var(--wr-border-glow-input-gradient-five, var(--wr-border-glow-gradient-five)) border-box,var(--wr-border-glow-input-gradient-six, var(--wr-border-glow-gradient-six)) border-box,var(--wr-border-glow-input-gradient-seven, var(--wr-border-glow-gradient-seven)) border-box,var(--wr-border-glow-input-gradient-base, var(--wr-border-glow-gradient-base)) border-box;opacity:calc((var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-color-sensitivity)) / (100 - var(--wr-border-glow-color-sensitivity)));-webkit-mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black calc(var(--wr-border-glow-cone-spread) * 1%),transparent calc((var(--wr-border-glow-cone-spread) + 15) * 1%),transparent calc((100 - var(--wr-border-glow-cone-spread) - 15) * 1%),black calc((100 - var(--wr-border-glow-cone-spread)) * 1%));mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black calc(var(--wr-border-glow-cone-spread) * 1%),transparent calc((var(--wr-border-glow-cone-spread) + 15) * 1%),transparent calc((100 - var(--wr-border-glow-cone-spread) - 15) * 1%),black calc((100 - var(--wr-border-glow-cone-spread)) * 1%))}.wr-border-glow:after{border:1px solid transparent;background:var(--wr-border-glow-input-gradient-one, var(--wr-border-glow-gradient-one)) padding-box,var(--wr-border-glow-input-gradient-two, var(--wr-border-glow-gradient-two)) padding-box,var(--wr-border-glow-input-gradient-three, var(--wr-border-glow-gradient-three)) padding-box,var(--wr-border-glow-input-gradient-four, var(--wr-border-glow-gradient-four)) padding-box,var(--wr-border-glow-input-gradient-five, var(--wr-border-glow-gradient-five)) padding-box,var(--wr-border-glow-input-gradient-six, var(--wr-border-glow-gradient-six)) padding-box,var(--wr-border-glow-input-gradient-seven, var(--wr-border-glow-gradient-seven)) padding-box,var(--wr-border-glow-input-gradient-base, var(--wr-border-glow-gradient-base)) padding-box;-webkit-mask-image:linear-gradient(to bottom,#000,#000),radial-gradient(ellipse at 50% 50%,black 40%,transparent 65%),radial-gradient(ellipse at 66% 66%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 66% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 66%,black 5%,transparent 40%),conic-gradient(from var(--wr-border-glow-angle) at center,transparent 5%,black 15%,black 85%,transparent 95%);mask-image:linear-gradient(to bottom,#000,#000),radial-gradient(ellipse at 50% 50%,black 40%,transparent 65%),radial-gradient(ellipse at 66% 66%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 66% 33%,black 5%,transparent 40%),radial-gradient(ellipse at 33% 66%,black 5%,transparent 40%),conic-gradient(from var(--wr-border-glow-angle) at center,transparent 5%,black 15%,black 85%,transparent 95%);-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mask-composite:subtract,add,add,add,add,add;opacity:calc(var(--wr-border-glow-fill-opacity, .5) * var(--wr-border-glow-fill-scale) * (var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-color-sensitivity)) / (100 - var(--wr-border-glow-color-sensitivity)));mix-blend-mode:var(--wr-border-glow-fill-blend)}.wr-border-glow>.wr-border-glow__edge{inset:calc(var(--wr-border-glow-padding) * -1);pointer-events:none;z-index:1;-webkit-mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black 2.5%,transparent 10%,transparent 90%,black 97.5%);mask-image:conic-gradient(from var(--wr-border-glow-angle) at center,black 2.5%,transparent 10%,transparent 90%,black 97.5%);opacity:calc((var(--wr-border-glow-edge-proximity) - var(--wr-border-glow-edge-sensitivity)) / (100 - var(--wr-border-glow-edge-sensitivity)));mix-blend-mode:var(--wr-border-glow-halo-blend)}.wr-border-glow>.wr-border-glow__edge:before{content:\"\";position:absolute;inset:var(--wr-border-glow-padding);border-radius:inherit;box-shadow:var(--wr-border-glow-edge-shadow)}.wr-border-glow__inner{position:relative;z-index:1;display:flex;flex-direction:column}\n"]
454
457
  }]
455
458
  }],
456
459
  ctorParameters: () => [],