{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"flip-card","type":"registry:component","title":"3D Flip Card","description":"A card with real thickness that turns on a spring: a shaded rim, a glare that sweeps the face turning toward you, a floor shadow that narrows mid-turn, and a lean toward the pointer. Flips on hover, focus, click, tap or Enter. No dependencies.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/flip-card.tsx","content":"\"use client\";\n\n/*\n * FlipCard: a card with real thickness that turns over on a spring.\n *\n * Three nested layers do the 3D: a perspective layer, a tilt layer that leans\n * toward the pointer, and a flipper that turns on the Y axis. Both faces sit on\n * the flipper with backface-visibility hidden, and a stack of thin slabs between\n * them gives the card a rim you can see when it is edge-on. The turn is a\n * hand-written spring (a little weight, a hint of overshoot); the same angle\n * drives a glare sweep across whichever face is turning toward you, and a\n * floor shadow that narrows and fades while the card lifts mid-turn.\n * Reduced motion drops the rotation and crossfades the faces instead.\n */\n\nimport { useEffect, useRef, useState, useSyncExternalStore, type CSSProperties, type KeyboardEvent, type PointerEvent, type ReactNode } from \"react\";\n\nexport interface FlipCardProps {\n  /** Text on the front face. */\n  frontLabel?: string;\n  /** Text on the back face. */\n  backLabel?: string;\n  /** \"hover\" flips while the pointer is over the card or it has keyboard focus (a tap toggles on touch); \"click\" toggles on click, tap, Enter or Space. */\n  trigger?: \"hover\" | \"click\";\n  /** Replaces the front label with your own content. */\n  front?: ReactNode;\n  /** Replaces the back label with your own content. */\n  back?: ReactNode;\n  /** How far the card leans toward the pointer, in degrees. 0 turns the lean off. */\n  tilt?: number;\n  /** Extra classes for the root. The root is the card box: size it here (the default is h-40 w-64). */\n  className?: string;\n  /** Called with true when the back face turns toward you, false when the front does. */\n  onFlipChange?: (flipped: boolean) => void;\n}\n\n/* ---- Motion constants ---------------------------------------------------- */\n\n/** Flip spring: stiffness, damping. Damping ratio ~0.78, so one small overshoot (about 2 degrees). */\nconst FLIP_K = 170;\nconst FLIP_C = 20.4;\n/** Lean spring, a touch softer than the flip. */\nconst LEAN_K = 120;\nconst LEAN_C = 17;\n/** How fast the pointer glare follows the pointer and fades (per second). */\nconst GLARE_RATE = 14;\n/** The card lifts toward you by up to this many px at the middle of the turn. */\nconst LIFT = 28;\n\nconst nowMs = () => performance.now();\n\nfunction subscribeMotion(cb: () => void) {\n  const m = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n  m.addEventListener(\"change\", cb);\n  return () => m.removeEventListener(\"change\", cb);\n}\n\n/** True when the visitor asked for reduced motion. False on the server. */\nfunction useReducedMotion(): boolean {\n  return useSyncExternalStore(\n    subscribeMotion,\n    () => window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches,\n    () => false,\n  );\n}\n\ninterface Spring {\n  x: number;\n  v: number;\n}\n\nfunction stepSpring(s: Spring, target: number, k: number, c: number, dt: number) {\n  s.v += (k * (target - s.x) - c * s.v) * dt;\n  s.x += s.v * dt;\n}\n\n/** Slab colours between the front rim and the back rim, so the edge shades from one face to the other. */\nconst SLABS = Array.from({ length: 10 }, (_, i) => {\n  const k = (i + 0.5) / 10 - 0.5;\n  const m = i / 9;\n  const mix = (a: number, b: number) => Math.round(a + (b - a) * m);\n  return { z: k * 0.9, color: `rgb(${mix(40, 134)} ${mix(41, 28)} ${mix(47, 30)})` };\n});\n\nconst FACE_RADIUS = \"5.2cqw\";\n\nconst glareBackground = [\n  \"radial-gradient(60% 80% at var(--gx) var(--gy), rgb(255 255 255 / calc(var(--pa) * 0.16)), transparent 70%)\",\n  \"linear-gradient(105deg, transparent calc(var(--sw) * 1% - 16%), rgb(255 255 255 / var(--sa)) calc(var(--sw) * 1%), transparent calc(var(--sw) * 1% + 16%))\",\n].join(\",\");\n\nfunction Face({ side, hidden, reduced, decor, children }: { side: \"front\" | \"back\"; hidden: boolean; reduced: boolean; decor: boolean; children: ReactNode }) {\n  const front = side === \"front\";\n  const style: CSSProperties = {\n    borderRadius: FACE_RADIUS,\n    backfaceVisibility: \"hidden\",\n    WebkitBackfaceVisibility: \"hidden\",\n    transform: reduced ? undefined : front ? \"translateZ(calc(var(--t) / 2))\" : \"rotateY(180deg) translateZ(calc(var(--t) / 2))\",\n    background: front\n      ? \"radial-gradient(120% 90% at 16% 0%, rgb(255 255 255 / 0.1), transparent 55%), linear-gradient(155deg, #1d1e23 0%, #121317 55%, #0d0e11 100%)\"\n      : \"radial-gradient(110% 80% at 85% 0%, rgb(255 255 255 / 0.2), transparent 52%), linear-gradient(150deg, #ff5b49 0%, #e5332b 46%, #a1161d 100%)\",\n    boxShadow: front\n      ? \"inset 0 0 0 1px rgb(255 255 255 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.16)\"\n      : \"inset 0 0 0 1px rgb(255 255 255 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.3)\",\n    color: front ? \"#f4f4f5\" : \"#ffffff\",\n    opacity: reduced ? (hidden ? 0 : 1) : undefined,\n    transition: reduced ? \"opacity 220ms ease\" : undefined,\n    pointerEvents: reduced && hidden ? \"none\" : undefined,\n  };\n  return (\n    <div aria-hidden={hidden || undefined} className=\"absolute inset-0 overflow-hidden\" style={style}>\n      {front ? null : (\n        <svg aria-hidden className=\"pointer-events-none absolute inset-0 h-full w-full\" viewBox=\"0 0 160 100\" preserveAspectRatio=\"xMidYMid slice\" fill=\"none\" stroke=\"#fff\" strokeWidth=\"0.5\" strokeOpacity=\"0.16\">\n          <circle cx=\"142\" cy=\"112\" r=\"38\" />\n          <circle cx=\"142\" cy=\"112\" r=\"62\" />\n          <circle cx=\"142\" cy=\"112\" r=\"86\" />\n          <circle cx=\"142\" cy=\"112\" r=\"110\" />\n        </svg>\n      )}\n      <div className=\"relative flex h-full w-full items-center justify-center px-[8cqw] text-center\">{children}</div>\n      {front && decor ? (\n        <>\n          <svg aria-hidden className=\"pointer-events-none absolute left-[6cqw] top-[6cqw] h-[5cqw] w-[5cqw] min-h-3 min-w-3\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" opacity=\"0.38\">\n            <circle cx=\"12\" cy=\"12\" r=\"9\" />\n            <circle cx=\"12\" cy=\"12\" r=\"3.6\" />\n          </svg>\n          <svg aria-hidden className=\"pointer-events-none absolute bottom-[6cqw] right-[6cqw] h-[5.4cqw] w-[5.4cqw] min-h-3.5 min-w-3.5\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" opacity=\"0.4\">\n            <path d=\"M20 11a8 8 0 0 0-14-4.5M4 4v3.5h3.5M4 13a8 8 0 0 0 14 4.5M20 20v-3.5h-3.5\" />\n          </svg>\n        </>\n      ) : null}\n      {reduced ? null : <div aria-hidden className=\"pointer-events-none absolute inset-0\" style={{ background: glareBackground }} />}\n    </div>\n  );\n}\n\nexport function FlipCard({\n  frontLabel = \"Hover to flip\",\n  backLabel = \"Here's the back\",\n  trigger = \"hover\",\n  front,\n  back,\n  tilt = 6,\n  className,\n  onFlipChange,\n}: FlipCardProps) {\n  const reduced = useReducedMotion();\n  const [clicked, setClicked] = useState(false);\n  const [hovered, setHovered] = useState(false);\n  const [focused, setFocused] = useState(false);\n  const [tapped, setTapped] = useState(false);\n  const flipped = trigger === \"click\" ? clicked : hovered || focused || tapped;\n\n  const rootRef = useRef<HTMLDivElement>(null);\n  const tiltRef = useRef<HTMLDivElement>(null);\n  const flipRef = useRef<HTMLDivElement>(null);\n  const shadowRef = useRef<HTMLDivElement>(null);\n  const lastPointer = useRef(\"mouse\");\n  const wake = useRef<() => void>(() => {});\n  const target = useRef({ angle: 0, rx: 0, ry: 0, gx: 50, gy: 50, pa: 0 });\n  const tiltMax = useRef(tilt);\n  const onFlip = useRef(onFlipChange);\n  const prevFlipped = useRef(false);\n\n  useEffect(() => {\n    tiltMax.current = tilt;\n    onFlip.current = onFlipChange;\n  });\n\n  /* The spring loop: runs only while something is moving. */\n  useEffect(() => {\n    const tl = tiltRef.current;\n    const fl = flipRef.current;\n    const sh = shadowRef.current;\n    const root = rootRef.current;\n    if (!tl || !fl || !sh || !root) return;\n    if (reduced) {\n      tl.style.transform = \"\";\n      fl.style.transform = \"\";\n      sh.style.transform = \"\";\n      sh.style.opacity = \"\";\n      wake.current = () => {};\n      return;\n    }\n    const tg = target.current;\n    const angle: Spring = { x: tg.angle, v: 0 };\n    const rx: Spring = { x: 0, v: 0 };\n    const ry: Spring = { x: 0, v: 0 };\n    let gx = tg.gx;\n    let gy = tg.gy;\n    let pa = 0;\n    let raf = 0;\n    let last = 0;\n\n    const apply = () => {\n      const rad = (angle.x * Math.PI) / 180;\n      const sn = Math.abs(Math.sin(rad));\n      const cs = Math.abs(Math.cos(rad));\n      fl.style.transform = `translateZ(${(sn * LIFT).toFixed(2)}px) rotateY(${angle.x.toFixed(3)}deg)`;\n      tl.style.transform = `rotateX(${rx.x.toFixed(3)}deg) rotateY(${ry.x.toFixed(3)}deg)`;\n      sh.style.transform = `translateX(-50%) scale(${(0.4 + 0.6 * cs).toFixed(3)}, ${(1 - 0.3 * sn).toFixed(3)})`;\n      sh.style.opacity = (1 - 0.6 * sn).toFixed(3);\n      const p = angle.x / 180;\n      const q = p <= 0.5 ? p : p - 0.5;\n      root.style.setProperty(\"--sw\", (-30 + 260 * q).toFixed(2));\n      root.style.setProperty(\"--sa\", (0.5 * Math.max(0, Math.sin(2 * Math.PI * q))).toFixed(3));\n      root.style.setProperty(\"--gx\", gx.toFixed(2) + \"%\");\n      root.style.setProperty(\"--gy\", gy.toFixed(2) + \"%\");\n      root.style.setProperty(\"--pa\", pa.toFixed(3));\n    };\n\n    const step = (t: number) => {\n      raf = 0;\n      const dt = Math.min(0.032, Math.max(0.001, (t - last) / 1000));\n      last = t;\n      const h = dt / 2;\n      for (let i = 0; i < 2; i++) {\n        stepSpring(angle, tg.angle, FLIP_K, FLIP_C, h);\n        stepSpring(rx, tg.rx, LEAN_K, LEAN_C, h);\n        stepSpring(ry, tg.ry, LEAN_K, LEAN_C, h);\n      }\n      const f = 1 - Math.exp(-dt * GLARE_RATE);\n      gx += (tg.gx - gx) * f;\n      gy += (tg.gy - gy) * f;\n      pa += (tg.pa - pa) * f;\n      const settled =\n        Math.abs(angle.x - tg.angle) < 0.04 && Math.abs(angle.v) < 0.6 &&\n        Math.abs(rx.x - tg.rx) < 0.02 && Math.abs(rx.v) < 0.1 &&\n        Math.abs(ry.x - tg.ry) < 0.02 && Math.abs(ry.v) < 0.1 &&\n        Math.abs(pa - tg.pa) < 0.004 && Math.abs(gx - tg.gx) < 0.1 && Math.abs(gy - tg.gy) < 0.1;\n      if (settled) {\n        angle.x = tg.angle; angle.v = 0;\n        rx.x = tg.rx; rx.v = 0;\n        ry.x = tg.ry; ry.v = 0;\n        gx = tg.gx; gy = tg.gy; pa = tg.pa;\n        apply();\n        return;\n      }\n      apply();\n      raf = requestAnimationFrame(step);\n    };\n\n    wake.current = () => {\n      if (raf) return;\n      last = nowMs();\n      raf = requestAnimationFrame(step);\n    };\n    apply();\n    wake.current();\n    return () => {\n      if (raf) cancelAnimationFrame(raf);\n      raf = 0;\n      wake.current = () => {};\n    };\n  }, [reduced]);\n\n  /* A new face is wanted: aim the spring and tell the host. */\n  useEffect(() => {\n    target.current.angle = flipped ? 180 : 0;\n    wake.current();\n    if (prevFlipped.current !== flipped) {\n      prevFlipped.current = flipped;\n      onFlip.current?.(flipped);\n    }\n  }, [flipped]);\n\n  const aim = (e: PointerEvent<HTMLDivElement>) => {\n    const el = rootRef.current;\n    if (!el || reduced || e.pointerType === \"touch\") return;\n    const r = el.getBoundingClientRect();\n    if (r.width === 0 || r.height === 0) return;\n    // Layout pixels: the library scales previews with a transform.\n    const x = (e.clientX - r.left) * (el.offsetWidth / r.width);\n    const y = (e.clientY - r.top) * (el.offsetHeight / r.height);\n    const nx = Math.max(-1, Math.min(1, (x / el.offsetWidth) * 2 - 1));\n    const ny = Math.max(-1, Math.min(1, (y / el.offsetHeight) * 2 - 1));\n    const t = target.current;\n    t.ry = nx * tiltMax.current;\n    t.rx = -ny * tiltMax.current;\n    t.gx = (x / el.offsetWidth) * 100;\n    t.gy = (y / el.offsetHeight) * 100;\n    t.pa = 1;\n    wake.current();\n  };\n\n  const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n    if (trigger === \"click\" && (e.key === \"Enter\" || e.key === \" \")) {\n      e.preventDefault();\n      setClicked((v) => !v);\n    }\n  };\n\n  const rootStyle = {\n    \"--sw\": -30,\n    \"--sa\": 0,\n    \"--gx\": \"50%\",\n    \"--gy\": \"50%\",\n    \"--pa\": 0,\n  } as CSSProperties;\n\n  return (\n    <div\n      ref={rootRef}\n      tabIndex={0}\n      role={trigger === \"click\" ? \"button\" : \"group\"}\n      aria-roledescription={trigger === \"click\" ? undefined : \"flip card\"}\n      aria-pressed={trigger === \"click\" ? flipped : undefined}\n      className={`group relative block h-40 w-64 max-w-full cursor-pointer select-none [container-type:inline-size] [touch-action:manipulation] focus-visible:!outline-none${className ? \" \" + className : \"\"}`}\n      style={rootStyle}\n      onPointerDown={(e) => {\n        lastPointer.current = e.pointerType;\n      }}\n      onPointerEnter={(e) => {\n        if (e.pointerType !== \"touch\") setHovered(true);\n      }}\n      onPointerMove={aim}\n      onPointerLeave={(e) => {\n        if (e.pointerType === \"touch\") return;\n        setHovered(false);\n        const t = target.current;\n        t.rx = 0;\n        t.ry = 0;\n        t.pa = 0;\n        wake.current();\n      }}\n      onClick={() => {\n        if (trigger === \"click\") setClicked((v) => !v);\n        else if (lastPointer.current === \"touch\") setTapped((v) => !v);\n      }}\n      onKeyDown={onKeyDown}\n      onFocus={(e) => {\n        if (e.currentTarget.matches(\":focus-visible\")) setFocused(true);\n      }}\n      onBlur={() => {\n        setFocused(false);\n        setTapped(false);\n      }}\n    >\n      {/* Floor shadow: narrows and fades while the card is lifted mid-turn. */}\n      <div\n        ref={shadowRef}\n        aria-hidden\n        className=\"pointer-events-none absolute left-1/2 top-[94%] h-[15%] w-[86%] [transform-origin:50%_0%] [transform:translateX(-50%)]\"\n        style={{ background: \"radial-gradient(closest-side, rgb(0 0 0 / 0.4), rgb(0 0 0 / 0.14) 55%, rgb(0 0 0 / 0))\" }}\n      />\n      <div className=\"absolute inset-0\" style={{ perspective: \"max(900px, 230cqw)\", [\"--t\" as string]: \"clamp(6px, 2.4cqw, 16px)\" } as CSSProperties}>\n        <div ref={tiltRef} className=\"absolute inset-0 [transform-style:preserve-3d]\">\n          <div ref={flipRef} className=\"absolute inset-0 [transform-style:preserve-3d]\">\n            {reduced\n              ? null\n              : SLABS.map((s) => (\n                  <div\n                    key={s.z}\n                    aria-hidden\n                    className=\"absolute inset-px\"\n                    style={{ borderRadius: FACE_RADIUS, background: s.color, transform: `translateZ(calc(var(--t) * ${s.z.toFixed(3)}))` }}\n                  />\n                ))}\n            <Face side=\"front\" hidden={flipped} reduced={reduced} decor={front === undefined}>\n              {front ?? <span className=\"text-balance text-[clamp(14px,7cqw,44px)] font-semibold leading-tight tracking-[-0.02em]\">{frontLabel}</span>}\n            </Face>\n            <Face side=\"back\" hidden={!flipped} reduced={reduced} decor={back === undefined}>\n              {back ?? <span className=\"text-balance text-[clamp(14px,7cqw,44px)] font-semibold leading-tight tracking-[-0.02em]\">{backLabel}</span>}\n            </Face>\n          </div>\n        </div>\n      </div>\n      {/* Focus ring: two-tone so it reads on light and dark pages. */}\n      <div\n        aria-hidden\n        className=\"pointer-events-none absolute opacity-0 group-focus-visible:opacity-100\"\n        style={{ inset: -6, borderRadius: \"calc(5.2cqw + 6px)\", boxShadow: \"0 0 0 2px #fff, 0 0 0 4px #ef4444\" }}\n      />\n    </div>\n  );\n}\n","type":"registry:component","target":"components/viberdy/flip-card.tsx"}],"meta":{"tier":"free","tags":["card","flip","3d","hover","spring","glare","perspective","click","reveal"],"href":"https://viberdy.dev/library/flip-card","aiPrompt":"Create a React + Tailwind (v3.4 with the container-queries plugin, or v4) component named FlipCard in one self-contained \"use client\" file. React only, no animation library. It is a card with real thickness that turns over on a hand-written spring.\n\nProps (all optional): frontLabel = \"Hover to flip\", backLabel = \"Here's the back\", trigger = \"hover\" | \"click\" (default \"hover\"), front and back (ReactNode replacing the labels), tilt = 6 (degrees of lean toward the pointer, 0 = off), className (merged onto the root), onFlipChange(flipped).\n\nStructure. Root div: tabIndex 0, relative block h-40 w-64 max-w-full, cursor-pointer, select-none, touch-action manipulation, container-type inline-size (so every size inside is in cqw and the card scales with its width; callers resize it with className). Inside it: (1) a floor shadow, absolute left 50%, top 94%, 86% wide x 15% tall, transform-origin 50% 0, radial-gradient(closest-side, rgb(0 0 0/.4), rgb(0 0 0/.14) 55%, transparent); (2) an absolute inset-0 perspective layer with perspective max(900px, 230cqw) and --t: clamp(6px, 2.4cqw, 16px) (the card thickness); inside it a tilt div (preserve-3d), inside that a flipper div (preserve-3d) holding 10 rim slabs and the two faces; (3) a focus ring element, inset -6px, radius calc(5.2cqw + 6px), box-shadow 0 0 0 2px #fff, 0 0 0 4px #ef4444, opacity 0 and 1 on group-focus-visible. Remove the default outline on the root (focus-visible:outline-none, important if your CSS has a global outline).\n\nFaces: absolute inset-0, overflow hidden, border-radius 5.2cqw, backface-visibility hidden (also the -webkit- prefix). Front: translateZ(var(--t)/2); background radial-gradient(120% 90% at 16% 0%, white/10%, transparent 55%) over linear-gradient(155deg, #1d1e23, #121317 55%, #0d0e11); inset 1px white/10% ring plus an inset 0 1px white/16% top light; text #f4f4f5. Back: rotateY(180deg) translateZ(var(--t)/2); radial-gradient(110% 80% at 85% 0%, white/20%, transparent 52%) over linear-gradient(150deg, #ff5b49, #e5332b 46%, #a1161d); inset ring white/18% and top light white/30%; text white; four faint concentric rings (stroke white 16%, 0.5 wide) centred near the bottom right in an SVG. Label: centred, px 8cqw, font-size clamp(14px, 7cqw, 44px), weight 600, tracking -0.02em, text-balance. Default front also has a tiny double-ring mark top left and a flip glyph bottom right (40% opacity, 5cqw), only when no custom front is passed. Slabs: 10 absolute inset-1px elements with the face radius, translateZ(var(--t) * k) for k from -0.405 to 0.405 in equal steps, colours stepping from rgb(40 41 47) to rgb(134 28 30). Each face carries a glare overlay (pointer-events none): radial-gradient(60% 80% at var(--gx) var(--gy), rgb(255 255 255 / calc(var(--pa) * .16)), transparent 70%) plus linear-gradient(105deg, transparent calc(var(--sw) * 1% - 16%), rgb(255 255 255 / var(--sa)) calc(var(--sw) * 1%), transparent calc(var(--sw) * 1% + 16%)). The root holds the variables --sw, --sa, --gx, --gy, --pa.\n\nState. flipped = trigger \"click\" ? clicked : (hovered || focusVisible || tapped). Hover mode: pointerenter/leave from mouse and pen set hovered; focus counts only when :focus-visible matches; on touch a tap (click event after a touch pointerdown) toggles tapped, and blur clears tapped. Click mode: click, tap, Enter or Space (preventDefault) toggle clicked. role is \"button\" with aria-pressed in click mode, otherwise role \"group\" with aria-roledescription \"flip card\". The face turned away gets aria-hidden. Call onFlipChange when flipped changes.\n\nMotion, one rAF loop inside a mount effect that runs only while something moves and sleeps when settled (all within tiny epsilons). Semi-implicit Euler, two sub-steps per frame, dt clamped to 32ms. Flip angle spring toward 0 or 180: stiffness 170, damping 20.4 (one overshoot of about 2 degrees). Lean springs (rotateX, rotateY toward the pointer, +-tilt degrees, from the pointer position inside the root measured in layout pixels: (clientX - rect.left) * (offsetWidth / rect.width)), stiffness 120, damping 17; pointer lean is mouse and pen only; leave returns it to 0. Glare position (--gx, --gy as percentages) and strength (--pa 0..1 while the pointer is over the card) ease with 1 - exp(-dt*14). Every frame write: flipper transform translateZ(28px * |sin a|) rotateY(a); tilt transform rotateX(rx) rotateY(ry); shadow transform translateX(-50%) scale(0.4 + 0.6|cos a|, 1 - 0.3|sin a|) and opacity 1 - 0.6|sin a|; sweep with p = a/180, q = p <= .5 ? p : p - .5: --sw = -30 + 260q, --sa = 0.5 * max(0, sin(2 pi q)). Those inline styles belong to the loop, not to React.\n\nReduced motion (matchMedia prefers-reduced-motion, via useSyncExternalStore): no loop, no slabs, no glare, no 3D transforms; both faces stacked flat and crossfaded with opacity over 220ms, the hidden one pointer-events none.\n\nTouch: nothing depends on hover, tapping toggles. Keep the file free of site tokens: paint everything with explicit colours.","license":"https://viberdy.dev/license"}}