{"version":3,"file":"ngwr-decrypt-text.mjs","sources":["../../../projects/lib/decrypt-text/decrypt-text.ts","../../../projects/lib/decrypt-text/decrypt-text.html","../../../projects/lib/decrypt-text/ngwr-decrypt-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the DecryptedText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/decrypted-text\n *\n * The reactbits version uses `motion/react` for the wrapper. This port\n * is dependency-free — vanilla signals + `setInterval` for the tick loop.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n  Component,\n  DestroyRef,\n  ElementRef,\n  PLATFORM_ID,\n  ViewEncapsulation,\n  afterNextRender,\n  computed,\n  effect,\n  inject,\n  input,\n  signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrDecryptTextAnimateOn, WrDecryptTextRevealDirection, WrDecryptTextClickMode } from './interfaces';\n\nconst DEFAULT_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+';\n\nfunction computeOrder(len: number, dir: WrDecryptTextRevealDirection): readonly number[] {\n  const order: number[] = [];\n  if (len <= 0) return order;\n  if (dir === 'start') {\n    for (let i = 0; i < len; i++) order.push(i);\n    return order;\n  }\n  if (dir === 'end') {\n    for (let i = len - 1; i >= 0; i--) order.push(i);\n    return order;\n  }\n  const middle = Math.floor(len / 2);\n  let off = 0;\n  while (order.length < len) {\n    if (off % 2 === 0) {\n      const idx = middle + off / 2;\n      if (idx >= 0 && idx < len) order.push(idx);\n    } else {\n      const idx = middle - Math.ceil(off / 2);\n      if (idx >= 0 && idx < len) order.push(idx);\n    }\n    off++;\n  }\n  return order.slice(0, len);\n}\n\nfunction fillAllIndices(len: number): Set<number> {\n  const s = new Set<number>();\n  for (let i = 0; i < len; i++) s.add(i);\n  return s;\n}\n\nfunction removeRandomIndices(set: ReadonlySet<number>, count: number): Set<number> {\n  const arr = Array.from(set);\n  for (let i = 0; i < count && arr.length > 0; i++) {\n    arr.splice(Math.floor(Math.random() * arr.length), 1);\n  }\n  return new Set(arr);\n}\n\n/**\n * Reveals a string by scrambling characters and progressively replacing\n * scramble glyphs with the originals. Supports sequential reveal in\n * three directions, or non-sequential \"settle\" after N iterations, and\n * four trigger modes (hover, click, view, in-view + hover).\n *\n * @example\n * ```html\n * <wr-decrypt-text text=\"Hello, ngwr!\" animateOn=\"hover\" />\n * <wr-decrypt-text\n *   text=\"Reveal from the center\"\n *   [sequential]=\"true\"\n *   revealDirection=\"center\"\n *   animateOn=\"view\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/decrypted-text\n */\n@Component({\n  selector: 'wr-decrypt-text',\n  templateUrl: './decrypt-text.html',\n  styleUrl: './decrypt-text.scss',\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    class: 'wr-decrypt-text',\n    '(mouseenter)': 'onMouseEnter()',\n    '(mouseleave)': 'onMouseLeave()',\n    '(click)': 'onClick()',\n  },\n})\nexport class WrDecryptText {\n  /** Text to reveal. Required. */\n  readonly text = input.required<string>();\n\n  /** Tick interval in ms. @default 50 */\n  readonly speed = input(50, { transform: numAttr(50) });\n\n  /** Non-sequential mode only — total scramble ticks before snapping to plain. @default 10 */\n  readonly maxIterations = input(10, { transform: numAttr(10) });\n\n  /** Reveal one char per tick instead of scrambling all of them. @default false */\n  readonly sequential = input(false, { transform: coerceBooleanProperty });\n\n  /** Order in which chars are revealed in sequential mode. @default 'start' */\n  readonly revealDirection = input<WrDecryptTextRevealDirection>('start');\n\n  /** Scramble using only the glyphs present in `text` (minus spaces). @default false */\n  readonly useOriginalCharsOnly = input(false, { transform: coerceBooleanProperty });\n\n  /** Pool of glyphs to scramble through (used when `useOriginalCharsOnly` is false). */\n  readonly characters = input(DEFAULT_CHARS);\n\n  /** When to start the animation. @default 'hover' */\n  readonly animateOn = input<WrDecryptTextAnimateOn>('hover');\n\n  /** Click behaviour. `'once'` decrypts then stops; `'toggle'` flips state on each click. @default 'once' */\n  readonly clickMode = input<WrDecryptTextClickMode>('once');\n\n  private readonly displayText = signal('');\n  private readonly revealedIndices = signal<ReadonlySet<number>>(new Set());\n  private readonly isAnimating = signal(false);\n  private readonly isDecrypted = signal(true);\n  private readonly direction = signal<'forward' | 'reverse'>('forward');\n\n  /** Per-char render data. */\n  protected readonly chars = computed(() => {\n    const display = this.displayText();\n    const revealed = this.revealedIndices();\n    const decrypted = this.isDecrypted();\n    const animating = this.isAnimating();\n    return [...display].map((ch, i) => ({\n      ch,\n      revealed: revealed.has(i) || (!animating && decrypted),\n    }));\n  });\n\n  /** Sequential reverse order — captured when reverse starts. */\n  private reverseOrder: readonly number[] = [];\n  private reversePointer = 0;\n  private iterationCount = 0;\n  private intervalId: ReturnType<typeof setInterval> | undefined;\n  private hasAnimatedOnce = false;\n\n  private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n  private readonly platform = inject(WrPlatform);\n\n  constructor() {\n    if (!this.isBrowser) {\n      // SSR: render plain text.\n      effect(() => this.displayText.set(this.text()));\n      return;\n    }\n\n    // Reset state whenever `text` or `animateOn` changes.\n    effect(() => {\n      const txt = this.text();\n      const mode = this.animateOn();\n      this.stopInterval();\n      if (mode === 'click') {\n        this.encryptInstantly(txt);\n      } else {\n        this.displayText.set(txt);\n        this.isDecrypted.set(true);\n      }\n      this.revealedIndices.set(new Set());\n      this.direction.set('forward');\n      this.hasAnimatedOnce = false;\n    });\n\n    afterNextRender(() => {\n      const mode = this.animateOn();\n      if (mode === 'view' || mode === 'inViewHover') this.setupIntersectionObserver();\n    });\n\n    this.destroyRef.onDestroy(() => this.stopInterval());\n  }\n\n  // Trigger handlers\n\n  protected onMouseEnter(): void {\n    const mode = this.animateOn();\n    if (mode !== 'hover' && mode !== 'inViewHover') return;\n    this.triggerHoverDecrypt();\n  }\n\n  protected onMouseLeave(): void {\n    const mode = this.animateOn();\n    if (mode !== 'hover' && mode !== 'inViewHover') return;\n    this.resetToPlain();\n  }\n\n  protected onClick(): void {\n    if (this.animateOn() !== 'click') return;\n    if (this.clickMode() === 'once') {\n      if (this.isDecrypted()) return;\n      this.direction.set('forward');\n      this.triggerDecrypt();\n      return;\n    }\n    if (this.isDecrypted()) this.triggerReverse();\n    else {\n      this.direction.set('forward');\n      this.triggerDecrypt();\n    }\n  }\n\n  // Internals\n\n  private setupIntersectionObserver(): void {\n    const io = new IntersectionObserver(\n      (entries, obs) => {\n        for (const e of entries) {\n          if (e.isIntersecting && !this.hasAnimatedOnce) {\n            obs.disconnect();\n            this.hasAnimatedOnce = true;\n            this.triggerDecrypt();\n            break;\n          }\n        }\n      },\n      { threshold: 0.1, rootMargin: '0px' }\n    );\n    io.observe(this.host.nativeElement);\n    this.destroyRef.onDestroy(() => io.disconnect());\n  }\n\n  private triggerHoverDecrypt(): void {\n    if (this.isAnimating()) return;\n    this.revealedIndices.set(new Set());\n    this.isDecrypted.set(false);\n    this.displayText.set(this.text());\n    this.direction.set('forward');\n    this.startInterval();\n  }\n\n  private resetToPlain(): void {\n    this.stopInterval();\n    this.revealedIndices.set(new Set());\n    this.displayText.set(this.text());\n    this.isDecrypted.set(true);\n    this.direction.set('forward');\n  }\n\n  private triggerDecrypt(): void {\n    if (this.sequential()) {\n      this.revealedIndices.set(new Set());\n    } else {\n      this.revealedIndices.set(new Set());\n    }\n    this.direction.set('forward');\n    this.startInterval();\n  }\n\n  private triggerReverse(): void {\n    const txt = this.text();\n    if (this.sequential()) {\n      this.reverseOrder = computeOrder(txt.length, this.revealDirection()).slice().reverse();\n      this.reversePointer = 0;\n    }\n    const all = fillAllIndices(txt.length);\n    this.revealedIndices.set(all);\n    this.displayText.set(this.shuffle(txt, all));\n    this.direction.set('reverse');\n    this.startInterval();\n  }\n\n  private encryptInstantly(txt: string): void {\n    this.revealedIndices.set(new Set());\n    this.displayText.set(this.shuffle(txt, new Set()));\n    this.isDecrypted.set(false);\n  }\n\n  private startInterval(): void {\n    // Reduced motion: every trigger funnels through here — skip the\n    // scramble loop and jump straight to the plain, decrypted text.\n    if (this.platform.prefersReducedMotion()) {\n      this.resetToPlain();\n      return;\n    }\n\n    this.stopInterval();\n    this.isAnimating.set(true);\n    this.iterationCount = 0;\n    this.intervalId = setInterval(() => this.tick(), this.speed());\n  }\n\n  private stopInterval(): void {\n    if (this.intervalId !== undefined) {\n      clearInterval(this.intervalId);\n      this.intervalId = undefined;\n    }\n    this.isAnimating.set(false);\n  }\n\n  private tick(): void {\n    const txt = this.text();\n    const seq = this.sequential();\n    const dir = this.direction();\n    const max = this.maxIterations();\n    const revealed = this.revealedIndices();\n\n    if (seq && dir === 'forward') {\n      if (revealed.size < txt.length) {\n        const nextIdx = this.nextSequentialIndex(revealed, txt.length);\n        const next = new Set(revealed);\n        next.add(nextIdx);\n        this.revealedIndices.set(next);\n        this.displayText.set(this.shuffle(txt, next));\n      } else {\n        this.stopInterval();\n        this.isDecrypted.set(true);\n        this.displayText.set(txt);\n      }\n      return;\n    }\n\n    if (seq && dir === 'reverse') {\n      if (this.reversePointer < this.reverseOrder.length) {\n        const idx = this.reverseOrder[this.reversePointer++];\n        const next = new Set(revealed);\n        next.delete(idx);\n        this.revealedIndices.set(next);\n        this.displayText.set(this.shuffle(txt, next));\n        if (next.size === 0) {\n          this.stopInterval();\n          this.isDecrypted.set(false);\n        }\n      } else {\n        this.stopInterval();\n        this.isDecrypted.set(false);\n      }\n      return;\n    }\n\n    if (!seq && dir === 'forward') {\n      this.displayText.set(this.shuffle(txt, revealed));\n      this.iterationCount++;\n      if (this.iterationCount >= max) {\n        this.stopInterval();\n        this.displayText.set(txt);\n        this.isDecrypted.set(true);\n      }\n      return;\n    }\n\n    if (!seq && dir === 'reverse') {\n      let current = revealed;\n      if (current.size === 0) current = fillAllIndices(txt.length);\n      const removeCount = Math.max(1, Math.ceil(txt.length / Math.max(1, max)));\n      const next = removeRandomIndices(current, removeCount);\n      this.revealedIndices.set(next);\n      this.displayText.set(this.shuffle(txt, next));\n      this.iterationCount++;\n      if (next.size === 0 || this.iterationCount >= max) {\n        this.stopInterval();\n        this.isDecrypted.set(false);\n        this.displayText.set(this.shuffle(txt, new Set()));\n        this.revealedIndices.set(new Set());\n      }\n    }\n  }\n\n  private nextSequentialIndex(revealed: ReadonlySet<number>, len: number): number {\n    switch (this.revealDirection()) {\n      case 'end':\n        return len - 1 - revealed.size;\n      case 'center': {\n        const middle = Math.floor(len / 2);\n        const offset = Math.floor(revealed.size / 2);\n        const candidate = revealed.size % 2 === 0 ? middle + offset : middle - offset - 1;\n        if (candidate >= 0 && candidate < len && !revealed.has(candidate)) return candidate;\n        for (let i = 0; i < len; i++) if (!revealed.has(i)) return i;\n        return 0;\n      }\n      case 'start':\n      default:\n        return revealed.size;\n    }\n  }\n\n  private shuffle(txt: string, revealed: ReadonlySet<number>): string {\n    const pool = this.useOriginalCharsOnly()\n      ? Array.from(new Set(txt.split(''))).filter(ch => ch !== ' ')\n      : this.characters().split('');\n    if (pool.length === 0) return txt;\n    return [...txt]\n      .map((ch, i) => {\n        if (ch === ' ') return ' ';\n        if (revealed.has(i)) return txt[i];\n        return pool[Math.floor(Math.random() * pool.length)];\n      })\n      .join('');\n  }\n}\n\nexport type { WrDecryptTextAnimateOn, WrDecryptTextRevealDirection, WrDecryptTextClickMode } from './interfaces';\n","<span class=\"wr-decrypt-text__sr-only\">{{ text() }}</span>\n<span aria-hidden=\"true\">\n  @for (c of chars(); track $index) {\n    <span [class]=\"c.revealed ? 'wr-decrypt-text__char' : 'wr-decrypt-text__char wr-decrypt-text__char--encrypted'\">{{\n      c.ch\n    }}</span>\n  }\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":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