@wave3d/core 0.5.0 → 0.6.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.
@@ -11413,10 +11413,16 @@ function xl() {
11413
11413
  z: 6.33
11414
11414
  },
11415
11415
  twistMotion: !1,
11416
+ helixTurns: 0,
11417
+ helixRadius: 0,
11418
+ helixRoll: 0,
11419
+ helixPhase: 0,
11416
11420
  theme: "solid",
11417
11421
  lineAmount: 425,
11418
11422
  lineThickness: 1,
11419
11423
  lineDerivativePower: .95,
11424
+ rungAmount: 0,
11425
+ rungThickness: 1,
11420
11426
  maxWidth: 1232,
11421
11427
  position: {
11422
11428
  x: -24.3,
@@ -11520,7 +11526,7 @@ function wl() {
11520
11526
  }
11521
11527
  function Tl(e) {
11522
11528
  let t = e.palette;
11523
- t.length > 0 && typeof t[0] == "string" && (e.palette = vl(t)), e.gradientType !== "radial" && e.gradientType !== "conic" && e.gradientType !== "mesh" && e.gradientType !== "linear" && (e.gradientType = "linear");
11529
+ !Array.isArray(t) || t.length === 0 ? e.palette = xl().palette : typeof t[0] == "string" && (e.palette = vl(t)), e.gradientType !== "radial" && e.gradientType !== "conic" && e.gradientType !== "mesh" && e.gradientType !== "linear" && (e.gradientType = "linear");
11524
11530
  let n = e.meshGradientPoints;
11525
11531
  if (!Array.isArray(n) || n.length < 2) e.meshGradientPoints = yl();
11526
11532
  else {
@@ -11544,7 +11550,7 @@ function Tl(e) {
11544
11550
  }, e.paletteTextureScale.x = pl(Number(e.paletteTextureScale.x) || 1, .1, 8), e.paletteTextureScale.y = pl(Number(e.paletteTextureScale.y) || 1, .1, 8), e.paletteTextureOffset.x = pl(Number(e.paletteTextureOffset.x) || 0, -4, 4), e.paletteTextureOffset.y = pl(Number(e.paletteTextureOffset.y) || 0, -4, 4), e.paletteTextureRotation = pl(Number(e.paletteTextureRotation) || 0, -180, 180);
11545
11551
  }
11546
11552
  function El(e) {
11547
- e.backgroundMode !== "gradient" && e.backgroundMode !== "image" && e.backgroundMode !== "color" && (e.backgroundMode = "color");
11553
+ typeof e.background != "string" && (e.background = "#ffffff"), typeof e.transparentBackground != "boolean" && (e.transparentBackground = !0), e.backgroundMode !== "gradient" && e.backgroundMode !== "image" && e.backgroundMode !== "color" && (e.backgroundMode = "color");
11548
11554
  let t = e.backgroundPalette;
11549
11555
  !t || t.length < 2 ? e.backgroundPalette = vl([
11550
11556
  "#0a2540",
@@ -11553,7 +11559,7 @@ function El(e) {
11553
11559
  "#f6f9fc"
11554
11560
  ]) : typeof t[0] == "string" && (e.backgroundPalette = vl(t)), e.backgroundGradientType !== "radial" && e.backgroundGradientType !== "conic" && e.backgroundGradientType !== "mesh" && e.backgroundGradientType !== "linear" && (e.backgroundGradientType = "linear");
11555
11561
  let n = e.backgroundMeshPoints;
11556
- (!Array.isArray(n) || n.length < 2) && (e.backgroundMeshPoints = yl()), Number.isFinite(e.backgroundMeshSoftness) || (e.backgroundMeshSoftness = .62), e.backgroundMeshSoftness = ml(e.backgroundMeshSoftness), typeof e.backgroundGradientAngle != "number" && (e.backgroundGradientAngle = 135), typeof e.backgroundGradientSource != "string" && (e.backgroundGradientSource = "stops"), typeof e.backgroundImageSource != "string" && (e.backgroundImageSource = "vaporwave"), e.backgroundImageFit !== "contain" && e.backgroundImageFit !== "stretch" && e.backgroundImageFit !== "cover" && (e.backgroundImageFit = "cover"), typeof e.backgroundImageZoom != "number" && (e.backgroundImageZoom = 1), e.backgroundImageZoom = pl(e.backgroundImageZoom, .1, 8), e.backgroundImagePosition ||= {
11562
+ (!Array.isArray(n) || n.length < 2) && (e.backgroundMeshPoints = yl()), Number.isFinite(e.backgroundMeshSoftness) || (e.backgroundMeshSoftness = .62), e.backgroundMeshSoftness = ml(e.backgroundMeshSoftness), Number.isFinite(e.backgroundGradientAngle) || (e.backgroundGradientAngle = 135), typeof e.backgroundGradientSource != "string" && (e.backgroundGradientSource = "stops"), typeof e.backgroundImageSource != "string" && (e.backgroundImageSource = "vaporwave"), e.backgroundImageFit !== "contain" && e.backgroundImageFit !== "stretch" && e.backgroundImageFit !== "cover" && (e.backgroundImageFit = "cover"), Number.isFinite(e.backgroundImageZoom) || (e.backgroundImageZoom = 1), e.backgroundImageZoom = pl(e.backgroundImageZoom, .1, 8), e.backgroundImagePosition ||= {
11557
11563
  x: 0,
11558
11564
  y: 0
11559
11565
  }, typeof e.backgroundImagePosition.x != "number" && (e.backgroundImagePosition.x = 0), typeof e.backgroundImagePosition.y != "number" && (e.backgroundImagePosition.y = 0), e.backgroundImagePosition.x = pl(e.backgroundImagePosition.x, -100, 100), e.backgroundImagePosition.y = pl(e.backgroundImagePosition.y, -100, 100);
@@ -11567,13 +11573,13 @@ function Dl(e) {
11567
11573
  x: 0,
11568
11574
  y: 0,
11569
11575
  z: 0
11570
- }, typeof e.cameraZoom != "number" && (e.cameraZoom = 1), Vl.includes(e.cameraFit) || (e.cameraFit = "cover"), e.cameraMinVisibleWidth = typeof e.cameraMinVisibleWidth == "number" ? pl(e.cameraMinVisibleWidth, 0, 1) : 0;
11576
+ }, Number.isFinite(e.cameraZoom) || (e.cameraZoom = 1), Wl.includes(e.cameraFit) || (e.cameraFit = "cover"), e.cameraMinVisibleWidth = typeof e.cameraMinVisibleWidth == "number" ? pl(e.cameraMinVisibleWidth, 0, 1) : 0;
11571
11577
  }
11572
11578
  function Ol(e) {
11573
- Tl(e), typeof e.gradientAngle != "number" && (e.gradientAngle = 90), typeof e.gradientShift != "number" && (e.gradientShift = .15), typeof e.usePaletteTexture != "boolean" && (e.usePaletteTexture = !0), typeof e.paletteSource != "string" && (e.paletteSource = "hero"), typeof e.paletteEdgeColor != "string" && (e.paletteEdgeColor = "#8e9dff"), typeof e.paletteEdgeAmount != "number" && (e.paletteEdgeAmount = .3), typeof e.paletteDriftX != "number" && (e.paletteDriftX = 0), typeof e.paletteDriftY != "number" && (e.paletteDriftY = 0), typeof e.hueShift != "number" && (e.hueShift = 0), typeof e.colorContrast != "number" && (e.colorContrast = 1), typeof e.colorSaturation != "number" && (e.colorSaturation = 1), typeof e.fiberCount != "number" && (e.fiberCount = 600), typeof e.fiberStrength != "number" && (e.fiberStrength = .2), Array.isArray(e.noiseBands) || (e.noiseBands = []), typeof e.texture != "number" && (e.texture = 0), typeof e.creaseLight != "number" && (e.creaseLight = .6), typeof e.creaseSharpness != "number" && (e.creaseSharpness = .589), typeof e.creaseSoftness != "number" && (e.creaseSoftness = 1), typeof e.sheen != "number" && (e.sheen = 0), typeof e.roundness != "number" && (e.roundness = 0), typeof e.iridescence != "number" && (e.iridescence = 0), typeof e.edgeFade != "number" && (e.edgeFade = .04), typeof e.edgeFeather != "number" && (e.edgeFeather = .1), typeof e.depthTint != "number" && (e.depthTint = 0), typeof e.depthTintColor != "string" && (e.depthTintColor = "#0a2540"), e.displaceFrequency ||= {
11579
+ Tl(e), Number.isFinite(e.gradientAngle) || (e.gradientAngle = 90), Number.isFinite(e.gradientShift) || (e.gradientShift = .15), typeof e.usePaletteTexture != "boolean" && (e.usePaletteTexture = !0), typeof e.paletteSource != "string" && (e.paletteSource = "hero"), typeof e.paletteEdgeColor != "string" && (e.paletteEdgeColor = "#8e9dff"), Number.isFinite(e.paletteEdgeAmount) || (e.paletteEdgeAmount = .3), Number.isFinite(e.paletteDriftX) || (e.paletteDriftX = 0), Number.isFinite(e.paletteDriftY) || (e.paletteDriftY = 0), Number.isFinite(e.hueShift) || (e.hueShift = 0), Number.isFinite(e.colorContrast) || (e.colorContrast = 1), Number.isFinite(e.colorSaturation) || (e.colorSaturation = 1), Number.isFinite(e.fiberCount) || (e.fiberCount = 600), Number.isFinite(e.fiberStrength) || (e.fiberStrength = .2), Array.isArray(e.noiseBands) || (e.noiseBands = []), Nl(e), Number.isFinite(e.texture) || (e.texture = 0), Number.isFinite(e.creaseLight) || (e.creaseLight = .6), Number.isFinite(e.creaseSharpness) || (e.creaseSharpness = .589), Number.isFinite(e.creaseSoftness) || (e.creaseSoftness = 1), Number.isFinite(e.sheen) || (e.sheen = 0), Number.isFinite(e.roundness) || (e.roundness = 0), Number.isFinite(e.iridescence) || (e.iridescence = 0), Number.isFinite(e.edgeFade) || (e.edgeFade = .04), Number.isFinite(e.edgeFeather) || (e.edgeFeather = .1), Number.isFinite(e.depthTint) || (e.depthTint = 0), typeof e.depthTintColor != "string" && (e.depthTintColor = "#0a2540"), e.displaceFrequency ||= {
11574
11580
  x: .003234,
11575
11581
  y: .00799
11576
- }, typeof e.displaceAmount != "number" && (e.displaceAmount = 6.051), typeof e.detailFrequency != "number" && (e.detailFrequency = .04), typeof e.detailAmount != "number" && (e.detailAmount = 0), e.twistFrequency ||= {
11582
+ }, Number.isFinite(e.displaceAmount) || (e.displaceAmount = 6.051), Number.isFinite(e.detailFrequency) || (e.detailFrequency = .04), Number.isFinite(e.detailAmount) || (e.detailAmount = 0), e.twistFrequency ||= {
11577
11583
  x: -.055,
11578
11584
  y: .077,
11579
11585
  z: -.518
@@ -11581,7 +11587,7 @@ function Ol(e) {
11581
11587
  x: 3.95,
11582
11588
  y: 5.85,
11583
11589
  z: 6.33
11584
- }, typeof e.theme != "string" && (e.theme = "solid"), typeof e.lineAmount != "number" && (e.lineAmount = 425), typeof e.lineThickness != "number" && (e.lineThickness = 1), typeof e.lineDerivativePower != "number" && (e.lineDerivativePower = .95), typeof e.maxWidth != "number" && (e.maxWidth = 1232), e.position ||= {
11590
+ }, typeof e.twistMotion != "boolean" && (e.twistMotion = !1), Number.isFinite(e.helixTurns) || (e.helixTurns = 0), Number.isFinite(e.helixRadius) || (e.helixRadius = 0), Number.isFinite(e.helixRoll) || (e.helixRoll = 0), Number.isFinite(e.helixPhase) || (e.helixPhase = 0), typeof e.theme != "string" && (e.theme = "solid"), Number.isFinite(e.lineAmount) || (e.lineAmount = 425), Number.isFinite(e.lineThickness) || (e.lineThickness = 1), Number.isFinite(e.lineDerivativePower) || (e.lineDerivativePower = .95), Number.isFinite(e.rungAmount) || (e.rungAmount = 0), Number.isFinite(e.rungThickness) || (e.rungThickness = 1), Number.isFinite(e.maxWidth) || (e.maxWidth = 1232), e.position ||= {
11585
11591
  x: 0,
11586
11592
  y: 0,
11587
11593
  z: 0
@@ -11593,25 +11599,38 @@ function Ol(e) {
11593
11599
  x: 10,
11594
11600
  y: 10,
11595
11601
  z: 7
11596
- }, typeof e.blendMode != "string" && (e.blendMode = "squared"), typeof e.speed != "number" && (e.speed = .04), typeof e.opacity != "number" && (e.opacity = 1), typeof e.seed != "number" && (e.seed = 0), e.interaction && Nl(e);
11602
+ }, typeof e.blendMode != "string" && (e.blendMode = "squared"), Number.isFinite(e.speed) || (e.speed = .04), Number.isFinite(e.opacity) || (e.opacity = 1), Number.isFinite(e.seed) || (e.seed = 0), e.interaction && Il(e);
11597
11603
  }
11598
11604
  function kl(e) {
11599
- El(e), Dl(e), typeof e.ambient != "number" && (e.ambient = .45), Array.isArray(e.lights) || (e.lights = []), typeof e.quality != "number" && (e.quality = 1), typeof e.dprMax != "number" && (e.dprMax = 2), typeof e.grain != "number" && (e.grain = 1.1), typeof e.blur != "number" && (e.blur = .02), typeof e.blurSamples != "number" && (e.blurSamples = 6), typeof e.bloomStrength != "number" && (e.bloomStrength = 0), typeof e.bloomRadius != "number" && (e.bloomRadius = .4), typeof e.bloomThreshold != "number" && (e.bloomThreshold = .85), typeof e.dither != "number" && (e.dither = 0), typeof e.ditherScale != "number" && (e.ditherScale = 2), typeof e.ditherSteps != "number" && (e.ditherSteps = 4), typeof e.innerLight != "number" && (e.innerLight = 0), typeof e.innerLightDensity != "number" && (e.innerLightDensity = .5), typeof e.innerLightDecay != "number" && (e.innerLightDecay = .95), typeof e.innerLightX != "number" && (e.innerLightX = .5), typeof e.innerLightY != "number" && (e.innerLightY = .15), typeof e.halftone != "number" && (e.halftone = 0), typeof e.halftoneCell != "number" && (e.halftoneCell = 6), typeof e.halftoneAngle != "number" && (e.halftoneAngle = .4), typeof e.heatmap != "number" && (e.heatmap = 0), typeof e.paperTexture != "number" && (e.paperTexture = 0), typeof e.paperTextureScale != "number" && (e.paperTextureScale = 2), typeof e.halftoneCmyk != "number" && (e.halftoneCmyk = 0), typeof e.halftoneCmykCell != "number" && (e.halftoneCmykCell = 6), typeof e.showCameraRig != "boolean" && (e.showCameraRig = !1), typeof e.paused != "boolean" && (e.paused = !1), typeof e.loopSeconds != "number" && (e.loopSeconds = 0), typeof e.mirrorH != "boolean" && (e.mirrorH = !1), typeof e.mirrorV != "boolean" && (e.mirrorV = !1);
11605
+ El(e), Dl(e), Number.isFinite(e.ambient) || (e.ambient = .45), Array.isArray(e.lights) || (e.lights = []), Ml(e), Number.isFinite(e.quality) || (e.quality = 1), Number.isFinite(e.dprMax) || (e.dprMax = 2), Number.isFinite(e.grain) || (e.grain = 1.1), Number.isFinite(e.blur) || (e.blur = .02), Number.isFinite(e.blurSamples) || (e.blurSamples = 6), Number.isFinite(e.bloomStrength) || (e.bloomStrength = 0), Number.isFinite(e.bloomRadius) || (e.bloomRadius = .4), Number.isFinite(e.bloomThreshold) || (e.bloomThreshold = .85), Number.isFinite(e.dither) || (e.dither = 0), Number.isFinite(e.ditherScale) || (e.ditherScale = 2), Number.isFinite(e.ditherSteps) || (e.ditherSteps = 4), Number.isFinite(e.innerLight) || (e.innerLight = 0), Number.isFinite(e.innerLightDensity) || (e.innerLightDensity = .5), Number.isFinite(e.innerLightDecay) || (e.innerLightDecay = .95), Number.isFinite(e.innerLightX) || (e.innerLightX = .5), Number.isFinite(e.innerLightY) || (e.innerLightY = .15), Number.isFinite(e.halftone) || (e.halftone = 0), Number.isFinite(e.halftoneCell) || (e.halftoneCell = 6), Number.isFinite(e.halftoneAngle) || (e.halftoneAngle = .4), Number.isFinite(e.heatmap) || (e.heatmap = 0), Number.isFinite(e.paperTexture) || (e.paperTexture = 0), Number.isFinite(e.paperTextureScale) || (e.paperTextureScale = 2), Number.isFinite(e.halftoneCmyk) || (e.halftoneCmyk = 0), Number.isFinite(e.halftoneCmykCell) || (e.halftoneCmykCell = 6), typeof e.showCameraRig != "boolean" && (e.showCameraRig = !1), typeof e.paused != "boolean" && (e.paused = !1), Number.isFinite(e.timeOffset) || (e.timeOffset = 0), Number.isFinite(e.loopSeconds) || (e.loopSeconds = 0), typeof e.mirrorH != "boolean" && (e.mirrorH = !1), typeof e.mirrorV != "boolean" && (e.mirrorV = !1);
11600
11606
  }
11601
11607
  function Al(e, t, n, r) {
11602
11608
  let i = Number(e);
11603
11609
  return Number.isFinite(i) ? pl(i, t, n) : r;
11604
11610
  }
11605
- function jl(e) {
11606
- return typeof e == "string" && (Ul.includes(e) || e.startsWith("custom:") && e.length > 7);
11611
+ function jl(e, t) {
11612
+ let n = Number(e);
11613
+ return Number.isFinite(n) ? n : t;
11607
11614
  }
11608
- function Ml(e, t) {
11615
+ function Ml(e) {
11616
+ e.lights = e.lights.filter((e) => typeof e == "object" && !!e);
11617
+ for (let t of e.lights) (typeof t.position != "object" || t.position === null) && (t.position = { ...Gl }), t.position.x = jl(t.position.x, Gl.x), t.position.y = jl(t.position.y, Gl.y), t.position.z = jl(t.position.z, Gl.z), typeof t.color != "string" && (t.color = "#ffffff"), t.intensity = jl(t.intensity, 1);
11618
+ }
11619
+ function Nl(e) {
11620
+ e.noiseBands = e.noiseBands.filter((e) => typeof e == "object" && !!e);
11621
+ let t = _l();
11622
+ for (let n of e.noiseBands) n.startX = jl(n.startX, t.startX), n.endX = jl(n.endX, t.endX), n.startY = jl(n.startY, t.startY), n.endY = jl(n.endY, t.endY), n.feather = jl(n.feather, t.feather), n.strength = jl(n.strength, t.strength), n.frequency = jl(n.frequency, t.frequency), n.colorAttenuation = jl(n.colorAttenuation, t.colorAttenuation), n.parabolaPower = jl(n.parabolaPower, t.parabolaPower);
11623
+ }
11624
+ function Pl(e) {
11625
+ return typeof e == "string" && (Kl.includes(e) || e.startsWith("custom:") && e.length > 7);
11626
+ }
11627
+ function Fl(e, t) {
11609
11628
  let n = [];
11610
11629
  if (!Array.isArray(e)) return n;
11611
11630
  for (let r of e) {
11612
11631
  if (!r || typeof r != "object") continue;
11613
11632
  let e = r;
11614
- if (!jl(e.source) || !t.includes(e.target)) continue;
11633
+ if (!Pl(e.source) || !t.includes(e.target)) continue;
11615
11634
  let i = Number(e.to);
11616
11635
  if (!Number.isFinite(i)) continue;
11617
11636
  let a = {
@@ -11627,31 +11646,31 @@ function Ml(e, t) {
11627
11646
  }
11628
11647
  return n;
11629
11648
  }
11630
- function Nl(e) {
11649
+ function Il(e) {
11631
11650
  let t = e.interaction;
11632
11651
  if (!t) return;
11633
11652
  let n = t.hover;
11634
- n && (n.agitate !== void 0 && (n.agitate = Al(n.agitate, 0, 60, 0)), n.push !== void 0 && (n.push = Al(n.push, -40, 40, 0)), n.wake !== void 0 && (n.wake = Al(n.wake, 0, 40, 0)), n.thin !== void 0 && (n.thin = Al(n.thin, 0, 1, 0)), n.hueShift !== void 0 && (n.hueShift = Al(n.hueShift, -360, 360, 0)), n.lighten !== void 0 && (n.lighten = Al(n.lighten, -1, 1, 0)), n.smoothing !== void 0 && (n.smoothing = Al(n.smoothing, 0, 2, .12))), t.press && t.press.ripple !== void 0 && (t.press.ripple = Al(t.press.ripple, 0, 60, 0)), t.bindings !== void 0 && (t.bindings = Ml(t.bindings, Wl));
11653
+ n && (n.agitate !== void 0 && (n.agitate = Al(n.agitate, 0, 60, 0)), n.push !== void 0 && (n.push = Al(n.push, -40, 40, 0)), n.wake !== void 0 && (n.wake = Al(n.wake, 0, 40, 0)), n.thin !== void 0 && (n.thin = Al(n.thin, 0, 1, 0)), n.hueShift !== void 0 && (n.hueShift = Al(n.hueShift, -360, 360, 0)), n.lighten !== void 0 && (n.lighten = Al(n.lighten, -1, 1, 0)), n.smoothing !== void 0 && (n.smoothing = Al(n.smoothing, 0, 2, .12))), t.press && t.press.ripple !== void 0 && (t.press.ripple = Al(t.press.ripple, 0, 60, 0)), t.bindings !== void 0 && (t.bindings = Fl(t.bindings, ql));
11635
11654
  }
11636
- function Pl(e) {
11655
+ function Ll(e) {
11637
11656
  let t = e.interaction;
11638
- t && (t.radius !== void 0 && (t.radius = Al(t.radius, .02, 2, .3)), t.ribbonFlow !== void 0 && (t.ribbonFlow = Al(t.ribbonFlow, 0, 1, .8)), t.bindings !== void 0 && (t.bindings = Ml(t.bindings, Gl)));
11657
+ t && (t.radius !== void 0 && (t.radius = Al(t.radius, .02, 2, .3)), t.ribbonFlow !== void 0 && (t.ribbonFlow = Al(t.ribbonFlow, 0, 1, .8)), t.bindings !== void 0 && (t.bindings = Fl(t.bindings, Jl)));
11639
11658
  }
11640
- function Fl(e) {
11659
+ function Rl(e) {
11641
11660
  let t = e;
11642
- return kl(t), (!Array.isArray(t.waves) || t.waves.length === 0) && (t.waves = [Sl()]), t.waves.forEach(Ol), t.waveCount = t.waves.length, t.interaction && Pl(t), t;
11661
+ return kl(t), (!Array.isArray(t.waves) || t.waves.length === 0) && (t.waves = [Sl()]), t.waves.forEach(Ol), t.waveCount = t.waves.length, t.interaction && Ll(t), t;
11643
11662
  }
11644
- var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl = t((() => {
11645
- hl(), Il = 8, Ll = 8, Rl = 8, zl = 4, Bl = 6, Vl = [
11663
+ var zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl, ql, Jl, Yl = t((() => {
11664
+ hl(), zl = 8, Bl = 8, Vl = 8, Hl = 4, Ul = 6, Wl = [
11646
11665
  "cover",
11647
11666
  "contain",
11648
11667
  "width",
11649
11668
  "height"
11650
- ], Hl = {
11669
+ ], Gl = {
11651
11670
  x: 800,
11652
11671
  y: 900,
11653
11672
  z: 1100
11654
- }, Ul = [
11673
+ }, Kl = [
11655
11674
  "scroll",
11656
11675
  "hover",
11657
11676
  "pointerX",
@@ -11660,7 +11679,7 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl = t((() => {
11660
11679
  "press",
11661
11680
  "scrollVelocity",
11662
11681
  "appear"
11663
- ], Wl = [
11682
+ ], ql = [
11664
11683
  "displaceAmount",
11665
11684
  "detailAmount",
11666
11685
  "twistPowerX",
@@ -11669,6 +11688,9 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl = t((() => {
11669
11688
  "twistFrequencyX",
11670
11689
  "twistFrequencyY",
11671
11690
  "twistFrequencyZ",
11691
+ "helixPhase",
11692
+ "helixTurns",
11693
+ "helixRadius",
11672
11694
  "hueShift",
11673
11695
  "gradientShift",
11674
11696
  "colorSaturation",
@@ -11680,15 +11702,47 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl = t((() => {
11680
11702
  "iridescence",
11681
11703
  "positionX",
11682
11704
  "positionY"
11683
- ], Gl = [
11705
+ ], Jl = [
11684
11706
  "timeOffset",
11685
11707
  "cameraZoom",
11686
11708
  "blur",
11687
11709
  "grain"
11688
11710
  ];
11689
- })), ql, Jl, Yl, Xl, Zl, Ql, $l, eu, tu, nu, ru, iu, au, ou, su = t((() => {
11690
- Kl(), ql = "\nfloat xxhash(vec2 x){\n uvec2 t = floatBitsToUint(x);\n uint h = 0xc2b2ae3du * t.x + 0x165667b9u;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h += 0xc2b2ae3du * t.y;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h ^= h >> 15u;\n h *= 0x85ebca77u;\n h ^= h >> 13u;\n h *= 0xc2b2ae3du;\n h ^= h >> 16u;\n return uintBitsToFloat(h >> 9u | 0x3f800000u) - 1.0;\n}\nvec2 hash(vec2 x){\n float k = 6.283185307 * xxhash(x);\n return vec2(cos(k), sin(k));\n}\nfloat simplexNoise(in vec2 p){\n const float K1 = 0.366025404; // (sqrt(3)-1)/2\n const float K2 = 0.211324865; // (3-sqrt(3))/6\n vec2 i = floor(p + (p.x + p.y) * K1);\n vec2 a = p - i + (i.x + i.y) * K2;\n float m = step(a.y, a.x);\n vec2 o = vec2(m, 1.0 - m);\n vec2 b = a - o + K2;\n vec2 c = a - 1.0 + 2.0 * K2;\n vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);\n vec3 n = h * h * h * vec3(dot(a, hash(i + 0.0)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));\n return dot(n, vec3(32.99)); // analytic factor (= 2916*sqrt(2)/125)\n}\n", Jl = "\nuniform vec3 uColors[MAX_COLORS];\nuniform float uColorPos[MAX_COLORS];\nuniform int uColorCount;\nuniform int uGradType;\nuniform float uGradAngle;\nuniform float uGradShift;\nuniform vec2 uMeshPointPos[MAX_MESH_POINTS];\nuniform vec3 uMeshPointColor[MAX_MESH_POINTS];\nuniform float uMeshPointInfluence[MAX_MESH_POINTS];\nuniform int uMeshPointCount;\nuniform float uMeshSoftness;\nuniform sampler2D uPalette; // baked 2D palette texture\nuniform float uUsePalette; // >0.5 = sample the texture; else procedural grad()\nuniform float uPaletteRaw; // >0.5 = sample palette by raw (uv.x,uv.y), not gradCoord\nuniform vec2 uPaletteScale;\nuniform vec2 uPaletteOffset;\nuniform float uPaletteRotation;\nuniform float uHueShift;\nuniform float uContrast;\nuniform float uSaturation;\nuniform float uOpacity;\nuniform float uSquared; // 1 = square the output colour (the deep \"squared\" hero look)\n", Yl = "\nvec3 contrastFn(vec3 v, float a){ return (v - 0.5) * a + 0.5; }\nvec3 desaturate(vec3 color, float factor){\n vec3 gray = vec3(dot(vec3(0.299, 0.587, 0.114), color));\n return mix(color, gray, factor);\n}\nvec3 hueShift(vec3 color, float shift){\n vec3 g = vec3(0.57735);\n vec3 proj = g * dot(g, color);\n vec3 U = color - proj;\n vec3 W = cross(g, U);\n return U * cos(shift) + W * sin(shift) + proj;\n}\n\n// Our gradient: interpolate stops by their positions (uColorPos sorted ascending).\nvec3 grad(float u){\n u = clamp(u, 0.0, 1.0);\n vec3 col = uColors[0];\n for (int i = 0; i < MAX_COLORS - 1; i++){\n if (i >= uColorCount - 1) break;\n float p0 = uColorPos[i];\n float p1 = uColorPos[i + 1];\n if (u >= p0){\n float t = clamp((u - p0) / max(p1 - p0, 1e-5), 0.0, 1.0);\n col = mix(uColors[i], uColors[i + 1], t);\n }\n }\n return col;\n}\n\n// iOS-style 2D colour field. Each control point contributes an inverse-distance\n// weight; normalising the sum fills the whole surface without dark seams.\nvec3 meshGradient(vec2 uv){\n vec3 colorSum = vec3(0.0);\n float weightSum = 0.0;\n float exponent = mix(4.8, 1.35, clamp(uMeshSoftness, 0.0, 1.0));\n for (int i = 0; i < MAX_MESH_POINTS; i++){\n if (i >= uMeshPointCount) break;\n float influence = max(uMeshPointInfluence[i], 0.05);\n float distanceFromPoint = length(uv - uMeshPointPos[i]) / influence;\n float weight = 1.0 / (pow(max(distanceFromPoint, 0.012), exponent) + 0.002);\n colorSum += uMeshPointColor[i] * weight;\n weightSum += weight;\n }\n return colorSum / max(weightSum, 0.0001);\n}\n\n// Map a surface uv to the 0–1 gradient coordinate per gradient type. uGradShift\n// adds a low-frequency simplex warp so the colour varies in 2D (along the length\n// as well as across the width) — a 2D palette feel instead\n// of flat 1-D bands.\nfloat gradCoord(vec2 uv){\n float warp = uGradShift * simplexNoise(uv * 1.6 + 4.0);\n if (uGradType == 1){ return clamp(length(uv - 0.5) * 2.0 + warp, 0.0, 1.0); } // radial\n if (uGradType == 2){ return fract(atan(uv.y - 0.5, uv.x - 0.5) / (2.0 * PI) + 0.5 + warp); } // conic\n vec2 dir = vec2(sin(uGradAngle), cos(uGradAngle)); // linear, angled\n return clamp(dot(uv - 0.5, dir) + 0.5 + warp, 0.0, 1.0);\n}\n\n// One base-colour sample for the whole surface: rotate/scale/offset the raw-palette uv,\n// then pick the mesh field / baked 2D texture / procedural stops by mode. The raw palette\n// is sampled by (uv.x, uv.y) directly; the stops-generated texture is sampled via\n// gradCoord so its angle/type/warp still apply.\nvec3 waveBaseColor(vec2 uv){\n float gc = gradCoord(uv);\n vec2 mediaUv = uv - 0.5;\n float mediaCos = cos(uPaletteRotation);\n float mediaSin = sin(uPaletteRotation);\n mediaUv = vec2(\n mediaCos * mediaUv.x + mediaSin * mediaUv.y,\n -mediaSin * mediaUv.x + mediaCos * mediaUv.y\n );\n mediaUv = mediaUv * uPaletteScale + 0.5 + uPaletteOffset;\n vec2 puv = uPaletteRaw > 0.5\n ? clamp(mediaUv, 0.0, 1.0)\n : vec2(gc, clamp(uv.y, 0.0, 1.0));\n return uGradType == 3\n ? meshGradient(uv)\n : (uUsePalette > 0.5 ? texture2D(uPalette, puv).rgb : grad(gc));\n}\n\n// The shared colour grade: contrast → desaturate → hue rotate (degrees).\nvec3 applyColorGrade(vec3 c){\n c = contrastFn(c, uContrast);\n c = desaturate(c, 1.0 - uSaturation);\n return hueShift(c, radians(uHueShift));\n}\n", Xl = `
11691
- ${ql}
11711
+ })), Xl, Zl, Ql, $l, eu, tu, nu = t((() => {
11712
+ Vc(), Xl = 400, Zl = 16, Ql = Xl / 4, $l = new K(1, 0, 0), eu = new K(0, 1, 0), tu = class {
11713
+ geometry;
11714
+ segments = -1;
11715
+ constructor(e) {
11716
+ this.geometry = new Rr(), this.resize(e);
11717
+ }
11718
+ resize(e) {
11719
+ if (e === this.segments) return;
11720
+ this.segments = e;
11721
+ let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(Xl, Xl, t, n), i = r.attributes.position, a = r.attributes.uv, o = new K();
11722
+ for (let e = 0; e < i.count; e++) {
11723
+ o.fromBufferAttribute(i, e);
11724
+ let t = a.getY(e), n = 4 - 2 * (4 * t * (1 - t)) ** 9.5;
11725
+ o.x < -16 ? o.z += n : o.x < Zl ? (o.z = Math.cos(Gt.mapLinear(o.x, -16, Zl, 0, Math.PI)) * n, o.x = Math.cos(Gt.mapLinear(o.x, -16, Zl, -Math.PI / 2, Math.PI / 2)) * n - Zl) : (o.z -= n, o.x = -o.x), o.x += Ql, o.applyAxisAngle($l, -Math.PI / 2), o.applyAxisAngle(eu, -Math.PI / 2), i.setXYZ(e, o.x, o.y, o.z);
11726
+ }
11727
+ i.needsUpdate = !0;
11728
+ let s = t + 1, c = r.getIndex(), l = c ? Array.from(c.array) : [];
11729
+ for (let e = 0; e < n; e++) {
11730
+ let n = e * s, r = (e + 1) * s, i = n + t, a = r + t;
11731
+ l.push(n, i, r, r, i, a);
11732
+ }
11733
+ for (let e of [0, n]) {
11734
+ let n = e * s;
11735
+ for (let r = 1; r < t; r++) l.push(n, e * s + r, e * s + r + 1);
11736
+ }
11737
+ r.setIndex(l), r.computeVertexNormals(), this.geometry.setIndex(r.getIndex()), this.geometry.setAttribute("position", r.getAttribute("position")), this.geometry.setAttribute("uv", r.getAttribute("uv")), this.geometry.setAttribute("normal", r.getAttribute("normal")), this.geometry.computeBoundingSphere(), r.dispose();
11738
+ }
11739
+ dispose() {
11740
+ this.geometry.dispose();
11741
+ }
11742
+ };
11743
+ })), ru, iu, au, ou, su, cu, lu, uu, du, fu, pu, mu, hu, gu, _u = t((() => {
11744
+ Yl(), nu(), ru = "\nfloat xxhash(vec2 x){\n uvec2 t = floatBitsToUint(x);\n uint h = 0xc2b2ae3du * t.x + 0x165667b9u;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h += 0xc2b2ae3du * t.y;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h ^= h >> 15u;\n h *= 0x85ebca77u;\n h ^= h >> 13u;\n h *= 0xc2b2ae3du;\n h ^= h >> 16u;\n return uintBitsToFloat(h >> 9u | 0x3f800000u) - 1.0;\n}\nvec2 hash(vec2 x){\n float k = 6.283185307 * xxhash(x);\n return vec2(cos(k), sin(k));\n}\nfloat simplexNoise(in vec2 p){\n const float K1 = 0.366025404; // (sqrt(3)-1)/2\n const float K2 = 0.211324865; // (3-sqrt(3))/6\n vec2 i = floor(p + (p.x + p.y) * K1);\n vec2 a = p - i + (i.x + i.y) * K2;\n float m = step(a.y, a.x);\n vec2 o = vec2(m, 1.0 - m);\n vec2 b = a - o + K2;\n vec2 c = a - 1.0 + 2.0 * K2;\n vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);\n vec3 n = h * h * h * vec3(dot(a, hash(i + 0.0)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));\n return dot(n, vec3(32.99)); // analytic factor (= 2916*sqrt(2)/125)\n}\n", iu = "\nuniform vec3 uColors[MAX_COLORS];\nuniform float uColorPos[MAX_COLORS];\nuniform int uColorCount;\nuniform int uGradType;\nuniform float uGradAngle;\nuniform float uGradShift;\nuniform vec2 uMeshPointPos[MAX_MESH_POINTS];\nuniform vec3 uMeshPointColor[MAX_MESH_POINTS];\nuniform float uMeshPointInfluence[MAX_MESH_POINTS];\nuniform int uMeshPointCount;\nuniform float uMeshSoftness;\nuniform sampler2D uPalette; // baked 2D palette texture\nuniform float uUsePalette; // >0.5 = sample the texture; else procedural grad()\nuniform float uPaletteRaw; // >0.5 = sample palette by raw (uv.x,uv.y), not gradCoord\nuniform vec2 uPaletteScale;\nuniform vec2 uPaletteOffset;\nuniform float uPaletteRotation;\nuniform float uHueShift;\nuniform float uContrast;\nuniform float uSaturation;\nuniform float uOpacity;\nuniform float uSquared; // 1 = square the output colour (the deep \"squared\" hero look)\n", au = "\nvec3 contrastFn(vec3 v, float a){ return (v - 0.5) * a + 0.5; }\nvec3 desaturate(vec3 color, float factor){\n vec3 gray = vec3(dot(vec3(0.299, 0.587, 0.114), color));\n return mix(color, gray, factor);\n}\nvec3 hueShift(vec3 color, float shift){\n vec3 g = vec3(0.57735);\n vec3 proj = g * dot(g, color);\n vec3 U = color - proj;\n vec3 W = cross(g, U);\n return U * cos(shift) + W * sin(shift) + proj;\n}\n\n// Our gradient: interpolate stops by their positions (uColorPos sorted ascending).\nvec3 grad(float u){\n u = clamp(u, 0.0, 1.0);\n vec3 col = uColors[0];\n for (int i = 0; i < MAX_COLORS - 1; i++){\n if (i >= uColorCount - 1) break;\n float p0 = uColorPos[i];\n float p1 = uColorPos[i + 1];\n if (u >= p0){\n float t = clamp((u - p0) / max(p1 - p0, 1e-5), 0.0, 1.0);\n col = mix(uColors[i], uColors[i + 1], t);\n }\n }\n return col;\n}\n\n// iOS-style 2D colour field. Each control point contributes an inverse-distance\n// weight; normalising the sum fills the whole surface without dark seams.\nvec3 meshGradient(vec2 uv){\n vec3 colorSum = vec3(0.0);\n float weightSum = 0.0;\n float exponent = mix(4.8, 1.35, clamp(uMeshSoftness, 0.0, 1.0));\n for (int i = 0; i < MAX_MESH_POINTS; i++){\n if (i >= uMeshPointCount) break;\n float influence = max(uMeshPointInfluence[i], 0.05);\n float distanceFromPoint = length(uv - uMeshPointPos[i]) / influence;\n float weight = 1.0 / (pow(max(distanceFromPoint, 0.012), exponent) + 0.002);\n colorSum += uMeshPointColor[i] * weight;\n weightSum += weight;\n }\n return colorSum / max(weightSum, 0.0001);\n}\n\n// Map a surface uv to the 0–1 gradient coordinate per gradient type. uGradShift\n// adds a low-frequency simplex warp so the colour varies in 2D (along the length\n// as well as across the width) — a 2D palette feel instead\n// of flat 1-D bands.\nfloat gradCoord(vec2 uv){\n float warp = uGradShift * simplexNoise(uv * 1.6 + 4.0);\n if (uGradType == 1){ return clamp(length(uv - 0.5) * 2.0 + warp, 0.0, 1.0); } // radial\n if (uGradType == 2){ return fract(atan(uv.y - 0.5, uv.x - 0.5) / (2.0 * PI) + 0.5 + warp); } // conic\n vec2 dir = vec2(sin(uGradAngle), cos(uGradAngle)); // linear, angled\n return clamp(dot(uv - 0.5, dir) + 0.5 + warp, 0.0, 1.0);\n}\n\n// One base-colour sample for the whole surface: rotate/scale/offset the raw-palette uv,\n// then pick the mesh field / baked 2D texture / procedural stops by mode. The raw palette\n// is sampled by (uv.x, uv.y) directly; the stops-generated texture is sampled via\n// gradCoord so its angle/type/warp still apply.\nvec3 waveBaseColor(vec2 uv){\n float gc = gradCoord(uv);\n vec2 mediaUv = uv - 0.5;\n float mediaCos = cos(uPaletteRotation);\n float mediaSin = sin(uPaletteRotation);\n mediaUv = vec2(\n mediaCos * mediaUv.x + mediaSin * mediaUv.y,\n -mediaSin * mediaUv.x + mediaCos * mediaUv.y\n );\n mediaUv = mediaUv * uPaletteScale + 0.5 + uPaletteOffset;\n vec2 puv = uPaletteRaw > 0.5\n ? clamp(mediaUv, 0.0, 1.0)\n : vec2(gc, clamp(uv.y, 0.0, 1.0));\n return uGradType == 3\n ? meshGradient(uv)\n : (uUsePalette > 0.5 ? texture2D(uPalette, puv).rgb : grad(gc));\n}\n\n// The shared colour grade: contrast → desaturate → hue rotate (degrees).\nvec3 applyColorGrade(vec3 c){\n c = contrastFn(c, uContrast);\n c = desaturate(c, 1.0 - uSaturation);\n return hueShift(c, radians(uHueShift));\n}\n", ou = `
11745
+ ${ru}
11692
11746
 
11693
11747
  uniform float uTime, uSpeed, uSeed;
11694
11748
  uniform float uDispFreqX, uDispFreqZ, uDispAmount;
@@ -11696,6 +11750,15 @@ uniform float uDetailFreq, uDetailAmount; // 2nd displacement octave (only read
11696
11750
  uniform float uTwFreqX, uTwFreqY, uTwFreqZ, uTwPowX, uTwPowY, uTwPowZ;
11697
11751
  uniform float uLoopSeconds; // seamless-loop period (only read under LOOP_MOTION)
11698
11752
 
11753
+ // Helix (optional). Behind HELIX so a wave without one compiles the exact same program — same
11754
+ // byte-identity contract as the pointer block below.
11755
+ #ifdef HELIX
11756
+ uniform float uHelixTurns; // full turns from one end of the ribbon to the other
11757
+ uniform float uHelixRadius; // orbit radius: carries the whole ribbon around the axis
11758
+ uniform float uHelixRoll; // cross-section roll, as a fraction of the turns (1 = rigid ladder)
11759
+ uniform float uHelixPhase; // degrees
11760
+ #endif
11761
+
11699
11762
  varying vec2 vUv;
11700
11763
  varying vec3 vWorldPos;
11701
11764
  varying vec3 vViewDir;
@@ -11784,6 +11847,28 @@ void main(){
11784
11847
  #endif
11785
11848
  #endif
11786
11849
 
11850
+ #ifdef HELIX
11851
+ // Helix — the one shape the three twists below cannot reach. Their angle is freq * expStep(uv),
11852
+ // a MONOTONE falloff, so it can only ramp once; this one is periodic in uv.y (the length), so
11853
+ // uHelixTurns full turns land evenly from end to end. Runs AFTER the displacement so the noise
11854
+ // above still samples the undeformed pos.x/pos.z (byte-identical sampling), and BEFORE the twist
11855
+ // so the two compose.
11856
+ // roll rolls the ribbon's own cross-section about the axis in step with the sweep, swinging
11857
+ // its two long edges onto opposite sides — one wave becomes a ladder whose edges are
11858
+ // both strands (pair with the wireframe theme's rungs for the rungs between them).
11859
+ // radius carries the whole ribbon around the axis instead, orientation intact — a narrow ribbon
11860
+ // then reads as ONE strand, and a second wave at phase+180 is the other.
11861
+ float hAng = 6.28318530718 * uHelixTurns * uv.y + radians(uHelixPhase);
11862
+ // Roll about the ribbon's width centre, not the origin — see RIBBON_Z_CENTER in WaveGeometry.
11863
+ float rollA = hAng * uHelixRoll;
11864
+ float rollC = cos(rollA), rollS = sin(rollA);
11865
+ vec2 rel = vec2(pos.y, pos.z - ${(-8).toFixed(1)});
11866
+ pos.y = rel.x * rollC - rel.y * rollS;
11867
+ pos.z = ${(-8).toFixed(1)} + rel.x * rollS + rel.y * rollC;
11868
+ pos.y += uHelixRadius * cos(hAng);
11869
+ pos.z += uHelixRadius * sin(hAng);
11870
+ #endif
11871
+
11787
11872
  // The X-twist frequency feeding rotB. Two modes: by default uTwFreqX is used
11788
11873
  // directly; the variant (used by the Wave 4 preset) modulates it with
11789
11874
  // simplex noise indexed along the ribbon (uv.y) so the twist breathes over time.
@@ -11891,16 +11976,16 @@ void main(){
11891
11976
  gl_Position = projectionMatrix * viewMatrix * world;
11892
11977
  vClipPosition = gl_Position;
11893
11978
  }
11894
- `, Zl = `
11979
+ `, su = `
11895
11980
  #define MAX_COLORS 8
11896
11981
  #define MAX_MESH_POINTS 8
11897
11982
  #define MAX_LIGHTS 8
11898
11983
  #define MAX_NOISE_BANDS 4
11899
11984
  #define PI 3.14159265359
11900
11985
 
11901
- ${ql}
11986
+ ${ru}
11902
11987
 
11903
- ${Jl}
11988
+ ${iu}
11904
11989
  uniform float uDebug; // dev: 1 = show crease, 2 = show derivative normal
11905
11990
  uniform float uSheen; // white-lift on the flat (low-crease) areas (1 = full)
11906
11991
  uniform float uRoundness; // pose-robust normal-based roundness/thickness strength
@@ -11947,7 +12032,7 @@ float grainHash(vec2 p){ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758
11947
12032
  float parabola(float x, float k){ return pow(4.0 * x * (1.0 - x), k); }
11948
12033
  float mapLinear(float v, float a, float b, float c, float d){ return c + (v - a) * (d - c) / (b - a); }
11949
12034
 
11950
- ${Yl}
12035
+ ${au}
11951
12036
 
11952
12037
  // Striations: a subtle high-frequency simplex-noise grain ADDED to the
11953
12038
  // colour — colour-matched (weaker where blue is high), only near folds (crease), and
@@ -12096,18 +12181,23 @@ void main(){
12096
12181
  gl_FragColor.rgb *= gl_FragColor.a;
12097
12182
  #endif
12098
12183
  }
12099
- `, Ql = `
12184
+ `, cu = `
12100
12185
  #define MAX_COLORS 8
12101
12186
  #define MAX_MESH_POINTS 8
12102
12187
  #define PI 3.14159265359
12103
12188
 
12104
- ${ql}
12189
+ ${ru}
12105
12190
 
12106
- ${Jl}
12191
+ ${iu}
12107
12192
  uniform float uLineAmount; // default 425
12108
12193
  uniform float uLineThickness; // default 1
12109
12194
  uniform float uLineDerivativePower; // default 0.95
12110
12195
  uniform float uMaxWidth; // default 1232
12196
+ // Cross-wise rungs (optional) — behind RUNGS so a wave without them compiles the same program.
12197
+ #ifdef RUNGS
12198
+ uniform float uRungAmount; // frequency across the ribbon (rungs ≈ amount / π)
12199
+ uniform float uRungThickness; // rung width in pixels
12200
+ #endif
12111
12201
  uniform vec3 uClearColor; // = page background colour (shown between the lines)
12112
12202
 
12113
12203
  varying vec2 vUv;
@@ -12119,7 +12209,7 @@ uniform float uPointerLighten; // -1..1 local brightness lift near the cursor
12119
12209
  varying float vPointerFall; // falloff × presence, written by the vertex shader
12120
12210
  #endif
12121
12211
 
12122
- ${Yl}
12212
+ ${au}
12123
12213
 
12124
12214
  void main(){
12125
12215
  // Same 2D palette sample + colour ops as the solid theme.
@@ -12139,6 +12229,16 @@ void main(){
12139
12229
  float a = abs(sin(vUv.x * uLineAmount));
12140
12230
  a = smoothstep(lineThickness, 0.0, a);
12141
12231
 
12232
+ #ifdef RUNGS
12233
+ // Rungs: the same carve at constant uv.y instead of uv.x, so this family runs ACROSS the ribbon
12234
+ // where the one above runs along it — together they read as a ladder. Width comes from fwidth()
12235
+ // rather than the lengthwise term's dFdy(vUv).x, which is the derivative of the wrong axis for
12236
+ // this direction: |sin| climbs by ~uRungAmount·fwidth(vUv.y) per pixel, so scaling by that keeps
12237
+ // a rung uRungThickness pixels wide at any zoom or ribbon scale.
12238
+ float rung = abs(sin(vUv.y * uRungAmount));
12239
+ a = max(a, smoothstep(uRungThickness * uRungAmount * fwidth(vUv.y), 0.0, rung));
12240
+ #endif
12241
+
12142
12242
  // Depth fade: the wave recedes into the background colour with depth. Watch the
12143
12243
  // argument order: clamp(0.0, 1.0, z*6) is a swapped-args trap — it clamps the
12144
12244
  // constant 0.0 into [1.0, z*6], i.e. min(1.0, z*6), which (with our ortho clip.z
@@ -12152,151 +12252,128 @@ void main(){
12152
12252
  gl_FragColor.rgb *= gl_FragColor.a;
12153
12253
  #endif
12154
12254
  }
12155
- `, $l = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", eu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uBlurAmount;\nuniform int uBlurSamples;\nuniform float uGrainAmount;\nuniform float uTime;\nvarying vec2 vUv;\n\nfloat random2(vec2 st){ return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453); }\n\n// Angular (spin) blur: rotate the sample coord around the centre and\n// accumulate — a tangential smear that grows toward the edges. Carries alpha so a\n// transparent background survives the post pass.\nvec4 blurAngular(sampler2D tex, vec2 uv, float angle, int samples){\n vec4 total = vec4(0.0);\n vec2 coord = uv - 0.5;\n float dist = 1.0 / float(samples);\n vec2 dir = vec2(cos(angle * dist), sin(angle * dist));\n mat2 rot = mat2(dir.x, dir.y, -dir.y, dir.x);\n for (int i = 0; i < 64; i++){\n if (i >= samples) break;\n total += texture2D(tex, coord + 0.5);\n coord = coord * rot; // row-vector order (coord * rot) sets the spin direction\n }\n return total * dist;\n}\n\nvoid main(){\n vec4 sceneColor = texture2D(tDiffuse, vUv);\n vec4 blurColor = blurAngular(tDiffuse, vUv, uBlurAmount, uBlurSamples);\n // blurPower: keep a sharp band weighted to the middle, blurring toward top & bottom.\n float blurPower = smoothstep(0.0, 0.7, vUv.y) - smoothstep(0.2, 1.0, vUv.y);\n vec4 color = mix(blurColor, sceneColor, blurPower);\n // Static film grain: keyed off gl_FragCoord only (no uTime), so it doesn't flicker.\n color.rgb += mix(uGrainAmount, -uGrainAmount, random2(gl_FragCoord.xy * 0.01)) * (4.0 / 255.0);\n gl_FragColor = color; // preserve alpha → transparent background works\n}\n", tu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uDitherStrength; // 0..1 mix back toward the original\nuniform float uDitherScale; // pixel-block size in device px (paper: u_pxSize)\nuniform float uDitherSteps; // quantization levels (paper: u_colorSteps)\nvarying vec2 vUv;\n\nconst int bayer2x2[4] = int[4](0, 2, 3, 1);\nconst int bayer4x4[16] = int[16](0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5);\nconst int bayer8x8[64] = int[64](\n 0, 32, 8, 40, 2, 34, 10, 42, 48, 16, 56, 24, 50, 18, 58, 26,\n 12, 44, 4, 36, 14, 46, 6, 38, 60, 28, 52, 20, 62, 30, 54, 22,\n 3, 35, 11, 43, 1, 33, 9, 41, 51, 19, 59, 27, 49, 17, 57, 25,\n 15, 47, 7, 39, 13, 45, 5, 37, 63, 31, 55, 23, 61, 29, 53, 21\n);\nfloat getBayerValue(vec2 uv, int size){\n ivec2 pos = ivec2(fract(uv / float(size)) * float(size));\n int index = pos.y * size + pos.x;\n if (size == 2) return float(bayer2x2[index]) / 4.0;\n else if (size == 4) return float(bayer4x4[index]) / 16.0;\n else if (size == 8) return float(bayer8x8[index]) / 64.0;\n return 0.0;\n}\n\nvoid main(){\n float pxSize = max(uDitherScale, 1.0);\n vec2 pxSizeUV = gl_FragCoord.xy / pxSize;\n vec2 sampleUV = (floor(gl_FragCoord.xy / pxSize) + 0.5) * pxSize / max(uResolution, vec2(1.0));\n vec4 image = texture2D(tDiffuse, sampleUV);\n\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), image.rgb);\n float colorSteps = max(floor(uDitherSteps), 1.0);\n\n float dithering = getBayerValue(pxSizeUV, 8) - 0.5; // paper's default 8x8 ordered screen\n float brightness = clamp(lum + dithering / colorSteps, 0.0, 1.0);\n brightness = mix(0.0, brightness, image.a);\n float quantLum = floor(brightness * colorSteps + 0.5) / colorSteps;\n\n // paper's \"original colours\" path: keep the source hue, quantize luminance.\n vec3 color = image.rgb / max(lum, 0.001) * quantLum;\n float quantAlpha = floor(image.a * colorSteps + 0.5) / colorSteps;\n float opacity = mix(quantLum, 1.0, quantAlpha);\n\n gl_FragColor = mix(image, vec4(color, opacity), clamp(uDitherStrength, 0.0, 1.0));\n}\n", nu = "\nuniform sampler2D tDiffuse;\nuniform float uInnerLight; // 0..1 strength of the added light\nuniform float uInnerLightDensity; // ray length / spread\nuniform float uInnerLightDecay; // per-sample falloff (<1)\nuniform vec2 uInnerLightCenter; // light source, UV (0..1)\nvarying vec2 vUv;\n\nconst int LIGHT_SAMPLES = 24;\n\nfloat luma(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }\n\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 delta = (vUv - uInnerLightCenter) * (uInnerLightDensity / float(LIGHT_SAMPLES));\n vec2 coord = vUv;\n float decay = 1.0;\n vec3 rays = vec3(0.0);\n for (int i = 0; i < LIGHT_SAMPLES; i++){\n coord -= delta;\n vec4 s = texture2D(tDiffuse, coord);\n rays += s.rgb * s.a * decay; // only opaque (wave) pixels emit light\n decay *= uInnerLightDecay;\n }\n rays /= float(LIGHT_SAMPLES);\n vec3 outc = src.rgb + rays * uInnerLight;\n float outA = max(src.a, luma(rays) * uInnerLight); // shafts stay visible over the transparent bg\n gl_FragColor = vec4(outc, clamp(outA, 0.0, 1.0));\n}\n", ru = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uHalftone; // 0..1 mix\nuniform float uHalftoneCell; // dot cell size in device px (paper: u_size)\nuniform float uHalftoneAngle; // screen rotation (radians, paper: u_rotation)\nvarying vec2 vUv;\n\nfloat sigmoid(float x, float k){ return 1.0 / (1.0 + exp(-k * (x - 0.5))); }\n// paper's classic dot: radius grows as the sampled cell darkens (1 - lum), soft edge via fwidth.\nfloat getCircle(vec2 uv, float lum, float baseR){\n float r = mix(0.25 * baseR, 0.0, lum);\n float d = length(uv - 0.5);\n float aa = fwidth(d);\n return 1.0 - smoothstep(r - aa, r + aa, d);\n}\n\nvoid main(){\n float ca = cos(uHalftoneAngle);\n float sa = sin(uHalftoneAngle);\n mat2 rot = mat2(ca, sa, -sa, ca);\n float cell = max(uHalftoneCell, 2.0);\n vec2 gridPx = rot * gl_FragCoord.xy; // rotate the screen into the dot grid\n vec2 cellId = floor(gridPx / cell);\n vec2 inCell = fract(gridPx / cell); // position within the cell (0..1)\n vec2 centrePx = transpose(rot) * ((cellId + 0.5) * cell); // cell centre, back in screen px\n vec4 tex = texture2D(tDiffuse, centrePx / max(uResolution, vec2(1.0)));\n\n float k = 2.0; // sigmoid contrast (paper default)\n vec3 c = vec3(sigmoid(tex.r, k), sigmoid(tex.g, k), sigmoid(tex.b, k));\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), c);\n lum = mix(1.0, lum, tex.a);\n float dot = getCircle(inCell, lum, 1.3); // baseR 1.3 ≈ paper original-colours default\n vec4 dots = vec4(tex.rgb, tex.a * dot); // wave-coloured dots, transparent between\n gl_FragColor = mix(texture2D(tDiffuse, vUv), dots, clamp(uHalftone, 0.0, 1.0));\n}\n", iu = "\nuniform sampler2D tDiffuse;\nuniform float uHeatmap; // 0..1 mix\nvarying vec2 vUv;\nvec3 heat(float t){\n t = clamp(t, 0.0, 1.0);\n vec3 c = mix(vec3(0.0, 0.0, 0.4), vec3(0.0, 0.6, 1.0), smoothstep(0.0, 0.25, t));\n c = mix(c, vec3(0.0, 1.0, 0.4), smoothstep(0.25, 0.5, t));\n c = mix(c, vec3(1.0, 1.0, 0.0), smoothstep(0.5, 0.75, t));\n c = mix(c, vec3(1.0, 0.1, 0.0), smoothstep(0.75, 1.0, t));\n return c;\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float l = dot(src.rgb, vec3(0.299, 0.587, 0.114));\n gl_FragColor = vec4(mix(src.rgb, heat(l), clamp(uHeatmap, 0.0, 1.0)), src.a);\n}\n", au = "\nuniform sampler2D tDiffuse;\nuniform float uPaper; // 0..1 strength\nuniform float uPaperScale; // grain scale\nvarying vec2 vUv;\nfloat h21(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 p = gl_FragCoord.xy / max(uPaperScale, 0.5);\n float fiber = h21(floor(p)) * 0.5 + h21(floor(p * vec2(0.3, 3.0))) * 0.5; // directional fibers\n float tex = mix(fiber, h21(gl_FragCoord.xy), 0.3); // + fine speckle\n float shade = 1.0 - (tex - 0.5) * 0.35;\n gl_FragColor = vec4(src.rgb * mix(1.0, shade, clamp(uPaper, 0.0, 1.0)), src.a);\n}\n", ou = "\nuniform sampler2D tDiffuse;\nuniform float uHalftoneCmyk; // 0..1 mix\nuniform float uHalftoneCmykCell; // dot cell size in device px\nvarying vec2 vUv;\n// One rotated halftone dot screen for a channel value.\nfloat dotScreen(vec2 coord, float value, float angle, float cell){\n float ca = cos(angle);\n float sa = sin(angle);\n vec2 r = mat2(ca, sa, -sa, ca) * coord;\n vec2 c = fract(r / max(cell, 2.0)) - 0.5;\n float radius = sqrt(clamp(value, 0.0, 1.0)) * 0.5;\n return smoothstep(radius, radius - 0.06, length(c));\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float k = 1.0 - max(max(src.r, src.g), src.b); // RGB → CMYK\n float invK = max(1.0 - k, 1e-3);\n float cyan = (1.0 - src.r - k) / invK;\n float mag = (1.0 - src.g - k) / invK;\n float yel = (1.0 - src.b - k) / invK;\n vec2 coord = gl_FragCoord.xy;\n float cell = uHalftoneCmykCell;\n float dc = dotScreen(coord, cyan, 1.309, cell); // 75°\n float dm = dotScreen(coord, mag, 0.262, cell); // 15°\n float dy = dotScreen(coord, yel, 0.0, cell); // 0°\n float dk = dotScreen(coord, k, 0.785, cell); // 45°\n // Subtractive: cyan ink absorbs red, magenta absorbs green, yellow absorbs blue, black absorbs all.\n vec3 outc = vec3(1.0) - vec3(dc, 0.0, 0.0) - vec3(0.0, dm, 0.0) - vec3(0.0, 0.0, dy) - vec3(dk);\n outc = clamp(outc, 0.0, 1.0);\n gl_FragColor = vec4(mix(src.rgb, outc, clamp(uHalftoneCmyk, 0.0, 1.0)), src.a);\n}\n";
12156
- })), cu, lu, uu, du, fu, pu, mu = t((() => {
12157
- Vc(), cu = 400, lu = 16, uu = cu / 4, du = new K(1, 0, 0), fu = new K(0, 1, 0), pu = class {
12158
- geometry;
12159
- segments = -1;
12160
- constructor(e) {
12161
- this.geometry = new Rr(), this.resize(e);
12162
- }
12163
- resize(e) {
12164
- if (e === this.segments) return;
12165
- this.segments = e;
12166
- let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(cu, cu, t, n), i = r.attributes.position, a = r.attributes.uv, o = new K();
12167
- for (let e = 0; e < i.count; e++) {
12168
- o.fromBufferAttribute(i, e);
12169
- let t = a.getY(e), n = 4 - 2 * (4 * t * (1 - t)) ** 9.5;
12170
- o.x < -16 ? o.z += n : o.x < lu ? (o.z = Math.cos(Gt.mapLinear(o.x, -16, lu, 0, Math.PI)) * n, o.x = Math.cos(Gt.mapLinear(o.x, -16, lu, -Math.PI / 2, Math.PI / 2)) * n - lu) : (o.z -= n, o.x = -o.x), o.x += uu, o.applyAxisAngle(du, -Math.PI / 2), o.applyAxisAngle(fu, -Math.PI / 2), i.setXYZ(e, o.x, o.y, o.z);
12171
- }
12172
- i.needsUpdate = !0;
12173
- let s = t + 1, c = r.getIndex(), l = c ? Array.from(c.array) : [];
12174
- for (let e = 0; e < n; e++) {
12175
- let n = e * s, r = (e + 1) * s, i = n + t, a = r + t;
12176
- l.push(n, i, r, r, i, a);
12177
- }
12178
- for (let e of [0, n]) {
12179
- let n = e * s;
12180
- for (let r = 1; r < t; r++) l.push(n, e * s + r, e * s + r + 1);
12181
- }
12182
- r.setIndex(l), r.computeVertexNormals(), this.geometry.setIndex(r.getIndex()), this.geometry.setAttribute("position", r.getAttribute("position")), this.geometry.setAttribute("uv", r.getAttribute("uv")), this.geometry.setAttribute("normal", r.getAttribute("normal")), this.geometry.computeBoundingSphere(), r.dispose();
12183
- }
12184
- dispose() {
12185
- this.geometry.dispose();
12186
- }
12187
- };
12255
+ `, lu = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", uu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uBlurAmount;\nuniform int uBlurSamples;\nuniform float uGrainAmount;\nuniform float uTime;\nvarying vec2 vUv;\n\nfloat random2(vec2 st){ return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453); }\n\n// Angular (spin) blur: rotate the sample coord around the centre and\n// accumulate — a tangential smear that grows toward the edges. Carries alpha so a\n// transparent background survives the post pass.\nvec4 blurAngular(sampler2D tex, vec2 uv, float angle, int samples){\n vec4 total = vec4(0.0);\n vec2 coord = uv - 0.5;\n float dist = 1.0 / float(samples);\n vec2 dir = vec2(cos(angle * dist), sin(angle * dist));\n mat2 rot = mat2(dir.x, dir.y, -dir.y, dir.x);\n for (int i = 0; i < 64; i++){\n if (i >= samples) break;\n total += texture2D(tex, coord + 0.5);\n coord = coord * rot; // row-vector order (coord * rot) sets the spin direction\n }\n return total * dist;\n}\n\nvoid main(){\n vec4 sceneColor = texture2D(tDiffuse, vUv);\n vec4 blurColor = blurAngular(tDiffuse, vUv, uBlurAmount, uBlurSamples);\n // blurPower: keep a sharp band weighted to the middle, blurring toward top & bottom.\n float blurPower = smoothstep(0.0, 0.7, vUv.y) - smoothstep(0.2, 1.0, vUv.y);\n vec4 color = mix(blurColor, sceneColor, blurPower);\n // Static film grain: keyed off gl_FragCoord only (no uTime), so it doesn't flicker.\n color.rgb += mix(uGrainAmount, -uGrainAmount, random2(gl_FragCoord.xy * 0.01)) * (4.0 / 255.0);\n gl_FragColor = color; // preserve alpha → transparent background works\n}\n", du = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uDitherStrength; // 0..1 mix back toward the original\nuniform float uDitherScale; // pixel-block size in device px (paper: u_pxSize)\nuniform float uDitherSteps; // quantization levels (paper: u_colorSteps)\nvarying vec2 vUv;\n\nconst int bayer2x2[4] = int[4](0, 2, 3, 1);\nconst int bayer4x4[16] = int[16](0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5);\nconst int bayer8x8[64] = int[64](\n 0, 32, 8, 40, 2, 34, 10, 42, 48, 16, 56, 24, 50, 18, 58, 26,\n 12, 44, 4, 36, 14, 46, 6, 38, 60, 28, 52, 20, 62, 30, 54, 22,\n 3, 35, 11, 43, 1, 33, 9, 41, 51, 19, 59, 27, 49, 17, 57, 25,\n 15, 47, 7, 39, 13, 45, 5, 37, 63, 31, 55, 23, 61, 29, 53, 21\n);\nfloat getBayerValue(vec2 uv, int size){\n ivec2 pos = ivec2(fract(uv / float(size)) * float(size));\n int index = pos.y * size + pos.x;\n if (size == 2) return float(bayer2x2[index]) / 4.0;\n else if (size == 4) return float(bayer4x4[index]) / 16.0;\n else if (size == 8) return float(bayer8x8[index]) / 64.0;\n return 0.0;\n}\n\nvoid main(){\n float pxSize = max(uDitherScale, 1.0);\n vec2 pxSizeUV = gl_FragCoord.xy / pxSize;\n vec2 sampleUV = (floor(gl_FragCoord.xy / pxSize) + 0.5) * pxSize / max(uResolution, vec2(1.0));\n vec4 image = texture2D(tDiffuse, sampleUV);\n\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), image.rgb);\n float colorSteps = max(floor(uDitherSteps), 1.0);\n\n float dithering = getBayerValue(pxSizeUV, 8) - 0.5; // paper's default 8x8 ordered screen\n float brightness = clamp(lum + dithering / colorSteps, 0.0, 1.0);\n brightness = mix(0.0, brightness, image.a);\n float quantLum = floor(brightness * colorSteps + 0.5) / colorSteps;\n\n // paper's \"original colours\" path: keep the source hue, quantize luminance.\n vec3 color = image.rgb / max(lum, 0.001) * quantLum;\n float quantAlpha = floor(image.a * colorSteps + 0.5) / colorSteps;\n float opacity = mix(quantLum, 1.0, quantAlpha);\n\n gl_FragColor = mix(image, vec4(color, opacity), clamp(uDitherStrength, 0.0, 1.0));\n}\n", fu = "\nuniform sampler2D tDiffuse;\nuniform float uInnerLight; // 0..1 strength of the added light\nuniform float uInnerLightDensity; // ray length / spread\nuniform float uInnerLightDecay; // per-sample falloff (<1)\nuniform vec2 uInnerLightCenter; // light source, UV (0..1)\nvarying vec2 vUv;\n\nconst int LIGHT_SAMPLES = 24;\n\nfloat luma(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }\n\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 delta = (vUv - uInnerLightCenter) * (uInnerLightDensity / float(LIGHT_SAMPLES));\n vec2 coord = vUv;\n float decay = 1.0;\n vec3 rays = vec3(0.0);\n for (int i = 0; i < LIGHT_SAMPLES; i++){\n coord -= delta;\n vec4 s = texture2D(tDiffuse, coord);\n rays += s.rgb * s.a * decay; // only opaque (wave) pixels emit light\n decay *= uInnerLightDecay;\n }\n rays /= float(LIGHT_SAMPLES);\n vec3 outc = src.rgb + rays * uInnerLight;\n float outA = max(src.a, luma(rays) * uInnerLight); // shafts stay visible over the transparent bg\n gl_FragColor = vec4(outc, clamp(outA, 0.0, 1.0));\n}\n", pu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uHalftone; // 0..1 mix\nuniform float uHalftoneCell; // dot cell size in device px (paper: u_size)\nuniform float uHalftoneAngle; // screen rotation (radians, paper: u_rotation)\nvarying vec2 vUv;\n\nfloat sigmoid(float x, float k){ return 1.0 / (1.0 + exp(-k * (x - 0.5))); }\n// paper's classic dot: radius grows as the sampled cell darkens (1 - lum), soft edge via fwidth.\nfloat getCircle(vec2 uv, float lum, float baseR){\n float r = mix(0.25 * baseR, 0.0, lum);\n float d = length(uv - 0.5);\n float aa = fwidth(d);\n return 1.0 - smoothstep(r - aa, r + aa, d);\n}\n\nvoid main(){\n float ca = cos(uHalftoneAngle);\n float sa = sin(uHalftoneAngle);\n mat2 rot = mat2(ca, sa, -sa, ca);\n float cell = max(uHalftoneCell, 2.0);\n vec2 gridPx = rot * gl_FragCoord.xy; // rotate the screen into the dot grid\n vec2 cellId = floor(gridPx / cell);\n vec2 inCell = fract(gridPx / cell); // position within the cell (0..1)\n vec2 centrePx = transpose(rot) * ((cellId + 0.5) * cell); // cell centre, back in screen px\n vec4 tex = texture2D(tDiffuse, centrePx / max(uResolution, vec2(1.0)));\n\n float k = 2.0; // sigmoid contrast (paper default)\n vec3 c = vec3(sigmoid(tex.r, k), sigmoid(tex.g, k), sigmoid(tex.b, k));\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), c);\n lum = mix(1.0, lum, tex.a);\n float dot = getCircle(inCell, lum, 1.3); // baseR 1.3 ≈ paper original-colours default\n vec4 dots = vec4(tex.rgb, tex.a * dot); // wave-coloured dots, transparent between\n gl_FragColor = mix(texture2D(tDiffuse, vUv), dots, clamp(uHalftone, 0.0, 1.0));\n}\n", mu = "\nuniform sampler2D tDiffuse;\nuniform float uHeatmap; // 0..1 mix\nvarying vec2 vUv;\nvec3 heat(float t){\n t = clamp(t, 0.0, 1.0);\n vec3 c = mix(vec3(0.0, 0.0, 0.4), vec3(0.0, 0.6, 1.0), smoothstep(0.0, 0.25, t));\n c = mix(c, vec3(0.0, 1.0, 0.4), smoothstep(0.25, 0.5, t));\n c = mix(c, vec3(1.0, 1.0, 0.0), smoothstep(0.5, 0.75, t));\n c = mix(c, vec3(1.0, 0.1, 0.0), smoothstep(0.75, 1.0, t));\n return c;\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float l = dot(src.rgb, vec3(0.299, 0.587, 0.114));\n gl_FragColor = vec4(mix(src.rgb, heat(l), clamp(uHeatmap, 0.0, 1.0)), src.a);\n}\n", hu = "\nuniform sampler2D tDiffuse;\nuniform float uPaper; // 0..1 strength\nuniform float uPaperScale; // grain scale\nvarying vec2 vUv;\nfloat h21(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 p = gl_FragCoord.xy / max(uPaperScale, 0.5);\n float fiber = h21(floor(p)) * 0.5 + h21(floor(p * vec2(0.3, 3.0))) * 0.5; // directional fibers\n float tex = mix(fiber, h21(gl_FragCoord.xy), 0.3); // + fine speckle\n float shade = 1.0 - (tex - 0.5) * 0.35;\n gl_FragColor = vec4(src.rgb * mix(1.0, shade, clamp(uPaper, 0.0, 1.0)), src.a);\n}\n", gu = "\nuniform sampler2D tDiffuse;\nuniform float uHalftoneCmyk; // 0..1 mix\nuniform float uHalftoneCmykCell; // dot cell size in device px\nvarying vec2 vUv;\n// One rotated halftone dot screen for a channel value.\nfloat dotScreen(vec2 coord, float value, float angle, float cell){\n float ca = cos(angle);\n float sa = sin(angle);\n vec2 r = mat2(ca, sa, -sa, ca) * coord;\n vec2 c = fract(r / max(cell, 2.0)) - 0.5;\n float radius = sqrt(clamp(value, 0.0, 1.0)) * 0.5;\n return smoothstep(radius, radius - 0.06, length(c));\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float k = 1.0 - max(max(src.r, src.g), src.b); // RGB → CMYK\n float invK = max(1.0 - k, 1e-3);\n float cyan = (1.0 - src.r - k) / invK;\n float mag = (1.0 - src.g - k) / invK;\n float yel = (1.0 - src.b - k) / invK;\n vec2 coord = gl_FragCoord.xy;\n float cell = uHalftoneCmykCell;\n float dc = dotScreen(coord, cyan, 1.309, cell); // 75°\n float dm = dotScreen(coord, mag, 0.262, cell); // 15°\n float dy = dotScreen(coord, yel, 0.0, cell); // 0°\n float dk = dotScreen(coord, k, 0.785, cell); // 45°\n // Subtractive: cyan ink absorbs red, magenta absorbs green, yellow absorbs blue, black absorbs all.\n vec3 outc = vec3(1.0) - vec3(dc, 0.0, 0.0) - vec3(0.0, dm, 0.0) - vec3(0.0, 0.0, dy) - vec3(dk);\n outc = clamp(outc, 0.0, 1.0);\n gl_FragColor = vec4(mix(src.rgb, outc, clamp(uHalftoneCmyk, 0.0, 1.0)), src.a);\n}\n";
12188
12256
  }));
12189
12257
  //#endregion
12190
12258
  //#region src/renderer/interaction.ts
12191
- function hu(e, t) {
12259
+ function vu(e, t) {
12192
12260
  return e > 0 ? 1 - Math.exp(-t / e) : 1;
12193
12261
  }
12194
- function gu(e, t, n, r, i, a) {
12262
+ function yu(e, t, n, r, i, a) {
12195
12263
  if (a <= 0) return;
12196
- let o = a > Mu ? Math.min(Math.ceil(a / Mu), Nu) : 1, s = a / o, c = r * r, l = 2 * i * r;
12264
+ let o = a > Fu ? Math.min(Math.ceil(a / Fu), Iu) : 1, s = a / o, c = r * r, l = 2 * i * r;
12197
12265
  for (let r = 0; r < o; r++) t.x += (c * (n.x - e.x) - l * t.x) * s, t.y += (c * (n.y - e.y) - l * t.y) * s, e.x += t.x * s, e.y += t.y * s;
12198
12266
  }
12199
- function _u(e) {
12267
+ function bu(e) {
12200
12268
  return e.interaction?.enabled !== !1;
12201
12269
  }
12202
- function vu(e) {
12270
+ function xu(e) {
12203
12271
  let t = e.interaction;
12204
12272
  return !!t && (!!t.hover || (t.press?.ripple ?? 0) > 0);
12205
12273
  }
12206
- function yu(e, t) {
12207
- return _u(e) && vu(t);
12274
+ function Su(e, t) {
12275
+ return bu(e) && xu(t);
12208
12276
  }
12209
- function bu(e, t) {
12210
- return _u(e) && (t.interaction?.press?.ripple ?? 0) > 0;
12277
+ function Cu(e, t) {
12278
+ return bu(e) && (t.interaction?.press?.ripple ?? 0) > 0;
12211
12279
  }
12212
- function xu(e) {
12213
- return _u(e) && e.waves.some(vu);
12280
+ function wu(e) {
12281
+ return bu(e) && e.waves.some(xu);
12214
12282
  }
12215
- function Su(e) {
12216
- return _u(e) ? (e.interaction?.bindings?.length ?? 0) > 0 ? !0 : e.waves.some((e) => {
12283
+ function Tu(e) {
12284
+ return bu(e) ? (e.interaction?.bindings?.length ?? 0) > 0 ? !0 : e.waves.some((e) => {
12217
12285
  let t = e.interaction;
12218
12286
  return !!t && (!!t.hover || (t.press?.ripple ?? 0) > 0 || (t.bindings?.length ?? 0) > 0);
12219
12287
  }) : !1;
12220
12288
  }
12221
- var Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu = t((() => {
12222
- Vc(), hl(), Cu = 1.5, wu = .08, Tu = 4, Eu = 2, Du = .15, Ou = .12, ku = .25, Au = .7, ju = .02, Mu = 1 / 120, Nu = 6, Pu = (e, t) => ({
12289
+ var Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12290
+ Vc(), hl(), Eu = 1.5, Du = .08, Ou = 4, ku = 2, Au = .15, ju = .12, Mu = .25, Nu = .7, Pu = .02, Fu = 1 / 120, Iu = 6, Lu = (e, t) => ({
12223
12291
  base: e,
12224
12292
  apply: t
12225
- }), Fu = (e, t) => ({
12293
+ }), Ru = (e, t) => ({
12226
12294
  base: e,
12227
12295
  apply: t
12228
- }), Iu = {
12229
- displaceAmount: Pu((e) => e.displaceAmount, (e, t) => {
12296
+ }), zu = {
12297
+ displaceAmount: Lu((e) => e.displaceAmount, (e, t) => {
12230
12298
  t.u.uDispAmount.value = e;
12231
12299
  }),
12232
- detailAmount: Pu((e) => e.detailAmount ?? 0, (e, t) => {
12300
+ detailAmount: Lu((e) => e.detailAmount ?? 0, (e, t) => {
12233
12301
  t.u.uDetailAmount.value = e;
12234
12302
  }),
12235
- twistPowerX: Pu((e) => e.twistPower.x, (e, t) => {
12303
+ twistPowerX: Lu((e) => e.twistPower.x, (e, t) => {
12236
12304
  t.u.uTwPowX.value = e;
12237
12305
  }),
12238
- twistPowerY: Pu((e) => e.twistPower.y, (e, t) => {
12306
+ twistPowerY: Lu((e) => e.twistPower.y, (e, t) => {
12239
12307
  t.u.uTwPowY.value = e;
12240
12308
  }),
12241
- twistPowerZ: Pu((e) => e.twistPower.z, (e, t) => {
12309
+ twistPowerZ: Lu((e) => e.twistPower.z, (e, t) => {
12242
12310
  t.u.uTwPowZ.value = e;
12243
12311
  }),
12244
- twistFrequencyX: Pu((e) => e.twistFrequency.x, (e, t) => {
12312
+ twistFrequencyX: Lu((e) => e.twistFrequency.x, (e, t) => {
12245
12313
  t.u.uTwFreqX.value = e;
12246
12314
  }),
12247
- twistFrequencyY: Pu((e) => e.twistFrequency.y, (e, t) => {
12315
+ twistFrequencyY: Lu((e) => e.twistFrequency.y, (e, t) => {
12248
12316
  t.u.uTwFreqY.value = e;
12249
12317
  }),
12250
- twistFrequencyZ: Pu((e) => e.twistFrequency.z, (e, t) => {
12318
+ twistFrequencyZ: Lu((e) => e.twistFrequency.z, (e, t) => {
12251
12319
  t.u.uTwFreqZ.value = e;
12252
12320
  }),
12253
- hueShift: Pu((e) => e.hueShift, (e, t) => {
12321
+ hueShift: Lu((e) => e.hueShift, (e, t) => {
12254
12322
  t.u.uHueShift.value = e;
12255
12323
  }),
12256
- gradientShift: Pu((e) => e.gradientShift ?? 0, (e, t) => {
12324
+ gradientShift: Lu((e) => e.gradientShift ?? 0, (e, t) => {
12257
12325
  t.u.uGradShift.value = e;
12258
12326
  }),
12259
- colorSaturation: Pu((e) => e.colorSaturation, (e, t) => {
12327
+ colorSaturation: Lu((e) => e.colorSaturation, (e, t) => {
12260
12328
  t.u.uSaturation.value = e;
12261
12329
  }),
12262
- opacity: Pu((e) => e.opacity, (e, t) => {
12330
+ opacity: Lu((e) => e.opacity, (e, t) => {
12263
12331
  t.u.uOpacity.value = e;
12264
12332
  }),
12265
- lineThickness: Pu((e) => e.lineThickness ?? 1, (e, t) => {
12333
+ lineThickness: Lu((e) => e.lineThickness ?? 1, (e, t) => {
12266
12334
  t.u.uLineThickness.value = e;
12267
12335
  }),
12268
- lineAmount: Pu((e) => e.lineAmount ?? 425, (e, t) => {
12336
+ lineAmount: Lu((e) => e.lineAmount ?? 425, (e, t) => {
12269
12337
  t.u.uLineAmount.value = e;
12270
12338
  }),
12271
- fiberStrength: Pu((e) => e.fiberStrength, (e, t) => {
12339
+ fiberStrength: Lu((e) => e.fiberStrength, (e, t) => {
12272
12340
  t.u.uFiberStrength.value = e;
12273
12341
  }),
12274
- sheen: Pu((e) => e.sheen ?? 1, (e, t) => {
12342
+ sheen: Lu((e) => e.sheen ?? 1, (e, t) => {
12275
12343
  t.u.uSheen.value = e;
12276
12344
  }),
12277
- iridescence: Pu((e) => e.iridescence ?? 0, (e, t) => {
12345
+ iridescence: Lu((e) => e.iridescence ?? 0, (e, t) => {
12278
12346
  t.u.uIridescence.value = e;
12279
12347
  }),
12280
- positionX: Pu((e) => e.position.x, (e, t) => {
12348
+ helixPhase: Lu((e) => e.helixPhase ?? 0, (e, t) => {
12349
+ t.u.uHelixPhase.value = e;
12350
+ }),
12351
+ helixTurns: Lu((e) => e.helixTurns ?? 0, (e, t) => {
12352
+ t.u.uHelixTurns.value = e;
12353
+ }),
12354
+ helixRadius: Lu((e) => e.helixRadius ?? 0, (e, t) => {
12355
+ t.u.uHelixRadius.value = e;
12356
+ }),
12357
+ positionX: Lu((e) => e.position.x, (e, t) => {
12281
12358
  t.mesh.position.x = e;
12282
12359
  }),
12283
- positionY: Pu((e) => e.position.y, (e, t) => {
12360
+ positionY: Lu((e) => e.position.y, (e, t) => {
12284
12361
  t.mesh.position.y = e;
12285
12362
  })
12286
- }, Lu = {
12287
- timeOffset: Fu((e) => e.timeOffset ?? 0, (e, t) => {
12363
+ }, Bu = {
12364
+ timeOffset: Ru((e) => e.timeOffset ?? 0, (e, t) => {
12288
12365
  t.out.timeOffset = e;
12289
12366
  }),
12290
- cameraZoom: Fu((e) => e.cameraZoom ?? 1, (e, t) => {
12367
+ cameraZoom: Ru((e) => e.cameraZoom ?? 1, (e, t) => {
12291
12368
  t.out.zoom = e;
12292
12369
  }),
12293
- blur: Fu((e) => e.blur, (e, t) => {
12370
+ blur: Ru((e) => e.blur, (e, t) => {
12294
12371
  t.post.uBlurAmount.value = e;
12295
12372
  }),
12296
- grain: Fu((e) => e.grain, (e, t) => {
12373
+ grain: Ru((e) => e.grain, (e, t) => {
12297
12374
  t.post.uGrainAmount.value = e;
12298
12375
  })
12299
- }, Ru = class {
12376
+ }, Vu = class {
12300
12377
  container;
12301
12378
  cfg;
12302
12379
  scrollOverride = null;
@@ -12374,12 +12451,12 @@ var Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu = t((() =
12374
12451
  update(e) {
12375
12452
  let t = this.cfg();
12376
12453
  if (!t) return;
12377
- let n = Math.max(e, 0), r = hu(Ou, n);
12454
+ let n = Math.max(e, 0), r = vu(ju, n);
12378
12455
  if (this.ndcPrev.copy(this.ndc), this.ndc.lerp(this.ndcTarget, r), this.presence += (this.presenceTarget - this.presence) * r, this.press += (this.pressTarget - this.press) * r, n > 1e-5) {
12379
- let e = hu(wu, n);
12456
+ let e = vu(Du, n);
12380
12457
  this.velNdc.x += ((this.ndc.x - this.ndcPrev.x) / n - this.velNdc.x) * e, this.velNdc.y += ((this.ndc.y - this.ndcPrev.y) / n - this.velNdc.y) * e;
12381
12458
  }
12382
- this.pointerSpeed = this.presence * ml(this.velNdc.length() / Tu);
12459
+ this.pointerSpeed = this.presence * ml(this.velNdc.length() / Ou);
12383
12460
  let i = t.waves;
12384
12461
  this.fields.length > i.length && (this.fields.length = i.length);
12385
12462
  for (let e = 0; e < i.length; e++) {
@@ -12389,19 +12466,19 @@ var Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu = t((() =
12389
12466
  vel: new G(),
12390
12467
  presence: this.presenceTarget
12391
12468
  }, this.fields[e] = t);
12392
- let r = Math.max(i[e].interaction?.hover?.smoothing ?? Ou, ju);
12393
- gu(t.ndc, t.vel, this.ndcTarget, 1 / r, Au, n), t.presence += (this.presenceTarget - t.presence) * hu(r, n);
12469
+ let r = Math.max(i[e].interaction?.hover?.smoothing ?? ju, Pu);
12470
+ yu(t.ndc, t.vel, this.ndcTarget, 1 / r, Nu, n), t.presence += (this.presenceTarget - t.presence) * vu(r, n);
12394
12471
  }
12395
12472
  let a = this.scrollOverride ?? this.computeScroll();
12396
12473
  if (n > 1e-5) {
12397
12474
  let e = Math.abs(a - this.scrollPrev) / n;
12398
- this.scrollVel += (e - this.scrollVel) * hu(Du, n);
12475
+ this.scrollVel += (e - this.scrollVel) * vu(Au, n);
12399
12476
  }
12400
12477
  this.scrollPrev = a, this.scroll = a, this.appearLatched = !0;
12401
12478
  for (let e of this.ripples) {
12402
12479
  if (!e.active) continue;
12403
12480
  e.age += n;
12404
- let t = Math.max(0, 1 - e.age / Cu);
12481
+ let t = Math.max(0, 1 - e.age / Eu);
12405
12482
  e.amp = t * t, e.amp <= 0 && (e.active = !1);
12406
12483
  }
12407
12484
  this.updateBindings(t, n);
@@ -12423,7 +12500,7 @@ var Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu = t((() =
12423
12500
  (!r || r.source !== e.source) && (r = {
12424
12501
  value: e.source === "appear" ? 0 : n,
12425
12502
  source: e.source
12426
- }, this.bindingState.set(e, r)), r.value += (n - r.value) * hu(e.smoothing ?? ku, t);
12503
+ }, this.bindingState.set(e, r)), r.value += (n - r.value) * vu(e.smoothing ?? Mu, t);
12427
12504
  }
12428
12505
  bindingValue(e) {
12429
12506
  return this.bindingState.get(e)?.value ?? 0;
@@ -12436,7 +12513,7 @@ var Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu = t((() =
12436
12513
  case "pointerY": return (this.ndc.y + 1) * .5;
12437
12514
  case "pointerSpeed": return this.pointerSpeed;
12438
12515
  case "press": return this.press;
12439
- case "scrollVelocity": return ml(this.scrollVel / Eu);
12516
+ case "scrollVelocity": return ml(this.scrollVel / ku);
12440
12517
  case "appear": return +!!this.appearLatched;
12441
12518
  default: return this.customInputs.get(e.slice(7)) ?? 0;
12442
12519
  }
@@ -12501,42 +12578,42 @@ var Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu = t((() =
12501
12578
  }));
12502
12579
  //#endregion
12503
12580
  //#region src/renderer/palette.ts
12504
- function Bu(e) {
12581
+ function Uu(e) {
12505
12582
  return e * e * (3 - 2 * e);
12506
12583
  }
12507
- function Vu(e, t) {
12584
+ function Wu(e, t) {
12508
12585
  let n = new X(e).clone().convertLinearToSRGB();
12509
12586
  return `rgba(${Math.round(n.r * 255)}, ${Math.round(n.g * 255)}, ${Math.round(n.b * 255)}, ${t})`;
12510
12587
  }
12511
- function Hu(e) {
12588
+ function Gu(e) {
12512
12589
  let t = document.createElement("canvas");
12513
- t.width = sd, t.height = cd;
12590
+ t.width = ud, t.height = dd;
12514
12591
  let n = t.getContext("2d");
12515
12592
  if (!n) return t;
12516
- let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0, sd, 0);
12593
+ let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0, ud, 0);
12517
12594
  if (r.length === 0) i.addColorStop(0, "#ffffff");
12518
12595
  else for (let e of r) i.addColorStop(ml(e.pos), e.color);
12519
- n.fillStyle = i, n.fillRect(0, 0, sd, cd);
12596
+ n.fillStyle = i, n.fillRect(0, 0, ud, dd);
12520
12597
  let a = ml(e.edgeAmount);
12521
12598
  if (a > .001) {
12522
- let t = n.createLinearGradient(0, 0, 0, cd);
12523
- t.addColorStop(0, Vu(e.edgeColor, a)), t.addColorStop(.5, Vu(e.edgeColor, 0)), t.addColorStop(1, Vu(e.edgeColor, a)), n.fillStyle = t, n.fillRect(0, 0, sd, cd);
12599
+ let t = n.createLinearGradient(0, 0, 0, dd);
12600
+ t.addColorStop(0, Wu(e.edgeColor, a)), t.addColorStop(.5, Wu(e.edgeColor, 0)), t.addColorStop(1, Wu(e.edgeColor, a)), n.fillStyle = t, n.fillRect(0, 0, ud, dd);
12524
12601
  }
12525
12602
  return t;
12526
12603
  }
12527
- function Uu(e) {
12604
+ function Ku(e) {
12528
12605
  return `${e.stops.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(",")}|${e.edgeColor}|${e.edgeAmount.toFixed(3)}`;
12529
12606
  }
12530
- function Wu(e) {
12607
+ function qu(e) {
12531
12608
  return e.colorSpace = At, e.minFilter = z, e.magFilter = z, e.wrapS = he, e.wrapT = he, e.generateMipmaps = !1, e;
12532
12609
  }
12533
- function Gu(e) {
12534
- return Wu(new yi(e));
12610
+ function Ju(e) {
12611
+ return qu(new yi(e));
12535
12612
  }
12536
- function Ku(e) {
12537
- return Gu(Hu(e));
12613
+ function Yu(e) {
12614
+ return Ju(Gu(e));
12538
12615
  }
12539
- function qu(e) {
12616
+ function Xu(e) {
12540
12617
  let t = document.createElement("canvas");
12541
12618
  t.width = Math.max(1, Math.round(e.width)), t.height = Math.max(1, Math.round(e.height));
12542
12619
  let n = t.getContext("2d");
@@ -12553,11 +12630,11 @@ function qu(e) {
12553
12630
  else for (let e of l) c.addColorStop(ml(e.pos), e.color);
12554
12631
  return n.fillStyle = c, n.fillRect(0, 0, r, i), t;
12555
12632
  }
12556
- function Ju(e) {
12633
+ function Zu(e) {
12557
12634
  let t = ml(e), n = t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
12558
12635
  return Math.round(ml(n) * 255);
12559
12636
  }
12560
- function Yu(e, t, n, r) {
12637
+ function Qu(e, t, n, r) {
12561
12638
  let i = Math.max(1, Math.round(n)), a = Math.max(1, Math.round(r)), o = new ImageData(i, a), s = o.data, c = e.length >= 2 ? e : yl(), l = c.map((e) => new X(e.color)), u = 4.8 + -3.4499999999999997 * ml(t);
12562
12639
  for (let e = 0; e < a; e++) {
12563
12640
  let t = 1 - e / Math.max(1, a - 1);
@@ -12568,12 +12645,12 @@ function Yu(e, t, n, r) {
12568
12645
  a += l[e].r * s, o += l[e].g * s, d += l[e].b * s, f += s;
12569
12646
  }
12570
12647
  let p = Math.max(f, 1e-4), m = (e * i + n) * 4;
12571
- s[m] = Ju(a / p), s[m + 1] = Ju(o / p), s[m + 2] = Ju(d / p), s[m + 3] = 255;
12648
+ s[m] = Zu(a / p), s[m + 1] = Zu(o / p), s[m + 2] = Zu(d / p), s[m + 3] = 255;
12572
12649
  }
12573
12650
  }
12574
12651
  return o;
12575
12652
  }
12576
- function Xu(e, t, n, r) {
12653
+ function $u(e, t, n, r) {
12577
12654
  let i = document.createElement("canvas");
12578
12655
  i.width = Math.max(1, Math.round(n)), i.height = Math.max(1, Math.round(r));
12579
12656
  let a = i.getContext("2d");
@@ -12581,42 +12658,42 @@ function Xu(e, t, n, r) {
12581
12658
  let o = Math.min(1, 320 / Math.max(i.width, i.height)), s = Math.max(2, Math.round(i.width * o)), c = Math.max(2, Math.round(i.height * o)), l = document.createElement("canvas");
12582
12659
  l.width = s, l.height = c;
12583
12660
  let u = l.getContext("2d");
12584
- return u ? (u.putImageData(Yu(e, t, s, c), 0, 0), a.imageSmoothingEnabled = !0, a.imageSmoothingQuality = "high", a.drawImage(l, 0, 0, s, c, 0, 0, i.width, i.height), i) : i;
12661
+ return u ? (u.putImageData(Qu(e, t, s, c), 0, 0), a.imageSmoothingEnabled = !0, a.imageSmoothingQuality = "high", a.drawImage(l, 0, 0, s, c, 0, 0, i.width, i.height), i) : i;
12585
12662
  }
12586
- function Zu(e, t, n, r, i, a, o, s = 1, c = 0, l = 0) {
12663
+ function ed(e, t, n, r, i, a, o, s = 1, c = 0, l = 0) {
12587
12664
  let u = document.createElement("canvas");
12588
- return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)), Qu(u, e, t, n, a, o, s, c, l), u;
12665
+ return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)), td(u, e, t, n, a, o, s, c, l), u;
12589
12666
  }
12590
- function Qu(e, t, n, r, i, a, o = 1, s = 0, c = 0) {
12667
+ function td(e, t, n, r, i, a, o = 1, s = 0, c = 0) {
12591
12668
  let l = e.getContext("2d");
12592
12669
  if (!l) return;
12593
12670
  l.fillStyle = a, l.fillRect(0, 0, e.width, e.height);
12594
12671
  let u = Math.max(.1, o), d = i === "stretch" ? e.width : n * (i === "contain" ? Math.min(e.width / n, e.height / r) : Math.max(e.width / n, e.height / r)), f = i === "stretch" ? e.height : r * (i === "contain" ? Math.min(e.width / n, e.height / r) : Math.max(e.width / n, e.height / r)), p = d * u, m = f * u, h = s / 100 * e.width, g = c / 100 * e.height;
12595
12672
  l.drawImage(t, (e.width - p) / 2 + h, (e.height - m) / 2 + g, p, m);
12596
12673
  }
12597
- function $u(e) {
12674
+ function nd(e) {
12598
12675
  let t = (t, n) => {
12599
12676
  let r = t * 374761393 + n * 668265263 + e * 1442695041 | 0;
12600
12677
  return r = Math.imul(r ^ r >>> 13, 1274126177), ((r ^ r >>> 16) >>> 0) / 4294967295;
12601
12678
  };
12602
12679
  return (e, n) => {
12603
- let r = Math.floor(e), i = Math.floor(n), a = Bu(e - r), o = Bu(n - i), s = t(r, i), c = t(r + 1, i), l = t(r, i + 1), u = t(r + 1, i + 1);
12680
+ let r = Math.floor(e), i = Math.floor(n), a = Uu(e - r), o = Uu(n - i), s = t(r, i), c = t(r + 1, i), l = t(r, i + 1), u = t(r + 1, i + 1);
12604
12681
  return s * (1 - a) * (1 - o) + c * a * (1 - o) + l * (1 - a) * o + u * a * o;
12605
12682
  };
12606
12683
  }
12607
- function ed(e, t, n, r) {
12684
+ function rd(e, t, n, r) {
12608
12685
  let i = 0, a = .5, o = 1, s = 0;
12609
12686
  for (let c = 0; c < r; c++) i += a * e(t * o, n * o), s += a, o *= 2, a *= .5;
12610
12687
  return i / s;
12611
12688
  }
12612
- function td(e = 220) {
12613
- let t = Math.max(64, Math.min(1280, Math.round(e))), n = ud.get(t);
12689
+ function id(e = 220) {
12690
+ let t = Math.max(64, Math.min(1280, Math.round(e))), n = pd.get(t);
12614
12691
  if (n) return n;
12615
12692
  let r = document.createElement("canvas");
12616
12693
  r.width = t, r.height = t;
12617
12694
  let i = r.getContext("2d");
12618
12695
  if (!i) return r;
12619
- let a = i.createImageData(t, t), o = $u(11), s = $u(91), c = $u(47), l = [
12696
+ let a = i.createImageData(t, t), o = nd(11), s = nd(91), c = nd(47), l = [
12620
12697
  [0, [
12621
12698
  34,
12622
12699
  26,
@@ -12660,24 +12737,24 @@ function td(e = 220) {
12660
12737
  return l[l.length - 1][1];
12661
12738
  };
12662
12739
  for (let e = 0; e < t; e++) for (let n = 0; n < t; n++) {
12663
- let r = n / t * 3, i = e / t * 3, l = r + .7 * s(r * .7 + 5, i * .7), d = i + .7 * s(r * .7, i * .7 + 9), [f, p, m] = u(ed(o, l, d, 4)), h = Math.max(0, ed(c, l * 1.6 + 3, d * 1.6, 3) - .55) * 1.7;
12740
+ let r = n / t * 3, i = e / t * 3, l = r + .7 * s(r * .7 + 5, i * .7), d = i + .7 * s(r * .7, i * .7 + 9), [f, p, m] = u(rd(o, l, d, 4)), h = Math.max(0, rd(c, l * 1.6 + 3, d * 1.6, 3) - .55) * 1.7;
12664
12741
  f = f * (1 - h) + 70 * h, p = p * (1 - h) + 210 * h, m = m * (1 - h) + 200 * h;
12665
12742
  let g = (e * t + n) * 4;
12666
12743
  a.data[g] = f, a.data[g + 1] = p, a.data[g + 2] = m, a.data[g + 3] = 255;
12667
12744
  }
12668
- return i.putImageData(a, 0, 0), ud.set(t, r), r;
12745
+ return i.putImageData(a, 0, 0), pd.set(t, r), r;
12669
12746
  }
12670
- function nd(e, t, n, r) {
12671
- let i = `${e}|${t}x${n}`, a = dd.get(i);
12747
+ function ad(e, t, n, r) {
12748
+ let i = `${e}|${t}x${n}`, a = md.get(i);
12672
12749
  if (a) return a;
12673
12750
  let o = document.createElement("canvas");
12674
12751
  o.width = t, o.height = n;
12675
12752
  let s = o.getContext("2d");
12676
- return s && r(s, t, n), dd.set(i, o), o;
12753
+ return s && r(s, t, n), md.set(i, o), o;
12677
12754
  }
12678
- function rd(e = 240) {
12755
+ function od(e = 240) {
12679
12756
  let t = Math.max(120, Math.min(2048, Math.round(e)));
12680
- return nd("vaporwave", t, Math.round(t * 2 / 3), (e, t, n) => {
12757
+ return ad("vaporwave", t, Math.round(t * 2 / 3), (e, t, n) => {
12681
12758
  let r = t / 240, i = e.createLinearGradient(0, 0, 0, n);
12682
12759
  i.addColorStop(0, "#120638"), i.addColorStop(.56, "#8e2de2"), i.addColorStop(1, "#ff2fa8"), e.fillStyle = i, e.fillRect(0, 0, t, n);
12683
12760
  let a = n * .48, o = n * .28, s = e.createLinearGradient(0, a - o, 0, a + o);
@@ -12693,9 +12770,9 @@ function rd(e = 240) {
12693
12770
  e.globalAlpha = 1;
12694
12771
  });
12695
12772
  }
12696
- function id(e = 220) {
12773
+ function sd(e = 220) {
12697
12774
  let t = Math.max(110, Math.min(2048, Math.round(e)));
12698
- return nd("kaleidoscope", t, t, (e, t, n) => {
12775
+ return ad("kaleidoscope", t, t, (e, t, n) => {
12699
12776
  let r = t / 220, i = [
12700
12777
  "#00e5ff",
12701
12778
  "#6c3bff",
@@ -12711,25 +12788,25 @@ function id(e = 220) {
12711
12788
  for (let t = 1; t <= 4; t++) e.strokeStyle = t % 2 ? "rgba(255,255,255,.55)" : "rgba(8,5,35,.6)", e.lineWidth = 5 * r, e.beginPath(), e.arc(a, o, t * 25 * r, 0, Math.PI * 2), e.stroke();
12712
12789
  });
12713
12790
  }
12714
- function ad(e, t) {
12715
- return e.build ? e.build(t) : Hu({
12791
+ function cd(e, t) {
12792
+ return e.build ? e.build(t) : Gu({
12716
12793
  stops: e.stops ?? [],
12717
12794
  edgeColor: e.edgeColor ?? "#8e9dff",
12718
12795
  edgeAmount: e.edgeAmount ?? 0
12719
12796
  });
12720
12797
  }
12721
- function od(e) {
12722
- return Wu(new Zi().load(e));
12798
+ function ld(e) {
12799
+ return qu(new Zi().load(e));
12723
12800
  }
12724
- var sd, cd, ld, ud, dd, fd, pd = t((() => {
12725
- Vc(), hl(), Kl(), sd = 256, cd = 64, ld = (e) => e.map(([e, t]) => ({
12801
+ var ud, dd, fd, pd, md, hd, gd = t((() => {
12802
+ Vc(), hl(), Yl(), ud = 256, dd = 64, fd = (e) => e.map(([e, t]) => ({
12726
12803
  color: e,
12727
12804
  pos: t
12728
- })), ud = /* @__PURE__ */ new Map(), dd = /* @__PURE__ */ new Map(), fd = {
12805
+ })), pd = /* @__PURE__ */ new Map(), md = /* @__PURE__ */ new Map(), hd = {
12729
12806
  palestine: {
12730
12807
  label: "Palestine",
12731
12808
  kind: "gradient",
12732
- stops: ld([
12809
+ stops: fd([
12733
12810
  ["#000000", 0],
12734
12811
  ["#f7f7f2", .34],
12735
12812
  ["#149954", .67],
@@ -12741,7 +12818,7 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12741
12818
  spain: {
12742
12819
  label: "Spain",
12743
12820
  kind: "gradient",
12744
- stops: ld([
12821
+ stops: fd([
12745
12822
  ["#aa151b", 0],
12746
12823
  ["#aa151b", .24],
12747
12824
  ["#f1bf00", .34],
@@ -12755,7 +12832,7 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12755
12832
  grandLine: {
12756
12833
  label: "Grand Line",
12757
12834
  kind: "gradient",
12758
- stops: ld([
12835
+ stops: fd([
12759
12836
  ["#071b33", 0],
12760
12837
  ["#087ea4", .22],
12761
12838
  ["#45d4c5", .4],
@@ -12770,22 +12847,22 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12770
12847
  vaporwave: {
12771
12848
  label: "Vaporwave Sunset",
12772
12849
  kind: "image",
12773
- build: rd
12850
+ build: od
12774
12851
  },
12775
12852
  kaleidoscope: {
12776
12853
  label: "Kaleidoscope",
12777
12854
  kind: "image",
12778
- build: id
12855
+ build: sd
12779
12856
  },
12780
12857
  nebula: {
12781
12858
  label: "Nebula (2D)",
12782
12859
  kind: "image",
12783
- build: td
12860
+ build: id
12784
12861
  },
12785
12862
  sunset: {
12786
12863
  label: "Sunset",
12787
12864
  kind: "gradient",
12788
- stops: ld([
12865
+ stops: fd([
12789
12866
  ["#3b1c6b", 0],
12790
12867
  ["#8b2fa0", .3],
12791
12868
  ["#e0457a", .56],
@@ -12798,7 +12875,7 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12798
12875
  aurora: {
12799
12876
  label: "Aurora",
12800
12877
  kind: "gradient",
12801
- stops: ld([
12878
+ stops: fd([
12802
12879
  ["#0b3d4f", 0],
12803
12880
  ["#1fb89e", .3],
12804
12881
  ["#5ee0a0", .52],
@@ -12811,7 +12888,7 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12811
12888
  ocean: {
12812
12889
  label: "Ocean",
12813
12890
  kind: "gradient",
12814
- stops: ld([
12891
+ stops: fd([
12815
12892
  ["#0a1f4d", 0],
12816
12893
  ["#1f6fb8", .36],
12817
12894
  ["#2bd0d0", .66],
@@ -12823,7 +12900,7 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12823
12900
  ember: {
12824
12901
  label: "Ember",
12825
12902
  kind: "gradient",
12826
- stops: ld([
12903
+ stops: fd([
12827
12904
  ["#2a0707", 0],
12828
12905
  ["#a81e1e", .34],
12829
12906
  ["#ff5a2e", .64],
@@ -12835,7 +12912,7 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12835
12912
  iris: {
12836
12913
  label: "Iris",
12837
12914
  kind: "gradient",
12838
- stops: ld([
12915
+ stops: fd([
12839
12916
  ["#2e1065", 0],
12840
12917
  ["#7c3aed", .34],
12841
12918
  ["#db2777", .64],
@@ -12847,7 +12924,7 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12847
12924
  mono: {
12848
12925
  label: "Mono",
12849
12926
  kind: "gradient",
12850
- stops: ld([
12927
+ stops: fd([
12851
12928
  ["#16161e", 0],
12852
12929
  ["#6b7280", .4],
12853
12930
  ["#c2c8d2", .72],
@@ -12860,35 +12937,35 @@ var sd, cd, ld, ud, dd, fd, pd = t((() => {
12860
12937
  }));
12861
12938
  //#endregion
12862
12939
  //#region src/util/base64.ts
12863
- function md(e) {
12940
+ function _d(e) {
12864
12941
  let t = atob(e.replace(/-/g, "+").replace(/_/g, "/")), n = new Uint8Array(new ArrayBuffer(t.length));
12865
12942
  for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
12866
12943
  return n;
12867
12944
  }
12868
- var hd = t((() => {}));
12945
+ var vd = t((() => {}));
12869
12946
  //#endregion
12870
12947
  //#region src/renderer/heroPalette.ts
12871
- function gd() {
12948
+ function yd() {
12872
12949
  let e = document.createElement("canvas");
12873
- e.width = vd, e.height = vd;
12950
+ e.width = xd, e.height = xd;
12874
12951
  let t = e.getContext("2d");
12875
12952
  if (t) {
12876
- let e = md(yd);
12877
- t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer), vd, vd), 0, 0);
12953
+ let e = _d(Sd);
12954
+ t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer), xd, xd), 0, 0);
12878
12955
  }
12879
12956
  return e;
12880
12957
  }
12881
- function _d() {
12882
- let e = Wu(new ci(md(yd), vd, vd, U, Se));
12958
+ function bd() {
12959
+ let e = qu(new ci(_d(Sd), xd, xd, U, Se));
12883
12960
  return e.needsUpdate = !0, e;
12884
12961
  }
12885
- var vd, yd, bd = t((() => {
12886
- Vc(), hd(), pd(), vd = 32, yd = "7PP//97s///O4/7/xt77/8vc7f/Y1sr/5c2f/+/EcP/2vEX/+rQp//2xGP/+rRv//J5M//uUf//7jp7/+4a3//2Ax//9g83//4vD//2bu//5kpv/83V+//Nbb//3VnT/81Sf/+tdxf/pid3/56Pr/+a58v/q1/P/6On3/+Xy/P/o8f//2ur+/8/j/P/O4ff/1tzc/+PSr//sx4X/879d//i3Of/8siD//rEP//6vD//9nz7//JJ4//uNnP/6h7f//IDJ//yEz//+jMX//Jq8//aOnf/xa3n/9Fxq//dief/1Y5v/8G62/+2K0v/tq+b/6Lby/+rP8v/q5fb/5vH7/+Pv///X6P7/0uT6/9bi8P/h2sf/682R//LCa//3ukn/+rQs//yxGv/+sQ7//q4T//2eRP/8knv/+o2e//eIuf/6g8v/+obR//yMx//6mb3/84uh//Bnef/1YWn/+nVx//lzj//1g6X/8pjC//Gz3f/stO//6cDx/+rf9P/m8fv/3uz//9Xm/f/V4vj/3d/r/+fWtP/xyHT/9r9R//m3N//7siP//bAW//6xDv/+qxr//ZpP//yPf//4jZ//9Yq6//eHzP/4itL/+o/K//iYvv/wiab/7mZ9//Zpbv/7gG///Il+//iYk//1pa//9LTO//Cx5v/qru7/69fy/+fw+v/Y6f7/1eL7/9nb9v/h2Of/7M+n//XCW//5uj3/+7Ur//yxHf/9rhX//q8Q//6mJP/9k1f/+4x///aNnv/zjbr/9Y3N//aR1f/4lM7/+JnC//COrv/ua4f/9m5y//uGc//8k3z/+qKI//aupP/1tMT/8J3b/+iJ6v/qzfD/6O75/9fl/f/Y3vn/3NPz/+TM4P/uxpr/+LxJ//u3MP/8syX//a8c//2sF//+rBb//p8w//2OX//7ioD/9o6e//KQu//zk8//9ZjX//ec0//4nsn/85i7//B3mf/1cHz/+oZ4//uSgf/6oYX/97Kg//Wpvv/vcdH/5W7n/+vG7f/p6vf/1d78/9nX9//fyu3/6MDN//O8fv/6uDv/+7Qr//yxJf/9rB///akd//6oIP/+mz3//oxm//uMg//2kaD/8pW9//Ob0f/2oNj/+aPX//ul1P/4o83/9Iyy//d7kP/6in3/+5OB//qhgv/5rpX/9pyy/+9czf/kZ+D/7L7q/+vk9f/S0/v/2s30/+O+4//ttK3/+LRW//u0Mf/8si7//K8q//2pJv/9pSj//qMu//6WSP/+jWv/+46F//aVo//zmr//9KHS//em2v/8qNr//qra//2q2P/5n8z/+Iuv//uOjP/7loH//KGA//ukjf/5kab/8VjD/+dq2P/tt+b/7t3y/9XJ+P/gwvD/6bPa//Osmf/6sEn/+7E1//ywNf/8ri///agu//2jNf/+nz3//pRT//6Pb//8k4j/95um//Shwv/1p9T/+Krc//yr2//+rdv//q3c//yp2v/5mM3/+pKp//ubhv/8oIH//J6L//yPmv/2a7D/63fL/++z4//w1u7/48D0/+257f/zr9n/96ic//urU//8rT//+689//yyMv/9ry///qk///6jUP/+nGT//pt6//yfj//4pKz/9ajG//at1v/6r9z//azb//+u3f//r93//q7e//ug3P/6lcn/+52g//ujhP/9nIz//ZKb//qJpP/zjrr/8rHc//PN6v/zuO//+7Ts//uw4f/7qK7//KVo//ynTf/7rEb//bU0//27Jv/9tz3//bJj//6weP/+sIj//a+a//mwsv/2scn/+LTY//uz3f/9rtz//7De//6w3//+reL//aXl//ya4P/8nML//KSZ//2cm//9mrD//aGz//uitf/4r87/9sPk//u07f//tO3//rLo//ymwP/8nYL//J9g//unU//8skL//b0v//zBQP/8xHD//saJ//7FlP/9waP/+725//i5y//5u9j/+rjd//yv3f/+r9///q7i//6r5v/9quj//aTp//2e2v/9oLr//aC1//2ouv/+s7b//rSz//ywwP/6uNn//bPs//6z6//+ruP//J7G//uRmv/7knn/+51m//yrUv/9tkb//MBZ//3Lf//+0pP//tSa//7PqP/8yb7/+sLM//vC1v/6v9z/+bHd//io4v/7pej//arp//2x6P/8ren//KHg//2hxf/9p7v//rC3//+4s///u7D//rS5//2x0f//tO3//7Lr//6n3f/8ksL/+oKl//mDkf/5kXz//KNi//2vWP/+vnH//suQ//7Umv/+2Zz//tan//7SwP/9ysn//srO//vF1P/3sdH/7p7b/+2c6P/2o+3/9Kvs//Gn7f/xn+L//KXF//6uuv//sLj//7S1//+5sf/+tLn//q7Q//+z7f//sen//p/W//uEuv/5daf/9ned//aFjv/6l3f//adp//65ff/+ypr//tGh//7Vn//+1af//ta9///Rv///0r///cvD//m1uP/vn8n/5Jff/96b6//Um/H/zZvy/9Wb6v/ypc7//6+8//+xuf//tLb//7mx//22vf/+rtT//q/q//2n4v/9jsr/+3Wy//drqP/0cKL/9H2Z//iOhv/8oHT//rV///7Hnv/+zqf//tGm//7Uqv/+2Ln//9az///Xsv/90bT//MSj//m6r//tqcn/0aDh/76a8v+9m/b/vZn0/9ue4f/8q8L//rO0//+5rv/+vqn//LrB//6v2v/8qef//JnY//x7vv/6Zq3/9mSn//NtpP/ze53/94qN//yceP/+sn3//sWb//7Oqf/+0an//tas//7cuf//27D//96r//7aqv/+1Jz//tSe//rLrP/htc3/waPr/7if9v+ymvn/zJzt//eoxf/+t6D//8WV//7Kmf/8v8L//a/c//yk5f/7jtL/+224//lcqv/2X6b/9Gyj//R8mv/4jIr//J53//6zfv/+xZr//s2o//7Sqf/+2K7//uC8///htf//46z//t2m//7XnP/+2Z///tmh//XLt//Osdr/s6Lx/7Kd9v/Ro+z/9qvH//64mf//y4j//s+S//zBwf/9sNv//aHk//uI0P/7Zbf/+Feq//Vdpv/0bqD/+IKR//uWfv/+qHf//rqI//7Gnv/+zaf//tSp//7bsP/+477//+W4///mrv//3qT//tic//7Yn//+2qH//NWr/967zP+6pOj/waTt/+Gt4P/4r8j//bWi///Hiv/+zpP//cDB//6v2//9oOT/+4bR//pkuf/3WK3/9F+o//Vynf/6jIX//qR1//61fv/+v5H//seg//7Npv/+1an//t2y//7kwP//5rj//+ex///fpv/+2J3//tie//7ZoP/91qb/5r7E/8am3//Yq97/9LbN//qzxf/8sa///r+R//7MlP/9vcL//q7b//yh5f/6iNP/+Gi8//Vdr//0Zan/93qW//yXev/+rXH//rp///6/kf/+xp///s6l//7WrP/+37j//uXE///kuP//57X//+Os//7Znv/+2J3//tme//3Sof/vu7z/4KvW/+6xz//7tsP/+7PC//uruf/9rJ7//bWd//yzxv/+rtv/+6Ll//iM1P/2b77/9GWw//Vvpf/5hoz//KBy//6ya//+unn//r+Q//7HoP/+z6n//tmz//7iwv/+58j//+K2///mt//+5rT//9ui//7Wnv/+057//smg//u5rv/4ssX/+rTF//u0wP/7sL//+p+7//mRrf/5lK3/+qXL//6u2//4o+X/9JDU//R5vf/1cq7/93ud//qQhf/7pW///bJm//67dP/+wY///smj//7Sr//+3Lz//uXK//7ny///37T//+O0//7isv/+0Jb//8WH///AjP/+upf//rSh//2zsf/7tLz/+7S7//yttf/6lbX/94Oz//WEtv/2n8///a7c//Gn5f/wltH/9IO5//h+pv/7h5X/+5WD//ukcP/9smL//r1t//7Dif/+yaD//tOy//7gw//+6M3//ujM///dsv//3q3//tur//7Agf//r2j//6px//+og//+pY3//qiX//ywov/8r6f//Kei//yVo//6hKv/9Ie3//Og0P/8rtz/563k/+mZzv/zibP/+oag//qLlf/5k4n/+6Jx//2zXf/+vWL//sJ5//7Hkv/+0av//uDC//3pyv/96Mz//tux///apf/+1qb//7h+//+lZf//nGf//5dt//+Tc///lXn//qN+//unjP/5nJ3//JWb//2Knv/2i7L/8KLR//uu3P/druT/4ZXN/+2FtP/1g6X/94Wd//iMj//6nXX//a5f//64Xv/+vW3//sKB//7KmP/+2bP//ebE//3nzf/+2bH//tWf//7Vpf/+toX//5xk//+RW///iFj//4Nc//+FYv/+l2j/+599//eQmv/3iKT/94aj/++HtP/tn9H/+q7d/9aq5f/ajND/5Hq7/+13rv/yeaL/9YCU//mPgf/8oW3//q1m//60a//+uHb//sKJ//7Spv/+48D//ufO//7Xsv/+0Zr//tSk//68kv//mGn//4ZP//9+S///elD//oJa//2Qav/5kIT/9YOX//N7pP/ueK7/5nu7/+iX0//5rd3/0aXp/9KB1v/ba8P/5Wa2/+xoqf/yb5v/936M//uUef/9pWz//qxr//6ucf/+u4X//tGl//7jwv/959H//tez//7PmP/+0KL//sWh//6rh//+i2D//3xQ//59VP/+iF///It1//d9j//ybpv/7Wmn/+Zmtv/dasP/447W//es3v/LpO7/yHnd/89czf/bU8H/5VW1/+5dpv/1cJT/+419//6ibf/+pWj//qZt//63hf/+0ar//eTJ//3o1f/+1rX//c2X//3Lof/+x6b//cCh//6dev/+hlz//ohd//6TZP/8iXn/9m2V/+5apv/mVbb/20/B/89YzP/ahdv/9are/8eo8v+/eeX/xFXW/9FIzP/fSML/6VC0//Nlnv/7ioH//qFt//6jaP/+q3H//rqL//3Ssf/95s///efa//7WuP/8y5j//Mik//7FqP/9xan//a6J//6caf/+kmL//ptn//yKe//0X5//6ky2/99Ew//RQcv/wk/V/9CB4f/yq+D/x7L3/76I7f/AZOH/zFXX/9pS0P/mVsb/8Guw//mRkP/8p3z//K15//y4hP/8w5v/+9W7//vm1v/75t///NbC//nMpP/6yq7//Mmy//vIs//7vZv//LWC//yldf/8o3X/+paM//FgtP/kT8n/20zR/8pN1v+9W+D/y4jn//Cs4f/Pw/v/xqL0/8aF6//PeeT/23Xf/+V32P/uhsf/9qWs//i3mv/4v5j/+Meh//jPsv/43Mn/9+jf//fm5v/31tb/9dXB//XWyP/31sr/99XI//fOt//3yqj/98Of//e9nv/2r6//7oXO/+R63f/beeH/z3vl/8aF7P/Soe3/8bHj/w==";
12962
+ var xd, Sd, Cd = t((() => {
12963
+ Vc(), vd(), gd(), xd = 32, Sd = "7PP//97s///O4/7/xt77/8vc7f/Y1sr/5c2f/+/EcP/2vEX/+rQp//2xGP/+rRv//J5M//uUf//7jp7/+4a3//2Ax//9g83//4vD//2bu//5kpv/83V+//Nbb//3VnT/81Sf/+tdxf/pid3/56Pr/+a58v/q1/P/6On3/+Xy/P/o8f//2ur+/8/j/P/O4ff/1tzc/+PSr//sx4X/879d//i3Of/8siD//rEP//6vD//9nz7//JJ4//uNnP/6h7f//IDJ//yEz//+jMX//Jq8//aOnf/xa3n/9Fxq//dief/1Y5v/8G62/+2K0v/tq+b/6Lby/+rP8v/q5fb/5vH7/+Pv///X6P7/0uT6/9bi8P/h2sf/682R//LCa//3ukn/+rQs//yxGv/+sQ7//q4T//2eRP/8knv/+o2e//eIuf/6g8v/+obR//yMx//6mb3/84uh//Bnef/1YWn/+nVx//lzj//1g6X/8pjC//Gz3f/stO//6cDx/+rf9P/m8fv/3uz//9Xm/f/V4vj/3d/r/+fWtP/xyHT/9r9R//m3N//7siP//bAW//6xDv/+qxr//ZpP//yPf//4jZ//9Yq6//eHzP/4itL/+o/K//iYvv/wiab/7mZ9//Zpbv/7gG///Il+//iYk//1pa//9LTO//Cx5v/qru7/69fy/+fw+v/Y6f7/1eL7/9nb9v/h2Of/7M+n//XCW//5uj3/+7Ur//yxHf/9rhX//q8Q//6mJP/9k1f/+4x///aNnv/zjbr/9Y3N//aR1f/4lM7/+JnC//COrv/ua4f/9m5y//uGc//8k3z/+qKI//aupP/1tMT/8J3b/+iJ6v/qzfD/6O75/9fl/f/Y3vn/3NPz/+TM4P/uxpr/+LxJ//u3MP/8syX//a8c//2sF//+rBb//p8w//2OX//7ioD/9o6e//KQu//zk8//9ZjX//ec0//4nsn/85i7//B3mf/1cHz/+oZ4//uSgf/6oYX/97Kg//Wpvv/vcdH/5W7n/+vG7f/p6vf/1d78/9nX9//fyu3/6MDN//O8fv/6uDv/+7Qr//yxJf/9rB///akd//6oIP/+mz3//oxm//uMg//2kaD/8pW9//Ob0f/2oNj/+aPX//ul1P/4o83/9Iyy//d7kP/6in3/+5OB//qhgv/5rpX/9pyy/+9czf/kZ+D/7L7q/+vk9f/S0/v/2s30/+O+4//ttK3/+LRW//u0Mf/8si7//K8q//2pJv/9pSj//qMu//6WSP/+jWv/+46F//aVo//zmr//9KHS//em2v/8qNr//qra//2q2P/5n8z/+Iuv//uOjP/7loH//KGA//ukjf/5kab/8VjD/+dq2P/tt+b/7t3y/9XJ+P/gwvD/6bPa//Osmf/6sEn/+7E1//ywNf/8ri///agu//2jNf/+nz3//pRT//6Pb//8k4j/95um//Shwv/1p9T/+Krc//yr2//+rdv//q3c//yp2v/5mM3/+pKp//ubhv/8oIH//J6L//yPmv/2a7D/63fL/++z4//w1u7/48D0/+257f/zr9n/96ic//urU//8rT//+689//yyMv/9ry///qk///6jUP/+nGT//pt6//yfj//4pKz/9ajG//at1v/6r9z//azb//+u3f//r93//q7e//ug3P/6lcn/+52g//ujhP/9nIz//ZKb//qJpP/zjrr/8rHc//PN6v/zuO//+7Ts//uw4f/7qK7//KVo//ynTf/7rEb//bU0//27Jv/9tz3//bJj//6weP/+sIj//a+a//mwsv/2scn/+LTY//uz3f/9rtz//7De//6w3//+reL//aXl//ya4P/8nML//KSZ//2cm//9mrD//aGz//uitf/4r87/9sPk//u07f//tO3//rLo//ymwP/8nYL//J9g//unU//8skL//b0v//zBQP/8xHD//saJ//7FlP/9waP/+725//i5y//5u9j/+rjd//yv3f/+r9///q7i//6r5v/9quj//aTp//2e2v/9oLr//aC1//2ouv/+s7b//rSz//ywwP/6uNn//bPs//6z6//+ruP//J7G//uRmv/7knn/+51m//yrUv/9tkb//MBZ//3Lf//+0pP//tSa//7PqP/8yb7/+sLM//vC1v/6v9z/+bHd//io4v/7pej//arp//2x6P/8ren//KHg//2hxf/9p7v//rC3//+4s///u7D//rS5//2x0f//tO3//7Lr//6n3f/8ksL/+oKl//mDkf/5kXz//KNi//2vWP/+vnH//suQ//7Umv/+2Zz//tan//7SwP/9ysn//srO//vF1P/3sdH/7p7b/+2c6P/2o+3/9Kvs//Gn7f/xn+L//KXF//6uuv//sLj//7S1//+5sf/+tLn//q7Q//+z7f//sen//p/W//uEuv/5daf/9ned//aFjv/6l3f//adp//65ff/+ypr//tGh//7Vn//+1af//ta9///Rv///0r///cvD//m1uP/vn8n/5Jff/96b6//Um/H/zZvy/9Wb6v/ypc7//6+8//+xuf//tLb//7mx//22vf/+rtT//q/q//2n4v/9jsr/+3Wy//drqP/0cKL/9H2Z//iOhv/8oHT//rV///7Hnv/+zqf//tGm//7Uqv/+2Ln//9az///Xsv/90bT//MSj//m6r//tqcn/0aDh/76a8v+9m/b/vZn0/9ue4f/8q8L//rO0//+5rv/+vqn//LrB//6v2v/8qef//JnY//x7vv/6Zq3/9mSn//NtpP/ze53/94qN//yceP/+sn3//sWb//7Oqf/+0an//tas//7cuf//27D//96r//7aqv/+1Jz//tSe//rLrP/htc3/waPr/7if9v+ymvn/zJzt//eoxf/+t6D//8WV//7Kmf/8v8L//a/c//yk5f/7jtL/+224//lcqv/2X6b/9Gyj//R8mv/4jIr//J53//6zfv/+xZr//s2o//7Sqf/+2K7//uC8///htf//46z//t2m//7XnP/+2Z///tmh//XLt//Osdr/s6Lx/7Kd9v/Ro+z/9qvH//64mf//y4j//s+S//zBwf/9sNv//aHk//uI0P/7Zbf/+Feq//Vdpv/0bqD/+IKR//uWfv/+qHf//rqI//7Gnv/+zaf//tSp//7bsP/+477//+W4///mrv//3qT//tic//7Yn//+2qH//NWr/967zP+6pOj/waTt/+Gt4P/4r8j//bWi///Hiv/+zpP//cDB//6v2//9oOT/+4bR//pkuf/3WK3/9F+o//Vynf/6jIX//qR1//61fv/+v5H//seg//7Npv/+1an//t2y//7kwP//5rj//+ex///fpv/+2J3//tie//7ZoP/91qb/5r7E/8am3//Yq97/9LbN//qzxf/8sa///r+R//7MlP/9vcL//q7b//yh5f/6iNP/+Gi8//Vdr//0Zan/93qW//yXev/+rXH//rp///6/kf/+xp///s6l//7WrP/+37j//uXE///kuP//57X//+Os//7Znv/+2J3//tme//3Sof/vu7z/4KvW/+6xz//7tsP/+7PC//uruf/9rJ7//bWd//yzxv/+rtv/+6Ll//iM1P/2b77/9GWw//Vvpf/5hoz//KBy//6ya//+unn//r+Q//7HoP/+z6n//tmz//7iwv/+58j//+K2///mt//+5rT//9ui//7Wnv/+057//smg//u5rv/4ssX/+rTF//u0wP/7sL//+p+7//mRrf/5lK3/+qXL//6u2//4o+X/9JDU//R5vf/1cq7/93ud//qQhf/7pW///bJm//67dP/+wY///smj//7Sr//+3Lz//uXK//7ny///37T//+O0//7isv/+0Jb//8WH///AjP/+upf//rSh//2zsf/7tLz/+7S7//yttf/6lbX/94Oz//WEtv/2n8///a7c//Gn5f/wltH/9IO5//h+pv/7h5X/+5WD//ukcP/9smL//r1t//7Dif/+yaD//tOy//7gw//+6M3//ujM///dsv//3q3//tur//7Agf//r2j//6px//+og//+pY3//qiX//ywov/8r6f//Kei//yVo//6hKv/9Ie3//Og0P/8rtz/563k/+mZzv/zibP/+oag//qLlf/5k4n/+6Jx//2zXf/+vWL//sJ5//7Hkv/+0av//uDC//3pyv/96Mz//tux///apf/+1qb//7h+//+lZf//nGf//5dt//+Tc///lXn//qN+//unjP/5nJ3//JWb//2Knv/2i7L/8KLR//uu3P/druT/4ZXN/+2FtP/1g6X/94Wd//iMj//6nXX//a5f//64Xv/+vW3//sKB//7KmP/+2bP//ebE//3nzf/+2bH//tWf//7Vpf/+toX//5xk//+RW///iFj//4Nc//+FYv/+l2j/+599//eQmv/3iKT/94aj/++HtP/tn9H/+q7d/9aq5f/ajND/5Hq7/+13rv/yeaL/9YCU//mPgf/8oW3//q1m//60a//+uHb//sKJ//7Spv/+48D//ufO//7Xsv/+0Zr//tSk//68kv//mGn//4ZP//9+S///elD//oJa//2Qav/5kIT/9YOX//N7pP/ueK7/5nu7/+iX0//5rd3/0aXp/9KB1v/ba8P/5Wa2/+xoqf/yb5v/936M//uUef/9pWz//qxr//6ucf/+u4X//tGl//7jwv/959H//tez//7PmP/+0KL//sWh//6rh//+i2D//3xQ//59VP/+iF///It1//d9j//ybpv/7Wmn/+Zmtv/dasP/447W//es3v/LpO7/yHnd/89czf/bU8H/5VW1/+5dpv/1cJT/+419//6ibf/+pWj//qZt//63hf/+0ar//eTJ//3o1f/+1rX//c2X//3Lof/+x6b//cCh//6dev/+hlz//ohd//6TZP/8iXn/9m2V/+5apv/mVbb/20/B/89YzP/ahdv/9are/8eo8v+/eeX/xFXW/9FIzP/fSML/6VC0//Nlnv/7ioH//qFt//6jaP/+q3H//rqL//3Ssf/95s///efa//7WuP/8y5j//Mik//7FqP/9xan//a6J//6caf/+kmL//ptn//yKe//0X5//6ky2/99Ew//RQcv/wk/V/9CB4f/yq+D/x7L3/76I7f/AZOH/zFXX/9pS0P/mVsb/8Guw//mRkP/8p3z//K15//y4hP/8w5v/+9W7//vm1v/75t///NbC//nMpP/6yq7//Mmy//vIs//7vZv//LWC//yldf/8o3X/+paM//FgtP/kT8n/20zR/8pN1v+9W+D/y4jn//Cs4f/Pw/v/xqL0/8aF6//PeeT/23Xf/+V32P/uhsf/9qWs//i3mv/4v5j/+Meh//jPsv/43Mn/9+jf//fm5v/31tb/9dXB//XWyP/31sr/99XI//fOt//3yqj/98Of//e9nv/2r6//7oXO/+R63f/beeH/z3vl/8aF7P/Soe3/8bHj/w==";
12887
12964
  }));
12888
12965
  //#endregion
12889
12966
  //#region src/renderer/WaveRenderer.ts
12890
- function xd(e, t, n, r = 0) {
12891
- let i = e / wd, a = t / 750, o;
12967
+ function wd(e, t, n, r = 0) {
12968
+ let i = e / Dd, a = t / 750, o;
12892
12969
  switch (n) {
12893
12970
  case "contain":
12894
12971
  o = Math.min(i, a);
@@ -12901,14 +12978,14 @@ function xd(e, t, n, r = 0) {
12901
12978
  break;
12902
12979
  default: o = Math.max(i, a);
12903
12980
  }
12904
- return r > 0 && (o = Math.min(o, e / (wd * r))), o;
12981
+ return r > 0 && (o = Math.min(o, e / (Dd * r))), o;
12905
12982
  }
12906
- function Sd(e, t) {
12907
- let n = Ed.set(e);
12983
+ function Td(e, t) {
12984
+ let n = kd.set(e);
12908
12985
  return t.set(n.r, n.g, n.b);
12909
12986
  }
12910
- var Cd, wd, Td, Ed, Dd, Od = t((() => {
12911
- Vc(), nl(), il(), cl(), Zc(), fl(), su(), mu(), zu(), pd(), bd(), Kl(), Cd = 220, wd = 1333, Td = class {
12987
+ var Ed, Dd, Od, kd, Ad, jd = t((() => {
12988
+ Vc(), nl(), il(), cl(), Zc(), fl(), _u(), nu(), Hu(), gd(), Cd(), Yl(), Ed = 220, Dd = 1333, Od = class {
12912
12989
  makeVideo;
12913
12990
  onVideoReady;
12914
12991
  texture;
@@ -12921,8 +12998,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
12921
12998
  }
12922
12999
  apply(e, t) {
12923
13000
  let n = e.paletteVideoUrl, r = e.paletteImageUrl, i = e.paletteSource ?? "hero", a, o;
12924
- if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () => Wu(new _i(this.video))) : (a = "video-loading|" + n, o = () => _d());
12925
- else if (r) this.clearVideo(), a = "url|" + r, o = () => od(r);
13001
+ if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () => qu(new _i(this.video))) : (a = "video-loading|" + n, o = () => bd());
13002
+ else if (r) this.clearVideo(), a = "url|" + r, o = () => ld(r);
12926
13003
  else if (i === "stops") {
12927
13004
  this.clearVideo();
12928
13005
  let t = {
@@ -12930,8 +13007,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
12930
13007
  edgeColor: e.paletteEdgeColor ?? "#8e9dff",
12931
13008
  edgeAmount: e.paletteEdgeAmount ?? .3
12932
13009
  };
12933
- a = "stops|" + Uu(t), o = () => Ku(t);
12934
- } else fd[i] ? (this.clearVideo(), a = "map|" + i, o = () => Gu(ad(fd[i]))) : (this.clearVideo(), a = "hero", o = () => _d());
13010
+ a = "stops|" + Ku(t), o = () => Yu(t);
13011
+ } else hd[i] ? (this.clearVideo(), a = "map|" + i, o = () => Ju(cd(hd[i]))) : (this.clearVideo(), a = "hero", o = () => bd());
12935
13012
  (a !== this.sig || !this.texture) && (this.texture?.dispose(), this.texture = o(), this.sig = a), t.uPalette.value = this.texture, t.uUsePalette.value = e.usePaletteTexture === !1 ? 0 : 1, t.uPaletteRaw.value = 1;
12936
13013
  }
12937
13014
  syncPlayback(e, t) {
@@ -12954,7 +13031,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
12954
13031
  dispose() {
12955
13032
  this.texture?.dispose(), this.texture = void 0, this.clearVideo(), this.failedUrl = "";
12956
13033
  }
12957
- }, Ed = new X(), Dd = class {
13034
+ }, kd = new X(), Ad = class {
12958
13035
  renderer;
12959
13036
  scene = new Gn();
12960
13037
  camera;
@@ -13013,7 +13090,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13013
13090
  capturing = !1;
13014
13091
  outputSize;
13015
13092
  constructor(e, t, n = {}) {
13016
- this.container = e, this.config = Fl(t), this.respectReducedMotion = n.respectReducedMotion ?? !0, this.skipIntroRamp = n.skipIntroRamp ?? !1, this.renderer = new Bc({
13093
+ this.container = e, this.config = Rl(t), this.respectReducedMotion = n.respectReducedMotion ?? !0, this.skipIntroRamp = n.skipIntroRamp ?? !1, this.renderer = new Bc({
13017
13094
  antialias: !0,
13018
13095
  alpha: !0,
13019
13096
  preserveDrawingBuffer: !0,
@@ -13027,15 +13104,15 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13027
13104
  uGrainAmount: { value: t.grain },
13028
13105
  uTime: { value: 0 }
13029
13106
  },
13030
- vertexShader: $l,
13031
- fragmentShader: eu
13107
+ vertexShader: lu,
13108
+ fragmentShader: uu
13032
13109
  }), this.composer.addPass(this.postPass), this.composer.addPass(new sl()), this.motionQuery = window.matchMedia("(prefers-reduced-motion: reduce)"), this.reducedMotion = this.respectReducedMotion && this.motionQuery.matches, this.motionQuery.addEventListener("change", this.onMotionChange), document.addEventListener("visibilitychange", this.onVisibilityChange), this.intersectionObserver = new IntersectionObserver((e) => {
13033
13110
  this.visible = e[0]?.isIntersecting ?? !0, this.updateRunning();
13034
13111
  }, { rootMargin: "100px" }), this.intersectionObserver.observe(e), this.resizeObserver = new ResizeObserver(this.onResize), this.resizeObserver.observe(e), this.watchDpr(), this.applyBackground(), this.buildWaves(), this.resize();
13035
13112
  }
13036
13113
  get segments() {
13037
13114
  let e = this.config.quality / Math.sqrt(Math.max(1, this.config.waves.length));
13038
- return Gt.clamp(Math.round(Cd * e), 24, 360);
13115
+ return Gt.clamp(Math.round(Ed * e), 24, 360);
13039
13116
  }
13040
13117
  makeUniforms() {
13041
13118
  let e = [], t = [];
@@ -13100,7 +13177,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13100
13177
  uEdgeFeather: { value: .1 },
13101
13178
  uOpacity: { value: 1 },
13102
13179
  uSquared: { value: 1 },
13103
- uResolution: { value: new G(1, 1) },
13180
+ uResolution: { value: this.renderer.getDrawingBufferSize(new G()) },
13104
13181
  uAmbient: { value: .45 },
13105
13182
  uNumLights: { value: 1 },
13106
13183
  uLightPos: { value: a },
@@ -13115,6 +13192,12 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13115
13192
  uLineDerivativePower: { value: .95 },
13116
13193
  uMaxWidth: { value: 1232 },
13117
13194
  uClearColor: { value: new K(1, 1, 1) },
13195
+ uHelixTurns: { value: 0 },
13196
+ uHelixRadius: { value: 0 },
13197
+ uHelixRoll: { value: 0 },
13198
+ uHelixPhase: { value: 0 },
13199
+ uRungAmount: { value: 0 },
13200
+ uRungThickness: { value: 1 },
13118
13201
  uPointer: { value: new G(0, 0) },
13119
13202
  uPointerActive: { value: 0 },
13120
13203
  uPointerRadius: { value: .6 },
@@ -13137,14 +13220,16 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13137
13220
  let t = {};
13138
13221
  e?.twistMotion && (t.TWIST_MOTION = ""), (this.config.loopSeconds ?? 0) > 0 && (t.LOOP_MOTION = "");
13139
13222
  let n = e?.interaction?.bindings?.some((e) => e.target === "detailAmount") ?? !1;
13140
- return ((e?.detailAmount ?? 0) !== 0 || n) && (t.DETAIL_OCTAVE = ""), (e?.depthTint ?? 0) > 0 && (t.DEPTH_TINT = ""), (e?.edgeFeather ?? .1) !== .1 && (t.EDGE_FEATHER = ""), e && yu(this.config, e) && (t.POINTER_FX = "", bu(this.config, e) && (t.POINTER_RIPPLES = "")), t;
13223
+ ((e?.detailAmount ?? 0) !== 0 || n) && (t.DETAIL_OCTAVE = ""), (e?.depthTint ?? 0) > 0 && (t.DEPTH_TINT = ""), (e?.edgeFeather ?? .1) !== .1 && (t.EDGE_FEATHER = "");
13224
+ let r = e?.interaction?.bindings?.some((e) => e.target.startsWith("helix")) ?? !1;
13225
+ return ((e?.helixRadius ?? 0) !== 0 || (e?.helixRoll ?? 0) !== 0 || r) && (t.HELIX = ""), e?.theme === "wireframe" && (e.rungAmount ?? 0) > 0 && (t.RUNGS = ""), e && Su(this.config, e) && (t.POINTER_FX = "", Cu(this.config, e) && (t.POINTER_RIPPLES = "")), t;
13141
13226
  }
13142
13227
  addWave() {
13143
- let e = new pu(this.segments), t = this.config.waves[this.waves.length] ?? this.config.waves[0], n = new Oi({
13228
+ let e = new tu(this.segments), t = this.config.waves[this.waves.length] ?? this.config.waves[0], n = new Oi({
13144
13229
  uniforms: this.makeUniforms(),
13145
13230
  defines: this.waveDefines(t),
13146
- vertexShader: Xl,
13147
- fragmentShader: t?.theme === "wireframe" ? Ql : Zl,
13231
+ vertexShader: ou,
13232
+ fragmentShader: t?.theme === "wireframe" ? cu : su,
13148
13233
  transparent: !0,
13149
13234
  depthTest: !0,
13150
13235
  depthWrite: !0,
@@ -13153,7 +13238,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13153
13238
  this.applyBlendMode(n, t?.blendMode ?? "squared");
13154
13239
  let r = new si(e.geometry, n);
13155
13240
  r.frustumCulled = !1, this.group.add(r);
13156
- let i = new Td((e) => this.createLoopingVideo(e), () => {
13241
+ let i = new Od((e) => this.createLoopingVideo(e), () => {
13157
13242
  this.updatePaletteTextures(), this.syncVideoPlayback(), this.running || this.renderOnce();
13158
13243
  });
13159
13244
  this.waves.push({
@@ -13194,7 +13279,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13194
13279
  this.applyBlendMode(e.material, n.blendMode) && (e.material.needsUpdate = !0);
13195
13280
  let i = this.waveDefines(n), a = e.material.defines ?? {};
13196
13281
  Object.keys(i).sort().join(",") !== Object.keys(a).sort().join(",") && (e.material.defines = i, e.material.needsUpdate = !0);
13197
- let o = n.theme === "wireframe" ? Ql : Zl;
13282
+ let o = n.theme === "wireframe" ? cu : su;
13198
13283
  e.material.fragmentShader !== o && (e.material.fragmentShader = o, e.material.needsUpdate = !0);
13199
13284
  let s = [...n.palette].sort((e, t) => e.pos - t.pos), c = Math.max(1, Math.min(s.length, 8)), l = r.uColors.value, u = r.uColorPos.value;
13200
13285
  for (let e = 0; e < 8; e++) {
@@ -13202,21 +13287,21 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13202
13287
  color: "#ffffff",
13203
13288
  pos: 0
13204
13289
  };
13205
- Sd(t.color, l[e]), u[e] = t.pos;
13290
+ Td(t.color, l[e]), u[e] = t.pos;
13206
13291
  }
13207
13292
  r.uColorCount.value = c, r.uGradType.value = n.gradientType === "radial" ? 1 : n.gradientType === "conic" ? 2 : n.gradientType === "mesh" ? 3 : 0, r.uGradAngle.value = (n.gradientAngle ?? 0) * Math.PI / 180, r.uGradShift.value = n.gradientShift ?? 0;
13208
13293
  let d = n.meshGradientPoints.slice(0, 8), f = r.uMeshPointPos.value, p = r.uMeshPointColor.value, m = r.uMeshPointInfluence.value;
13209
13294
  for (let e = 0; e < 8; e++) {
13210
13295
  let t = d[e] ?? d[d.length - 1];
13211
- t && (f[e].set(t.x, t.y), Sd(t.color, p[e]), m[e] = t.influence);
13296
+ t && (f[e].set(t.x, t.y), Td(t.color, p[e]), m[e] = t.influence);
13212
13297
  }
13213
- r.uMeshPointCount.value = d.length, r.uMeshSoftness.value = n.meshGradientSoftness, r.uPaletteScale.value.set(n.paletteTextureScale?.x ?? 1, n.paletteTextureScale?.y ?? 1), r.uPaletteOffset.value.set(n.paletteTextureOffset?.x ?? 0, n.paletteTextureOffset?.y ?? 0), r.uPaletteRotation.value = (n.paletteTextureRotation ?? 0) * Math.PI / 180, r.uHueShift.value = n.hueShift, r.uContrast.value = n.colorContrast, r.uSaturation.value = n.colorSaturation, r.uLineAmount.value = n.lineAmount ?? 425, r.uLineThickness.value = n.lineThickness ?? 1, r.uLineDerivativePower.value = n.lineDerivativePower ?? .95, r.uMaxWidth.value = n.maxWidth ?? 1232, Sd(this.config.background, r.uClearColor.value), r.uFiberCount.value = n.fiberCount, r.uFiberStrength.value = n.fiberStrength, r.uTexture.value = n.texture, r.uCreaseLight.value = n.creaseLight, r.uCreaseSharpness.value = n.creaseSharpness, r.uCreaseSoftness.value = n.creaseSoftness, r.uSheen.value = n.sheen ?? 1, r.uRoundness.value = n.roundness ?? .35, r.uIridescence.value = n.iridescence ?? 0, r.uDepthTint.value = n.depthTint ?? 0, Sd(n.depthTintColor ?? "#0a2540", r.uDepthTintColor.value), r.uEdgeFade.value = n.edgeFade, r.uEdgeFeather.value = n.edgeFeather ?? .1;
13298
+ r.uMeshPointCount.value = d.length, r.uMeshSoftness.value = n.meshGradientSoftness, r.uPaletteScale.value.set(n.paletteTextureScale?.x ?? 1, n.paletteTextureScale?.y ?? 1), r.uPaletteOffset.value.set(n.paletteTextureOffset?.x ?? 0, n.paletteTextureOffset?.y ?? 0), r.uPaletteRotation.value = (n.paletteTextureRotation ?? 0) * Math.PI / 180, r.uHueShift.value = n.hueShift, r.uContrast.value = n.colorContrast, r.uSaturation.value = n.colorSaturation, r.uLineAmount.value = n.lineAmount ?? 425, r.uLineThickness.value = n.lineThickness ?? 1, r.uLineDerivativePower.value = n.lineDerivativePower ?? .95, r.uRungAmount.value = n.rungAmount ?? 0, r.uRungThickness.value = n.rungThickness ?? 1, r.uMaxWidth.value = n.maxWidth ?? 1232, Td(this.config.background, r.uClearColor.value), r.uFiberCount.value = n.fiberCount, r.uFiberStrength.value = n.fiberStrength, r.uTexture.value = n.texture, r.uCreaseLight.value = n.creaseLight, r.uCreaseSharpness.value = n.creaseSharpness, r.uCreaseSoftness.value = n.creaseSoftness, r.uSheen.value = n.sheen ?? 1, r.uRoundness.value = n.roundness ?? .35, r.uIridescence.value = n.iridescence ?? 0, r.uDepthTint.value = n.depthTint ?? 0, Td(n.depthTintColor ?? "#0a2540", r.uDepthTintColor.value), r.uEdgeFade.value = n.edgeFade, r.uEdgeFeather.value = n.edgeFeather ?? .1;
13214
13299
  let h = this.config.lights ?? [];
13215
13300
  r.uAmbient.value = this.config.ambient ?? .45, r.uNumLights.value = Math.min(h.length, 8);
13216
13301
  let g = r.uLightPos.value, _ = r.uLightColor.value, v = r.uLightIntensity.value;
13217
13302
  for (let e = 0; e < 8; e++) {
13218
13303
  let t = h[e];
13219
- t ? (g[e].set(t.position.x, t.position.y, t.position.z), Sd(t.color, _[e]), v[e] = t.intensity) : v[e] = 0;
13304
+ t ? (g[e].set(t.position.x, t.position.y, t.position.z), Td(t.color, _[e]), v[e] = t.intensity) : v[e] = 0;
13220
13305
  }
13221
13306
  let y = n.noiseBands ?? [];
13222
13307
  r.uNumNoiseBands.value = Math.min(y.length, 4);
@@ -13225,12 +13310,12 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13225
13310
  let t = y[e];
13226
13311
  t && (b[e].set(t.startX, t.endX, t.startY, t.endY), x[e].set(t.feather, t.strength, t.frequency, t.colorAttenuation), S[e] = t.parabolaPower);
13227
13312
  }
13228
- r.uSpeed.value = n.speed, r.uSeed.value = n.seed, r.uLoopSeconds.value = this.config.loopSeconds ?? 0, r.uDispFreqX.value = n.displaceFrequency.x, r.uDispFreqZ.value = n.displaceFrequency.y, r.uDispAmount.value = n.displaceAmount, r.uDetailFreq.value = n.detailFrequency ?? .04, r.uDetailAmount.value = n.detailAmount ?? 0, r.uTwFreqX.value = n.twistFrequency.x, r.uTwFreqY.value = n.twistFrequency.y, r.uTwFreqZ.value = n.twistFrequency.z, r.uTwPowX.value = n.twistPower.x, r.uTwPowY.value = n.twistPower.y, r.uTwPowZ.value = n.twistPower.z, e.mesh.scale.set(n.scale.x, n.scale.y, n.scale.z), e.mesh.rotation.set(Gt.degToRad(n.rotation.x), Gt.degToRad(n.rotation.y), Gt.degToRad(n.rotation.z)), e.mesh.position.set(n.position.x, n.position.y, n.position.z), r.uOpacity.value = n.opacity;
13313
+ r.uSpeed.value = n.speed, r.uSeed.value = n.seed, r.uLoopSeconds.value = this.config.loopSeconds ?? 0, r.uDispFreqX.value = n.displaceFrequency.x, r.uDispFreqZ.value = n.displaceFrequency.y, r.uDispAmount.value = n.displaceAmount, r.uDetailFreq.value = n.detailFrequency ?? .04, r.uDetailAmount.value = n.detailAmount ?? 0, r.uTwFreqX.value = n.twistFrequency.x, r.uTwFreqY.value = n.twistFrequency.y, r.uTwFreqZ.value = n.twistFrequency.z, r.uTwPowX.value = n.twistPower.x, r.uTwPowY.value = n.twistPower.y, r.uTwPowZ.value = n.twistPower.z, r.uHelixTurns.value = n.helixTurns ?? 0, r.uHelixRadius.value = n.helixRadius ?? 0, r.uHelixRoll.value = n.helixRoll ?? 0, r.uHelixPhase.value = n.helixPhase ?? 0, e.mesh.scale.set(n.scale.x, n.scale.y, n.scale.z), e.mesh.rotation.set(Gt.degToRad(n.rotation.x), Gt.degToRad(n.rotation.y), Gt.degToRad(n.rotation.z)), e.mesh.position.set(n.position.x, n.position.y, n.position.z), r.uOpacity.value = n.opacity;
13229
13314
  });
13230
13315
  let e = (this.config.interaction?.radius ?? .3) * 2, t = this.config.interaction?.ribbonFlow ?? .8;
13231
13316
  this.waves.forEach((n, r) => {
13232
13317
  let i = this.config.waves[r] ?? this.config.waves[this.config.waves.length - 1];
13233
- if (!yu(this.config, i)) return;
13318
+ if (!Su(this.config, i)) return;
13234
13319
  let a = n.material.uniforms, o = i.interaction?.hover;
13235
13320
  a.uPointerRadius.value = e, a.uPointerAgitate.value = o?.agitate ?? 0, a.uPointerPush.value = o?.push ?? 0, a.uPointerWake.value = o?.wake ?? 0, a.uPointerThin.value = o?.thin ?? 0, a.uPointerHue.value = o?.hueShift ?? 0, a.uPointerLighten.value = o?.lighten ?? 0, a.uPointerRipple.value = i.interaction?.press?.ripple ?? 0, a.uShapeFlow.value = t;
13236
13321
  }), this.updatePaletteTextures(), this.syncVideoPlayback(), this.group.scale.set(this.config.mirrorH ? -1 : 1, this.config.mirrorV ? -1 : 1, 1), this.onAfterRefresh(), this.running || this.renderOnce();
@@ -13276,13 +13361,13 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13276
13361
  t
13277
13362
  ].join("|");
13278
13363
  if (a !== this.backgroundSig || !this.backgroundTexture) {
13279
- let i = Xu(n, r, e, t);
13280
- this.backgroundTexture?.dispose(), this.backgroundTexture = Gu(i), this.backgroundSig = a;
13364
+ let i = $u(n, r, e, t);
13365
+ this.backgroundTexture?.dispose(), this.backgroundTexture = Ju(i), this.backgroundSig = a;
13281
13366
  }
13282
13367
  this.scene.background = this.backgroundTexture;
13283
13368
  return;
13284
13369
  }
13285
- let r = this.config.backgroundGradientSource ?? "stops", i = fd[r], a = r !== "stops" && i?.kind === "gradient" && i.stops ? i.stops : this.config.backgroundPalette, o = a.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(","), s = [
13370
+ let r = this.config.backgroundGradientSource ?? "stops", i = hd[r], a = r !== "stops" && i?.kind === "gradient" && i.stops ? i.stops : this.config.backgroundPalette, o = a.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(","), s = [
13286
13371
  "gradient",
13287
13372
  r,
13288
13373
  n,
@@ -13292,14 +13377,14 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13292
13377
  t
13293
13378
  ].join("|");
13294
13379
  if (s !== this.backgroundSig || !this.backgroundTexture) {
13295
- let r = qu({
13380
+ let r = Xu({
13296
13381
  stops: a,
13297
13382
  type: n,
13298
13383
  angle: this.config.backgroundGradientAngle,
13299
13384
  width: e,
13300
13385
  height: t
13301
13386
  });
13302
- this.backgroundTexture?.dispose(), this.backgroundTexture = Gu(r), this.backgroundSig = s;
13387
+ this.backgroundTexture?.dispose(), this.backgroundTexture = Ju(r), this.backgroundSig = s;
13303
13388
  }
13304
13389
  this.scene.background = this.backgroundTexture;
13305
13390
  }
@@ -13322,7 +13407,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13322
13407
  c = this.backgroundImage, l = this.backgroundImage.naturalWidth, u = this.backgroundImage.naturalHeight, d = `custom|${s}`;
13323
13408
  } else {
13324
13409
  this.clearBackgroundVideo();
13325
- let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ? gd() : fd[r]?.kind === "image" ? ad(fd[r], Math.max(t, n)) : null;
13410
+ let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ? yd() : hd[r]?.kind === "image" ? cd(hd[r], Math.max(t, n)) : null;
13326
13411
  if (!i) {
13327
13412
  this.scene.background = e;
13328
13413
  return;
@@ -13341,8 +13426,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13341
13426
  n
13342
13427
  ].join("|");
13343
13428
  if (f !== this.backgroundSig || !this.backgroundTexture) {
13344
- let e = Zu(c, l, u, t, n, r, this.config.background, i, a.x, a.y);
13345
- this.backgroundTexture?.dispose(), this.backgroundTexture = Gu(e), this.backgroundSig = f, this.backgroundVideoCanvas = o ? e : void 0;
13429
+ let e = ed(c, l, u, t, n, r, this.config.background, i, a.x, a.y);
13430
+ this.backgroundTexture?.dispose(), this.backgroundTexture = Ju(e), this.backgroundSig = f, this.backgroundVideoCanvas = o ? e : void 0;
13346
13431
  }
13347
13432
  this.scene.background = this.backgroundTexture;
13348
13433
  }
@@ -13394,7 +13479,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13394
13479
  x: 0,
13395
13480
  y: 0
13396
13481
  };
13397
- Qu(t, e, e.videoWidth, e.videoHeight, this.config.backgroundImageFit ?? "cover", this.config.background, this.config.backgroundImageZoom ?? 1, n.x, n.y), this.backgroundTexture.needsUpdate = !0;
13482
+ td(t, e, e.videoWidth, e.videoHeight, this.config.backgroundImageFit ?? "cover", this.config.background, this.config.backgroundImageZoom ?? 1, n.x, n.y), this.backgroundTexture.needsUpdate = !0;
13398
13483
  }
13399
13484
  applyPost() {
13400
13485
  let e = this.postPass.uniforms;
@@ -13421,8 +13506,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13421
13506
  uDitherScale: { value: this.config.ditherScale ?? 2 },
13422
13507
  uDitherSteps: { value: this.config.ditherSteps ?? 4 }
13423
13508
  },
13424
- vertexShader: $l,
13425
- fragmentShader: tu
13509
+ vertexShader: lu,
13510
+ fragmentShader: du
13426
13511
  }), this.composer.addPass(this.ditherPass));
13427
13512
  let t = this.ditherPass.uniforms;
13428
13513
  t.uDitherStrength.value = e, t.uDitherScale.value = Math.max(1, this.config.ditherScale ?? 2), t.uDitherSteps.value = Math.max(2, Math.round(this.config.ditherSteps ?? 4));
@@ -13440,8 +13525,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13440
13525
  uInnerLightDecay: { value: this.config.innerLightDecay ?? .95 },
13441
13526
  uInnerLightCenter: { value: new G(t, n) }
13442
13527
  },
13443
- vertexShader: $l,
13444
- fragmentShader: nu
13528
+ vertexShader: lu,
13529
+ fragmentShader: fu
13445
13530
  }), this.composer.insertPass(this.innerLightPass, 1));
13446
13531
  let r = this.innerLightPass.uniforms;
13447
13532
  r.uInnerLight.value = e, r.uInnerLightDensity.value = this.config.innerLightDensity ?? .5, r.uInnerLightDecay.value = this.config.innerLightDecay ?? .95, r.uInnerLightCenter.value.set(t, n);
@@ -13458,8 +13543,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13458
13543
  uHalftoneCell: { value: this.config.halftoneCell ?? 6 },
13459
13544
  uHalftoneAngle: { value: this.config.halftoneAngle ?? .4 }
13460
13545
  },
13461
- vertexShader: $l,
13462
- fragmentShader: ru
13546
+ vertexShader: lu,
13547
+ fragmentShader: pu
13463
13548
  }), this.composer.addPass(this.halftonePass));
13464
13549
  let t = this.halftonePass.uniforms;
13465
13550
  t.uHalftone.value = e, t.uHalftoneCell.value = Math.max(2, this.config.halftoneCell ?? 6), t.uHalftoneAngle.value = this.config.halftoneAngle ?? .4;
@@ -13472,8 +13557,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13472
13557
  tDiffuse: { value: null },
13473
13558
  uHeatmap: { value: e }
13474
13559
  },
13475
- vertexShader: $l,
13476
- fragmentShader: iu
13560
+ vertexShader: lu,
13561
+ fragmentShader: mu
13477
13562
  }), this.composer.addPass(this.heatmapPass)), this.heatmapPass.uniforms.uHeatmap.value = e) : this.heatmapPass &&= (this.composer.removePass(this.heatmapPass), this.heatmapPass.dispose(), void 0);
13478
13563
  }
13479
13564
  applyPaperTexture() {
@@ -13485,8 +13570,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13485
13570
  uPaper: { value: e },
13486
13571
  uPaperScale: { value: this.config.paperTextureScale ?? 2 }
13487
13572
  },
13488
- vertexShader: $l,
13489
- fragmentShader: au
13573
+ vertexShader: lu,
13574
+ fragmentShader: hu
13490
13575
  }), this.composer.addPass(this.paperTexturePass));
13491
13576
  let t = this.paperTexturePass.uniforms;
13492
13577
  t.uPaper.value = e, t.uPaperScale.value = Math.max(.5, this.config.paperTextureScale ?? 2);
@@ -13501,8 +13586,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13501
13586
  uHalftoneCmyk: { value: e },
13502
13587
  uHalftoneCmykCell: { value: this.config.halftoneCmykCell ?? 6 }
13503
13588
  },
13504
- vertexShader: $l,
13505
- fragmentShader: ou
13589
+ vertexShader: lu,
13590
+ fragmentShader: gu
13506
13591
  }), this.composer.addPass(this.halftoneCmykPass));
13507
13592
  let t = this.halftoneCmykPass.uniforms;
13508
13593
  t.uHalftoneCmyk.value = e, t.uHalftoneCmykCell.value = Math.max(2, this.config.halftoneCmykCell ?? 6);
@@ -13591,8 +13676,8 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13591
13676
  this.updateBackgroundVideoFrame(), this.updateTime(), this.applyInteraction(), this.updateClipPlanes(), this.composer.render(), this.onAfterRenderFrame();
13592
13677
  }
13593
13678
  syncInteraction() {
13594
- let e = Su(this.config);
13595
- e && !this.interaction ? this.interaction = new Ru(this.container, () => this.config) : !e && this.interaction && (this.interaction.dispose(), this.interaction = void 0, this.interactionTimeOffset = 0, this.interactionZoom !== 1 && (this.interactionZoom = 1, this.applyZoom()));
13679
+ let e = Tu(this.config);
13680
+ e && !this.interaction ? this.interaction = new Vu(this.container, () => this.config) : !e && this.interaction && (this.interaction.dispose(), this.interaction = void 0, this.interactionTimeOffset = 0, this.interactionZoom !== 1 && (this.interactionZoom = 1, this.applyZoom()));
13596
13681
  }
13597
13682
  applyInteraction() {
13598
13683
  if (this.interaction) {
@@ -13600,13 +13685,13 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13600
13685
  this.applyInteractionRest();
13601
13686
  return;
13602
13687
  }
13603
- xu(this.config) && this.applyPointerField(this.interaction), this.applyBindings(this.interaction);
13688
+ wu(this.config) && this.applyPointerField(this.interaction), this.applyBindings(this.interaction);
13604
13689
  }
13605
13690
  }
13606
13691
  applyInteractionRest() {
13607
13692
  for (let e = 0; e < this.waves.length; e++) {
13608
13693
  let t = this.config.waves[e] ?? this.config.waves[this.config.waves.length - 1];
13609
- if (!yu(this.config, t)) continue;
13694
+ if (!Su(this.config, t)) continue;
13610
13695
  let n = this.waves[e].material.uniforms;
13611
13696
  n.uPointerActive.value = 0;
13612
13697
  let r = n.uRippleAmp.value;
@@ -13620,7 +13705,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13620
13705
  out: this.interactionSceneOut
13621
13706
  };
13622
13707
  for (let n of e) {
13623
- let e = Lu[n.target];
13708
+ let e = Bu[n.target];
13624
13709
  e.apply(e.base(this.config), t);
13625
13710
  }
13626
13711
  }
@@ -13630,7 +13715,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13630
13715
  if (!t || !n || n.length === 0) continue;
13631
13716
  let r = this.waves[e];
13632
13717
  for (let e of n) {
13633
- let n = Iu[e.target];
13718
+ let n = zu[e.target];
13634
13719
  n.apply(n.base(t), {
13635
13720
  u: r.material.uniforms,
13636
13721
  mesh: r.mesh
@@ -13642,7 +13727,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13642
13727
  let t = this.camera.right - this.camera.left, n = this.camera.top - this.camera.bottom, r = n === 0 ? 1 : t / n, i = e.sample().ripples, a = Math.min(1, .2 + .85 * e.pointerFlux()), o = e.pointerVelocity();
13643
13728
  for (let t = 0; t < this.waves.length; t++) {
13644
13729
  let n = this.config.waves[t] ?? this.config.waves[this.config.waves.length - 1];
13645
- if (!yu(this.config, n)) continue;
13730
+ if (!Su(this.config, n)) continue;
13646
13731
  let s = this.waves[t].material.uniforms;
13647
13732
  s.uPointerAgitate.value = (n.interaction?.hover?.agitate ?? 0) * a, s.uPointerVel.value.copy(o);
13648
13733
  let c = e.fieldFor(t);
@@ -13658,7 +13743,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13658
13743
  out: this.interactionSceneOut
13659
13744
  };
13660
13745
  for (let n of this.config.interaction?.bindings ?? []) {
13661
- let r = Lu[n.target], i = Gt.lerp(n.from ?? r.base(this.config), n.to, e.bindingValue(n));
13746
+ let r = Bu[n.target], i = Gt.lerp(n.from ?? r.base(this.config), n.to, e.bindingValue(n));
13662
13747
  r.apply(i, t);
13663
13748
  }
13664
13749
  for (let t = 0; t < this.waves.length; t++) {
@@ -13666,7 +13751,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13666
13751
  if (!n || !r || r.length === 0) continue;
13667
13752
  let i = this.waves[t];
13668
13753
  for (let t of r) {
13669
- let r = Iu[t.target], a = Gt.lerp(t.from ?? r.base(n), t.to, e.bindingValue(t));
13754
+ let r = zu[t.target], a = Gt.lerp(t.from ?? r.base(n), t.to, e.bindingValue(t));
13670
13755
  r.apply(a, {
13671
13756
  u: i.material.uniforms,
13672
13757
  mesh: i.mesh
@@ -13698,7 +13783,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13698
13783
  this.camera.zoom = this.baseFrameZoom(e, t) * (this.config.cameraZoom ?? 1) * this.interactionZoom, this.camera.updateProjectionMatrix();
13699
13784
  }
13700
13785
  baseFrameZoom(e, t) {
13701
- return xd(e, t, this.config.cameraFit ?? "cover", this.config.cameraMinVisibleWidth ?? 0);
13786
+ return wd(e, t, this.config.cameraFit ?? "cover", this.config.cameraMinVisibleWidth ?? 0);
13702
13787
  }
13703
13788
  updateClipPlanes() {
13704
13789
  this.clipBox.makeEmpty();
@@ -13708,7 +13793,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13708
13793
  let r = n.geometry.boundingSphere;
13709
13794
  if (!r) continue;
13710
13795
  let i = this.clipTmpA.setFromMatrixPosition(n.matrixWorld), a = Math.abs(Number(t.material.uniforms.uDispAmount.value) || 0), o = this.config.waves[e] ?? this.config.waves[this.config.waves.length - 1], s = 0;
13711
- if (yu(this.config, o)) {
13796
+ if (Su(this.config, o)) {
13712
13797
  let e = o.interaction?.hover;
13713
13798
  s = (e?.agitate ?? 0) + Math.abs(e?.push ?? 0) + (e?.wake ?? 0) + (o.interaction?.press?.ripple ?? 0);
13714
13799
  }
@@ -13744,7 +13829,7 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13744
13829
  return this.config;
13745
13830
  }
13746
13831
  setConfig(e) {
13747
- let t = Fl(e), n = t.waves.length !== this.waves.length || t.quality !== this.config.quality;
13832
+ let t = Rl(e), n = t.waves.length !== this.waves.length || t.quality !== this.config.quality;
13748
13833
  this.config = t, n ? this.rebuild() : this.refresh(), this.applyCameraFromConfig();
13749
13834
  }
13750
13835
  dispose() {
@@ -13753,16 +13838,16 @@ var Cd, wd, Td, Ed, Dd, Od = t((() => {
13753
13838
  this.bloomPass?.dispose(), this.ditherPass?.dispose(), this.innerLightPass?.dispose(), this.halftonePass?.dispose(), this.heatmapPass?.dispose(), this.paperTexturePass?.dispose(), this.halftoneCmykPass?.dispose(), this.composer.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
13754
13839
  }
13755
13840
  };
13756
- })), kd = /* @__PURE__ */ n({
13757
- WaveRenderer: () => Dd,
13841
+ })), Md = /* @__PURE__ */ n({
13842
+ WaveRenderer: () => Ad,
13758
13843
  createDefaultConfig: () => wl
13759
13844
  });
13760
13845
  //#endregion
13761
13846
  //#region src/shell/probe.ts
13762
13847
  t((() => {
13763
- Od(), Kl();
13848
+ jd(), Yl();
13764
13849
  }))();
13765
- function Ad() {
13850
+ function Nd() {
13766
13851
  if (typeof document > "u") return !1;
13767
13852
  try {
13768
13853
  let e = document.createElement("canvas"), t = { failIfMajorPerformanceCaveat: !0 }, n = e.getContext("webgl2", t) ?? e.getContext("webgl", t);
@@ -13771,22 +13856,22 @@ function Ad() {
13771
13856
  return !1;
13772
13857
  }
13773
13858
  }
13774
- function jd() {
13859
+ function Pd() {
13775
13860
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
13776
13861
  }
13777
- function Md() {
13862
+ function Fd() {
13778
13863
  return typeof navigator > "u" ? !1 : navigator.connection?.saveData === !0;
13779
13864
  }
13780
13865
  //#endregion
13781
13866
  //#region src/shell/poster.ts
13782
- var Nd = "data-wave3d-poster";
13783
- function Pd(e) {
13867
+ var Id = "data-wave3d-poster";
13868
+ function Ld(e) {
13784
13869
  getComputedStyle(e).position === "static" && (e.style.position = "relative");
13785
13870
  }
13786
- function Fd(e, t, n = "fill") {
13787
- let r = e.querySelector(`img[${Nd}]`);
13871
+ function Rd(e, t, n = "fill") {
13872
+ let r = e.querySelector(`img[${Id}]`);
13788
13873
  if (!r && !t) return null;
13789
- r || (r = document.createElement("img"), r.setAttribute(Nd, ""), r.decoding = "async", r.alt = "", r.setAttribute("aria-hidden", "true"), e.appendChild(r)), t && (r.src = t), Object.assign(r.style, {
13874
+ r || (r = document.createElement("img"), r.setAttribute(Id, ""), r.decoding = "async", r.alt = "", r.setAttribute("aria-hidden", "true"), e.appendChild(r)), t && (r.src = t), Object.assign(r.style, {
13790
13875
  position: "absolute",
13791
13876
  inset: "0",
13792
13877
  width: "100%",
@@ -13819,12 +13904,12 @@ function Fd(e, t, n = "fill") {
13819
13904
  }
13820
13905
  //#endregion
13821
13906
  //#region src/shell/createWave.ts
13822
- function Id(e, t, n, r) {
13907
+ function zd(e, t, n, r) {
13823
13908
  let { lazy: i = !0, rootMargin: a = "200px", webgl: o = "auto", respectReducedMotion: s = !0, reducedMotionBehavior: c = "static", respectSaveData: l = !0, fadeMs: u = 300 } = r, d = "poster", f = null, p = { ...n };
13824
13909
  r.paused !== void 0 && (p.paused = r.paused);
13825
13910
  let m = /* @__PURE__ */ new Map(), h = !1, g = null, _, v = 0;
13826
- Pd(t);
13827
- let y = Fd(t, r.poster, r.posterFit);
13911
+ Ld(t);
13912
+ let y = Rd(t, r.poster, r.posterFit);
13828
13913
  function b(e) {
13829
13914
  d !== e && (d = e, r.onStateChange?.(e));
13830
13915
  }
@@ -13872,7 +13957,7 @@ function Id(e, t, n, r) {
13872
13957
  }
13873
13958
  function E() {
13874
13959
  if (!h) {
13875
- if (o === "auto" && !Ad()) {
13960
+ if (o === "auto" && !Nd()) {
13876
13961
  x("no-webgl");
13877
13962
  return;
13878
13963
  }
@@ -13881,8 +13966,8 @@ function Id(e, t, n, r) {
13881
13966
  }
13882
13967
  function D() {
13883
13968
  if (o !== "off") {
13884
- if (l && Md()) return x("save-data");
13885
- if (s && c === "poster" && jd()) return x("reduced-motion");
13969
+ if (l && Fd()) return x("save-data");
13970
+ if (s && c === "poster" && Pd()) return x("reduced-motion");
13886
13971
  i && typeof IntersectionObserver < "u" ? (g = new IntersectionObserver((e) => {
13887
13972
  e.some((e) => e.isIntersecting) && (g?.disconnect(), g = null, E());
13888
13973
  }, { rootMargin: a }), g.observe(t)) : E();
@@ -13925,11 +14010,11 @@ function Id(e, t, n, r) {
13925
14010
  }
13926
14011
  //#endregion
13927
14012
  //#region src/presets.ts
13928
- Kl();
13929
- var Ld = 180 / Math.PI;
13930
- function Rd(e) {
14013
+ Yl();
14014
+ var Bd = 180 / Math.PI;
14015
+ function Vd(e) {
13931
14016
  let t = wl(), n = t.waves[0];
13932
- return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad * Ld, n.displaceFrequency = {
14017
+ return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad * Bd, n.displaceFrequency = {
13933
14018
  x: e.dispX,
13934
14019
  y: e.dispZ
13935
14020
  }, n.displaceAmount = e.dispAmt, n.position = {
@@ -13937,9 +14022,9 @@ function Rd(e) {
13937
14022
  y: e.pos[1],
13938
14023
  z: e.pos[2]
13939
14024
  }, n.rotation = {
13940
- x: e.rotRad[0] * Ld,
13941
- y: e.rotRad[1] * Ld,
13942
- z: e.rotRad[2] * Ld
14025
+ x: e.rotRad[0] * Bd,
14026
+ y: e.rotRad[1] * Bd,
14027
+ z: e.rotRad[2] * Bd
13943
14028
  }, n.scale = {
13944
14029
  x: e.scale[0],
13945
14030
  y: e.scale[1],
@@ -13962,8 +14047,8 @@ function Rd(e) {
13962
14047
  z: 0
13963
14048
  }, t.cameraZoom = e.zoom, t;
13964
14049
  }
13965
- var zd = {
13966
- Hero: () => Rd({
14050
+ var Hd = {
14051
+ Hero: () => Vd({
13967
14052
  speed: .04,
13968
14053
  contrast: 1,
13969
14054
  sat: 1,
@@ -14007,7 +14092,7 @@ var zd = {
14007
14092
  camTarget: [-420, -200]
14008
14093
  }),
14009
14094
  "Wave 2": () => wl(),
14010
- "Wave 3": () => Rd({
14095
+ "Wave 3": () => Vd({
14011
14096
  speed: .08,
14012
14097
  contrast: 1,
14013
14098
  sat: 1,
@@ -14050,7 +14135,7 @@ var zd = {
14050
14135
  zoom: 1.3,
14051
14136
  camTarget: [-104, 13]
14052
14137
  }),
14053
- "Wave 4": () => Rd({
14138
+ "Wave 4": () => Vd({
14054
14139
  speed: .0525,
14055
14140
  contrast: .969,
14056
14141
  sat: 1.383,
@@ -14130,7 +14215,7 @@ var zd = {
14130
14215
  ]), t.creaseLight = 1, e.background = "#05060c", e.transparentBackground = !1, e.waves = bl(t, 3), e.waveCount = 3, e;
14131
14216
  },
14132
14217
  "Mesh Gradient": () => {
14133
- let e = zd.Hero(), t = e.waves[0];
14218
+ let e = Hd.Hero(), t = e.waves[0];
14134
14219
  return t.gradientType = "mesh", t.meshGradientPoints = [
14135
14220
  {
14136
14221
  color: "#0a84ff",
@@ -14171,7 +14256,7 @@ var zd = {
14171
14256
  ], t.meshGradientSoftness = .68, t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.06, t.colorSaturation = 1.12, t.fiberStrength = .14, e.grain = .3, e.blur = .008, e.background = "#070914", e.backgroundMode = "color", e.transparentBackground = !1, e;
14172
14257
  },
14173
14258
  "Solar Bloom": () => {
14174
- let e = zd.Hero(), t = e.waves[0];
14259
+ let e = Hd.Hero(), t = e.waves[0];
14175
14260
  return t.usePaletteTexture = !1, t.gradientType = "radial", t.gradientShift = .14, t.palette = [
14176
14261
  {
14177
14262
  color: "#fff3c4",
@@ -14200,7 +14285,7 @@ var zd = {
14200
14285
  ], t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.05, t.colorSaturation = 1.18, t.fiberStrength = .12, e.grain = .3, e.blur = .01, e.background = "#0a0714", e.backgroundMode = "gradient", e.backgroundGradientType = "radial", e.backgroundGradientSource = "stops", e.backgroundPalette = vl(["#2a1330", "#08040f"]), e.transparentBackground = !1, e;
14201
14286
  },
14202
14287
  Holographic: () => {
14203
- let e = zd.Hero(), t = e.waves[0];
14288
+ let e = Hd.Hero(), t = e.waves[0];
14204
14289
  return t.usePaletteTexture = !1, t.gradientType = "conic", t.gradientShift = .08, t.palette = [
14205
14290
  {
14206
14291
  color: "#8ef6e4",
@@ -14233,7 +14318,7 @@ var zd = {
14233
14318
  ], t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.04, t.colorSaturation = 1.12, t.fiberStrength = .12, e.grain = .28, e.blur = .01, e.background = "#05060c", e.backgroundMode = "gradient", e.backgroundGradientType = "linear", e.backgroundGradientAngle = 135, e.backgroundGradientSource = "stops", e.backgroundPalette = vl(["#04121a", "#0a0518"]), e.transparentBackground = !1, e;
14234
14319
  },
14235
14320
  Aurora: () => {
14236
- let e = zd.Hero(), t = e.waves[0];
14321
+ let e = Hd.Hero(), t = e.waves[0];
14237
14322
  return t.gradientType = "mesh", t.meshGradientPoints = [
14238
14323
  {
14239
14324
  color: "#0a1f3c",
@@ -14305,31 +14390,103 @@ var zd = {
14305
14390
  ], e.backgroundMeshSoftness = .75, e.transparentBackground = !1, e;
14306
14391
  },
14307
14392
  Palestine: () => {
14308
- let e = zd.Hero(), t = e.waves[0];
14393
+ let e = Hd.Hero(), t = e.waves[0];
14309
14394
  return t.paletteSource = "palestine", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1, t.colorSaturation = 1, e.grain = .35, e.background = "#f2efe8", e.transparentBackground = !0, e;
14310
14395
  },
14311
14396
  Spain: () => {
14312
- let e = zd.Hero(), t = e.waves[0];
14397
+ let e = Hd.Hero(), t = e.waves[0];
14313
14398
  return t.paletteSource = "spain", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.18, t.colorSaturation = 1.25, t.creaseLight = 1.6, e.grain = .3, e.background = "#1a0608", e.backgroundMode = "color", e.transparentBackground = !1, e;
14314
14399
  },
14315
14400
  "Vaporwave Sunset": () => {
14316
- let e = zd.Hero(), t = e.waves[0];
14317
- return t.position.x = 525, t.rotation.x = -.64 * Ld, t.rotation.z = 1.68 * Ld, t.paletteSource = "vaporwave", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.08, t.colorSaturation = 1.15, t.creaseLight = 1.25, e.cameraZoom = 1.1, e.cameraTarget = {
14401
+ let e = Hd.Hero(), t = e.waves[0];
14402
+ return t.position.x = 525, t.rotation.x = -.64 * Bd, t.rotation.z = 1.68 * Bd, t.paletteSource = "vaporwave", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.08, t.colorSaturation = 1.15, t.creaseLight = 1.25, e.cameraZoom = 1.1, e.cameraTarget = {
14318
14403
  x: 150,
14319
14404
  y: 360,
14320
14405
  z: 0
14321
14406
  }, e.background = "#09051f", e.transparentBackground = !1, e;
14322
14407
  },
14408
+ Corkscrew: () => {
14409
+ let e = Hd.Hero(), t = e.waves[0];
14410
+ return t.helixTurns = 5, t.helixRadius = 45, t.helixRoll = 1, t.helixPhase = 0, t.twistFrequency = {
14411
+ x: 0,
14412
+ y: 0,
14413
+ z: 0
14414
+ }, t.twistPower = {
14415
+ x: 4,
14416
+ y: 4,
14417
+ z: 2
14418
+ }, t.displaceAmount = 16, t.displaceFrequency = {
14419
+ x: .006,
14420
+ y: 8e-4
14421
+ }, t.speed = .1, t.position = {
14422
+ x: 0,
14423
+ y: 0,
14424
+ z: 0
14425
+ }, t.rotation = {
14426
+ x: 0,
14427
+ y: 0,
14428
+ z: 12
14429
+ }, t.scale = {
14430
+ x: 3,
14431
+ y: 3,
14432
+ z: 1.5
14433
+ }, t.gradientType = "mesh", t.meshGradientPoints = [
14434
+ {
14435
+ color: "#0a84ff",
14436
+ x: .06,
14437
+ y: .9,
14438
+ influence: .68
14439
+ },
14440
+ {
14441
+ color: "#64d2ff",
14442
+ x: .88,
14443
+ y: .92,
14444
+ influence: .72
14445
+ },
14446
+ {
14447
+ color: "#bf5af2",
14448
+ x: .5,
14449
+ y: .64,
14450
+ influence: .58
14451
+ },
14452
+ {
14453
+ color: "#ff375f",
14454
+ x: .1,
14455
+ y: .14,
14456
+ influence: .7
14457
+ },
14458
+ {
14459
+ color: "#ff9f0a",
14460
+ x: .84,
14461
+ y: .12,
14462
+ influence: .74
14463
+ },
14464
+ {
14465
+ color: "#30d158",
14466
+ x: .94,
14467
+ y: .5,
14468
+ influence: .54
14469
+ }
14470
+ ], t.meshGradientSoftness = .68, t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.06, t.colorSaturation = 1.12, t.fiberStrength = .14, e.cameraPosition = {
14471
+ x: -526.009,
14472
+ y: -285.284,
14473
+ z: -425.489
14474
+ }, e.cameraTarget = {
14475
+ x: -95.046,
14476
+ y: -17.053,
14477
+ z: -105.608
14478
+ }, e.cameraDistance = 600, e.cameraZoom = 1.176, e.grain = .3, e.blur = .008, e.bloomStrength = .35, e.bloomRadius = .6, e.bloomThreshold = .55, e.background = "#070914", e.backgroundMode = "color", e.transparentBackground = !1, e;
14479
+ },
14323
14480
  Kaleidoscope: () => {
14324
- let e = zd["Wave 3"](), t = e.waves[0];
14481
+ let e = Hd["Wave 3"](), t = e.waves[0];
14325
14482
  return t.paletteSource = "kaleidoscope", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.05, t.colorSaturation = 1.12, e.grain = .5, e;
14326
14483
  }
14327
14484
  };
14328
- Od(), Kl();
14329
- var Bd = () => Promise.resolve(kd);
14330
- function Vd(e, t = {}, n = {}) {
14331
- return Id(Bd, e, t, n);
14485
+ jd(), Yl();
14486
+ var Ud = () => Promise.resolve(Md);
14487
+ function Wd(e, t = {}, n = {}) {
14488
+ return zd(Ud, e, t, n);
14332
14489
  }
14333
- var Hd = Vd;
14490
+ var Gd = Wd;
14334
14491
  //#endregion
14335
- export { Vl as CAMERA_FITS, Hl as DEFAULT_LIGHT_POSITION, Il as MAX_COLORS, Rl as MAX_LIGHTS, Ll as MAX_MESH_POINTS, zl as MAX_NOISE_BANDS, Bl as MAX_WAVES, zd as PRESETS, Dd as WaveRenderer, wl as createDefaultConfig, yl as createDefaultMeshPoints, gl as createLight, _l as createNoiseBand, Vd as createWave, Dl as ensureCamera, kl as ensureSceneDefaults, Fl as ensureStudioConfig, vl as makeStops, Sl as makeWave, bl as makeWaveSpread, Hd as mountWave, El as normalizeBackground, Pl as normalizeSceneInteraction, Ol as normalizeWave, Nl as normalizeWaveInteraction, Cl as resizeWaves };
14492
+ export { Wl as CAMERA_FITS, Gl as DEFAULT_LIGHT_POSITION, zl as MAX_COLORS, Vl as MAX_LIGHTS, Bl as MAX_MESH_POINTS, Hl as MAX_NOISE_BANDS, Ul as MAX_WAVES, Hd as PRESETS, Ad as WaveRenderer, wl as createDefaultConfig, yl as createDefaultMeshPoints, gl as createLight, _l as createNoiseBand, Wd as createWave, Dl as ensureCamera, kl as ensureSceneDefaults, Rl as ensureStudioConfig, vl as makeStops, Sl as makeWave, bl as makeWaveSpread, Gd as mountWave, El as normalizeBackground, Ll as normalizeSceneInteraction, Ol as normalizeWave, Il as normalizeWaveInteraction, Cl as resizeWaves };