{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "media-tile",
  "title": "MediaTile",
  "description": "A tile for one live picture in a call: a person's camera, their photo when the camera is off, or a shared screen.",
  "registryDependencies": [
    "@ouro/avatar",
    "@ouro/ax-component",
    "@ouro/lib-class-name-check",
    "@ouro/lib-cn",
    "@ouro/lib-env",
    "@ouro/lib-refs",
    "@ouro/lib-use-dev-messages",
    "@ouro/toggle"
  ],
  "files": [
    {
      "path": "registry/ouro/components/ouro/media-tile/media-tile-styles.ts",
      "content": "export {\n  avatarSizeFor,\n  connections,\n  controlsClass,\n  defaultLabels,\n  fitClasses,\n  HYSTERESIS_DEFAULT,\n  mediaClass,\n  mediaTileAx,\n  plateClass,\n  ringClass,\n  sentenceFor,\n  smallPhotos,\n  sources,\n  tileClass,\n  upperFirst,\n  VISIBLE_RATIO,\n};\nexport type { MediaTileConnection, MediaTileHysteresis, MediaTileLabels, MediaTileSentence };\n\n// Class strings, values and the agent side for MediaTile, apart from the component so its file\n// exports only components (React Fast Refresh). Class strings are literal so the app's Tailwind\n// finds them when it compiles.\n\nimport { defineComponentAx } from \"@/registry/ouro/ax/component\";\n\n/**\n * How much of a tile must be on screen before it counts as seen: a tenth of it, so a sliver at\n * the edge of a scrolled strip doesn't keep a picture coming. @internal\n * @claim \"How much of a tile must be\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile visibility > counts a tile as seen only once a tenth of it is on screen, so a sliver doesn't count)\n */\nconst VISIBLE_RATIO = 0.1;\n\n/**\n * How long, in milliseconds, someone must speak before the ring comes on, and be quiet before it\n * goes. @internal\n * @claim \"How long, in milliseconds, someone must\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile speaking > turns the ring on after 300ms of speaking and off after 600ms of quiet, and ignores a blip shorter than that)\n */\nconst HYSTERESIS_DEFAULT = { on: 300, off: 600 } as const;\n\n/**\n * How long someone must speak before the speaking ring comes on (`on`), and be quiet before it\n * goes (`off`), in milliseconds, so a cough doesn't flash it.\n */\ninterface MediaTileHysteresis {\n  /** Milliseconds of speaking before the ring comes on. @default 300 */\n  on?: number | undefined;\n  /** Milliseconds of quiet before the ring goes. @default 600 */\n  off?: number | undefined;\n}\n\n/** How well the person's media is getting through. Only `poor` shows: a fair connection still carries the call. */\ntype MediaTileConnection = \"good\" | \"fair\" | \"poor\";\n\n/** The connections a tile knows. @internal */\nconst connections = [\"good\", \"fair\", \"poor\"] as const;\n\n/** Where the picture comes from. @internal */\nconst sources = [\"camera\", \"screen\"] as const;\n\n/**\n * The words a tile is read in, one sentence per tile (\"Mara Lind, speaking, camera on, hand\n * raised\"), and the words of its controls. Translate them with the rest of your interface.\n */\ninterface MediaTileLabels {\n  /** Read while the speaking ring is on: \"speaking\". */\n  speaking: string;\n  /** Read while the person is muted: \"muted\". It is also the muted glyph's tooltip. */\n  muted: string;\n  /** Read while the camera is on: \"camera on\". */\n  cameraOn: string;\n  /** Read while the camera is off: \"camera off\". */\n  cameraOff: string;\n  /** Read for a tile whose picture is a shared screen: \"shared screen\". */\n  screen: string;\n  /** Read while the picture is paused, when `paused` gives no reason of its own: \"video paused\". */\n  paused: string;\n  /** Read while the person's hand is up: \"hand raised\". It is also the hand's tooltip. */\n  handRaised: string;\n  /** Read while the connection is poor: \"poor connection\". It is also the glyph's tooltip. */\n  poorConnection: string;\n  /** Read, and shown on the name plate after the name, while the person presents: \"presenting\". */\n  presenting: string;\n  /** Read while the tile is pinned: \"pinned\". */\n  pinned: string;\n  /** The Pin control's name, which stays the same pinned or not (it is a toggle): \"Pin\". */\n  pin: string;\n}\n\n/**\n * The words a tile uses without `labels`. @internal\n * @claim \"The words a tile uses without\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > reads as one sentence: who, then what they are doing, in the order a person listens for it)\n */\nconst defaultLabels: MediaTileLabels = {\n  speaking: \"speaking\",\n  muted: \"muted\",\n  cameraOn: \"camera on\",\n  cameraOff: \"camera off\",\n  screen: \"shared screen\",\n  paused: \"video paused\",\n  handRaised: \"hand raised\",\n  poorConnection: \"poor connection\",\n  presenting: \"presenting\",\n  pinned: \"pinned\",\n  pin: \"Pin\",\n};\n\n/** What a tile's sentence says. @internal */\ninterface MediaTileSentence {\n  name: string;\n  presenting: boolean;\n  speaking: boolean;\n  muted: boolean;\n  source: (typeof sources)[number];\n  cameraOn: boolean;\n  /** The words for a paused picture, or `undefined` while it plays. */\n  paused: string | undefined;\n  handRaised: boolean;\n  connection: MediaTileConnection;\n  pinned: boolean;\n}\n\n/**\n * A tile as one sentence: the name, then presenting, speaking, muted, the picture (camera on or\n * off, a shared screen, or paused), a raised hand, a poor connection and pinned, in that order.\n * @internal\n * @claim \"A tile as one sentence: the\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > reads as one sentence: who, then what they are doing, in the order a person listens for it)\n */\nfunction sentenceFor(tile: MediaTileSentence, labels: MediaTileLabels): string {\n  const picture = tile.paused ?? (tile.source === \"screen\" ? labels.screen : tile.cameraOn ? labels.cameraOn : labels.cameraOff);\n  return [\n    tile.name,\n    tile.presenting && labels.presenting,\n    tile.speaking && labels.speaking,\n    tile.muted && labels.muted,\n    picture,\n    tile.handRaised && labels.handRaised,\n    tile.connection === \"poor\" && labels.poorConnection,\n    tile.pinned && labels.pinned,\n  ]\n    .filter(Boolean)\n    .join(\", \");\n}\n\n/** Words with their first letter upper case, for a tooltip or a name plate: \"Presenting\". @internal */\nfunction upperFirst(words: string): string {\n  return words.charAt(0).toLocaleUpperCase() + words.slice(1);\n}\n\n/**\n * The photo's size for a tile whose shorter side is this many pixels: 32px under 96, 48px\n * under 160, 64px under 280, 72px under 440, and 112px from there. @internal\n * @claim \"The photo's size for a tile\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > grows the photo with the tile, 64px until the tile is measured)\n */\nfunction avatarSizeFor(width: number, height: number): \"sm\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\" {\n  const side = Math.min(width, height);\n  if (side < 96) return \"sm\";\n  if (side < 160) return \"lg\";\n  if (side < 280) return \"xl\";\n  return side < 440 ? \"2xl\" : \"3xl\";\n}\n\n/**\n * The photo sizes, 48px and smaller, beside which the paused glyph sits rather than over the\n * corner, where it would cover the initials. @internal\n * @claim \"beside which the paused glyph sits\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > keeps the paused glyph off the initials: beside a small photo, on the corner of a large one)\n */\nconst smallPhotos: readonly string[] = [\"xs\", \"sm\", \"md\", \"lg\"];\n\n/**\n * The tile: a 16:9 box in the muted surface with rounded corners, that clips its picture. Its\n * size is the app's layout (`aspect-square`, `h-full`, a grid cell). @internal\n * @claim \"The tile: a 16:9 box in\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > is a 16:9 tile as wide as its container, and keeps layout classes, ids, refs and div attributes)\n */\nconst tileClass =\n  \"@container/tile group/tile relative isolate box-border block aspect-video w-full overflow-hidden rounded-ouro-xl \" +\n  \"bg-muted text-foreground forced-colors:border forced-colors:border-solid forced-colors:border-[CanvasText]\";\n\n/** The layer the app's media fills, hidden but still mounted while the photo shows, so a `<video>` keeps its stream. @internal */\nconst mediaClass = \"absolute inset-0 *:block *:size-full\";\n\n/**\n * How the picture fills the tile: a camera is cropped to fill it, a share is never cropped. @internal\n * @claim \"How the picture fills the tile:\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > crops a camera to fill the tile and never crops a share)\n */\nconst fitClasses = { cover: \"*:object-cover\", contain: \"*:object-contain\" } as const;\n\n/**\n * The name plate's, the glyphs' and the controls' fill: the surface at about three quarters, solid\n * where the person asks for less transparency or more contrast, and never a backdrop blur, which\n * would repaint over moving video every frame. @internal\n * @claim \"solid where the person asks for less\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > puts the name plate on a translucent fill with no blur, solid with reduced transparency)\n */\nconst plateClass =\n  \"box-border border border-solid border-transparent text-foreground \" +\n  \"bg-[color-mix(in_oklab,var(--background)_76%,transparent)] \" +\n  \"[@media(prefers-reduced-transparency:reduce)]:bg-background contrast-more:bg-background contrast-more:border-foreground \" +\n  \"forced-colors:border-[CanvasText]\";\n\n/**\n * The speaking ring: an inset box-shadow over the picture in `--ouro-media-tile-ring` (default\n * the theme's `--primary`), with a hairline of the surface inside it so it shows on any picture.\n * It fades in and out over `--ouro-duration-fast`; with reduced motion it is steady on or off,\n * and under forced colours it is a Highlight outline. @internal\n * @claim \"The speaking ring: an inset box-shadow\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile speaking > draws the ring as an inset box-shadow that never moves the layout, and as an outline under forced colours)\n */\nconst ringClass =\n  \"pointer-events-none absolute inset-0 z-10 rounded-[inherit] opacity-0 \" +\n  \"shadow-[inset_0_0_0_3px_var(--ouro-media-tile-ring,var(--primary)),inset_0_0_0_4px_var(--background)] \" +\n  \"transition-opacity duration-(--ouro-duration-fast) ease-(--ouro-ease-out) data-highlighted:opacity-100 motion-reduce:transition-none \" +\n  \"forced-colors:shadow-none forced-colors:outline-3 forced-colors:outline-solid forced-colors:outline-[Highlight] forced-colors:-outline-offset-3\";\n\n/**\n * The tile's controls in its top end corner: shown while a fine pointer is over the tile, while\n * focus is inside it, while it is pinned, and always on a coarse pointer, where there is no\n * hover. @internal\n * @claim \"The tile's controls in its top\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile controls > shows its controls while focus is inside the tile or it is pinned, and hides them otherwise)\n * @claim \"The tile's controls in its top\" registry/ouro/components/ouro/media-tile/media-tile.touch.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.touch.test.tsx::MediaTile on a touch screen > always shows its controls, and gives the Pin toggle a 44px target)\n */\nconst controlsClass =\n  \"absolute end-2 top-2 z-20 flex items-center gap-1 rounded-ouro-lg p-0.5 \" +\n  \"opacity-0 transition-opacity duration-(--ouro-duration-fast) ease-[ease] \" +\n  \"pointer-fine:group-hover/tile:opacity-100 group-focus-within/tile:opacity-100 group-focus-within/tile:transition-none \" +\n  \"data-pinned:opacity-100 pointer-coarse:opacity-100\";\n\n/**\n * MediaTile's agent side, declared with Ouro AX's `defineComponentAx`: it reads who is in the tile and what they are doing,\n * and an agent may pin the tile, which only the person sees.\n *\n * @example\n * mediaTileAx.actions[0].id; // \"pin\"\n * @claim \"it reads who is in the tile\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > declares its agent side: a participant read anyone may take, and a private pin an agent may take)\n */\nconst mediaTileAx = defineComponentAx({\n  component: \"MediaTile\",\n  reads: [\n    {\n      id: \"participant\",\n      summary: \"Who is in the tile, and what they are doing.\",\n      fields: [\"name\", \"muted\", \"camera\", \"speaking\", \"handRaised\", \"connection\"],\n      consent: \"none\",\n    },\n  ],\n  actions: [{ id: \"pin\", summary: \"Keep this tile in the person's main view.\", effect: \"private\", agent: true }],\n});\n",
      "type": "registry:ui",
      "target": "@components/ouro/media-tile/media-tile-styles.ts"
    },
    {
      "path": "registry/ouro/components/ouro/media-tile/media-tile.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useLayoutEffect, useRef, useState, type HTMLAttributes, type JSX, type ReactNode, type Ref, type SVGProps } from \"react\";\nimport { Avatar, type AvatarOwnProps } from \"@/registry/ouro/components/ouro/avatar/avatar\";\nimport {\n  avatarSizeFor,\n  connections,\n  controlsClass,\n  defaultLabels,\n  fitClasses,\n  HYSTERESIS_DEFAULT,\n  mediaClass,\n  plateClass,\n  ringClass,\n  sentenceFor,\n  smallPhotos,\n  sources,\n  tileClass,\n  upperFirst,\n  VISIBLE_RATIO,\n  type MediaTileConnection,\n  type MediaTileHysteresis,\n  type MediaTileLabels,\n} from \"@/registry/ouro/components/ouro/media-tile/media-tile-styles\";\nimport { Toggle } from \"@/registry/ouro/components/ouro/toggle/toggle\";\nimport { useAppearanceClassNameCheck } from \"@/registry/ouro/lib/ouro/class-name-check\";\nimport { cn } from \"@/registry/ouro/lib/ouro/cn\";\nimport { useMergedRef } from \"@/registry/ouro/lib/ouro/refs\";\nimport { useDevWarnings } from \"@/registry/ouro/lib/ouro/use-dev-messages\";\n\nexport type { MediaTileConnection, MediaTileHysteresis, MediaTileLabels };\n\n/** The Avatar props a tile passes to the photo it shows in place of the picture. Its name is the tile's. */\nexport type MediaTileAvatar = Pick<AvatarOwnProps, \"src\" | \"initials\" | \"icon\" | \"shape\" | \"color\" | \"idForColor\" | \"size\">;\n\n/** The props MediaTile adds to the `<div>` attributes it passes through. */\nexport interface MediaTileOwnProps {\n  /**\n   * Who is in the tile: \"Mara Lind\". The name plate shows it, its photo's initials come from it,\n   * and it starts the sentence screen readers hear. Required, so no tile is silent.\n   * @claim \"Required, so no tile is silent.\" registry/ouro/components/ouro/media-tile/media-tile.test-d.ts verify:fileLine(registry/ouro/components/ouro/media-tile/media-tile.test-d.ts, /expectTypeOf<\\{ speaking: true \\}>\\(\\)\\.not\\.toExtend<MediaTileProps>/)\n   */\n  name: string;\n  /**\n   * The picture: your `<video>` (or `<canvas>`, or `<img>`), which fills the tile. MediaTile\n   * renders no media of its own, and keeps yours mounted while it shows the photo instead, so a\n   * `<video>` keeps its stream when the camera goes off and on.\n   * @claim \"and keeps yours mounted while it\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > shows the app's media while the camera is on, and the photo while it is off or paused, keeping the media mounted)\n   */\n  children?: ReactNode;\n  /**\n   * Whether the person's camera is on. While it is off the tile shows their photo, or their\n   * initials, from `avatar`. Defaults to whether there are `children`.\n   * @claim \"While it is off the tile shows\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > shows the app's media while the camera is on, and the photo while it is off or paused, keeping the media mounted)\n   */\n  cameraOn?: boolean | undefined;\n  /**\n   * Where the picture comes from: `camera`, or `screen` for a shared screen or window, which is\n   * read as \"shared screen\" and is never cropped. @default \"camera\"\n   * @claim \"Where the picture comes from:\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > crops a camera to fill the tile and never crops a share)\n   */\n  source?: \"camera\" | \"screen\" | (string & { 'Use \"camera\" or \"screen\"; a shared window is \"screen\"': never }) | undefined;\n  /**\n   * How the picture fills the tile: `cover` crops it to fill (a camera), `contain` shows all of\n   * it with bars (a share). Defaults to `cover` for a camera and `contain` for a screen.\n   * @claim \"How the picture fills the tile:\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > crops a camera to fill the tile and never crops a share)\n   */\n  fit?: \"cover\" | \"contain\" | (string & { 'Use \"cover\" or \"contain\"': never }) | undefined;\n  /**\n   * The person's photo, shown in place of the picture: Avatar's props, such as `{ src, idForColor }`.\n   * Without it the photo is their initials. It grows with the tile unless you pass `size`.\n   */\n  avatar?: MediaTileAvatar | undefined;\n  /** Whether the person is muted: a crossed-out microphone on the name plate, and \"muted\" in the sentence. */\n  muted?: boolean | undefined;\n  /** Whether the person's hand is up: a hand in the top start corner, and \"hand raised\" in the sentence. */\n  handRaised?: boolean | undefined;\n  /**\n   * How well the person's media is getting through. `poor` shows a glyph in the top start\n   * corner and is read as \"poor connection\"; `good` and `fair` show nothing, since a fair\n   * connection still carries the call. @default \"good\"\n   * @claim \"`good` and `fair` show nothing, since\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > shows a glyph for a poor connection only, and the hand while it is up)\n   */\n  connection?: MediaTileConnection | (string & { 'Use \"good\", \"fair\" or \"poor\"': never }) | undefined;\n  /**\n   * The picture is paused (your app stopped receiving it, to save bandwidth or power): the tile\n   * shows the photo with a pause glyph. Pass the reason as words to say it, such as\n   * `paused=\"video paused to save power\"`; `true` says \"video paused\".\n   * @claim \"Pass the reason as words to say\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > shows the app's media while the camera is on, and the photo while it is off or paused, keeping the media mounted)\n   */\n  paused?: boolean | string | undefined;\n  /**\n   * Whether the person is speaking now: the app's speaker detection. The ring and the sentence\n   * follow it after `hysteresis`, so a cough doesn't flash the ring.\n   */\n  speaking?: boolean | undefined;\n  /**\n   * How long, in milliseconds, someone must speak before the ring comes on (`on`), and be quiet\n   * before it goes (`off`). The ring eases between the two states and never throbs with the\n   * voice. @default { on: 300, off: 600 }\n   * @claim \"{ on: 300, off: 600 }\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile speaking > turns the ring on after 300ms of speaking and off after 600ms of quiet, and ignores a blip shorter than that)\n   * @claim \"The ring eases between the two\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile motion > fades the ring in over the fast duration, and turns it on at once with reduced motion)\n   * @claim \"The ring eases between the two\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile speaking > turns the ring on after 300ms of speaking and off after 600ms of quiet, and ignores a blip shorter than that)\n   * @claim \"How long, in milliseconds, someone must\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile speaking > turns the ring on after 300ms of speaking and off after 600ms of quiet, and ignores a blip shorter than that)\n   * @claim \"How long, in milliseconds, someone must\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile speaking > takes its own hysteresis, and turns at once with 0)\n   */\n  hysteresis?: MediaTileHysteresis | undefined;\n  /**\n   * Whether to draw the speaking ring. Pass `ring={false}` for a stage tile, which already says\n   * who is speaking; the sentence still says \"speaking\". @default true\n   * @claim \"Pass `ring={false}` for a stage tile,\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile speaking > draws no ring with ring={false}, and still says speaking)\n   */\n  ring?: boolean | undefined;\n  /** Whether the tile is pinned: a pin on the name plate (or the Pin control pressed), and \"pinned\" in the sentence. */\n  pinned?: boolean | undefined;\n  /**\n   * Shows a Pin toggle in the tile's top end corner, with `data-ax-action=\"pin\"`, and is called\n   * with the new state when it is pressed. Pinning changes only the person's own view.\n   * @claim \"Shows a Pin toggle in the tile's\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile controls > shows a Pin toggle that carries the pin action, pressed while pinned)\n   */\n  onPinnedChange?: ((pinned: boolean) => void) | undefined;\n  /** Whether the person is presenting: \"Presenting\" after the name on the name plate, and in the sentence. */\n  presenting?: boolean | undefined;\n  /**\n   * The tile's own controls, such as a `Menu` with Pin, Spotlight and Remove, in the top end\n   * corner after the Pin toggle. They show while the pointer is over the tile or focus is in\n   * it, and always on a touch screen. Give a Pin item of your own `data-ax-action=\"pin\"`.\n   * @claim \"They show while the pointer is over\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile controls > shows its controls while focus is inside the tile or it is pinned, and hides them otherwise)\n   * @claim \"and always on a touch screen\" registry/ouro/components/ouro/media-tile/media-tile.touch.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.touch.test.tsx::MediaTile on a touch screen > always shows its controls, and gives the Pin toggle a 44px target)\n   */\n  actions?: ReactNode;\n  /**\n   * Called with whether the tile can be seen and its size in CSS pixels, rounded up, whenever\n   * either changes, so you can stop receiving a picture nobody sees and ask for a picture\n   * size at or above the tile's (multiply by `devicePixelRatio` for device pixels). A tile counts\n   * as seen once a tenth of it is on screen, so a sliver doesn't count, and not while the page\n   * is hidden. The first call waits until the browser has said whether the tile is on screen.\n   * Changes are gathered once a frame, and it is never called twice with the same values.\n   * @claim \"The first call waits until the\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile visibility > calls nothing until the browser has said whether the tile is on screen, so it never starts unseen by mistake)\n   * @claim \"A tile counts as seen once a\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile visibility > counts a tile as seen only once a tenth of it is on screen, so a sliver doesn't count)\n   * @claim \"and not while the page is hidden\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile visibility > reports a hidden page as unseen at once, and seen again when it shows)\n   * @claim \"Changes are gathered once a frame, and\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile visibility > reports its size rounded up once a frame, never twice with the same values, whatever the callback)\n   */\n  onVisibilityChange?: ((visible: boolean, width: number, height: number) => void) | undefined;\n  /**\n   * The words the tile is read in, and its controls' names. Pass the ones you translate; the\n   * rest stay English.\n   * @claim \"Pass the ones you translate; the rest\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > reads in the words labels gives, and English for the rest)\n   */\n  labels?: Partial<MediaTileLabels> | undefined;\n  /**\n   * Layout only: width, grid placement, another shape (`aspect-square`, `h-full`). The tile is\n   * 16:9 and as wide as its container by default. Appearance classes warn in development;\n   * set `--ouro-media-tile-ring` for the ring's colour.\n   * @claim \"The tile is 16:9 and as\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > is a 16:9 tile as wide as its container, and keeps layout classes, ids, refs and div attributes)\n   */\n  className?: string | undefined;\n  ref?: Ref<HTMLDivElement> | undefined;\n\n  /** Not a prop. The ring is on or off, from your speaker detection: `<MediaTile speaking={level > 0.1}>`. */\n  level?: { \"Use <MediaTile speaking={level > 0.1}>\": never };\n  /** Not a prop. Ouro UI uses `muted`: `<MediaTile muted>`. */\n  isMuted?: { \"Use <MediaTile muted>\": never };\n  /** Not a prop. Ouro UI uses `name`: `<MediaTile name=\"Mara Lind\">`. */\n  label?: { 'Use <MediaTile name=\"Mara Lind\">': never };\n  /** Not a prop. Ouro UI uses `fit`: `<MediaTile fit=\"contain\">`. */\n  objectFit?: { 'Use <MediaTile fit=\"contain\">': never };\n  /** Not a prop. Pass the picture as children, and the photo as `avatar`: `<MediaTile avatar={{ src: photoUrl }}>`. */\n  src?: { \"Use <MediaTile avatar={{ src: photoUrl }}>\": never };\n}\n\n/** Props for {@link MediaTile}: its own props and the `<div>` attributes it passes through. */\nexport type MediaTileProps = Omit<HTMLAttributes<HTMLDivElement>, keyof MediaTileOwnProps | \"role\" | \"aria-label\" | \"aria-labelledby\"> & MediaTileOwnProps;\n\nconst line = { fill: \"none\", stroke: \"currentColor\", strokeWidth: 2, strokeLinecap: \"round\", strokeLinejoin: \"round\" } as const;\nconst glyphClass = \"block size-3.5 shrink-0 @2xs/tile:size-4\";\n\nfunction MicOffGlyph(): JSX.Element {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" className={glyphClass}>\n      <rect x=\"9\" y=\"3\" width=\"6\" height=\"11\" rx=\"3\" {...line} />\n      <path d=\"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M4 4l16 16\" {...line} />\n    </svg>\n  );\n}\n\nfunction HandGlyph(): JSX.Element {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" className={glyphClass}>\n      <path d=\"M8 12V5.5a1.5 1.5 0 0 1 3 0V11m0-6.5a1.5 1.5 0 0 1 3 0V11m0-5a1.5 1.5 0 0 1 3 0v7.5a7 7 0 0 1-7 7 6.5 6.5 0 0 1-5.2-2.6L3.6 15a1.5 1.5 0 0 1 2.4-1.8L8 15.5\" {...line} />\n    </svg>\n  );\n}\n\nfunction SignalGlyph(): JSX.Element {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" className={glyphClass}>\n      <path d=\"M5 20v-4\" {...line} strokeWidth={3} />\n      <path d=\"M12 20v-9M19 20V5\" {...line} strokeWidth={3} strokeOpacity={0.3} />\n    </svg>\n  );\n}\n\nfunction PauseGlyph(): JSX.Element {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" className={glyphClass}>\n      <path d=\"M9 6.5v11M15 6.5v11\" {...line} strokeWidth={2.5} />\n    </svg>\n  );\n}\n\nfunction PinGlyph(props: SVGProps<SVGSVGElement>): JSX.Element {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" className={glyphClass} {...props}>\n      <path d=\"M14 3.5l6.5 6.5M17.25 6.75 13 11l1 5-1.5 1.5-7-7L7 9l5 1 4.25-4.25M8.5 15.5 4 20\" {...line} />\n    </svg>\n  );\n}\n\n/** A value from a list, or `undefined` when it is not one. */\nfunction oneOf<T extends string>(list: readonly T[], value: unknown): T | undefined {\n  return list.find((entry) => entry === value);\n}\n\nfunction millisecondsOf(value: number | undefined): number | undefined {\n  return typeof value === \"number\" && value >= 0 ? value : undefined;\n}\n\n/** `value` once it has held for `onDelay` (turning true) or `offDelay` (turning false), in milliseconds. */\nfunction useHeld(value: boolean, onDelay: number, offDelay: number): boolean {\n  const [held, setHeld] = useState(value);\n  useEffect(() => {\n    // Stryker disable next-line ConditionalExpression: a timer that sets the value it already holds changes nothing.\n    if (held === value) return;\n    const timer = setTimeout(() => setHeld(value), value ? onDelay : offDelay);\n    return () => clearTimeout(timer);\n  }, [value, held, onDelay, offDelay]);\n  return held;\n}\n\n/**\n * Watches the tile's size (ResizeObserver) and, with `report`, whether it can be seen\n * (IntersectionObserver and the page's visibility), gathering the changes once a frame. Returns\n * the photo size for the tile and whether its name is cut short.\n */\nfunction useTileObservers(\n  tile: { current: HTMLDivElement | null },\n  nameRef: { current: HTMLSpanElement | null },\n  report: MediaTileOwnProps[\"onVisibilityChange\"],\n  name: string,\n  presenting: boolean,\n): { photoSize: ReturnType<typeof avatarSizeFor>; truncated: boolean } {\n  const [photoSize, setPhotoSize] = useState<ReturnType<typeof avatarSizeFor>>(\"xl\");\n  // Stryker disable next-line BooleanLiteral: the layout effect below measures the name before the first paint.\n  const [truncated, setTruncated] = useState(false);\n  // The latest callback, so a new function each render neither resubscribes nor reports again.\n  const reportRef = useRef(report);\n  useLayoutEffect(() => {\n    reportRef.current = report;\n  });\n  // A longer name, or \"Presenting\" after it, can cut the name short without a resize.\n  useLayoutEffect(() => {\n    const element = nameRef.current!;\n    setTruncated(element.scrollWidth > element.clientWidth);\n  }, [nameRef, name, presenting]);\n  // Stryker disable next-line ConditionalExpression: without a callback nothing reads whether the tile is seen, so observing it too changes only the cost.\n  const watching = report !== undefined;\n  useEffect(() => {\n    const element = tile.current!;\n    let frame = 0;\n    let width = 0;\n    let height = 0;\n    // Stryker disable next-line BooleanLiteral: nothing reads it until the first intersection sets it.\n    let seen = false;\n    // A resize can reach a frame before the first intersection does; until then, whether the tile is seen is unknown.\n    let known = false;\n    // Stryker disable next-line StringLiteral: no report's key is either start, so the first report always goes out.\n    let last = \"\";\n    const flush = () => {\n      frame = 0;\n      setPhotoSize(avatarSizeFor(width, height));\n      const plateName = nameRef.current!;\n      setTruncated(plateName.scrollWidth > plateName.clientWidth);\n      const call = reportRef.current;\n      if (!call || !known) return;\n      const visible = seen && document.visibilityState !== \"hidden\";\n      const key = `${visible} ${width} ${height}`;\n      if (key === last) return;\n      last = key;\n      call(visible, width, height);\n    };\n    const schedule = () => {\n      frame ||= requestAnimationFrame(flush);\n    };\n    const resize = new ResizeObserver(([entry]) => {\n      const box = entry!.borderBoxSize[0]!;\n      width = Math.ceil(box.inlineSize);\n      height = Math.ceil(box.blockSize);\n      schedule();\n    });\n    resize.observe(element);\n    let intersection: IntersectionObserver | undefined;\n    // Stryker disable next-line ConditionalExpression: without a callback nothing reads whether the tile is seen, so observing it too changes only the cost.\n    if (watching) {\n      intersection = new IntersectionObserver(\n        (entries) => {\n          // A busy page can queue several entries before this runs, oldest first; only the newest is where the tile is now.\n          const entry = entries[entries.length - 1]!;\n          // Stryker disable next-line LogicalOperator,ConditionalExpression,EqualityOperator: with the one threshold at VISIBLE_RATIO, Chromium and WebKit already report isIntersecting false below it; the ratio guards an engine that does not.\n          seen = entry.isIntersecting && entry.intersectionRatio >= VISIBLE_RATIO;\n          known = true;\n          schedule();\n        },\n        { threshold: [VISIBLE_RATIO] },\n      );\n      intersection.observe(element);\n    }\n    // A hidden page runs no animation frames, so its change is reported at once.\n    const onPageVisibility = () => {\n      // Stryker disable next-line CallExpression: a frame left waiting runs the same flush again, which reports nothing new.\n      cancelAnimationFrame(frame);\n      flush();\n    };\n    document.addEventListener(\"visibilitychange\", onPageVisibility);\n    return () => {\n      cancelAnimationFrame(frame);\n      resize.disconnect();\n      intersection?.disconnect();\n      document.removeEventListener(\"visibilitychange\", onPageVisibility);\n    };\n  }, [tile, nameRef, watching]);\n  return { photoSize, truncated };\n}\n\n/**\n * A tile for one live picture in a call: a person's camera, their photo when the camera is off,\n * or a shared screen. Pass your `<video>` as children; MediaTile renders no media itself. Over\n * the picture it draws a name plate in the bottom start corner, with a crossed-out microphone\n * while the person is muted and \"Presenting\" after the name, a raised hand and a poor-connection\n * glyph in the top start corner, and the speaking ring.\n *\n * The tile reads as one sentence: \"Mara Lind, speaking, camera on, hand raised\". It is a group\n * with that name, and nothing in it is read again. The ring is an inset box-shadow over the\n * picture, so it never moves the layout. It has two states, speaking or not, held for\n * `hysteresis` and eased between over `--ouro-duration-fast`; it never throbs with the voice.\n * With reduced motion it is steady on or off, and under forced colours it is an outline.\n *\n * The name plate sits on a solid translucent fill with no backdrop blur, which would repaint\n * over moving video every frame; with reduced transparency or more contrast the fill is solid.\n * A name too long for the plate is cut short, with the whole name in its tooltip.\n *\n * `onVisibilityChange` tells you whether the tile can be seen and its size, from\n * IntersectionObserver and ResizeObserver, once a frame and only when something changed, so you\n * can stop receiving pictures nobody sees and ask for the smallest size at or above the tile's.\n *\n * Its agent side, `mediaTileAx` in `media-tile-styles.ts`, declares one read, `participant`\n * (name, muted, camera, speaking, raised hand and connection, which anyone may read, since the\n * tile shows them to everyone in the call), and one action, `pin`, which only changes the\n * person's own view, so an agent may take it. The Pin toggle carries `data-ax-action=\"pin\"`.\n *\n * Use `Avatar` instead for a person without live media, and `AspectRatio` for plain media.\n *\n * @claim \"The tile reads as one sentence:\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > reads as one sentence: who, then what they are doing, in the order a person listens for it)\n * @claim \"It is a group with that name,\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > reads as one sentence: who, then what they are doing, in the order a person listens for it)\n * @claim \"The ring is an inset box-shadow\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile speaking > draws the ring as an inset box-shadow that never moves the layout, and as an outline under forced colours)\n * @claim \"It has two states, speaking or\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile motion > fades the ring in over the fast duration, and turns it on at once with reduced motion)\n * @claim \"With reduced motion it is steady\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile motion > fades the ring in over the fast duration, and turns it on at once with reduced motion)\n * @claim \"The name plate sits on a\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > puts the name plate on a translucent fill with no blur, solid with reduced transparency)\n * @claim \"A name too long for the\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > cuts a long name short on a small tile, with the whole name in its tooltip)\n * @claim \"`onVisibilityChange` tells you whether the\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile visibility > reports its size rounded up once a frame, never twice with the same values, whatever the callback)\n * @claim \"Its agent side, `mediaTileAx` in\" registry/ouro/components/ouro/media-tile/media-tile.test.tsx verify:testExists(registry/ouro/components/ouro/media-tile/media-tile.test.tsx::MediaTile > declares its agent side: a participant read anyone may take, and a private pin an agent may take)\n * @group Display\n * @see https://ui.ouroboros.bot/docs/media-tile\n *\n * @example\n * <MediaTile name=\"Mara Lind\" speaking={isSpeaking} muted={isMuted} avatar={{ src: photoUrl }} onVisibilityChange={subscribe}>\n *   <video ref={attachStream} autoPlay playsInline muted />\n * </MediaTile>\n * <MediaTile name=\"Theo Okafor\" source=\"screen\" presenting ring={false}>\n *   <video ref={attachShare} autoPlay playsInline muted />\n * </MediaTile>\n */\nexport function MediaTile(props: MediaTileProps): JSX.Element {\n  const {\n    name,\n    children,\n    cameraOn: cameraOnProp,\n    source: sourceProp = \"camera\",\n    fit: fitProp,\n    avatar,\n    muted = false,\n    handRaised = false,\n    connection: connectionProp = \"good\",\n    paused,\n    speaking = false,\n    hysteresis,\n    ring = true,\n    pinned = false,\n    onPinnedChange,\n    presenting = false,\n    actions,\n    onVisibilityChange,\n    labels: labelsProp,\n    className,\n    ref,\n    // Guard props (hint types), dropped here so they never reach the DOM.\n    level,\n    isMuted,\n    label,\n    objectFit,\n    src,\n    ...rest\n  } = props;\n  const labels = { ...defaultLabels, ...labelsProp };\n  // A source, fit or connection that is not one of MediaTile's (a type error) warns and renders the default.\n  const source = oneOf(sources, sourceProp) ?? \"camera\";\n  const defaultFit = source === \"screen\" ? \"contain\" : \"cover\";\n  const fit = oneOf([\"cover\", \"contain\"] as const, fitProp) ?? defaultFit;\n  const connection = oneOf(connections, connectionProp) ?? \"good\";\n  const onDelay = millisecondsOf(hysteresis?.on);\n  const offDelay = millisecondsOf(hysteresis?.off);\n  const speakingShown = useHeld(Boolean(speaking), onDelay ?? HYSTERESIS_DEFAULT.on, offDelay ?? HYSTERESIS_DEFAULT.off);\n  const hasMedia = children !== undefined && children !== null && children !== false;\n  const cameraOn = cameraOnProp ?? hasMedia;\n  const pausedWords = paused ? (typeof paused === \"string\" ? paused : labels.paused) : undefined;\n  const picture = hasMedia && (source === \"screen\" || cameraOn) && pausedWords === undefined;\n  const tile = useRef<HTMLDivElement>(null);\n  const nameRef = useRef<HTMLSpanElement>(null);\n  const mergedRef = useMergedRef(ref, tile);\n  const { photoSize, truncated } = useTileObservers(tile, nameRef, onVisibilityChange, name, presenting);\n  useAppearanceClassNameCheck(\n    \"MediaTile\",\n    className,\n    process.env.NODE_ENV !== \"production\"\n      ? \"MediaTile draws its own surface; set --ouro-media-tile-ring for the ring's colour, or wrap the tile in an element of your own\"\n      : // Stryker disable next-line StringLiteral: production only; the check never runs there.\n        /* istanbul ignore next @preserve -- production only */ \"\",\n  );\n  useDevWarnings(\n    \"MediaTile\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          !name && [\"name is empty, so screen readers hear no one\", '<MediaTile name=\"Mara Lind\">'],\n          source !== sourceProp && [`source=\"${String(sourceProp)}\" is not a source; use \"camera\", \"screen\"`, '<MediaTile source=\"screen\">'],\n          fitProp !== undefined && fit !== fitProp && [`fit=\"${String(fitProp)}\" is not a fit; use \"cover\", \"contain\"`, `<MediaTile fit=\"${defaultFit}\">`],\n          connection !== connectionProp && [`connection=\"${String(connectionProp)}\" is not a connection; use \"good\", \"fair\", \"poor\"`, '<MediaTile connection=\"poor\">'],\n          ((hysteresis?.on !== undefined && onDelay === undefined) || (hysteresis?.off !== undefined && offDelay === undefined)) && [\n            \"hysteresis takes milliseconds from 0\",\n            \"<MediaTile hysteresis={{ on: 300, off: 600 }}>\",\n          ],\n          typeof speaking !== \"boolean\" && [\"speaking is on or off, not a level\", \"<MediaTile speaking={level > 0.1}>\"],\n          level !== undefined && [\"level is not a prop; speaking is on or off\", \"<MediaTile speaking={level > 0.1}>\"],\n          isMuted !== undefined && [\"isMuted is not a prop\", \"<MediaTile muted>\"],\n          label !== undefined && [\"label is not a prop; the name names the tile\", `<MediaTile name=\"${String(label)}\">`],\n          objectFit !== undefined && [\"objectFit is not a prop\", `<MediaTile fit=\"${String(objectFit)}\">`],\n          src !== undefined && [\"src is not a prop; pass the picture as children, and the photo as avatar\", `<MediaTile avatar={{ src: \"${String(src)}\" }}>`],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n  const sentence = sentenceFor(\n    { name, presenting, speaking: speakingShown, muted, source, cameraOn, paused: pausedWords, handRaised, connection, pinned },\n    labels,\n  );\n  const shownSize = avatar?.size ?? photoSize;\n  const status = handRaised || connection === \"poor\";\n  const controls = onPinnedChange !== undefined || (actions !== undefined && actions !== null && actions !== false);\n  return (\n    <div\n      {...rest}\n      ref={mergedRef}\n      role=\"group\"\n      aria-label={sentence}\n      data-ouro=\"media-tile\"\n      data-source={source}\n      data-fit={fit}\n      data-connection={connection}\n      data-picture={picture ? \"\" : undefined}\n      data-speaking={speakingShown ? \"\" : undefined}\n      className={cn(tileClass, className)}\n    >\n      <div aria-hidden=\"true\" data-ouro-media-tile-media=\"\" className={cn(mediaClass, fitClasses[fit], !picture && \"invisible\")}>\n        {children}\n      </div>\n      {!picture && (\n        <div aria-hidden=\"true\" data-ouro-media-tile-photo=\"\" className=\"absolute inset-0 grid place-items-center\">\n          <span className=\"relative inline-flex\">\n            <Avatar {...avatar} name={name} alt=\"\" size={shownSize} />\n            {pausedWords !== undefined && (\n              <span\n                data-ouro-media-tile-paused=\"\"\n                title={upperFirst(pausedWords)}\n                className={cn(\n                  plateClass,\n                  \"absolute flex size-7 items-center justify-center [--corner-shape:round] [corner-shape:round] rounded-full\",\n                  // On a photo of 48px or less the glyph would cover the initials, so it sits beside the photo.\n                  smallPhotos.includes(shownSize) ? \"start-full bottom-0 ms-1\" : \"-end-1.5 -bottom-1.5\",\n                )}\n              >\n                <PauseGlyph />\n              </span>\n            )}\n          </span>\n        </div>\n      )}\n      {status && (\n        <div aria-hidden=\"true\" data-ouro-media-tile-status=\"\" className=\"absolute start-2 top-2 z-20 flex gap-1\">\n          {handRaised && (\n            <span data-ouro-media-tile-hand=\"\" title={upperFirst(labels.handRaised)} className={cn(plateClass, \"flex size-7 items-center justify-center rounded-ouro-md\")}>\n              <HandGlyph />\n            </span>\n          )}\n          {connection === \"poor\" && (\n            <span\n              data-ouro-media-tile-connection=\"\"\n              title={upperFirst(labels.poorConnection)}\n              className={cn(plateClass, \"flex size-7 items-center justify-center rounded-ouro-md text-[color-mix(in_oklab,var(--warning)_70%,var(--foreground))]\")}\n            >\n              <SignalGlyph />\n            </span>\n          )}\n        </div>\n      )}\n      <div\n        aria-hidden=\"true\"\n        data-ouro-media-tile-plate=\"\"\n        className={cn(\n          plateClass,\n          \"absolute start-2 bottom-2 z-20 flex max-w-[calc(100%-1rem)] items-center gap-1 rounded-ouro-md px-1.5 py-0.5 text-xs leading-5 font-medium @2xs/tile:text-sm\",\n        )}\n      >\n        {muted && (\n          <span data-ouro-media-tile-muted=\"\" title={upperFirst(labels.muted)} className=\"text-[color-mix(in_oklab,var(--destructive)_75%,var(--foreground))]\">\n            <MicOffGlyph />\n          </span>\n        )}\n        <span ref={nameRef} data-ouro-media-tile-name=\"\" title={truncated ? name : undefined} className=\"min-w-0 truncate\">\n          {name}\n        </span>\n        {presenting && (\n          <span data-ouro-media-tile-presenting=\"\" className=\"shrink-0 text-[color-mix(in_oklab,var(--muted-foreground)_70%,var(--foreground))]\">\n            · {upperFirst(labels.presenting)}\n          </span>\n        )}\n        {pinned && onPinnedChange === undefined && (\n          <span data-ouro-media-tile-pinned=\"\" title={upperFirst(labels.pinned)}>\n            <PinGlyph />\n          </span>\n        )}\n      </div>\n      {controls && (\n        <div data-ouro-media-tile-controls=\"\" data-pinned={pinned ? \"\" : undefined} className={cn(plateClass, controlsClass)}>\n          {onPinnedChange !== undefined && (\n            <Toggle\n              data-ouro-control=\"media-tile\"\n              data-ouro-part=\"pin\"\n              data-ax-action=\"pin\"\n              title={labels.pin}\n              label={labels.pin}\n              icon={PinGlyph}\n              hideLabel\n              size=\"sm\"\n              pressed={pinned}\n              onPressedChange={onPinnedChange}\n            />\n          )}\n          {actions}\n        </div>\n      )}\n      {ring && <span aria-hidden=\"true\" data-ouro-part=\"ring\" data-highlighted={speakingShown ? \"\" : undefined} className={ringClass} />}\n    </div>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/media-tile/media-tile.tsx"
    }
  ],
  "docs": "A tile for one live picture in a call: a person's camera, their photo when the camera is off, or a shared screen. Import: import { MediaTile } from \"@/components/ouro/media-tile/media-tile\", with @/components replaced by your components alias (aliases.components in components.json, such as ~/components). Also installed: avatar, ax-component, ax-effects, skeleton, toggle, the helpers they import in lib/ouro. Needs ouro-base in your stylesheet: add that item once per app, from the same place as this one, if you have not. Docs: https://ui.ouroboros.bot/docs/media-tile.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}